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

#include <StgcRawDataMonAlg.h>

Inheritance diagram for sTgcRawDataMonAlg:
Collaboration diagram for sTgcRawDataMonAlg:

Public Types

enum class  Environment_t {
  user = 0 , online , tier0 , tier0Raw ,
  tier0ESD , AOD , altprod
}
 Specifies the processing environment. More...
enum class  DataType_t {
  userDefined = 0 , monteCarlo , collisions , cosmics ,
  heavyIonCollisions
}
 Specifies what type of input data is being monitored. More...

Public Member Functions

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

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

ToolHandleArray< GenericMonitoringToolm_tools {this,"GMTools",{}}
 Array of Generic Monitoring Tools.
PublicToolHandle< Trig::TrigDecisionToolm_trigDecTool
 Tool to tell whether a specific trigger is passed.
ToolHandleArray< IDQFilterToolm_DQFilterTools {this,"FilterTools",{}}
 Array of Data Quality filter tools.
SG::ReadCondHandleKey< LuminosityCondDatam_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
SG::ReadCondHandleKey< LBDurationCondDatam_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
SG::ReadCondHandleKey< TrigLiveFractionCondDatam_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"}
AthMonitorAlgorithm::Environment_t m_environment
 Instance of the Environment_t enum.
AthMonitorAlgorithm::DataType_t m_dataType
 Instance of the DataType_t enum.
Gaudi::Property< std::string > m_environmentStr {this,"Environment","user"}
 Environment string pulled from the job option and converted to enum.
Gaudi::Property< std::string > m_dataTypeStr {this,"DataType","userDefined"}
 DataType string pulled from the job option and converted to enum.
Gaudi::Property< std::string > m_triggerChainString {this,"TriggerChain",""}
 Trigger chain string pulled from the job option and parsed into a vector.
std::vector< std::string > m_vTrigChainNames
 Vector of trigger chain names parsed from trigger chain string.
Gaudi::Property< std::string > m_fileKey {this,"FileKey",""}
 Internal Athena name for file.
Gaudi::Property< bool > m_useLumi {this,"EnableLumi",false}
 Allows use of various luminosity functions.
Gaudi::Property< float > m_defaultLBDuration {this,"DefaultLBDuration",60.}
 Default duration of one lumi block.
Gaudi::Property< int > m_detailLevel {this,"DetailLevel",0}
 Sets the level of detail used in the monitoring.
SG::ReadHandleKey< xAOD::EventInfom_EventInfoKey {this,"EventInfoKey","EventInfo"}
 Key for retrieving EventInfo from StoreGate.

Private Types

