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

#include <JetEfficiencyMonitorAlgorithm.h>

Inheritance diagram for JetEfficiencyMonitorAlgorithm:
Collaboration diagram for JetEfficiencyMonitorAlgorithm:

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

 JetEfficiencyMonitorAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~JetEfficiencyMonitorAlgorithm ()=default
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

Public Attributes

dict plateau_dict = {}
dict threshold_dict
 flags = initConfigFlags()
 inputs = glob.glob('/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/00354311/data18_13TeV.00354311.physics_Main.recon.ESD.f1129/data18_13TeV.00354311.physics_Main.recon.ESD.f1129._lb0013._SFO-8._0001.1')
 Files
 HISTFileName
 cfg = MainServicesCfg(flags)
 JetEfficiencyMonitorCfg = JetEfficiencyMonitoringConfig(flags)
 OutputLevel

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

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

Private Attributes

StringProperty m_packageName {this,"PackageName","JetEfficiencyMonitor","group name for histograming"}
StringProperty m_bootstrap_reference_trigger {this,"BootstrapReferenceTrigger","L1_J15","the bootstrapping trigger"}
Gaudi::Property< std::vector< std::string > > m_muon_reference_triggers {this,"MuonReferenceTriggers",{},"the muon refernce triggers"}
Gaudi::Property< std::vector< std::string > > m_HLTrandom_reference_triggers {this,"HLTRandomReferenceTriggers",{},"the random refernce trigger"}
Gaudi::Property< bool > m_passedb4Prescale {this,"PassedBeforePrescale",0,"boolean of if we want to measure the efficiency based on passed before prescale"}
Gaudi::Property< std::vector< std::string > > m_SmallRadiusJetTriggers_phase1 {this,"SmallRadiusJetTriggers_phase1",{},"Vector of all Small radius triggers"}
Gaudi::Property< std::vector< std::string > > m_LargeRadiusJetTriggers_phase1 {this,"LargeRadiusJetTriggers_phase1",{},"Vector of all Large radius triggers"}
Gaudi::Property< std::vector< std::string > > m_SmallRadiusJetTriggers_gFEX {this,"SmallRadiusJetTriggers_gFEX",{},"Vector of all small radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"}
Gaudi::Property< std::vector< std::string > > m_LargeRadiusJetTriggers_gFEX {this,"LargeRadiusJetTriggers_gFEX",{},"Vector of all large radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"}
SG::ReadHandleKey< xAOD::JetContainerm_jetKey { this, "JetKey" , "AntiKt4EMPFlowJets", ""}
SG::ReadHandleKey< xAOD::JetContainerm_LRjetKey { this, "LRJetKey" , "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets", ""}
SG::ReadHandleKey< xAOD::gFexJetRoIContainerm_gFexSRJetContainerKey { this, "mygFexSRJetRoIContainer" , "L1_gFexSRJetRoI" , ""}
SG::ReadHandleKey< xAOD::gFexJetRoIContainerm_gFexLRJetContainerKey { this, "mygFexLRJetRoIContainer" , "L1_gFexLRJetRoI" , ""}
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 24 of file JetEfficiencyMonitorAlgorithm.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

◆ JetEfficiencyMonitorAlgorithm()

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

Definition at line 56 of file JetEfficiencyMonitorAlgorithm.cxx.

57 : AthMonitorAlgorithm(name,pSvcLocator)
58{
59}
Base class for Athena Monitoring Algorithms.

◆ ~JetEfficiencyMonitorAlgorithm()

virtual JetEfficiencyMonitorAlgorithm::~JetEfficiencyMonitorAlgorithm ( )
virtualdefault

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.

◆ extractgFEXThresholdValue()

int JetEfficiencyMonitorAlgorithm::extractgFEXThresholdValue ( const std::string & key) const
private

Definition at line 35 of file JetEfficiencyMonitorAlgorithm.cxx.

35 {
36 std::regex pattern(R"(L1_g(?:LJ|J)(\d+)(?:p0ETA25)?)");
37 std::smatch match;
38 if (std::regex_search(key, match, pattern)) {
39 int threshold = std::stoi(match[1]) * GeV;
40 if (key.find("gLJ") != std::string::npos) { //the gLJ threshold is actually 30 GeV less than the threshold in the name
41 threshold -= 30 * GeV;
42 }
43 if (threshold < 0) {
44 ATH_MSG_WARNING("Extracted threshold for " << key << " is negative!");
45 }
46 ATH_MSG_DEBUG("Trigger " << key << ": extracted threshold " << threshold );
47 return threshold;
48 } else {
49 ATH_MSG_WARNING("Trigger " << key << " threshold not extracted!");
50 return -1; // Error indicator
51 }
52}
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:357

