Trig::D3PDBunchCrossingTool Class Reference

Stand-alone bunch crossing tool for processing D3PD files. More...

#include <D3PDBunchCrossingTool.h>

Inheritance diagram for Trig::D3PDBunchCrossingTool:
Trig::BunchCrossingToolBase Trig::IBunchCrossingTool asg::AsgMetadataTool asg::IAsgTool asg::AsgTool asg::IAsgTool

List of all members.

Public Member Functions

 D3PDBunchCrossingTool (const std::string &name="D3PDBunchCrossingTool")
 Create a proper constructor for Athena.
Function managing the configuration loaded by the tool



StatusCode cacheConfig (::TTree *metaTree, bool clearCache=true)
 Function caching the information out of the metadata tree.
StatusCode loadConfig (UInt_t configID)
bool isAvailable (UInt_t configID) const
 Function checking if a given configuration key is known.
Functions re-implemented from the IBunchCrossingTool interface



virtual bool isFilled (bcid_type bcid) const
 The simplest query: Is the bunch crossing filled or not?
virtual bool isInTrain (bcid_type bcid) const
 Function deciding if a given bunch crossing is in a filled train.
virtual bool isUnpaired (bcid_type bcid) const
 Function deciding if a given bunch crossing has an unpaired bunch.
virtual bool isBeam1 (bcid_type bcid) const
 Function deciding if there was a bunch from "beam 1" in this bunch crossing.
virtual bool isBeam2 (bcid_type bcid) const
 Function deciding if there was a bunch from "beam 2" in this bunch crossing.
virtual float bcIntensity (bcid_type bcid, BeamType type=Crossing) const
 Function returning the "intensity" of a given bunch crossing.
virtual BunchCrossingType bcType (bcid_type bcid) const
 Get the type of the specific bunch crossing.
virtual std::vector< bool > bunchesInFront (bcid_type bcid, int bunches=10) const
 Function returning whether the previous bunches were filled, and how.
virtual std::vector< bool > bunchesAfter (bcid_type bcid, int bunches=10) const
 Function returning whether the following bunches were filled, and how.
virtual std::vector< float > bunchIntInFront (bcid_type bcid, int bunches=10, BeamType type=Crossing) const
 Function returning the intensities of the bunch crossings before the reference.
virtual std::vector< float > bunchIntAfter (bcid_type bcid, int bunches=10, BeamType type=Crossing) const
 Function returning the intensities of the bunch crossings after the reference.
virtual int gapBeforeBunch (bcid_type bcid, BunchDistanceType dtype=NanoSec, BunchFillType ftype=CollidingBunch) const
 Gap before a particular bunch.
virtual int gapAfterBunch (bcid_type bcid, BunchDistanceType dtype=NanoSec, BunchFillType ftype=CollidingBunch) const
 Gap after a particular bunch.
virtual unsigned int numberOfFilledBunches () const
 Get the number of filled bunches in the current configuration.

Detailed Description

Stand-alone bunch crossing tool for processing D3PD files.

This implementation was designed to be used for processing D3PD files which have the bunch configuration stored in them as metadata.

Each time you open a new D3PD file you need to call the cacheConfig(...) function, and for each event you need to call the loadConfig(...) function. This way the tool is always configured correctly in your analysis. Unfortunately unlike in Athena, there's no way of doing this automatically behing the scenes in this tool...

This tool has no Athena front-end, as it would make no sense.

Author:
Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Revision
639543
Date
2015-01-14 18:51:02 +0100 (Wed, 14 Jan 2015)

Constructor & Destructor Documentation

Trig::D3PDBunchCrossingTool::D3PDBunchCrossingTool ( const std::string &  name = "D3PDBunchCrossingTool"  ) 

Create a proper constructor for Athena.

Default constructor


Member Function Documentation

float Trig::D3PDBunchCrossingTool::bcIntensity ( bcid_type  bcid,
BeamType  type = Crossing 
) const [virtual]

Function returning the "intensity" of a given bunch crossing.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

IBunchCrossingTool::BunchCrossingType Trig::D3PDBunchCrossingTool::bcType ( bcid_type  bcid  )  const [virtual]

Get the type of the specific bunch crossing.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

std::vector< bool > Trig::D3PDBunchCrossingTool::bunchesAfter ( bcid_type  bcid,
int  bunches = 10 
) const [virtual]

