ExtrapHistsGen Class Reference

#include <ExtrapHistsGen.h>

List of all members.

Public Member Functions

 ExtrapHistsGen ()
virtual ~ExtrapHistsGen ()
void SetOutputFile (string name="DefaultOut.root")
void AddPID (string pidname, Selection::Selection_t pidsel)
void SetFileList (string list="NULL")
void FillHistograms ()
void SetRecoBins (int n, double *edges)
void SetPIDBins (int n, double *edges)
void SetTrueBins (int n, double *edges)
void SetRHC ()

Private Member Functions

void Initialize ()
void InitializeHistograms ()
void FinalizeHistograms ()
void SetDataType (string type="NULL")
void WriteToFile ()
double GetNueRecoEnergy (NueRecord *nr)
double GetCCRecoEnergy (NueRecord *nr)

Private Attributes

ExtrapHists2DExHists
ExtrapHists2DExHists_Nu
ExtrapHists2DExHists_NuBar
string outFileName
string FileList
string DataType
map< string,
Selection::Selection_t
PIDlist
TFile * fout
TTree * paramtree
double Theta12
double Theta13
double Theta23
double DeltaMSq23
double DeltaMSq12
double DeltaCP
int nReco
int nTrue
int nPID
vector< double > RecoEdges
vector< double > PIDEdges
vector< double > TrueEdges
bool isRHC

Detailed Description

Definition at line 28 of file ExtrapHistsGen.h.


Constructor & Destructor Documentation

ExtrapHistsGen::ExtrapHistsGen (  ) 

Definition at line 3 of file ExtrapHistsGen.cxx.

References Initialize().

00004 {
00005   Initialize();
00006   return;
00007 }

virtual ExtrapHistsGen::~ExtrapHistsGen (  )  [inline, virtual]

Definition at line 32 of file ExtrapHistsGen.h.

00032 {};


Member Function Documentation

void ExtrapHistsGen::AddPID ( string  pidname,
Selection::Selection_t  pidsel 
)

Definition at line 28 of file ExtrapHistsGen.cxx.

References PIDlist.

00029 {
00030   PIDlist[pidname] = pidsel;
00031   return;
00032 }

void ExtrapHistsGen::FillHistograms (  ) 

Definition at line 172 of file ExtrapHistsGen.cxx.

References det, ExHists, ExHists_Nu, ExHists_NuBar, FileList, ANtpTrackInfo::fitMomentum, GetCCRecoEnergy(), VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), NueStandard::GetMCWeights(), NueStandard::GetNDDataWeights(), GetNueRecoEnergy(), NueStandard::GetOscWeight(), NueStandard::GetPIDValue(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), gSystem(), InitializeHistograms(), ANtpTruthInfo::interactionType, isMC, isRHC, Selection::kCC, Detector::kFar, Selection::kFid, SimFlag::kMC, Detector::kNear, Selection::kPre, Detector::kUnknown, NueRecord::mctrue, n, ANtpTruthInfoBeam::nonOscNuFlavor, NueConvention::NueEnergyCorrection(), ANtpTruthInfo::nuEnergy, ANtpTruthInfo::nuFlavor, NueStandard::PassesSelection(), PIDlist, NuePOT::pot, ExtrapHists2D::Reco_CClike, ExtrapHists2D::Reco_CClike_Neg, ExtrapHists2D::Reco_CClike_Pos, NueConvention::RHCNueEnergyCorrection(), SetDataType(), ExtrapHists2D::SetPOT(), NueRecord::srtrack, ExtrapHists2D::True_Fid_NueBarCC, ExtrapHists2D::True_Fid_NueCC, ExtrapHists2D::True_Fid_NuTauBarCC, ExtrapHists2D::True_Fid_NuTauCC, ExtrapHists2D::TrueVsReco_CClike, ExtrapHists2D::TrueVsReco_CClike_Neg, ExtrapHists2D::TrueVsReco_CClike_Neg_NuMuCC, ExtrapHists2D::TrueVsReco_CClike_NuMuCC, ExtrapHists2D::TrueVsReco_CClike_Pos, ExtrapHists2D::TrueVsReco_CClike_Pos_NuMuBarCC, ExtrapHists2D::TrueVsReco_Fid, ExtrapHists2D::TrueVsReco_Fid_NueBarCC, ExtrapHists2D::TrueVsReco_Fid_NueCC, ExtrapHists2D::TrueVsReco_Fid_NuMuBarCC, ExtrapHists2D::TrueVsReco_Fid_NuMuCC, ExtrapHists2D::TrueVsReco_Fid_NuTauBarCC, ExtrapHists2D::TrueVsReco_Fid_NuTauCC, ExtrapHists2D::TrueVsRecoVsPID_BNueToBNue, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuMu, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuTau, ExtrapHists2D::TrueVsRecoVsPID_NC, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNue, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNueBar, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMu, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMuBar, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNue, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuMu, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuTau, and WriteToFile().

