ATLAS Offline Software
Loading...
Searching...
No Matches
AFPToFAlgorithm Class Reference

#include <AFPToFAlgorithm.h>

Inheritance diagram for AFPToFAlgorithm:
Collaboration diagram for AFPToFAlgorithm:

Public Types

enum class  Environment_t {
  user = 0 , online , tier0 , tier0Raw ,
  tier0ESD , AOD , altprod
}
 Specifies the processing environment. More...
enum class  DataType_t {
  userDefined = 0 , monteCarlo , collisions , cosmics ,
  heavyIonCollisions
}
 Specifies what type of input data is being monitored. More...

Public Member Functions

virtual ~AFPToFAlgorithm ()
virtual StatusCode initialize () override
 initialize
virtual StatusCode fillHistograms (const EventContext &ctx) const override
 adds event to the monitoring histograms
virtual StatusCode fillHistograms_crossBarDeltaT (const xAOD::AFPTrackContainer &, const xAOD::AFPToFHitContainer &) const
 AthMonitorAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
virtual StatusCode execute (const EventContext &ctx) const override
 Applies filters and trigger requirements.
void fill (const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
 Fills a vector of variables to a group by reference.
void fill (const ToolHandle< GenericMonitoringTool > &groupHandle, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
 Fills a vector of variables to a group by reference.
template<typename... T>
void fill (const ToolHandle< GenericMonitoringTool > &groupHandle, T &&... variables) const
 Fills a variadic list of variables to a group by reference.
void fill (std::string_view groupName, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
 Fills a vector of variables to a group by name.
void fill (std::string_view groupName, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
 Fills a vector of variables to a group by name.
template<typename S, typename... T>
requires std::convertible_to<S, std::string_view>
void fill (S &&groupName, T &&... variables) const
 Fills a variadic list of variables to a group by name.
Environment_t environment () const
 Accessor functions for the environment.
Environment_t envStringToEnum (const std::string &str) const
 Convert the environment string from the python configuration to an enum object.
DataType_t dataType () const
 Accessor functions for the data type.
DataType_t dataTypeStringToEnum (const std::string &str) const
 Convert the data type string from the python configuration to an enum object.
const ToolHandle< GenericMonitoringTool > & getGroup (std::string_view name) const
 Get a specific monitoring tool from the tool handle array.
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool () const
 Get the trigger decision tool member.
bool trigChainsArePassed (const std::vector< std::string > &vTrigNames) const
 Check whether triggers are passed.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo (const EventContext &) const
 Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
virtual float lbAverageInteractionsPerCrossing (const EventContext &ctx) const
 Calculate the average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx) const
 Calculate instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx) const
 Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbLuminosityPerBCID (const EventContext &ctx) const
 Calculate the instantaneous luminosity per bunch crossing.
virtual double lbDuration (const EventContext &ctx) const
 Calculate the duration of the luminosity block (in seconds).
virtual float lbAverageLivefraction (const EventContext &ctx) const
 Calculate the average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx) const
 Calculate the live fraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx) const
 Calculate the average integrated luminosity multiplied by the live fraction.
virtual StatusCode parseList (const std::string &line, std::vector< std::string > &result) const
 Parse a string into a vector.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::vector< std::string > m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" }
std::vector< std::string > m_sidesToF = { "sideA", "sideC" }
std::vector< std::string > m_trainsToF = { "T0", "T1" , "T2" , "T3" }
std::vector< std::string > m_barsToF = { "A", "B" , "C" , "D" }
std::vector< std::string > m_chanComb
ToolHandleArray< GenericMonitoringTool > m_tools {this,"GMTools",{}}
 Array of Generic Monitoring Tools.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
 Tool to tell whether a specific trigger is passed.
ToolHandleArray< IDQFilterTool > m_DQFilterTools {this,"FilterTools",{}}
 Array of Data Quality filter tools.
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
SG::ReadCondHandleKey< LBDurationCondData > m_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
SG::ReadCondHandleKey< TrigLiveFractionCondData > m_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"}
AthMonitorAlgorithm::Environment_t m_environment
 Instance of the Environment_t enum.
AthMonitorAlgorithm::DataType_t m_dataType
 Instance of the DataType_t enum.
Gaudi::Property< std::string > m_environmentStr {this,"Environment","user"}
 Environment string pulled from the job option and converted to enum.
Gaudi::Property< std::string > m_dataTypeStr {this,"DataType","userDefined"}
 DataType string pulled from the job option and converted to enum.
Gaudi::Property< std::string > m_triggerChainString {this,"TriggerChain",""}
 Trigger chain string pulled from the job option and parsed into a vector.
std::vector< std::string > m_vTrigChainNames
 Vector of trigger chain names parsed from trigger chain string.
Gaudi::Property< std::string > m_fileKey {this,"FileKey",""}
 Internal Athena name for file.
Gaudi::Property< bool > m_useLumi {this,"EnableLumi",false}
 Allows use of various luminosity functions.
Gaudi::Property< float > m_defaultLBDuration {this,"DefaultLBDuration",60.}
 Default duration of one lumi block.
Gaudi::Property< int > m_detailLevel {this,"DetailLevel",0}
 Sets the level of detail used in the monitoring.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey {this,"EventInfoKey","EventInfo"}
 Key for retrieving EventInfo from StoreGate.

Private Types

typedef std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > MonVarVec_t
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::map< std::string, int > m_StationNamesGroup
std::map< std::string, std::map< std::string, std::map< std::string, int > > > m_BarsInTrains
std::map< std::string, int > m_GroupChanCombDeltaT
std::map< std::string, std::map< std::string, int > > m_SideTrainGroup
std::map< std::string, int > m_SideGroup
SG::ReadHandleKey< xAOD::AFPToFHitContainer > m_afpToFHitContainerKey {this, "AFPToFHitContainer", "AFPToFHitContainer"}
SG::ReadHandleKey< xAOD::AFPTrackContainer > m_afpTrackContainerKey {this, "AFPTrackContainer", "AFPTrackContainer"}
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKeyToF {this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" }
std::string m_name
std::unordered_map< std::string, size_t, CxxUtils::TransparentStringHash, std::equal_to<> > m_toolLookupMap
const ToolHandle< GenericMonitoringTool > m_dummy
Gaudi::Property< bool > m_enforceExpressTriggers
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 19 of file AFPToFAlgorithm.h.

Member Typedef Documentation

◆ MonVarVec_t

typedef std::vector<std::reference_wrapper<Monitored::IMonitoredVariable> > AthMonitorAlgorithm::MonVarVec_t
privateinherited

Definition at line 379 of file AthMonitorAlgorithm.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ DataType_t

enum class AthMonitorAlgorithm::DataType_t
stronginherited

Specifies what type of input data is being monitored.

An enumeration of the different types of data the monitoring application may be running over. This can be used to select which histograms to produce, e.g. to prevent the production of colliding-beam histograms when running on cosmic-ray data. Strings of the same names may be given as jobOptions.

Enumerator
userDefined 
monteCarlo 
collisions 
cosmics 
heavyIonCollisions 

Definition at line 203 of file AthMonitorAlgorithm.h.

203 {
204 userDefined = 0,
205 monteCarlo,
206 collisions,
207 cosmics,
208 heavyIonCollisions,
209 };
AthConfigFlags cosmics(AthConfigFlags flags, str instanceName, str recoMode)

◆ Environment_t

enum class AthMonitorAlgorithm::Environment_t
stronginherited

Specifies the processing environment.

The running environment may be used to select which histograms are produced, and where they are located in the output. For example, the output paths of the histograms are different for the "user", "online" and the various offline flags. Strings of the same names may be given as jobOptions.

Enumerator
user 
online 
tier0 
tier0Raw 
tier0ESD 
AOD 
altprod 

Definition at line 184 of file AthMonitorAlgorithm.h.

184 {
185 user = 0,
186 online,
187 tier0,
188 tier0Raw,
189 tier0ESD,
190 AOD,
191 altprod,
192 };

Constructor & Destructor Documentation

◆ ~AFPToFAlgorithm()

AFPToFAlgorithm::~AFPToFAlgorithm ( )
virtual

Definition at line 15 of file AFPToFAlgorithm.cxx.

15{}

Member Function Documentation

◆ AthMonitorAlgorithm()

AthMonitorAlgorithm::AthMonitorAlgorithm ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Definition at line 49 of file AthMonitorAlgorithm.cxx.

9:AthReentrantAlgorithm(name,pSvcLocator)
10 // Put this here rather than in the header to allow forward-declaring
11 // TrigDecisionTool.
12,m_trigDecTool{this, "TrigDecisionTool",""}
16{}
AthMonitorAlgorithm::DataType_t m_dataType
Instance of the DataType_t enum.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
AthMonitorAlgorithm::Environment_t m_environment
Instance of the Environment_t enum.

◆ dataType()

DataType_t AthMonitorAlgorithm::dataType ( ) const
inlineinherited

Accessor functions for the data type.

Returns
the current value of the class's DataType_t instance.

Definition at line 233 of file AthMonitorAlgorithm.h.

233{ return m_dataType; }

◆ dataTypeStringToEnum()

AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::dataTypeStringToEnum ( const std::string & str) const
inherited

Convert the data type string from the python configuration to an enum object.

Returns
a value in the DataType_t enumeration which matches the input string.

Definition at line 144 of file AthMonitorAlgorithm.cxx.

144 {
145 // convert the string to all lowercase
146 std::string lowerCaseStr = str;
147 std::transform(lowerCaseStr.begin(), lowerCaseStr.end(), lowerCaseStr.begin(), ::tolower);
148
149 // check if it matches one of the enum choices
150 if( lowerCaseStr == "userdefined" ) {
152 } else if( lowerCaseStr == "montecarlo" ) {
154 } else if( lowerCaseStr == "collisions" ) {
156 } else if( lowerCaseStr == "cosmics" ) {
157 return DataType_t::cosmics;
158 } else if( lowerCaseStr == "heavyioncollisions" ) {
160 } else { // otherwise, warn the user and return "userDefined"
161 ATH_MSG_WARNING("AthMonitorAlgorithm::dataTypeStringToEnum(): Unknown data type "
162 <<str<<", returning userDefined.");
164 }
165}
#define ATH_MSG_WARNING(x,...)
void tolower(std::string &s)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ environment()

Environment_t AthMonitorAlgorithm::environment ( ) const
inlineinherited

Accessor functions for the environment.

Returns
the current value of the class's Environment_t instance.

Definition at line 217 of file AthMonitorAlgorithm.h.

217{ return m_environment; }

◆ envStringToEnum()

AthMonitorAlgorithm::Environment_t AthMonitorAlgorithm::envStringToEnum ( const std::string & str) const
inherited

Convert the environment string from the python configuration to an enum object.

Returns
a value in the Environment_t enumeration which matches the input string.

Definition at line 116 of file AthMonitorAlgorithm.cxx.

116 {
117 // convert the string to all lowercase
118 std::string lowerCaseStr = str;
119 std::transform(lowerCaseStr.begin(), lowerCaseStr.end(), lowerCaseStr.begin(), ::tolower);
120
121 // check if it matches one of the enum choices
122 if( lowerCaseStr == "user" ) {
123 return Environment_t::user;
124 } else if( lowerCaseStr == "online" ) {
126 } else if( lowerCaseStr == "tier0" ) {
128 } else if( lowerCaseStr == "tier0raw" ) {
130 } else if( lowerCaseStr == "tier0esd" ) {
132 } else if( lowerCaseStr == "aod" ) {
133 return Environment_t::AOD;
134 } else if( lowerCaseStr == "altprod" ) {
136 } else { // otherwise, warn the user and return "user"
137 ATH_MSG_WARNING("AthMonitorAlgorithm::envStringToEnum(): Unknown environment "
138 <<str<<", returning user.");
139 return Environment_t::user;
140 }
141}

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode AthMonitorAlgorithm::execute ( const EventContext & ctx) const
overridevirtualinherited

Applies filters and trigger requirements.

Then, calls fillHistograms().

Parameters
ctxevent context for reentrant Athena call
Returns
StatusCode

Reimplemented in TrigIDR4Mon.

Definition at line 77 of file AthMonitorAlgorithm.cxx.

77 {
78
79 // Checks that all of the DQ filters are passed. If any one of the filters
80 // fails, return SUCCESS code and do not fill the histograms with the event.
81 for ( const auto& filterItr : m_DQFilterTools ) {
82 if (!filterItr->accept(ctx)) {
83 ATH_MSG_DEBUG("Event rejected due to filter tool.");
84 return StatusCode::SUCCESS;
85 }
86 }
87
88 // Trigger: If there is a decision tool and the chains fail, skip the event.
90 ATH_MSG_DEBUG("Event rejected due to trigger filter.");
91 return StatusCode::SUCCESS;
92 }
93
94 ATH_MSG_DEBUG("Event accepted!");
95 return fillHistograms(ctx);
96}
#define ATH_MSG_DEBUG(x,...)
virtual StatusCode fillHistograms(const EventContext &ctx) const =0
adds event to the monitoring histograms
bool trigChainsArePassed(const std::vector< std::string > &vTrigNames) const
Check whether triggers are passed.
ToolHandleArray< IDQFilterTool > m_DQFilterTools
Array of Data Quality filter tools.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ fillHistograms()