Function returning whether the following bunches were filled, and how.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

std::vector< bool > Trig::D3PDBunchCrossingTool::bunchesInFront ( bcid_type  bcid,
int  bunches = 10 
) const [virtual]

Function returning whether the previous bunches were filled, and how.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

std::vector< float > Trig::D3PDBunchCrossingTool::bunchIntAfter ( bcid_type  bcid,
int  bunches = 10,
BeamType  type = Crossing 
) const [virtual]

Function returning the intensities of the bunch crossings after the reference.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

std::vector< float > Trig::D3PDBunchCrossingTool::bunchIntInFront ( bcid_type  bcid,
int  bunches = 10,
BeamType  type = Crossing 
) const [virtual]

Function returning the intensities of the bunch crossings before the reference.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

StatusCode Trig::D3PDBunchCrossingTool::cacheConfig ( ::TTree *  metaTree,
bool  clearCache = true 
)

Function caching the information out of the metadata tree.

This function should be called whenever a new file is opened by the analysis code. It reads in all the information from the metadata TTree into memory in one go, so the users can access the metadata tree however they want after the function is finished.

Parameters:
metaTree Pointer to the metadata tree holding the bunch configuration
clearCache If set to true (default value) then the already known configurations are forgotten by the tool. This is good practice in general to keep the memory consumption of the tool low in a big job.
Returns:
StatusCode::SUCCESS if the caching was successful, or StatusCode::FAILURE otherwise
int Trig::D3PDBunchCrossingTool::gapAfterBunch ( bcid_type  bcid,
BunchDistanceType  dtype = NanoSec,
BunchFillType  ftype = CollidingBunch 
) const [virtual]

Gap after a particular bunch.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

int Trig::D3PDBunchCrossingTool::gapBeforeBunch ( bcid_type  bcid,
BunchDistanceType  dtype = NanoSec,
BunchFillType  ftype = CollidingBunch 
) const [virtual]

Gap before a particular bunch.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

bool Trig::D3PDBunchCrossingTool::isAvailable ( UInt_t  configID  )  const

Function checking if a given configuration key is known.

This function can be used to figure out if a given configuration is available to the tool currently. It is mostly used by the Athena version of the tool to decide when to read in new metadata.

Parameters:
configID The configuration ID that is to be checked
Returns:
true if the configuration is available, false if it's not
bool Trig::D3PDBunchCrossingTool::isBeam1 ( bcid_type  bcid  )  const [virtual]

Function deciding if there was a bunch from "beam 1" in this bunch crossing.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

bool Trig::D3PDBunchCrossingTool::isBeam2 ( bcid_type  bcid  )  const [virtual]

Function deciding if there was a bunch from "beam 2" in this bunch crossing.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

bool Trig::D3PDBunchCrossingTool::isFilled ( bcid_type  bcid  )  const [virtual]

The simplest query: Is the bunch crossing filled or not?

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

bool Trig::D3PDBunchCrossingTool::isInTrain ( bcid_type  bcid  )  const [virtual]

Function deciding if a given bunch crossing is in a filled train.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

bool Trig::D3PDBunchCrossingTool::isUnpaired ( bcid_type  bcid  )  const [virtual]

Function deciding if a given bunch crossing has an unpaired bunch.

Function re-implemented to give meaningful answers for non-pileup MC files as well.

Reimplemented from Trig::BunchCrossingToolBase.

StatusCode Trig::D3PDBunchCrossingTool::loadConfig ( UInt_t  configID  ) 

Function loading a the configuration corresponding to a given configuration ID

This function should be called whenever processing a new D3PD event. It tries to be as smart as possible, to do as little as possible. So it should be safe to call it in every event.

You should yourself read the configuration ID from the event information in the D3PD, and pass that to this function.

Of course you should also not forget about caching the configurations of the current file using cacheConfig(...).

Parameters:
configID The configuration ID of the current event
Returns:
StatusCode::SUCCESS if the loading of the configuration was successful, or StatusCode::FAILURE otherwise
unsigned int Trig::D3PDBunchCrossingTool::numberOfFilledBunches (  )  const [virtual]

Get the number of filled bunches in the current configuration.

In case the tool is not configured correctly (we're processing a non-pileup MC file) it should not report 0 filled bunches, but 1. The override of this function makes sure that this is what happens...

Reimplemented from Trig::BunchCrossingToolBase.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1