MiniPlotMaker Class Reference

#include <MiniPlotMaker.h>

List of all members.

Public Member Functions

 MiniPlotMaker ()
 ~MiniPlotMaker ()
void PrintConfigs ()
int AddInputFiles (string s, int group=0)
void SetOutputFile (string s)
void SetRecoType (int t)
void SetMC (int t)
void SetMRCC (int t)
void SetDetector (int t)
void SetHorn (int t)
void SetSystematic (int t)
void SetMaxEntries (int i)
void MakePlots ()
void SetWantPOTs (double wp=1e19)
void SetOverwrite (int i)
void MoveOverFlow (TH2D *h)

Private Member Functions

vector< string > GetFileList (TChain *c)
string GetDirectory ()
TDirectory * MakeDirectory (TFile *f)
void CountPots (TChain *c, TChain *d, double rp[3])
void MakeHistos ()
void FillHistos (int cut, double weight, int rp)
void SaveHistos (TDirectory *td)
string GetRecoTypeString ()
string GetMCString ()
string GetMRCCString ()
string GetDetectorString ()
string GetHornString ()
string GetSystematic ()
string GetMRCCQPCut (int cut)
void ProcessChainNormal (TChain *c, double chainweight[])
void ProcessChainNormalMRCC (TChain *c, double chainweight[])
void ProcessChainParticlePID (TChain *c, double chainweight[])
void ProcessChain2Pairs (TChain *c, double chainweight[])
void ApplySystematic ()
int GetRunPeriod (time_t ts)
string GetRunName (int j)
int GetNCuts ()
string GetCutName (int cut)
void SetUpChain (TChain *c)
string GetNueClassSuffix (int j)
string GetDirectoryString ()
double GetReweight (int type)
bool PassesNuePreselection ()

Private Attributes

string outputFile
TFile * outfile
TChain * infiles [3]
TChain * infilesPOTTree [3]
TChain * infilesForPOTCounting [3]
int infileCount [3]
int infilePOTTreeCount [3]
int infileForPOTCountingCount [3]
int recoType
int isMC
int isMRCC
int detector
int horn
int systematic
int maxEntries
NueMiniPIDnm
double wantPOTs
int overwrite
TH1D * hist_recoE [4][MAXCUTS][6]
TH1D * hist_resCode [4][MAXCUTS][6]
TH1D * hist_nuEnergy [4][MAXCUTS][6]
TH1D * hist_ann14 [4][MAXCUTS][6]
TH1D * hist_ann11 [4][MAXCUTS][6]
TH1D * hist_ann11_firebird [4][MAXCUTS][6]
TH1D * hist_pidA [4][MAXCUTS][6]
TH1D * hist_pidB [4][MAXCUTS][6]
TH1D * hist_pidC [4][MAXCUTS][6]
TH1D * hist_pidD [4][MAXCUTS][6]
TH1D * hist_pidE [4][MAXCUTS][6]
TH1D * hist_pidF [4][MAXCUTS][6]
TH2D * hist_pidA_recoE [4][MAXCUTS][6]
TH2D * hist_pidB_recoE [4][MAXCUTS][6]
TH2D * hist_pidC_recoE [4][MAXCUTS][6]
TH2D * hist_pidD_recoE [4][MAXCUTS][6]
TH2D * hist_pidE_recoE [4][MAXCUTS][6]
TH2D * hist_pidF_recoE [4][MAXCUTS][6]
TH2D * hist_lisa_trueE_recoE [4][MAXCUTS][6]
TH2D * hist_lisa_recoE_pidF [4][MAXCUTS][6]
TH2D * hist_lisa_recoE_ann11 [4][MAXCUTS][6]
TH2D * hist_lisa_recoE_ann11_firebird [4][MAXCUTS][6]
TH2D * hist_lisa_recoE_ann14 [4][MAXCUTS][6]
TH1D * hist_ntot [4][MAXCUTS][6]
TH1D * hist_pars [14][4][MAXCUTS][6]
TH2D * hist_pids_PID_ann [4][6]
SKZPWeightCalculatorskzp
MCReweightmcr
NeugenWeightCalculatornwc
Registryrwtconfig
int lastReweightType
double inputPOT [3][3]

Static Private Attributes

static double potratios [3] = {1.20378e20,1.92724e20,3.78478e20}
static double potratios_mrcc [3] = {4.207220e+19,1.416530e+20,2.565563e+20}

Detailed Description

Definition at line 36 of file MiniPlotMaker.h.


Constructor & Destructor Documentation

MiniPlotMaker::MiniPlotMaker (  ) 

Definition at line 1929 of file MiniPlotMaker.cxx.

References detector, horn, infileCount, infileForPOTCountingCount, infilePOTTreeCount, infiles, infilesForPOTCounting, infilesPOTTree, inputPOT, isMC, isMRCC, lastReweightType, maxEntries, mcr, nm, nwc, outputFile, overwrite, recoType, rwtconfig, NueStandard::SetDefaultOscParam(), SetWantPOTs(), skzp, and systematic.

01930 {
01931 
01932         NueStandard::SetDefaultOscParam();      
01933 
01934         skzp=0;
01935         mcr=0;
01936         nwc=0;
01937         rwtconfig=0;
01938 
01939         lastReweightType=-1;
01940 
01941         //we will need to manually place the histos....
01942         TH1::AddDirectory(0);
01943         TH1::SetDefaultSumw2(true);
01944 
01945         printf("MiniPlotMaker....\n");
01946 
01947         for(int i=0;i<3;i++)
01948         {
01949                 infiles[i]=new TChain("NueMiniPID");
01950                 infilesPOTTree[i]=new TChain("pottree");
01951                 infilesForPOTCounting[i]=new TChain("NueMiniPID");
01952         }
01953         
01954         SetWantPOTs();
01955         
01956         recoType=0;
01957         isMC=0;
01958         isMRCC=0;
01959         detector=0;
01960         horn=0;
01961         systematic=0;
01962         
01963         overwrite=1;
01964         
01965         outputFile="";
01966         
01967         maxEntries=0;
01968         
01969         for(int i=0;i<3;i++)
01970         {
01971                 infileCount[i]=0;
01972                 infilePOTTreeCount[i]=0;
01973                 infileForPOTCountingCount[i]=0;
01974         }
01975         
01976         nm = new NueMiniPID();
01977 
01978 
01979         for(int i=0;i<3;i++)
01980         for(int j=0;j<3;j++)
01981                 inputPOT[i][j]=0;
01982 
01983 }

MiniPlotMaker::~MiniPlotMaker (  ) 

Definition at line 134 of file MiniPlotMaker.cxx.

00135 {
00136 }


Member Function Documentation

int MiniPlotMaker::AddInputFiles ( string  s,
int  group = 0 
)

Definition at line 17 of file MiniPlotMaker.cxx.

References infileCount, infileForPOTCountingCount, infilePOTTreeCount, infiles, infilesForPOTCounting, and infilesPOTTree.

00018 {
00019         infileCount[group] += infiles[group]->Add(s.c_str()); 
00020         infilePOTTreeCount[group] += infilesPOTTree[group]->Add(s.c_str());
00021         infileForPOTCountingCount[group] += infilesForPOTCounting[group]->Add(s.c_str());
00022          
00023         return infileCount[group];
00024 }

void MiniPlotMaker::ApplySystematic (  )  [private]

Definition at line 2060 of file MiniPlotMaker.cxx.

References detector, NueMiniPID::event_energy, NueMiniPID::evtRecoNueEnergy, SKZPWeightCalculator::GetFluxError(), GetReweight(), isMC, NueMiniPID::MCWeight, nm, NueMiniPID::nuEnergy, NueMiniPID::nuFlavor, NueMiniPID::passes_NueStandard_PassesPreSelection, PassesNuePreselection(), skzp, and systematic.

Referenced by ProcessChain2Pairs(), ProcessChainNormal(), ProcessChainNormalMRCC(), and ProcessChainParticlePID().

02061 {
02062                 
02063         //calibrate ParticlePID energy!
02064                 
02065         if(detector==0)
02066         {
02067                 float offset =   0.489987;
02068         float slope  =  0.0387301;
02069         nm->event_energy = nm->event_energy*slope+offset;
02070         }else if(detector==1)
02071         {
02072                 float offset = 0.4803261;
02073                 float slope = 0.03799819;
02074                 nm->event_energy = nm->event_energy*slope+offset;
02075         }
02076 
02077         switch (systematic)
02078         {
02079                 case 0: //none
02080                         return;
02081                         
02082                 case 1: //shower_e_plus_11percent
02083                                 nm->event_energy*=1.11;
02084                                 nm->evtRecoNueEnergy*=1.11;
02085                                 nm->passes_NueStandard_PassesPreSelection=PassesNuePreselection();
02086                         return;
02087                         
02088                 case 2: //shower_e_minus_11percent
02089                                 nm->event_energy*=0.89;
02090                                 nm->evtRecoNueEnergy*=0.89;
02091                                 nm->passes_NueStandard_PassesPreSelection=PassesNuePreselection();
02092 
02093                         return;
02094                         
02095                 case 3: //flux_error_weight_increased
02096                                 nm->MCWeight=(isMC?nm->MCWeight:1)*skzp->GetFluxError(1,2,nm->nuFlavor,nm->nuEnergy);   
02097                         return;
02098                         
02099                 case 4: //flux_error_weight_decreased
02100                                 nm->MCWeight=(isMC?nm->MCWeight:1)*(2-skzp->GetFluxError(1,2,nm->nuFlavor,nm->nuEnergy));
02101                         return;
02102                         
02103                 case 5: //cross_section_qema_plus_15percent
02104                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(0);
02105                         return;
02106                         
02107                 case 6: //cross_section_qema_minus_15percent
02108                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(1);
02109                         return;
02110                         
02111                 case 7: //cross_section_resma_plus_15percent
02112                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(2);
02113                         return;
02114                         
02115                 case 8: //cross_section_resma_minus_15percent
02116                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(3);
02117                         return;
02118                         
02119                 case 9: //cross_section_kno_plus_50percent
02120                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(4);
02121                         return;
02122                         
02123                 case 10: //cross_section_kno_minus_50percent
02124                                 nm->MCWeight=(isMC?nm->MCWeight:1)*GetReweight(5);
02125                         return;
02126         
02127         };
02128 }

void MiniPlotMaker::CountPots ( TChain *  c,
TChain *  d,
double  rp[3] 
) [private]

Definition at line 36 of file MiniPlotMaker.cxx.

References detector, NueMiniPID::fBeam, NueMiniPID::fDet, NueMiniPID::fPOT, NueMiniPID::fRelease, MCInfo::GetMCPoT(), GetRunPeriod(), isMC, nm, NueMiniPID::passes_NueStandard_PassesDataQuality, NueMiniPID::snarl, and NueMiniPID::timestamp.

Referenced by MakePlots().

00037 {
00038         //set up chain
00039         double tpot=0;
00040         c->SetMakeClass(1);
00041         c->SetBranchStatus("*",0);
00042         c->SetBranchStatus("pot",1);
00043         c->SetBranchAddress("pot",&tpot);
00044 
00045 
00046         int nsnarls=0;
00047         c->SetBranchStatus("nsnarls",1);
00048         c->SetBranchAddress("nsnarls",&nsnarls);
00049         
00050 
00051         d->SetBranchStatus("*",1);
00052         d->SetBranchAddress("NueMiniPID",&nm);
00053         d->SetBranchStatus("*",0);
00054         d->SetBranchStatus("timestamp",1);
00055         
00056 
00057         rp[0]=0;
00058         rp[1]=0;
00059         rp[2]=0;
00060         
00061         int ent=c->GetEntries();
00062         
00063         Long64_t *offsets=d->GetTreeOffset();
00064         
00065         int snarls=0;
00066         
00067         if(!isMC || detector==0)
00068         {
00069                 for(int i=0;i<ent;i++)
00070                 {
00071                         c->GetEntry(i);
00072                         //check the timestamp of the first entry from this tree
00073                         d->GetEntry(offsets[i]);
00074                         
00075         
00076                         snarls+=nsnarls;
00077                         rp[GetRunPeriod(nm->timestamp)]+=tpot;
00078                 }
00079                 printf("estimating %d snarls...\n",snarls);
00080                 return;
00081         }
00082         
00083         //if we are here... we are doing near mc
00084         //near mc has entries from all runs in a single file!
00085         
00086         printf("counting pots for near mc\n");
00087         
00088         
00089 
00090         d->SetBranchStatus("fDet",1);
00091         d->SetBranchStatus("fBeam",1);
00092         d->SetBranchStatus("fRelease",1);
00093         d->SetBranchStatus("snarl",1);
00094         d->SetBranchStatus("fPOT",1);
00095         d->SetBranchStatus("passes_NueStandard_PassesDataQuality",1);
00096 
00097         ent = d->GetEntries();
00098         
00099         int lastsnarl=-1;
00100         for(int i=0;i<ent;i++)
00101         {
00102                 d->GetEntry(i);
00103                 snarls++;
00104                 //if(nm->snarl==lastsnarl)continue;
00105                 
00106                 if(!nm->passes_NueStandard_PassesDataQuality)continue;
00107                 if(!nm->fPOT)continue;
00108                 //a near mc will have a fPOT of -9999 when we should be counting it...
00109                 
00110                 if(isMC)
00111                 {
00112                         rp[GetRunPeriod(nm->timestamp)]+=
00113                                 MCInfo::GetMCPoT((Detector::Detector_t)nm->fDet,
00114                                         (BeamType::BeamType_t)nm->fBeam,
00115                                         (ReleaseType::Release_t)nm->fRelease);
00116                 }
00117                                 
00118                 lastsnarl=nm->snarl;
00119                 
00120         }
00121         
00122         d->SetMakeClass(0);
00123         d->ResetBranchAddresses();
00124         d->SetBranchStatus("*",0);
00125 
00126         printf("estimating %d snarls...\n",snarls);
00127 
00128         
00129 }

