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

#include <AFPSiLayerAlgorithm.h>

Inheritance diagram for AFPSiLayerAlgorithm:
Collaboration diagram for AFPSiLayerAlgorithm:

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 ~AFPSiLayerAlgorithm ()
virtual StatusCode initialize () override
 initialize
virtual StatusCode fillHistograms (const EventContext &ctx) const override
 adds event to the monitoring histograms
virtual StatusCode fillHistogramsPlaneEff (const xAOD::AFPSiHitContainer &) 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_pixlayers = { "P0", "P1", "P2", "P3"}
std::vector< std::string > m_stationnames = { "farAside", "nearAside" , "nearCside" , "farCside"}
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, std::map< std::string, int > > m_StationPlaneGroup
std::map< std::string, int > m_StationGroup
SG::ReadHandleKey< xAOD::AFPSiHitContainer > m_afpHitContainerKey {this, "AFPSiHitContainer", "AFPSiHitContainer"}
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKey {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 20 of file AFPSiLayerAlgorithm.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

◆ ~AFPSiLayerAlgorithm()

AFPSiLayerAlgorithm::~AFPSiLayerAlgorithm ( )
virtual

Definition at line 24 of file AFPSiLayerAlgorithm.cxx.

24{}

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 AFPSiLayerAlgorithm::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 45 of file AFPSiLayerAlgorithm.cxx.

45 {
46 using namespace Monitored;
47
48 auto bcidAll = Monitored::Scalar<int>("bcidAll", 0);
49 auto bcidFront = Monitored::Scalar<int>("bcidFront", 0);
50 auto bcidMiddle = Monitored::Scalar<int>("bcidMiddle", 0);
51 auto bcidEnd = Monitored::Scalar<int>("bcidEnd", 0);
52
53 auto numberOfEventsPerLumiblockFront = Monitored::Scalar<int>("numberOfEventsPerLumiblockFront", 0);
54 auto numberOfEventsPerLumiblockMiddle = Monitored::Scalar<int>("numberOfEventsPerLumiblockMiddle", 0);
55 auto numberOfEventsPerLumiblockEnd = Monitored::Scalar<int>("numberOfEventsPerLumiblockEnd", 0);
56
57 SG::ReadHandle<xAOD::EventInfo> eventInfo = GetEventInfo(ctx);
58 numberOfEventsPerLumiblockFront = eventInfo->lumiBlock();
59 numberOfEventsPerLumiblockMiddle = eventInfo->lumiBlock();
60 numberOfEventsPerLumiblockEnd = eventInfo->lumiBlock();
61
62 // BCX handler
63 const unsigned int bcid = eventInfo->bcid();
64 const unsigned int run_number = eventInfo->runNumber();
65 SG::ReadCondHandle<BunchCrossingCondData> bcidHdl(m_bunchCrossingKey,ctx);
66 if (!bcidHdl.isValid()) {
67 ATH_MSG_ERROR( "Unable to retrieve BunchCrossing conditions object (SiT)" );
68 }
69 const BunchCrossingCondData* bcData{*bcidHdl};
70
71 int bx_diff = int(run_number) >= 521800 ? 2 : 1;
72 // Classifying bunches by position in train (Front, Middle, End)
73 enum { FRONT, MIDDLE, END, NPOS } position = NPOS;
74 if(bcData->isFilled(bcid))
75 {
76 bcidAll = bcid;
77 fill("AFPSiLayerTool", bcidAll);
78 if(!bcData->isFilled(bcid-bx_diff))
79 {
80 position = FRONT;
81 bcidFront = bcid;
82 fill("AFPSiLayerTool", bcidFront);
83 fill("AFPSiLayerTool", numberOfEventsPerLumiblockFront);
84 }
85 else
86 {
87 if(bcData->isFilled(bcid+bx_diff))
88 {
89 position = MIDDLE;
90 bcidMiddle = bcid;
91 fill("AFPSiLayerTool", bcidMiddle);
92 fill("AFPSiLayerTool", numberOfEventsPerLumiblockMiddle);
93 }
94 else
95 {
96 position = END;
97 bcidEnd = bcid;
98 fill("AFPSiLayerTool", bcidEnd);
99 fill("AFPSiLayerTool", numberOfEventsPerLumiblockEnd);
100 }
101 }
102 }
103
104
105 // Declare the quantities which should be monitored:
106 auto lb = Monitored::Scalar<int>("lb", 0);
107 auto muPerBX = Monitored::Scalar<float>("muPerBX", 0.0);
108 //auto run = Monitored::Scalar<int>("run",0);
109
110 auto nSiHits = Monitored::Scalar<int>("nSiHits", 1);
111
112 auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0);
113 auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0);
114
115 auto timeOverThreshold = Monitored::Scalar<int>("timeOverThreshold", 0);
116
117 auto clusterX = Monitored::Scalar<float>("clusterX", 0.0);
118 auto clusterY = Monitored::Scalar<float>("clusterY", 0.0);
119 auto clustersInPlanes = Monitored::Scalar<int>("clustersInPlanes", 0);
120
121 auto trackX = Monitored::Scalar<float>("trackX", 0.0);
122 auto trackY = Monitored::Scalar<float>("trackY", 0.0);
123
124 auto planeHits = Monitored::Scalar<int>("planeHits", 0);
125
126 auto numberOfHitsPerStation = Monitored::Scalar<int>("numberOfHitsPerStation", 0);
127
128 auto lbEvents = Monitored::Scalar<int>("lbEvents", 0);
129 auto lbHits = Monitored::Scalar<int>("lbHits", 0);
130 auto lbEventsStations = Monitored::Scalar<int>("lbEventsStations", 0);
131 auto lbEventsStationsAll = Monitored::Scalar<int>("lbEventsStationsAll", 0);
132
133 auto planes = Monitored::Scalar<int>("planes", 0);
134
135 auto eventsPerStation = Monitored::Scalar<int>("eventsPerStation", 0);
136
137 auto clusterToT = Monitored::Scalar<int>("clusterToT", 0);
138
139 lb = eventInfo->lumiBlock();
140 lbEvents = eventInfo->lumiBlock();
141 //muPerBX = lbAverageInteractionsPerCrossing(ctx);
142 muPerBX = lbInteractionsPerCrossing(ctx);
143 if (muPerBX == 0.0) {
144 ATH_MSG_DEBUG("AverageInteractionsPerCrossing is 0, forcing to 1.0");
145 muPerBX=1.0;
146 }
147 fill("AFPSiLayerTool", lb, muPerBX);
148 fill("AFPSiLayerTool", lbEvents);
149
150
151 SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
152 if(! afpHitContainer.isValid())
153 {
154 ATH_MSG_WARNING("evtStore() does not contain hits collection with name " << m_afpHitContainerKey);
155 return StatusCode::SUCCESS;
156 }
157
158 ATH_CHECK( afpHitContainer.initialize() );
159
160 nSiHits = afpHitContainer->size();
161 fill("AFPSiLayerTool", lb, nSiHits);
162
163 int eventsInStations[4] = {};
164 int numberOfHitsPerPlane[4][4] = {};
165
166 for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
167 {
168 lb = eventInfo->lumiBlock();
169 lbHits = eventInfo->lumiBlock();
170 lbEventsStations = eventInfo->lumiBlock();
171 lbEventsStationsAll = eventInfo->lumiBlock();
172 pixelRowIDChip = hitsItr->pixelRowIDChip();
173 pixelColIDChip = hitsItr->pixelColIDChip();
174 timeOverThreshold = hitsItr->timeOverThreshold();
175
176
177 if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0)
178 {
179 ++eventsInStations[hitsItr->stationID()];
180
181 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip, pixelColIDChip);
182 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelRowIDChip);
183 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], pixelColIDChip);
184 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(hitsItr->stationID())).at(m_pixlayers.at(hitsItr->pixelLayerID()))], timeOverThreshold);
185
186 planeHits = hitsItr->pixelLayerID();
187 fill(m_tools[m_StationGroup.at(m_stationnames.at(hitsItr->stationID()))], planeHits);
188
189 ++numberOfHitsPerPlane[hitsItr->stationID()][hitsItr->pixelLayerID()];
190 numberOfHitsPerStation = hitsItr->stationID();
191 fill("AFPSiLayerTool", numberOfHitsPerStation);
192
193 fill("AFPSiLayerTool", lbHits);
194 }
195 else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID());
196 }
197
198 auto hitsPerPlaneProfile = Monitored::Scalar<float>("hitsPerPlaneProfile", 0.0);
199 auto lbhitsPerPlaneProfile = Monitored::Scalar<int>("lbhitsPerPlaneProfile", 0);
200 auto hitsPerPlaneEventsMu = Monitored::Scalar<float>("hitsPerPlaneEventsMu", 0.0);
201 auto hitPerPlaneEventMuIndex = Monitored::Scalar<int>("hitPerPlaneEventMuIndex", 0);
202
203 lbhitsPerPlaneProfile = eventInfo->lumiBlock();
204 for(int i_station = 0; i_station < 4; i_station++)
205 for(int j_layer = 0; j_layer < 4; j_layer++)
206 {
207 hitsPerPlaneProfile = numberOfHitsPerPlane[i_station][j_layer]/muPerBX;
208 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i_station)).at(m_pixlayers.at(j_layer))], lbhitsPerPlaneProfile, hitsPerPlaneProfile);
209 if (muPerBX != 0.0) {
210 hitsPerPlaneEventsMu = numberOfHitsPerPlane[i_station][j_layer] / muPerBX;
211 }
212 hitPerPlaneEventMuIndex = reorganizePlanes(i_station, j_layer);
213 fill("AFPSiLayerTool", hitPerPlaneEventMuIndex, hitsPerPlaneEventsMu);
214 }
215
216 bool noEventsInStations = true;
217 for(int i=0; i<4; i++)
218 {
219 if(eventsInStations[i]>0) {
220 fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lbEventsStations);
221
222 eventsPerStation = i * 4;
223 fill("AFPSiLayerTool", eventsPerStation);
224 ++eventsPerStation;
225 fill("AFPSiLayerTool", eventsPerStation);
226 ++eventsPerStation;
227 fill("AFPSiLayerTool", eventsPerStation);
228 ++eventsPerStation;
229 fill("AFPSiLayerTool", eventsPerStation);
230
231 noEventsInStations = false;
232 }
233 }
234 if(!noEventsInStations)
235 {
236 fill("AFPSiLayerTool", lbEventsStationsAll);
237 }
238
239 // Filling of cluster and track 2D histograms
240 AFPMon::AFPFastReco fast(afpHitContainer.get());
241 fast.reco();
242
243 // Track histograms:
244 unsigned int totalTracksAll[4] = {};
245 unsigned int totalTracksFront[4] = {};
246 unsigned int totalTracksMiddle[4] = {};
247 unsigned int totalTracksEnd[4] = {};
248
249 for (const auto& track : fast.tracks())
250 {
251 trackX = track.x * 1.0;
252 trackY = track.y * 1.0;
253 fill(m_tools[m_StationGroup.at(m_stationnames.at(track.station))], trackY, trackX);
254
255 if (position == FRONT)
256 {
257 ++totalTracksFront[track.station];
258 ++totalTracksAll[track.station];
259 }
260 else if (position == MIDDLE)
261 {
262 ++totalTracksMiddle[track.station];
263 ++totalTracksAll[track.station];
264 }
265 else if (position == END)
266 {
267 ++totalTracksEnd[track.station];
268 ++totalTracksAll[track.station];
269 }
270 }
271
272 auto lbTracksAll = Monitored::Scalar<int>("lbTracksAll", 0);
273 auto lbTracksFront = Monitored::Scalar<int>("lbTracksFront", 0);
274 auto lbTracksMiddle = Monitored::Scalar<int>("lbTracksMiddle", 0);
275 auto lbTracksEnd = Monitored::Scalar<int>("lbTracksEnd", 0);
276
277 auto Total_tracks_All_profile = Monitored::Scalar<float>("Total_tracks_All_profile", 0.0);
278 auto Total_tracks_Front_profile = Monitored::Scalar<float>("Total_tracks_Front_profile", 0.0);
279 auto Total_tracks_Middle_profile = Monitored::Scalar<float>("Total_tracks_Middle_profile", 0.0);
280 auto Total_tracks_End_profile = Monitored::Scalar<float>("Total_tracks_End_profile", 0.0);
281
282 lbTracksAll = eventInfo->lumiBlock();
283 lbTracksFront = eventInfo->lumiBlock();
284 lbTracksMiddle = eventInfo->lumiBlock();
285 lbTracksEnd = eventInfo->lumiBlock();
286
287 for(int i = 0; i < 4; i++)
288 {
289 Total_tracks_All_profile = totalTracksAll[i] / muPerBX;
290 fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lbTracksAll, Total_tracks_All_profile);
291 totalTracksAll[i] = 0;
292
293 Total_tracks_Front_profile = totalTracksFront[i] / muPerBX;
294 if (position == FRONT)
295 fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lbTracksFront, Total_tracks_Front_profile);
296 totalTracksFront[i] = 0;
297
298 Total_tracks_Middle_profile = totalTracksMiddle[i] / muPerBX;
299 if (position == MIDDLE)
300 fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lbTracksMiddle, Total_tracks_Middle_profile);
301 totalTracksMiddle[i] = 0;
302
303 Total_tracks_End_profile = totalTracksEnd[i] / muPerBX;
304 if (position == END)
305 fill(m_tools[m_StationGroup.at(m_stationnames.at(i))], lbTracksEnd, Total_tracks_End_profile);
306 totalTracksEnd[i] = 0;
307 }
308
309 // Cluster histograms
310 unsigned int totalClustersAll[4][4] = {};
311 unsigned int totalClustersFront[4][4] = {};
312 unsigned int totalClustersMiddle[4][4] = {};
313 unsigned int totalClustersEnd[4][4] = {};
314
315 auto clustersPerPlaneAllPP = Monitored::Scalar<float>("clustersPerPlaneAllPP", 0.0);
316 auto clustersPerPlaneFrontPP = Monitored::Scalar<float>("clustersPerPlaneFrontPP", 0.0);
317 auto clustersPerPlaneMiddlePP = Monitored::Scalar<float>("clustersPerPlaneMiddlePP", 0.0);
318 auto clustersPerPlaneEndPP = Monitored::Scalar<float>("clustersPerPlaneEndPP", 0.0);
319
320 auto lbClustersPerPlanesAll = Monitored::Scalar<int>("lbClustersPerPlanesAll", 0);
321 auto lbClustersPerPlanesFront = Monitored::Scalar<int>("lbClustersPerPlanesFront", 0);
322 auto lbClustersPerPlanesMiddle = Monitored::Scalar<int>("lbClustersPerPlanesMiddle", 0);
323 auto lbClustersPerPlanesEnd = Monitored::Scalar<int>("lbClustersPerPlanesEnd", 0);
324
325 lbClustersPerPlanesAll = eventInfo->lumiBlock();
326 lbClustersPerPlanesFront = eventInfo->lumiBlock();
327 lbClustersPerPlanesMiddle = eventInfo->lumiBlock();
328 lbClustersPerPlanesEnd = eventInfo->lumiBlock();
329
330 for(const auto& cluster : fast.clusters())
331 {
332 clusterX = cluster.x * 1.0;
333 clusterY = cluster.y * 1.0;
334 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterY, clusterX);
335 if (cluster.station == 0 || cluster.station == 1)
336 {
337 clustersInPlanes = reorganizePlanes(cluster.station, cluster.layer);
338 }
339 else
340 {
341 clustersInPlanes = (cluster.station*4)+cluster.layer;
342 }
343 fill("AFPSiLayerTool", clustersInPlanes);
344
345 clusterToT = cluster.sumToT;
346 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterToT);
347
348 if (position == FRONT)
349 {
350 ++totalClustersFront[cluster.station][cluster.layer];
351 ++totalClustersAll[cluster.station][cluster.layer];
352 }
353 else if (position == MIDDLE)
354 {
355 ++totalClustersMiddle[cluster.station][cluster.layer];
356 ++totalClustersAll[cluster.station][cluster.layer];
357 }
358 else if (position == END)
359 {
360 ++totalClustersEnd[cluster.station][cluster.layer];
361 ++totalClustersAll[cluster.station][cluster.layer];
362 }
363 }
364
365 for(int i_station = 0; i_station < 4; i_station++)
366 for(int j_layer = 0; j_layer < 4; j_layer++)
367 {
368 clustersPerPlaneAllPP = totalClustersAll[i_station][j_layer] / muPerBX;
369 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i_station)).at(m_pixlayers.at(j_layer))], lbClustersPerPlanesAll, clustersPerPlaneAllPP);
370 totalClustersAll[i_station][j_layer] = 0;
371
372 clustersPerPlaneFrontPP = totalClustersFront[i_station][j_layer] / muPerBX;
373 if (position == FRONT)
374 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i_station)).at(m_pixlayers.at(j_layer))], lbClustersPerPlanesFront, clustersPerPlaneFrontPP);
375 totalClustersFront[i_station][j_layer] = 0;
376
377 clustersPerPlaneMiddlePP = totalClustersMiddle[i_station][j_layer] / muPerBX;
378 if (position == MIDDLE)
379 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i_station)).at(m_pixlayers.at(j_layer))], lbClustersPerPlanesMiddle, clustersPerPlaneMiddlePP);
380 totalClustersMiddle[i_station][j_layer] = 0;
381
382 clustersPerPlaneEndPP = totalClustersEnd[i_station][j_layer] / muPerBX;
383 if (position == END)
384 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(i_station)).at(m_pixlayers.at(j_layer))], lbClustersPerPlanesEnd, clustersPerPlaneEndPP);
385 totalClustersEnd[i_station][j_layer] = 0;
386 }
387
388 return(fillHistogramsPlaneEff(*afpHitContainer));
389} // end of fillHistograms
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKey
std::map< std::string, int > m_StationGroup
virtual StatusCode fillHistogramsPlaneEff(const xAOD::AFPSiHitContainer &) const
SG::ReadHandleKey< xAOD::AFPSiHitContainer > m_afpHitContainerKey
std::vector< std::string > m_stationnames
std::vector< std::string > m_pixlayers
std::map< std::string, std::map< std::string, int > > m_StationPlaneGroup
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?
double timeOverThreshold(unsigned int m_word)
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 lbInteractionsPerCrossing(const EventContext &ctx) const
Calculate instantaneous number of interactions, i.e.
float nSiHits(const U &p)
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
AFPSiHit_v2 AFPSiHit
Definition AFPSiHit.h:12
setEventNumber setTimeStamp bcid

