NuFluxChain Class Reference

#include <NuFluxChain.h>

Inheritance diagram for NuFluxChain:

NuFluggChain NuGnumiChain List of all members.

Public Member Functions

 NuFluxChain ()
virtual ~NuFluxChain ()
virtual void LoadEvent (const Int_t event) const
virtual Int_t GetEntries () const
virtual Double_t MuonParentPX (const Int_t event) const =0
virtual Double_t MuonParentPY (const Int_t event) const =0
virtual Double_t MuonParentPZ (const Int_t event) const =0
virtual Double_t MuonParentEnergy (const Int_t event) const =0
virtual Double_t NeutrinoFDEnergy (const Int_t event) const =0
virtual Double_t NeutrinoNDEnergy (const Int_t event) const =0
virtual Double_t NuECofM (const Int_t event) const =0
virtual NuParticle::NuParticleType_t NuType (const Int_t event) const =0
virtual Double_t NuImportanceWeight (const Int_t event) const =0
virtual Double_t NuFDWeight (const Int_t event) const =0
virtual Int_t NuParticleAsPDGCode (const NuParticle::NuParticleType_t nuParticle) const
virtual Double_t NuNDWeight (const Int_t event) const =0
virtual Double_t ParentDecayVtxX (const Int_t event) const =0
virtual Double_t ParentDecayVtxY (const Int_t event) const =0
virtual Double_t ParentDecayVtxZ (const Int_t event) const =0
virtual Double_t ParentMass (const Int_t event) const =0
virtual NuParticle::NuParticleType_t ParentParticleType (const Int_t event) const =0
virtual Double_t ParentPX (const Int_t event) const =0
virtual Double_t ParentPY (const Int_t event) const =0
virtual Double_t ParentPZ (const Int_t event) const =0
virtual Double_t ParentProdDXDZ (const Int_t event) const =0
virtual Double_t ParentProdDYDZ (const Int_t event) const =0
virtual Double_t ParentProdEnergy (const Int_t event) const =0
virtual Double_t ParentProdPZ (const Int_t event) const =0
virtual Double_t ParentProdVtxX (const Int_t event) const =0
virtual Double_t ParentProdVtxY (const Int_t event) const =0
virtual Double_t ParentProdVtxZ (const Int_t event) const =0
virtual NuParticle::NuParticleType_t ParentType (const Int_t event) const =0
virtual Double_t TargetParentPX (const Int_t event) const =0
virtual Double_t TargetParentPY (const Int_t event) const =0
virtual Double_t TargetParentPZ (const Int_t event) const =0
virtual BeamType::BeamType_t GetBeamType () const
virtual SKZPWeightCalculator::RunPeriod_t GetRunPeriod () const

Protected Member Functions

virtual void ParseFileName (TString files)
 ClassDef (NuFluxChain, 0)

Protected Attributes

TChain fchain
Int_t fcurrEntry
Int_t fNuType
Int_t fparPartType
Int_t fparType
BeamType::BeamType_t fBeamType
SKZPWeightCalculator::RunPeriod_t fRunPeriod

Detailed Description

Definition at line 38 of file NuFluxChain.h.


Constructor & Destructor Documentation

NuFluxChain::NuFluxChain (  ) 

Definition at line 34 of file NuFluxChain.cxx.

00035   : fchain("h10"),
00036     fcurrEntry(-1),
00037     fNuType(0),
00038     fparPartType(0),
00039     fparType(0),
00040     fBeamType(BeamType::kUnknown),
00041     fRunPeriod(SKZPWeightCalculator::kNone)
00042 {
00043 }

NuFluxChain::~NuFluxChain (  )  [virtual]

Definition at line 46 of file NuFluxChain.cxx.

00047 {
00048 }


Member Function Documentation

NuFluxChain::ClassDef ( NuFluxChain  ,
 
) [protected]

virtual BeamType::BeamType_t NuFluxChain::GetBeamType (  )  const [inline, virtual]

Definition at line 79 of file NuFluxChain.h.

References fBeamType.

Referenced by NuFluxHelper::MakeHelperHistos().

00079 {return fBeamType;};

Int_t NuFluxChain::GetEntries (  )  const [virtual]

Definition at line 61 of file NuFluxChain.cxx.

References fchain.

Referenced by NuFluxHelper::MakeHelperHistos().

00062 {
00063   return fchain.GetEntries();
00064 }

virtual SKZPWeightCalculator::RunPeriod_t NuFluxChain::GetRunPeriod (  )  const [inline, virtual]

