MadQEID Class Reference

#include <MadQEID.h>

List of all members.

Public Member Functions

 MadQEID ()
Bool_t CalcQEVars (MadBase *mb, Int_t evtindex)
Float_t CalcQEID (MadBase *mb, Int_t evtindex, Float_t reco_enu, Float_t recoW2)
Float_t AltCalcQEID (MadBase *mb, Int_t evtindex, Float_t reco_enu, Float_t recoW2)
void ResetPDFs ()
void FillPDFs (Int_t cc_nc, Int_t process, MadBase *mb, Int_t evtindex, Float_t reco_enu, Float_t recoW2)
void WritePDFs (const char *name="QEpdfs.root")
void ReadPDFs (const char *name="QEpdfs.root")
Int_t PassMEDQECut (Float_t reco_enu, Float_t QEIDval)
void FillCutTrainingHists (MadBase *mb, Int_t evtindex, Float_t reco_enu, Float_t recoW2)
void AltFillCutTrainingHists (MadBase *mb, Int_t evtindex, Float_t reco_enu, Float_t recoW2)
void MakeCutHist (Float_t eff)
void RebinPDFs (Int_t nbins)
Float_t GetRePHfrac ()

Private Member Functions

void NormalisePDFs ()
void InitPDFs ()
void InitTrainingHists ()
Bool_t IsTrkHit (Float_t zPos, Float_t tPos, const NtpSRTrack *ntpTrk, MadBase *madb)
Bool_t IsShowHit (Float_t zPos, Float_t tPos, const NtpSRShower *ntpShow, MadBase *madb)
Bool_t IsVPln (Int_t plane)
Int_t GetEnergyBin (Float_t enu)
Float_t GetBinStart (Int_t bin)
Float_t GetBinRange (Int_t bin)

Private Attributes

Int_t ntrks
Int_t nshows
Int_t houghPeak
Float_t recoWsqd
Float_t rePHfrac
Float_t PCAvar
Bool_t pdfs_normalised
TH1F * ntrkCCQE [18]
TH1F * ntrkCCR [18]
TH1F * ntrkCCDIS [18]
TH1F * ntrkNC [18]
TH1F * ntrkBG [18]
TH1F * nshowCCQE [18]
TH1F * nshowCCR [18]
TH1F * nshowCCDIS [18]
TH1F * nshowNC [18]
TH1F * nshowBG [18]
TH1F * hpeakCCQE [18]
TH1F * hpeakCCR [18]
TH1F * hpeakCCDIS [18]
TH1F * hpeakNC [18]
TH1F * hpeakBG [18]
TH1F * recoW2CCQE [18]
TH1F * recoW2CCR [18]
TH1F * recoW2CCDIS [18]
TH1F * recoW2NC [18]
TH1F * recoW2BG [18]
TH1F * rePHfracCCQE [18]
TH1F * rePHfracCCR [18]
TH1F * rePHfracCCDIS [18]
TH1F * rePHfracNC [18]
TH1F * rePHfracBG [18]
TH1F * PCACCQE [18]
TH1F * PCACCR [18]
TH1F * PCACCDIS [18]
TH1F * PCANC [18]
TH1F * PCABG [18]
TH1F * trainingHists [18]
TH1F * cutsHist


Detailed Description

Definition at line 27 of file MadQEID.h.


Constructor & Destructor Documentation

MadQEID::MadQEID (  ) 

Definition at line 35 of file MadQEID.cxx.

References cutsHist, hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, rePHfracNC, and trainingHists.

00036   : ntrks(-1), nshows(-1), houghPeak(-1), recoWsqd(1000.0),
00037     rePHfrac(-1.0), PCAvar(-1.0), pdfs_normalised(kFALSE)
00038 {
00039 
00040   for(Int_t i=0;i<18;i++){
00041     rePHfracCCQE[i] = 0;
00042     rePHfracCCR[i] = 0;
00043     rePHfracCCDIS[i] = 0;
00044     rePHfracNC[i] = 0;
00045     rePHfracBG[i] = 0;
00046     recoW2CCQE[i] = 0;
00047     recoW2CCR[i] = 0;
00048     recoW2CCDIS[i] = 0;
00049     recoW2NC[i] = 0;
00050     recoW2BG[i] = 0;
00051     ntrkCCQE[i] = 0;
00052     ntrkCCR[i] = 0;
00053     ntrkCCDIS[i] = 0;
00054     ntrkNC[i] = 0;
00055     ntrkBG[i] = 0;
00056     nshowCCQE[i] = 0;
00057     nshowCCR[i] = 0;    
00058     nshowCCDIS[i] = 0;
00059     nshowNC[i] = 0;
00060     nshowBG[i] = 0;
00061     hpeakCCQE[i] = 0;
00062     hpeakCCR[i] = 0;
00063     hpeakCCDIS[i] = 0;
00064     hpeakNC[i] = 0;
00065     hpeakBG[i] = 0;
00066     PCACCQE[i] = 0;
00067     PCACCR[i] = 0;
00068     PCACCDIS[i] = 0;
00069     PCANC[i] = 0;
00070     PCABG[i] = 0;
00071     trainingHists[i] = 0;
00072   }
00073 
00074   cutsHist = 0;
00075 
00076 }


Member Function Documentation

Float_t MadQEID::AltCalcQEID ( MadBase mb,
Int_t  evtindex,
Float_t  reco_enu,
Float_t  recoW2 
)

Definition at line 344 of file MadQEID.cxx.

References CalcQEVars(), GetEnergyBin(), houghPeak, hpeakBG, hpeakCCQE, NormalisePDFs(), nshowBG, nshowCCQE, nshows, PCABG, PCACCQE, PCAvar, pdfs_normalised, recoW2BG, recoW2CCQE, recoWsqd, rePHfrac, rePHfracBG, and rePHfracCCQE.

Referenced by AltFillCutTrainingHists(), and MadMKAnalysis::CreatePAN().

00345 {
00346   if(pdfs_normalised==kFALSE) NormalisePDFs();
00347 
00348   if(reco_enu>=20.0) return -1000.0;
00349   if(!CalcQEVars(mb,evtindex)) return -1000.0;
00350 
00351   recoWsqd = recoW2;
00352 
00353   if(recoW2>=10.0) return -5.0;
00354   if(PCAvar>=50000.0) return -5.0;
00355 
00356   Int_t currentBin = GetEnergyBin(reco_enu);
00357 
00358   //QE
00359   Float_t QErePHfrac=rePHfracCCQE[currentBin]->GetBinContent(rePHfracCCQE[currentBin]->FindBin(rePHfrac));
00360   Float_t QErecoW2=recoW2CCQE[currentBin]->GetBinContent(recoW2CCQE[currentBin]->FindBin(recoWsqd));
00361   Float_t QEnshow=nshowCCQE[currentBin]->GetBinContent(nshowCCQE[currentBin]->FindBin(nshows));
00362   //Float_t QEntrk=ntrkCCQE[currentBin]->GetBinContent(ntrkCCQE[currentBin]->FindBin(ntrks));
00363   Float_t QEhpk=hpeakCCQE[currentBin]->GetBinContent(hpeakCCQE[currentBin]->FindBin(houghPeak));
00364   Float_t QEpca=PCACCQE[currentBin]->GetBinContent(PCACCQE[currentBin]->FindBin(PCAvar));
00365   
00366   //all backgrounds together 
00367   Float_t BGrePHfrac=rePHfracBG[currentBin]->GetBinContent(rePHfracBG[currentBin]->FindBin(rePHfrac));
00368   Float_t BGrecoW2=recoW2BG[currentBin]->GetBinContent(recoW2BG[currentBin]->FindBin(recoWsqd));
00369   Float_t BGnshow=nshowBG[currentBin]->GetBinContent(nshowBG[currentBin]->FindBin(nshows));
00370   //Float_t BGntrk=ntrkBG[currentBin]->GetBinContent(ntrkBG[currentBin]->FindBin(ntrks));
00371   Float_t BGhpk=hpeakBG[currentBin]->GetBinContent(hpeakBG[currentBin]->FindBin(houghPeak));
00372   Float_t BGpca=PCABG[currentBin]->GetBinContent(PCABG[currentBin]->FindBin(PCAvar));
00373   
00374   Float_t likliQE = QErePHfrac*QErecoW2*QEnshow*QEhpk*QEpca;
00375   Float_t liklinotQE = BGrePHfrac*BGrecoW2*BGnshow*BGhpk*BGpca;
00376 
00377   if(likliQE==0 && liklinotQE==0) return -1000.0;
00378   if(likliQE==0 && liklinotQE>0) return -5.0;
00379   if(likliQE>0 && liklinotQE==0) return 5.0;
00380   Float_t PID = -(sqrt(-log(likliQE)))+(sqrt(-log(liklinotQE)));
00381 
00382   return PID;  
00383 
00384 }