◆ fillHistogramsPlaneEff()

StatusCode AFPSiLayerAlgorithm::fillHistogramsPlaneEff ( const xAOD::AFPSiHitContainer & afpHitContainer) const
virtual

Definition at line 391 of file AFPSiLayerAlgorithm.cxx.

391 {
392 using namespace Monitored;
393
394 // Define 2D histograms for tries and successes
395 Monitored::Scalar<bool> sit_plane_eff_passed("sit_plane_eff_passed", false);
396 Monitored::Scalar<float> sit_plane_eff_triedX("sit_plane_eff_triedX", 0.0);
397 Monitored::Scalar<float> sit_plane_eff_triedY("sit_plane_eff_triedY", 0.0);
398
399 auto triesX = Monitored::Scalar<float>("triesX", 0.0);
400 auto triesY = Monitored::Scalar<float>("triesY", 0.0);
401
402 auto successX = Monitored::Scalar<float>("successX", 0.0);
403 auto successY = Monitored::Scalar<float>("successY", 0.0);
404
405
406 auto clusterXLocal = Monitored::Scalar<float>("clusterXLocal", 0.0);
407 auto clusterYLocal = Monitored::Scalar<float>("clusterYLocal", 0.0);
408
409 auto clusterXTag = Monitored::Scalar<float>("clusterXTag", 0.0);
410 auto clusterYTag = Monitored::Scalar<float>("clusterYTag", 0.0);
411
412 AFPMon::AFPFastReco fast(&afpHitContainer);
413 fast.reco();
414
415 int min_hits[4] = {2, 3, 3, 3};
416 int numStations = 4;
417 int numPlanes = 4;
418
419 // Count clusters per station and plane
420 std::vector<std::vector<int>> nclusters_planes(numStations, std::vector<int>(numPlanes, 0));
421 for (const auto& cluster : fast.clusters()) {
422 ++nclusters_planes[cluster.station][cluster.layer];
423 }
424
425 // Count planes with clusters at each station
426 std::vector<std::vector<int>> nclusters_other_planes(numStations, std::vector<int>(numPlanes, 0));
427 for (int iStation = 0; iStation < numStations; ++iStation) {
428 for (int iPlane = 0; iPlane < numPlanes; ++iPlane) {
429 for (int ip = 0; ip < numPlanes; ++ip) {
430 if (iPlane != ip && nclusters_planes[iStation][ip] > 0) {
431 ++nclusters_other_planes[iStation][iPlane];
432 }
433 }
434 }
435 }
436
437 // Precomputed tag planes
438 std::array<std::set<int>, 4> precomputed_tag_planes = {
439 std::set<int>{1, 2, 3},
440 std::set<int>{0, 1, 2, 3},
441 std::set<int>{0, 1, 2, 3},
442 std::set<int>{0, 1, 2, 3}
443 };
444
445 // Precomputed clusters by Stations and Planes
446 using ClusterType = std::decay_t<decltype(*fast.clusters().begin())>;
447 std::vector<std::vector<std::vector<ClusterType>>> clusters_by_station_layer(numStations,
448 std::vector<std::vector<ClusterType>>(numPlanes));
449
450 for (const auto& cluster : fast.clusters()) {
451 clusters_by_station_layer[cluster.station][cluster.layer].push_back(cluster);
452 }
453
454 for (int iStation = 0; iStation < numStations; ++iStation) {
455 for (int iPlane = 0; iPlane < numPlanes; ++iPlane) {
456 // Skip if no enough hits in other planes
457 if (nclusters_other_planes[iStation][iPlane] < min_hits[iStation]) {continue;}
458
459 std::set<int> tag_planes = precomputed_tag_planes[iStation];
460 tag_planes.erase(iPlane);
461
462 std::vector<int> v_tag_planes(tag_planes.begin(), tag_planes.end());
463 int seed = v_tag_planes[0]; // Take first plane as a seed
464
465 // Iterate only stations coresponding to the given Station and Layer
466 for (const auto& cluster : clusters_by_station_layer[iStation][seed]) {
467 int found_in_other_tag_planes = 0;
468
469 // Check other tag planes using lookup
470 for (size_t i = 1; i < v_tag_planes.size(); ++i) {
471 int tag_plane = v_tag_planes[i];
472 bool found = false;
473
474 for (const auto& clusterTag : clusters_by_station_layer[iStation][tag_plane]) {
475 if (std::fabs(cluster.x - clusterTag.x) < 2.0 && std::fabs(cluster.y - clusterTag.y) < 2.0) {
476 found = true;
477 ++found_in_other_tag_planes;
478 break;
479 }
480 }
481 // if not found in current tag plane
482 if (!found) {break;}
483 }
484
485 // Check if valid tag
486 if (found_in_other_tag_planes == static_cast<int>(v_tag_planes.size()) - 1) {
487 sit_plane_eff_triedX = cluster.x;
488 sit_plane_eff_triedY = cluster.y;
489
490 // Check probe plane
491 for (const auto& clusterTag : clusters_by_station_layer[iStation][iPlane]) {
492 if (std::fabs(cluster.x - clusterTag.x) < 2.0 && std::fabs(cluster.y - clusterTag.y) < 2.0) {
493 sit_plane_eff_passed = true;
494 break;
495 }
496 }
497
498 fill(m_tools[m_StationPlaneGroup.at(m_stationnames.at(iStation)).at(m_pixlayers.at(iPlane))],
499 sit_plane_eff_passed, sit_plane_eff_triedY, sit_plane_eff_triedX);
500 sit_plane_eff_passed = false;
501 }
502 }
503 }
504 }
505 return StatusCode::SUCCESS;
506}