using decoder = Muon::nsw::NSWPadTriggerL1a
using mapper = Muon::nsw::MapperSTG
using MuonSectorMapping = Muon::MuonSectorMapping
typedef std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > MonVarVec_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void fillsTgcOccupancyHistograms (const Muon::sTgcPrepDataContainer *, const MuonGM::MuonDetectorManager *, const int lb) const
void fillsTgcLumiblockHistograms (const Muon::sTgcPrepDataContainer *, const int lb) const
void fillsTgcClusterFromTrackHistograms (const xAOD::TrackParticleContainer *) const
void fillsTgcPadTriggerDataHistograms (const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const int lb) const
void fillsTgcEfficiencyHistograms (const xAOD::MuonContainer *, const MuonGM::MuonDetectorManager *) const
void fillsTgcPadTriggerEfficiencyHistograms (const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
int getFEBs (int eta, int layers) const
int getSectors (const Identifier &id) const
int getLayer (const int multiplet, const int gasGap) const
int32_t sourceidToSector (uint32_t sourceid, bool isSideA) const
int getSignedPhiId (const uint32_t phiid) const
std::optional< IdentifiergetPadId (uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
std::optional< std::tuple< Identifier, const Trk::RIO_OnTrack * > > getRotIdAndRotObject (const Trk::TrackStateOnSurface *trkState) const
std::optional< IdentifiergetRotId (const Trk::TrackStateOnSurface *trkState) const
std::optional< std::tuple< int, int, std::string, std::string, int > > getPadEtaPhiTuple (uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
std::optional< double > band2theta (double rPosAtNSW, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
std::optional< double > band2eta (double rPosAtNSW, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
std::optional< double > rPosAtNsw2eta (double rPosAtNSW, bool isA, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
std::optional< double > bandId2eta (int bandid, bool isLarge, bool isA, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
double triggersectorphiid2phi (uint32_t sourceid, int trigger_phiid) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
ToolHandle< Trk::IResidualPullCalculatorm_residualPullCalculator {this, "ResPullCalc", "Trk::ResidualPullCalculator/ResidualPullCalculator"}
SG::ReadHandleKey< Muon::sTgcPrepDataContainerm_sTgcContainerKey {this,"sTgcPrepDataContainerName", "STGC_Measurements"}
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_detectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager","Key of input MuonDetectorManager condition data"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_meTrkKey {this, "METrkContainer", "ExtrapolatedMuonTrackParticles"}
SG::ReadHandleKey< Muon::NSW_PadTriggerDataContainerm_rdoKey {this, "NSW_PadTriggerDataKey", ""}
SG::ReadHandleKey< xAOD::MuonContainerm_muonKey {this, "MuonsKey", "Muons"}
Gaudi::Property< double > m_cutPt {this, "cutPt", 15000.}
Gaudi::Property< double > m_cutEtaDown {this, "cutEtaDown", 1.3}
Gaudi::Property< double > m_cutEtaUp {this, "cutEtaUp", 2.4}
Gaudi::Property< double > m_minDeltaR {this, "minDeltaR", 0.1}
Gaudi::Property< int > m_cutTriggerPhiId {this, "cutTriggerPhiId", 63}
Gaudi::Property< int > m_cutTriggerBandId {this, "cutTriggerBandId", 255}
std::string m_name
std::unordered_map< std::string, size_t > m_toolLookupMap
const ToolHandle< GenericMonitoringToolm_dummy
Gaudi::Property< bool > m_enforceExpressTriggers
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static constexpr uint32_t NVMMCHAN = Muon::nsw::Constants::N_CHAN_PER_VMM
static constexpr uint32_t FIRSTPFEBVMM = 1

Detailed Description

Definition at line 55 of file StgcRawDataMonAlg.h.

Member Typedef Documentation

◆ decoder

◆ mapper

Definition at line 57 of file StgcRawDataMonAlg.h.

◆ MonVarVec_t

typedef std::vector<std::reference_wrapper<Monitored::IMonitoredVariable> > AthMonitorAlgorithm::MonVarVec_t
privateinherited

Definition at line 370 of file AthMonitorAlgorithm.h.

◆ MuonSectorMapping

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ DataType_t

enum class AthMonitorAlgorithm::DataType_t
stronginherited

Specifies what type of input data is being monitored.

An enumeration of the different types of data the monitoring application may be running over. This can be used to select which histograms to produce, e.g. to prevent the production of colliding-beam histograms when running on cosmic-ray data. Strings of the same names may be given as jobOptions.

Enumerator
userDefined 
monteCarlo 
collisions 
cosmics 
heavyIonCollisions 

Definition at line 194 of file AthMonitorAlgorithm.h.

194 {
195 userDefined = 0,
196 monteCarlo,
197 collisions,
198 cosmics,
199 heavyIonCollisions,
200 };
AthConfigFlags cosmics(AthConfigFlags flags, str instanceName, str recoMode)

◆ Environment_t

enum class AthMonitorAlgorithm::Environment_t
stronginherited

Specifies the processing environment.

The running environment may be used to select which histograms are produced, and where they are located in the output. For example, the output paths of the histograms are different for the "user", "online" and the various offline flags. Strings of the same names may be given as jobOptions.

Enumerator
user 
online 
tier0 
tier0Raw 
tier0ESD 
AOD 
altprod 

Definition at line 175 of file AthMonitorAlgorithm.h.

175 {
176 user = 0,
177 online,
178 tier0,
179 tier0Raw,
180 tier0ESD,
181 AOD,
182 altprod,
183 };

Constructor & Destructor Documentation

◆ sTgcRawDataMonAlg()

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

Definition at line 23 of file StgcRawDataMonAlg.cxx.

23 : AthMonitorAlgorithm(name, pSvcLocator) {
24 //Declare the property
25}
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~sTgcRawDataMonAlg()

virtual sTgcRawDataMonAlg::~sTgcRawDataMonAlg ( )
virtualdefault

Member Function Documentation

◆ band2eta()

std::optional< double > sTgcRawDataMonAlg::band2eta ( double rPosAtNSW,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 157 of file StgcRawDataUtils.cxx.

157 {
158 std::optional<double> status = band2theta(rPosAtNSW, muonDetectorManagerObject);
159 if (!status.has_value()) return std::nullopt;
160 double theta = status.value();
161 if (!std::isnormal(theta/2.)) return std::nullopt;
162 double eta = -std::log(std::tan(theta/2.));
163 return std::make_optional(eta);
164}
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
std::optional< double > band2theta(double rPosAtNSW, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
status
Definition merge.py:16

◆ band2theta()

std::optional< double > sTgcRawDataMonAlg::band2theta ( double rPosAtNSW,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 138 of file StgcRawDataUtils.cxx.

138 {
139 const auto& help = m_idHelperSvc -> stgcIdHelper();
140 bool isValid = false;
141
142 const Identifier maxNSWZid = m_idHelperSvc -> stgcIdHelper().channelID("STL", 1, help.stationPhiMin(), help.multilayerMax(), help.gasGapMax(), sTgcIdHelper::sTgcChannelTypes::Pad, 1, isValid);
143
144 if (!isValid) {
145 ATH_MSG_WARNING("Identifier for maximum value of NSW global Z-coordinate is invalid!");
146 return std::nullopt;
147 }
148
149 Amg::Vector3D posNSW{Amg::Vector3D::Zero()};
150 (muonDetectorManagerObject -> getsTgcReadoutElement(maxNSWZid)) -> stripGlobalPosition(maxNSWZid, posNSW);
151 float posNSWZ = posNSW.z();
152
153 double theta = std::atan(rPosAtNSW/posNSWZ);
154 return std::make_optional(theta);
155}
#define ATH_MSG_WARNING(x)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Eigen::Matrix< double, 3, 1 > Vector3D

◆ bandId2eta()

std::optional< double > sTgcRawDataMonAlg::bandId2eta ( int bandid,
bool isLarge,
bool isA,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 178 of file StgcRawDataUtils.cxx.

178 {
179 double rPosAtNSW = MuonGM::sTgcReadoutElement::triggerBandIdToRadius(isLarge,bandid);
180 std::optional<double> status = rPosAtNsw2eta(rPosAtNSW, isA, muonDetectorManagerObject);
181 if (!status.has_value()) return std::nullopt;
182 double rPosAtNsw2eta = status.value();
183
184 return std::make_optional(rPosAtNsw2eta);
185}
std::optional< double > rPosAtNsw2eta(double rPosAtNSW, bool isA, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const

◆ dataType()

DataType_t AthMonitorAlgorithm::dataType ( ) const
inlineinherited

Accessor functions for the data type.

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

Definition at line 224 of file AthMonitorAlgorithm.h.

224{ return m_dataType; }
AthMonitorAlgorithm::DataType_t m_dataType
Instance of the DataType_t enum.

◆ dataTypeStringToEnum()

AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::dataTypeStringToEnum ( const std::string & str) const
inherited

Convert the data type string from the python configuration to an enum object.

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

Definition at line 144 of file AthMonitorAlgorithm.cxx.

144 {
145 // convert the string to all lowercase
146 std::string lowerCaseStr = str;
147 std::transform(lowerCaseStr.begin(), lowerCaseStr.end(), lowerCaseStr.begin(), ::tolower);
148
149 // check if it matches one of the enum choices
150 if( lowerCaseStr == "userdefined" ) {
152 } else if( lowerCaseStr == "montecarlo" ) {
154 } else if( lowerCaseStr == "collisions" ) {
156 } else if( lowerCaseStr == "cosmics" ) {
157 return DataType_t::cosmics;
158 } else if( lowerCaseStr == "heavyioncollisions" ) {
160 } else { // otherwise, warn the user and return "userDefined"
161 ATH_MSG_WARNING("AthMonitorAlgorithm::dataTypeStringToEnum(): Unknown data type "
162 <<str<<", returning userDefined.");
164 }
165}
void tolower(std::string &s)

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ environment()

Environment_t AthMonitorAlgorithm::environment ( ) const
inlineinherited

Accessor functions for the environment.

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

Definition at line 208 of file AthMonitorAlgorithm.h.

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

◆ envStringToEnum()

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

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

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

Definition at line 116 of file AthMonitorAlgorithm.cxx.

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

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

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

Applies filters and trigger requirements.

Then, calls fillHistograms().

Parameters
ctxevent context for reentrant Athena call
Returns
StatusCode

Definition at line 77 of file AthMonitorAlgorithm.cxx.

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

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ fillHistograms()

StatusCode sTgcRawDataMonAlg::fillHistograms ( const EventContext & ctx) const
overridevirtual

adds event to the monitoring histograms

User will overwrite this function. Histogram booking is no longer done in C++. This function is called in execute once the filters are all passed.

Parameters
ctxforwarded from execute
Returns
StatusCode

Implements AthMonitorAlgorithm.

Definition at line 40 of file StgcRawDataMonAlg.cxx.

40 {
41 const int lumiblock = GetEventInfo(ctx) -> lumiBlock();
42
43 SG::ReadHandle<Muon::sTgcPrepDataContainer> sTgcContainer(m_sTgcContainerKey, ctx);
44 SG::ReadCondHandle<MuonGM::MuonDetectorManager> detectorManagerKey(m_detectorManagerKey, ctx);
45 SG::ReadHandle<xAOD::TrackParticleContainer> meTPContainer(m_meTrkKey, ctx);
46 SG::ReadHandle<xAOD::MuonContainer> muonContainer(m_muonKey, ctx);
47
48 if (!meTPContainer.isValid()) {
49 ATH_MSG_FATAL("Could not get track particle container: " << m_meTrkKey.fullKey());
50 return StatusCode::FAILURE;
51 }
52
53 if (!muonContainer.isValid()) {
54 ATH_MSG_FATAL("Could not get muon container: " << m_muonKey.fullKey());
55 return StatusCode::FAILURE;
56 }
57
58 if(!m_rdoKey.key().empty()){
59 SG::ReadHandle<Muon::NSW_PadTriggerDataContainer> NSWpadTriggerContainer(m_rdoKey, ctx);
60 if (!NSWpadTriggerContainer.isValid()) {
61 ATH_MSG_FATAL("Could not get pad trigger data container: " << m_rdoKey.fullKey());
62 return StatusCode::FAILURE;
63 }
64 fillsTgcPadTriggerDataHistograms(muonContainer.cptr(), NSWpadTriggerContainer.cptr(), lumiblock);
65 fillsTgcPadTriggerEfficiencyHistograms(muonContainer.cptr(), NSWpadTriggerContainer.cptr(), detectorManagerKey.cptr());
66 }
67
68 ATH_MSG_DEBUG("Lumiblock: " << lumiblock);
69
70 fillsTgcClusterFromTrackHistograms(meTPContainer.cptr());
71 fillsTgcEfficiencyHistograms(muonContainer.cptr(), detectorManagerKey.cptr());
72 fillsTgcOccupancyHistograms(sTgcContainer.cptr(), detectorManagerKey.cptr(), lumiblock);
73 fillsTgcLumiblockHistograms(sTgcContainer.cptr(), lumiblock);
74
75 return StatusCode::SUCCESS;
76}
#define ATH_MSG_FATAL(x)
xAOD::MuonContainer * muonContainer
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
SG::ReadHandleKey< Muon::NSW_PadTriggerDataContainer > m_rdoKey
void fillsTgcLumiblockHistograms(const Muon::sTgcPrepDataContainer *, const int lb) const
void fillsTgcOccupancyHistograms(const Muon::sTgcPrepDataContainer *, const MuonGM::MuonDetectorManager *, const int lb) const
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_meTrkKey
void fillsTgcPadTriggerEfficiencyHistograms(const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detectorManagerKey
void fillsTgcPadTriggerDataHistograms(const xAOD::MuonContainer *, const Muon::NSW_PadTriggerDataContainer *, const int lb) const
void fillsTgcClusterFromTrackHistograms(const xAOD::TrackParticleContainer *) const
void fillsTgcEfficiencyHistograms(const xAOD::MuonContainer *, const MuonGM::MuonDetectorManager *) const
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_sTgcContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
setTeId lumiBlock

◆ fillsTgcClusterFromTrackHistograms()

void sTgcRawDataMonAlg::fillsTgcClusterFromTrackHistograms ( const xAOD::TrackParticleContainer * trkPartCont) const
private

Definition at line 224 of file StgcRawDataMonAlg.cxx.

224 {
225 ATH_MSG_DEBUG("On fillsTgcClusterFromTrackHistograms");
226 for (const xAOD::TrackParticle* meTP : *trkPartCont) {
227 const Trk::Track* meTrack = meTP -> track();
228 if(!meTrack) continue;
229 for (const Trk::TrackStateOnSurface* trkState : *meTrack -> trackStateOnSurfaces()) {
230 std::optional<std::tuple<Identifier, const Trk::RIO_OnTrack*>> status = getRotIdAndRotObject(trkState);
231 if (!status.has_value()) continue;
232 std::tuple<Identifier, const Trk::RIO_OnTrack*> rotIDtuple = status.value();
233
234 Identifier rot_id = std::get<Identifier>(rotIDtuple);
235
236 const Muon::sTgcClusterOnTrack* cluster = dynamic_cast<const Muon::sTgcClusterOnTrack*>(std::get<const Trk::RIO_OnTrack*>(rotIDtuple));
237 if(!cluster) continue;
238
239 const Muon::sTgcPrepData* prd = cluster -> prepRawData();
240 if (!prd) continue;
241
242 const MuonGM::sTgcReadoutElement* rdoEl = prd->detectorElement();
243 if (!rdoEl) continue;
244
245 const Amg::Vector2D& localPos = prd->localPosition();
246
247 int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
248 int stEta = m_idHelperSvc -> stgcIdHelper().stationEta(rot_id);
249 int multi = m_idHelperSvc -> stgcIdHelper().multilayer(rot_id);
250 int gap = m_idHelperSvc -> stgcIdHelper().gasGap(rot_id);
251 int sector = m_idHelperSvc -> sector(rot_id);
252 int sectorsTotal = getSectors(rot_id);
253 int layer = getLayer(multi, gap);
254 int iside = (stEta > 0) ? 1 : 0;
255 std::string side = GeometricSectors::sTgcSide[iside];
256 std::string channelName = "";
257 std::string sectorStr = std::to_string(sector);
258
259 std::string quadLabel = "";
260 bool isInner = false;
261 bool isQ1 = (std::abs(stEta) == 1);
262 if (isQ1) {
263 isInner = rdoEl->isEtaZero(rot_id, localPos);
264 quadLabel = isInner ? "Q1Inner" : "Q1Outer";
265 } else {
266 quadLabel = "Q" + std::to_string(std::abs(stEta));
267 }
268
269 if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
270 float padCharge = prd -> charge();
271 auto padChargeMon = Monitored::Scalar<float>("padTrackCharge_" + side + "_quad_" + quadLabel + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), padCharge);
272 fill("padCharge_" + side + std::to_string(sector) + "_quad_" + quadLabel, padChargeMon);
273
274 short int padTiming = prd -> time();
275 auto padSectorSidedMon = Monitored::Scalar<int>("padTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
276 auto padTimingMon = Monitored::Scalar<float>("padTrackTiming_layer_" + std::to_string(layer), padTiming);
277 fill("sTgcTiming", padSectorSidedMon, padTimingMon);
278
279 auto padSectorSidedExpertMon = Monitored::Scalar<int>("padTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
280 auto padTimingExpertMon = Monitored::Scalar<float>("padTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), padTiming);
281 fill("padTiming_quad_" + std::to_string(std::abs(stEta)), padSectorSidedExpertMon, padTimingExpertMon);
282
283 ATH_MSG_DEBUG("Pad Timing: " << padTiming);
284
285 auto febMon = Monitored::Scalar<int>("padFEB"+ side + sectorStr, getFEBs(stEta,layer));
286 auto timeMon = Monitored::Scalar<int>("padTiming"+ side + sectorStr, padTiming);
287 fill("sTgcTiming", timeMon, febMon);
288 }
289
290 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) {
291 channelName = "strip";
292 const std::vector<Identifier>& stripIds = prd->rdoList();
293 unsigned int csize = stripIds.size();
294
295 std::vector<short int> stripTimesVec = prd -> stripTimes();
296 std::vector<int> stripChargesVec = prd -> stripCharges();
297
298 float stripClusterTimes = 0;
299 float stripClusterCharges = 0;
300
301 for (unsigned int sIdx = 0; sIdx < csize; ++sIdx) {
302 stripClusterTimes += stripTimesVec.at(sIdx);
303 stripClusterCharges += stripChargesVec.at(sIdx);
304 }
305
306 stripClusterTimes /= stripTimesVec.size();
307
308 auto stripClusterChargesPerSideQuadMon = Monitored::Scalar<float>("stripTrackCharge_" + side + "_quad_" + quadLabel + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), stripClusterCharges);
309 fill("stripCharge_" + side + std::to_string(sector) + "_quad_" + quadLabel, stripClusterChargesPerSideQuadMon);
310
311
312 auto stripClusterSectorSidedMon = Monitored::Scalar<int>("stripTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
313 auto stripClusterTimesMon = Monitored::Scalar<float>("stripTrackTiming_layer_" + std::to_string(layer), stripClusterTimes);
314 auto stripClusterSizeMon = Monitored::Scalar<unsigned int>("stripTrackClusterSize_layer_" + std::to_string(layer), csize);
315 fill("sTgcTiming", stripClusterSectorSidedMon, stripClusterTimesMon);
316 fill("padTriggerExpert", stripClusterSectorSidedMon, stripClusterSizeMon);
317
318 ATH_MSG_DEBUG("Strip Timing: " << stripClusterTimes);
319
320 auto febMon = Monitored::Scalar<int>("stripFEB"+ side + sectorStr, getFEBs(stEta,layer));
321 auto timeMon = Monitored::Scalar<int>("stripTiming"+ side + sectorStr, stripClusterTimes);
322 fill("sTgcTiming", timeMon, febMon);
323
324
325 auto stripSectorSidedExpertMon = Monitored::Scalar<int>("stripTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
326 auto stripTimingExpertMon = Monitored::Scalar<float>("stripTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), stripClusterTimes);
327 fill("stripTiming_quad_" + std::to_string(std::abs(stEta)), stripSectorSidedExpertMon, stripTimingExpertMon);
328
329
330 std::optional<Trk::ResidualPull> resPull(m_residualPullCalculator -> residualPull(trkState -> measurementOnTrack(), trkState -> trackParameters(), Trk::ResidualPull::ResidualType::Biased));
331
332 if (resPull) {
333 float residual = resPull -> residual()[Trk::locX];
334 auto residualMon = Monitored::Scalar<float>("residual_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), residual);
335 fill("sTgcResiduals_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), residualMon);
336 }
337 }
338
339 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) {
340 float wireGroupCharge = prd -> charge();
341 auto wireGroupChargeMon = Monitored::Scalar<float>("wireGroupTrackCharge_" + side + "_quad_" + std::to_string(std::abs(stEta)) + "_sector_" + std::to_string(sector) + "_layer_" + std::to_string(layer), wireGroupCharge);
342 fill("wireGroupCharge_" + side + std::to_string(sector) + "_quad_" + std::to_string(std::abs(stEta)), wireGroupChargeMon);
343
344 short int wireGroupTiming = prd -> time();
345 auto wireGroupSectorSidedMon = Monitored::Scalar<int>("wireGroupTrackSectorSided_layer_" + std::to_string(layer), sectorsTotal);
346 auto wireGroupTimingMon = Monitored::Scalar<float>("wireGroupTrackTiming_layer_" + std::to_string(layer), wireGroupTiming);
347 fill("sTgcTiming", wireGroupSectorSidedMon, wireGroupTimingMon);
348
349 auto wireSectorSidedExpertMon = Monitored::Scalar<int>("wireTrackSectorSided_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), sectorsTotal);
350 auto wireTimingExpertMon = Monitored::Scalar<float>("wireTrackTiming_quad_" + std::to_string(std::abs(stEta)) + "_layer_" + std::to_string(layer), wireGroupTiming);
351 fill("wireTiming_quad_" + std::to_string(std::abs(stEta)), wireSectorSidedExpertMon, wireTimingExpertMon);
352
353 ATH_MSG_DEBUG("Wire Timing: " << wireGroupTiming);
354
355 auto febMon = Monitored::Scalar<int>("wireFEB"+ side + sectorStr, getFEBs(stEta,layer));
356 auto timeMon = Monitored::Scalar<int>("wireTiming"+ side + sectorStr, wireGroupTiming);
357 fill("sTgcTiming", timeMon, febMon);
358 }
359 }
360 }
361 ATH_MSG_DEBUG("Off fillsTgcClusterFromTrackHistograms");
362}
double charge(const T &p)
Definition AtlasPID.h:997
bool isEtaZero(const Identifier &id, const Amg::Vector2D &localPosition) const
is eta=0 of QL1 or QS1?
virtual const MuonGM::sTgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
const Amg::Vector2D & localPosition() const
return the local position reference
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
@ Biased
RP with track state including the hit.
std::optional< std::tuple< Identifier, const Trk::RIO_OnTrack * > > getRotIdAndRotObject(const Trk::TrackStateOnSurface *trkState) const
int getLayer(const int multiplet, const int gasGap) const
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
int getSectors(const Identifier &id) const
int getFEBs(int eta, int layers) const
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
Eigen::Matrix< double, 2, 1 > Vector2D
gap(flags, cells_name, *args, **kw)
time(flags, cells_name, *args, **kw)
static const std::array< std::string, 2 > sTgcSide
@ layer
Definition HitInfo.h:79
@ locX
Definition ParamDefs.h:37
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ fillsTgcEfficiencyHistograms()

void sTgcRawDataMonAlg::fillsTgcEfficiencyHistograms ( const xAOD::MuonContainer * muonContainer,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 475 of file StgcRawDataMonAlg.cxx.

475 {
476 ATH_MSG_DEBUG("On fillsTgcEfficiencyHistograms");
477 for (const xAOD::Muon* mu : *muonContainer) {
478 if (mu -> pt() < m_cutPt) continue;
479 if (!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
480
481 struct sTGCeff {
482 std::array<int, 8> quadMultiplet{};
483 std::array<int, 8> layerMultiplet{};
484 std::array<float, 8> xPosMultiplet{};
485 std::array<float, 8> yPosMultiplet{};
486 std::array<float, 8> zPosMultiplet{};
487 };
488
489 std::array<std::array<sTGCeff, 16>, 2> effPlots; // Store active layers per side (2) and sectors (16)
490
491 const xAOD::TrackParticle* meTP = mu -> trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
492 if(meTP == nullptr) continue;
493
494 const Trk::Track* meTrack = meTP -> track();
495 if(!meTrack) continue;
496
497 for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
498 std::optional<Identifier> status = getRotId(trkState);
499 if (!status.has_value()) continue;
500
501 Identifier rot_id = status.value();
502
503 int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
504 if (channelType != sTgcIdHelper::sTgcChannelTypes::Strip) continue;
505
506 int stEta = m_idHelperSvc -> stgcIdHelper().stationEta(rot_id);
507 int iside = (stEta > 0) ? 1 : 0;
508 int sector = m_idHelperSvc -> sector(rot_id);
509 int multi = m_idHelperSvc -> stgcIdHelper().multilayer(rot_id);
510 int gap = m_idHelperSvc -> stgcIdHelper().gasGap(rot_id);
511 int layer = getLayer(multi, gap);
512
513 const Amg::Vector2D& positionsMultiplet = (trkState) -> trackParameters() -> localPosition();
514 float xPosStripInMultipletLocal = positionsMultiplet.x();
515 float yPosStripInMultipletLocal = positionsMultiplet.y();
516
517 Amg::Vector2D localPos(xPosStripInMultipletLocal, yPosStripInMultipletLocal);
518 Amg::Vector3D globalPos(Amg::Vector3D::Zero());
519 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStrip = muonDetectorManagerObject -> getsTgcReadoutElement(rot_id);
520 sTgcReadoutObjectStrip -> surface(rot_id).localToGlobal(localPos, Amg::Vector3D::Zero(), globalPos);
521 float xPosStripInMultiplet = globalPos.x();
522 float yPosStripInMultiplet = globalPos.y();
523
524 Amg::Vector3D posStripGlobal{Amg::Vector3D::Zero()};
525 (muonDetectorManagerObject -> getsTgcReadoutElement(rot_id)) -> stripGlobalPosition(rot_id, posStripGlobal);
526 float zPosStripInMultiplet = posStripGlobal.z();
527
528 auto& sTGCelements = effPlots[iside][sector - 1];
529
530 sTGCelements.quadMultiplet.at(layer - 1) = stEta;
531 sTGCelements.layerMultiplet.at(layer - 1) = layer;
532 sTGCelements.xPosMultiplet.at(layer - 1) = xPosStripInMultiplet;
533 sTGCelements.yPosMultiplet.at(layer - 1) = yPosStripInMultiplet;
534 sTGCelements.zPosMultiplet.at(layer - 1) = zPosStripInMultiplet;
535 } // end track state loop
536
537 for (unsigned int isideIndex = 0; isideIndex <= 1; ++isideIndex) {
538 for (unsigned int sectorIndex = 1; sectorIndex <= 16; ++sectorIndex) {
539 auto& sTGCelements = effPlots[isideIndex][sectorIndex - 1];
540 bool fourOutEight = std::count_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) { return i != 0; }) >= 4;
541 bool oneRefLayer = std::count_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) { return i != 0; }) >= 1;
542
543 if (fourOutEight) {
544 for (auto layerIndex = static_cast<std::array<int, 8>::size_type>(1); layerIndex <= sTGCelements.layerMultiplet.size(); ++layerIndex) {
545 if (sTGCelements.layerMultiplet.at(layerIndex - 1) == 0) continue;
546
547 float xPos = sTGCelements.xPosMultiplet.at(layerIndex - 1);
548 float yPos = sTGCelements.yPosMultiplet.at(layerIndex - 1);
549 float rPos = std::hypot(xPos, yPos);
550
551 std::string side = GeometricSectors::sTgcSide[isideIndex];
552
553 auto effQuestionMon = Monitored::Scalar<bool>("hitLayer", true);
554 auto rPosStripMon = Monitored::Scalar<float>("rPosStrip_" + side + "_sector_" + std::to_string(sectorIndex) + "_layer_" + std::to_string(layerIndex), rPos);
555 fill("rPosStrip_" + side + std::to_string(sectorIndex), rPosStripMon, effQuestionMon);
556 //GlobalRGroup
557
558 auto xPosStripmon = Monitored::Scalar<float>("xPosStrip_" + side + "_layer_" + std::to_string(layerIndex), xPos);
559 auto yPosStripmon = Monitored::Scalar<float>("yPosStrip_" + side + "_layer_" + std::to_string(layerIndex), yPos);
560 fill("padTriggerShifter", xPosStripmon, yPosStripmon, effQuestionMon);
561 //StripEfficiency
562 } // End of loop over efficient layers
563 } // End of efficient case
564
565 else if (!fourOutEight && oneRefLayer) {
566 auto refLayerIndex = std::distance(sTGCelements.layerMultiplet.begin(), std::find_if(sTGCelements.layerMultiplet.begin(), sTGCelements.layerMultiplet.end(), [](int i) {return i != 0;}));
567
568 for (auto layerIndex = static_cast<std::array<int, 8>::size_type>(1); layerIndex <= sTGCelements.layerMultiplet.size(); ++layerIndex) {
569 if (sTGCelements.layerMultiplet.at(layerIndex - 1) != 0) continue;
570 int quad = sTGCelements.quadMultiplet.at(refLayerIndex);
571 int multi = (layerIndex <= static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax())) ? m_idHelperSvc->stgcIdHelper().multilayerMin() : m_idHelperSvc->stgcIdHelper().multilayerMax();
572 int gap = (layerIndex <= static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax())) ? layerIndex : layerIndex - static_cast<std::array<int, 8>::size_type>(m_idHelperSvc->stgcIdHelper().gasGapMax());
573
574 bool isValid = false;
575 const Identifier idProbe = m_idHelperSvc -> stgcIdHelper().channelID((sectorIndex % 2 == 0) ? "STS" : "STL", quad, (sectorIndex % 2 == 0) ? sectorIndex/2 : (sectorIndex + 1)/2, multi, gap, sTgcIdHelper::sTgcChannelTypes::Strip, 1, isValid);
576
577 if (!isValid) {
578 ATH_MSG_WARNING("Identifier of probe layer is invalid");
579 continue;
580 }
581
582 Amg::Vector3D posProbe{Amg::Vector3D::Zero()};
583 (muonDetectorManagerObject -> getsTgcReadoutElement(idProbe)) -> stripGlobalPosition(idProbe, posProbe);
584 float posZprobe = posProbe.z();
585
586 float xSlope = sTGCelements.xPosMultiplet.at(refLayerIndex)/sTGCelements.zPosMultiplet.at(refLayerIndex);
587 float ySlope = sTGCelements.yPosMultiplet.at(refLayerIndex)/sTGCelements.zPosMultiplet.at(refLayerIndex);
588
589 float xPos = sTGCelements.xPosMultiplet.at(refLayerIndex) + xSlope*(posZprobe - sTGCelements.zPosMultiplet.at(refLayerIndex));
590 float yPos = sTGCelements.yPosMultiplet.at(refLayerIndex) + ySlope*(posZprobe - sTGCelements.zPosMultiplet.at(refLayerIndex));
591 float rPos = std::hypot(xPos, yPos);
592
593 std::string side = GeometricSectors::sTgcSide[isideIndex];
594
595 auto effQuestionMon = Monitored::Scalar<bool>("hitLayer", false);
596
597 auto rPosStripProbemon = Monitored::Scalar<float>("rPosStrip_" + side + "_sector_" + std::to_string(sectorIndex) + "_layer_" + std::to_string(layerIndex), rPos);
598 fill("rPosStrip_" + side + std::to_string(sectorIndex), rPosStripProbemon, effQuestionMon);
599
600 auto xPosStripProbemon = Monitored::Scalar<float>("xPosStrip_" + side + "_layer_" + std::to_string(layerIndex), xPos);
601 auto yPosStripProbemon = Monitored::Scalar<float>("yPosStrip_" + side + "_layer_" + std::to_string(layerIndex), yPos);
602 fill("padTriggerShifter", xPosStripProbemon, yPosStripProbemon, effQuestionMon);
603 } // End of loop over probe layers
604 } // End of non-efficient case
605 } // End of sector loop
606 } // End of iside loop
607 } // End muon container loop
608 ATH_MSG_DEBUG("Off fillsTgcClusterFromTrackHistograms");
609} // end stgc strip function
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Gaudi::Property< double > m_cutPt
std::optional< Identifier > getRotId(const Trk::TrackStateOnSurface *trkState) const
Muon_v1 Muon
Reference the current persistent version:

◆ fillsTgcLumiblockHistograms()

void sTgcRawDataMonAlg::fillsTgcLumiblockHistograms ( const Muon::sTgcPrepDataContainer * sTgcContainer,
const int lb ) const
private

Definition at line 184 of file StgcRawDataMonAlg.cxx.

184 {
185 ATH_MSG_DEBUG("On fillsTgcLumiblockHistograms");
186 for(const Muon::sTgcPrepDataCollection* coll : *sTgcContainer) {
187 for (const Muon::sTgcPrepData* prd : *coll) {
188 Identifier id = prd -> identify();
189
190
191 std::string stationName = m_idHelperSvc -> stgcIdHelper().stationNameString(m_idHelperSvc -> stgcIdHelper().stationName(id));
192 int stationEta = m_idHelperSvc -> stgcIdHelper().stationEta(id);
193 int multiplet = m_idHelperSvc -> stgcIdHelper().multilayer(id);
194 int gasGap = m_idHelperSvc -> stgcIdHelper().gasGap(id);
195 int channelType = m_idHelperSvc -> stgcIdHelper().channelType(id);
196 int sector = m_idHelperSvc -> sector(id);
197 std::string sectorStr = std::to_string(sector);
198 int sectorsTotal = getSectors(id);
199 int numberOfHits = coll->size();
200 int layer = getLayer(multiplet, gasGap);
201 std::string layerStr = std::to_string(layer);
202 int iside = (stationEta > 0) ? 1 : 0;
203 std::string side = GeometricSectors::sTgcSide[iside];
204 int feb = getFEBs(stationEta,layer);
205 std::string channelName = "";
206
207 if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) channelName = "pad";
208 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) channelName = "strip";
209 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) channelName = "wire";
210
211 auto febMon = Monitored::Scalar<int>(channelName+"FEBsector"+side+sectorStr, feb);
212 auto lbMon = Monitored::Scalar<int>(channelName+"LBsector"+side+sectorStr, lb);
213 auto sectorMon = Monitored::Scalar<int>(channelName+"Sector", sectorsTotal);
214 auto lbbMon = Monitored::Scalar<int>(channelName+"Lb", lb);
215 auto numberOfHitsMon = Monitored::Scalar<int>(channelName+"NumberOfHits", numberOfHits);
216
217 fill("LBExpertGroup", lbMon, febMon);
218 }
219 }
220 ATH_MSG_DEBUG("Off fillsTgcLumiblockHistograms");
221}
int lb
Definition globals.cxx:23
MuonPrepDataCollection< sTgcPrepData > sTgcPrepDataCollection
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.

◆ fillsTgcOccupancyHistograms()

void sTgcRawDataMonAlg::fillsTgcOccupancyHistograms ( const Muon::sTgcPrepDataContainer * sTgcContainer,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject,
const int lb ) const
private

Definition at line 78 of file StgcRawDataMonAlg.cxx.

78 {
79 ATH_MSG_DEBUG("ON fillsTgcOccupancyHistograms");
80 for(const Muon::sTgcPrepDataCollection* coll : *sTgcContainer) {
81 for (const Muon::sTgcPrepData* prd : *coll) {
82 Identifier id = prd -> identify();
83
84 if(!id.is_valid()) {
85 ATH_MSG_WARNING("Invalid identifier found in Muon::sTgcPrepData");
86 return;
87 }
88
89 std::string stationName = m_idHelperSvc -> stgcIdHelper().stationNameString(m_idHelperSvc -> stgcIdHelper().stationName(id));
90 int stationEta = m_idHelperSvc -> stgcIdHelper().stationEta(id);
91 int stationPhi = m_idHelperSvc -> stgcIdHelper().stationPhi(id);
92 int multiplet = m_idHelperSvc -> stgcIdHelper().multilayer(id);
93 int gasGap = m_idHelperSvc -> stgcIdHelper().gasGap(id);
94 int channelType = m_idHelperSvc -> stgcIdHelper().channelType(id);
95 int sector = m_idHelperSvc -> sector(id);
96 std::string sectorStr = std::to_string(sector);
97 int sectorsTotal = getSectors(id);
98 int layer = getLayer(multiplet, gasGap);
99 int stationEtaAbs = std::abs(stationEta);
100 std::string layerStr = std::to_string(layer);
101 int iside = (stationEta > 0) ? 1 : 0;
102 std::string side = GeometricSectors::sTgcSide[iside];
103 std::string channelName = "";
104
105 if (channelType == sTgcIdHelper::sTgcChannelTypes::Pad) {
106 channelName = "pad";
107 int padNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
108 Identifier idPadQ1 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 1, stationPhi, multiplet, gasGap, channelType, 1);
109 Identifier idPadQ2 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 2, stationPhi, multiplet, gasGap, channelType, 1);
110 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectPadQ1 = muonDetectorManagerObject -> getsTgcReadoutElement(idPadQ1);
111 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectPadQ2 = muonDetectorManagerObject -> getsTgcReadoutElement(idPadQ2);
112 int maxPadNumberQ1 = sTgcReadoutObjectPadQ1 -> maxPadNumber(idPadQ1);
113 int maxPadNumberQ2 = sTgcReadoutObjectPadQ2 -> maxPadNumber(idPadQ2);
114
115 if (stationEtaAbs == 2) padNumber = padNumber + maxPadNumberQ1;
116 else if (stationEtaAbs == 3) padNumber = padNumber + maxPadNumberQ1 + maxPadNumberQ2;
117
118 auto sectorMon = Monitored::Scalar<int>("sector_layer_" + layerStr, sectorsTotal);
119 auto padNumberMon = Monitored::Scalar<int>("padNumber_layer_" + layerStr, padNumber);
120 auto padLbMon = Monitored::Scalar<int>(channelName + "Lb", lb);
121 auto padsectMon = Monitored::Scalar<int>(channelName + "Sector", sectorsTotal);
122
123 fill("Occupancy", sectorMon, padNumberMon);
124
125 auto layerMon = Monitored::Scalar<int>(channelName+"layer_" + side + sectorStr, layer);
126 auto quadMon = Monitored::Scalar<int>(channelName+"quad_" + side + sectorStr, stationEtaAbs);
127 fill("Occupancy", layerMon, quadMon);
128 }
129
130 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Strip) {
131 channelName = "strip";
132 int stripNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
133 Identifier idStripQ1 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 1, stationPhi, multiplet, gasGap, channelType, 1);
134 Identifier idStripQ2 = m_idHelperSvc -> stgcIdHelper().channelID(stationName, 2, stationPhi, multiplet, gasGap, channelType, 1);
135 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStripQ1 = muonDetectorManagerObject -> getsTgcReadoutElement(idStripQ1);
136 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectStripQ2 = muonDetectorManagerObject -> getsTgcReadoutElement(idStripQ2);
137 int maxStripNumberQ1 = sTgcReadoutObjectStripQ1 -> numberOfStrips(idStripQ1);
138 int maxStripNumberQ2 = sTgcReadoutObjectStripQ2 -> numberOfStrips(idStripQ2);
139
140 if (stationEtaAbs == 2) stripNumber = stripNumber + maxStripNumberQ1 + 1;
141 else if (stationEtaAbs == 3) stripNumber = stripNumber + maxStripNumberQ1 + maxStripNumberQ2 + 1;
142
143 auto sectorMon = Monitored::Scalar<int>("sector_layer_" + layerStr, sectorsTotal);
144 auto stripNumberMon = Monitored::Scalar<int>("stripNumber_layer_" + layerStr, stripNumber);
145 auto stripLbMon = Monitored::Scalar<int>(channelName + "Lb", lb);
146 auto stripsectMon = Monitored::Scalar<int>(channelName + "Sector", sectorsTotal);
147
148 fill("Occupancy", sectorMon, stripNumberMon);
149
150 auto layerMon = Monitored::Scalar<int>(channelName+"layer_" + side + sectorStr, layer);
151 auto quadMon = Monitored::Scalar<int>(channelName+"quad_" + side + sectorStr, stationEtaAbs);
152 fill("Occupancy", layerMon, quadMon);
153 }
154
155 else if (channelType == sTgcIdHelper::sTgcChannelTypes::Wire) {
156 channelName = "wire";
157 int wireGroupNumber = m_idHelperSvc -> stgcIdHelper().channel(id);
158 Identifier idWireGroupQ3 = m_idHelperSvc -> stgcIdHelper().channelID("STL", 3, stationPhi, 1, 3, channelType, 1);
159 const MuonGM::sTgcReadoutElement* sTgcReadoutObjectWireGroupQ3 = muonDetectorManagerObject -> getsTgcReadoutElement(idWireGroupQ3);
160 int maxWireGroupNumberQ3 = sTgcReadoutObjectWireGroupQ3 -> numberOfStrips(idWireGroupQ3);
161
162 auto stationEtaMon = Monitored::Scalar<int>("stationEta_layer_" + layerStr, stationEta);
163 auto wireGroupNumberMon = Monitored::Scalar<int>("wireGroupNumber_layer_" + layerStr, wireGroupNumber + (sector - 1)*maxWireGroupNumberQ3);
164 auto wireLbMon = Monitored::Scalar<int>(channelName + "Lb", lb);
165 auto wiresectMon = Monitored::Scalar<int>(channelName + "Sector", sectorsTotal);
166 fill("Occupancy", stationEtaMon, wireGroupNumberMon);
167
168 auto layerMon = Monitored::Scalar<int>(channelName+"layer_" + side + sectorStr, layer);
169 auto quadMon = Monitored::Scalar<int>(channelName+"quad_" + side + sectorStr, stationEtaAbs);
170 fill("Occupancy", layerMon, quadMon);
171 }
172 auto sectorMon = Monitored::Scalar<int>(channelName+"Sector", sectorsTotal);
173 auto febMon = Monitored::Scalar<int>(channelName+"Feb", getFEBs(stationEta,layer));
174 auto lbMon = Monitored::Scalar<int>(channelName+"Lb", lb);
175
176 fill("Occupancy", sectorMon, febMon);
177 fill("LBShifterGroup", lbMon, sectorMon);
178 }
179 }
180 ATH_MSG_DEBUG("Off fillsTgcOccupancyHistograms");
181}
constexpr uint8_t stationPhi
station Phi 1 to 8

◆ fillsTgcPadTriggerDataHistograms()

void sTgcRawDataMonAlg::fillsTgcPadTriggerDataHistograms ( const xAOD::MuonContainer * muonContainer,
const Muon::NSW_PadTriggerDataContainer * NSWpadTriggerObject,
const int lb ) const
private

Definition at line 364 of file StgcRawDataMonAlg.cxx.

364 {
365 ATH_MSG_DEBUG("On fillsTgcPadTriggerDataHistograms");
366 for (const Muon::NSW_PadTriggerData* rdo : *NSWpadTriggerObject) {
367 bool sideA = rdo -> sideA();
368 bool largeSector = rdo -> largeSector();
369
370 int iside = (sideA) ? 1 : 0;
371 int isize = (largeSector) ? 1 : 0;
372
373 std::string side = GeometricSectors::sTgcSide[iside];
374 std::string size = GeometricSectors::sTgcSize[isize];
375
376 size_t numberOfTriggers = rdo -> getNumberOfTriggers();
377 size_t numberOfHits = rdo -> getNumberOfHits();
378
379 for (size_t trigger = 0; trigger < numberOfTriggers; ++trigger) {
380 int triggerPhiIdsUnsigned = rdo -> getTriggerPhiIds().at(trigger);
381 int triggerBandIds = rdo -> getTriggerBandIds().at(trigger);
382 int triggerRelBCID = rdo -> getTriggerRelBcids().at(trigger);
383 int sourceId = rdo -> getSourceid();
384 int sectorNumber = sourceidToSector(sourceId, sideA);
385
386 if (triggerPhiIdsUnsigned == m_cutTriggerPhiId || triggerBandIds == m_cutTriggerBandId) continue;
387
388 int triggerPhiIds = getSignedPhiId(triggerPhiIdsUnsigned);
389
390 auto phiIdsPerSideSizeMon = Monitored::Scalar<int>("phiIds_" + side + "_" + size, triggerPhiIds);
391 auto bandIdsPerSideSizeMon = Monitored::Scalar<int>("bandIds_" + side + "_" + size, triggerBandIds);
392 fill("padTriggerExpert", phiIdsPerSideSizeMon, bandIdsPerSideSizeMon);
393
394 auto lbMon = Monitored::Scalar<int>("lb", lb);
395 auto relBCIDMon = Monitored::Scalar<int>("relBCID", triggerRelBCID);
396 auto sectorMon = Monitored::Scalar<int>("sector", sectorNumber);
397 auto numberOfTriggersMon = Monitored::Scalar<int>("numberOfTriggers", numberOfTriggers);
398 fill("Overview", lbMon, sectorMon, numberOfTriggersMon);
399 fill("padTriggerExpert", lbMon, relBCIDMon);
400
401 auto numberOfTriggersPerSectorMon = Monitored::Scalar<int>("numberOfTriggers_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), numberOfTriggers);
402 auto phiIdsSidedSizedPerSectorMon = Monitored::Scalar<int>("phiIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerPhiIds);
403 auto bandIdsSidedSizedPerSectorMon = Monitored::Scalar<int>("bandIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerBandIds);
404 auto lbPerSectorMon = Monitored::Scalar<int>("lb_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), lb);
405 auto relBCIDperSectorMon = Monitored::Scalar<int>("relBCID_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerRelBCID);
406 fill("padTriggerExpert", numberOfTriggersPerSectorMon, phiIdsSidedSizedPerSectorMon, bandIdsSidedSizedPerSectorMon, lbPerSectorMon, relBCIDperSectorMon);
407
408 auto RelBCIDPerSectorMon = Monitored::Scalar<int>("relBCID_"+ side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerRelBCID);
409 auto PhiIDPerSectorMon = Monitored::Scalar<int>("phiIds_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerPhiIds);
410 auto BandIDPerSectorMon = Monitored::Scalar<int>("bandID_" + side + "_sector_" + std::to_string(std::abs(sectorNumber)), triggerBandIds);
411 fill("padTriggerExpert", RelBCIDPerSectorMon, PhiIDPerSectorMon, BandIDPerSectorMon);
412 }
413
414 for (size_t hits = 0; hits < numberOfHits; ++hits){
415 std::optional<Identifier> status = getPadId(rdo->getSourceid(), rdo->getHitPfebs().at(hits), rdo->getHitTdsChannels().at(hits));
416 if (!status.has_value()) continue;
417 Identifier pad_id = status.value();
418
419 for (const xAOD::Muon* mu : *muonContainer) {
420 if(mu -> pt() < m_cutPt) continue;
421 if(!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
422
423 const xAOD::TrackParticle* meTP = mu -> trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
424 if(meTP == nullptr) continue;
425
426 const Trk::Track* meTrack = meTP -> track();
427 if(!meTrack) continue;
428
429 for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
430 std::optional<Identifier> status = getRotId(trkState);
431 if (!status.has_value()) continue;
432 Identifier rot_id = status.value();
433
434 int channelType = m_idHelperSvc -> stgcIdHelper().channelType(rot_id);
435 if (channelType != sTgcIdHelper::sTgcChannelTypes::Pad) continue;
436
437
438 if (rot_id != pad_id) continue;
439
440 int sourceIds = rdo -> getSourceid();
441 int sectorNumbers = sourceidToSector(sourceIds, sideA);
442 int hitRelBCID = rdo -> getHitRelBcids().at(hits);
443 int hitpfebs = rdo -> getHitPfebs().at(hits);
444 int hitTdsChannels = rdo->getHitTdsChannels().at(hits);
445
446 std::optional<std::tuple<int, int, std::string, std::string, int>> statusPadEtaPhi = getPadEtaPhiTuple(sourceIds, hitpfebs, hitTdsChannels);
447 if (!statusPadEtaPhi.has_value()) continue;
448 std::tuple<int, int, std::string, std::string, int> padEtaPhiTuple = statusPadEtaPhi.value();
449
450 int padPhi = std::get<0>(padEtaPhiTuple);
451 int padEta = std::get<1>(padEtaPhiTuple);
452 std::string sideName = std::get<2>(padEtaPhiTuple);
453 std::string sizeName = std::get<3>(padEtaPhiTuple);
454 int layer = std::get<4>(padEtaPhiTuple);
455
456 auto padPhiMon = Monitored::Scalar<int>("padPhi_" + sideName + "_" + sizeName + "_layer_" + std::to_string(layer), padPhi);
457 auto padEtaMon = Monitored::Scalar<int>("padEta_" + sideName + "_" + sizeName + "_layer_" + std::to_string(layer), padEta);
458 fill("padTriggerOccupancy", padPhiMon, padEtaMon);
459
460 auto hitRelBCIDmon = Monitored::Scalar<int>("hitRelBCID", hitRelBCID);
461 auto hitPfebsMon = Monitored::Scalar<int>("hitPfebs", hitpfebs);
462 auto sectorMon = Monitored::Scalar<int>("sector", sectorNumbers);
463 fill("padTriggerExpert", hitRelBCIDmon, hitPfebsMon, sectorMon);
464
465 auto hitRelBCIDPerSectorMon = Monitored::Scalar<int>("hitRelBCID_"+side+"_sector_"+std::to_string(std::abs(sectorNumbers)), hitRelBCID);
466 auto hitpfebsPerSectorMon = Monitored::Scalar<int>("hitPfebs_"+side+"_sector_"+std::to_string(std::abs(sectorNumbers)), hitpfebs);
467 fill("padTriggerExpert", hitRelBCIDPerSectorMon, hitpfebsPerSectorMon);
468 } // end TrackStateOnSurface loop
469 } // end Muon loop
470 } // end NSW_PadTriggerData loop
471 }// end Number of Hits loop
472 ATH_MSG_DEBUG("Off fillsTgcPadTriggerDataHistograms");
473}
size_t size() const
Number of registered mappings.
int getSignedPhiId(const uint32_t phiid) const
int32_t sourceidToSector(uint32_t sourceid, bool isSideA) const
Gaudi::Property< int > m_cutTriggerBandId
Gaudi::Property< int > m_cutTriggerPhiId
std::optional< std::tuple< int, int, std::string, std::string, int > > getPadEtaPhiTuple(uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
std::optional< Identifier > getPadId(uint32_t sourceid, uint32_t pfeb, uint32_t tdschan) const
static const std::array< std::string, 2 > sTgcSize
unsigned int constexpr sideA
Definition RPDUtils.h:16

◆ fillsTgcPadTriggerEfficiencyHistograms()

void sTgcRawDataMonAlg::fillsTgcPadTriggerEfficiencyHistograms ( const xAOD::MuonContainer * muonContainer,
const Muon::NSW_PadTriggerDataContainer * NSWpadTriggerObject,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 611 of file StgcRawDataMonAlg.cxx.

611 {
612 ATH_MSG_DEBUG("On fillsTgcPadTriggerEfficiencyHistograms");
613 for (const xAOD::Muon* mu : *muonContainer) {
614 if (!(mu -> author() == xAOD::Muon::Author::MuidCo || mu -> author() == xAOD::Muon::Author::MuidSA)) continue;
615 if (mu -> pt() < m_cutPt) continue;
616 if (std::abs(mu -> eta()) < m_cutEtaDown || std::abs(mu -> eta()) > m_cutEtaUp) continue;
617
618 double recoMuonEta = mu -> eta();
619 double recoMuonPhi = mu -> phi();
620
621 std::string sideRecoMuon = GeometricSectors::sTgcSide[recoMuonEta > 0];
622
623 std::string minSideRecoMuon = "", minSideTrigger = "";
624
625 double minTriggerEta = 999., minTriggerPhi = 999.,
626 minRecoEta = 999., minRecoPhi = 999., minDeltaR = 999.;
627
628 auto minDeltaRtrigIt = -1;
629
630 for (const Muon::NSW_PadTriggerData* rdo : *NSWpadTriggerObject) {
631 bool sideA = rdo -> sideA();
632 bool largeSector = rdo -> largeSector();
633 std::string sideTrigger = GeometricSectors::sTgcSide[sideA];
634 size_t numberOfTriggers = rdo -> getNumberOfTriggers();
635
636 for (size_t trigger = 0; trigger < numberOfTriggers; ++trigger) {
637 int triggerPhiIdsUnsigned = rdo -> getTriggerPhiIds().at(trigger);
638 int triggerBandIds = rdo -> getTriggerBandIds().at(trigger);
639 int sourceId = rdo -> getSourceid();
640
641 if (triggerPhiIdsUnsigned == m_cutTriggerPhiId || triggerBandIds == m_cutTriggerBandId) continue;
642
643 int triggerPhiIds = getSignedPhiId(triggerPhiIdsUnsigned);
644 std::optional<double> status = bandId2eta(triggerBandIds, largeSector, sideA, muonDetectorManagerObject);
645 if (!status.has_value()) continue;
646 double triggerBandIdToEta = status.value();
647 double triggerPhiIDtoPhi = triggersectorphiid2phi(sourceId, triggerPhiIds);
648 double deltaR = xAOD::P4Helpers::deltaR(recoMuonEta, recoMuonPhi, triggerBandIdToEta, triggerPhiIDtoPhi);
649
650 if (std::abs(triggerBandIdToEta) < m_cutEtaDown || std::abs(triggerBandIdToEta) > m_cutEtaUp) continue;
651
652 if (sideRecoMuon == sideTrigger) {
653 if (deltaR < minDeltaR) {
654 minSideRecoMuon = sideRecoMuon;
655 minSideTrigger = sideTrigger;
656 minTriggerEta = triggerBandIdToEta;
657 minTriggerPhi = triggerPhiIDtoPhi;
658 minRecoEta = recoMuonEta;
659 minRecoPhi = recoMuonPhi;
660 minDeltaR = deltaR;
661 minDeltaRtrigIt = trigger;
662 }
663 }
664 } // end number of triggers loop
665 } // end pad trigger data container loop
666
667 bool muonRecoTriggerMatch = false;
668
669 if (minDeltaRtrigIt != -1) {
670 if (minDeltaR < m_minDeltaR) {
671 muonRecoTriggerMatch = true;
672 }
673 }
674
675 auto deltaRmon = Monitored::Scalar<double>("deltaR", minDeltaR);
676 fill("Overview", deltaRmon);
677
678 auto etaRecoMuonMon = Monitored::Scalar<double>("etaRecoMuon", minRecoEta);
679 auto phiRecoMuonMon = Monitored::Scalar<double>("phiRecoMuon", minRecoPhi);
680 fill("Overview", etaRecoMuonMon, phiRecoMuonMon);
681
682 auto etaPadTriggerMon = Monitored::Scalar<double>("etaPadTrigger", minTriggerEta);
683 auto phiPadTriggerMon = Monitored::Scalar<double>("phiPadTrigger", minTriggerPhi);
684 fill("Overview", etaPadTriggerMon, phiPadTriggerMon);
685
686 auto phiRecoMuonSidedMon = Monitored::Scalar<double>("phiRecoMuon_" + minSideRecoMuon, minRecoPhi);
687 auto phiPadTriggerSidedMon = Monitored::Scalar<double>("phiPadTrigger_" + minSideTrigger, minTriggerPhi);
688 fill("Overview", phiRecoMuonSidedMon, phiPadTriggerSidedMon);
689
690 auto muonRecoTriggerMatchMon = Monitored::Scalar<bool>("muonRecoTriggerMatch", muonRecoTriggerMatch);
691 auto etaRecoMuonEffMon = Monitored::Scalar<double>("etaRecoMuonEff", minRecoEta);
692 auto phiRecoMuonEffMon = Monitored::Scalar<double>("phiRecoMuonEff", minRecoPhi);
693 fill("Overview", muonRecoTriggerMatchMon, etaRecoMuonEffMon, phiRecoMuonEffMon);
694
695 } // end muon container loop
696 ATH_MSG_DEBUG("Off fillsTgcPadTriggerEfficiencyHistograms");
697}
Scalar deltaR(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
Gaudi::Property< double > m_cutEtaDown
double triggersectorphiid2phi(uint32_t sourceid, int trigger_phiid) const
std::optional< double > bandId2eta(int bandid, bool isLarge, bool isA, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const
Gaudi::Property< double > m_minDeltaR
Gaudi::Property< double > m_cutEtaUp
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ GetEventInfo()

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

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

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

Definition at line 111 of file AthMonitorAlgorithm.cxx.

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

◆ getFEBs()

int sTgcRawDataMonAlg::getFEBs ( int eta,
int layers ) const
private

Definition at line 13 of file StgcRawDataUtils.cxx.

13 {
14 int feb=-1;
15 if (std::abs(eta)==1) feb=layer-1;
16 else if(std::abs(eta)==2) feb=layer+7;
17 else if(std::abs(eta)==3) feb=layer+15;
18
19 //ATH_MSG_DEBUG("FEB: " << feb << " Eta: " << eta << " Layer: " << layer);
20 return feb;
21}

◆ getGroup()

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

Get a specific monitoring tool from the tool handle array.

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

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

Definition at line 168 of file AthMonitorAlgorithm.cxx.

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

◆ getLayer()

int sTgcRawDataMonAlg::getLayer ( const int multiplet,
const int gasGap ) const
private

Definition at line 27 of file StgcRawDataUtils.cxx.

27 {
28 return 4*(multiplet - 1) + gasGap;
29}

◆ getPadEtaPhiTuple()

std::optional< std::tuple< int, int, std::string, std::string, int > > sTgcRawDataMonAlg::getPadEtaPhiTuple ( uint32_t sourceid,
uint32_t pfeb,
uint32_t tdschan ) const
private

Definition at line 96 of file StgcRawDataUtils.cxx.

96 {
97 bool isValid = false;
98 const int side = (decoder::isA(sourceid)) ? 1 : -1;
99 const auto vmm = tdschan / NVMMCHAN + FIRSTPFEBVMM;
100 const auto vmmchan = tdschan % NVMMCHAN;
101 const auto sec = decoder::sector(sourceid);
102
103 mapper mapperSTG;
104
105 int sector_type = decoder::isLarge(sec) ? 1 : 0;
106 int feb_radius = decoder::radius(pfeb);
107 int layer = decoder::layer(pfeb);
108 int channel_number = mapperSTG.channel_number(Muon::nsw::OFFLINE_CHANNEL_TYPE_PAD, sector_type, feb_radius, layer, vmm, vmmchan);
109
110 const auto& help = m_idHelperSvc -> stgcIdHelper();
111 const auto pad_id = help.channelID(help.elementID(decoder::offlineStationName(sec),
117 channel_number, isValid);
118
119
120 if (!isValid) {
121 ATH_MSG_WARNING("Pad Identifier not valid, skipping");
122 return std::nullopt;
123 }
124
125 int padPhi = help.padPhi(pad_id);
126 int padEta = help.padEta(pad_id);
127 int padPhiMax = help.padPhiMax();
128 int padEtaMax = help.padEtaMax();
129
130 int padPhiTotal = padPhi + (padPhiMax + 1)*(decoder::offlineStationPhi(sourceid) - 1);
131 int padEtaTotal = padEta + (padEtaMax + 1)*(decoder::offlineStationAbsEta(pfeb) - 1);
132 std::string sideName = (side == 1) ? "A" : "C";
133 std::string sizeName = (decoder::offlineStationName(sec) == "STS") ? "S" : "L";
134
135 return std::make_optional(std::make_tuple(padPhiTotal, padEtaTotal, sideName, sizeName, layer + 1));
136}
static uint32_t offlineStationAbsEta(const uint32_t pfeb)
static uint32_t offlineGasgap(const uint32_t pfeb)
static uint32_t radius(const uint32_t pfeb)
static bool isLarge(const uint32_t sec)
static uint32_t layer(const uint32_t pfeb)
static uint32_t offlineStationPhi(const uint32_t sourceid)
static std::string offlineStationName(const uint32_t sec)
static uint32_t sector(const uint32_t sourceid)
static bool isA(const uint32_t sourceid)
static uint32_t offlineMultilayer(const uint32_t pfeb)
Muon::nsw::MapperSTG mapper
static constexpr uint32_t NVMMCHAN
static constexpr uint32_t FIRSTPFEBVMM
@ OFFLINE_CHANNEL_TYPE_PAD

◆ getPadId()

std::optional< Identifier > sTgcRawDataMonAlg::getPadId ( uint32_t sourceid,
uint32_t pfeb,
uint32_t tdschan ) const
private

Definition at line 43 of file StgcRawDataUtils.cxx.

43 {
44 bool isValid = false;
45 const int side = (decoder::isA(sourceid)) ? 1 : -1;
46 const auto vmm = tdschan / NVMMCHAN + FIRSTPFEBVMM;
47 const auto vmmchan = tdschan % NVMMCHAN;
48 const auto sec = decoder::sector(sourceid);
49 const auto& help = m_idHelperSvc -> stgcIdHelper();
50 const auto pad_id = help.channelID(help.elementID(decoder::offlineStationName(sec),
56 decoder::offlineChannelNumber(sec, pfeb, vmm, vmmchan), isValid);
57
58 if (!isValid) {
59 ATH_MSG_WARNING("Pad Identifier not valid, skipping");
60 return std::nullopt;
61 }
62
63 return std::make_optional(pad_id);
64}
static uint32_t offlineChannelNumber(const uint32_t sec, const uint32_t pfeb, const uint32_t vmm, const uint32_t vmmchan)

◆ getRotId()

std::optional< Identifier > sTgcRawDataMonAlg::getRotId ( const Trk::TrackStateOnSurface * trkState) const
private

Definition at line 88 of file StgcRawDataUtils.cxx.

88 {
89 std::optional<std::tuple<Identifier, const Trk::RIO_OnTrack*>> status = getRotIdAndRotObject(trkState);
90 if (!status.has_value()) return std::nullopt;
91 std::tuple<Identifier, const Trk::RIO_OnTrack*> rotIDtuple = status.value();
92
93 return std::make_optional(std::get<Identifier>(rotIDtuple));
94}

◆ getRotIdAndRotObject()

std::optional< std::tuple< Identifier, const Trk::RIO_OnTrack * > > sTgcRawDataMonAlg::getRotIdAndRotObject ( const Trk::TrackStateOnSurface * trkState) const
private

Definition at line 66 of file StgcRawDataUtils.cxx.

66 {
67 if (!trkState->type(Trk::TrackStateOnSurface::Measurement)) return std::nullopt;
68
69 Identifier surfaceId = (trkState) -> surface().associatedDetectorElementIdentifier();
70 if(!m_idHelperSvc -> issTgc(surfaceId)) return std::nullopt;
71
72 const Trk::MeasurementBase* meas = trkState->measurementOnTrack();
73 if(!meas) return std::nullopt;
74
75 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas);
76 if(!rot) return std::nullopt;
77
78 Identifier rot_id = rot -> identify();
79
80 if(!rot_id.is_valid()) {
81 ATH_MSG_WARNING("Invalid identifier found in Trk::RIO_OnTrack");
82 return std::nullopt;
83 }
84
85 return std::make_tuple(rot_id, rot);
86}
bool is_valid() const
Check if id is in a valid state.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.

◆ getSectors()

int sTgcRawDataMonAlg::getSectors ( const Identifier & id) const
private

Definition at line 23 of file StgcRawDataUtils.cxx.

23 {
24 return m_idHelperSvc -> sector(id)*(m_idHelperSvc -> stationEta(id) > 0 ? 1. : -1.);
25}

◆ getSignedPhiId()

int sTgcRawDataMonAlg::getSignedPhiId ( const uint32_t phiid) const
private

Definition at line 36 of file StgcRawDataUtils.cxx.

36 {
37 // 1 bit of sign (0 = positive) followed by 5 bits of phiid
38 constexpr size_t nbitsPhi{5};
39 constexpr size_t mask{(1 << nbitsPhi) - 1};
40 return std::pow(-1, phiid >> nbitsPhi) * (phiid & mask);
41}

◆ getTrigDecisionTool()

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

Get the trigger decision tool member.

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

Returns
m_trigDecTool

Definition at line 203 of file AthMonitorAlgorithm.cxx.

203 {
204 return m_trigDecTool;
205}

◆ initialize()

StatusCode sTgcRawDataMonAlg::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 27 of file StgcRawDataMonAlg.cxx.

27 {
29 ATH_CHECK(m_idHelperSvc.retrieve());
30 ATH_CHECK(m_sTgcContainerKey.initialize());
31 ATH_CHECK(m_detectorManagerKey.initialize());
32 ATH_CHECK(m_meTrkKey.initialize());
34 ATH_CHECK(m_muonKey.initialize());
36
37 return StatusCode::SUCCESS;
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
initialize

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

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

Specify if the algorithm is clonable.

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

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

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ parseList()

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

Parse a string into a vector.

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

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

Definition at line 350 of file AthMonitorAlgorithm.cxx.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ rPosAtNsw2eta()

std::optional< double > sTgcRawDataMonAlg::rPosAtNsw2eta ( double rPosAtNSW,
bool isA,
const MuonGM::MuonDetectorManager * muonDetectorManagerObject ) const
private

Definition at line 166 of file StgcRawDataUtils.cxx.

166 {
167 std::optional<double> status = band2eta(rPosAtNSW, muonDetectorManagerObject);
168 if (!status.has_value()) return std::nullopt;
169 double band2eta = status.value();
170 if (isA) {
171 return std::make_optional(band2eta);
172 }
173 else {
174 return std::make_optional(-band2eta);
175 }
176}
std::optional< double > band2eta(double rPosAtNSW, const MuonGM::MuonDetectorManager *muonDetectorManagerObject) const

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

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

◆ sourceidToSector()

int32_t sTgcRawDataMonAlg::sourceidToSector ( uint32_t sourceid,
bool isSideA ) const
private

Definition at line 31 of file StgcRawDataUtils.cxx.

31 {
32 uint32_t sectorNumber = sourceid & 0xf;
33 return (isSideA) ? sectorNumber + 1: -sectorNumber - 1;
34}
setEventNumber uint32_t

◆ sysExecute()

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

Execute an algorithm.

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

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ trigChainsArePassed()

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

Check whether triggers are passed.

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

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

Definition at line 208 of file AthMonitorAlgorithm.cxx.

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

◆ triggersectorphiid2phi()

double sTgcRawDataMonAlg::triggersectorphiid2phi ( uint32_t sourceid,
int trigger_phiid ) const
private

Sector 8 (A09/C09) is a special case, is where the phi changes sign (-pi to +pi)

Definition at line 187 of file StgcRawDataUtils.cxx.

187 {
188 MuonSectorMapping sectorMapping;
189 double trigger_sector_phicenter = sectorMapping.sectorPhi((sourceid & 0xf) + 1);
190 double trigger_phi = trigger_sector_phicenter + (trigger_phiid*9.)/1000.;
192 if((sourceid & 0xf) == 8 && trigger_phiid < 0) {
193 trigger_phi = -trigger_sector_phicenter + (trigger_phiid*9./1000.);
194 }
195 return trigger_phi;
196}
Muon::MuonSectorMapping MuonSectorMapping

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ FIRSTPFEBVMM

uint32_t sTgcRawDataMonAlg::FIRSTPFEBVMM = 1
staticconstexprprivate

Definition at line 60 of file StgcRawDataMonAlg.h.

◆ m_cutEtaDown

Gaudi::Property<double> sTgcRawDataMonAlg::m_cutEtaDown {this, "cutEtaDown", 1.3}
private

Definition at line 100 of file StgcRawDataMonAlg.h.

100{this, "cutEtaDown", 1.3};

◆ m_cutEtaUp

Gaudi::Property<double> sTgcRawDataMonAlg::m_cutEtaUp {this, "cutEtaUp", 2.4}
private

Definition at line 101 of file StgcRawDataMonAlg.h.

101{this, "cutEtaUp", 2.4};

◆ m_cutPt

Gaudi::Property<double> sTgcRawDataMonAlg::m_cutPt {this, "cutPt", 15000.}
private

Definition at line 99 of file StgcRawDataMonAlg.h.

99{this, "cutPt", 15000.};

◆ m_cutTriggerBandId

Gaudi::Property<int> sTgcRawDataMonAlg::m_cutTriggerBandId {this, "cutTriggerBandId", 255}
private

Definition at line 104 of file StgcRawDataMonAlg.h.

104{this, "cutTriggerBandId", 255};

◆ m_cutTriggerPhiId

Gaudi::Property<int> sTgcRawDataMonAlg::m_cutTriggerPhiId {this, "cutTriggerPhiId", 63}
private

Definition at line 103 of file StgcRawDataMonAlg.h.

103{this, "cutTriggerPhiId", 63};

◆ m_dataType

AthMonitorAlgorithm::DataType_t AthMonitorAlgorithm::m_dataType
protectedinherited

Instance of the DataType_t enum.

Definition at line 356 of file AthMonitorAlgorithm.h.

◆ m_dataTypeStr

Gaudi::Property<std::string> AthMonitorAlgorithm::m_dataTypeStr {this,"DataType","userDefined"}
protectedinherited

DataType string pulled from the job option and converted to enum.

Definition at line 358 of file AthMonitorAlgorithm.h.

358{this,"DataType","userDefined"};

◆ m_defaultLBDuration

Gaudi::Property<float> AthMonitorAlgorithm::m_defaultLBDuration {this,"DefaultLBDuration",60.}
protectedinherited

Default duration of one lumi block.

Definition at line 365 of file AthMonitorAlgorithm.h.

365{this,"DefaultLBDuration",60.};

◆ m_detailLevel

Gaudi::Property<int> AthMonitorAlgorithm::m_detailLevel {this,"DetailLevel",0}
protectedinherited

Sets the level of detail used in the monitoring.

Definition at line 366 of file AthMonitorAlgorithm.h.

366{this,"DetailLevel",0};

◆ m_detectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> sTgcRawDataMonAlg::m_detectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager","Key of input MuonDetectorManager condition data"}
private

Definition at line 94 of file StgcRawDataMonAlg.h.

94{this, "DetectorManagerKey", "MuonDetectorManager","Key of input MuonDetectorManager condition data"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DQFilterTools

ToolHandleArray<IDQFilterTool> AthMonitorAlgorithm::m_DQFilterTools {this,"FilterTools",{}}
protectedinherited

Array of Data Quality filter tools.

Definition at line 346 of file AthMonitorAlgorithm.h.

346{this,"FilterTools",{}};

◆ m_dummy

const ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::m_dummy
privateinherited

Definition at line 374 of file AthMonitorAlgorithm.h.

◆ m_enforceExpressTriggers

Gaudi::Property<bool> AthMonitorAlgorithm::m_enforceExpressTriggers
privateinherited
Initial value:
{this,
"EnforceExpressTriggers", false,
"Requires that matched triggers made the event enter the express stream"}

Definition at line 377 of file AthMonitorAlgorithm.h.

377 {this,
378 "EnforceExpressTriggers", false,
379 "Requires that matched triggers made the event enter the express stream"};

◆ m_environment

AthMonitorAlgorithm::Environment_t AthMonitorAlgorithm::m_environment
protectedinherited

Instance of the Environment_t enum.

Definition at line 355 of file AthMonitorAlgorithm.h.

◆ m_environmentStr

Gaudi::Property<std::string> AthMonitorAlgorithm::m_environmentStr {this,"Environment","user"}
protectedinherited

Environment string pulled from the job option and converted to enum.

Definition at line 357 of file AthMonitorAlgorithm.h.

357{this,"Environment","user"};

◆ m_EventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> AthMonitorAlgorithm::m_EventInfoKey {this,"EventInfoKey","EventInfo"}
protectedinherited

Key for retrieving EventInfo from StoreGate.

Definition at line 367 of file AthMonitorAlgorithm.h.

367{this,"EventInfoKey","EventInfo"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fileKey

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

Internal Athena name for file.

Definition at line 363 of file AthMonitorAlgorithm.h.

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

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> sTgcRawDataMonAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 68 of file StgcRawDataMonAlg.h.

68{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_lbDurationDataKey

SG::ReadCondHandleKey<LBDurationCondData> AthMonitorAlgorithm::m_lbDurationDataKey {this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"}
protectedinherited

Definition at line 350 of file AthMonitorAlgorithm.h.

351{this,"LBDurationCondDataKey","LBDurationCondData","SG Key of LBDurationCondData object"};

◆ m_lumiDataKey

SG::ReadCondHandleKey<LuminosityCondData> AthMonitorAlgorithm::m_lumiDataKey {this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"}
protectedinherited

Definition at line 348 of file AthMonitorAlgorithm.h.

349{this,"LuminosityCondDataKey","LuminosityCondData","SG Key of LuminosityCondData object"};

◆ m_meTrkKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> sTgcRawDataMonAlg::m_meTrkKey {this, "METrkContainer", "ExtrapolatedMuonTrackParticles"}
private

Definition at line 95 of file StgcRawDataMonAlg.h.

95{this, "METrkContainer", "ExtrapolatedMuonTrackParticles"};

◆ m_minDeltaR

Gaudi::Property<double> sTgcRawDataMonAlg::m_minDeltaR {this, "minDeltaR", 0.1}
private

Definition at line 102 of file StgcRawDataMonAlg.h.

102{this, "minDeltaR", 0.1};

◆ m_muonKey

SG::ReadHandleKey<xAOD::MuonContainer> sTgcRawDataMonAlg::m_muonKey {this, "MuonsKey", "Muons"}
private

Definition at line 97 of file StgcRawDataMonAlg.h.

97{this, "MuonsKey", "Muons"};

◆ m_name

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 371 of file AthMonitorAlgorithm.h.

◆ m_rdoKey

SG::ReadHandleKey<Muon::NSW_PadTriggerDataContainer> sTgcRawDataMonAlg::m_rdoKey {this, "NSW_PadTriggerDataKey", ""}
private

Definition at line 96 of file StgcRawDataMonAlg.h.

96{this, "NSW_PadTriggerDataKey", ""};

◆ m_residualPullCalculator

ToolHandle<Trk::IResidualPullCalculator> sTgcRawDataMonAlg::m_residualPullCalculator {this, "ResPullCalc", "Trk::ResidualPullCalculator/ResidualPullCalculator"}
private

Definition at line 69 of file StgcRawDataMonAlg.h.

69{this, "ResPullCalc", "Trk::ResidualPullCalculator/ResidualPullCalculator"};

◆ m_sTgcContainerKey

SG::ReadHandleKey<Muon::sTgcPrepDataContainer> sTgcRawDataMonAlg::m_sTgcContainerKey {this,"sTgcPrepDataContainerName", "STGC_Measurements"}
private

Definition at line 93 of file StgcRawDataMonAlg.h.

93{this,"sTgcPrepDataContainerName", "STGC_Measurements"};

◆ m_toolLookupMap

std::unordered_map<std::string, size_t> AthMonitorAlgorithm::m_toolLookupMap
privateinherited

Definition at line 372 of file AthMonitorAlgorithm.h.

◆ m_tools

ToolHandleArray<GenericMonitoringTool> AthMonitorAlgorithm::m_tools {this,"GMTools",{}}
protectedinherited

Array of Generic Monitoring Tools.

Definition at line 341 of file AthMonitorAlgorithm.h.

341{this,"GMTools",{}};

◆ m_trigDecTool

PublicToolHandle<Trig::TrigDecisionTool> AthMonitorAlgorithm::m_trigDecTool
protectedinherited

Tool to tell whether a specific trigger is passed.

Definition at line 345 of file AthMonitorAlgorithm.h.

◆ m_triggerChainString

Gaudi::Property<std::string> AthMonitorAlgorithm::m_triggerChainString {this,"TriggerChain",""}
protectedinherited

Trigger chain string pulled from the job option and parsed into a vector.

Definition at line 360 of file AthMonitorAlgorithm.h.

360{this,"TriggerChain",""};

◆ m_trigLiveFractionDataKey

SG::ReadCondHandleKey<TrigLiveFractionCondData> AthMonitorAlgorithm::m_trigLiveFractionDataKey {this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"}
protectedinherited

Definition at line 352 of file AthMonitorAlgorithm.h.

353{this,"TrigLiveFractionCondDataKey","TrigLiveFractionCondData", "SG Key of TrigLiveFractionCondData object"};

◆ m_useLumi

Gaudi::Property<bool> AthMonitorAlgorithm::m_useLumi {this,"EnableLumi",false}
protectedinherited

Allows use of various luminosity functions.

Definition at line 364 of file AthMonitorAlgorithm.h.

364{this,"EnableLumi",false};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vTrigChainNames

std::vector<std::string> AthMonitorAlgorithm::m_vTrigChainNames
protectedinherited

Vector of trigger chain names parsed from trigger chain string.

Definition at line 361 of file AthMonitorAlgorithm.h.

◆ NVMMCHAN

uint32_t sTgcRawDataMonAlg::NVMMCHAN = Muon::nsw::Constants::N_CHAN_PER_VMM
staticconstexprprivate

Definition at line 59 of file StgcRawDataMonAlg.h.


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