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=Gaudi::Hive::currentContext()) const
 Calculate the average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbLuminosityPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the instantaneous luminosity per bunch crossing.
virtual double lbDuration (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the duration of the luminosity block (in seconds)
virtual float lbAverageLivefraction (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the live fraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx=Gaudi::Hive::currentContext()) 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.

64{
65 return 0;
66}

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

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
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 link = muon->combinedTrackParticleLink(); // TM and DG 18/06/22
424 if (link.isValid()) {
425 plotDeltaZ = true;
426 const xAOD::TrackParticle* track = *link;
427 muonZ = track->z0() + track->vz();
428 } else {
429 plotDeltaZ = false;
430 muonZ = 0.;
431 }
432
433 if (imuon == 0) {
434 //store the parameter for the 1st muon
435 muonPt1 = muonPt;
436 muonEta1 = muonEta;
437 muonPhi1 = muonPhi;
438 muonZ1 = muonZ;
439 }// if imuon==0
440
441 // The associated jet loop
442 for(const auto& jetLinkInfo : onlinejets) {
443 const xAOD::Jet* jet = *(jetLinkInfo.link);
444 // jetPt
445 NameH = "jetPt_"+trigName;
446 ATH_MSG_DEBUG( " NameH: " << NameH );
447 auto jetPt = Monitored::Scalar<float>(NameH,0.0);
448 jetPt = (jet->pt())*1.e-3;
449 ATH_MSG_DEBUG(" jetPt: " << jetPt);
450 fill("TrigBjetMonitor",jetPt);
451 // jetEta
452 NameH = "jetEta_"+trigName;
453 ATH_MSG_DEBUG( " NameH: " << NameH );
454 auto jetEta = Monitored::Scalar<float>(NameH,0.0);
455 jetEta = jet->eta();
456 ATH_MSG_DEBUG(" jetEta : " << jetEta);
457 fill("TrigBjetMonitor",jetEta);
458 // jetPhi
459 NameH = "jetPhi_"+trigName;
460 ATH_MSG_DEBUG( " NameH: " << NameH );
461 auto jetPhi = Monitored::Scalar<float>(NameH,0.0);
462 jetPhi = jet->phi();
463 ATH_MSG_DEBUG(" jetPhi : " << jetPhi);
464
465 // Take the b-tagging info from the first jet
466 if (ijet == 0) {
467 //store the parameter for the 1st jet
468 jetPt1 = jetPt;
469 jetEta1 = jetEta;
470 jetPhi1 = jetPhi;
471 jetZ1 = zPrmVtx;
472
473 auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, m_btaggingLinkName); // TM 2021-10-30
474 const SG::AuxElement* obj_storing_btag = nullptr;
475 if ( btaggingLinkInfo.isValid() ) {
476 obj_storing_btag = *(btaggingLinkInfo.link);
477 }
478 else {
479 obj_storing_btag = *(jetLinkInfo.link);
480 }
481
482 static const SG::AuxElement::ConstAccessor<float> GN1pu_accessor("GN120220813_pu");
483 static const SG::AuxElement::ConstAccessor<float> GN1pc_accessor("GN120220813_pc");
484 static const SG::AuxElement::ConstAccessor<float> GN1pb_accessor("GN120220813_pb");
485
486 static const SG::AuxElement::ConstAccessor<float> GN2pu_accessor("GN220240122_pu");
487 static const SG::AuxElement::ConstAccessor<float> GN2pc_accessor("GN220240122_pc");
488 static const SG::AuxElement::ConstAccessor<float> GN2pb_accessor("GN220240122_pb");
489
490 // checking just pu is enough
491 if (GN1pu_accessor.isAvailable(*obj_storing_btag)) {
492 double GN1_pu(-1.), GN1_pc(-1.), GN1_pb(-1.);
493 GN1_pu = GN1pu_accessor(*obj_storing_btag);
494 ATH_MSG_DEBUG(" GN1_pu: " << GN1_pu);
495 GN1_pc = GN1pc_accessor(*obj_storing_btag);
496 ATH_MSG_DEBUG(" GN1_pc: " << GN1_pc);
497 GN1_pb = GN1pb_accessor(*obj_storing_btag);
498 ATH_MSG_DEBUG(" GN1_pb: " << GN1_pb);
499 theLLR_GN1 = LLR (GN1_pu, GN1_pc, GN1_pb, GN1_mv);
500 ATH_MSG_DEBUG(" GN1_mv: " << GN1_mv << " LLR: " << theLLR_GN1);
501 }
502 if (GN2pu_accessor.isAvailable(*obj_storing_btag)) {
503 double GN2_pu(-1.), GN2_pc(-1.), GN2_pb(-1.);
504 GN2_pu = GN2pu_accessor(*obj_storing_btag);
505 ATH_MSG_DEBUG(" GN2_pu: " << GN2_pu);
506 GN2_pc = GN2pc_accessor(*obj_storing_btag);
507 ATH_MSG_DEBUG(" GN2_pc: " << GN2_pc);
508 GN2_pb = GN2pb_accessor(*obj_storing_btag);
509 ATH_MSG_DEBUG(" GN2_pb: " << GN2_pb);
510 theLLR_GN2 = LLR (GN2_pu, GN2_pc, GN2_pb, GN2_mv);
511 ATH_MSG_DEBUG(" GN2_mv: " << GN2_mv << " LLR: " << theLLR_GN2);
512 }
513 }// if ijet==0
514
515 ijet++;
516
517 }// for onlinejets
518
519 imuon++;
520
521 }// for onlinemuons
522
523 // muon vs jet histograms
524
525 // Delta R(muon,jet)
526 std::string DeltaRH = "DeltaR_"+trigName;
527 ATH_MSG_DEBUG( " DeltaRH: " << DeltaRH );
528 auto DeltaR = Monitored::Scalar<float>(DeltaRH,0.0);
529 float DeltaEta = muonEta1 - jetEta1;
530 float DeltaPhi = phiCorr( phiCorr(muonPhi1) - phiCorr(jetPhi1) );
531 DeltaR = sqrt( DeltaEta*DeltaEta + DeltaPhi*DeltaPhi );
532 ATH_MSG_DEBUG(" Delta R : " << DeltaR);
533 fill("TrigBjetMonitor",DeltaR);
534
535 // Delta Z(muon,jet)
536 std::string DeltaZH = "DeltaZ_"+trigName;
537 ATH_MSG_DEBUG( " DeltaZH: " << DeltaZH );
538 auto DeltaZ = Monitored::Scalar<float>(DeltaZH,0.0);
539 DeltaZ = std::abs(muonZ1-jetZ1);
540 ATH_MSG_DEBUG(" Delta Z : " << DeltaZ);
541 if (plotDeltaZ) fill("TrigBjetMonitor",DeltaZ);
542
543 // muonPt/jetPt
544 std::string RatioPtH = "RatioPt_"+trigName;
545 ATH_MSG_DEBUG( " RatioPtH: " << RatioPtH );
546 auto RatioPt = Monitored::Scalar<float>(RatioPtH,0.0);
547 RatioPt = -100.;
548 if (jetPt1 > 0.) RatioPt = muonPt1/jetPt1;
549 ATH_MSG_DEBUG(" RatioPt : " << RatioPt);
550 if (RatioPt > 0.) fill("TrigBjetMonitor",RatioPt);
551
552 // muonPt relative to jet direction
553 std::string RelPtH = "RelPt_"+trigName;
554 ATH_MSG_DEBUG( " RelPtH: " << RelPtH );
555 auto RelPt = Monitored::Scalar<float>(RelPtH,0.0);
556 RelPt = 1.e10;
557 bool calc_relpt = CalcRelPt (muonPt1, muonEta1, muonPhi1, jetPt1, jetEta1, jetPhi1, RelPt);
558 ATH_MSG_DEBUG(" RelPt : " << RelPt);
559
560 // wGN1
561 std::string wGN1H = "wGN1_"+trigName;
562 ATH_MSG_DEBUG( " NameH: " << wGN1H );
563 auto wGN1 = Monitored::Scalar<float>(wGN1H,0.0);
564 wGN1 = float(GN1_mv);
565 ATH_MSG_DEBUG(" wGN1: " << wGN1 << " RelPt : " << RelPt);
566 if (calc_relpt && theLLR_GN1) fill("TrigBjetMonitor",wGN1,RelPt);
567
568 // wGN2
569 std::string wGN2H = "wGN2_"+trigName;
570 ATH_MSG_DEBUG( " NameH: " << wGN2H );
571 auto wGN2 = Monitored::Scalar<float>(wGN2H,0.0);
572 wGN2 = float(GN2_mv);
573 ATH_MSG_DEBUG(" wGN2: " << wGN2 << " RelPt : " << RelPt);
574 if (calc_relpt && theLLR_GN2) fill("TrigBjetMonitor",wGN2,RelPt);
575
576 } // if (nMuon*nJet > 0)
577
578 }// if mujetChain
579
580 // bjet chains
581 if (bjetChain) {
582
583 // Jets and PV and tracks through jet link
584
585 std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDecTool->features<xAOD::JetContainer>(trigName, TrigDefs::Physics); // TM 2021-10-30
586
587 int ijet = 0;
588 int itrack = 0;
589 std::string nJetH = "nJet_"+trigName;
590 auto nJet = Monitored::Scalar<int>(nJetH,0.0);
591 nJet = onlinejets.size();
592 fill("TrigBjetMonitor",nJet);
593
594 if (nJet > 0) {
595
596 for(const auto& jetLinkInfo : onlinejets) {
597 const xAOD::Jet* jet = *(jetLinkInfo.link);
598 // jetPt
599 std::string NameH = "jetPt_"+trigName;
600 ATH_MSG_DEBUG( " NameH: " << NameH );
601 auto jetPt = Monitored::Scalar<float>(NameH,0.0);
602 jetPt = (jet->pt())*1.e-3;
603 ATH_MSG_DEBUG(" jetPt: " << jetPt);
604 fill("TrigBjetMonitor",jetPt);
605 // jetEta
606 NameH = "jetEta_"+trigName;
607 ATH_MSG_DEBUG( " NameH: " << NameH );
608 auto jetEta = Monitored::Scalar<float>(NameH,0.0);
609 jetEta = jet->eta();
610 // jetPhi
611 NameH = "jetPhi_"+trigName;
612 ATH_MSG_DEBUG( " NameH: " << NameH );
613 auto jetPhi = Monitored::Scalar<float>(NameH,0.0);
614 jetPhi = jet->phi();
615 ATH_MSG_DEBUG(" jetEta: " << jetEta << " jetPhi : " << jetPhi);
616 fill("TrigBjetMonitor",jetEta,jetPhi);
617
618 // 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
619 if (ijet == 0) {
620
621 // Fetch and plot PV
622
623 std::string vtxname = m_onlineVertexContainerKey.key();
624 if ( vtxname.compare(0, 4, "HLT_")==0 ) vtxname.erase(0,4);
625 auto vertexLinkInfo = TrigCompositeUtils::findLink<xAOD::VertexContainer>(jetLinkInfo.source, vtxname ); // CV 200120 & MS 290620
626 ATH_CHECK( vertexLinkInfo.isValid() ) ; // TM 200120
627 const xAOD::Vertex* vtx = *(vertexLinkInfo.link);
628 NameH = "PVz_jet_"+trigName;
629 ATH_MSG_DEBUG( " NameH: " << NameH );
630 auto PVz_jet = Monitored::Scalar<float>(NameH,0.0);
631 PVz_jet = vtx->z();
632 ATH_MSG_DEBUG(" PVz_jet: " << PVz_jet);
633 fill("TrigBjetMonitor",PVz_jet);
634 NameH = "PVx_jet_"+trigName;
635 ATH_MSG_DEBUG( " NameH: " << NameH );
636 auto PVx_jet = Monitored::Scalar<float>(NameH,0.0);
637 PVx_jet = vtx->x();
638 ATH_MSG_DEBUG(" PVx_jet: " << PVx_jet);
639 fill("TrigBjetMonitor",PVx_jet);
640 NameH = "PVy_jet_"+trigName;
641 ATH_MSG_DEBUG( " NameH: " << NameH );
642 auto PVy_jet = Monitored::Scalar<float>(NameH,0.0);
643 PVy_jet = vtx->y();
644 ATH_MSG_DEBUG(" PVy_jet: " << PVy_jet);
645 fill("TrigBjetMonitor",PVy_jet);
646
647
648 } // if (ijet == 0)
649
650 ijet++;
651
652 // Fetch and plot BTagging information
653 const SG::AuxElement* obj_storing_btag = nullptr;
654 auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, m_btaggingLinkName); // TM 2021-10-30
655 if ( btaggingLinkInfo.isValid() ) {
656 obj_storing_btag = *(btaggingLinkInfo.link);
657 }
658 else {
659 obj_storing_btag = *(jetLinkInfo.link);
660 }
661
662 bool theLLR(false);
663 static const SG::AuxElement::ConstAccessor<float> GN1pu_accessor("GN120220813_pu");
664 static const SG::AuxElement::ConstAccessor<float> GN1pc_accessor("GN120220813_pc");
665 static const SG::AuxElement::ConstAccessor<float> GN1pb_accessor("GN120220813_pb");
666 static const SG::AuxElement::ConstAccessor<float> GN2pu_accessor("GN220240122_pu");
667 static const SG::AuxElement::ConstAccessor<float> GN2pc_accessor("GN220240122_pc");
668 static const SG::AuxElement::ConstAccessor<float> GN2pb_accessor("GN220240122_pb");
669 // checking only pu should be sufficient
670 bool GN1_available = GN1pu_accessor.isAvailable(*obj_storing_btag);
671 bool GN2_available = GN2pu_accessor.isAvailable(*obj_storing_btag);
672 NameH = "GN1_pu_tr_"+trigName;
673 ATH_MSG_DEBUG( " NameH: " << NameH );
674 auto GN1_pu = Monitored::Scalar<double>(NameH,0.0);
675 GN1_pu = GN1_available ? GN1pu_accessor(*obj_storing_btag) : -1.0;
676 ATH_MSG_DEBUG(" GN1_pu: " << GN1_pu);
677 fill("TrigBjetMonitor",GN1_pu);
678
679 NameH = "GN1_pc_tr_"+trigName;
680 ATH_MSG_DEBUG( " NameH: " << NameH );
681 auto GN1_pc = Monitored::Scalar<double>(NameH,0.0);
682 GN1_pc = GN1_available ? GN1pc_accessor(*obj_storing_btag) : -1.0;
683 ATH_MSG_DEBUG(" GN1_pc: " << GN1_pc);
684 fill("TrigBjetMonitor",GN1_pc);
685
686 NameH = "GN1_pb_tr_"+trigName;
687 ATH_MSG_DEBUG( " NameH: " << NameH );
688 auto GN1_pb = Monitored::Scalar<double>(NameH,0.0);
689 GN1_pb = GN1_available ? GN1pb_accessor(*obj_storing_btag) : -1.0;
690 ATH_MSG_DEBUG(" GN1_pb: " << GN1_pb);
691 fill("TrigBjetMonitor",GN1_pb);
692
693 NameH = "GN1_mv_tr_"+trigName;
694 ATH_MSG_DEBUG( " NameH: " << NameH );
695 auto GN1_mv = Monitored::Scalar<double>(NameH,0.0);
696 theLLR = LLR (GN1_pu, GN1_pc, GN1_pb, GN1_mv);
697 if ( theLLR ) fill("TrigBjetMonitor",GN1_mv);
698 ATH_MSG_DEBUG(" GN1_mv: " << GN1_mv << " LLR: " << theLLR);
699
700
701 NameH = "GN2_pu_tr_"+trigName;
702 ATH_MSG_DEBUG( " NameH: " << NameH );
703 auto GN2_pu = Monitored::Scalar<double>(NameH,0.0);
704 GN2_pu = GN2_available ? GN2pu_accessor(*obj_storing_btag) : -1.0;
705 ATH_MSG_DEBUG(" GN2_pu: " << GN2_pu);
706 fill("TrigBjetMonitor",GN2_pu);
707
708 NameH = "GN2_pc_tr_"+trigName;
709 ATH_MSG_DEBUG( " NameH: " << NameH );
710 auto GN2_pc = Monitored::Scalar<double>(NameH,0.0);
711 GN2_pc = GN2_available ? GN2pc_accessor(*obj_storing_btag) : -1.0;
712 ATH_MSG_DEBUG(" GN2_pc: " << GN2_pc);
713 fill("TrigBjetMonitor",GN2_pc);
714
715 NameH = "GN2_pb_tr_"+trigName;
716 ATH_MSG_DEBUG( " NameH: " << NameH );
717 auto GN2_pb = Monitored::Scalar<double>(NameH,0.0);
718 GN2_pb = GN2_available ? GN2pb_accessor(*obj_storing_btag) : -1.0;
719 ATH_MSG_DEBUG(" GN2_pb: " << GN2_pb);
720 fill("TrigBjetMonitor",GN2_pb);
721
722 NameH = "GN2_mv_tr_"+trigName;
723 ATH_MSG_DEBUG( " NameH: " << NameH );
724 auto GN2_mv = Monitored::Scalar<double>(NameH,0.0);
725 theLLR = LLR (GN2_pu, GN2_pc, GN2_pb, GN2_mv);
726 if ( theLLR ) fill("TrigBjetMonitor",GN2_mv);
727 ATH_MSG_DEBUG(" GN2_mv: " << GN2_mv << " LLR: " << theLLR);
728
729
730 // Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020
731 const auto track_it_pair = m_trigDecTool->associateToEventView(theTracks, jetLinkInfo.source, "roi");
732 const xAOD::TrackParticleContainer::const_iterator start_it = track_it_pair.first;
733 const xAOD::TrackParticleContainer::const_iterator end_it = track_it_pair.second;
734
735 int count = 0;
736 for ( xAOD::TrackParticleContainer::const_iterator it = start_it; it != end_it; ++it) {
737 count++;
738 ATH_MSG_DEBUG( " Track " << count << " with pT " << (*it)->pt() <<" from BJet with pT " << (*jetLinkInfo.link)->pt() );
739 ATH_MSG_DEBUG( " Track " << count << " with pT/eta/phi " << (*it)->pt() << "/" << (*it)->eta() << "/" << (*it)->phi() );
740 ATH_MSG_DEBUG( " Track " << count << " with d0/sigd0 " << (*it)->d0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 0) );
741 ATH_MSG_DEBUG( " Track " << count << " with z0/sigz0 " << (*it)->z0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 1) );
742 std::string NameH = "trkPt_"+trigName;
743 ATH_MSG_DEBUG( " NameH: " << NameH );
744 auto trkPt = Monitored::Scalar<float>(NameH,0.0);
745 trkPt = ((*it)->pt())*1.e-3;
746 ATH_MSG_DEBUG(" trkPt: " << trkPt);
747 fill("TrigBjetMonitor",trkPt);
748 NameH = "trkEta_"+trigName;
749 ATH_MSG_DEBUG( " NameH: " << NameH );
750 auto trkEta = Monitored::Scalar<float>(NameH,0.0);
751 trkEta = (*it)->eta();
752 NameH = "trkPhi_"+trigName;
753 ATH_MSG_DEBUG( " NameH: " << NameH );
754 auto trkPhi = Monitored::Scalar<float>(NameH,0.0);
755 trkPhi = (*it)->phi();
756 ATH_MSG_DEBUG(" trkEta: " << trkEta << " trkPhi : " << trkPhi);
757 fill("TrigBjetMonitor",trkEta,trkPhi);
758 NameH = "d0_"+trigName;
759 ATH_MSG_DEBUG( " NameH: " << NameH );
760 auto d0 = Monitored::Scalar<float>(NameH,0.0);
761 d0 = (*it)->d0();
762 ATH_MSG_DEBUG(" d0: " << d0);
763 fill("TrigBjetMonitor",d0);
764 NameH = "z0_"+trigName;
765 ATH_MSG_DEBUG( " NameH: " << NameH );
766 auto z0 = Monitored::Scalar<float>(NameH,0.0);
767 z0 = (*it)->z0();
768 ATH_MSG_DEBUG(" z0: " << z0);
769 fill("TrigBjetMonitor",z0);
770 NameH = "ed0_"+trigName;
771 ATH_MSG_DEBUG( " NameH: " << NameH );
772 auto ed0 = Monitored::Scalar<float>(NameH,0.0);
773 ed0 = Amg::error((*it)->definingParametersCovMatrix(), 0);
774 ATH_MSG_DEBUG(" ed0: " << ed0);
775 fill("TrigBjetMonitor",ed0);
776 NameH = "sd0_"+trigName;
777 ATH_MSG_DEBUG( " NameH: " << NameH );
778 auto sd0 = Monitored::Scalar<float>(NameH,0.0);
779 sd0 = -10.;
780 if (ed0 > 0.) sd0 = std::abs(d0)/ed0;
781 ATH_MSG_DEBUG(" sd0: " << sd0);
782 fill("TrigBjetMonitor",sd0);
783 NameH = "ez0_"+trigName;
784 ATH_MSG_DEBUG( " NameH: " << NameH );
785 auto ez0 = Monitored::Scalar<float>(NameH,0.0);
786 ez0 = Amg::error((*it)->definingParametersCovMatrix(), 1);
787 ATH_MSG_DEBUG(" ez0: " << ez0);
788 fill("TrigBjetMonitor",ez0);
789 } // it on tracks
790 ATH_MSG_DEBUG( " Number of tracks: " << count );
791 itrack += count;
792
793 } // jetLinkInfo from onlinejets
794
795 ATH_MSG_DEBUG(" Total number of triggered b-jets: " << ijet << " nJet : " << nJet);
796 ATH_MSG_DEBUG(" Total number of triggered tracks associated to the b-jets: " << itrack);
797 std::string nTrackH = "nTrack_"+trigName;
798 auto nTrack = Monitored::Scalar<int>(nTrackH,0.0);
799 nTrack = itrack;
800 fill("TrigBjetMonitor",nTrack);
801
802 } // if (nJet > 0)
803
804 } //if bjetChain
805
806 } else {
807 ATH_MSG_DEBUG(" Chain " << trigName << " is declared for the Express Stream but it is NOT in the Express Stream in an Express Job");
808 } // if m_expressStreamFlag
809
810 } else {
811 ATH_MSG_DEBUG( " Trigger chain from AllChains list: " << trigName << " has not fired " );
812 } // trigger not fired
813
814
815 } // for AllChains
816
817 return StatusCode::SUCCESS;
818}
#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:146
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 ...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
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 if (ATH_LIKELY(idx != m_toolLookupMap.end())) {
172 return m_tools[idx->second];
173 }
174 else {
175 // treat empty tool handle case as in Monitored::Group
176 if (m_toolLookupMap.empty()) {
177 return m_dummy;
178 }
179
180 if (!isInitialized()) {
182 "It seems that the AthMonitorAlgorithm::initialize was not called "
183 "in derived class initialize method");
184 } else {
185 std::string available = std::accumulate(
186 m_toolLookupMap.begin(), m_toolLookupMap.end(), std::string(""),
187 [](const std::string& s, auto h) { return s + "," + h.first; });
188 ATH_MSG_FATAL("The tool " << name << " could not be found in the tool array of the "
189 << "monitoring algorithm " << m_name << ". This probably reflects a discrepancy between "
190 << "your python configuration and c++ filling code. Note: your available groups are {"
191 << available << "}.");
192 }
193 }
194 return m_dummy;
195}
#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 198 of file AthMonitorAlgorithm.cxx.

198 {
199 return m_trigDecTool;
200}

◆ 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 345 of file AthMonitorAlgorithm.cxx.

345 {
346 std::string item;
347 std::stringstream ss(line);
348
349 ATH_MSG_DEBUG( "AthMonitorAlgorithm::parseList()" );
350
351 while ( std::getline(ss, item, ',') ) {
352 std::stringstream iss(item); // remove whitespace
353 iss >> item;
354 result.push_back(item);
355 }
356
357 return StatusCode::SUCCESS;
358}
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.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ 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.

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

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