◆ 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 AFPSiLayerAlgorithm::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 27 of file AFPSiLayerAlgorithm.cxx.

27 {
28
29 using namespace Monitored;
30
31 m_StationPlaneGroup = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
32 m_StationGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
33
34
35 // We must declare to the framework in initialize what SG objects we are going to use:
36 SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
37 ATH_CHECK(m_afpHitContainerKey.initialize());
38
39 ATH_MSG_INFO( "BunchCrossingKey initialization (SiT)" );
40 ATH_CHECK(m_bunchCrossingKey.initialize());
41 ATH_MSG_INFO( "initialization completed (SiT)" );
43}
#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_afpHitContainerKey

SG::ReadHandleKey<xAOD::AFPSiHitContainer> AFPSiLayerAlgorithm::m_afpHitContainerKey {this, "AFPSiHitContainer", "AFPSiHitContainer"}
private

Definition at line 31 of file AFPSiLayerAlgorithm.h.

31{this, "AFPSiHitContainer", "AFPSiHitContainer"};

◆ m_bunchCrossingKey

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

Definition at line 32 of file AFPSiLayerAlgorithm.h.

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

◆ 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_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_pixlayers

std::vector<std::string> AFPSiLayerAlgorithm::m_pixlayers = { "P0", "P1", "P2", "P3"}
protected

Definition at line 36 of file AFPSiLayerAlgorithm.h.

36{ "P0", "P1", "P2", "P3"};

◆ m_StationGroup

std::map<std::string,int> AFPSiLayerAlgorithm::m_StationGroup
private

Definition at line 30 of file AFPSiLayerAlgorithm.h.

◆ m_stationnames

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

Definition at line 37 of file AFPSiLayerAlgorithm.h.

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

◆ m_StationPlaneGroup

std::map<std::string,std::map<std::string,int> > AFPSiLayerAlgorithm::m_StationPlaneGroup
private

Definition at line 29 of file AFPSiLayerAlgorithm.h.

◆ 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_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: