Typesetting math: 100%
ATLAS Offline Software
#include <L1TopoRatesCalculator.h >
L1TopoRatesCalculator (const std::string &name , ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
Get the trigger decision tool and set up global groups. More...
virtual StatusCode ratesInitialize () override
To be implemented by the user. More...
virtual StatusCode ratesExecute () override
To be implemented by the user. More...
virtual StatusCode ratesFinalize () override
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
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...
TH1 * bookGetPointer (const TH1 &hist , const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms. More...
TH1 * bookGetPointer (TH1 *hist , const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms. More...
TH1 * bookGetPointer (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...
TH1 * hist (const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type. More...
TH2 * hist2d (const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered 2-d histograms. More...
TH3 * hist3d (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...
uint32_t extractResult (const std::vector< uint32_t > &connectorContents, const L1TopoRatesCalculator::ResultDefinition &definition, unsigned int startOffset)
uint32_t getHWvalue (const L1TopoRatesCalculator::ResultDefinition &definition)
bool getTOBblockFromProcessor (const std::vector< uint32_t > &allDataBlock, std::vector< uint32_t > &tobBlock, uint32_t fpgaPattern)
uint32_t L1TopoSimResultsContainer_decoder (const L1TopoRatesCalculator::ResultDefinition &definition, SG::ReadHandle < xAOD::L1TopoSimResultsContainer > &cont)
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...
TH2D * m_ratesMatrixHist {}
Gaudi::Property< std::vector< std::string > > m_L1_items_json {this, "m_L1_items_json", {}, "L1 trigger items"}
Gaudi::Property< std::vector< std::string > > m_userDefinedNames {this, "m_userDefinedNames", {}, "user Defined Names"}
Gaudi::Property< std::vector< std::string > > m_userDefinedDefinitions {this, "m_userDefinedDefinitions", {}, "user Defined definitions"}
std::unordered_map< std::string, std::string > m_userDefinedMap
std::vector< std::string > m_L1_items
std::vector< std::string > m_L1_item_definitions
std::vector< std::string > m_beforeCTP_triggers
std::vector< std::string > m_beforeCTP_triggers_mult
std::vector< ResultDefinition > m_definitions
std::vector< std::vector< double > > m_rates_matrix
std::vector< std::vector< double > > m_rates_matrix2
std::vector< double > m_denominator
double m_weighted_sum {}
std::map< std::string, TriggerInfo > m_triggerMap
Gaudi::Property< float > m_lumi {this, "TargetLuminosity", 2e34, "Targer inst. luminosity, assuming full ring."}
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< IEnhancedBiasWeighter > m_enhancedBiasRatesTool {this, "EnhancedBiasRatesTool", "EnhancedBiasWeighter /EnhancedBiasRatesTool"}
ToolHandle< Trig::TrigDecisionTool > m_tdt {this, "TrigDecisionTool", "Trig::TrigDecisionTool /TrigDecisionTool"}
ServiceHandle < TrigConf::ITrigConfigSvc > m_configSvc {this, "TrigConfigSvc", "TrigConf::xAODConfigSvc "}
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_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...
uint32_t m_eventCounter
Count how many events processed. More...
double m_weightedEventCounter
Count how many weighted events were processed. More...
TH1D * m_scalingHist
One-bin histogram to store the normalisation of the sample, for use in later combinations. More...
TH1D * m_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...
ServiceHandle < StoreGateSvc > m_inputMetaStore
Object accessing the input metadata store. More...
ServiceHandle < StoreGateSvc > m_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...
Definition at line 30 of file L1TopoRatesCalculator.h .
◆ EffMap_t
◆ GraphMap_t
◆ hash_t
◆ HistMap_t
◆ StoreGateSvc_t
◆ TreeMap_t
◆ 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 43 of file RatesAnalysisAlg.h .
◆ L1TopoRatesCalculator()
L1TopoRatesCalculator::L1TopoRatesCalculator
(
const std::string &
name ,
ISvcLocator *
pSvcLocator
)
◆ addAllExisting()
StatusCode RatesAnalysisAlg::addAllExisting
(
)
inherited
Register all existing triggers in the AOD into the rates algorithm.
Definition at line 189 of file RatesAnalysisAlg.cxx .
◆ addExisting()
StatusCode RatesAnalysisAlg::addExisting
(
const std::string &
pattern )
inherited
Register some existing triggers based on wild-card match, e.g.
"L1_.*" for all L1.
Parameters
pattern Wild-card string to match in trigger name
Definition at line 194 of file RatesAnalysisAlg.cxx .
204 for (
auto &
p : hltPrescalesSet.
data ().get_child(
"prescales" ) ) {
209 ATH_MSG_WARNING (
"Trigger " <<
p .first <<
" disabled in supplied AOD file. DISABLING" );
215 for (
auto &
p : l1PrescalesSet.
prescales () ) {
216 if ((!
m_prescalesJSON .value().count(
p .first) && !runWithPrescaleJSON) ||
p .second.prescale < 0){
219 if (
p .second.prescale < 0){
220 ATH_MSG_WARNING (
"Trigger " <<
p .first <<
" disabled in supplied AOD file. DISABLING" );
226 for (
const auto & trigger :
triggers ) {
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." );
234 const std::string lowerName = (isHLT ? trigConf->lower_chain_name() :
"" );
235 std::set<std::string>
groups = std::set<std::string>();
239 if (lowerName.find(
"," ) != std::string::npos) {
240 ATH_MSG_WARNING (
"Can not add " << trigger <<
" due to multiple L1 seeds." );
244 if (lowerName.empty()) {
245 ATH_MSG_WARNING (
"Can not add " << trigger <<
" due to multiple L1 seeds: L1All" );
250 if (trigConf->prescale() < 1.) {
251 ATH_MSG_DEBUG (
"Will not add " << trigger <<
", it was disabled in the reprocessing." );
264 std::vector<std::string> chainGroups = (*chain).groups();
265 std::vector<std::string> chainStreams = (*chain).streams();
267 ATH_MSG_DEBUG (
" chain " << trigger <<
" has " << chainGroups.size() <<
" groups and " << chainStreams.size() <<
" streams" );
269 groups .insert(chainGroups.begin(), chainGroups.end());
270 for (
const std::string&
stream : chainStreams){
276 double prescale = 1., expressPrescale = -1., lowerPrescale = 1.;
279 ATH_MSG_WARNING (
"Unable to find " << trigger <<
" in supplied JSON. DISABLING." );
287 ATH_MSG_WARNING (
"Unable to find " << trigger <<
"'s seed, " << lowerName <<
", in supplied JSON. DISABLING." );
297 ATH_MSG_DEBUG (
"Registering existing trigger " << trigger <<
" for automatic TDT based rates prediction." );
303 ATH_MSG_WARNING (
"Trigger " << trigger.first <<
" in supplied JSON is NOT AVAILABLE in the supplied AOD file." );
307 return StatusCode::SUCCESS;
◆ beginInputFile()
StatusCode AthAnalysisAlgorithm::beginInputFile
(
)
protected virtual inherited
◆ book() [1/8]
StatusCode AthHistogramming::book
(
const TEfficiency &
eff ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 335 of file AthHistogramming.h .
338 TEfficiency* effClone =
dynamic_cast< TEfficiency*
> (
eff .Clone() );
340 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone" <<
endmsg ;
341 return StatusCode::FAILURE;
◆ book() [2/8]
StatusCode AthHistogramming::book
(
const TGraph &
graphRef ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
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 = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 303 of file AthHistogramming.h .
306 TH1* histClone =
dynamic_cast< TH1*
> (
hist .Clone() );
308 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone" <<
endmsg ;
309 return StatusCode::FAILURE;
311 return this->
book ( *histClone, tDir,
stream );
◆ book() [4/8]
StatusCode AthHistogramming::book
(
const TTree &
treeRef ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 403 of file AthHistogramming.h .
409 return StatusCode::SUCCESS;
413 return StatusCode::FAILURE;
◆ book() [5/8]
StatusCode AthHistogramming::book
(
TEfficiency &
effRef ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 356 of file AthHistogramming.h .
361 m_msg << MSG::ERROR <<
"Couldn't book a TEfficiency" <<
endmsg ;
362 return StatusCode::FAILURE;
364 return StatusCode::SUCCESS;
◆ book() [6/8]
StatusCode AthHistogramming::book
(
TEfficiency *
eff ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 346 of file AthHistogramming.h .
349 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency" <<
endmsg ;
350 return StatusCode::FAILURE;
◆ book() [7/8]
StatusCode AthHistogramming::book
(
TH1 &
histRef ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 324 of file AthHistogramming.h .
328 if ( !histPointer ) {
329 m_msg << MSG::ERROR <<
"Couldn't book a TH1" <<
endmsg ;
330 return StatusCode::FAILURE;
332 return StatusCode::SUCCESS;
◆ book() [8/8]
StatusCode AthHistogramming::book
(
TH1 *
hist ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 314 of file AthHistogramming.h .
317 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1" <<
endmsg ;
318 return StatusCode::FAILURE;
◆ bookGetPointer() [1/8]
TEfficiency * AthHistogramming::bookGetPointer
(
const TEfficiency &
eff ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 281 of file AthHistogramming.h .
284 TEfficiency* histClone =
dynamic_cast< TEfficiency*
> (
hist .Clone() );
286 m_msg << MSG::ERROR <<
"Couldn't create a TEfficiency clone in bookGetPointer" <<
endmsg ;
◆ bookGetPointer() [2/8]
TGraph * AthHistogramming::bookGetPointer
(
const TGraph &
graphRef ,
std::string
tDir = ""
,
std::string
stream = ""
)
protected inherited
Simplify the booking and registering (into THistSvc) of TGraphs.
Definition at line 427 of file AthHistogramming.cxx .
430 const TGraph* graphPointer = &graphRef;
435 m_msg << MSG::WARNING
436 <<
"We got an invalid TGraph pointer in the BookGetPointer(TGraph*) method of the class" <<
m_name
442 std::string graphName = graphPointer->GetName();
443 const std::string graphTitle = graphPointer->GetTitle();
446 const hash_t graphHash = this->
hash (graphName);
447 GraphMap_t::const_iterator
it =
m_graphMap .find( graphHash );
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 ;
461 m_msg << MSG::WARNING
462 <<
"We couldn't clone the TGraph in the BookGetPointer(TGraph&) method of the class" <<
m_name
469 std::string bookingString(
"" );
473 if ( !((
histSvc ()->regGraph(bookingString, graphClone)).isSuccess()) )
475 m_msg << MSG::WARNING
476 <<
"Problem registering TGraph with name " << graphName
477 <<
", title " << graphTitle
483 m_graphMap .insert(
m_graphMap .end(), std::pair< const hash_t, TGraph* >( graphHash, graphClone ) );
◆ bookGetPointer() [3/8]
TH1 * AthHistogramming::bookGetPointer
(
const TH1 &
hist ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 260 of file AthHistogramming.h .
263 TH1* histClone =
dynamic_cast< TH1*
> (
hist .Clone() );
265 m_msg << MSG::ERROR <<
"Couldn't create a TH1 clone in bookGetPointer" <<
endmsg ;
◆ bookGetPointer() [4/8]
TTree * AthHistogramming::bookGetPointer
(
const TTree &
treeRef ,
std::string
tDir = ""
,
std::string
stream = ""
)
protected inherited
Simplify the booking and registering (into THistSvc) of TTrees.
Definition at line 312 of file AthHistogramming.cxx .
315 const TTree* treePointer = &treeRef;
320 m_msg << MSG::WARNING
321 <<
"We got an invalid TTree pointer in the BookGetPointer(TTree*) method of the class" <<
m_name
327 std::string
treeName = treePointer->GetName();
328 const std::string treeTitle = treePointer->GetTitle();
332 TreeMap_t::const_iterator
it =
m_treeMap .find( treeHash );
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 ;
343 TTree* treeClone =
dynamic_cast< TTree*
> ( treePointer->Clone(
treeName .c_str()) );
346 m_msg << MSG::WARNING
347 <<
"We couldn't clone the TTree in the BookGetPointer(TTree&) method of the class" <<
m_name
351 treeClone->SetTitle (treeTitle.c_str());
354 std::string bookingString(
"" );
358 if ( !((
histSvc ()->regTree(bookingString, treeClone)).isSuccess()) )
360 m_msg << MSG::WARNING
361 <<
"Problem registering TTree with name " <<
treeName
362 <<
", title " << treeTitle
368 m_treeMap .insert(
m_treeMap .end(), std::pair< const hash_t, TTree* >( treeHash, treeClone ) );
◆ bookGetPointer() [5/8]
TEfficiency * AthHistogramming::bookGetPointer
(
TEfficiency &
effRef ,
std::string
tDir = ""
,
std::string
stream = ""
)
protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 146 of file AthHistogramming.cxx .
149 std::string effName(effRef.GetName());
150 const std::string effTitle(effRef.GetTitle());
151 std::string bookingString(
"" );
155 effRef.SetName(effName.c_str());
159 EffMap_t::const_iterator
it =
m_effMap .find( effHash );
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 ;
175 if ( !((
histSvc ()->regEfficiency(bookingString, &effRef)).isSuccess()) )
177 m_msg << MSG::WARNING
178 <<
"Problem registering TEfficiency with name " << effName
180 <<
", title " << effTitle
188 m_effMap .insert(
m_effMap .end(), std::pair< const hash_t, TEfficiency* >( effHash, &effRef ) );
◆ bookGetPointer() [6/8]
TEfficiency * AthHistogramming::bookGetPointer
(
TEfficiency *
eff ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of TEfficiency.
Definition at line 293 of file AthHistogramming.h .
296 m_msg << MSG::ERROR <<
"Got a zero pointer to a TEfficiency in bookGetPointer" <<
endmsg ;
◆ bookGetPointer() [7/8]
TH1 * AthHistogramming::bookGetPointer
(
TH1 &
histRef ,
std::string
tDir = ""
,
std::string
stream = ""
)
protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 98 of file AthHistogramming.cxx .
101 std::string
histName (histRef.GetName());
102 const std::string histTitle(histRef.GetTitle());
103 std::string bookingString(
"" );
111 HistMap_t::const_iterator
it =
m_histMap .find( histHash );
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 ;
127 if ( !((
histSvc ()->regHist(bookingString, &histRef)).isSuccess()) )
129 m_msg << MSG::WARNING
130 <<
"Problem registering histogram with name " <<
histName
132 <<
", title " << histTitle
140 m_histMap .insert(
m_histMap .end(), std::pair< const hash_t, TH1* >( histHash, &histRef ) );
◆ bookGetPointer() [8/8]
TH1 * AthHistogramming::bookGetPointer
(
TH1 *
hist ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the booking and registering (into THistSvc) of histograms.
Definition at line 272 of file AthHistogramming.h .
275 m_msg << MSG::ERROR <<
"Got a zero pointer to a TH1 in bookGetPointer" <<
endmsg ;
◆ buildBookingString()
void AthHistogramming::buildBookingString
(
std::string &
bookingString ,
std::string &
histName ,
std::string &
tDir ,
std::string &
stream ,
bool
usePrefixPostfix = false
)
private inherited
Method to build individual booking string.
Definition at line 560 of file AthHistogramming.cxx .
569 if (
pos != std::string::npos){
576 if (usePrefixPostfix){
581 while (bookingString.find(
"//" ) != std::string::npos){
◆ checkExistingTrigger()
StatusCode RatesAnalysisAlg::checkExistingTrigger
(
const std::string &
name ,
const std::string &
seedName
)
private inherited
Internal function to check if a supplied HLT trigger and L1 seed match what is stored in the AOD config.
Parameters
name Name of the L1 or HLT trigger.
seedName For 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 .
330 return StatusCode::FAILURE;
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;
339 return StatusCode::SUCCESS;
◆ checkGotTDT()
StatusCode RatesAnalysisAlg::checkGotTDT
(
)
private inherited
Internal check that the TDT is fetched.
Definition at line 310 of file RatesAnalysisAlg.cxx .
313 return StatusCode::FAILURE;
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." );
321 return StatusCode::SUCCESS;
◆ 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
)
protected inherited
To be called by the derived classes to fill the internal configuration.
Definition at line 66 of file AthHistogramming.cxx .
79 return StatusCode::SUCCESS;
◆ currentFile()
TFile * AthAnalysisAlgorithm::currentFile
(
const char *
evtSelName = "EventSelector"
)
final protected virtual inherited
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 .
153 SmartIF<IProperty> evtSelector{service(evtSelName,
false )};
155 ATH_MSG_ERROR (
"currentFile(): Couldn't find the service: " << evtSelName);
return 0;
160 const StringArrayProperty& inputCollectionsName =
dynamic_cast< const StringArrayProperty&
> (evtSelector->getProperty(
"InputCollections" ));
162 ATH_MSG_VERBOSE (
"nOpenFile=" << gROOT->GetListOfFiles()->GetSize() <<
". nFilesInInputCollection=" << inputCollectionsName.value().size());
164 for (
int i =0;
i <gROOT->GetListOfFiles()->GetSize();
i ++) {
165 ATH_MSG_VERBOSE (
"Open file: " << gROOT->GetListOfFiles()->At(
i )->GetName());
171 for (
int i =0;
i <gROOT->GetListOfFiles()->GetSize();
i ++) {
172 TFile *
g = (TFile*)gROOT->GetListOfFiles()->At(
i );
175 TString
s (
g ->GetName());
176 TObjArray*
tokens =
s .Tokenize(
"/" );
177 TObjString* lastToken =
dynamic_cast< TObjString*
> (
tokens ->Last());
178 TString sToCompare(
"" );
179 bool shortComparison(
false );
180 if (
tokens ->GetEntries()>1) {
181 TString beforeSlash((
dynamic_cast< TObjString*
> (
tokens ->At(
tokens ->GetEntries()-2)))->GetString());
182 if (beforeSlash.Length()>0) sToCompare += beforeSlash;
185 shortComparison=
true ;
187 sToCompare += lastToken->GetString();
188 TString sToCompare_short(lastToken->GetString());
191 for (
unsigned int j=0;j<inputCollectionsName.value().
size ();j++) {
192 TString
t (inputCollectionsName.value()[j].c_str());
195 ATH_MSG_VERBOSE (
"Current File is: " << inputCollectionsName.value()[j]);
199 TObjArray*
tokens =
t .Tokenize(
"/" );
200 TObjString* lastToken =
dynamic_cast< TObjString*
> (
tokens ->Last());
201 TString tToCompare =
"" ;
202 bool shortComparison2(
false );
203 if (
tokens ->GetEntries()>1) {
204 TString beforeSlash((
dynamic_cast< TObjString*
> (
tokens ->At(
tokens ->GetEntries()-2)))->GetString());
205 if (beforeSlash.Length()>0) tToCompare += beforeSlash;
208 shortComparison2=
true ;
210 tToCompare += lastToken->GetString();
211 TString tToCompare_short(lastToken->GetString());
214 if (shortComparison || shortComparison2) {
215 if (sToCompare_short.EqualTo(tToCompare_short)) {
216 ATH_MSG_VERBOSE (
"Current File is: " << inputCollectionsName.value()[j]);
221 if (sToCompare.EqualTo(tToCompare)) {
222 ATH_MSG_VERBOSE (
"Current File is: " << inputCollectionsName.value()[j]);
230 ATH_MSG_ERROR (
"currentFile(): Couldn't load InputCollections property of " << evtSelName);
return 0;
233 ATH_MSG_ERROR (
"currentFile(): Could not find the current file!" );
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h .
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h .
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h .
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
Parameters
name Name of the property.
hndl Object holding the property value.
doc Documentation 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 .
250 this->declare(hndl.
vhKey ());
251 hndl.
vhKey ().setOwner(
this );
253 return PBASE::declareProperty(
name ,hndl,
doc );
◆ declareProperty() [2/6]
Declare a new Gaudi property.
Parameters
name Name of the property.
hndl Object holding the property value.
doc Documentation 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 .
229 return PBASE::declareProperty(
name ,hndl,
doc );
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
Parameters
name Name of the property.
property Object holding the property value.
doc Documentation 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 .
338 return PBASE::declareProperty(
name , property,
doc );
◆ declareProperty() [5/6]
Declare a new Gaudi property.
Parameters
name Name of the property.
property Object holding the property value.
doc Documentation 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 .
◆ declareProperty() [6/6]
◆ detStore()
◆ efficiency()
TEfficiency * AthHistogramming::efficiency
(
const std::string &
effName ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
protected inherited
Simplify the retrieval of registered TEfficiency.
Definition at line 250 of file AthHistogramming.cxx .
256 EffMap_t::const_iterator
it =
m_effMap .find( effHash );
261 std::string effNameCopy = effName;
262 std::string tDirCopy = tDir;
263 std::string streamCopy =
stream ;
266 std::string bookingString(
"" );
269 TEfficiency* effPointer(NULL);
270 if ( !((
histSvc ()->getEfficiency(bookingString, effPointer)).isSuccess()) )
273 std::string bookingString(
"" );
276 if ( !((
histSvc ()->getEfficiency(bookingString, effPointer)).isSuccess()) )
278 m_msg << MSG::WARNING
279 <<
"Problem retrieving the TEfficiency with name (including pre- and post-fixes) "
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 ;
288 m_effMap .insert(
m_effMap .end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
293 m_effMap .insert(
m_effMap .end(), std::pair< const hash_t, TEfficiency* >( effHash, effPointer ) );
◆ endInputFile()
StatusCode AthAnalysisAlgorithm::endInputFile
(
)
protected virtual inherited
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 .
125 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode RatesAnalysisAlg::execute
(
)
private virtual inherited
In first call - register all triggers.
Then load event weighting parameters, fill trigger decisions, compute group rates.
Definition at line 586 of file RatesAnalysisAlg.cxx .
649 setFilterPassed(
true );
650 return StatusCode::SUCCESS;
◆ executeTrigDecisionToolTriggers()
StatusCode RatesAnalysisAlg::executeTrigDecisionToolTriggers
(
)
private inherited
Internal call to get the pass/fail for all TDT triggers.
Definition at line 653 of file RatesAnalysisAlg.cxx .
655 const bool passed = trigger.second->isPassed();
659 const std::unordered_map<std::string, const Trig::ChainGroup*>::const_iterator
it =
m_existingTriggers .find(lower);
663 return StatusCode::SUCCESS;
◆ executeTriggerEmulation()
StatusCode RatesAnalysisAlg::executeTriggerEmulation
(
)
private inherited
Internal call to get the pass/fail for all automatically emulated triggers.
Definition at line 666 of file RatesAnalysisAlg.cxx .
669 ATH_MSG_WARNING (
"Cannot do rates for " << trigger <<
". Automatic trigger emulation is not yet included, sorry :(" );
671 return StatusCode::SUCCESS;
◆ extractResult()
Definition at line 328 of file L1TopoRatesCalculator.cxx .
331 unsigned int startindex = definition.
flatindex + startOffset;
332 unsigned int endindex = startindex + definition.
nBit - 1;
333 unsigned int firstWord = startindex / 32;
334 unsigned int lastWord = endindex / 32;
335 unsigned int nBitAdded = 0;
338 if ((firstWord>1) | (lastWord>1)){
339 firstWord = firstWord%3;
340 lastWord = lastWord%3;
343 std::vector<uint32_t>result_vec(lastWord,0);
346 for (
unsigned int wordIndex=firstWord; wordIndex <= lastWord; wordIndex++) {
347 unsigned int startPosInWord = (wordIndex == firstWord) ? (startindex % 32) : 0 ;
348 unsigned int endPosInWord = (wordIndex == lastWord) ? (endindex % 32) : 31;
350 mask = ( ( 1
u << (endPosInWord+1) ) - 1 );
351 word = connectorContents[wordIndex] &
mask ;
352 word >>= startPosInWord;
353 result |= word << nBitAdded;
354 nBitAdded += endPosInWord - startPosInWord + 1;
355 result_vec.push_back(
result );
357 if (result_vec.size()>1){
358 result = result_vec[0] || result_vec[1];
◆ extraDeps_update_handler()
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
override virtual inherited
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 .
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode RatesAnalysisAlg::finalize
(
)
private virtual inherited
Print rates.
Definition at line 674 of file RatesAnalysisAlg.cxx .
679 ATH_MSG_INFO (
"################## Computed Rate Scans for Threshold-Scan Items:" );
683 ATH_MSG_INFO (
"################## Computed Rate Estimations for Single Items:" );
684 std::set<std::string>
keys ;
685 for (
const auto & trigger :
m_triggers )
keys .insert(trigger.first);
689 ATH_MSG_INFO (
"################## Computed Express Rate Estimations for Single Items:" );
693 ATH_MSG_INFO (
"################## Computed Rate Estimations for Groups:" );
697 ATH_MSG_INFO (
"################## Computed Rate Estimations for Global Groups:" );
700 ATH_MSG_INFO (
"################## LHC Conditions and weighting information:" );
707 return StatusCode::SUCCESS;
◆ firstExecute()
StatusCode AthAnalysisAlgorithm::firstExecute
(
)
protected virtual inherited
◆ getHWvalue()
◆ getLevel()
uint32_t RatesAnalysisAlg::getLevel
(
const std::string &
name )
const
private inherited
String match to a trigger level.
If unknown, we assume HLT .
Returns trigger level (1 or 2)
Definition at line 801 of file RatesAnalysisAlg.cxx .
802 if (
name .find(
"HLT_" ) != std::string::npos)
return 2;
803 if (
name .find(
"L1_" ) != std::string::npos)
return 1;
◆ getTOBblockFromProcessor()
bool L1TopoRatesCalculator::getTOBblockFromProcessor
(
const std::vector< uint32_t > &
allDataBlock ,
std::vector< uint32_t > &
tobBlock ,
uint32_t
fpgaPattern
)
private
◆ graph()
TGraph * AthHistogramming::graph
(
const std::string &
graphName ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
protected inherited
Simplify the retrieval of registered TGraphs.
Definition at line 492 of file AthHistogramming.cxx .
495 const hash_t graphHash = this->
hash (graphName);
498 GraphMap_t::const_iterator
it =
m_graphMap .find( graphHash );
503 std::string graphNameCopy = graphName;
504 std::string tDirCopy = tDir;
505 std::string streamCopy =
stream ;
508 std::string bookingString(
"" );
511 TGraph* graphPointer(NULL);
512 if ( !((
histSvc ()->getGraph(bookingString, graphPointer)).isSuccess()) )
515 std::string bookingString(
"" );
516 this->
buildBookingString ( bookingString, graphNameCopy, tDirCopy, streamCopy,
false );
518 if ( !((
histSvc ()->getGraph(bookingString, graphPointer)).isSuccess()) )
520 m_msg << MSG::WARNING
521 <<
"Problem retrieving the TGraph with name (including pre- and post-fixes) "
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 ;
530 m_graphMap .insert(
m_graphMap .end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
535 m_graphMap .insert(
m_graphMap .end(), std::pair< const hash_t, TGraph* >( graphHash, graphPointer ) );
◆ handle()
void AthAnalysisAlgorithm::handle
(
const Incident &
inc )
override protected virtual inherited
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 .
89 if ( inc.type() == IncidentType::BeginInputFile ) {
93 throw std::runtime_error(
"Couldn't call beginInputFile()" );
95 }
else if (inc.type() == IncidentType::EndInputFile ) {
98 throw std::runtime_error(
"Couldn't call endInputFile()" );
100 }
else if (inc.type() ==
"MetaDataStop" ) {
103 throw std::runtime_error(
"Couldn't call metaDataStop()" );
◆ hash()
◆ hist()
TH1 * AthHistogramming::hist
(
const std::string &
histName ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
protected inherited
Simplify the retrieval of registered histograms of any type.
Definition at line 198 of file AthHistogramming.cxx .
204 HistMap_t::const_iterator
it =
m_histMap .find( histHash );
209 std::string histNameCopy =
histName ;
210 std::string tDirCopy = tDir;
211 std::string streamCopy =
stream ;
214 std::string bookingString(
"" );
217 TH1* histPointer(NULL);
218 if ( !((
histSvc ()->
getHist (bookingString, histPointer)).isSuccess()) )
221 std::string bookingString(
"" );
224 if ( !((
histSvc ()->
getHist (bookingString, histPointer)).isSuccess()) )
226 m_msg << MSG::WARNING
227 <<
"Problem retrieving the histogram with name (including pre- and post-fixes) "
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 ;
236 m_histMap .insert(
m_histMap .end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
241 m_histMap .insert(
m_histMap .end(), std::pair< const hash_t, TH1* >( histHash, histPointer ) );
◆ hist2d()
TH2 * AthHistogramming::hist2d
(
const std::string &
histName ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the retrieval of registered 2-d histograms.
Definition at line 369 of file AthHistogramming.h .
376 <<
"Cannot get a 2-d histogram with name " <<
histName
377 <<
"... will probably seg-fault!" <<
endmsg ;
381 return dynamic_cast< TH2*
> ( th1Pointer );
◆ hist3d()
TH3 * AthHistogramming::hist3d
(
const std::string &
histName ,
const std::string &
tDir = ""
,
const std::string &
stream = ""
)
inline protected inherited
Simplify the retrieval of registered 3-d histograms.
Definition at line 386 of file AthHistogramming.h .
393 <<
"Cannot get a 3-d histogram with name " <<
histName
394 <<
"... will probably seg-fault!" <<
endmsg ;
398 return dynamic_cast< TH3*
> ( th1Pointer );
◆ histSvc()
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 .
◆ initialize()
StatusCode L1TopoRatesCalculator::initialize
(
)
override virtual
Get the trigger decision tool and set up global groups.
Reimplemented from RatesAnalysisAlg .
Definition at line 16 of file L1TopoRatesCalculator.cxx .
37 const std::string& L1name = L1item.name();
38 if (L1name == L1_item){
39 const std::string& L1definition = L1item.definition();
47 ATH_MSG_DEBUG (
"Warning: L1 item '" << L1_item <<
"' not found in the L1 menu!" );
57 std::map<std::string, TriggerInfo> triggerMap;
62 std::regex re (R
"(([\w\d_-]+)x(\d+) Undefined control sequence \d
)");
64 std::sregex_iterator end ;
65 std::vector<size_t> triggerPositions;
69 std::smatch
match = *iter;
70 std::string triggerName =
match .str(1);
71 std::string triggerCount =
match .str(2);
72 info .triggers.push_back(triggerCount + triggerName);
75 triggerPositions.push_back(
match .position(0) +
match .length(0));
80 for (
size_t j = 0; j < triggerPositions.size(); ++j) {
81 size_t pos = triggerPositions[j];
86 [](
unsigned char c ) { return std::isspace(c); }),
90 if (
part .find(
"&" ) != std::string::npos) {
91 info .operations.push_back(
"&" );
92 }
else if (
part .find(
"|" ) != std::string::npos) {
93 info .operations.push_back(
"|" );
100 lastPart.erase(std::remove_if(lastPart.begin(), lastPart.end(),
101 [](
unsigned char c ) {
return std::isspace(
c ); }),
108 for (
const auto & pair : triggerMap) {
110 for (
size_t i = 0;
i < pair.second.triggers.size(); ++
i ) {
112 if (
i < pair.second.operations.size()) {
120 std::vector<std::string> beforeCTP_triggers;
121 std::vector<std::string> beforeCTP_triggers_mult;
123 for (
const auto & pair : triggerMap) {
124 for (
size_t i = 0;
i < pair.second.triggers.size(); ++
i ) {
125 beforeCTP_triggers_mult.push_back(pair.second.triggers[
i ]);
126 size_t pos_number = 0;
127 while (pos_number < (pair.second.triggers[
i ]).size() && std::isdigit((pair.second.triggers[
i ])[pos_number])) {
130 beforeCTP_triggers.push_back((pair.second.triggers[
i ]).substr(pos_number));
134 std::unordered_set<std::string> seen_mult;
135 std::vector<std::string> beforeCTP_triggers_mult_unique;
137 for (
const auto & str_mult : beforeCTP_triggers_mult) {
138 auto [
it , inserted] = seen_mult.insert(str_mult);
140 beforeCTP_triggers_mult_unique.push_back(str_mult);
144 std::sort (beforeCTP_triggers.begin(), beforeCTP_triggers.end());
145 auto beforeCTP_triggers_unique =
std::unique (beforeCTP_triggers.begin(), beforeCTP_triggers.end());
146 beforeCTP_triggers.erase(beforeCTP_triggers_unique, beforeCTP_triggers.end());
153 for (
size_t i = 0;
i < beforeCTP_triggers.size(); ++
i ){
154 ATH_MSG_DEBUG (
"Filling L1menu parameters from item: " << beforeCTP_triggers[
i ]);
155 ResultDefinition definition;
156 definition.flatindex = 0;
157 definition.clock = 0;
159 definition.fromSim =
true ;
160 definition.overflow =
true ;
162 for (
const auto & connName :
l1menu ->connectorNames() ) {
164 for (
auto &
tl :
conn .triggerLines() ) {
166 if ((connName ==
"Topo2El" ) || (connName ==
"Topo3El" )){
167 for (
size_t fpga = 0; fpga < 2; ++fpga){
168 for (
size_t clock = 0; clock < 2; ++clock){
169 for (
auto &
tl :
conn .triggerLines(fpga,clock)){
170 if (
tl .name() == beforeCTP_triggers[
i ]){
171 definition.flatindex =
tl .flatindex();
172 definition.nBit =
tl .nbits();
173 definition.clock =
tl .clock();
174 if (connName ==
"Topo2El" ) definition.conID = 2;
175 if (connName ==
"Topo3El" ) definition.conID = 3;
184 if (
tl .name() == beforeCTP_triggers[
i ]){
185 definition.flatindex =
tl .flatindex();
186 definition.nBit =
tl .nbits();
187 definition.clock = 0;
188 if (connName ==
"Topo1Opt0" ) definition.conID = 4;
189 if (connName ==
"Topo1Opt1" ) definition.conID = 5;
190 if (connName ==
"Topo1Opt2" ) definition.conID = 6;
191 if (connName ==
"Topo1Opt3" ) definition.conID = 7;
202 return StatusCode::SUCCESS;
◆ inputHandles()
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]
◆ inputMetaStore() [2/2]
◆ isCPS()
bool RatesAnalysisAlg::isCPS
(
const std::string &
group )
const
private inherited
String match coherent prescale groups.
Parameters
group Name of a trigger group
Returns If name-parsing thinks that the group is a coherent prescale group
Definition at line 790 of file RatesAnalysisAlg.cxx .
791 return (
group .find(
"CPS" ) != std::string::npos);
◆ isRandomSeed()
bool RatesAnalysisAlg::isRandomSeed
(
const std::string &
me ,
const std::string &
seed
)
const
private inherited
String match random L1 items.
Parameters
me Name of the trigger
seed Name of the trigger's seed
Returns if name-parsing thinks that the trigger seeds from a random L1 trgigger
Definition at line 794 of file RatesAnalysisAlg.cxx .
795 if (me.find(
"L1_RD" ) != std::string::npos)
return true ;
796 if (me.find(
"L1RD" ) != std::string::npos)
return true ;
797 if (
seed .find(
"L1_RD" ) != std::string::npos)
return true ;
◆ isZero()
bool RatesAnalysisAlg::isZero
(
double
v )
const
inline private inherited
◆ L1TopoSimResultsContainer_decoder()
Definition at line 253 of file L1TopoRatesCalculator.cxx .
259 std::vector<uint32_t>result_vector(2,0);
262 long long topoWordPrint =
result ->topoWord64();
263 std::bitset<64> wordPrint(topoWordPrint);
264 if (
result ->connectionId() != definition.
conID )
continue ;
266 std::vector<uint32_t> connectorWords(4);
276 long long topoWordOverflow =
result ->topoWordOverflow();
279 std::bitset<32> wordOver(topoWordOverflow);
280 word = wordRes | wordOver;
282 connectorWords[
result ->clock()] =
static_cast< uint32_t > (word.to_ullong());
287 long long topoWord64Overflow =
result ->topoWord64Overflow();
290 std::bitset<64> wordOver(topoWord64Overflow);
291 word = wordRes | wordOver;
294 connectorWords[2*
result ->clock() + 0] =
static_cast< uint32_t > (word.to_ullong());
295 connectorWords[2*
result ->clock() + 1] =
static_cast< uint32_t > (word.to_ullong() >> 32);
300 unsigned int startOffset = 0;
302 if (
result ->connectionId() == 5 ||
result ->connectionId() == 7){
307 resultValue =
extractResult (connectorWords, definition, startOffset);
308 result_vector[
result ->clock()] = resultValue;
311 if ((result_vector[0]>1)||(result_vector[1]>1)){
312 if (result_vector[0]>1) resultValue = result_vector[0];
313 if (result_vector[1]>1) resultValue = result_vector[1];
315 resultValue = result_vector[0] || result_vector[1];
◆ metaDataStop()
StatusCode AthAnalysisAlgorithm::metaDataStop
(
)
protected virtual inherited
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 .
133 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ myReplace()
void AthHistogramming::myReplace
(
std::string &
str ,
const std::string &
oldStr ,
const std::string &
newStr
)
private inherited
Helper method to replace sub-string.
Definition at line 590 of file AthHistogramming.cxx .
595 while ((
pos =
str .find(oldStr,
pos )) != std::string::npos)
597 str .replace(
pos , oldStr.length(), newStr);
598 pos += newStr.length();
◆ newScanTrigger() [1/2]
Register a new threshold scan trigger which plots rate as a function of some dependent variable.
Parameters
name The name of the emulated scan trigger. Recommend either a "L1_" or "HLT_" prefix.
thresholdMin The lower threshold of this trigger, rates will not be available below this threshold
thresholdMax The upper threshold of this trigger, rates will not be available above this threshold
thresholdBins Granularity
behaviour If the trigger should activate above (kTriggerAboveThreshold) or below (kTriggerBelowThreshold) the threshold
prescale The prescale value to simulate applying. Default 1
seedName The name of any lower seeding e.g. L1 item. This info is required to get group rates correct
seedPrescale The prescale of any L1 seed item. Default 1.
method Determines who is responsible for evaluating the emulated trigger decision, you (kMANUAL) or the algorithm (kAUTO or kEXISTING).
extrapolation Determines the triggers luminosity extrapolation behaviour.
Definition at line 40 of file RatesAnalysisAlg.cxx .
52 ATH_MSG_ERROR (
"Sorry - ScanTriggers have to be implemented with the kMANUAL method for now." );
53 return StatusCode::FAILURE;
57 m_scanTriggers .emplace(
name , std::make_unique<RatesScanTrigger>(
name ,
msgSvc (), thresholdMin, thresholdMax, thresholdBins, behaviour, prescale,
seedName , seedPrecale,
e ));
61 return StatusCode::SUCCESS;
◆ newScanTrigger() [2/2]
Version of newScanTrigger which takes a vector of bin edges.
Parameters
thresholdBinEdged Vector of bin edges to use for quantifying rate as a function of threshold
Definition at line 65 of file RatesAnalysisAlg.cxx .
75 ATH_MSG_ERROR (
"Sorry - ScanTriggers have to be implemented with the kMANUAL method for now." );
76 return StatusCode::FAILURE;
85 return StatusCode::SUCCESS;
◆ newTrigger() [1/2]
Register a new trigger for emulation.
Parameters
name The name of the emulated trigger. Recommend either a "L1_" or "HLT_" prefix.
prescale The prescale value to simulate applying. Default 1
expressPrescale The prescale value to simulate applying to the express stream. Default -1
seedName The 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.
seedPrescale The prescale of any L1 seed item. Default 1.
Comma separated 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.
method Determines who is responsible for evaluating the emulated trigger decision, you (kMANUAL) or the algorithm (kAUTO or kEXISTING).
extrapolation Determines the triggers luminosity extrapolation behaviour.
Definition at line 109 of file RatesAnalysisAlg.cxx .
119 ATH_MSG_FATAL (
"Too late to call newTrigger. All emulated triggers must be registered during ratesInitialize()." );
120 return StatusCode::FAILURE;
127 return StatusCode::SUCCESS;
139 return StatusCode::SUCCESS;
153 if (
group .starts_with(
"BW" ) ||
group .starts_with(
"PS" ) ||
group .starts_with(
"STREAM:express" ))
continue ;
160 it ->second->addToGroup( newTriggerPtr );
165 const size_t CPSID = newTriggerPtr->
getCPSID ();
180 if (
level == 2 && expressPrescale >= 1) {
186 return StatusCode::SUCCESS;
◆ newTrigger() [2/2]
Version of newTrigger which accepts a set of group names rather than a comma separated string.
Definition at line 89 of file RatesAnalysisAlg.cxx .
98 std::set<std::string> groupSet;
102 if (!std::getline(
ss ,
group ,
',' ))
break ;
103 groupSet.insert(
group );
◆ outputHandles()
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]
◆ outputMetaStore() [2/2]
◆ populateTriggers()
StatusCode RatesAnalysisAlg::populateTriggers
(
)
private inherited
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 .
392 ATH_MSG_INFO (
"Initializing User's Triggers (note: we are actually now in the event loop)" );
408 ATH_MSG_INFO (
"Computing coherent factors for coherent prescale groups." );
411 const size_t CPSID = trigger.second->getCPSID();
412 if (CPSID != 0) trigger.second->setCoherentFactor(
m_lowestPrescale .at(CPSID) );
416 ATH_MSG_INFO (
"Creating extra groups to calculate unique rates." );
441 if (trigger.second->getDisabled() ==
false ) {
447 ATH_MSG_INFO (
"Retrieving HLT chain's ID and Group from HLT menu." );
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 );
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];
485 for (
size_t i = 0;
i <
l1menu .size();
i ++) {
494 for ( ; item_itr != item_end; ++item_itr ) {
504 ATH_MSG_DEBUG (
"################## Configured to estimate rates for the following triggers:" );
508 ATH_MSG_DEBUG (
"################## Configured to estimate rates for the following scan triggers:" );
512 ATH_MSG_DEBUG (
"################## Configured to estimate rates for the following groups of triggers:" );
516 ATH_MSG_DEBUG (
"################## Configured to estimate rates for the following global groups of triggers:" );
521 ATH_MSG_DEBUG (
"################## Registering normalisation histogram:" );
524 m_bcidHist =
new TH1D(
"bcid" ,
";BCID;Events" ,3565,-.5,3564.5);
526 ATH_MSG_DEBUG (
"################## Registering metadata tree histogram:" );
527 ATH_CHECK (
histSvc ()->regTree(
"/RATESTREAM/metadata" , std::make_unique<TTree>(
"metadata" ,
"metadata" )) );
530 ATH_MSG_DEBUG (
"################## Registering trigger histograms:" );
532 if (!trigger.second->doHistograms())
continue ;
533 std::string lvlSubdir =
"" ;
534 if (trigger.second->getName().find(
"L1" ) == 0){
535 lvlSubdir =
"Rate_ChainL1_HLT/" ;
536 }
else if (trigger.second->getName().find(
"HLT" ) == 0) {
537 lvlSubdir =
"Rate_ChainHLT_HLT/" ;
539 ATH_CHECK ( trigger.second->giveDataHist(
histSvc (), std::string(
"/RATESTREAM/All/" + lvlSubdir + trigger.first +
"/data" )) );
540 ATH_CHECK ( trigger.second->giveMuHist(
histSvc (), std::string(
"/RATESTREAM/All/" + lvlSubdir + trigger.first +
"/rateVsMu" )) );
542 else trigger.second->clearTrainHist();
546 ATH_MSG_DEBUG (
"################## Registering scan trigger histograms:" );
548 ATH_CHECK ( trigger.second->giveThresholdHist(
histSvc (), std::string(
"/RATESTREAM/ScanTriggers/" + trigger.first +
"/rateVsThreshold" )) );
552 ATH_MSG_DEBUG (
"################## Registering group histograms:" );
554 if (!
group .second->doHistograms())
continue ;
560 else group .second->clearTrainHist();
564 ATH_MSG_DEBUG (
"################## Registering global group histograms:" );
566 if (!
group .second->doHistograms())
continue ;
567 ATH_CHECK (
group .second->giveDataHist(
histSvc (), std::string(
"/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" +
group .first +
"/data" )) );
568 ATH_CHECK (
group .second->giveMuHist(
histSvc (), std::string(
"/RATESTREAM/All/Rate_Group_HLT/RATE_GLOBAL_" +
group .first +
"/rateVsMu" )) );
570 else group .second->clearTrainHist();
583 return StatusCode::SUCCESS;
◆ printInputSummary()
void RatesAnalysisAlg::printInputSummary
(
)
const
private inherited
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 780 of file RatesAnalysisAlg.cxx .
782 <<
" with <L_inst.> = "
784 <<
" cm-2s-1, <mu> = "
786 <<
", paired bunches = "
◆ printStatistics()
void RatesAnalysisAlg::printStatistics
(
)
const
private inherited
◆ printTarget()
void RatesAnalysisAlg::printTarget
(
)
const
private inherited
Print the target instantaneous luminosity, mu and number of bunches.
Definition at line 768 of file RatesAnalysisAlg.cxx .
772 ATH_MSG_INFO (
"Luminosity extrapolation is switched off. Input files will determin the paired bunches, L_inst. and mu profile." );
◆ ratesExecute()
StatusCode L1TopoRatesCalculator::ratesExecute
(
)
override virtual
To be implemented by the user.
Supply pass/fail for all "triggers"
Implements RatesAnalysisAlg .
Definition at line 364 of file L1TopoRatesCalculator.cxx .
371 const std::vector<uint32_t>
l1Triggers = trigDecision->
tbp ();
375 ATH_MSG_FATAL (
"Could not retrieve L1Topo EDM Container from the Simulation." );
376 return StatusCode::FAILURE;
379 std::vector<std::string> l1Items_vector;
381 std::vector<uint32_t> resultValue(l1Items_vector.size(), 0);
386 std::map<std::string, bool> beforeCTP_result_Map;
396 ATH_MSG_DEBUG (
"Decision from the decoder (L1TopoResultsContainer): " << resultValue[
i ]);
403 while (
pos < mult_item.size() && std::isdigit(mult_item[
pos ])) {
406 std::string leading_number = mult_item.substr(0,
pos );
407 std::string item_name = mult_item.substr(
pos );
410 if (item_name == l1Items_vector[
i ]) {
412 if (resultValue[
i ] >= 1){
413 beforeCTP_result_Map[mult_item] =
true ;
427 std::map<std::string, bool> L1_result_Map;
428 std::vector<bool> isPassed_L1item;
432 const std::string&
key = pair.first;
434 if (
info .triggers.empty())
continue ;
436 bool result = beforeCTP_result_Map[
info .triggers[0]];
438 for (
size_t i = 1;
i <
info .triggers.size(); ++
i ) {
439 const std::string& currentTrigger =
info .triggers[
i ];
440 const std::string& currentOp =
info .operations[
i - 1];
441 if (currentOp ==
"&" ) {
442 result &= beforeCTP_result_Map[currentTrigger];
443 }
else if (currentOp ==
"|" ) {
444 result |= beforeCTP_result_Map[currentTrigger];
448 isPassed_L1item.push_back(
result );
455 for (
const auto & pair : L1_result_Map) {
456 const std::string&
label = pair.first;
475 return StatusCode::SUCCESS;
◆ ratesFinalize()
StatusCode L1TopoRatesCalculator::ratesFinalize
(
)
override virtual
◆ ratesInitialize()
StatusCode L1TopoRatesCalculator::ratesInitialize
(
)
override virtual
To be implemented by the user.
Register "triggers" to calculate the rate for
Implements RatesAnalysisAlg .
Definition at line 205 of file L1TopoRatesCalculator.cxx .
209 ATH_MSG_DEBUG (
"################## Registering rates matrix:" );
210 m_ratesMatrixHist =
new TH2D(
"rates_matrix" ,
"L1item Rates matrix" ,150,-3,3,150,-3,3);
226 std::set<std::string> triggerGroup {
"RATE_SingleElectron" };
230 std::vector<double> vector_zeros(
m_L1_items .size(), 0);
250 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ retrieveMetadata() [1/2]
template<typename T >
StatusCode AthAnalysisAlgorithm::retrieveMetadata
(
const std::string &
folder ,
const std::string &
key ,
T &
out
)
inline inherited
◆ 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
)
inline inherited
◆ setExponentialMuScalingFactor()
void RatesAnalysisAlg::setExponentialMuScalingFactor
(
const double
f )
inline inherited
Set the exponential scaling factor for relevant chains.
scaling = exp(f * (targetMu - eventMu))
Parameters
Definition at line 184 of file RatesAnalysisAlg.h .
◆ setTargetLumi()
void RatesAnalysisAlg::setTargetLumi
(
const double
lumi )
inline inherited
Set the target instantaneous luminosity.
Assumes a full-ring. Mu is derived.
Parameters
lumi The target lumi in cm-2s-1
Definition at line 172 of file RatesAnalysisAlg.h .
◆ setTargetLumiBunches()
void RatesAnalysisAlg::setTargetLumiBunches
(
const double
lumi ,
const int32_t
bunches
)
inherited
Set the target instantaneous luminosity and number of bunches.
Mu is derived.
Parameters
lumi The target lumi in cm-2s-1
bunches The target number of paired bunches
Definition at line 730 of file RatesAnalysisAlg.cxx .
732 ATH_MSG_WARNING (
"Too late to call setTargetLumiBunches. Do this during ratesInitialize()." );
◆ setTargetLumiMu()
void RatesAnalysisAlg::setTargetLumiMu
(
const double
lumi ,
const double
mu
)
inherited
Set the target instantaneous luminosity and mu.
Number of bunches in the ring is derived.
Parameters
lumi The target lumi in cm-2s-1
mu The target pileup
Definition at line 710 of file RatesAnalysisAlg.cxx .
712 ATH_MSG_WARNING (
"Too late to call setTargetLumiMu. Do this during ratesInitialize()." );
◆ setTargetMu()
void RatesAnalysisAlg::setTargetMu
(
const double
mu )
inline inherited
Set the target pileup.
Assumes a full-ring. Inst. lumi is derived.
Parameters
Definition at line 178 of file RatesAnalysisAlg.h .
◆ setTargetMuBunches()
void RatesAnalysisAlg::setTargetMuBunches
(
const double
mu ,
const int32_t
bunches
)
inherited
Set the target mu and number of bunches.
The instantaneous luminosity is derived.
Parameters
mu The target pileup
bunches The target number of paired bunches
Definition at line 747 of file RatesAnalysisAlg.cxx .
749 ATH_MSG_WARNING (
"Too late to call setTargetMuBunches. Do this during ratesInitialize()." );
◆ setTriggerDesicison() [1/2]
StatusCode RatesAnalysisAlg::setTriggerDesicison
(
const std::string &
name ,
const bool
triggerIsPassed = true
,
const bool
triggerIsActive = true
)
inherited
Set the pass/fail decision for an item.
Parameters
name Name of the registered trigger
triggerIsPassed Trigger decision.
Definition at line 342 of file RatesAnalysisAlg.cxx .
345 if (triggerIsPassed || triggerIsActive) {
348 ATH_MSG_ERROR (
"Cannot find trigger " <<
name <<
" did you call newTrigger for this in initialize?" );
349 return StatusCode::FAILURE;
354 return StatusCode::SUCCESS;
◆ setTriggerDesicison() [2/2]
StatusCode RatesAnalysisAlg::setTriggerDesicison
(
const std::string &
name ,
const double
threshold
)
inherited
Set the pass threshold for a Scan Trigger item.
Parameters
name Name of the registered scan-trigger
threshold The passed threshold in the event
Definition at line 358 of file RatesAnalysisAlg.cxx .
361 ATH_MSG_ERROR (
"Cannot find scan-trigger " <<
name <<
" did you call newScanTrigger for this in initialize?" );
362 return StatusCode::FAILURE;
366 return StatusCode::SUCCESS;
◆ sysExecute()
StatusCode AthAnalysisAlgorithm::sysExecute
(
const EventContext &
ctx )
override virtual inherited
override to do firstEvent method
Definition at line 72 of file AthAnalysisAlgorithm.cxx .
77 return StatusCode::FAILURE;
80 return AthHistogramAlgorithm::sysExecute(ctx);
◆ sysInitialize()
StatusCode AthAnalysisAlgorithm::sysInitialize
(
)
override virtual inherited
Function initialising the tool in the correct way in Athena .
Reimplemented from AthHistogramAlgorithm .
Definition at line 50 of file AthAnalysisAlgorithm.cxx .
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 );
69 return StatusCode::SUCCESS;
◆ sysStart()
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 = ""
)
protected inherited
Simplify the retrieval of registered TTrees.
Definition at line 378 of file AthHistogramming.cxx .
384 TreeMap_t::const_iterator
it =
m_treeMap .find( treeHash );
389 std::string treeNameCopy =
treeName ;
390 std::string tDirCopy = tDir;
391 std::string streamCopy =
stream ;
394 std::string bookingString(
"" );
397 TTree* treePointer(NULL);
398 if ( !((
histSvc ()->
getTree (bookingString, treePointer)).isSuccess()) )
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 ;
408 m_treeMap .insert(
m_treeMap .end(), std::pair< const hash_t, TTree* >( treeHash, treePointer ) );
◆ updateEvtStore()
void AthAnalysisAlgorithm::updateEvtStore
(
Gaudi::Details::PropertyBase &
prop )
protected inherited
◆ updateVHKA()
◆ writeMetadata()
void RatesAnalysisAlg::writeMetadata
(
)
private inherited
Write to outpute tree (if any) the metadata needed downstream.
Definition at line 807 of file RatesAnalysisAlg.cxx .
818 std::vector<std::string> lowers;
820 std::vector<double> express;
827 lowers.push_back(trigger.second->getSeedName());
828 prescales .push_back(trigger.second->getPrescale() );
829 express.push_back(trigger.second->getPrescale(
true ) );
833 lowers.push_back(
"-" );
835 express.push_back(-1);
839 lowers.push_back(
"-" );
841 express.push_back(-1);
847 std::vector<int32_t> bunchGroups;
848 bunchGroups.reserve(16);
874 std::string atlasProject =
std::getenv (
"AtlasProject" );
875 std::string atlasVersion =
std::getenv (
"AtlasVersion" );
◆ m_activatedTriggers
std::unordered_set<RatesTrigger *> RatesAnalysisAlg::m_activatedTriggers
private inherited
Triggers which were changed & hence need to be reset at the event end.
Definition at line 251 of file RatesAnalysisAlg.h .
◆ m_activeGroups
std::unordered_set<RatesGroup *> RatesAnalysisAlg::m_activeGroups
private inherited
◆ m_autoTriggers
std::vector<std::string> RatesAnalysisAlg::m_autoTriggers
private inherited
List of triggers which it is up to us to the algorithm to work out the pass/fail for.
Definition at line 255 of file RatesAnalysisAlg.h .
◆ m_bcidHist
TH1D* RatesAnalysisAlg::m_bcidHist
private inherited
Histogram of the BCIDs distribution of the processing.
Definition at line 292 of file RatesAnalysisAlg.h .
◆ m_beforeCTP_triggers
std::vector<std::string> L1TopoRatesCalculator::m_beforeCTP_triggers
private
◆ m_beforeCTP_triggers_mult
std::vector<std::string> L1TopoRatesCalculator::m_beforeCTP_triggers_mult
private
◆ m_configSvc
◆ m_currentEventIsUnbiased
Gaudi::Property<bool> RatesAnalysisAlg::m_currentEventIsUnbiased
private inherited
If the current event was triggered online by RDx or not.
Random seeded HLT chains must only see these
Definition at line 278 of file RatesAnalysisAlg.h .
◆ m_currentFile
TFile* AthAnalysisAlgorithm::m_currentFile {nullptr}
private inherited
◆ m_definitions
◆ m_denominator
std::vector<double> L1TopoRatesCalculator::m_denominator
private
◆ m_detStore
◆ m_doExpressRates
Gaudi::Property<bool> RatesAnalysisAlg::m_doExpressRates {this, "DoExpressRates", false, "Calculate total rates for the express stream."}
private inherited
◆ m_doGlobalGroups
Gaudi::Property<bool> RatesAnalysisAlg::m_doGlobalGroups {this, "DoGlobalGroups", false, "Calculate total rates for each trigger level."}
private inherited
◆ m_doHistograms
Gaudi::Property<bool> RatesAnalysisAlg::m_doHistograms {this, "DoHistograms", true, "Switch on histogram output of rate vs. mu and position in train."}
protected inherited
◆ m_doneFirstEvent
bool AthAnalysisAlgorithm::m_doneFirstEvent {false}
private inherited
◆ m_doTriggerGroups
Gaudi::Property<bool> RatesAnalysisAlg::m_doTriggerGroups {this, "DoTriggerGroups", false, "Calculate total rates for each group of triggers."}
private inherited
◆ m_doUniqueRates
Gaudi::Property<bool> RatesAnalysisAlg::m_doUniqueRates {this, "DoUniqueRates", false, "Calculate unique rates for all chains (slow). Requires DoGlobalGroups=True too."}
private inherited
◆ m_effMap
◆ 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 inherited
◆ m_enhancedBiasRatesTool
◆ m_eventCounter
uint32_t RatesAnalysisAlg::m_eventCounter
private inherited
◆ m_evtStore
◆ m_existingTriggers
Map of triggers which we ask the TDT ChainGroup for the pass/fail.
Definition at line 257 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 inherited
◆ m_expressGroupName
const std::string RatesAnalysisAlg::m_expressGroupName = "Express"
private inherited
◆ m_expressTriggers
std::unordered_set<RatesTrigger *> RatesAnalysisAlg::m_expressTriggers
private inherited
Triggers with non-zero express PS, used to print them at the end.
Definition at line 252 of file RatesAnalysisAlg.h .
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects
private inherited
◆ m_globalGroups
std::unordered_map<std::string, std::unique_ptr<RatesGroup > > RatesAnalysisAlg::m_globalGroups
private inherited
Big (master) groups which do the OR of the whole menu.
Definition at line 248 of file RatesAnalysisAlg.h .
◆ m_graphMap
◆ m_groups
std::unordered_map<std::string, std::unique_ptr<RatesGroup > > RatesAnalysisAlg::m_groups
private inherited
◆ m_histMap
◆ m_histNamePostfix
std::string AthHistogramAlgorithm::m_histNamePostfix
private inherited
◆ m_histNamePrefix
std::string AthHistogramAlgorithm::m_histNamePrefix
private inherited
◆ m_histSvc
◆ m_histTitlePostfix
std::string AthHistogramAlgorithm::m_histTitlePostfix
private inherited
◆ m_histTitlePrefix
std::string AthHistogramAlgorithm::m_histTitlePrefix
private inherited
◆ m_hltChainIDGroup
std::vector<std::vector<std::string> > RatesAnalysisAlg::m_hltChainIDGroup
private inherited
◆ 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 inherited
◆ m_inputMetaStore
◆ m_L1_item_definitions
std::vector<std::string> L1TopoRatesCalculator::m_L1_item_definitions
private
◆ m_L1_items
std::vector<std::string> L1TopoRatesCalculator::m_L1_items
private
◆ m_L1_items_json
Gaudi::Property<std::vector<std::string> > L1TopoRatesCalculator::m_L1_items_json {this, "m_L1_items_json", {}, "L1 trigger items"}
private
◆ m_l1GroupName
const std::string RatesAnalysisAlg::m_l1GroupName = "L1"
private inherited
◆ m_l1ItemID
std::vector<std::vector<std::string> > RatesAnalysisAlg::m_l1ItemID
private inherited
◆ m_l1topoKey
◆ m_l2GroupName
const std::string RatesAnalysisAlg::m_l2GroupName = "HLT"
private inherited
◆ m_linearLumiFactor
double RatesAnalysisAlg::m_linearLumiFactor
protected inherited
◆ m_lowerTrigger
std::unordered_map<std::string, std::string> RatesAnalysisAlg::m_lowerTrigger
private inherited
◆ m_lowestPrescale
std::unordered_map<size_t, double> RatesAnalysisAlg::m_lowestPrescale
private inherited
Lowest prescale within a CPS group, key is the hash of the CPS group name.
Definition at line 254 of file RatesAnalysisAlg.h .
◆ m_lumi
Gaudi::Property<float> L1TopoRatesCalculator::m_lumi {this, "TargetLuminosity", 2e34, "Targer inst. luminosity, assuming full ring."}
private
◆ m_metadataTree
TTree* RatesAnalysisAlg::m_metadataTree
private inherited
Used to write out some metadata needed by post-processing (e.g.
bunchgroup, lumi)
Definition at line 294 of file RatesAnalysisAlg.h .
◆ m_msg
MsgStream AthHistogramming::m_msg
private inherited
◆ m_name
std::string AthHistogramming::m_name
private inherited
◆ m_outputMetaStore
◆ m_prefix
std::string AthHistogramAlgorithm::m_prefix
private inherited
◆ 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 inherited
◆ m_rates_matrix
std::vector<std::vector<double> > L1TopoRatesCalculator::m_rates_matrix
private
◆ m_rates_matrix2
std::vector<std::vector<double> > L1TopoRatesCalculator::m_rates_matrix2
private
◆ m_ratesDenominator
double RatesAnalysisAlg::m_ratesDenominator
protected inherited
How much walltime is seen by the algorithm.
This is what we need to normalise to.
Definition at line 190 of file RatesAnalysisAlg.h .
◆ m_ratesMatrixHist
TH2D* L1TopoRatesCalculator::m_ratesMatrixHist {}
private
◆ m_rootDir
std::string AthHistogramAlgorithm::m_rootDir
private inherited
◆ m_runNumber
uint32_t RatesAnalysisAlg::m_runNumber
private inherited
◆ m_scalingHist
TH1D* RatesAnalysisAlg::m_scalingHist
private inherited
One-bin histogram to store the normalisation of the sample, for use in later combinations.
Definition at line 291 of file RatesAnalysisAlg.h .
◆ m_scanTriggers
std::unordered_map<std::string, std::unique_ptr<RatesScanTrigger > > RatesAnalysisAlg::m_scanTriggers
private inherited
◆ m_streamName
std::string AthHistogramming::m_streamName
private inherited
◆ m_targetBunches
double RatesAnalysisAlg::m_targetBunches
private inherited
◆ m_targetLumi
double RatesAnalysisAlg::m_targetLumi
private inherited
What instantaneous luminosity the prediction is targeting.
Definition at line 286 of file RatesAnalysisAlg.h .
◆ m_targetMu
double RatesAnalysisAlg::m_targetMu
private inherited
◆ m_tdt
◆ m_treeMap
◆ m_trigDecisionKey
◆ m_triggerMap
std::map<std::string, TriggerInfo > L1TopoRatesCalculator::m_triggerMap
private
◆ m_triggers
std::unordered_map<std::string, std::unique_ptr<RatesTrigger > > RatesAnalysisAlg::m_triggers
private inherited
◆ m_uniqueGroups
std::unordered_map<std::string, std::unique_ptr<RatesGroup > > RatesAnalysisAlg::m_uniqueGroups
private inherited
◆ 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 inherited
◆ m_userDefinedDefinitions
Gaudi::Property<std::vector<std::string> > L1TopoRatesCalculator::m_userDefinedDefinitions {this, "m_userDefinedDefinitions", {}, "user Defined definitions"}
private
◆ m_userDefinedMap
std::unordered_map<std::string, std::string> L1TopoRatesCalculator::m_userDefinedMap
private
◆ m_userDefinedNames
Gaudi::Property<std::vector<std::string> > L1TopoRatesCalculator::m_userDefinedNames {this, "m_userDefinedNames", {}, "user Defined Names"}
private
◆ m_varHandleArraysDeclared
◆ 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 inherited
◆ m_vhka
◆ m_weighted_sum
double L1TopoRatesCalculator::m_weighted_sum {}
private
◆ m_weightedEventCounter
double RatesAnalysisAlg::m_weightedEventCounter
private inherited
◆ m_weightingValues
Possible weighting & lumi extrapolation values for the current event.
Definition at line 189 of file RatesAnalysisAlg.h .
The documentation for this class was generated from the following files:
std::string m_rootDir
Name of the ROOT directory.
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
const ptree & data() const
Access to the underlying data, if needed.
void printStatistics() const
Print some extra statistics on events processed.
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
const std::string m_expressGroupName
std::string replace(std::string s, const std::string &s2, const std::string &s3)
StatusCode populateTriggers()
Register all triggers to emulate.
SG::ReadHandleKey< xAOD::TrigDecision > m_trigDecisionKey
uint32_t m_runNumber
What is the RunNumber.
void myReplace(std::string &str, const std::string &oldStr, const std::string &newStr)
Helper method to replace sub-string.
double m_eventLiveTime
How much wall-time at P1 did this event represent.
Used to calculate a rate scan as a function of some threshold value.
MsgStream m_msg
Cached Message Stream.
ToolHandle< Trig::TrigDecisionTool > m_tdt
HistMap_t m_histMap
The map of histogram names to their pointers.
virtual StatusCode endInputFile()
Function called as an input file is being closed.
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.
void removeFromGroup(const RatesTrigger *toRemove)
Remove a trigger from this group.
Gaudi::Property< bool > m_enableLumiExtrapolation
std::unordered_map< std::string, std::string > m_lowerTrigger
Map of triggers lower chain, to tell if a HLT trigger ran or not.
virtual StatusCode ratesExecute()=0
To be implemented by the user.
virtual StatusCode firstExecute()
Function called when first execute is encountered user can read event information with evtStore()
ServiceHandle< ITHistSvc > m_histSvc
Default constructor: AthHistogramAlgorithm();.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
std::unordered_map< std::string, std::unique_ptr< RatesScanTrigger > > m_scanTriggers
All individual rates-scan triggers (L1 or HLT)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Gaudi::Property< std::vector< std::string > > m_L1_items_json
std::map< std::string, TriggerInfo > m_triggerMap
StatusCode checkGotTDT()
Internal check that the TDT is fetched.
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.
bool m_isUnbiased
If the event was taken online with a RD trigger.
const std::string m_l2GroupName
void setUseCachedWeights(const bool i)
Set to use cached weights from the Master group (need ptr to m_masterGroup)
Gaudi::Property< std::vector< std::string > > m_userDefinedNames
std::vector< double > m_denominator
float round(const float toRound, const unsigned int decimals)
ServiceHandle< StoreGateSvc > m_inputMetaStore
Object accessing the input metadata store.
TH1D * m_bcidHist
Histogram of the BCIDs distribution of the processing.
double m_eventLumi
The instantaneous lumi in cm-2s-1.
ToolHandle< IEnhancedBiasWeighter > m_enhancedBiasRatesTool
virtual StatusCode ratesInitialize()=0
To be implemented by the user.
const std::string print()
Gaudi::Property< double > m_expoScalingFactor
const HLTPrescale & prescale_express(const std::string &chainName) const
HLT prescales by chain names.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_groups
All regular and CPS groups.
std::vector< SG::VarHandleKeyArray * > m_vhka
double m_ratesDenominator
How much walltime is seen by the algorithm.
double m_linearLumiFactor
What weight needs to be applied to extrapolate rates linear in mu and bunches.
uint32_t m_distanceInTrain
How far into the bunch train the event was, in bunch crossings.
bool msgLvl(const MSG::Level lvl) const
Gaudi::Property< bool > m_doUniqueRates
uint32_t extractResult(const std::vector< uint32_t > &connectorContents, const L1TopoRatesCalculator::ResultDefinition &definition, unsigned int startOffset)
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_globalGroups
Big (master) groups which do the OR of the whole menu.
double m_targetMu
What pileup level the prediction is targeting.
const ServiceHandle< StoreGateSvc > & inputMetaStore() const
Const accessor for the input metadata store.
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.
#define ATH_MSG_VERBOSE(x)
std::unordered_map< std::string, std::string > m_userDefinedMap
const std::shared_ptr< L1BunchGroup > & getBunchGroup(const std::string &name) const
Accessor to the bunchgroup by name.
std::string m_histNamePostfix
The postfix for the histogram THx name.
@ kEXISTING
The pass/fail decision is taken from the Trigger Decision Tool for an existing trigger.
@ u
Enums for curvilinear frames.
std::string getTree(const std::string &file_name)
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
void setTargetMuBunches(const double mu, const int32_t bunches)
Set the target mu and number of bunches.
Gaudi::Property< std::map< std::string, std::map< std::string, double > > > m_prescalesJSON
@ kAUTO
The pass/fail decision is automatically emulated per event based on decoding the trigger name.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
std::vector< std::string > m_L1_item_definitions
virtual void setOwner(IDataHandleHolder *o)=0
double m_weightedEventCounter
Count how many weighted events were processed.
Gaudi::Property< float > m_lumi
Used to calculate the rate for a single trigger at L1 or the HLT.
virtual StatusCode initialize()
Get the trigger decision tool and set up global groups.
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
SG::ReadHandleKey< xAOD::L1TopoSimResultsContainer > m_l1topoKey
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
StatusCode executeTriggerEmulation()
Internal call to get the pass/fail for all automatically emulated triggers.
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
msgSvc
Provide convenience handles for various services.
uint32_t L1TopoSimResultsContainer_decoder(const L1TopoRatesCalculator::ResultDefinition &definition, SG::ReadHandle< xAOD::L1TopoSimResultsContainer > &cont)
const HLTPrescale & prescale(const std::string &chainName) const
HLT prescales by chain names.
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)
std::reverse_iterator< DataModel_detail::iterator< DVL > > unique(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, BinaryPredicate pred)
Specialization of unique for DataVector/List.
TTree * m_metadataTree
Used to write out some metadata needed by post-processing (e.g.
double m_targetBunches
How many bunches the prediction is targeting.
void setTargetLumiBunches(const double lumi, const int32_t bunches)
Set the target instantaneous luminosity and number of bunches.
RatesAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
bool isCPS(const std::string &group) const
String match coherent prescale groups.
std::unordered_map< std::string, std::unique_ptr< RatesGroup > > m_uniqueGroups
Groups used to obtain unique rates for chains.
WeightingValuesSummary_t m_weightingValues
Possible weighting & lumi extrapolation values for the current event.
#define ATH_MSG_ALWAYS(x)
StatusCode addExisting(const std::string &pattern)
Register some existing triggers based on wild-card match, e.g.
L1 threshold configuration.
double m_expoMuFactor
What weight needs to be applied to extrapolate rates linear in bunches and exponential in mu.
constexpr std::size_t maxNBunchGroups() const
Maximum number of bunchgroups.
size_t getCPSID() const
Get the hash of my CPS group name.
@ kMANUAL
The pass/fail decision is evaluated by the user and supplied per event using setTriggerDesicison.
Gaudi::Property< bool > m_doHistograms
virtual StatusCode metaDataStop()
Function called before finalize user can read output metadata from outputMetaStore()
GraphMap_t m_graphMap
The map of TGraph names to their pointers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::string m_streamName
Name of the ROOT output stream (file)
setTopoWord setTopoWord64 unsigned bitWidth
void removeOtherL1(const RatesTrigger *toKeep)
Remove from the groups mapping all triggers which have a dissimilar seed to the supplied trigger.
std::unordered_set< RatesGroup * > m_activeGroups
All groups which are enabled (PS >= 1)
uint32_t hash_t
typedef for the internal hash
uint64_t crc64(const CRCTable &table, const char *data, size_t data_len)
Find the CRC-64 of a string,.
void printTarget() const
Print the target instantaneous luminosity, mu and number of bunches.
bool isRandomSeed(const std::string &me, const std::string &seed) const
String match random L1 items.
constexpr static uint32_t FULL_RING
Number of bunches in a full ring.
std::string m_histTitlePostfix
The postfix for the histogram THx title.
bool getDisabled() const
If I or my seed were prescaled out.
virtual void renounce()=0
double m_bunchFactor
What weight needs to be applied to extrapolate rates linear in number of bunches.
Forward iterator over an iterable of type V returning an object of type T.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< std::string > m_beforeCTP_triggers
std::unordered_set< RatesTrigger * > m_activatedTriggers
Triggers which were changed & hence need to be reset at the event end.
std::vector< std::string > m_beforeCTP_triggers_mult
Gaudi::Property< bool > m_doExpressRates
This class contains trigger related information.
static bool isZero(double v)
constexpr static double LHC_FREQUENCY
std::string to_string(const DetectorType &type)
TH1D * m_scalingHist
One-bin histogram to store the normalisation of the sample, for use in later combinations.
hash_t hash(const std::string &histName) const
Method to calculate a 32-bit hash from a string.
Gaudi::Property< std::vector< std::string > > m_userDefinedDefinitions
void setTargetLumi(const double lumi)
Set the target instantaneous luminosity.
StatusCode executeTrigDecisionToolTriggers()
Internal call to get the pass/fail for all TDT triggers.
def getHist(name, makehist)
virtual StatusCode sysInitialize()
Initialization method invoked by the framework.
void setUniqueTrigger(RatesTrigger *trigger)
Set trigger I am doing unique rates for.
Class describing the basic event information.
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...
void writeMetadata()
Write to outpute tree (if any) the metadata needed downstream.
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
std::unordered_map< std::string, std::unique_ptr< RatesTrigger > > m_triggers
All individual triggers (L1 or HLT)
uint32_t getLevel(const std::string &name) const
String match to a trigger level.
std::vector< ResultDefinition > m_definitions
DataObjIDColl m_extendedExtraObjects
virtual StatusCode beginInputFile()
Function called when a new input file is opened user can read input metadata from inputMetaStore()
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
void printInputSummary() const
Print the input data instantaneous luminosity, mu and number of bunches.
EffMap_t m_effMap
The map of histogram names to their pointers.
std::string getenv(const std::string &variableName)
get an environment variable
std::string m_histTitlePrefix
The prefix for the histogram THx title.
const std::string m_l1GroupName
def time(flags, cells_name, *args, **kw)
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
std::unordered_map< size_t, double > m_lowestPrescale
Lowest prescale within a CPS group, key is the hash of the CPS group name.
const boost::regex re(r_e)
std::vector< std::vector< std::string > > m_l1ItemID
TreeMap_t m_treeMap
The map of TTree names to their pointers.
std::string m_histNamePrefix
The prefix for the histogram THx name.
const std::map< std::string, L1Prescale > & prescales() const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode ratesFinalize()=0
To be implemented by the user.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
std::unordered_map< std::string, const Trig::ChainGroup * > m_existingTriggers
Map of triggers which we ask the TDT ChainGroup for the pass/fail.
ServiceHandle< ITHistSvc > m_histSvc
Pointer to the THistSvc (event store by default)
std::vector< std::vector< double > > m_rates_matrix2
const std::vector< uint32_t > & tbp() const
Get the Trigger Before Prescale bits.
Gaudi::Property< uint32_t > m_vetoStartOfTrain
std::vector< std::vector< double > > m_rates_matrix
double m_muFactor
What weight needs to be applied to extrapolate rates linear in mu.
ServiceHandle< StoreGateSvc > m_outputMetaStore
Object accessing the output metadata store.
Gaudi::Property< bool > m_doTriggerGroups
Gaudi::Property< bool > m_useBunchCrossingData
std::string m_name
Instance name.
double m_targetLumi
What instantaneous luminosity the prediction is targeting.
uint32_t m_eventCounter
Count how many events processed.
std::vector< std::string > m_L1_items
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
StatusCode setTriggerDesicison(const std::string &name, const bool triggerIsPassed=true, const bool triggerIsActive=true)
Set the pass/fail decision for an item.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Gaudi::Property< double > m_inelasticCrossSection
Gaudi::Property< bool > m_doGlobalGroups
Interface to the raw trigger decision information of the event.
std::vector< std::vector< std::string > > m_hltChainIDGroup
bool match(std::string s1, std::string s2)
match the individual directories of two strings
bool isZero(double v) const
Helper function for floating point subtraction.
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....
void buildBookingString(std::string &bookingString, std::string &histName, std::string &tDir, std::string &stream, bool usePrefixPostfix=false)
Method to build individual booking string.
void duplicateChildren(const RatesGroup *toDuplicate)
Copy in triggers from another group.
TH1 * bookGetPointer(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
@ kNONE
Do not scale this trigger for changes in luminosity.
std::unordered_set< RatesTrigger * > m_expressTriggers
Triggers with non-zero express PS, used to print them at the end.
double m_eventMu
The actual number of interactions in the event.