void MiniPlotMaker::FillHistos ( int  cut,
double  weight,
int  rp 
) [private]

Definition at line 1561 of file MiniPlotMaker.cxx.

References NueMiniPID::ann14, NueMiniPID::ann2pe, NueMiniPID::ann2pe_daikon04, detector, NueMiniPID::event_energy, NueMiniPID::evtRecoNueEnergy, hist_ann11, hist_ann11_firebird, hist_ann14, hist_lisa_recoE_ann11, hist_lisa_recoE_ann11_firebird, hist_lisa_recoE_ann14, hist_lisa_recoE_pidF, hist_lisa_trueE_recoE, hist_ntot, hist_nuEnergy, hist_pars, hist_pidA, hist_pidA_recoE, hist_pidB, hist_pidB_recoE, hist_pidC, hist_pidC_recoE, hist_pidD, hist_pidD_recoE, hist_pidE, hist_pidE_recoE, hist_pidF, hist_pidF_recoE, hist_recoE, hist_resCode, isMC, NueMiniPID::MCWeight, nm, NueMiniPID::ntot, NueMiniPID::nueClass, NueMiniPID::nuEnergy, NueMiniPID::nueOscProb, NueMiniPID::pars, NueMiniPID::pidA, NueMiniPID::pidB, NueMiniPID::pidC, NueMiniPID::pidD, NueMiniPID::pidE, NueMiniPID::pidF, recoType, and NueMiniPID::resonanceCode.

Referenced by ProcessChainNormal(), ProcessChainNormalMRCC(), and ProcessChainParticlePID().

01562 {
01563         if(isMC && (nm->nueClass<0 || nm->nueClass>4))
01564         {
01565                 printf("unknown nue class\n");
01566                 return;
01567         }
01568         
01569         //do all and also the correct run
01570         for(int rpc =0;rpc<2;rpc++)
01571         {       
01572         
01573         int rp=rpc ==0 ? 3 : myrp;
01574 
01575 
01576         if(!isMC)nm->nueClass=0;
01577         
01578         double totweight = weight;
01579         double osctotweight = totweight;
01580         if(isMC)
01581         {
01582                 totweight*=nm->MCWeight;
01583                 osctotweight*=nm->MCWeight;
01584                 if(detector==0)osctotweight*=nm->nueOscProb;
01585         }
01586 
01587 
01588         
01589         //if we are near, we want things normalized to 1e19
01590         if(detector==1)
01591         {
01592                 if(rp<3) //specific run period
01593                         ;// already normalized 
01594                 else //for all
01595                 {
01596                         totweight/=3.;  
01597                         osctotweight/=3.;
01598                 }
01599         }
01600         
01601         
01602 
01603         if(isMC)
01604         {
01605         
01606                 hist_resCode[rp][cut][5]->Fill(nm->resonanceCode,osctotweight);
01607                 if(isMC)hist_resCode[rp][cut][nm->nueClass]->Fill(nm->resonanceCode,osctotweight);
01608 
01609                 hist_nuEnergy[rp][cut][5]->Fill(nm->nuEnergy,osctotweight);
01610                 if(isMC)hist_nuEnergy[rp][cut][nm->nueClass]->Fill(nm->nuEnergy,osctotweight);
01611                 
01613                 //lisa histos
01614                 //don't oscillate!
01615                 hist_lisa_trueE_recoE[rp][cut][5]->Fill(nm->evtRecoNueEnergy, nm->nuEnergy,totweight);
01616                 if(isMC)hist_lisa_trueE_recoE[rp][cut][nm->nueClass]->Fill(nm->evtRecoNueEnergy, nm->nuEnergy,totweight);
01617                 //lisa histos
01619         }
01620         
01621 
01623         //lisa histos   
01624 
01625         double recoE=0;
01626         if(recoType==0 )
01627                 recoE=nm->evtRecoNueEnergy;
01628         if(recoType==1 ) // || cut==4 )
01629                 recoE=nm->event_energy;
01630 
01631 
01632         hist_lisa_recoE_pidF[rp][cut][5]->Fill(nm->pidF, recoE,osctotweight);
01633         if(isMC)hist_lisa_recoE_pidF[rp][cut][nm->nueClass]->Fill(nm->pidF, recoE,osctotweight);
01634                 
01635         hist_lisa_recoE_ann11[rp][cut][5]->Fill(nm->ann2pe_daikon04, recoE,osctotweight);
01636         if(isMC)hist_lisa_recoE_ann11[rp][cut][nm->nueClass]->Fill(nm->ann2pe_daikon04, recoE,osctotweight);
01637                 
01638         hist_lisa_recoE_ann11_firebird[rp][cut][5]->Fill(nm->ann2pe, recoE,osctotweight);
01639         if(isMC)hist_lisa_recoE_ann11_firebird[rp][cut][nm->nueClass]->Fill(nm->ann2pe, recoE,osctotweight);
01640                 
01641         hist_lisa_recoE_ann14[rp][cut][5]->Fill(nm->ann14, recoE,osctotweight);
01642         if(isMC)hist_lisa_recoE_ann14[rp][cut][nm->nueClass]->Fill(nm->ann14, recoE,osctotweight);
01643         //lisa histos
01645 
01646         if(recoType==0)
01647         {
01648         
01649                 hist_ann11[rp][cut][5]->Fill(nm->ann2pe_daikon04,osctotweight);
01650                 if(isMC)hist_ann11[rp][cut][nm->nueClass]->Fill(nm->ann2pe_daikon04,osctotweight);
01651         
01652                 hist_ann11_firebird[rp][cut][5]->Fill(nm->ann2pe,osctotweight);
01653                 if(isMC)hist_ann11_firebird[rp][cut][nm->nueClass]->Fill(nm->ann2pe,osctotweight);      
01654 
01655                 hist_ann14[rp][cut][5]->Fill(nm->ann14,osctotweight);
01656                 if(isMC)hist_ann14[rp][cut][nm->nueClass]->Fill(nm->ann14,osctotweight);
01657 
01658 
01659         }
01660 
01661         
01662         if(recoType==0 )//&& cut<4)
01663         {
01664                 hist_recoE[rp][cut][5]->Fill(nm->evtRecoNueEnergy,osctotweight);
01665                 if(isMC)hist_recoE[rp][cut][nm->nueClass]->Fill(nm->evtRecoNueEnergy,osctotweight);
01666         }
01667         
01668         
01669         if(recoType==1 ) // || cut==4 )
01670         {
01671                 hist_recoE[rp][cut][5]->Fill(nm->event_energy,osctotweight);
01672                 if(isMC)hist_recoE[rp][cut][nm->nueClass]->Fill(nm->event_energy,osctotweight); 
01673         }
01674         
01675         if( 1 || recoType==1 || (recoType==0 && isMC==1 && detector==1))  
01676         //for debugging with anna's results... want a detail of variables in near mc standard hornON normal
01677         {                       
01678                 hist_ntot[rp][cut][5]->Fill(nm->ntot,osctotweight);
01679                 if(isMC)hist_ntot[rp][cut][nm->nueClass]->Fill(nm->ntot,osctotweight);
01680                 
01681                 
01682                 hist_pidA[rp][cut][5]->Fill(nm->pidA,osctotweight);
01683                 if(isMC)hist_pidA[rp][cut][nm->nueClass]->Fill(nm->pidA,osctotweight);  
01684                         
01685                 hist_pidB[rp][cut][5]->Fill(nm->pidB,osctotweight);
01686                 if(isMC)hist_pidB[rp][cut][nm->nueClass]->Fill(nm->pidB,osctotweight);          
01687                 
01688                 hist_pidC[rp][cut][5]->Fill(nm->pidC,osctotweight);
01689                 if(isMC)hist_pidC[rp][cut][nm->nueClass]->Fill(nm->pidC,osctotweight);          
01690                 
01691                 hist_pidD[rp][cut][5]->Fill(nm->pidD,osctotweight);
01692                 if(isMC)hist_pidD[rp][cut][nm->nueClass]->Fill(nm->pidD,osctotweight);          
01693                 
01694                 hist_pidE[rp][cut][5]->Fill(nm->pidE,osctotweight);
01695                 if(isMC)hist_pidE[rp][cut][nm->nueClass]->Fill(nm->pidE,osctotweight);          
01696                 
01697                 hist_pidF[rp][cut][5]->Fill(nm->pidF,osctotweight);
01698                 if(isMC)hist_pidF[rp][cut][nm->nueClass]->Fill(nm->pidF,osctotweight);
01699                 
01700                 
01701                 hist_pidA_recoE[rp][cut][5]->Fill(nm->pidA,nm->event_energy,osctotweight);
01702                 if(isMC)hist_pidA_recoE[rp][cut][nm->nueClass]->Fill(nm->pidA,nm->event_energy,osctotweight);
01703                 
01704                 hist_pidB_recoE[rp][cut][5]->Fill(nm->pidB,nm->event_energy,osctotweight);
01705                 if(isMC)hist_pidB_recoE[rp][cut][nm->nueClass]->Fill(nm->pidB,nm->event_energy,osctotweight);
01706                 
01707                 hist_pidC_recoE[rp][cut][5]->Fill(nm->pidC,nm->event_energy,osctotweight);
01708                 if(isMC)hist_pidC_recoE[rp][cut][nm->nueClass]->Fill(nm->pidC,nm->event_energy,osctotweight);
01709                 
01710                 hist_pidD_recoE[rp][cut][5]->Fill(nm->pidD,nm->event_energy,osctotweight);
01711                 if(isMC)hist_pidD_recoE[rp][cut][nm->nueClass]->Fill(nm->pidD,nm->event_energy,osctotweight);
01712                 
01713                 hist_pidE_recoE[rp][cut][5]->Fill(nm->pidE,nm->event_energy,osctotweight);
01714                 if(isMC)hist_pidE_recoE[rp][cut][nm->nueClass]->Fill(nm->pidE,nm->event_energy,osctotweight);
01715                 
01716                 hist_pidF_recoE[rp][cut][5]->Fill(nm->pidF,nm->event_energy,osctotweight);
01717                 if(isMC)hist_pidF_recoE[rp][cut][nm->nueClass]->Fill(nm->pidF,nm->event_energy,osctotweight);
01718                 
01719                                 
01720 
01721                 for(int i=0;i<14;i++)
01722                 {
01723                         double pv=nm->pars[i];
01724                         
01725                         //we don't want to draw all values...
01726                         switch(i)
01727                         {
01728                                 case 2:
01729                                         if(pv==0)continue;
01730                                         break;
01731                                 case 6:
01732                                         if(pv==0)continue;
01733                                         if(pv>1.4499)continue;
01734                                         if(pv==0.5)continue;
01735                                         break;
01736                                 case 7:
01737                                         if(pv==0)continue;
01738                                         break;
01739                                 case 8:
01740                                         if(pv==0)continue;
01741                                         break;
01742                                 case 9:
01743                                         if(pv==0)continue;
01744                                         break;
01745                                 case 10:
01746                                         if(pv==0)continue;
01747                                         break;
01748                                 case 11:
01749                                         if(pv<1.5001)continue;
01750                                         if(pv>4.9999)continue;
01751                                         if(pv==3)continue;
01752                                         if(pv==0)continue;
01753                                         break;
01754                                 case 13:
01755                                         if(pv==0)continue;
01756                                         break;
01757                         
01758                         }
01759                 
01760                         hist_pars[i][rp][cut][5]->Fill(pv,osctotweight);
01761                         if(isMC)hist_pars[i][rp][cut][nm->nueClass]->Fill(pv,osctotweight);                             
01762                 }
01763 
01764         }
01765 
01766 
01767 }
01768 
01769 }

string MiniPlotMaker::GetCutName ( int  cut  )  [private]

Definition at line 662 of file MiniPlotMaker.cxx.

References recoType.

Referenced by SaveHistos().

00663 {
00664         switch (recoType)
00665         {
00666                 case 0:
00667                         switch (cut)
00668                         {
00669                                 case 0:
00670                                         return "fiducial";
00671                                 case 1:
00672                                         return "presel";
00673                                 case 2:
00674                                         return "ann11";
00675                                 case 3:
00676                                         return "ann11_firebird";
00677                                 case 4:
00678                                         return "pidF";
00679                                 case 5:
00680                                         return "ann14";
00681                         
00682                         };
00683                 case 1:
00684                         switch (cut)
00685                         {
00686                                 case 0:
00687                                         return "fiducial";
00688                                 case 1:
00689                                         return "presel";
00690                                 case 2:
00691                                         return "pidA";
00692                                 case 3:
00693                                         return "pidB";                  
00694                                 case 4:
00695                                         return "pidC";
00696                                 case 5:
00697                                         return "pidD";          
00698                                 case 6:
00699                                         return "pidE";
00700                                 case 7:
00701                                         return "pidF";                                                                          
00702                         };
00703                 
00704         };
00705 
00706         return "?";
00707 }

string MiniPlotMaker::GetDetectorString (  )  [private]

Definition at line 1869 of file MiniPlotMaker.cxx.

References detector.

Referenced by GetDirectory(), GetDirectoryString(), and PrintConfigs().

01870 {
01871         switch (detector)
01872         {
01873                 case 0:
01874                         return "far";
01875                 case 1:
01876                         return "near";
01877         };
01878         return "?";
01879 }

string MiniPlotMaker::GetDirectory (  )  [private]

Definition at line 1820 of file MiniPlotMaker.cxx.

References det, GetDetectorString(), GetMCString(), GetMRCCString(), and GetRecoTypeString().

Referenced by MakeDirectory(), PrintConfigs(), and SaveHistos().