StatusCode AFPToFAlgorithm::fillHistograms ( const EventContext & ctx) const
overridevirtual

adds event to the monitoring histograms

User will overwrite this function. Histogram booking is no longer done in C++. This function is called in execute once the filters are all passed.

Parameters
ctxforwarded from execute
Returns
StatusCode

Implements AthMonitorAlgorithm.

Definition at line 41 of file AFPToFAlgorithm.cxx.

41 {
42 using namespace Monitored;
43
44 const unsigned NTRAINS = 4;
45 const unsigned NBARS = 4;
46 const unsigned NSIDES = 2;
47 enum { FRONT, MIDDLE, END, NPOS } position = NPOS;
48
49 auto bcidAllToF = Monitored::Scalar<int>("bcidAllToF", 0);
50 Monitored::Scalar<int> bcidToF[NPOS] =
51 { Monitored::Scalar<int>("bcidFrontToF", 0),
52 Monitored::Scalar<int>("bcidMiddleToF", 0),
53 Monitored::Scalar<int>("bcidEndToF", 0) };
54
55 // Declare the quantities which should be monitored
56 auto lb = Monitored::Scalar<int>("lb", 0);
57 auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
58 auto trainID = Monitored::Scalar<int>("trainID", 0);
59 auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0);
60
61 auto ToFHits_MU_Weight = Monitored::Scalar<float>("ToFHits_MU_Weight", 0.0);
62 auto muPerBXToF = Monitored::Scalar<float>("muPerBXToF", 0.0);
63
64 auto numberOfHit = Monitored::Scalar<int>("numberOfHit", 0);
65 auto barInTrainIDSide = Monitored::Scalar<int>("barInTrainIDSide", 0);
66 auto barInTrainAll = Monitored::Scalar<int>("barInTrainAll", 0);
67 auto ToFHits_side = Monitored::Scalar<int>("ToFHits_side", 0);
68
69 auto lbAandCToFEvents = Monitored::Scalar<int>("lbAandCToFEvents", 0);
70 Monitored::Scalar<int> lbToFEvents[NSIDES] =
71 { Monitored::Scalar<int>("lbAToFEvents", 0),
72 Monitored::Scalar<int>("lbCToFEvents", 0) };
73
74 // per-mu TH1F variables
75 auto lbToFTrainAll = Monitored::Scalar<int>("lbToFTrainAll", 0);
76 auto weightToFTrainAll = Monitored::Scalar<float>("weightToFTrainAll", 0.0);
77 auto lbToFTrainFront = Monitored::Scalar<int>("lbToFTrainFront", 0);
78 auto weightToFTrainFront = Monitored::Scalar<float>("weightToFTrainFront", 0.0);
79 auto lbToFTrainMiddle = Monitored::Scalar<int>("lbToFTrainMiddle", 0);
80 auto weightToFTrainMiddle = Monitored::Scalar<float>("weightToFTrainMiddle", 0.0);
81 auto lbToFTrainEnd = Monitored::Scalar<int>("lbToFTrainEnd", 0);
82 auto weightToFTrainEnd = Monitored::Scalar<float>("weightToFTrainEnd", 0.0);
83 auto lbToFBar = Monitored::Scalar<int>("lbToFBar", 0);
84 auto lbToFBar_Weight = Monitored::Scalar<float>("lbToFBar_Weight", 0.0);
85
86 SG::ReadHandle<xAOD::EventInfo> eventInfo = GetEventInfo(ctx);
87 lb = eventInfo->lumiBlock();
88 lbAandCToFEvents = eventInfo->lumiBlock();
89 muPerBXToF = lbAverageInteractionsPerCrossing(ctx);
90
91 if (muPerBXToF == 0.0) {
92 ATH_MSG_DEBUG("AverageInteractionsPerCrossing is 0, forcing to 1.0");
93 muPerBXToF=1.0;
94 }
95
96 ToFHits_MU_Weight = 1/muPerBXToF;
97 lbToFBar_Weight = 1/muPerBXToF;
98 weightToFTrainAll = 1/muPerBXToF;
99 weightToFTrainFront = 1/muPerBXToF;
100 weightToFTrainMiddle = 1/muPerBXToF;
101 weightToFTrainEnd = 1/muPerBXToF;
102
103 for(unsigned int s = 0; s < NSIDES; s++)
104 {
105 lbToFEvents[s] = eventInfo->lumiBlock();
106 }
107
108 fill("AFPToFTool", lb, muPerBXToF);
109
110 // BCX handler
111 const unsigned int tempBCID = eventInfo->bcid();
112 SG::ReadCondHandle<BunchCrossingCondData> bcidHdlToF(m_bunchCrossingKeyToF,ctx);
113 if (!bcidHdlToF.isValid()) {
114 ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object (ToF)" );
115 }
116 const BunchCrossingCondData* bcDataToF{*bcidHdlToF};
117
118 // Classifying bunches by position in train (Front, Middle, End)
119 if(bcDataToF->isFilled(tempBCID))
120 {
121 bcidAllToF = tempBCID;
122 fill("AFPToFTool", bcidAllToF);
123 if(!bcDataToF->isFilled(tempBCID-1))
124 {
125 position = FRONT;
126 }
127 else if(bcDataToF->isFilled(tempBCID+1))
128 {
129 position = MIDDLE;
130 }
131 else
132 {
133 position = END;
134 }
135 bcidToF[position] = tempBCID;
136 fill("AFPToFTool", bcidToF[position]);
137 }
138
139
140 SG::ReadHandle<xAOD::AFPToFHitContainer> afpToFHitContainer(m_afpToFHitContainerKey, ctx);
141 if(! afpToFHitContainer.isValid())
142 {
143 ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpToFHitContainerKey);
144 return StatusCode::SUCCESS;
145 }
146
147 ATH_CHECK( afpToFHitContainer.initialize() );
148
149 SG::ReadHandle<xAOD::AFPTrackContainer> afpTrackContainer( m_afpTrackContainerKey, ctx );
150 if ( !afpTrackContainer.isValid() ) {
151 ATH_MSG_WARNING( "evtStore() does not contain hits collection with name " << m_afpTrackContainerKey );
152 return StatusCode::SUCCESS;
153 }
154 ATH_CHECK( afpTrackContainer.initialize() );
155
156 nTofHits = afpToFHitContainer->size();
157 fill("AFPToFTool", lb, nTofHits);
158
159 int eventsInStations[4] = {};
160
161 // hit counts per event for TProfile
162 unsigned int totalHitsPerTrainAll[NSIDES][NTRAINS] = {};
163 unsigned int totalHitsPerTrainFME[NSIDES][NTRAINS][NPOS] = {};
164 unsigned int totalHitsPerBar[NSIDES][NTRAINS][NBARS] = {};
165 unsigned int totalStationHits[NSIDES] = {};
166
167 for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
168 {
169 if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->trainID()<4 && hitsItr->trainID()>=0 && hitsItr->barInTrainID()<4 && hitsItr->barInTrainID()>=0)
170 {
171 trainID = hitsItr->trainID();
172 barInTrainID = hitsItr->barInTrainID();
173 ++eventsInStations[hitsItr->stationID()];
174
175 // Only process ToF stations: 0 (farAside) and 3 (farCside)
176 if(hitsItr->stationID() != 0 && hitsItr->stationID() != 3)
177 continue;
178
179 int side = (hitsItr->stationID() == 3) ? 1 : 0;
180 unsigned int train = hitsItr->trainID();
181 unsigned int bar = hitsItr->barInTrainID();
182
183 numberOfHit = train;
184 fill(m_tools[m_SideGroup.at(m_sidesToF.at(side))], numberOfHit);
185
186 barInTrainIDSide = bar;
187 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], barInTrainIDSide);
188
189 barInTrainAll = train * 4 + bar;
190 fill(m_tools[m_SideGroup.at(m_sidesToF.at(side))], barInTrainAll);
191
192 ToFHits_side = eventInfo->lumiBlock();
193 fill(m_tools[m_SideGroup.at(m_sidesToF.at(side))], ToFHits_side, ToFHits_MU_Weight);
194
195 fill(m_tools[m_StationNamesGroup.at(m_stationNamesToF.at(hitsItr->stationID()))], barInTrainID, trainID);
196
197 // per-mu TH1F per-bar
198 lbToFBar = eventInfo->lumiBlock();
199 fill(m_tools[m_BarsInTrains.at(m_sidesToF.at(side)).at(m_trainsToF.at(train)).at(m_barsToF.at(bar))], lbToFBar, lbToFBar_Weight);
200
201 // Accumulate counts for TProfile
202 ++totalStationHits[side];
203 ++totalHitsPerTrainAll[side][train];
204 if(bar < NBARS) ++totalHitsPerBar[side][train][bar];
205 if(position != NPOS) ++totalHitsPerTrainFME[side][train][position];
206
207 // per-mu TH1F: fill per-train
208 lbToFTrainAll = eventInfo->lumiBlock();
209 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFTrainAll, weightToFTrainAll);
210
211 if(position == FRONT)
212 {
213 lbToFTrainFront = eventInfo->lumiBlock();
214 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFTrainFront, weightToFTrainFront);
215 }
216 else if(position == MIDDLE)
217 {
218 lbToFTrainMiddle = eventInfo->lumiBlock();
219 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFTrainMiddle, weightToFTrainMiddle);
220 }
221 else if(position == END)
222 {
223 lbToFTrainEnd = eventInfo->lumiBlock();
224 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFTrainEnd, weightToFTrainEnd);
225 }
226
227 }
228 }
229
230 // Events histograms
231 if(eventsInStations[0] > 0 || eventsInStations[3] > 0)
232 {
233 fill("AFPToFTool", lbAandCToFEvents);
234
235 if(eventsInStations[0] > 0)
236 {
237 fill("AFPToFTool", lbToFEvents[0]);
238 }
239 if(eventsInStations[3] > 0)
240 {
241 fill("AFPToFTool", lbToFEvents[1]);
242 }
243 }
244
245 // per-event TProfile per-train
246 auto lbToFPerEvent = Monitored::Scalar<int>("lbToFPerEvent", eventInfo->lumiBlock());
247 auto hitsPerTrainAllPP = Monitored::Scalar<float>("hitsPerTrainAllPP", 0.0);
248 auto lbToFPerEventFront = Monitored::Scalar<int>("lbToFPerEventFront", eventInfo->lumiBlock());
249 auto hitsPerTrainFrontPP = Monitored::Scalar<float>("hitsPerTrainFrontPP", 0.0);
250 auto lbToFPerEventMiddle = Monitored::Scalar<int>("lbToFPerEventMiddle", eventInfo->lumiBlock());
251 auto hitsPerTrainMiddlePP = Monitored::Scalar<float>("hitsPerTrainMiddlePP", 0.0);
252 auto lbToFPerEventEnd = Monitored::Scalar<int>("lbToFPerEventEnd", eventInfo->lumiBlock());
253 auto hitsPerTrainEndPP = Monitored::Scalar<float>("hitsPerTrainEndPP", 0.0);
254
255 for(unsigned int side = 0; side < NSIDES; side++)
256 {
257 for(unsigned int train = 0; train < NTRAINS; train++)
258 {
259 hitsPerTrainAllPP = totalHitsPerTrainAll[side][train] / muPerBXToF;
260 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFPerEvent, hitsPerTrainAllPP);
261
262 hitsPerTrainFrontPP = totalHitsPerTrainFME[side][train][FRONT] / muPerBXToF;
263 if(position == FRONT)
264 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFPerEventFront, hitsPerTrainFrontPP);
265
266 hitsPerTrainMiddlePP = totalHitsPerTrainFME[side][train][MIDDLE] / muPerBXToF;
267 if(position == MIDDLE)
268 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFPerEventMiddle, hitsPerTrainMiddlePP);
269
270 hitsPerTrainEndPP = totalHitsPerTrainFME[side][train][END] / muPerBXToF;
271 if(position == END)
272 fill(m_tools[m_SideTrainGroup.at(m_sidesToF.at(side)).at(m_trainsToF.at(train))], lbToFPerEventEnd, hitsPerTrainEndPP);
273 }
274 }
275
276 // per-event TProfile per-bar
277 auto lbToFBarPerEvent = Monitored::Scalar<int>("lbToFBarPerEvent", eventInfo->lumiBlock());
278 auto hitsPerBarPP = Monitored::Scalar<float>("hitsPerBarPP", 0.0);
279
280 for(unsigned int side = 0; side < NSIDES; side++)
281 {
282 for(unsigned int train = 0; train < NTRAINS; train++)
283 {
284 for(unsigned int bar = 0; bar < NBARS; bar++)
285 {
286 hitsPerBarPP = totalHitsPerBar[side][train][bar] / muPerBXToF;
287 fill(m_tools[m_BarsInTrains.at(m_sidesToF.at(side)).at(m_trainsToF.at(train)).at(m_barsToF.at(bar))], lbToFBarPerEvent, hitsPerBarPP);
288 }
289 }
290 }
291
292 // per-event TProfile station-level
293 auto lbToFStationPerEvent = Monitored::Scalar<int>("lbToFStationPerEvent", eventInfo->lumiBlock());
294 auto hitsPerStationPP = Monitored::Scalar<float>("hitsPerStationPP", 0.0);
295
296 for(unsigned int side = 0; side < NSIDES; side++)
297 {
298 hitsPerStationPP = totalStationHits[side] / muPerBXToF;
299 fill(m_tools[m_SideGroup.at(m_sidesToF.at(side))], lbToFStationPerEvent, hitsPerStationPP);
300 }
301
302 return fillHistograms_crossBarDeltaT(*afpTrackContainer, *afpToFHitContainer);
303}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
std::vector< std::string > m_barsToF
virtual StatusCode fillHistograms_crossBarDeltaT(const xAOD::AFPTrackContainer &, const xAOD::AFPToFHitContainer &) const
SG::ReadHandleKey< xAOD::AFPToFHitContainer > m_afpToFHitContainerKey
std::vector< std::string > m_trainsToF
std::vector< std::string > m_sidesToF
SG::ReadHandleKey< xAOD::AFPTrackContainer > m_afpTrackContainerKey
std::map< std::string, std::map< std::string, int > > m_SideTrainGroup
std::map< std::string, int > m_SideGroup
std::vector< std::string > m_stationNamesToF
std::map< std::string, int > m_StationNamesGroup
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKeyToF
std::map< std::string, std::map< std::string, std::map< std::string, int > > > m_BarsInTrains
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
int lb
Definition globals.cxx:23
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx) const
Calculate the average mu, i.e.
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
AFPToFHit_v1 AFPToFHit
Definition AFPToFHit.h:12

