NueUtilities::AnaNueProcessor Class Reference

#include <NueUtilities.h>

List of all members.

Public Member Functions

 AnaNueProcessor ()
 AnaNueProcessor (std::string fileListName)
 AnaNueProcessor (const AnaNueProcessor &original)
AnaNueProcessoroperator= (const AnaNueProcessor &original)
 ~AnaNueProcessor ()
Double_t GetTotalPOT ()
Bool_t didMC () const
Bool_t didData () const
Bool_t didFar () const
Bool_t didNear () const
Bool_t didNC () const
Bool_t didCC () const
Bool_t didBeamNue () const
Bool_t didTau () const
Bool_t didSignal () const
Bool_t didRun1 () const
Bool_t didRun2 () const
Bool_t didRun3 () const
Bool_t didRun11 () const
Bool_t didRun12 () const
Bool_t didRun13 () const
Bool_t NextEntry ()
Bool_t SetEntry (Long64_t entry)
Long64_t GetEntries () const
Long64_t CurrentEntry () const
void PrintProgress (unsigned int percentInterval)
std::string GetFileListName () const
Int_t GetLastFraction () const
Int_t GetNumberOfFiles ()
void PrintFileNames ()
Bool_t isMC ()
Bool_t isData ()
Bool_t isFar ()
Bool_t isNear ()
Bool_t isNC ()
Bool_t isCC ()
Bool_t isBeamNue ()
Bool_t isTau ()
Bool_t isSignal ()
Bool_t isNu ()
Bool_t isNuBar ()
Bool_t isQuasiElastic ()
Bool_t isRun1 ()
Bool_t isRun2 ()
Bool_t isRun3 ()
Bool_t isRun4RHC ()
Bool_t isRun7RHC ()
Bool_t isRun9RHC ()
Bool_t isRun11 ()
Bool_t isRun12 ()
Bool_t isRun13 ()
Double_t Normalization_RunSeparatedSample ()
Double_t Normalization_MixedRunSample ()
Double_t Normalization_RunSeparatedSampleRHC ()
Double_t Normalization_MixedRunSampleRHC ()
Double_t GetNDDataWeightedPOT (Bool_t mixed=false, unsigned int percentInterval=5)
Double_t GetOscWeight_f210f213f214Separate ()
Double_t GetRecoE ()
Double_t GetTrueE ()

Public Attributes

NueRecordnueRecord

Private Attributes

std::string filelist
TChain * ana_nue_chain
TChain * pottree_chain
Double_t totalPOT
bool totalPOTNotFilled
Long64_t numEntries
Long64_t currentEntry
Int_t lastfraction
Bool_t ProcessedMC
Bool_t ProcessedData
Bool_t ProcessedFar
Bool_t ProcessedNear
Bool_t ProcessedNC
Bool_t ProcessedCC
Bool_t ProcessedBeamNue
Bool_t ProcessedTau
Bool_t ProcessedSignal
Bool_t ProcessedRun1
Bool_t ProcessedRun2
Bool_t ProcessedRun3
Bool_t ProcessedRun11
Bool_t ProcessedRun12
Bool_t ProcessedRun13

Detailed Description

Definition at line 66 of file NueUtilities.h.


Constructor & Destructor Documentation

NueUtilities::AnaNueProcessor::AnaNueProcessor (  ) 

Definition at line 115 of file NueUtilities.cxx.

References ana_nue_chain, currentEntry, filelist, lastfraction, nueRecord, numEntries, pottree_chain, ProcessedBeamNue, ProcessedCC, ProcessedData, ProcessedFar, ProcessedMC, ProcessedNC, ProcessedNear, ProcessedRun1, ProcessedRun11, ProcessedRun12, ProcessedRun13, ProcessedRun2, ProcessedRun3, ProcessedSignal, ProcessedTau, and totalPOTNotFilled.

00116  {
00117    filelist = "";
00118    ana_nue_chain = NULL;
00119    pottree_chain = NULL;
00120 
00121    totalPOTNotFilled=true;
00122 
00123    nueRecord = NULL;
00124    numEntries = 0;
00125    currentEntry = -1;
00126    lastfraction = -1;
00127 
00128    ProcessedMC = false;
00129    ProcessedData = false;
00130    ProcessedFar = false;
00131    ProcessedNear = false;
00132    ProcessedNC = false;
00133    ProcessedCC = false;
00134    ProcessedBeamNue = false;
00135    ProcessedTau = false;
00136    ProcessedSignal = false;
00137    ProcessedRun1 = false;
00138    ProcessedRun2 = false;
00139    ProcessedRun3 = false;
00140 
00141    ProcessedRun11 = false;
00142    ProcessedRun12 = false;
00143    ProcessedRun13 = false;
00144 
00145  }

