NuFluxHelper Class Reference

#include <NuFluxHelper.h>

List of all members.

Public Member Functions

 NuFluxHelper (SKZPWeightCalculator::ERunPeriod=SKZPWeightCalculator::kNone, Bool_t _doRW=true)
 NuFluxHelper (const TString &xmlFile)
virtual ~NuFluxHelper ()
virtual void BeamType (const BeamType::BeamType_t beamType)
virtual BeamType::BeamType_t BeamType () const
virtual void RunPeriod (const SKZPWeightCalculator::RunPeriod_t runPeriod)
virtual
SKZPWeightCalculator::RunPeriod_t 
RunPeriod () const
virtual const TVector3 ConvertNDToBeamCoOrdinates (const TVector3 &ndCoordinates) const
virtual void CrossSectionFile (const char *xSecFile)
virtual void DoSKZP (const Bool_t doSKZP)
virtual Bool_t DoSKZP () const
virtual void OutputFilename (const char *outFile)
virtual void MakeHelperHistos (const char *fileList)
virtual void ConcatenateHelpers (const char *fileList)
virtual void NDTrueEBins (const std::vector< Double_t > ndtruebins)
virtual void FDTrueEBins (const std::vector< Double_t > fdtruebins)
virtual Bool_t IsNDFiducial (const TVector3 &ndPoint) const
virtual void ReweightVersion (const SKZPWeightCalculator::SKZPConfig_t reweightVersion)
virtual
SKZPWeightCalculator::SKZPConfig_t 
ReweightVersion () const
virtual void SystematicBeamShift (const Bool_t doShift, const Double_t numSigma)
virtual void SystematicScrapingShift (const Bool_t doShift, const Double_t scaleFactor)
virtual void ParticleToExtrapolate (const NuParticle::NuParticleType_t particle)
virtual void ParticlesToExtrapolate (const std::vector< NuParticle::NuParticleType_t > particleList)
virtual void ParticlesToExtrapolate (int flavour)
virtual void SetBatch (Bool_t set)

Private Member Functions

virtual Bool_t CreateHistos ()
virtual Double_t CrossSection (const NuParticle::NuParticleType_t particle, const Double_t energy) const
virtual Double_t TauCrossSection (const NuParticle::NuParticleType_t particle, const Double_t energy) const
virtual void FillMMHelpers (const NuFluxChain *fluxChain, const Int_t flukaEntry) const
virtual void FillNonMMHelpers (const NuFluxChain *fluxChain, const Int_t flukaEntry) const
virtual Bool_t IsParticleToExtrapolate (const NuParticle::NuParticleType_t particle) const
virtual void NormaliseHistos () const
virtual const ArrAy NuWte (const Double_t XDET, const Double_t YDET, const Double_t ZDET, const NuFluxChain *fluxChain, const Int_t flukaEntry) const
virtual void WriteHistos () const

Private Attributes

Bool_t fdoSKZP
Bool_t fdoBeamShift
Bool_t fdoScrapingShift
Bool_t batchRunning
Int_t fNNDTrueEBins
Int_t fNFDTrueEBins
Double_t * fNDTrueEBinEdges
Double_t * fFDTrueEBinEdges
NuBinningScheme::NuBinningScheme_t fbinningScheme
Double_t fbeamShiftAsSigma
Double_t fscrapingScaleFactor
std::vector
< NuParticle::NuParticleType_t
fparticlesToExtrapolate
std::string foutFile
std::string fxSecFile
SKZPWeightCalculator::RunPeriod_t frunPeriod
SKZPWeightCalculator::SKZPConfig_t freweightVersion
BeamType::BeamType_t fbeamType
bool overrideReweightVersion
SKZPWeightCalculator::SKZPConfig_t configReweightVersion
bool overrideRunPeriod
SKZPWeightCalculator::RunPeriod_t configRunPeriod
NuZBeamReweightfzarko
TGraph * fxSecGraphNuMuCC
TGraph * fxSecGraphNuMuBarCC
TGraph * fxSecGraphNuTauCC
TGraph * fxSecGraphNuTauBarCC
TGraph * fxSecGraphNuECC
TGraph * fxSecGraphNuEBarCC
TH2D * fFDVsNDMatrix
TH2D * fFDVsNDMatrixRW
TH2D * fFDVsNDMatrixXSec
TH2D * fFDVsNDMatrixXSecRW
TH2D * fFDVsNDMatrixTauXSecRW
TH1D * fTrueEnergyNuFlux_ND
TH1D * fTrueEnergyNuFluxRW_ND
TH1D * fTrueEnergyNuFlux_FD
TH1D * fTrueEnergyNuFluxRW_FD
TH1D * fTrueEnergyCCFlux_ND
TH1D * fTrueEnergyCCFluxRW_ND
TH1D * fTrueEnergyCCFlux_FD
TH1D * fTrueEnergyCCFluxRW_FD
TRandom3 * frandom3

Detailed Description

Definition at line 37 of file NuFluxHelper.h.


Constructor & Destructor Documentation

NuFluxHelper::NuFluxHelper ( SKZPWeightCalculator::ERunPeriod  rp = SKZPWeightCalculator::kNone,
Bool_t  _doRW = true 
)

Definition at line 49 of file NuFluxHelper.cxx.

References BeamType::kUnknown, SKZPWeightCalculator::kUnknown, NuBinningScheme::kUnknown, and NuUtilities::TrueBins().

00050 {
00051   batchRunning = false;
00052   fzarko = 0;
00053   DoSKZP(_doRW);
00054   frunPeriod = rp;
00055   fbeamType = BeamType::kUnknown; // Now pulled from file by default
00056   freweightVersion = SKZPWeightCalculator::kUnknown; // Set when determining file version
00057 
00058   fdoBeamShift = false;
00059   fdoScrapingShift = false;
00060   fbeamShiftAsSigma = 0.0;
00061   fscrapingScaleFactor = 0.0;
00062 
00063   fbinningScheme = NuBinningScheme::kUnknown;
00064   const NuUtilities utils;
00065   const vector<Double_t> trueBins = utils.TrueBins(fbinningScheme);
00066   fNNDTrueEBins = trueBins.size()-1;
00067   fNDTrueEBinEdges=new Double_t[fNNDTrueEBins+1];
00068   {
00069     Int_t i=0;
00070     for (vector<Double_t>::const_iterator itBin = trueBins.begin();
00071          itBin != trueBins.end();
00072          ++itBin, ++i){
00073       fNDTrueEBinEdges[i] = *itBin;
00074     }
00075   }
00076   fNFDTrueEBins = fNNDTrueEBins;
00077   fFDTrueEBinEdges = fNDTrueEBinEdges;
00078 
00079   foutFile = "";
00080   fxSecFile = "";
00081 
00082   fxSecGraphNuMuCC = 0;
00083   fxSecGraphNuMuBarCC = 0;
00084   fxSecGraphNuTauCC = 0;
00085   fxSecGraphNuTauBarCC = 0;
00086   fxSecGraphNuECC = 0;
00087   fxSecGraphNuEBarCC = 0;
00088 
00089   fFDVsNDMatrix = 0;
00090   fFDVsNDMatrixRW = 0;
00091   fFDVsNDMatrixXSec = 0;
00092   fFDVsNDMatrixXSecRW = 0;
00093   fFDVsNDMatrixTauXSecRW = 0;
00094 
00095   fTrueEnergyNuFlux_ND = 0;
00096   fTrueEnergyNuFluxRW_ND = 0;
00097   fTrueEnergyNuFlux_FD = 0;
00098   fTrueEnergyNuFluxRW_FD = 0;
00099   fTrueEnergyCCFlux_ND = 0;
00100   fTrueEnergyCCFluxRW_ND = 0;
00101   fTrueEnergyCCFlux_FD = 0;
00102   fTrueEnergyCCFluxRW_FD = 0;
00103 
00104   frandom3 = new TRandom3();
00105 }

NuFluxHelper::NuFluxHelper ( const TString &  xmlFile  ) 

Definition at line 108 of file NuFluxHelper.cxx.

References batchRunning, NuXMLConfig::BinningScheme(), configReweightVersion, configRunPeriod, DoSKZP(), fbeamType, fbinningScheme, fFDTrueEBinEdges, fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, fNDTrueEBinEdges, fNFDTrueEBins, fNNDTrueEBins, foutFile, frandom3, freweightVersion, frunPeriod, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, fxSecFile, fxSecGraphNuEBarCC, fxSecGraphNuECC, fxSecGraphNuMuBarCC, fxSecGraphNuMuCC, fxSecGraphNuTauBarCC, fxSecGraphNuTauCC, fzarko, NuXMLConfig::GetUnknownKey(), SKZPWeightCalculator::kMINOSplus_2014_v2, SKZPWeightCalculator::kMINOSplus_2018, SKZPWeightCalculator::kNone, SKZPWeightCalculator::kRunXI, SKZPWeightCalculator::kRunXIII, BeamType::kUnknown, SKZPWeightCalculator::kUnknown, NuXMLConfig::Name(), overrideReweightVersion, overrideRunPeriod, NuXMLConfig::Shift(), SystematicBeamShift(), SystematicScrapingShift(), NuUtilities::TrueBins(), and NuXMLConfig::UseBeamWeight().

00109 {
00110   cout << "Beginning to construct NuFluxHelper(" << xmlFile << ")" << endl;
00111   fzarko = 0;
00112   batchRunning = false;
00113 
00114   NuXMLConfig xmlConfig(xmlFile);
00115   if (xmlConfig.UseBeamWeight()){
00116     frunPeriod = SKZPWeightCalculator::kNone;
00117     this->DoSKZP(true);
00118   }
00119   else{
00120     frunPeriod = SKZPWeightCalculator::kNone;
00121     this->DoSKZP(false);
00122     cout << "NOT doing SKZP." << endl;
00123   }
00124 
00125   fbeamType = BeamType::kUnknown; // Now pulled from file by default
00126   freweightVersion = SKZPWeightCalculator::kUnknown; // Set when determining file version
00127 
00128   TString tmpValue;
00129   tmpValue = xmlConfig.GetUnknownKey("ReweightVersion","not found");
00130 
00131   overrideReweightVersion = !(tmpValue.EqualTo("not found"));
00132   
00133   if ( overrideReweightVersion && tmpValue.EqualTo("MINOSplus_2018") ){
00134 
00135     std::cout<< "Setting configReweightVersion to SKZPWeightCalculator::kMINOSplus_2018" << std::endl;
00136     configReweightVersion = SKZPWeightCalculator::kMINOSplus_2018;
00137 
00138   }
00139 
00140   else if ( overrideReweightVersion && !tmpValue.EqualTo("MINOSplus_2018") ){
00141 
00142     std::cout << "WARNING THIS CONFIG REWEIGHTVERSION IS NOT VALID" << std::endl;
00143 
00144     std::cout << "Forcing reweight version SKZPWeightCalculator::kMINOSplus_2014_v2" << std::endl;
00145 
00146     configReweightVersion = SKZPWeightCalculator::kMINOSplus_2014_v2;
00147 
00148   }
00149 
00150 
00151   tmpValue = xmlConfig.GetUnknownKey("RunPeriod","not found");
00152 
00153   overrideRunPeriod = !(tmpValue.EqualTo("not found"));
00154   
00155   if ( overrideRunPeriod && tmpValue.EqualTo("13") ){
00156 
00157     std::cout<< "Setting configRunPeriod to SKZPWeightCalculator::kRunXIII" << std::endl;
00158     configRunPeriod = SKZPWeightCalculator::kRunXIII;
00159 
00160   }
00161 
00162   else if ( overrideReweightVersion && !tmpValue.EqualTo("13") ){
00163 
00164     std::cout << "WARNING THIS CONFIG RUNPERIOD IS NOT VALID" << std::endl;
00165 
00166     std::cout << "Forcing run period SKZPWeightCalculator::kRunXI" << std::endl;
00167 
00168     configRunPeriod = SKZPWeightCalculator::kRunXI;
00169 
00170   }
00171 
00172 
00173   if (xmlConfig.Name().Contains("Beam",TString::kIgnoreCase) ||
00174       xmlConfig.Name().Contains("SKZP",TString::kIgnoreCase) ||
00175       xmlConfig.Name().Contains("Flux",TString::kIgnoreCase)){
00176     this->SystematicBeamShift(true,xmlConfig.Shift());
00177   }
00178   else{
00179     this->SystematicBeamShift(false, 0.0);
00180   }
00181   if (xmlConfig.Name().Contains("Scraping",TString::kIgnoreCase) ||
00182       xmlConfig.Name().Contains("DecayPipe",TString::kIgnoreCase)){
00183     this->SystematicScrapingShift(true,xmlConfig.Shift());
00184   }
00185   else{
00186     this->SystematicScrapingShift(false, 0.0);
00187   }
00188   cout << "Read other things from the xml file" << endl;
00189 
00190   fbinningScheme = static_cast<NuBinningScheme::NuBinningScheme_t>(xmlConfig.BinningScheme());
00191   const NuUtilities utils;
00192 
00193   const vector<Double_t> trueBins = utils.TrueBins(fbinningScheme);
00194   fNNDTrueEBins = trueBins.size()-1;
00195   fNDTrueEBinEdges=new Double_t[fNNDTrueEBins+1];
00196   {
00197     Int_t i=0;
00198     for (vector<Double_t>::const_iterator itBin = trueBins.begin();
00199          itBin != trueBins.end();
00200          ++itBin, ++i){
00201       fNDTrueEBinEdges[i] = *itBin;
00202     }
00203   }
00204   fNFDTrueEBins = fNNDTrueEBins;
00205   fFDTrueEBinEdges = fNDTrueEBinEdges;
00206 
00207   cout << "Constructed bins" << endl;
00208 
00209   foutFile = "";
00210   fxSecFile = "";
00211 
00212   fxSecGraphNuMuCC = 0;
00213   fxSecGraphNuMuBarCC = 0;
00214   fxSecGraphNuTauCC = 0;
00215   fxSecGraphNuTauBarCC = 0;
00216   fxSecGraphNuECC = 0;
00217   fxSecGraphNuEBarCC = 0;
00218 
00219   fFDVsNDMatrix = 0;
00220   fFDVsNDMatrixRW = 0;
00221   fFDVsNDMatrixXSec = 0;
00222   fFDVsNDMatrixXSecRW = 0;
00223   fFDVsNDMatrixTauXSecRW = 0;
00224 
00225   fTrueEnergyNuFlux_ND = 0;
00226   fTrueEnergyNuFluxRW_ND = 0;
00227   fTrueEnergyNuFlux_FD = 0;
00228   fTrueEnergyNuFluxRW_FD = 0;
00229   fTrueEnergyCCFlux_ND = 0;
00230   fTrueEnergyCCFluxRW_ND = 0;
00231   fTrueEnergyCCFlux_FD = 0;
00232   fTrueEnergyCCFluxRW_FD = 0;
00233 
00234   frandom3 = new TRandom3();
00235 
00236   cout << "Initialized objects" << endl;
00237 }