◆ 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 JetEfficiencyMonitorAlgorithm::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 74 of file JetEfficiencyMonitorAlgorithm.cxx.

74 {
75 ATH_MSG_DEBUG("JetEfficiencyMonitorAlgorithm::fillHistograms");
76 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> variables;
77
78 // Retrieve Offline Jets from SG
79 SG::ReadHandle<xAOD::JetContainer> jets(m_jetKey,ctx);
80 if(!jets.isValid()){
81 ATH_MSG_WARNING("Failed to retrieve Offline Small Radius Jet Container " << m_jetKey<< ". Will be skipped!");
82 }
83 // Retrieve Offline LR Jets from SG
84 SG::ReadHandle<xAOD::JetContainer> LRjets(m_LRjetKey,ctx);
85 if(!LRjets.isValid()){
86 ATH_MSG_WARNING("Failed to retrieve Offline Large Radius Jet Container "<<m_LRjetKey<< ". Will be skipped!");
87 }
88
89 // reterive the gFEX Jets from SG, only if we plan on accessing them!
90 // Declare the map of gFEX contianers
91 std::map<std::string, SG::ReadHandle<xAOD::gFexJetRoIContainer>> gFEX_Container;
92
93 // Retrieve gFex SR Jets from SG
94 if (!m_gFexSRJetContainerKey.empty()) {
95 SG::ReadHandle<xAOD::gFexJetRoIContainer> gFexSRJetContainer{m_gFexSRJetContainerKey, ctx};
96 if (!gFexSRJetContainer.isValid()) {
97 ATH_MSG_WARNING("No gFex Small Radius Jet container found in storegate " << m_gFexSRJetContainerKey);
98 } else {
99 gFEX_Container.emplace("leadingGfex_SmallRadiusTOB", gFexSRJetContainer);
100 }
101 }
102
103 // Retrieve gFex LR Jets from SG
104 if (!m_gFexLRJetContainerKey.empty()) {
105 SG::ReadHandle<xAOD::gFexJetRoIContainer> gFexLRJetContainer{m_gFexLRJetContainerKey, ctx};
106 if (!gFexLRJetContainer.isValid()) {
107 ATH_MSG_WARNING("No gFex Large Radius Jet container found in storegate " << m_gFexLRJetContainerKey);
108 } else {
109 gFEX_Container.emplace("leadingGfex_LargeRadiusTOB", gFexLRJetContainer);
110 }
111 }
112
113
116 //DEFINITIONS and extracting variables from the python config file!
117 bool use_passed_before_prescale = m_passedb4Prescale;
118 const std::string& bootstrap_trigger = m_bootstrap_reference_trigger.value();
119 const std::vector<std::string>& muon_triggers = m_muon_reference_triggers.value();
120 const std::vector<std::string>& HLTrandom_triggers = m_HLTrandom_reference_triggers.value();
121 std::vector<std::string> gFex_types {"leadingGfex_SmallRadiusTOB", "leadingGfex_LargeRadiusTOB"};
122
123
124 //Define the various reference vector things!
125 std::vector<std::string> reference_trigger_options {"Bootstrap", "RandomHLT", "No", "Muon"};
126
127 bool bootstrap_ref_decision = false; //bootstrap trigger decision
128 bool random_ref_decision = false; //random reference triggers decision
129 bool muon_ref_decision = false; //muon reference triggers decision
130
131
132
133 bootstrap_ref_decision = AthMonitorAlgorithm::getTrigDecisionTool()->isPassed(bootstrap_trigger);
134 for (auto & u : muon_triggers) {
135 if (AthMonitorAlgorithm::getTrigDecisionTool()->isPassed(u)) {muon_ref_decision = true;}
136 } //close iterating through the muon triggers
137
138 //then for the HLT decision chains, we always want to use the traditional way of getting our trigger deicsion
139 for (auto & u : HLTrandom_triggers) {
140 if (AthMonitorAlgorithm::getTrigDecisionTool()->isPassed(u)) {random_ref_decision = true;}
141 } //close iterating through the HLT random chains
142
143
144 std::map<std::string, bool> reference_trigger_decision {
145 {"Bootstrap", bootstrap_ref_decision },
146 {"RandomHLT", random_ref_decision},
147 {"No", true},
148 {"Muon", muon_ref_decision}
149 };
150
151
152 //definition of variables for the offlineSRJet_maxEta_minPt_requirement and offlineLRJet_maxEta_minPt_requirement
153 //these just force us to have a minimum pt, and limited eta region for our efficiency checks
154 constexpr int minPt = 10*GeV;
155 constexpr float maxEta = 2.5;
156
157 //fill maps that allow us to keep track of variables according to the different containers
158 float offline_SR_pt = 0, offline_LR_pt = 0, gfex_SR_pt = 0, gfex_LR_pt=0;
159 std::map<std::string, float> jet_pt {
160 {"leadingOffline_SmallRadiusJet", offline_SR_pt},
161 {"leadingOffline_LargeRadiusJet", offline_LR_pt},
162 {"leadingGfex_SmallRadiusTOB", gfex_SR_pt},
163 {"leadingGfex_LargeRadiusTOB", gfex_LR_pt}
164 };
165
166 float offline_SR_eta = 0, offline_LR_eta = 0, gfex_SR_eta = 0, gfex_LR_eta=0;
167 std::map<std::string, float> jet_eta {
168 {"leadingOffline_SmallRadiusJet", offline_SR_eta},
169 {"leadingOffline_LargeRadiusJet", offline_LR_eta},
170 {"leadingGfex_SmallRadiusTOB", gfex_SR_eta},
171 {"leadingGfex_LargeRadiusTOB", gfex_LR_eta}
172 };
173
174 float offline_SR_phi = 0, offline_LR_phi = 0, gfex_SR_phi = 0, gfex_LR_phi=0;
175 std::map<std::string, float> jet_phi {
176 {"leadingOffline_SmallRadiusJet", offline_SR_phi},
177 {"leadingOffline_LargeRadiusJet", offline_LR_phi},
178 {"leadingGfex_SmallRadiusTOB", gfex_SR_phi},
179 {"leadingGfex_LargeRadiusTOB", gfex_LR_phi}
180 };
181
182
185 // Fill pt, eta and phi vals for all the containers!
186 //offline jet containers
187 if (jets.isValid()){
188 if (!jets->empty()) { //check that there are jets before accessing the container
189 xAOD::JetContainer::const_iterator leading_offline_SR_jet = jets->begin(); //the first jet in the contianer is the leading jet
190 jet_pt["leadingOffline_SmallRadiusJet"] = (*leading_offline_SR_jet)->pt();
191 jet_eta["leadingOffline_SmallRadiusJet"] = (*leading_offline_SR_jet)->eta();
192 jet_phi["leadingOffline_SmallRadiusJet"] = (*leading_offline_SR_jet)->phi();
193 }
194 } //(close IF) jets size > 0 loop
195 //LR jet containers
196 if (LRjets.isValid()){
197 if (!LRjets->empty()) { //check that there are jets before accessing the container
198 xAOD::JetContainer::const_iterator leading_offline_LR_jet = LRjets->begin(); //the first jet in the contianer is the leading jet
199 jet_pt["leadingOffline_LargeRadiusJet"] = (*leading_offline_LR_jet)->pt();
200 jet_eta["leadingOffline_LargeRadiusJet"] = (*leading_offline_LR_jet)->eta();
201 jet_phi["leadingOffline_LargeRadiusJet"] = (*leading_offline_LR_jet)->phi();
202 } //(close IF) LRjets size > 0 loop
203 }
204 // gFex SR and LR TOB containers
205 // when we emulate the gfex trigger decision, we just want to find the leading gFEX TOB
206 // its not gaurenteed that these TOBs are pt ordered, so well iterate through them
207 float max_gfex_pt = -1.0; // Track max pt
208 const xAOD::gFexJetRoI* most_energetic_gfex_jet = nullptr;
209
210 for (auto & g : gFex_types) { // Iterate through SR and LR gFex jets
211 if(auto itr = gFEX_Container.find(g); itr != gFEX_Container.end() ) { //check that we were able to access the contianer
212 for (const auto* gfex_jet : *(itr->second)) {// Iterate through gFex jets
213 float gfex_pt = gfex_jet->et();
214 if (gfex_pt > max_gfex_pt && std::abs(gfex_jet->eta()) < maxEta) { // Track highest pt jet
215 max_gfex_pt = gfex_pt;
216 most_energetic_gfex_jet = gfex_jet;
217 }
218 }
219 if(most_energetic_gfex_jet) {
220 jet_eta[g] = most_energetic_gfex_jet->eta();
221 jet_phi[g] = most_energetic_gfex_jet->phi();
222 jet_pt[g] = most_energetic_gfex_jet->et();
223 }
224 }
225 }
226
227 // #####################
228 // #####################
229 //Physical cuts applied to all events on the offline jets
230 //requring a minimum pt threshold
231 //and maximum eta threshold
232
233 //offline SR Jet requriment
234 bool offlineSRJet_maxEta_minPt_requirement = false;
235 if(std::abs(jet_eta["leadingOffline_SmallRadiusJet"])<=maxEta && (jet_pt["leadingOffline_SmallRadiusJet"] >= minPt)) {
236 offlineSRJet_maxEta_minPt_requirement = true;
237 }
238
239 // offline LR Jet requriment
240 bool offlineLRJet_maxEta_minPt_requirement = false;
241 if(std::abs(jet_eta["leadingOffline_LargeRadiusJet"])<=maxEta && (jet_pt["leadingOffline_LargeRadiusJet"] >= minPt)) {
242 offlineLRJet_maxEta_minPt_requirement = true;
243 }
244
245 // #####################
246 // #####################
247 // Fill sample histograms of the pt and eta of leading SR jet
248 if (offlineSRJet_maxEta_minPt_requirement ) {
249 auto raw_pt = Monitored::Scalar<float>("raw_pt", jet_pt["leadingOffline_SmallRadiusJet"]);
250 auto raw_eta = Monitored::Scalar<float>("raw_eta", jet_eta["leadingOffline_SmallRadiusJet"]);
251 fill(m_packageName, raw_pt, raw_eta);
252 }
253 // #####################
254 // #####################
255
256
257 // FILL EFFIENCY HISTOGRAMS INVOLVING SMALL RADIUS OFFLINE JETS
258 for (auto & r : reference_trigger_options){ //iterate through the refernce triggers
259 if (offlineSRJet_maxEta_minPt_requirement && reference_trigger_decision[r]) { //check that the physical cuts and reference trigger is passed
260 //get the pt of leading jet
261 auto pt_ref = Monitored::Scalar<float>("val_SRpt", jet_pt["leadingOffline_SmallRadiusJet"]);
262
263 for (const auto& trigger_name : m_SmallRadiusJetTriggers_phase1){
264 bool trig_of_interest_decision = false; //default definition of the trigger of interest decison to be false,
265 if (use_passed_before_prescale) {
266 //We can choose if we want to use pass before prescale, or not when defining our trigger efficiency
267 //this boolean is defiend in the jeteffmonalg.py file
268 const unsigned int bits = AthMonitorAlgorithm::getTrigDecisionTool()->isPassedBits(trigger_name);
269 trig_of_interest_decision = bits & TrigDefs::L1_isPassedBeforePrescale;
270 } else { trig_of_interest_decision = AthMonitorAlgorithm::getTrigDecisionTool()->isPassed(trigger_name); }
271
272 //get values and fill the histogram of offline jet pt and boolean of trigger passing
273 auto passed_pt_bool = Monitored::Scalar<bool>("bool_"+r+"_"+trigger_name, trig_of_interest_decision);
274 fill(m_packageName, pt_ref, passed_pt_bool);
275
276 //filling histograms that are effiency curves as a funciton of eta
277 //in order to ensure that we are isolating only the eta behavior, we have a
278 // flatline value where the pt effiencies aproximtley flatten out to 1
279 //these are hard coded, and saved for only a few of the triggers!
280 auto l1_trigger_flat_val = l1_trigger_flatline_vals.find(trigger_name);
281 if (l1_trigger_flat_val != l1_trigger_flatline_vals.end()) {
282 if(jet_pt["leadingOffline_SmallRadiusJet"]>l1_trigger_flat_val->second) { //is jet pt greater than the flatline value?
283 //get value of eta, and histogram passing boolean and fill
284 auto eta_ref = Monitored::Scalar<float>("val_SReta", jet_eta["leadingOffline_SmallRadiusJet"]);
285 auto passed_eta = Monitored::Scalar<bool>("bool_" + r + "_" + trigger_name, trig_of_interest_decision);
286 fill(m_packageName, eta_ref, passed_eta);
287 //if the trigger passes, we can also add the eta value to a stand alone histogram
288 } //(close IF) jet pt is greater than pt flatline vlaue loop
289 } //(close IF) loop that checks if the trigger of interest is in list of flatline trigger vals
290 } //(close FOR) loop that iterates through all of L1 single jet triggers we make effiency curves for
291
292 // if a gFEX trigger is not defined in the menu, then we populate the turn on curve using TOBs
293 // check the map to see if there is a predefined
294 for (const auto& trigger_name : m_SmallRadiusJetTriggers_gFEX) {
295 bool trig_of_interest_decision = false; // Default to false
296 int gFEX_threshold = -1; // Default invalid threshold value
297 // Check if the trigger name exists in the map first
298 auto gFEX_threshold_it = gFEX_trigger_thresholds.find(trigger_name);
299 if (gFEX_threshold_it != gFEX_trigger_thresholds.end()) {
300 gFEX_threshold = gFEX_threshold_it->second;
301 ATH_MSG_DEBUG("gfex threshold in map! "<< gFEX_threshold);
302 } else {
303 // If not found in the map, extract the threshold dynamically
304 gFEX_threshold = extractgFEXThresholdValue(trigger_name);
305 }
306 ATH_MSG_DEBUG("gfex threshold used: "<< gFEX_threshold);
307 // Proceed only if a valid threshold was obtained
308 if (gFEX_threshold != -1) {
309 if (jet_pt["leadingGfex_SmallRadiusTOB"] >= gFEX_threshold) {
310 trig_of_interest_decision = true;
311 }
312 }
313 // Get values and fill the histogram of offline jet pt and boolean of trigger passing
314 auto passed_pt_bool_gFEX = Monitored::Scalar<bool>("bool_" + r + "_" + trigger_name, trig_of_interest_decision);
315 fill(m_packageName, pt_ref, passed_pt_bool_gFEX);
316 }
317
318 } //(close IF) loop that checks if the reference trigger and physical property pass is passed
319 } //(close FOR) the iteration that fills effiency histogram for 4 different kinds of refernce triggers
320
323 //FILL EFFIENCY HISTOGRAMS INVOLVING LARGE RADIUS OFFLINE JETS
324
325 for (auto & r : reference_trigger_options){ //iterate through the reference triggers
326 if ( offlineLRJet_maxEta_minPt_requirement && reference_trigger_decision[r]) { //check that the physical cuts and reference trigger is passed
327 auto pt_ref = Monitored::Scalar<float>("val_LRpt", jet_pt["leadingOffline_LargeRadiusJet"]);
328
329 for (const auto& trigger_name : m_LargeRadiusJetTriggers_phase1){
330 bool trig_of_interest_decision = false;
331 if (use_passed_before_prescale) {
332 const unsigned int bits = AthMonitorAlgorithm::getTrigDecisionTool()->isPassedBits(trigger_name);
333 trig_of_interest_decision = bits & TrigDefs::L1_isPassedBeforePrescale;
334 } else { trig_of_interest_decision = AthMonitorAlgorithm::getTrigDecisionTool()->isPassed(trigger_name); }
335
336
337 auto passed_pt_bool = Monitored::Scalar<bool>("bool_"+r+"_"+trigger_name, trig_of_interest_decision);
338 fill(m_packageName, pt_ref, passed_pt_bool);
339
340
341 //filling histograms that are effiency curves as a funciton of eta
342 auto l1_trigger_flat_val = l1_trigger_flatline_vals.find(trigger_name);
343 if (l1_trigger_flat_val != l1_trigger_flatline_vals.end()) {
344 if(jet_pt["leadingOffline_LargelRadiusJet"]>l1_trigger_flat_val->second) { //is jet pt greater than the flatline value?
345 //get value of eta, and histogram passing boolean and fill
346 auto eta_ref = Monitored::Scalar<float>("val_LReta", jet_eta["leadingOffline_LargeRadiusJet"]);
347 auto passed_eta = Monitored::Scalar<bool>("bool_" + r + "_" + trigger_name, trig_of_interest_decision);
348 fill(m_packageName, eta_ref, passed_eta);
349 //if the trigger passes, we can also add the eta value to a stand alone histogram
350 } //(close IF) jet pt is greater than pt flatline vlaue loop
351 } //(close IF) loop that checks if the trigger of interest is in list of flatline trigger vals
352 for (const auto& trigger_name : m_LargeRadiusJetTriggers_gFEX) {
353 bool trig_of_interest_decision = false; // Default to false
354 int gFEX_threshold = -1; // Default invalid threshold value
355 // Check if the trigger name exists in the map first
356 auto gFEX_threshold_it = gFEX_trigger_thresholds.find(trigger_name);
357 if (gFEX_threshold_it != gFEX_trigger_thresholds.end()) {
358 gFEX_threshold = gFEX_threshold_it->second;
359 } else {
360 // If not found in the map, extract the threshold dynamically
361 gFEX_threshold = extractgFEXThresholdValue(trigger_name);
362 }
363 // Proceed only if a valid threshold was obtained
364 if (gFEX_threshold != -1) {
365 if (jet_pt["leadingGfex_LargeRadiusTOB"] >= gFEX_threshold) {
366 trig_of_interest_decision = true;
367 }
368 }
369 // Get values and fill the histogram of offline jet pt and boolean of trigger passing
370 auto passed_pt_bool_gFEX = Monitored::Scalar<bool>("bool_" + r + "_" + trigger_name, trig_of_interest_decision);
371 fill(m_packageName, pt_ref, passed_pt_bool_gFEX);
372 }
373 } //(close FOR) loop that iterates through all of the triggers we make effiency curves for
374 } //(close FOR) the iteration that fills effiency histogram for 4 different kinds of refernce triggers
375 } //(close IF) loop that checks if the physical properties were passed for the jet
376
377 variables.clear();
378 return StatusCode::SUCCESS;
379}
static const std::map< std::string, int > l1_trigger_flatline_vals
static const std::map< std::string, int > gFEX_trigger_thresholds
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
int extractgFEXThresholdValue(const std::string &key) const
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexLRJetContainerKey
Gaudi::Property< std::vector< std::string > > m_HLTrandom_reference_triggers
Gaudi::Property< std::vector< std::string > > m_muon_reference_triggers
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexSRJetContainerKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
float phi() const
High value of phi corresponding to phi index (using gFex convention, phi in [0, 2pi]).
float eta() const
retrieves the Eta index from the 32-bit word
float et() const
retrieves the Et index from the 32-bit word
int r
Definition globals.cxx:22
constexpr float maxEta
gFexJetRoI_v1 gFexJetRoI
Define the latest version of the gFexJetRoI class.
Definition gFexJetRoI.h:16
void fill(H5::Group &out_file, size_t iterations)

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

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 61 of file JetEfficiencyMonitorAlgorithm.cxx.

