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

#include <TrigTauMonitorTruthAlgorithm.h>

Inheritance diagram for TrigTauMonitorTruthAlgorithm:
Collaboration diagram for TrigTauMonitorTruthAlgorithm:

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

 TrigTauMonitorTruthAlgorithm (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=Gaudi::Hive::currentContext()) const
 Calculate the average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbLuminosityPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the instantaneous luminosity per bunch crossing.
virtual double lbDuration (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the duration of the luminosity block (in seconds)
virtual float lbAverageLivefraction (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the live fraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx=Gaudi::Hive::currentContext()) const
 Calculate the average integrated luminosity multiplied by the live fraction.
virtual StatusCode parseList (const std::string &line, std::vector< std::string > &result) const
 Parse a string into a vector.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

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) const
std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > getOnlineTaus (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< const xAOD::jFexTauRoI * > getL1jTAUs (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 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 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 std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0) const
const SG::ReadHandleKey< xAOD::TauJetContainer > & getOnlineContainerKey (const std::string &sequence) 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"}
SG::ReadHandleKey< xAOD::TauJetContainerm_hltTauJetKey {this, "HLTTauJetKey", "HLT_TrigTauRecMerged_MVA", "HLT tracktwoMVA taujet container key"}
SG::ReadHandleKey< xAOD::TauJetContainerm_hltTauJetLLPKey {this, "HLTTauJetLLPKey", "HLT_TrigTauRecMerged_LLP", "HLT tracktwoLLP taujet container key"}
SG::ReadHandleKey< xAOD::TauJetContainerm_hltTauJetLRTKey {this, "HLTTauJetLRTKey", "HLT_TrigTauRecMerged_LRT", "HLT trackLRT taujet container key"}
SG::ReadHandleKey< xAOD::TauJetContainerm_hltTauJetCaloMVAOnlyKey {this, "HLTTauJetCaloMVAOnlyKey", "HLT_TrigTauRecMerged_CaloMVAOnly", "HLT ptonly taujet container key"}
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::pair< std::vector< std::shared_ptr< xAOD::TruthParticle > >, std::vector< std::shared_ptr< xAOD::TruthParticle > > > getTruthTaus (const EventContext &ctx, const float threshold=20.0) const
StatusCode examineTruthTau (const std::shared_ptr< xAOD::TruthParticle > &xTruthParticle) const
virtual StatusCode processEvent (const EventContext &ctx) const override
void fillTruthEfficiency (const std::vector< const xAOD::TauJet * > &online_tau_vec_all, const std::vector< std::shared_ptr< xAOD::TruthParticle > > &true_taus, const std::string &trigger, const std::string &nProng) const
void fillTruthVars (const std::vector< const xAOD::TauJet * > &tau_vec, const std::vector< std::shared_ptr< xAOD::TruthParticle > > &true_taus, const std::string &trigger, const std::string &nProng) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleKey {this, "truthParticleKey", "TruthParticles", "TruthParticleContainer 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 13 of file TrigTauMonitorTruthAlgorithm.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

◆ TrigTauMonitorTruthAlgorithm()

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

Definition at line 11 of file TrigTauMonitorTruthAlgorithm.cxx.

12 : TrigTauMonitorBaseAlgorithm(name, pSvcLocator)
13{}
TrigTauMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

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}

◆ classifyOfflineTaus()

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

Definition at line 322 of file TrigTauMonitorBaseAlgorithm.cxx.

323{
324 std::vector<const xAOD::TauJet*> tau_vec_1p, tau_vec_3p;
325
326 for(const xAOD::TauJet* const tau : classifyTausAll(taus, threshold, tau_id)) {
327 int nTracks = -1;
328 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
329
330 if(nTracks == 1) tau_vec_1p.push_back(tau);
331 else if(nTracks == 3) tau_vec_3p.push_back(tau);
332 }
333
334 return {tau_vec_1p, tau_vec_3p};
335}
static Double_t taus
std::vector< const xAOD::TauJet * > classifyTausAll(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 std::vector< const xAOD::TauJet * > & taus,
const float threshold = 0.0 ) const
protectedinherited

Definition at line 305 of file TrigTauMonitorBaseAlgorithm.cxx.

306{
307 std::vector<const xAOD::TauJet*> tau_vec_0p, tau_vec_1p, tau_vec_mp;
308
309 for(const xAOD::TauJet* tau : classifyTausAll(taus, threshold, TauID::None)) {
310 int nTracks = -1;
311 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
312
313 if(nTracks == 0) tau_vec_0p.push_back(tau);
314 else if(nTracks == 1) tau_vec_1p.push_back(tau);
315 else tau_vec_mp.push_back(tau);
316 }
317
318 return {tau_vec_0p, tau_vec_1p, tau_vec_mp};
319}

◆ classifyTausAll()

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

Definition at line 277 of file TrigTauMonitorBaseAlgorithm.cxx.

278{
279 std::vector<const xAOD::TauJet*> tau_vec;
280
281 SG::ReadDecorHandle<xAOD::TauJetContainer, char> tauid_medium{m_offlineGNTauDecorKey, Gaudi::Hive::currentContext()};
282 if(!tauid_medium.isValid()) {
283 ATH_MSG_WARNING("Cannot retrieve " << tauid_medium.key());
284 return tau_vec;
285 }
286
287 for(const xAOD::TauJet* tau : taus) {
288 if(tau->pt() < threshold*Gaudi::Units::GeV) continue;
289
290 // Consider only offline taus which pass medium ID WP
291 if(tau_id == TauID::RNN) {
292 if(!tau->isTau(xAOD::TauJetParameters::JetRNNSigMedium)) continue;
293 }
294 else if(tau_id == TauID::GNTau) {
295 if(!tauid_medium(*tau)) continue;
296 }
297
298 tau_vec.push_back(tau);
299 }
300
301 return tau_vec;
302}
#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 70 of file TrigTauMonitorBaseAlgorithm.h.

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

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

◆ examineTruthTau()

StatusCode TrigTauMonitorTruthAlgorithm::examineTruthTau ( const std::shared_ptr< xAOD::TruthParticle > & xTruthParticle) const
private

Definition at line 74 of file TrigTauMonitorTruthAlgorithm.cxx.

75{
76 if(!xTruthTau->hasDecayVtx()) return StatusCode::FAILURE;
77 static const SG::Accessor<double> acc_ptvis("pt_vis");
78 static const SG::Accessor<double> acc_etavis("eta_vis");
79 static const SG::Accessor<double> acc_phivis("phi_vis");
80 static const SG::Accessor<double> acc_mvis("mvis");
81 static const SG::Accessor<int> acc_childChargeSum("childChargeSum");
82 static const SG::Accessor<int> acc_ntracks("nTracks");
83 static const SG::Accessor<char> acc_isleptonic("IsLeptonicTau");
84
85 acc_isleptonic(*xTruthTau) = false;
86
87 TLorentzVector VisSumTLV;
88 acc_ptvis(*xTruthTau) = 0.;
89 acc_etavis(*xTruthTau) = 0.;
90 acc_phivis(*xTruthTau) = 0.;
91 acc_mvis(*xTruthTau) = 0.;
92 acc_childChargeSum(*xTruthTau) = 0;
93 acc_ntracks(*xTruthTau) = 0;
94
95 const xAOD::TruthVertex* decayvtx = xTruthTau->decayVtx();
96 if(decayvtx) {
97 const std::size_t nChildren = decayvtx->nOutgoingParticles();
98 for(std::size_t iChild = 0; iChild != nChildren; ++iChild) {
99 const xAOD::TruthParticle* child = decayvtx->outgoingParticle(iChild);
100 if(child) {
101 if(MC::isSMNeutrino(child)) continue;
102 if(!MC::isPhysical(child)) continue;
103 ATH_MSG_DEBUG("Child " << child->pdgId() << ", status " << child->status() << ", charge " << child->charge());
104 if(MC::isSMLepton(child)) acc_isleptonic(*xTruthTau) = true; // Just selects charged SM Leptons as we have already skipped SM neutrinos
105 VisSumTLV += child->p4();
106 acc_childChargeSum(*xTruthTau) += child->charge();
107 acc_ntracks(*xTruthTau) += std::abs(child->charge());
108 }
109 }
110 }
111 acc_ptvis(*xTruthTau) = VisSumTLV.Pt();
112 acc_etavis(*xTruthTau) = VisSumTLV.Eta();
113 acc_phivis(*xTruthTau) = VisSumTLV.Phi();
114 acc_mvis(*xTruthTau) = VisSumTLV.M();
115
116 if(acc_childChargeSum(*xTruthTau) != xTruthTau->charge() || acc_ntracks(*xTruthTau)%2 == 0) {
117 ATH_MSG_WARNING("Strange tau: charge " << acc_childChargeSum(*xTruthTau) << " and " << acc_ntracks(*xTruthTau) << " tracks");
118 const std::size_t nChildren = decayvtx->nOutgoingParticles();
119 for(std::size_t iChild = 0; iChild != nChildren; ++iChild) {
120 const xAOD::TruthParticle * child = decayvtx->outgoingParticle(iChild);
121 if(child) ATH_MSG_WARNING("Child "<< child->pdgId() << ", status "<< child->status() << ", charge "<< child->charge());
122 }
123 }
124
125 return StatusCode::SUCCESS;
126}
#define ATH_MSG_DEBUG(x)
int status() const
Status code.
int pdgId() const
PDG ID code.
double charge() const
Physical charge.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
bool isSMNeutrino(const T &p)
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ 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}
virtual StatusCode fillHistograms(const EventContext &ctx) const =0
adds event to the monitoring histograms
bool trigChainsArePassed(const std::vector< std::string > &vTrigNames) const
Check whether triggers are passed.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
ToolHandleArray< IDQFilterTool > m_DQFilterTools
Array of Data Quality filter tools.

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

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