NuFluxHelper::~NuFluxHelper (  )  [virtual]

Definition at line 252 of file NuFluxHelper.cxx.

References fFDTrueEBinEdges, fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, fNDTrueEBinEdges, frandom3, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, fxSecGraphNuEBarCC, fxSecGraphNuECC, fxSecGraphNuMuBarCC, fxSecGraphNuMuCC, fxSecGraphNuTauBarCC, fxSecGraphNuTauCC, and fzarko.

00253 {
00254   if (fFDVsNDMatrix)
00255     {delete fFDVsNDMatrix; fFDVsNDMatrix = 0;}
00256   if (fFDVsNDMatrixRW)
00257     {delete fFDVsNDMatrixRW; fFDVsNDMatrixRW = 0;}
00258   if (fFDVsNDMatrixXSec)
00259     {delete fFDVsNDMatrixXSec; fFDVsNDMatrixXSec = 0;}
00260   if (fFDVsNDMatrixXSecRW)
00261     {delete fFDVsNDMatrixXSecRW; fFDVsNDMatrixXSecRW = 0;}
00262   if (fFDVsNDMatrixTauXSecRW)
00263     {delete fFDVsNDMatrixTauXSecRW; fFDVsNDMatrixTauXSecRW = 0;}
00264 
00265   if (fTrueEnergyNuFlux_ND)
00266     {delete fTrueEnergyNuFlux_ND; fTrueEnergyNuFlux_ND = 0;}
00267   if (fTrueEnergyNuFluxRW_ND)
00268     {delete fTrueEnergyNuFluxRW_ND; fTrueEnergyNuFluxRW_ND = 0;}
00269   if (fTrueEnergyNuFlux_FD)
00270     {delete fTrueEnergyNuFlux_FD; fTrueEnergyNuFlux_FD = 0;}
00271   if (fTrueEnergyNuFluxRW_FD)
00272     {delete fTrueEnergyNuFluxRW_FD; fTrueEnergyNuFluxRW_FD = 0;}
00273   if (fTrueEnergyCCFlux_ND)
00274     {delete fTrueEnergyCCFlux_ND; fTrueEnergyCCFlux_ND = 0;}
00275   if (fTrueEnergyCCFluxRW_ND)
00276     {delete fTrueEnergyCCFluxRW_ND; fTrueEnergyCCFluxRW_ND = 0;}
00277   if (fTrueEnergyCCFlux_FD)
00278     {delete fTrueEnergyCCFlux_FD; fTrueEnergyCCFlux_FD = 0;}
00279   if (fTrueEnergyCCFluxRW_FD)
00280     {delete fTrueEnergyCCFluxRW_FD; fTrueEnergyCCFluxRW_FD = 0;}
00281 
00282   if (fFDTrueEBinEdges) {delete[] fFDTrueEBinEdges; fFDTrueEBinEdges=0;}
00283   if (fNDTrueEBinEdges) {delete[] fNDTrueEBinEdges; fNDTrueEBinEdges=0;}
00284 
00285   if (fzarko) {delete fzarko; fzarko = 0;}
00286 
00287   if (fxSecGraphNuMuCC) {delete fxSecGraphNuMuCC; fxSecGraphNuMuCC = 0;}
00288   if (fxSecGraphNuMuBarCC) {delete fxSecGraphNuMuBarCC; fxSecGraphNuMuBarCC = 0;}
00289   if (fxSecGraphNuTauCC) {delete fxSecGraphNuTauCC; fxSecGraphNuTauCC = 0;}
00290   if (fxSecGraphNuTauBarCC) {delete fxSecGraphNuTauBarCC; fxSecGraphNuTauBarCC = 0;}
00291   if (fxSecGraphNuECC) {delete fxSecGraphNuECC; fxSecGraphNuECC = 0;}
00292   if (fxSecGraphNuEBarCC) {delete fxSecGraphNuEBarCC; fxSecGraphNuEBarCC = 0;}
00293 
00294   if (frandom3) {delete frandom3; frandom3 = 0;}
00295 }


Member Function Documentation

virtual BeamType::BeamType_t NuFluxHelper::BeamType (  )  const [inline, virtual]

Definition at line 45 of file NuFluxHelper.h.

References fbeamType.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and MakeHelperHistos().

00046     {return fbeamType;};

virtual void NuFluxHelper::BeamType ( const BeamType::BeamType_t  beamType  )  [inline, virtual]

Definition at line 43 of file NuFluxHelper.h.

References fbeamType.

00044     {fbeamType = beamType;};

void NuFluxHelper::ConcatenateHelpers ( const char *  fileList  )  [virtual]

Definition at line 808 of file NuFluxHelper.cxx.

References fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, NuUtilities::GetListOfFilesInDir(), Msg::kError, Msg::kInfo, MSG, NormaliseHistos(), and WriteHistos().

00809 {
00810   vector<TString> vFiles = NuUtilities::GetListOfFilesInDir(fileList);
00811   if (vFiles.size() <= 0) {
00812     MSG("NuFluxHelper",Msg::kInfo) << "Cannot find any files in " << fileList << endl;
00813   }
00814 
00815   MSG("NuFluxHelper",Msg::kInfo) << "Concatenating " << vFiles.size()
00816   << " flux helper files." << endl;
00817 
00818   TFile *f;
00819 
00820   MSG("NuFluxHelper",Msg::kInfo) << "Reading from " << vFiles[0] << endl;
00821   f = new TFile(vFiles[0]);
00822   if (!f->IsOpen()) {
00823     MSG("NuFluxHelper",Msg::kError) << "File not opened.  Bailing" << endl;
00824     assert(false);
00825   }
00826   f->ls();
00827 
00828   fFDVsNDMatrix = (TH2D*)f->Get("FDVsNDMatrix");
00829   fFDVsNDMatrixRW = (TH2D*)f->Get("FDVsNDMatrixRW");
00830   fFDVsNDMatrixXSec = (TH2D*)f->Get("FDVsNDMatrixXSec");
00831   fFDVsNDMatrixXSecRW = (TH2D*)f->Get("FDVsNDMatrixXSecRW");
00832   fFDVsNDMatrixTauXSecRW = (TH2D*)f->Get("FDVsNDMatrixTauXSecRW");
00833 
00834   fTrueEnergyNuFlux_ND = (TH1D*)f->Get("TrueEnergyNuFlux_ND");
00835   fTrueEnergyNuFluxRW_ND = (TH1D*)f->Get("TrueEnergyNuFluxRW_ND");
00836   fTrueEnergyNuFlux_FD = (TH1D*)f->Get("TrueEnergyNuFlux_FD");
00837   fTrueEnergyNuFluxRW_FD = (TH1D*)f->Get("TrueEnergyNuFluxRW_FD");
00838   fTrueEnergyCCFlux_ND = (TH1D*)f->Get("TrueEnergyCCFlux_ND");
00839   fTrueEnergyCCFluxRW_ND = (TH1D*)f->Get("TrueEnergyCCFluxRW_ND");
00840   fTrueEnergyCCFlux_FD = (TH1D*)f->Get("TrueEnergyCCFlux_FD");
00841   fTrueEnergyCCFluxRW_FD = (TH1D*)f->Get("TrueEnergyCCFluxRW_FD");
00842 
00843   fFDVsNDMatrix->SetDirectory(0);
00844   fFDVsNDMatrixRW->SetDirectory(0);
00845   fFDVsNDMatrixXSec->SetDirectory(0);
00846   fFDVsNDMatrixXSecRW->SetDirectory(0);
00847   fFDVsNDMatrixTauXSecRW->SetDirectory(0);
00848 
00849   fTrueEnergyNuFlux_ND->SetDirectory(0);
00850   fTrueEnergyNuFluxRW_ND->SetDirectory(0);
00851   fTrueEnergyNuFlux_FD->SetDirectory(0);
00852   fTrueEnergyNuFluxRW_FD->SetDirectory(0);
00853   fTrueEnergyCCFlux_ND->SetDirectory(0);
00854   fTrueEnergyCCFluxRW_ND->SetDirectory(0);
00855   fTrueEnergyCCFlux_FD->SetDirectory(0);
00856   fTrueEnergyCCFluxRW_FD->SetDirectory(0);
00857   f->Close();
00858 
00859 
00860   for (unsigned int i = 1; i < vFiles.size(); i++) {
00861     MSG("NuFluxHelper",Msg::kInfo) << "Reading from " << vFiles[i] << endl;
00862     f = new TFile(vFiles[i]);
00863     if (!f->IsOpen()) {
00864       MSG("NuFluxHelper",Msg::kError) << "File not opened.  Bailing" << endl;
00865       assert(false);
00866     }
00867 
00868     TH2D* tmp_fFDVsNDMatrix = (TH2D*)f->Get("FDVsNDMatrix");
00869     TH2D* tmp_fFDVsNDMatrixRW = (TH2D*)f->Get("FDVsNDMatrixRW");
00870     TH2D* tmp_fFDVsNDMatrixXSec = (TH2D*)f->Get("FDVsNDMatrixXSec");
00871     TH2D* tmp_fFDVsNDMatrixXSecRW = (TH2D*)f->Get("FDVsNDMatrixXSecRW");
00872     TH2D* tmp_fFDVsNDMatrixTauXSecRW = (TH2D*)f->Get("FDVsNDMatrixTauXSecRW");
00873 
00874     TH1D* tmp_fTrueEnergyNuFlux_ND = (TH1D*)f->Get("TrueEnergyNuFlux_ND");
00875     TH1D* tmp_fTrueEnergyNuFluxRW_ND = (TH1D*)f->Get("TrueEnergyNuFluxRW_ND");
00876     TH1D* tmp_fTrueEnergyNuFlux_FD = (TH1D*)f->Get("TrueEnergyNuFlux_FD");
00877     TH1D* tmp_fTrueEnergyNuFluxRW_FD = (TH1D*)f->Get("TrueEnergyNuFluxRW_FD");
00878     TH1D* tmp_fTrueEnergyCCFlux_ND = (TH1D*)f->Get("TrueEnergyCCFlux_ND");
00879     TH1D* tmp_fTrueEnergyCCFluxRW_ND = (TH1D*)f->Get("TrueEnergyCCFluxRW_ND");
00880     TH1D* tmp_fTrueEnergyCCFlux_FD = (TH1D*)f->Get("TrueEnergyCCFlux_FD");
00881     TH1D* tmp_fTrueEnergyCCFluxRW_FD = (TH1D*)f->Get("TrueEnergyCCFluxRW_FD");
00882 
00883     fFDVsNDMatrix->Add(tmp_fFDVsNDMatrix);
00884     fFDVsNDMatrixRW->Add(tmp_fFDVsNDMatrixRW);
00885     fFDVsNDMatrixXSec->Add(tmp_fFDVsNDMatrixXSec);
00886     fFDVsNDMatrixXSecRW->Add(tmp_fFDVsNDMatrixXSecRW);
00887     fFDVsNDMatrixTauXSecRW->Add(tmp_fFDVsNDMatrixTauXSecRW);
00888 
00889     fTrueEnergyNuFlux_ND->Add(tmp_fTrueEnergyNuFlux_ND);
00890     fTrueEnergyNuFluxRW_ND->Add(tmp_fTrueEnergyNuFluxRW_ND);
00891     fTrueEnergyNuFlux_FD->Add(tmp_fTrueEnergyNuFlux_FD);
00892     fTrueEnergyNuFluxRW_FD->Add(tmp_fTrueEnergyNuFluxRW_FD);
00893     fTrueEnergyCCFlux_ND->Add(tmp_fTrueEnergyCCFlux_ND);
00894     fTrueEnergyCCFluxRW_ND->Add(tmp_fTrueEnergyCCFluxRW_ND);
00895     fTrueEnergyCCFlux_FD->Add(tmp_fTrueEnergyCCFlux_FD);
00896     fTrueEnergyCCFluxRW_FD->Add(tmp_fTrueEnergyCCFluxRW_FD);
00897 
00898     f->Close();
00899   }
00900 
00901   this->NormaliseHistos();
00902   this->WriteHistos();
00903 
00904   return;
00905 }