◆ fillHistograms_crossBarDeltaT()

StatusCode AFPToFAlgorithm::fillHistograms_crossBarDeltaT ( const xAOD::AFPTrackContainer & afpTrackContainer,
const xAOD::AFPToFHitContainer & afpToFHitContainer ) const
virtual

Definition at line 305 of file AFPToFAlgorithm.cxx.

307 {
308 // Initialize monitored variables for histogram filling
309 Monitored::Scalar<float> crossBarDeltaT[2] = {
310 Monitored::Scalar<float>( "crossBarDeltaT_A", 0.0 ),
311 Monitored::Scalar<float>( "crossBarDeltaT_C", 0.0 )
312 };
313
314 bool channel_present[2][16] = {};
315 bool multihit[2] = {};
316 std::size_t track_count[2] = {};
317 std::size_t train_count[2][4] = {};
318
319 for (const xAOD::AFPTrack* tracksItr : afpTrackContainer)
320 {
321 const auto side = tracksItr->stationID() == 3;
322 // Ignore tracks that are not from FAR stations
323 if (tracksItr->stationID() != 0 && tracksItr->stationID() != 3)
324 continue;
325 ++track_count[side];
326 }
327
328 // Load the necessary information
329 auto times = std::vector<std::vector<std::vector<float>>>(2, std::vector<std::vector<float>>(4, std::vector<float>(4, -10000)));
330 for (const xAOD::AFPToFHit* hitsItr : afpToFHitContainer)
331 {
332 const auto side = hitsItr->stationID() == 3;
333 const auto train = hitsItr->trainID();
334 const auto bar = hitsItr->barInTrainID();
335 const auto channel = 4 * train + bar;
336 const auto tof_time = hitsItr->time();
337 const auto TimePs=(tof_time)*1000;
338 //Cut on only 1 SiT track in the monitored station
339 if (track_count[side] != 1) continue;
340 // Ignore hits with an impossible origin
341 if (hitsItr->stationID() != 0 && hitsItr->stationID() != 3)
342 continue;
343 if (train < 0 || train >= 4 || bar < 0 || bar >= 4) continue;
344 if (channel_present[side][channel])
345 multihit[side] = true;
346 channel_present[side][channel] = true;
347 ++train_count[side][train];
348
349 times[side][train][bar]=TimePs;
350
351 }
352
353 for (uint8_t side : {0, 1})
354 {
355 // Cut on only 1 SiT track in the monitored station
356 if (track_count[side] != 1) continue;
357 // Cut on maximum of 1 hit in each ToF channel
358 if (multihit[side]) continue;
359 //Cut on maximum 1 train per event
360 uint8_t multrain[2] = {};
361 for (uint8_t train = 0; train < 4; ++train) {
362 if (train_count[side][train]>1) {
363 ++multrain[side];
364 }
365 }
366 if (multrain[side]>1) continue;
367 //fill histos
368 for (uint8_t train = 0; train < 4; ++train) {
369 for (uint8_t bar1 = 0; bar1 < 4; ++bar1) {
370 for (uint8_t bar2 = 0; bar2 < 4; ++bar2) {
371 if (bar2>bar1) {
372 int comb = bar1*bar2+bar2-1;
373 if (comb==5) {comb=4;}
374 if (comb==8) {comb=5;}
375 int global_comb = train*6 + comb;
376 if (times[side][train][bar1]>-10000 && times[side][train][bar2]>-10000) {
377 crossBarDeltaT[side] = (times[side][train][bar1] - times[side][train][bar2]);
378 fill(m_tools[m_GroupChanCombDeltaT.at(m_chanComb.at(global_comb))], crossBarDeltaT[side]);
379 }
380 }
381 }
382 }
383 }
384 }
385
386 return StatusCode::SUCCESS;
387}
std::map< std::string, int > m_GroupChanCombDeltaT
std::vector< std::string > m_chanComb
AFPTrack_v2 AFPTrack
Definition AFPTrack.h:12

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ GetEventInfo()

