Belle II Software  release-05-02-19
background modules
Collaboration diagram for background modules:

Classes

class  BeamBkgGeneratorModule
 Beam background generator based on SAD files. More...
 
class  BeamBkgHitRateMonitorModule
 A module to monitor detector hit rates of beam background Output is to a flat ntuple. More...
 
class  BeamBkgMixerModule
 New beam background mixer; this one doesn't need ROF files. More...
 
class  BeamBkgTagSetterModule
 A module that sets m_backgroundTag variable in SimHits (see BackgroundMetaData.h). More...
 
class  BGOverlayExecutorModule
 Overlay of measured background with simulated data (Digits or Clusters) More...
 
class  BGOverlayInputModule
 Beam BG data input, either in form of Digits or raw data. More...
 

Functions

 BeamBkgGeneratorModule ()
 Constructor.
 
virtual ~BeamBkgGeneratorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
int generateEntry () const
 Pick up particle randomly from the SAD file according to its rate. More...
 
 BeamBkgHitRateMonitorModule ()
 Constructor.
 
virtual ~BeamBkgHitRateMonitorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action.
 
virtual void terminate () override
 Termination action. More...
 
bool isEventSelected ()
 event selection More...
 
void collectFileMetaData ()
 Collect file meta data: LFN's, low and high experiment, run and event numbers. More...
 
void setFileMetaData ()
 Set output FileMetaData object. More...
 
 BeamBkgMixerModule ()
 Constructor.
 
virtual ~BeamBkgMixerModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
bool isComponentIncluded (std::vector< std::string > &components, const std::string &component)
 Returns true if a component is found in components or the list is empty. More...
 
void appendSample (BackgroundMetaData::BG_TAG bkgTag, const std::string &bkgType, const std::string &fileName, double realTime, BackgroundMetaData::EFileType fileTyp)
 appends background sample to m_backgrounds More...
 
bool acceptEvent (TClonesArray *cloneArrayECL)
 Checks for deposited energy of ECLHits and returns true if Edep < m_maxEdepECL. More...
 
 BeamBkgTagSetterModule ()
 Constructor.
 
virtual ~BeamBkgTagSetterModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 BGOverlayExecutorModule ()
 Constructor.
 
virtual ~BGOverlayExecutorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 BGOverlayInputModule ()
 Constructor.
 
virtual ~BGOverlayInputModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
bool connectBranches ()
 Connect branches of the given event tree to the data store, except EventMetaData and all relations. More...
 

Detailed Description

Function Documentation

◆ acceptEvent()

bool acceptEvent ( TClonesArray *  cloneArrayECL)
private

Checks for deposited energy of ECLHits and returns true if Edep < m_maxEdepECL.

Parameters
cloneArrayECLpointer to TClonesArray of ECLHits
Returns
true if all ECLHits have deposited energy below m_maxEdepECL

Definition at line 560 of file BeamBkgMixerModule.cc.

561  {
562  if (!cloneArrayECL) return true;
563  if (m_maxEdepECL == 0) return true;
564 
565  int numEntries = cloneArrayECL->GetEntriesFast();
566  for (int i = 0; i < numEntries; i++) {
567  ECLHit* simHit = static_cast<ECLHit*>(cloneArrayECL->AddrAt(i));
568  if (simHit->getEnergyDep() > m_maxEdepECL) return false;
569  }
570  return true;
571  }

◆ appendSample()

void appendSample ( BackgroundMetaData::BG_TAG  bkgTag,
const std::string &  bkgType,
const std::string &  fileName,
double  realTime,
BackgroundMetaData::EFileType  fileTyp 
)
private

appends background sample to m_backgrounds

Parameters
bkgTagbackground tag
bkgTypebackground type
fileNamefile name
realTimereal time that corresponds to background sample
fileTypfile type

Definition at line 538 of file BeamBkgMixerModule.cc.

◆ beginRun() [1/5]

void beginRun ( )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 130 of file BGOverlayInputModule.cc.

131  {
132  }

◆ beginRun() [2/5]

void beginRun ( )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 163 of file BeamBkgGeneratorModule.cc.

164  {
165  }

◆ beginRun() [3/5]

void beginRun ( )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 101 of file BGOverlayExecutorModule.cc.

102  {
103  }

◆ beginRun() [4/5]

void beginRun ( )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 353 of file BeamBkgMixerModule.cc.

◆ beginRun() [5/5]

void beginRun ( )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 127 of file BeamBkgTagSetterModule.cc.

128  {
129  }

◆ collectFileMetaData()

void collectFileMetaData ( )
private

Collect file meta data: LFN's, low and high experiment, run and event numbers.

This code is based on RootOutputModule::event().

Definition at line 299 of file BeamBkgHitRateMonitorModule.cc.

300  {
301  // add file name to the list
302  if (m_fileMetaData.isValid()) {
303  std::string lfn = m_fileMetaData->getLfn();
304  if (not lfn.empty() and (m_parentLfns.empty() or (m_parentLfns.back() != lfn))) {
305  m_parentLfns.push_back(lfn);
306  }
307  }
308 
309  // low and high experiment, run and event numbers
310  unsigned long experiment = m_eventMetaData->getExperiment();
311  unsigned long run = m_eventMetaData->getRun();
312  unsigned long event = m_eventMetaData->getEvent();
313  if (m_experimentLow > m_experimentHigh) { //starting condition
314  m_experimentLow = m_experimentHigh = experiment;
315  m_runLow = m_runHigh = run;
317  } else {
318  if ((experiment < m_experimentLow) or ((experiment == m_experimentLow) and ((run < m_runLow) or ((run == m_runLow)
319  and (event < m_eventLow))))) {
320  m_experimentLow = experiment;
321  m_runLow = run;
322  m_eventLow = event;
323  }
324  if ((experiment > m_experimentHigh) or ((experiment == m_experimentHigh) and ((run > m_runHigh) or ((run == m_runHigh)
325  and (event > m_eventHigh))))) {
326  m_experimentHigh = experiment;
327  m_runHigh = run;
328  m_eventHigh = event;
329  }
330  }
331 
332  }

◆ connectBranches()

bool connectBranches ( )
private

Connect branches of the given event tree to the data store, except EventMetaData and all relations.

Returns
True if the branches are connected successfully.

Definition at line 179 of file BGOverlayInputModule.cc.

◆ endRun() [1/5]

void endRun ( )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 167 of file BGOverlayInputModule.cc.

◆ endRun() [2/5]

void endRun ( )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 233 of file BeamBkgGeneratorModule.cc.

◆ endRun() [3/5]

void endRun ( )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 120 of file BGOverlayExecutorModule.cc.

◆ endRun() [4/5]

void endRun ( )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 502 of file BeamBkgMixerModule.cc.

◆ endRun() [5/5]

void endRun ( )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 178 of file BeamBkgTagSetterModule.cc.

◆ generateEntry()

int generateEntry ( ) const
private

Pick up particle randomly from the SAD file according to its rate.

Returns
TTree entry number

Definition at line 263 of file BeamBkgGeneratorModule.cc.

◆ initialize() [1/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 72 of file BGOverlayInputModule.cc.

◆ initialize() [2/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 74 of file BeamBkgGeneratorModule.cc.

◆ initialize() [3/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 77 of file BGOverlayExecutorModule.cc.

◆ initialize() [4/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 118 of file BeamBkgMixerModule.cc.

◆ initialize() [5/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 122 of file BeamBkgHitRateMonitorModule.cc.

◆ initialize() [6/6]

void initialize ( )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 75 of file BeamBkgTagSetterModule.cc.

◆ isComponentIncluded()

bool isComponentIncluded ( std::vector< std::string > &  components,
const std::string &  component 
)
private

Returns true if a component is found in components or the list is empty.

If found a component is erased from components.

Parameters
componentslist of components to be included
componentthe name of detector component to check
Returns
true if component found in components

Definition at line 525 of file BeamBkgMixerModule.cc.

◆ isEventSelected()

bool isEventSelected ( )
private

event selection

Returns
true if event is selected

Definition at line 277 of file BeamBkgHitRateMonitorModule.cc.

◆ setFileMetaData()

void setFileMetaData ( )
private

Set output FileMetaData object.

This code is based on RootOutputModule::fillFileMetaData().

Definition at line 335 of file BeamBkgHitRateMonitorModule.cc.

◆ terminate() [1/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 171 of file BGOverlayInputModule.cc.

◆ terminate() [2/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 237 of file BeamBkgGeneratorModule.cc.

◆ terminate() [3/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 124 of file BGOverlayExecutorModule.cc.

◆ terminate() [4/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 264 of file BeamBkgHitRateMonitorModule.cc.

◆ terminate() [5/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 506 of file BeamBkgMixerModule.cc.

◆ terminate() [6/6]

void terminate ( )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 182 of file BeamBkgTagSetterModule.cc.

Belle2::BeamBkgHitRateMonitorModule::m_parentLfns
std::vector< std::string > m_parentLfns
Vector of parent file LFNs.
Definition: BeamBkgHitRateMonitorModule.h:161
Belle2::BeamBkgHitRateMonitorModule::m_runLow
unsigned long m_runLow
Lowest run number.
Definition: BeamBkgHitRateMonitorModule.h:163
Belle2::BeamBkgHitRateMonitorModule::m_experimentLow
unsigned long m_experimentLow
Lowest experiment number.
Definition: BeamBkgHitRateMonitorModule.h:162
Belle2::BeamBkgHitRateMonitorModule::m_eventMetaData
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data object
Definition: BeamBkgHitRateMonitorModule.h:127
Belle2::BeamBkgHitRateMonitorModule::m_eventLow
unsigned long m_eventLow
Lowest event number in lowest run.
Definition: BeamBkgHitRateMonitorModule.h:164
Belle2::BeamBkgHitRateMonitorModule::m_runHigh
unsigned long m_runHigh
Highest run number.
Definition: BeamBkgHitRateMonitorModule.h:166
Belle2::BeamBkgHitRateMonitorModule::m_experimentHigh
unsigned long m_experimentHigh
Highest experiment number.
Definition: BeamBkgHitRateMonitorModule.h:165
Belle2::BeamBkgHitRateMonitorModule::event
virtual void event() override
Event processor.
Definition: BeamBkgHitRateMonitorModule.cc:207
Belle2::BeamBkgHitRateMonitorModule::m_fileMetaData
StoreObjPtr< FileMetaData > m_fileMetaData
file metadata
Definition: BeamBkgHitRateMonitorModule.h:129
Belle2::BeamBkgMixerModule::m_maxEdepECL
double m_maxEdepECL
maximal allowed deposited energy in ECL
Definition: BeamBkgMixerModule.h:282
Belle2::BeamBkgHitRateMonitorModule::m_eventHigh
unsigned long m_eventHigh
Highest event number in highest run.
Definition: BeamBkgHitRateMonitorModule.h:167