4 #include "EVENT/LCIO.h"
10 #include <sio/io_device.h>
11 #include <sio/version.h>
26 SIO_DATA( device , &type , 1 ) ;
28 SIO_DATA( device , &(cluster->
_energy) , 1 ) ;
29 if( vers > SIO_VERSION_ENCODE( 1, 51 ) ) {
32 SIO_DATA( device , cluster->
_position , 3 ) ;
34 SIO_DATA( device , &errpos[0] ,
NERRPOS ) ;
36 SIO_DATA( device , &(cluster->
_theta) , 1 ) ;
37 SIO_DATA( device , &(cluster->
_phi) , 1 ) ;
39 SIO_DATA( device , &errdir[0] ,
NERRDIR ) ;
42 if( vers > SIO_VERSION_ENCODE(1,2) ) {
43 SIO_DATA( device , &nShape , 1 ) ;
49 SIO_DATA( device , &(cluster->
_shape[0]) ,nShape ) ;
50 if( vers > SIO_VERSION_ENCODE(1,2) ) {
53 SIO_DATA( device , &nPid , 1 ) ;
54 for(
int i=0;i<nPid;i++) {
58 SIO_DATA( device , &(pid->
_type) , 1 ) ;
59 SIO_DATA( device , &(pid->
_pdg) , 1 ) ;
62 SIO_DATA( device , &nPara , 1 ) ;
64 for(
int j=0;j<nPara;j++) {
65 SIO_DATA( device , &aParameter , 1 ) ;
73 SIO_DATA( device , pType , 3 ) ;
76 SIO_DATA( device, &nClusters , 1 ) ;
80 for(
int i=0;i<nClusters;i++) {
81 SIO_PNTR( device , &(cluster->
_clusters[i] ) ) ;
85 SIO_DATA( device, &nHits , 1 ) ;
88 for(
int i=0;i<nHits;i++) {
89 SIO_PNTR( device , &(cluster->
_hits[i] ) ) ;
90 SIO_DATA( device , &(cluster->
_weights[i] ) , 1 ) ;
94 SIO_DATA( device, &nEnergies , 1 ) ;
96 for(
int i=0;i<nEnergies;i++){
100 SIO_PTAG( device , dynamic_cast<const EVENT::Cluster*>(cluster) ) ;
110 SIO_SDATA( device, cluster->
getType() ) ;
111 SIO_SDATA( device, cluster->
getEnergy() ) ;
115 for(
unsigned int i=0;i<errpos.size();i++) {
116 SIO_SDATA( device, errpos[i] ) ;
118 SIO_SDATA( device, cluster->
getITheta() ) ;
119 SIO_SDATA( device, cluster->
getIPhi() ) ;
121 for(
unsigned int i=0;i<errdir.size();i++){
122 SIO_SDATA( device, errdir[i] ) ;
125 int nshape = shape.
size() ;
126 SIO_SDATA( device, nshape ) ;
127 for(
unsigned int i=0;i<shape.size();i++){
128 SIO_SDATA( device, shape[i] ) ;
132 SIO_SDATA( device , nPid ) ;
133 for(
int i=0;i<nPid;i++) {
135 SIO_SDATA( device, pid->getLikelihood() ) ;
136 SIO_SDATA( device, pid->getType() ) ;
137 SIO_SDATA( device, pid->getPDG() ) ;
138 SIO_SDATA( device, pid->getAlgorithmType() ) ;
139 int nPara = pid->getParameters().
size() ;
140 SIO_DATA( device , &nPara , 1 ) ;
141 for(
int j=0;j<nPara;j++){
142 SIO_SDATA( device, pid->getParameters()[j] ) ;
146 int nClusters = clusters.
size() ;
147 SIO_DATA( device, &nClusters , 1 ) ;
148 for(
int i=0;i<nClusters;i++) {
149 SIO_PNTR( device , &(clusters[i]) ) ;
154 int nHits = hits.
size() ;
155 SIO_DATA( device, &nHits , 1 ) ;
156 for(
int i=0;i<nHits;i++){
157 SIO_PNTR( device , &(hits[i]) ) ;
158 SIO_SDATA( device , weights[i] ) ;
162 int nEnergies = subdetectorEnergies.
size() ;
163 SIO_SDATA( device, nEnergies ) ;
164 for(
int i=0;i<nEnergies;i++) {
165 SIO_SDATA( device, subdetectorEnergies[i] ) ;
168 SIO_PTAG( device , cluster ) ;
The generic object that is held in an LCCollection.
virtual float getITheta() const =0
Intrinsic direction of cluster at position: Theta.
EVENT::FloatVec _subdetectorEnergies
SIOClusterHandler()
Constructor.
void setPositionError(const EVENT::FloatVec &errpos)
void setDirectionError(const EVENT::FloatVec &errdir)
Adding stuff needed for io (friend declarations, etc.)
virtual const CalorimeterHitVec & getCalorimeterHits() const =0
The hits that have been combined to this cluster.
void write(sio::write_device &device, const EVENT::LCObject *obj)
Writes lcio objects to an SIO stream.
void read(sio::read_device &device, EVENT::LCObject *objP, sio::version_type vers)
Reads lcio objects from an SIO stream.
virtual const ClusterVec & getClusters() const =0
The clusters that have been combined to this cluster.
virtual const FloatVec & getHitContributions() const =0
Returns the energy contribution of the hits Runs parallel to the CalorimeterHitVec from getCalorimete...
Interface for all lcio object SIO-handlers, has to be implemented for all event entities (hits...
virtual const FloatVec & getPositionError() const =0
Covariance matrix of the position (6 Parameters)
unsigned int _flag
The collection flag.
EVENT::LCObject * create() const
Factory method to create an object of the type of the collection.
virtual float getEnergyError() const =0
Returns the error on the energy of the cluster.
void addParticleID(EVENT::ParticleID *pid)
virtual const FloatVec & getDirectionError() const =0
Covariance matrix of the direction (3 Parameters).
EVENT::CalorimeterHitVec _hits
virtual const ParticleIDVec & getParticleIDs() const =0
The particle Id's sorted by their likelihood.
Implementation of helper class to create and interpret the 32-bit flag word in LCCollections.
Adding stuff needed for io (friend declarations, etc.)
virtual const float * getPosition() const =0
Position of the cluster.
virtual int getType() const =0
Flagword that defines the type of cluster.
void addParameter(float p)
virtual const FloatVec & getSubdetectorEnergies() const =0
A vector that holds the energy observed in a particular subdetectors.
virtual float getIPhi() const =0
Intrinsic direction of cluster at position: Phi.
virtual float getEnergy() const =0
Energy of the cluster.
EVENT::ClusterVec _clusters
virtual const FloatVec & getShape() const =0
Shape parameters - check/set collection parameter ClusterShapeParameters for size and names of parame...