CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/SimG4CMS/Forward/interface/CastorShowerLibrary.h

Go to the documentation of this file.
00001 #ifndef SimG4CMS_CastorShowerLibrary_h
00002 #define SimG4CMS_CastorShowerLibrary_h
00003 
00004 // File: CastorShowerLibrary.h
00005 // Description: Gets information from a shower library
00006 //              Adapted from HFShowerLibrary class
00007 //
00008 //              Wagner Carvalho (wcarvalh@cern.ch)  
00009 //
00011 
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00014 #include "SimDataFormats/CaloHit/interface/CastorShowerLibraryInfo.h"
00015 #include "SimDataFormats/CaloHit/interface/CastorShowerEvent.h"
00016 #include "DetectorDescription/Core/interface/DDsvalues.h"
00017 
00018 #include "G4ParticleTable.hh"
00019 #include "G4ThreeVector.hh"
00020  
00021 //ROOT
00022 #include "TROOT.h"
00023 #include "TFile.h"
00024 #include "TTree.h"
00025 #include "TBranchObject.h"
00026 
00027 #include <string>
00028 #include <memory>
00029 
00030 class G4Step;
00031 
00032 class CastorShowerLibrary {
00033   
00034 public:
00035   
00036   //Constructor and Destructor
00037   CastorShowerLibrary(std::string & name, edm::ParameterSet const & p);
00038   ~CastorShowerLibrary();
00039 
00040 public:
00041 
00042   void                initParticleTable(G4ParticleTable *);
00043   CastorShowerEvent   getShowerHits(G4Step*, bool&);
00044   int                 FindEnergyBin(double);
00045   int                 FindEtaBin(double);
00046   int                 FindPhiBin(double);
00047 
00048 protected:
00049 
00050   void                initFile(edm::ParameterSet const & );
00051   void                getRecord(int, int);
00052   void                loadEventInfo(TBranchObject *);
00053 // if eta or phi is not given, take into account only the binning in energy
00054   void                select(int, double,double =0,double=9);  // Replaces interpolate / extrapolate
00055   // void                interpolate(int, double);
00056   // void                extrapolate(int, double);
00057 
00058 private:
00059 
00060   TFile               *hf;                      
00061   TBranchObject       *evtInfo;                 // pointer to CastorShowerLibraryInfo-type branch 
00062   TBranchObject       *emBranch, *hadBranch;    // pointer to CastorShowerEvent-type branch
00063 
00064   // User defined classes in Root Dictionary 
00065   CastorShowerLibraryInfo  *eventInfo;
00066   CastorShowerEvent        *showerEvent;
00067 
00068   bool                verbose;
00069   unsigned int        nMomBin, totEvents, evtPerBin;
00070   
00071   std::vector<double> pmom;
00072 
00073   int                 emPDG, epPDG, gammaPDG;
00074   int                 pi0PDG, etaPDG, nuePDG, numuPDG, nutauPDG;
00075   int                 anuePDG, anumuPDG, anutauPDG, geantinoPDG;
00076   int                 mumPDG, mupPDG;
00077 // new variables (bins in eta and phi)
00078   unsigned int        nBinsE, nBinsEta, nBinsPhi;
00079   unsigned int        nEvtPerBinE, nEvtPerBinEta, nEvtPerBinPhi;
00080   std::vector<double> SLenergies;
00081   std::vector<double> SLetas;
00082   std::vector<double> SLphis;
00083 };
00084 #endif