61 {
62 ATH_MSG_DEBUG("JetEfficiencyMonitorAlgorith::initialize");
63 ATH_MSG_DEBUG("Package Name "<< m_packageName);
64
65 // we initialise all the containers that we need
66 ATH_CHECK(m_jetKey.initialize() ); //initialize offline SR jets
67 ATH_CHECK(m_LRjetKey.initialize() ); //initialize offline LR jets
68 ATH_CHECK(m_gFexLRJetContainerKey.initialize(SG::AllowEmpty)); //initizlize gfex lr jets
69 ATH_CHECK(m_gFexSRJetContainerKey.initialize(SG::AllowEmpty)); //initizlize gfex sr jets
70
72}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
initialize

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

◆ 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}
#define ATH_MSG_ERROR(x)
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

◆ cfg

JetEfficiencyMonitorAlgorithm.cfg = MainServicesCfg(flags)

Definition at line 275 of file JetEfficiencyMonitorAlgorithm.py.

◆ Files

JetEfficiencyMonitorAlgorithm.Files

Definition at line 266 of file JetEfficiencyMonitorAlgorithm.py.

◆ flags

JetEfficiencyMonitorAlgorithm.flags = initConfigFlags()

Definition at line 259 of file JetEfficiencyMonitorAlgorithm.py.