NueUtilities::AnaNueProcessor::AnaNueProcessor ( std::string  fileListName  ) 

Definition at line 147 of file NueUtilities.cxx.

References ana_nue_chain, NueUtilities::CreateChain(), currentEntry, filelist, lastfraction, nueRecord, numEntries, pottree_chain, ProcessedBeamNue, ProcessedCC, ProcessedData, ProcessedFar, ProcessedMC, ProcessedNC, ProcessedNear, ProcessedRun1, ProcessedRun11, ProcessedRun12, ProcessedRun13, ProcessedRun2, ProcessedRun3, ProcessedSignal, ProcessedTau, and totalPOTNotFilled.

00148  {
00149    filelist = fileListName;
00150    ana_nue_chain= NueUtilities::CreateChain("ana_nue",fileListName);
00151    pottree_chain= NueUtilities::CreateChain("pottree",fileListName);
00152 
00153    totalPOTNotFilled=true;
00154 
00155    nueRecord = NULL;
00156    ana_nue_chain->SetBranchAddress("NueRecord",&nueRecord);
00157    
00158    numEntries = ana_nue_chain->GetEntries();
00159    currentEntry = -1;
00160    lastfraction = -1;
00161 
00162    ProcessedMC = false;
00163    ProcessedData = false;
00164    ProcessedFar = false;
00165    ProcessedNear = false;
00166    ProcessedNC = false;
00167    ProcessedCC = false;
00168    ProcessedBeamNue = false;
00169    ProcessedTau = false;
00170    ProcessedSignal = false;
00171    ProcessedRun1 = false;
00172    ProcessedRun2 = false;
00173    ProcessedRun3 = false;
00174 
00175    ProcessedRun11 = false;
00176    ProcessedRun12 = false;
00177    ProcessedRun13 = false;
00178 
00179  }

NueUtilities::AnaNueProcessor::AnaNueProcessor ( const AnaNueProcessor original  ) 

Definition at line 183 of file NueUtilities.cxx.

00184  {
00185    *this = original;
00186  }

NueUtilities::AnaNueProcessor::~AnaNueProcessor (  ) 

Definition at line 232 of file NueUtilities.cxx.

References ana_nue_chain, and pottree_chain.

00233  {
00234    delete ana_nue_chain;
00235    delete pottree_chain;
00236 
00237  }


Member Function Documentation

Long64_t NueUtilities::AnaNueProcessor::CurrentEntry (  )  const [inline]

Definition at line 103 of file NueUtilities.h.

References currentEntry.

Referenced by GetNDDataWeightedPOT(), and operator=().

00103 {return(currentEntry);};

Bool_t NueUtilities::AnaNueProcessor::didBeamNue (  )  const [inline]

Definition at line 86 of file NueUtilities.h.

References ProcessedBeamNue.

Referenced by operator=().

00086 { return(ProcessedBeamNue); };

Bool_t NueUtilities::AnaNueProcessor::didCC (  )  const [inline]

Definition at line 85 of file NueUtilities.h.

References ProcessedCC.

Referenced by operator=().

00085 { return(ProcessedCC); };

Bool_t NueUtilities::AnaNueProcessor::didData (  )  const [inline]

Definition at line 81 of file NueUtilities.h.

References ProcessedData.

Referenced by operator=().

00081 { return(ProcessedData); };

Bool_t NueUtilities::AnaNueProcessor::didFar (  )  const [inline]

Definition at line 82 of file NueUtilities.h.

References ProcessedFar.

Referenced by operator=().

00082 { return(ProcessedFar); };

Bool_t NueUtilities::AnaNueProcessor::didMC (  )  const [inline]

Definition at line 80 of file NueUtilities.h.

References ProcessedMC.

Referenced by operator=().

00080 { return(ProcessedMC); };

Bool_t NueUtilities::AnaNueProcessor::didNC (  )  const [inline]

Definition at line 84 of file NueUtilities.h.

References ProcessedNC.

Referenced by operator=().

00084 { return(ProcessedNC); };

