Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 const Int_t GetEntries () const
virtual const Double_t MuonParentPX (const Int_t event) const =0
virtual const Double_t MuonParentPY (const Int_t event) const =0
virtual const Double_t MuonParentPZ (const Int_t event) const =0
virtual const Double_t MuonParentEnergy (const Int_t event) const =0
virtual const Double_t NeutrinoFDEnergy (const Int_t event) const =0
virtual const Double_t NeutrinoNDEnergy (const Int_t event) const =0
virtual const Double_t NuECofM (const Int_t event) const =0
virtual const NuParticle::NuParticleType_t NuType (const Int_t event) const =0
virtual const Double_t NuImportanceWeight (const Int_t event) const =0
virtual const Double_t NuFDWeight (const Int_t event) const =0
virtual const Int_t NuParticleAsPDGCode (const NuParticle::NuParticleType_t nuParticle) const
virtual const Double_t NuNDWeight (const Int_t event) const =0
virtual const Double_t ParentDecayVtxX (const Int_t event) const =0
virtual const Double_t ParentDecayVtxY (const Int_t event) const =0
virtual const Double_t ParentDecayVtxZ (const Int_t event) const =0
virtual const Double_t ParentMass (const Int_t event) const =0
virtual const NuParticle::NuParticleType_t ParentParticleType (const Int_t event) const =0
virtual const Double_t ParentPX (const Int_t event) const =0
virtual const Double_t ParentPY (const Int_t event) const =0
virtual const Double_t ParentPZ (const Int_t event) const =0
virtual const Double_t ParentProdDXDZ (const Int_t event) const =0
virtual const Double_t ParentProdDYDZ (const Int_t event) const =0
virtual const Double_t ParentProdEnergy (const Int_t event) const =0
virtual const Double_t ParentProdPZ (const Int_t event) const =0
virtual const Double_t ParentProdVtxX (const Int_t event) const =0
virtual const Double_t ParentProdVtxY (const Int_t event) const =0
virtual const Double_t ParentProdVtxZ (const Int_t event) const =0
virtual const NuParticle::NuParticleType_t ParentType (const Int_t event) const =0
virtual const Double_t TargetParentPX (const Int_t event) const =0
virtual const Double_t TargetParentPY (const Int_t event) const =0
virtual const Double_t TargetParentPZ (const Int_t event) const =0
virtual const BeamType::BeamType_t GetBeamType () const
virtual const 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

Constructor & Destructor Documentation

NuFluxChain::NuFluxChain  ) 
 

Definition at line 98 of file NuFluxChain.cxx.

00099   : fchain("h10"),
00100     fcurrEntry(-1),
00101     fNuType(0),
00102     fparPartType(0),
00103     fparType(0),
00104     fBeamType(BeamType::kUnknown),
00105     fRunPeriod(SKZPWeightCalculator::kNone)
00106 {
00107 }

NuFluxChain::~NuFluxChain  )  [virtual]
 

Definition at line 110 of file NuFluxChain.cxx.

00111 {
00112 }


Member Function Documentation

NuFluxChain::ClassDef NuFluxChain  ,
[protected]
 

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

Definition at line 119 of file NuFluxChain.h.

Referenced by NuFluxHelper::MakeHelperHistos().

00119 {return fBeamType;};

const Int_t NuFluxChain::GetEntries  )  const [virtual]
 

Definition at line 125 of file NuFluxChain.cxx.

References fchain.

Referenced by NuFluxHelper::MakeHelperHistos().

00126 {
00127   return fchain.GetEntries();
00128 }

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

Definition at line 120 of file NuFluxChain.h.

Referenced by NuFluxHelper::MakeHelperHistos().

00120 {return fRunPeriod;};

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

Definition at line 115 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().

00116 {
00117   if (event == fcurrEntry){return;}
00118   else{
00119     fchain.GetEvent(event);
00120     fcurrEntry = event;
00121   }
00122 }

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

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

Implemented in NuFluggChain, and NuGnumiChain.

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

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::FillNonMMHelpers().

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

Definition at line 132 of file NuFluxChain.cxx.

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

00133 {
00134   if (NuParticle::kNuMu == nuParticle){return 14;}
00135   if (NuParticle::kNuMuBar == nuParticle){return -14;}
00136   if (NuParticle::kNuE == nuParticle){return 12;}
00137   if (NuParticle::kNuEBar == nuParticle){return -12;}
00138   return NuParticle::kUndefined;
00139 }

virtual const 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 const Double_t NuFluxChain::ParentDecayVtxX const Int_t  event  )  const [pure virtual]
 

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

virtual const 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 const Double_t NuFluxChain::ParentProdDXDZ const Int_t  event  )  const [pure virtual]
 

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

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

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

Implemented in NuFluggChain, and NuGnumiChain.

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

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

Implemented in NuFluggChain, and NuGnumiChain.

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

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

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

Implemented in NuFluggChain, and NuGnumiChain.

Referenced by NuFluxHelper::NuWte().

virtual const 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 142 of file NuFluxChain.cxx.

References fBeamType, files, Form(), fRunPeriod, gSystem(), and s().

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