◆ fillHistograms()

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

251{
252 ATH_MSG_DEBUG("Executing Monitoring algorithm");
253
254 // Protect against truncated events
255 // Since this happens very rarely, it won't bias the L1 distributions and efficiencies
256 if(m_trigDecTool->ExperimentalAndExpertMethods().isHLTTruncated()){
257 ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
258 return StatusCode::SUCCESS;
259 }
260
261 // Protect against LAr noise bursts and other detector errors
262 SG::ReadHandle<xAOD::EventInfo> eventInfo(GetEventInfo(ctx));
263 ATH_CHECK(eventInfo.isValid());
264 if (eventInfo->errorState(xAOD::EventInfo::LAr) == xAOD::EventInfo::Error
265 || eventInfo->errorState(xAOD::EventInfo::Tile) == xAOD::EventInfo::Error
266 || eventInfo->errorState(xAOD::EventInfo::SCT) == xAOD::EventInfo::Error
267 || eventInfo->isEventFlagBitSet(xAOD::EventInfo::Core, 18)) {
268 return StatusCode::SUCCESS;
269 }
270
272
273 return StatusCode::SUCCESS;
274}
#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.

◆ fillTruthEfficiency()

void TrigTauMonitorTruthAlgorithm::fillTruthEfficiency ( const std::vector< const xAOD::TauJet * > & online_tau_vec_all,
const std::vector< std::shared_ptr< xAOD::TruthParticle > > & true_taus,
const std::string & trigger,
const std::string & nProng ) const
private