Bool_t NueUtilities::AnaNueProcessor::didNear (  )  const [inline]

Definition at line 83 of file NueUtilities.h.

References ProcessedNear.

Referenced by operator=().

00083 { return(ProcessedNear); };

Bool_t NueUtilities::AnaNueProcessor::didRun1 (  )  const [inline]

Definition at line 89 of file NueUtilities.h.

References ProcessedRun1.

Referenced by operator=().

00089 { return(ProcessedRun1); };

Bool_t NueUtilities::AnaNueProcessor::didRun11 (  )  const [inline]

Definition at line 93 of file NueUtilities.h.

References ProcessedRun11.

Referenced by operator=().

00093 { return(ProcessedRun11); };

Bool_t NueUtilities::AnaNueProcessor::didRun12 (  )  const [inline]

Definition at line 94 of file NueUtilities.h.

References ProcessedRun12.

Referenced by operator=().

00094 { return(ProcessedRun12); };

Bool_t NueUtilities::AnaNueProcessor::didRun13 (  )  const [inline]

Definition at line 95 of file NueUtilities.h.

References ProcessedRun13.

Referenced by operator=().

00095 { return(ProcessedRun13); };

Bool_t NueUtilities::AnaNueProcessor::didRun2 (  )  const [inline]

Definition at line 90 of file NueUtilities.h.

References ProcessedRun2.

Referenced by operator=().

00090 { return(ProcessedRun2); };

Bool_t NueUtilities::AnaNueProcessor::didRun3 (  )  const [inline]

Definition at line 91 of file NueUtilities.h.

References ProcessedRun3.

Referenced by operator=().

00091 { return(ProcessedRun3); };

Bool_t NueUtilities::AnaNueProcessor::didSignal (  )  const [inline]

Definition at line 88 of file NueUtilities.h.

References ProcessedSignal.

Referenced by operator=().

00088 { return(ProcessedSignal); };

Bool_t NueUtilities::AnaNueProcessor::didTau (  )  const [inline]

Definition at line 87 of file NueUtilities.h.

References ProcessedTau.

Referenced by operator=().

00087 { return(ProcessedTau); };

Long64_t NueUtilities::AnaNueProcessor::GetEntries (  )  const [inline]

Definition at line 102 of file NueUtilities.h.

References numEntries.

00102 {return(numEntries);};

std::string NueUtilities::AnaNueProcessor::GetFileListName (  )  const [inline]

Definition at line 106 of file NueUtilities.h.

References filelist.

Referenced by operator=().

00106 {return(filelist);};

Int_t NueUtilities::AnaNueProcessor::GetLastFraction (  )  const [inline]

Definition at line 107 of file NueUtilities.h.

References lastfraction.

Referenced by operator=().

00107 {return(lastfraction);};

Double_t NueUtilities::AnaNueProcessor::GetNDDataWeightedPOT ( Bool_t  mixed = false,
unsigned int  percentInterval = 5 
)

Definition at line 524 of file NueUtilities.cxx.

References BeamMon::bI, NueRecord::bmon, CurrentEntry(), NueHeader::GetEventNo(), NueHeader::GetEvents(), RecRecordImp< T >::GetHeader(), NueStandard::GetNDDataWeights(), GetTotalPOT(), isMC(), isRun3(), isRun4RHC(), isRun7RHC(), isRun9RHC(), lastfraction, NextEntry(), nueRecord, NueStandard::PassesPOTStandards(), PrintProgress(), and SetEntry().

00524                                                                                                     {
00525   Double_t chainpot = 0;
00526   lastfraction = 0;
00527   SetEntry(0);
00528   Bool_t pass = true;
00529   if( ( !isRun3() && !mixed && !isRun4RHC() && !isRun7RHC() && !isRun9RHC() ) || isMC() ){
00530     chainpot = GetTotalPOT();
00531     pass = false;
00532     cout << "===========> Not Run3 Data! Getting Standard POT <===========" << endl;
00533   }
00534   else cout << "===========> Beginning POT weight loop <===========" << endl;
00535   SetEntry(-1);
00536   while( NextEntry() && pass ) //loop over events in ana_nue chain
00537   {
00538     PrintProgress(percentInterval);
00539 
00540     if(NueStandard::PassesPOTStandards(nueRecord)){
00541       if(nueRecord->GetHeader().GetEventNo() == 0 || nueRecord->GetHeader().GetEvents()==0)
00542       {
00543         double dataweight = NueStandard::GetNDDataWeights(nueRecord);
00544         chainpot += dataweight*nueRecord->bmon.bI;
00545         SetEntry(CurrentEntry()+TMath::Max(0,nueRecord->GetHeader().GetEvents()-1));
00546       }
00547     }
00548   }
00549   lastfraction = 0;
00550   SetEntry(-1);
00551   return chainpot;
00552 }