void MadQEID::AltFillCutTrainingHists ( MadBase mb,
Int_t  evtindex,
Float_t  reco_enu,
Float_t  recoW2 
)

Definition at line 701 of file MadQEID.cxx.

References AltCalcQEID(), GetEnergyBin(), InitTrainingHists(), and trainingHists.

00702 {
00703   if(reco_enu>=20.0) return;
00704   static bool first=true;
00705   if(first){ InitTrainingHists(); first=false;}
00706   Float_t currentID = AltCalcQEID(mb,evtindex,reco_enu,recoW2);
00707   Int_t currentBin = GetEnergyBin(reco_enu);
00708   trainingHists[currentBin]->Fill(currentID);
00709 }

Float_t MadQEID::CalcQEID ( MadBase mb,
Int_t  evtindex,
Float_t  reco_enu,
Float_t  recoW2 
)

Definition at line 283 of file MadQEID.cxx.

References CalcQEVars(), GetEnergyBin(), houghPeak, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, NormalisePDFs(), nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, nshows, PCACCDIS, PCACCQE, PCACCR, PCANC, PCAvar, pdfs_normalised, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, recoWsqd, rePHfrac, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

Referenced by FillCutTrainingHists().

00284 {
00285   if(pdfs_normalised==kFALSE) NormalisePDFs();
00286 
00287   if(reco_enu>=20.0) return -1000.0;
00288   if(!CalcQEVars(mb,evtindex)) return -1000.0;
00289 
00290   recoWsqd = recoW2;
00291 
00292   if(recoW2>=10.0) return -5.0;
00293   if(PCAvar>=50000.0) return -5.0;
00294 
00295   Int_t currentBin = GetEnergyBin(reco_enu);
00296 
00297   //QE
00298   Float_t QErePHfrac=rePHfracCCQE[currentBin]->GetBinContent(rePHfracCCQE[currentBin]->FindBin(rePHfrac));
00299   Float_t QErecoW2=recoW2CCQE[currentBin]->GetBinContent(recoW2CCQE[currentBin]->FindBin(recoWsqd));
00300   Float_t QEnshow=nshowCCQE[currentBin]->GetBinContent(nshowCCQE[currentBin]->FindBin(nshows));
00301   //Float_t QEntrk=ntrkCCQE[currentBin]->GetBinContent(ntrkCCQE[currentBin]->FindBin(ntrks));
00302   Float_t QEhpk=hpeakCCQE[currentBin]->GetBinContent(hpeakCCQE[currentBin]->FindBin(houghPeak));
00303   Float_t QEpca=PCACCQE[currentBin]->GetBinContent(PCACCQE[currentBin]->FindBin(PCAvar));
00304   
00305   //Res
00306   Float_t RrePHfrac=rePHfracCCR[currentBin]->GetBinContent(rePHfracCCR[currentBin]->FindBin(rePHfrac));
00307   Float_t RrecoW2=recoW2CCR[currentBin]->GetBinContent(recoW2CCR[currentBin]->FindBin(recoWsqd));
00308   Float_t Rnshow=nshowCCR[currentBin]->GetBinContent(nshowCCR[currentBin]->FindBin(nshows));
00309   //Float_t Rntrk=ntrkCCR[currentBin]->GetBinContent(ntrkCCR[currentBin]->FindBin(ntrks));
00310   Float_t Rhpk=hpeakCCR[currentBin]->GetBinContent(hpeakCCR[currentBin]->FindBin(houghPeak));
00311   Float_t Rpca=PCACCR[currentBin]->GetBinContent(PCACCR[currentBin]->FindBin(PCAvar));
00312   
00313   //DIS
00314   Float_t DISrePHfrac=rePHfracCCDIS[currentBin]->GetBinContent(rePHfracCCDIS[currentBin]->FindBin(rePHfrac));
00315   Float_t DISrecoW2=recoW2CCDIS[currentBin]->GetBinContent(recoW2CCDIS[currentBin]->FindBin(recoWsqd));
00316   Float_t DISnshow=nshowCCDIS[currentBin]->GetBinContent(nshowCCDIS[currentBin]->FindBin(nshows));
00317   //Float_t DISntrk=ntrkCCDIS[currentBin]->GetBinContent(ntrkCCDIS[currentBin]->FindBin(ntrks));
00318   Float_t DIShpk=hpeakCCDIS[currentBin]->GetBinContent(hpeakCCDIS[currentBin]->FindBin(houghPeak));
00319   Float_t DISpca=PCACCDIS[currentBin]->GetBinContent(PCACCDIS[currentBin]->FindBin(PCAvar));
00320   
00321   //NC
00322   Float_t NCrePHfrac=rePHfracNC[currentBin]->GetBinContent(rePHfracNC[currentBin]->FindBin(rePHfrac));
00323   Float_t NCrecoW2=recoW2NC[currentBin]->GetBinContent(recoW2NC[currentBin]->FindBin(recoWsqd));
00324   Float_t NCnshow=nshowNC[currentBin]->GetBinContent(nshowNC[currentBin]->FindBin(nshows));
00325   //Float_t NCntrk=ntrkNC[currentBin]->GetBinContent(ntrkNC[currentBin]->FindBin(ntrks));
00326   Float_t NChpk=hpeakNC[currentBin]->GetBinContent(hpeakNC[currentBin]->FindBin(houghPeak));
00327   Float_t NCpca=PCANC[currentBin]->GetBinContent(PCANC[currentBin]->FindBin(PCAvar));
00328 
00329   Float_t likliQE = QErePHfrac*QErecoW2*QEnshow*QEhpk*QEpca;
00330   Float_t liklinotQE = (RrePHfrac*RrecoW2*Rnshow*Rhpk*Rpca)
00331     +(DISrePHfrac*DISrecoW2*DISnshow*DIShpk*DISpca)
00332     +(NCrePHfrac*NCrecoW2*NCnshow*NChpk*NCpca);
00333 
00334   if(likliQE==0 && liklinotQE==0) return -1000.0;
00335   if(likliQE==0 && liklinotQE>0) return -5.0;
00336   if(likliQE>0 && liklinotQE==0) return 5.0;
00337   Float_t PID = -(sqrt(-log(likliQE)))+(sqrt(-log(liklinotQE)));
00338 
00339   return PID;  
00340 
00341 }

