NCExtrapolationNone Class Reference

"Extrapolation" that simply uses FD MC More...

#include <NCExtrapolationNone.h>

Inheritance diagram for NCExtrapolationNone:
NCExtrapolation

List of all members.

Public Member Functions

 NCExtrapolationNone ()
virtual ~NCExtrapolationNone ()
void Prepare (const Registry &r)
void WriteResources (const NC::OscProb::OscPars *trueOscPars)
virtual TString GetShortName () const
 This is the name used to name things in the output file etc.
virtual TString GetLongName () const
 This is the name the extrapolation is known under on plots and such.
virtual void AddEvent (NCEventInfo eventInfo, bool useMCAsData, NCType::EFileType fileType, NCBeam::Info beamInfo)
virtual void FindSpectraForPars (const NC::OscProb::OscPars *oscPars, const NC::SystPars &systPars, std::vector< NCBeam::Info > beamsToUse, std::vector< TH1 * > &exps, std::vector< TH1 * > &obss)
 Override this in the derived class.
virtual void CleanupSpectra (std::vector< TH1 * > expvec, std::vector< TH1 * > obsvec)
 Called after FindSpectraForPars() to delete necessary spectra.

Static Public Member Functions

static const RegistryDefaultConfig ()
 Return a default config that will be merged with the NCExtrapolationModule DefaultConfig.

Private Types

typedef void(NCEnergyBin::* InfoFunction )(double &, double &, double &, double &, int &, int) const
 The type signature of the NCEnergyBin::GetMC*Information functions.

Private Member Functions

void FillMCSpectrum (TH1 *exp, const NCEnergyBin *bin, InfoFunction func, int size, const NC::OscProb::OscPars *pars, NCType::EEventType nccc, NCType::EOscMode oscmode)

Private Attributes

int nCalls
 Counts number of calls to the method.
TTree * fEventsTree
TString fSelEvtsFname

Detailed Description

"Extrapolation" that simply uses FD MC

Definition at line 25 of file NCExtrapolationNone.h.


Member Typedef Documentation

typedef void(NCEnergyBin::* NCExtrapolationNone::InfoFunction)(double &, double &, double &, double &, int &, int) const [private]

The type signature of the NCEnergyBin::GetMC*Information functions.

Definition at line 59 of file NCExtrapolationNone.h.


Constructor & Destructor Documentation

NCExtrapolationNone::NCExtrapolationNone (  ) 

Definition at line 33 of file NCExtrapolationNone.cxx.

00034 {
00035   nCalls = 0;
00036 
00037   fEventsTree = new TTree("sel_evts", "sel_evts");
00038 
00039   fEventsTree->Branch("header.",   "ANtpHeaderInfo",   (void**)0);
00040   fEventsTree->Branch("beam.",     "ANtpBeamInfo",     (void**)0);
00041   fEventsTree->Branch("reco.",     "ANtpRecoInfo",     (void**)0);
00042   fEventsTree->Branch("analysis.", "ANtpAnalysisInfo", (void**)0);
00043 }

NCExtrapolationNone::~NCExtrapolationNone (  )  [virtual]

Definition at line 48 of file NCExtrapolationNone.cxx.

References fEventsTree, Msg::kInfo, MSG, and nCalls.

00049 {
00050   MSG("NCExtrapolationNone", Msg::kInfo) << nCalls << " calls in total to NCExtrapolationNone" << endl;
00051 
00052   if(fEventsTree) delete fEventsTree;
00053 }


Member Function Documentation

void NCExtrapolationNone::AddEvent ( NCEventInfo  eventInfo,
bool  useMCAsData,
NCType::EFileType  fileType,
NCBeam::Info  beamInfo 
) [virtual]

Reimplemented from NCExtrapolation.

Definition at line 80 of file NCExtrapolationNone.cxx.

References NCEventInfo::analysis, NCEventInfo::beam, ANtpHeaderInfo::dataType, ANtpHeaderInfo::detector, fEventsTree, NCEventInfo::header, ANtpRecoInfo::inFiducialVolume, ANtpRecoInfo::isSimpleCutsClean, SimFlag::kData, Detector::kNear, and NCEventInfo::reco.

00084 {
00085   // Chain up to base-class's implementation so the NCBeam objects get filled
00086   NCExtrapolation::AddEvent(info, useMCAsData, fileType, beamInfo);
00087 
00088   // Then go ahead and put the events in the selected events tree too
00089 
00090   if(info.reco->inFiducialVolume < 1 ||
00091      (info.header->detector == int(Detector::kNear) &&
00092       info.reco->isSimpleCutsClean < 1))
00093      return;
00094 
00095   if(info.header->dataType != int(SimFlag::kData)) return;
00096 
00097   assert(fEventsTree);
00098   fEventsTree->SetBranchAddress("header.", &info.header);
00099   fEventsTree->SetBranchAddress("beam.", &info.beam);
00100   fEventsTree->SetBranchAddress("reco.", &info.reco);
00101   fEventsTree->SetBranchAddress("analysis.", &info.analysis);
00102 
00103   fEventsTree->Fill();
00104 }

virtual void NCExtrapolationNone::CleanupSpectra ( std::vector< TH1 * >  exps,
std::vector< TH1 * >  obss 
) [virtual]

Called after FindSpectraForPars() to delete necessary spectra.

Parameters:
exps The expected spectra just returned from FindSpectraForPars()
obss The observed spectra just returned from FindSpectraForPars()

Reimplemented from NCExtrapolation.

const Registry & NCExtrapolationNone::DefaultConfig ( void   )  [static]

Return a default config that will be merged with the NCExtrapolationModule DefaultConfig.

Reimplemented from NCExtrapolation.

Definition at line 56 of file NCExtrapolationNone.cxx.

References Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00057 {
00058   static Registry r;
00059 
00060   r.UnLockValues();
00061 
00062   r.Set("SelectedEventsFilename", "/tmp/sel_evts.root");
00063 
00064   r.LockValues();
00065   return r;
00066 }

void NCExtrapolationNone::FillMCSpectrum ( TH1 *  exp,
const NCEnergyBin bin,
InfoFunction  func,
int  size,
const NC::OscProb::OscPars pars,
NCType::EEventType  nccc,
NCType::EOscMode  oscmode 
) [private]

Definition at line 107 of file NCExtrapolationNone.cxx.

References MuELoss::e, NCType::kBaseLineFar, and NC::OscProb::OscPars::TransitionProbability().

00114 {
00115   for(int e = 0; e < size; ++e){
00116     double trueE, showerE, trackE, weight;
00117     int flavour;
00118 
00119     // Call the member function specified by func
00120     (bin->*func)(trueE, showerE, trackE, weight, flavour, e);
00121 
00122     const double oscweight = pars->TransitionProbability(oscmode,
00123                                                          nccc,
00124                                                          NCType::kBaseLineFar,
00125                                                          trueE);
00126 
00127      exp->Fill(showerE+trackE, weight*oscweight);
00128   }
00129 }

virtual void NCExtrapolationNone::FindSpectraForPars ( const NC::OscProb::OscPars oscPars,
const NC::SystPars systPars,
std::vector< NCBeam::Info beamsToUse,
std::vector< TH1 * > &  exps,
std::vector< TH1 * > &  obss 
) [virtual]

Override this in the derived class.

Parameters:
oscPars Oscillation parameters
systPars Systematic shifts
beamsToUse Only fill exps and obss with spectra from beams with these indices
[out] exps To be filled with expected spectra
[out] obss To be filled with the corresponding observed spectra

Implements NCExtrapolation.

virtual TString NCExtrapolationNone::GetLongName (  )  const [inline, virtual]

This is the name the extrapolation is known under on plots and such.

Implements NCExtrapolation.

Definition at line 39 of file NCExtrapolationNone.h.

00039 {return "No Extrapolation";}

virtual TString NCExtrapolationNone::GetShortName (  )  const [inline, virtual]

This is the name used to name things in the output file etc.

Implements NCExtrapolation.

Definition at line 38 of file NCExtrapolationNone.h.

00038 {return "None";}

void NCExtrapolationNone::Prepare ( const Registry r  )  [virtual]

Read whatever values you need out of the registry to initialize yourself. Please remember to chain up to the NCExtrapolation implementation too.

Reimplemented from NCExtrapolation.

Definition at line 68 of file NCExtrapolationNone.cxx.

References fSelEvtsFname, and Registry::Get().

00069 {
00070   NCExtrapolation::Prepare(r);
00071 
00072   const char* tmps;
00073   if(r.Get("SelectedEventsFilename", tmps)) fSelEvtsFname = tmps;
00074 }

void NCExtrapolationNone::WriteResources ( const NC::OscProb::OscPars trueOscPars  )  [virtual]

gDirectory will point to the output file. Please remember to chain up to the NCExtrapolation implementation.

trueOscPars may be zero (eg obviously in case of fit to real data)

Reimplemented from NCExtrapolation.

Definition at line 226 of file NCExtrapolationNone.cxx.

References fEventsTree, and fSelEvtsFname.

00227 {
00228   NCExtrapolation::WriteResources(trueOscPars);
00229 
00230   TDirectory* fileDir = gDirectory;
00231 
00232   TFile f(fSelEvtsFname, "RECREATE");
00233   fEventsTree->Write();
00234   f.Close();
00235 
00236   fileDir->cd();
00237 }


Member Data Documentation

Definition at line 70 of file NCExtrapolationNone.h.

Referenced by AddEvent(), WriteResources(), and ~NCExtrapolationNone().

Definition at line 71 of file NCExtrapolationNone.h.

Referenced by Prepare(), and WriteResources().

Counts number of calls to the method.

Definition at line 56 of file NCExtrapolationNone.h.

Referenced by ~NCExtrapolationNone().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1