NC::RealDataAdder Class Reference

Adds MC chains to the MC spectra and data chains to the data spectra. More...

#include <NCEventAdder.h>

Inheritance diagram for NC::RealDataAdder:
NC::EventAdderBase NC::IEventAdder

List of all members.

Public Member Functions

 RealDataAdder ()
virtual ~RealDataAdder ()
virtual void Config (const Registry &r)
 Override this function to handle additional registry options.
virtual void AddEvents (NCExtrapolationModule *mod, NCEventInfo *eventInfo, TChain *nearData, TChain *nearMC, TChain *farData, TChain *farMC, TChain *farMCTau, TChain *farMCElectron) const
 You should implement this function to call back to NCExtrapolationModule::AddEventToExtrapolations.

Protected Member Functions

void AddEventsToExtrapolations (NCExtrapolationModule *mod, NCEventInfo *eventInfo, TChain *chain) const

Protected Attributes

bool fSkipMC
 Don't add MC because LoadExtrapolationsFile!="".

Detailed Description

Adds MC chains to the MC spectra and data chains to the data spectra.

This is what is used when fitting to real data

Definition at line 145 of file NCEventAdder.h.


Constructor & Destructor Documentation

NC::RealDataAdder::RealDataAdder (  ) 

Definition at line 426 of file NCEventAdder.cxx.

00426                                : fSkipMC(false)
00427 {
00428 }

NC::RealDataAdder::~RealDataAdder (  )  [virtual]

Definition at line 432 of file NCEventAdder.cxx.

00433 {
00434 }


Member Function Documentation

void NC::RealDataAdder::AddEvents ( NCExtrapolationModule mod,
NCEventInfo eventInfo,
TChain *  nearData,
TChain *  nearMC,
TChain *  farData,
TChain *  farMC,
TChain *  farMCTau,
TChain *  farMCElectron 
) const [virtual]

You should implement this function to call back to NCExtrapolationModule::AddEventToExtrapolations.

Implements NC::IEventAdder.

Definition at line 451 of file NCEventAdder.cxx.

References AddEventsToExtrapolations(), and fSkipMC.

00459 {
00460   if(!fSkipMC){
00461     AddEventsToExtrapolations(mod, eventInfo, nearMC);
00462     // Yes, really skip ND data if fSkipMC is set. fSkipMC is set if
00463     // we're reading the extrapolation from a file. The ND data is the
00464     // same every time, and so we can skip readding it
00465     AddEventsToExtrapolations(mod, eventInfo, nearData);
00466   }
00467 
00468   if(!fSkipMC){
00469     AddEventsToExtrapolations(mod, eventInfo, farMCTau);
00470     AddEventsToExtrapolations(mod, eventInfo, farMCElectron);
00471     AddEventsToExtrapolations(mod, eventInfo, farMC);
00472   }
00473   AddEventsToExtrapolations(mod, eventInfo, farData);
00474 }

void NC::RealDataAdder::AddEventsToExtrapolations ( NCExtrapolationModule mod,
NCEventInfo eventInfo,
TChain *  chain 
) const [protected]

Definition at line 479 of file NCEventAdder.cxx.

References NCExtrapolationModule::AddEventToExtrapolations(), LoopRunLimitHelper::AreDone(), ANtpHeaderInfo::dataType, det, ANtpHeaderInfo::detector, NCEventInfo::FillFromChain(), NC::EventAdderBase::fRunLimitFarData, NC::EventAdderBase::fRunLimitFarMC, NC::EventAdderBase::fRunLimitNearData, NC::EventAdderBase::fRunLimitNearMC, NCEventInfo::header, kData, Msg::kError, kFar, kMC, kNear, MSG, and NC::EventAdderBase::ReportOnEventInfo().

Referenced by AddEvents().

00482 {
00483   if(chain->GetEntries() < 1){
00484     MSG("NC::RealDataAdder", Msg::kError) << "No entries in chain!" << endl;
00485     return;
00486   }
00487 
00488   eventInfo->FillFromChain(chain, 0);
00489 
00490   using namespace Detector;
00491   using namespace SimFlag;
00492 
00493   const Detector_t det = Detector_t(eventInfo->header->detector);
00494   const SimFlag_t sim = SimFlag_t(eventInfo->header->dataType);
00495 
00496   ReportOnEventInfo(eventInfo);
00497 
00498   // The file limit
00499   int limit = -1;
00500   if(det == kNear && sim == kMC)   limit = fRunLimitNearMC;
00501   if(det == kNear && sim == kData) limit = fRunLimitNearData;
00502   if(det == kFar  && sim == kMC)   limit = fRunLimitFarMC;
00503   if(det == kFar  && sim == kData) limit = fRunLimitFarData;
00504   assert(limit >= 0);
00505 
00506   const int eventTot = chain->GetEntries();
00507 
00508   LoopRunLimitHelper runLimitHelper(limit, eventTot, eventInfo);
00509 
00510   //loop over the entries in the tree
00511   for(int i = 0; i < eventTot; ++i){
00512     eventInfo->FillFromChain(chain, i);
00513 
00514     if(runLimitHelper.AreDone(i, eventInfo)) break;
00515 
00516     mod->AddEventToExtrapolations(false);
00517 
00518   }//end loop over data chain
00519 }

void NC::RealDataAdder::Config ( const Registry r  )  [virtual]

Override this function to handle additional registry options.

This default implementation fills the run limit member variables

Reimplemented from NC::EventAdderBase.

Definition at line 438 of file NCEventAdder.cxx.

References fSkipMC, and Registry::Get().

00439 {
00440   NC::EventAdderBase::Config(r);
00441 
00442   const char* tmps;
00443   const bool ok = r.Get("LoadExtrapolationsFile", tmps);
00444   fSkipMC = TString(tmps) != "";
00445 
00446   assert(ok);
00447 }


Member Data Documentation

bool NC::RealDataAdder::fSkipMC [protected]

Don't add MC because LoadExtrapolationsFile!="".

Definition at line 167 of file NCEventAdder.h.

Referenced by AddEvents(), and Config().


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

Generated on 24 Jul 2018 for loon by  doxygen 1.6.1