Int_t NueUtilities::AnaNueProcessor::GetNumberOfFiles (  )  [inline]

Definition at line 109 of file NueUtilities.h.

References ana_nue_chain.

00109 { return( ana_nue_chain->GetNtrees() ); };

Double_t NueUtilities::AnaNueProcessor::GetOscWeight_f210f213f214Separate (  ) 

Definition at line 554 of file NueUtilities.cxx.

References NueStandard::GetOscWeight(), isFar(), isMC(), isNC(), NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, ANtpTruthInfo::nuEnergy, nueRecord, and ANtpTruthInfo::nuFlavor.

00555  {
00556   //This method of applying oscillations depends on how you do add your samples together
00557   //This method works if you keep the f210*, f213*, and f214* files separate
00558    Double_t eventWeight =1;
00559 
00560    if( isMC() && isFar() && !isNC() )
00561    {
00562     eventWeight = NueStandard::GetOscWeight(nueRecord->mctrue.nuFlavor, nueRecord->mctrue.nonOscNuFlavor, nueRecord->mctrue.nuEnergy);
00563    }
00564 
00565    return(eventWeight);
00566  }

Double_t NueUtilities::AnaNueProcessor::GetRecoE (  ) 

Definition at line 569 of file NueUtilities.cxx.

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

00570  {
00571    return(nueRecord->srevent.phNueGeV);
00572  }

Double_t NueUtilities::AnaNueProcessor::GetTotalPOT (  ) 
Double_t NueUtilities::AnaNueProcessor::GetTrueE (  ) 

Definition at line 575 of file NueUtilities.cxx.

References NueRecord::mctrue, ANtpTruthInfo::nuEnergy, and nueRecord.

00576  {
00577    return(nueRecord->mctrue.nuEnergy);
00578  }

Bool_t NueUtilities::AnaNueProcessor::isBeamNue (  ) 

Definition at line 359 of file NueUtilities.cxx.

References isMC(), isNC(), NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, nueRecord, and ANtpTruthInfo::nuFlavor.

Referenced by SetEntry().

00360  {
00361   return(isMC() && !isNC() && abs(nueRecord->mctrue.nuFlavor)==12 && abs(nueRecord->mctrue.nonOscNuFlavor)==12);
00362  }

Bool_t NueUtilities::AnaNueProcessor::isCC (  ) 

Definition at line 354 of file NueUtilities.cxx.

References isMC(), isNC(), NueRecord::mctrue, nueRecord, and ANtpTruthInfo::nuFlavor.

Referenced by isQuasiElastic(), and SetEntry().

00355  {
00356   return(isMC() && !isNC() && abs(nueRecord->mctrue.nuFlavor)==14);
00357  }

Bool_t NueUtilities::AnaNueProcessor::isData (  ) 
Bool_t NueUtilities::AnaNueProcessor::isFar (  ) 
Bool_t NueUtilities::AnaNueProcessor::isMC (  ) 
Bool_t NueUtilities::AnaNueProcessor::isNC (  ) 
Bool_t NueUtilities::AnaNueProcessor::isNear (  ) 
Bool_t NueUtilities::AnaNueProcessor::isNu (  ) 

Definition at line 374 of file NueUtilities.cxx.

References isMC(), NueRecord::mctrue, nueRecord, and ANtpTruthInfo::nuFlavor.

00375  {
00376   return( isMC() && nueRecord->mctrue.nuFlavor > 0 );
00377  }

Bool_t NueUtilities::AnaNueProcessor::isNuBar (  ) 

Definition at line 379 of file NueUtilities.cxx.

References isMC(), NueRecord::mctrue, nueRecord, and ANtpTruthInfo::nuFlavor.

00380  {
00381   return( isMC() && nueRecord->mctrue.nuFlavor < 0 && nueRecord->mctrue.nuFlavor > -9000 );
00382  }

Bool_t NueUtilities::AnaNueProcessor::isQuasiElastic (  ) 