Definition at line 160 of file TrigTauMonitorTruthAlgorithm.cxx.

161{
162 ATH_MSG_DEBUG("Fill Truth Tau Matching to Offline and Online Taus efficiencies: " << trigger);
163
164 const TrigTauInfo& info = getTrigInfo(trigger);
165
166 auto monGroup = getGroup(trigger+"_Truth_Efficiency_"+nProng);
167
168 // Truth Tau + HLT Tau / Truth Tau
169 auto pt_vis = Monitored::Scalar<float>("pt_vis", 0.0);
170 auto eta_vis = Monitored::Scalar<float>("eta_vis", 0.0);
171 auto phi_vis = Monitored::Scalar<float>("phi_vis", 0.0);
172 auto HLT_truth_match = Monitored::Scalar<bool>("HLT_pass", false);
173 auto HLT_truth_match_highPt = Monitored::Scalar<bool>("HLT_pass_highPt", false);
174
175 bool hlt_fires = m_trigDecTool->isPassed(trigger, TrigDefs::Physics | TrigDefs::allowResurrectedDecision);
176
177 static const SG::AuxElement::ConstAccessor<double> acc_ptvis("pt_vis");
178 static const SG::AuxElement::ConstAccessor<double> acc_etavis("eta_vis");
179 static const SG::AuxElement::ConstAccessor<double> acc_phivis("phi_vis");
180
181 for(const std::shared_ptr<xAOD::TruthParticle>& true_tau : true_taus) {
182 pt_vis = acc_ptvis(*true_tau)/Gaudi::Units::GeV;
183 eta_vis = acc_etavis(*true_tau);
184 phi_vis = acc_phivis(*true_tau);
185
186 HLT_truth_match = matchTruthObjects(true_tau.get(), online_tau_vec, 0.2) && hlt_fires;
187
188 bool is_highPt = false;
189 if(info.isHLTSingleTau()) is_highPt = pt_vis > info.getHLTTauThreshold() + 20.0;
190
191 fill(monGroup, pt_vis, eta_vis, phi_vis, HLT_truth_match);
192
193 if(is_highPt) {
194 HLT_truth_match_highPt = static_cast<bool>(HLT_truth_match);
195 fill(monGroup, eta_vis, phi_vis, HLT_truth_match_highPt);
196 }
197 }
198 ATH_MSG_DEBUG("After fill Truth efficiencies");
199}
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
bool matchTruthObjects(const T1 *true_tau, const std::vector< const T2 * > &tau_vec, float threshold) const
const TrigTauInfo & getTrigInfo(const std::string &trigger) 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.
monGroup(analysis_chain)

