// ESAF : Euso Simulation and Analysis Framework // $Id: EnergyModule.hh,v 1.10 2005/03/30 09:19:53 naumov Exp $ // Naumov Dmitry created Jul, 4 2004 #ifndef __ENERGYMODULE_HH_ #define __ENERGYMODULE_HH_ /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: EnergyModule * * Package: energy * * Coordinator: Dmitry.Naumov * * * *****************************************************************************/ #include "euso.hh" #include "RecoModule.hh" #include "EarthVector.hh" class RecoEvent; class FluoCalculator; class RadiativeProcessesCalculator; class EOpticsResponse; class TH1F; class TSeqCollection; class ShowerTrack; class ERunParameters; class EsafSpectrum; class RecoPixelData; class TPolyLine; class TCanvas; class TGraphErrors; class TGraph; class TSpline3; class TF1; class SlastShowerGenerator; using std::map; using std::vector; enum RecoPixelId {kUnknownPixel = -1}; typedef vector Pixels_t; typedef vector PMTs_t; typedef map GtuPixels_t; typedef map PixelWeight_t; // map for PixelId and efficacy integrated in pixel typedef map TimeMap_t; // for each time moment map PixelWeight_t ////////////////////////////////////////////////////////////////////////////// // // // EnergyModule // // // // // ////////////////////////////////////////////////////////////////////////////// struct EnergyModuleData : public TObject { // container of the data used by the TMinuit fit void Clear(); Float_t fQuantumEff; Float_t fAttenuation; Float_t fYield; Float_t fShowerLength; Float_t fRmax; TSpline3 *fRecovery; TGraphErrors *fPhotoElectrons; // Distribution of p.e. versus time TGraphErrors *fMyPhotoElectrons; // Distribution of p.e. versus time TSpline3 *fPsfIdeal; TH1F *fFlux; // Flux on EP by 10**21 eV Shower and reconstructed Theta and Phi ClassDef(EnergyModuleData,0) }; class EnergyModule : public RecoModule { public: // ctor EnergyModule(); // dtor virtual ~EnergyModule(); // Init method: called at the beginning of a run Bool_t Init(); // called before each event process Bool_t PreProcess(); // event processing Bool_t Process( RecoEvent* ); // called after processing an event Bool_t PostProcess(); // save root output virtual Bool_t SaveRootData( RecoRootEvent* ); // called at the end of each run Bool_t Done(); // memory clean void UserMemoryClean(); // workers void LoadModules(); // prepares map void SortGtu(); // dump gtu sorted information for DEBUG void DumpGtuSorted(); // build ThetaFoV() and PhiFoV() functions void BuildFoVAngleFunctions(); // ThetaFoV(Float_t time) Float_t ThetaFoV(Float_t); // PhiFoV(Float_t time) Float_t PhiFoV(Float_t); // computes fluorescence yield for the reconstructed altitude Float_t MakeFluorYield(); // define which pixels to view and consider void DefinePixelsView(); // prepare list of pmt and pixels to draw and draw them void DisplayCluster(); // Clear graphs void ClearGraphs(); // Create temp objects (histos, graphs, etc) void CreateAuxilaryObjects(); // Build Recovery Function along the track Bool_t BuildRecoveryFunction(); // Fit Time Distribution void FitTimeDistribution(); // Mode 1 for Time distribution fit void FitMode1(); // Mode 2 for Time distribution fit void FitMode2(); // Mode 2 for Time distribution fit void FitMode2fumili(); // Save Fit Info void SaveFitInfo(); // Reconstruct 3D Shower track Bool_t ShowerTrack3D(); // Find Theta and Phi for the Maximum number of p.e. observed (may be different fro real shower maximum) void FindThetaPhiAtMaximum(); // Fill data needed for the TMinuit fit void FillDataStructure(); // Estimate background p.e. per pixel per GTU from the data void EstimateBackground(); EsafConfigClass(Reco, EnergyModule) private: // calculators and so variables FluoCalculator *fFluoCalculator; // Fluorescent calculator RadiativeProcessesCalculator *fRadCalculator; // Radiative Transfer Calculator EOpticsResponse *fOpticsResponse; // Optics Response object (handles efficacies, etc) RecoEvent *fEvent; // pointer to the current reco event object ERunParameters *fRunpars; // ERunParameters ShowerTrack *fShowerTrack; // pointer to a dummy shower track object EsafSpectrum *fEsafSpectrum; // pointer to EsafSpectrum object // information from revious modules const RecoModuleData *fTDM; // pointer to the track direction module const RecoModuleData *fGtuCM; // pointer to the GTU Clustering module const RecoModuleData *fHmaxShapeM; // pointer to HmaxByShapeMethod module const RecoModuleData *fHmaxProtonM; // pointer to HmaxForProtonMethod module Int_t fNumPoints; Pixels_t fPixelsCluster; // vector of Uid of pixels in the cluster vector fAllActivePixels;// vector of all active pixels Double_t fTheta; // reconstrustructed from the previous module Theta zenith angle Double_t fPhi; // reconstrustructed from the previous module Phi azimuthal angle TVector3 fShowerDir; // unit vector opposite to shower direction Double_t fAltitude; // reconstructed altitude of shower maximum Float_t fGtuMin; // minimum Gtu in the selected cluster Float_t fGtuMax; // maximum Gtu in the selected cluster // configuration data Float_t fQuantumEff; // PMT quantum efficiency Float_t fEusoAlt; // Euso Altitude Float_t fEusoRadius; // Euso Radius Int_t fMinuitOutputLevel; // see EnergyModule.cfg for explanations Int_t fViewThreshold; // Threshold to visualize the event Int_t fThreshold; // minimum number of p.e. per pixel per GTU Int_t fFitMode; // see EnergyModule.cfg file for explanations // computed information Float_t fTotalYield; // estimated fluorescence yield Double_t fEnergy; // reconstructed energy Double_t fEnergyError; // reconstructed energy error Double_t fEnergyChi2; // Chi2/NDF for energy fit Double_t fFluorMaxPe; // Fitted Number of p.e. in fluorescence maximum Double_t fDeltaL; // track length corresponding to one GTU Int_t fGtuAtMax; // Gtu Hit corresponding to Shower Maximum Float_t fGtuTimeAtMax; // Time at the Shower Maximum (may be different from fGtuMax) Float_t fThetaFoVAtMax; // Theta FoV at Shower Maximum Float_t fPhiFoVAtMax; // Phi FoV at Shower Maximum Float_t fMeanAttenuation;// Mean Attenuation from the shower maximum Float_t fMeanLambdaOnEntrancePupil; // Float_t fRmax; // Distance between shower maximum and EUSO Float_t fBackground; // Estimated background of p.e. per pixel per GTU EarthVector fMaxPos; // Estimated Vector of shower Maximum position // auxilary data SlastShowerGenerator *fShowerGenerator;// ShowerGenerator TH1F *fEPspectrum; // Histo with Entrance Pupil spectrum TH1F *fEPphotons; // Histo with Entrance Pupil photons map fPmtLines; map fPixelLines; GtuPixels_t fGtuPixels; // map with vector of pixels for each Gtu hit belonging to the cluster GtuPixels_t fGtuMyPixels; // map with vector of pixels for each Gtu hit belonging to my cluster string fSaveEps; // yes/no save or not eps files string fEnergyDistributionName; // name of energy distribution // Event Viewer data TCanvas *fCanvas; // Canvas used for all debugging plots TGraphErrors *fGraphTheta; // ThetaFoV graph for the pixels in cluster TGraphErrors *fGraphPhi; // ThetaFoV graph for the pixels in cluster TGraphErrors *fGraphXY; // ThetaFoV graph for the pixels in cluster TGraphErrors *fPhotoElectrons;// Distribution of p.e. versus time TGraphErrors *fMyPhotoElectrons;// Distribution of p.e. versus time TGraph *fPsfOverlap; // efficacy overlap with pixels in cluster TGraph *fPsfIdealOverlap; // efficacy overlap with focal surface in cluster TGraph *fBgGraph; // background vs GTU TSpline3 *fRecovery; // spline for the recovery function TSpline3 *fEffIdeal; // spline for the recovery function Float_t fXmin; // Minimum X of View Float_t fXmax; // Maximum X of View Float_t fYmin; // Minimum Y of View Float_t fYmax; // Maximum Y of View EnergyModuleData fData; // container with needed data to make TMinuit fit ClassDef(EnergyModule,0) }; #endif /* __ENERGYMODULE_HH_ */