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

#include <TrigTauMonitorL1Algorithm.h>

Inheritance diagram for TrigTauMonitorL1Algorithm:
Collaboration diagram for TrigTauMonitorL1Algorithm:

Public Types

enum  TauID { None = 0 , RNN = 1 , GNTau = 2 }
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

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

Protected Member Functions

std::map< std::string, TrigTauInfo > & getTrigInfoMap ()
const TrigTauInfogetTrigInfo (const std::string &trigger) const
std::vector< const xAOD::TauJet * > getOnlineTausAll (const std::string &trigger, bool include_0P=true, bool filter_legs=false) const
std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > getOnlineTaus (const EventContext &ctx, const std::string &trigger) const
std::vector< const xAOD::TauJet * > getOfflineTausAll (const EventContext &ctx, const float threshold=20.0) const
std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > getOfflineTaus (const EventContext &ctx, const float threshold=20.0, const TauID tau_id=TauID::None) const
std::vector< const xAOD::eFexTauRoI * > getL1eTAUs (const EventContext &ctx, const std::string &l1_item) const
std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > getL1cTAUs (const EventContext &ctx, const std::string &l1_item) const
double dR (const double eta1, const double phi1, const double eta2, const double phi2) const
template<typename T1 = xAOD::IParticle, typename T2 = xAOD::IParticle>
bool matchObjects (const T1 *tau, const std::vector< const T2 * > &tau_vec, float threshold) const
bool matchObjects (const TLorentzVector &tau, const std::vector< TLorentzVector > &tau_vec, float threshold) const
template<typename T1 = xAOD::IParticle, typename T2 = xAOD::eFexTauRoI>
bool matchObjects (const T1 *tau_1, const T2 *tau_2, float threshold) const
template<typename T1 = xAOD::IParticle, typename T2 = xAOD::IParticle>
bool matchTruthObjects (const T1 *true_tau, const std::vector< const T2 * > &tau_vec, float threshold) const
std::vector< const xAOD::TauJet * > classifyTausAll (const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOfflineTaus (const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOnlineTaus (const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0) const
const SG::ReadHandleKey< xAOD::TauJetContainer > & getOnlineContainerKey (const std::string &container_suffix) const
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

Gaudi::Property< std::vector< std::string > > m_triggers {this, "TriggerList", {}}
Gaudi::Property< std::map< std::string, float > > m_L1_Phase1_thresholds {this, "L1Phase1Thresholds", {}}
Gaudi::Property< std::map< std::string, uint64_t > > m_L1_Phase1_threshold_patterns {this, "L1Phase1ThresholdPatterns", {}}
Gaudi::Property< bool > m_L1_select_by_et_only {this, "SelectL1ByETOnly", false}
Gaudi::Property< bool > m_do_efficiency_plots {this, "DoEfficiencyPlots", true}
Gaudi::Property< bool > m_do_variable_plots {this, "DoVariablePlots", true}
SG::ReadHandleKey< xAOD::TauJetContainerm_offlineTauJetKey {this, "OfflineTauJetKey", "TauJets", "Offline taujet container key"}
std::unordered_map< std::string, SG::ReadHandleKey< xAOD::TauJetContainer > > m_hltTauJetKeysMap
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

std::vector< const xAOD::eFexTauRoI * > getL1xTOBeTAUs () const
unsigned int getBDTScore (const xAOD::eFexTauRoI *roi, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
virtual StatusCode processEvent (const EventContext &ctx) const override
template<typename T = xAOD::eFexTauRoI>
void fillL1Efficiencies (const EventContext &ctx, const std::vector< const xAOD::TauJet * > &offline_tau_vec, const std::string &nProng, const std::string &trigger, const std::vector< const T * > &rois) const
void fillL1eTauVars (const std::string &trigger, const std::vector< const xAOD::eFexTauRoI * > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
void fillL1cTauVars (const std::string &trigger, const std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
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_requireOfflineTaus {this, "RequireOfflineTaus", true, "Require at leat 1 offline tau per event"}
Gaudi::Property< unsigned int > m_offline_tau_id {this, "OfflineTauID", TauID::RNN, "Offline TauID (1: RNN, 2: GNTau)"}
SG::ReadHandleKey< xAOD::eFexTauRoIContainerm_phase1l1eTauxRoIKey {this, "Phase1L1eTauxRoIKey", "L1_eTauxRoI", "eTau Phase1 L1 xRoI key"}
std::map< std::string, TrigTauInfom_trigInfo
SG::ReadDecorHandleKey< xAOD::EventInfom_eventInfoDecorKey {this, "LArStatusFlag", "EventInfo.larFlags", "Key for EventInfo object"}
SG::ReadDecorHandleKey< xAOD::TauJetContainerm_offlineGNTauDecorKey {this, "OfflineGNTauDecorKey", "", "Offline GNTau decoration key"}
SG::ReadHandleKey< xAOD::eFexTauRoIContainerm_phase1l1eTauRoIKey {this, "Phase1L1eTauRoIKey", "L1_eTauRoI", "eTau Phase1 L1 RoI key"}
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainerm_phase1l1eTauRoIThresholdPatternsKey {this, "Phase1L1eTauRoIThresholdPatternsKey", "L1_eTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the eTau RoIs"}
SG::ReadHandleKey< xAOD::jFexTauRoIContainerm_phase1l1jTauRoIKey {this, "Phase1L1jTauRoIKey", "L1_jFexTauRoI", "jTau Phase1 L1 RoI key"}
SG::ReadDecorHandleKey< xAOD::jFexTauRoIContainerm_phase1l1jTauRoIThresholdPatternsKey {this, "Phase1L1jTauRoIThresholdPatternsKey", "L1_jFexTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the jTau RoIs"}
SG::ReadHandleKey< xAOD::eFexTauRoIContainerm_phase1l1cTauRoIKey {this, "Phase1L1cTauRoIKey", "L1_cTauRoI", "cTau Phase1 L1 RoI key"}
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainerm_phase1l1cTauRoIDecorKey {this, "Phase1L1cTauRoIjTauRoILinkKey", "L1_cTauRoI.jTauLink", "Decoration for the link from eTau to the matching jTau"}
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainerm_phase1l1cTauRoIThresholdPatternsKey {this, "Phase1L1cTauRoIThresholdPatternsKey", "L1_cTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the cTau RoIs"}
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 10 of file TrigTauMonitorL1Algorithm.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 };

◆ TauID

Constructor & Destructor Documentation

◆ TrigTauMonitorL1Algorithm()

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

Definition at line 8 of file TrigTauMonitorL1Algorithm.cxx.

9 : TrigTauMonitorBaseAlgorithm(name, pSvcLocator)
10{}
TrigTauMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

Member Function Documentation

◆ classifyOfflineTaus()

std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > TrigTauMonitorBaseAlgorithm::classifyOfflineTaus ( const EventContext & ctx,
const std::vector< const xAOD::TauJet * > & taus,
const float threshold = 0.0,
const TauID tau_id = TauID::None ) const
protectedinherited

Definition at line 307 of file TrigTauMonitorBaseAlgorithm.cxx.

308{
309 std::vector<const xAOD::TauJet*> tau_vec_1p, tau_vec_3p;
310
311 for(const xAOD::TauJet* const tau : classifyTausAll(ctx, taus, threshold, tau_id)) {
312 int nTracks = -1;
313 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
314
315 if(nTracks == 1) tau_vec_1p.push_back(tau);
316 else if(nTracks == 3) tau_vec_3p.push_back(tau);
317 }
318
319 return {tau_vec_1p, tau_vec_3p};
320}
static Double_t taus
std::vector< const xAOD::TauJet * > classifyTausAll(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
TauJet_v3 TauJet
Definition of the current "tau version".

◆ classifyOnlineTaus()

std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > TrigTauMonitorBaseAlgorithm::classifyOnlineTaus ( const EventContext & ctx,
const std::vector< const xAOD::TauJet * > & taus,
const float threshold = 0.0 ) const
protectedinherited

Definition at line 290 of file TrigTauMonitorBaseAlgorithm.cxx.

291{
292 std::vector<const xAOD::TauJet*> tau_vec_0p, tau_vec_1p, tau_vec_mp;
293
294 for(const xAOD::TauJet* tau : classifyTausAll(ctx, taus, threshold, TauID::None)) {
295 int nTracks = -1;
296 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
297
298 if(nTracks == 0) tau_vec_0p.push_back(tau);
299 else if(nTracks == 1) tau_vec_1p.push_back(tau);
300 else tau_vec_mp.push_back(tau);
301 }
302
303 return {tau_vec_0p, tau_vec_1p, tau_vec_mp};
304}

◆ classifyTausAll()

std::vector< const xAOD::TauJet * > TrigTauMonitorBaseAlgorithm::classifyTausAll ( const EventContext & ctx,
const std::vector< const xAOD::TauJet * > & taus,
const float threshold = 0.0,
const TauID tau_id = TauID::None ) const
protectedinherited

Definition at line 262 of file TrigTauMonitorBaseAlgorithm.cxx.

263{
264 std::vector<const xAOD::TauJet*> tau_vec;
265
266 SG::ReadDecorHandle<xAOD::TauJetContainer, char> tauid_medium{m_offlineGNTauDecorKey, ctx};
267 if(!tauid_medium.isValid()) {
268 ATH_MSG_WARNING("Cannot retrieve " << tauid_medium.key());
269 return tau_vec;
270 }
271
272 for(const xAOD::TauJet* tau : taus) {
273 if(tau->pt() < threshold*Gaudi::Units::GeV) continue;
274
275 // Consider only offline taus which pass medium ID WP
276 if(tau_id == TauID::RNN) {
277 if(!tau->isTau(xAOD::TauJetParameters::JetRNNSigMedium)) continue;
278 }
279 else if(tau_id == TauID::GNTau) {
280 if(!tauid_medium(*tau)) continue;
281 }
282
283 tau_vec.push_back(tau);
284 }
285
286 return tau_vec;
287}
#define ATH_MSG_WARNING(x)
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_offlineGNTauDecorKey

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

◆ dR()

double TrigTauMonitorBaseAlgorithm::dR ( const double eta1,
const double phi1,
const double eta2,
const double phi2 ) const
inlineprotectedinherited

Definition at line 69 of file TrigTauMonitorBaseAlgorithm.h.

70 {
71 double deta = std::fabs(eta1 - eta2);
72 double dphi = std::fabs(CxxUtils::wrapToPi(phi1-phi2));
73 return std::sqrt(deta*deta + dphi*dphi);
74 }
constexpr T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition phihelper.h:30

◆ environment()

Environment_t AthMonitorAlgorithm::environment ( ) const
inlineinherited

Accessor functions for the environment.

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

Definition at line 208 of file AthMonitorAlgorithm.h.

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

◆ envStringToEnum()

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

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

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

Definition at line 116 of file AthMonitorAlgorithm.cxx.

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

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

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

Applies filters and trigger requirements.

Then, calls fillHistograms().

Parameters
ctxevent context for reentrant Athena call
Returns
StatusCode

Definition at line 77 of file AthMonitorAlgorithm.cxx.

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

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ fillHistograms()

StatusCode TrigTauMonitorBaseAlgorithm::fillHistograms ( const EventContext & ctx) const
overridevirtualinherited

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 235 of file TrigTauMonitorBaseAlgorithm.cxx.

236{
237 ATH_MSG_DEBUG("Executing Monitoring algorithm");
238
239 // Protect against truncated events
240 // Since this happens very rarely, it won't bias the L1 distributions and efficiencies
241 if(m_trigDecTool->ExperimentalAndExpertMethods().isHLTTruncated()){
242 ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
243 return StatusCode::SUCCESS;
244 }
245
246 // Protect against LAr noise bursts and other detector errors
247 SG::ReadHandle<xAOD::EventInfo> eventInfo(GetEventInfo(ctx));
248 ATH_CHECK(eventInfo.isValid());
249 if (eventInfo->errorState(xAOD::EventInfo::LAr) == xAOD::EventInfo::Error
250 || eventInfo->errorState(xAOD::EventInfo::Tile) == xAOD::EventInfo::Error
251 || eventInfo->errorState(xAOD::EventInfo::SCT) == xAOD::EventInfo::Error
252 || eventInfo->isEventFlagBitSet(xAOD::EventInfo::Core, 18)) {
253 return StatusCode::SUCCESS;
254 }
255
257
258 return StatusCode::SUCCESS;
259}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
virtual StatusCode processEvent(const EventContext &ctx) const =0
@ Tile
The Tile calorimeter.
@ Core
Core flags describing the event.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.

◆ fillL1cTauVars()

void TrigTauMonitorL1Algorithm::fillL1cTauVars ( const std::string & trigger,
const std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > & rois,
const std::vector< const xAOD::eFexTauRoI * > & xtob_rois ) const
private

Definition at line 98 of file TrigTauMonitorL1Algorithm.cxx.

99{
100 ATH_MSG_DEBUG("Fill L1 variables: " << trigger);
101
102 auto monGroup = getGroup(trigger+"_L1Vars");
103
104 auto L1RoIEt = Monitored::Collection("L1RoIEt" , rois, [](const auto L1roi){ return L1roi.first->et()/Gaudi::Units::GeV; });
105 auto L1RoIEta = Monitored::Collection("L1RoIEta" , rois, [](const auto L1roi){ return L1roi.first->eta(); });
106 auto L1RoIPhi = Monitored::Collection("L1RoIPhi" , rois, [](const auto L1roi){ return L1roi.first->phi(); });
107 auto L1eFexRoIRCore = Monitored::Collection("L1eFexRoIRCore", rois, [](const auto L1roi){ return L1roi.first->rCore(); });
108 auto L1eFexRoIRHad = Monitored::Collection("L1eFexRoIRHad" , rois, [](const auto L1roi){ return L1roi.first->rHad(); });
109 auto L1RoIBDTScore = Monitored::Collection("L1eFexRoIBDTScore" , rois, [this, &xtob_rois](const auto L1roi){ return getBDTScore(L1roi.first, xtob_rois); });
110
111 std::vector<bool> jFex_isMatched;
112 std::vector<float> jFex_eFex_et_ratio;
113 std::vector<float> jFex_isolation;
114 std::vector<float> cTau_isolation;
115 for(const auto& [eFexRoI, jFexRoI] : rois) {
116 if(!jFexRoI) {
117 jFex_isMatched.push_back(false);
118 continue;
119 }
120
121 jFex_isMatched.push_back(true);
122 jFex_eFex_et_ratio.push_back(jFexRoI->et()/eFexRoI->et());
123 jFex_isolation.push_back(jFexRoI->iso()/Gaudi::Units::GeV);
124 cTau_isolation.push_back(jFexRoI->iso()/eFexRoI->et());
125 }
126 auto L1cTauRoITopoMatch = Monitored::Collection("L1cTauRoITopoMatch" , jFex_isMatched);
127 auto L1jFexRoIIso = Monitored::Collection("L1jFexRoIIso" , jFex_isolation);
128 auto L1cTauRoIIso = Monitored::Collection("L1cTauMatchedRoIIso" , cTau_isolation);
129 auto L1RoIcTauEtRatio = Monitored::Collection("L1RoIcTauMatchedEtRatio", jFex_eFex_et_ratio);
130
131 fill(monGroup, L1RoIEt, L1RoIEta, L1RoIPhi, L1eFexRoIRCore, L1eFexRoIRHad, L1cTauRoITopoMatch, L1jFexRoIIso, L1cTauRoIIso, L1RoIcTauEtRatio, L1RoIBDTScore );
132
133 ATH_MSG_DEBUG("After fill L1 variables: " << trigger);
134}
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
unsigned int getBDTScore(const xAOD::eFexTauRoI *roi, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
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.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
monGroup(analysis_chain)

◆ fillL1Efficiencies()

template<typename T = xAOD::eFexTauRoI>
void TrigTauMonitorL1Algorithm::fillL1Efficiencies ( const EventContext & ctx,
const std::vector< const xAOD::TauJet * > & offline_tau_vec,
const std::string & nProng,
const std::string & trigger,
const std::vector< const T * > & rois ) const
inlineprivate

Definition at line 30 of file TrigTauMonitorL1Algorithm.h.

31 {
32 ATH_MSG_DEBUG("Fill L1 efficiencies: " << trigger);
33
34 const TrigTauInfo& info = getTrigInfo(trigger);
35
36 auto monGroup = getGroup(trigger+"_L1_Efficiency_"+nProng);
37
38 auto tauPt = Monitored::Scalar<float>("tauPt", 0.0);
39 auto tauEta = Monitored::Scalar<float>("tauEta", 0.0);
40 auto tauPhi = Monitored::Scalar<float>("tauPhi", 0.0);
41 auto averageMu = Monitored::Scalar<float>("averageMu", 0.0);
42 auto L1_match = Monitored::Scalar<bool>("L1_pass", false);
43 auto L1_match_highPt = Monitored::Scalar<bool>("L1_pass_highPt", false);
44
45 averageMu = lbAverageInteractionsPerCrossing(ctx);
46
47 for(const xAOD::TauJet* offline_tau : offline_tau_vec) {
48 tauPt = offline_tau->pt()/Gaudi::Units::GeV;
49 tauEta = offline_tau->eta();
50 tauPhi = offline_tau->phi();
51
52 bool is_highPt = tauPt > info.getL1TauThreshold() + 20.0;
53
54 L1_match = false;
55 for(const T* roi : rois) {
56 L1_match = matchObjects(offline_tau, roi, 0.3);
57 if(L1_match) break;
58 }
59
60 fill(monGroup, tauPt, tauEta, tauPhi, averageMu, L1_match);
61
62 if(is_highPt) {
63 L1_match_highPt = static_cast<bool>(L1_match);
64 fill(monGroup, tauEta, tauPhi, L1_match_highPt);
65 }
66 }
67
68 ATH_MSG_DEBUG("After fill L1 efficiencies: " << trigger);
69 }
bool matchObjects(const T1 *tau, const std::vector< const T2 * > &tau_vec, float threshold) const
const TrigTauInfo & getTrigInfo(const std::string &trigger) const
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx) const
Calculate the average mu, i.e.

◆ fillL1eTauVars()

void TrigTauMonitorL1Algorithm::fillL1eTauVars ( const std::string & trigger,
const std::vector< const xAOD::eFexTauRoI * > & rois,
const std::vector< const xAOD::eFexTauRoI * > & xtob_rois ) const
private

Definition at line 80 of file TrigTauMonitorL1Algorithm.cxx.

81{
82 ATH_MSG_DEBUG("Fill L1 variables: " << trigger);
83
84 auto monGroup = getGroup(trigger+"_L1Vars");
85
86 auto L1RoIEt = Monitored::Collection("L1RoIEt" , rois, [](const xAOD::eFexTauRoI* L1roi){ return L1roi->et()/Gaudi::Units::GeV; });
87 auto L1RoIEta = Monitored::Collection("L1RoIEta" , rois, [](const xAOD::eFexTauRoI* L1roi){ return L1roi->eta(); });
88 auto L1RoIPhi = Monitored::Collection("L1RoIPhi" , rois, [](const xAOD::eFexTauRoI* L1roi){ return L1roi->phi(); });
89 auto L1RoIRCore = Monitored::Collection("L1eFexRoIRCore", rois, [](const xAOD::eFexTauRoI* L1roi){ return L1roi->rCore(); });
90 auto L1RoIRHad = Monitored::Collection("L1eFexRoIRHad" , rois, [](const xAOD::eFexTauRoI* L1roi){ return L1roi->rHad(); });
91 auto L1RoIBDTScore = Monitored::Collection("L1eFexRoIBDTScore" , rois, [this, &xtob_rois](const xAOD::eFexTauRoI* L1roi){ return getBDTScore(L1roi, xtob_rois); });
92 fill(monGroup, L1RoIEt, L1RoIEta, L1RoIPhi, L1RoIRCore, L1RoIRHad, L1RoIBDTScore);
93
94 ATH_MSG_DEBUG("After fill L1 variables: " << trigger);
95}
float et() const
TOB ET (decoded from TOB, stored for convenience).
float phi() const
Seed supercell index within central tower (0 -> 3).
float rCore() const
Jet Discriminants Derived floating point values (not used in actual algorithm).
float eta() const
setter for the above
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition eFexTauRoI.h:16

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ getBDTScore()

unsigned int TrigTauMonitorL1Algorithm::getBDTScore ( const xAOD::eFexTauRoI * roi,
const std::vector< const xAOD::eFexTauRoI * > & xtob_rois ) const
private

Definition at line 152 of file TrigTauMonitorL1Algorithm.cxx.

153{
154 if(xtob_rois.empty()) return 0;
155
156 for(const xAOD::eFexTauRoI* xroi : xtob_rois) {
157 if(xroi->eta() == roi->eta() && xroi->phi() == roi->phi()) return xroi->bdtScore();
158 }
159 ATH_MSG_DEBUG("Unmatched RoI! et=" << roi->et() << ", eta=" << roi->eta() << ", phi=" << roi->phi());
160 for(const xAOD::eFexTauRoI* xroi : xtob_rois) {
161 ATH_MSG_DEBUG(" - xRoI et=" << xroi->et() << ", eta=" << xroi->eta() << ", phi=" << xroi->phi());
162 }
163 return 0;
164}

◆ GetEventInfo()

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

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

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

Definition at line 111 of file AthMonitorAlgorithm.cxx.

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

◆ getGroup()

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

Get a specific monitoring tool from the tool handle array.

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

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

Definition at line 168 of file AthMonitorAlgorithm.cxx.

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

◆ getL1cTAUs()

std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > TrigTauMonitorBaseAlgorithm::getL1cTAUs ( const EventContext & ctx,
const std::string & l1_item ) const
protectedinherited

Definition at line 176 of file TrigTauMonitorBaseAlgorithm.cxx.

177{
178 std::vector<std::pair<const xAOD::eFexTauRoI*, const xAOD::jFexTauRoI*>> roi_vec;
179
180 SG::ReadHandle<xAOD::eFexTauRoIContainer> rois(m_phase1l1cTauRoIKey, ctx);
181 if(!rois.isValid()) {
182 ATH_MSG_WARNING("Failed to retrieve the L1_cTauRoi container");
183 return roi_vec;
184 }
185 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, ElementLink<xAOD::jFexTauRoIContainer>> jTau_roi_link{m_phase1l1cTauRoIDecorKey, ctx};
186 if(!jTau_roi_link.isValid()) {
187 ATH_MSG_WARNING("Failed to create jTauLink accessor for the L1_cTauRoi container");
188 return roi_vec;
189 }
190
192 for(size_t i = 0; i < rois->size(); i++) {
193 const xAOD::eFexTauRoI* roi = (*rois)[i];
194 const xAOD::jFexTauRoI* jTau_roi = jTau_roi_link(i).isValid() ? *jTau_roi_link(i) : nullptr;
195
196 // Select by RoI ET value only
197 if(roi->et() > m_L1_Phase1_thresholds.value().at(l1_item)) roi_vec.push_back(std::make_pair(roi, jTau_roi));
198 }
199 } else {
200 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, uint64_t> thresholdPatterns(m_phase1l1cTauRoIThresholdPatternsKey, ctx);
201 if(!thresholdPatterns.isValid()) {
202 ATH_MSG_WARNING("Failed to create thresholdPatterns property accessor for the L1_cTauRoi container");
203 return roi_vec;
204 }
205
206 for(size_t i = 0; i < rois->size(); i++) {
207 const xAOD::eFexTauRoI* roi = (*rois)[i];
208 const xAOD::jFexTauRoI* jTau_roi = jTau_roi_link(i).isValid() ? *jTau_roi_link(i) : nullptr;
209
210 // Check that the RoI passed the threshold selection
211 if(thresholdPatterns(*roi) & m_L1_Phase1_threshold_patterns.value().at(l1_item)) roi_vec.push_back(std::make_pair(roi, jTau_roi));
212 }
213 }
214
215
216 return roi_vec;
217}
Gaudi::Property< std::map< std::string, float > > m_L1_Phase1_thresholds
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1cTauRoIDecorKey
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1cTauRoIThresholdPatternsKey
Gaudi::Property< bool > m_L1_select_by_et_only
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1cTauRoIKey
Gaudi::Property< std::map< std::string, uint64_t > > m_L1_Phase1_threshold_patterns
jFexTauRoI_v1 jFexTauRoI
Define the latest version of the jFexSRJetRoI class.
Definition jFexTauRoI.h:13

◆ getL1eTAUs()

std::vector< const xAOD::eFexTauRoI * > TrigTauMonitorBaseAlgorithm::getL1eTAUs ( const EventContext & ctx,
const std::string & l1_item ) const
protectedinherited

Definition at line 144 of file TrigTauMonitorBaseAlgorithm.cxx.

145{
146 std::vector<const xAOD::eFexTauRoI*> roi_vec;
147
148 SG::ReadHandle<xAOD::eFexTauRoIContainer> rois(m_phase1l1eTauRoIKey, ctx);
149 if(!rois.isValid()) {
150 ATH_MSG_WARNING("Failed to retrieve the L1_eTauRoi container");
151 return roi_vec;
152 }
153
155 for(const xAOD::eFexTauRoI* roi : *rois) {
156 // Select by RoI ET value only
157 if(roi->et() > m_L1_Phase1_thresholds.value().at(l1_item)) roi_vec.push_back(roi);
158 }
159 } else {
160 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, uint64_t> thresholdPatterns(m_phase1l1eTauRoIThresholdPatternsKey, ctx);
161 if(!thresholdPatterns.isValid()) {
162 ATH_MSG_WARNING("Failed to create thresholdPatterns property accessor for the L1_eTauRoi container");
163 return roi_vec;
164 }
165
166 for(const xAOD::eFexTauRoI* roi : *rois) {
167 // Check that the RoI passed the threshold selection
168 if(thresholdPatterns(*roi) & m_L1_Phase1_threshold_patterns.value().at(l1_item)) roi_vec.push_back(roi);
169 }
170 }
171
172 return roi_vec;
173}
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauRoIKey
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauRoIThresholdPatternsKey

◆ getL1xTOBeTAUs()

std::vector< const xAOD::eFexTauRoI * > TrigTauMonitorL1Algorithm::getL1xTOBeTAUs ( ) const
private

Definition at line 136 of file TrigTauMonitorL1Algorithm.cxx.

137{
138 std::vector<const xAOD::eFexTauRoI*> roi_vec;
139
140 if(m_phase1l1eTauxRoIKey.empty()) return roi_vec;
141
142 SG::ReadHandle<xAOD::eFexTauRoIContainer> rois(m_phase1l1eTauxRoIKey);
143 if(!rois.isValid()) {
144 ATH_MSG_WARNING("The L1_eTauxRoI container is not available! No e/cTAU BDT score will be retrieved");
145 return roi_vec;
146 }
147
148 for(const xAOD::eFexTauRoI* roi : *rois) roi_vec.push_back(roi);
149 return roi_vec;
150}
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauxRoIKey

◆ getOfflineTaus()

std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > TrigTauMonitorBaseAlgorithm::getOfflineTaus ( const EventContext & ctx,
const float threshold = 20.0,
const TauID tau_id = TauID::None ) const
protectedinherited

Definition at line 138 of file TrigTauMonitorBaseAlgorithm.cxx.

139{
140 return classifyOfflineTaus(ctx, getOfflineTausAll(ctx, threshold), threshold, tau_id);
141}
std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOfflineTaus(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
std::vector< const xAOD::TauJet * > getOfflineTausAll(const EventContext &ctx, const float threshold=20.0) const

◆ getOfflineTausAll()

std::vector< const xAOD::TauJet * > TrigTauMonitorBaseAlgorithm::getOfflineTausAll ( const EventContext & ctx,
const float threshold = 20.0 ) const
protectedinherited

Definition at line 105 of file TrigTauMonitorBaseAlgorithm.cxx.

106{
107 ATH_MSG_DEBUG("Retrieving offline Taus");
108
109 std::vector<const xAOD::TauJet*> tau_vec;
110
111 SG::ReadHandle<xAOD::TauJetContainer> taus(m_offlineTauJetKey, ctx);
112 if(!taus.isValid()) {
113 ATH_MSG_WARNING("Failed to retrieve offline Taus");
114 return tau_vec;
115 }
116
117 for(const xAOD::TauJet* const tau : *taus) {
118 // Consider only offline taus with a certain minimum pT
119 if(tau->pt() < threshold*Gaudi::Units::GeV) continue;
120
121 // Consider only offline taus outside of the crack region
122 if(std::abs(tau->eta()) > 1.37 && std::abs(tau->eta()) < 1.52) continue;
123
124 // Consider only offline taus which pass thinning
125 static const SG::ConstAccessor<char> passThinningAcc("passThinning");
126 if(!passThinningAcc.withDefault(*tau, true)) continue;
127
128 int nTracks = -1;
129 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
130 ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
131 if(nTracks == 1 || nTracks == 3) tau_vec.push_back(tau);
132 }
133
134 return tau_vec;
135}
SG::ReadHandleKey< xAOD::TauJetContainer > m_offlineTauJetKey

◆ getOnlineContainerKey()

const SG::ReadHandleKey< xAOD::TauJetContainer > & TrigTauMonitorBaseAlgorithm::getOnlineContainerKey ( const std::string & container_suffix) const
protectedinherited

Definition at line 220 of file TrigTauMonitorBaseAlgorithm.cxx.

221{
222 if(m_hltTauJetKeysMap.find(container_suffix) != m_hltTauJetKeysMap.end()) return m_hltTauJetKeysMap.at(container_suffix);
223 else {
224 if(m_hltTauJetKeysMap.find("MVA") != m_hltTauJetKeysMap.end()) {
225 ATH_MSG_ERROR("HLT TauJet container not registered for suffix \"" << container_suffix << "\". Returning the default \"" << m_hltTauJetKeysMap.at("MVA").key() << "\"");
226 return m_hltTauJetKeysMap.at("MVA");
227 } else {
228 ATH_MSG_ERROR("HLT TauJet container not registered for suffix \"" << container_suffix << "\". Returning the first available container \"" << m_hltTauJetKeysMap.begin()->second.key() << "\"");
229 return m_hltTauJetKeysMap.begin()->second;
230 }
231 }
232}
#define ATH_MSG_ERROR(x)
std::unordered_map< std::string, SG::ReadHandleKey< xAOD::TauJetContainer > > m_hltTauJetKeysMap

◆ getOnlineTaus()

std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > TrigTauMonitorBaseAlgorithm::getOnlineTaus ( const EventContext & ctx,
const std::string & trigger ) const
protectedinherited

Definition at line 99 of file TrigTauMonitorBaseAlgorithm.cxx.

100{
101 return classifyOnlineTaus(ctx, getOnlineTausAll(trigger, true), 0.0);
102}
std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOnlineTaus(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0) const
std::vector< const xAOD::TauJet * > getOnlineTausAll(const std::string &trigger, bool include_0P=true, bool filter_legs=false) const

◆ getOnlineTausAll()

std::vector< const xAOD::TauJet * > TrigTauMonitorBaseAlgorithm::getOnlineTausAll ( const std::string & trigger,
bool include_0P = true,
bool filter_legs = false ) const
protectedinherited

Definition at line 68 of file TrigTauMonitorBaseAlgorithm.cxx.

69{
70 std::vector<const xAOD::TauJet*> tau_vec;
71
72 const TrigTauInfo& info = getTrigInfo(trigger);
73
74 std::vector<int> leg_indices = {-1};
75 if(filter_legs) leg_indices = info.getHLTTauLegIndices();
76 for(size_t i = 0; i < leg_indices.size(); ++i) {
77 const int leg = leg_indices[i];
78 const std::string tau_container_name = getOnlineContainerKey(info.getHLTTauLegContainerSfxs().at(leg == -1 ? 0 : i)).key();
79 ATH_MSG_DEBUG("Tau container name is: " << tau_container_name);
80
82 for(auto& featLinkInfo : vec) {
83 const xAOD::TauJet* feat = *(featLinkInfo.link);
84 if(!feat) continue;
85
86 int nTracks = -1;
88 ATH_MSG_DEBUG("NTracks Online: " << nTracks);
89
90 if(include_0P && nTracks == 0) tau_vec.push_back(feat);
91 else tau_vec.push_back(feat);
92 }
93 }
94
95 return tau_vec;
96}
std::vector< size_t > vec
const SG::ReadHandleKey< xAOD::TauJetContainer > & getOnlineContainerKey(const std::string &container_suffix) const
bool detail(TauJetParameters::Detail detail, int &value) const
Get and set values of common details variables via enum.
const std::string & featureString()
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".

◆ getTrigDecisionTool()

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

Get the trigger decision tool member.

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

Returns
m_trigDecTool

Definition at line 203 of file AthMonitorAlgorithm.cxx.

203 {
204 return m_trigDecTool;
205}

◆ getTrigInfo()

const TrigTauInfo & TrigTauMonitorBaseAlgorithm::getTrigInfo ( const std::string & trigger) const
inlineprotectedinherited

Definition at line 51 of file TrigTauMonitorBaseAlgorithm.h.

51{ return m_trigInfo.at(trigger); }
std::map< std::string, TrigTauInfo > m_trigInfo

◆ getTrigInfoMap()

std::map< std::string, TrigTauInfo > & TrigTauMonitorBaseAlgorithm::getTrigInfoMap ( )
inlineprotectedinherited

Definition at line 50 of file TrigTauMonitorBaseAlgorithm.h.

50{ return m_trigInfo; }

◆ initialize()

StatusCode TrigTauMonitorL1Algorithm::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from TrigTauMonitorBaseAlgorithm.

Definition at line 13 of file TrigTauMonitorL1Algorithm.cxx.

14{
16
18
19 return StatusCode::SUCCESS;
20}
virtual StatusCode initialize() override
initialize

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

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

Specify if the algorithm is clonable.

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

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

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ matchObjects() [1/3]

template<typename T1 = xAOD::IParticle, typename T2 = xAOD::IParticle>
bool TrigTauMonitorBaseAlgorithm::matchObjects ( const T1 * tau,
const std::vector< const T2 * > & tau_vec,
float threshold ) const
inlineprotectedinherited

Definition at line 77 of file TrigTauMonitorBaseAlgorithm.h.

78 {
79 for(auto tau_2 : tau_vec) {
80 if(tau->p4().DeltaR(tau_2->p4()) < threshold) return true;
81 }
82 return false;
83 }

◆ matchObjects() [2/3]

template<typename T1 = xAOD::IParticle, typename T2 = xAOD::eFexTauRoI>
bool TrigTauMonitorBaseAlgorithm::matchObjects ( const T1 * tau_1,
const T2 * tau_2,
float threshold ) const
inlineprotectedinherited

Definition at line 94 of file TrigTauMonitorBaseAlgorithm.h.

95 {
96 return dR(tau_1->eta(), tau_1->phi(), tau_2->eta(), tau_2->phi()) < threshold;
97 }
double dR(const double eta1, const double phi1, const double eta2, const double phi2) const

◆ matchObjects() [3/3]

bool TrigTauMonitorBaseAlgorithm::matchObjects ( const TLorentzVector & tau,
const std::vector< TLorentzVector > & tau_vec,
float threshold ) const
inlineprotectedinherited

Definition at line 85 of file TrigTauMonitorBaseAlgorithm.h.

86 {
87 for(auto& tau_2 : tau_vec) {
88 if(tau.DeltaR(tau_2) < threshold) return true;
89 }
90 return false;
91 }

◆ matchTruthObjects()

template<typename T1 = xAOD::IParticle, typename T2 = xAOD::IParticle>
bool TrigTauMonitorBaseAlgorithm::matchTruthObjects ( const T1 * true_tau,
const std::vector< const T2 * > & tau_vec,
float threshold ) const
inlineprotectedinherited

Definition at line 100 of file TrigTauMonitorBaseAlgorithm.h.

101 {
102 static const SG::ConstAccessor<double> acc_ptvis("pt_vis");
103 static const SG::ConstAccessor<double> acc_etavis("eta_vis");
104 static const SG::ConstAccessor<double> acc_phivis("phi_vis");
105 static const SG::ConstAccessor<double> acc_mvis("mvis");
106 TLorentzVector true_tau_p4;
107 true_tau_p4.SetPtEtaPhiM(acc_ptvis(*true_tau), acc_etavis(*true_tau), acc_phivis(*true_tau), acc_mvis(*true_tau));
108
109 for(auto tau : tau_vec) {
110 if(true_tau_p4.DeltaR(tau->p4()) < threshold) return true;
111 }
112 return false;
113 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ parseList()

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

Parse a string into a vector.

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

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

Definition at line 350 of file AthMonitorAlgorithm.cxx.

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

◆ processEvent()

StatusCode TrigTauMonitorL1Algorithm::processEvent ( const EventContext & ctx) const
overrideprivatevirtual

Implements TrigTauMonitorBaseAlgorithm.

Definition at line 22 of file TrigTauMonitorL1Algorithm.cxx.

23{
24 constexpr float threshold_offset = 10.0;
25
26 // Offline taus
27 auto offline_taus_all = getOfflineTausAll(ctx, 0.0);
28 if(m_requireOfflineTaus && offline_taus_all.empty()) return StatusCode::SUCCESS;
29
30 // xTOB-based eTAU RoIs
31 // If the container is not in SG, it'll return an empty vector
32 const std::vector<const xAOD::eFexTauRoI*> xtob_etau_rois = getL1xTOBeTAUs();
33
34 for(const std::string& trigger : m_triggers) {
35 const TrigTauInfo& info = getTrigInfo(trigger);
36
37 if(!info.isL1TauOnly()) {
38 ATH_MSG_WARNING("Chain \"" << trigger << "\" is not an L1 tau trigger. Skipping...");
39 continue;
40 }
41
42 // Offline tau requirement check
43 std::vector<const xAOD::TauJet*> offline_taus_with_id = classifyTausAll(ctx, offline_taus_all, 0, static_cast<TauID>(m_offline_tau_id.value()));
44 if(m_requireOfflineTaus && offline_taus_with_id.empty()) continue;
45
46 // Filter offline taus
47 auto offline_taus = classifyOfflineTaus(ctx, offline_taus_with_id, info.getL1TauThreshold() - threshold_offset);
48 std::vector<const xAOD::TauJet*> offline_taus_1p = offline_taus.first;
49 std::vector<const xAOD::TauJet*> offline_taus_3p = offline_taus.second;
50
51 if(info.getL1TauType() == "eTAU") {
52 std::vector<const xAOD::eFexTauRoI*> rois = getL1eTAUs(ctx, info.getL1TauItem());
53
54 if(m_do_variable_plots) fillL1eTauVars(trigger, rois, xtob_etau_rois);
56 fillL1Efficiencies(ctx, offline_taus_1p, "1P", trigger, rois);
57 fillL1Efficiencies(ctx, offline_taus_3p, "3P", trigger, rois);
58 }
59
60 } else if(info.getL1TauType() == "cTAU") {
61 std::vector<std::pair<const xAOD::eFexTauRoI*, const xAOD::jFexTauRoI*>> rois = getL1cTAUs(ctx, info.getL1TauItem());
62
63 std::vector<const xAOD::eFexTauRoI*> eTau_rois;
64 eTau_rois.reserve(rois.size());
65for(const auto& [eTau_roi, jTau_roi] : rois) eTau_rois.push_back(eTau_roi);
66
67 if(m_do_variable_plots) fillL1cTauVars(trigger, rois, xtob_etau_rois);
69 fillL1Efficiencies(ctx, offline_taus_1p, "1P", trigger, eTau_rois);
70 fillL1Efficiencies(ctx, offline_taus_3p, "3P", trigger, eTau_rois);
71 }
72
73 }
74 }
75
76 return StatusCode::SUCCESS;
77}
std::vector< const xAOD::eFexTauRoI * > getL1eTAUs(const EventContext &ctx, const std::string &l1_item) const
Gaudi::Property< bool > m_do_efficiency_plots
Gaudi::Property< std::vector< std::string > > m_triggers
std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > getL1cTAUs(const EventContext &ctx, const std::string &l1_item) const
Gaudi::Property< bool > m_do_variable_plots
Gaudi::Property< unsigned int > m_offline_tau_id
void fillL1Efficiencies(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &offline_tau_vec, const std::string &nProng, const std::string &trigger, const std::vector< const T * > &rois) const
void fillL1eTauVars(const std::string &trigger, const std::vector< const xAOD::eFexTauRoI * > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
void fillL1cTauVars(const std::string &trigger, const std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
std::vector< const xAOD::eFexTauRoI * > getL1xTOBeTAUs() const
Gaudi::Property< bool > m_requireOfflineTaus

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ trigChainsArePassed()

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

Check whether triggers are passed.

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

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

Definition at line 208 of file AthMonitorAlgorithm.cxx.

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

◆ updateVHKA()

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

Definition at line 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_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_do_efficiency_plots

Gaudi::Property<bool> TrigTauMonitorBaseAlgorithm::m_do_efficiency_plots {this, "DoEfficiencyPlots", true}
protectedinherited

Definition at line 46 of file TrigTauMonitorBaseAlgorithm.h.

46{this, "DoEfficiencyPlots", true};

◆ m_do_variable_plots

Gaudi::Property<bool> TrigTauMonitorBaseAlgorithm::m_do_variable_plots {this, "DoVariablePlots", true}
protectedinherited

Definition at line 47 of file TrigTauMonitorBaseAlgorithm.h.

47{this, "DoVariablePlots", true};

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

SG::ReadDecorHandleKey<xAOD::EventInfo> TrigTauMonitorBaseAlgorithm::m_eventInfoDecorKey {this, "LArStatusFlag", "EventInfo.larFlags", "Key for EventInfo object"}
privateinherited

Definition at line 130 of file TrigTauMonitorBaseAlgorithm.h.

130{this, "LArStatusFlag", "EventInfo.larFlags", "Key for EventInfo object"}; // To get data-dependencies right

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fileKey

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

Internal Athena name for file.

Definition at line 363 of file AthMonitorAlgorithm.h.

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

◆ m_hltTauJetKeysMap

std::unordered_map<std::string, SG::ReadHandleKey<xAOD::TauJetContainer> > TrigTauMonitorBaseAlgorithm::m_hltTauJetKeysMap
protectedinherited

Definition at line 121 of file TrigTauMonitorBaseAlgorithm.h.

◆ m_L1_Phase1_threshold_patterns

Gaudi::Property<std::map<std::string, uint64_t> > TrigTauMonitorBaseAlgorithm::m_L1_Phase1_threshold_patterns {this, "L1Phase1ThresholdPatterns", {}}
protectedinherited

Definition at line 42 of file TrigTauMonitorBaseAlgorithm.h.

42{this, "L1Phase1ThresholdPatterns", {}};

◆ m_L1_Phase1_thresholds

Gaudi::Property<std::map<std::string, float> > TrigTauMonitorBaseAlgorithm::m_L1_Phase1_thresholds {this, "L1Phase1Thresholds", {}}
protectedinherited

Definition at line 41 of file TrigTauMonitorBaseAlgorithm.h.

41{this, "L1Phase1Thresholds", {}};

◆ m_L1_select_by_et_only

Gaudi::Property<bool> TrigTauMonitorBaseAlgorithm::m_L1_select_by_et_only {this, "SelectL1ByETOnly", false}
protectedinherited

Definition at line 43 of file TrigTauMonitorBaseAlgorithm.h.

43{this, "SelectL1ByETOnly", false};

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

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 371 of file AthMonitorAlgorithm.h.

◆ m_offline_tau_id

Gaudi::Property<unsigned int> TrigTauMonitorL1Algorithm::m_offline_tau_id {this, "OfflineTauID", TauID::RNN, "Offline TauID (1: RNN, 2: GNTau)"}
private

Definition at line 19 of file TrigTauMonitorL1Algorithm.h.

19{this, "OfflineTauID", TauID::RNN, "Offline TauID (1: RNN, 2: GNTau)"};

◆ m_offlineGNTauDecorKey

SG::ReadDecorHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_offlineGNTauDecorKey {this, "OfflineGNTauDecorKey", "", "Offline GNTau decoration key"}
privateinherited

Definition at line 132 of file TrigTauMonitorBaseAlgorithm.h.

132{this, "OfflineGNTauDecorKey", "", "Offline GNTau decoration key"};

◆ m_offlineTauJetKey

SG::ReadHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_offlineTauJetKey {this, "OfflineTauJetKey", "TauJets", "Offline taujet container key"}
protectedinherited

Definition at line 120 of file TrigTauMonitorBaseAlgorithm.h.

120{this, "OfflineTauJetKey", "TauJets", "Offline taujet container key"};

◆ m_phase1l1cTauRoIDecorKey

SG::ReadDecorHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1cTauRoIDecorKey {this, "Phase1L1cTauRoIjTauRoILinkKey", "L1_cTauRoI.jTauLink", "Decoration for the link from eTau to the matching jTau"}
privateinherited

Definition at line 139 of file TrigTauMonitorBaseAlgorithm.h.

139{this, "Phase1L1cTauRoIjTauRoILinkKey", "L1_cTauRoI.jTauLink", "Decoration for the link from eTau to the matching jTau"};

◆ m_phase1l1cTauRoIKey

SG::ReadHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1cTauRoIKey {this, "Phase1L1cTauRoIKey", "L1_cTauRoI", "cTau Phase1 L1 RoI key"}
privateinherited

Definition at line 138 of file TrigTauMonitorBaseAlgorithm.h.

138{this, "Phase1L1cTauRoIKey", "L1_cTauRoI", "cTau Phase1 L1 RoI key"};

◆ m_phase1l1cTauRoIThresholdPatternsKey

SG::ReadDecorHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1cTauRoIThresholdPatternsKey {this, "Phase1L1cTauRoIThresholdPatternsKey", "L1_cTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the cTau RoIs"}
privateinherited

Definition at line 140 of file TrigTauMonitorBaseAlgorithm.h.

140{this, "Phase1L1cTauRoIThresholdPatternsKey", "L1_cTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the cTau RoIs"};

◆ m_phase1l1eTauRoIKey

SG::ReadHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1eTauRoIKey {this, "Phase1L1eTauRoIKey", "L1_eTauRoI", "eTau Phase1 L1 RoI key"}
privateinherited

Definition at line 134 of file TrigTauMonitorBaseAlgorithm.h.

134{this, "Phase1L1eTauRoIKey", "L1_eTauRoI", "eTau Phase1 L1 RoI key"};

◆ m_phase1l1eTauRoIThresholdPatternsKey

SG::ReadDecorHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1eTauRoIThresholdPatternsKey {this, "Phase1L1eTauRoIThresholdPatternsKey", "L1_eTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the eTau RoIs"}
privateinherited

Definition at line 135 of file TrigTauMonitorBaseAlgorithm.h.

135{this, "Phase1L1eTauRoIThresholdPatternsKey", "L1_eTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the eTau RoIs"};

◆ m_phase1l1eTauxRoIKey

SG::ReadHandleKey<xAOD::eFexTauRoIContainer> TrigTauMonitorL1Algorithm::m_phase1l1eTauxRoIKey {this, "Phase1L1eTauxRoIKey", "L1_eTauxRoI", "eTau Phase1 L1 xRoI key"}
private

Definition at line 22 of file TrigTauMonitorL1Algorithm.h.

22{this, "Phase1L1eTauxRoIKey", "L1_eTauxRoI", "eTau Phase1 L1 xRoI key"};

◆ m_phase1l1jTauRoIKey

SG::ReadHandleKey<xAOD::jFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1jTauRoIKey {this, "Phase1L1jTauRoIKey", "L1_jFexTauRoI", "jTau Phase1 L1 RoI key"}
privateinherited

Definition at line 136 of file TrigTauMonitorBaseAlgorithm.h.

136{this, "Phase1L1jTauRoIKey", "L1_jFexTauRoI", "jTau Phase1 L1 RoI key"};

◆ m_phase1l1jTauRoIThresholdPatternsKey

SG::ReadDecorHandleKey<xAOD::jFexTauRoIContainer> TrigTauMonitorBaseAlgorithm::m_phase1l1jTauRoIThresholdPatternsKey {this, "Phase1L1jTauRoIThresholdPatternsKey", "L1_jFexTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the jTau RoIs"}
privateinherited

Definition at line 137 of file TrigTauMonitorBaseAlgorithm.h.

137{this, "Phase1L1jTauRoIThresholdPatternsKey", "L1_jFexTauRoI.thresholdPatterns", "Decoration for the threshold patterns for the jTau RoIs"};

◆ m_requireOfflineTaus

Gaudi::Property<bool> TrigTauMonitorL1Algorithm::m_requireOfflineTaus {this, "RequireOfflineTaus", true, "Require at leat 1 offline tau per event"}
private

Definition at line 18 of file TrigTauMonitorL1Algorithm.h.

18{this, "RequireOfflineTaus", true, "Require at leat 1 offline tau per event"};

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

Gaudi::Property<std::vector<std::string> > TrigTauMonitorBaseAlgorithm::m_triggers {this, "TriggerList", {}}
protectedinherited

Definition at line 38 of file TrigTauMonitorBaseAlgorithm.h.

38{this, "TriggerList", {}};

◆ m_trigInfo

std::map<std::string, TrigTauInfo> TrigTauMonitorBaseAlgorithm::m_trigInfo
privateinherited

Definition at line 126 of file TrigTauMonitorBaseAlgorithm.h.

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