NC::MockDataAdder Class Reference

Handles the kind of mock data that comes from special input files. More...

#include <NCEventAdder.h>

Inheritance diagram for NC::MockDataAdder:
NC::EventAdderBase NC::IEventAdder

List of all members.

Public Member Functions

 MockDataAdder ()
virtual ~MockDataAdder ()
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

TString fMockDataSet
int fMockDataSubRun
 which subrun of the MDC do you want to use?

Detailed Description

Handles the kind of mock data that comes from special input files.

The kind that applies random weights to fake data is still handled by NCExtrapolationModule

Definition at line 176 of file NCEventAdder.h.


Constructor & Destructor Documentation

NC::MockDataAdder::MockDataAdder (  ) 

Definition at line 526 of file NCEventAdder.cxx.

00526                                : fMockDataSubRun(-1)
00527 {
00528 }

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

Definition at line 532 of file NCEventAdder.cxx.

00533 {
00534 }


Member Function Documentation

void NC::MockDataAdder::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 555 of file NCEventAdder.cxx.

References AddEventsToExtrapolations().

00563 {
00564   AddEventsToExtrapolations(mod, eventInfo, nearMC);
00565 
00566   AddEventsToExtrapolations(mod, eventInfo, farMCTau);
00567   AddEventsToExtrapolations(mod, eventInfo, farMCElectron);
00568   AddEventsToExtrapolations(mod, eventInfo, farMC);
00569   AddEventsToExtrapolations(mod, eventInfo, farData);
00570 }

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

Definition at line 575 of file NCEventAdder.cxx.

References NCExtrapolationModule::AddEventToExtrapolations(), LoopRunLimitHelper::AreDone(), ANtpHeaderInfo::dataType, det, ANtpHeaderInfo::detector, NCEventInfo::FillFromChain(), NCType::FindFileType(), fMockDataSubRun, NC::EventAdderBase::fRunLimitFarMC, NC::EventAdderBase::fRunLimitNearMC, NCEventInfo::header, Msg::kError, kFar, kMC, NCType::kMockFile, kNear, MSG, NC::EventAdderBase::ReportOnEventInfo(), and ANtpHeaderInfo::subRun.

Referenced by AddEvents().

00578 {
00579   if(chain->GetEntries() < 1){
00580     MSG("NC::MockDataAdder", Msg::kError) << "No entries in chain!" << endl;
00581     return;
00582   }
00583 
00584   eventInfo->FillFromChain(chain, 0);
00585 
00586   using namespace Detector;
00587   using namespace SimFlag;
00588 
00589   const Detector_t det = Detector_t(eventInfo->header->detector);
00590   const SimFlag_t sim = SimFlag_t(eventInfo->header->dataType);
00591   const NCType::EFileType fileType = NCType::FindFileType(eventInfo->header);
00592 
00593   ReportOnEventInfo(eventInfo);
00594 
00595   // The file limit
00596   int limit = INT_MAX;
00597   if(det == kNear && sim == kMC) limit = fRunLimitNearMC;
00598   if(det == kFar  && sim == kMC) limit = fRunLimitFarMC;
00599   assert(limit >= 0);
00600 
00601   const int eventTot = chain->GetEntries();
00602 
00603   LoopRunLimitHelper runLimitHelper(limit, eventTot, eventInfo);
00604 
00605   //loop over the entries in the tree
00606   for(int i = 0; i < eventTot; ++i){
00607     eventInfo->FillFromChain(chain, i);
00608 
00609     const int thisSubRun = eventInfo->header->subRun;
00610 
00611     // For the case of just one mock data subrun, only use the subrun requested
00612     if(fileType == NCType::kMockFile &&
00613        fMockDataSubRun != -1 &&
00614        thisSubRun != fMockDataSubRun) continue;
00615 
00616     if(runLimitHelper.AreDone(i, eventInfo)) break;
00617 
00618     mod->AddEventToExtrapolations(false);
00619     if(det == kNear) mod->AddEventToExtrapolations(true);
00620 
00621   }//end loop over data chain
00622 }

void NC::MockDataAdder::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 538 of file NCEventAdder.cxx.

References fMockDataSet, fMockDataSubRun, and Registry::Get().

00539 {
00540   NC::EventAdderBase::Config(r);
00541 
00542   bool ok = true;
00543 
00544   const char* tmps;
00545   ok = ok && r.Get("MockDataSet", tmps);
00546   fMockDataSet = tmps;
00547 
00548   ok = ok && r.Get("MockDataSubRun", fMockDataSubRun);
00549 
00550   assert(ok);
00551 }


Member Data Documentation

TString NC::MockDataAdder::fMockDataSet [protected]

MDC run number designation (eg "F21910001")

Definition at line 198 of file NCEventAdder.h.

Referenced by Config().

which subrun of the MDC do you want to use?

Set to -1 to use all subruns (ie, sensitivity fit)

Definition at line 202 of file NCEventAdder.h.

Referenced by AddEventsToExtrapolations(), and Config().


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

Generated on 21 Jun 2018 for loon by  doxygen 1.6.1