◆ fillTruthVars()

void TrigTauMonitorTruthAlgorithm::fillTruthVars ( const std::vector< const xAOD::TauJet * > & tau_vec,
const std::vector< std::shared_ptr< xAOD::TruthParticle > > & true_taus,
const std::string & trigger,
const std::string & nProng ) const
private

Definition at line 202 of file TrigTauMonitorTruthAlgorithm.cxx.

203{
204 ATH_MSG_DEBUG("Fill Truth variables: " << trigger);
205
206 auto monGroup = getGroup(trigger+"_TruthVars_"+nProng);
207
208 std::vector<float> ratio, ptvis, etavis, phivis, mvis;
209
210 auto PtRatio = Monitored::Collection("PtRatio", ratio);
211 auto pt_vis = Monitored::Collection("pt_vis", ptvis);
212 auto eta_vis = Monitored::Collection("eta_vis", etavis);
213 auto phi_vis = Monitored::Collection("phi_vis", phivis);
214 auto mass_vis = Monitored::Collection("mass_vis", mvis);
215
216 float matchedRatio = -999, matchedptvis = -999, matchedetavis = 999, matchedphivis = 999, matchedmvis = -999;
217
218 static const SG::AuxElement::ConstAccessor<double> acc_ptvis("pt_vis");
219 static const SG::AuxElement::ConstAccessor<double> acc_etavis("eta_vis");
220 static const SG::AuxElement::ConstAccessor<double> acc_phivis("phi_vis");
221 static const SG::AuxElement::ConstAccessor<double> acc_mvis("mvis");
222
223 // Visible-Truth Tau matching to HLT Tau
224 static const SG::ConstAccessor<double> pt_visAcc("pt_vis");
225 static const SG::ConstAccessor<double> eta_visAcc("eta_vis");
226 static const SG::ConstAccessor<double> phi_visAcc("phi_vis");
227 static const SG::ConstAccessor<double> mvisAcc("mvis");
228 for(auto& HLTTau : ef_taus) {
229 for(const std::shared_ptr<xAOD::TruthParticle>& true_tau : true_taus) {
230 if(matchTruthObjects(true_tau.get(), {HLTTau}, 0.2)) {
231 double pt_vis = acc_ptvis(*true_tau);
232 matchedptvis = pt_vis/Gaudi::Units::GeV;
233 matchedetavis = acc_etavis(*true_tau);
234 matchedphivis = acc_phivis(*true_tau);
235 matchedmvis = acc_mvis(*true_tau);
236 matchedRatio = HLTTau->pt()/pt_vis - 1.;
237 }
238 }
239
240 if(matchedptvis > 0) {
241 ptvis.push_back(matchedptvis);
242 etavis.push_back(matchedetavis);
243 phivis.push_back(matchedphivis);
244 mvis.push_back(matchedmvis);
245 ratio.push_back(matchedRatio);
246 }
247 }
248
249 fill(monGroup, pt_vis, eta_vis, phi_vis, mass_vis, PtRatio);
250
251 ATH_MSG_DEBUG("After fill Truth variables");
252}
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.

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

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

194{
195 std::vector<std::pair<const xAOD::eFexTauRoI*, const xAOD::jFexTauRoI*>> roi_vec;
196
197 SG::ReadHandle<xAOD::eFexTauRoIContainer> rois(m_phase1l1cTauRoIKey, ctx);
198 if(!rois.isValid()) {
199 ATH_MSG_WARNING("Failed to retrieve the L1_cTauRoi container");
200 return roi_vec;
201 }
202 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, ElementLink<xAOD::jFexTauRoIContainer>> jTau_roi_link{m_phase1l1cTauRoIDecorKey, ctx};
203 if(!jTau_roi_link.isValid()) {
204 ATH_MSG_WARNING("Failed to create jTauLink accessor for the L1_cTauRoi container");
205 return roi_vec;
206 }
207
209 for(size_t i = 0; i < rois->size(); i++) {
210 const xAOD::eFexTauRoI* roi = (*rois)[i];
211 const xAOD::jFexTauRoI* jTau_roi = jTau_roi_link(i).isValid() ? *jTau_roi_link(i) : nullptr;
212
213 // Select by RoI ET value only
214 if(roi->et() > m_L1_Phase1_thresholds.value().at(l1_item)) roi_vec.push_back(std::make_pair(roi, jTau_roi));
215 }
216 } else {
217 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, uint64_t> thresholdPatterns(m_phase1l1cTauRoIThresholdPatternsKey, ctx);
218 if(!thresholdPatterns.isValid()) {
219 ATH_MSG_WARNING("Failed to create thresholdPatterns property accessor for the L1_cTauRoi container");
220 return roi_vec;
221 }
222
223 for(size_t i = 0; i < rois->size(); i++) {
224 const xAOD::eFexTauRoI* roi = (*rois)[i];
225 const xAOD::jFexTauRoI* jTau_roi = jTau_roi_link(i).isValid() ? *jTau_roi_link(i) : nullptr;
226
227 // Check that the RoI passed the threshold selection
228 if(thresholdPatterns(*roi) & m_L1_Phase1_threshold_patterns.value().at(l1_item)) roi_vec.push_back(std::make_pair(roi, jTau_roi));
229 }
230 }
231
232
233 return roi_vec;
234}
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
float et() const
TOB ET (decoded from TOB, stored for convenience)
jFexTauRoI_v1 jFexTauRoI
Define the latest version of the jFexSRJetRoI class.
Definition jFexTauRoI.h:13
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition eFexTauRoI.h:16