◆ HISTFileName

JetEfficiencyMonitorAlgorithm.HISTFileName

Definition at line 267 of file JetEfficiencyMonitorAlgorithm.py.

◆ inputs

JetEfficiencyMonitorAlgorithm.inputs = glob.glob('/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/00354311/data18_13TeV.00354311.physics_Main.recon.ESD.f1129/data18_13TeV.00354311.physics_Main.recon.ESD.f1129._lb0013._SFO-8._0001.1')

Definition at line 263 of file JetEfficiencyMonitorAlgorithm.py.

◆ JetEfficiencyMonitorCfg

JetEfficiencyMonitorAlgorithm.JetEfficiencyMonitorCfg = JetEfficiencyMonitoringConfig(flags)

Definition at line 278 of file JetEfficiencyMonitorAlgorithm.py.

◆ m_bootstrap_reference_trigger

StringProperty JetEfficiencyMonitorAlgorithm::m_bootstrap_reference_trigger {this,"BootstrapReferenceTrigger","L1_J15","the bootstrapping trigger"}
private

Definition at line 32 of file JetEfficiencyMonitorAlgorithm.h.

32{this,"BootstrapReferenceTrigger","L1_J15","the bootstrapping trigger"};

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

SG::ReadHandleKey<xAOD::gFexJetRoIContainer> JetEfficiencyMonitorAlgorithm::m_gFexLRJetContainerKey { this, "mygFexLRJetRoIContainer" , "L1_gFexLRJetRoI" , ""}
private

