00001 #ifndef MCINTEGRATINGHIT_H
00002 #define MCINTEGRATINGHIT_H
00003
00004 #include "TObject.h"
00005 #include "TVector.h"
00006 #include "TRefArray.h"
00007
00008 #include "commonRootData/idents/VolumeIdentifier.h"
00009 #include "McParticle.h"
00010
00011 #include <vector>
00012 #ifndef R__GLOBALSTL
00013 #ifndef WIN32
00014 using std::vector;
00015 #else
00016 using namespace std;
00017 #endif
00018 #endif
00019
00020
00078 class McIntegratingHit: public TObject {
00079
00080 public:
00081
00083 enum Particle{
00084 PRIMARY = 0,
00085 ELECTRON = 1,
00086 POSITRON = 2
00087 };
00088
00089 McIntegratingHit();
00090
00091 virtual ~McIntegratingHit();
00092
00093 void Clear(Option_t * ="");
00094 void Fake( Int_t ievent, UInt_t rank, Float_t randNum ) ;
00095 Bool_t CompareInRange( const McIntegratingHit &, const std::string & name = "" ) const ;
00096 void Print(Option_t * ="") const;
00097
00098 void initialize(const VolumeIdentifier& id);
00099
00100 const VolumeIdentifier getVolumeId() const { return m_volumeId; };
00101
00102 Double_t getTotalEnergy() const { return m_totalEnergy; };
00103
00105 void addEnergyItem( const Double_t& energy, McParticle* t, const TVector3& pos );
00106
00107 void setEnergyItems( const Double_t &totE, const Double_t *energyArr,
00108 const TVector3& moment1, const TVector3& moment2);
00109
00113 const McParticle* itemizedEnergyNext (Double_t &energy) const ;
00115 void itemizedEnergyReset() const { m_mapPtr = 0; };
00117 UInt_t itemizedEnergySize() const { return m_mcPartArr.GetEntries(); };
00118
00120 Double_t getMcParticleEnergy(Particle p) const;
00121
00123 const TVector3 getMoment1 () const;
00125 const TVector3 getMoment2 () const;
00126
00127 void* operator new(size_t size);
00128
00129 void* operator new(size_t size, void* vp);
00130
00131 McIntegratingHit& operator=(const McIntegratingHit& rhs);
00132
00133 private:
00135 Double_t m_totalEnergy;
00137 Double_t m_energyArray[3];
00139 UInt_t m_packedFlags;
00141 VolumeIdentifier m_volumeId;
00143 TVector3 m_moment1Seed;
00145 TVector3 m_moment2Seed;
00146
00148 TRefArray m_mcPartArr;
00150 vector<Double_t> m_energyPtrArr;
00151
00153
00154
00157
00158
00160 mutable UInt_t m_mapPtr;
00161
00162 ClassDef(McIntegratingHit,2)
00163 };
00164
00165 #endif