Bool_t MadQEID::CalcQEVars ( MadBase mb,
Int_t  evtindex 
)

Definition at line 214 of file MadQEID.cxx.

References HoughTrans::FillHough(), MadBase::GetEvent(), MadBase::GetLargestTrackFromEvent(), HoughTrans::GetPeakHeight(), MadBase::GetShower(), MadBase::GetStrip(), houghPeak, IsShowHit(), IsTrkHit(), IsVPln(), NtpSREvent::nshower, nshows, NtpSREvent::nstrip, NtpSREvent::ntrack, ntrks, PCAvar, rePHfrac, HoughTrans::ResetHough(), HoughTrans::SetVtxz(), NtpSREvent::shw, NtpSREvent::stp, NtpSREvent::vtx, NtpSRStrip::z, and NtpSRVertex::z.

Referenced by AltCalcQEID(), CalcQEID(), and FillPDFs().

00215 {
00216   ntrks = -1;
00217   nshows = -1;
00218   houghPeak = -1;
00219   rePHfrac = -1.0;
00220   PCAvar = -1.0;
00221 
00222   if(!mb) return false;
00223   const NtpSREvent* evt = mb->GetEvent(evtindex);
00224   if(!evt) return false;
00225   ntrks = evt->ntrack;
00226   nshows = evt->nshower;
00227   Int_t track_index = -1;
00228   const NtpSRTrack* trk = mb->GetLargestTrackFromEvent(evtindex,track_index);
00229   if(track_index==-1) return false;
00230   Float_t EvtPH=0.0;
00231   Float_t PHremaining=0.0;
00232   Int_t numbighits=0;
00233 
00234   // MAK 02/08/05: no reason to create HoughTrans objects on the heap with new
00235   // make these objects static so we don't have to keep deleting them
00236   static HoughTrans HTUpln(80,-4.0,4.0);
00237   static HoughTrans HTVpln(80,-4.0,4.0);
00238   HTUpln.ResetHough();
00239   HTVpln.ResetHough();
00240 
00241   HTUpln.SetVtxz(evt->vtx.z);
00242   HTVpln.SetVtxz(evt->vtx.z);
00243   for(Int_t istp=0;istp<evt->nstrip;istp++){
00244     int stripindex = evt->stp[istp];
00245     const NtpSRStrip* stp = mb->GetStrip(stripindex);
00246     if(!stp) continue;
00247     Float_t zPos = stp->z;
00248     Float_t tPos = stp->tpos;
00249     Float_t pes = (stp->ph0.pe)+(stp->ph1.pe);
00250     Float_t scor = (stp->ph0.sigcor)+(stp->ph1.sigcor);
00251     Float_t vtxz = evt->vtx.z;
00252     Int_t pln = stp->plane;
00253     EvtPH+=scor;
00254     if(pes<1.5) continue;
00255     if((zPos-vtxz)>2) continue;
00256     if(!IsTrkHit(zPos,tPos,trk,mb)){
00257       PHremaining+=scor;
00258       if(pes>20) numbighits++;
00259       if(IsVPln(pln)) HTVpln.FillHough(zPos,tPos);
00260       if(!IsVPln(pln)) HTUpln.FillHough(zPos,tPos);
00261     }
00262     for(Int_t ishw=0;ishw<nshows;ishw++){
00263       int shwindex = evt->shw[ishw];    
00264       const NtpSRShower* shwr = mb->GetShower(shwindex);
00265       if(!shwr) continue;
00266       if(IsShowHit(zPos,tPos,shwr,mb) && IsTrkHit(zPos,tPos,trk,mb)){
00267         PHremaining+=(scor-545);  //how much is a MIP in sigcor??? ~545(ND)
00268         if(pes>26) numbighits++;  //and in pes??? ~6 (gain ~100 in ND)
00269       }
00270     }
00271   }
00272 
00273   houghPeak = (HTUpln.GetPeakHeight())+(HTVpln.GetPeakHeight());
00274 
00275   if(EvtPH!=0) rePHfrac = (PHremaining/EvtPH);
00276   if(numbighits<=0 || PHremaining<=0) PCAvar = 0.0;
00277   else PCAvar = (((2500*numbighits)/PHremaining)*(2500*numbighits+PHremaining));
00278 
00279   return true;
00280 }

void MadQEID::FillCutTrainingHists ( MadBase mb,
Int_t  evtindex,
Float_t  reco_enu,
Float_t  recoW2 
)

Definition at line 690 of file MadQEID.cxx.

References CalcQEID(), GetEnergyBin(), InitTrainingHists(), and trainingHists.

00691 {
00692   if(reco_enu>=20.0) return;
00693   static bool first=true;
00694   if(first){ InitTrainingHists(); first=false;}
00695   Float_t currentID = CalcQEID(mb,evtindex,reco_enu,recoW2);
00696   Int_t currentBin = GetEnergyBin(reco_enu);
00697   trainingHists[currentBin]->Fill(currentID);
00698 }

void MadQEID::FillPDFs ( Int_t  cc_nc,
Int_t  process,
MadBase mb,
Int_t  evtindex,
Float_t  reco_enu,
Float_t  recoW2 
)

Definition at line 402 of file MadQEID.cxx.

References CalcQEVars(), GetEnergyBin(), houghPeak, hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, InitPDFs(), nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, nshows, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, ntrks, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, PCAvar, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, recoWsqd, rePHfrac, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

00403 {
00404   static bool first=true;
00405   if(first){ InitPDFs(); first=false;}
00406   if(!CalcQEVars(mb,evtindex)) return;
00407   if(reco_enu>=20.0) return;
00408   Int_t currentBin = GetEnergyBin(reco_enu);
00409   recoWsqd = recoW2;
00410 
00411   if(cc_nc==1 && process==1001){
00412     rePHfracCCQE[currentBin]->Fill(rePHfrac);
00413     ntrkCCQE[currentBin]->Fill(ntrks);
00414     recoW2CCQE[currentBin]->Fill(recoWsqd);
00415     nshowCCQE[currentBin]->Fill(nshows);
00416     hpeakCCQE[currentBin]->Fill(houghPeak);
00417     PCACCQE[currentBin]->Fill(PCAvar);
00418   }
00419   if(cc_nc==1 && process==1002){ 
00420     rePHfracCCR[currentBin]->Fill(rePHfrac);
00421     ntrkCCR[currentBin]->Fill(ntrks);
00422     recoW2CCR[currentBin]->Fill(recoWsqd);
00423     nshowCCR[currentBin]->Fill(nshows);
00424     hpeakCCR[currentBin]->Fill(houghPeak);
00425     PCACCR[currentBin]->Fill(PCAvar);
00426     rePHfracBG[currentBin]->Fill(rePHfrac);
00427     ntrkBG[currentBin]->Fill(ntrks);
00428     recoW2BG[currentBin]->Fill(recoWsqd);
00429     nshowBG[currentBin]->Fill(nshows);
00430     hpeakBG[currentBin]->Fill(houghPeak);
00431     PCABG[currentBin]->Fill(PCAvar);
00432   }   
00433   if(cc_nc==1 && process==1003){
00434     rePHfracCCDIS[currentBin]->Fill(rePHfrac);
00435     ntrkCCDIS[currentBin]->Fill(ntrks);
00436     recoW2CCDIS[currentBin]->Fill(recoWsqd);
00437     nshowCCDIS[currentBin]->Fill(nshows);
00438     hpeakCCDIS[currentBin]->Fill(houghPeak);
00439     PCACCDIS[currentBin]->Fill(PCAvar);
00440     rePHfracBG[currentBin]->Fill(rePHfrac);
00441     ntrkBG[currentBin]->Fill(ntrks);
00442     recoW2BG[currentBin]->Fill(recoWsqd);
00443     nshowBG[currentBin]->Fill(nshows);
00444     hpeakBG[currentBin]->Fill(houghPeak);
00445     PCABG[currentBin]->Fill(PCAvar);
00446   }
00447   if(cc_nc==0){
00448     rePHfracNC[currentBin]->Fill(rePHfrac);
00449     ntrkNC[currentBin]->Fill(ntrks);
00450     recoW2NC[currentBin]->Fill(recoWsqd);
00451     nshowNC[currentBin]->Fill(nshows);
00452     hpeakNC[currentBin]->Fill(houghPeak);
00453     PCANC[currentBin]->Fill(PCAvar);
00454     rePHfracBG[currentBin]->Fill(rePHfrac);
00455     ntrkBG[currentBin]->Fill(ntrks);
00456     recoW2BG[currentBin]->Fill(recoWsqd);
00457     nshowBG[currentBin]->Fill(nshows);
00458     hpeakBG[currentBin]->Fill(houghPeak);
00459     PCABG[currentBin]->Fill(PCAvar);
00460   }
00461 }