const TVector3 NuFluxHelper::ConvertNDToBeamCoOrdinates ( const TVector3 &  ndCoordinates  )  const [virtual]

Definition at line 1128 of file NuFluxHelper.cxx.

References Munits::cm.

Referenced by FillMMHelpers().

01129 {
01130   //Give it a point in ND co-ordinates.
01131   //Returns the same point in beam co-ordinates.
01132 
01133   // beam center (0,0) in detector coord system:
01134   // (148.844,13.97)
01135   // z offset is 104000
01136   // beamdydz = -0.0581
01137   Double_t beamCenterXDet = 148.28*Munits::cm;
01138   Double_t beamCenterYDet = 23.84*Munits::cm;
01139   Double_t beamAngle = 3.323155*TMath::DegToRad();
01140   Double_t detZ0InBeamCoOrds = 103648.837*Munits::cm;
01141 
01142   Double_t beamX = ndCoordinates.X() - beamCenterXDet;
01143   Double_t beamY =
01144     (ndCoordinates.Y()-beamCenterYDet)
01145     *TMath::Cos(beamAngle) +
01146     ndCoordinates.Z()*TMath::Sin(beamAngle);
01147   Double_t beamZ =
01148     detZ0InBeamCoOrds +
01149     (ndCoordinates.Z()*TMath::Cos(beamAngle) -
01150      ndCoordinates.Y()*TMath::Sin(beamAngle));
01151   //N.B. beamz should have a term beamCenterYDet*TMath::Sin(3.23155)
01152   //assuming the 104000 cm is measured along the beam axis.
01153   //But this term's small.
01154 
01155   TVector3 beamCoordinates(beamX,
01156                            beamY,
01157                            beamZ);
01158   return beamCoordinates;
01159 }

Bool_t NuFluxHelper::CreateHistos (  )  [private, virtual]

Definition at line 328 of file NuFluxHelper.cxx.

References fFDTrueEBinEdges, fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, fNDTrueEBinEdges, fNFDTrueEBins, fNNDTrueEBins, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, Msg::kError, and MSG.

Referenced by MakeHelperHistos().

00329 {
00330   if (fFDVsNDMatrix)
00331     {delete fFDVsNDMatrix; fFDVsNDMatrix = 0;}
00332   if (fFDVsNDMatrixRW)
00333     {delete fFDVsNDMatrixRW; fFDVsNDMatrixRW = 0;}
00334   if (fFDVsNDMatrixXSec)
00335     {delete fFDVsNDMatrixXSec; fFDVsNDMatrixXSec = 0;}
00336   if (fFDVsNDMatrixXSecRW)
00337     {delete fFDVsNDMatrixXSecRW; fFDVsNDMatrixXSecRW = 0;}
00338   if (fFDVsNDMatrixTauXSecRW)
00339     {delete fFDVsNDMatrixTauXSecRW; fFDVsNDMatrixTauXSecRW = 0;}
00340 
00341   if (fTrueEnergyNuFlux_ND)
00342     {delete fTrueEnergyNuFlux_ND; fTrueEnergyNuFlux_ND = 0;}
00343   if (fTrueEnergyNuFluxRW_ND)
00344     {delete fTrueEnergyNuFluxRW_ND; fTrueEnergyNuFluxRW_ND = 0;}
00345   if (fTrueEnergyNuFlux_FD)
00346     {delete fTrueEnergyNuFlux_FD; fTrueEnergyNuFlux_FD = 0;}
00347   if (fTrueEnergyNuFluxRW_FD)
00348     {delete fTrueEnergyNuFluxRW_FD; fTrueEnergyNuFluxRW_FD = 0;}
00349   if (fTrueEnergyCCFlux_ND)
00350     {delete fTrueEnergyCCFlux_ND; fTrueEnergyCCFlux_ND = 0;}
00351   if (fTrueEnergyCCFluxRW_ND)
00352     {delete fTrueEnergyCCFluxRW_ND; fTrueEnergyCCFluxRW_ND = 0;}
00353   if (fTrueEnergyCCFlux_FD)
00354     {delete fTrueEnergyCCFlux_FD; fTrueEnergyCCFlux_FD = 0;}
00355   if (fTrueEnergyCCFluxRW_FD)
00356     {delete fTrueEnergyCCFluxRW_FD; fTrueEnergyCCFluxRW_FD = 0;}
00357 
00358   if (!fNNDTrueEBins){
00359     MSG("NuFluxHelper",Msg::kError)
00360       <<"Number of ND true energy bins not set " <<endl;
00361     return false;
00362   }
00363   if (!fNFDTrueEBins){
00364     MSG("NuFluxHelper",Msg::kError)
00365       <<"Number of FD true energy bins not set " <<endl;
00366     return false;
00367   }
00368   if (!fNDTrueEBinEdges){
00369     MSG("NuFluxHelper",Msg::kError)
00370       <<"ND true energy bin edges not set " <<endl;
00371     return false;
00372   }
00373   if (!fFDTrueEBinEdges){
00374     MSG("NuFluxHelper",Msg::kError)
00375       <<"FD true energy bin edges not set " <<endl;
00376     return false;
00377   }
00378 
00379   fFDVsNDMatrix = new
00380     TH2D("FDVsNDMatrix",
00381          "Number of FD Vs ND Events with True Energy",
00382          fNNDTrueEBins,fNDTrueEBinEdges,
00383          fNFDTrueEBins,fFDTrueEBinEdges);
00384   fFDVsNDMatrix->Sumw2();
00385   fFDVsNDMatrixRW = new
00386     TH2D("FDVsNDMatrixRW",
00387          "Number of FD Vs ND Events with True Energy (with Near Reweight)",
00388          fNNDTrueEBins,fNDTrueEBinEdges,
00389          fNFDTrueEBins,fFDTrueEBinEdges);
00390   fFDVsNDMatrixRW->Sumw2();
00391   fFDVsNDMatrixXSec = new
00392     TH2D("FDVsNDMatrixXSec",
00393          "Number of FD Vs ND Events with True Energy (with XSec)",
00394          fNNDTrueEBins,fNDTrueEBinEdges,
00395          fNFDTrueEBins,fFDTrueEBinEdges);
00396   fFDVsNDMatrixXSec->Sumw2();
00397   fFDVsNDMatrixXSecRW = new
00398     TH2D("FDVsNDMatrixXSecRW",
00399          "Number of FD Vs ND Events with True Energy (with XSec + Near Reweight)",
00400          fNNDTrueEBins,fNDTrueEBinEdges,
00401          fNFDTrueEBins,fFDTrueEBinEdges);
00402   fFDVsNDMatrixXSecRW->Sumw2();
00403   fFDVsNDMatrixTauXSecRW = new
00404     TH2D("FDVsNDMatrixTauXSecRW",
00405          "Number of FD Vs ND Events with True Energy (with FD Tau XSec + Near Reweight)",
00406          fNNDTrueEBins,fNDTrueEBinEdges,
00407          fNFDTrueEBins,fFDTrueEBinEdges);
00408 
00409   fTrueEnergyNuFlux_ND = new
00410     TH1D("TrueEnergyNuFlux_ND",
00411          "Neutrino Flux with True Energy (NearDet)",
00412          fNNDTrueEBins,fNDTrueEBinEdges);
00413   fTrueEnergyNuFlux_ND->Sumw2();
00414   fTrueEnergyNuFluxRW_ND = new
00415     TH1D("TrueEnergyNuFluxRW_ND",
00416          "Neutrino Flux with True Energy (NearDet with Reweighting)",
00417          fNNDTrueEBins,fNDTrueEBinEdges);
00418   fTrueEnergyNuFlux_FD = new
00419     TH1D("TrueEnergyNuFlux_FD",
00420          "Neutrino Flux with True Energy (FarDet)",
00421          fNFDTrueEBins,fFDTrueEBinEdges);
00422   fTrueEnergyNuFlux_FD->Sumw2();
00423   fTrueEnergyNuFluxRW_FD = new
00424     TH1D("TrueEnergyNuFluxRW_FD",
00425          "Neutrino Flux with True Energy (FarDet with Reweighting)",
00426          fNFDTrueEBins,fFDTrueEBinEdges);
00427   fTrueEnergyNuFluxRW_FD->Sumw2();
00428   fTrueEnergyCCFlux_ND = new
00429     TH1D("TrueEnergyCCFlux_ND",
00430          "NuMu CC Flux with True Energy (NearDet)",
00431          fNNDTrueEBins,fNDTrueEBinEdges);
00432   fTrueEnergyCCFlux_ND->Sumw2();
00433   fTrueEnergyCCFluxRW_ND = new
00434     TH1D("TrueEnergyCCFluxRW_ND",
00435          "NuMu CC Flux with True Energy with (NearDet with Reweighting)",
00436          fNNDTrueEBins,fNDTrueEBinEdges);
00437   fTrueEnergyCCFluxRW_ND->Sumw2();
00438   fTrueEnergyCCFlux_FD = new
00439     TH1D("TrueEnergyCCFlux_FD",
00440          "NuMu CC Flux with True Energy (FarDet)",
00441          fNFDTrueEBins,fFDTrueEBinEdges);
00442   fTrueEnergyCCFlux_FD->Sumw2();
00443   fTrueEnergyCCFluxRW_FD = new
00444     TH1D("TrueEnergyCCFluxRW_FD",
00445          "NuMu CC Flux with True Energy (FarDet with Reweighing)",
00446          fNFDTrueEBins,fFDTrueEBinEdges);
00447   fTrueEnergyCCFluxRW_FD->Sumw2();
00448 
00449   return true;
00450 }

virtual Double_t NuFluxHelper::CrossSection ( const NuParticle::NuParticleType_t  particle,
const Double_t  energy 
) const [private, virtual]

Referenced by FillMMHelpers(), and FillNonMMHelpers().

void NuFluxHelper::CrossSectionFile ( const char *  xSecFile  )  [virtual]

Definition at line 453 of file NuFluxHelper.cxx.

References fxSecFile, fxSecGraphNuEBarCC, fxSecGraphNuECC, fxSecGraphNuMuBarCC, fxSecGraphNuMuCC, fxSecGraphNuTauBarCC, and fxSecGraphNuTauCC.

