Project
Loading...
Searching...
No Matches
o2::steer::DigitizationContext Class Reference

#include <DigitizationContext.h>

Public Member Functions

 DigitizationContext ()
 
uint32_t getFirstOrbitForSampling () const
 
void setFirstOrbitForSampling (uint32_t o)
 
int getNCollisions () const
 
void setNCollisions (int n)
 
void setMaxNumberParts (int maxp)
 
int getMaxNumberParts () const
 
std::vector< o2::InteractionTimeRecord > & getEventRecords (bool withQED=false)
 
std::vector< std::vector< o2::steer::EventPart > > & getEventParts (bool withQED=false)
 
const std::vector< o2::InteractionTimeRecord > & getEventRecords (bool withQED=false) const
 
const std::vector< std::vector< o2::steer::EventPart > > & getEventParts (bool withQED=false) const
 
std::unordered_map< int, intgetCollisionIndicesForSource (int source) const
 
bool isQEDProvided () const
 
void setBunchFilling (o2::BunchFilling const &bf)
 
const o2::BunchFillinggetBunchFilling () const
 
void setMuPerBC (float m)
 
float getMuPerBC () const
 
float getCalculatedInteractionRate () const
 returns the main (hadronic interaction rate) associated to this digitization context
 
void printCollisionSummary (bool withQED=false, int truncateOutputTo=-1) const
 
void setSimPrefixes (std::vector< std::string > const &p)
 
std::vector< std::string > const & getSimPrefixes () const
 
int findSimPrefix (std::string const &prefix) const
 
void fillQED (std::string_view QEDprefix, int max_events, double qedrate)
 add QED contributions to context, giving prefix; maximal event number and qed interaction rate
 
void fillQED (std::string_view QEDprefix, std::vector< o2::InteractionTimeRecord > const &irecord, int max_events=-1, bool fromKinematics=true)
 
bool initSimChains (o2::detectors::DetID detid, std::vector< TChain * > &simchains) const
 
bool initSimKinematicsChains (std::vector< TChain * > &simkinematicschains) const
 
bool checkVertexCompatibility (bool verbose=false) const
 Check collision parts for vertex consistency.
 
DigitizationContext extractSingleTimeframe (int timeframeid, std::vector< std::tuple< int, int, int > > const &timeframeindices, std::vector< int > const &sources_to_offset)
 