Float_t MadQEID::GetBinRange ( Int_t  bin  )  [private]

Definition at line 863 of file MadQEID.cxx.

Referenced by MakeCutHist(), and PassMEDQECut().

00864 {
00865   Float_t binrange = 0.;
00866   if(bin<=9){
00867     binrange=0.5;
00868   } 
00869   if(bin>9 && bin<=12){
00870     binrange=1.0;
00871   }
00872   if(bin>=13 && bin<16){
00873     binrange=2.0;
00874   }
00875   if(bin>=16){
00876     binrange=3.0;
00877   }
00878   return binrange;
00879 }

Float_t MadQEID::GetBinStart ( Int_t  bin  )  [private]

Definition at line 838 of file MadQEID.cxx.

Referenced by MakeCutHist(), and PassMEDQECut().

00839 {
00840   Float_t binstart=0.;
00841   if(bin==0) binstart=0.0;
00842   if(bin==1) binstart=0.5;
00843   if(bin==2) binstart=1.0;
00844   if(bin==3) binstart=1.5;
00845   if(bin==4) binstart=2.0;
00846   if(bin==5) binstart=2.5;
00847   if(bin==6) binstart=3.0;
00848   if(bin==7) binstart=3.5;
00849   if(bin==8) binstart=4.0;
00850   if(bin==9) binstart=4.5;
00851   if(bin==10) binstart=5.0;
00852   if(bin==11) binstart=6.0;
00853   if(bin==12) binstart=7.0;
00854   if(bin==13) binstart=8.0;
00855   if(bin==14) binstart=10.0;
00856   if(bin==15) binstart=12.0;
00857   if(bin==16) binstart=14.0;
00858   if(bin==17) binstart=17.0;
00859   return binstart;
00860 }

Int_t MadQEID::GetEnergyBin ( Float_t  enu  )  [private]

Definition at line 813 of file MadQEID.cxx.

Referenced by AltCalcQEID(), AltFillCutTrainingHists(), CalcQEID(), FillCutTrainingHists(), FillPDFs(), and PassMEDQECut().

00814 {
00815   Int_t bin = 0;
00816   if(enu>=0.0 && enu<0.5) bin=0;
00817   if(enu>=0.5 && enu<1.0) bin=1;
00818   if(enu>=1.0 && enu<1.5) bin=2;
00819   if(enu>=1.5 && enu<2.0) bin=3;
00820   if(enu>=2.0 && enu<2.5) bin=4;
00821   if(enu>=2.5 && enu<3.0) bin=5;
00822   if(enu>=3.0 && enu<3.5) bin=6;
00823   if(enu>=3.5 && enu<4.0) bin=7;
00824   if(enu>=4.0 && enu<4.5) bin=8;
00825   if(enu>=4.5 && enu<5.0) bin=9;
00826   if(enu>=5.0 && enu<6.0) bin=10;
00827   if(enu>=6.0 && enu<7.0) bin=11;
00828   if(enu>=7.0 && enu<8.0) bin=12;
00829   if(enu>=8.0 && enu<10.0) bin=13;
00830   if(enu>=10.0 && enu<12.0) bin=14;
00831   if(enu>=12.0 && enu<14.0) bin=15;
00832   if(enu>=14.0 && enu<17.0) bin=16;
00833   if(enu>=17.0 && enu<20.0) bin=17;
00834   return bin;
00835 }

Float_t MadQEID::GetRePHfrac (  ) 

Definition at line 772 of file MadQEID.cxx.

References rePHfrac.

00773 {
00774   return rePHfrac;
00775 }

void MadQEID::InitPDFs (  )  [private]

Definition at line 79 of file MadQEID.cxx.

References hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

Referenced by FillPDFs().

00080 {
00081   TH1::AddDirectory(kFALSE); // do not assign histograms to TDirectory
00082 
00083   for(Int_t i=0;i<18;i++){
00084     char name[30];
00085     sprintf(name,"rePHfracCCQE[%d]",i);
00086     rePHfracCCQE[i] = new TH1F(name,name,25,0.0,1.0);
00087     sprintf(name,"rePHfracCCR[%d]",i);
00088     rePHfracCCR[i] = new TH1F(name,name,25,0.0,1.0);
00089     sprintf(name,"rePHfracCCDIS[%d]",i);
00090     rePHfracCCDIS[i] = new TH1F(name,name,25,0.0,1.0);
00091     sprintf(name,"rePHfracNC[%d]",i);
00092     rePHfracNC[i] = new TH1F(name,name,25,0.0,1.0);
00093     sprintf(name,"rePHfracBG[%d]",i);
00094     rePHfracBG[i] = new TH1F(name,name,25,0.0,1.0);
00095 
00096     sprintf(name,"recoW2CCQE[%d]",i);
00097     recoW2CCQE[i] = new TH1F(name,name,75,-5,10);
00098     sprintf(name,"recoW2CCR[%d]",i);
00099     recoW2CCR[i] = new TH1F(name,name,75,-5,10);
00100     sprintf(name,"recoW2CCDIS[%d]",i);
00101     recoW2CCDIS[i] = new TH1F(name,name,75,-5,10);
00102     sprintf(name,"recoW2NC[%d]",i);
00103     recoW2NC[i] = new TH1F(name,name,75,-5,10);
00104     sprintf(name,"recoW2BG[%d]",i);
00105     recoW2BG[i] = new TH1F(name,name,75,-5,10);
00106 
00107     sprintf(name,"ntrkCCQE[%d]",i);
00108     ntrkCCQE[i] = new TH1F(name,name,5,0,5);
00109     sprintf(name,"ntrkCCR[%d]",i);
00110     ntrkCCR[i] = new TH1F(name,name,5,0,5);
00111     sprintf(name,"ntrkCCDIS[%d]",i);
00112     ntrkCCDIS[i] = new TH1F(name,name,5,0,5);
00113     sprintf(name,"ntrkNC[%d]",i);
00114     ntrkNC[i] = new TH1F(name,name,5,0,5);
00115     sprintf(name,"ntrkBG[%d]",i);
00116     ntrkBG[i] = new TH1F(name,name,5,0,5);
00117 
00118     sprintf(name,"nshowCCQE[%d]",i);
00119     nshowCCQE[i] = new TH1F(name,name,10,0,10);
00120     sprintf(name,"nshowCCR[%d]",i);
00121     nshowCCR[i] = new TH1F(name,name,10,0,10);
00122     sprintf(name,"nshowCCDIS[%d]",i);
00123     nshowCCDIS[i] = new TH1F(name,name,10,0,10);
00124     sprintf(name,"nshowNC[%d]",i);
00125     nshowNC[i] = new TH1F(name,name,10,0,10);
00126     sprintf(name,"nshowBG[%d]",i);
00127     nshowBG[i] = new TH1F(name,name,10,0,10);
00128 
00129     sprintf(name,"hpeakCCQE[%d]",i);
00130     hpeakCCQE[i] = new TH1F(name,name,25,0,50);
00131     sprintf(name,"hpeakCCR[%d]",i);
00132     hpeakCCR[i] = new TH1F(name,name,25,0,50);
00133     sprintf(name,"hpeakCCDIS[%d]",i);
00134     hpeakCCDIS[i] = new TH1F(name,name,25,0,50);
00135     sprintf(name,"hpeakNC[%d]",i);
00136     hpeakNC[i] = new TH1F(name,name,25,0,50);
00137     sprintf(name,"hpeakBG[%d]",i);
00138     hpeakBG[i] = new TH1F(name,name,25,0,50);
00139 
00140     sprintf(name,"PCACCQE[%d]",i);
00141     PCACCQE[i] = new TH1F(name,name,25,0,100000);
00142     sprintf(name,"PCACCR[%d]",i);
00143     PCACCR[i] = new TH1F(name,name,25,0,100000);
00144     sprintf(name,"PCACCDIS[%d]",i);
00145     PCACCDIS[i] = new TH1F(name,name,25,0,100000);
00146     sprintf(name,"PCANC[%d]",i);
00147     PCANC[i] = new TH1F(name,name,25,0,100000);
00148     sprintf(name,"PCABG[%d]",i);
00149     PCABG[i] = new TH1F(name,name,25,0,100000);
00150 
00151   }  
00152 
00153   TH1::AddDirectory(kTRUE); // revert above
00154 }