00454 {
00455   fxSecFile = xSecFile;
00456 
00457   if (fxSecGraphNuMuCC){
00458     delete fxSecGraphNuMuCC;
00459     fxSecGraphNuMuCC = 0;
00460   }
00461   if (fxSecGraphNuMuBarCC){
00462     delete fxSecGraphNuMuBarCC;
00463     fxSecGraphNuMuBarCC = 0;
00464   }
00465   if (fxSecGraphNuTauCC){
00466     delete fxSecGraphNuTauCC;
00467     fxSecGraphNuTauCC = 0;
00468   }
00469   if (fxSecGraphNuTauBarCC){
00470     delete fxSecGraphNuTauBarCC;
00471     fxSecGraphNuTauBarCC = 0;
00472   }
00473   if (fxSecGraphNuECC){
00474     delete fxSecGraphNuECC;
00475     fxSecGraphNuECC = 0;
00476   }
00477   if (fxSecGraphNuEBarCC){
00478     delete fxSecGraphNuEBarCC;
00479     fxSecGraphNuEBarCC = 0;
00480   }
00481 
00482   //Get the cross-section information from the histogram in the file.
00483   //Put it into an array.
00484   TFile *mikeFile=new TFile(fxSecFile.c_str(),"READ");
00485 
00486   //Put the numu CC cross sections into an array
00487   TH1F* XSec_NuMuCC = (TH1F*) mikeFile->Get("h_numu_cc_tot");
00488   XSec_NuMuCC->SetDirectory(0);
00489   Float_t* x = new Float_t[XSec_NuMuCC->GetNbinsX()];
00490   Float_t* y = new Float_t[XSec_NuMuCC->GetNbinsX()];
00491   for(int i=0;i<XSec_NuMuCC->GetNbinsX();i++) {
00492     x[i] = XSec_NuMuCC->GetBinCenter(i+1);
00493     y[i] = XSec_NuMuCC->GetBinContent(i+1);
00494   }
00495   //Turn the array into a graph.
00496   fxSecGraphNuMuCC = new TGraph(XSec_NuMuCC->GetNbinsX(),x,y);
00497 
00498   //Clean up ready for the next set of cross sections
00499   if (x) {delete x; x=0;}
00500   if (y) {delete y; y=0;}
00501 
00502   //Put the numubar CC cross sections into an array
00503   TH1F* XSec_NuMuBarCC = (TH1F*) mikeFile->Get("h_numubar_cc_tot");
00504   XSec_NuMuBarCC->SetDirectory(0);
00505   x = new Float_t[XSec_NuMuBarCC->GetNbinsX()];
00506   y = new Float_t[XSec_NuMuBarCC->GetNbinsX()];
00507   for(int i=0;i<XSec_NuMuBarCC->GetNbinsX();i++) {
00508     x[i] = XSec_NuMuBarCC->GetBinCenter(i+1);
00509     y[i] = XSec_NuMuBarCC->GetBinContent(i+1);
00510   }
00511   //Turn the array into a graph.
00512   fxSecGraphNuMuBarCC = new TGraph(XSec_NuMuBarCC->GetNbinsX(),x,y);
00513 
00514   //Clean up ready for the next set of cross sections:
00515   if (x) {delete x; x=0;}
00516   if (y) {delete y; y=0;}
00517 
00518   //Put the nutau CC cross sections into an array
00519   TH1F* XSec_NuTauCC = (TH1F*) mikeFile->Get("h_nutau_cc_tot");
00520   XSec_NuTauCC->SetDirectory(0);
00521   x = new Float_t[XSec_NuTauCC->GetNbinsX()];
00522   y = new Float_t[XSec_NuTauCC->GetNbinsX()];
00523   for(int i=0;i<XSec_NuTauCC->GetNbinsX();i++) {
00524     x[i] = XSec_NuTauCC->GetBinCenter(i+1);
00525     y[i] = XSec_NuTauCC->GetBinContent(i+1);
00526   }
00527   //Turn the array into a graph.
00528   fxSecGraphNuTauCC = new TGraph(XSec_NuTauCC->GetNbinsX(),x,y);
00529 
00530   //Clean up ready for the next set of cross sections
00531   if (x) {delete x; x=0;}
00532   if (y) {delete y; y=0;}
00533 
00534   //Put the nutaubar CC cross sections into an array
00535   TH1F* XSec_NuTauBarCC = (TH1F*) mikeFile->Get("h_nutaubar_cc_tot");
00536   XSec_NuTauBarCC->SetDirectory(0);
00537   x = new Float_t[XSec_NuTauBarCC->GetNbinsX()];
00538   y = new Float_t[XSec_NuTauBarCC->GetNbinsX()];
00539   for(int i=0;i<XSec_NuTauBarCC->GetNbinsX();i++) {
00540     x[i] = XSec_NuTauBarCC->GetBinCenter(i+1);
00541     y[i] = XSec_NuTauBarCC->GetBinContent(i+1);
00542   }
00543   //Turn the array into a graph.
00544   fxSecGraphNuTauBarCC = new TGraph(XSec_NuTauBarCC->GetNbinsX(),x,y);
00545 
00546   //Clean up memory:
00547   if (x) {delete x; x=0;}
00548   if (y) {delete y; y=0;}
00549 
00550 
00551   //Put the nue CC cross sections into an array
00552   TH1F* XSec_NuECC = (TH1F*) mikeFile->Get("h_nue_cc_tot");
00553   XSec_NuECC->SetDirectory(0);
00554   x = new Float_t[XSec_NuECC->GetNbinsX()];
00555   y = new Float_t[XSec_NuECC->GetNbinsX()];
00556   for(int i=0;i<XSec_NuECC->GetNbinsX();i++) {
00557     x[i] = XSec_NuECC->GetBinCenter(i+1);
00558     y[i] = XSec_NuECC->GetBinContent(i+1);
00559   }
00560   //Turn the array into a graph.
00561   fxSecGraphNuECC = new TGraph(XSec_NuECC->GetNbinsX(),x,y);
00562 
00563   //Clean up memory:
00564   if (x) {delete x; x=0;}
00565   if (y) {delete y; y=0;}
00566 
00567   //Put the nuebar CC cross sections into an array
00568   TH1F* XSec_NuEBarCC = (TH1F*) mikeFile->Get("h_nuebar_cc_tot");
00569   XSec_NuEBarCC->SetDirectory(0);
00570   x = new Float_t[XSec_NuEBarCC->GetNbinsX()];
00571   y = new Float_t[XSec_NuEBarCC->GetNbinsX()];
00572   for(int i=0;i<XSec_NuEBarCC->GetNbinsX();i++) {
00573     x[i] = XSec_NuEBarCC->GetBinCenter(i+1);
00574     y[i] = XSec_NuEBarCC->GetBinContent(i+1);
00575   }
00576   //Turn the array into a graph.
00577   fxSecGraphNuEBarCC = new TGraph(XSec_NuEBarCC->GetNbinsX(),x,y);
00578 
00579   //Clean up memory:
00580   if (x) {delete x; x=0;}
00581   if (y) {delete y; y=0;}
00582 
00583   mikeFile->Close();
00584   if (mikeFile) {delete mikeFile; mikeFile = 0;}
00585 }

virtual Bool_t NuFluxHelper::DoSKZP (  )  const [inline, virtual]

Definition at line 55 of file NuFluxHelper.h.

References fdoSKZP.

Referenced by NuFluxHelper().

00055 {return fdoSKZP;};

void NuFluxHelper::DoSKZP ( const Bool_t  doSKZP  )  [virtual]

Definition at line 240 of file NuFluxHelper.cxx.

References fdoSKZP, and fzarko.

00241 {
00242   fdoSKZP=doSKZP;
00243   if (fdoSKZP && !fzarko) {
00244     fzarko = new NuZBeamReweight();
00245   }
00246   if (!fdoSKZP && fzarko){
00247     delete fzarko; fzarko = 0;
00248   }
00249 }

virtual void NuFluxHelper::FDTrueEBins ( const std::vector< Double_t >  fdtruebins  )  [virtual]
void NuFluxHelper::FillMMHelpers ( const NuFluxChain fluxChain,
const Int_t  flukaEntry 
) const [private, virtual]

Definition at line 1187 of file NuFluxHelper.cxx.

References NuEvent::beamType, BeamType(), NuEvent::beamWeight, Munits::cm, ConvertNDToBeamCoOrdinates(), CrossSection(), NuEvent::detector, fbeamShiftAsSigma, fdoBeamShift, fdoScrapingShift, fdoSKZP, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSecRW, NuEvent::fluxErr, frandom3, fscrapingScaleFactor, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, fzarko, NuZBeamReweight::GetBeamWeightsOnly(), NuEvent::iaction, NuEvent::inu, IsNDFiducial(), DDS::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z185i, BeamType::kL250z200i, SimFlag::kMC, Detector::kNear, MSG, NuEvent::neuEnMC, ArrAy::new_ene, ArrAy::new_weight, NuFluxChain::NuImportanceWeight(), NuFluxChain::NuParticleAsPDGCode(), NuFluxChain::NuType(), NuWte(), NuFluxChain::ParentParticleType(), NuFluxChain::ParentProdDXDZ(), NuFluxChain::ParentProdDYDZ(), NuFluxChain::ParentProdPZ(), NuFluxChain::ParentProdVtxX(), NuFluxChain::ParentProdVtxY(), NuFluxChain::ParentProdVtxZ(), NuFluxChain::ParentType(), NuEvent::ppdxdz, NuEvent::ppdydz, NuEvent::pppz, NuEvent::ptype, ReweightVersion(), NuEvent::reweightVersion, NuEvent::runPeriod, RunPeriod(), NuEvent::simFlag, NuFluxChain::TargetParentPX(), NuFluxChain::TargetParentPY(), NuFluxChain::TargetParentPZ(), TauCrossSection(), NuEvent::tptype, NuEvent::tpx, NuEvent::tpy, NuEvent::tpz, and MinosMaterial::Z().

Referenced by MakeHelperHistos().

01189 {
01190   //Get the fluka variables I'm going to need
01191   NuParticleType_t Ntype = fluxChain->NuType(flukaEntry);
01192   Int_t tptype = fluxChain->ParentParticleType(flukaEntry);
01193   Double_t tpx = fluxChain->TargetParentPX(flukaEntry);
01194   Double_t tpy = fluxChain->TargetParentPY(flukaEntry);
01195   Double_t tpz = fluxChain->TargetParentPZ(flukaEntry);
01196   Double_t Nimpwt = fluxChain->NuImportanceWeight(flukaEntry);
01197   
01198   Int_t ptype =  fluxChain->ParentType(flukaEntry);
01199   Double_t pppz = fluxChain->ParentProdPZ(flukaEntry);
01200   Double_t ppdydz = fluxChain->ParentProdDYDZ(flukaEntry);
01201   Double_t ppdxdz = fluxChain->ParentProdDXDZ(flukaEntry);
01202 
01203   //Higher-level fluka variables
01204   Double_t pt = 0;
01205   Double_t pt2 = tpx*tpx + tpy*tpy;
01206   if (0 < pt2){pt = sqrt(pt2);}
01207 
01208   //Loop over the neutrinos 10 times to spread out importance weights
01209   for(int subLoop=0;subLoop<10;subLoop++){
01210 
01211     //Make a vector ready to hold random detector points
01212     TVector3 vDetPoint(0,0,0);
01213 
01214     //Keep creating random points until one falls within the
01215     //fiducial volume.
01216     do {
01217       vDetPoint.SetX(frandom3->Uniform(-300,300)*Munits::cm);
01218       vDetPoint.SetY(frandom3->Uniform(-300,300)*Munits::cm);
01219       vDetPoint.SetZ(frandom3->Uniform(0,600)*Munits::cm);
01220     } while (!this->IsNDFiducial(vDetPoint));
01221 
01222     TVector3 vBeamPoint = this->ConvertNDToBeamCoOrdinates(vDetPoint);
01223 
01224     Double_t X = vBeamPoint.X()/Munits::cm;
01225     Double_t Y = vBeamPoint.Y()/Munits::cm;
01226     Double_t Z = vBeamPoint.Z()/Munits::cm;
01227 
01228     //Get the ND weight and energy:
01229     ArrAy newvals_nd = this->NuWte(X,Y,Z,fluxChain,flukaEntry);
01230     //get new fd weight and energy:
01231     ArrAy newvals_fd = this->NuWte(0,0,73534000.,fluxChain,flukaEntry);
01232 
01233     //Calculate SKZP parameters for the new neutrino energies
01234     //Make NuEvents to get the beam weights into.
01235     NuEvent nearEvent;
01236     nearEvent.reweightVersion = this->ReweightVersion();
01237     nearEvent.simFlag = SimFlag::kMC;
01238     nearEvent.beamType = this->BeamType();
01239     nearEvent.runPeriod = this->RunPeriod();
01240     nearEvent.neuEnMC = newvals_nd.new_ene;
01241     nearEvent.inu=fluxChain->NuParticleAsPDGCode(Ntype);
01242     nearEvent.tptype = tptype;
01243     nearEvent.tpz = tpz;
01244     nearEvent.tpy = tpy;
01245     nearEvent.tpx = tpx;
01246     nearEvent.detector = Detector::kNear;
01247     nearEvent.beamWeight = 1.0;
01248     nearEvent.fluxErr = 1.0;
01249     nearEvent.ptype = ptype;
01250     nearEvent.pppz = pppz;
01251     nearEvent.ppdydz = ppdydz;
01252     nearEvent.ppdxdz = ppdxdz;
01253     
01254     NuEvent farEvent;
01255     farEvent.reweightVersion = this->ReweightVersion();
01256     farEvent.simFlag = SimFlag::kMC;
01257     farEvent.beamType = this->BeamType();
01258     farEvent.runPeriod = this->RunPeriod();
01259     farEvent.neuEnMC = newvals_fd.new_ene;
01260     farEvent.inu=fluxChain->NuParticleAsPDGCode(Ntype);
01261     farEvent.iaction=1;//CC
01262     farEvent.tptype = tptype;
01263     farEvent.tpz = tpz;
01264     farEvent.tpy = tpy;
01265     farEvent.tpx = tpx;
01266     farEvent.detector = Detector::kFar;
01267     farEvent.beamWeight = 1.0;
01268     farEvent.fluxErr = 1.0;
01269     farEvent.ptype = ptype;
01270     farEvent.pppz = pppz;
01271     farEvent.ppdydz = ppdydz;
01272     farEvent.ppdxdz = ppdxdz;
01273     
01274     //Get the SKZP weights
01275     Double_t flux_weight_near = 1.0;
01276     Double_t flux_weight_far = 1.0;
01277 
01278     if (fdoSKZP){
01279       //Reweight the NuEvents
01280       fzarko->GetBeamWeightsOnly(nearEvent);
01281       fzarko->GetBeamWeightsOnly(farEvent);
01282       
01283       flux_weight_near = nearEvent.beamWeight;
01284       flux_weight_far = farEvent.beamWeight;
01285     }
01286     if (fdoBeamShift){
01287       {
01288         static Int_t messageCounter = 0;
01289         if (messageCounter < 5){
01290           MSG("NuFluxHelper",Msg::kInfo)
01291             << "Performing beam shift "
01292             << fbeamShiftAsSigma << " sigma"
01293             << endl;
01294           ++messageCounter;
01295         }
01296       }
01297       flux_weight_near *= 1.0 + fbeamShiftAsSigma*(nearEvent.fluxErr - 1.0);
01298       flux_weight_far *= 1.0 + fbeamShiftAsSigma*(farEvent.fluxErr - 1.0);
01299     }
01300     if (fdoScrapingShift){
01301       Double_t ppvx = fluxChain->ParentProdVtxX(flukaEntry);
01302       Double_t ppvy = fluxChain->ParentProdVtxY(flukaEntry);
01303       Double_t ppvz = fluxChain->ParentProdVtxZ(flukaEntry);
01304       Float_t ppvr = sqrt(ppvx*ppvx + ppvy*ppvy);
01305       Float_t Znom = 52.06; // -187.06 for HE
01306       if (BeamType::kL250z200i == this->BeamType()){
01307         Znom = -187.06;
01308       }
01309       else if (BeamType::kL010z185i == this->BeamType()){
01310         Znom = 52.06;
01311       }
01312       else{
01313         MSG("NuFluxHelper", kError)
01314           << "Trying to do a scraping shift with an unrecognised beam type "
01315           << "is probably a bad idea."
01316           << endl;
01317         Znom = 52.06;
01318         assert(false);
01319       }
01320 
01321       Bool_t shouldIShift = true;
01322       if (ppvr < 1.65 && TMath::Abs(ppvz - Znom) < 0.1){
01323         shouldIShift = false;
01324       }
01325       if (TMath::Abs(ppvr - 1.51) < 0.11 && ppvz < Znom){
01326         shouldIShift = false; // Target Side
01327       }
01328       // Chase (z < 4500) or Decay Pipe (z > 4500)
01329       if (shouldIShift){
01330         flux_weight_near *= fscrapingScaleFactor;
01331         flux_weight_far *= fscrapingScaleFactor;
01332       }
01333     }
01334 
01335     //Calculate cross-sections for the new neutrino energies
01336     Double_t xsec_nd = this->CrossSection(Ntype,newvals_nd.new_ene);
01337     if(xsec_nd<=0.0) xsec_nd = 0.0;
01338     Double_t xsec_fd = this->CrossSection(Ntype,newvals_fd.new_ene);
01339     if(xsec_fd<=0.0) xsec_fd = 0.0;
01340     //Tau cross section:
01341     Double_t tauXsec_fd = this->TauCrossSection(Ntype,newvals_fd.new_ene);
01342     if (tauXsec_fd<=0.0) tauXsec_fd = 0.0;
01343 
01344     //Fill the beam matrix:
01345     fFDVsNDMatrixXSecRW->Fill(newvals_nd.new_ene,
01346                               newvals_fd.new_ene,
01347                               Nimpwt*newvals_fd.new_weight*
01348                               xsec_fd*flux_weight_far);
01349 
01350     //Fill the numu->nutau beam matrix:
01351     fFDVsNDMatrixTauXSecRW->Fill(newvals_nd.new_ene,
01352                                  newvals_fd.new_ene,
01353                                  Nimpwt*newvals_fd.new_weight*
01354                                  tauXsec_fd*flux_weight_far);
01355 
01356 
01357     //Fill the beam matrix without cross-sections:
01358     fFDVsNDMatrixRW->Fill(newvals_nd.new_ene,
01359                           newvals_fd.new_ene,
01360                           Nimpwt*newvals_fd.new_weight*
01361                           flux_weight_far);
01362 
01363     //Needed to normalise fFDVsNDMatrixRW:
01364     fTrueEnergyNuFluxRW_ND->Fill(newvals_nd.new_ene,
01365                                  Nimpwt*newvals_nd.new_weight*
01366                                  flux_weight_near);
01367     //Not needed:
01368     fTrueEnergyNuFluxRW_FD->Fill(newvals_fd.new_ene,
01369                                  Nimpwt*newvals_fd.new_weight*
01370                                  flux_weight_far);
01371 
01372     //Needed to normalise fFDVsNDMatrixXSecRW and fFDVsNDMatrixTauXSecRW:
01373     fTrueEnergyCCFluxRW_ND->Fill(newvals_nd.new_ene,
01374                                  Nimpwt*newvals_nd.new_weight*
01375                                  xsec_nd*flux_weight_near);
01376     //Not needed:
01377     fTrueEnergyCCFluxRW_FD->Fill(newvals_fd.new_ene,
01378                                  Nimpwt*newvals_fd.new_weight*
01379                                  xsec_fd*flux_weight_far);
01380 
01381   } //End x10 loop over fluka neutrinos
01382 }

