ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
RatesAnalysisAlg Class Referenceabstract

virtual analysis class for performing rates studies on AOD Pure virtual base class for trigger rate studies on EnhancedBias or MC AOD files. More...

#include <RatesAnalysisAlg.h>

Inheritance diagram for RatesAnalysisAlg:
Collaboration diagram for RatesAnalysisAlg:

Public Types

enum  Method_t { kMANUAL, kAUTO, kEXISTING }
 Method by which the trigger pass/fail decision is calculated. More...
 

Public Member Functions

 RatesAnalysisAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~RatesAnalysisAlg ()
 
virtual StatusCode ratesInitialize ()=0
 To be implemented by the user. More...
 
virtual StatusCode ratesExecute ()=0
 To be implemented by the user. More...
 
virtual StatusCode ratesFinalize ()=0
 To be implemented by the user. More...
 
StatusCode newTrigger (const std::string &name, const double prescale=1., const double expressPrescale=-1., const std::string &seedName="", const double seedPrecale=1., const std::string &groups="", const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
 Version of newTrigger which accepts a set of group names rather than a comma separated string. More...
 
StatusCode newTrigger (const std::string &name, const double prescale=1., const double expressPrescale=-1., const std::string &seedName="", const double seedPrecale=1., const std::set< std::string > &groups=std::set< std::string >(), const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
 Register a new trigger for emulation. More...
 
StatusCode newScanTrigger (const std::string &name, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins=100, const RatesScanTrigger::TriggerBehaviour_t behaviour=RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold, const double prescale=1., const std::string &seedName="", const double seedPrecale=1., const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
 Register a new threshold scan trigger which plots rate as a function of some dependent variable. More...
 
StatusCode newScanTrigger (const std::string &name, const std::vector< double > &thresholdBinEdges, const RatesScanTrigger::TriggerBehaviour_t behaviour=RatesScanTrigger::TriggerBehaviour_t::kTriggerAboveThreshold, const double prescale=1., const std::string &seedName="", const double seedPrecale=1., const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
 Version of newScanTrigger which takes a vector of bin edges. More...
 
StatusCode addAllExisting ()
 Register all existing triggers in the AOD into the rates algorithm. More...
 
StatusCode addExisting (const std::string pattern)
 Register some existing triggers based on wild-card match, e.g. More...
 
StatusCode setTriggerDesicison (const std::string &name, const bool triggerIsPassed=true, const bool triggerIsActive=true)
 Set the pass/fail decision for an item. More...
 
StatusCode setTriggerDesicison (const std::string &name, const double threshold)
 Set the pass threshold for a Scan Trigger item. More...
 
void setTargetLumiMu (const double lumi, const double mu)
 Set the target instantaneous luminosity and mu. More...
 
void setTargetLumiBunches (const double lumi, const int32_t bunches)
 Set the target instantaneous luminosity and number of bunches. More...
 
void setTargetMuBunches (const double mu, const int32_t bunches)
 Set the target mu and number of bunches. More...
 
void setTargetLumi (const double lumi)
 Set the target instantaneous luminosity. More...
 
void setTargetMu (const double mu)
 Set the target pileup. More...
 
void setExponentialMuScalingFactor (const double f)
 Set the exponential scaling factor for relevant chains. More...
 
virtual StatusCode sysInitialize () override
 Function initialising the tool in the correct way in Athena. More...
 
virtual StatusCode sysExecute (const EventContext &) override
 override to do firstEvent method More...
 
template<typename T >
StatusCode retrieveMetadata (const std::string &folder, const std::string &key, T &out)
 Helper function to access IOVMetaDataContainer information helped in the MetaDataStore. More...
 
template<typename T >
StatusCode retrieveMetadata (const std::string &folder, const std::string &key, T &out, const IOVTime &time, int channel=-1)
 Helper function to access IOVMetaDataContainer information held in InputMetaDataStore, but will check IOVTime. More...
 
const ServiceHandle< ITHistSvc > & histSvc () const
 The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void updateEvtStore (Gaudi::Details::PropertyBase &prop)
 
virtual void handle (const Incident &inc) override
 Function receiving incidents from IncidentSvc/TEvent Experts can override but they should ensure they add AthAnalysisAlgorithm::handle(); to the end of their own implementation. More...
 
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened user can read input metadata from inputMetaStore() More...
 
virtual StatusCode endInputFile ()
 Function called as an input file is being closed. More...
 
virtual StatusCode metaDataStop ()
 Function called before finalize user can read output metadata from outputMetaStore() More...
 
virtual StatusCode firstExecute ()
 Function called when first execute is encountered user can read event information with evtStore() More...
 
virtual TFile * currentFile (const char *evtSelName="EventSelector") final
 Function returning the TFile pointer of the currently open file of the given EventSelector (in athena jobs this defaults to "EventSelector") More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 
StatusCode configAthHistogramming (const ServiceHandle< ITHistSvc > &histSvc, const std::string &prefix, const std::string &rootDir, const std::string &histNamePrefix, const std::string &histNamePostfix, const std::string &histTitlePrefix, const std::string &histTitlePostfix)
 To be called by the derived classes to fill the internal configuration. More...
 
TH1bookGetPointer (const TH1 &hist, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
TH1bookGetPointer (TH1 *hist, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
TH1bookGetPointer (TH1 &histRef, std::string tDir="", std::string stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
TTree * bookGetPointer (const TTree &treeRef, std::string tDir="", std::string stream="")
 Simplify the booking and registering (into THistSvc) of TTrees. More...
 
TGraph * bookGetPointer (const TGraph &graphRef, std::string tDir="", std::string stream="")
 Simplify the booking and registering (into THistSvc) of TGraphs. More...
 
TEfficiency * bookGetPointer (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
TEfficiency * bookGetPointer (TEfficiency *eff, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
TEfficiency * bookGetPointer (TEfficiency &effRef, std::string tDir="", std::string stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
StatusCode book (const TH1 &hist, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
StatusCode book (TH1 *hist, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
StatusCode book (TH1 &histRef, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of histograms. More...
 
StatusCode book (const TTree &treeRef, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TTrees. More...
 
StatusCode book (const TGraph &graphRef, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TGraphs. More...
 
StatusCode book (const TEfficiency &eff, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
StatusCode book (TEfficiency *eff, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
StatusCode book (TEfficiency &effRef, const std::string &tDir="", const std::string &stream="")
 Simplify the booking and registering (into THistSvc) of TEfficiency. More...
 
TH1hist (const std::string &histName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered histograms of any type. More...
 
TH2hist2d (const std::string &histName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered 2-d histograms. More...
 
TH3hist3d (const std::string &histName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered 3-d histograms. More...
 
TTree * tree (const std::string &treeName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered TTrees. More...
 
TGraph * graph (const std::string &graphName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered TGraphs. More...
 
TEfficiency * efficiency (const std::string &effName, const std::string &tDir="", const std::string &stream="")
 Simplify the retrieval of registered TEfficiency. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 
typedef uint32_t hash_t
 typedef for the internal hash More...
 
typedef std::map< const hash_t, TH1 * > HistMap_t
 Typedef for convenience. More...
 
typedef std::map< const hash_t, TEfficiency * > EffMap_t
 Typedef for convenience. More...
 
typedef std::map< const hash_t, TTree * > TreeMap_t
 Typedef for convenience. More...
 
typedef std::map< const hash_t, TGraph * > GraphMap_t
 Typedef for convenience. More...
 

Private Member Functions

virtual StatusCode initialize ()
 Get the trigger decision tool and set up global groups. More...
 
virtual StatusCode execute ()
 In first call - register all triggers. More...
 
virtual StatusCode finalize ()
 Print rates. More...
 
StatusCode populateTriggers ()
 Register all triggers to emulate. More...
 
StatusCode executeTrigDecisionToolTriggers ()
 Internal call to get the pass/fail for all TDT triggers. More...
 
StatusCode executeTriggerEmulation ()
 Internal call to get the pass/fail for all automatically emulated triggers. More...
 
StatusCode checkExistingTrigger (const std::string &name, const std::string &seedName)
 Internal function to check if a supplied HLT trigger and L1 seed match what is stored in the AOD config. More...
 
StatusCode checkGotTDT ()
 Internal check that the TDT is fetched. More...
 
void printInputSummary () const
 Print the input data instantaneous luminosity, mu and number of bunches. More...
 
void printStatistics () const
 Print some extra statistics on events processed. More...
 
void printTarget () const
 Print the target instantaneous luminosity, mu and number of bunches. More...
 
void writeMetadata ()
 Write to outpute tree (if any) the metadata needed downstream. More...
 
bool isCPS (const std::string &group) const
 String match coherent prescale groups. More...
 
bool isRandomSeed (const std::string &me, const std::string &seed) const
 String match random L1 items. More...
 
uint32_t getLevel (const std::string &name) const
 String match to a trigger level. More...
 
bool isZero (double v) const
 Helper function for floating point subtraction. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 
void buildBookingString (std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false)
 Method to build individual booking string. More...
 
void myReplace (std::string &str, const std::string &oldStr, const std::string &newStr)
 Helper method to replace sub-string. More...
 
hash_t hash (const std::string &histName) const
 Method to calculate a 32-bit hash from a string. More...
 

Private Attributes

std::unordered_map< std::string, std::unique_ptr< RatesTrigger > > m_triggers
 All individual triggers (L1 or HLT) More...
 
std::unordered_map< std::string, std::unique_ptr< RatesScanTrigger > > m_scanTriggers
 All individual rates-scan triggers (L1 or HLT) More...
 
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_groups
 All regular and CPS groups. More...
 
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_globalGroups
 Big (master) groups which do the OR of the whole menu. More...
 
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_uniqueGroups
 Groups used to obtain unique rates for chains. More...
 
std::unordered_set< RatesTrigger * > m_activatedTriggers
 Triggers which were changed & hence need to be reset at the event end. More...
 
std::unordered_set< RatesTrigger * > m_expressTriggers
 Triggers with non-zero express PS, used to print them at the end. More...
 
std::unordered_set< RatesGroup * > m_activeGroups
 All groups which are enabled (PS >= 1) More...
 
std::unordered_map< size_t, double > m_lowestPrescale
 Lowest prescale within a CPS group, key is the hash of the CPS group name. More...
 
std::vector< std::string > m_autoTriggers
 List of triggers which it is up to us to the algorithm to work out the pass/fail for. More...
 
std::unordered_map< std::string, const Trig::ChainGroup * > m_existingTriggers
 Map of triggers which we ask the TDT ChainGroup for the pass/fail. More...
 
std::unordered_map< std::string, std::string > m_lowerTrigger
 Map of triggers lower chain, to tell if a HLT trigger ran or not. More...
 
std::vector< std::vector< std::string > > m_hltChainIDGroup
 
std::vector< std::vector< std::string > > m_l1ItemID
 
const std::string m_l1GroupName = "L1"
 
const std::string m_l2GroupName = "HLT"
 
const std::string m_expressGroupName = "Express"
 
ToolHandle< IEnhancedBiasWeighterm_enhancedBiasRatesTool {this, "EnhancedBiasRatesTool", "EnhancedBiasWeighter/EnhancedBiasRatesTool"}
 
ToolHandle< Trig::TrigDecisionToolm_tdt {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"}
 
ServiceHandle< TrigConf::ITrigConfigSvcm_configSvc {this, "TrigConfigSvc", ""}
 
Gaudi::Property< double > m_expoScalingFactor {this, "ExpoScalingFactor", 0.1, "Optional. Exponential factor if using exponential-mu rates scaling."}
 
Gaudi::Property< double > m_inelasticCrossSection {this, "InelasticCrossSection", 8e-26, "Inelastic cross section in units cm^2. Default 80 mb at 13 TeV."}
 
Gaudi::Property< bool > m_doUniqueRates {this, "DoUniqueRates", false, "Calculate unique rates for all chains (slow). Requires DoGlobalGroups=True too."}
 
Gaudi::Property< bool > m_doGlobalGroups {this, "DoGlobalGroups", false, "Calculate total rates for each trigger level."}
 
Gaudi::Property< bool > m_doTriggerGroups {this, "DoTriggerGroups", false, "Calculate total rates for each group of triggers."}
 
Gaudi::Property< bool > m_doExpressRates {this, "DoExpressRates", false, "Calculate total rates for the express stream."}
 
Gaudi::Property< bool > m_useBunchCrossingData {this, "UseBunchCrossingData", true, "BunchCrossing data requires CONDBR2 access. Can be disabled here if this is a problem."}
 
Gaudi::Property< bool > m_currentEventIsUnbiased
 If the current event was triggered online by RDx or not. More...
 
Gaudi::Property< bool > m_doHistograms {this, "DoHistograms", true, "Switch on histogram output of rate vs. mu and position in train."}
 
Gaudi::Property< bool > m_enableLumiExtrapolation {this, "EnableLumiExtrapolation", true, "If false then no extrapolation in L, N_bunch or <mu> will be performed.."}
 
Gaudi::Property< uint32_t > m_vetoStartOfTrain {this, "VetoStartOfTrain", 0, "How many BCID to veto at the start of a bunch train."}
 
Gaudi::Property< std::map< std::string, std::map< std::string, double > > > m_prescalesJSON {this, "PrescalesJSON", {}, "Optional JSON of prescales from the TrigMenuRuleBook to apply."}
 
double m_targetMu
 What pileup level the prediction is targeting. More...
 
double m_targetBunches
 How many bunches the prediction is targeting. More...
 
double m_targetLumi
 What instantaneous luminosity the prediction is targeting. More...
 
uint32_t m_runNumber
 What is the RunNumber. More...
 
double m_ratesDenominator
 How much walltime is seen by the algorithm. More...
 
uint32_t m_eventCounter
 Count how many events processed. More...
 
double m_weightedEventCounter
 Count how many weighted events were processed. More...
 
TH1Dm_scalingHist
 One-bin histogram to store the normalisation of the sample, for use in later combinations. More...
 
TH1Dm_bcidHist
 Histogram of the BCIDs distribution of the processing. More...
 
TTree * m_metadataTree
 Used to write out some metadata needed by post-processing (e.g. More...
 
WeightingValuesSummary_t m_weightingValues
 Possible weighting & lumi extrapolation values for the current event. More...
 
ServiceHandle< StoreGateSvcm_inputMetaStore
 Object accessing the input metadata store. More...
 
ServiceHandle< StoreGateSvcm_outputMetaStore
 Object accessing the output metadata store. More...
 
TFile * m_currentFile {nullptr}
 
bool m_doneFirstEvent {false}
 
ServiceHandle< ITHistSvc > m_histSvc
 Default constructor: AthHistogramAlgorithm();. More...
 
std::string m_prefix
 Name of the ROOT output stream (file) More...
 
std::string m_rootDir
 Name of the ROOT directory. More...
 
std::string m_histNamePrefix
 The prefix for the histogram THx name. More...
 
std::string m_histNamePostfix
 The postfix for the histogram THx name. More...
 
std::string m_histTitlePrefix
 The prefix for the histogram THx title. More...
 
std::string m_histTitlePostfix
 The postfix for the histogram THx title. More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 
HistMap_t m_histMap
 The map of histogram names to their pointers. More...
 
EffMap_t m_effMap
 The map of histogram names to their pointers. More...
 
TreeMap_t m_treeMap
 The map of TTree names to their pointers. More...
 
GraphMap_t m_graphMap
 The map of TGraph names to their pointers. More...
 
std::string m_streamName
 Name of the ROOT output stream (file) More...
 
std::string m_name
 Instance name. More...
 
MsgStream m_msg
 Cached Message Stream. More...
 

Detailed Description

virtual analysis class for performing rates studies on AOD Pure virtual base class for trigger rate studies on EnhancedBias or MC AOD files.

This class should be inherited and the user should implement ratesInitialize, ratesExecute and ratesFinalize. Triggers to emulate should be added in ratesInitialize with newTrigger or other members such as addExisting. Manually emulated triggers should have their decision supplied during ratesExecute using setTriggerDesicison. Rates will be reported at the end.

Definition at line 37 of file RatesAnalysisAlg.h.

Member Typedef Documentation

◆ EffMap_t

typedef std::map< const hash_t, TEfficiency* > AthHistogramming::EffMap_t
privateinherited

Typedef for convenience.

Definition at line 205 of file AthHistogramming.h.

◆ GraphMap_t

typedef std::map< const hash_t, TGraph* > AthHistogramming::GraphMap_t
privateinherited

Typedef for convenience.

Definition at line 219 of file AthHistogramming.h.

◆ hash_t

typedef uint32_t AthHistogramming::hash_t
privateinherited

typedef for the internal hash

Definition at line 169 of file AthHistogramming.h.

◆ HistMap_t

typedef std::map< const hash_t, TH1* > AthHistogramming::HistMap_t
privateinherited

Typedef for convenience.

Definition at line 198 of file AthHistogramming.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TreeMap_t

typedef std::map< const hash_t, TTree* > AthHistogramming::TreeMap_t
privateinherited

Typedef for convenience.

Definition at line 212 of file AthHistogramming.h.

Member Enumeration Documentation

◆ Method_t

Method by which the trigger pass/fail decision is calculated.

Via manual or automated emulator or using the Trigger Decision Tool for a pre-existing item.

Enumerator
kMANUAL 

The pass/fail decision is evaluated by the user and supplied per event using setTriggerDesicison.

kAUTO 

The pass/fail decision is automatically emulated per event based on decoding the trigger name.

kEXISTING 

The pass/fail decision is taken from the Trigger Decision Tool for an existing trigger.

Definition at line 44 of file RatesAnalysisAlg.h.

44  {
45  kMANUAL,
46  kAUTO,
47  kEXISTING
48  };

Constructor & Destructor Documentation

◆ RatesAnalysisAlg()

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

Definition at line 23 of file RatesAnalysisAlg.cxx.

23  :
24  AthAnalysisAlgorithm( name, pSvcLocator ),
25  m_targetMu(0.),
26  m_targetBunches(0.),
27  m_targetLumi(0.),
28  m_runNumber(0.),
30  m_eventCounter(0),
32  m_scalingHist(nullptr),
33  m_bcidHist(nullptr),
34  m_metadataTree(nullptr)
35 {}

◆ ~RatesAnalysisAlg()

RatesAnalysisAlg::~RatesAnalysisAlg ( )
virtual

Definition at line 37 of file RatesAnalysisAlg.cxx.

37 {}

Member Function Documentation

◆ addAllExisting()

StatusCode RatesAnalysisAlg::addAllExisting ( )

Register all existing triggers in the AOD into the rates algorithm.

Definition at line 189 of file RatesAnalysisAlg.cxx.

189  {
191  return addExisting(".*");
192 }

◆ addExisting()

StatusCode RatesAnalysisAlg::addExisting ( const std::string  pattern)

Register some existing triggers based on wild-card match, e.g.

"L1_.*" for all L1.

Parameters
patternWild-card string to match in trigger name

Definition at line 194 of file RatesAnalysisAlg.cxx.

194  {
195  // Check we have the TDT
197 
198  const auto& triggers = m_tdt->getListOfTriggers(pattern);
199  ATH_MSG_INFO("Read " << triggers.size() << " triggers from AOD.");
200 
201  // Check if chain was disabled in athena job
202  const bool runWithPrescaleJSON = !m_prescalesJSON.value().empty();
203  const TrigConf::HLTPrescalesSet& hltPrescalesSet = m_configSvc->hltPrescalesSet(Gaudi::Hive::currentContext());
204  for( auto & p : hltPrescalesSet.data().get_child("prescales") ) {
205  if ((!m_prescalesJSON.value().count(p.first) && !runWithPrescaleJSON) || hltPrescalesSet.prescale(p.first).prescale < 0){
206  m_prescalesJSON[p.first]["prescale"] = (hltPrescalesSet.prescale(p.first).enabled ? hltPrescalesSet.prescale(p.first).prescale : -1);
207  m_prescalesJSON[p.first]["prescale_express"] = (hltPrescalesSet.prescale_express(p.first).enabled ? hltPrescalesSet.prescale_express(p.first).prescale : -1);
208  if (hltPrescalesSet.prescale(p.first).prescale < 0){
209  ATH_MSG_WARNING("Trigger " << p.first << " disabled in supplied AOD file. DISABLING");
210  }
211  }
212  }
213 
214  const TrigConf::L1PrescalesSet& l1PrescalesSet = m_configSvc->l1PrescalesSet(Gaudi::Hive::currentContext());
215  for( auto & p : l1PrescalesSet.prescales() ) {
216  if ((!m_prescalesJSON.value().count(p.first) && !runWithPrescaleJSON) || p.second.prescale < 0){
217  m_prescalesJSON[p.first]["prescale"] = p.second.prescale;
218 
219  if (p.second.prescale < 0){
220  ATH_MSG_WARNING("Trigger " << p.first << " disabled in supplied AOD file. DISABLING");
221  }
222  }
223  }
224 
225  // Iterate over the triggers and add them
226  for (const auto& trigger : triggers) {
227  ATH_MSG_DEBUG("Considering " << trigger );
228  const bool isHLT = (getLevel(trigger) == 2);
229  const auto trigConf = (isHLT ? m_tdt->ExperimentalAndExpertMethods().getChainConfigurationDetails(trigger) : nullptr);
230  if (isHLT && !trigConf) {
231  ATH_MSG_ERROR("Problem with TDT trig conf - cannot get details for " << trigger << ", will be ignored.");
232  continue;
233  }
234  const std::string lowerName = (isHLT ? trigConf->lower_chain_name() : "");
235  std::set<std::string> groups = std::set<std::string>(); // To be filled later from the HLTMenu
236 
237  if (isHLT) {
238  // If this is a HLT item, we require it to be seeded by at most one item. This allows us to use a factorising rates algorithm
239  if (lowerName.find(",") != std::string::npos) {
240  ATH_MSG_WARNING("Can not add " << trigger << " due to multiple L1 seeds." );
241  continue;
242  }
243 
244  if (lowerName.empty()) {
245  ATH_MSG_WARNING("Can not add " << trigger << " due to multiple L1 seeds: L1All" );
246  continue;
247  }
248 
249  // Check it also wasn't disabled in the reprocessing (e.g. auto prescaled out in a perf or tightperf menu)
250  if (trigConf->prescale() < 1.) { // Note this prescale is from ATHENA
251  ATH_MSG_DEBUG("Will not add " << trigger << ", it was disabled in the reprocessing.");
252  continue;
253  }
254 
255  ATH_CHECK(m_configSvc.isValid());
256  const TrigConf::HLTMenu& hltMenu = m_configSvc->hltMenu(Gaudi::Hive::currentContext());
257 
258  TrigConf::HLTMenu::const_iterator chain = std::find_if(hltMenu.begin(), hltMenu.end(), [&] (const TrigConf::Chain& c) {return c.name() == trigger;});
259  if (chain == hltMenu.end()){
260  ATH_MSG_WARNING("Chain " << trigger << " not found in the menu!");
261  continue;
262  }
263 
264  std::vector<std::string> chainGroups = (*chain).groups();
265  std::vector<std::string> chainStreams = (*chain).streams();
266 
267  ATH_MSG_DEBUG(" chain " << trigger << " has " << chainGroups.size() << " groups and " << chainStreams.size() << " streams");
268 
269  groups.insert(chainGroups.begin(), chainGroups.end());
270  for (const std::string& stream : chainStreams){
271  groups.insert("STREAM:" + stream );
272  }
273  }
274 
275  // Get the prescale, express prescale and lower prescale. Note these prescales are from SUPPLIED JSON.
276  double prescale = 1., expressPrescale = -1., lowerPrescale = 1.;
277  if (m_prescalesJSON.size() != 0) {
278  if (m_prescalesJSON.value().count(trigger) == 0) {
279  ATH_MSG_WARNING("Unable to find " << trigger << " in supplied JSON. DISABLING." );
280  prescale = 0.;
281  } else {
282  prescale = m_prescalesJSON[trigger]["prescale"];
283  expressPrescale = m_prescalesJSON[trigger]["prescale_express"];
284  }
285  if (isHLT) {
286  if (m_prescalesJSON.value().count(lowerName) == 0) {
287  ATH_MSG_WARNING("Unable to find " << trigger << "'s seed, " << lowerName << ", in supplied JSON. DISABLING." );
288  lowerPrescale = 0.;
289  } else {
290  lowerPrescale = m_prescalesJSON[lowerName]["prescale"];
291  }
292  }
293  }
294 
295 
296  // We now have all the info needed to add this trigger
297  ATH_MSG_DEBUG("Registering existing trigger " << trigger << " for automatic TDT based rates prediction." );
298  ATH_CHECK( newTrigger(trigger, prescale, expressPrescale, lowerName, lowerPrescale, groups, kEXISTING) );
299  }
300 
301  for (const auto& trigger : m_prescalesJSON) {
302  if (trigger.second.at("prescale") > 0 && std::find(triggers.begin(), triggers.end(), trigger.first) == triggers.end()) {
303  ATH_MSG_WARNING( "Trigger " << trigger.first << " in supplied JSON is NOT AVAILABLE in the supplied AOD file.");
304  }
305  }
306 
307  return StatusCode::SUCCESS;
308 }

◆ beginInputFile()

StatusCode AthAnalysisAlgorithm::beginInputFile ( )
protectedvirtualinherited

Function called when a new input file is opened user can read input metadata from inputMetaStore()

Dummy implementation that can be overridden by the derived tool.

Reimplemented in MuonVal::MuonTPMetaDataAlg.

Definition at line 114 of file AthAnalysisAlgorithm.cxx.

114  {
115 
116  // Return gracefully:
117  return StatusCode::SUCCESS;
118 }

◆ book() [1/8]

StatusCode AthHistogramming::book ( const TEfficiency &  eff,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 335 of file AthHistogramming.h.

336 {
337  // We need to create a non-const clone
338  TEfficiency* effClone = dynamic_cast< TEfficiency* >( eff.Clone() );
339  if ( !effClone ) {
340  m_msg << MSG::ERROR << "Couldn't create a TEfficiency clone" << endmsg;
341  return StatusCode::FAILURE;
342  }
343  return this->book( *effClone, tDir, stream );
344 }

◆ book() [2/8]

StatusCode AthHistogramming::book ( const TGraph &  graphRef,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TGraphs.

◆ book() [3/8]

StatusCode AthHistogramming::book ( const TH1 hist,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 303 of file AthHistogramming.h.

304 {
305  // We need to create a non-const clone
306  TH1* histClone = dynamic_cast< TH1* >( hist.Clone() );
307  if ( !histClone ) {
308  m_msg << MSG::ERROR << "Couldn't create a TH1 clone" << endmsg;
309  return StatusCode::FAILURE;
310  }
311  return this->book( *histClone, tDir, stream );
312 }

◆ book() [4/8]

StatusCode AthHistogramming::book ( const TTree &  treeRef,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TTrees.

Definition at line 403 of file AthHistogramming.h.

404 {
405  // Call the other Book method and see if it returns a valid pointer
406  TTree* treePointer = this->bookGetPointer( treeRef, tDir, stream );
407  if ( treePointer )
408  {
409  return StatusCode::SUCCESS;
410  }
411  else
412  {
413  return StatusCode::FAILURE;
414  }
415 }

◆ book() [5/8]

StatusCode AthHistogramming::book ( TEfficiency &  effRef,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 356 of file AthHistogramming.h.

357 {
358  // Call the other Book method and see if it returns a valid pointer
359  TEfficiency* effPointer = this->bookGetPointer( effRef, tDir, stream );
360  if ( !effPointer ) {
361  m_msg << MSG::ERROR << "Couldn't book a TEfficiency" << endmsg;
362  return StatusCode::FAILURE;
363  }
364  return StatusCode::SUCCESS;
365 }

◆ book() [6/8]

StatusCode AthHistogramming::book ( TEfficiency *  eff,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 346 of file AthHistogramming.h.

347 {
348  if ( !eff ) {
349  m_msg << MSG::ERROR << "Got a zero pointer to a TEfficiency" << endmsg;
350  return StatusCode::FAILURE;
351  }
352  return this->book( *eff, tDir, stream );
353 }

◆ book() [7/8]

StatusCode AthHistogramming::book ( TH1 histRef,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 324 of file AthHistogramming.h.

325 {
326  // Call the other Book method and see if it returns a valid pointer
327  TH1* histPointer = this->bookGetPointer( histRef, tDir, stream );
328  if ( !histPointer ) {
329  m_msg << MSG::ERROR << "Couldn't book a TH1" << endmsg;
330  return StatusCode::FAILURE;
331  }
332  return StatusCode::SUCCESS;
333 }

◆ book() [8/8]

StatusCode AthHistogramming::book ( TH1 hist,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 314 of file AthHistogramming.h.

315 {
316  if ( !hist ) {
317  m_msg << MSG::ERROR << "Got a zero pointer to a TH1" << endmsg;
318  return StatusCode::FAILURE;
319  }
320  return this->book( *hist, tDir, stream );
321 }

◆ bookGetPointer() [1/8]

TEfficiency * AthHistogramming::bookGetPointer ( const TEfficiency &  eff,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 281 of file AthHistogramming.h.

282 {
283  // We need to create a non-const clone
284  TEfficiency* histClone = dynamic_cast< TEfficiency* >( hist.Clone() );
285  if ( !histClone ) {
286  m_msg << MSG::ERROR << "Couldn't create a TEfficiency clone in bookGetPointer" << endmsg;
287  return 0;
288  }
289  return this->bookGetPointer( *histClone, tDir, stream );
290 
291 }

◆ bookGetPointer() [2/8]

TGraph * AthHistogramming::bookGetPointer ( const TGraph &  graphRef,
std::string  tDir = "",
std::string  stream = "" 
)
protectedinherited

Simplify the booking and registering (into THistSvc) of TGraphs.

Definition at line 427 of file AthHistogramming.cxx.

428 {
429  // Get a pointer
430  const TGraph* graphPointer = &graphRef;
431 
432  // Check that we got a valid pointer
433  if ( !graphPointer )
434  {
435  m_msg << MSG::WARNING
436  << "We got an invalid TGraph pointer in the BookGetPointer(TGraph*) method of the class" << m_name
437  << "!" << endmsg;
438  return NULL;
439  }
440 
441  // Modify the name and title according to the prefixes of this classes instance
442  std::string graphName = graphPointer->GetName();
443  const std::string graphTitle = graphPointer->GetTitle();
444 
445  // Check if the hash for this graphName already exists, i.e., if we have a hash collision
446  const hash_t graphHash = this->hash(graphName);
447  GraphMap_t::const_iterator it = m_graphMap.find( graphHash );
448  if ( it != m_graphMap.end() ) // It does exist!
449  {
450  m_msg << MSG::WARNING
451  << "Detected a hash collision. The hash for the TGraph with name=" << graphName
452  << " already exists and points to a TGraph with name=" << it->second->GetName()
453  << " NOT going to book the new histogram and returning a NULL pointer!" << endmsg;
454  return NULL;
455  }
456 
457  // Create a clone that has the new name
458  TGraph* graphClone = dynamic_cast< TGraph* >( graphPointer->Clone((m_histNamePrefix+graphName+m_histNamePostfix).c_str()) );
459  if( !graphClone )
460  {
461  m_msg << MSG::WARNING
462  << "We couldn't clone the TGraph in the BookGetPointer(TGraph&) method of the class" << m_name
463  << "!" << endmsg;
464  return NULL;
465  }
466  graphClone->SetTitle ((m_histTitlePrefix+graphTitle+m_histTitlePostfix).c_str());
467 
468  // Massage the final string to book things
469  std::string bookingString("");
470  this->buildBookingString( bookingString, graphName, tDir, stream );
471 
472  // Register the TGraph into the THistSvc
473  if ( !((histSvc()->regGraph(bookingString, graphClone)).isSuccess()) )
474  {
475  m_msg << MSG::WARNING
476  << "Problem registering TGraph with name " << graphName
477  << ", title " << graphTitle
478  << " in " << m_name << "!" << endmsg;
479  return NULL;
480  }
481 
482  // Also register it in the local map of string to pointer
483  m_graphMap.insert( m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphClone ) );
484 
485  return graphClone;
486 }

◆ bookGetPointer() [3/8]

TH1 * AthHistogramming::bookGetPointer ( const TH1 hist,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 260 of file AthHistogramming.h.

261 {
262  // We need to create a non-const clone
263  TH1* histClone = dynamic_cast< TH1* >( hist.Clone() );
264  if ( !histClone ) {
265  m_msg << MSG::ERROR << "Couldn't create a TH1 clone in bookGetPointer" << endmsg;
266  return 0;
267  }
268  return this->bookGetPointer( *histClone, tDir, stream );
269 
270 }

◆ bookGetPointer() [4/8]

TTree * AthHistogramming::bookGetPointer ( const TTree &  treeRef,
std::string  tDir = "",
std::string  stream = "" 
)
protectedinherited

Simplify the booking and registering (into THistSvc) of TTrees.

Definition at line 312 of file AthHistogramming.cxx.

313 {
314  // Get a pointer
315  const TTree* treePointer = &treeRef;
316 
317  // Check that we got a valid pointer
318  if ( !treePointer )
319  {
320  m_msg << MSG::WARNING
321  << "We got an invalid TTree pointer in the BookGetPointer(TTree*) method of the class" << m_name
322  << "!" << endmsg;
323  return NULL;
324  }
325 
326  // Modify the name and title according to the prefixes of this classes instance
327  std::string treeName = treePointer->GetName();
328  const std::string treeTitle = treePointer->GetTitle();
329 
330  // Check if the hash for this treeName already exists, i.e., if we have a hash collision
331  const hash_t treeHash = this->hash(treeName);
332  TreeMap_t::const_iterator it = m_treeMap.find( treeHash );
333  if ( it != m_treeMap.end() ) // It does exist!
334  {
335  m_msg << MSG::WARNING
336  << "Detected a hash collision. The hash for the TTree with name=" << treeName
337  << " already exists and points to a TTree with name=" << it->second->GetName()
338  << " NOT going to book the new histogram and returning a NULL pointer!" << endmsg;
339  return NULL;
340  }
341 
342  // Create a clone that has the new name
343  TTree* treeClone = dynamic_cast< TTree* >( treePointer->Clone(treeName.c_str()) );
344  if( !treeClone )
345  {
346  m_msg << MSG::WARNING
347  << "We couldn't clone the TTree in the BookGetPointer(TTree&) method of the class" << m_name
348  << "!" << endmsg;
349  return NULL;
350  }
351  treeClone->SetTitle (treeTitle.c_str());
352 
353  // Massage the final string to book things
354  std::string bookingString("");
355  this->buildBookingString( bookingString, treeName, tDir, stream );
356 
357  // Register the TTree into the THistSvc
358  if ( !((histSvc()->regTree(bookingString, treeClone)).isSuccess()) )
359  {
360  m_msg << MSG::WARNING
361  << "Problem registering TTree with name " << treeName
362  << ", title " << treeTitle
363  << " in " << m_name << "!" << endmsg;
364  return NULL;
365  }
366 
367  // Also register it in the local map of string to pointer
368  m_treeMap.insert( m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treeClone ) );
369 
370  return treeClone;
371 }

◆ bookGetPointer() [5/8]

TEfficiency * AthHistogramming::bookGetPointer ( TEfficiency &  effRef,
std::string  tDir = "",
std::string  stream = "" 
)
protectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 146 of file AthHistogramming.cxx.

147 {
148  // Modify the name and title according to the prefixes of this classes instance
149  std::string effName(effRef.GetName());
150  const std::string effTitle(effRef.GetTitle());
151  std::string bookingString("");
152 
153  this->buildBookingString( bookingString, effName, tDir, stream );
154  effRef.SetTitle((m_histTitlePrefix+effTitle+m_histTitlePostfix).c_str() );
155  effRef.SetName(effName.c_str());
156 
157  // Check if the hash for this effName already exists, i.e., if we have a hash collision
158  const hash_t effHash = this->hash(effName);
159  EffMap_t::const_iterator it = m_effMap.find( effHash );
160  if ( it != m_effMap.end() ) // It does exist!
161  {
162  m_msg << MSG::WARNING
163  << "Detected a hash collision. The hash for the TEfficiency with name=" << effName
164  << " already exists and points to a TEfficiency with name=" << it->second->GetName()
165  << " NOT going to book the new TEfficiency and returning a NULL pointer!" << endmsg;
166  return NULL;
167  }
168 
169  // Set the new name and title for the TEfficiency, based on the prefixes that the user set for this class instance
170  // Create a clone that has the new name
171 
172  // Massage the final string to book things
173 
174  // Register the TEfficiency into the THistSvc
175  if ( !((histSvc()->regEfficiency(bookingString, &effRef)).isSuccess()) )
176  {
177  m_msg << MSG::WARNING
178  << "Problem registering TEfficiency with name " << effName
179  << ", name prefix " << m_histNamePrefix
180  << ", title " << effTitle
181  << ", tile prefix " << m_histTitlePrefix
182  << ", and tile postfix " << m_histTitlePostfix
183  << " in " << m_name << "!" << endmsg;
184  return NULL;
185  }
186 
187  // Also register it in the local map of string to pointer
188  m_effMap.insert( m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, &effRef ) );
189 
190  return &effRef;
191 }

◆ bookGetPointer() [6/8]

TEfficiency * AthHistogramming::bookGetPointer ( TEfficiency *  eff,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of TEfficiency.

Definition at line 293 of file AthHistogramming.h.

294 {
295  if ( !hist ) {
296  m_msg << MSG::ERROR << "Got a zero pointer to a TEfficiency in bookGetPointer" << endmsg;
297  return 0;
298  }
299  return this->bookGetPointer( *hist, tDir, stream );
300 }

◆ bookGetPointer() [7/8]

TH1 * AthHistogramming::bookGetPointer ( TH1 histRef,
std::string  tDir = "",
std::string  stream = "" 
)
protectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 98 of file AthHistogramming.cxx.

99 {
100  // Modify the name and title according to the prefixes of this classes instance
101  std::string histName(histRef.GetName());
102  const std::string histTitle(histRef.GetTitle());
103  std::string bookingString("");
104 
105  this->buildBookingString( bookingString, histName, tDir, stream );
106  histRef.SetTitle((m_histTitlePrefix+histTitle+m_histTitlePostfix).c_str() );
107  histRef.SetName(histName.c_str());
108 
109  // Check if the hash for this histName already exists, i.e., if we have a hash collision
110  const hash_t histHash = this->hash(histName);
111  HistMap_t::const_iterator it = m_histMap.find( histHash );
112  if ( it != m_histMap.end() ) // It does exist!
113  {
114  m_msg << MSG::WARNING
115  << "Detected a hash collision. The hash for the histogram with name=" << histName
116  << " already exists and points to a histogram with name=" << it->second->GetName()
117  << " NOT going to book the new histogram and returning a NULL pointer!" << endmsg;
118  return NULL;
119  }
120 
121  // Set the new name and title for the histogram, based on the prefixes that the user set for this class instance
122  // Create a clone that has the new name
123 
124  // Massage the final string to book things
125 
126  // Register the histogram into the THistSvc
127  if ( !((histSvc()->regHist(bookingString, &histRef)).isSuccess()) )
128  {
129  m_msg << MSG::WARNING
130  << "Problem registering histogram with name " << histName
131  << ", name prefix " << m_histNamePrefix
132  << ", title " << histTitle
133  << ", tile prefix " << m_histTitlePrefix
134  << ", and tile postfix " << m_histTitlePostfix
135  << " in " << m_name << "!" << endmsg;
136  return NULL;
137  }
138 
139  // Also register it in the local map of string to pointer
140  m_histMap.insert( m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, &histRef ) );
141 
142  return &histRef;
143 }

◆ bookGetPointer() [8/8]

TH1 * AthHistogramming::bookGetPointer ( TH1 hist,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the booking and registering (into THistSvc) of histograms.

Definition at line 272 of file AthHistogramming.h.

273 {
274  if ( !hist ) {
275  m_msg << MSG::ERROR << "Got a zero pointer to a TH1 in bookGetPointer" << endmsg;
276  return 0;
277  }
278  return this->bookGetPointer( *hist, tDir, stream );
279 }

◆ buildBookingString()

void AthHistogramming::buildBookingString ( std::string &  bookingString,
std::string &  histName,
std::string &  tDir,
std::string &  stream,
bool  usePrefixPostfix = false 
)
privateinherited

Method to build individual booking string.

Definition at line 560 of file AthHistogramming.cxx.

565 {
566  // Massage the final string to book things
567  if(tDir.empty()) tDir = m_rootDir;
568  size_t pos = histName.rfind('/');
569  if(pos != std::string::npos){
570  tDir+='/';
571  tDir.append(histName, 0,pos);
572  histName.erase(0,pos+1);
573  };
574  if(stream.empty()) stream = m_streamName;
575 
576  if(usePrefixPostfix){
577  bookingString = "/"+stream+"/"+tDir+"/"+m_histNamePrefix+histName+m_histNamePostfix;
578  } else {
579  bookingString = "/"+stream+"/"+tDir+"/"+histName;
580  }
581  while(bookingString.find("//") != std::string::npos){
582  this->myReplace(bookingString,"//","/");
583  }
584 
585  return;
586 }

◆ checkExistingTrigger()

StatusCode RatesAnalysisAlg::checkExistingTrigger ( const std::string &  name,
const std::string &  seedName 
)
private

Internal function to check if a supplied HLT trigger and L1 seed match what is stored in the AOD config.

Parameters
nameName of the L1 or HLT trigger.
seedNameFor HLT triggers, name of the L1 seed item.
Returns
StatusCode::FAILURE if the trigger does not match the AOD.

Definition at line 325 of file RatesAnalysisAlg.cxx.

325  {
327  const auto& triggers = m_tdt->getListOfTriggers(name);
328  if (triggers.size() != 1) {
329  ATH_MSG_FATAL("Unable to find existing trigger " << name << " in this AOD.");
330  return StatusCode::FAILURE;
331  }
332  if (getLevel(name) == 1) return StatusCode::SUCCESS;
333  // L1 items will crash if we call this on them.
334  const auto trigConf = m_tdt->ExperimentalAndExpertMethods().getChainConfigurationDetails(triggers.at(0));
335  if (trigConf->lower_chain_name() != seedName) {
336  ATH_MSG_FATAL("Tried to register an existing trigger '" << name << "' seeding from '" << seedName << "' but in this AOD it seeds from '" << trigConf->lower_chain_name() << "'");
337  return StatusCode::FAILURE;
338  }
339  return StatusCode::SUCCESS;
340 }

◆ checkGotTDT()

StatusCode RatesAnalysisAlg::checkGotTDT ( )
private

Internal check that the TDT is fetched.

Definition at line 310 of file RatesAnalysisAlg.cxx.

310  {
311  if (m_tdt.empty()){
312  ATH_MSG_ERROR("TriggerDecisionTool is not available!");
313  return StatusCode::FAILURE;
314  }
315  [[maybe_unused]] static std::atomic<bool> printed = [&]() {
316  ATH_MSG_INFO("TDT contains: " << m_tdt->getListOfTriggers().size() << " triggers, "
317  << m_tdt->getListOfStreams().size() << " streams and "
318  << m_tdt->getListOfGroups().size() << " groups.");
319  return true;
320  }();
321  return StatusCode::SUCCESS;
322 }

◆ configAthHistogramming()

StatusCode AthHistogramming::configAthHistogramming ( const ServiceHandle< ITHistSvc > &  histSvc,
const std::string &  prefix,
const std::string &  rootDir,
const std::string &  histNamePrefix,
const std::string &  histNamePostfix,
const std::string &  histTitlePrefix,
const std::string &  histTitlePostfix 
)
protectedinherited

To be called by the derived classes to fill the internal configuration.

Definition at line 66 of file AthHistogramming.cxx.

70 {
73  m_rootDir = rootDir;
74  m_histNamePrefix = histNamePrefix;
75  m_histNamePostfix = histNamePostfix;
76  m_histTitlePrefix = histTitlePrefix;
77  m_histTitlePostfix = histTitlePostfix;
78 
79  return StatusCode::SUCCESS;
80 }

◆ currentFile()

TFile * AthAnalysisAlgorithm::currentFile ( const char *  evtSelName = "EventSelector")
finalprotectedvirtualinherited

Function returning the TFile pointer of the currently open file of the given EventSelector (in athena jobs this defaults to "EventSelector")

Definition at line 147 of file AthAnalysisAlgorithm.cxx.

147  {
148  if(m_currentFile) return m_currentFile;
149 
150  //get the EventSelector so we can get it's list of input files
151  //dont get it with a ServiceHandle, because that invokes initialize, can get into init loop
152 
153  IProperty* evtSelector = 0;
154  if(service(evtSelName,evtSelector,false).isFailure()) {
155  ATH_MSG_ERROR("currentFile(): Couldn't find the service: " << evtSelName);return 0;
156  }
157  //SmartIF<IProperty> evtSelector(mysel);
158  /*
159  ServiceHandle<IProperty> evtSelector(evtSelName,name());
160 
161  if(evtSelector.retrieve().isFailure()) {
162  ATH_MSG_ERROR("currentFile(): Couldn't find the service: " << evtSelName);return 0;
163  }*/
164 
165  try {
166  //get the list of input files - use this to determine which open file is the current input file
167  const StringArrayProperty& inputCollectionsName = dynamic_cast<const StringArrayProperty&>(evtSelector->getProperty("InputCollections"));
168 
169  ATH_MSG_VERBOSE("nOpenFile=" << gROOT->GetListOfFiles()->GetSize() << ". nFilesInInputCollection=" << inputCollectionsName.value().size());
170  if(msgLvl(MSG::VERBOSE)) {
171  for(int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
172  ATH_MSG_VERBOSE("Open file: " << gROOT->GetListOfFiles()->At(i)->GetName());
173  }
174  }
175 
176  //look through list of files and find the one from the input collection that is currently open
177 
178  for(int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
179  TFile *g = (TFile*)gROOT->GetListOfFiles()->At(i);
180  //see if this file is in the input file list
181  //strip everything except stuff either side of last /
182  TString s(g->GetName());
183  TObjArray* tokens = s.Tokenize("/");
184  TObjString* lastToken = dynamic_cast<TObjString*>(tokens->Last());
185  TString sToCompare("");
186  bool shortComparison(false);
187  if(tokens->GetEntries()>1) {
188  TString beforeSlash((dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-2)))->GetString());
189  if(beforeSlash.Length()>0) sToCompare += beforeSlash;
190  sToCompare += "/";
191  } else {
192  shortComparison=true;
193  }
194  sToCompare += lastToken->GetString();
195  TString sToCompare_short(lastToken->GetString()); //short versions search
196  delete tokens;
197 
198  for(unsigned int j=0;j<inputCollectionsName.value().size();j++) {
199  TString t(inputCollectionsName.value()[j].c_str());
200  //try perfect match first
201  if(s.EqualTo(t)) {
202  ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
203  m_currentFile = g;
204  return g;
205  }
206  TObjArray* tokens = t.Tokenize("/");
207  TObjString* lastToken = dynamic_cast<TObjString*>(tokens->Last());
208  TString tToCompare = "";
209  bool shortComparison2(false);
210  if(tokens->GetEntries()>1) {
211  TString beforeSlash((dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-2)))->GetString());
212  if(beforeSlash.Length()>0) tToCompare += beforeSlash;
213  tToCompare += "/";
214  } else {
215  shortComparison2=true;
216  }
217  tToCompare += lastToken->GetString();
218  TString tToCompare_short(lastToken->GetString());
219  delete tokens;
220 
221  if(shortComparison || shortComparison2) { //doing short version search, no directories to distinguish files!
222  if(sToCompare_short.EqualTo(tToCompare_short)) {
223  ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
224  m_currentFile = g;
225  return g;
226  }
227  } else
228  if(sToCompare.EqualTo(tToCompare)) {
229  ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
231  return g;
232  }
233  }
234  }
235 
236  } catch(...) {
237  ATH_MSG_ERROR("currentFile(): Couldn't load InputCollections property of " << evtSelName); return 0;
238  }
239 
240  ATH_MSG_ERROR("currentFile(): Could not find the current file!");
241  return 0; //something went wrong :-(
242 
243 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ efficiency()

TEfficiency * AthHistogramming::efficiency ( const std::string &  effName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
protectedinherited

Simplify the retrieval of registered TEfficiency.

Definition at line 250 of file AthHistogramming.cxx.

251 {
252  // Build a 32 bit hash out of the name
253  const hash_t effHash = this->hash(effName);
254 
255  // See if this entry exists in the map
256  EffMap_t::const_iterator it = m_effMap.find( effHash );
257  if ( it == m_effMap.end() ) // It doesn't exist!
258  { // Let's see into the THistSvc if somebody else has registered the TEfficiency...
259 
260  // Need to copy the strings as we will massage them from here on
261  std::string effNameCopy = effName;
262  std::string tDirCopy = tDir;
263  std::string streamCopy = stream;
264 
265  // Massage the final string to book things
266  std::string bookingString("");
267  this->buildBookingString( bookingString, effNameCopy, tDirCopy, streamCopy ,false);
268 
269  TEfficiency* effPointer(NULL);
270  if ( !((histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
271  {
272  // Massage the final string to book things
273  std::string bookingString("");
274  this->buildBookingString( bookingString, effNameCopy, tDirCopy, streamCopy, true );
275 
276  if ( !((histSvc()->getEfficiency(bookingString, effPointer)).isSuccess()) )
277  {
278  m_msg << MSG::WARNING
279  << "Problem retrieving the TEfficiency with name (including pre- and post-fixes) "
280  << m_histNamePrefix + effNameCopy + m_histNamePostfix
281  << " or with name " << effNameCopy
282  << " in " << m_name << "... it doesn't exist, neither in the cached map nor in the THistSvc!"
283  << " Will return an NULL pointer... you have to handle it correctly!" << endmsg;
284  return NULL;
285  }
286  // If we get to here, we actually found the TEfficiency in the THistSvc.
287  // So let's add it to the local cache map and return its pointer
288  m_effMap.insert( m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
289  return effPointer;
290  }
291  // If we get to here, we actually found the TEfficiency in the THistSvc.
292  // So let's add it to the local cache map and return its pointer
293  m_effMap.insert( m_effMap.end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
294  return effPointer;
295  }
296 
297  // Return the pointer to the TEfficiency that we got from the local cache map
298  return it->second;
299 }

◆ endInputFile()

StatusCode AthAnalysisAlgorithm::endInputFile ( )
protectedvirtualinherited

Function called as an input file is being closed.

Dummy implementation that can be overridden by the derived tool.

Definition at line 122 of file AthAnalysisAlgorithm.cxx.

122  {
123 
124  // Return gracefully:
125  return StatusCode::SUCCESS;
126 }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode RatesAnalysisAlg::execute ( )
privatevirtual

In first call - register all triggers.

Then load event weighting parameters, fill trigger decisions, compute group rates.

Definition at line 587 of file RatesAnalysisAlg.cxx.

587  {
588  ATH_MSG_DEBUG("Executing " << name() << " on event " << m_eventCounter << "...");
589  if (m_eventCounter++ == 0) { // First time in execute loop - cannot access TDT before this.
591  }
592 
593  // Get event characteristics
594  const xAOD::EventInfo* eventInfo(nullptr);
595  uint32_t distance = 0;
596  ATH_CHECK( evtStore()->retrieve(eventInfo, "EventInfo") );
597  ATH_CHECK( m_enhancedBiasRatesTool->getDistanceIntoTrain(eventInfo, distance) );
598 
599  // Get the weighting & scaling characteristics
601  m_weightingValues.m_eventMu = std::ceil(eventInfo->actualInteractionsPerCrossing()); // This always seems to be a half integer
602  m_weightingValues.m_eventLumi = m_enhancedBiasRatesTool->getLBLumi(eventInfo);
603  m_weightingValues.m_isUnbiased = m_enhancedBiasRatesTool->isUnbiasedEvent(eventInfo);
605  m_weightingValues.m_eventLiveTime = m_enhancedBiasRatesTool->getEBLiveTime(eventInfo);
606 
608 
609  // Bunch factor doesn't change as a fn. of the run. Reminder: m_bunchFactor = m_targetBunches / (double)ebPairedBunches;
613 
614  // Ignore zero weighted events. Typically these come from bad LB
615  if (RatesHistoBase::isZero(m_weightingValues.m_enhancedBiasWeight)) return StatusCode::SUCCESS;
616 
617  // Do automated triggers
619 
620  // Do TDT-controlled triggers
622 
623  // Run user's code. Do manual triggers
624  ATH_CHECK( ratesExecute() );
625 
626  // Execute groups
627  for (const auto& group : m_globalGroups) group.second->execute(m_weightingValues); // Physics, L1, express: Must execute before m_uniqueGroups (which are in active groups). Map.
628  for (const auto& group : m_activeGroups) group->execute(m_weightingValues); // Individual groups, CPS groups and active unique groups. Set.
629 
630  // Reset triggers
631  for (const auto& trigger : m_activatedTriggers) trigger->reset();
632  m_activatedTriggers.clear();
633 
634  // Keep track of elapsed walltime
637 
638  if (m_doHistograms) {
639  m_bcidHist->Fill(eventInfo->bcid(), m_weightingValues.m_enhancedBiasWeight);
640  m_scalingHist->Fill(0.5, m_weightingValues.m_eventLiveTime); // Walltime
641  m_scalingHist->Fill(1.5, 1.); // Total events
642  m_scalingHist->Fill(2.5, m_weightingValues.m_enhancedBiasWeight); // Total events weighted
643  }
644 
645  // Some debug info
646  if (m_eventCounter % 1000 == 0) {
647  ATH_MSG_INFO( "Event " << m_eventCounter << " " << m_weightingValues.print() << " currentWallTime:" << m_ratesDenominator );
648  }
649 
650  setFilterPassed(true); //if got here, assume that means algorithm passed
651  return StatusCode::SUCCESS;
652 }

◆ executeTrigDecisionToolTriggers()

StatusCode RatesAnalysisAlg::executeTrigDecisionToolTriggers ( )
private

Internal call to get the pass/fail for all TDT triggers.

Definition at line 654 of file RatesAnalysisAlg.cxx.

654  {
655  for (const auto& trigger : m_existingTriggers) {
656  const bool passed = trigger.second->isPassed();
657  // L1 chains are always active, HLT chains are active if their L1 passed.
658  const std::string& lower = m_lowerTrigger[trigger.first];
659  // Expect this find operation to fail for L1 chains (lower = "")
660  const std::unordered_map<std::string, const Trig::ChainGroup*>::const_iterator it = m_existingTriggers.find(lower);
661  const bool active = (it == m_existingTriggers.end() ? true : it->second->isPassed());
663  }
664  return StatusCode::SUCCESS;
665 }

◆ executeTriggerEmulation()

StatusCode RatesAnalysisAlg::executeTriggerEmulation ( )
private

Internal call to get the pass/fail for all automatically emulated triggers.

Definition at line 667 of file RatesAnalysisAlg.cxx.

667  {
668  // TODO emulation code here
669  for (const auto& trigger : m_autoTriggers) {
670  ATH_MSG_WARNING("Cannot do rates for " << trigger << ". Automatic trigger emulation is not yet included, sorry :(");
671  }
672  return StatusCode::SUCCESS;
673 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode RatesAnalysisAlg::finalize ( )
privatevirtual

Print rates.

Definition at line 675 of file RatesAnalysisAlg.cxx.

675  {
676  ATH_MSG_INFO ("Finalizing " << name() << "...");
677 
679  if (m_scanTriggers.size()) {
680  ATH_MSG_INFO("################## Computed Rate Scans for Threshold-Scan Items:");
681  for (const auto& trigger : m_scanTriggers) ATH_MSG_INFO(trigger.second->printRate(m_ratesDenominator));
682  }
683  if (m_triggers.size()) {
684  ATH_MSG_INFO("################## Computed Rate Estimations for Single Items:");
685  std::set<std::string> keys; // Used an unordered map for speed, but now we'd like the items in order
686  for (const auto& trigger : m_triggers) keys.insert(trigger.first);
687  for (const std::string& key : keys) ATH_MSG_INFO(m_triggers.at(key)->printRate(m_ratesDenominator));
688  }
689  if (m_expressTriggers.size()) {
690  ATH_MSG_INFO("################## Computed Express Rate Estimations for Single Items:");
691  for (const auto& trigger : m_expressTriggers) ATH_MSG_INFO(trigger->printExpressRate(m_ratesDenominator));
692  }
693  if (m_groups.size()) {
694  ATH_MSG_INFO("################## Computed Rate Estimations for Groups:");
695  for (const auto& group : m_groups) ATH_MSG_INFO(group.second->printRate(m_ratesDenominator));
696  }
697  if (m_globalGroups.size()) {
698  ATH_MSG_INFO("################## Computed Rate Estimations for Global Groups:");
699  for (const auto& group : m_globalGroups) ATH_MSG_INFO(group.second->printRate(m_ratesDenominator));
700  }
701  ATH_MSG_INFO("################## LHC Conditions and weighting information:");
703  printTarget();
704  printStatistics();
705  ATH_MSG_INFO("##################");
706 
707  writeMetadata();
708 
709  return StatusCode::SUCCESS;
710 }

◆ firstExecute()

StatusCode AthAnalysisAlgorithm::firstExecute ( )
protectedvirtualinherited

Function called when first execute is encountered user can read event information with evtStore()

Dummy implementation that can be overridden by the derived tool.

Reimplemented in CP::JetTileCorrectionAlg.

Definition at line 139 of file AthAnalysisAlgorithm.cxx.

139  {
140 
141  // Return gracefully:
142  return StatusCode::SUCCESS;
143 }

◆ getLevel()

uint32_t RatesAnalysisAlg::getLevel ( const std::string &  name) const
private

String match to a trigger level.

If unknown, we assume HLT.

Returns
trigger level (1 or 2)

Definition at line 803 of file RatesAnalysisAlg.cxx.

803  {
804  if (name.find("HLT_") != std::string::npos) return 2;
805  if (name.find("L1_") != std::string::npos) return 1;
806  return 2;
807 }

◆ graph()

TGraph * AthHistogramming::graph ( const std::string &  graphName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
protectedinherited

Simplify the retrieval of registered TGraphs.

Definition at line 492 of file AthHistogramming.cxx.

493 {
494  // Build a 32 bit hash out of the name
495  const hash_t graphHash = this->hash(graphName);
496 
497  // See if this entry exists in the map
498  GraphMap_t::const_iterator it = m_graphMap.find( graphHash );
499  if ( it == m_graphMap.end() ) // It doesn't exist!
500  { // Let's see into the THistSvc if somebody else has registered the TGraph...
501 
502  // Need to copy the strings as we will massage them from here on
503  std::string graphNameCopy = graphName;
504  std::string tDirCopy = tDir;
505  std::string streamCopy = stream;
506 
507  // Massage the final string to book things
508  std::string bookingString("");
509  this->buildBookingString( bookingString, graphNameCopy, tDirCopy, streamCopy, true);
510 
511  TGraph* graphPointer(NULL);
512  if ( !((histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
513  {
514  // Massage the final string to book things
515  std::string bookingString("");
516  this->buildBookingString( bookingString, graphNameCopy, tDirCopy, streamCopy, false );
517 
518  if ( !((histSvc()->getGraph(bookingString, graphPointer)).isSuccess()) )
519  {
520  m_msg << MSG::WARNING
521  << "Problem retrieving the TGraph with name (including pre- and post-fixes) "
522  << m_histNamePrefix + graphNameCopy + m_histNamePostfix
523  << " or with name " << graphNameCopy
524  << " in " << m_name << "... it doesn't exist, neither in the cached map nor in the THistSvc!"
525  << " Will return an NULL pointer... you have to handle it correctly!" << endmsg;
526  return NULL;
527  }
528  // If we get to here, we actually found the TGraph in the THistSvc.
529  // So let's add it to the local cache map and return its pointer
530  m_graphMap.insert( m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
531  return graphPointer;
532  }
533  // If we get to here, we actually found the TGraph in the THistSvc.
534  // So let's add it to the local cache map and return its pointer
535  m_graphMap.insert( m_graphMap.end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
536  return graphPointer;
537  }
538 
539 
540  // Return the pointer to the TGraph that we got from the local cache map
541  return it->second;
542 }

◆ handle()

void AthAnalysisAlgorithm::handle ( const Incident &  inc)
overrideprotectedvirtualinherited

Function receiving incidents from IncidentSvc/TEvent Experts can override but they should ensure they add AthAnalysisAlgorithm::handle(); to the end of their own implementation.

Definition at line 83 of file AthAnalysisAlgorithm.cxx.

83  {
84 
85  // Tell the user what's happening:
86  ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
87 
88  // Call the appropriate member function:
89  if( inc.type() == IncidentType::BeginInputFile ) {
90  m_currentFile=0;
91  if( beginInputFile().isFailure() ) {
92  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
93  throw std::runtime_error( "Couldn't call beginInputFile()" );
94  }
95  } else if(inc.type() == IncidentType::EndInputFile ) {
96  if( endInputFile().isFailure() ) {
97  ATH_MSG_FATAL( "Failed to call endInputFile()" );
98  throw std::runtime_error( "Couldn't call endInputFile()" );
99  }
100  } else if(inc.type() == "MetaDataStop" ) {
101  if( metaDataStop().isFailure() ) {
102  ATH_MSG_FATAL( "Failed to call metaDataStop()" );
103  throw std::runtime_error( "Couldn't call metaDataStop()" );
104  }
105  } else {
106  ATH_MSG_WARNING( "Unknown incident type received: " << inc.type() );
107  }
108 
109  return;
110 }

◆ hash()

AthHistogramming::hash_t AthHistogramming::hash ( const std::string &  histName) const
inlineprivateinherited

Method to calculate a 32-bit hash from a string.

Definition at line 428 of file AthHistogramming.h.

429 {
431  return (hash_t)(hash64 & 0xFFFFFFFF);
432 }

◆ hist()

TH1 * AthHistogramming::hist ( const std::string &  histName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
protectedinherited

Simplify the retrieval of registered histograms of any type.

Definition at line 198 of file AthHistogramming.cxx.

199 {
200  // Build a 32 bit hash out of the name
201  const hash_t histHash = this->hash(histName);
202 
203  // See if this entry exists in the map
204  HistMap_t::const_iterator it = m_histMap.find( histHash );
205  if ( it == m_histMap.end() ) // It doesn't exist!
206  { // Let's see into the THistSvc if somebody else has registered the histogram...
207 
208  // Need to copy the strings as we will massage them from here on
209  std::string histNameCopy = histName;
210  std::string tDirCopy = tDir;
211  std::string streamCopy = stream;
212 
213  // Massage the final string to book things
214  std::string bookingString("");
215  this->buildBookingString( bookingString, histNameCopy, tDirCopy, streamCopy ,false);
216 
217  TH1* histPointer(NULL);
218  if ( !((histSvc()->getHist(bookingString, histPointer)).isSuccess()) )
219  {
220  // Massage the final string to book things
221  std::string bookingString("");
222  this->buildBookingString( bookingString, histNameCopy, tDirCopy, streamCopy, true );
223 
224  if ( !((histSvc()->getHist(bookingString, histPointer)).isSuccess()) )
225  {
226  m_msg << MSG::WARNING
227  << "Problem retrieving the histogram with name (including pre- and post-fixes) "
228  << m_histNamePrefix + histNameCopy + m_histNamePostfix
229  << " or with name " << histNameCopy
230  << " in " << m_name << "... it doesn't exist, neither in the cached map nor in the THistSvc!"
231  << " Will return an NULL pointer... you have to handle it correctly!" << endmsg;
232  return NULL;
233  }
234  // If we get to here, we actually found the histogram in the THistSvc.
235  // So let's add it to the local cache map and return its pointer
236  m_histMap.insert( m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
237  return histPointer;
238  }
239  // If we get to here, we actually found the histogram in the THistSvc.
240  // So let's add it to the local cache map and return its pointer
241  m_histMap.insert( m_histMap.end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
242  return histPointer;
243  }
244 
245 
246  // Return the pointer to the histogram that we got from the local cache map
247  return it->second;
248 }

◆ hist2d()

TH2 * AthHistogramming::hist2d ( const std::string &  histName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the retrieval of registered 2-d histograms.

Definition at line 369 of file AthHistogramming.h.

370 {
371  // Get the TH1 pointer
372  TH1* th1Pointer = this->hist(histName, tDir, stream);
373  if ( !th1Pointer )
374  {
375  m_msg << MSG::ERROR
376  << "Cannot get a 2-d histogram with name " << histName
377  << "... will probably seg-fault!" << endmsg;
378  return NULL;
379  }
380  // If the TH1 pointer is valid, simply return the dynamic_cast
381  return dynamic_cast<TH2*>( th1Pointer );
382 }

◆ hist3d()

TH3 * AthHistogramming::hist3d ( const std::string &  histName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
inlineprotectedinherited

Simplify the retrieval of registered 3-d histograms.

Definition at line 386 of file AthHistogramming.h.

387 {
388  // Get the TH1 pointer
389  TH1* th1Pointer = this->hist(histName, tDir, stream);
390  if ( !th1Pointer )
391  {
392  m_msg << MSG::ERROR
393  << "Cannot get a 3-d histogram with name " << histName
394  << "... will probably seg-fault!" << endmsg;
395  return NULL;
396  }
397  // If the TH1 pointer is valid, simply return the dynamic_cast
398  return dynamic_cast<TH3*>( th1Pointer );
399 }

◆ histSvc()

const ServiceHandle< ITHistSvc > & AthHistogramAlgorithm::histSvc ( ) const
inlineinherited

The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a pointer to the THistSvc.

Definition at line 113 of file AthHistogramAlgorithm.h.

114 {
115  return m_histSvc;
116 }

◆ initialize()

StatusCode RatesAnalysisAlg::initialize ( )
privatevirtual

Get the trigger decision tool and set up global groups.

Definition at line 369 of file RatesAnalysisAlg.cxx.

369  {
370  ATH_MSG_INFO ("Initializing " << name() << "...");
371 
372  if (!m_tdt.empty()){
373  ATH_CHECK( m_tdt.retrieve() );
374  }
375 
376  if(!m_configSvc.empty()) {
377  ATH_CHECK( m_configSvc.retrieve() );
378  }
379 
380  ATH_CHECK( m_enhancedBiasRatesTool.retrieve() );
381 
383  ATH_MSG_ERROR("DoUniqueRates=True requires DoGlobalGroups=True");
384  return StatusCode::FAILURE;
385  }
386 
387  return StatusCode::SUCCESS;
388 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ inputMetaStore() [1/2]

ServiceHandle< StoreGateSvc >& AthAnalysisAlgorithm::inputMetaStore ( )
inlineinherited

Accessor for the input metadata store.

Definition at line 51 of file AthAnalysisAlgorithm.h.

51 { return m_inputMetaStore; }

◆ inputMetaStore() [2/2]

const ServiceHandle< StoreGateSvc >& AthAnalysisAlgorithm::inputMetaStore ( ) const
inlineinherited

Const accessor for the input metadata store.

Definition at line 49 of file AthAnalysisAlgorithm.h.

49 { return m_inputMetaStore; }

◆ isCPS()

bool RatesAnalysisAlg::isCPS ( const std::string &  group) const
private

String match coherent prescale groups.

Parameters
groupName of a trigger group
Returns
If name-parsing thinks that the group is a coherent prescale group

Definition at line 792 of file RatesAnalysisAlg.cxx.

792  {
793  return (group.find("CPS") != std::string::npos);
794 }

◆ isRandomSeed()

bool RatesAnalysisAlg::isRandomSeed ( const std::string &  me,
const std::string &  seed 
) const
private

String match random L1 items.

Parameters
meName of the trigger
seedName of the trigger's seed
Returns
if name-parsing thinks that the trigger seeds from a random L1 trgigger

Definition at line 796 of file RatesAnalysisAlg.cxx.

796  {
797  if (me.find("L1_RD") != std::string::npos) return true;
798  if (me.find("L1RD") != std::string::npos) return true;
799  if (seed.find("L1_RD") != std::string::npos) return true;
800  return false;
801 }

◆ isZero()

bool RatesAnalysisAlg::isZero ( double  v) const
inlineprivate

Helper function for floating point subtraction.

Definition at line 239 of file RatesAnalysisAlg.h.

◆ metaDataStop()

StatusCode AthAnalysisAlgorithm::metaDataStop ( )
protectedvirtualinherited

Function called before finalize user can read output metadata from outputMetaStore()

Dummy implementation that can be overridden by the derived tool.

Definition at line 130 of file AthAnalysisAlgorithm.cxx.

130  {
131 
132  // Return gracefully:
133  return StatusCode::SUCCESS;
134 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ myReplace()

void AthHistogramming::myReplace ( std::string &  str,
const std::string &  oldStr,
const std::string &  newStr 
)
privateinherited

Helper method to replace sub-string.

Definition at line 590 of file AthHistogramming.cxx.

593 {
594  size_t pos = 0;
595  while((pos = str.find(oldStr, pos)) != std::string::npos)
596  {
597  str.replace(pos, oldStr.length(), newStr);
598  pos += newStr.length();
599  }
600 }

◆ newScanTrigger() [1/2]

StatusCode RatesAnalysisAlg::newScanTrigger ( const std::string &  name,
const double  thresholdMin,
const double  thresholdMax,
const uint32_t  thresholdBins = 100,
const RatesScanTrigger::TriggerBehaviour_t  behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold,
const double  prescale = 1.,
const std::string &  seedName = "",
const double  seedPrecale = 1.,
const Method_t  method = kMANUAL,
const ExtrapStrat_t  extrapolation = kLINEAR 
)

Register a new threshold scan trigger which plots rate as a function of some dependent variable.

Parameters
nameThe name of the emulated scan trigger. Recommend either a "L1_" or "HLT_" prefix.
thresholdMinThe lower threshold of this trigger, rates will not be available below this threshold
thresholdMaxThe upper threshold of this trigger, rates will not be available above this threshold
thresholdBinsGranularity
behaviourIf the trigger should activate above (kTriggerAboveThreshold) or below (kTriggerBelowThreshold) the threshold
prescaleThe prescale value to simulate applying. Default 1
seedNameThe name of any lower seeding e.g. L1 item. This info is required to get group rates correct
seedPrescaleThe prescale of any L1 seed item. Default 1.
methodDetermines who is responsible for evaluating the emulated trigger decision, you (kMANUAL) or the algorithm (kAUTO or kEXISTING).
extrapolationDetermines the triggers luminosity extrapolation behaviour.

Definition at line 39 of file RatesAnalysisAlg.cxx.

48  {
49 
50  if (method != kMANUAL) {
51  ATH_MSG_ERROR("Sorry - ScanTriggers have to be implemented with the kMANUAL method for now.");
52  return StatusCode::FAILURE;
53  }
54 
56  m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdMin, thresholdMax, thresholdBins, behaviour, prescale, seedName, seedPrecale, e));
58  if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true);
59  ATH_MSG_DEBUG("newScanTrigger " << name << " added");
60  return StatusCode::SUCCESS;
61 }

◆ newScanTrigger() [2/2]

StatusCode RatesAnalysisAlg::newScanTrigger ( const std::string &  name,
const std::vector< double > &  thresholdBinEdges,
const RatesScanTrigger::TriggerBehaviour_t  behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerAboveThreshold,
const double  prescale = 1.,
const std::string &  seedName = "",
const double  seedPrecale = 1.,
const Method_t  method = kMANUAL,
const ExtrapStrat_t  extrapolation = kLINEAR 
)

Version of newScanTrigger which takes a vector of bin edges.

Parameters
thresholdBinEdgedVector of bin edges to use for quantifying rate as a function of threshold

Definition at line 64 of file RatesAnalysisAlg.cxx.

71  {
72 
73  if (method != kMANUAL) {
74  ATH_MSG_ERROR("Sorry - ScanTriggers have to be implemented with the kMANUAL method for now.");
75  return StatusCode::FAILURE;
76  }
77 
79 
80  m_scanTriggers.emplace(name, std::make_unique<RatesScanTrigger>(name, msgSvc(), thresholdBinEdges, behaviour, prescale, seedName, seedPrecale, e));
82  if (isRandomSeed(name, seedName)) newScanTrigger->setSeedsFromRandom(true);
83  ATH_MSG_DEBUG("newScanTrigger " << name << " added");
84  return StatusCode::SUCCESS;
85 }

◆ newTrigger() [1/2]

StatusCode RatesAnalysisAlg::newTrigger ( const std::string &  name,
const double  prescale = 1.,
const double  expressPrescale = -1.,
const std::string &  seedName = "",
const double  seedPrecale = 1.,
const std::set< std::string > &  groups = std::set<std::string>(),
const Method_t  method = kMANUAL,
const ExtrapStrat_t  extrapolation = kLINEAR 
)

Register a new trigger for emulation.

Parameters
nameThe name of the emulated trigger. Recommend either a "L1_" or "HLT_" prefix.
prescaleThe prescale value to simulate applying. Default 1
expressPrescaleThe prescale value to simulate applying to the express stream. Default -1
seedNameThe name of any lower seeding e.g. L1 item. This info is required to get group rates correct when multiple chains seed of the same prescaled L1 item.
seedPrescaleThe prescale of any L1 seed item. Default 1.
Commaseparated list of groups to include this trigger in. Any group containing "CPS" will be simulated as a coherent prescale group and implies that all members of that group share a common L1 seed.
methodDetermines who is responsible for evaluating the emulated trigger decision, you (kMANUAL) or the algorithm (kAUTO or kEXISTING).
extrapolationDetermines the triggers luminosity extrapolation behaviour.

Definition at line 108 of file RatesAnalysisAlg.cxx.

115  {
116 
117  if (m_eventCounter > 1) { // All triggers must be defined before we start looping over the sample
118  ATH_MSG_FATAL("Too late to call newTrigger. All emulated triggers must be registered during ratesInitialize().");
119  return StatusCode::FAILURE;
120  }
121 
122  if (method == kEXISTING) ATH_CHECK( checkExistingTrigger(name, seedName) ); // Check this agrees with what is in the AOD
123 
124  // Check if it already exists
125  if (m_triggers.count(name) == 1) {
126  ATH_MSG_WARNING("Trigger " << name << " is already registered.");
127  return StatusCode::SUCCESS;
128  }
129 
130  const ExtrapStrat_t e = (m_enableLumiExtrapolation ? extrapolation : ExtrapStrat_t::kNONE);
131 
132  m_triggers.emplace(name, std::make_unique<RatesTrigger>(name, msgSvc(), prescale, expressPrescale, seedName, seedPrecale, m_doHistograms, e));
133  RatesTrigger* newTriggerPtr = m_triggers.at(name).get();
134 
135  if (isRandomSeed(name, seedName)) newTriggerPtr->setSeedsFromRandom(true);
136 
137  // Only worthwhile doing the remainder if the trigger is not disabled. Otherwise will slow everything down
138  if (newTriggerPtr->getDisabled()) {
139  ATH_MSG_DEBUG("newTrigger " << name << " added (disabled)");
140  return StatusCode::SUCCESS;
141  }
142 
143  if (method == kAUTO) {
144  m_autoTriggers.push_back(name);
145  } else if (method == kEXISTING) {
146  m_existingTriggers[name] = m_tdt->getChainGroup(name);
148  }
149 
150  // Add this trigger to its groups
151  if (m_doTriggerGroups) {
152  for (const std::string& group : groups) {
153  // Ignore BW and PS groups
154  if (group.find("BW") == 0 || group.find("PS") == 0 || group.find("STREAM:express") == 0) continue;
155  if (m_groups.count(group) == 0) {
156  m_groups.emplace(group, std::make_unique<RatesGroup>(group, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
157  // As the group is formed from at least one active trigger - it must be active itself (counter example - CPS group of a PS=-1 trigger)
158  m_activeGroups.insert( m_groups.at(group).get() );
159  }
160  m_groups.at(group)->addToGroup( newTriggerPtr );
161  // For CPS, we let the trigger know that it is special
162  if (isCPS(group)) {
163  if (newTriggerPtr->getCPSID() != 0) ATH_MSG_WARNING("Trigger " << name << " can only be in one coherent prescale group.");
164  newTriggerPtr->setCPS(group); // This changes the CPSID
165  const size_t CPSID = newTriggerPtr->getCPSID();
166  // Find the lowest prescale of any member in this CPS group
167  if (m_lowestPrescale.count(CPSID) == 0) m_lowestPrescale[CPSID] = FLT_MAX;
168  if (prescale < m_lowestPrescale[CPSID]) m_lowestPrescale[CPSID] = prescale;
169  }
170  }
171  }
172 
173  // Add to total rates
174  const uint32_t level = getLevel(name);
175  if (m_doGlobalGroups) {
176  if (level == 2) m_globalGroups.at(m_l2GroupName)->addToGroup( newTriggerPtr );
177  else if (level == 1) m_globalGroups.at(m_l1GroupName)->addToGroup( newTriggerPtr );
178  }
179  // Add to express group - if express prescale is enabled
180  if (level == 2 && expressPrescale >= 1) {
181  if (m_doGlobalGroups) m_globalGroups.at(m_expressGroupName)->addToGroup( newTriggerPtr );
182  if (m_doExpressRates) m_expressTriggers.insert( newTriggerPtr );
183  }
184 
185  ATH_MSG_DEBUG("newTrigger " << name << " added");
186  return StatusCode::SUCCESS;
187 }

◆ newTrigger() [2/2]

StatusCode RatesAnalysisAlg::newTrigger ( const std::string &  name,
const double  prescale = 1.,
const double  expressPrescale = -1.,
const std::string &  seedName = "",
const double  seedPrecale = 1.,
const std::string &  groups = "",
const Method_t  method = kMANUAL,
const ExtrapStrat_t  extrapolation = kLINEAR 
)

Version of newTrigger which accepts a set of group names rather than a comma separated string.

Definition at line 88 of file RatesAnalysisAlg.cxx.

95  {
96 
97  std::set<std::string> groupSet;
98  std::istringstream ss(groups);
99  while (ss) {
100  std::string group;
101  if (!std::getline(ss, group, ',')) break;
102  groupSet.insert(group);
103  }
104 
105  return newTrigger(name, prescale, expressPrescale, seedName, seedPrecale, groupSet, method, extrapolation);
106 }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ outputMetaStore() [1/2]

ServiceHandle< StoreGateSvc >& AthAnalysisAlgorithm::outputMetaStore ( )
inlineinherited

Accessor for the output metadata store.

Definition at line 55 of file AthAnalysisAlgorithm.h.

55 { return m_outputMetaStore; }

◆ outputMetaStore() [2/2]

const ServiceHandle< StoreGateSvc >& AthAnalysisAlgorithm::outputMetaStore ( ) const
inlineinherited

Const accessor for the output metadata store.

Definition at line 53 of file AthAnalysisAlgorithm.h.

53 { return m_outputMetaStore; }

◆ populateTriggers()

StatusCode RatesAnalysisAlg::populateTriggers ( )
private

Register all triggers to emulate.

This is actually done at the start of the event loop such that the TDT has access to the configuration.

Definition at line 390 of file RatesAnalysisAlg.cxx.

390  {
391  // Let user add their triggers
392  ATH_MSG_INFO("Initializing User's Triggers (note: we are actually now in the event loop)");
393 
394  if (m_doGlobalGroups) {
395  m_globalGroups.emplace(m_l1GroupName, std::make_unique<RatesGroup>(m_l1GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
396  m_globalGroups.emplace(m_l2GroupName, std::make_unique<RatesGroup>(m_l2GroupName, msgSvc(), m_doHistograms, m_enableLumiExtrapolation));
397  m_globalGroups.at(m_l2GroupName)->setDoCachedWeights( m_doUniqueRates ); // This extra sub-weight caching is only utilised by unique-rate groups
398  if (m_doExpressRates) {
400  m_globalGroups.at(m_expressGroupName)->setExpressGroup( true );
401  }
402  }
403 
404  // This runs the derived class's code to add whatever triggers are desired.
405  // Should be calling newTrigger(...), newScanTrigger(...) or addExisting(...), addAllExisting().
407 
408  ATH_MSG_INFO("Computing coherent factors for coherent prescale groups.");
409  // Now we are not going to get any more chains - we can fill in the coherent prescale factors
410  for (const auto& trigger : m_triggers) {
411  const size_t CPSID = trigger.second->getCPSID();
412  if (CPSID != 0) trigger.second->setCoherentFactor( m_lowestPrescale.at(CPSID) );
413  }
414 
416  ATH_MSG_INFO("Creating extra groups to calculate unique rates.");
417  const RatesGroup* l2GroupPtr = m_globalGroups.at(m_l2GroupName).get(); // The finalised list of all HLT chains
418  const RatesGroup* l1GroupPtr = m_globalGroups.at(m_l1GroupName).get(); // The finalised list of all L1 chains
419  for (const auto& trigger : m_triggers) {
420  const uint32_t level = getLevel(trigger.first);
421  m_uniqueGroups.emplace(trigger.first, std::make_unique<RatesGroup>(trigger.first, msgSvc(), false, m_enableLumiExtrapolation)); // Each trigger gets its own unique group. No hist needed
422  RatesTrigger* triggerPtr = m_triggers.at(trigger.first).get();
423  RatesGroup* uniqueGroupPtr = m_uniqueGroups.at(trigger.first).get();
424  triggerPtr->setUniqueGroup( uniqueGroupPtr ); // Create two-way links
425  uniqueGroupPtr->setUniqueTrigger( triggerPtr ); // Create two-way links
426  // Copy in the global rates topology and make note of the unique rates master group
427  if (level == 2) uniqueGroupPtr->duplicateChildren( l2GroupPtr );
428  else if (level == 1) uniqueGroupPtr->duplicateChildren( l1GroupPtr );
429  else continue;
430  // Remove this one chain from the group (a unique rate is the rate of the entire menu minus one chain)
431  uniqueGroupPtr->removeFromGroup( triggerPtr );
432  if (getLevel(trigger.first) == 2) {
433  // For HLT, we can be more computationally efficient by utilising cached info from the hlt group
434  // We remove from the group all other L1 seeds except for the one seeding our chain.
435  // This sub-weight is the only one which can change. The combined weight of all other L1 seeds
436  // can be cached by the master group and fetched from there.
437  uniqueGroupPtr->removeOtherL1( triggerPtr );
438  uniqueGroupPtr->setUseCachedWeights(true);
439  }
440  // Efficiency - if the trigger is disabled, no need to actually calculate anything for it.
441  if (trigger.second->getDisabled() == false) {
442  m_activeGroups.insert( uniqueGroupPtr ); // Add this to the event loop
443  }
444  }
445  }
446 
447  ATH_MSG_INFO("Retrieving HLT chain's ID and Group from HLT menu.");
448 
449  if(!m_configSvc.empty() && m_configSvc.isValid()) {
450  const TrigConf::HLTMenu& hltmenu = m_configSvc->hltMenu( Gaudi::Hive::currentContext() );
451 
452  TrigConf::HLTMenu::const_iterator chain_itr = hltmenu.begin();
453  TrigConf::HLTMenu::const_iterator chain_end = hltmenu.end();
454 
455  m_hltChainIDGroup.resize(hltmenu.size());
456  for (size_t i = 0; i < hltmenu.size(); i++) m_hltChainIDGroup.at(i).resize(3);
457 
458  size_t c = 0;
459  for( ; chain_itr != chain_end; ++chain_itr ) {
460  std::string chainName = ( *chain_itr ).name() ;
461  unsigned int chainID = ( *chain_itr ).counter();
462  std::vector<std::string> chainGroups = ( *chain_itr ).groups();
463  for (std::string& stream : (*chain_itr).streams()){
464  chainGroups.push_back("STREAM:" + stream);
465  }
466  std::string singlechainGroups = "";
467  for (unsigned int j=0; j < chainGroups.size(); ++j){
468  if (j==0) singlechainGroups += chainGroups[j];
469  else singlechainGroups += ", "+chainGroups[j];
470  }
471 
472  m_hltChainIDGroup.at(c).at(0) = chainName;
473  m_hltChainIDGroup.at(c).at(1) = std::to_string(chainID);
474  m_hltChainIDGroup.at(c).at(2) = singlechainGroups;
475  ++c;
476  }
477  }
478 
479  ATH_MSG_INFO("Retrieving L1 item's ID from L1 menu.");
480 
481  if(!m_configSvc.empty() && m_configSvc.isValid()) {
482  const TrigConf::L1Menu& l1menu = m_configSvc->l1Menu( Gaudi::Hive::currentContext() );
483 
484  m_l1ItemID.resize(l1menu.size());
485  for (size_t i = 0; i < l1menu.size(); i++) {
486  // No groups for items
487  m_l1ItemID.at(i).resize(2);
488  }
489 
490  TrigConf::L1Menu::const_iterator item_itr = l1menu.begin();
491  TrigConf::L1Menu::const_iterator item_end = l1menu.end();
492 
493  size_t c = 0;
494  for( ; item_itr != item_end; ++item_itr ) {
495  m_l1ItemID.at(c).at(0) = (*item_itr).name();
496  m_l1ItemID.at(c).at(1) = std::to_string((*item_itr).ctpId());
497  ++c;
498  }
499  }
500 
501  // Print all triggers
502  if (msgLevel(MSG::DEBUG)) {
503  if (m_triggers.size()) {
504  ATH_MSG_DEBUG("################## Configured to estimate rates for the following triggers:");
505  for (const auto& trigger : m_triggers) ATH_MSG_DEBUG(trigger.second->printConfig());
506  }
507  if (m_scanTriggers.size()) {
508  ATH_MSG_DEBUG("################## Configured to estimate rates for the following scan triggers:");
509  for (const auto& trigger : m_scanTriggers) ATH_MSG_DEBUG(trigger.second->printConfig());
510  }
511  if (m_groups.size()) {
512  ATH_MSG_DEBUG("################## Configured to estimate rates for the following groups of triggers:");
513  for (const auto& group : m_groups) ATH_MSG_DEBUG(group.second->printConfig());
514  }
515  if (m_globalGroups.size()) {
516  ATH_MSG_DEBUG("################## Configured to estimate rates for the following global groups of triggers:");
517  for (const auto& group : m_globalGroups) ATH_MSG_DEBUG(group.second->printConfig());
518  }
519  }
520 
521  if (m_doHistograms) {
522  ATH_MSG_DEBUG("################## Registering normalisation histogram:");
523  m_scalingHist = new TH1D("normalisation",";;",3,0.,3.);
524  ATH_CHECK( histSvc()->regHist("/RATESTREAM/normalisation", m_scalingHist) );
525  m_bcidHist = new TH1D("bcid",";BCID;Events",3565,-.5,3564.5);
526  ATH_CHECK( histSvc()->regHist("/RATESTREAM/bcid", m_bcidHist) );
527  ATH_MSG_DEBUG("################## Registering metadata tree histogram:");
528  ATH_CHECK( histSvc()->regTree("/RATESTREAM/metadata", std::make_unique<TTree>("metadata", "metadata")) );
529  ATH_CHECK( histSvc()->getTree("/RATESTREAM/metadata", m_metadataTree) );
530  if (m_triggers.size()) {
531  ATH_MSG_DEBUG("################## Registering trigger histograms:");
532  for (const auto& trigger : m_triggers) {
533  if (!trigger.second->doHistograms()) continue; // Not all may be doing histograming
534  std::string lvlSubdir = "";
535  if (trigger.second->getName().find("L1") == 0){
536  lvlSubdir = "Rate_ChainL1_HLT/";
537  } else if (trigger.second->getName().find("HLT") == 0) {
538  lvlSubdir = "Rate_ChainHLT_HLT/";
539  }
540  ATH_CHECK( trigger.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/data")) );
541  ATH_CHECK( trigger.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/rateVsMu")) );
542  if (m_useBunchCrossingData) ATH_CHECK( trigger.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/" + lvlSubdir + trigger.first + "/rateVsTrain")) );
543  else trigger.second->clearTrainHist();
544  }
545  }
546  if (m_scanTriggers.size()) {
547  ATH_MSG_DEBUG("################## Registering scan trigger histograms:");
548  for (const auto& trigger : m_scanTriggers) {
549  ATH_CHECK( trigger.second->giveThresholdHist(histSvc(), std::string("/RATESTREAM/ScanTriggers/" + trigger.first + "/rateVsThreshold")) );
550  }
551  }
552  if (m_groups.size()) {
553  ATH_MSG_DEBUG("################## Registering group histograms:");
554  for (const auto& group : m_groups) {
555  if (!group.second->doHistograms()) continue;
556  std::string groupName = group.first;
557  std::replace( groupName.begin(), groupName.end(), ':', '_');
558  ATH_CHECK( group.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/data")) );
559  ATH_CHECK( group.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/rateVsMu")) );
560  if (m_useBunchCrossingData) ATH_CHECK( group.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/" + groupName + "/rateVsTrain")) );
561  else group.second->clearTrainHist();
562  }
563  }
564  if (m_globalGroups.size()) {
565  ATH_MSG_DEBUG("################## Registering global group histograms:");
566  for (const auto& group : m_globalGroups) {
567  if (!group.second->doHistograms()) continue;
568  ATH_CHECK( group.second->giveDataHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/data")) );
569  ATH_CHECK( group.second->giveMuHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/rateVsMu")) );
570  if (m_useBunchCrossingData) ATH_CHECK( group.second->giveTrainHist(histSvc(), std::string("/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" + group.first + "/rateVsTrain")) );
571  else group.second->clearTrainHist();
572  }
573  }
574  }
575 
576  // Has the user set a lumi extrapolation? If not - set a default
578 
579  // We now know the final lumi scaling so we can set the bunch scaling
580  const uint32_t ebPairedBunches = m_enhancedBiasRatesTool->getPairedBunches();
581  ATH_MSG_INFO("Number of paired bunches in input file:" << m_enhancedBiasRatesTool->getPairedBunches());
583 
584  return StatusCode::SUCCESS;
585 }

◆ printInputSummary()

void RatesAnalysisAlg::printInputSummary ( ) const
private

Print the input data instantaneous luminosity, mu and number of bunches.

Note this is averaged as the data are processed - so should only be printed at the end.

Definition at line 782 of file RatesAnalysisAlg.cxx.

782  {
783  ATH_MSG_INFO("Input " << (m_enhancedBiasRatesTool->isMC() ? "MC" : "EB Data")
784  << " with <L_inst.> = "
785  << m_enhancedBiasRatesTool->getAverageLumi()
786  << " cm-2s-1, <mu> = "
787  << m_enhancedBiasRatesTool->getAverageMu()
788  << ", paired bunches = "
789  << m_enhancedBiasRatesTool->getPairedBunches());
790 }

◆ printStatistics()

void RatesAnalysisAlg::printStatistics ( ) const
private

Print some extra statistics on events processed.

Definition at line 778 of file RatesAnalysisAlg.cxx.

778  {
779  ATH_MSG_INFO("Processed " << m_eventCounter << " raw events, " << m_weightedEventCounter << " weighted. Total LHC wall-time of " << m_ratesDenominator << " s.");
780 }

◆ printTarget()

void RatesAnalysisAlg::printTarget ( ) const
private

Print the target instantaneous luminosity, mu and number of bunches.

Definition at line 770 of file RatesAnalysisAlg.cxx.

770  {
772  ATH_MSG_INFO("Calculating rates for a target L_inst. = " << m_targetLumi << " cm-2s-1, mu = " << m_targetMu << ", paired bunches = " << m_targetBunches);
773  } else {
774  ATH_MSG_INFO("Luminosity extrapolation is switched off. Input files will determin the paired bunches, L_inst. and mu profile.");
775  }
776 }

◆ ratesExecute()

virtual StatusCode RatesAnalysisAlg::ratesExecute ( )
pure virtual

To be implemented by the user.

Supply pass/fail for all "triggers"

Implemented in FullMenu, and RatesEmulationExample.

◆ ratesFinalize()

virtual StatusCode RatesAnalysisAlg::ratesFinalize ( )
pure virtual

To be implemented by the user.

Implemented in FullMenu, and RatesEmulationExample.

◆ ratesInitialize()

virtual StatusCode RatesAnalysisAlg::ratesInitialize ( )
pure virtual

To be implemented by the user.

Register "triggers" to calculate the rate for

Implemented in FullMenu, and RatesEmulationExample.

◆ 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< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ retrieveMetadata() [1/2]

template<typename T >
StatusCode AthAnalysisAlgorithm::retrieveMetadata ( const std::string &  folder,
const std::string &  key,
T &  out 
)
inlineinherited

Helper function to access IOVMetaDataContainer information helped in the MetaDataStore.

Definition at line 65 of file AthAnalysisAlgorithm.h.

65  {
66  try {
68  } catch(std::exception& e) {
69  ATH_MSG_WARNING(e.what());
70  return StatusCode::FAILURE;
71  }
72  }

◆ retrieveMetadata() [2/2]

template<typename T >
StatusCode AthAnalysisAlgorithm::retrieveMetadata ( const std::string &  folder,
const std::string &  key,
T &  out,
const IOVTime time,
int  channel = -1 
)
inlineinherited

Helper function to access IOVMetaDataContainer information held in InputMetaDataStore, but will check IOVTime.

Also can give a channel (leave as -1 to take first available) IOVTime(runNumber, eventNumber) is a valid constructor for example

Definition at line 76 of file AthAnalysisAlgorithm.h.

76  {
77  try {
79  } catch(std::exception& e) {
80  ATH_MSG_WARNING(e.what());
81  return StatusCode::FAILURE;
82  }
83  }

◆ setExponentialMuScalingFactor()

void RatesAnalysisAlg::setExponentialMuScalingFactor ( const double  f)
inline

Set the exponential scaling factor for relevant chains.

scaling = exp(f * (targetMu - eventMu))

Parameters
fExponential factor

Definition at line 186 of file RatesAnalysisAlg.h.

186 { m_expoScalingFactor = f; }

◆ setTargetLumi()

void RatesAnalysisAlg::setTargetLumi ( const double  lumi)
inline

Set the target instantaneous luminosity.

Assumes a full-ring. Mu is derived.

Parameters
lumiThe target lumi in cm-2s-1

Definition at line 174 of file RatesAnalysisAlg.h.

◆ setTargetLumiBunches()

void RatesAnalysisAlg::setTargetLumiBunches ( const double  lumi,
const int32_t  bunches 
)

Set the target instantaneous luminosity and number of bunches.

Mu is derived.

Parameters
lumiThe target lumi in cm-2s-1
bunchesThe target number of paired bunches

Definition at line 732 of file RatesAnalysisAlg.cxx.

732  {
733  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
734  ATH_MSG_WARNING("Too late to call setTargetLumiBunches. Do this during ratesInitialize().");
735  return;
736  }
737  m_targetLumi = lumi;
738  if (bunches == 0) {
739  ATH_MSG_WARNING("Cannot have bunches = 0. Setting to 1.");
740  m_targetBunches = 1;
741  } else {
742  m_targetBunches = bunches;
743  }
745  printTarget();
746 }

◆ setTargetLumiMu()

void RatesAnalysisAlg::setTargetLumiMu ( const double  lumi,
const double  mu 
)

Set the target instantaneous luminosity and mu.

Number of bunches in the ring is derived.

Parameters
lumiThe target lumi in cm-2s-1
muThe target pileup

Definition at line 712 of file RatesAnalysisAlg.cxx.

712  {
713  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
714  ATH_MSG_WARNING("Too late to call setTargetLumiMu. Do this during ratesInitialize().");
715  return;
716  }
717  m_targetLumi = lumi;
718  if (isZero(mu)) {
719  ATH_MSG_WARNING("Cannot have <mu> = 0. Setting to 1.");
720  m_targetMu = 1;
721  } else {
722  m_targetMu = mu;
723  }
726  ATH_MSG_WARNING("Un-physical number of bunches " << m_targetBunches << ", should be within 1 < N < " << EnhancedBiasWeighter::FULL_RING+1);
727  if (m_targetBunches == 0) ++m_targetBunches;
728  }
729  printTarget();
730 }

◆ setTargetMu()

void RatesAnalysisAlg::setTargetMu ( const double  mu)
inline

Set the target pileup.

Assumes a full-ring. Inst. lumi is derived.

Parameters
muThe target pileup

Definition at line 180 of file RatesAnalysisAlg.h.

◆ setTargetMuBunches()

void RatesAnalysisAlg::setTargetMuBunches ( const double  mu,
const int32_t  bunches 
)

Set the target mu and number of bunches.

The instantaneous luminosity is derived.

Parameters
muThe target pileup
bunchesThe target number of paired bunches

Definition at line 749 of file RatesAnalysisAlg.cxx.

749  {
750  if (m_eventCounter > 1) { // All settings must be defined before we start looping over the sample
751  ATH_MSG_WARNING("Too late to call setTargetMuBunches. Do this during ratesInitialize().");
752  return;
753  }
754  if (bunches == 0) {
755  ATH_MSG_WARNING("Cannot have paired bunches = 0. Setting to 1.");
756  m_targetBunches = 1;
757  } else {
758  m_targetBunches = bunches;
759  }
760  if (isZero(mu)) {
761  ATH_MSG_WARNING("Cannot have mu = 0. Setting to 1.");
762  m_targetMu = 1;
763  } else {
764  m_targetMu = mu;
765  }
767  printTarget();
768 }

◆ setTriggerDesicison() [1/2]

StatusCode RatesAnalysisAlg::setTriggerDesicison ( const std::string &  name,
const bool  triggerIsPassed = true,
const bool  triggerIsActive = true 
)

Set the pass/fail decision for an item.

Parameters
nameName of the registered trigger
triggerIsPassedTrigger decision.

Definition at line 342 of file RatesAnalysisAlg.cxx.

342  {
343  // Currently - we call execute on setPassed, so the user would be unable to overwrite a decision set e.g. by the TDT.
344  // so for now we only accept positive decisions here.
345  if (triggerIsPassed || triggerIsActive) {
346  const auto iterator = m_triggers.find(name);
347  if (iterator == m_triggers.end()) {
348  ATH_MSG_ERROR("Cannot find trigger " << name << " did you call newTrigger for this in initialize?");
349  return StatusCode::FAILURE;
350  }
351  iterator->second->setPassedAndExecute(triggerIsPassed, triggerIsActive, m_weightingValues); // There is logic in the RatesTrigger to prevent multiple calls per event by accident.
352  m_activatedTriggers.insert( iterator->second.get() );
353  }
354  return StatusCode::SUCCESS;
355 }

◆ setTriggerDesicison() [2/2]

StatusCode RatesAnalysisAlg::setTriggerDesicison ( const std::string &  name,
const double  threshold 
)

Set the pass threshold for a Scan Trigger item.

Parameters
nameName of the registered scan-trigger
thresholdThe passed threshold in the event

Definition at line 358 of file RatesAnalysisAlg.cxx.

358  {
359  const auto iterator = m_scanTriggers.find(name);
360  if (iterator == m_scanTriggers.end()) {
361  ATH_MSG_ERROR("Cannot find scan-trigger " << name << " did you call newScanTrigger for this in initialize?");
362  return StatusCode::FAILURE;
363  }
364  iterator->second->setPassedAndExecute(threshold, m_weightingValues); // There is logic in the RatesScanTrigger to prevent multiple calls per event by accident.
365  m_activatedTriggers.insert( static_cast<RatesTrigger*>(iterator->second.get()));
366  return StatusCode::SUCCESS;
367 }

◆ sysExecute()

StatusCode AthAnalysisAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

override to do firstEvent method

Definition at line 72 of file AthAnalysisAlgorithm.cxx.

72  {
73  if(!m_doneFirstEvent) {
74  m_doneFirstEvent=true;
75  if( firstExecute().isFailure() ) {
76  ATH_MSG_FATAL("Failure in firstEvent method");
77  return StatusCode::FAILURE;
78  }
79  }
80  return AthHistogramAlgorithm::sysExecute(ctx);
81 }

◆ sysInitialize()

StatusCode AthAnalysisAlgorithm::sysInitialize ( )
overridevirtualinherited

Function initialising the tool in the correct way in Athena.

Reimplemented from AthHistogramAlgorithm.

Definition at line 50 of file AthAnalysisAlgorithm.cxx.

50  {
51 
52  // Connect to the IncidentSvc:
53  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
54  ATH_CHECK( incSvc.retrieve() );
55 
56  // Set up the right callbacks: //but ensure we don't double-register if sysInitialize called twice (appears to be the case)
57  incSvc->removeListener( this, IncidentType::BeginInputFile );
58  incSvc->addListener( this, IncidentType::BeginInputFile, 0, true );
59  incSvc->removeListener( this, IncidentType::EndInputFile );
60  incSvc->addListener( this, IncidentType::EndInputFile, 0, true );
61  incSvc->removeListener( this, "MetaDataStop" );
62  incSvc->addListener( this, "MetaDataStop", 0, true );
63 
64 
65  // Let the base class do its thing:
67 
68  // Return gracefully:
69  return StatusCode::SUCCESS;
70 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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.

◆ tree()

TTree * AthHistogramming::tree ( const std::string &  treeName,
const std::string &  tDir = "",
const std::string &  stream = "" 
)
protectedinherited

Simplify the retrieval of registered TTrees.

Definition at line 378 of file AthHistogramming.cxx.

379 {
380  // Build a 32 bit hash out of the name
381  const hash_t treeHash = this->hash(treeName);
382 
383  // See if this entry exists in the map
384  TreeMap_t::const_iterator it = m_treeMap.find( treeHash );
385  if ( it == m_treeMap.end() ) // It doesn't exist!
386  { // Let's see into the THistSvc if somebody else has registered the TTree...
387 
388  // Need to copy the strings as we will massage them from here on
389  std::string treeNameCopy = treeName;
390  std::string tDirCopy = tDir;
391  std::string streamCopy = stream;
392 
393  // Massage the final string to book things
394  std::string bookingString("");
395  this->buildBookingString( bookingString, treeNameCopy, tDirCopy, streamCopy );
396 
397  TTree* treePointer(NULL);
398  if ( !((histSvc()->getTree(bookingString, treePointer)).isSuccess()) )
399  {
400  m_msg << MSG::WARNING
401  << "Problem retrieving the TTree with name " << treeNameCopy
402  << " in " << m_name << "... it doesn't exist, neither in the cached map nor in the THistSvc!"
403  << " Will return an NULL pointer... you have to handle it correctly!" << endmsg;
404  return NULL;
405  }
406  // If we get to here, we actually found the TTree in the THistSvc.
407  // So let's add it to the local cache map and return its pointer
408  m_treeMap.insert( m_treeMap.end(), std::pair< const hash_t, TTree* >( treeHash, treePointer ) );
409  return treePointer;
410  }
411 
412  // Return the pointer to the TTree that we got from the local cache map
413  return it->second;
414 }

◆ updateEvtStore()

void AthAnalysisAlgorithm::updateEvtStore ( Gaudi::Details::PropertyBase &  prop)
protectedinherited

Definition at line 45 of file AthAnalysisAlgorithm.cxx.

45  {
46  evtStore().release().ignore();
47  evtStore().setTypeAndName(prop.toString());
48 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ writeMetadata()

void RatesAnalysisAlg::writeMetadata ( )
private

Write to outpute tree (if any) the metadata needed downstream.

Definition at line 809 of file RatesAnalysisAlg.cxx.

809  {
810  if (!m_metadataTree) {
811  return;
812  }
813 
814  m_runNumber = m_enhancedBiasRatesTool->getRunNumber();
815  m_metadataTree->Branch("runNumber", &m_runNumber);
816 
817  m_metadataTree->Branch("targetMu", &m_targetMu);
818  m_metadataTree->Branch("targetBunches", &m_targetBunches);
819  m_metadataTree->Branch("targetLumi", &m_targetLumi);
820 
821  std::vector<std::string> triggers;
822  std::vector<std::string> lowers;
823  std::vector<double> prescales;
824  std::vector<double> express;
825  triggers.reserve(m_triggers.size());
826  lowers.reserve(m_triggers.size());
827  prescales.reserve(m_triggers.size());
828  express.reserve(m_triggers.size());
829  for (const auto& trigger : m_triggers) {
830  triggers.push_back(trigger.first);
831  lowers.push_back(trigger.second->getSeedName());
832  prescales.push_back(trigger.second->getPrescale() );
833  express.push_back(trigger.second->getPrescale(true /*includeExpress*/) );
834  }
835 
836  for (const auto& group : m_groups) {
837  triggers.push_back(group.first);
838  lowers.push_back("-");
839  prescales.push_back(-1);
840  express.push_back(-1);
841  }
842 
843  for (const auto& group : m_globalGroups) {
844  triggers.push_back("RATE_GLOBAL_" + group.first);
845  lowers.push_back("-");
846  prescales.push_back(-1);
847  express.push_back(-1);
848  }
849 
850  m_metadataTree->Branch("triggers", &triggers);
851  m_metadataTree->Branch("lowers", &lowers);
852  m_metadataTree->Branch("prescales", &prescales);
853  m_metadataTree->Branch("express", &express);
854 
855  std::vector<int32_t> bunchGroups;
856  bunchGroups.reserve(16);
857 
858  uint32_t masterKey = 0;
859  uint32_t hltPrescaleKey = 0;
860  uint32_t lvl1PrescaleKey = 0;
861 
862  if(!m_configSvc.empty() && m_configSvc.isValid()) {
863  const TrigConf::BunchGroupSet* bgs = m_configSvc->bunchGroupSet();
864  for (const TrigConf::BunchGroup& bg : bgs->bunchGroups()) {
865  bunchGroups.push_back(bg.bunches().size());
866  }
867  masterKey = m_configSvc->masterKey();
868  hltPrescaleKey = m_configSvc->hltPrescaleKey();
869  lvl1PrescaleKey = m_configSvc->lvl1PrescaleKey();
870  }
871 
872  if (bunchGroups.size() == 0 || std::all_of(bunchGroups.begin(), bunchGroups.end(), [](int i) { return i==0; })) {
873  bunchGroups = m_enhancedBiasRatesTool->getBunchGroups();
874  }
875 
876  m_metadataTree->Branch("bunchGroups", &bunchGroups);
877 
878  m_metadataTree->Branch("hltChainIDGroup", &m_hltChainIDGroup);
879  m_metadataTree->Branch("l1ItemID", &m_l1ItemID);
880 
881  m_metadataTree->Branch("masterKey", &masterKey);
882  m_metadataTree->Branch("lvl1PrescaleKey", &lvl1PrescaleKey);
883  m_metadataTree->Branch("hltPrescaleKey", &hltPrescaleKey);
884 
885  std::string atlasProject = std::getenv("AtlasProject");
886  std::string atlasVersion = std::getenv("AtlasVersion");
887  m_metadataTree->Branch("AtlasProject", &atlasProject);
888  m_metadataTree->Branch("AtlasVersion", &atlasVersion);
889 
890  m_metadataTree->Fill();
891 
892 }

Member Data Documentation

◆ m_activatedTriggers

std::unordered_set<RatesTrigger*> RatesAnalysisAlg::m_activatedTriggers
private

Triggers which were changed & hence need to be reset at the event end.

Definition at line 247 of file RatesAnalysisAlg.h.

◆ m_activeGroups

std::unordered_set<RatesGroup*> RatesAnalysisAlg::m_activeGroups
private

All groups which are enabled (PS >= 1)

Definition at line 249 of file RatesAnalysisAlg.h.

◆ m_autoTriggers

std::vector<std::string> RatesAnalysisAlg::m_autoTriggers
private

List of triggers which it is up to us to the algorithm to work out the pass/fail for.

Definition at line 251 of file RatesAnalysisAlg.h.

◆ m_bcidHist

TH1D* RatesAnalysisAlg::m_bcidHist
private

Histogram of the BCIDs distribution of the processing.

Definition at line 291 of file RatesAnalysisAlg.h.

◆ m_configSvc

ServiceHandle<TrigConf::ITrigConfigSvc> RatesAnalysisAlg::m_configSvc {this, "TrigConfigSvc", ""}
private

Definition at line 265 of file RatesAnalysisAlg.h.

◆ m_currentEventIsUnbiased

Gaudi::Property<bool> RatesAnalysisAlg::m_currentEventIsUnbiased
private

If the current event was triggered online by RDx or not.

Random seeded HLT chains must only see these

Definition at line 274 of file RatesAnalysisAlg.h.

◆ m_currentFile

TFile* AthAnalysisAlgorithm::m_currentFile {nullptr}
privateinherited

Definition at line 120 of file AthAnalysisAlgorithm.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doExpressRates

Gaudi::Property<bool> RatesAnalysisAlg::m_doExpressRates {this, "DoExpressRates", false, "Calculate total rates for the express stream."}
private

Definition at line 272 of file RatesAnalysisAlg.h.

◆ m_doGlobalGroups

Gaudi::Property<bool> RatesAnalysisAlg::m_doGlobalGroups {this, "DoGlobalGroups", false, "Calculate total rates for each trigger level."}
private

Definition at line 270 of file RatesAnalysisAlg.h.

◆ m_doHistograms

Gaudi::Property<bool> RatesAnalysisAlg::m_doHistograms {this, "DoHistograms", true, "Switch on histogram output of rate vs. mu and position in train."}
private

Definition at line 275 of file RatesAnalysisAlg.h.

◆ m_doneFirstEvent

bool AthAnalysisAlgorithm::m_doneFirstEvent {false}
privateinherited

Definition at line 122 of file AthAnalysisAlgorithm.h.

◆ m_doTriggerGroups

Gaudi::Property<bool> RatesAnalysisAlg::m_doTriggerGroups {this, "DoTriggerGroups", false, "Calculate total rates for each group of triggers."}
private

Definition at line 271 of file RatesAnalysisAlg.h.

◆ m_doUniqueRates

Gaudi::Property<bool> RatesAnalysisAlg::m_doUniqueRates {this, "DoUniqueRates", false, "Calculate unique rates for all chains (slow). Requires DoGlobalGroups=True too."}
private

Definition at line 269 of file RatesAnalysisAlg.h.

◆ m_effMap

EffMap_t AthHistogramming::m_effMap
privateinherited

The map of histogram names to their pointers.

Definition at line 208 of file AthHistogramming.h.

◆ m_enableLumiExtrapolation

Gaudi::Property<bool> RatesAnalysisAlg::m_enableLumiExtrapolation {this, "EnableLumiExtrapolation", true, "If false then no extrapolation in L, N_bunch or <mu> will be performed.."}
private

Definition at line 276 of file RatesAnalysisAlg.h.

◆ m_enhancedBiasRatesTool

ToolHandle<IEnhancedBiasWeighter> RatesAnalysisAlg::m_enhancedBiasRatesTool {this, "EnhancedBiasRatesTool", "EnhancedBiasWeighter/EnhancedBiasRatesTool"}
private

Definition at line 263 of file RatesAnalysisAlg.h.

◆ m_eventCounter

uint32_t RatesAnalysisAlg::m_eventCounter
private

Count how many events processed.

Definition at line 287 of file RatesAnalysisAlg.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_existingTriggers

std::unordered_map<std::string, const Trig::ChainGroup*> RatesAnalysisAlg::m_existingTriggers
private

Map of triggers which we ask the TDT ChainGroup for the pass/fail.

Definition at line 253 of file RatesAnalysisAlg.h.

◆ m_expoScalingFactor

Gaudi::Property<double> RatesAnalysisAlg::m_expoScalingFactor {this, "ExpoScalingFactor", 0.1, "Optional. Exponential factor if using exponential-mu rates scaling."}
private

Definition at line 267 of file RatesAnalysisAlg.h.

◆ m_expressGroupName

const std::string RatesAnalysisAlg::m_expressGroupName = "Express"
private

Definition at line 261 of file RatesAnalysisAlg.h.

◆ m_expressTriggers

std::unordered_set<RatesTrigger*> RatesAnalysisAlg::m_expressTriggers
private

Triggers with non-zero express PS, used to print them at the end.

Definition at line 248 of file RatesAnalysisAlg.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_globalGroups

std::unordered_map<std::string, std::unique_ptr<RatesGroup> > RatesAnalysisAlg::m_globalGroups
private

Big (master) groups which do the OR of the whole menu.

Definition at line 244 of file RatesAnalysisAlg.h.

◆ m_graphMap

GraphMap_t AthHistogramming::m_graphMap
privateinherited

The map of TGraph names to their pointers.

Definition at line 222 of file AthHistogramming.h.

◆ m_groups

std::unordered_map<std::string, std::unique_ptr<RatesGroup> > RatesAnalysisAlg::m_groups
private

All regular and CPS groups.

Definition at line 243 of file RatesAnalysisAlg.h.

◆ m_histMap

HistMap_t AthHistogramming::m_histMap
privateinherited

The map of histogram names to their pointers.

Definition at line 201 of file AthHistogramming.h.

◆ m_histNamePostfix

std::string AthHistogramAlgorithm::m_histNamePostfix
privateinherited

The postfix for the histogram THx name.

Definition at line 97 of file AthHistogramAlgorithm.h.

◆ m_histNamePrefix

std::string AthHistogramAlgorithm::m_histNamePrefix
privateinherited

The prefix for the histogram THx name.

Definition at line 94 of file AthHistogramAlgorithm.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> AthHistogramAlgorithm::m_histSvc
privateinherited

Default constructor: AthHistogramAlgorithm();.

a handle on the Hist/TTree registration service

Definition at line 83 of file AthHistogramAlgorithm.h.

◆ m_histTitlePostfix

std::string AthHistogramAlgorithm::m_histTitlePostfix
privateinherited

The postfix for the histogram THx title.

Definition at line 103 of file AthHistogramAlgorithm.h.

◆ m_histTitlePrefix

std::string AthHistogramAlgorithm::m_histTitlePrefix
privateinherited

The prefix for the histogram THx title.

Definition at line 100 of file AthHistogramAlgorithm.h.

◆ m_hltChainIDGroup

std::vector<std::vector<std::string> > RatesAnalysisAlg::m_hltChainIDGroup
private

Definition at line 256 of file RatesAnalysisAlg.h.

◆ m_inelasticCrossSection

Gaudi::Property<double> RatesAnalysisAlg::m_inelasticCrossSection {this, "InelasticCrossSection", 8e-26, "Inelastic cross section in units cm^2. Default 80 mb at 13 TeV."}
private

Definition at line 268 of file RatesAnalysisAlg.h.

◆ m_inputMetaStore

ServiceHandle< StoreGateSvc > AthAnalysisAlgorithm::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 116 of file AthAnalysisAlgorithm.h.

◆ m_l1GroupName

const std::string RatesAnalysisAlg::m_l1GroupName = "L1"
private

Definition at line 259 of file RatesAnalysisAlg.h.

◆ m_l1ItemID

std::vector<std::vector<std::string> > RatesAnalysisAlg::m_l1ItemID
private

Definition at line 257 of file RatesAnalysisAlg.h.

◆ m_l2GroupName

const std::string RatesAnalysisAlg::m_l2GroupName = "HLT"
private

Definition at line 260 of file RatesAnalysisAlg.h.

◆ m_lowerTrigger

std::unordered_map<std::string, std::string> RatesAnalysisAlg::m_lowerTrigger
private

Map of triggers lower chain, to tell if a HLT trigger ran or not.

Definition at line 254 of file RatesAnalysisAlg.h.

◆ m_lowestPrescale

std::unordered_map<size_t, double> RatesAnalysisAlg::m_lowestPrescale
private

Lowest prescale within a CPS group, key is the hash of the CPS group name.

Definition at line 250 of file RatesAnalysisAlg.h.

◆ m_metadataTree

TTree* RatesAnalysisAlg::m_metadataTree
private

Used to write out some metadata needed by post-processing (e.g.

bunchgroup, lumi)

Definition at line 293 of file RatesAnalysisAlg.h.

◆ m_msg

MsgStream AthHistogramming::m_msg
privateinherited

Cached Message Stream.

Definition at line 248 of file AthHistogramming.h.

◆ m_name

std::string AthHistogramming::m_name
privateinherited

Instance name.

Definition at line 245 of file AthHistogramming.h.

◆ m_outputMetaStore

ServiceHandle< StoreGateSvc > AthAnalysisAlgorithm::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 118 of file AthAnalysisAlgorithm.h.

◆ m_prefix

std::string AthHistogramAlgorithm::m_prefix
privateinherited

Name of the ROOT output stream (file)

Definition at line 88 of file AthHistogramAlgorithm.h.

◆ m_prescalesJSON

Gaudi::Property<std::map<std::string, std::map<std::string, double> > > RatesAnalysisAlg::m_prescalesJSON {this, "PrescalesJSON", {}, "Optional JSON of prescales from the TrigMenuRuleBook to apply."}
private

Definition at line 279 of file RatesAnalysisAlg.h.

◆ m_ratesDenominator

double RatesAnalysisAlg::m_ratesDenominator
private

How much walltime is seen by the algorithm.

This is what we need to normalise to.

Definition at line 286 of file RatesAnalysisAlg.h.

◆ m_rootDir

std::string AthHistogramAlgorithm::m_rootDir
privateinherited

Name of the ROOT directory.

Definition at line 91 of file AthHistogramAlgorithm.h.

◆ m_runNumber

uint32_t RatesAnalysisAlg::m_runNumber
private

What is the RunNumber.

Definition at line 285 of file RatesAnalysisAlg.h.

◆ m_scalingHist

TH1D* RatesAnalysisAlg::m_scalingHist
private

One-bin histogram to store the normalisation of the sample, for use in later combinations.

Definition at line 290 of file RatesAnalysisAlg.h.

◆ m_scanTriggers

std::unordered_map<std::string, std::unique_ptr<RatesScanTrigger> > RatesAnalysisAlg::m_scanTriggers
private

All individual rates-scan triggers (L1 or HLT)

Definition at line 242 of file RatesAnalysisAlg.h.

◆ m_streamName

std::string AthHistogramming::m_streamName
privateinherited

Name of the ROOT output stream (file)

Definition at line 226 of file AthHistogramming.h.

◆ m_targetBunches

double RatesAnalysisAlg::m_targetBunches
private

How many bunches the prediction is targeting.

Definition at line 283 of file RatesAnalysisAlg.h.

◆ m_targetLumi

double RatesAnalysisAlg::m_targetLumi
private

What instantaneous luminosity the prediction is targeting.

Definition at line 284 of file RatesAnalysisAlg.h.

◆ m_targetMu

double RatesAnalysisAlg::m_targetMu
private

What pileup level the prediction is targeting.

Definition at line 282 of file RatesAnalysisAlg.h.

◆ m_tdt

ToolHandle<Trig::TrigDecisionTool> RatesAnalysisAlg::m_tdt {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"}
private

Definition at line 264 of file RatesAnalysisAlg.h.

◆ m_treeMap

TreeMap_t AthHistogramming::m_treeMap
privateinherited

The map of TTree names to their pointers.

Definition at line 215 of file AthHistogramming.h.

◆ m_triggers

std::unordered_map<std::string, std::unique_ptr<RatesTrigger> > RatesAnalysisAlg::m_triggers
private

All individual triggers (L1 or HLT)

Definition at line 241 of file RatesAnalysisAlg.h.

◆ m_uniqueGroups

std::unordered_map<std::string, std::unique_ptr<RatesGroup> > RatesAnalysisAlg::m_uniqueGroups
private

Groups used to obtain unique rates for chains.

Definition at line 245 of file RatesAnalysisAlg.h.

◆ m_useBunchCrossingData

Gaudi::Property<bool> RatesAnalysisAlg::m_useBunchCrossingData {this, "UseBunchCrossingData", true, "BunchCrossing data requires CONDBR2 access. Can be disabled here if this is a problem."}
private

Definition at line 273 of file RatesAnalysisAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vetoStartOfTrain

Gaudi::Property<uint32_t> RatesAnalysisAlg::m_vetoStartOfTrain {this, "VetoStartOfTrain", 0, "How many BCID to veto at the start of a bunch train."}
private

Definition at line 277 of file RatesAnalysisAlg.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_weightedEventCounter

double RatesAnalysisAlg::m_weightedEventCounter
private

Count how many weighted events were processed.

Definition at line 288 of file RatesAnalysisAlg.h.

◆ m_weightingValues

WeightingValuesSummary_t RatesAnalysisAlg::m_weightingValues
private

Possible weighting & lumi extrapolation values for the current event.

Definition at line 295 of file RatesAnalysisAlg.h.


The documentation for this class was generated from the following files:
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
AthHistogramming::m_rootDir
std::string m_rootDir
Name of the ROOT directory.
Definition: AthHistogramming.h:229
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::HLTPrescalesSet::HLTPrescale::prescale
double prescale
Definition: HLTPrescalesSet.h:24
RatesAnalysisAlg::printStatistics
void printStatistics() const
Print some extra statistics on events processed.
Definition: RatesAnalysisAlg.cxx:778
AthHistogramming::histSvc
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
Definition: AthHistogramming.h:421
TrigConf::BunchGroup
Definition: BunchGroup.h:17
AthHistogramAlgorithm::histSvc
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
Definition: AthHistogramAlgorithm.h:113
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
TrigConf::BunchGroupSet
Definition: BunchGroupSet.h:19
RatesAnalysisAlg::m_expressGroupName
const std::string m_expressGroupName
Definition: RatesAnalysisAlg.h:261
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
AthAnalysisAlgorithm::m_currentFile
TFile * m_currentFile
Definition: AthAnalysisAlgorithm.h:120
ChainDefInMenu.groups
groups
Definition: ChainDefInMenu.py:44
RatesAnalysisAlg::populateTriggers
StatusCode populateTriggers()
Register all triggers to emulate.
Definition: RatesAnalysisAlg.cxx:390
RatesAnalysisFullMenu.e34
e34
Definition: RatesAnalysisFullMenu.py:25
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
RatesAnalysisAlg::m_runNumber
uint32_t m_runNumber
What is the RunNumber.
Definition: RatesAnalysisAlg.h:285
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AthHistogramming::myReplace
void myReplace(std::string &str, const std::string &oldStr, const std::string &newStr)
Helper method to replace sub-string.
Definition: AthHistogramming.cxx:590
WeightingValuesSummary_t::m_eventLiveTime
double m_eventLiveTime
How much wall-time at P1 did this event represent.
Definition: RatesHistoBase.h:62
RatesScanTrigger
Used to calculate a rate scan as a function of some threshold value.
Definition: RatesScanTrigger.h:14
AthHistogramming::m_msg
MsgStream m_msg
Cached Message Stream.
Definition: AthHistogramming.h:248
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
RatesAnalysisAlg::m_tdt
ToolHandle< Trig::TrigDecisionTool > m_tdt
Definition: RatesAnalysisAlg.h:264
AthHistogramming::m_histMap
HistMap_t m_histMap
The map of histogram names to their pointers.
Definition: AthHistogramming.h:201
AthAnalysisAlgorithm::endInputFile
virtual StatusCode endInputFile()
Function called as an input file is being closed.
Definition: AthAnalysisAlgorithm.cxx:122
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
RatesAnalysisAlg::newTrigger
StatusCode newTrigger(const std::string &name, const double prescale=1., const double expressPrescale=-1., const std::string &seedName="", const double seedPrecale=1., const std::string &groups="", const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
Version of newTrigger which accepts a set of group names rather than a comma separated string.
Definition: RatesAnalysisAlg.cxx:88
RatesGroup::removeFromGroup
void removeFromGroup(const RatesTrigger *toRemove)
Remove a trigger from this group.
Definition: RatesGroup.cxx:67
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
RatesAnalysisAlg::m_enableLumiExtrapolation
Gaudi::Property< bool > m_enableLumiExtrapolation
Definition: RatesAnalysisAlg.h:276
RatesAnalysisAlg::m_lowerTrigger
std::unordered_map< std::string, std::string > m_lowerTrigger
Map of triggers lower chain, to tell if a HLT trigger ran or not.
Definition: RatesAnalysisAlg.h:254
RatesAnalysisAlg::ratesExecute
virtual StatusCode ratesExecute()=0
To be implemented by the user.
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
AthAnalysisAlgorithm::firstExecute
virtual StatusCode firstExecute()
Function called when first execute is encountered user can read event information with evtStore()
Definition: AthAnalysisAlgorithm.cxx:139
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
AthHistogramAlgorithm::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
Definition: AthHistogramAlgorithm.h:83
StandaloneBunchgroupHandler.bg
bg
Definition: StandaloneBunchgroupHandler.py:243
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::HLTMenu
HLT menu configuration.
Definition: HLTMenu.h:21
AthHistogramming::book
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Definition: AthHistogramming.h:303
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RatesAnalysisAlg::m_scanTriggers
std::unordered_map< std::string, std::unique_ptr< RatesScanTrigger > > m_scanTriggers
All individual rates-scan triggers (L1 or HLT)
Definition: RatesAnalysisAlg.h:242
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
RatesAnalysisAlg::checkGotTDT
StatusCode checkGotTDT()
Internal check that the TDT is fetched.
Definition: RatesAnalysisAlg.cxx:310
RatesAnalysisAlg::newScanTrigger
StatusCode newScanTrigger(const std::string &name, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins=100, const RatesScanTrigger::TriggerBehaviour_t behaviour=RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold, const double prescale=1., const std::string &seedName="", const double seedPrecale=1., const Method_t method=kMANUAL, const ExtrapStrat_t extrapolation=kLINEAR)
Register a new threshold scan trigger which plots rate as a function of some dependent variable.
Definition: RatesAnalysisAlg.cxx:39
WeightingValuesSummary_t::m_isUnbiased
bool m_isUnbiased
If the event was taken online with a RD trigger.
Definition: RatesHistoBase.h:60
RatesAnalysisAlg::m_l2GroupName
const std::string m_l2GroupName
Definition: RatesAnalysisAlg.h:260
RatesGroup::setUseCachedWeights
void setUseCachedWeights(const bool i)
Set to use cached weights from the Master group (need ptr to m_masterGroup)
Definition: RatesGroup.cxx:188
RunTileMonitoring.groupName
groupName
Definition: RunTileMonitoring.py:158
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
AthAnalysisAlgorithm::m_inputMetaStore
ServiceHandle< StoreGateSvc > m_inputMetaStore
Object accessing the input metadata store.
Definition: AthAnalysisAlgorithm.h:116
RatesAnalysisAlg::m_bcidHist
TH1D * m_bcidHist
Histogram of the BCIDs distribution of the processing.
Definition: RatesAnalysisAlg.h:291
WeightingValuesSummary_t::m_eventLumi
double m_eventLumi
The instantaneous lumi in cm-2s-1.
Definition: RatesHistoBase.h:59
skel.it
it
Definition: skel.GENtoEVGEN.py:423
RatesAnalysisAlg::m_enhancedBiasRatesTool
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasRatesTool
Definition: RatesAnalysisAlg.h:263
RatesAnalysisAlg::ratesInitialize
virtual StatusCode ratesInitialize()=0
To be implemented by the user.
TH1D
Definition: rootspy.cxx:342
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
WeightingValuesSummary_t::print
const std::string print()
Definition: RatesHistoBase.h:69
RatesAnalysisAlg::m_expoScalingFactor
Gaudi::Property< double > m_expoScalingFactor
Definition: RatesAnalysisAlg.h:267
TrigConf::HLTPrescalesSet::prescale_express
const HLTPrescale & prescale_express(const std::string &chainName) const
HLT prescales by chain names.
Definition: HLTPrescalesSet.cxx:96
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
RatesAnalysisAlg::m_groups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_groups
All regular and CPS groups.
Definition: RatesAnalysisAlg.h:243
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
RatesAnalysisAlg::m_ratesDenominator
double m_ratesDenominator
How much walltime is seen by the algorithm.
Definition: RatesAnalysisAlg.h:286
WeightingValuesSummary_t::m_linearLumiFactor
double m_linearLumiFactor
What weight needs to be applied to extrapolate rates linear in mu and bunches.
Definition: RatesHistoBase.h:66
WeightingValuesSummary_t::m_distanceInTrain
uint32_t m_distanceInTrain
How far into the bunch train the event was, in bunch crossings.
Definition: RatesHistoBase.h:61
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
RatesAnalysisAlg::m_doUniqueRates
Gaudi::Property< bool > m_doUniqueRates
Definition: RatesAnalysisAlg.h:269
RatesAnalysisAlg::m_globalGroups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_globalGroups
Big (master) groups which do the OR of the whole menu.
Definition: RatesAnalysisAlg.h:244
RatesAnalysisAlg::m_targetMu
double m_targetMu
What pileup level the prediction is targeting.
Definition: RatesAnalysisAlg.h:282
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
AthAnalysisAlgorithm::inputMetaStore
const ServiceHandle< StoreGateSvc > & inputMetaStore() const
Const accessor for the input metadata store.
Definition: AthAnalysisAlgorithm.h:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
RatesAnalysisAlg::m_autoTriggers
std::vector< std::string > m_autoTriggers
List of triggers which it is up to us to the algorithm to work out the pass/fail for.
Definition: RatesAnalysisAlg.h:251
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
AthAnalysisAlgorithm::AthAnalysisAlgorithm
AthAnalysisAlgorithm(const std::string &name)
Constructor taking just a name.
Definition: AthAnalysisAlgorithm.cxx:19
AthHistogramming::m_histNamePostfix
std::string m_histNamePostfix
The postfix for the histogram THx name.
Definition: AthHistogramming.h:235
RatesAnalysisAlg::kEXISTING
@ kEXISTING
The pass/fail decision is taken from the Trigger Decision Tool for an existing trigger.
Definition: RatesAnalysisAlg.h:47
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
H5Utils::getTree
std::string getTree(const std::string &file_name)
Definition: getTree.cxx:36
RatesTrigger::setUniqueGroup
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
Definition: RatesTrigger.cxx:161
ExtrapStrat_t
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
Definition: RatesHistoBase.h:30
RatesAnalysisFullMenu.prescales
prescales
Definition: RatesAnalysisFullMenu.py:119
RatesAnalysisAlg::setTargetMuBunches
void setTargetMuBunches(const double mu, const int32_t bunches)
Set the target mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:749
RatesAnalysisAlg::m_prescalesJSON
Gaudi::Property< std::map< std::string, std::map< std::string, double > > > m_prescalesJSON
Definition: RatesAnalysisAlg.h:279
RatesAnalysisAlg::kAUTO
@ kAUTO
The pass/fail decision is automatically emulated per event based on decoding the trigger name.
Definition: RatesAnalysisAlg.h:46
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
AthAnalysisAlgorithm::m_doneFirstEvent
bool m_doneFirstEvent
Definition: AthAnalysisAlgorithm.h:122
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
RatesAnalysisAlg::m_weightedEventCounter
double m_weightedEventCounter
Count how many weighted events were processed.
Definition: RatesAnalysisAlg.h:288
RatesTrigger
Used to calculate the rate for a single trigger at L1 or the HLT.
Definition: RatesTrigger.h:15
RatesGroup
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
Definition: RatesGroup.h:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
WeightingValuesSummary_t::m_enhancedBiasWeight
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
Definition: RatesHistoBase.h:57
RatesAnalysisAlg::executeTriggerEmulation
StatusCode executeTriggerEmulation()
Internal call to get the pass/fail for all automatically emulated triggers.
Definition: RatesAnalysisAlg.cxx:667
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
RatesAnalysisAlg::addExisting
StatusCode addExisting(const std::string pattern)
Register some existing triggers based on wild-card match, e.g.
Definition: RatesAnalysisAlg.cxx:194
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RatesTrigger::setSeedsFromRandom
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
Definition: RatesTrigger.cxx:143
Trk::active
@ active
Definition: Layer.h:48
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigConf::HLTPrescalesSet::prescale
const HLTPrescale & prescale(const std::string &chainName) const
HLT prescales by chain names.
Definition: HLTPrescalesSet.cxx:85
RatesTrigger::setCPS
void setCPS(const std::string &group)
If I'm in a CPS group, set the group name (I'll keep a copy of the hash)
Definition: RatesTrigger.cxx:165
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
RatesAnalysisAlg::m_metadataTree
TTree * m_metadataTree
Used to write out some metadata needed by post-processing (e.g.
Definition: RatesAnalysisAlg.h:293
RatesAnalysisAlg::m_targetBunches
double m_targetBunches
How many bunches the prediction is targeting.
Definition: RatesAnalysisAlg.h:283
RatesAnalysisAlg::setTargetLumiBunches
void setTargetLumiBunches(const double lumi, const int32_t bunches)
Set the target instantaneous luminosity and number of bunches.
Definition: RatesAnalysisAlg.cxx:732
TH3
Definition: rootspy.cxx:440
calibdata.exception
exception
Definition: calibdata.py:496
RatesAnalysisAlg::isCPS
bool isCPS(const std::string &group) const
String match coherent prescale groups.
Definition: RatesAnalysisAlg.cxx:792
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
RatesAnalysisAlg::m_uniqueGroups
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_uniqueGroups
Groups used to obtain unique rates for chains.
Definition: RatesAnalysisAlg.h:245
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:20
RatesAnalysisAlg::m_weightingValues
WeightingValuesSummary_t m_weightingValues
Possible weighting & lumi extrapolation values for the current event.
Definition: RatesAnalysisAlg.h:295
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
WeightingValuesSummary_t::m_expoMuFactor
double m_expoMuFactor
What weight needs to be applied to extrapolate rates linear in bunches and exponential in mu.
Definition: RatesHistoBase.h:67
RatesTrigger::getCPSID
size_t getCPSID() const
Get the hash of my CPS group name.
Definition: RatesTrigger.cxx:167
RatesAnalysisAlg::kMANUAL
@ kMANUAL
The pass/fail decision is evaluated by the user and supplied per event using setTriggerDesicison.
Definition: RatesAnalysisAlg.h:45
RatesAnalysisAlg::m_doHistograms
Gaudi::Property< bool > m_doHistograms
Definition: RatesAnalysisAlg.h:275
AthAnalysisAlgorithm::metaDataStop
virtual StatusCode metaDataStop()
Function called before finalize user can read output metadata from outputMetaStore()
Definition: AthAnalysisAlgorithm.cxx:130
AthHistogramming::m_graphMap
GraphMap_t m_graphMap
The map of TGraph names to their pointers.
Definition: AthHistogramming.h:222
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthHistogramming::m_streamName
std::string m_streamName
Name of the ROOT output stream (file)
Definition: AthHistogramming.h:226
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
RatesGroup::removeOtherL1
void removeOtherL1(const RatesTrigger *toKeep)
Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
Definition: RatesGroup.cxx:72
RatesAnalysisAlg::m_activeGroups
std::unordered_set< RatesGroup * > m_activeGroups
All groups which are enabled (PS >= 1)
Definition: RatesAnalysisAlg.h:249
AthHistogramming::hash_t
uint32_t hash_t
typedef for the internal hash
Definition: AthHistogramming.h:169
TH2
Definition: rootspy.cxx:373
CxxUtils::crc64
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
Definition: crc64.cxx:696
RatesAnalysisAlg::printTarget
void printTarget() const
Print the target instantaneous luminosity, mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:770
TrigConf::HLTMenu::begin
const_iterator begin() const
Begin of the HLT chains list.
Definition: HLTMenu.cxx:51
RatesAnalysisAlg::isRandomSeed
bool isRandomSeed(const std::string &me, const std::string &seed) const
String match random L1 items.
Definition: RatesAnalysisAlg.cxx:796
EnhancedBiasWeighter::FULL_RING
constexpr static uint32_t FULL_RING
Number of bunches in a full ring.
Definition: EnhancedBiasWeighter.h:56
AthHistogramming::m_histTitlePostfix
std::string m_histTitlePostfix
The postfix for the histogram THx title.
Definition: AthHistogramming.h:241
RatesTrigger::getDisabled
bool getDisabled() const
If I or my seed were prescaled out.
Definition: RatesTrigger.cxx:159
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition: L1PrescalesSet.h:19
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
WeightingValuesSummary_t::m_bunchFactor
double m_bunchFactor
What weight needs to be applied to extrapolate rates linear in number of bunches.
Definition: RatesHistoBase.h:64
TrigConf::HLTMenu::size
std::size_t size() const
Accessor to the number of HLT chains.
Definition: HLTMenu.cxx:35
TrigConf::ConstIter
Forward iterator over an iterable of type V returning an object of type T.
Definition: ConstIter.h:32
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TrigConf::BunchGroupSet::bunchGroups
const std::vector< BunchGroup > & bunchGroups() const
Definition: BunchGroupSet.h:27
RatesAnalysisAlg::m_activatedTriggers
std::unordered_set< RatesTrigger * > m_activatedTriggers
Triggers which were changed & hence need to be reset at the event end.
Definition: RatesAnalysisAlg.h:247
RatesAnalysisAlg::m_doExpressRates
Gaudi::Property< bool > m_doExpressRates
Definition: RatesAnalysisAlg.h:272
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
RatesHistoBase::isZero
static bool isZero(double v)
Definition: RatesHistoBase.h:103
EnhancedBiasWeighter::LHC_FREQUENCY
constexpr static double LHC_FREQUENCY
Definition: EnhancedBiasWeighter.h:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
threshold
Definition: chainparser.cxx:74
RatesAnalysisAlg::m_scalingHist
TH1D * m_scalingHist
One-bin histogram to store the normalisation of the sample, for use in later combinations.
Definition: RatesAnalysisAlg.h:290
AthHistogramming::hash
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
Definition: AthHistogramming.h:428
RatesAnalysisAlg::setTargetLumi
void setTargetLumi(const double lumi)
Set the target instantaneous luminosity.
Definition: RatesAnalysisAlg.h:174
RatesAnalysisAlg::executeTrigDecisionToolTriggers
StatusCode executeTrigDecisionToolTriggers()
Internal call to get the pass/fail for all TDT triggers.
Definition: RatesAnalysisAlg.cxx:654
module_driven_slicing.getHist
def getHist(name, makehist)
Definition: module_driven_slicing.py:121
AthHistogramAlgorithm::sysInitialize
virtual StatusCode sysInitialize()
Initialization method invoked by the framework.
Definition: AthHistogramAlgorithm.cxx:75
RatesGroup::setUniqueTrigger
void setUniqueTrigger(RatesTrigger *trigger)
Set trigger I am doing unique rates for.
Definition: RatesGroup.cxx:196
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
RatesAnalysisAlg::checkExistingTrigger
StatusCode checkExistingTrigger(const std::string &name, const std::string &seedName)
Internal function to check if a supplied HLT trigger and L1 seed match what is stored in the AOD conf...
Definition: RatesAnalysisAlg.cxx:325
RatesAnalysisAlg::writeMetadata
void writeMetadata()
Write to outpute tree (if any) the metadata needed downstream.
Definition: RatesAnalysisAlg.cxx:809
xxh3::hash64
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
Definition: XXH.cxx:9
RatesAnalysisAlg::m_triggers
std::unordered_map< std::string, std::unique_ptr< RatesTrigger > > m_triggers
All individual triggers (L1 or HLT)
Definition: RatesAnalysisAlg.h:241
RatesAnalysisAlg::getLevel
uint32_t getLevel(const std::string &name) const
String match to a trigger level.
Definition: RatesAnalysisAlg.cxx:803
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthAnalysisAlgorithm::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened user can read input metadata from inputMetaStore()
Definition: AthAnalysisAlgorithm.cxx:114
RatesAnalysisAlg::m_configSvc
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
Definition: RatesAnalysisAlg.h:265
lumiFormat.lumi
lumi
Definition: lumiFormat.py:113
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
RatesAnalysisAlg::printInputSummary
void printInputSummary() const
Print the input data instantaneous luminosity, mu and number of bunches.
Definition: RatesAnalysisAlg.cxx:782
a
TList * a
Definition: liststreamerinfos.cxx:10
AthHistogramming::m_effMap
EffMap_t m_effMap
The map of histogram names to their pointers.
Definition: AthHistogramming.h:208
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
h
AthHistogramming::m_histTitlePrefix
std::string m_histTitlePrefix
The prefix for the histogram THx title.
Definition: AthHistogramming.h:238
RatesAnalysisAlg::m_l1GroupName
const std::string m_l1GroupName
Definition: RatesAnalysisAlg.h:259
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
RatesAnalysisAlg::m_lowestPrescale
std::unordered_map< size_t, double > m_lowestPrescale
Lowest prescale within a CPS group, key is the hash of the CPS group name.
Definition: RatesAnalysisAlg.h:250
TH1
Definition: rootspy.cxx:268
DEBUG
#define DEBUG
Definition: page_access.h:11
RatesAnalysisAlg::m_l1ItemID
std::vector< std::vector< std::string > > m_l1ItemID
Definition: RatesAnalysisAlg.h:257
AthHistogramming::m_treeMap
TreeMap_t m_treeMap
The map of TTree names to their pointers.
Definition: AthHistogramming.h:215
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:353
AthHistogramming::m_histNamePrefix
std::string m_histNamePrefix
The prefix for the histogram THx name.
Definition: AthHistogramming.h:232
TrigConf::L1PrescalesSet::prescales
const std::map< std::string, L1Prescale > & prescales() const
Definition: L1PrescalesSet.cxx:58
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
RatesAnalysisAlg::ratesFinalize
virtual StatusCode ratesFinalize()=0
To be implemented by the user.
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthHistogramming::hist
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
Definition: AthHistogramming.cxx:198
TrigConf::HLTPrescalesSet::HLTPrescale::enabled
bool enabled
Definition: HLTPrescalesSet.h:23
RatesAnalysisAlg::m_existingTriggers
std::unordered_map< std::string, const Trig::ChainGroup * > m_existingTriggers
Map of triggers which we ask the TDT ChainGroup for the pass/fail.
Definition: RatesAnalysisAlg.h:253
AthHistogramming::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the THistSvc (event store by default)
Definition: AthHistogramming.h:194
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
str
Definition: BTagTrackIpAccessor.cxx:11
ValidateEBMenu.seedName
seedName
Definition: ValidateEBMenu.py:100
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
RatesAnalysisAlg::m_vetoStartOfTrain
Gaudi::Property< uint32_t > m_vetoStartOfTrain
Definition: RatesAnalysisAlg.h:277
WeightingValuesSummary_t::m_muFactor
double m_muFactor
What weight needs to be applied to extrapolate rates linear in mu.
Definition: RatesHistoBase.h:65
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AthAnalysisAlgorithm::m_outputMetaStore
ServiceHandle< StoreGateSvc > m_outputMetaStore
Object accessing the output metadata store.
Definition: AthAnalysisAlgorithm.h:118
RatesAnalysisAlg::m_doTriggerGroups
Gaudi::Property< bool > m_doTriggerGroups
Definition: RatesAnalysisAlg.h:271
TrigConf::Chain
HLT chain configuration.
Definition: TrigConfData/TrigConfData/HLTChain.h:18
RatesAnalysisAlg::m_useBunchCrossingData
Gaudi::Property< bool > m_useBunchCrossingData
Definition: RatesAnalysisAlg.h:273
AthHistogramming::m_name
std::string m_name
Instance name.
Definition: AthHistogramming.h:245
RatesAnalysisAlg::m_targetLumi
double m_targetLumi
What instantaneous luminosity the prediction is targeting.
Definition: RatesAnalysisAlg.h:284
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition: HLTPrescalesSet.h:19
RatesAnalysisAlg::m_eventCounter
uint32_t m_eventCounter
Count how many events processed.
Definition: RatesAnalysisAlg.h:287
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.compressB64.c
def c
Definition: compressB64.py:93
RatesAnalysisAlg::setTriggerDesicison
StatusCode setTriggerDesicison(const std::string &name, const bool triggerIsPassed=true, const bool triggerIsActive=true)
Set the pass/fail decision for an item.
Definition: RatesAnalysisAlg.cxx:342
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TrigConf::HLTMenu::end
const_iterator end() const
End of the HLT chains list.
Definition: HLTMenu.cxx:57
RatesAnalysisAlg::m_inelasticCrossSection
Gaudi::Property< double > m_inelasticCrossSection
Definition: RatesAnalysisAlg.h:268
RatesAnalysisAlg::m_doGlobalGroups
Gaudi::Property< bool > m_doGlobalGroups
Definition: RatesAnalysisAlg.h:270
RatesAnalysisAlg::m_hltChainIDGroup
std::vector< std::vector< std::string > > m_hltChainIDGroup
Definition: RatesAnalysisAlg.h:256
fitman.k
k
Definition: fitman.py:528
PhysDESDM_Quirks.trigger
trigger
Definition: PhysDESDM_Quirks.py:27
RatesAnalysisAlg::isZero
bool isZero(double v) const
Helper function for floating point subtraction.
Definition: RatesAnalysisAlg.h:239
AthAnalysisHelper::retrieveMetadata
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
Definition: AthAnalysisHelper.h:254
AthHistogramming::buildBookingString
void buildBookingString(std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false)
Method to build individual booking string.
Definition: AthHistogramming.cxx:560
ServiceHandle< IIncidentSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
RatesGroup::duplicateChildren
void duplicateChildren(const RatesGroup *toDuplicate)
Copy in triggers from another group.
Definition: RatesGroup.cxx:190
AthHistogramming::bookGetPointer
TH1 * bookGetPointer(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Definition: AthHistogramming.h:260
kNONE
@ kNONE
Do not scale this trigger for changes in luminosity.
Definition: RatesHistoBase.h:35
RatesAnalysisAlg::m_expressTriggers
std::unordered_set< RatesTrigger * > m_expressTriggers
Triggers with non-zero express PS, used to print them at the end.
Definition: RatesAnalysisAlg.h:248
WeightingValuesSummary_t::m_eventMu
double m_eventMu
The actual number of interactions in the event.
Definition: RatesHistoBase.h:58