void MadQEID::InitTrainingHists (  )  [private]

Definition at line 157 of file MadQEID.cxx.

References cutsHist, and trainingHists.

Referenced by AltFillCutTrainingHists(), and FillCutTrainingHists().

00158 {
00159   for(Int_t i=0;i<18;i++){
00160     trainingHists[i] = 0;
00161   }
00162   TH1::AddDirectory(kFALSE); // do not assign histograms to TDirectory
00163   for(Int_t i=0;i<18;i++){
00164     char name[30];
00165     sprintf(name,"trainingHists[%d]",i);
00166     trainingHists[i] = new TH1F(name,name,1200,-6.0,6.0);
00167   }
00168   Float_t axarray[19] = {0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,
00169                          5.0,6.0,7.0,8.0,10.0,12.0,14.0,17.0,20.0};
00170   cutsHist = new TH1F("cuthist","cuthist",18,axarray);
00171   TH1::AddDirectory(kTRUE); // revert above
00172 }

Bool_t MadQEID::IsShowHit ( Float_t  zPos,
Float_t  tPos,
const NtpSRShower ntpShow,
MadBase madb 
) [private]

Definition at line 791 of file MadQEID.cxx.

References MadBase::GetStrip(), NtpSRShower::nstrip, and NtpSRShower::stp.

Referenced by CalcQEVars().

00792 {
00793   for(Int_t i=0;i<ntpShow->nstrip;i++){
00794     const NtpSRStrip* strp = madb->GetStrip(ntpShow->stp[i]);
00795     if(!strp) continue;
00796     if(strp->tpos==tPos && strp->z==zPos){
00797       return true;
00798     }
00799   }
00800   return false;
00801 }

Bool_t MadQEID::IsTrkHit ( Float_t  zPos,
Float_t  tPos,
const NtpSRTrack ntpTrk,
MadBase madb 
) [private]

Definition at line 778 of file MadQEID.cxx.

References MadBase::GetStrip(), NtpSRTrack::nstrip, and NtpSRTrack::stp.

Referenced by CalcQEVars().

00779 {
00780   for(Int_t i=0;i<ntpTrk->nstrip;i++){
00781     const NtpSRStrip* strp = madb->GetStrip(ntpTrk->stp[i]);
00782     if(!strp) continue;
00783     if(strp->tpos==tPos && strp->z==zPos){
00784       return true;
00785     }
00786   }
00787   return false;
00788 }

Bool_t MadQEID::IsVPln ( Int_t  plane  )  [private]

Definition at line 804 of file MadQEID.cxx.

Referenced by CalcQEVars().

00805 {
00806   for(int i=0;i<246;i++){
00807     if(plane==2*i) return true;
00808   }
00809   return false;
00810 }

void MadQEID::MakeCutHist ( Float_t  eff  ) 

Definition at line 712 of file MadQEID.cxx.

References cutsHist, GetBinRange(), GetBinStart(), Detector::GetEntries(), and trainingHists.

00713 {
00714 
00715   for(Int_t i=0;i<18;i++){
00716     Int_t totQE = static_cast<Int_t>(trainingHists[i]->GetEntries());
00717     Float_t currentBinStart = GetBinStart(i);
00718     Float_t currentBinRange = GetBinRange(i);
00719     Float_t lookup = (currentBinStart + (currentBinRange/2.0));
00720     if(totQE==0){
00721       cutsHist->Fill(lookup,0.3);
00722       //cout << "Training energy bin number: " << i << endl;
00723       //cout << "Cut value:                   0.3" << endl;
00724       //cout << endl;
00725       continue;
00726     }
00727     Int_t currentNumQE = 0;
00728     Float_t currentEff = 0.0;
00729     Bool_t foundEff = false;
00730     Int_t trainingHistBins = trainingHists[i]->GetNbinsX();
00731 
00732     //cout << "-------------------------------" << endl;
00733     //cout << "Training energy bin number: " << i << endl;
00734     //cout << "Lookup energy:              " << lookup << endl;
00735     //cout << endl; 
00736 
00737     for(Int_t bin=1;bin<trainingHistBins;bin++){
00738       if(foundEff) continue;
00739       Int_t binNumFromEnd = trainingHistBins-bin;
00740       currentNumQE+=static_cast<Int_t>(trainingHists[i]->GetBinContent(binNumFromEnd));
00741       if(currentNumQE==0){ 
00742         currentEff=0.0;
00743         continue;
00744       }
00745       else currentEff = (static_cast<Float_t>(currentNumQE)/static_cast<Float_t>(totQE));
00746 
00747       //cout << "Current QEID value:   " << trainingHists[i]->GetBinCenter(binNumFromEnd) << endl;
00748       //cout << "Total # QE:           " << totQE << endl;
00749       //cout << "Current # QE:         " << currentNumQE << endl;
00750       //cout << "Current efficiency:   " << currentEff << endl;
00751       //cout << endl;
00752 
00753       if(currentEff>eff && !foundEff){
00754         Float_t cutVal = static_cast<Float_t>((trainingHists[i]->GetBinCenter(binNumFromEnd)));
00755         cutsHist->Fill(lookup,cutVal);
00756         //cout << "Training energy bin number: " << i << endl;
00757         //cout << "Cut value:                  " << cutVal << endl;
00758         //cout << endl;
00759         foundEff = true;
00760       }
00761       if(bin==(trainingHistBins-1) && !foundEff){ 
00762         cutsHist->Fill(lookup,4.5); //still include definite QE in sample
00763         //cout << "Training energy bin number: " << i << endl;
00764         //cout << "Cut value:                   4.5" << endl;
00765         //cout << endl;
00766       }
00767     }
00768   }
00769 }