Definition at line 80 of file NuFluxChain.h.

References fRunPeriod.

Referenced by NuFluxHelper::MakeHelperHistos().

00080 {return fRunPeriod;};

void NuFluxChain::LoadEvent ( const Int_t  event  )  const [virtual]

Definition at line 51 of file NuFluxChain.cxx.

References fchain, and fcurrEntry.

Referenced by NuGnumiChain::MuonParentEnergy(), NuFluggChain::MuonParentEnergy(), NuGnumiChain::MuonParentPX(), NuFluggChain::MuonParentPX(), NuGnumiChain::MuonParentPY(), NuFluggChain::MuonParentPY(), NuGnumiChain::MuonParentPZ(), NuFluggChain::MuonParentPZ(), NuGnumiChain::NeutrinoFDEnergy(), NuFluggChain::NeutrinoFDEnergy(), NuGnumiChain::NeutrinoNDEnergy(), NuFluggChain::NeutrinoNDEnergy(), NuGnumiChain::NuECofM(), NuFluggChain::NuECofM(), NuGnumiChain::NuFDWeight(), NuFluggChain::NuFDWeight(), NuGnumiChain::NuImportanceWeight(), NuFluggChain::NuImportanceWeight(), NuGnumiChain::NuNDWeight(), NuFluggChain::NuNDWeight(), NuGnumiChain::NuType(), NuFluggChain::NuType(), NuGnumiChain::ParentDecayVtxX(), NuFluggChain::ParentDecayVtxX(), NuGnumiChain::ParentDecayVtxY(), NuFluggChain::ParentDecayVtxY(), NuGnumiChain::ParentDecayVtxZ(), NuFluggChain::ParentDecayVtxZ(), NuGnumiChain::ParentParticleType(), NuFluggChain::ParentParticleType(), NuGnumiChain::ParentProdDXDZ(), NuFluggChain::ParentProdDXDZ(), NuGnumiChain::ParentProdDYDZ(), NuFluggChain::ParentProdDYDZ(), NuGnumiChain::ParentProdEnergy(), NuFluggChain::ParentProdEnergy(), NuGnumiChain::ParentProdPZ(), NuFluggChain::ParentProdPZ(), NuGnumiChain::ParentProdVtxX(), NuFluggChain::ParentProdVtxX(), NuGnumiChain::ParentProdVtxY(), NuFluggChain::ParentProdVtxY(), NuGnumiChain::ParentProdVtxZ(), NuFluggChain::ParentProdVtxZ(), NuGnumiChain::ParentPX(), NuFluggChain::ParentPX(), NuGnumiChain::ParentPY(), NuFluggChain::ParentPY(), NuGnumiChain::ParentPZ(), NuFluggChain::ParentPZ(), NuGnumiChain::ParentType(), NuFluggChain::ParentType(), NuGnumiChain::TargetParentPX(), NuFluggChain::TargetParentPX(), NuGnumiChain::TargetParentPY(), NuFluggChain::TargetParentPY(), NuGnumiChain::TargetParentPZ(), and NuFluggChain::TargetParentPZ().

00052 {
00053   if (event == fcurrEntry){return;}
00054   else{
00055     fchain.GetEvent(event);
00056     fcurrEntry = event;
00057   }
00058 }

virtual Double_t NuFluxChain::MuonParentEnergy ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::MuonParentPX ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::MuonParentPY ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::MuonParentPZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::NeutrinoFDEnergy ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::NeutrinoNDEnergy ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::NuECofM ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::NuFDWeight ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::NuImportanceWeight ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::NuNDWeight ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

Int_t NuFluxChain::NuParticleAsPDGCode ( const NuParticle::NuParticleType_t  nuParticle  )  const [virtual]

Definition at line 68 of file NuFluxChain.cxx.

References NuParticle::kNuE, NuParticle::kNuEBar, NuParticle::kNuMu, NuParticle::kNuMuBar, and NuParticle::kUndefined.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

00069 {
00070   if (NuParticle::kNuMu == nuParticle){return 14;}
00071   if (NuParticle::kNuMuBar == nuParticle){return -14;}
00072   if (NuParticle::kNuE == nuParticle){return 12;}
00073   if (NuParticle::kNuEBar == nuParticle){return -12;}
00074   return NuParticle::kUndefined;
00075 }

virtual NuParticle::NuParticleType_t NuFluxChain::NuType ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), NuFluxHelper::FillNonMMHelpers(), NuFluxHelper::MakeHelperHistos(), and NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentDecayVtxX ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentDecayVtxY ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentDecayVtxZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentMass ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