Definition at line 51 of file JetEfficiencyMonitorAlgorithm.h.

51{ this, "mygFexLRJetRoIContainer" , "L1_gFexLRJetRoI" , ""}; //gfex LR jets

◆ m_gFexSRJetContainerKey

SG::ReadHandleKey<xAOD::gFexJetRoIContainer> JetEfficiencyMonitorAlgorithm::m_gFexSRJetContainerKey { this, "mygFexSRJetRoIContainer" , "L1_gFexSRJetRoI" , ""}
private

Definition at line 50 of file JetEfficiencyMonitorAlgorithm.h.

50{ this, "mygFexSRJetRoIContainer" , "L1_gFexSRJetRoI" , ""}; //gfex SR jets

◆ m_HLTrandom_reference_triggers

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_HLTrandom_reference_triggers {this,"HLTRandomReferenceTriggers",{},"the random refernce trigger"}
private

Definition at line 34 of file JetEfficiencyMonitorAlgorithm.h.

34{this,"HLTRandomReferenceTriggers",{},"the random refernce trigger"};

◆ m_jetKey

SG::ReadHandleKey<xAOD::JetContainer> JetEfficiencyMonitorAlgorithm::m_jetKey { this, "JetKey" , "AntiKt4EMPFlowJets", ""}
private

