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

#include <TrigBjetMonitorAlgorithm.h>

Inheritance diagram for TrigBjetMonitorAlgorithm:
Collaboration diagram for TrigBjetMonitorAlgorithm:

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

 TrigBjetMonitorAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TrigBjetMonitorAlgorithm ()
virtual StatusCode initialize () override
 initialize
virtual StatusCode fillHistograms (const EventContext &ctx) const override
 adds event to the monitoring histograms
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 (const std::string &groupName, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
 Fills a vector of variables to a group by name.
void fill (const std::string &groupName, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
 Fills a vector of variables to a group by name.
template<typename... T>
void fill (const std::string &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 (const std::string &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::EventInfoGetEventInfo (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 unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

ToolHandleArray< GenericMonitoringToolm_tools {this,"GMTools",{}}
 Array of Generic Monitoring Tools.
PublicToolHandle< Trig::TrigDecisionToolm_trigDecTool
 Tool to tell whether a specific trigger is passed.
ToolHandleArray< IDQFilterToolm_DQFilterTools {this,"FilterTools",{}}
 Array of Data Quality filter tools.
SG::ReadCondHandleKey< LuminosityCondDatam_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
SG::ReadCondHandleKey< LBDurationCondDatam_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
SG::ReadCondHandleKey< TrigLiveFractionCondDatam_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::EventInfom_EventInfoKey {this,"EventInfoKey","EventInfo"}
 Key for retrieving EventInfo from StoreGate.

Private Types

typedef std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > MonVarVec_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_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

Gaudi::Property< bool > m_collisionRun {this, "CollisionRun", true}
Gaudi::Property< std::string > m_btaggingLinkName {this, "BtaggingLinkName", "btag"}
Gaudi::Property< bool > m_expressStreamFlag {this, "ExpressStreamFlag", false}
Gaudi::Property< std::vector< std::string > > m_allChains {this,"AllChains",{}}
SG::ReadHandleKey< xAOD::MuonContainerm_muonContainerKey {this, "MuonContainerName", "Muons", "Muon Container Name"}
SG::ReadHandleKey< xAOD::VertexContainerm_offlineVertexContainerKey {this, "OfflineVertexContainerName", "PrimaryVertices", "Key of offline primary vertexes"}
SG::ReadHandleKey< xAOD::VertexContainerm_onlineVertexContainerKey {this, "OnlineVertexContainerName", "HLT_IDVertex_FS", "Key of online bjet primary vertexes"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_onlineTrackContainerKey {this, "OnlineTrackContainerName", "HLT_IDTrack_Bjet_IDTrig", "Key of online tracks of bjets"}
SG::ReadHandleKey< xAOD::JetContainerm_onlineEMPFlowBJetContainerKey {this, "OnlineEMPFlowBJetContainerKey", "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJets", "Key of online EMPFlow bjets"}
SG::ReadHandleKey< xAOD::JetContainerm_onlineEMTopoBJetContainerKey {this, "OnlineEMTopoBJetContainerKey", "HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf_bJets", "Key of online EMTopo bjets"}
std::string m_name
std::unordered_map< std::string, size_t > m_toolLookupMap
const ToolHandle< GenericMonitoringToolm_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 16 of file TrigBjetMonitorAlgorithm.h.

Member Typedef Documentation

◆ MonVarVec_t

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

Definition at line 370 of file AthMonitorAlgorithm.h.

◆ StoreGateSvc_t

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

Definition at line 388 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 194 of file AthMonitorAlgorithm.h.

194 {
195 userDefined = 0,
196 monteCarlo,
197 collisions,
198 cosmics,
199 heavyIonCollisions,
200 };
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 175 of file AthMonitorAlgorithm.h.

175 {
176 user = 0,
177 online,
178 tier0,
179 tier0Raw,
180 tier0ESD,
181 AOD,
182 altprod,
183 };

Constructor & Destructor Documentation

◆ TrigBjetMonitorAlgorithm()

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

Definition at line 14 of file TrigBjetMonitorAlgorithm.cxx.

15 : AthMonitorAlgorithm(name,pSvcLocator)
16{}
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~TrigBjetMonitorAlgorithm()

TrigBjetMonitorAlgorithm::~TrigBjetMonitorAlgorithm ( )
virtual

Definition at line 18 of file TrigBjetMonitorAlgorithm.cxx.

18{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ 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 224 of file AthMonitorAlgorithm.h.

224{ return m_dataType; }
AthMonitorAlgorithm::DataType_t m_dataType
Instance of the DataType_t enum.

◆ 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 208 of file AthMonitorAlgorithm.h.

208{ return m_environment; }
AthMonitorAlgorithm::Environment_t m_environment
Instance of the Environment_t enum.

◆ 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

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.
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.
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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ fillHistograms()

StatusCode TrigBjetMonitorAlgorithm::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 100 of file TrigBjetMonitorAlgorithm.cxx.

100 {
101 using namespace Monitored;
102
103 if(m_trigDecTool->ExperimentalAndExpertMethods().isHLTTruncated()) {
104 ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
105 return StatusCode::SUCCESS;
106 } // ATR-31454
107
108
109 // Read off-line PV's and fill histograms
110
111 bool Eofflinepv(false);
112 float offlinepvz(-1.e6);
113 float offlinepvx(-1.e6);
114 float offlinepvy(-1.e6);
115
116 if (m_collisionRun) {
117 auto OffNVtx = Monitored::Scalar<int>("Off_NVtx",0);
118 auto OffxVtx = Monitored::Scalar<float>("Off_xVtx",0.0);
119 auto OffyVtx = Monitored::Scalar<float>("Off_yVtx",0.0);
120 auto OffzVtx = Monitored::Scalar<float>("Off_zVtx",0.0);
121
122 SG::ReadHandle<xAOD::VertexContainer> offlinepv = SG::makeHandle( m_offlineVertexContainerKey, ctx );
123 if (! offlinepv.isValid() ) {
124 ATH_MSG_ERROR("evtStore() does not contain VertexContainer Collection with name "<< m_offlineVertexContainerKey);
125 return StatusCode::FAILURE;
126 }
127 ATH_MSG_DEBUG(" Size of the Off-line PV container: " << offlinepv->size() );
128 if ( offlinepv->size() ) {
129 Eofflinepv = true;
130 offlinepvz = offlinepv->front()->z();
131 offlinepvx = offlinepv->front()->x();
132 offlinepvy = offlinepv->front()->y();
133 OffNVtx = offlinepv->size() ;
134 for (unsigned int j = 0; j<offlinepv->size(); j++) {
135 if ( (*(offlinepv))[j]->nTrackParticles()==0 ) continue; // MS 9/7/2025
136 if ( (*(offlinepv))[j]->vertexType()==0 ) continue; // MS 9/7/2025
137 OffxVtx = (*(offlinepv))[j]->x();
138 OffyVtx = (*(offlinepv))[j]->y();
139 OffzVtx = (*(offlinepv))[j]->z();
140 fill("TrigBjetMonitor",OffxVtx,OffyVtx,OffzVtx);
141 }
142 fill("TrigBjetMonitor",OffNVtx);
143 } // if size
144 } // if m_collisionRun
145
146 // print the trigger chain names
147
148 std::string chainName;
149
150 int size_AllChains = m_allChains.size();
151 ATH_MSG_DEBUG(" Size of the AllChains trigger container: " << size_AllChains );
152 for (int i =0; i<size_AllChains; i++) {
153 chainName = m_allChains[i];
154 ATH_MSG_DEBUG(" Chain number: " << i << " AllChains Chain Name: " << chainName );
155 }
156
157 // Verifiy if the trigger chain was fired and if yes, fill the corresponding histogram
158
159 bool mujetChain(false);
160 bool bjetChain(true);
161 bool L2bjetChain(false);
162
163
164 for ( auto& trigName : m_allChains ) {
165
166
167 if ( m_trigDecTool->isPassed(trigName) ) {
168 ATH_MSG_DEBUG(" Trigger chain from AllChains list: " << trigName << " has fired !!! " );
169
170 // Verify if the chain was in the Express Stream if the job was an express job
171
172 const unsigned int passBits = m_trigDecTool->isPassedBits(trigName);
173 const bool expressPass = passBits & TrigDefs::Express_passed;
174
175 ATH_MSG_DEBUG( " Express Stream Test: Chain: " << trigName<< " m_expressStreamFlag: " << m_expressStreamFlag << " expressPass: " << expressPass );
176
177 if ( !m_expressStreamFlag || (m_expressStreamFlag && expressPass) ) {
178
179
180 // bjet vs mujet vs L2bjetChain
181 mujetChain = false;
182 L2bjetChain = false;
183 bjetChain = false;
184 std::size_t found = trigName.find("HLT_mu");
185 if (found!=std::string::npos) mujetChain = true;
186 else {
187 found = trigName.find("a10sd_cssk");
188 if (found!=std::string::npos) L2bjetChain = true;
189 else bjetChain = true;
190 }
191
192 ATH_MSG_DEBUG(" ===> Run 3 access to Trigger Item: " << trigName );
193 ATH_MSG_DEBUG(" bjetChain: " << bjetChain << " mujetChain: " << mujetChain << " L2bjetChain: " << L2bjetChain );
194
195
196 // online track container
197 SG::ReadHandle<xAOD::TrackParticleContainer> theTracks(m_onlineTrackContainerKey, ctx);
198 // verify the content
199 for ( const xAOD::TrackParticle* track : *theTracks ) {
200 ATH_MSG_DEBUG( " Pt of track in TrackParticleContainer: " << track->pt() );
201 }
202
203 float zPrmVtx = 0.; // used for muon-jets
204
205 // Online Primary Vertex from SG
206
207 if (m_collisionRun) {
208 SG::ReadHandle<xAOD::VertexContainer> vtxContainer = SG::makeHandle( m_onlineVertexContainerKey, ctx );
209 int nPV = 0;
210 for (const xAOD::Vertex* vtx : *vtxContainer) {
211 if (vtx->vertexType() == xAOD::VxType::PriVtx) {
212 nPV++;
213 std::string NameH = "PVz_tr_"+trigName;
214 ATH_MSG_DEBUG( " NameH: " << NameH );
215 auto PVz_tr = Monitored::Scalar<float>(NameH,0.0);
216 PVz_tr = vtx->z();
217 zPrmVtx = PVz_tr;
218 ATH_MSG_DEBUG(" PVz_tr: " << PVz_tr);
219 fill("TrigBjetMonitor",PVz_tr);
220 if (Eofflinepv) {
221 NameH = "DiffOnOffPVz_tr_"+trigName;
222 ATH_MSG_DEBUG( " NameH: " << NameH );
223 auto DiffOnOffPVz_tr = Monitored::Scalar<float>(NameH,0.0);
224 DiffOnOffPVz_tr = vtx->z()-offlinepvz;
225 ATH_MSG_DEBUG(" DiffOnOffPVz_tr: " << DiffOnOffPVz_tr);
226 fill("TrigBjetMonitor",DiffOnOffPVz_tr);
227 } // if Eofflinepv
228 NameH = "PVx_tr_"+trigName;
229 ATH_MSG_DEBUG( " NameH: " << NameH );
230 auto PVx_tr = Monitored::Scalar<float>(NameH,0.0);
231 PVx_tr = vtx->x();
232 ATH_MSG_DEBUG(" PVx_tr: " << PVx_tr);
233 fill("TrigBjetMonitor",PVx_tr);
234 if (Eofflinepv) {
235 NameH = "DiffOnOffPVx_tr_"+trigName;
236 ATH_MSG_DEBUG( " NameH: " << NameH );
237 auto DiffOnOffPVx_tr = Monitored::Scalar<float>(NameH,0.0);
238 DiffOnOffPVx_tr = vtx->x()-offlinepvx;
239 ATH_MSG_DEBUG(" DiffOnOffPVx_tr: " << DiffOnOffPVx_tr);
240 fill("TrigBjetMonitor",DiffOnOffPVx_tr);
241 } // if Eofflinepv
242 NameH = "PVy_tr_"+trigName;
243 ATH_MSG_DEBUG( " NameH: " << NameH );
244 auto PVy_tr = Monitored::Scalar<float>(NameH,0.0);
245 PVy_tr = vtx->y();
246 ATH_MSG_DEBUG(" PVy_tr: " << PVy_tr);
247 fill("TrigBjetMonitor",PVy_tr);
248 if (Eofflinepv) {
249 NameH = "DiffOnOffPVy_tr_"+trigName;
250 ATH_MSG_DEBUG( " NameH: " << NameH );
251 auto DiffOnOffPVy_tr = Monitored::Scalar<float>(NameH,0.0);
252 DiffOnOffPVy_tr = vtx->y()-offlinepvy;
253 ATH_MSG_DEBUG(" DiffOnOffPVy_tr: " << DiffOnOffPVy_tr);
254 fill("TrigBjetMonitor",DiffOnOffPVy_tr);
255 } // if Eofflinepv
256 } // if vtx type
257 } // loop on vtxContainer
258 std::string NpvH = "nPV_tr_"+trigName;
259 ATH_MSG_DEBUG( " NpvH: " << NpvH );
260 auto nPV_tr = Monitored::Scalar<int>(NpvH,0.0);
261 nPV_tr = nPV;
262 fill("TrigBjetMonitor",nPV_tr);
263 } // if m_collisionRun
264
265 // L2bjetChain
266
267
268 if (L2bjetChain) {
269 std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDecTool->features<xAOD::JetContainer>(trigName, TrigDefs::Physics);
270
271 std::string nJetH = "LargeR_nJet_"+trigName;
272 auto nJet = Monitored::Scalar<int>(nJetH,0.0);
273 nJet = onlinejets.size();
274 ATH_MSG_DEBUG(" nJet: " << nJet);
275 fill("TrigBjetMonitor",nJet);
276 for(const auto& jetLinkInfo : onlinejets) {
277 const xAOD::Jet* jet = *(jetLinkInfo.link);
278
279 // GN2XTrig
280 static const SG::AuxElement::ConstAccessor<float> pqcd_accessor("GN2XTrig_pqcd");
281 static const SG::AuxElement::ConstAccessor<float> ptop_accessor("GN2XTrig_ptop");
282 static const SG::AuxElement::ConstAccessor<float> phbb_accessor("GN2XTrig_phbb");
283 bool isGN2XTrigAvailable = pqcd_accessor.isAvailable(*jet);
284
285 std::string NameH = "GN2XTrig_pqcd_tr_"+trigName;
286 ATH_MSG_DEBUG( " NameH: " << NameH );
287 auto GN2XTrig_pqcd = Monitored::Scalar<float>(NameH,0.0);
288 GN2XTrig_pqcd = isGN2XTrigAvailable ? pqcd_accessor(*jet) : -1.;
289 fill("TrigBjetMonitor",GN2XTrig_pqcd);
290
291 NameH = "GN2XTrig_ptop_tr_"+trigName;
292 ATH_MSG_DEBUG( " NameH: " << NameH );
293 auto GN2XTrig_ptop = Monitored::Scalar<float>(NameH,0.0);
294 GN2XTrig_ptop = isGN2XTrigAvailable ? ptop_accessor(*jet) : -1.;
295 fill("TrigBjetMonitor",GN2XTrig_ptop);
296
297 NameH = "GN2XTrig_phbb_tr_"+trigName;
298 ATH_MSG_DEBUG( " NameH: " << NameH );
299 auto GN2XTrig_phbb = Monitored::Scalar<float>(NameH,0.0);
300 GN2XTrig_phbb = isGN2XTrigAvailable ? phbb_accessor(*jet) : -1.;
301 fill("TrigBjetMonitor",GN2XTrig_phbb);
302
303 NameH = "GN2XTrig_mv_tr_"+trigName;
304 ATH_MSG_DEBUG( " NameH: " << NameH );
305 auto GN2XTrig_mv = Monitored::Scalar<float>(NameH,0.0);
306 ATH_MSG_DEBUG(" GN2XTrig_pqcd: " << GN2XTrig_pqcd << " GN2XTrig_ptop: " << GN2XTrig_ptop << " GN2XTrig_phbb: " << GN2XTrig_phbb );
307 bool theLLRW = LLRW (GN2XTrig_pqcd, GN2XTrig_ptop, GN2XTrig_phbb, GN2XTrig_mv);
308 ATH_MSG_DEBUG(" GN2XTrig_mv: " << GN2XTrig_mv << " LLRW: " << theLLRW);
309 if ( theLLRW ) fill("TrigBjetMonitor",GN2XTrig_mv);
310
311 // jetPt
312 NameH = "LargeR_jetPt_"+trigName;
313 ATH_MSG_DEBUG( " NameH: " << NameH );
314 auto LargeR_jetPt = Monitored::Scalar<float>(NameH,0.0);
315 LargeR_jetPt = (jet->pt())*1.e-3;
316 ATH_MSG_DEBUG(" LargeR_jetPt: " << LargeR_jetPt);
317 fill("TrigBjetMonitor",LargeR_jetPt);
318
319 // jetEta
320 NameH = "LargeR_jetEta_"+trigName;
321 ATH_MSG_DEBUG( " NameH: " << NameH );
322 auto LargeR_jetEta = Monitored::Scalar<float>(NameH,0.0);
323 LargeR_jetEta = jet->eta();
324
325 // jetPhi
326 NameH = "LargeR_jetPhi_"+trigName;
327 ATH_MSG_DEBUG( " NameH: " << NameH );
328 auto LargeR_jetPhi = Monitored::Scalar<float>(NameH,0.0);
329 LargeR_jetPhi = jet->phi();
330 ATH_MSG_DEBUG(" LargeR_jetEta: " << LargeR_jetEta << " LargeR_jetPhi : " << LargeR_jetPhi);
331 fill("TrigBjetMonitor",LargeR_jetEta,LargeR_jetPhi);
332
333 // jetMass
334 NameH = "LargeR_jetMass_"+trigName;
335 ATH_MSG_DEBUG( " NameH: " << NameH );
336 auto LargeR_jetMass = Monitored::Scalar<float>(NameH,0.0);
337 LargeR_jetMass = (jet->m())*1.e-3;
338 ATH_MSG_DEBUG(" LargeR_jetMass: " << LargeR_jetMass);
339 fill("TrigBjetMonitor",LargeR_jetMass);
340
341 // GN2Xv01
342 static const SG::AuxElement::ConstAccessor<float> pqcd_accessor0("GN2Xv01_pqcd");
343 static const SG::AuxElement::ConstAccessor<float> ptop_accessor0("GN2Xv01_ptop");
344 static const SG::AuxElement::ConstAccessor<float> phbb_accessor0("GN2Xv01_phbb");
345 bool isGN2Xv01Available = pqcd_accessor0.isAvailable(*jet);
346
347 NameH = "GN2Xv01_pqcd_tr_"+trigName;
348 ATH_MSG_DEBUG( " NameH: " << NameH );
349 auto GN2Xv01_pqcd = Monitored::Scalar<float>(NameH,0.0);
350 GN2Xv01_pqcd = isGN2Xv01Available ? pqcd_accessor0(*jet) : -1.;
351 fill("TrigBjetMonitor",GN2Xv01_pqcd);
352
353 NameH = "GN2Xv01_ptop_tr_"+trigName;
354 ATH_MSG_DEBUG( " NameH: " << NameH );
355 auto GN2Xv01_ptop = Monitored::Scalar<float>(NameH,0.0);
356 GN2Xv01_ptop = isGN2Xv01Available ? ptop_accessor0(*jet) : -1.;
357 fill("TrigBjetMonitor",GN2Xv01_ptop);
358
359 NameH = "GN2Xv01_phbb_tr_"+trigName;
360 ATH_MSG_DEBUG( " NameH: " << NameH );
361 auto GN2Xv01_phbb = Monitored::Scalar<float>(NameH,0.0);
362 GN2Xv01_phbb = isGN2Xv01Available ? phbb_accessor0(*jet) : -1.;
363 fill("TrigBjetMonitor",GN2Xv01_phbb);
364
365 NameH = "GN2Xv01_mv_tr_"+trigName;
366 ATH_MSG_DEBUG( " NameH: " << NameH );
367 auto GN2Xv01_mv = Monitored::Scalar<float>(NameH,0.0);
368 ATH_MSG_DEBUG(" GN2Xv01_pqcd: " << GN2Xv01_pqcd << " GN2Xv01_ptop: " << GN2Xv01_ptop << " GN2Xv01_phbb: " << GN2Xv01_phbb );
369 theLLRW = LLRW (GN2Xv01_pqcd, GN2Xv01_ptop, GN2Xv01_phbb, GN2Xv01_mv);
370 ATH_MSG_DEBUG(" GN2Xv01_mv: " << GN2Xv01_mv << " LLRW: " << theLLRW);
371 if ( theLLRW ) fill("TrigBjetMonitor",GN2Xv01_mv);
372
373 } // for jetLinkInfo
374
375 } // if (L2bjetChain)
376
377
378 if (mujetChain) {
379 std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > onlinemuons = m_trigDecTool->features<xAOD::MuonContainer>(trigName, TrigDefs::Physics); // TM 2022-05-16
380 int imuon = 0;
381 std::string nMuonH = "nMuon_"+trigName;
382 auto nMuon = Monitored::Scalar<int>(nMuonH,0.0);
383 nMuon = onlinemuons.size();
384 fill("TrigBjetMonitor",nMuon);
385
386 std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDecTool->features<xAOD::JetContainer>(trigName, TrigDefs::Physics); // TM 2021-10-30
387 int ijet = 0;
388 std::string nJetH = "nJet_"+trigName;
389 auto nJet = Monitored::Scalar<int>(nJetH,0.0);
390 nJet = onlinejets.size();
391 fill("TrigBjetMonitor",nJet);
392
393 if (nMuon*nJet > 0) {
394
395 float muonPt1(0.), muonEta1(0.), muonPhi1(0.), muonZ1(0.), jetPt1(0.), jetEta1(0.), jetPhi1(0.), jetZ1(0.), muonZ(0.);
396 double GN1_mv(0.), GN2_mv(0.);
397 bool theLLR_GN1(false), theLLR_GN2(false);
398 bool plotDeltaZ(false);
399
400 for(const auto& muonLinkInfo : onlinemuons) {
401 const xAOD::Muon* muon = *(muonLinkInfo.link);
402 // muonPt
403 std::string NameH = "muonPt_"+trigName;
404 ATH_MSG_DEBUG( " NameH: " << NameH );
405 auto muonPt = Monitored::Scalar<float>(NameH,0.0);
406 muonPt = (muon->pt())*1.e-3;
407 ATH_MSG_DEBUG(" muonPt: " << muonPt);
408 fill("TrigBjetMonitor",muonPt);
409 // muonEta
410 NameH = "muonEta_"+trigName;
411 ATH_MSG_DEBUG( " NameH: " << NameH );
412 auto muonEta = Monitored::Scalar<float>(NameH,0.0);
413 muonEta = muon->eta();
414 ATH_MSG_DEBUG(" muonEta: " << muonEta);
415 fill("TrigBjetMonitor",muonEta);
416 // muonPhi
417 NameH = "muonPhi_"+trigName;
418 ATH_MSG_DEBUG( " NameH: " << NameH );
419 auto muonPhi = Monitored::Scalar<float>(NameH,0.0);
420 muonPhi = muon->phi();
421 ATH_MSG_DEBUG(" muonPhi : " << muonPhi);
422 // muonZ
423 auto track = muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle); // TM and DG 18/06/22
424 if (track) {
425 plotDeltaZ = true;
426 muonZ = track->z0() + track->vz();
427 } else {
428 plotDeltaZ = false;
429 muonZ = 0.;
430 }
431
432 if (imuon == 0) {
433 //store the parameter for the 1st muon
434 muonPt1 = muonPt;
435 muonEta1 = muonEta;
436 muonPhi1 = muonPhi;
437 muonZ1 = muonZ;
438 }// if imuon==0
439
440 // The associated jet loop
441 for(const auto& jetLinkInfo : onlinejets) {
442 const xAOD::Jet* jet = *(jetLinkInfo.link);
443 // jetPt
444 NameH = "jetPt_"+trigName;
445 ATH_MSG_DEBUG( " NameH: " << NameH );
446 auto jetPt = Monitored::Scalar<float>(NameH,0.0);
447 jetPt = (jet->pt())*1.e-3;
448 ATH_MSG_DEBUG(" jetPt: " << jetPt);
449 fill("TrigBjetMonitor",jetPt);
450 // jetEta
451 NameH = "jetEta_"+trigName;
452 ATH_MSG_DEBUG( " NameH: " << NameH );
453 auto jetEta = Monitored::Scalar<float>(NameH,0.0);
454 jetEta = jet->eta();
455 ATH_MSG_DEBUG(" jetEta : " << jetEta);
456 fill("TrigBjetMonitor",jetEta);
457 // jetPhi
458 NameH = "jetPhi_"+trigName;
459 ATH_MSG_DEBUG( " NameH: " << NameH );
460 auto jetPhi = Monitored::Scalar<float>(NameH,0.0);
461 jetPhi = jet->phi();
462 ATH_MSG_DEBUG(" jetPhi : " << jetPhi);
463
464 // Take the b-tagging info from the first jet
465 if (ijet == 0) {
466 //store the parameter for the 1st jet
467 jetPt1 = jetPt;
468 jetEta1 = jetEta;
469 jetPhi1 = jetPhi;
470 jetZ1 = zPrmVtx;
471
472 auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, m_btaggingLinkName); // TM 2021-10-30
473 const SG::AuxElement* obj_storing_btag = nullptr;
474 if ( btaggingLinkInfo.isValid() ) {
475 obj_storing_btag = *(btaggingLinkInfo.link);
476 }
477 else {
478 obj_storing_btag = *(jetLinkInfo.link);
479 }
480
481 static const SG::AuxElement::ConstAccessor<float> GN1pu_accessor("GN120220813_pu");
482 static const SG::AuxElement::ConstAccessor<float> GN1pc_accessor("GN120220813_pc");
483 static const SG::AuxElement::ConstAccessor<float> GN1pb_accessor("GN120220813_pb");
484
485 static const SG::AuxElement::ConstAccessor<float> GN2pu_accessor("GN220240122_pu");
486 static const SG::AuxElement::ConstAccessor<float> GN2pc_accessor("GN220240122_pc");
487 static const SG::AuxElement::ConstAccessor<float> GN2pb_accessor("GN220240122_pb");
488
489 // checking just pu is enough
490 if (GN1pu_accessor.isAvailable(*obj_storing_btag)) {
491 double GN1_pu(-1.), GN1_pc(-1.), GN1_pb(-1.);
492 GN1_pu = GN1pu_accessor(*obj_storing_btag);
493 ATH_MSG_DEBUG(" GN1_pu: " << GN1_pu);
494 GN1_pc = GN1pc_accessor(*obj_storing_btag);
495 ATH_MSG_DEBUG(" GN1_pc: " << GN1_pc);
496 GN1_pb = GN1pb_accessor(*obj_storing_btag);
497 ATH_MSG_DEBUG(" GN1_pb: " << GN1_pb);
498 theLLR_GN1 = LLR (GN1_pu, GN1_pc, GN1_pb, GN1_mv);
499 ATH_MSG_DEBUG(" GN1_mv: " << GN1_mv << " LLR: " << theLLR_GN1);
500 }
501 if (GN2pu_accessor.isAvailable(*obj_storing_btag)) {
502 double GN2_pu(-1.), GN2_pc(-1.), GN2_pb(-1.);
503 GN2_pu = GN2pu_accessor(*obj_storing_btag);
504 ATH_MSG_DEBUG(" GN2_pu: " << GN2_pu);
505 GN2_pc = GN2pc_accessor(*obj_storing_btag);
506 ATH_MSG_DEBUG(" GN2_pc: " << GN2_pc);
507 GN2_pb = GN2pb_accessor(*obj_storing_btag);
508 ATH_MSG_DEBUG(" GN2_pb: " << GN2_pb);
509 theLLR_GN2 = LLR (GN2_pu, GN2_pc, GN2_pb, GN2_mv);
510 ATH_MSG_DEBUG(" GN2_mv: " << GN2_mv << " LLR: " << theLLR_GN2);
511 }
512 }// if ijet==0
513
514 ijet++;
515
516 }// for onlinejets
517
518 imuon++;
519
520 }// for onlinemuons
521
522 // muon vs jet histograms
523
524 // Delta R(muon,jet)
525 std::string DeltaRH = "DeltaR_"+trigName;
526 ATH_MSG_DEBUG( " DeltaRH: " << DeltaRH );
527 auto DeltaR = Monitored::Scalar<float>(DeltaRH,0.0);
528 float DeltaEta = muonEta1 - jetEta1;
529 float DeltaPhi = phiCorr( phiCorr(muonPhi1) - phiCorr(jetPhi1) );
530 DeltaR = sqrt( DeltaEta*DeltaEta + DeltaPhi*DeltaPhi );
531 ATH_MSG_DEBUG(" Delta R : " << DeltaR);
532 fill("TrigBjetMonitor",DeltaR);
533
534 // Delta Z(muon,jet)
535 std::string DeltaZH = "DeltaZ_"+trigName;
536 ATH_MSG_DEBUG( " DeltaZH: " << DeltaZH );
537 auto DeltaZ = Monitored::Scalar<float>(DeltaZH,0.0);
538 DeltaZ = std::abs(muonZ1-jetZ1);
539 ATH_MSG_DEBUG(" Delta Z : " << DeltaZ);
540 if (plotDeltaZ) fill("TrigBjetMonitor",DeltaZ);
541
542 // muonPt/jetPt
543 std::string RatioPtH = "RatioPt_"+trigName;
544 ATH_MSG_DEBUG( " RatioPtH: " << RatioPtH );
545 auto RatioPt = Monitored::Scalar<float>(RatioPtH,0.0);
546 RatioPt = -100.;
547 if (jetPt1 > 0.) RatioPt = muonPt1/jetPt1;
548 ATH_MSG_DEBUG(" RatioPt : " << RatioPt);
549 if (RatioPt > 0.) fill("TrigBjetMonitor",RatioPt);
550
551 // muonPt relative to jet direction
552 std::string RelPtH = "RelPt_"+trigName;
553 ATH_MSG_DEBUG( " RelPtH: " << RelPtH );
554 auto RelPt = Monitored::Scalar<float>(RelPtH,0.0);
555 RelPt = 1.e10;
556 bool calc_relpt = CalcRelPt (muonPt1, muonEta1, muonPhi1, jetPt1, jetEta1, jetPhi1, RelPt);
557 ATH_MSG_DEBUG(" RelPt : " << RelPt);
558
559 // wGN1
560 std::string wGN1H = "wGN1_"+trigName;
561 ATH_MSG_DEBUG( " NameH: " << wGN1H );
562 auto wGN1 = Monitored::Scalar<float>(wGN1H,0.0);
563 wGN1 = float(GN1_mv);
564 ATH_MSG_DEBUG(" wGN1: " << wGN1 << " RelPt : " << RelPt);
565 if (calc_relpt && theLLR_GN1) fill("TrigBjetMonitor",wGN1,RelPt);
566
567 // wGN2
568 std::string wGN2H = "wGN2_"+trigName;
569 ATH_MSG_DEBUG( " NameH: " << wGN2H );
570 auto wGN2 = Monitored::Scalar<float>(wGN2H,0.0);
571 wGN2 = float(GN2_mv);
572 ATH_MSG_DEBUG(" wGN2: " << wGN2 << " RelPt : " << RelPt);
573 if (calc_relpt && theLLR_GN2) fill("TrigBjetMonitor",wGN2,RelPt);
574
575 } // if (nMuon*nJet > 0)
576
577 }// if mujetChain
578
579 // bjet chains
580 if (bjetChain) {
581
582 // Jets and PV and tracks through jet link
583
584 std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDecTool->features<xAOD::JetContainer>(trigName, TrigDefs::Physics); // TM 2021-10-30
585
586 int ijet = 0;
587 int itrack = 0;
588 std::string nJetH = "nJet_"+trigName;
589 auto nJet = Monitored::Scalar<int>(nJetH,0.0);
590 nJet = onlinejets.size();
591 fill("TrigBjetMonitor",nJet);
592
593 if (nJet > 0) {
594
595 for(const auto& jetLinkInfo : onlinejets) {
596 const xAOD::Jet* jet = *(jetLinkInfo.link);
597 // jetPt
598 std::string NameH = "jetPt_"+trigName;
599 ATH_MSG_DEBUG( " NameH: " << NameH );
600 auto jetPt = Monitored::Scalar<float>(NameH,0.0);
601 jetPt = (jet->pt())*1.e-3;
602 ATH_MSG_DEBUG(" jetPt: " << jetPt);
603 fill("TrigBjetMonitor",jetPt);
604 // jetEta
605 NameH = "jetEta_"+trigName;
606 ATH_MSG_DEBUG( " NameH: " << NameH );
607 auto jetEta = Monitored::Scalar<float>(NameH,0.0);
608 jetEta = jet->eta();
609 // jetPhi
610 NameH = "jetPhi_"+trigName;
611 ATH_MSG_DEBUG( " NameH: " << NameH );
612 auto jetPhi = Monitored::Scalar<float>(NameH,0.0);
613 jetPhi = jet->phi();
614 ATH_MSG_DEBUG(" jetEta: " << jetEta << " jetPhi : " << jetPhi);
615 fill("TrigBjetMonitor",jetEta,jetPhi);
616
617 // zPV associated to the jets in the same event: they are the same for every jet in the same event so only the first zPV should be plotted
618 if (ijet == 0) {
619
620 // Fetch and plot PV
621
622 std::string vtxname = m_onlineVertexContainerKey.key();
623 if ( vtxname.compare(0, 4, "HLT_")==0 ) vtxname.erase(0,4);
624 auto vertexLinkInfo = TrigCompositeUtils::findLink<xAOD::VertexContainer>(jetLinkInfo.source, vtxname ); // CV 200120 & MS 290620
625 ATH_CHECK( vertexLinkInfo.isValid() ) ; // TM 200120
626 const xAOD::Vertex* vtx = *(vertexLinkInfo.link);
627 NameH = "PVz_jet_"+trigName;
628 ATH_MSG_DEBUG( " NameH: " << NameH );
629 auto PVz_jet = Monitored::Scalar<float>(NameH,0.0);
630 PVz_jet = vtx->z();
631 ATH_MSG_DEBUG(" PVz_jet: " << PVz_jet);
632 fill("TrigBjetMonitor",PVz_jet);
633 NameH = "PVx_jet_"+trigName;
634 ATH_MSG_DEBUG( " NameH: " << NameH );
635 auto PVx_jet = Monitored::Scalar<float>(NameH,0.0);
636 PVx_jet = vtx->x();
637 ATH_MSG_DEBUG(" PVx_jet: " << PVx_jet);
638 fill("TrigBjetMonitor",PVx_jet);
639 NameH = "PVy_jet_"+trigName;
640 ATH_MSG_DEBUG( " NameH: " << NameH );
641 auto PVy_jet = Monitored::Scalar<float>(NameH,0.0);
642 PVy_jet = vtx->y();
643 ATH_MSG_DEBUG(" PVy_jet: " << PVy_jet);
644 fill("TrigBjetMonitor",PVy_jet);
645
646
647 } // if (ijet == 0)
648
649 ijet++;
650
651 // Fetch and plot BTagging information
652 const SG::AuxElement* obj_storing_btag = nullptr;
653 auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, m_btaggingLinkName); // TM 2021-10-30
654 if ( btaggingLinkInfo.isValid() ) {
655 obj_storing_btag = *(btaggingLinkInfo.link);
656 }
657 else {
658 obj_storing_btag = *(jetLinkInfo.link);
659 }
660
661 bool theLLR(false);
662 static const SG::AuxElement::ConstAccessor<float> GN1pu_accessor("GN120220813_pu");
663 static const SG::AuxElement::ConstAccessor<float> GN1pc_accessor("GN120220813_pc");
664 static const SG::AuxElement::ConstAccessor<float> GN1pb_accessor("GN120220813_pb");
665 static const SG::AuxElement::ConstAccessor<float> GN2pu_accessor("GN220240122_pu");
666 static const SG::AuxElement::ConstAccessor<float> GN2pc_accessor("GN220240122_pc");
667 static const SG::AuxElement::ConstAccessor<float> GN2pb_accessor("GN220240122_pb");
668 // checking only pu should be sufficient
669 bool GN1_available = GN1pu_accessor.isAvailable(*obj_storing_btag);
670 bool GN2_available = GN2pu_accessor.isAvailable(*obj_storing_btag);
671 NameH = "GN1_pu_tr_"+trigName;
672 ATH_MSG_DEBUG( " NameH: " << NameH );
673 auto GN1_pu = Monitored::Scalar<double>(NameH,0.0);
674 GN1_pu = GN1_available ? GN1pu_accessor(*obj_storing_btag) : -1.0;
675 ATH_MSG_DEBUG(" GN1_pu: " << GN1_pu);
676 fill("TrigBjetMonitor",GN1_pu);
677
678 NameH = "GN1_pc_tr_"+trigName;
679 ATH_MSG_DEBUG( " NameH: " << NameH );
680 auto GN1_pc = Monitored::Scalar<double>(NameH,0.0);
681 GN1_pc = GN1_available ? GN1pc_accessor(*obj_storing_btag) : -1.0;
682 ATH_MSG_DEBUG(" GN1_pc: " << GN1_pc);
683 fill("TrigBjetMonitor",GN1_pc);
684
685 NameH = "GN1_pb_tr_"+trigName;
686 ATH_MSG_DEBUG( " NameH: " << NameH );
687 auto GN1_pb = Monitored::Scalar<double>(NameH,0.0);
688 GN1_pb = GN1_available ? GN1pb_accessor(*obj_storing_btag) : -1.0;
689 ATH_MSG_DEBUG(" GN1_pb: " << GN1_pb);
690 fill("TrigBjetMonitor",GN1_pb);
691
692 NameH = "GN1_mv_tr_"+trigName;
693 ATH_MSG_DEBUG( " NameH: " << NameH );
694 auto GN1_mv = Monitored::Scalar<double>(NameH,0.0);
695 theLLR = LLR (GN1_pu, GN1_pc, GN1_pb, GN1_mv);
696 if ( theLLR ) fill("TrigBjetMonitor",GN1_mv);
697 ATH_MSG_DEBUG(" GN1_mv: " << GN1_mv << " LLR: " << theLLR);
698
699
700 NameH = "GN2_pu_tr_"+trigName;
701 ATH_MSG_DEBUG( " NameH: " << NameH );
702 auto GN2_pu = Monitored::Scalar<double>(NameH,0.0);
703 GN2_pu = GN2_available ? GN2pu_accessor(*obj_storing_btag) : -1.0;
704 ATH_MSG_DEBUG(" GN2_pu: " << GN2_pu);
705 fill("TrigBjetMonitor",GN2_pu);
706
707 NameH = "GN2_pc_tr_"+trigName;
708 ATH_MSG_DEBUG( " NameH: " << NameH );
709 auto GN2_pc = Monitored::Scalar<double>(NameH,0.0);
710 GN2_pc = GN2_available ? GN2pc_accessor(*obj_storing_btag) : -1.0;
711 ATH_MSG_DEBUG(" GN2_pc: " << GN2_pc);
712 fill("TrigBjetMonitor",GN2_pc);
713
714 NameH = "GN2_pb_tr_"+trigName;
715 ATH_MSG_DEBUG( " NameH: " << NameH );
716 auto GN2_pb = Monitored::Scalar<double>(NameH,0.0);
717 GN2_pb = GN2_available ? GN2pb_accessor(*obj_storing_btag) : -1.0;
718 ATH_MSG_DEBUG(" GN2_pb: " << GN2_pb);
719 fill("TrigBjetMonitor",GN2_pb);
720
721 NameH = "GN2_mv_tr_"+trigName;
722 ATH_MSG_DEBUG( " NameH: " << NameH );
723 auto GN2_mv = Monitored::Scalar<double>(NameH,0.0);
724 theLLR = LLR (GN2_pu, GN2_pc, GN2_pb, GN2_mv);
725 if ( theLLR ) fill("TrigBjetMonitor",GN2_mv);
726 ATH_MSG_DEBUG(" GN2_mv: " << GN2_mv << " LLR: " << theLLR);
727
728
729 // Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020
730 const auto track_it_pair = m_trigDecTool->associateToEventView(theTracks, jetLinkInfo.source, "roi");
731 const xAOD::TrackParticleContainer::const_iterator start_it = track_it_pair.first;
732 const xAOD::TrackParticleContainer::const_iterator end_it = track_it_pair.second;
733
734 int count = 0;
735 for ( xAOD::TrackParticleContainer::const_iterator it = start_it; it != end_it; ++it) {
736 count++;
737 ATH_MSG_DEBUG( " Track " << count << " with pT " << (*it)->pt() <<" from BJet with pT " << (*jetLinkInfo.link)->pt() );
738 ATH_MSG_DEBUG( " Track " << count << " with pT/eta/phi " << (*it)->pt() << "/" << (*it)->eta() << "/" << (*it)->phi() );
739 ATH_MSG_DEBUG( " Track " << count << " with d0/sigd0 " << (*it)->d0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 0) );
740 ATH_MSG_DEBUG( " Track " << count << " with z0/sigz0 " << (*it)->z0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 1) );
741 std::string NameH = "trkPt_"+trigName;
742 ATH_MSG_DEBUG( " NameH: " << NameH );
743 auto trkPt = Monitored::Scalar<float>(NameH,0.0);
744 trkPt = ((*it)->pt())*1.e-3;
745 ATH_MSG_DEBUG(" trkPt: " << trkPt);
746 fill("TrigBjetMonitor",trkPt);
747 NameH = "trkEta_"+trigName;
748 ATH_MSG_DEBUG( " NameH: " << NameH );
749 auto trkEta = Monitored::Scalar<float>(NameH,0.0);
750 trkEta = (*it)->eta();
751 NameH = "trkPhi_"+trigName;
752 ATH_MSG_DEBUG( " NameH: " << NameH );
753 auto trkPhi = Monitored::Scalar<float>(NameH,0.0);
754 trkPhi = (*it)->phi();
755 ATH_MSG_DEBUG(" trkEta: " << trkEta << " trkPhi : " << trkPhi);
756 fill("TrigBjetMonitor",trkEta,trkPhi);
757 NameH = "d0_"+trigName;
758 ATH_MSG_DEBUG( " NameH: " << NameH );
759 auto d0 = Monitored::Scalar<float>(NameH,0.0);
760 d0 = (*it)->d0();
761 ATH_MSG_DEBUG(" d0: " << d0);
762 fill("TrigBjetMonitor",d0);
763 NameH = "z0_"+trigName;
764 ATH_MSG_DEBUG( " NameH: " << NameH );
765 auto z0 = Monitored::Scalar<float>(NameH,0.0);
766 z0 = (*it)->z0();
767 ATH_MSG_DEBUG(" z0: " << z0);
768 fill("TrigBjetMonitor",z0);
769 NameH = "ed0_"+trigName;
770 ATH_MSG_DEBUG( " NameH: " << NameH );
771 auto ed0 = Monitored::Scalar<float>(NameH,0.0);
772 ed0 = Amg::error((*it)->definingParametersCovMatrix(), 0);
773 ATH_MSG_DEBUG(" ed0: " << ed0);
774 fill("TrigBjetMonitor",ed0);
775 NameH = "sd0_"+trigName;
776 ATH_MSG_DEBUG( " NameH: " << NameH );
777 auto sd0 = Monitored::Scalar<float>(NameH,0.0);
778 sd0 = -10.;
779 if (ed0 > 0.) sd0 = std::abs(d0)/ed0;
780 ATH_MSG_DEBUG(" sd0: " << sd0);
781 fill("TrigBjetMonitor",sd0);
782 NameH = "ez0_"+trigName;
783 ATH_MSG_DEBUG( " NameH: " << NameH );
784 auto ez0 = Monitored::Scalar<float>(NameH,0.0);
785 ez0 = Amg::error((*it)->definingParametersCovMatrix(), 1);
786 ATH_MSG_DEBUG(" ez0: " << ez0);
787 fill("TrigBjetMonitor",ez0);
788 } // it on tracks
789 ATH_MSG_DEBUG( " Number of tracks: " << count );
790 itrack += count;
791
792 } // jetLinkInfo from onlinejets
793
794 ATH_MSG_DEBUG(" Total number of triggered b-jets: " << ijet << " nJet : " << nJet);
795 ATH_MSG_DEBUG(" Total number of triggered tracks associated to the b-jets: " << itrack);
796 std::string nTrackH = "nTrack_"+trigName;
797 auto nTrack = Monitored::Scalar<int>(nTrackH,0.0);
798 nTrack = itrack;
799 fill("TrigBjetMonitor",nTrack);
800
801 } // if (nJet > 0)
802
803 } //if bjetChain
804
805 } else {
806 ATH_MSG_DEBUG(" Chain " << trigName << " is declared for the Express Stream but it is NOT in the Express Stream in an Express Job");
807 } // if m_expressStreamFlag
808
809 } else {
810 ATH_MSG_DEBUG( " Trigger chain from AllChains list: " << trigName << " has not fired " );
811 } // trigger not fired
812
813
814 } // for AllChains
815
816 return StatusCode::SUCCESS;
817}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
bool LLRW(float pqcd, float ptop, float phbb, float &w)
bool LLR(double pu, double pc, double pb, double &w)
float phiCorr(float phi)
bool CalcRelPt(float muonPt, float muonEta, float muonPhi, float jetPt, float jetEta, float jetPhi, float &RelPt)
#define y
#define x
#define z
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< xAOD::VertexContainer > m_offlineVertexContainerKey
Gaudi::Property< bool > m_expressStreamFlag
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_onlineTrackContainerKey
Gaudi::Property< std::vector< std::string > > m_allChains
Gaudi::Property< std::string > m_btaggingLinkName
SG::ReadHandleKey< xAOD::VertexContainer > m_onlineVertexContainerKey
Gaudi::Property< bool > m_collisionRun
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
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.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
@ PriVtx
Primary vertex.
Jet_v1 Jet
Definition of the current "jet version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
Muon_v1 Muon
Reference the current persistent version:
JetContainer_v1 JetContainer
Definition of the current "jet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ 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 ( const std::string & 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 (ATH_LIKELY(idx != m_toolLookupMap.end())) {
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)
#define ATH_LIKELY(x)
std::unordered_map< std::string, size_t > m_toolLookupMap
const ToolHandle< GenericMonitoringTool > m_dummy
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.

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

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 21 of file TrigBjetMonitorAlgorithm.cxx.

21 {
22 ATH_CHECK( m_muonContainerKey.initialize() );
23
29 ATH_CHECK( m_trigDecTool.retrieve() );
30
32}
virtual StatusCode initialize() override
initialize
SG::ReadHandleKey< xAOD::JetContainer > m_onlineEMTopoBJetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_onlineEMPFlowBJetContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey

◆ 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()

◆ 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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_allChains

Gaudi::Property<std::vector<std::string> > TrigBjetMonitorAlgorithm::m_allChains {this,"AllChains",{}}
private

Definition at line 29 of file TrigBjetMonitorAlgorithm.h.

29{this,"AllChains",{}};

◆ m_btaggingLinkName

Gaudi::Property<std::string> TrigBjetMonitorAlgorithm::m_btaggingLinkName {this, "BtaggingLinkName", "btag"}
private

Definition at line 26 of file TrigBjetMonitorAlgorithm.h.

26{this, "BtaggingLinkName", "btag"}; // TM 2021-10-30

◆ m_collisionRun

Gaudi::Property<bool> TrigBjetMonitorAlgorithm::m_collisionRun {this, "CollisionRun", true}
private

Definition at line 24 of file TrigBjetMonitorAlgorithm.h.

24{this, "CollisionRun", true};

◆ m_dataType

AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::m_dataType
protectedinherited

Instance of the DataType_t enum.

Definition at line 356 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 358 of file AthMonitorAlgorithm.h.

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

◆ m_defaultLBDuration

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

Default duration of one lumi block.

Definition at line 365 of file AthMonitorAlgorithm.h.

365{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 366 of file AthMonitorAlgorithm.h.

366{this,"DetailLevel",0};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DQFilterTools

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

Array of Data Quality filter tools.

Definition at line 346 of file AthMonitorAlgorithm.h.

346{this,"FilterTools",{}};

◆ m_dummy

const ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::m_dummy
privateinherited

Definition at line 374 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 377 of file AthMonitorAlgorithm.h.

377 {this,
378 "EnforceExpressTriggers", false,
379 "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 355 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 357 of file AthMonitorAlgorithm.h.

357{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 367 of file AthMonitorAlgorithm.h.

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

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_expressStreamFlag

Gaudi::Property<bool> TrigBjetMonitorAlgorithm::m_expressStreamFlag {this, "ExpressStreamFlag", false}
private

Definition at line 27 of file TrigBjetMonitorAlgorithm.h.

27{this, "ExpressStreamFlag", false}; // TM 2022-09-14

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fileKey

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

Internal Athena name for file.

Definition at line 363 of file AthMonitorAlgorithm.h.

363{this,"FileKey",""};

◆ m_lbDurationDataKey

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

Definition at line 350 of file AthMonitorAlgorithm.h.

351{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 348 of file AthMonitorAlgorithm.h.

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

◆ m_muonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> TrigBjetMonitorAlgorithm::m_muonContainerKey {this, "MuonContainerName", "Muons", "Muon Container Name"}
private

Definition at line 31 of file TrigBjetMonitorAlgorithm.h.

31{this, "MuonContainerName", "Muons", "Muon Container Name"};

◆ m_name

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 371 of file AthMonitorAlgorithm.h.

◆ m_offlineVertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> TrigBjetMonitorAlgorithm::m_offlineVertexContainerKey {this, "OfflineVertexContainerName", "PrimaryVertices", "Key of offline primary vertexes"}
private

Definition at line 32 of file TrigBjetMonitorAlgorithm.h.

32{this, "OfflineVertexContainerName", "PrimaryVertices", "Key of offline primary vertexes"};

◆ m_onlineEMPFlowBJetContainerKey

SG::ReadHandleKey<xAOD::JetContainer> TrigBjetMonitorAlgorithm::m_onlineEMPFlowBJetContainerKey {this, "OnlineEMPFlowBJetContainerKey", "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJets", "Key of online EMPFlow bjets"}
private

Definition at line 35 of file TrigBjetMonitorAlgorithm.h.

35{this, "OnlineEMPFlowBJetContainerKey", "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJets", "Key of online EMPFlow bjets"};

◆ m_onlineEMTopoBJetContainerKey

SG::ReadHandleKey<xAOD::JetContainer> TrigBjetMonitorAlgorithm::m_onlineEMTopoBJetContainerKey {this, "OnlineEMTopoBJetContainerKey", "HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf_bJets", "Key of online EMTopo bjets"}
private

Definition at line 36 of file TrigBjetMonitorAlgorithm.h.

36{this, "OnlineEMTopoBJetContainerKey", "HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf_bJets", "Key of online EMTopo bjets"};

◆ m_onlineTrackContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> TrigBjetMonitorAlgorithm::m_onlineTrackContainerKey {this, "OnlineTrackContainerName", "HLT_IDTrack_Bjet_IDTrig", "Key of online tracks of bjets"}
private

Definition at line 34 of file TrigBjetMonitorAlgorithm.h.

34{this, "OnlineTrackContainerName", "HLT_IDTrack_Bjet_IDTrig", "Key of online tracks of bjets"};

◆ m_onlineVertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> TrigBjetMonitorAlgorithm::m_onlineVertexContainerKey {this, "OnlineVertexContainerName", "HLT_IDVertex_FS", "Key of online bjet primary vertexes"}
private

Definition at line 33 of file TrigBjetMonitorAlgorithm.h.

33{this, "OnlineVertexContainerName", "HLT_IDVertex_FS", "Key of online bjet primary vertexes"}; // MS 290620

◆ m_toolLookupMap

std::unordered_map<std::string, size_t> AthMonitorAlgorithm::m_toolLookupMap
privateinherited

Definition at line 372 of file AthMonitorAlgorithm.h.

◆ m_tools

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

Array of Generic Monitoring Tools.

Definition at line 341 of file AthMonitorAlgorithm.h.

341{this,"GMTools",{}};

◆ m_trigDecTool

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

Tool to tell whether a specific trigger is passed.

Definition at line 345 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 360 of file AthMonitorAlgorithm.h.

360{this,"TriggerChain",""};

◆ m_trigLiveFractionDataKey

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

Definition at line 352 of file AthMonitorAlgorithm.h.

353{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 364 of file AthMonitorAlgorithm.h.

364{this,"EnableLumi",false};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 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 361 of file AthMonitorAlgorithm.h.


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