template<typename T >
void retrieveHits (std::vector< TChain * > const &chains, const char *brname, int sourceID, int entryID, std::vector< T > *hits) const
 function reading the hits from a chain (previously initialized with initSimChains
 
o2::parameters::GRPObject const & getGRP () const
 returns the GRP object associated to this context
 
void applyMaxCollisionFilter (std::vector< std::tuple< int, int, int > > &timeframeindices, long startOrbit, long orbitsPerTF, int maxColl, double orbitsEarly=0.)
 
std::vector< std::tuple< int, int, int > > calcTimeframeIndices (long startOrbit, long orbitsPerTF, double orbitsEarly=0.) const
 get timeframe structure --> index markers where timeframe starts/ends/is_influenced_by
 
void sampleInteractionVertices (o2::dataformats::MeanVertexObject const &v)
 
void saveToFile (std::string_view filename) const
 
std::vector< math_utils::Point3D< float > > const & getInteractionVertices () const
 
void setCTPDigits (std::vector< o2::ctp::CTPDigit > const *ctpdigits) const
 
void setDigitizerInteractionRate (float intRate)
 
float getDigitizerInteractionRate () const
 
std::vector< o2::ctp::CTPDigit > const * getCTPDigits () const
 
bool hasTriggerInput () const
 

Static Public Member Functions

static DigitizationContextloadFromFile (std::string_view filename="")
 

Detailed Description

Definition at line 54 of file DigitizationContext.h.

Constructor & Destructor Documentation

◆ DigitizationContext()

o2::steer::DigitizationContext::DigitizationContext ( )
inline

Definition at line 57 of file DigitizationContext.h.

Member Function Documentation

◆ applyMaxCollisionFilter()

void DigitizationContext::applyMaxCollisionFilter ( std::vector< std::tuple< int, int, int > > &  timeframeindices,
long  startOrbit,
long  orbitsPerTF,
int  maxColl,
double  orbitsEarly = 0. 
)

Definition at line 477 of file DigitizationContext.cxx.

◆ calcTimeframeIndices()

std::vector< std::tuple< int, int, int > > DigitizationContext::calcTimeframeIndices ( long  startOrbit,
long  orbitsPerTF,
double  orbitsEarly = 0. 
) const

get timeframe structure --> index markers where timeframe starts/ends/is_influenced_by

Definition at line 578 of file DigitizationContext.cxx.

◆ checkVertexCompatibility()

bool DigitizationContext::checkVertexCompatibility ( bool  verbose = false) const

Check collision parts for vertex consistency.

Definition at line 157 of file DigitizationContext.cxx.

◆ extractSingleTimeframe()

DigitizationContext DigitizationContext::extractSingleTimeframe ( int  timeframeid,
std::vector< std::tuple< int, int, int > > const &  timeframeindices,
std::vector< int > const &  sources_to_offset 
)

retrieves collision context for a single timeframe-id (which may be needed by simulation) (Only copies collision context without QED information. This can be added to the result with the fillQED method in a second step. Takes as input a timeframe indices collection)

Definition at line 673 of file DigitizationContext.cxx.

◆ fillQED() [1/2]

void DigitizationContext::fillQED ( std::string_view  QEDprefix,
int  max_events,
double  qedrate 
)

add QED contributions to context, giving prefix; maximal event number and qed interaction rate

Definition at line 290 of file DigitizationContext.cxx.

◆ fillQED() [2/2]

void DigitizationContext::fillQED ( std::string_view  QEDprefix,
std::vector< o2::InteractionTimeRecord > const &  irecord,
int  max_events = -1,
bool  fromKinematics = true 
)

add QED contributions to context; QEDprefix is prefix of QED production irecord is vector of QED interaction times (sampled externally)

Definition at line 323 of file DigitizationContext.cxx.

◆ findSimPrefix()

int DigitizationContext::findSimPrefix ( std::string const &  prefix) const

Definition at line 605 of file DigitizationContext.cxx.

◆ getBunchFilling()

const o2::BunchFilling & o2::steer::DigitizationContext::getBunchFilling ( ) const
inline

Definition at line 80 of file DigitizationContext.h.

◆ getCalculatedInteractionRate()

float o2::steer::DigitizationContext::getCalculatedInteractionRate ( ) const
inline

returns the main (hadronic interaction rate) associated to this digitization context

Definition at line 86 of file DigitizationContext.h.

◆ getCollisionIndicesForSource()

std::unordered_map< int, int > DigitizationContext::getCollisionIndicesForSource ( int  source) const

Definition at line 589 of file DigitizationContext.cxx.

◆ getCTPDigits()

std::vector< o2::ctp::CTPDigit > const * o2::steer::DigitizationContext::getCTPDigits ( ) const
inline

Definition at line 165 of file DigitizationContext.h.

◆ getDigitizerInteractionRate()

float o2::steer::DigitizationContext::getDigitizerInteractionRate ( ) const
inline

Definition at line 163 of file DigitizationContext.h.

◆ getEventParts() [1/2]

std::vector< std::vector< o2::steer::EventPart > > & o2::steer::DigitizationContext::getEventParts ( bool  withQED = false)
inline

Definition at line 69 of file DigitizationContext.h.

◆ getEventParts() [2/2]

const std::vector< std::vector< o2::steer::EventPart > > & o2::steer::DigitizationContext::getEventParts ( bool  withQED = false) const
inline

Definition at line 72 of file DigitizationContext.h.

◆ getEventRecords() [1/2]

std::vector< o2::InteractionTimeRecord > & o2::steer::DigitizationContext::getEventRecords ( bool  withQED = false)
inline

Definition at line 68 of file DigitizationContext.h.

◆ getEventRecords() [2/2]

const std::vector< o2::InteractionTimeRecord > & o2::steer::DigitizationContext::getEventRecords ( bool  withQED = false) const
inline

Definition at line 71 of file DigitizationContext.h.

◆ getFirstOrbitForSampling()

uint32_t o2::steer::DigitizationContext::getFirstOrbitForSampling ( ) const
inline

Definition at line 59 of file DigitizationContext.h.

◆ getGRP()

o2::parameters::GRPObject const & DigitizationContext::getGRP ( ) const

returns the GRP object associated to this context

Definition at line 217 of file DigitizationContext.cxx.

◆ getInteractionVertices()

std::vector< math_utils::Point3D< float > > const & o2::steer::DigitizationContext::getInteractionVertices ( ) const
inline

Definition at line 150 of file DigitizationContext.h.

◆ getMaxNumberParts()

int o2::steer::DigitizationContext::getMaxNumberParts ( ) const
inline

Definition at line 66 of file DigitizationContext.h.

◆ getMuPerBC()

float o2::steer::DigitizationContext::getMuPerBC ( ) const
inline

Definition at line 83 of file DigitizationContext.h.

◆ getNCollisions()

int o2::steer::DigitizationContext::getNCollisions ( ) const
inline

Definition at line 62 of file DigitizationContext.h.

◆ getSimPrefixes()

std::vector< std::string > const & o2::steer::DigitizationContext::getSimPrefixes ( ) const
inline

Definition at line 92 of file DigitizationContext.h.

◆ hasTriggerInput()

bool o2::steer::DigitizationContext::hasTriggerInput ( ) const
inline

Definition at line 166 of file DigitizationContext.h.

◆ initSimChains()

bool DigitizationContext::initSimChains ( o2::detectors::DetID  detid,
std::vector< TChain * > &  simchains 
) const

Common functions the setup input TChains for reading, given the state (prefixes) encapsulated by this context. The input vector needs to be empty otherwise nothing will be done. return boolean saying if input simchains was modified or not

Definition at line 95 of file DigitizationContext.cxx.

◆ initSimKinematicsChains()

bool DigitizationContext::initSimKinematicsChains ( std::vector< TChain * > &  simkinematicschains) const

Common functions the setup input TChains for reading kinematics information, given the state (prefixes) encapsulated by this context. The input vector needs to be empty otherwise nothing will be done. return boolean saying if input simchains was modified or not

Definition at line 138 of file DigitizationContext.cxx.

◆ isQEDProvided()

bool o2::steer::DigitizationContext::isQEDProvided ( ) const
inline

Definition at line 77 of file DigitizationContext.h.

◆ loadFromFile()

DigitizationContext * DigitizationContext::loadFromFile ( std::string_view  filename = "")
static

Definition at line 277 of file DigitizationContext.cxx.

◆ printCollisionSummary()

void DigitizationContext::printCollisionSummary ( bool  withQED = false,
int  truncateOutputTo = -1 
) const

Definition at line 26 of file DigitizationContext.cxx.

◆ retrieveHits()

template<typename T >
void o2::steer::DigitizationContext::retrieveHits ( std::vector< TChain * > const &  chains,
const char brname,
int  sourceID,
int  entryID,
std::vector< T > *  hits 
) const
inline

function reading the hits from a chain (previously initialized with initSimChains

function reading the hits from a chain (previously initialized with initSimChains The hits pointer will be initialized (what to we do about ownership??)

Definition at line 206 of file DigitizationContext.h.

◆ sampleInteractionVertices()

void DigitizationContext::sampleInteractionVertices ( o2::dataformats::MeanVertexObject const &  v)

Definition at line 625 of file DigitizationContext.cxx.

◆ saveToFile()

void DigitizationContext::saveToFile ( std::string_view  filename) const

Definition at line 227 of file DigitizationContext.cxx.

◆ setBunchFilling()

void o2::steer::DigitizationContext::setBunchFilling ( o2::BunchFilling const &  bf)
inline

Definition at line 79 of file DigitizationContext.h.

◆ setCTPDigits()

void o2::steer::DigitizationContext::setCTPDigits ( std::vector< o2::ctp::CTPDigit > const *  ctpdigits) const
inline

Definition at line 154 of file DigitizationContext.h.

◆ setDigitizerInteractionRate()

void o2::steer::DigitizationContext::setDigitizerInteractionRate ( float  intRate)
inline

Definition at line 162 of file DigitizationContext.h.

◆ setFirstOrbitForSampling()

void o2::steer::DigitizationContext::setFirstOrbitForSampling ( uint32_t  o)
inline

Definition at line 60 of file DigitizationContext.h.

◆ setMaxNumberParts()

void o2::steer::DigitizationContext::setMaxNumberParts ( int  maxp)
inline

Definition at line 65 of file DigitizationContext.h.

◆ setMuPerBC()

void o2::steer::DigitizationContext::setMuPerBC ( float  m)
inline

Definition at line 82 of file DigitizationContext.h.

◆ setNCollisions()

void o2::steer::DigitizationContext::setNCollisions ( int  n)
inline

Definition at line 63 of file DigitizationContext.h.

◆ setSimPrefixes()

void DigitizationContext::setSimPrefixes ( std::vector< std::string > const &  p)

Definition at line 90 of file DigitizationContext.cxx.


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