void NuFluxHelper::FillNonMMHelpers ( const NuFluxChain fluxChain,
const Int_t  flukaEntry 
) const [private, virtual]

Definition at line 934 of file NuFluxHelper.cxx.

References NuEvent::beamType, BeamType(), NuEvent::beamWeight, CrossSection(), NuEvent::detector, fbeamShiftAsSigma, fdoBeamShift, fdoScrapingShift, fdoSKZP, fFDVsNDMatrix, fFDVsNDMatrixXSec, NuEvent::fluxErr, fscrapingScaleFactor, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fzarko, NuZBeamReweight::GetBeamWeightsOnly(), NuEvent::inu, DDS::kError, Detector::kFar, Msg::kInfo, BeamType::kL010z185i, BeamType::kL250z200i, SimFlag::kMC, Detector::kNear, MSG, NuEvent::neuEnMC, NuFluxChain::NeutrinoFDEnergy(), NuFluxChain::NeutrinoNDEnergy(), NuFluxChain::NuFDWeight(), NuFluxChain::NuImportanceWeight(), NuFluxChain::NuNDWeight(), NuFluxChain::NuParticleAsPDGCode(), NuFluxChain::NuType(), NuFluxChain::ParentParticleType(), NuFluxChain::ParentProdVtxX(), NuFluxChain::ParentProdVtxY(), NuFluxChain::ParentProdVtxZ(), ReweightVersion(), NuEvent::reweightVersion, NuEvent::runPeriod, RunPeriod(), NuEvent::simFlag, NuFluxChain::TargetParentPX(), NuFluxChain::TargetParentPY(), NuFluxChain::TargetParentPZ(), NuEvent::tptype, NuEvent::tpx, NuEvent::tpy, and NuEvent::tpz.

00936 {
00937   //Get the fluka variables I'm going to need
00938   NuParticleType_t Ntype = fluxChain->NuType(flukaEntry);
00939   Int_t tptype = fluxChain->ParentParticleType(flukaEntry);
00940   Double_t tpx = fluxChain->TargetParentPX(flukaEntry);
00941   Double_t tpy = fluxChain->TargetParentPY(flukaEntry);
00942   Double_t tpz = fluxChain->TargetParentPZ(flukaEntry);
00943   Double_t Nenergyn = fluxChain->NeutrinoNDEnergy(flukaEntry);
00944   Double_t Nenergyf = fluxChain->NeutrinoFDEnergy(flukaEntry);
00945   Double_t Nimpwt = fluxChain->NuImportanceWeight(flukaEntry);
00946   Double_t Nwtnear = fluxChain->NuNDWeight(flukaEntry);
00947   Double_t Nwtfar = fluxChain->NuFDWeight(flukaEntry);
00948 
00949   //Higher-level fluka variables
00950   Double_t pt = 0;
00951   Double_t pt2 = tpx*tpx + tpy*tpy;
00952   if (0 < pt2){pt = sqrt(pt2);}
00953 
00954   //Make NuEvents to get the beam weights into.
00955   NuEvent nearEvent;
00956   nearEvent.reweightVersion = this->ReweightVersion();
00957   nearEvent.simFlag = SimFlag::kMC;
00958   nearEvent.beamType = this->BeamType();
00959   nearEvent.runPeriod = this->RunPeriod();
00960   nearEvent.neuEnMC = Nenergyn;
00961   nearEvent.inu=fluxChain->NuParticleAsPDGCode(Ntype);
00962   nearEvent.tptype = tptype;
00963   nearEvent.tpz = tpz;
00964   nearEvent.tpy = tpy;
00965   nearEvent.tpx = tpx;
00966   nearEvent.detector = Detector::kNear;
00967   nearEvent.beamWeight = 1.0;
00968   nearEvent.fluxErr = 1.0;
00969 
00970   NuEvent farEvent;
00971   farEvent.reweightVersion = this->ReweightVersion();
00972   farEvent.simFlag = SimFlag::kMC;
00973   farEvent.beamType = this->BeamType();
00974   farEvent.runPeriod = this->RunPeriod();
00975   farEvent.neuEnMC = Nenergyf;
00976   farEvent.inu=fluxChain->NuParticleAsPDGCode(Ntype);
00977   farEvent.tptype = tptype;
00978   farEvent.tpz = tpz;
00979   farEvent.tpy = tpy;
00980   farEvent.tpx = tpx;
00981   farEvent.detector = Detector::kFar;
00982   farEvent.beamWeight = 1.0;
00983   farEvent.fluxErr = 1.0;
00984 
00985   //Get the SKZP weights
00986   Double_t flux_weight_near = 1.0;
00987   Double_t flux_weight_far = 1.0;
00988 
00989   if (fdoSKZP){
00990     //Reweight the NuEvents
00991     fzarko->GetBeamWeightsOnly(nearEvent);
00992     fzarko->GetBeamWeightsOnly(farEvent);
00993     
00994     flux_weight_near = nearEvent.beamWeight;
00995     flux_weight_far = farEvent.beamWeight;
00996   }
00997   else{
00998     static Int_t messageCounter = 0;
00999     if (messageCounter < 5){
01000       MSG("NuFluxHelper",Msg::kInfo)
01001         << "No SKZP reweighting" << endl;
01002       ++messageCounter;
01003     }
01004   }
01005   if (fdoBeamShift){
01006     {
01007       static Int_t messageCounter = 0;
01008       if (messageCounter < 5){
01009         MSG("NuFluxHelper",Msg::kInfo)
01010           << "Performing beam shift "
01011           << fbeamShiftAsSigma << " sigma"
01012           << endl;
01013         ++messageCounter;
01014       }
01015     }
01016     flux_weight_near *= 1.0 + fbeamShiftAsSigma*(nearEvent.fluxErr - 1.0);
01017     flux_weight_far *= 1.0 + fbeamShiftAsSigma*(farEvent.fluxErr - 1.0);
01018   }
01019   if (fdoScrapingShift){
01020     Double_t ppvx = fluxChain->ParentProdVtxX(flukaEntry);
01021     Double_t ppvy = fluxChain->ParentProdVtxY(flukaEntry);
01022     Double_t ppvz = fluxChain->ParentProdVtxZ(flukaEntry);
01023     Float_t ppvr = sqrt(ppvx*ppvx + ppvy*ppvy);
01024     Float_t Znom = 52.06; // -187.06 for HE
01025     if (BeamType::kL250z200i == this->BeamType()){
01026       Znom = -187.06;
01027     }
01028     else if (BeamType::kL010z185i == this->BeamType()){
01029       Znom = 52.06;
01030     }
01031     else{
01032       MSG("NuFluxHelper", kError)
01033         << "Trying to do a scraping shift with an unrecognised beam type "
01034         << "is probably a bad idea."
01035         << endl;
01036       Znom = 52.06;
01037       assert(false);
01038     }
01039 
01040     Bool_t shouldIShift = true;
01041     if (ppvr < 1.65 && TMath::Abs(ppvz - Znom) < 0.1){
01042       shouldIShift = false;
01043     }
01044     if (TMath::Abs(ppvr - 1.51) < 0.11 && ppvz < Znom){
01045       shouldIShift = false; // Target Side
01046     }
01047     // Chase (z < 4500) or Decay Pipe (z > 4500)
01048     if (shouldIShift){
01049       flux_weight_near *= fscrapingScaleFactor;
01050       flux_weight_far *= fscrapingScaleFactor;
01051     }
01052   }
01053 
01054   //What's the cross-section of my neutrino?
01055   //Only needed for filling XSec-reweighted plots
01056   Double_t xsec_nd = this->CrossSection(Ntype,Nenergyn);
01057   Double_t xsec_fd = this->CrossSection(Ntype,Nenergyf);
01058   if(xsec_nd<=0.0) xsec_nd = 0.0;
01059   if(xsec_fd<=0.0) xsec_fd = 0.0;
01060 
01061   //Fill the beam matrix without MM reweighting or cross-sections:
01062   //(Does this reduce down to the N/F method?)
01063   fFDVsNDMatrix->Fill(Nenergyn,
01064                       Nenergyf,
01065                       Nimpwt*Nwtfar*flux_weight_far);
01066 
01067   //Fill the beam matrix without MM reweighting but with cross-sections:
01068   fFDVsNDMatrixXSec->Fill(Nenergyn,
01069                           Nenergyf,
01070                           Nimpwt*Nwtfar*xsec_fd*flux_weight_far);
01071 
01072   //Needed to normalise fFDVsNDMatrix:
01073   fTrueEnergyNuFlux_ND->Fill(Nenergyn,
01074                              Nimpwt*Nwtnear*flux_weight_near);
01075 
01076   //Not needed:
01077   fTrueEnergyNuFlux_FD->Fill(Nenergyf,
01078                              Nimpwt*Nwtfar*flux_weight_far);
01079 
01080   //Needed to normalise fFDVsNDMatrixXSec:
01081   fTrueEnergyCCFlux_ND->Fill(Nenergyn,
01082                              Nimpwt*Nwtnear*xsec_nd*flux_weight_near);
01083 
01084   //Not needed:
01085   fTrueEnergyCCFlux_FD->Fill(Nenergyf,
01086                              Nimpwt*Nwtfar*xsec_fd*flux_weight_far);
01087 
01088   return;
01089 }