Definition at line 384 of file NueUtilities.cxx.

References isCC(), NueRecord::mctrue, nueRecord, and ANtpTruthInfoBeam::resonanceCode.

00385  {
00386   return( isCC() && nueRecord->mctrue.resonanceCode==1001);
00387  }

Bool_t NueUtilities::AnaNueProcessor::isRun1 (  ) 

Definition at line 392 of file NueUtilities.cxx.

References NueStandard::IsRun1(), and nueRecord.

Referenced by SetEntry().

00393  {
00394   return( NueStandard::IsRun1(nueRecord) );
00395  }

Bool_t NueUtilities::AnaNueProcessor::isRun11 (  ) 

Definition at line 423 of file NueUtilities.cxx.

References NueStandard::IsRun11(), and nueRecord.

Referenced by SetEntry().

00424  {
00425   return( NueStandard::IsRun11(nueRecord) );
00426  }

Bool_t NueUtilities::AnaNueProcessor::isRun12 (  ) 

Definition at line 428 of file NueUtilities.cxx.

References NueStandard::IsRun12(), and nueRecord.

Referenced by SetEntry().

00429  {
00430   return( NueStandard::IsRun12(nueRecord) );
00431  }

Bool_t NueUtilities::AnaNueProcessor::isRun13 (  ) 

Definition at line 433 of file NueUtilities.cxx.

References NueStandard::IsRun13(), and nueRecord.

Referenced by SetEntry().

00434  {
00435   return( NueStandard::IsRun13(nueRecord) );
00436  }

Bool_t NueUtilities::AnaNueProcessor::isRun2 (  ) 

Definition at line 397 of file NueUtilities.cxx.

References NueStandard::IsRun2(), and nueRecord.

Referenced by SetEntry().

00398  {
00399   return( NueStandard::IsRun2(nueRecord) );
00400  }

Bool_t NueUtilities::AnaNueProcessor::isRun3 (  ) 

Definition at line 402 of file NueUtilities.cxx.

References NueStandard::IsRun3(), and nueRecord.

Referenced by GetNDDataWeightedPOT(), and SetEntry().

00403  {
00404   return( NueStandard::IsRun3(nueRecord) );
00405  }

Bool_t NueUtilities::AnaNueProcessor::isRun4RHC (  ) 

Definition at line 408 of file NueUtilities.cxx.

References NueStandard::IsRun4RHC(), and nueRecord.

Referenced by GetNDDataWeightedPOT().

00409 {
00410   return( NueStandard::IsRun4RHC(nueRecord) );
00411 }

Bool_t NueUtilities::AnaNueProcessor::isRun7RHC (  ) 

Definition at line 413 of file NueUtilities.cxx.

References NueStandard::IsRun7RHC(), and nueRecord.

Referenced by GetNDDataWeightedPOT().

00414 {
00415   return( NueStandard::IsRun7RHC(nueRecord) );
00416 }

Bool_t NueUtilities::AnaNueProcessor::isRun9RHC (  ) 

Definition at line 417 of file NueUtilities.cxx.

References NueStandard::IsRun9RHC(), and nueRecord.

Referenced by GetNDDataWeightedPOT().

00418 {
00419   return( NueStandard::IsRun9RHC(nueRecord) );
00420 }

Bool_t NueUtilities::AnaNueProcessor::isSignal (  ) 

Definition at line 369 of file NueUtilities.cxx.

References isMC(), isNC(), NueRecord::mctrue, ANtpTruthInfoBeam::nonOscNuFlavor, nueRecord, and ANtpTruthInfo::nuFlavor.

Referenced by SetEntry().

00370  {
00371   return( isMC() && !isNC() && abs(nueRecord->mctrue.nuFlavor)==12 && abs(nueRecord->mctrue.nonOscNuFlavor)==14 );
00372  }

Bool_t NueUtilities::AnaNueProcessor::isTau (  ) 

Definition at line 364 of file NueUtilities.cxx.

References isMC(), isNC(), NueRecord::mctrue, nueRecord, and ANtpTruthInfo::nuFlavor.

Referenced by SetEntry().

00365  {
00366   return(isMC() && !isNC() && abs(nueRecord->mctrue.nuFlavor)==16);
00367  }

Bool_t NueUtilities::AnaNueProcessor::NextEntry (  ) 

Definition at line 250 of file NueUtilities.cxx.

References currentEntry, and SetEntry().

