// ESAF : Euso Simulation and Analysis Framework // $Id: EBunchPhotons.hh,v 1.18 2005/01/24 13:30:05 moreggia Exp $ // A.Thea created Jun, 13 2004 #ifndef __EBUNCHPHOTONS_HH_ #define __EBUNCHPHOTONS_HH_ #include "TObject.h" #include "TRefArray.h" #include "TVector3.h" #include "EFillable.hh" #include "ESinglePhoton.hh" class EBunchPhotons : public TObject { public: // ctor EBunchPhotons(); EBunchPhotons( const EBunchPhotons& ); // dtor virtual ~EBunchPhotons(); virtual void Copy( TObject& ) const; virtual void Clear(Option_t* ="" ); //inline ESinglePhoton *GetSingle(Int_t i) const; inline void AddSingle( ESinglePhoton* ); // getters inline UChar_t GetType() const {return fType;} inline UInt_t GetId() const {return fId;} inline Float_t GetDatei() const {return fDatei;} inline Float_t GetDatef() const {return fDatef;} inline TVector3 GetShowerPosi() const; inline TVector3 GetShowerPosf() const; inline TVector3 GetFinalPos() const; inline Bool_t GetFlagDir() const {return fFlagDir;} inline Float_t GetMeanDirTheta() const {return fMeanDirTheta;} inline Float_t GetMeanDirPhi() const {return fMeanDirPhi;} inline Float_t GetWeight() const {return fWeight;} inline Float_t GetYield() const {return fYield;} inline Int_t GetNumWavelengths() const {return fNumWavelengths;} inline const Float_t* GetTable(char*) const; inline UChar_t GetFate() const {return fFate;} inline Int_t GetNumSingles() const {return fNumSingles;} inline Int_t GetNumDir() const {return fNumDir;} inline Int_t GetNumBack() const {return fNumBack;} inline Int_t GetNumRef() const {return fNumRef;} //setters inline void SetType ( UInt_t type ) { fType = type; } inline void SetId(UInt_t id) {fId = id;} inline void SetDatei( Float_t date) { fDatei = date; } inline void SetDatef( Float_t date) { fDatef = date; } inline void SetShowerPosi( const TVector3& v ); inline void SetShowerPosf( const TVector3& v ); inline void SetFinalPos( const TVector3& v ); inline void SetWeight( Float_t w) { fWeight = w; } inline void SetYield( Float_t y) { fYield = y; } inline void SetFate(UChar_t f) {fFate = f;} inline void SetFlagDir( Bool_t iso ) { fFlagDir = iso; } inline void SetMeanDirTheta( Float_t theta ) { fMeanDirTheta = theta; } inline void SetMeanDirPhi( Float_t phi ) { fMeanDirPhi = phi; } void SetSpectrum ( Int_t n, const Float_t* lambda, const Float_t* weight ); private: UChar_t fType; // Bunch Type UInt_t fId; // bunch identity Float_t fDatei; // date of creation of the first point Float_t fDatef; // date of creation of the last point Float_t fShowerPosiX,fShowerPosiY,fShowerPosiZ; // first point of the bunch at creation Float_t fShowerPosfX,fShowerPosfY,fShowerPosfZ; // last point of the bunch at creation Float_t fFinalPosX,fFinalPosY,fFinalPosZ; // where bunch is dead Bool_t fFlagDir; // false if bunch isotropic Float_t fMeanDirTheta,fMeanDirPhi; // mean direction (theta, phi) Float_t fWeight; // bunch weight Float_t fYield; // yield associated with this bunch Int_t fNumWavelengths; // nb of bins in the following spectra Float_t *fWlLambda; // [fNumWavelengths] array of wavelength (for spectrum X-axis) -> fNumWavelengths values Float_t *fWlWeight; // [fNumWavelengths] number of photons at bunch creation UChar_t fFate; // fate of the bunch (where it dies in the code) // 0 : initialization value // 1 : not propagated -> because fluo bunch // 2 : not propagated -> because too small weight // 3 : not propagated -> because created underground // 4 : propagated -> has reached ground // 5 : propagated -> til out of FoV Int_t fNumSingles; // number of singles from this bunch Int_t fNumDir; // number of singles directly in Euso solid angle Int_t fNumBack; // number of singles backscattered in Euso solid angle Int_t fNumRef; // number of singles reflected on ground //TOFIX: put in commentary everywhere.. TRefArray *fSingles; // reference to th singles coming from this bunch //TOFIX not used yet SetEVisitable() ClassDef(EBunchPhotons,1) }; inline TVector3 EBunchPhotons::GetShowerPosi() const { TVector3 rtn(fShowerPosiX,fShowerPosiY,fShowerPosiZ); return rtn; } inline TVector3 EBunchPhotons::GetShowerPosf() const { TVector3 rtn(fShowerPosfX,fShowerPosfY,fShowerPosfZ); return rtn; } inline TVector3 EBunchPhotons::GetFinalPos() const { TVector3 rtn(fFinalPosX,fFinalPosY,fFinalPosZ); return rtn; } inline const Float_t* EBunchPhotons::GetTable(char* s) const { Float_t* rtn = 0; if(strncmp(s,"lambda",6) == 0) rtn = fWlLambda; else if(strncmp(s,"weight",6) == 0) rtn = fWlWeight; else Fatal("GetTable(char*)","wrong type of table required"); return rtn; } //inline ESinglePhoton *EBunchPhotons::GetSingle(Int_t i) const { // return (ESinglePhoton*) fSingles->At(i); //} inline void EBunchPhotons::AddSingle( ESinglePhoton* ph ) { fNumSingles++; //fSingles->Add( ph ); } inline void EBunchPhotons::SetShowerPosi( const TVector3& v ){ fShowerPosiX = v.X(); fShowerPosiY = v.Y(); fShowerPosiZ = v.Z(); } inline void EBunchPhotons::SetShowerPosf( const TVector3& v ){ fShowerPosfX = v.X(); fShowerPosfY = v.Y(); fShowerPosfZ = v.Z(); } inline void EBunchPhotons::SetFinalPos( const TVector3& v ){ fFinalPosX = v.X(); fFinalPosY = v.Y(); fFinalPosZ = v.Z(); } #endif /* __EBUNCHPHOTONS_HH_ */