Bool_t NuFluxHelper::IsNDFiducial ( const TVector3 &  ndPoint  )  const [virtual]

Definition at line 1162 of file NuFluxHelper.cxx.

References NuCuts::IsInFidVol(), NuCuts::kCC0325Std, SimFlag::kMC, and Detector::kNear.

Referenced by FillMMHelpers().

01163 {
01164   //create a NuCuts object
01165   static NuCuts nuCuts;
01166 
01167   //give fake values for u,v,plane,r,releaseType
01168   //since they are not needed for kCC0325Std
01169   return nuCuts.IsInFidVol(ndPoint.X(),ndPoint.Y(),ndPoint.Z(),
01170                            0,0,
01171                            0,0,
01172                            Detector::kNear,NuCuts::kCC0325Std,
01173                            0,SimFlag::kMC);
01174 
01175   //Bool_t NuCuts::IsInFidVol(Float_t x,Float_t y,Float_t z,
01176   //              Float_t u,Float_t v,
01177   //              Int_t planeTrkVtx,Float_t rTrkVtx,
01178   //              Int_t detector,Int_t anaVersion,
01179   //              Int_t releaseType,Int_t simFlag)
01180 
01181   //return nuCuts.IsInFidVolNDCC0325Std(ndPoint.X(),
01182   //                        ndPoint.Y(),
01183   //                        ndPoint.Z());
01184 }

virtual Bool_t NuFluxHelper::IsParticleToExtrapolate ( const NuParticle::NuParticleType_t  particle  )  const [private, virtual]

Referenced by MakeHelperHistos().

void NuFluxHelper::MakeHelperHistos ( const char *  fileList  )  [virtual]

Definition at line 644 of file NuFluxHelper.cxx.

References bfld::AsString(), BeamType::AsString(), batchRunning, BeamType(), configReweightVersion, configRunPeriod, CreateHistos(), FillMMHelpers(), frandom3, freweightVersion, frunPeriod, fxSecGraphNuMuBarCC, fxSecGraphNuMuCC, fxSecGraphNuTauBarCC, fxSecGraphNuTauCC, NuFluxChain::GetBeamType(), NuFluxChain::GetEntries(), NuUtilities::GetListOfFilesInDir(), NuFluxChain::GetRunPeriod(), IsParticleToExtrapolate(), SKZPWeightCalculator::kDetXs, SKZPWeightCalculator::kDogwood5_Daikon07_2012, Msg::kError, Msg::kInfo, BeamType::kM000z200i_nova, BeamType::kM000z200i_nova_rev, SKZPWeightCalculator::kMINOSplus_2014_v2, SKZPWeightCalculator::kNone, SKZPWeightCalculator::kRunXI, BeamType::kUnknown, MSG, NormaliseHistos(), NuFluxChain::NuType(), overrideReweightVersion, overrideRunPeriod, RunPeriod(), and WriteHistos().

00645 {
00646   const NuFluxChain* fluxChain = 0;
00647   vector<TString> vFiles = NuUtilities::GetListOfFilesInDir(fileList);
00648   TString tmp = vFiles[0];
00649   if (tmp.Contains("flugg")){
00650     MSG("NuFluxHelper",Msg::kInfo)  << "USING FLUGG CHAIN" << endl;
00651     fluxChain = new NuFluggChain(fileList);
00652     // Reset the reweight version only for Flugg
00653     freweightVersion = SKZPWeightCalculator::kDogwood5_Daikon07_2012;
00654   }
00655   else{
00656     MSG("NuFluxHelper",Msg::kInfo) << "USING GNUMI CHAIN" << endl;
00657     fluxChain = new NuGnumiChain(fileList);
00658     freweightVersion = SKZPWeightCalculator::kDetXs;
00659   }
00660   //if medium energy beam use the new weights
00661   if (tmp.Contains("mn")){
00662     MSG("NuFluxHelper",Msg::kInfo)  << "USING FLUGG CHAIN" << endl;
00663     fluxChain = new NuFluggChain(fileList);
00664     // Reset the reweight version only for Flugg
00665     freweightVersion = SKZPWeightCalculator::kMINOSplus_2014_v2;
00666   }
00667 
00668   TString num = tmp(tmp.Last('_')+1, 3);
00669   if (!num.IsDigit()) {
00670     MSG("NuFluxHelper",Msg::kInfo) << "Cannot determine run number for file: " << tmp
00671     << " (got " << num << ") so random seed will not be reproducible." << endl;
00672     frandom3->SetSeed(0);
00673   }
00674   else {
00675     MSG("NuFluxHelper",Msg::kInfo) << "Setting random seed to " << num << "." << endl;
00676     frandom3->SetSeed(num.Atoi());
00677   }
00678 
00679 
00680 
00681   // Double check the beam type
00682   // If our beam type is not yet known, fill it with type from fluxChain
00683   // If fluxChain type is not known, trust our beam type
00684   // If we have both types, check that they match
00685   if (fluxChain->GetBeamType() != BeamType::kUnknown) {
00686     if (BeamType() == BeamType::kUnknown) BeamType(fluxChain->GetBeamType());
00687     if (BeamType() != fluxChain->GetBeamType()) {
00688       MSG("NuFluxHelper",Msg::kError) << "Beam types do not match.  "
00689                                       << "Type from fluxFiles: " << BeamType::AsString(fluxChain->GetBeamType())
00690                                       << ", Type from FluxHelper: " << BeamType::AsString(BeamType()) << endl;
00691       return;
00692     }
00693   }
00694 
00695 
00696 
00697   // Double check the Run Period
00698   // If our run period is not yet known, fill it with type from fluxChain
00699   // If fluxChain run period is not known, trust our run period
00700   // If we have both types, check that they match
00701   if (fluxChain->GetRunPeriod() != SKZPWeightCalculator::kNone) {
00702     if (RunPeriod() == SKZPWeightCalculator::kNone) RunPeriod(fluxChain->GetRunPeriod());
00703     if (RunPeriod() != fluxChain->GetRunPeriod()) {
00704       MSG("NuFluxHelper",Msg::kError) << "Run Periods do not match.  "
00705                                       << "Period from fluxFiles: " << static_cast<int>(fluxChain->GetRunPeriod())
00706                                       << ", Period from FluxHelper: " << static_cast<int>(RunPeriod()) << endl;
00707       return;
00708     }
00709   }
00710   //if "nova" period beam, run period is 11
00711   if (BeamType() == BeamType::kM000z200i_nova ||
00712       BeamType() == BeamType::kM000z200i_nova_rev){
00713     frunPeriod = SKZPWeightCalculator::kRunXI;
00714     //}
00715     //if (RunPeriod() != SKZPWeightCalculator::kNone){
00716     //MSG("NuFluxHelper",Msg::kError)
00717     //<< "You are using NOvA-era flux files, but the run period "
00718     //<< "is not set to 0"
00719     //<< endl;
00720     // return;
00721     //}
00722   
00723   //if (DoSKZP()){
00724   // MSG("NuFluxHelper",Msg::kWarning)
00725   //  << endl
00726   //  << "   This is NOvA-era beam, for which no SKZP weights exist,"
00727   //  << endl
00728   //  << "   but you have requested SKZP reweighting."
00729   //  << endl
00730   //  << "   SKZP weighting is being switched off."
00731   //  << endl;
00732   //this->DoSKZP(false);
00733   //}
00734   }
00735 
00736   if ( overrideReweightVersion ){
00737     std::cout << "wARNING OVERRIDING REWEIGHT VERSION" << std::endl;
00738     freweightVersion = configReweightVersion;
00739   }
00740 
00741   if ( overrideRunPeriod ){
00742     std::cout << "WARNING OVERRIDING RUN PERIOD" << std::endl;
00743     frunPeriod = configRunPeriod;
00744   }
00745   
00746   MSG("NuFluxHelper",Msg::kInfo) << "Make flux helpers with " << BeamType::AsString(BeamType())
00747                                  << " and run period " << static_cast<int>(RunPeriod()) << endl;
00748 
00749   //Make the histograms if possible:
00750   Bool_t histosReady = this->CreateHistos();
00751   if (!histosReady){return;}
00752 
00753   if (!fxSecGraphNuMuCC){
00754     MSG("NuFluxHelper",Msg::kError)
00755       <<"No numu CC cross-section graph supplied." <<endl;
00756     return;
00757   }
00758   if (!fxSecGraphNuMuBarCC){
00759     MSG("NuFluxHelper",Msg::kError)
00760       <<"No numubar CC cross-section graph supplied." <<endl;
00761     return;
00762   }
00763   if (!fxSecGraphNuTauCC){
00764     MSG("NuFluxHelper",Msg::kError)
00765       <<"No nutau CC cross-section graph supplied." <<endl;
00766     return;
00767   }
00768   if (!fxSecGraphNuTauBarCC){
00769     MSG("NuFluxHelper",Msg::kError)
00770       <<"No nutaubar CC cross-section graph supplied." <<endl;
00771     return;
00772   }
00773 
00774   //Loop over the entries in the fluka files.
00775   Int_t numFlukaEntries = fluxChain->GetEntries();
00776   for(int flukaEntry=0;flukaEntry<numFlukaEntries;++flukaEntry){
00777     if(flukaEntry%10000==0){
00778       MSG("NuFluxHelper",Msg::kInfo)
00779         <<"Processing fluka entry " << flukaEntry
00780         << " of " << numFlukaEntries <<endl;
00781     }
00782 
00783     //Is this the correct particle?
00784     if (!this->IsParticleToExtrapolate(fluxChain->NuType(flukaEntry))){
00785       continue;
00786     }
00787     /*
00788     this->FillNonMMHelpers(fluxChain,
00789                            flukaEntry);
00790     */
00791     this->FillMMHelpers(fluxChain,
00792                         flukaEntry);
00793 
00794   } //End loop over flukaChain
00795 
00796   if (!batchRunning) {
00797     this->NormaliseHistos();
00798   }
00799   this->WriteHistos();
00800 
00801   if (fluxChain){delete fluxChain; fluxChain=0;}
00802 
00803   return;
00804 }

virtual void NuFluxHelper::NDTrueEBins ( const std::vector< Double_t >  ndtruebins  )  [virtual]
void NuFluxHelper::NormaliseHistos (  )  const [private, virtual]

Definition at line 1385 of file NuFluxHelper.cxx.

References fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, fNFDTrueEBins, fNNDTrueEBins, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_ND, Msg::kInfo, and MSG.

Referenced by ConcatenateHelpers(), and MakeHelperHistos().

