// $Id: ETreePainter.hh,v 1.12 2005/09/22 16:17:40 moreggia Exp $ // Author: Anne Stutz 2005/03/03 /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: ETreePainter * * Package: * * Coordinator: * * * *****************************************************************************/ #ifndef __ETREEPAINTER_HH__ #define __ETREEPAINTER_HH__ //#include "euso.hh" #include #include #include class TGeoManager; class TGeoVolume; class TGeoMedium; class TTree; class TChain; class EAtmosphere; class ETruth; class EShower; class EAtmosphereHistoPainter; class EEvent; class TH1F; class TCut; //////////////////////////////////////////////////////////////////////////////// // // ETreePainter // // // * This class is responsible for reading events from the euso simulation tree // * and doing its graphycal representation. // * It can draw the EUSO Field of View, displays 3D tracks, // * draw histos from Truth with Energy,Theta, Phi, X1 // * draw histograms for photons in atmosphere // * draw histograms for photons on pupil // * fill a simple tree with fundamental parameters //////////////////////////////////////////////////////////////////////////////// class ETreePainter : public TObject { public: ETreePainter( TTree* ); ETreePainter( TChain* ); virtual ~ETreePainter(); void Build(); void SetBranchesStatus( TTree* ); void BuildTree(); // Build fStree // methods getting some info generated from simu data histos TH1F* BuildAltHisto( Option_t *opt ); TH1F* BuildLongitudinalHisto( Option_t *opt ); TH1F* BuildTofHisto( Option_t *opt ); TH1F* BuildWlHisto( Option_t *opt ); void FillTrack(); // Fill fTrack Data Member void FillTree(); // Fills the simple tree // Prepare and draw the histogramms void PrepareHistos(Option_t *,TCut& drawcut,Option_t * opt,Float_t min,Float_t max,UInt_t Nbins); void DrawHistos(Option_t *,TCut& drawcut,Option_t * opt="",Float_t min=0.,Float_t max=0.,UInt_t Nbins=0); inline TVector3 EUSO() const {return fEUSO;} inline Double_t DetectorRadius() const {return fRadius;} // for shower drawings //void AddShower(); // Adds new shower read from the file //void BuildWorld(); // Build the geometry // virtual void Draw( Option_t * =""); //inline Bool_t IsWorldBuilt() {return fWorldBuild;} // Checks if the geometry is built private: TVector3 fEUSO; // detector position Double_t fRadius; // pupil radius Double_t fGTU; // GTU length TChain *fChain; // Pointer for the euso tree chain to read from TTree *fTree; // Pointer for the euso tree to read from EEvent *fEv; // Current Euso Event EShower *fShower; // shower simu data EAtmosphere *fAtmo; // atmosphere simu data ETruth *fTruth; // simu truth Int_t fEvTot; // Total number of events in the fTree TTree *fStree; // resulting tree // define a stucture to fill fStree typedef struct { // Truth Float_t fEnergy; Float_t fTheta; Float_t fPhi; Float_t fH1; // first interaction point Float_t fInitPosX; Float_t fInitPosY; Float_t fInitPosZ; Float_t fX1; Float_t fTrueImpactX; // shower impact and maximum Float_t fTrueImpactY; Float_t fTrueImpactZ; Float_t fTrueMaxPosX; Float_t fTrueMaxPosY; Float_t fTrueMaxPosZ; Float_t fTrueHmax; Float_t fTrueXmax; Float_t fTrueDmax; // (km) shower max distance from detector // atmosphere conditions Float_t fLatitude; // geodetic latitude [from -90 (south) to 90 (north)] Float_t fLongitude; // geodetic longitude [from 0 to 360 (east)] Float_t fDate; // event date [in sec UT, from 1st Jan 00:00:00] (year not taken into account) Float_t fHclouds; // clouds top altitude (km) Float_t fCloudsThick; // vertical thickness (km) Float_t fCloudsOD; // vertical Optical Depth // Electrons from shower Float_t fNe; // longitudinal profile integration (in g/cm2) Float_t fNe2; // integrated until max only (in g/cm2) Float_t fNemax; // max of electrons longitudinal profile Float_t fXmaxshow; // Xmax from electrons profile fit (in g/cm2) Float_t fHmaxshow; // Xmax from electrons profile fit (in g/cm2) Float_t fWidthshow; // width (at half max) of electrons profile (in km) Float_t fWidth2show; // width (at half max) of _the first half_ of electrons profile (in km) // Photons at creation Float_t fNph_f; // total fluo created Float_t fNph_c; // total ckov created Float_t fNph2_f; // integrated until maximum only Float_t fNph2_c; // integrated until max only Float_t fNmax_f; // in cm2/g (i.e. per grammage binlength) Float_t fNmax_f_L; // in 1/km (i.e. per track binlength) Float_t fNmax_c; // in cm2/g (i.e. per grammage binlength) Float_t fHmax_f; // fluo max local height (km) Float_t fHmax_c; // ckov max local height (km) Float_t fWidth_f; // width (at half max) of longitudinal fluo profile (in km) Float_t fWidth2_f; // width (at half max) of _the first half_ of longitudinal fluo profile (in km) Float_t fXmaxph_f; // Xmax for fluo (g/cm2) Float_t fXmaxph_c; // Xmax for ckov (g/cm2) Float_t fYieldmean; // (per meter, per electron) mean fluo yield, averaged along the track Float_t fYieldHmax; // (per meter, per electron) fluo yield at shower max Float_t fWlmean_f; // in nm Float_t fWlmean_c; // ... Float_t fWlmean_tot; // ... // Photons on pupil // Nph Float_t fCkovInOmega; // ckov within solid angle Float_t fFluoInOmega; // fluo within solid angle Float_t fNph_f_p; // total fluo on pupil Float_t fNph_cdirect_p; // total direct ckov on pupil Float_t fNph2_f_p; // fluo on pupil integrated until Tmax Float_t fNph_airscat_p; // air scattered ckov on pupil Float_t fNph_cloudscat_p; // clouds scattered ckov on pupil Float_t fNph_cr_p; // reflected ckov on pupil // Nmax Float_t fNmax_f_p_raw; // per GTU - fluo, without any fit Float_t fNmax_f_p; // per GTU - fluo, with fit Float_t fNmax_f2_p; // per GTU : after ckov "substraction", i.e. with two fits Float_t fNmax_tot_p_raw; // per GTU -- with air scat ckov, without any fit Float_t fNmax_tot_p; // per GTU -- with air scat ckov, with fit Float_t fNmax_cr_p; // per GTU - reflected ckov Float_t fNmax_crtot_p; // per GTU - reflected + scattered ckov IN THE BIN Float_t fWidth_f2_p; // (in GTU) SIGMA of gaussian fit : HALF Width of fluo profile on pupil, after ckov "substraction" Float_t fWidth_f_p; // (in GTU) SIGMA of gaussian fit : HALF Width of fluo profile on pupil Float_t fWidth_tot_p; // (in GTU) SIGMA of gaussian fit : HALF Width of (fluo+scattered photons) profile on pupil // miscellaneous Float_t fYieldGTUmax; // (per meter, per electron) fluo yield (averaged if sev. bunches (fNbBunches) contribute to GTUmax) Int_t fNbBunches; // associated with above data (nb of bunches within GTUmax) Float_t fXGTUmax; // (g/cm2) GTU max corresponding position along track (averaged if sev. bunches (fNbBunches) contribute to GTUmax) Float_t fXGTUmax_tot; // (g/cm2) same as here above, but on (FLUO + CKOV backscattering) profile Float_t fTransGTUmax; // ratio (photons_on_pupil / photons_in_omega) #FLUO# bunch at XGTUmax Float_t fTransMax; // ratio (photons_on_pupil / photons_in_omega) #FLUO# bunch at Xmax_fluo Float_t fWlmean_f_p; // in nm Float_t fWlmean_cb_p; // ... Float_t fWlmean_cr_p; // ... Float_t fWlmean_tot_p; // ... } Track; Track fTrack; // for shower drawings //Bool_t fWorldBuild; // true if the geometry is build, false othewise //TGeoVolume *fTop; // TOP Volume of the global geometry //TGeoVolume *fFoVVolume; // Geometry realization of the Field of View of EUSO //TGeoMedium *fVacuum; // Geometry Medium //Int_t fCurrentTrack; // index of the current track read from fTree ClassDef(ETreePainter,0) }; #endif /* __ETREEPAINTER_HH__ */