◆ getL1eTAUs()

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

Definition at line 129 of file TrigTauMonitorBaseAlgorithm.cxx.

130{
131 std::vector<const xAOD::eFexTauRoI*> roi_vec;
132
133 SG::ReadHandle<xAOD::eFexTauRoIContainer> rois(m_phase1l1eTauRoIKey, ctx);
134 if(!rois.isValid()) {
135 ATH_MSG_WARNING("Failed to retrieve the L1_eTauRoi container");
136 return roi_vec;
137 }
138
140 for(const xAOD::eFexTauRoI* roi : *rois) {
141 // Select by RoI ET value only
142 if(roi->et() > m_L1_Phase1_thresholds.value().at(l1_item)) roi_vec.push_back(roi);
143 }
144 } else {
145 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, uint64_t> thresholdPatterns(m_phase1l1eTauRoIThresholdPatternsKey, ctx);
146 if(!thresholdPatterns.isValid()) {
147 ATH_MSG_WARNING("Failed to create thresholdPatterns property accessor for the L1_eTauRoi container");
148 return roi_vec;
149 }
150
151 for(const xAOD::eFexTauRoI* roi : *rois) {
152 // Check that the RoI passed the threshold selection
153 if(thresholdPatterns(*roi) & m_L1_Phase1_threshold_patterns.value().at(l1_item)) roi_vec.push_back(roi);
154 }
155 }
156
157 return roi_vec;
158}
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauRoIKey
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauRoIThresholdPatternsKey

◆ getL1jTAUs()

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

Definition at line 161 of file TrigTauMonitorBaseAlgorithm.cxx.

162{
163 std::vector<const xAOD::jFexTauRoI*> roi_vec;
164
165 SG::ReadHandle<xAOD::jFexTauRoIContainer> rois(m_phase1l1jTauRoIKey, ctx);
166 if(!rois.isValid()) {
167 ATH_MSG_WARNING("Failed to retrieve the L1_jTauRoi container");
168 return roi_vec;
169 }
170
172 for(const xAOD::jFexTauRoI* roi : *rois) {
173 // Select by RoI ET value only
174 if(roi->et() > m_L1_Phase1_thresholds.value().at(l1_item)) roi_vec.push_back(roi);
175 }
176 } else {
177 SG::ReadDecorHandle<xAOD::jFexTauRoIContainer, uint64_t> thresholdPatterns(m_phase1l1jTauRoIThresholdPatternsKey, ctx);
178 if(!thresholdPatterns.isValid()) {
179 ATH_MSG_WARNING("Failed to create thresholdPatterns property accessor for the L1_jTauRoi container");
180 return roi_vec;
181 }
182
183 for(const xAOD::jFexTauRoI* roi : *rois) {
184 // Check that the RoI passed the threshold selection
185 if(thresholdPatterns(*roi) & m_L1_Phase1_threshold_patterns.value().at(l1_item)) roi_vec.push_back(roi);
186 }
187 }
188
189 return roi_vec;
190}
SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_phase1l1jTauRoIKey
SG::ReadDecorHandleKey< xAOD::jFexTauRoIContainer > m_phase1l1jTauRoIThresholdPatternsKey

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