Referenced by GetNDDataWeightedPOT().

00251  {
00252   ++currentEntry;
00253   return (SetEntry(currentEntry));
00254  }

Double_t NueUtilities::AnaNueProcessor::Normalization_MixedRunSample (  ) 

Definition at line 466 of file NueUtilities.cxx.

References GetTotalPOT(), isMC(), isNear(), NueStandard::kNormalizedFarPOT, and NueStandard::kNormalizedNearPOT.

00467  {
00468   //normalize POT assuming sample only contains mixture of events from different run periods
00469    Double_t eventWeight = 1;
00470    if(isNear())
00471    {
00472      //Normalize Near Data and MC
00473       eventWeight = NueStandard::kNormalizedNearPOT/GetTotalPOT();
00474    }
00475    else if(isMC())
00476    {
00477      //Only Normalize Far MC
00478      //This normalization is only appropriate if runs mixed -- and is thoroughly inappropriate for MINOS+
00479      eventWeight = NueStandard::kNormalizedFarPOT/GetTotalPOT();
00480    }
00481     
00482    return(eventWeight);
00483  }

Double_t NueUtilities::AnaNueProcessor::Normalization_MixedRunSampleRHC (  ) 

Definition at line 504 of file NueUtilities.cxx.

References GetTotalPOT(), isMC(), isNear(), NueStandard::kNormalizedFarPOT_RHC, and NueStandard::kNormalizedNearPOT.

00505 {
00506   //normalize POT assuming mixture of events from different run periods
00507   Double_t eventWeight = 1;
00508   if(isNear())
00509     {
00510       eventWeight = NueStandard::kNormalizedNearPOT/GetTotalPOT();
00511     }
00512   else if(isMC())
00513     {
00514       eventWeight = NueStandard::kNormalizedFarPOT_RHC/GetTotalPOT();
00515     }
00516 
00517   return(eventWeight);
00518 }

Double_t NueUtilities::AnaNueProcessor::Normalization_RunSeparatedSample (  ) 

Definition at line 441 of file NueUtilities.cxx.

References GetTotalPOT(), isMC(), isNear(), NueStandard::IsRun1(), NueStandard::IsRun11(), NueStandard::IsRun12(), NueStandard::IsRun13(), NueStandard::IsRun2(), NueStandard::IsRun3(), NueStandard::kNormalizedFarPOT_Run1, NueStandard::kNormalizedFarPOT_Run11, NueStandard::kNormalizedFarPOT_Run12, NueStandard::kNormalizedFarPOT_Run13, NueStandard::kNormalizedFarPOT_Run2, NueStandard::kNormalizedFarPOT_Run3, NueStandard::kNormalizedNearPOT, and nueRecord.