SG::ReadHandle< xAOD::EventInfo > AthMonitorAlgorithm::GetEventInfo ( const EventContext & ctx) const
inherited

Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).

Parameters
ctxEventContext for the event
Returns
a SG::ReadHandle<xAOD::EventInfo>

Definition at line 111 of file AthMonitorAlgorithm.cxx.

111 {
112 return SG::ReadHandle<xAOD::EventInfo>(m_EventInfoKey, ctx);
113}
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Key for retrieving EventInfo from StoreGate.

◆ getGroup()

const ToolHandle< GenericMonitoringTool > & AthMonitorAlgorithm::getGroup ( std::string_view name) const
inherited

Get a specific monitoring tool from the tool handle array.

Finds a specific GenericMonitoringTool instance from the list of monitoring tools (a ToolHandleArray). Throws a FATAL warning if the object found is empty.

Parameters
namestring name of the desired tool
Returns
reference to the desired monitoring tool

Definition at line 168 of file AthMonitorAlgorithm.cxx.

168 {
169 // get the pointer to the tool, and check that it exists
170 auto idx = m_toolLookupMap.find(name);
171 //Check if the tool exists in the map
172 if (idx != m_toolLookupMap.end()) [[likely]] {
173 return m_tools[idx->second];
174 }
175 else {
176 //Check if the map is empty
177 if (m_toolLookupMap.empty()) {
178 ATH_MSG_FATAL("The m_toolLookupMap is empty. The tool " << name << " cannot be found in an empty map.");
179 return m_dummy;
180 }
181 //If the map is not empty and the tool was not found, print a fatal error
182 if (!m_toolLookupMap.empty()) {
183 std::string available = std::accumulate(
184 m_toolLookupMap.begin(), m_toolLookupMap.end(), std::string(""),
185 [](const std::string& s, auto h) { return s + "," + h.first; });
186 ATH_MSG_FATAL("The tool " << name << " could not be found in the tool array of the "
187 << "monitoring algorithm " << m_name << ". This probably reflects a discrepancy between "
188 << "your python configuration and c++ filling code. Note: your available groups are {"
189 << available << "}.");
190
191 return m_dummy;
192 }
193 if (!isInitialized()) {
195 "It seems that the AthMonitorAlgorithm::initialize was not called "
196 "in derived class initialize method, group name: " << name);
197 }
198 }
199 return m_dummy;
200}
#define ATH_MSG_FATAL(x,...)
const ToolHandle< GenericMonitoringTool > m_dummy
std::unordered_map< std::string, size_t, CxxUtils::TransparentStringHash, std::equal_to<> > m_toolLookupMap
#define likely(x)

