#ifndef WCSimWrap_h_ #define WCSimWrap_h_ #include #include #include #include #include "WCSimRootEvent.hh" #include "WCSimRootGeom.hh" const int MAXNSUBEV = 30; //< Maximum number of sub events to allow /// Singleton class to provide global access /// to the data and geometry info from WCSim input /// author: Blair Jamieson, Jan 2013 class WCSimWrap { private: WCSimWrap(); //< Constructor method for this class int ReadGeom(); //< Helper method to read geometry static WCSimWrap* staticthis; //< The instance of this class static TFile * fIn; //< Input WCSim file pointer static TTree * fTIn; //< Input WCSim data and truth TTree pointer static TTree * fTGeo; //< Input WCSim pmt Geometry TTree pointer static TTree * fTSet; //< Input Settings TTree pointer static int fNEv; //< Number of events in current file static int fCurEntry; //< Current tree entry number loaded static WCSimRootEvent *fEv; //< Pointer to current super event static int fNSubEv; //< Number of subevents in current super event /// Pointers to up to MAXNSUBEV subevents static WCSimRootTrigger *fTrig[MAXNSUBEV]; static double fTOffset[MAXNSUBEV]; static WCSimRootGeom * fGeo; //< Pointer to detector geometry // save copies of geometry here for faster access static Int_t fNPMT; //< Number of PMTs static Float_t ** fPMTpos; //< PMT position Index by [fNPMT][x,y,z] static Float_t ** fPMTdir; //< PMT normal to front face Index by [fNPMT][dx,dy,dz] static Float_t * fPMTQE; //< Relative PMT QE (~1) static Int_t * fPMTtype; //< PMT Type (0 old, 1 new, -1 missing) // static Float_t * fPMTR; //< PMT R (calculated) // static Float_t * fPMTphi; //< PMT phi angle (calculated) static Int_t * fPMTnum; //< PMT tube number static Int_t * fPMTloc; //< PMT location (endcap1, wall, endcap2) static Float_t WCXRotation[3]; static Float_t WCYRotation[3]; static Float_t WCZRotation[3]; public: /// Method to get the instance of this class /// Optionally can set the filename to try to read in static WCSimWrap* Get( char * afilename){ if (!staticthis) { std::cout<<" Initializing (w/file)..."<SetInput( afilename ); return staticthis; } static WCSimWrap* Get(){ if (!staticthis) { std::cout<<" Initializing (no file)..."< out of range 0<="<=0 && asubindex subindex out of range 0<="<GetWCCylRadius(); } /// Get cylindrical tank size (length) Float_t CylLen(){ return fGeo->GetWCCylLength(); } Float_t LocCoordOffset(int i){ return fGeo->GetWCOffset(i); } Float_t LocCoordXdir(int i){ return WCXRotation[i]; } Float_t LocCoordYdir(int i){ return WCYRotation[i]; } Float_t LocCoordZdir(int i){ return WCZRotation[i]; } /// Get PMT radius Float_t PMTRad(){ return fGeo->GetWCPMTRadius(); } /// Get PMT position for the ith PMT Float_t PMTpos(int ipmt,int ixyz){ return fPMTpos[ipmt][ixyz]; } /// Get PMT positions array Float_t ** PMTposs(){ return fPMTpos; } /// Get PMT normal to front face for ith PMT Float_t PMTdir(int ipmt, int ixyz){ return fPMTdir[ipmt][ixyz]; } /// Get PMT normal to front face array Float_t ** PMTdirs(){ return fPMTdir; } /// Get PMT relative Quantum Efficiency for ith PMT Float_t PMTQE(int ipmt){ return fPMTQE[ipmt]; } /// Get PMT QE array Float_t * PMTQEs(){ return fPMTQE; } /// Get PMT type (0 old, 1 new, -1 missing) for ith PMT Int_t PMTtype(int ipmt){ return fPMTtype[ipmt]; } /// Get PMT type array Int_t * PMTtypes(){ return fPMTtype; } // /// Get PMT R for ith PMT // Float_t PMTR(int ipmt){ return fPMTR[ipmt]; } // // /// Get PMT R array // Float_t * PMTRs(){ return fPMTR; } // // /// Get PMT phi for ith PMT // Float_t PMTphi(int ipmt){ return fPMTphi[ipmt]; } // // /// Get PMT phi array // Float_t * PMTphis(){ return fPMTphi; } /// Get PMT number for the ith PMT Float_t PMTnum(int ipmt){ return fPMTnum[ipmt]; } /// Get PMt number array Int_t * PMTnums(){ return fPMTnum; } /// Get PMT location type (endcap1, wall, endcap2) for ith PMT Int_t PMTloc(int ipmt){ return fPMTloc[ipmt]; } //// Get PMT location type array Int_t * PMTlocs(){ return fPMTloc; } }; #endif