void MadQEID::NormalisePDFs (  )  [private]

Definition at line 464 of file MadQEID.cxx.

References hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, pdfs_normalised, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

Referenced by AltCalcQEID(), CalcQEID(), and ReadPDFs().

00465 {
00466   Float_t integ;
00467   for(Int_t i=0;i<18;i++){
00468 
00469     integ=rePHfracCCQE[i]->Integral(0,((rePHfracCCQE[i]->GetNbinsX())+1));
00470     if(integ!=0) rePHfracCCQE[i]->Scale(1./integ);
00471     integ=rePHfracCCR[i]->Integral(0,((rePHfracCCR[i]->GetNbinsX())+1));
00472     if(integ!=0) rePHfracCCR[i]->Scale(1./integ);
00473     integ=rePHfracCCDIS[i]->Integral(0,((rePHfracCCDIS[i]->GetNbinsX())+1));
00474     if(integ!=0) rePHfracCCDIS[i]->Scale(1./integ);
00475     integ=rePHfracNC[i]->Integral(0,((rePHfracNC[i]->GetNbinsX())+1));
00476     if(integ!=0) rePHfracNC[i]->Scale(1./integ);
00477     integ=rePHfracBG[i]->Integral(0,((rePHfracBG[i]->GetNbinsX())+1));
00478     if(integ!=0) rePHfracBG[i]->Scale(1./integ);
00479 
00480     integ=recoW2CCQE[i]->Integral(0,((recoW2CCQE[i]->GetNbinsX())+1));
00481     if(integ!=0) recoW2CCQE[i]->Scale(1./integ);
00482     integ=recoW2CCR[i]->Integral(0,((recoW2CCR[i]->GetNbinsX())+1));
00483     if(integ!=0) recoW2CCR[i]->Scale(1./integ);
00484     integ=recoW2CCDIS[i]->Integral(0,((recoW2CCDIS[i]->GetNbinsX())+1));
00485     if(integ!=0) recoW2CCDIS[i]->Scale(1./integ);
00486     integ=recoW2NC[i]->Integral(0,((recoW2NC[i]->GetNbinsX())+1));
00487     if(integ!=0) recoW2NC[i]->Scale(1./integ);
00488     integ=recoW2BG[i]->Integral(0,((recoW2BG[i]->GetNbinsX())+1));
00489     if(integ!=0) recoW2BG[i]->Scale(1./integ);
00490     
00491     integ=ntrkCCQE[i]->Integral(0,((ntrkCCQE[i]->GetNbinsX())+1));
00492     if(integ!=0) ntrkCCQE[i]->Scale(1./integ);
00493     integ=ntrkCCR[i]->Integral(0,((ntrkCCR[i]->GetNbinsX())+1));
00494     if(integ!=0) ntrkCCR[i]->Scale(1./integ);
00495     integ=ntrkCCDIS[i]->Integral(0,((ntrkCCDIS[i]->GetNbinsX())+1));
00496     if(integ!=0) ntrkCCDIS[i]->Scale(1./integ);
00497     integ=ntrkNC[i]->Integral(0,((ntrkNC[i]->GetNbinsX())+1));
00498     if(integ!=0) ntrkNC[i]->Scale(1./integ);
00499     integ=ntrkBG[i]->Integral(0,((ntrkBG[i]->GetNbinsX())+1));
00500     if(integ!=0) ntrkBG[i]->Scale(1./integ);
00501     
00502     integ=nshowCCQE[i]->Integral(0,((nshowCCQE[i]->GetNbinsX())+1));
00503     if(integ!=0) nshowCCQE[i]->Scale(1./integ);
00504     integ=nshowCCR[i]->Integral(0,((nshowCCR[i]->GetNbinsX())+1));
00505     if(integ!=0) nshowCCR[i]->Scale(1./integ);
00506     integ=nshowCCDIS[i]->Integral(0,((nshowCCDIS[i]->GetNbinsX())+1));
00507     if(integ!=0) nshowCCDIS[i]->Scale(1./integ);
00508     integ=nshowNC[i]->Integral(0,((nshowNC[i]->GetNbinsX())+1));
00509     if(integ!=0) nshowNC[i]->Scale(1./integ);
00510     integ=nshowBG[i]->Integral(0,((nshowBG[i]->GetNbinsX())+1));
00511     if(integ!=0) nshowBG[i]->Scale(1./integ);
00512     
00513     integ=hpeakCCQE[i]->Integral(0,((hpeakCCQE[i]->GetNbinsX())+1));
00514     if(integ!=0) hpeakCCQE[i]->Scale(1./integ);
00515     integ=hpeakCCR[i]->Integral(0,((hpeakCCR[i]->GetNbinsX())+1));
00516     if(integ!=0) hpeakCCR[i]->Scale(1./integ);
00517     integ=hpeakCCDIS[i]->Integral(0,((hpeakCCDIS[i]->GetNbinsX())+1));
00518     if(integ!=0) hpeakCCDIS[i]->Scale(1./integ);
00519     integ=hpeakNC[i]->Integral(0,((hpeakNC[i]->GetNbinsX())+1));
00520     if(integ!=0) hpeakNC[i]->Scale(1./integ);
00521     integ=hpeakBG[i]->Integral(0,((hpeakBG[i]->GetNbinsX())+1));
00522     if(integ!=0) hpeakBG[i]->Scale(1./integ);
00523 
00524     integ=PCACCQE[i]->Integral(0,((PCACCQE[i]->GetNbinsX())+1));
00525     if(integ!=0) PCACCQE[i]->Scale(1./integ);
00526     integ=PCACCR[i]->Integral(0,((PCACCR[i]->GetNbinsX())+1));
00527     if(integ!=0) PCACCR[i]->Scale(1./integ);
00528     integ=PCACCDIS[i]->Integral(0,((PCACCDIS[i]->GetNbinsX())+1));
00529     if(integ!=0) PCACCDIS[i]->Scale(1./integ);
00530     integ=PCANC[i]->Integral(0,((PCANC[i]->GetNbinsX())+1));
00531     if(integ!=0) PCANC[i]->Scale(1./integ);
00532     integ=PCABG[i]->Integral(0,((PCABG[i]->GetNbinsX())+1));
00533     if(integ!=0) PCABG[i]->Scale(1./integ);
00534   }
00535   pdfs_normalised=kTRUE;
00536 }

Int_t MadQEID::PassMEDQECut ( Float_t  reco_enu,
Float_t  QEIDval 
)

Definition at line 387 of file MadQEID.cxx.

References cutsHist, GetBinRange(), GetBinStart(), and GetEnergyBin().

Referenced by MadMKAnalysis::CreatePAN().

00388 {
00389   if(reco_enu>=20.0) return -1;
00390   if(QEIDval==-1000.0) return -1;
00391   if(QEIDval==-5.0) return 0;
00392   Int_t currentBin = GetEnergyBin(reco_enu);
00393   Float_t currentBinRange = GetBinRange(currentBin);
00394   Float_t currentBinStart = GetBinStart(currentBin);
00395   Float_t lookup = (currentBinStart+(currentBinRange/2.0));
00396   Float_t cutVal = cutsHist->GetBinContent(cutsHist->FindBin(lookup));
00397   if(QEIDval>cutVal) return 1;
00398   return 0;
00399 }