◆ getTrigDecisionTool()

const ToolHandle< Trig::TrigDecisionTool > & AthMonitorAlgorithm::getTrigDecisionTool ( ) const
inherited

Get the trigger decision tool member.

The trigger decision tool is used to check whether a specific trigger is passed by an event.

Returns
m_trigDecTool

Definition at line 203 of file AthMonitorAlgorithm.cxx.

203 {
204 return m_trigDecTool;
205}

◆ initialize()

StatusCode AFPToFAlgorithm::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 18 of file AFPToFAlgorithm.cxx.

18 {
19 using namespace Monitored;
20
21 m_StationNamesGroup = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
22 m_BarsInTrains = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools, "AFPToFTool", m_sidesToF, m_trainsToF, m_barsToF);
23 m_GroupChanCombDeltaT = buildToolMap<int>(m_tools, "AFPToFTool", m_chanComb);
24 m_SideTrainGroup = buildToolMap<std::map<std::string,int>>(m_tools, "AFPToFTool", m_sidesToF, m_trainsToF);
25 m_SideGroup = buildToolMap<int>(m_tools, "AFPToFTool", m_sidesToF);
26
27 // We must declare to the framework in initialize what SG objects we are going to use
28 SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
30 SG::ReadHandleKey<xAOD::AFPTrackContainer> afpTrackContainerKey( "AFPTracks" );
31 ATH_CHECK( m_afpTrackContainerKey.initialize() );
32
33 ATH_MSG_INFO( "BunchCrossingKey initialization (ToF)" );
34 ATH_CHECK(m_bunchCrossingKeyToF.initialize());
35 ATH_MSG_INFO( "initialization completed (ToF)" );
36
38}
#define ATH_MSG_INFO(x,...)
virtual StatusCode initialize() override
initialize

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ parseList()

