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

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().

00459 {
00460   if(!fSkipMC) AddEventsToExtrapolations(mod, eventInfo, nearMC);
00461   AddEventsToExtrapolations(mod, eventInfo, nearData);
00462 
00463   if(!fSkipMC){
00464     AddEventsToExtrapolations(mod, eventInfo, farMCTau);
00465     AddEventsToExtrapolations(mod, eventInfo, farMCElectron);
00466     AddEventsToExtrapolations(mod, eventInfo, farMC);
00467   }
00468   AddEventsToExtrapolations(mod, eventInfo, farData);
00469 }

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

Definition at line 474 of file NCEventAdder.cxx.

References NCExtrapolationModule::AddEventToExtrapolations(), LoopRunLimitHelper::AreDone(), ANtpHeaderInfo::dataType, det, ANtpHeaderInfo::detector, NCEventInfo::FillFromChain(), NCEventInfo::header, kFar, kNear, MSG, NC::EventAdderBase::ReportOnEventInfo(), and SimFlag::SimFlag_t.

Referenced by AddEvents().

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

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 NC::EventAdderBase::Config(), 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 Config().


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