01386 {
01387   MSG("NuFluxHelper",Msg::kInfo)
01388     <<"Normalising histograms" << endl;
01389 
01390   //Loop over the bins of the beam matrices:
01391   for(int i=1;i<=fNNDTrueEBins;i++){
01392     for(int j=1;j<=fNFDTrueEBins;j++){
01393       //Renormalise the un-MM-reweighted, un-XSec-reweighted beam matrix
01394       if(fTrueEnergyNuFlux_ND->GetBinContent(i)>0 &&
01395          fFDVsNDMatrix->GetBinContent(i,j)>0 ) {
01396         Float_t error = TMath::Power(fFDVsNDMatrix->GetBinError(i,j) /
01397                                      fFDVsNDMatrix->GetBinContent(i,j),2);
01398         error = TMath::Sqrt(error);
01399         fFDVsNDMatrix->SetBinContent(i,j,
01400                                      fFDVsNDMatrix->GetBinContent(i,j)/
01401                                      fTrueEnergyNuFlux_ND->GetBinContent(i));
01402         fFDVsNDMatrix->SetBinError(i,j,error *
01403                                    fFDVsNDMatrix->GetBinContent(i,j));
01404       }
01405       else {
01406         fFDVsNDMatrix->SetBinContent(i,j,0.);
01407         fFDVsNDMatrix->SetBinError(i,j,0.);
01408       }
01409 
01410       //Renormalise the MM-reweighted, un-XSec-reweighted beam matrix
01411       if( fTrueEnergyNuFluxRW_ND->GetBinContent(i)>0 &&
01412           fFDVsNDMatrixRW->GetBinContent(i,j)>0 ) {
01413         Float_t error = TMath::Power(fFDVsNDMatrixRW->GetBinError(i,j) /
01414                                      fFDVsNDMatrixRW->GetBinContent(i,j),2);
01415         error = TMath::Sqrt(error);
01416         fFDVsNDMatrixRW->SetBinContent(i,j,
01417                                        fFDVsNDMatrixRW->GetBinContent(i,j)/
01418                                        fTrueEnergyNuFluxRW_ND->GetBinContent(i));
01419         fFDVsNDMatrixRW->SetBinError(i,j,error *
01420                                      fFDVsNDMatrixRW->GetBinContent(i,j));
01421       }
01422       else {
01423         fFDVsNDMatrixRW->SetBinContent(i,j,0.);
01424         fFDVsNDMatrixRW->SetBinError(i,j,0.);
01425       }
01426 
01427       //Renormalise the un-MM-reweighted, XSec-reweighted beam matrix
01428       if( fTrueEnergyCCFlux_ND->GetBinContent(i)>0 &&
01429           fFDVsNDMatrixXSec->GetBinContent(i,j)>0 ) {
01430         Float_t error = TMath::Power(fFDVsNDMatrixXSec->GetBinError(i,j) /
01431                                      fFDVsNDMatrixXSec->GetBinContent(i,j),2);
01432         error = TMath::Sqrt(error);
01433         fFDVsNDMatrixXSec->SetBinContent(i,j,
01434                                          fFDVsNDMatrixXSec->GetBinContent(i,j)/
01435                                          fTrueEnergyCCFlux_ND->GetBinContent(i));
01436         fFDVsNDMatrixXSec->SetBinError(i,j,error *
01437                                        fFDVsNDMatrixXSec->GetBinContent(i,j));
01438       }
01439       else {
01440         fFDVsNDMatrixXSec->SetBinContent(i,j,0.);
01441         fFDVsNDMatrixXSec->SetBinError(i,j,0.);
01442       }
01443 
01444       //Renormalise the MM-reweighted, XSec-reweighted beam matrix
01445       if( fTrueEnergyCCFluxRW_ND->GetBinContent(i)>0 &&
01446           fFDVsNDMatrixXSecRW->GetBinContent(i,j)>0 ) {
01447         Float_t error = TMath::Power(fFDVsNDMatrixXSecRW->GetBinError(i,j) /
01448                                      fFDVsNDMatrixXSecRW->GetBinContent(i,j),2);
01449         error = TMath::Sqrt(error);
01450         fFDVsNDMatrixXSecRW->SetBinContent(i,j,
01451                                            fFDVsNDMatrixXSecRW->GetBinContent(i,j)/
01452                                            fTrueEnergyCCFluxRW_ND->GetBinContent(i));
01453         fFDVsNDMatrixXSecRW->SetBinError(i,j,error *
01454                                          fFDVsNDMatrixXSecRW->GetBinContent(i,j));
01455       }
01456       else {
01457         fFDVsNDMatrixXSecRW->SetBinContent(i,j,0.);
01458         fFDVsNDMatrixXSecRW->SetBinError(i,j,0.);
01459       }
01461 
01462       //Renormalise the MM-reweighted, tauXSec-reweighted beam matrix
01463       if( fTrueEnergyCCFluxRW_ND->GetBinContent(i)>0 &&
01464           fFDVsNDMatrixTauXSecRW->GetBinContent(i,j)>0 ) {
01465         Float_t error = TMath::Power(fFDVsNDMatrixTauXSecRW->GetBinError(i,j) /
01466                                      fFDVsNDMatrixTauXSecRW->GetBinContent(i,j),2);
01467         error = TMath::Sqrt(error);
01468         fFDVsNDMatrixTauXSecRW->SetBinContent(i,j,
01469                                               fFDVsNDMatrixTauXSecRW->GetBinContent(i,j)/
01470                                               fTrueEnergyCCFluxRW_ND->GetBinContent(i));
01471         fFDVsNDMatrixTauXSecRW->SetBinError(i,j,error *
01472                                             fFDVsNDMatrixTauXSecRW->GetBinContent(i,j));
01473       }
01474       else {
01475         fFDVsNDMatrixTauXSecRW->SetBinContent(i,j,0.);
01476         fFDVsNDMatrixTauXSecRW->SetBinError(i,j,0.);
01477       }
01479 
01480     } //End loop over matrix columns
01481   } //End loop over matrix rows
01482   return;
01483 }

const ArrAy NuFluxHelper::NuWte ( const Double_t  XDET,
const Double_t  YDET,
const Double_t  ZDET,
const NuFluxChain fluxChain,
const Int_t  flukaEntry 
) const [private, virtual]

Definition at line 1486 of file NuFluxHelper.cxx.

References Munits::cm, NuFluxChain::MuonParentEnergy(), NuFluxChain::MuonParentPX(), NuFluxChain::MuonParentPY(), NuFluxChain::MuonParentPZ(), ArrAy::new_ene, ArrAy::new_weight, NueConvention::nue, NuFluxChain::NuECofM(), NueConvention::numu, NuFluxChain::NuType(), NuFluxChain::ParentDecayVtxX(), NuFluxChain::ParentDecayVtxY(), NuFluxChain::ParentDecayVtxZ(), NuFluxChain::ParentProdDXDZ(), NuFluxChain::ParentProdDYDZ(), NuFluxChain::ParentProdEnergy(), NuFluxChain::ParentProdPZ(), NuFluxChain::ParentPX(), NuFluxChain::ParentPY(), NuFluxChain::ParentPZ(), and NuFluxChain::ParentType().

Referenced by FillMMHelpers().

01491 {
01492   ArrAy   newvars,empty;
01493   empty.new_ene   =-1;
01494   empty.new_weight=-1.;
01495 
01496   Int_t Ntype = fluxChain->NuType(flukaEntry);
01497   Double_t Vx = fluxChain->ParentDecayVtxX(flukaEntry)/Munits::cm;
01498   Float_t Vy = fluxChain->ParentDecayVtxY(flukaEntry)/Munits::cm;
01499   Float_t Vz = fluxChain->ParentDecayVtxZ(flukaEntry)/Munits::cm;
01500   Float_t pdpx = fluxChain->ParentPX(flukaEntry);
01501   Float_t pdpy = fluxChain->ParentPY(flukaEntry);
01502   Float_t pdpz = fluxChain->ParentPZ(flukaEntry);
01503   Float_t ppdxdz = fluxChain->ParentProdDXDZ(flukaEntry);
01504   Float_t ppdydz = fluxChain->ParentProdDYDZ(flukaEntry);
01505   Float_t pppz = fluxChain->ParentProdPZ(flukaEntry);
01506   Float_t ppenergy = fluxChain->ParentProdEnergy(flukaEntry);
01507   Int_t ptype = fluxChain->ParentType(flukaEntry);
01508   Float_t muparpx = fluxChain->MuonParentPX(flukaEntry);
01509   Float_t muparpy = fluxChain->MuonParentPY(flukaEntry);
01510   Float_t muparpz = fluxChain->MuonParentPZ(flukaEntry);
01511   Float_t mupare = fluxChain->MuonParentEnergy(flukaEntry);
01512   Float_t Necm = fluxChain->NuECofM(flukaEntry);
01513 
01514   //    -----------------fixed parameters
01515   Double_t pimass, kmass, k0mass, mumass, omegamass;
01516   pimass=0.13957; kmass=0.49368;
01517   k0mass=0.49767; mumass=0.105658389;
01518   omegamass=1.67245;
01519   Int_t nue, nuebar, numu, numubar, muplus, muminus;
01520   nue=53; nuebar=52; numu=56; numubar=55;
01521   muplus=5;  muminus=6;
01522   //      set to flux per 1 meter radius
01523   Double_t RDET =100.;
01524   //
01525 
01526 
01527 //    -----------------ADAMO style variables
01528       Double_t Neutrino_type;
01529       Double_t Vertex_x,           Vertex_y,          Vertex_z;
01530       Double_t Neutrino_parentpx,  Neutrino_parentpy, Neutrino_parentpz;
01531       Double_t Particle_dxdz,      Particle_dydz,     Particle_pz;
01532       Double_t Particle_energy,    Particle_type;
01533       Double_t Muparent_px,        Muparent_py,       Muparent_pz;
01534       Double_t Muparent_energy;
01535       Double_t Neutrino_ecm;
01536 
01537 //    -----------------rest of local variables
01538       Double_t eneu, WGT;
01539       double ENUZR, gamma, beta[3], SANGDET, RAD, EMRAT;
01540       double beta_mag, gamma_sqr;
01541       double parent_energy, parent_mass, parentp, partial;
01542       double costh_pardet, THETA_pardet,costh;
01543       Double_t P_dcm_nu[4], P_nu[3], P_pcm_mp[3];
01544       Double_t P_pcm, wt_ratio, xnu;
01545 //======================================================================
01546 
01547 //    switch to ADAMO variables to maintain compatibility with internal GNUMI
01548       Neutrino_type = Ntype;
01549       Vertex_x = Vx;
01550       Vertex_y = Vy;
01551       Vertex_z = Vz;
01552       Neutrino_parentpx = pdpx;
01553       Neutrino_parentpy = pdpy;
01554       Neutrino_parentpz = pdpz;
01555       Particle_dxdz   = ppdxdz;
01556       Particle_dydz   = ppdydz;
01557       Particle_pz     = pppz;
01558       Particle_energy = ppenergy;
01559       Particle_type   = ptype;
01560       Muparent_px = muparpx;
01561       Muparent_py = muparpy;
01562       Muparent_pz = muparpz;
01563       Muparent_energy = mupare;
01564       Neutrino_ecm = Necm;
01565 
01566 //    >=t gamma of muon parent particle at point of decay to neutrino
01567 
01568       if(Particle_type==8||Particle_type==9)        parent_mass = pimass;
01569       else if(Particle_type==11||Particle_type==12) parent_mass = kmass;
01570       else if(Particle_type==10||Particle_type==16) parent_mass = k0mass;
01571       else if(Particle_type==5||Particle_type==6)   parent_mass = mumass;
01572       else if(Particle_type==24||Particle_type==32) parent_mass = omegamass;
01573       else{
01574         cout << "NUWEIGHT unknown particle type STOP" << endl;
01575         return empty;
01576       }
01577       parent_energy = sqrt(double(Neutrino_parentpx)*double(Neutrino_parentpx)
01578        + double(Neutrino_parentpy)*double(Neutrino_parentpy)
01579        + double(Neutrino_parentpz)*double(Neutrino_parentpz) + parent_mass*parent_mass);
01580       gamma = parent_energy / parent_mass;
01581       gamma_sqr = gamma*gamma;
01582       beta_mag  = sqrt( (gamma_sqr-1.)/gamma_sqr );
01583 
01584 //    >=t the neutrino energy in the parent decay cm
01585 
01586 //    :::ARBITRARY LORENTZ TRANSFORM
01587 //    :::     EtP = PCX * BGX + PCY * BGY + PCZ * BGZ
01588 //    :::     E  = GA * E//+ EtP
01589 //    :::     PtE = EtP / (GA + 1e0) + EC
01590 //    :::     PX = PCX + BGX * PtE
01591 //    :::     PY = PCY + BGY * PtE
01592 //    :::     PZ = PCZ + BGZ * PtE
01593 //    :::     P  = SQRT (PX * PX + PY * PY + PZ * PZ)
01594       ENUZR = Neutrino_ecm;
01595 
01596 //    >=t angle from parent line of flight to detector in lab frame
01597 
01598       RAD =pow((double(XDET)-double(Vertex_x)),2)+pow((double(YDET)-double(Vertex_y)),2)
01599         +pow((double(ZDET)-double(Vertex_z)),2);
01600       RAD = sqrt(RAD);
01601       parentp =  double(Neutrino_parentpx)*double(Neutrino_parentpx) +
01602        double(Neutrino_parentpy)*double(Neutrino_parentpy) + double(Neutrino_parentpz)* double(Neutrino_parentpz);
01603       parentp = sqrt(parentp);
01604       costh_pardet = ( Neutrino_parentpx*(double(XDET)-Vertex_x)
01605        + Neutrino_parentpy*(double(YDET)-Vertex_y)
01606        + Neutrino_parentpz*(double(ZDET)-Vertex_z) )
01607        / ( parentp * RAD );
01608       if(fabs(costh_pardet)>1.){
01609         if(costh_pardet<0) costh_pardet = -1.;
01610         if(costh_pardet>0) costh_pardet =  1;
01611       }
01612       THETA_pardet = acos(costh_pardet);
01613 
01614 //    weighted neutrino energy in lab, approx, good for small theta
01615 //I'VE WORKED THIS OUT AND I DON'T THINK IT'S APPROXIMATE:
01616 //I THINK IT'S EXACT --JE
01617       EMRAT = 1. / (gamma * (1. - beta_mag * cos(THETA_pardet)));
01618       eneu=EMRAT*ENUZR;
01619 
01620 //    >=t solid angle/4pi for detector element
01621       SANGDET = (   RDET*RDET/((ZDET-Vertex_z)*(ZDET-Vertex_z)))/(4.0   );
01622 
01623 //    weight for solid angle and lorentz boost
01624       WGT = SANGDET * (EMRAT*EMRAT);
01625 //    weight weighted by approx neutrino cross section
01626 //    WGTE=0.67*ENEU*WGT
01627 
01628 //    done for all except polarized muon decay, ==================
01629 //    in which case need to modify weight
01630 //    (Warning: This section may need more double precision)
01631       if(Particle_type==muplus||Particle_type==muminus) {
01632 
01633 //      boost new neutrino to mu decay cm
01634 //      boost new neutrino to mu decay cm
01635         beta[0] = Neutrino_parentpx / parent_energy;
01636         beta[1] = Neutrino_parentpy / parent_energy;
01637         beta[2] = Neutrino_parentpz / parent_energy;
01638         P_nu[0] = (XDET-Vertex_x)*eneu/RAD;
01639         P_nu[1] = (YDET-Vertex_y)*eneu/RAD;
01640         P_nu[2] = (ZDET-Vertex_z)*eneu/RAD;
01641         partial =gamma*(beta[0]*P_nu[0]+beta[1]*P_nu[1]+beta[2]*P_nu[2]);
01642         partial = eneu - partial /(gamma+1.);
01643         P_dcm_nu[0] = P_nu[0] - beta[0]*gamma*partial;
01644         P_dcm_nu[1] = P_nu[1] - beta[1]*gamma*partial;
01645         P_dcm_nu[2] = P_nu[2] - beta[2]*gamma*partial;
01646         P_dcm_nu[3] = sqrt(P_dcm_nu[0]*P_dcm_nu[0]+P_dcm_nu[1]*+P_dcm_nu[1]+P_dcm_nu[2]*P_dcm_nu[2]);
01647 
01648 //      boost parent of mu to mu production cm
01649         gamma = Particle_energy/parent_mass;
01650         beta[0] = Particle_dxdz*Particle_pz/Particle_energy;
01651         beta[1] = Particle_dydz*Particle_pz/Particle_energy;
01652         beta[2] =               Particle_pz/Particle_energy;
01653         partial = gamma * ( beta[0]*Muparent_px +
01654          beta[1]*Muparent_py + beta[2]*Muparent_pz);
01655         partial = Muparent_energy - partial /(gamma+1.);
01656         P_pcm_mp[0] = Muparent_px - beta[0]*gamma*partial;
01657         P_pcm_mp[1] = Muparent_py - beta[1]*gamma*partial;
01658         P_pcm_mp[2] = Muparent_pz - beta[2]*gamma*partial;
01659         P_pcm = sqrt(P_pcm_mp[0]*P_pcm_mp[0] + P_pcm_mp[1]* P_pcm_mp[1] + P_pcm_mp[2]* P_pcm_mp[2]);
01660 
01661 //      cal//new  decay angle w.r.t. (anti)spin direction
01662         if(P_dcm_nu[3]*P_pcm!=0) {
01663           costh  = ( P_dcm_nu[0]*P_pcm_mp[0] + P_dcm_nu[1]*P_pcm_mp[1]
01664                      + P_dcm_nu[2]*P_pcm_mp[2] ) / (P_dcm_nu[3]*P_pcm);
01665         }
01666         else costh = 0;
01667         if(fabs(costh)>=1.) {
01668          if(costh<0.) costh = -1. ;
01669          if(costh>0.) costh=  1.  ;
01670         }
01671 //      cal//relative weight due to angle difference
01672         if( Neutrino_type==nue || Neutrino_type==nuebar ) {
01673           wt_ratio = 1.-costh;
01674         }
01675         else if( Neutrino_type==numu|| Neutrino_type==numubar) {
01676           xnu = 2. * ENUZR / mumass;
01677           wt_ratio = ( (3.-2.*xnu) - (1.-2.*xnu)*costh ) / (3.-2.*xnu);
01678          }
01679         else {
01680           cout << "NUWEIGHT bad neutrino type" << endl;
01681           return empty;
01682         }
01683 
01684         WGT = WGT * wt_ratio;
01685       }
01686       Double_t ene_wei[2];
01687       ene_wei[0]=eneu;
01688       ene_wei[1]=WGT;
01689       newvars.new_ene    = eneu;
01690       newvars.new_weight = WGT;
01691       return newvars;
01692 }