StatusCode AthMonitorAlgorithm::parseList ( const std::string & line,
std::vector< std::string > & result ) const
virtualinherited

Parse a string into a vector.

The input string is a single long string of all of the trigger names. It parses this string and turns it into a vector, where each element is one trigger or trigger category.

Parameters
lineThe input string.
resultThe parsed output vector of strings.
Returns
StatusCode

Definition at line 350 of file AthMonitorAlgorithm.cxx.

350 {
351 std::string item;
352 std::stringstream ss(line);
353
354 ATH_MSG_DEBUG( "AthMonitorAlgorithm::parseList()" );
355
356 while ( std::getline(ss, item, ',') ) {
357 std::stringstream iss(item); // remove whitespace
358 iss >> item;
359 result.push_back(item);
360 }
361
362 return StatusCode::SUCCESS;
363}
static Double_t ss

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ trigChainsArePassed()

bool AthMonitorAlgorithm::trigChainsArePassed ( const std::vector< std::string > & vTrigNames) const
inherited

Check whether triggers are passed.

For the event, use the trigger decision tool to check that at least one of the triggers listed in the supplied vector is passed.

Parameters
vTrigNamesList of trigger names.
Returns
If empty input, default to true. If at least one trigger is specified, returns whether at least one trigger was passed.

Definition at line 208 of file AthMonitorAlgorithm.cxx.

208 {
209
210
211 // If no triggers were given, return true.
212 if (vTrigNames.empty()) return true;
213
214
215 // Trigger: Check if this Algorithm is being run as an Express Stream job.
216 // Events are entering the express stream are chosen randomly, and by chain,
217 // Hence an additional check should be aplied to see if the chain(s)
218 // monitored here are responsible for the event being selected for
219 // the express stream.
220
221 const auto group = m_trigDecTool->getChainGroup(vTrigNames);
223 const auto passedBits = m_trigDecTool->isPassedBits(group);
224 bool expressPass = passedBits & TrigDefs::Express_passed; //bitwise AND
225 if(!expressPass) {
226 return false;
227 }
228 }
229
230 // monitor the event if any of the chains in the chain group passes the event.
231 return group->isPassed();
232
233}
Gaudi::Property< bool > m_enforceExpressTriggers

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_afpToFHitContainerKey

SG::ReadHandleKey<xAOD::AFPToFHitContainer> AFPToFAlgorithm::m_afpToFHitContainerKey {this, "AFPToFHitContainer", "AFPToFHitContainer"}
private

Definition at line 33 of file AFPToFAlgorithm.h.

33{this, "AFPToFHitContainer", "AFPToFHitContainer"};

◆ m_afpTrackContainerKey

SG::ReadHandleKey<xAOD::AFPTrackContainer> AFPToFAlgorithm::m_afpTrackContainerKey {this, "AFPTrackContainer", "AFPTrackContainer"}
private

Definition at line 34 of file AFPToFAlgorithm.h.

34{this, "AFPTrackContainer", "AFPTrackContainer"};

◆ m_BarsInTrains

std::map<std::string,std::map<std::string,std::map<std::string,int> > > AFPToFAlgorithm::m_BarsInTrains
private

Definition at line 29 of file AFPToFAlgorithm.h.

◆ m_barsToF

std::vector<std::string> AFPToFAlgorithm::m_barsToF = { "A", "B" , "C" , "D" }
protected

Definition at line 41 of file AFPToFAlgorithm.h.

41{ "A", "B" , "C" , "D" };

◆ m_bunchCrossingKeyToF

