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
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
00062 Bool_t IsTrack();
00063 Bool_t IsSingleTrack();
00064 Bool_t PassTrackCuts(Int_t itrk);
00065 Bool_t PassCuts(Int_t itrk);
00066 Bool_t PassCuts();
00067 Bool_t IsFidVtx(Int_t itrk=0);
00068 Bool_t IsFidAll(Int_t itrk=0);
00069 Bool_t IsFidVtxEvt(Int_t ievt=0);
00070 Bool_t IsFidVtxTrk(Int_t itrk=0);
00071 Bool_t IsFidAllEvt(Int_t ievt=0);
00072
00073 Bool_t IsFidFD_AB(Int_t ievt=0);
00074 Bool_t IsFid_2008(Int_t ievt=0);
00075
00076
00077 Float_t *CCNCSepVars(Int_t itrk=0);
00078
00079 Bool_t PassQuasiCuts(Int_t itrk=0,Float_t frac=0.1);
00080
00081
00082
00083 Int_t INu(Int_t itr=0);
00084 Int_t INuNoOsc(Int_t itr=0);
00085 Int_t Flavour(Int_t itr=0);
00086 Int_t IAction(Int_t itr=0);
00087 Int_t IResonance(Int_t itr=0);
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);
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);
00105
00106 Float_t TrueMuDCosZ(Int_t itr=0);
00107 Float_t TrueMuDCosNeu(Int_t itr=0);
00108
00109
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
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
00135
00136 Float_t RecoMuEnergy(Int_t opt=0,Int_t itrk=0,Bool_t data=true, Detector::Detector_t det = Detector::kNear);
00137
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);
00145 Float_t GetNonTrkSC(Int_t itrk=0,Int_t npln=0);
00146
00147 Float_t GetShwSC(Int_t itrk=0);
00148
00149 Float_t RecoShwEnergy(Int_t ishw=0,Int_t opt=-1, Int_t det=1, bool isdata=true, int mode=1);
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);
00157 Float_t GetSqrtTrkSkimSC(Int_t ievt=0);
00158 Float_t GetSqrtShwSC(Int_t ievt=0);
00159 Int_t GetChargeSign(Int_t itrk=0);
00160 Float_t RecoQENuEnergy(Int_t itrk=0);
00161
00162 Float_t RecoQEQ2(Int_t itrk=0);
00163
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
00171 void MakeValidationFile(std::string);
00172
00173 void ShowerValidation(char *fileName,Int_t startEnt=0);
00174
00175 };
00176 #endif // #ifdef madquantities_h