Definition at line 48 of file JetEfficiencyMonitorAlgorithm.h.

48{ this, "JetKey" , "AntiKt4EMPFlowJets", ""}; //offline jets

◆ m_LargeRadiusJetTriggers_gFEX

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_LargeRadiusJetTriggers_gFEX {this,"LargeRadiusJetTriggers_gFEX",{},"Vector of all large radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"}
private

Definition at line 41 of file JetEfficiencyMonitorAlgorithm.h.

41{this,"LargeRadiusJetTriggers_gFEX",{},"Vector of all large radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"};

◆ m_LargeRadiusJetTriggers_phase1

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_LargeRadiusJetTriggers_phase1 {this,"LargeRadiusJetTriggers_phase1",{},"Vector of all Large radius triggers"}
private

Definition at line 38 of file JetEfficiencyMonitorAlgorithm.h.

38{this,"LargeRadiusJetTriggers_phase1",{},"Vector of all Large radius triggers"};

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

SG::ReadHandleKey<xAOD::JetContainer> JetEfficiencyMonitorAlgorithm::m_LRjetKey { this, "LRJetKey" , "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets", ""}
private

Definition at line 49 of file JetEfficiencyMonitorAlgorithm.h.

49{ this, "LRJetKey" , "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets", ""}; //offline LR jets

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

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_muon_reference_triggers {this,"MuonReferenceTriggers",{},"the muon refernce triggers"}
private