00143 {
00144   TString fFirstFileName;
00145   //check if there is actually a wildcard
00146   if (!files.MaybeWildcard()) {
00147     fFirstFileName = files;
00148   }
00149   else {
00150     //this was ripped off from ROOT's TChain::AddFile
00151     //Ripped off again from NuBase
00152     
00153     vector<string> fileList;
00154     
00155     //wildcarding used in name
00156     TString basename = files;
00157     
00158     Int_t dotslashpos = basename.Index(".root/");
00159     TString behind_dot_root;
00160     if (dotslashpos>=0) {
00161       // Copy the tree name specification
00162       behind_dot_root = basename(dotslashpos+6,basename.Length()-dotslashpos+6);
00163       // and remove it from basename
00164       basename.Remove(dotslashpos+5);
00165     }
00166     
00167     Int_t slashpos = basename.Last('/');
00168     TString directory;
00169     if (slashpos>=0) {
00170       directory = basename(0,slashpos); // Copy the directory name
00171       basename.Remove(0,slashpos+1);      // and remove it from basename
00172     } else {
00173       directory = gSystem->WorkingDirectory();
00174     }
00175     
00176     const char *file;
00177     void *dir = gSystem->OpenDirectory(gSystem->ExpandPathName(directory.Data()));
00178     
00179     if (dir) {
00180       //create a TList to store the file names (not yet sorted)
00181       TList l;
00182       TRegexp re(basename,kTRUE);
00183       while ((file = gSystem->GetDirEntry(dir))) {
00184         if (!strcmp(file,".") || !strcmp(file,"..")) continue;
00185         TString s = file;
00186         if ( (basename!=file) && s.Index(re) == kNPOS) continue;
00187         l.Add(new TObjString(file));
00188       }
00189       gSystem->FreeDirectory(dir);
00190       //sort the files in alphanumeric order
00191       l.Sort();
00192       TIter next(&l);
00193       TObjString *obj;
00194       while ((obj = (TObjString*)next())) {
00195         file = obj->GetName();
00196         if (behind_dot_root.Length()!=0){
00197           string fileName=Form("%s/%s/%s",directory.Data(),
00198                                file,behind_dot_root.Data());
00199           fileList.push_back(fileName);
00200           //nf += AddFile(Form("%s/%s/%s",directory.Data(),file,behind_dot_root.Data()),kBigNumber);
00201         }
00202         else {
00203           string fileName=Form("%s/%s",directory.Data(),file);
00204           fileList.push_back(fileName);
00205           //nf += AddFile(Form("%s/%s",directory.Data(),file),kBigNumber);
00206         }
00207       }
00208       l.Delete();
00209     }
00210     
00211     //check if any files were found
00212     if (fileList.begin()!=fileList.end()){
00213       cout<<"Used wildcard expansion to find first file name="
00214       <<*fileList.begin()<<endl;
00215       fFirstFileName = *fileList.begin();
00216     }
00217     else {
00218       return;//null string
00219     }
00220   }
00221   
00222   if (fFirstFileName.IsNull()) return;
00223   
00224   //filename: fluka05_le010z185i_extra flugg_le010z185i_run1_extra
00225     
00226   if (fFirstFileName.Contains("le010z-185i"))      fBeamType = BeamType::kL010z185i_rev;
00227   else if (fFirstFileName.Contains("le010z000i"))  fBeamType = BeamType::kL010z000i;
00228   else if (fFirstFileName.Contains("le010z170i"))  fBeamType = BeamType::kL010z170i;
00229   else if (fFirstFileName.Contains("le010z185i"))  fBeamType = BeamType::kL010z185i;
00230   else if (fFirstFileName.Contains("le010z200i"))  fBeamType = BeamType::kL010z200i;
00231   else if (fFirstFileName.Contains("le100z200i"))  fBeamType = BeamType::kL100z200i;
00232   else if (fFirstFileName.Contains("le150z200i"))  fBeamType = BeamType::kL150z200i;
00233   else if (fFirstFileName.Contains("le250z200i"))  fBeamType = BeamType::kL250z200i;
00234 
00235   if (fFirstFileName.Contains("run1")) fRunPeriod = SKZPWeightCalculator::kRunI;
00236   if (fFirstFileName.Contains("run2")) fRunPeriod = SKZPWeightCalculator::kRunII;
00237   if (fFirstFileName.Contains("run3")) fRunPeriod = SKZPWeightCalculator::kRunIII;
00238   if (fFirstFileName.Contains("run4")) fRunPeriod = SKZPWeightCalculator::kRunIV;
00239   
00240   // Correct Run 4 beam type
00241   if (fBeamType == BeamType::kL010z185i && fRunPeriod == SKZPWeightCalculator::kRunIV) {
00242     fBeamType = BeamType::kL010z185i_rev;
00243   }
00244 }

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

Implemented in NuFluggChain, and NuGnumiChain.

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

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

Implemented in NuFluggChain, and NuGnumiChain.

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

virtual const 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 133 of file NuFluxChain.h.

Referenced by ParseFileName().

TChain NuFluxChain::fchain [mutable, protected]
 

Definition at line 125 of file NuFluxChain.h.

Referenced by GetEntries(), and LoadEvent().

Int_t NuFluxChain::fcurrEntry [mutable, protected]
 

Definition at line 129 of file NuFluxChain.h.

Referenced by LoadEvent().

Int_t NuFluxChain::fNuType [protected]
 

Definition at line 130 of file NuFluxChain.h.

Int_t NuFluxChain::fparPartType [protected]
 

Definition at line 131 of file NuFluxChain.h.

Int_t NuFluxChain::fparType [protected]
 

Definition at line 132 of file NuFluxChain.h.

SKZPWeightCalculator::RunPeriod_t NuFluxChain::fRunPeriod [protected]
 

Definition at line 134 of file NuFluxChain.h.

Referenced by ParseFileName().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:51 2010 for loon by  doxygen 1.3.9.1