124{
125 return classifyOfflineTaus(getOfflineTausAll(ctx, threshold), threshold, tau_id);
126}
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 * > > classifyOfflineTaus(const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const

◆ getOfflineTausAll()

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

Definition at line 87 of file TrigTauMonitorBaseAlgorithm.cxx.

88{
89 ATH_MSG_DEBUG("Retrieving offline Taus");
90
91 std::vector<const xAOD::TauJet*> tau_vec;
92
93 SG::ReadHandle<xAOD::TauJetContainer> taus(m_offlineTauJetKey, ctx);
94 if(!taus.isValid()) {
95 ATH_MSG_WARNING("Failed to retrieve offline Taus");
96 return tau_vec;
97 }
98
99 for(const xAOD::TauJet* const tau : *taus) {
100 // Consider only offline taus with a certain minimum pT
101 if(tau->pt() < threshold*Gaudi::Units::GeV) continue;
102
103 // Consider only offline taus outside of the crack region
104 if(std::abs(tau->eta()) > 1.37 && std::abs(tau->eta()) < 1.52) continue;
105
106 // Consider only offline taus which pass RNN medium WP
107 if(!tau->isTau(xAOD::TauJetParameters::JetRNNSigMedium)) continue;
108
109 // Consider only offline taus which pass thinning
110 static const SG::ConstAccessor<char> passThinningAcc("passThinning");
111 if(!passThinningAcc.withDefault(*tau, true)) continue;
112
113 int nTracks = -1;
114 tau->detail(xAOD::TauJetParameters::nChargedTracks, nTracks);
115 ATH_MSG_DEBUG("NTracks Offline: " << nTracks);
116 if(nTracks == 1 || nTracks == 3) tau_vec.push_back(tau);
117 }
118
119 return tau_vec;
120}
SG::ReadHandleKey< xAOD::TauJetContainer > m_offlineTauJetKey

◆ getOnlineContainerKey()

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

Definition at line 237 of file TrigTauMonitorBaseAlgorithm.cxx.

238{
239 if(sequence == "tracktwoMVA" || sequence == "tracktwoMVABDT") return m_hltTauJetKey;
240 else if(sequence == "tracktwoLLP") return m_hltTauJetLLPKey;
241 else if(sequence == "trackLRT") return m_hltTauJetLRTKey;
242 else if(sequence == "ptonly") return m_hltTauJetCaloMVAOnlyKey;
243 else {
244 ATH_MSG_ERROR("Unknown HLT TauJet container for sequence \"" << sequence << "\". Returning the default \"" << m_hltTauJetKey.key() << "\"");
245 return m_hltTauJetKey;
246 }
247}
#define ATH_MSG_ERROR(x)
SG::ReadHandleKey< xAOD::TauJetContainer > m_hltTauJetKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_hltTauJetLLPKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_hltTauJetCaloMVAOnlyKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_hltTauJetLRTKey

◆ getOnlineTaus()

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

Definition at line 81 of file TrigTauMonitorBaseAlgorithm.cxx.

82{
83 return classifyOnlineTaus(getOnlineTausAll(trigger, true), 0.0);
84}
std::tuple< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOnlineTaus(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) const

◆ getOnlineTausAll()

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

Definition at line 57 of file TrigTauMonitorBaseAlgorithm.cxx.

58{
59 std::vector<const xAOD::TauJet*> tau_vec;
60
61
62 const TrigTauInfo& info = getTrigInfo(trigger);
63 const std::string tau_container_name = getOnlineContainerKey(info.getHLTTauType()).key();
64 ATH_MSG_DEBUG("Tau container name is: " << tau_container_name);
65 auto vec = m_trigDecTool->features<xAOD::TauJetContainer>(trigger, TrigDefs::Physics, tau_container_name);
66 for(auto& featLinkInfo : vec) {
67 const xAOD::TauJet* feat = *(featLinkInfo.link);
68 if(!feat) continue;
69
70 int nTracks = -1;
72 ATH_MSG_DEBUG("NTracks Online: " << nTracks);
73
74 if(include_0P && nTracks == 0) tau_vec.push_back(feat);
75 else tau_vec.push_back(feat);
76 }
77
78 return tau_vec;
79}
std::vector< size_t > vec
const SG::ReadHandleKey< xAOD::TauJetContainer > & getOnlineContainerKey(const std::string &sequence) const
bool detail(TauJetParameters::Detail detail, int &value) const
Get and set values of common details variables via enum.
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 198 of file AthMonitorAlgorithm.cxx.

198 {
199 return m_trigDecTool;
200}

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

◆ getTruthTaus()

std::pair< std::vector< std::shared_ptr< xAOD::TruthParticle > >, std::vector< std::shared_ptr< xAOD::TruthParticle > > > TrigTauMonitorTruthAlgorithm::getTruthTaus ( const EventContext & ctx,
const float threshold = 20.0 ) const
private

Definition at line 25 of file TrigTauMonitorTruthAlgorithm.cxx.

26{
27 std::vector<std::shared_ptr<xAOD::TruthParticle>> true_taus_1p;
28 std::vector<std::shared_ptr<xAOD::TruthParticle>> true_taus_3p;
29
30 // Truth Taus distributions
31 SG::ReadHandle<xAOD::TruthParticleContainer> truth_cont(m_truthParticleKey, ctx);
32 if(!truth_cont.isValid()) {
33 ATH_MSG_WARNING("Failed to retrieve truth Taus");
34 return {true_taus_1p, true_taus_3p};
35 }
36
37 static const SG::ConstAccessor<double> acc_ptvis("pt_vis");
38 static const SG::ConstAccessor<double> acc_etavis("eta_vis");
39 static const SG::ConstAccessor<int> acc_ntracks("nTracks");
40 static const SG::ConstAccessor<char> acc_isleptonic("IsLeptonicTau");
41
42 // Fill truth tau containers
43 for(const auto xTruthParticle : *truth_cont) {
44 if(xTruthParticle->isTau()) {
45 ATH_MSG_DEBUG("Tau with status " << xTruthParticle->status() << " and charge " << xTruthParticle->charge());
46
47 // Create a copy of the original TruthParticle, to augment it with tau-specific properties
48 std::shared_ptr xTruthTau = std::make_shared<xAOD::TruthParticle>();
49 xTruthTau->makePrivateStore(*xTruthParticle);
50
51 // Keep only truth taus
52 if(examineTruthTau(xTruthTau).isFailure()) continue;
53
54 // Keep only the hadronic decay mode
55 if(acc_isleptonic(*xTruthTau)) continue;
56
57 float pt = acc_ptvis(*xTruthTau);
58 float eta = acc_etavis(*xTruthTau);
59 ATH_MSG_DEBUG("True Tau visible pt: " << pt << ", eta: " << eta);
60
61 // Keep only truth taus in the barrel region, with a pT > 20 GeV (offline minimum threshold)
62 if(pt < threshold || std::abs(eta) > 2.47) continue;
63
64 int nTracks = acc_ntracks(*xTruthTau);
65 if(nTracks == 1) true_taus_1p.push_back(xTruthTau);
66 else if(nTracks == 3) true_taus_3p.push_back(xTruthTau);
67 }
68 }
69
70 return {true_taus_1p, true_taus_3p};
71}
Scalar eta() const
pseudorapidity method
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleKey
StatusCode examineTruthTau(const std::shared_ptr< xAOD::TruthParticle > &xTruthParticle) const

◆ initialize()

StatusCode TrigTauMonitorTruthAlgorithm::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from TrigTauMonitorBaseAlgorithm.

Definition at line 16 of file TrigTauMonitorTruthAlgorithm.cxx.

16 {
18
19 ATH_CHECK( m_truthParticleKey.initialize() );
20
21 return StatusCode::SUCCESS;
22}
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()

◆ 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 78 of file TrigTauMonitorBaseAlgorithm.h.

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

◆ 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 95 of file TrigTauMonitorBaseAlgorithm.h.

96 {
97 return dR(tau_1->eta(), tau_1->phi(), tau_2->eta(), tau_2->phi()) < threshold;
98 }
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 86 of file TrigTauMonitorBaseAlgorithm.h.

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

◆ 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 101 of file TrigTauMonitorBaseAlgorithm.h.

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

◆ 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

◆ processEvent()

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

Implements TrigTauMonitorBaseAlgorithm.

Definition at line 129 of file TrigTauMonitorTruthAlgorithm.cxx.

130{
131 // Truth taus
132 auto true_taus = getTruthTaus(ctx, 20.0);
133 std::vector<std::shared_ptr<xAOD::TruthParticle>> true_taus_1p = true_taus.first;
134 std::vector<std::shared_ptr<xAOD::TruthParticle>> true_taus_3p = true_taus.second;
135
136 for(const std::string& trigger : m_triggers) {
137
138 // skip ditau and T&P chains:
139 const TrigTauInfo& info = getTrigInfo(trigger);
140 if( info.isHLTTandP() || info.isHLTDiTau()) continue;
141
142 // Online taus
143 std::vector<const xAOD::TauJet*> hlt_taus = getOnlineTausAll(trigger, true);
144
145 if(!true_taus_1p.empty()) {
146 if(m_do_variable_plots) fillTruthVars(hlt_taus, true_taus_1p, trigger, "1P");
147 if(m_do_efficiency_plots) fillTruthEfficiency(hlt_taus, true_taus_1p, trigger, "1P");
148 }
149
150 if(!true_taus_3p.empty()) {
151 if(m_do_variable_plots) fillTruthVars(hlt_taus, true_taus_3p, trigger, "3P");
152 if(m_do_efficiency_plots) fillTruthEfficiency(hlt_taus, true_taus_3p, trigger, "3P");
153 }
154 }
155
156 return StatusCode::SUCCESS;
157}
Gaudi::Property< bool > m_do_efficiency_plots
Gaudi::Property< std::vector< std::string > > m_triggers
Gaudi::Property< bool > m_do_variable_plots
void fillTruthEfficiency(const std::vector< const xAOD::TauJet * > &online_tau_vec_all, const std::vector< std::shared_ptr< xAOD::TruthParticle > > &true_taus, const std::string &trigger, const std::string &nProng) const
std::pair< std::vector< std::shared_ptr< xAOD::TruthParticle > >, std::vector< std::shared_ptr< xAOD::TruthParticle > > > getTruthTaus(const EventContext &ctx, const float threshold=20.0) const
void fillTruthVars(const std::vector< const xAOD::TauJet * > &tau_vec, const std::vector< std::shared_ptr< xAOD::TruthParticle > > &true_taus, const std::string &trigger, const std::string &nProng) const

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ trigChainsArePassed()

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

Check whether triggers are passed.

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

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

Definition at line 203 of file AthMonitorAlgorithm.cxx.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_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 135 of file TrigTauMonitorBaseAlgorithm.h.

135{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 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_hltTauJetCaloMVAOnlyKey

SG::ReadHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_hltTauJetCaloMVAOnlyKey {this, "HLTTauJetCaloMVAOnlyKey", "HLT_TrigTauRecMerged_CaloMVAOnly", "HLT ptonly taujet container key"}
protectedinherited

Definition at line 126 of file TrigTauMonitorBaseAlgorithm.h.

126{this, "HLTTauJetCaloMVAOnlyKey", "HLT_TrigTauRecMerged_CaloMVAOnly", "HLT ptonly taujet container key"};

◆ m_hltTauJetKey

SG::ReadHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_hltTauJetKey {this, "HLTTauJetKey", "HLT_TrigTauRecMerged_MVA", "HLT tracktwoMVA taujet container key"}
protectedinherited

Definition at line 123 of file TrigTauMonitorBaseAlgorithm.h.

123{this, "HLTTauJetKey", "HLT_TrigTauRecMerged_MVA", "HLT tracktwoMVA taujet container key"};

◆ m_hltTauJetLLPKey

SG::ReadHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_hltTauJetLLPKey {this, "HLTTauJetLLPKey", "HLT_TrigTauRecMerged_LLP", "HLT tracktwoLLP taujet container key"}
protectedinherited

Definition at line 124 of file TrigTauMonitorBaseAlgorithm.h.

124{this, "HLTTauJetLLPKey", "HLT_TrigTauRecMerged_LLP", "HLT tracktwoLLP taujet container key"};

◆ m_hltTauJetLRTKey

SG::ReadHandleKey<xAOD::TauJetContainer> TrigTauMonitorBaseAlgorithm::m_hltTauJetLRTKey {this, "HLTTauJetLRTKey", "HLT_TrigTauRecMerged_LRT", "HLT trackLRT taujet container key"}
protectedinherited

Definition at line 125 of file TrigTauMonitorBaseAlgorithm.h.

125{this, "HLTTauJetLRTKey", "HLT_TrigTauRecMerged_LRT", "HLT trackLRT taujet container key"};

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

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

Definition at line 137 of file TrigTauMonitorBaseAlgorithm.h.

137{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 121 of file TrigTauMonitorBaseAlgorithm.h.

121{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 144 of file TrigTauMonitorBaseAlgorithm.h.

144{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 143 of file TrigTauMonitorBaseAlgorithm.h.

143{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 145 of file TrigTauMonitorBaseAlgorithm.h.

145{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 139 of file TrigTauMonitorBaseAlgorithm.h.

139{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 140 of file TrigTauMonitorBaseAlgorithm.h.

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

◆ m_phase1l1jTauRoIKey

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

Definition at line 141 of file TrigTauMonitorBaseAlgorithm.h.

141{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 142 of file TrigTauMonitorBaseAlgorithm.h.

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

◆ 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 131 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_truthParticleKey

SG::ReadHandleKey< xAOD::TruthParticleContainer> TrigTauMonitorTruthAlgorithm::m_truthParticleKey {this, "truthParticleKey", "TruthParticles", "TruthParticleContainer key"}
private

Definition at line 32 of file TrigTauMonitorTruthAlgorithm.h.

32{this, "truthParticleKey", "TruthParticles", "TruthParticleContainer key"};

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