Definition at line 33 of file JetEfficiencyMonitorAlgorithm.h.

33{this,"MuonReferenceTriggers",{},"the muon refernce triggers"};

◆ m_name

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 371 of file AthMonitorAlgorithm.h.

◆ m_packageName

StringProperty JetEfficiencyMonitorAlgorithm::m_packageName {this,"PackageName","JetEfficiencyMonitor","group name for histograming"}
private

Definition at line 30 of file JetEfficiencyMonitorAlgorithm.h.

30{this,"PackageName","JetEfficiencyMonitor","group name for histograming"};

◆ m_passedb4Prescale

Gaudi::Property<bool> JetEfficiencyMonitorAlgorithm::m_passedb4Prescale {this,"PassedBeforePrescale",0,"boolean of if we want to measure the efficiency based on passed before prescale"}
private

Definition at line 35 of file JetEfficiencyMonitorAlgorithm.h.

35{this,"PassedBeforePrescale",0,"boolean of if we want to measure the efficiency based on passed before prescale"};

◆ m_SmallRadiusJetTriggers_gFEX

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_SmallRadiusJetTriggers_gFEX {this,"SmallRadiusJetTriggers_gFEX",{},"Vector of all small radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"}
private

Definition at line 40 of file JetEfficiencyMonitorAlgorithm.h.