void MadQEID::ReadPDFs ( const char *  name = "QEpdfs.root"  ) 

Definition at line 604 of file MadQEID.cxx.

References cutsHist, hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, NormalisePDFs(), nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

00605 {
00606   TFile* QEfile = new TFile(name,"READ");
00607   if(QEfile->IsOpen() && !QEfile->IsZombie()){
00608     std::cout<<"Read MadQEID PDFs from : "<<name<<std::endl;
00609     QEfile->cd();
00610     for(Int_t i=0;i<18;i++){
00611       char name[30];
00612 
00613       sprintf(name,"rePHfracCCQE[%d]",i);
00614       rePHfracCCQE[i] = (TH1F*) QEfile->Get(name);
00615       sprintf(name,"rePHfracCCR[%d]",i);
00616       rePHfracCCR[i] = (TH1F*) QEfile->Get(name);
00617       sprintf(name,"rePHfracCCDIS[%d]",i);
00618       rePHfracCCDIS[i] = (TH1F*) QEfile->Get(name);
00619       sprintf(name,"rePHfracNC[%d]",i);
00620       rePHfracNC[i] = (TH1F*) QEfile->Get(name);
00621       sprintf(name,"rePHfracBG[%d]",i);
00622       rePHfracBG[i] = (TH1F*) QEfile->Get(name);
00623 
00624       sprintf(name,"recoW2CCQE[%d]",i);
00625       recoW2CCQE[i] = (TH1F*) QEfile->Get(name);
00626       sprintf(name,"recoW2CCR[%d]",i);
00627       recoW2CCR[i] = (TH1F*) QEfile->Get(name);
00628       sprintf(name,"recoW2CCDIS[%d]",i);
00629       recoW2CCDIS[i] = (TH1F*) QEfile->Get(name);
00630       sprintf(name,"recoW2NC[%d]",i);
00631       recoW2NC[i] = (TH1F*) QEfile->Get(name);
00632       sprintf(name,"recoW2BG[%d]",i);
00633       recoW2BG[i] = (TH1F*) QEfile->Get(name);
00634 
00635       sprintf(name,"hpeakCCQE[%d]",i);
00636       hpeakCCQE[i] = (TH1F*) QEfile->Get(name);
00637       sprintf(name,"hpeakCCR[%d]",i);
00638       hpeakCCR[i] = (TH1F*) QEfile->Get(name);
00639       sprintf(name,"hpeakCCDIS[%d]",i);
00640       hpeakCCDIS[i] = (TH1F*) QEfile->Get(name);
00641       sprintf(name,"hpeakNC[%d]",i);
00642       hpeakNC[i] = (TH1F*) QEfile->Get(name);
00643       sprintf(name,"hpeakBG[%d]",i);
00644       hpeakBG[i] = (TH1F*) QEfile->Get(name);
00645 
00646       sprintf(name,"ntrkCCQE[%d]",i);
00647       ntrkCCQE[i] = (TH1F*) QEfile->Get(name);
00648       sprintf(name,"ntrkCCR[%d]",i);
00649       ntrkCCR[i] = (TH1F*) QEfile->Get(name);
00650       sprintf(name,"ntrkCCDIS[%d]",i);
00651       ntrkCCDIS[i] = (TH1F*) QEfile->Get(name);
00652       sprintf(name,"ntrkNC[%d]",i);
00653       ntrkNC[i] = (TH1F*) QEfile->Get(name);
00654       sprintf(name,"ntrkBG[%d]",i);
00655       ntrkBG[i] = (TH1F*) QEfile->Get(name);
00656 
00657       sprintf(name,"nshowCCQE[%d]",i);
00658       nshowCCQE[i] = (TH1F*) QEfile->Get(name);
00659       sprintf(name,"nshowCCR[%d]",i);
00660       nshowCCR[i] = (TH1F*) QEfile->Get(name);
00661       sprintf(name,"nshowCCDIS[%d]",i);
00662       nshowCCDIS[i] = (TH1F*) QEfile->Get(name);
00663       sprintf(name,"nshowNC[%d]",i);
00664       nshowNC[i] = (TH1F*) QEfile->Get(name);
00665       sprintf(name,"nshowBG[%d]",i);
00666       nshowBG[i] = (TH1F*) QEfile->Get(name);
00667 
00668       sprintf(name,"PCACCQE[%d]",i);
00669       PCACCQE[i] = (TH1F*) QEfile->Get(name);
00670       sprintf(name,"PCACCR[%d]",i);
00671       PCACCR[i] = (TH1F*) QEfile->Get(name);
00672       sprintf(name,"PCACCDIS[%d]",i);
00673       PCACCDIS[i] = (TH1F*) QEfile->Get(name);
00674       sprintf(name,"PCANC[%d]",i);
00675       PCANC[i] = (TH1F*) QEfile->Get(name);
00676       sprintf(name,"PCABG[%d]",i);
00677       PCABG[i] = (TH1F*) QEfile->Get(name);
00678 
00679     }
00680   }
00681   else {
00682     std::cout<<"Failed to read MadQEID PDFs from : "<<name<<std::endl;
00683     assert(false);
00684   }
00685   NormalisePDFs();
00686   cutsHist = (TH1F*) QEfile->Get("cuthist");
00687 }

void MadQEID::RebinPDFs ( Int_t  nbins  ) 

Definition at line 539 of file MadQEID.cxx.

References PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

00540 {
00541   for(Int_t i=0;i<18;i++){
00542     rePHfracCCQE[i]->Rebin(nbins);
00543     rePHfracCCR[i]->Rebin(nbins);
00544     rePHfracCCDIS[i]->Rebin(nbins);
00545     rePHfracNC[i]->Rebin(nbins);
00546     rePHfracBG[i]->Rebin(nbins);
00547     recoW2CCQE[i]->Rebin(nbins);
00548     recoW2CCR[i]->Rebin(nbins);
00549     recoW2CCDIS[i]->Rebin(nbins);
00550     recoW2NC[i]->Rebin(nbins);
00551     recoW2BG[i]->Rebin(nbins);
00552     PCACCQE[i]->Rebin(nbins);
00553     PCACCR[i]->Rebin(nbins);
00554     PCACCDIS[i]->Rebin(nbins);
00555     PCANC[i]->Rebin(nbins);
00556     PCABG[i]->Rebin(nbins);
00557   }
00558 }

void MadQEID::ResetPDFs (  ) 

Definition at line 177 of file MadQEID.cxx.

References hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, and rePHfracNC.

00178 {
00179   for(Int_t i=0;i<18;i++){
00180     rePHfracCCQE[i]->Reset();
00181     rePHfracCCR[i]->Reset();
00182     rePHfracCCDIS[i]->Reset();
00183     rePHfracNC[i]->Reset();
00184     rePHfracBG[i]->Reset();
00185     recoW2CCQE[i]->Reset();
00186     recoW2CCR[i]->Reset();
00187     recoW2CCDIS[i]->Reset();
00188     recoW2NC[i]->Reset();
00189     recoW2BG[i]->Reset();
00190     ntrkCCQE[i]->Reset();
00191     ntrkCCR[i]->Reset();
00192     ntrkCCDIS[i]->Reset();
00193     ntrkNC[i]->Reset();
00194     ntrkBG[i]->Reset();
00195     nshowCCQE[i]->Reset();
00196     nshowCCR[i]->Reset();
00197     nshowCCDIS[i]->Reset();
00198     nshowNC[i]->Reset();
00199     nshowBG[i]->Reset();
00200     hpeakCCQE[i]->Reset();
00201     hpeakCCR[i]->Reset();
00202     hpeakCCDIS[i]->Reset();
00203     hpeakNC[i]->Reset();
00204     hpeakBG[i]->Reset();
00205     PCACCQE[i]->Reset();
00206     PCACCR[i]->Reset();
00207     PCACCDIS[i]->Reset();
00208     PCANC[i]->Reset();
00209     PCABG[i]->Reset();
00210   }
00211 }

void MadQEID::WritePDFs ( const char *  name = "QEpdfs.root"  ) 

Definition at line 561 of file MadQEID.cxx.

References cutsHist, hpeakBG, hpeakCCDIS, hpeakCCQE, hpeakCCR, hpeakNC, nshowBG, nshowCCDIS, nshowCCQE, nshowCCR, nshowNC, ntrkBG, ntrkCCDIS, ntrkCCQE, ntrkCCR, ntrkNC, PCABG, PCACCDIS, PCACCQE, PCACCR, PCANC, recoW2BG, recoW2CCDIS, recoW2CCQE, recoW2CCR, recoW2NC, rePHfracBG, rePHfracCCDIS, rePHfracCCQE, rePHfracCCR, rePHfracNC, and trainingHists.

00562 {
00563   TDirectory* dir = gDirectory;
00564   TFile* f = new TFile(name,"recreate");
00565   dir->cd();
00566   for(Int_t i=0;i<18;i++){
00567     rePHfracCCQE[i]->SetDirectory(f);
00568     rePHfracCCR[i]->SetDirectory(f);
00569     rePHfracCCDIS[i]->SetDirectory(f);
00570     rePHfracNC[i]->SetDirectory(f);
00571     rePHfracBG[i]->SetDirectory(f);
00572     recoW2CCQE[i]->SetDirectory(f);
00573     recoW2CCR[i]->SetDirectory(f);
00574     recoW2CCDIS[i]->SetDirectory(f);
00575     recoW2NC[i]->SetDirectory(f);
00576     recoW2BG[i]->SetDirectory(f);
00577     ntrkCCQE[i]->SetDirectory(f);
00578     ntrkCCR[i]->SetDirectory(f);
00579     ntrkCCDIS[i]->SetDirectory(f);
00580     ntrkNC[i]->SetDirectory(f);
00581     ntrkBG[i]->SetDirectory(f);
00582     nshowCCQE[i]->SetDirectory(f);
00583     nshowCCR[i]->SetDirectory(f);
00584     nshowCCDIS[i]->SetDirectory(f);
00585     nshowNC[i]->SetDirectory(f);
00586     nshowBG[i]->SetDirectory(f);
00587     hpeakCCQE[i]->SetDirectory(f);
00588     hpeakCCR[i]->SetDirectory(f);
00589     hpeakCCDIS[i]->SetDirectory(f);
00590     hpeakNC[i]->SetDirectory(f);
00591     hpeakBG[i]->SetDirectory(f);
00592     PCACCQE[i]->SetDirectory(f);
00593     PCACCR[i]->SetDirectory(f);
00594     PCACCDIS[i]->SetDirectory(f);
00595     PCANC[i]->SetDirectory(f);
00596     PCABG[i]->SetDirectory(f);
00597     if(trainingHists[i]) trainingHists[i]->SetDirectory(f);
00598   } 
00599   if(cutsHist) cutsHist->SetDirectory(f); 
00600   f->Write();
00601 }


Member Data Documentation

TH1F* MadQEID::cutsHist [private]

Definition at line 106 of file MadQEID.h.

Referenced by InitTrainingHists(), MadQEID(), MakeCutHist(), PassMEDQECut(), ReadPDFs(), and WritePDFs().

Int_t MadQEID::houghPeak [private]

Definition at line 62 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), CalcQEVars(), and FillPDFs().

TH1F* MadQEID::hpeakBG[18] [private]

Definition at line 84 of file MadQEID.h.

Referenced by AltCalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::hpeakCCDIS[18] [private]

Definition at line 82 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::hpeakCCQE[18] [private]

Definition at line 80 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::hpeakCCR[18] [private]

Definition at line 81 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::hpeakNC[18] [private]

Definition at line 83 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::nshowBG[18] [private]

Definition at line 78 of file MadQEID.h.

Referenced by AltCalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::nshowCCDIS[18] [private]

Definition at line 76 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::nshowCCQE[18] [private]

Definition at line 74 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::nshowCCR[18] [private]

Definition at line 75 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::nshowNC[18] [private]

Definition at line 77 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

Int_t MadQEID::nshows [private]

Definition at line 61 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), CalcQEVars(), and FillPDFs().

TH1F* MadQEID::ntrkBG[18] [private]

Definition at line 72 of file MadQEID.h.

Referenced by FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::ntrkCCDIS[18] [private]

Definition at line 70 of file MadQEID.h.

Referenced by FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::ntrkCCQE[18] [private]

Definition at line 68 of file MadQEID.h.

Referenced by FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::ntrkCCR[18] [private]

Definition at line 69 of file MadQEID.h.

Referenced by FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::ntrkNC[18] [private]

Definition at line 71 of file MadQEID.h.

Referenced by FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), ResetPDFs(), and WritePDFs().

Int_t MadQEID::ntrks [private]

Definition at line 60 of file MadQEID.h.

Referenced by CalcQEVars(), and FillPDFs().

TH1F* MadQEID::PCABG[18] [private]

Definition at line 102 of file MadQEID.h.

Referenced by AltCalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::PCACCDIS[18] [private]

Definition at line 100 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::PCACCQE[18] [private]

Definition at line 98 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::PCACCR[18] [private]

Definition at line 99 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::PCANC[18] [private]

Definition at line 101 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

Float_t MadQEID::PCAvar [private]

Definition at line 65 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), CalcQEVars(), and FillPDFs().

Bool_t MadQEID::pdfs_normalised [private]

Definition at line 66 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), and NormalisePDFs().

TH1F* MadQEID::recoW2BG[18] [private]

Definition at line 90 of file MadQEID.h.

Referenced by AltCalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::recoW2CCDIS[18] [private]

Definition at line 88 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::recoW2CCQE[18] [private]

Definition at line 86 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::recoW2CCR[18] [private]

Definition at line 87 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::recoW2NC[18] [private]

Definition at line 89 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

Float_t MadQEID::recoWsqd [private]

Definition at line 63 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), and FillPDFs().

Float_t MadQEID::rePHfrac [private]

Definition at line 64 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), CalcQEVars(), FillPDFs(), and GetRePHfrac().

TH1F* MadQEID::rePHfracBG[18] [private]

Definition at line 96 of file MadQEID.h.

Referenced by AltCalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::rePHfracCCDIS[18] [private]

Definition at line 94 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::rePHfracCCQE[18] [private]

Definition at line 92 of file MadQEID.h.

Referenced by AltCalcQEID(), CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::rePHfracCCR[18] [private]

Definition at line 93 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::rePHfracNC[18] [private]

Definition at line 95 of file MadQEID.h.

Referenced by CalcQEID(), FillPDFs(), InitPDFs(), MadQEID(), NormalisePDFs(), ReadPDFs(), RebinPDFs(), ResetPDFs(), and WritePDFs().

TH1F* MadQEID::trainingHists[18] [private]

Definition at line 104 of file MadQEID.h.

Referenced by AltFillCutTrainingHists(), FillCutTrainingHists(), InitTrainingHists(), MadQEID(), MakeCutHist(), and WritePDFs().


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:06:09 2014 for loon by  doxygen 1.4.7