01821 {
01822         string reco = GetRecoTypeString();
01823         string mc = GetMCString();
01824         string mrcc = GetMRCCString();
01825         string det = GetDetectorString();
01826 
01827         return "/"+det+"/"+mc+"/"+mrcc+"/"+reco;
01828 }

string MiniPlotMaker::GetDirectoryString (  )  [private]

Definition at line 1773 of file MiniPlotMaker.cxx.

References detector, GetDetectorString(), GetHornString(), GetMCString(), GetMRCCString(), GetRecoTypeString(), and GetSystematic().

Referenced by MakeDirectory(), and SaveHistos().

01774 {
01775         string stage="stage0";
01776         
01777         
01778         stage+="/"+GetSystematic();
01779         stage+="/"+GetDetectorString();
01780         stage+="/"+GetMCString();       
01781         stage+="/"+GetMRCCString();
01782 
01783         if(detector==1)//need to show the hornoff/on 
01784         {
01785                 stage+="/"+GetHornString();
01786         }
01787         
01788         
01789         
01790         stage+="/"+GetRecoTypeString();
01791         return stage;
01792 
01793 }

vector< string > MiniPlotMaker::GetFileList ( TChain *  c  )  [private]

Definition at line 1806 of file MiniPlotMaker.cxx.

References MuELoss::a.

Referenced by PrintConfigs().

01807 {
01808         vector<string> a;
01809         
01810         TObjArray *fileElements=c->GetListOfFiles();
01811     TIter next(fileElements);
01812     TChainElement *chEl=0;
01813     while (( chEl=(TChainElement*)next() )) {
01814          a.push_back(chEl->GetTitle());
01815     }
01816 
01817         return a;
01818 }

string MiniPlotMaker::GetHornString (  )  [private]

Definition at line 1881 of file MiniPlotMaker.cxx.

References horn.

Referenced by GetDirectoryString(), and PrintConfigs().

01882 {
01883         switch (horn)
01884         {
01885                 case 0:
01886                         return "horn_on";
01887                 case 1:
01888                         return "horn_off";
01889         };
01890         return "?";
01891 }

string MiniPlotMaker::GetMCString (  )  [private]

Definition at line 1843 of file MiniPlotMaker.cxx.

References isMC.

Referenced by GetDirectory(), GetDirectoryString(), and PrintConfigs().

01844 {
01845         switch(isMC)
01846         {
01847                 case 0:
01848                         return "data";
01849                 case 1:
01850                         return "MC";
01851         };
01852         return "?";
01853 }

string MiniPlotMaker::GetMRCCQPCut ( int  cut  )  [private]

Definition at line 1895 of file MiniPlotMaker.cxx.

Referenced by SaveHistos().

01896 {
01897         switch(cut)
01898         {
01899                 case 0:return "mrcc_all";
01900                 case 1:return "mrcc_numu";
01901                 case 2:return "mrcc_antinumu01";
01902                 case 3:return "mrcc_antinumu04";
01903         }
01904         return "?";
01905 }

string MiniPlotMaker::GetMRCCString (  )  [private]

Definition at line 1856 of file MiniPlotMaker.cxx.

References isMRCC.

Referenced by GetDirectory(), GetDirectoryString(), and PrintConfigs().

01857 {
01858         switch (isMRCC)
01859         {
01860                 case 0:
01861                         return "standard";
01862                 case 1:
01863                         return "MRCC";
01864         };
01865         return "?";
01866 }

int MiniPlotMaker::GetNCuts (  )  [private]

Definition at line 649 of file MiniPlotMaker.cxx.

References recoType.

Referenced by MakeHistos(), ProcessChainNormalMRCC(), and SaveHistos().

00650 {
00651         switch (recoType)
00652         {
00653                 case 0:
00654                         return 6;
00655                 case 1:
00656                         return 8;
00657         
00658         };
00659         return 0;
00660 }

string MiniPlotMaker::GetNueClassSuffix ( int  j  )  [private]

Definition at line 628 of file MiniPlotMaker.cxx.

Referenced by SaveHistos().

00629 {
00630         switch(j)
00631         {
00632                 case 0:
00633                         return "_nc";
00634                 case 1:
00635                         return "_cc";
00636                 case 2:
00637                         return "_sig";
00638                 case 3:
00639                         return "_tau";
00640                 case 4:
00641                         return "_beam";
00642                 case 5:
00643                         return "";
00644         }
00645 
00646         return "?";
00647 }

string MiniPlotMaker::GetRecoTypeString (  )  [private]

Definition at line 1830 of file MiniPlotMaker.cxx.

References recoType.

Referenced by GetDirectory(), GetDirectoryString(), and PrintConfigs().

01831 {
01832         switch (recoType)
01833         {
01834                 case 0:
01835                         return "normal";
01836                 case 1:
01837                         return "ParticlePID";
01838         };
01839         return "?";
01840 }

double MiniPlotMaker::GetReweight ( int  type  )  [private]

Definition at line 2131 of file MiniPlotMaker.cxx.

References NueMiniPID::atomicNumber, NueMiniPID::atomicWeight, NueMiniPID::bjorkenX, Registry::Clear(), MCReweight::ComputeWeight(), ReweightHelpers::FindNucleusNumber(), MCEventInfo::had_fs, NueMiniPID::hadronicFinalState, NueMiniPID::hadronicY, MCEventInfo::iaction, MCEventInfo::initial_state, NueMiniPID::initialState, NueMiniPID::interactionType, MCEventInfo::inu, MCEventInfo::iresonance, lastReweightType, Registry::LockKeys(), Registry::LockValues(), mcr, nm, MCEventInfo::nucleus, NueMiniPID::nuDCosX, NueMiniPID::nuDCosY, NueMiniPID::nuDCosZ, MCEventInfo::nuE, NueMiniPID::nuEnergy, NueMiniPID::nuFlavor, MCEventInfo::nuPx, MCEventInfo::nuPy, MCEventInfo::nuPz, MCEventInfo::q2, NueMiniPID::q2, NueMiniPID::resonanceCode, rwtconfig, Registry::Set(), MCEventInfo::tarE, NueMiniPID::targetEnergy, NueMiniPID::targetPX, NueMiniPID::targetPY, NueMiniPID::targetPZ, MCEventInfo::tarPx, MCEventInfo::tarPy, MCEventInfo::tarPz, Registry::UnLockKeys(), Registry::UnLockValues(), MCEventInfo::UseStoredXSec(), NueMiniPID::w2, MCEventInfo::w2, MCEventInfo::x, and MCEventInfo::y.

Referenced by ApplySystematic().

02132 {
02133 
02134         bool reset=false;
02135         if(lastReweightType!=type)
02136         {
02137                 rwtconfig->UnLockValues();
02138                 rwtconfig->UnLockKeys();
02139                 rwtconfig->Clear();
02140                 rwtconfig->Set("neugen:use_scale_factors",1);
02141         
02142                 switch(type)
02143                 {
02144                         case 0:
02145                                 rwtconfig->Set("neugen:ma_qe",1.15);break;
02146                         case 1:
02147                                     rwtconfig->Set("neugen:ma_qe",0.85);break;
02148                         case 2:
02149                             rwtconfig->Set("neugen:ma_res",1.15);break;
02150                         case 3:
02151                                 rwtconfig->Set("neugen:ma_res",0.85);break;
02152                         case 4:
02153                                 rwtconfig->Set("neugen:scale_kno_all",1.5);break;
02154                         case 5:
02155                                 rwtconfig->Set("neugen:scale_kno_all",0.5);break;
02156                 
02157                 };
02158                 rwtconfig->LockValues();
02159                 rwtconfig->LockKeys();
02160                 lastReweightType=type;
02161                 reset=true;
02162         }
02163         
02164         
02165     MCEventInfo ei;
02166 
02168     ei.UseStoredXSec(false);
02169     ei.nuE=nm->nuEnergy;
02170     ei.nuPx=nm->nuDCosX*sqrt(nm->nuEnergy*nm->nuEnergy);
02171     ei.nuPy=nm->nuDCosY*sqrt(nm->nuEnergy*nm->nuEnergy);
02172     ei.nuPz=nm->nuDCosZ*sqrt(nm->nuEnergy*nm->nuEnergy);
02173     ei.tarE=nm->targetEnergy;
02174     ei.tarPx=nm->targetPX;
02175     ei.tarPy=nm->targetPY;
02176     ei.tarPz=nm->targetPZ;
02177     ei.y=nm->hadronicY;
02178     ei.x=nm->bjorkenX;
02179     ei.q2=nm->q2;
02180     ei.w2=nm->w2;
02181     ei.iaction=nm->interactionType;
02182     ei.inu=nm->nuFlavor;
02183     ei.iresonance=nm->resonanceCode;
02184     ei.initial_state=nm->initialState;
02185     ei.nucleus=ReweightHelpers::FindNucleusNumber((int)nm->atomicNumber,
02186                                                     (int)nm->atomicWeight);
02187     ei.had_fs=nm->hadronicFinalState;
02188 
02189   if(ei.inu<-9998 ||
02190      (ei.iresonance==1003 && TMath::Abs(ei.had_fs)<200) ) return 1;
02191 
02192 
02193     NuParent *nuparent = 0;
02194     double xsw=1;
02195 
02196     if(reset)xsw = mcr->ComputeWeight(&ei,nuparent,rwtconfig);
02197    else xsw = mcr->ComputeWeight(&ei,nuparent);
02198 
02199 
02200         return xsw;
02201 }

string MiniPlotMaker::GetRunName ( int  j  )  [private]

Definition at line 614 of file MiniPlotMaker.cxx.

Referenced by SaveHistos().

00615 {
00616         switch(j)
00617         {
00618                 case 0:return "Run1";
00619                 case 1:return "Run2";
00620                 case 2:return "Run3";
00621                 case 3:return "All";
00622         };
00623 
00624         return "?";
00625 }

int MiniPlotMaker::GetRunPeriod ( time_t  ts  )  [private]

Definition at line 27 of file MiniPlotMaker.cxx.

Referenced by CountPots(), ProcessChain2Pairs(), ProcessChainNormal(), ProcessChainNormalMRCC(), and ProcessChainParticlePID().

00028 {
00029                 
00030         if(ts<1145036420)return 0;
00031         if(ts<1190028111)return 1;
00032                 
00033         return 2;
00034 }

string MiniPlotMaker::GetSystematic (  )  [private]

Definition at line 2028 of file MiniPlotMaker.cxx.

References systematic.

Referenced by GetDirectoryString(), and PrintConfigs().

02029 {
02030         switch (systematic)
02031         {
02032                 case 0:
02033                         return "full";
02034                 case 1:
02035                         return "shower_e_plus_11percent";
02036                 case 2:
02037                         return "shower_e_minus_11percent";
02038                 case 3:
02039                         return "flux_error_weight_increased";
02040                 case 4:
02041                         return "flux_error_weight_decreased";
02042                 case 5:
02043                         return "cross_section_qema_plus_15percent";
02044                 case 6:
02045                         return "cross_section_qema_minus_15percent";
02046                 case 7:
02047                         return "cross_section_resma_plus_15percent";
02048                 case 8:
02049                         return "cross_section_resma_minus_15percent";
02050                 case 9:
02051                         return "cross_section_kno_plus_50percent";
02052                 case 10:
02053                         return "cross_section_kno_minus_50percent";
02054         };
02055         return "?";
02056 
02057 
02058 }

TDirectory * MiniPlotMaker::MakeDirectory ( TFile *  f  )  [private]

Definition at line 1796 of file MiniPlotMaker.cxx.

References GetDirectory(), and GetDirectoryString().

Referenced by MakePlots().

01797 {
01798 
01799 
01800         string stage=GetDirectoryString();
01801 
01802         return DirectoryHelpers::GetDirectory(f,stage,2);
01803 }

void MiniPlotMaker::MakeHistos (  )  [private]

Definition at line 1265 of file MiniPlotMaker.cxx.

References GetNCuts(), hist_ann11, hist_ann11_firebird, hist_ann14, hist_lisa_recoE_ann11, hist_lisa_recoE_ann11_firebird, hist_lisa_recoE_ann14, hist_lisa_recoE_pidF, hist_lisa_trueE_recoE, hist_ntot, hist_nuEnergy, hist_pars, hist_pidA, hist_pidA_recoE, hist_pidB, hist_pidB_recoE, hist_pidC, hist_pidC_recoE, hist_pidD, hist_pidD_recoE, hist_pidE, hist_pidE_recoE, hist_pidF, hist_pidF_recoE, hist_pids_PID_ann, hist_recoE, hist_resCode, isMC, isMRCC, max, and min.

Referenced by MakePlots().

01266 {
01267 
01269         //lisa histos params
01270         
01271         vector<double>RecoEdges;
01272         vector<double>TrueEdges;
01273         vector<double>PIDEdges;
01274         
01275         int nReco = 100;
01276         for(int i=0;i<nReco+1;i++)
01277         {
01278                 RecoEdges.push_back(i*1.);
01279         }
01280         int nTrue = 1200;
01281         for(int i=0;i<nTrue+1;i++)
01282         {
01283                 TrueEdges.push_back(i*0.1);
01284         }
01285         int nPID = 20;
01286         for(int i=0;i<nPID+1;i++)
01287         {
01288                 PIDEdges.push_back(i*0.05);
01289         }
01290         
01291         
01292         double *redges = new double[nReco+1];
01293         double *tedges = new double[nTrue+1];
01294         double *pedges = new double[nPID+1];
01295 
01296         for(int i=0;i<nReco+1;i++)
01297         {
01298                 redges[i] = RecoEdges[i];
01299         }
01300         for(int i=0;i<nTrue+1;i++)
01301         {
01302                 tedges[i] = TrueEdges[i];
01303         }
01304         for(int i=0;i<nPID+1;i++)
01305         {
01306                 pedges[i] = PIDEdges[i];
01307         }
01308         //lisa histos params
01310 
01311 
01312         int cuts=GetNCuts();
01313         
01314         if(isMRCC)cuts*=4;
01315 
01316         int start= isMC ? 0 :5;
01317 
01318         char tmp[500];
01319         
01320         for(int rp=0;rp<4;rp++)
01321         {
01322 
01323         for(int j=start;j<6;j++)
01324         {
01325 
01326                         sprintf(tmp,"pids_PID_ann_%d_%d",rp,j);
01327                         hist_pids_PID_ann[rp][j] = new TH2D(tmp,tmp,1000,-0.5,1.5,1000,-0.5,1.5);
01328 //                      hist_pids_PID_ann[rp][j]->Sumw2();
01329                 
01330         for(int i=0;i<cuts;i++)
01331         {
01332 
01333                 
01334                 sprintf(tmp,"recoE_%d_%d_%d",rp,i,j);
01335                 hist_recoE[rp][i][j]=new TH1D(tmp,tmp,20,0,10);
01336 //              hist_recoE[rp][i][j]->Sumw2();
01337 
01338 
01340                 //lisa histos
01341                 if(isMC)
01342                 {
01343                         sprintf(tmp,"lisa_trueE_recoE_%d_%d_%d",rp,i,j);
01344                         hist_lisa_trueE_recoE[rp][i][j] = new TH2D(tmp,tmp,nReco,redges,nTrue,tedges);
01345 //                      hist_lisa_trueE_recoE[rp][i][j]->Sumw2();
01346                 }
01347                 
01348 
01349                 sprintf(tmp,"lisa_recoE_pidF_%d_%d_%d",rp,i,j);
01350                 hist_lisa_recoE_pidF[rp][i][j] = new TH2D(tmp,tmp,nPID,pedges,nReco,redges);
01351 //              hist_lisa_recoE_pidF[rp][i][j]->Sumw2();
01352                 
01353                
01354 
01355                 sprintf(tmp,"lisa_recoE_ann11_%d_%d_%d",rp,i,j);
01356                 hist_lisa_recoE_ann11[rp][i][j] = new TH2D(tmp,tmp,nPID,pedges,nReco,redges);
01357 //              hist_lisa_recoE_ann11[rp][i][j]->Sumw2();
01358                 
01359               
01360 
01361 
01362                 sprintf(tmp,"lisa_recoE_ann11_firebird_%d_%d_%d",rp,i,j);
01363                 hist_lisa_recoE_ann11_firebird[rp][i][j] = new TH2D(tmp,tmp,nPID,pedges,nReco,redges);
01364 //              hist_lisa_recoE_ann11_firebird[rp][i][j]->Sumw2();
01365                 
01366              
01367 
01368 
01369                 sprintf(tmp,"lisa_recoE_ann14_%d_%d_%d",rp,i,j);
01370                 hist_lisa_recoE_ann14[rp][i][j] = new TH2D(tmp,tmp,nPID,pedges,nReco,redges);
01371 //              hist_lisa_recoE_ann14[rp][i][j]->Sumw2();
01372 
01373             
01374 
01375                 //lisa histos
01377 
01378 
01379                 if(isMC)
01380                 {
01381                         sprintf(tmp,"resCode_%d_%d_%d",rp,i,j);
01382                         hist_resCode[rp][i][j]=new TH1D(tmp,tmp,5,1001,1006);
01383 //                      hist_resCode[rp][i][j]->Sumw2();
01384                 
01385                         sprintf(tmp,"nuEnergy_%d_%d_%d",rp,i,j);
01386                         hist_nuEnergy[rp][i][j]=new TH1D(tmp,tmp,20,0,10);
01387 //                      hist_nuEnergy[rp][i][j]->Sumw2();
01388                 }
01389                 
01390                 
01391                         sprintf(tmp,"ann11_%d_%d_%d",rp,i,j);
01392                         hist_ann11[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01393 //                      hist_ann11[rp][i][j]->Sumw2();
01394                 
01395                         sprintf(tmp,"ann11_firebird_%d_%d_%d",rp,i,j);
01396                         hist_ann11_firebird[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01397 //                      hist_ann11_firebird[rp][i][j]->Sumw2();                         
01398         
01399                         sprintf(tmp,"ann14_%d_%d_%d",rp,i,j);
01400                         hist_ann14[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01401   //                      hist_ann14[rp][i][j]->Sumw2();
01402 
01403         
01404                 
01405                         sprintf(tmp,"ntot_%d_%d_%d",rp,i,j);
01406                         hist_ntot[rp][i][j]=new TH1D(tmp,tmp,100,0,100);
01407 //                      hist_ntot[rp][i][j]->Sumw2();                   
01408 
01409                         sprintf(tmp,"pidA_%d_%d_%d",rp,i,j);
01410                         hist_pidA[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01411 //                      hist_pidA[rp][i][j]->Sumw2();   
01412 
01413                         sprintf(tmp,"pidB_%d_%d_%d",rp,i,j);
01414                         hist_pidB[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01415 //                      hist_pidB[rp][i][j]->Sumw2();   
01416                         
01417                         sprintf(tmp,"pidC_%d_%d_%d",rp,i,j);
01418                         hist_pidC[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01419 //                      hist_pidC[rp][i][j]->Sumw2();   
01420                         
01421                         sprintf(tmp,"pidD_%d_%d_%d",rp,i,j);
01422                         hist_pidD[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01423 //                      hist_pidD[rp][i][j]->Sumw2();   
01424                         
01425                         sprintf(tmp,"pidE_%d_%d_%d",rp,i,j);
01426                         hist_pidE[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01427 //                      hist_pidE[rp][i][j]->Sumw2();   
01428                         
01429                         sprintf(tmp,"pidF_%d_%d_%d",rp,i,j);
01430                         hist_pidF[rp][i][j]=new TH1D(tmp,tmp,150,-0.5,1.5);
01431 //                      hist_pidF[rp][i][j]->Sumw2();                           
01432 
01433 
01434                         sprintf(tmp,"pidA_recoE_%d_%d_%d",rp,i,j);
01435                         hist_pidA_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01436 //                      hist_pidA_recoE[rp][i][j]->Sumw2();     
01437                         
01438                         sprintf(tmp,"pidB_recoE_%d_%d_%d",rp,i,j);
01439                         hist_pidB_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01440 //                      hist_pidB_recoE[rp][i][j]->Sumw2();     
01441                         
01442                         sprintf(tmp,"pidC_recoE_%d_%d_%d",rp,i,j);
01443                         hist_pidC_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01444 //                      hist_pidC_recoE[rp][i][j]->Sumw2();     
01445                         
01446                         sprintf(tmp,"pidD_recoE_%d_%d_%d",rp,i,j);
01447                         hist_pidD_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01448 //                      hist_pidD_recoE[rp][i][j]->Sumw2();     
01449                         
01450                         sprintf(tmp,"pidE_recoE_%d_%d_%d",rp,i,j);
01451                         hist_pidE_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01452 //                      hist_pidE_recoE[rp][i][j]->Sumw2();     
01453                         
01454                         sprintf(tmp,"pidF_recoE_%d_%d_%d",rp,i,j);
01455                         hist_pidF_recoE[rp][i][j]=new TH2D(tmp,tmp,150,-0.5,1.5,20,0,10);
01456 //                      hist_pidF_recoE[rp][i][j]->Sumw2();     
01457 
01458 
01459 
01460                         for(int k=0;k<14;k++)
01461                         {
01462                                 int nbin=1;
01463                                 double min=0;
01464                                 double max=1;
01465                                 switch(k)
01466                                 {
01467                                         case 0:
01468                                                 nbin=300;
01469                                                 min=0;
01470                                                 max=3;
01471                                                 break;
01472                                         case 1:
01473                                                 nbin=200;
01474                                                 min=0;
01475                                                 max=0.1;
01476                                                 break;
01477                                         case 2:
01478                                                 nbin=100;
01479                                                 min=0;
01480                                                 max=1;
01481                                                 break;
01482                                         case 3:
01483                                                 nbin=50;
01484                                                 min=0;
01485                                                 max=50;
01486                                                 break;
01487                                         case 4:
01488                                                 nbin=100;
01489                                                 min=0;
01490                                                 max=1.2;
01491                                                 break;
01492                                         case 5:
01493                                                 nbin=100;
01494                                                 min=0;
01495                                                 max=1;
01496                                                 break;
01497                                         case 6:
01498                                                 nbin=100;
01499                                                 min=0;
01500                                                 max=1.5;
01501                                                 break;
01502                                         case 7:
01503                                                 nbin=100;
01504                                                 min=0;
01505                                                 max=8000;
01506                                                 break;
01507                                         case 8:
01508                                                 nbin=100;
01509                                                 min=0;
01510                                                 max=500;
01511                                                 break;
01512                                         case 9:
01513                                                 nbin=100;
01514                                                 min=-20;
01515                                                 max=20;
01516                                                 break;
01517                                         case 10:
01518                                                 nbin=100;
01519                                                 min=0;
01520                                                 max=1.5;
01521                                                 break;
01522                                         case 11:
01523                                                 nbin=100;
01524                                                 min=0;
01525                                                 max=6;
01526                                                 break;
01527                                         case 12:
01528                                                 nbin=100;
01529                                                 min=0;
01530                                                 max=50;
01531                                                 break;
01532                                         case 13:
01533                                                 nbin=100;
01534                                                 min=0;
01535                                                 max=0.005;
01536                                                 break;
01537                                 }
01538                                 sprintf(tmp,"pars_%d_%d_%d_%d",rp,k,i,j);
01539                                 hist_pars[k][rp][i][j]=new TH1D(tmp,tmp,nbin,min,max);
01540 //                              hist_pars[k][rp][i][j]->Sumw2();        
01541                         }
01542 
01543                 
01544                 
01545                 
01546         }
01547         }
01548         }
01549         
01550 
01551 
01552 
01553         delete [] redges;
01554         delete [] tedges;
01555         delete [] pedges;
01556 
01557         
01558 }

void MiniPlotMaker::MakePlots (  ) 

Definition at line 138 of file MiniPlotMaker.cxx.

References CountPots(), detector, infileCount, infilePOTTreeCount, infiles, infilesForPOTCounting, infilesPOTTree, inputPOT, isMC, isMRCC, MakeDirectory(), MakeHistos(), outfile, outputFile, overwrite, potratios, potratios_mrcc, PrintConfigs(), ProcessChain2Pairs(), ProcessChainNormal(), ProcessChainNormalMRCC(), ProcessChainParticlePID(), recoType, SaveHistos(), SetUpChain(), and wantPOTs.

00139 {
00140 
00141         //check the input counts to make sure we don't have bogus files...
00142         int fcheck = infileCount[0] == infilePOTTreeCount[0];
00143         fcheck = fcheck && infileCount[0] == infilePOTTreeCount[0];
00144         fcheck = fcheck && infileCount[0] == infilePOTTreeCount[0];
00145 
00146         if(!fcheck)
00147         {
00148                 printf("NueMini/POTTree count mismatch!\n");
00149                 return;
00150         }
00151 
00152         PrintConfigs();
00153 
00154         outfile=0;
00155         
00156         if(outputFile!="" && !overwrite)outfile=new TFile(outputFile.c_str(),"UPDATE"); 
00157         if(outputFile!="" && overwrite)outfile=new TFile(outputFile.c_str(),"RECREATE");
00158         if(!outfile)
00159         {
00160                 printf("error opening output file %s\n",outputFile.c_str());
00161                 return;
00162         }
00163 
00164         outfile->SetCompressionLevel(9);
00165 
00166         TDirectory *workingDir = MakeDirectory(outfile);
00167         workingDir->cd();
00168 
00169         //make histos.....
00170         MakeHistos();
00171 
00172 
00173 
00174         //compute pots
00175         double weight[3][3];
00176         for(int i=0;i<3;i++)
00177         for(int j=0;j<3;j++)weight[i][j]=0;
00178 
00179 
00180         fstream file_list("filelist",fstream::out | fstream::app);
00181 
00182         for(int i=0;i<3;i++)
00183         {
00184                 CountPots(infilesPOTTree[i],
00185                         infilesForPOTCounting[i],       
00186                         weight[i]);
00187                 
00188                 weight[i][0]*=1e12;
00189                 weight[i][1]*=1e12;
00190                 weight[i][2]*=1e12;
00191                 
00192                 //save a record for the tree!
00193                 for(int j=0;j<3;j++)
00194                         inputPOT[i][j]=weight[i][j];    
00195                 
00196                 
00197                 char tmp[500];
00198                 printf("group %d has %e pots %e %e %e\n",i,(weight[i][0]+weight[i][1]+weight[i][2]),    
00199                         weight[i][0],weight[i][1],weight[i][2]);
00200 
00201                 sprintf(tmp,"group %d has %e pots %e %e %e\n",i,(weight[i][0]+weight[i][1]+weight[i][2]),       
00202                         weight[i][0],weight[i][1],weight[i][2]);
00203                         
00204                 file_list<<tmp; 
00205                         
00206                 if(isMC)
00207                 {       
00208                 
00209                         //in the near, we are normalizing each run to the same...
00210                         if(detector==1)
00211                         {
00212                                 if(weight[i][0])weight[i][0]=wantPOTs/weight[i][0];
00213                                 if(weight[i][1])weight[i][1]=wantPOTs/weight[i][1];
00214                                 if(weight[i][2])weight[i][2]=wantPOTs/weight[i][2];                                             
00215                         }else{
00216                 
00217                                 if(weight[i][0] && weight[i][1] && weight[i][2])
00218                                 {
00219                                         if(!isMRCC){
00220                                                 weight[i][0]=1./weight[i][0]*potratios[0];
00221                                                 weight[i][1]=1./weight[i][1]*potratios[1];
00222                                                 weight[i][2]=1./weight[i][2]*potratios[2];
00223                                         }else{
00224                                                 weight[i][0]=1./weight[i][0]*potratios_mrcc[0];
00225                                                 weight[i][1]=1./weight[i][1]*potratios_mrcc[1];
00226                                                 weight[i][2]=1./weight[i][2]*potratios_mrcc[2];
00227                                         }
00228                                 }
00229                         
00230                                 //a testing scenario when we only have a single run of data
00231                                 if(weight[i][0] && !weight[i][1] && !weight[i][2])
00232                                 {
00233                                         weight[i][0]=1./weight[i][0];
00234                                 }
00235                         }               
00236                         
00237                 }else{
00238                         //in data, we already have events with proper weight ratios
00239                         //but we normalize the near
00240                         if(detector==1)
00241                         {
00242                                 if(weight[i][0])weight[i][0]=wantPOTs/weight[i][0];
00243                                 if(weight[i][1])weight[i][1]=wantPOTs/weight[i][1];
00244                                 if(weight[i][2])weight[i][2]=wantPOTs/weight[i][2];
00245                         }
00246 
00247                         //far data... don't normalize at all!
00248                         if(detector==0)
00249                         {
00250                                 printf("FAR DATA!!!! not normalizing!\n");
00251                                 weight[i][0]=1.;
00252                                 weight[i][1]=1.;
00253                                 weight[i][2]=1.;
00254                         }
00255 
00256                 }
00257         }
00258         file_list.close();
00259 
00260 
00261         //loop over each set of chains
00262 
00263         for(int i=0;i<3;i++)
00264         {
00265                 if(!weight[i])continue; //chain is empty...
00266                 
00267                 printf("processing chain %d\n",i);
00268                 SetUpChain(infiles[i]);
00269 
00270 
00271 
00272                 
00273                 if(recoType==0)
00274                 {
00275                         if(!isMRCC)
00276                                 ProcessChainNormal(infiles[i],weight[i]);
00277                         else
00278                                 ProcessChainNormalMRCC(infiles[i],weight[i]);
00279                         
00280                 }
00281                 if(recoType==1)ProcessChainParticlePID(infiles[i],weight[i]);           
00282                 
00283                 
00284                 if(detector==0 && recoType==1 && isMC==1 && isMRCC==0)
00285                         ProcessChain2Pairs(infiles[i],weight[i]);
00286         
00287         }
00288 
00289 
00290         //save histos
00291         SaveHistos(workingDir);
00292 
00293         outfile->Write();
00294         outfile->Close();
00295 }

void MiniPlotMaker::MoveOverFlow ( TH2D *  h  ) 

Definition at line 583 of file MiniPlotMaker.cxx.

Referenced by SaveHistos().

00584 {
00585         int nx = h->GetNbinsX();
00586         int ny = h->GetNbinsY();
00587         
00588         for(int i=1;i<nx+1;i++)
00589         {
00590                 int obin = h->GetBin(i,ny+1);
00591                 int tbin = h->GetBin(i,ny);
00592                 h->AddBinContent(tbin,h->GetBinContent(obin));
00593                 h->AddBinContent(obin,-h->GetBinContent(obin));
00594         
00595         }
00596 
00597 
00598         for(int i=1;i<ny+1;i++)
00599         {
00600                 int obin = h->GetBin(nx+1,i);
00601                 int tbin = h->GetBin(nx,i);
00602                 h->AddBinContent(tbin,h->GetBinContent(obin));
00603                 h->AddBinContent(obin,-h->GetBinContent(obin));
00604         }
00605 
00606         //get the top diagonal!
00607         int obin = h->GetBin(nx+1,ny+1);
00608         int tbin = h->GetBin(nx,ny);
00609         h->AddBinContent(tbin,h->GetBinContent(obin));
00610         h->AddBinContent(obin,-h->GetBinContent(obin));
00611         
00612 }

bool MiniPlotMaker::PassesNuePreselection (  )  [private]

Definition at line 2204 of file MiniPlotMaker.cxx.

References NueMiniPID::contPlanes, NueMiniPID::cosmicCut, detector, NueMiniPID::evtRecoNueEnergy, NueMiniPID::largestEvent, nm, NueMiniPID::nshower, NueMiniPID::trkLikePlanes, and NueMiniPID::trkPlanes.

Referenced by ApplySystematic().

02205 {
02206         bool pass=1;
02207         pass = pass && (nm->evtRecoNueEnergy>1 && nm->evtRecoNueEnergy<8);
02208         pass = pass && (nm->nshower>0);
02209         pass = pass && (nm->contPlanes>4);
02210         pass = pass && (nm->cosmicCut==1);
02211         pass = pass && (detector!=0 || nm->largestEvent==1);
02212         pass = pass && (nm->trkPlanes<25);
02213         pass = pass && (nm->trkLikePlanes<16);
02214         return pass;
02215 }

void MiniPlotMaker::PrintConfigs (  ) 

Definition at line 1985 of file MiniPlotMaker.cxx.

References GetDetectorString(), GetDirectory(), GetFileList(), GetHornString(), GetMCString(), GetMRCCString(), GetRecoTypeString(), GetSystematic(), infileCount, infiles, outputFile, and wantPOTs.

Referenced by MakePlots().

01986 {
01987         printf("configuration:\n");
01988         printf("normalizing to %e POTs\n",wantPOTs);
01989         printf("output file %s\n",outputFile.c_str());
01990         printf("working directory %s\n",GetDirectory().c_str());
01991         
01992         string setup = GetRecoTypeString() + ' ' + GetMCString() + ' ' + 
01993                 GetMRCCString() + ' ' + GetDetectorString() + ' ' + GetHornString() + ' ' + GetSystematic();
01994 
01995         printf("%s\n",setup.c_str());
01996         
01997         fstream file_list("filelist",ios::out);
01998         
01999         char tmp[500];
02000         sprintf(tmp,"normalizing to %e POTs\n",wantPOTs);
02001         file_list<<tmp;
02002         sprintf(tmp,"output file %s\n",outputFile.c_str());
02003         file_list<<tmp;
02004         sprintf(tmp,"working directory %s\n",GetDirectory().c_str());
02005         file_list<<tmp;
02006         sprintf(tmp,"%s\n",setup.c_str());
02007         file_list<<tmp; 
02008         
02009         
02010         file_list<<"input files:\n";
02011         for(int i=0;i<3;i++)
02012         {
02013                 if(!infileCount[i])continue;
02014                 
02015                 file_list<< "-------------------\nGroup "<<i<<"\n";
02016                 vector<string> filelist=GetFileList(infiles[i]);
02017                 file_list<<"  with "<<filelist.size()<<" files\n";
02018                 for(int i=0;i<(int)filelist.size();i++)
02019                         file_list<<filelist[i].c_str()<<"\n";
02020         
02021                 file_list<<"\n\n";
02022         }
02023         
02024         file_list.close();
02025 }

void MiniPlotMaker::ProcessChain2Pairs ( TChain *  c,
double  chainweight[] 
) [private]

if(ip100==0)printf("%.2f%%\n",(double)i/(double)ent*100.);

Definition at line 851 of file MiniPlotMaker.cxx.

References NueMiniPID::ann2pe_daikon04, ApplySystematic(), detector, NueMiniPID::event_energy, NueMiniPID::event_length, GetRunPeriod(), hist_pids_PID_ann, isMC, isMRCC, NueMiniPID::longest_s, NueMiniPID::MCWeight, nm, NueMiniPID::ntot, NueMiniPID::nueClass, NueMiniPID::nueOscProb, NueMiniPID::pass_var_check, NueMiniPID::passes_NueStandard_IsInFid, NueMiniPID::passes_NueStandard_PassesDataQuality, NueMiniPID::passes_NueStandard_PassesMRCCFiducial, NueMiniPID::passes_NueStandard_PassesMRCCPreSelection, NueMiniPID::passes_NueStandard_PassesPreSelection, NueMiniPID::pidC, and NueMiniPID::timestamp.

Referenced by MakePlots().

00852 {
00853         printf("(in ProcessChain2Pairs)\n");
00854         //do the loop
00855         c->SetBranchStatus("ann2pe_daikon04",1);
00856     c->SetBranchStatus("ann2pe",1);             
00857         
00858         //int ent=c->GetEntries();
00859         //if(maxEntries && maxEntries < ent)ent=maxEntries;
00860         
00861         //int p100 = ent/10;
00862         
00863         
00864         
00865         //printf("running on %d entries...\n",ent);
00866         
00867         for(int i=0;c->GetEntry(i);i++)
00868         {
00870                 if(i%100000==0)printf("%d\n",i);
00871         //      c->GetEntry(i);
00872                 ApplySystematic();
00873 
00874 
00875                 int myrp=GetRunPeriod(nm->timestamp);
00876                 
00877                 //dq cut
00878                 if(!nm->passes_NueStandard_PassesDataQuality)continue;
00879                         
00880                 
00881                 //fiducial cut
00882                 if(!nm->passes_NueStandard_IsInFid)continue;
00883 
00884                 if(isMRCC)
00885                 {
00886                         if(!nm->passes_NueStandard_PassesMRCCFiducial) continue;   
00887                 }
00888 
00889                                 
00890                 //preselection cut for NUE
00891                 if(!nm->passes_NueStandard_PassesPreSelection)continue;
00892                 
00893                 if(isMRCC)
00894                 {
00895                         if(!nm->passes_NueStandard_PassesMRCCPreSelection)continue;
00896                 }
00898                 
00899 
00900 
00901                 //preselection cut for ParticlePID
00902                                 int pre = 1;
00903                 
00904                 pre = pre && nm->event_length>0.1 && nm->event_length<1.2;
00905                 pre = pre && nm->longest_s>0.1 && nm->longest_s<1.2;
00906                 pre = pre && nm->ntot>0;
00907                 pre = pre && nm->event_energy>0.5 && nm->event_energy<8;        
00908                 
00909                 if(!pre)continue;
00910                 //make sure inputs are good!
00911                 if(!nm->pass_var_check)continue;
00913 
00914 
00915 
00916 
00917         if(isMC && (nm->nueClass<0 || nm->nueClass>4))
00918         {
00919 //              printf("unknown nue class\n");
00920                 return;
00921         }
00922         
00923         if(!isMC)nm->nueClass=0;
00924         
00925         double totweight = chainweight[myrp];
00926         
00927         //MCWeight has already been "fixed" (set to 1 for data) by ApplySystematic()
00928         totweight*=nm->MCWeight;
00929         
00930         
00931         if(isMC)
00932         {
00933                 if(detector==0)totweight*=nm->nueOscProb;
00934         }
00935 
00936 
00937 
00938         for(int rpc=0;rpc<2;rpc++)
00939         {
00940                 int rp=rpc==0 ? 3 : myrp;
00941 
00942                 hist_pids_PID_ann[rp][nm->nueClass]->Fill(nm->pidC,nm->ann2pe_daikon04,totweight);
00943                 hist_pids_PID_ann[rp][5]->Fill(nm->pidC,nm->ann2pe_daikon04,totweight);
00944         }
00945         
00946         }
00947 }

void MiniPlotMaker::ProcessChainNormal ( TChain *  c,
double  chainweight[] 
) [private]

Definition at line 949 of file MiniPlotMaker.cxx.

References NueMiniPID::ann14, NueMiniPID::ann2pe, NueMiniPID::ann2pe_daikon04, ApplySystematic(), NueMiniPID::contained, NueMiniPID::event_energy, NueMiniPID::event_length, FillHistos(), GetRunPeriod(), NueMiniPID::infid, isMRCC, NueMiniPID::longest_s, nm, NueMiniPID::ntot, NueMiniPID::passes_NueStandard_IsInFid, NueMiniPID::passes_NueStandard_PassesDataQuality, NueMiniPID::passes_NueStandard_PassesMRCCFiducial, NueMiniPID::passes_NueStandard_PassesMRCCPreSelection, NueMiniPID::passes_NueStandard_PassesPreSelection, NueMiniPID::pidF, and NueMiniPID::timestamp.

Referenced by MakePlots().

00950 {
00951 
00952 
00953         
00954         //do the loop
00955         
00956 //      int ent=c->GetEntries();
00957 //      if(maxEntries && maxEntries < ent)ent=maxEntries;
00958         
00959 //      int p100 = ent/10;
00960         
00961         
00962 //      printf("running on %d entries...\n",ent);
00963         
00964         for(int i=0;c->GetEntry(i);i++)
00965         {
00966 //              if(i%p100==0)printf("%.2f%%\n",(double)i/(double)ent*100.);
00967                 if(i%100000==0)printf("%d\n",i);
00968         
00969 //              c->GetEntry(i);
00970                 ApplySystematic();
00971 
00972 
00973                 int rp=GetRunPeriod(nm->timestamp);
00974                 //dq cut
00975                 
00976                 
00977                 if(!nm->passes_NueStandard_PassesDataQuality)continue;
00978         
00979         
00980                 //fiducial cut
00981                 if(!nm->passes_NueStandard_IsInFid)continue;
00982 
00983                 if(isMRCC)
00984                 {
00985                         if(!nm->passes_NueStandard_PassesMRCCFiducial) continue;   
00986                 }
00987 
00988                 
00989                 FillHistos(0, chainweight[rp], rp);
00990                 
00991                 //preselection cut
00992                 if(!nm->passes_NueStandard_PassesPreSelection)continue;
00993                 
00994                 if(isMRCC)
00995                 {
00996                         if(!nm->passes_NueStandard_PassesMRCCPreSelection)continue;
00997                 }
00998                 
00999                 
01000                 FillHistos(1, chainweight[rp], rp);
01001                 
01002                 //pid cuts..
01003                 
01004                 if(nm->ann2pe_daikon04>0.7)
01005                         FillHistos(2, chainweight[rp], rp);
01006                 
01007                 if(nm->ann2pe>0.7)
01008                         FillHistos(3, chainweight[rp], rp);
01009 
01010                 if(nm->ann14>0.7)
01011                         FillHistos(5, chainweight[rp], rp);
01012 
01013 
01014                 if(nm->pidF>0.7)
01015                 {
01016 
01017                         int passfid=1;
01018                                         //fiducial cut
01019                         if(!nm->infid 
01020                                 || !nm->contained 
01021                                 || !nm->passes_NueStandard_IsInFid
01022                         )passfid=0;
01023                 
01024                         //preselection cut
01025                         int pre = 1;
01026                 
01027                         pre = pre && nm->event_length>0.1 && nm->event_length<1.2;
01028                         pre = pre && nm->longest_s>0.1 && nm->longest_s<1.2;
01029                         pre = pre && nm->ntot>0;
01030                         pre = pre && nm->event_energy>0.5 && nm->event_energy<8;        
01031                         
01032                         bool passPP = true;
01033                         passPP = passPP && passfid;
01034                         passPP = passPP && pre;
01035                 
01036                         if(passPP)FillHistos(4, chainweight[rp], rp);
01037 
01038                 }       
01039         
01040         }
01041 
01042 
01043 }

void MiniPlotMaker::ProcessChainNormalMRCC ( TChain *  c,
double  chainweight[] 
) [private]

Definition at line 1047 of file MiniPlotMaker.cxx.

References NueMiniPID::ann14, NueMiniPID::ann2pe, NueMiniPID::ann2pe_daikon04, ApplySystematic(), NueMiniPID::contained, NueMiniPID::event_energy, NueMiniPID::event_length, FillHistos(), GetNCuts(), GetRunPeriod(), NueMiniPID::infid, isMRCC, NueMiniPID::longest_s, NueMiniPID::mri_orig_cc_pid, NueMiniPID::mri_qp, NueMiniPID::mri_SigmaQP, nm, NueMiniPID::ntot, NueMiniPID::passes_NueStandard_IsInFid, NueMiniPID::passes_NueStandard_PassesDataQuality, NueMiniPID::passes_NueStandard_PassesMRCCFiducial, NueMiniPID::passes_NueStandard_PassesMRCCPreSelection, NueMiniPID::passes_NueStandard_PassesPreSelection, NueMiniPID::pidF, and NueMiniPID::timestamp.

Referenced by MakePlots().

01048 {
01049 
01050 
01051         
01052         //do the loop
01053         
01054 //      int ent=c->GetEntries();
01055 //      if(maxEntries && maxEntries < ent)ent=maxEntries;
01056         
01057 //      int p100 = ent/10;
01058         
01059         
01060 //      printf("running on %d entries...\n",ent);
01061         
01062         for(int i=0;c->GetEntry(i);i++)
01063         {
01064 //              if(i%p100==0)printf("%.2f%%\n",(double)i/(double)ent*100.);
01065                 if(i%100000==0)printf("%d\n",i);
01066         
01067 //              c->GetEntry(i);
01068                 ApplySystematic();
01069 
01070 
01071                 int rp=GetRunPeriod(nm->timestamp);
01072                 //dq cut
01073 
01074 
01075         for(int qpcut=0;qpcut<4;qpcut++)
01076         {               
01077 
01078                 
01079                 if(!nm->passes_NueStandard_PassesDataQuality)continue;
01080         
01081         
01082                 //fiducial cut
01083                 if(!nm->passes_NueStandard_IsInFid)continue;
01084 
01085 
01086                 if(isMRCC)
01087                 {
01088                         if(!nm->passes_NueStandard_PassesMRCCFiducial) continue; 
01089                         
01090                         
01091                         //do the qp cut;
01092                         bool passesQP=false;
01093                         switch(qpcut)
01094                         {
01095                                 case 0:  //no cut
01096                                         passesQP=true;break;
01097                                 case 1: // numu         i.e. qp<=0 and ccpid>-0.1
01098                                         if(nm->mri_qp<=0)passesQP=true;break; 
01099                                 case 2: // antinumu01   i.e. qp>0 and ccpid>-0.1 
01100                                         if(nm->mri_qp>0)passesQP=true;break; 
01101                                 case 3: // antinumu04   i.e. qp>0 and ccpid>0.4 and SigmaQP/QP<0.3 
01102                                         if(nm->mri_qp>0 && nm->mri_orig_cc_pid>0.4 && 
01103                                                 (nm->mri_SigmaQP/nm->mri_qp)<0.3)passesQP=true;break;
01104                         }
01105                          
01106                                  
01107                         if(!passesQP)continue;
01108                 }
01109 
01110         
01111                 int ncuts = GetNCuts();
01112                 
01113                 FillHistos((qpcut*ncuts)+0, chainweight[rp], rp);
01114                 
01115                 //preselection cut
01116                 if(!nm->passes_NueStandard_PassesPreSelection)continue;
01117                 
01118                 if(isMRCC)
01119                 {
01120                         if(!nm->passes_NueStandard_PassesMRCCPreSelection)continue;
01121                 }
01122                 
01123                 
01124                 FillHistos((qpcut*ncuts)+1, chainweight[rp], rp);
01125                 
01126                 //pid cuts..
01127                 
01128                 if(nm->ann2pe_daikon04>0.7)
01129                         FillHistos((qpcut*ncuts)+2, chainweight[rp], rp);
01130                 
01131                 if(nm->ann2pe>0.7)
01132                         FillHistos((qpcut*ncuts)+3, chainweight[rp], rp);
01133 
01134                 if(nm->ann14>0.7)
01135                         FillHistos((qpcut*ncuts)+5, chainweight[rp], rp);
01136 
01137 
01138                 if(nm->pidF>0.7)
01139                 {
01140 
01141                         int passfid=1;
01142                                         //fiducial cut
01143                         if(!nm->infid 
01144                                 || !nm->contained 
01145                                 || !nm->passes_NueStandard_IsInFid
01146                         )passfid=0;
01147                 
01148                         //preselection cut
01149                         int pre = 1;
01150                 
01151                         pre = pre && nm->event_length>0.1 && nm->event_length<1.2;
01152                         pre = pre && nm->longest_s>0.1 && nm->longest_s<1.2;
01153                         pre = pre && nm->ntot>0;
01154                         pre = pre && nm->event_energy>0.5 && nm->event_energy<8;        
01155                         
01156                         bool passPP = true;
01157                         passPP = passPP && passfid;
01158                         passPP = passPP && pre;
01159                 
01160                         if(passPP)FillHistos((qpcut*ncuts)+4, chainweight[rp], rp);
01161 
01162                 }       
01163         }
01164         }
01165 
01166 
01167 }

void MiniPlotMaker::ProcessChainParticlePID ( TChain *  c,
double  chainweight[] 
) [private]

Definition at line 1170 of file MiniPlotMaker.cxx.

References ApplySystematic(), NueMiniPID::contained, NueMiniPID::event, NueMiniPID::event_energy, NueMiniPID::event_length, FillHistos(), GetRunPeriod(), NueMiniPID::infid, isMRCC, NueMiniPID::longest_s, NueMiniPID::mrcc_s, nm, NueMiniPID::ntot, NueMiniPID::passes_NueStandard_IsInFid, NueMiniPID::passes_NueStandard_PassesDataQuality, NueMiniPID::pidA, NueMiniPID::pidB, NueMiniPID::pidC, NueMiniPID::pidD, NueMiniPID::pidE, NueMiniPID::pidF, NueMiniPID::run, NueMiniPID::snarl, and NueMiniPID::timestamp.

Referenced by MakePlots().

01171 {
01172 
01173 
01174         
01175         //do the loop
01176         
01177 //      int ent=c->GetEntries();
01178 //      if(maxEntries && maxEntries < ent)ent=maxEntries;
01179         
01180 //      int p100 = ent/10;
01181         
01182         
01183 //      printf("running on %d entries...\n",ent);
01184         
01185         for(int i=0;c->GetEntry(i);i++)
01186         {
01187 //              if(i%p100==0)printf("%.2f%%\n",(double)i/(double)ent*100.);
01188                 if(i%100000==0)printf("%d\n",i);
01189         
01190 //              c->GetEntry(i);
01191                 ApplySystematic();
01192                 
01193                 int rp=GetRunPeriod(nm->timestamp);
01194 
01195                 
01196                 
01197                 //mrcc cut?
01198                 if(isMRCC)
01199                 {
01200                         if(nm->mrcc_s<1.2)continue;   //require removed long muon to be longer than X
01201                 
01202                 }
01203                 
01204                 
01205                 
01206                 //dq cut
01207                 if(!nm->passes_NueStandard_PassesDataQuality)continue;
01208                         
01209                 
01210                 //fiducial cut
01211                 if(!nm->infid 
01212                         || !nm->contained 
01213                         || !nm->passes_NueStandard_IsInFid
01214                 )continue;
01215                 
01216                 FillHistos(0, chainweight[rp], rp);
01217                 
01218                 
01219                 //preselection cut
01220                 int pre = 1;
01221                 
01222                 pre = pre && nm->event_length>0.1 && nm->event_length<1.2;
01223                 pre = pre && nm->longest_s>0.1 && nm->longest_s<1.2;
01224                 pre = pre && nm->ntot>0;
01225                 pre = pre && nm->event_energy>0.5 && nm->event_energy<8;        
01226                 
01227                 if(!pre)continue;
01228                 
01229                 
01230                 FillHistos(1, chainweight[rp], rp);
01231                 
01232                 //pid cuts..
01233                 
01234                 //make sure inputs are good!
01235         //      if(!nm->pass_var_check)continue;
01236                 
01237                 if(nm->pidA>0.7)
01238                         FillHistos(2, chainweight[rp], rp);
01239                 
01240                 if(nm->pidB>0.7)
01241                         FillHistos(3, chainweight[rp], rp);
01242 
01243                 if(nm->pidC>0.7)
01244                         FillHistos(4, chainweight[rp], rp);
01245 
01246                 if(nm->pidD>0.7)
01247                         FillHistos(5, chainweight[rp], rp);
01248                         
01249                 if(nm->pidE>0.7)
01250                         FillHistos(6, chainweight[rp], rp);
01251                         
01252                 if(nm->pidF>0.7)
01253                 {
01254                         FillHistos(7, chainweight[rp], rp);             
01255                         if(nm->run==13037001)printf("%d %d\n",nm->snarl,nm->event);
01256                 }
01257         
01258         }
01259 
01260 
01261 }

void MiniPlotMaker::SaveHistos ( TDirectory *  td  )  [private]

Definition at line 297 of file MiniPlotMaker.cxx.

References base, OscFit::DeltaCP(), detector, GetCutName(), GetDirectory(), GetDirectoryString(), GetMRCCQPCut(), GetNCuts(), GetNueClassSuffix(), NueStandard::GetOscParam(), GetRunName(), hist_ann11, hist_ann11_firebird, hist_ann14, hist_lisa_recoE_ann11, hist_lisa_recoE_ann11_firebird, hist_lisa_recoE_ann14, hist_lisa_recoE_pidF, hist_lisa_trueE_recoE, hist_ntot, hist_nuEnergy, hist_pars, hist_pidA, hist_pidA_recoE, hist_pidB, hist_pidB_recoE, hist_pidC, hist_pidC_recoE, hist_pidD, hist_pidD_recoE, hist_pidE, hist_pidE_recoE, hist_pidF, hist_pidF_recoE, hist_pids_PID_ann, hist_recoE, hist_resCode, inputPOT, isMC, isMRCC, OscPar::kDelta, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kTh12, OscPar::kTh13, OscPar::kTh23, MoveOverFlow(), outfile, recoType, sdir, systematic, OscFit::Theta12(), OscFit::Theta13(), OscFit::Theta23(), DirectoryHelpers::Tokenize(), and wantPOTs.

Referenced by MakePlots().

00298 {
00299         
00300         TDirectory *base = td;
00301 
00302         for(int rp=0;rp<4;rp++)
00303         {
00304 
00305                 td=DirectoryHelpers::GetDirectory(base,GetRunName(rp),2);
00306 
00307         if( detector==0 && recoType==1 && isMC==1 && isMRCC==0)
00308         {
00309                 string x = GetDirectoryString();
00310                 string xx="/";
00311                 vector<string> aa;
00312                 DirectoryHelpers::Tokenize(x,aa,"/");
00313                 for(int i=0;i<(int)aa.size()-2;i++)
00314                         xx+=aa[i]+"/";
00315                 xx+="Combined/"+GetRunName(rp);
00316                 TDirectory *sp=DirectoryHelpers::GetDirectory(outfile,xx,2);
00317                 
00318                 sp->cd();
00319                 char tmp[200];
00320                 for(int i=0;i<6;i++)
00321                 {
00322                         sprintf(tmp,"pid_ParticlePID_vs_ANN11%s",GetNueClassSuffix(i).c_str());
00323                         hist_pids_PID_ann[rp][i]->SetDirectory(sp);
00324                         hist_pids_PID_ann[rp][i]->SetName(tmp);
00325                         hist_pids_PID_ann[rp][i]->SetTitle(tmp);                
00326                 
00327                 }
00328                 
00329         }
00330                 
00331                 
00332                 
00333 
00334         td->cd();
00335         
00336         int nCuts=GetNCuts();
00337         if(isMRCC)nCuts*=4;
00338         for(int i=0;i<nCuts;i++)
00339         {
00340                 string cutname=GetCutName(i%GetNCuts());
00341                 TDirectory *sdir = td->GetDirectory(cutname.c_str());
00342                 if(!sdir)td->mkdir(cutname.c_str());
00343                 sdir = td->GetDirectory(cutname.c_str());       
00344                 sdir->cd();
00345 
00346                 if(isMRCC)
00347                 {
00348                         cutname=GetMRCCQPCut(i/GetNCuts());
00349                         TDirectory *sdirt = sdir->GetDirectory(cutname.c_str());
00350                         if(!sdirt)sdir->mkdir(cutname.c_str());
00351                         sdir = sdir->GetDirectory(cutname.c_str());     
00352                         sdir->cd();                     
00353                 }
00354                 
00355                 
00356                 char tmp[200];
00357                 int start = isMC ? 0 : 5;
00358                 for(int j=start;j<6;j++)
00359                 {
00360                         if(detector==1 && j==2)continue;//no signal in near
00361                         if(detector==1 && j==3)continue;//no tau in near
00362 
00363                         sprintf(tmp,"recoE%s",GetNueClassSuffix(j).c_str());
00364                         hist_recoE[rp][i][j]->SetDirectory(sdir);
00365                         hist_recoE[rp][i][j]->SetName(tmp);
00366                         hist_recoE[rp][i][j]->SetTitle(tmp);
00367                         
00368                 //      if(i==0&&j==0&&rp==3)hist_recoE[rp][i][j]->Dump();
00369 
00370                         if(isMC)
00371                         {
00372                                 sprintf(tmp,"resCode%s",GetNueClassSuffix(j).c_str());
00373                                 hist_resCode[rp][i][j]->SetDirectory(sdir);
00374                                 hist_resCode[rp][i][j]->SetName(tmp);
00375                                 hist_resCode[rp][i][j]->SetTitle(tmp);          
00376 
00377                                 sprintf(tmp,"nuEnergy%s",GetNueClassSuffix(j).c_str());
00378                                 hist_nuEnergy[rp][i][j]->SetDirectory(sdir);
00379                                 hist_nuEnergy[rp][i][j]->SetName(tmp);
00380                                 hist_nuEnergy[rp][i][j]->SetTitle(tmp); 
00381                         }
00382                         
00383                         
00384                                 sprintf(tmp,"ann11%s",GetNueClassSuffix(j).c_str());
00385                                 hist_ann11[rp][i][j]->SetDirectory(sdir);
00386                                 hist_ann11[rp][i][j]->SetName(tmp);
00387                                 hist_ann11[rp][i][j]->SetTitle(tmp);    
00388                         
00389                                 sprintf(tmp,"ann11_firebird%s",GetNueClassSuffix(j).c_str());
00390                                 hist_ann11_firebird[rp][i][j]->SetDirectory(sdir);
00391                                 hist_ann11_firebird[rp][i][j]->SetName(tmp);
00392                                 hist_ann11_firebird[rp][i][j]->SetTitle(tmp);                                                   
00393 
00394                                 sprintf(tmp,"ann14%s",GetNueClassSuffix(j).c_str());
00395                                 hist_ann14[rp][i][j]->SetDirectory(sdir);
00396                                 hist_ann14[rp][i][j]->SetName(tmp);
00397                                 hist_ann14[rp][i][j]->SetTitle(tmp);    
00398 
00399                         
00400                         
00401                                 sprintf(tmp,"ntot%s",GetNueClassSuffix(j).c_str());
00402                                 hist_ntot[rp][i][j]->SetDirectory(sdir);
00403                                 hist_ntot[rp][i][j]->SetName(tmp);
00404                                 hist_ntot[rp][i][j]->SetTitle(tmp);                                     
00405 
00406                                 sprintf(tmp,"pidA%s",GetNueClassSuffix(j).c_str());
00407                                 hist_pidA[rp][i][j]->SetDirectory(sdir);
00408                                 hist_pidA[rp][i][j]->SetName(tmp);
00409                                 hist_pidA[rp][i][j]->SetTitle(tmp);                                     
00410 
00411                                 sprintf(tmp,"pidB%s",GetNueClassSuffix(j).c_str());
00412                                 hist_pidB[rp][i][j]->SetDirectory(sdir);
00413                                 hist_pidB[rp][i][j]->SetName(tmp);
00414                                 hist_pidB[rp][i][j]->SetTitle(tmp);                                     
00415 
00416                                 sprintf(tmp,"pidC%s",GetNueClassSuffix(j).c_str());
00417                                 hist_pidC[rp][i][j]->SetDirectory(sdir);
00418                                 hist_pidC[rp][i][j]->SetName(tmp);
00419                                 hist_pidC[rp][i][j]->SetTitle(tmp);                                     
00420 
00421                                 sprintf(tmp,"pidD%s",GetNueClassSuffix(j).c_str());
00422                                 hist_pidD[rp][i][j]->SetDirectory(sdir);
00423                                 hist_pidD[rp][i][j]->SetName(tmp);
00424                                 hist_pidD[rp][i][j]->SetTitle(tmp);                                     
00425 
00426                                 sprintf(tmp,"pidE%s",GetNueClassSuffix(j).c_str());
00427                                 hist_pidE[rp][i][j]->SetDirectory(sdir);
00428                                 hist_pidE[rp][i][j]->SetName(tmp);
00429                                 hist_pidE[rp][i][j]->SetTitle(tmp);                                     
00430 
00431                                 sprintf(tmp,"pidF%s",GetNueClassSuffix(j).c_str());
00432                                 hist_pidF[rp][i][j]->SetDirectory(sdir);
00433                                 hist_pidF[rp][i][j]->SetName(tmp);
00434                                 hist_pidF[rp][i][j]->SetTitle(tmp);                                     
00435 
00436 
00437                                 sprintf(tmp,"pidA_recoE%s",GetNueClassSuffix(j).c_str());
00438                                 hist_pidA_recoE[rp][i][j]->SetDirectory(sdir);
00439                                 hist_pidA_recoE[rp][i][j]->SetName(tmp);
00440                                 hist_pidA_recoE[rp][i][j]->SetTitle(tmp);               
00441                                                         
00442                                 sprintf(tmp,"pidB_recoE%s",GetNueClassSuffix(j).c_str());
00443                                 hist_pidB_recoE[rp][i][j]->SetDirectory(sdir);
00444                                 hist_pidB_recoE[rp][i][j]->SetName(tmp);
00445                                 hist_pidB_recoE[rp][i][j]->SetTitle(tmp);       
00446                                                                 
00447                                 sprintf(tmp,"pidC_recoE%s",GetNueClassSuffix(j).c_str());
00448                                 hist_pidC_recoE[rp][i][j]->SetDirectory(sdir);
00449                                 hist_pidC_recoE[rp][i][j]->SetName(tmp);
00450                                 hist_pidC_recoE[rp][i][j]->SetTitle(tmp);                       
00451                                                 
00452                                 sprintf(tmp,"pidD_recoE%s",GetNueClassSuffix(j).c_str());
00453                                 hist_pidD_recoE[rp][i][j]->SetDirectory(sdir);
00454                                 hist_pidD_recoE[rp][i][j]->SetName(tmp);
00455                                 hist_pidD_recoE[rp][i][j]->SetTitle(tmp);                       
00456                                                 
00457                                 sprintf(tmp,"pidE_recoE%s",GetNueClassSuffix(j).c_str());
00458                                 hist_pidE_recoE[rp][i][j]->SetDirectory(sdir);
00459                                 hist_pidE_recoE[rp][i][j]->SetName(tmp);
00460                                 hist_pidE_recoE[rp][i][j]->SetTitle(tmp);                               
00461                                         
00462                                 sprintf(tmp,"pidF_recoE%s",GetNueClassSuffix(j).c_str());
00463                                 hist_pidF_recoE[rp][i][j]->SetDirectory(sdir);
00464                                 hist_pidF_recoE[rp][i][j]->SetName(tmp);
00465                                 hist_pidF_recoE[rp][i][j]->SetTitle(tmp);                                       
00466                                 
00467                                 //save file size by only saving these where needed      
00468                                 if(recoType==1 ||
00469                                         (recoType==0 && (
00470                                                 i%GetNCuts()==0 || //fiducial                           
00471                                                 i%GetNCuts()==1 || //preselection
00472                                                 i%GetNCuts()==4 //pidF
00473                                         ))
00474                                 ){
00475                                         //we don't need these for systematic tests (saves space)
00476                                         if(!systematic)
00477                                         for(int k=0;k<14;k++)
00478                                         {
00479                                                 sprintf(tmp,"pars_%d%s",k,GetNueClassSuffix(j).c_str());
00480                                                 hist_pars[k][rp][i][j]->SetDirectory(sdir);
00481                                                 hist_pars[k][rp][i][j]->SetName(tmp);
00482                                                 hist_pars[k][rp][i][j]->SetTitle(tmp);          
00483                                         }
00484                                 }
00485                 
00486                 
00488                                 //lisa histos
00489 //only need these for fid and presel (save a lot of space!)
00490 
00491 if(i%GetNCuts()<2)
00492 {                               
00493                                 if(isMC)MoveOverFlow(hist_lisa_trueE_recoE[rp][i][j]);
00494                                 MoveOverFlow(hist_lisa_recoE_pidF[rp][i][j]);
00495                                 MoveOverFlow(hist_lisa_recoE_ann11[rp][i][j]);
00496                                 MoveOverFlow(hist_lisa_recoE_ann11_firebird[rp][i][j]);
00497                                 MoveOverFlow(hist_lisa_recoE_ann14[rp][i][j]);
00498                                 
00499                                 if(isMC)
00500                                 {
00501                                         sprintf(tmp,"lisa_trueE_recoE%s",GetNueClassSuffix(j).c_str());
00502                                         hist_lisa_trueE_recoE[rp][i][j]->SetDirectory(sdir);
00503                                         hist_lisa_trueE_recoE[rp][i][j]->SetName(tmp);
00504                                         hist_lisa_trueE_recoE[rp][i][j]->SetTitle(tmp);
00505                                 }
00506                                 
00507                                 
00508                                 sprintf(tmp,"lisa_recoE_pidF%s",GetNueClassSuffix(j).c_str());
00509                                 hist_lisa_recoE_pidF[rp][i][j]->SetDirectory(sdir);
00510                                 hist_lisa_recoE_pidF[rp][i][j]->SetName(tmp);
00511                                 hist_lisa_recoE_pidF[rp][i][j]->SetTitle(tmp);          
00512                                 
00513                                 sprintf(tmp,"lisa_recoE_ann11%s",GetNueClassSuffix(j).c_str()); 
00514                                 hist_lisa_recoE_ann11[rp][i][j]->SetDirectory(sdir);
00515                                 hist_lisa_recoE_ann11[rp][i][j]->SetName(tmp);
00516                                 hist_lisa_recoE_ann11[rp][i][j]->SetTitle(tmp);         
00517                                 
00518                                 sprintf(tmp,"lisa_recoE_ann11_firebird%s",GetNueClassSuffix(j).c_str());        
00519                                 hist_lisa_recoE_ann11_firebird[rp][i][j]->SetDirectory(sdir);
00520                                 hist_lisa_recoE_ann11_firebird[rp][i][j]->SetName(tmp);
00521                                 hist_lisa_recoE_ann11_firebird[rp][i][j]->SetTitle(tmp);                
00522                                 
00523                                 sprintf(tmp,"lisa_recoE_ann14%s",GetNueClassSuffix(j).c_str()); 
00524                                 hist_lisa_recoE_ann14[rp][i][j]->SetDirectory(sdir);
00525                                 hist_lisa_recoE_ann14[rp][i][j]->SetName(tmp);
00526                                 hist_lisa_recoE_ann14[rp][i][j]->SetTitle(tmp);         
00527 }
00528                                 //lisa histos   
00530                                 
00531                                 
00532                 }
00533 
00534 
00535                 //lisas tree for sample information
00536                 //...not everything is being filled now...
00537                 char selection[256];
00538                 sprintf(selection,"%s",GetCutName(i%GetNCuts()).c_str());
00539 
00540                 double par[100]={0};
00541                 NueStandard::GetOscParam(par);
00542                 double Theta12 = par[OscPar::kTh12];
00543                 double Theta13 = par[OscPar::kTh13];
00544                 double Theta23 = par[OscPar::kTh23];
00545                 double DeltaMSq23 = par[OscPar::kDeltaM23];
00546                 double DeltaMSq12 = par[OscPar::kDeltaM12];
00547                 double DeltaCP = par[OscPar::kDelta];
00548                 
00549                 
00550                 double fFarPOT = 0;
00551                 double fNearPOT = 0;
00552                 if(detector==0)fFarPOT = wantPOTs;
00553                 if(detector==1)fNearPOT = wantPOTs;
00554                 
00555 
00556             TTree * paramtree = new TTree("paramtree","paramtree");
00557             paramtree->Branch("Selection",selection,"Selection/C");
00558             paramtree->Branch("nearPOT",&fNearPOT,"nearPOT/D");
00559             paramtree->Branch("farPOT",&fFarPOT,"farPOT/D");
00560             paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00561             paramtree->Branch("Theta13",&Theta13,"Theta13/D");
00562             paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00563                 paramtree->Branch("DeltaMSq23",&DeltaMSq23,"DeltaMSq23/D");
00564             paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00565             paramtree->Branch("DeltaCP",&DeltaCP,"DeltaCP/D");
00566             paramtree->Branch("inputPOT0[3]",inputPOT[0]);
00567             paramtree->Branch("inputPOT1[3]",inputPOT[1]);
00568             paramtree->Branch("inputPOT2[3]",inputPOT[2]);
00569 
00570 
00571                 paramtree->SetDirectory(sdir);
00572                 paramtree->Fill();
00573                 //lisa's tree
00575 
00576         
00577         }
00578         }
00579 }

void MiniPlotMaker::SetDetector ( int  t  )  [inline]

Definition at line 51 of file MiniPlotMaker.h.

References detector.

00051 {detector=t;};

void MiniPlotMaker::SetHorn ( int  t  )  [inline]

Definition at line 52 of file MiniPlotMaker.h.

References horn.

00052 {horn=t;};

void MiniPlotMaker::SetMaxEntries ( int  i  )  [inline]

Definition at line 55 of file MiniPlotMaker.h.

References maxEntries.

00055 {maxEntries=i;};

void MiniPlotMaker::SetMC ( int  t  )  [inline]

Definition at line 49 of file MiniPlotMaker.h.

References isMC.

00049 {isMC=t;};

void MiniPlotMaker::SetMRCC ( int  t  )  [inline]

Definition at line 50 of file MiniPlotMaker.h.

References isMRCC.

00050 {isMRCC=t;};

void MiniPlotMaker::SetOutputFile ( string  s  )  [inline]

Definition at line 46 of file MiniPlotMaker.h.

References outputFile.

00046 {outputFile=s;};

void MiniPlotMaker::SetOverwrite ( int  i  )  [inline]

Definition at line 62 of file MiniPlotMaker.h.

References overwrite.

00062 {overwrite=i;};

void MiniPlotMaker::SetRecoType ( int  t  )  [inline]

Definition at line 48 of file MiniPlotMaker.h.

References recoType.

00048 {recoType=t;};

void MiniPlotMaker::SetSystematic ( int  t  ) 

normal

Definition at line 1909 of file MiniPlotMaker.cxx.

References MCReweight::AddWeightCalculator(), MCReweight::Instance(), mcr, nwc, rwtconfig, skzp, and systematic.

01910 {
01911         systematic=t;
01912         
01913         if(!t)return;
01914         
01915         //otherwise...set up the necessary helpers
01916         
01917         
01918 
01919         if(!skzp)skzp=new SKZPWeightCalculator("DetXs",true);
01920         bool needToAdd=(!mcr) || (!nwc);
01921         if(!mcr)mcr=&MCReweight::Instance();
01922         if(!nwc)nwc=new NeugenWeightCalculator();
01923         if(needToAdd)mcr->AddWeightCalculator(nwc);
01924         if(!rwtconfig)rwtconfig = new Registry();
01925 
01926 
01927 }

void MiniPlotMaker::SetUpChain ( TChain *  c  )  [private]

Definition at line 710 of file MiniPlotMaker.cxx.

References isMRCC, nm, recoType, and systematic.

Referenced by MakePlots().

00711 {
00712 
00713         c->SetBranchStatus("*",1);
00714 
00715         c->SetBranchAddress("NueMiniPID",&nm);
00716 
00717         c->SetBranchStatus("*",0);
00718 
00719 
00720         c->SetBranchStatus("fBeam",1);
00721         c->SetBranchStatus("fDet",1);
00722         c->SetBranchStatus("fRelease",1);
00723         
00724         
00725         c->SetBranchStatus("run",1);
00726         c->SetBranchStatus("snarl",1);
00727         c->SetBranchStatus("event",1);
00728  
00729 
00730     c->SetBranchStatus("nueClass",1);
00731     c->SetBranchStatus("nueOscProb",1);
00732     c->SetBranchStatus("weight",1);
00733     c->SetBranchStatus("skzpWeight",1);
00734     
00735     c->SetBranchStatus("MCWeight",1);
00736         
00737         c->SetBranchStatus("event_energy",1);
00738         c->SetBranchStatus("resonanceCode",1);  
00739         c->SetBranchStatus("nuEnergy",1);       
00740         
00741         
00742         c->SetBranchStatus("timestamp",1);
00743 
00744 
00745         if(isMRCC)
00746         {
00747                 c->SetBranchStatus("mri_qp",1);
00748                 c->SetBranchStatus("mri_orig_cc_pid",1);
00749                 c->SetBranchStatus("mri_SigmaQP",1);
00750          
00751                 c->SetBranchStatus("mri_best_complete",1);
00752                 c->SetBranchStatus("mri_fitp",1);
00753         
00754         }
00755 
00756         if(recoType==0)
00757         {
00758                 //preselects
00759                 c->SetBranchStatus("passes_NueStandard_PassesDataQuality",1);          
00760             c->SetBranchStatus("passes_NueStandard_IsInFid",1);         
00761         c->SetBranchStatus("passes_NueStandard_PassesNonHEPreSelection",1);    
00762         c->SetBranchStatus("passes_NueStandard_PassesPreSelection",1);
00763 
00764                 c->SetBranchStatus("evtRecoNueEnergy",1);
00765 
00766        
00767         c->SetBranchStatus("nshower",1);
00768         c->SetBranchStatus("contPlanes",1);
00769         c->SetBranchStatus("cosmicCut",1);
00770         c->SetBranchStatus("largestEvent",1);
00771         c->SetBranchStatus("trkPlanes",1);
00772         c->SetBranchStatus("trkLikePlanes",1);
00773 
00774                 //pids
00775                 c->SetBranchStatus("ann2pe_daikon04",1);
00776         c->SetBranchStatus("ann2pe",1); 
00777                 c->SetBranchStatus("pidF",1);
00778 
00779         c->SetBranchStatus("ann14",1);
00780 
00781                 if(isMRCC)
00782                 {
00783                         c->SetBranchStatus("passes_NueStandard_PassesMRCCFiducial",1);
00784                         c->SetBranchStatus(
00785                                 "passes_NueStandard_PassesMRCCPreSelection",1);  
00786                 }
00787 
00788         }
00789         
00790         if(1|| recoType==1 )
00791         {
00792                 //preselects
00793                 
00794                 c->SetBranchStatus("infid",1);
00795         c->SetBranchStatus("contained",1);
00796                 c->SetBranchStatus("pars[14]",1);
00797                 
00798                 c->SetBranchStatus("passes_NueStandard_PassesDataQuality",1);          
00799             c->SetBranchStatus("passes_NueStandard_IsInFid",1);         
00800         c->SetBranchStatus("passes_NueStandard_PassesNonHEPreSelection",1);    
00801         c->SetBranchStatus("passes_NueStandard_PassesPreSelection",1);
00802 
00803             c->SetBranchStatus("longest_s",1);
00804         c->SetBranchStatus("event_length",1);
00805         c->SetBranchStatus("ntot",1);
00806                 c->SetBranchStatus("event_energy",1);
00807 
00808                 //pids
00809                 c->SetBranchStatus("pidA",1);
00810                 c->SetBranchStatus("pidB",1);
00811                 c->SetBranchStatus("pidC",1);
00812                 c->SetBranchStatus("pidD",1);
00813                 c->SetBranchStatus("pidE",1);
00814                 c->SetBranchStatus("pidF",1);
00815                 
00816                 
00817                 c->SetBranchStatus("pass_var_check",1);
00818                 
00819                 if(isMRCC)
00820                 {
00821                         c->SetBranchStatus("mrcc_s",1);
00822                 
00823                 }
00824         }
00825 
00826         if(systematic)
00827         {
00828 
00829                 c->SetBranchStatus("nuEnergy",1);
00830                 c->SetBranchStatus("targetEnergy",1);  
00831                 c->SetBranchStatus("targetPX",1);
00832                 c->SetBranchStatus("targetPY",1);
00833                 c->SetBranchStatus("targetPZ",1);
00834                 c->SetBranchStatus("hadronicY",1);
00835                 c->SetBranchStatus("bjorkenX",1);
00836                 c->SetBranchStatus("q2",1);
00837                 c->SetBranchStatus("w2",1);
00838                 c->SetBranchStatus("interactionType",1);
00839                 c->SetBranchStatus("nuFlavor",1);
00840                 c->SetBranchStatus("resonanceCode",1);
00841                 c->SetBranchStatus("initialState",1);
00842                 c->SetBranchStatus("atomicNumber",1);
00843                 c->SetBranchStatus("atomicWeight",1);
00844                 c->SetBranchStatus("hadronicFinalState",1);
00845         }
00846 
00847 }

void MiniPlotMaker::SetWantPOTs ( double  wp = 1e19  )  [inline]

Definition at line 59 of file MiniPlotMaker.h.

References wantPOTs.

Referenced by MiniPlotMaker().

00059 {wantPOTs=wp;};


Member Data Documentation

int MiniPlotMaker::detector [private]
TH1D* MiniPlotMaker::hist_ann11[4][MAXCUTS][6] [private]

Definition at line 147 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_ann11_firebird[4][MAXCUTS][6] [private]

Definition at line 148 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_ann14[4][MAXCUTS][6] [private]

Definition at line 146 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_lisa_recoE_ann11[4][MAXCUTS][6] [private]

Definition at line 168 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_lisa_recoE_ann11_firebird[4][MAXCUTS][6] [private]

Definition at line 169 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_lisa_recoE_ann14[4][MAXCUTS][6] [private]

Definition at line 170 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_lisa_recoE_pidF[4][MAXCUTS][6] [private]

Definition at line 167 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_lisa_trueE_recoE[4][MAXCUTS][6] [private]

Definition at line 166 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_ntot[4][MAXCUTS][6] [private]

Definition at line 174 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_nuEnergy[4][MAXCUTS][6] [private]

Definition at line 145 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pars[14][4][MAXCUTS][6] [private]

Definition at line 175 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidA[4][MAXCUTS][6] [private]

Definition at line 150 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidA_recoE[4][MAXCUTS][6] [private]

Definition at line 157 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidB[4][MAXCUTS][6] [private]

Definition at line 151 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidB_recoE[4][MAXCUTS][6] [private]

Definition at line 158 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidC[4][MAXCUTS][6] [private]

Definition at line 152 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidC_recoE[4][MAXCUTS][6] [private]

Definition at line 159 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidD[4][MAXCUTS][6] [private]

Definition at line 153 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidD_recoE[4][MAXCUTS][6] [private]

Definition at line 160 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidE[4][MAXCUTS][6] [private]

Definition at line 154 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidE_recoE[4][MAXCUTS][6] [private]

Definition at line 161 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_pidF[4][MAXCUTS][6] [private]

Definition at line 155 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pidF_recoE[4][MAXCUTS][6] [private]

Definition at line 162 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH2D* MiniPlotMaker::hist_pids_PID_ann[4][6] [private]

Definition at line 177 of file MiniPlotMaker.h.

Referenced by MakeHistos(), ProcessChain2Pairs(), and SaveHistos().

TH1D* MiniPlotMaker::hist_recoE[4][MAXCUTS][6] [private]

Definition at line 142 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

TH1D* MiniPlotMaker::hist_resCode[4][MAXCUTS][6] [private]

Definition at line 143 of file MiniPlotMaker.h.

Referenced by FillHistos(), MakeHistos(), and SaveHistos().

int MiniPlotMaker::horn [private]

Definition at line 97 of file MiniPlotMaker.h.

Referenced by GetHornString(), MiniPlotMaker(), and SetHorn().

int MiniPlotMaker::infileCount[3] [private]

Definition at line 78 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), MakePlots(), MiniPlotMaker(), and PrintConfigs().

Definition at line 80 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), and MiniPlotMaker().

Definition at line 79 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), MakePlots(), and MiniPlotMaker().

TChain* MiniPlotMaker::infiles[3] [private]

Definition at line 75 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), MakePlots(), MiniPlotMaker(), and PrintConfigs().

Definition at line 77 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), MakePlots(), and MiniPlotMaker().

TChain* MiniPlotMaker::infilesPOTTree[3] [private]

Definition at line 76 of file MiniPlotMaker.h.

Referenced by AddInputFiles(), MakePlots(), and MiniPlotMaker().

double MiniPlotMaker::inputPOT[3][3] [private]

Definition at line 197 of file MiniPlotMaker.h.

Referenced by MakePlots(), MiniPlotMaker(), and SaveHistos().

int MiniPlotMaker::isMC [private]
int MiniPlotMaker::isMRCC [private]

Definition at line 191 of file MiniPlotMaker.h.

Referenced by GetReweight(), and MiniPlotMaker().

Definition at line 110 of file MiniPlotMaker.h.

Referenced by MiniPlotMaker(), and SetMaxEntries().

Definition at line 188 of file MiniPlotMaker.h.

Referenced by GetReweight(), MiniPlotMaker(), and SetSystematic().

Definition at line 189 of file MiniPlotMaker.h.

Referenced by MiniPlotMaker(), and SetSystematic().

TFile* MiniPlotMaker::outfile [private]

Definition at line 69 of file MiniPlotMaker.h.

Referenced by MakePlots(), and SaveHistos().

string MiniPlotMaker::outputFile [private]

Definition at line 68 of file MiniPlotMaker.h.

Referenced by MakePlots(), MiniPlotMaker(), PrintConfigs(), and SetOutputFile().

int MiniPlotMaker::overwrite [private]

Definition at line 136 of file MiniPlotMaker.h.

Referenced by MakePlots(), MiniPlotMaker(), and SetOverwrite().

double MiniPlotMaker::potratios = {1.20378e20,1.92724e20,3.78478e20} [static, private]

Definition at line 182 of file MiniPlotMaker.h.

Referenced by MakePlots().

double MiniPlotMaker::potratios_mrcc = {4.207220e+19,1.416530e+20,2.565563e+20} [static, private]

Definition at line 183 of file MiniPlotMaker.h.

Referenced by MakePlots().

int MiniPlotMaker::recoType [private]

Definition at line 190 of file MiniPlotMaker.h.

Referenced by GetReweight(), MiniPlotMaker(), and SetSystematic().

Definition at line 186 of file MiniPlotMaker.h.

Referenced by ApplySystematic(), MiniPlotMaker(), and SetSystematic().

double MiniPlotMaker::wantPOTs [private]

Definition at line 133 of file MiniPlotMaker.h.

Referenced by MakePlots(), PrintConfigs(), SaveHistos(), and SetWantPOTs().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1