00173 {
00174   if(FileList=="NULL")
00175   {
00176     cout<<"No file list. Quitting..."<<endl;
00177     return;
00178   }
00179   
00180   NueRecord* nr = new NueRecord();
00181   TChain *chain = new TChain("ana_nue");
00182   chain->SetBranchAddress("NueRecord",&nr);
00183   
00184   NuePOT *np = new NuePOT();
00185   TChain *pchain = new TChain("pottree");
00186   pchain->SetBranchAddress("NuePOT",&np);
00187   
00188   Int_t i;
00189   double totpot=0;
00190   Int_t n;
00191   ifstream filelist;
00192   string line;
00193   
00194   filelist.open(gSystem->ExpandPathName(FileList.c_str()));
00195   if(!filelist.good())
00196   {
00197     cout<<"Problem reading "<<FileList<<". Quitting..."<<endl;
00198     return;
00199   }
00200   while(!filelist.eof())
00201   {
00202     getline(filelist,line);
00203     if(!line.empty())
00204     {
00205       chain->Add(gSystem->ExpandPathName(line.c_str()));
00206       pchain->Add(gSystem->ExpandPathName(line.c_str()));
00207     }
00208   }
00209   filelist.close();
00210   
00211   n = pchain->GetEntries();
00212   totpot=0;
00213   for(i=0;i<n;i++)
00214   {
00215     pchain->GetEntry(i);
00216     totpot+=np->pot;
00217   }
00218   totpot = totpot*1e12;
00219   cout<<totpot<<" POT"<<endl;
00220   
00221   int nevt = chain->GetEntries();
00222   cout<<nevt<<" events"<<endl;
00223   if(nevt==0)
00224   {
00225     cout<<"No events.  Quitting..."<<endl;
00226     return;
00227   }
00228   
00229   Double_t weight=1;
00230   Double_t oscweight=1;
00231   bool isMC=false;
00232   Double_t CCEn = 0;
00233   Double_t NueEn = 0;
00234   Detector::Detector_t det=Detector::kUnknown;
00235   
00236   map<string,Selection::Selection_t>::iterator piditer;
00237   map<string,Selection::Selection_t>::iterator last;
00238   string pidname;
00239   Selection::Selection_t pidsel;
00240   
00241   string dt="NULL";
00242   chain->GetEvent(0);
00243   isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00244   det = nr->GetHeader().GetVldContext().GetDetector();
00245   if(!isMC && det==Detector::kNear) dt="NDData";
00246   if(isMC && det==Detector::kNear) dt="NDMC";
00247   if(isMC && det==Detector::kFar)
00248   {
00249     if(nr->mctrue.nuFlavor==-9999 && nevt>1) chain->GetEvent(1);//try a couple of more entries in case the nuFlavor isn't set correctly in the first entry
00250     if(nr->mctrue.nuFlavor==-9999 && nevt>5) chain->GetEvent(5);
00251     if((TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14) || (TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12))//beam MC
00252     {
00253       dt="FDMC_Beam";
00254     }
00255     else if((TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12) || (TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14))
00256     {
00257       dt="FDMC_Nue";
00258     }
00259     else if((TMath::Abs(nr->mctrue.nuFlavor)==16 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14) || (TMath::Abs(nr->mctrue.nuFlavor)==16 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12))
00260     {
00261       dt="FDMC_Tau";
00262     }
00263     else
00264     {
00265       cout<<"Unknown data type.  ("<<TMath::Abs(nr->mctrue.nonOscNuFlavor)<<", "<<TMath::Abs(nr->mctrue.nuFlavor)<<")  Quitting..."<<endl;
00266       return;
00267     }
00268   }
00269   SetDataType(dt);
00270   
00271   InitializeHistograms();
00272   ExHists->SetPOT(totpot);
00273   ExHists_Nu->SetPOT(totpot);
00274   ExHists_NuBar->SetPOT(totpot);
00275   
00276   for(i=0;i<nevt;i++)
00277 //   for(i=0;i<1000;i++)
00278   {
00279     chain->GetEvent(i);
00280     if(i%1000==0)
00281     {
00282       cout<<i<<endl;
00283     }
00284     
00285     isMC = (nr->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC);
00286     det = nr->GetHeader().GetVldContext().GetDetector();
00287     
00288     if(!NueStandard::PassesSelection(nr,Selection::kFid)) continue;
00289     
00290     NueConvention::NueEnergyCorrection(nr);
00291     if(isRHC) NueConvention::RHCNueEnergyCorrection(nr);
00292     
00293     weight = 1;
00294     if(isMC) weight = NueStandard::GetMCWeights(nr);
00295     if(!isMC && det == Detector::kNear) weight = NueStandard::GetNDDataWeights(nr);
00296     
00297     oscweight = 1;
00298     if(det == Detector::kFar && isMC)//oscillation reweighting
00299     {
00300       oscweight = NueStandard::GetOscWeight(nr->mctrue.nuFlavor,nr->mctrue.nonOscNuFlavor,nr->mctrue.nuEnergy);
00301     }
00302     
00303     CCEn = GetCCRecoEnergy(nr);
00304     NueEn = GetNueRecoEnergy(nr);
00305     
00306     if(!isMC && det == Detector::kNear)//near data
00307     {
00308       if(NueStandard::PassesSelection(nr,Selection::kCC))
00309       {
00310         ExHists->Reco_CClike->Fill(CCEn,weight);
00311         if(nr->srtrack.fitMomentum>0)
00312         {
00313           ExHists->Reco_CClike_Pos->Fill(CCEn,weight);
00314         }
00315         else
00316         {
00317           ExHists->Reco_CClike_Neg->Fill(CCEn,weight);
00318         }
00319       }
00320       continue;
00321     }
00322     
00323     if(isMC && det == Detector::kNear)//near MC
00324     {
00325       ExHists->TrueVsReco_Fid->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00326       if(nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==14)//numuCC
00327       {
00328         ExHists->TrueVsReco_Fid_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00329       }
00330       if(nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==-14)//numubarCC
00331       {
00332         ExHists->TrueVsReco_Fid_NuMuBarCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00333       }
00334     
00335       if(NueStandard::PassesSelection(nr, Selection::kCC))
00336       {
00337         ExHists->TrueVsReco_CClike->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00338         if(nr->srtrack.fitMomentum>0)
00339         {
00340           ExHists->TrueVsReco_CClike_Pos->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00341         }
00342         else
00343         {
00344           ExHists->TrueVsReco_CClike_Neg->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00345         }
00346         
00347         if(nr->mctrue.interactionType>0 && TMath::Abs(nr->mctrue.nuFlavor)==14)//numu/numubar CC
00348         {
00349           ExHists->TrueVsReco_CClike_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00350         }
00351         if(nr->srtrack.fitMomentum>0 && nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==-14 )//pos track, numubarCC
00352         {
00353           ExHists->TrueVsReco_CClike_Pos_NuMuBarCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00354         }
00355         if(nr->srtrack.fitMomentum<0 && nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==14 )//neg track, numuCC
00356         {
00357           ExHists->TrueVsReco_CClike_Neg_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00358         }
00359       }
00360       
00361       if(NueStandard::PassesSelection(nr, Selection::kPre))
00362       {
00363         piditer = PIDlist.begin();
00364         last = PIDlist.end();
00365         while(piditer!=last)
00366         {
00367           pidname = piditer->first;
00368           pidsel = piditer->second;
00369           if(nr->mctrue.interactionType==0)//NC
00370           {
00371             ExHists->TrueVsRecoVsPID_NC[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00372           }
00373           else//CC
00374           {
00375             if(TMath::Abs(nr->mctrue.nuFlavor)==14)//numu
00376             {
00377               ExHists->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00378             }
00379             if(TMath::Abs(nr->mctrue.nuFlavor)==12)//beam nue
00380             {
00381               ExHists->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00382             }
00383           }
00384           piditer++;
00385         }
00386       }
00387       
00388       continue;
00389     }
00390     
00391     if(isMC && det == Detector::kFar)
00392     {
00393       if((TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14) || (TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12))//beam MC only
00394       {
00395         ExHists->TrueVsReco_Fid->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00396         if(nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==14)//numuCC
00397         {
00398           ExHists->TrueVsReco_Fid_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00399         }
00400         if(nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==-14)//numubarCC
00401         {
00402           ExHists->TrueVsReco_Fid_NuMuBarCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00403         }
00404     
00405         if(NueStandard::PassesSelection(nr, Selection::kCC))
00406         {
00407           ExHists->TrueVsReco_CClike->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00408           if(nr->srtrack.fitMomentum>0)
00409           {
00410             ExHists->TrueVsReco_CClike_Pos->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00411           }
00412           else
00413           {
00414             ExHists->TrueVsReco_CClike_Neg->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00415           }
00416           
00417           if(nr->mctrue.interactionType>0 && TMath::Abs(nr->mctrue.nuFlavor)==14)//numu/numubar CC
00418           {
00419             ExHists->TrueVsReco_CClike_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00420           }
00421           if(nr->srtrack.fitMomentum>0 && nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==-14 )//pos track, numubarCC
00422           {
00423             ExHists->TrueVsReco_CClike_Pos_NuMuBarCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00424           }
00425           if(nr->srtrack.fitMomentum<0 && nr->mctrue.interactionType>0 && nr->mctrue.nuFlavor==14 )//neg track, numuCC
00426           {
00427             ExHists->TrueVsReco_CClike_Neg_NuMuCC->Fill(CCEn,nr->mctrue.nuEnergy,weight);
00428           }
00429         }
00430       }
00431       
00432       if(TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14 && nr->mctrue.interactionType>0)//oscillated nueCC only
00433       {
00434         if(nr->mctrue.nuFlavor==12)
00435         {
00436           ExHists->TrueVsReco_Fid_NueCC->Fill(NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00437           ExHists->True_Fid_NueCC->Fill(nr->mctrue.nuEnergy,weight*oscweight);
00438         }
00439         if(nr->mctrue.nuFlavor==-12)
00440         {
00441           ExHists->TrueVsReco_Fid_NueBarCC->Fill(NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00442           ExHists->True_Fid_NueBarCC->Fill(nr->mctrue.nuEnergy,weight*oscweight);
00443         }
00444       }
00445       
00446       if(TMath::Abs(nr->mctrue.nuFlavor)==16 && nr->mctrue.interactionType>0)//oscillated nutauCC only
00447       {
00448         if(nr->mctrue.nuFlavor==16)
00449         {
00450           ExHists->TrueVsReco_Fid_NuTauCC->Fill(NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00451           ExHists->True_Fid_NuTauCC->Fill(nr->mctrue.nuEnergy,weight*oscweight);
00452         }
00453         if(nr->mctrue.nuFlavor==-16)
00454         {
00455           ExHists->TrueVsReco_Fid_NuTauBarCC->Fill(NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00456           ExHists->True_Fid_NuTauBarCC->Fill(nr->mctrue.nuEnergy,weight*oscweight);
00457         }
00458       }
00459       
00460       if(NueStandard::PassesSelection(nr, Selection::kPre))
00461       {
00462         piditer = PIDlist.begin();
00463         last = PIDlist.end();
00464         while(piditer!=last)
00465         {
00466           pidname = piditer->first;
00467           pidsel = piditer->second;
00468           if(nr->mctrue.interactionType==0)//NC
00469           {
00470             ExHists->TrueVsRecoVsPID_NC[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00471             
00472             if((TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14) || (TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12))//beam MC only
00473             {
00474               if(nr->mctrue.nonOscNuFlavor==14)
00475               {
00476                 ExHists->TrueVsRecoVsPID_NC_NoOscNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00477               }
00478               if(nr->mctrue.nonOscNuFlavor==-14)
00479               {
00480                 ExHists->TrueVsRecoVsPID_NC_NoOscNuMuBar[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00481               }
00482               if(nr->mctrue.nonOscNuFlavor==12)
00483               {
00484                 ExHists->TrueVsRecoVsPID_NC_NoOscNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00485               }
00486               if(nr->mctrue.nonOscNuFlavor==-12)
00487               {
00488                 ExHists->TrueVsRecoVsPID_NC_NoOscNueBar[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight);
00489               }
00490             }
00491           }
00492           else//CC
00493           {
00494             if(TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14)//numu->numu
00495             {
00496               ExHists->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00497               if(nr->mctrue.nuFlavor>0)  ExHists_Nu->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00498               else ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00499             }
00500             if(TMath::Abs(nr->mctrue.nuFlavor)==14 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12)//beam nue->numu
00501             {
00502               ExHists->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00503               if(nr->mctrue.nuFlavor>0) ExHists_Nu->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00504               else ExHists_NuBar->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00505             }
00506             if(TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12)//beam nue->beam nue
00507             {
00508               ExHists->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00509               if(nr->mctrue.nuFlavor>0) ExHists_Nu->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00510               else ExHists_NuBar->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00511             }
00512             if(TMath::Abs(nr->mctrue.nuFlavor)==12 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14)//numu->nue
00513             {
00514               ExHists->TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00515               if(nr->mctrue.nuFlavor>0) ExHists_Nu->TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00516               else ExHists_NuBar->TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00517             }
00518             if(TMath::Abs(nr->mctrue.nuFlavor)==16 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==14)//numu->nutau
00519             {
00520               ExHists->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00521               if(nr->mctrue.nuFlavor>0) ExHists_Nu->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00522               else ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00523             }
00524             if(TMath::Abs(nr->mctrue.nuFlavor)==16 && TMath::Abs(nr->mctrue.nonOscNuFlavor)==12)//beam nue->nutau
00525             {
00526               ExHists->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00527               if(nr->mctrue.nuFlavor>0) ExHists_Nu->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00528               else ExHists_NuBar->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(NueStandard::GetPIDValue(nr,pidsel),NueEn,nr->mctrue.nuEnergy,weight*oscweight);
00529             }
00530           }
00531           piditer++;
00532         }
00533       }
00534     }
00535   }
00536   
00537   WriteToFile();
00538   
00539   return;
00540   
00541 }

void ExtrapHistsGen::FinalizeHistograms (  )  [private]

Definition at line 542 of file ExtrapHistsGen.cxx.

References ExHists, ExHists_Nu, ExHists_NuBar, ExtrapHists2D::fDirectory, ExtrapHists2D::GetPIDBins(), ExtrapHists2D::GetRecoBins(), ExtrapHists2D::GetTrueBins(), it, ExtrapHists2D::TrueVsRecoVsPID_BNueToBNue, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuMu, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuTau, ExtrapHists2D::TrueVsRecoVsPID_NC, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNue, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNueBar, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMu, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMuBar, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNue, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuMu, and ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuTau.

Referenced by WriteToFile().

00543 {
00544   int ir,it;
00545   int npid,nreco,ntrue;
00546   double r,p,t;
00547   
00548   npid = ExHists->GetPIDBins();
00549   nreco = ExHists->GetRecoBins();
00550   ntrue = ExHists->GetTrueBins();
00551   
00552   map<std::string, TH3D*>::iterator piditer;
00553   map<std::string, TH3D*>::iterator lastpid;
00554   string pidname;
00555   
00556   ExHists->fDirectory->cd();
00557   piditer = ExHists->TrueVsRecoVsPID_NC.begin();
00558   lastpid = ExHists->TrueVsRecoVsPID_NC.end();
00559   while(piditer != lastpid)
00560   {
00561     pidname = piditer->first;
00562     p = ExHists->TrueVsRecoVsPID_NC[pidname]->GetXaxis()->GetBinCenter(npid);//value of pid in last bin
00563     
00564     for(it=0;it<ntrue;it++)
00565     {
00566       for(ir=0;ir<nreco;ir++)
00567       {
00568         r = ExHists->TrueVsRecoVsPID_NC[pidname]->GetYaxis()->GetBinCenter(ir+1);
00569         t = ExHists->TrueVsRecoVsPID_NC[pidname]->GetZaxis()->GetBinCenter(it+1);
00570         
00571         ExHists->TrueVsRecoVsPID_NC[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NC[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00572         ExHists->TrueVsRecoVsPID_NC[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00573         
00574         ExHists->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NuMuToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00575         ExHists->TrueVsRecoVsPID_NuMuToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00576         
00577         ExHists->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_BNueToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00578         ExHists->TrueVsRecoVsPID_BNueToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00579         
00580         ExHists->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_BNueToBNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00581         ExHists->TrueVsRecoVsPID_BNueToBNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00582         
00583         ExHists-> TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NuMuToNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00584         ExHists->TrueVsRecoVsPID_NuMuToNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00585         
00586         ExHists->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NuMuToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00587         ExHists->TrueVsRecoVsPID_NuMuToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00588         
00589         ExHists->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_BNueToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00590         ExHists->TrueVsRecoVsPID_BNueToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00591         
00592         ExHists->TrueVsRecoVsPID_NC_NoOscNue[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NC_NoOscNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00593         ExHists->TrueVsRecoVsPID_NC_NoOscNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00594         
00595         ExHists->TrueVsRecoVsPID_NC_NoOscNuMu[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NC_NoOscNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00596         ExHists->TrueVsRecoVsPID_NC_NoOscNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00597         
00598         ExHists->TrueVsRecoVsPID_NC_NoOscNueBar[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NC_NoOscNueBar[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00599         ExHists->TrueVsRecoVsPID_NC_NoOscNueBar[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00600         
00601         ExHists->TrueVsRecoVsPID_NC_NoOscNuMuBar[pidname]->Fill(p,r,t,ExHists->TrueVsRecoVsPID_NC_NoOscNuMuBar[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00602         ExHists->TrueVsRecoVsPID_NC_NoOscNuMuBar[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00603         
00604       }
00605     }
00606     
00607     piditer++;
00608   }
00609   
00610   ExHists_Nu->fDirectory->cd();
00611   piditer = ExHists_Nu->TrueVsRecoVsPID_NC.begin();
00612   lastpid = ExHists_Nu->TrueVsRecoVsPID_NC.end();
00613   while(piditer != lastpid)
00614   {
00615     pidname = piditer->first;
00616     p = ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->GetXaxis()->GetBinCenter(npid);//value of pid in last bin
00617     
00618     for(it=0;it<ntrue;it++)
00619     {
00620       for(ir=0;ir<nreco;ir++)
00621       {
00622         r = ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->GetYaxis()->GetBinCenter(ir+1);
00623         t = ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->GetZaxis()->GetBinCenter(it+1);
00624         
00625         ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00626         ExHists_Nu->TrueVsRecoVsPID_NC[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00627         
00628         ExHists_Nu->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_NuMuToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00629         ExHists_Nu->TrueVsRecoVsPID_NuMuToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00630         
00631         ExHists_Nu->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_BNueToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00632         ExHists_Nu->TrueVsRecoVsPID_BNueToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00633         
00634         ExHists_Nu->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_BNueToBNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00635         ExHists_Nu->TrueVsRecoVsPID_BNueToBNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00636         
00637         ExHists_Nu-> TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_NuMuToNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00638         ExHists_Nu->TrueVsRecoVsPID_NuMuToNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00639         
00640         ExHists_Nu->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_NuMuToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00641         ExHists_Nu->TrueVsRecoVsPID_NuMuToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00642         
00643         ExHists_Nu->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(p,r,t,ExHists_Nu->TrueVsRecoVsPID_BNueToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00644         ExHists_Nu->TrueVsRecoVsPID_BNueToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00645         
00646       }
00647     }
00648     
00649     piditer++;
00650   }
00651   
00652   ExHists_NuBar->fDirectory->cd();
00653   piditer = ExHists_NuBar->TrueVsRecoVsPID_NC.begin();
00654   lastpid = ExHists_NuBar->TrueVsRecoVsPID_NC.end();
00655   while(piditer != lastpid)
00656   {
00657     pidname = piditer->first;
00658     p = ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->GetXaxis()->GetBinCenter(npid);//value of pid in last bin
00659     
00660     for(it=0;it<ntrue;it++)
00661     {
00662       for(ir=0;ir<nreco;ir++)
00663       {
00664         r = ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->GetYaxis()->GetBinCenter(ir+1);
00665         t = ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->GetZaxis()->GetBinCenter(it+1);
00666         
00667         ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00668         ExHists_NuBar->TrueVsRecoVsPID_NC[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00669         
00670         ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuMu[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00671         ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00672         
00673         ExHists_NuBar->TrueVsRecoVsPID_BNueToNuMu[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_BNueToNuMu[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00674         ExHists_NuBar->TrueVsRecoVsPID_BNueToNuMu[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00675         
00676         ExHists_NuBar->TrueVsRecoVsPID_BNueToBNue[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_BNueToBNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00677         ExHists_NuBar->TrueVsRecoVsPID_BNueToBNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00678         
00679         ExHists_NuBar-> TrueVsRecoVsPID_NuMuToNue[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_NuMuToNue[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00680         ExHists_NuBar->TrueVsRecoVsPID_NuMuToNue[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00681         
00682         ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuTau[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00683         ExHists_NuBar->TrueVsRecoVsPID_NuMuToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00684         
00685         ExHists_NuBar->TrueVsRecoVsPID_BNueToNuTau[pidname]->Fill(p,r,t,ExHists_NuBar->TrueVsRecoVsPID_BNueToNuTau[pidname]->GetBinContent(npid+1,ir+1,it+1));//fill last pid bin with overflow content
00686         ExHists_NuBar->TrueVsRecoVsPID_BNueToNuTau[pidname]->SetBinContent(npid+1,ir+1,it+1,0);//set overflow content to 0
00687         
00688       }
00689     }
00690     
00691     piditer++;
00692   }
00693   
00694   return;
00695 }

double ExtrapHistsGen::GetCCRecoEnergy ( NueRecord nr  )  [private]

Definition at line 767 of file ExtrapHistsGen.cxx.

References ANtpTrackInfoNue::phCCGeV, ANtpShowerInfoNue::phCCGeV, NueRecord::srshower, and NueRecord::srtrack.

Referenced by FillHistograms().

00768 {
00769   double CCEn = 0.0;
00770   if(nr->srtrack.phCCGeV > 0) CCEn += nr->srtrack.phCCGeV;
00771   if(nr->srshower.phCCGeV > 0) CCEn += nr->srshower.phCCGeV;
00772   
00773   return CCEn;
00774 }

double ExtrapHistsGen::GetNueRecoEnergy ( NueRecord nr  )  [private]

Definition at line 763 of file ExtrapHistsGen.cxx.

References ANtpEventInfoNue::phNueGeV, and NueRecord::srevent.

Referenced by FillHistograms().

00764 {
00765   return nr->srevent.phNueGeV;
00766 }

void ExtrapHistsGen::Initialize (  )  [private]

Definition at line 8 of file ExtrapHistsGen.cxx.

References ExHists, fout, isRHC, nPID, nReco, nTrue, paramtree, SetDataType(), NueStandard::SetDefaultOscParam(), SetFileList(), and SetOutputFile().

Referenced by ExtrapHistsGen().

00009 {
00010   SetOutputFile();
00011   SetFileList();
00012   SetDataType();
00013   
00014   fout = 0;
00015   paramtree = 0;
00016   ExHists = 0;
00017   
00018   NueStandard::SetDefaultOscParam();
00019   
00020   nReco=0;
00021   nTrue=0;
00022   nPID=0;
00023   
00024   isRHC=false;
00025   
00026   return;
00027 }

void ExtrapHistsGen::InitializeHistograms (  )  [private]

Definition at line 91 of file ExtrapHistsGen.cxx.

References ExtrapHists2D::AddPID(), DataType, ExHists, ExHists_Nu, ExHists_NuBar, ExtrapHists2D::fDirectory, Form(), ExtrapHists2D::InitializeHists(), nPID, nReco, nTrue, PIDEdges, PIDlist, RecoEdges, ExtrapHists2D::SetPIDBins(), ExtrapHists2D::SetRecoBins(), ExtrapHists2D::SetTrueBins(), and TrueEdges.

Referenced by FillHistograms().

00092 {
00093   gDirectory->cd("/");
00094   map<string,Selection::Selection_t>::iterator piditer;
00095   map<string,Selection::Selection_t>::iterator last;
00096   string p;
00097   
00098   int i;
00099   double *redges=0,*pedges=0,*tedges=0; 
00100   if(nReco!=0)
00101   {
00102     redges = new double[nReco+1];
00103     for(i=0;i<nReco+1;i++)
00104     {
00105       redges[i] = RecoEdges.at(i);
00106     }
00107   }
00108   if(nPID!=0)
00109   {
00110     pedges = new double[nPID+1];
00111     for(i=0;i<nPID+1;i++)
00112     {
00113       pedges[i] = PIDEdges.at(i);
00114     }
00115   }
00116   if(nTrue!=0)
00117   {
00118     tedges = new double[nTrue+1];
00119     for(i=0;i<nTrue+1;i++)
00120     {
00121       tedges[i] = TrueEdges.at(i);
00122     }
00123   }
00124   
00125   ExHists = new ExtrapHists2D(Form("ExtrapHists_%s",DataType.c_str()));
00126   if(nReco!=0) ExHists->SetRecoBins(nReco,redges);
00127   if(nPID!=0) ExHists->SetPIDBins(nPID,pedges);
00128   if(nTrue!=0) ExHists->SetTrueBins(nTrue,tedges);
00129   ExHists->fDirectory->cd();
00130   piditer = PIDlist.begin();
00131   last = PIDlist.end();
00132   while(piditer!=last)
00133   {
00134     p = piditer->first;
00135     ExHists->AddPID(p);
00136     piditer++;
00137   }
00138   ExHists->InitializeHists();
00139   
00140   ExHists_Nu = new ExtrapHists2D(Form("ExtrapHists_Nu_%s",DataType.c_str()));
00141   if(nReco!=0) ExHists_Nu->SetRecoBins(nReco,redges);
00142   if(nPID!=0) ExHists_Nu->SetPIDBins(nPID,pedges);
00143   if(nTrue!=0) ExHists_Nu->SetTrueBins(nTrue,tedges);
00144   ExHists_Nu->fDirectory->cd();
00145   piditer = PIDlist.begin();
00146   last = PIDlist.end();
00147   while(piditer!=last)
00148   {
00149     p = piditer->first;
00150     ExHists_Nu->AddPID(p);
00151     piditer++;
00152   }
00153   ExHists_Nu->InitializeHists();
00154   
00155   ExHists_NuBar = new ExtrapHists2D(Form("ExtrapHists_NuBar_%s",DataType.c_str()));
00156   if(nReco!=0) ExHists_NuBar->SetRecoBins(nReco,redges);
00157   if(nPID!=0) ExHists_NuBar->SetPIDBins(nPID,pedges);
00158   if(nTrue!=0) ExHists_NuBar->SetTrueBins(nTrue,tedges);
00159   ExHists_NuBar->fDirectory->cd();
00160   piditer = PIDlist.begin();
00161   last = PIDlist.end();
00162   while(piditer!=last)
00163   {
00164     p = piditer->first;
00165     ExHists_NuBar->AddPID(p);
00166     piditer++;
00167   }
00168   ExHists_NuBar->InitializeHists();
00169   
00170   return;
00171 }

void ExtrapHistsGen::SetDataType ( string  type = "NULL"  )  [private]

Definition at line 38 of file ExtrapHistsGen.cxx.

References DataType.

Referenced by FillHistograms(), and Initialize().

00039 {
00040   DataType = type;
00041   return;
00042 }

void ExtrapHistsGen::SetFileList ( string  list = "NULL"  ) 

Definition at line 33 of file ExtrapHistsGen.cxx.

References FileList.

Referenced by Initialize().

00034 {
00035   FileList = list;
00036   return;
00037 }

void ExtrapHistsGen::SetOutputFile ( string  name = "DefaultOut.root"  ) 

Referenced by Initialize().

void ExtrapHistsGen::SetPIDBins ( int  n,
double *  edges 
)

Definition at line 77 of file ExtrapHistsGen.cxx.

References nPID, and PIDEdges.

00078 {
00079   int i;
00080   
00081   nPID = n;
00082   
00083   PIDEdges.clear();
00084   for(i=0;i<nPID+1;i++)
00085   {
00086     PIDEdges.push_back(edges[i]);
00087   }
00088   
00089   return;
00090 }

void ExtrapHistsGen::SetRecoBins ( int  n,
double *  edges 
)

Definition at line 49 of file ExtrapHistsGen.cxx.

References nReco, and RecoEdges.

00050 {
00051   int i;
00052   
00053   nReco = n;
00054   
00055   RecoEdges.clear();
00056   for(i=0;i<nReco+1;i++)
00057   {
00058     RecoEdges.push_back(edges[i]);
00059   }
00060   
00061   return;
00062 }

void ExtrapHistsGen::SetRHC (  )  [inline]

Definition at line 43 of file ExtrapHistsGen.h.

References isRHC.

00043 {isRHC = true;};

void ExtrapHistsGen::SetTrueBins ( int  n,
double *  edges 
)

Definition at line 63 of file ExtrapHistsGen.cxx.

References nTrue, and TrueEdges.

00064 {
00065   int i;
00066   
00067   nTrue = n;
00068   
00069   TrueEdges.clear();
00070   for(i=0;i<nTrue+1;i++)
00071   {
00072     TrueEdges.push_back(edges[i]);
00073   }
00074   
00075   return;
00076 }

void ExtrapHistsGen::WriteToFile (  )  [private]

Definition at line 696 of file ExtrapHistsGen.cxx.

References DataType, DeltaCP, DeltaMSq12, DeltaMSq23, ExHists, ExHists_Nu, ExHists_NuBar, ExtrapHists2D::fDirectory, FinalizeHistograms(), fout, NueStandard::GetOscParam(), ExtrapHists2D::GetPOT(), gSystem(), OscPar::kDelta, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kTh12, OscPar::kTh13, OscPar::kTh23, n, outFileName, paramtree, Theta12, Theta13, and Theta23.

Referenced by FillHistograms().

00697 {
00698   FinalizeHistograms();
00699   
00700   double par[100]={0};
00701   NueStandard::GetOscParam(par);
00702   Theta12 = par[OscPar::kTh12];
00703   Theta13 = par[OscPar::kTh13];
00704   Theta23 = par[OscPar::kTh23];
00705   DeltaMSq23 = par[OscPar::kDeltaM23];
00706   DeltaMSq12 = par[OscPar::kDeltaM12];
00707   DeltaCP = par[OscPar::kDelta];
00708   
00709   double p = ExHists->GetPOT();
00710   
00711   fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00712   paramtree = new TTree("paramtree","paramtree");
00713   paramtree->Branch("POT",&p,"POT/D");
00714   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00715   paramtree->Branch("Theta13",&Theta13,"Theta13/D");
00716   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00717   paramtree->Branch("DeltaMSq23",&DeltaMSq23,"DeltaMSq23/D");
00718   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00719   paramtree->Branch("DeltaCP",&DeltaCP,"DeltaCP/D");
00720   paramtree->Fill();
00721   
00722   fout->cd();
00723   TDirectory *dir = fout->mkdir(DataType.c_str());
00724   dir->cd();
00725   TList *list = ExHists->fDirectory->GetList();
00726   TIter iter(list->MakeIterator());
00727   TObject *ob = 0;
00728   while((ob = iter())) 
00729   {
00730     ob->Write();
00731   }
00732   
00733   string n;
00734   
00735   fout->cd();
00736   n = DataType + "_Nu";
00737   TDirectory *dirnu = fout->mkdir(n.c_str());
00738   dirnu->cd();
00739   TList *listnu = ExHists_Nu->fDirectory->GetList();
00740   TIter iternu(listnu->MakeIterator());
00741   TObject *obnu = 0;
00742   while((obnu = iternu())) 
00743   {
00744     obnu->Write();
00745   }
00746   
00747   fout->cd();
00748   n = DataType + "_NuBar";
00749   TDirectory *dirnubar = fout->mkdir(n.c_str());
00750   dirnubar->cd();
00751   TList *listnubar = ExHists_NuBar->fDirectory->GetList();
00752   TIter iternubar(listnubar->MakeIterator());
00753   TObject *obnubar = 0;
00754   while((obnubar = iternubar())) 
00755   {
00756     obnubar->Write();
00757   }
00758   
00759   fout->cd();
00760   paramtree->Write();
00761   fout->Close();
00762 }


Member Data Documentation

string ExtrapHistsGen::DataType [private]

Definition at line 61 of file ExtrapHistsGen.h.

Referenced by InitializeHistograms(), SetDataType(), and WriteToFile().

double ExtrapHistsGen::DeltaCP [private]

Definition at line 73 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

double ExtrapHistsGen::DeltaMSq12 [private]

Definition at line 72 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

double ExtrapHistsGen::DeltaMSq23 [private]

Definition at line 71 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

string ExtrapHistsGen::FileList [private]

Definition at line 60 of file ExtrapHistsGen.h.

Referenced by FillHistograms(), and SetFileList().

TFile* ExtrapHistsGen::fout [private]

Definition at line 65 of file ExtrapHistsGen.h.

Referenced by Initialize(), and WriteToFile().

bool ExtrapHistsGen::isRHC [private]

Definition at line 83 of file ExtrapHistsGen.h.

Referenced by FillHistograms(), Initialize(), and SetRHC().

int ExtrapHistsGen::nPID [private]

Definition at line 77 of file ExtrapHistsGen.h.

Referenced by Initialize(), InitializeHistograms(), and SetPIDBins().

int ExtrapHistsGen::nReco [private]

Definition at line 75 of file ExtrapHistsGen.h.

Referenced by Initialize(), InitializeHistograms(), and SetRecoBins().

int ExtrapHistsGen::nTrue [private]

Definition at line 76 of file ExtrapHistsGen.h.

Referenced by Initialize(), InitializeHistograms(), and SetTrueBins().

string ExtrapHistsGen::outFileName [private]

Definition at line 59 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

TTree* ExtrapHistsGen::paramtree [private]

Definition at line 66 of file ExtrapHistsGen.h.

Referenced by Initialize(), and WriteToFile().

vector<double> ExtrapHistsGen::PIDEdges [private]

Definition at line 80 of file ExtrapHistsGen.h.

Referenced by InitializeHistograms(), and SetPIDBins().

Definition at line 63 of file ExtrapHistsGen.h.

Referenced by AddPID(), FillHistograms(), and InitializeHistograms().

vector<double> ExtrapHistsGen::RecoEdges [private]

Definition at line 79 of file ExtrapHistsGen.h.

Referenced by InitializeHistograms(), and SetRecoBins().

double ExtrapHistsGen::Theta12 [private]

Definition at line 68 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

double ExtrapHistsGen::Theta13 [private]

Definition at line 69 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

double ExtrapHistsGen::Theta23 [private]

Definition at line 70 of file ExtrapHistsGen.h.

Referenced by WriteToFile().

vector<double> ExtrapHistsGen::TrueEdges [private]

Definition at line 81 of file ExtrapHistsGen.h.

Referenced by InitializeHistograms(), and SetTrueBins().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1