40{this,"SmallRadiusJetTriggers_gFEX",{},"Vector of all small radius gFEX triggers, whose trigger decision is emulated using gFEX TOB values"};

◆ m_SmallRadiusJetTriggers_phase1

Gaudi::Property<std::vector<std::string> > JetEfficiencyMonitorAlgorithm::m_SmallRadiusJetTriggers_phase1 {this,"SmallRadiusJetTriggers_phase1",{},"Vector of all Small radius triggers"}
private

Definition at line 37 of file JetEfficiencyMonitorAlgorithm.h.

37{this,"SmallRadiusJetTriggers_phase1",{},"Vector of all Small radius triggers"};

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

◆ OutputLevel

JetEfficiencyMonitorAlgorithm.OutputLevel

Definition at line 283 of file JetEfficiencyMonitorAlgorithm.py.

◆ plateau_dict

dict JetEfficiencyMonitorAlgorithm.plateau_dict = {}

Definition at line 228 of file JetEfficiencyMonitorAlgorithm.py.

◆ threshold_dict

dict JetEfficiencyMonitorAlgorithm.threshold_dict
Initial value:
= {"L1_gJ20p0ETA25" : [55e3, 75e3], #hits 50% at 50 for a good run, 100% around 75
"L1_gJ50p0ETA25" : [110e3, 180e3], #hits 50% at 109 for a good run, 100% around 180
"L1_gJ100p0ETA25" : [195e3, 3000e3],#hits 50% at 185 for a good run, 100% around 300
"L1_gJ400p0ETA25" : [620e3, 900e3],#hits 50% at 611 for a good run, 100% around 900
"L1_gLJ80p0ETA25" : [125e3, 200e3],#hits 50% at 113 for a good run, 100% around 200
"L1_gLJ100p0ETA25" : [150e3, 240e3],#hits 50% at 137 for a good run, 100% around 240
"L1_gLJ140p0ETA25" : [210e3, 315e3],#hits 50% at 197 for a good run, 100% around 315
"L1_gLJ160p0ETA25" : [240e3, 260e3],#hits 50% at 225 for a good run, 100% around 350
"L1_jJ30" : [50e3, 85e3],#hits 50% at 46 for a good run, 100% around 85
"L1_jJ40" : [55e3, 90e3],#hits 50% at 47 for a good run, 100% around 90
"L1_jJ50" : [60e3, 100e3],#hits 50% at 53 for a good run, 100% around 100
"L1_jJ60" : [90e3, 130e3],#hits 50% at 85 for a good run, 100% around 130
"L1_jJ80" : [90e3, 155e3],#hits 50% at 86 for a good run, 100% around 155
"L1_jJ90" : [110e3, 185e3],#hits 50% at 105 for a good run, 100% around 185
"L1_jJ125" : [145e3, 230e3],#hits 50% at 140 for a good run, 100% around 230
"L1_jJ140" : [160e3, 225e3],#hits 50% at 150 for a good run, 100% around 255
"L1_jJ160" : [180e3, 260e3],#hits 50% at 170 for a good run, 100% around 260
"L1_jJ180" : [235e3, 320e3],#hits 50% at 223 for a good run, 100% around 320
"L1_SC175-SCjJ10": [195e3, 300e3],#hits 50% at 190 for a good run, 100% around 300
}

Definition at line 229 of file JetEfficiencyMonitorAlgorithm.py.


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