virtual NuParticle::NuParticleType_t NuFluxChain::ParentParticleType ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::ParentProdDXDZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentProdDYDZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentProdEnergy ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentProdPZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentProdVtxX ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::ParentProdVtxY ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::ParentProdVtxZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::ParentPX ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentPY ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual Double_t NuFluxChain::ParentPZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual NuParticle::NuParticleType_t NuFluxChain::ParentType ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

void NuFluxChain::ParseFileName ( TString  files  )  [protected, virtual]

Definition at line 78 of file NuFluxChain.cxx.

References fBeamType, Form(), fRunPeriod, gSystem(), BeamType::kL010z000i, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z185i_rev, BeamType::kL010z200i, BeamType::kL100z200i, BeamType::kL150z200i, BeamType::kL250z200i, BeamType::kM000z200i_nova, BeamType::kM000z200i_nova_rev, SKZPWeightCalculator::kNone, SKZPWeightCalculator::kRunI, SKZPWeightCalculator::kRunII, SKZPWeightCalculator::kRunIII, SKZPWeightCalculator::kRunIV, Msg::kWarning, and MSG.

00079 {
00080   TString fFirstFileName;
00081   //check if there is actually a wildcard
00082   if (!files.MaybeWildcard()) {
00083     fFirstFileName = files;
00084   }
00085   else {
00086     //this was ripped off from ROOT's TChain::AddFile
00087     //Ripped off again from NuBase
00088     
00089     vector<string> fileList;
00090     
00091     //wildcarding used in name
00092     TString basename = files;
00093     
00094     Int_t dotslashpos = basename.Index(".root/");
00095     TString behind_dot_root;
00096     if (dotslashpos>=0) {
00097       // Copy the tree name specification
00098       behind_dot_root = basename(dotslashpos+6,basename.Length()-dotslashpos+6);
00099       // and remove it from basename
00100       basename.Remove(dotslashpos+5);
00101     }
00102     
00103     Int_t slashpos = basename.Last('/');
00104     TString directory;
00105     if (slashpos>=0) {
00106       directory = basename(0,slashpos); // Copy the directory name
00107       basename.Remove(0,slashpos+1);      // and remove it from basename
00108     } else {
00109       directory = gSystem->WorkingDirectory();
00110     }
00111     
00112     const char *file;
00113     void *dir = gSystem->OpenDirectory(gSystem->ExpandPathName(directory.Data()));
00114     
00115     if (dir) {
00116       //create a TList to store the file names (not yet sorted)
00117       TList l;
00118       TRegexp re(basename,kTRUE);
00119       while ((file = gSystem->GetDirEntry(dir))) {
00120         if (!strcmp(file,".") || !strcmp(file,"..")) continue;
00121         TString s = file;
00122         if ( (basename!=file) && s.Index(re) == kNPOS) continue;
00123         l.Add(new TObjString(file));
00124       }
00125       gSystem->FreeDirectory(dir);
00126       //sort the files in alphanumeric order
00127       l.Sort();
00128       TIter next(&l);
00129       TObjString *obj;
00130       while ((obj = (TObjString*)next())) {
00131         file = obj->GetName();
00132         if (behind_dot_root.Length()!=0){
00133           string fileName=Form("%s/%s/%s",directory.Data(),
00134                                file,behind_dot_root.Data());
00135           fileList.push_back(fileName);
00136           //nf += AddFile(Form("%s/%s/%s",directory.Data(),file,behind_dot_root.Data()),kBigNumber);
00137         }
00138         else {
00139           string fileName=Form("%s/%s",directory.Data(),file);
00140           fileList.push_back(fileName);
00141           //nf += AddFile(Form("%s/%s",directory.Data(),file),kBigNumber);
00142         }
00143       }
00144       l.Delete();
00145     }
00146     
00147     //check if any files were found
00148     if (fileList.begin()!=fileList.end()){
00149       cout<<"Used wildcard expansion to find first file name="
00150       <<*fileList.begin()<<endl;
00151       fFirstFileName = *fileList.begin();
00152     }
00153     else {
00154       return;//null string
00155     }
00156   }
00157   
00158   if (fFirstFileName.IsNull()) return;
00159   
00160   //filename: fluka05_le010z185i_extra flugg_le010z185i_run1_extra
00161     
00162   if (fFirstFileName.Contains("le010z-185i"))      fBeamType = BeamType::kL010z185i_rev;
00163   else if (fFirstFileName.Contains("le010z000i"))  fBeamType = BeamType::kL010z000i;
00164   else if (fFirstFileName.Contains("le010z170i"))  fBeamType = BeamType::kL010z170i;
00165   else if (fFirstFileName.Contains("le010z185i"))  fBeamType = BeamType::kL010z185i;
00166   else if (fFirstFileName.Contains("le010z200i"))  fBeamType = BeamType::kL010z200i;
00167   else if (fFirstFileName.Contains("le100z200i"))  fBeamType = BeamType::kL100z200i;
00168   else if (fFirstFileName.Contains("le150z200i"))  fBeamType = BeamType::kL150z200i;
00169   else if (fFirstFileName.Contains("le250z200i"))  fBeamType = BeamType::kL250z200i;
00170   else if (fFirstFileName.Contains("mn000z200i"))  fBeamType = BeamType::kM000z200i_nova;
00171   else if (fFirstFileName.Contains("mn000z-200i")) fBeamType = BeamType::kM000z200i_nova_rev;
00172   else{
00173     MSG("NuFluxChain", Msg::kWarning)
00174       << "Unrecognised beam type while parsing filename. Asserting here." << endl;
00175     assert(false);
00176   }
00177 
00178   if (BeamType::kM000z200i_nova == fBeamType)
00179     fRunPeriod = SKZPWeightCalculator::kNone;
00180   else if (BeamType::kM000z200i_nova_rev == fBeamType)
00181     fRunPeriod = SKZPWeightCalculator::kNone;
00182   else if (fFirstFileName.Contains("run1")) fRunPeriod = SKZPWeightCalculator::kRunI;
00183   else if (fFirstFileName.Contains("run2")) fRunPeriod = SKZPWeightCalculator::kRunII;
00184   else if (fFirstFileName.Contains("run3")) fRunPeriod = SKZPWeightCalculator::kRunIII;
00185   else if (fFirstFileName.Contains("run4")) fRunPeriod = SKZPWeightCalculator::kRunIV;
00186   else{
00187     MSG("NuFluxChain", Msg::kWarning)
00188       << "Unrecognised run period while parsing filename. Asserting here." << endl;
00189     assert(false);
00190   }
00191   
00192   // Correct Run 4 beam type
00193   if (fBeamType == BeamType::kL010z185i && fRunPeriod == SKZPWeightCalculator::kRunIV) {
00194     fBeamType = BeamType::kL010z185i_rev;
00195   }
00196 }

