00001 #ifndef IMPL_CLUSTERIMPL_H 00002 #define IMPL_CLUSTERIMPL_H 1 00003 00004 00005 #include "EVENT/Cluster.h" 00006 #include "AccessChecked.h" 00007 #include <map> 00008 #include <bitset> 00009 00010 #define NERRPOS 6 00011 #define NERRDIR 3 00012 00013 #define NSHAPE_OLD 6 00014 00015 namespace IMPL { 00016 00017 00024 class ClusterImpl : public EVENT::Cluster, public AccessChecked { 00025 00026 public: 00027 00030 ClusterImpl() ; 00031 00033 virtual ~ClusterImpl() ; 00034 00035 virtual int id() const { return simpleUID() ; } 00036 00041 virtual int getType() const ; 00042 00045 virtual float getEnergy() const ; 00046 00049 virtual float getEnergyError() const ; 00050 00053 virtual const float* getPosition() const ; 00054 00057 virtual const EVENT::FloatVec & getPositionError() const ; 00058 00061 virtual float getITheta() const ; 00062 00065 virtual float getIPhi() const ; 00066 00069 virtual const EVENT::FloatVec & getDirectionError() const ; 00070 00074 virtual const EVENT::FloatVec & getShape() const ; 00075 00076 // /** Type hypotheses: 3 Parameters: compatible with EM, HAD, muon cluster 00077 // */ 00078 // virtual const EVENT::FloatVec & getParticleType() const ; 00079 00080 00084 virtual const EVENT::ParticleIDVec & getParticleIDs() const ; 00085 00086 00089 virtual const EVENT::ClusterVec & getClusters() const ; 00090 00091 00094 virtual const EVENT::CalorimeterHitVec & getCalorimeterHits() const ; 00095 00099 virtual const EVENT::FloatVec & getHitContributions() const ; 00100 00101 00109 virtual const EVENT::FloatVec & getSubdetectorEnergies() const ; 00110 00111 //setters 00112 void setTypeBit( int index , bool val=true) ; 00113 void setEnergy(float energy ) ; 00114 void setEnergyError(float energyError ) ; 00115 void setPosition(const float* position) ; 00116 void setPositionError(const EVENT::FloatVec &errpos) ; 00117 void setPositionError(const float* errpos) ; 00118 void setITheta(float theta) ; 00119 void setIPhi(float phi) ; 00120 void setDirectionError(const EVENT::FloatVec &errdir) ; 00121 void setDirectionError(const float* errdir) ; 00122 // void setShape(const float* shape) ; 00123 void setShape(const EVENT::FloatVec &shape) ; 00124 00125 void addParticleID( EVENT::ParticleID* pid ) ; 00126 00127 // void setEMWeight(float emWeight ) ; 00128 // void setHADWeight(float hadWeight ) ; 00129 // void setMuonWeight(float muonWeight ) ; 00130 00131 void addCluster(EVENT::Cluster* cluster) ; 00132 void addHit(EVENT::CalorimeterHit* hit , float contribution) ; 00133 00134 00141 EVENT::FloatVec& subdetectorEnergies() ; 00142 00143 protected: 00144 void setType(int type ) ; 00145 00146 std::bitset<32> _type{0} ; 00147 float _energy{0} ; 00148 float _energyError{0} ; 00149 float _position[3]={0,0,0} ; 00150 EVENT::FloatVec _errpos ; 00151 float _theta{0}; 00152 float _phi{0} ; 00153 EVENT::FloatVec _errdir ; 00154 EVENT::FloatVec _shape{} ; 00155 EVENT::ParticleIDVec _pid{} ; 00156 EVENT::ClusterVec _clusters{} ; 00157 EVENT::CalorimeterHitVec _hits{} ; 00158 EVENT::FloatVec _weights{} ; 00159 EVENT::FloatVec _subdetectorEnergies{} ; 00160 00161 }; // class 00162 00163 } // namespace IMPL 00164 #endif /* ifndef IMPL_CLUSTERIMLP_H */