SG::ReadCondHandleKey<BunchCrossingCondData> AFPToFAlgorithm::m_bunchCrossingKeyToF {this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" }
private

Definition at line 35 of file AFPToFAlgorithm.h.

35{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };

◆ m_chanComb

std::vector<std::string> AFPToFAlgorithm::m_chanComb
protected
Initial value:
= {
"0AB", "0AC", "0AD", "0BC", "0BD", "0CD",
"1AB", "1AC", "1AD", "1BC", "1BD", "1CD",
"2AB", "2AC", "2AD", "2BC", "2BD", "2CD",
"3AB", "3AC", "3AD", "3BC", "3BD", "3CD"}

Definition at line 43 of file AFPToFAlgorithm.h.

43 {
44 "0AB", "0AC", "0AD", "0BC", "0BD", "0CD",
45 "1AB", "1AC", "1AD", "1BC", "1BD", "1CD",
46 "2AB", "2AC", "2AD", "2BC", "2BD", "2CD",
47 "3AB", "3AC", "3AD", "3BC", "3BD", "3CD"};

◆ m_dataType

AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::m_dataType
protectedinherited

Instance of the DataType_t enum.

Definition at line 365 of file AthMonitorAlgorithm.h.

◆ m_dataTypeStr

Gaudi::Property<std::string> AthMonitorAlgorithm::m_dataTypeStr {this,"DataType","userDefined"}
protectedinherited

DataType string pulled from the job option and converted to enum.

Definition at line 367 of file AthMonitorAlgorithm.h.

367{this,"DataType","userDefined"};

◆ m_defaultLBDuration

Gaudi::Property<float> AthMonitorAlgorithm::m_defaultLBDuration {this,"DefaultLBDuration",60.}
protectedinherited

Default duration of one lumi block.

Definition at line 374 of file AthMonitorAlgorithm.h.

374{this,"DefaultLBDuration",60.};

◆ m_detailLevel

Gaudi::Property<int> AthMonitorAlgorithm::m_detailLevel {this,"DetailLevel",0}
protectedinherited

Sets the level of detail used in the monitoring.

Definition at line 375 of file AthMonitorAlgorithm.h.

375{this,"DetailLevel",0};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_DQFilterTools

ToolHandleArray<IDQFilterTool> AthMonitorAlgorithm::m_DQFilterTools {this,"FilterTools",{}}
protectedinherited

Array of Data Quality filter tools.

Definition at line 355 of file AthMonitorAlgorithm.h.

355{this,"FilterTools",{}};

◆ m_dummy

const ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::m_dummy
privateinherited

Definition at line 383 of file AthMonitorAlgorithm.h.

◆ m_enforceExpressTriggers

Gaudi::Property<bool> AthMonitorAlgorithm::m_enforceExpressTriggers
privateinherited
Initial value:
{this,
"EnforceExpressTriggers", false,
"Requires that matched triggers made the event enter the express stream"}

Definition at line 386 of file AthMonitorAlgorithm.h.

386 {this,
387 "EnforceExpressTriggers", false,
388 "Requires that matched triggers made the event enter the express stream"};

◆ m_environment

AthMonitorAlgorithm::Environment_t AthMonitorAlgorithm::m_environment
protectedinherited

Instance of the Environment_t enum.

Definition at line 364 of file AthMonitorAlgorithm.h.

◆ m_environmentStr

Gaudi::Property<std::string> AthMonitorAlgorithm::m_environmentStr {this,"Environment","user"}
protectedinherited

Environment string pulled from the job option and converted to enum.

Definition at line 366 of file AthMonitorAlgorithm.h.

366{this,"Environment","user"};

◆ m_EventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> AthMonitorAlgorithm::m_EventInfoKey {this,"EventInfoKey","EventInfo"}
protectedinherited

Key for retrieving EventInfo from StoreGate.

Definition at line 376 of file AthMonitorAlgorithm.h.

376{this,"EventInfoKey","EventInfo"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fileKey

Gaudi::Property<std::string> AthMonitorAlgorithm::m_fileKey {this,"FileKey",""}
protectedinherited

Internal Athena name for file.

Definition at line 372 of file AthMonitorAlgorithm.h.

372{this,"FileKey",""};

◆ m_GroupChanCombDeltaT

std::map<std::string,int> AFPToFAlgorithm::m_GroupChanCombDeltaT
private

Definition at line 30 of file AFPToFAlgorithm.h.

◆ m_lbDurationDataKey

SG::ReadCondHandleKey<LBDurationCondData> AthMonitorAlgorithm::m_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
protectedinherited

Definition at line 359 of file AthMonitorAlgorithm.h.

360{this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"};

◆ m_lumiDataKey

SG::ReadCondHandleKey<LuminosityCondData> AthMonitorAlgorithm::m_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
protectedinherited

Definition at line 357 of file AthMonitorAlgorithm.h.

358{this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"};

◆ m_name

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 380 of file AthMonitorAlgorithm.h.

◆ m_SideGroup

std::map<std::string,int> AFPToFAlgorithm::m_SideGroup
private

Definition at line 32 of file AFPToFAlgorithm.h.

◆ m_sidesToF

std::vector<std::string> AFPToFAlgorithm::m_sidesToF = { "sideA", "sideC" }
protected

Definition at line 39 of file AFPToFAlgorithm.h.

39{ "sideA", "sideC" };

◆ m_SideTrainGroup

std::map<std::string,std::map<std::string,int> > AFPToFAlgorithm::m_SideTrainGroup
private

Definition at line 31 of file AFPToFAlgorithm.h.

◆ m_StationNamesGroup

std::map<std::string,int> AFPToFAlgorithm::m_StationNamesGroup
private

Definition at line 28 of file AFPToFAlgorithm.h.

◆ m_stationNamesToF

std::vector<std::string> AFPToFAlgorithm::m_stationNamesToF = { "farAside", "nearAside" , "nearCside" , "farCside" }
protected

Definition at line 38 of file AFPToFAlgorithm.h.

38{ "farAside", "nearAside" , "nearCside" , "farCside" };

◆ m_toolLookupMap

std::unordered_map<std::string, size_t, CxxUtils::TransparentStringHash, std::equal_to<> > AthMonitorAlgorithm::m_toolLookupMap
privateinherited

Definition at line 381 of file AthMonitorAlgorithm.h.

◆ m_tools

ToolHandleArray<GenericMonitoringTool> AthMonitorAlgorithm::m_tools {this,"GMTools",{}}
protectedinherited

Array of Generic Monitoring Tools.

Definition at line 350 of file AthMonitorAlgorithm.h.

350{this,"GMTools",{}};

◆ m_trainsToF

std::vector<std::string> AFPToFAlgorithm::m_trainsToF = { "T0", "T1" , "T2" , "T3" }
protected

Definition at line 40 of file AFPToFAlgorithm.h.

40{ "T0", "T1" , "T2" , "T3" };

◆ m_trigDecTool

PublicToolHandle<Trig::TrigDecisionTool> AthMonitorAlgorithm::m_trigDecTool
protectedinherited

Tool to tell whether a specific trigger is passed.

Definition at line 354 of file AthMonitorAlgorithm.h.

◆ m_triggerChainString

Gaudi::Property<std::string> AthMonitorAlgorithm::m_triggerChainString {this,"TriggerChain",""}
protectedinherited

Trigger chain string pulled from the job option and parsed into a vector.

Definition at line 369 of file AthMonitorAlgorithm.h.

369{this,"TriggerChain",""};

◆ m_trigLiveFractionDataKey

SG::ReadCondHandleKey<TrigLiveFractionCondData> AthMonitorAlgorithm::m_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"}
protectedinherited

Definition at line 361 of file AthMonitorAlgorithm.h.

362{this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"};

◆ m_useLumi

Gaudi::Property<bool> AthMonitorAlgorithm::m_useLumi {this,"EnableLumi",false}
protectedinherited

Allows use of various luminosity functions.

Definition at line 373 of file AthMonitorAlgorithm.h.

373{this,"EnableLumi",false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ m_vTrigChainNames

std::vector<std::string> AthMonitorAlgorithm::m_vTrigChainNames
protectedinherited

Vector of trigger chain names parsed from trigger chain string.

Definition at line 370 of file AthMonitorAlgorithm.h.


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