virtual Double_t NuFluxChain::TargetParentPX ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::TargetParentPY ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().

virtual Double_t NuFluxChain::TargetParentPZ ( const Int_t  event  )  const [pure virtual]

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillMMHelpers(), and NuFluxHelper::FillNonMMHelpers().


Member Data Documentation

BeamType::BeamType_t NuFluxChain::fBeamType [protected]

Definition at line 93 of file NuFluxChain.h.

Referenced by GetBeamType(), and ParseFileName().

TChain NuFluxChain::fchain [mutable, protected]

Definition at line 85 of file NuFluxChain.h.

Referenced by GetEntries(), LoadEvent(), NuFluggChain::NuFluggChain(), and NuGnumiChain::NuGnumiChain().

Int_t NuFluxChain::fcurrEntry [mutable, protected]

Definition at line 89 of file NuFluxChain.h.

Referenced by LoadEvent().

Int_t NuFluxChain::fNuType [protected]

Definition at line 90 of file NuFluxChain.h.

Referenced by NuFluggChain::NuFluggChain(), NuGnumiChain::NuGnumiChain(), NuGnumiChain::NuType(), and NuFluggChain::NuType().

Int_t NuFluxChain::fparPartType [protected]

Definition at line 91 of file NuFluxChain.h.

Referenced by NuFluggChain::NuFluggChain(), NuGnumiChain::NuGnumiChain(), NuGnumiChain::ParentParticleType(), and NuFluggChain::ParentParticleType().

Int_t NuFluxChain::fparType [protected]

Definition at line 92 of file NuFluxChain.h.

Referenced by NuFluggChain::NuFluggChain(), NuGnumiChain::NuGnumiChain(), NuGnumiChain::ParentType(), and NuFluggChain::ParentType().

SKZPWeightCalculator::RunPeriod_t NuFluxChain::fRunPeriod [protected]

Definition at line 94 of file NuFluxChain.h.

Referenced by GetRunPeriod(), and ParseFileName().


The documentation for this class was generated from the following files:
Generated on Mon Sep 1 00:52:12 2014 for loon by  doxygen 1.4.7