Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MadQuantities.h

Go to the documentation of this file.
00001 #ifndef madquantities_h
00002 #define madquantities_h
00003 #include <string>
00004 #include "TROOT.h"
00005 #include "TChain.h"
00006 #include "TH1.h"
00007 #include "TVector3.h"
00008 #include "Mad/MadBase.h"
00009 #include "Conventions/Detector.h"
00010 #include "Validity/VldContext.h"
00011 #include "DataUtil/EnergyCorrections.h"
00012 #include "Conventions/ReleaseType.h"
00013 
00014 
00015 class MadQuantities : public MadBase
00016 {
00017 
00018  protected:
00019 
00020   Int_t fCurStdHepEntry;
00021   Int_t fCurTruthIndex;
00022 
00023   Int_t fNumFSGeantino;
00024   Float_t fGeantinoEnergy;  
00025 
00026   Int_t fNumFSProton;
00027   Float_t fTotFSProtonEnergy;
00028   Float_t  fMaxFSProtonEnergy;
00029 
00030   Int_t fNumFSNeutron;
00031   Float_t fTotFSNeutronEnergy;
00032   Float_t  fMaxFSNeutronEnergy;
00033 
00034   Int_t fNumFSPiPlus;
00035   Float_t fTotFSPiPlusEnergy;
00036   Float_t fMaxFSPiPlusEnergy;
00037   
00038   Int_t fNumFSPiMinus;
00039   Float_t fTotFSPiMinusEnergy;
00040   Float_t fMaxFSPiMinusEnergy;
00041 
00042   Int_t fNumFSPiZero;
00043   Float_t fTotFSPiZeroEnergy;
00044   Float_t fMaxFSPiZeroEnergy;
00045 
00046   Int_t fNumFSKaon;
00047   Float_t fTotFSKaonEnergy;
00048   Float_t fMaxFSKaonEnergy;
00049   
00050   //Set up std hep info
00051   void SetStdHepVars(Int_t itr);
00052 
00053  public:
00054 
00055   MadQuantities(TChain *chainSR=0,TChain *chainMC=0,
00056                 TChain *chainTH=0,TChain *chainEM=0);
00057   MadQuantities(JobC *,string,int);
00058   ~MadQuantities();
00059 
00060 
00061   //EVENT SELECTION METHODS:
00062   Bool_t IsTrack();                 //one or more tracks present in snarl
00063   Bool_t IsSingleTrack();           //Is there one (& only one) track in snarl
00064   Bool_t PassTrackCuts(Int_t itrk); //Pass basic fit track quality cuts
00065   Bool_t PassCuts(Int_t itrk);      //Pass track quality cuts + contained vtx
00066   Bool_t PassCuts();                //For event display
00067   Bool_t IsFidVtx(Int_t itrk=0);      //is track vtx contained in fid volume
00068   Bool_t IsFidAll(Int_t itrk=0);      //is track contained in fiducial volume
00069   Bool_t IsFidVtxEvt(Int_t ievt=0);   //is event vtx contained in fid volume
00070   Bool_t IsFidVtxTrk(Int_t itrk=0);   //is track vtx contained in fid volume
00071   Bool_t IsFidAllEvt(Int_t ievt=0);   //is event contained in fiducial volume
00072 
00073   Bool_t IsFidFD_AB(Int_t ievt=0);    //Andy Blake's FD fidvol definition
00074   Bool_t IsFid_2008(Int_t ievt=0);    //Andy Blake's FD fidvol definition
00075 
00076  
00077   Float_t *CCNCSepVars(Int_t itrk=0); //return some variables 
00078                                       //useful for mu/pi separation
00079   Bool_t PassQuasiCuts(Int_t itrk=0,Float_t frac=0.1);//Pass cuts for trying to
00080                                                       //select out QE events
00081 
00082   //TRUTH INFO METHODS::
00083   Int_t INu(Int_t itr=0);        //neutrino type
00084   Int_t INuNoOsc(Int_t itr=0);        //neutrino type
00085   Int_t Flavour(Int_t itr=0);  
00086   Int_t IAction(Int_t itr=0);    //interaction type
00087   Int_t IResonance(Int_t itr=0); //QE, RES, DIS
00088   Float_t X(Int_t itr=0);
00089   Float_t Y(Int_t itr=0);
00090   Float_t Q2(Int_t itr=0);
00091   Float_t W2(Int_t itr=0);
00092   Int_t Initial_state(Int_t itr=0);
00093   Int_t Nucleus(Int_t itr=0);
00094   Int_t HadronicFinalState(Int_t itr=0);
00095   Float_t *Target4Vector(Int_t itr=0);
00096 
00097   Float_t TrueNuEnergy(Int_t itr=0);
00098   Float_t *TrueNuMom(Int_t itr=0);
00099   Float_t *TrueVtx(Int_t itr=0);  //returns interaction vertex coords
00100   Float_t TrueMuEnergy(Int_t itr=0);
00101   Float_t TrueLeptonEnergy(Int_t itr=0);
00102   Float_t TrueMuQP(Int_t itr=0);
00103   Float_t TrueShwEnergy(Int_t itr=0);
00104   Float_t GetTrueShwSC(Int_t itr=0); //returns summed SigCors from shower 
00105                                      //strips(from HitBits)
00106   Float_t TrueMuDCosZ(Int_t itr=0);
00107   Float_t TrueMuDCosNeu(Int_t itr=0);
00108 
00109   //STDHEP METHODS:
00110   Int_t NumFSGeantino(Int_t itr=0);
00111   Float_t GeantinoEnergy(Int_t itr=0);
00112 
00113   Int_t NumFSProton(Int_t itr=0);
00114   Float_t TotFSProtonEnergy(Int_t itr=0);
00115   Float_t MaxFSProtonEnergy(Int_t itr=0);
00116 
00117   Int_t NumFSNeutron(Int_t itr=0);
00118   Float_t TotFSNeutronEnergy(Int_t itr=0);
00119   Float_t MaxFSNeutronEnergy(Int_t itr=0);
00120 
00121   //use pm=-1 for pi-; pm=1 for pi+; pm=0 both
00122   Int_t NumFSPion(Int_t itr=0,Int_t pm=0); 
00123   Float_t TotFSPionEnergy(Int_t itr=0,Int_t pm=0);
00124   Float_t MaxFSPionEnergy(Int_t itr=0,Int_t pm=0);
00125 
00126   Int_t NumFSKaon(Int_t itr=0);
00127   Float_t TotFSKaonEnergy(Int_t itr=0);
00128   Float_t MaxFSKaonEnergy(Int_t itr=0);
00129 
00130   Int_t NumFSPiZero(Int_t itr=0);
00131   Float_t TotFSPiZeroEnergy(Int_t itr=0);
00132   Float_t MaxFSPiZeroEnergy(Int_t itr=0);
00133  
00134   //RECO QUANTITIES:
00135 
00136   Float_t RecoMuEnergy(Int_t opt=0,Int_t itrk=0,Bool_t data=true, Detector::Detector_t det = Detector::kNear); //Arguments are:
00137   //(method,track index) method=0,1,2: 1=curvature,2=range,0=most appropriate
00138 
00139   Float_t RecoMuEnergyNew(Int_t opt, Int_t itrk, VldContext cx, ReleaseType::Release_t reltype, EnergyCorrections::WhichCorrection_t corrver);
00140 
00141 
00142 
00143 
00144   Float_t RecoMuQP(Int_t itrk=0); //q/p from magnetic track fitting
00145   Float_t GetNonTrkSC(Int_t itrk=0,Int_t npln=0); //summed SigCors from all 
00146   //stp NOT in track itrk if argument is >0, only sum in npln from track vertex
00147   Float_t GetShwSC(Int_t itrk=0);//summed SigCors from stps in shw closest vtx
00148 
00149   Float_t RecoShwEnergy(Int_t ishw=0,Int_t opt=-1, Int_t det=1, bool isdata=true, int mode=1); //from SR
00150  
00151   Float_t RecoShwEnergyNew(Int_t ishw, Int_t opt, VldContext cx, ReleaseType::Release_t reltype, EnergyCorrections::WhichCorrection_t corrver); 
00152 
00153 
00154 
00155 
00156   Float_t RecoShwEnergySqrt(Int_t ievt=0); //using sqrt method
00157   Float_t GetSqrtTrkSkimSC(Int_t ievt=0);  //needed for the shower sqrt energy
00158   Float_t GetSqrtShwSC(Int_t ievt=0);      //needed for the shower sqrt energy
00159   Int_t GetChargeSign(Int_t itrk=0); //charge sign of mu from track fitting
00160   Float_t RecoQENuEnergy(Int_t itrk=0); //E_{nu} from E_{mu},trk angle 
00161                                         //for QE events
00162   Float_t RecoQEQ2(Int_t itrk=0); //Q^{2} from E_{mu},trk angle 
00163                                   //for QE events
00164   Float_t RecoMuDCosZ(Int_t itr=0);
00165   Float_t RecoMuDCosNeu(Int_t itr=0);
00166   Double_t RecoEMFrac(Int_t shower,Int_t method,Double_t &EMFrac0,Double_t &EMFrac1);
00167   Int_t *GetNShowerStrip(Int_t event,Int_t opt=0);
00168   Float_t *ClosestDistanceToEvent(Int_t event,Float_t timeWeight=1);
00169 
00170   //SUMMARY FILES:
00171   void MakeValidationFile(std::string);
00172   //use macro LookAtValidationFile.C to plot histos
00173   void ShowerValidation(char *fileName,Int_t startEnt=0);
00174 
00175 };
00176 #endif // #ifdef madquantities_h

Generated on Mon Feb 15 11:06:56 2010 for loon by  doxygen 1.3.9.1