virtual void NuFluxHelper::OutputFilename ( const char *  outFile  )  [inline, virtual]

Definition at line 56 of file NuFluxHelper.h.

References foutFile.

00057     {foutFile = outFile;}

void NuFluxHelper::ParticlesToExtrapolate ( int  flavour  )  [virtual]

Definition at line 589 of file NuFluxHelper.cxx.

References NuParticle::kNuE, NuParticle::kNuEBar, NuParticle::kNuMu, NuParticle::kNuMuBar, and ParticlesToExtrapolate().

00590 {
00591   //Configure the particles to extrapolate
00592   vector<NuParticle::NuParticleType_t> particles;
00593   if (0==flavour){
00594     particles.push_back(NuParticle::kNuMu);
00595     particles.push_back(NuParticle::kNuMuBar);
00596   }
00597   if (1==flavour){
00598     particles.push_back(NuParticle::kNuMu);
00599   }
00600   if (2==flavour){
00601     particles.push_back(NuParticle::kNuMuBar);
00602   }
00603   if (3==flavour){
00604     particles.push_back(NuParticle::kNuE);
00605   }
00606   if (4==flavour){
00607     particles.push_back(NuParticle::kNuEBar);
00608   }
00609 
00610   this->ParticlesToExtrapolate(particles);
00611 }

virtual void NuFluxHelper::ParticlesToExtrapolate ( const std::vector< NuParticle::NuParticleType_t particleList  )  [virtual]

Referenced by ParticlesToExtrapolate().

virtual void NuFluxHelper::ParticleToExtrapolate ( const NuParticle::NuParticleType_t  particle  )  [virtual]
virtual SKZPWeightCalculator::SKZPConfig_t NuFluxHelper::ReweightVersion (  )  const [inline, virtual]

Definition at line 67 of file NuFluxHelper.h.

References freweightVersion.

Referenced by FillMMHelpers(), and FillNonMMHelpers().

00068     {return freweightVersion;}

virtual void NuFluxHelper::ReweightVersion ( const SKZPWeightCalculator::SKZPConfig_t  reweightVersion  )  [inline, virtual]

Definition at line 65 of file NuFluxHelper.h.

References freweightVersion.

00066     {freweightVersion = reweightVersion;};

virtual SKZPWeightCalculator::RunPeriod_t NuFluxHelper::RunPeriod (  )  const [inline, virtual]

Definition at line 49 of file NuFluxHelper.h.

References frunPeriod.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and MakeHelperHistos().

00050     {return frunPeriod;};

virtual void NuFluxHelper::RunPeriod ( const SKZPWeightCalculator::RunPeriod_t  runPeriod  )  [inline, virtual]

Definition at line 47 of file NuFluxHelper.h.

References frunPeriod.

00048     {frunPeriod = runPeriod;};

virtual void NuFluxHelper::SetBatch ( Bool_t  set  )  [inline, virtual]

Definition at line 88 of file NuFluxHelper.h.

References batchRunning.

00088 { batchRunning = set; };

virtual void NuFluxHelper::SystematicBeamShift ( const Bool_t  doShift,
const Double_t  numSigma 
) [inline, virtual]

Definition at line 69 of file NuFluxHelper.h.

References fbeamShiftAsSigma, and fdoBeamShift.

Referenced by NuFluxHelper().

00071     {
00072       fdoBeamShift = doShift;
00073       if (doShift){fbeamShiftAsSigma = numSigma;}
00074     }

virtual void NuFluxHelper::SystematicScrapingShift ( const Bool_t  doShift,
const Double_t  scaleFactor 
) [inline, virtual]

Definition at line 75 of file NuFluxHelper.h.

References fdoScrapingShift, and fscrapingScaleFactor.

Referenced by NuFluxHelper().

00077     {
00078       fdoScrapingShift = doShift;
00079       if (doShift){fscrapingScaleFactor = scaleFactor;}
00080     }

virtual Double_t NuFluxHelper::TauCrossSection ( const NuParticle::NuParticleType_t  particle,
const Double_t  energy 
) const [private, virtual]

Referenced by FillMMHelpers().

void NuFluxHelper::WriteHistos (  )  const [private, virtual]

Definition at line 908 of file NuFluxHelper.cxx.

References fFDVsNDMatrix, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSec, fFDVsNDMatrixXSecRW, foutFile, fTrueEnergyCCFlux_FD, fTrueEnergyCCFlux_ND, fTrueEnergyCCFluxRW_FD, fTrueEnergyCCFluxRW_ND, fTrueEnergyNuFlux_FD, fTrueEnergyNuFlux_ND, fTrueEnergyNuFluxRW_FD, fTrueEnergyNuFluxRW_ND, Msg::kInfo, and MSG.

Referenced by ConcatenateHelpers(), and MakeHelperHistos().

00909 {
00910   MSG("NuFluxHelper",Msg::kInfo)
00911     <<"Writing helper histograms to " << foutFile << endl;
00912 
00913   TFile *savefile = new TFile(foutFile.c_str(),"RECREATE");
00914   savefile->cd();
00915   fFDVsNDMatrix->Write();
00916   fFDVsNDMatrixRW->Write();
00917   fFDVsNDMatrixXSec->Write();
00918   fFDVsNDMatrixXSecRW->Write();
00919   fFDVsNDMatrixTauXSecRW->Write();
00920 
00921   fTrueEnergyNuFlux_ND->Write();
00922   fTrueEnergyNuFluxRW_ND->Write();
00923   fTrueEnergyNuFlux_FD->Write();
00924   fTrueEnergyNuFluxRW_FD->Write();
00925   fTrueEnergyCCFlux_ND->Write();
00926   fTrueEnergyCCFluxRW_ND->Write();
00927   fTrueEnergyCCFlux_FD->Write();
00928   fTrueEnergyCCFluxRW_FD->Write();
00929   savefile->Close();
00930   if (savefile) {delete savefile; savefile = 0;}
00931 }


Member Data Documentation

Bool_t NuFluxHelper::batchRunning [private]

Definition at line 94 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), NuFluxHelper(), and SetBatch().

Definition at line 117 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), and NuFluxHelper().

Definition at line 119 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), and NuFluxHelper().

Double_t NuFluxHelper::fbeamShiftAsSigma [private]

Definition at line 104 of file NuFluxHelper.h.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and SystematicBeamShift().

Definition at line 114 of file NuFluxHelper.h.

Referenced by BeamType(), and NuFluxHelper().

Definition at line 101 of file NuFluxHelper.h.

Referenced by NuFluxHelper().

Bool_t NuFluxHelper::fdoBeamShift [private]

Definition at line 92 of file NuFluxHelper.h.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and SystematicBeamShift().

Definition at line 93 of file NuFluxHelper.h.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and SystematicScrapingShift().

Bool_t NuFluxHelper::fdoSKZP [private]

Definition at line 88 of file NuFluxHelper.h.

Referenced by DoSKZP(), FillMMHelpers(), and FillNonMMHelpers().

Double_t* NuFluxHelper::fFDTrueEBinEdges [private]

Definition at line 100 of file NuFluxHelper.h.

Referenced by CreateHistos(), NuFluxHelper(), and ~NuFluxHelper().

TH2D* NuFluxHelper::fFDVsNDMatrix [private]
Double_t* NuFluxHelper::fNDTrueEBinEdges [private]

Definition at line 99 of file NuFluxHelper.h.

Referenced by CreateHistos(), NuFluxHelper(), and ~NuFluxHelper().

Int_t NuFluxHelper::fNFDTrueEBins [private]

Definition at line 98 of file NuFluxHelper.h.

Referenced by CreateHistos(), NormaliseHistos(), and NuFluxHelper().

Int_t NuFluxHelper::fNNDTrueEBins [private]

Definition at line 97 of file NuFluxHelper.h.

Referenced by CreateHistos(), NormaliseHistos(), and NuFluxHelper().

std::string NuFluxHelper::foutFile [private]

Definition at line 109 of file NuFluxHelper.h.

Referenced by NuFluxHelper(), OutputFilename(), and WriteHistos().

Definition at line 107 of file NuFluxHelper.h.

TRandom3* NuFluxHelper::frandom3 [private]

Definition at line 153 of file NuFluxHelper.h.

Referenced by FillMMHelpers(), MakeHelperHistos(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 113 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), NuFluxHelper(), and ReweightVersion().

Definition at line 112 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), NuFluxHelper(), and RunPeriod().

Definition at line 105 of file NuFluxHelper.h.

Referenced by FillMMHelpers(), FillNonMMHelpers(), and SystematicScrapingShift().

std::string NuFluxHelper::fxSecFile [private]

Definition at line 110 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), and NuFluxHelper().

Definition at line 129 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), NuFluxHelper(), and ~NuFluxHelper().

TGraph* NuFluxHelper::fxSecGraphNuECC [private]

Definition at line 128 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 125 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), MakeHelperHistos(), NuFluxHelper(), and ~NuFluxHelper().

TGraph* NuFluxHelper::fxSecGraphNuMuCC [private]

Definition at line 124 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), MakeHelperHistos(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 127 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), MakeHelperHistos(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 126 of file NuFluxHelper.h.

Referenced by CrossSectionFile(), MakeHelperHistos(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 121 of file NuFluxHelper.h.

Referenced by DoSKZP(), FillMMHelpers(), FillNonMMHelpers(), NuFluxHelper(), and ~NuFluxHelper().

Definition at line 116 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), and NuFluxHelper().

Definition at line 118 of file NuFluxHelper.h.

Referenced by MakeHelperHistos(), and NuFluxHelper().


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

Generated on 13 Nov 2018 for loon by  doxygen 1.6.1