00442  {
00443   //normalize POT assuming sample only contains events from one run period
00444    Double_t eventWeight =1;
00445    if(isNear())
00446    {
00447      //Normalize Near Data and MC
00448       eventWeight = NueStandard::kNormalizedNearPOT/GetTotalPOT();
00449    }
00450    else if(isMC())
00451    {
00452      //Only Normalize Far MC
00453      //This normalization is only appropriate if Run 1, 2, and 3 are in separate samples
00454      if( NueStandard::IsRun1(nueRecord) )      eventWeight = NueStandard::kNormalizedFarPOT_Run1/GetTotalPOT();
00455      else if( NueStandard::IsRun2(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run2/GetTotalPOT();
00456      else if( NueStandard::IsRun3(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run3/GetTotalPOT();
00457      //Adam is going to cheat and add MINOS+ functions to this nonsense
00458      else if( NueStandard::IsRun11(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run11/GetTotalPOT();
00459      else if( NueStandard::IsRun12(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run12/GetTotalPOT();
00460      else if( NueStandard::IsRun13(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run13/GetTotalPOT();
00461    }
00462     
00463    return(eventWeight);
00464  }

Double_t NueUtilities::AnaNueProcessor::Normalization_RunSeparatedSampleRHC (  ) 

Definition at line 487 of file NueUtilities.cxx.

References GetTotalPOT(), isMC(), isNear(), NueStandard::IsRun4RHC(), NueStandard::IsRun7RHC(), NueStandard::kNormalizedFarPOT_Run4RHC, NueStandard::kNormalizedFarPOT_Run7RHC, NueStandard::kNormalizedNearPOT, and nueRecord.

00488 {
00489   //normalize POT assuming sample contains events from only one run period
00490   Double_t eventWeight = 1;
00491   if(isNear())
00492     {
00493       eventWeight = NueStandard::kNormalizedNearPOT/GetTotalPOT();
00494     }
00495   else if(isMC())
00496     {
00497       if( NueStandard::IsRun4RHC(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run4RHC/GetTotalPOT();
00498       else if( NueStandard::IsRun7RHC(nueRecord) ) eventWeight = NueStandard::kNormalizedFarPOT_Run7RHC/GetTotalPOT();
00499     }
00500 
00501   return(eventWeight);
00502 }

NueUtilities::AnaNueProcessor & NueUtilities::AnaNueProcessor::operator= ( const AnaNueProcessor original  ) 

Definition at line 188 of file NueUtilities.cxx.

References ana_nue_chain, NueUtilities::CreateChain(), CurrentEntry(), didBeamNue(), didCC(), didData(), didFar(), didMC(), didNC(), didNear(), didRun1(), didRun11(), didRun12(), didRun13(), didRun2(), didRun3(), didSignal(), didTau(), filelist, GetFileListName(), GetLastFraction(), lastfraction, nueRecord, numEntries, pottree_chain, ProcessedBeamNue, ProcessedCC, ProcessedData, ProcessedFar, ProcessedMC, ProcessedNC, ProcessedNear, ProcessedRun1, ProcessedRun11, ProcessedRun12, ProcessedRun13, ProcessedRun2, ProcessedRun3, ProcessedSignal, ProcessedTau, SetEntry(), and totalPOTNotFilled.

00189  {  
00190   // check for "self assignment" and do nothing in that case
00191   if (this != &original)
00192   {
00193    filelist = original.GetFileListName();
00194 
00195    ana_nue_chain= NueUtilities::CreateChain("ana_nue",filelist);
00196    pottree_chain= NueUtilities::CreateChain("pottree",filelist);
00197 
00198    totalPOTNotFilled=true;
00199 
00200    nueRecord = NULL;
00201    ana_nue_chain->SetBranchAddress("NueRecord",&nueRecord);
00202 
00203    ProcessedMC = original.didMC();
00204    ProcessedData = original.didData();
00205    ProcessedFar = original.didFar();
00206    ProcessedNear = original.didNear();
00207    ProcessedNC = original.didNC();
00208    ProcessedCC = original.didCC();
00209    ProcessedBeamNue = original.didBeamNue();
00210    ProcessedTau = original.didTau();
00211    ProcessedSignal = original.didSignal();
00212    ProcessedRun1 = original.didRun1();
00213    ProcessedRun2 = original.didRun2();
00214    ProcessedRun3 = original.didRun3();
00215 
00216    ProcessedRun11 = original.didRun11();
00217    ProcessedRun12 = original.didRun12();
00218    ProcessedRun13 = original.didRun13();
00219 
00220    
00221    numEntries = ana_nue_chain->GetEntries();
00222    lastfraction = original.GetLastFraction();
00223 
00224    this->SetEntry(original.CurrentEntry());
00225   }// if not itself
00226   return *this;
00227 
00228  }

void NueUtilities::AnaNueProcessor::PrintFileNames (  ) 

Definition at line 309 of file NueUtilities.cxx.

References filelist.

00310  {
00311   Long64_t num = 0;
00312   std::cout << "\nProcessing the following files:";
00313   ifstream fileList(filelist.c_str());
00314   if( fileList )
00315   {
00316    while( fileList.good() && !fileList.eof() )
00317    {
00318      std::string line;
00319      getline(fileList,line,'\n');
00320      if ( line.size()==0 ) continue;
00321      std::cout << "\n " << line;
00322      ++num;
00323    }
00324   }
00325   std::cout << "\nTotal number of files = " << num << endl;
00326  }

void NueUtilities::AnaNueProcessor::PrintProgress ( unsigned int  percentInterval  ) 

Definition at line 292 of file NueUtilities.cxx.

References currentEntry, lastfraction, and numEntries.

Referenced by GetNDDataWeightedPOT().

00293  {
00294    Int_t fraction = (100*currentEntry)/numEntries;
00295    
00296    if ( (fraction-lastfraction) >= (Int_t)percentInterval )
00297    {
00298     std::cout<<"\n"<<fraction<<"% done"<<std::endl;
00299     lastfraction = fraction;
00300    }
00301 
00302    if( currentEntry == (numEntries-1) ) 
00303    {
00304     std::cout<<"\nOn last entry"<<std::endl;
00305     lastfraction = fraction;
00306    }
00307  }

Bool_t NueUtilities::AnaNueProcessor::SetEntry ( Long64_t  entry  ) 

Definition at line 256 of file NueUtilities.cxx.

References ana_nue_chain, currentEntry, isBeamNue(), isCC(), isData(), isFar(), isMC(), isNC(), isNear(), isRun1(), isRun11(), isRun12(), isRun13(), isRun2(), isRun3(), isSignal(), isTau(), numEntries, ProcessedBeamNue, ProcessedCC, ProcessedData, ProcessedFar, ProcessedMC, ProcessedNC, ProcessedNear, ProcessedRun1, ProcessedRun11, ProcessedRun12, ProcessedRun13, ProcessedRun2, ProcessedRun3, ProcessedSignal, and ProcessedTau.

Referenced by GetNDDataWeightedPOT(), NextEntry(), and operator=().

00257  {
00258   currentEntry = entry;
00259   if(currentEntry <0 || currentEntry >= numEntries)
00260   {
00261     //nueRecord= NULL; //just don't do anything
00262     return(false);
00263   }
00264   ana_nue_chain->GetEntry(currentEntry);
00265    ProcessedMC |= isMC();
00266    ProcessedData |= isData();
00267    ProcessedFar |= isFar();
00268    ProcessedNear |= isNear();
00269    ProcessedNC |= isNC();
00270    ProcessedCC |= isCC();
00271    ProcessedBeamNue |= isBeamNue();
00272    ProcessedTau |= isTau();
00273    ProcessedSignal |= isSignal();
00274    ProcessedRun1 |= isRun1();
00275    ProcessedRun2 |= isRun2();
00276    ProcessedRun3 |= isRun3();
00277 
00278    ProcessedRun11 |= isRun11();
00279    ProcessedRun12 |= isRun12();
00280    ProcessedRun13 |= isRun13();
00281 
00282   //Could of had this function return the result of GetEntry(currentEntry),
00283   //but that would just cause loops to end and people would probably think that
00284   //they just hit the end of the entries. However, at this point in the code if
00285   //GetEntry(currentEntry) returns a nonpositve value, then something wrong happend
00286   //and I want the program to crash
00287 
00288   return(true);
00289   
00290  }


Member Data Documentation

Definition at line 164 of file NueUtilities.h.

Referenced by AnaNueProcessor(), CurrentEntry(), NextEntry(), PrintProgress(), and SetEntry().

Definition at line 157 of file NueUtilities.h.

Referenced by AnaNueProcessor(), GetFileListName(), operator=(), and PrintFileNames().

Definition at line 163 of file NueUtilities.h.

Referenced by AnaNueProcessor(), GetEntries(), operator=(), PrintProgress(), and SetEntry().

Definition at line 159 of file NueUtilities.h.

Referenced by AnaNueProcessor(), GetTotalPOT(), operator=(), and ~AnaNueProcessor().

Definition at line 173 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didBeamNue(), operator=(), and SetEntry().

Definition at line 172 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didCC(), operator=(), and SetEntry().

Definition at line 168 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didData(), operator=(), and SetEntry().

Definition at line 169 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didFar(), operator=(), and SetEntry().

Definition at line 167 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didMC(), operator=(), and SetEntry().

Definition at line 171 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didNC(), operator=(), and SetEntry().

Definition at line 170 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didNear(), operator=(), and SetEntry().

Definition at line 176 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun1(), operator=(), and SetEntry().

Definition at line 180 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun11(), operator=(), and SetEntry().

Definition at line 181 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun12(), operator=(), and SetEntry().

Definition at line 182 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun13(), operator=(), and SetEntry().

Definition at line 177 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun2(), operator=(), and SetEntry().

Definition at line 178 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didRun3(), operator=(), and SetEntry().

Definition at line 175 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didSignal(), operator=(), and SetEntry().

Definition at line 174 of file NueUtilities.h.

Referenced by AnaNueProcessor(), didTau(), operator=(), and SetEntry().

Definition at line 160 of file NueUtilities.h.

Referenced by GetTotalPOT().

Definition at line 161 of file NueUtilities.h.

Referenced by AnaNueProcessor(), GetTotalPOT(), and operator=().


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

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1