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

#include <MMRawDataMonAlg.h>

Inheritance diagram for MMRawDataMonAlg:
Collaboration diagram for MMRawDataMonAlg:

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

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

Protected Member Functions

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

typedef std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > MonVarVec_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode fillMMOverviewVects (const Muon::MMPrepData *, MMOverviewHistogramStruct &vects, MMByPhiStruct(&occupancyPlots)[16][2]) const
void fillMMOverviewHistograms (const MMOverviewHistogramStruct &vects, MMByPhiStruct(&occupancyPlots)[16][2], const int lb) const
StatusCode fillMMSummaryVects (const Muon::MMPrepData *, MMSummaryHistogramStruct(&vects)[2][16][2][2][4]) const
StatusCode fillMMHistograms (const Muon::MMPrepData *) const
StatusCode fillMMSummaryHistograms (const MMSummaryHistogramStruct(&vects)[2][16][2][2][4]) const
void clusterFromTrack (const xAOD::TrackParticleContainer *, const int lb) const
void clusterFromSegments (const Trk::SegmentCollection *, const int lb) const
int get_PCB_from_channel (const int channel) const
int get_FEB_from_channel (const int channel, const int stEta) const
int get_sectorPhi_from_stationPhi_stName (const int stationPhi, const std::string &stName) const
int get_sectorEta_from_stationEta (const int stationEta) const
int get_bin_for_occ_CSide_hist (const int stationEta, const int multiplet, const int gas_gap) const
int get_bin_for_occ_ASide_hist (const int stationEta, const int multiplet, const int gas_gap) const
int get_bin_for_occ (const int gas_gap, const int PCB) const
int get_bin_for_feb_occ (const int gas_gap, const int FEB) const
int get_bin_for_occ_CSide_pcb_eta2_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
int get_bin_for_occ_CSide_pcb_eta1_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
int get_bin_for_occ_ASide_pcb_eta2_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
int get_bin_for_occ_ASide_pcb_eta1_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
int get_bin_for_occ_lb_CSide_pcb_eta2_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const
int get_bin_for_occ_lb_CSide_pcb_eta1_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB, int isector) const
int get_bin_for_occ_lb_ASide_pcb_eta1_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB, int isector) const
int get_bin_for_occ_lb_ASide_pcb_eta2_hist (const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const
int get_bin_for_occ_lb_pcb_hist (const int multiplet, const int gas_gap, const int PCB) const
void MMEfficiency (const xAOD::TrackParticleContainer *) const
void fillMMTrigger (const xAOD::NSWMMTPRDOContainer *, const int) 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< CP::IMuonSelectionToolm_muonSelectionTool {this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool"}
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager","Key of input MuonDetectorManager condition data"}
SG::ReadHandleKey< Trk::SegmentCollectionm_segm_type {this,"Eff_segm_type","TrackMuonSegments","muon segments"}
SG::ReadHandleKey< Muon::MMPrepDataContainerm_MMContainerKey {this,"MMPrepDataContainerName","MM_Measurements"}
SG::ReadHandleKey< xAOD::MuonContainerm_muonKey {this,"MuonKey","Muons","muons"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_meTrkKey {this, "METrkContainer", "ExtrapolatedMuonTrackParticles"}
SG::ReadHandleKey< xAOD::NSWMMTPRDOContainerm_mmtpRdoKey {this, "NSW_MMTPDataKey", "NSW_MMTrigProcessor_RDO"}
Gaudi::Property< bool > m_doMMESD {this,"DoMMESD",true}
Gaudi::Property< bool > m_do_mm_overview {this,"do_mm_overview",true}
Gaudi::Property< bool > m_do_stereoCorrection {this,"do_stereoCorrection",false}
Gaudi::Property< float > m_cut_pt {this,"cut_pt",15000}
Gaudi::Property< bool > m_doDetailedHists {this,"doDetailedHists",true}
std::string m_name
std::unordered_map< std::string, size_t > m_toolLookupMap
const ToolHandle< GenericMonitoringToolm_dummy
Gaudi::Property< bool > m_enforceExpressTriggers
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 50 of file MMRawDataMonAlg.h.

Member Typedef Documentation

◆ MonVarVec_t

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

Definition at line 370 of file AthMonitorAlgorithm.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ DataType_t

enum class AthMonitorAlgorithm::DataType_t
stronginherited

Specifies what type of input data is being monitored.

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

Enumerator
userDefined 
monteCarlo 
collisions 
cosmics 
heavyIonCollisions 

Definition at line 194 of file AthMonitorAlgorithm.h.

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

◆ Environment_t

enum class AthMonitorAlgorithm::Environment_t
stronginherited

Specifies the processing environment.

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

Enumerator
user 
online 
tier0 
tier0Raw 
tier0ESD 
AOD 
altprod 

Definition at line 175 of file AthMonitorAlgorithm.h.

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

Constructor & Destructor Documentation

◆ MMRawDataMonAlg()

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

Definition at line 98 of file MMRawDataMonAlg.cxx.

98 :
99 AthMonitorAlgorithm(name,pSvcLocator)
100{ }
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~MMRawDataMonAlg()

virtual MMRawDataMonAlg::~MMRawDataMonAlg ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ clusterFromSegments()

void MMRawDataMonAlg::clusterFromSegments ( const Trk::SegmentCollection * segms,
const int lb ) const
private

Definition at line 845 of file MMRawDataMonAlg.cxx.

846{
847 MMOverviewHistogramStruct overviewPlots;
848 MMByPhiStruct occupancyPlots[16][2];
849 MMSummaryHistogramStruct summaryPlots[2][16][2][2][4];
850 int nseg=0;
851
852 for (Trk::SegmentCollection::const_iterator s = segms->begin(); s != segms->end(); ++s) {
853 const Muon::MuonSegment* segment = dynamic_cast<const Muon::MuonSegment*>(*s);
854 if (segment == nullptr) {
855 ATH_MSG_DEBUG("no pointer to segment!!!");
856 break;
857 }
858 bool isMM=false;
859 for(unsigned int irot=0;irot<segment->numberOfContainedROTs();irot++){
860 const Trk::RIO_OnTrack* rot = segment->rioOnTrack(irot);
861 if(!rot) continue;
862 Identifier rot_id = rot->identify();
863 if(!m_idHelperSvc->isMM(rot_id)) continue;
864 isMM=true;
865 const Muon::MMClusterOnTrack* cluster = dynamic_cast<const Muon::MMClusterOnTrack*>(rot);
866 if(!cluster) continue;
867
868 std::string stName = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(rot_id));
869 int stEta = m_idHelperSvc->mmIdHelper().stationEta(rot_id);
870 int stPhi = m_idHelperSvc->mmIdHelper().stationPhi(rot_id);
871 int multi = m_idHelperSvc->mmIdHelper().multilayer(rot_id);
872 int gap = m_idHelperSvc->mmIdHelper().gasGap(rot_id);
873 int ch = m_idHelperSvc->mmIdHelper().channel(rot_id);
874
875 // MMS and MML phi sectors
876 int sectorPhi = get_sectorPhi_from_stationPhi_stName(stPhi,stName);
877 int PCB = get_PCB_from_channel(ch);
878 int iside = (stEta > 0) ? 1 : 0;
879
880 const Muon::MMPrepData* prd = cluster->prepRawData();
881 const std::vector<Identifier>& stripIds = prd->rdoList();
882 unsigned int csize = stripIds.size();
883 const std::vector<uint16_t>& stripNumbers = prd->stripNumbers();
884
885 auto& pcb_vects = summaryPlots[iside][sectorPhi-1][std::abs(stEta)-1][multi-1][gap-1];
886 pcb_vects.cl_size.push_back(csize);
887 pcb_vects.pcb.push_back(PCB);
888 std::vector<short int> s_times = prd->stripTimes();
889 float c_time = 0;
890 for(unsigned int sIdx=0; sIdx<csize; ++sIdx) {
891 pcb_vects.strp_times.push_back(s_times.at(sIdx));
892 pcb_vects.pcb_strip.push_back( get_PCB_from_channel(stripNumbers[sIdx]));
893 c_time += s_times.at(sIdx);
894 }
895 c_time /= s_times.size();
896 pcb_vects.cl_times.push_back(c_time);
897
898 float charge = prd->charge()*conversion_charge;
899 pcb_vects.charge.push_back(charge);
900
901 auto& vects = overviewPlots;
902
903 auto& thisSect = occupancyPlots[sectorPhi-1][iside];
904
905 const int gap_offset=4;
906 int gas_gap8 = (multi==1) ? gap : gap + gap_offset;
907 int FEB = get_FEB_from_channel(ch, stEta);
908
909 int bin=get_bin_for_feb_occ(gas_gap8,FEB);
910 thisSect.sector_lb_onseg.push_back(bin);
911
912 if(stEta<0) {
913 vects.sector_CSide_onseg.push_back(bin);
914 vects.stationPhi_CSide_onseg.push_back(sectorPhi);
915 } else {
916 vects.sector_ASide_onseg.push_back(bin);
917 vects.stationPhi_ASide_onseg.push_back(sectorPhi);
918 }
919
920 } // loop on ROT container
921 if (isMM==true) ++nseg;
922
923 } // loop on segment collection
924 auto nsegs = Monitored::Scalar<int>("nseg",nseg);
925 fill("mmMonitor", nsegs);
926
927 auto& vects = overviewPlots;
928 auto stationPhi_CSide_onseg = Monitored::Collection("stationPhi_CSide_onseg",vects.stationPhi_CSide_onseg);
929 auto stationPhi_ASide_onseg = Monitored::Collection("stationPhi_ASide_onseg",vects.stationPhi_ASide_onseg);
930 auto sector_ASide_onseg = Monitored::Collection("sector_ASide_onseg",vects.sector_ASide_onseg);
931 auto sector_CSide_onseg = Monitored::Collection("sector_CSide_onseg",vects.sector_CSide_onseg);
932
933 auto lb_onseg = Monitored::Scalar<int>("lb_onseg", lb);
934
935 fill("mmMonitor", stationPhi_CSide_onseg, stationPhi_ASide_onseg, sector_CSide_onseg, sector_ASide_onseg, lb_onseg);
936
937 for(int iside = 0; iside < 2; ++iside) {
938 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
939 for(int statPhi=0; statPhi<16; ++statPhi) {
940 auto& occ_lb = occupancyPlots[statPhi][iside];
941 auto sector_lb_onseg = Monitored::Collection("sector_lb_"+MM_Side[iside]+"_phi"+std::to_string(statPhi+1)+"_onseg",occ_lb.sector_lb_onseg);
942 fill(MM_sideGroup, lb_onseg, sector_lb_onseg);
943
944 for(int statEta = 0; statEta < 2; ++statEta) {
945 for(int multiplet = 0; multiplet < 2; ++multiplet) {
946 for(int gas_gap = 0; gas_gap < 4; ++gas_gap) {
947 auto& pcb_vects = summaryPlots[iside][statPhi][statEta][multiplet][gas_gap];
948
949 if(pcb_vects.pcb.empty()) continue;
951 auto pcb_mon = Monitored::Collection("pcb_mon_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.pcb);
952 auto pcb_strip_mon = Monitored::Collection("pcb_strip_mon_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.pcb_strip);
953 auto strip_times = Monitored::Collection("strp_time_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.strp_times);
954 auto cluster_time = Monitored::Collection("cluster_time_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.cl_times);
955 auto clus_size = Monitored::Collection("cluster_size_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.cl_size);
956 auto charge_perPCB = Monitored::Collection("charge_perPCB_onseg_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), pcb_vects.charge);
957
958 fill(MM_sideGroup, clus_size, strip_times, charge_perPCB, cluster_time, pcb_mon, pcb_strip_mon);
959 }
960 auto clus_size_all = Monitored::Collection("cluster_size_onseg", pcb_vects.cl_size);
961 auto charge_all = Monitored::Collection("charge_onseg", pcb_vects.charge);
962 auto strip_times_all = Monitored::Collection("strp_time_onseg", pcb_vects.strp_times);
963 fill("mmMonitor", clus_size_all, charge_all, strip_times_all);
964 }
965 }
966 }
967 }
968 }
969}
#define ATH_MSG_DEBUG(x)
double charge(const T &p)
Definition AtlasPID.h:997
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
int get_FEB_from_channel(const int channel, const int stEta) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
int get_sectorPhi_from_stationPhi_stName(const int stationPhi, const std::string &stName) const
int get_bin_for_feb_occ(const int gas_gap, const int FEB) const
int get_PCB_from_channel(const int channel) const
Gaudi::Property< bool > m_doDetailedHists
virtual const MMPrepData * prepRawData() const
Returns the MMPrepData - is a TRT_DriftCircle in this scope.
const std::vector< uint16_t > & stripNumbers() const
returns the list of strip numbers
Definition MMPrepData.h:247
const std::vector< short int > & stripTimes() const
returns the list of times
Definition MMPrepData.h:252
int charge() const
Returns the AD.
Definition MMPrepData.h:227
const Trk::RIO_OnTrack * rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Identifier identify() const
return the identifier -extends MeasurementBase
int lb
Definition globals.cxx:23
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.
gap(flags, cells_name, *args, **kw)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
const std::string & stName(StIndex index)
convert StIndex into a string

◆ clusterFromTrack()

void MMRawDataMonAlg::clusterFromTrack ( const xAOD::TrackParticleContainer * muonContainer,
const int lb ) const
private

Definition at line 497 of file MMRawDataMonAlg.cxx.

498{
499 MMSummaryHistogramStruct summaryPlots[2][2][4]; // side, multilayer, gas gap
500 MMSummaryHistogramStruct summaryPlots_full[2][16][2][2][4]; // side, phi, eta, multilayer, gas gap
501 MMSummaryHistogramStruct sumPlots[2][16][2][2][4]; // side, phi, eta, multilayer, gas gap
502 MMOverviewHistogramStruct overviewPlots;
503 MMByPhiStruct occupancyPlots[16][2]; // sector, side
504 int ntrk=0;
505 for(const xAOD::TrackParticle* meTP : *muonContainer) {
506
507 if(!meTP) continue;
508 auto eta_trk = Monitored::Scalar<float>("eta_trk", meTP->eta());
509 auto phi_trk = Monitored::Scalar<float>("phi_trk", meTP->phi());
510 auto pt_trk = Monitored::Scalar<float>("pt_trk", meTP->pt()/1000.);
511
512 //retrieve the original track
513 const Trk::Track* meTrack = meTP->track();
514
515 if(!meTrack) continue;
516
517 // get the vector of measurements on track
518 const DataVector<const Trk::MeasurementBase>* meas = meTrack->measurementsOnTrack();
519 bool isMM=false;
520 for(const Trk::MeasurementBase* it : *meas) {
521 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(it);
522 if(!rot) continue;
523 Identifier rot_id = rot->identify();
524 if(!m_idHelperSvc->isMM(rot_id)) continue;
525 isMM=true;
526 const Muon::MMClusterOnTrack* cluster = dynamic_cast<const Muon::MMClusterOnTrack*>(rot);
527 if(!cluster) continue;
528
529 std::string stName = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(rot_id));
530 int stEta = m_idHelperSvc->mmIdHelper().stationEta(rot_id);
531 int stPhi = m_idHelperSvc->mmIdHelper().stationPhi(rot_id);
532 int multi = m_idHelperSvc->mmIdHelper().multilayer(rot_id);
533 int gap = m_idHelperSvc->mmIdHelper().gasGap(rot_id);
534 int ch = m_idHelperSvc->mmIdHelper().channel(rot_id);
535
536 // MMS and MML phi sectors
537 // int phisec = (stNumber%2==0) ? 1 : 0;
538 int sectorPhi = get_sectorPhi_from_stationPhi_stName(stPhi,stName); // 1->16
539 int PCB = get_PCB_from_channel(ch);
540 int iside = (stEta > 0) ? 1 : 0;
541 auto& vects = overviewPlots;
542 auto& thisSect = occupancyPlots[sectorPhi-1][iside];
543
544
545 const Muon::MMPrepData* prd = cluster->prepRawData();
546 const std::vector<Identifier>& stripIds = prd->rdoList();
547 unsigned int csize = stripIds.size();
548 const std::vector<uint16_t>& stripNumbers = prd->stripNumbers();
549 float charge = prd->charge()*conversion_charge;
550 std::vector<short int> s_times = prd->stripTimes();
551
552 vects.charge_all.push_back(charge);
553
554 float c_time = 0;
555 for(unsigned int sIdx=0; sIdx<stripIds.size(); ++sIdx){
556 vects.strp_times.push_back(s_times.at(sIdx));
557 c_time += s_times.at(sIdx);
558 }
559 c_time /= s_times.size();
560 vects.cl_times.push_back(c_time);
561
563 auto& vect = sumPlots[iside][sectorPhi-1][std::abs(stEta)-1][multi-1][gap-1];
564 vect.cl_size.push_back(csize);
565 vect.pcb.push_back(PCB);
566 for(unsigned int sIdx=0; sIdx<stripIds.size(); ++sIdx)
567 {
568 vect.strip_number.push_back(stripNumbers[sIdx]);
569 vect.strp_times.push_back(s_times.at(sIdx));
570 vect.pcb_strip.push_back(get_PCB_from_channel(stripNumbers[sIdx]));
571 }
572 vect.cl_times.push_back(c_time);
573 vect.charge.push_back(charge);
574 }
575
576
577 const int gap_offset=4;
578 int gas_gap8 = (multi==1) ? gap : gap + gap_offset;
579
580 int FEB = get_FEB_from_channel(ch, stEta);
581 int bin = get_bin_for_feb_occ(gas_gap8,FEB);
582 thisSect.sector_lb_ontrack.push_back(bin);
583 // Occupancy plots with FEB granularity further divided for each eta sector: -2, -1, 1, 2
584 // Filling Vectors for stationEta=-1 - cluster on track
585 if(stEta<0) {
586 vects.sector_CSide_ontrack.push_back(bin);
587 vects.stationPhi_CSide_ontrack.push_back(sectorPhi);
588 } else {
589 vects.sector_ASide_ontrack.push_back(bin);
590 vects.stationPhi_ASide_ontrack.push_back(sectorPhi);
591 }
592
593 float x = cluster->localParameters()[Trk::loc1];
594 for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
595
596 if(!(trkState)) continue;
597 if (!trkState->type(Trk::TrackStateOnSurface::Measurement)) continue;
598
599 Identifier surfaceId = (trkState)->surface().associatedDetectorElementIdentifier();
600 if(!m_idHelperSvc->isMM(surfaceId)) continue;
601
602 int trk_stEta = m_idHelperSvc->mmIdHelper().stationEta(surfaceId);
603 int trk_stPhi = m_idHelperSvc->mmIdHelper().stationPhi(surfaceId);
604 int trk_multi = m_idHelperSvc->mmIdHelper().multilayer(surfaceId);
605 int trk_gap = m_idHelperSvc->mmIdHelper().gasGap(surfaceId);
606
607 if( (trk_stPhi == stPhi) && (trk_stEta == stEta) && (trk_multi == multi) && (trk_gap == gap)) {
608 double x_trk = trkState->trackParameters()->parameters()[Trk::loc1];
609 int sectorPhi = get_sectorPhi_from_stationPhi_stName(trk_stPhi,stName); // 1->16
610 int side = (stEta > 0) ? 1 : 0;
611 float res_stereo = (x - x_trk);
613 float stereo_angle = ((multi == 1 && gap < 3) || (multi == 2 && gap > 2)) ? 0 : 0.02618;
614 double y_trk = trkState->trackParameters()->parameters()[Trk::locY];
615 float stereo_correction = ( (multi == 1 && gap < 3) || (multi == 2 && gap > 2) ) ? 0 : ( ((multi == 1 && gap == 3) || (multi == 2 && gap ==1 )) ? (-std::sin(stereo_angle)*y_trk) : std::sin(stereo_angle)*y_trk );
616 res_stereo = (x - x_trk)*std::cos(stereo_angle) - stereo_correction;
617 }
618 auto residual_mon = Monitored::Scalar<float>("residual", res_stereo);
619 auto stPhi_mon = Monitored::Scalar<float>("stPhi_mon",sectorPhi);
620
621 fill("mmMonitor", residual_mon, eta_trk, phi_trk, stPhi_mon);
622 int abs_stEta = get_sectorEta_from_stationEta(stEta); // 0 or 1
623
625 auto& vectors = summaryPlots_full[side][sectorPhi-1][abs_stEta][multi-1][gap-1];
626 vectors.residuals.push_back(res_stereo);
627 }
628 }
629 }//TrackStates
630
631 } // loop on meas
632 if(isMM) {
633 ++ntrk;
634 fill("mmMonitor", pt_trk);
635 }
636
638 for(int iside = 0; iside < 2; ++iside) {
639 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
640 for(int statPhi = 0; statPhi < 16; ++statPhi) {
641 // for(int statEta = 0; statEta < 2; ++statEta) {
642 for(int multiplet = 0; multiplet < 2; ++multiplet) {
643 for(int gas_gap = 0; gas_gap < 4; ++gas_gap) {
644 auto layer=gas_gap+multiplet*4;
645 MMSummaryHistogramStruct vects;
646 for(int statEta = 0; statEta < 2; ++statEta) {
647 vects = summaryPlots_full[iside][statPhi][statEta][multiplet][gas_gap];
648 auto residuals_gap = Monitored::Collection("residuals_"+MM_Side[iside]+"_phi"+std::to_string(statPhi+1)+"_stationEta"+EtaSector[statEta]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap"+std::to_string(gas_gap+1),vects.residuals);
649 auto residuals_layer = Monitored::Collection("residuals_"+MM_Side[iside]+"_phi"+std::to_string(statPhi+1)+"_layer"+std::to_string(layer+1),vects.residuals);
650
651 fill(MM_sideGroup, residuals_gap,residuals_layer);
652 }
653 }
654 }
655 }
656 }
657 }
658
659 for(const Trk::TrackStateOnSurface* trkState : *meTrack->trackStateOnSurfaces()) {
660 if(!(trkState)) continue;
661 if (!trkState->type(Trk::TrackStateOnSurface::Measurement)) continue;
662 Identifier surfaceId = (trkState)->surface().associatedDetectorElementIdentifier();
663 if(!m_idHelperSvc->isMM(surfaceId)) continue;
664
665 const Trk::MeasurementBase* meas = trkState->measurementOnTrack() ;
666 if(!meas) continue;
667
668 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas);
669 if(!rot) continue;
670 Identifier rot_id = rot->identify();
671 if(!m_idHelperSvc->isMM(rot_id)) continue;
672
673 const Amg::Vector3D& pos = (trkState)->trackParameters()->position();
674 int stEta = m_idHelperSvc->mmIdHelper().stationEta(surfaceId);
675 int multi = m_idHelperSvc->mmIdHelper().multilayer(surfaceId);
676 int gap = m_idHelperSvc->mmIdHelper().gasGap(surfaceId);
677
678 // CSide and ASide
679 int iside = (stEta > 0) ? 1 : 0;
680 auto& Vectors = summaryPlots[iside][multi-1][gap-1];
681
682 // Filling x-y position vectors using the trackStateonSurface
683 Vectors.x_ontrack.push_back(pos.x());
684 Vectors.y_ontrack.push_back(pos.y());
685 }
686 } // loop on muonContainer
687
688 auto ntrack = Monitored::Scalar<int>("ntrk",ntrk);
689 fill("mmMonitor", ntrack);
690
691 auto& vects = overviewPlots;
692 auto stationPhi_CSide_ontrack = Monitored::Collection("stationPhi_CSide_ontrack",vects.stationPhi_CSide_ontrack);
693 auto stationPhi_ASide_ontrack = Monitored::Collection("stationPhi_ASide_ontrack",vects.stationPhi_ASide_ontrack);
694 auto sector_ASide_ontrack = Monitored::Collection("sector_ASide_ontrack",vects.sector_ASide_ontrack);
695 auto sector_CSide_ontrack = Monitored::Collection("sector_CSide_ontrack",vects.sector_CSide_ontrack);
696
697 auto lb_ontrack = Monitored::Scalar<int>("lb_ontrack", lb);
698 auto csize = Monitored::Collection("nstrips_ontrack", vects.numberofstrips_percluster);
699 auto charge = Monitored::Collection("charge_ontrack", vects.charge_all);
700 auto stime = Monitored::Collection("strip_time_on_track", vects.strp_times);
701 auto ctime = Monitored::Collection("cluster_time_on_track", vects.cl_times);
702
703 fill("mmMonitor", csize, charge, stime, ctime, stationPhi_CSide_ontrack, stationPhi_ASide_ontrack, sector_CSide_ontrack,sector_ASide_ontrack, lb_ontrack);
704
705 for(int iside = 0; iside < 2; ++iside) {
706 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
707 for(int statPhi = 0; statPhi < 16; ++statPhi) {
708 for(int statEta = 0; statEta < 2; ++statEta) {
709 for(int multiplet = 0; multiplet < 2; ++multiplet) {
710 for(int gas_gap = 0; gas_gap < 4; ++gas_gap) {
711 auto& vects = sumPlots[iside][statPhi][statEta][multiplet][gas_gap];
713 if(!vects.strip_number.empty())
714 {
715 auto clus_size = Monitored::Collection("cluster_size_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.cl_size);
716 auto strip_times = Monitored::Collection("strp_time_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.strp_times);
717 auto cluster_time = Monitored::Collection("cluster_time_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.cl_times);
718 auto charge_perPCB = Monitored::Collection("charge_perPCB_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.charge);
719 auto charge_perlayer = Monitored::Collection("charge_perlayer_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.charge);
720 auto clus_size_perlayer = Monitored::Collection("cluster_size_perlayer_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.cl_size);
721 auto pcb_mon = Monitored::Collection("pcb_mon_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.pcb);
722 auto pcb_strip_mon = Monitored::Collection("pcb_strip_mon_ontrack_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), vects.pcb_strip);
723
724 fill(MM_sideGroup, clus_size, strip_times, cluster_time, charge_perPCB, pcb_mon, pcb_strip_mon,charge_perlayer,clus_size_perlayer);
725 }
726 }
727
728 }
729 }
730 }
731 auto& occ_lb = occupancyPlots[statPhi][iside];
732 auto sector_lb_ontrack = Monitored::Collection("sector_lb_"+MM_Side[iside]+"_phi"+std::to_string(statPhi+1)+"_ontrack",occ_lb.sector_lb_ontrack);
733 fill(MM_sideGroup, lb_ontrack, sector_lb_ontrack);
734 }
735 for(int multiplet=0; multiplet<2; ++multiplet) {
736 for(int gas_gap=0; gas_gap<4; ++gas_gap) {
737 auto& Vectors = summaryPlots[iside][multiplet][gas_gap];
738 auto x_ontrack = Monitored::Collection("x_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.x_ontrack);
739 auto y_ontrack = Monitored::Collection("y_"+MM_Side[iside]+"_multiplet"+std::to_string(multiplet+1)+"_gas_gap_"+std::to_string(gas_gap+1)+"_ontrack", Vectors.y_ontrack);
740 fill(MM_sideGroup, x_ontrack, y_ontrack);
741 }
742 }
743 }
744
745}
xAOD::MuonContainer * muonContainer
#define x
int get_sectorEta_from_stationEta(const int stationEta) const
Gaudi::Property< bool > m_do_stereoCorrection
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
std::string stime()
return the current data and time
Eigen::Matrix< double, 3, 1 > Vector3D
@ layer
Definition HitInfo.h:79
@ locY
local cartesian
Definition ParamDefs.h:38
@ loc1
Definition ParamDefs.h:34
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ 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}
#define ATH_MSG_WARNING(x)
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()) {
83 ATH_MSG_DEBUG("Event rejected due to filter tool.");
84 return StatusCode::SUCCESS;
85 }
86 }
87
88 // Trigger: If there is a decision tool and the chains fail, skip the event.
90 ATH_MSG_DEBUG("Event rejected due to trigger filter.");
91 return StatusCode::SUCCESS;
92 }
93
94 ATH_MSG_DEBUG("Event accepted!");
95 return fillHistograms(ctx);
96}
virtual StatusCode fillHistograms(const EventContext &ctx) const =0
adds event to the monitoring histograms
bool trigChainsArePassed(const std::vector< std::string > &vTrigNames) const
Check whether triggers are passed.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
ToolHandleArray< IDQFilterTool > m_DQFilterTools
Array of Data Quality filter tools.

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

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

◆ fillHistograms()

StatusCode MMRawDataMonAlg::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 129 of file MMRawDataMonAlg.cxx.

130{
131 int lumiblock = -1;
132 lumiblock = GetEventInfo(ctx)->lumiBlock();
133 ATH_MSG_DEBUG("MMRawDataMonAlg::MM RawData Monitoring Histograms being filled" );
134
135 SG::ReadHandle<Muon::MMPrepDataContainer> mm_container(m_MMContainerKey,ctx);
136 ATH_MSG_DEBUG("****** mmContainer->size() : " << mm_container->size());
137
138 if(m_doMMESD) {
139 MMOverviewHistogramStruct overviewPlots;
140 MMSummaryHistogramStruct summaryPlots[2][16][2][2][4];
141 MMByPhiStruct occupancyPlots[16][2];
142
143 //loop in MMPrepDataContainer
144 for(const Muon::MMPrepDataCollection* coll : *mm_container) {
145 for(const Muon::MMPrepData* prd : *coll) {
146 ATH_CHECK(fillMMOverviewVects(prd, overviewPlots, occupancyPlots));
147 ATH_CHECK(fillMMSummaryVects(prd, summaryPlots));
149 }
150 }
151
152 if(m_do_mm_overview) fillMMOverviewHistograms(overviewPlots, occupancyPlots, lumiblock);
153
154 ATH_CHECK(fillMMSummaryHistograms(summaryPlots));
155 SG::ReadHandle<xAOD::TrackParticleContainer> meTPContainer{m_meTrkKey,ctx};
156 if (!meTPContainer.isValid()) {
157 ATH_MSG_FATAL("Nope. Could not retrieve "<<m_meTrkKey.fullKey());
158 return StatusCode::FAILURE;
159 }
160 clusterFromTrack(meTPContainer.cptr(),lumiblock);
161 MMEfficiency(meTPContainer.cptr());
162
163
164
165 //trigger
166 SG::ReadHandle<xAOD::NSWMMTPRDOContainer> rdos = SG::ReadHandle<xAOD::NSWMMTPRDOContainer>{m_mmtpRdoKey, ctx};
167 if (not rdos.isValid()) {
168 ATH_MSG_INFO("NSW MMTP failed. Skipping");
169 // return StatusCode::SUCCESS;
170 } else fillMMTrigger(rdos.cptr(),lumiblock);
171
172 SG::ReadHandle<Trk::SegmentCollection> segms(m_segm_type, ctx);
173
174 if (!segms.isValid()) {
175 ATH_MSG_INFO("evtStore() does not contain MM segms Collection with name " << m_segm_type);
176 // return StatusCode::FAILURE;
177 }else
178 clusterFromSegments(segms.cptr(),lumiblock);
179 }
180
181
182 return StatusCode::SUCCESS;
183}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
void clusterFromTrack(const xAOD::TrackParticleContainer *, const int lb) const
void MMEfficiency(const xAOD::TrackParticleContainer *) const
SG::ReadHandleKey< xAOD::NSWMMTPRDOContainer > m_mmtpRdoKey
void fillMMOverviewHistograms(const MMOverviewHistogramStruct &vects, MMByPhiStruct(&occupancyPlots)[16][2], const int lb) const
Gaudi::Property< bool > m_doMMESD
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_MMContainerKey
StatusCode fillMMSummaryVects(const Muon::MMPrepData *, MMSummaryHistogramStruct(&vects)[2][16][2][2][4]) const
StatusCode fillMMHistograms(const Muon::MMPrepData *) const
StatusCode fillMMOverviewVects(const Muon::MMPrepData *, MMOverviewHistogramStruct &vects, MMByPhiStruct(&occupancyPlots)[16][2]) const
SG::ReadHandleKey< Trk::SegmentCollection > m_segm_type
void fillMMTrigger(const xAOD::NSWMMTPRDOContainer *, const int) const
StatusCode fillMMSummaryHistograms(const MMSummaryHistogramStruct(&vects)[2][16][2][2][4]) const
Gaudi::Property< bool > m_do_mm_overview
void clusterFromSegments(const Trk::SegmentCollection *, const int lb) const
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_meTrkKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
MuonPrepDataCollection< MMPrepData > MMPrepDataCollection

◆ fillMMHistograms()

StatusCode MMRawDataMonAlg::fillMMHistograms ( const Muon::MMPrepData * ) const
private

Definition at line 393 of file MMRawDataMonAlg.cxx.

393 {
394 return StatusCode::SUCCESS;
395}

◆ fillMMOverviewHistograms()

void MMRawDataMonAlg::fillMMOverviewHistograms ( const MMOverviewHistogramStruct & vects,
MMByPhiStruct(&) occupancyPlots[16][2],
const int lb ) const
private

Definition at line 259 of file MMRawDataMonAlg.cxx.

260{
261 auto charge_all = Monitored::Collection("charge_all", vects.charge_all);
262 auto numberofstrips_percluster = Monitored::Collection("numberofstrips_percluster", vects.numberofstrips_percluster);
263 fill("mmMonitor", charge_all, numberofstrips_percluster);
264
265 auto strip_times = Monitored::Collection("strip_times", vects.strp_times);
266 auto cluster_times = Monitored::Collection("cluster_times", vects.cl_times);
267 auto strip_number = Monitored::Collection("strip_number", vects.strip_number);
268 auto statEta_strip = Monitored::Collection("statEta_strip", vects.statEta_strip);
269 fill("mmMonitor", strip_times, cluster_times, strip_number, statEta_strip);
270
271 auto x_mon = Monitored::Collection("x_mon", vects.x_mon);
272 auto y_mon = Monitored::Collection("y_mon", vects.y_mon);
273 auto z_mon = Monitored::Collection("z_mon", vects.z_mon);
274 auto R_mon = Monitored::Collection("R_mon", vects.R_mon);
275 fill("mmMonitor", x_mon, y_mon, z_mon, R_mon);
276
277 auto lb_mon = Monitored::Scalar<int>("lb_mon", lb);
278
279 for(int statPhi=0; statPhi<16; ++statPhi) {
280 for(int iside=0; iside<2; ++iside) {
281 auto& occ_lb = occupancyPlots[statPhi][iside];
282 auto sector_lb = Monitored::Collection("sector_lb_"+MM_Side[iside]+"_phi"+std::to_string(statPhi+1),occ_lb.sector_lb);
283 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
284 fill(MM_sideGroup, lb_mon, sector_lb);
285 }
286 }
287 auto sector_CSide = Monitored::Collection("sector_CSide",vects.sector_CSide);
288 auto sector_ASide = Monitored::Collection("sector_ASide",vects.sector_ASide);
289 auto stationPhi_CSide = Monitored::Collection("stationPhi_CSide",vects.stationPhi_CSide);
290 auto stationPhi_ASide = Monitored::Collection("stationPhi_ASide",vects.stationPhi_ASide);
291
292 fill("mmMonitor", sector_CSide, sector_ASide, stationPhi_CSide, stationPhi_ASide );
293}

◆ fillMMOverviewVects()

StatusCode MMRawDataMonAlg::fillMMOverviewVects ( const Muon::MMPrepData * prd,
MMOverviewHistogramStruct & vects,
MMByPhiStruct(&) occupancyPlots[16][2] ) const
private

Definition at line 185 of file MMRawDataMonAlg.cxx.

186{
187 Identifier Id = prd->identify();
188 const std::vector<Identifier>& stripIds = prd->rdoList();
189 unsigned int nStrips = stripIds.size(); // number of strips in this cluster (cluster size)
190 const std::vector<uint16_t>& stripNumbers = prd->stripNumbers();
191
192 std::string stName = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
193 int gas_gap = m_idHelperSvc->mmIdHelper().gasGap(Id);
194 int stationEta = m_idHelperSvc->mmIdHelper().stationEta(Id);
195 int stationPhi = m_idHelperSvc->mmIdHelper().stationPhi(Id);
196 int multiplet = m_idHelperSvc->mmIdHelper().multilayer(Id);
197 int channel = m_idHelperSvc->mmIdHelper().channel(Id);
198
199 // Returns the charge (number of electrons) converted in fC
200 float charge = prd->charge()*conversion_charge;
201 // Returns the times of each strip (in ns)
202 std::vector<short int> strip_times = prd->stripTimes();
203
205 float R = std::hypot(pos.x(),pos.y());
206
207 // MM gaps are back to back, so the direction of the drift (time) is different for the even and odd gaps -> flip for the even gaps
208
209 vects.charge_all.push_back(charge);
210 vects.numberofstrips_percluster.push_back(nStrips);
211 vects.x_mon.push_back(pos.x());
212 vects.y_mon.push_back(pos.y());
213 vects.z_mon.push_back(pos.z());
214 vects.R_mon.push_back(R);
215
216 // 16 phi sectors, 8 stationPhi times 2 stName, MMS and MML
217 int sectorPhi = get_sectorPhi_from_stationPhi_stName(stationPhi,stName);
218
219 // Occupancy plots with PCB granularity further divided for each eta sector: -2, -1, 1, 2
220 // CSide and ASide
221 int iside = (stationEta>0) ? 1 : 0;
222
223 auto& thisSect = occupancyPlots[sectorPhi-1][iside];
224 const int gap_offset=4;
225 int gas_gap8 = (multiplet==1) ? gas_gap : gas_gap + gap_offset;
226 int FEB = get_FEB_from_channel(channel, stationEta);
227
228 int bin = get_bin_for_feb_occ(gas_gap8,FEB);
229
230 thisSect.sector_lb.push_back(bin);
231
232 if(stationEta<0) {
233 vects.sector_CSide.push_back(bin);
234 vects.stationPhi_CSide.push_back(sectorPhi);
235 } else {
236 vects.sector_ASide.push_back(bin);
237 vects.stationPhi_ASide.push_back(sectorPhi);
238 }
239
240 // loop on each strip
241 int sIdx = 0; // index-counter for the vector of Id's
242 float cluster_time = 0;
243 for(const Identifier& id: stripIds) {
244
245 std::string stName_strip = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(id));
246 int stationEta_strip = m_idHelperSvc->mmIdHelper().stationEta(id);
247 vects.statEta_strip.push_back(stationEta_strip);
248 vects.strip_number.push_back(stripNumbers[sIdx]);
249 vects.strp_times.push_back(strip_times.at(sIdx));
250 cluster_time += strip_times.at(sIdx);
251 ++sIdx;
252 }
253 cluster_time /= strip_times.size();
254 vects.cl_times.push_back(cluster_time);
255
256 return StatusCode::SUCCESS;
257}
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
Definition MMPrepData.h:211
Identifier identify() const
return the identifier
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
constexpr uint8_t stationPhi
station Phi 1 to 8

◆ fillMMSummaryHistograms()

StatusCode MMRawDataMonAlg::fillMMSummaryHistograms ( const MMSummaryHistogramStruct(&) vects[2][16][2][2][4]) const
private

Definition at line 351 of file MMRawDataMonAlg.cxx.

351 {
352
353 for(int iside=0; iside<2; ++iside) {
354 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
355
356
357
358 for(int statPhi=0; statPhi<16; ++statPhi) {
359 for(int multiplet=0; multiplet<2; ++multiplet) {
360
361
362 for(int statEta=0; statEta<2; ++statEta) {
363
364 for(int gas_gap=0; gas_gap<4; ++gas_gap) {
365 auto& Vectors = vects[iside][statPhi][statEta][multiplet][gas_gap];
366 auto sector_strip = Monitored::Collection("sector_strip_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1), Vectors.sector_strip);
367 auto strip_number = Monitored::Collection("strip_number_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1), Vectors.strip_number);
369 if(!Vectors.strip_number.empty())
370 {
371 auto cluster_size = Monitored::Collection("cluster_size_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.cl_size);
372 auto strip_times = Monitored::Collection("strp_time_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.strp_times);
373 auto cluster_time = Monitored::Collection("cluster_time_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.cl_times);
374 auto charge_perPCB = Monitored::Collection("charge_perPCB_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.charge);
375 auto charge_perlayer = Monitored::Collection("charge_perlayer_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.charge);
376 auto cluster_size_perlayer = Monitored::Collection("cluster_size_perlayer_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.cl_size);
377 auto pcb_mon = Monitored::Collection("pcb_mon_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.pcb);
378 auto pcb_strip_mon = Monitored::Collection("pcb_strip_mon_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1) + "_eta" + std::to_string(statEta+1) + "_ml" + std::to_string(multiplet+1) + "_gap" + std::to_string(gas_gap+1), Vectors.pcb_strip);
379 fill(MM_sideGroup, cluster_size, strip_times, cluster_time, charge_perPCB, pcb_mon, pcb_strip_mon, charge_perlayer, cluster_size_perlayer);
380 }
381 }
382
383 fill(MM_sideGroup, strip_number, sector_strip);
384 }
385 }
386 }
387 }
388 }
389
390 return StatusCode::SUCCESS;
391}

◆ fillMMSummaryVects()

StatusCode MMRawDataMonAlg::fillMMSummaryVects ( const Muon::MMPrepData * prd,
MMSummaryHistogramStruct(&) vects[2][16][2][2][4] ) const
private

Definition at line 295 of file MMRawDataMonAlg.cxx.

296{
297 Identifier Id = prd->identify();
298 const std::vector<Identifier>& stripIds = prd->rdoList();
299
300 std::string stName = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(Id));
301 int thisStationEta = m_idHelperSvc->mmIdHelper().stationEta(Id);
302 int thisStationPhi = m_idHelperSvc->mmIdHelper().stationPhi(Id);
303 int thisMultiplet = m_idHelperSvc->mmIdHelper().multilayer(Id);
304 int thisGasgap = m_idHelperSvc->mmIdHelper().gasGap(Id);
305 int ch = m_idHelperSvc->mmIdHelper().channel(Id);
306 float thisCharge=prd->charge()*conversion_charge;
307 std::vector<short int> strip_times = prd->stripTimes();
308
309
310 int phi=get_sectorPhi_from_stationPhi_stName(thisStationPhi ,stName);
311
312 // CSide and ASide
313 int iside = (thisStationEta>0) ? 1 : 0;
314
315 // 2 eta sectors depending on Eta=+-1 (0) and +-2 (1)
316 int sectorEta=get_sectorEta_from_stationEta(thisStationEta);
317 unsigned int csize = stripIds.size();
318 int PCB = get_PCB_from_channel(ch);
319 auto& Vectors = vects[iside][phi-1][sectorEta][thisMultiplet-1][thisGasgap-1];
320
321 // loop on strips
322 int sIdx = 0;
323 const std::vector<uint16_t>& stripNumbers=prd->stripNumbers();
324 float cluster_time = 0;
325 for ( const Identifier& id : stripIds) {
326
327 int stationEta = m_idHelperSvc->mmIdHelper().stationEta(id);
328 int gas_gap = m_idHelperSvc->mmIdHelper().gasGap(Id);
329 int multiplet = m_idHelperSvc->mmIdHelper().multilayer(Id);
330 // Filling Vectors for both sides, considering each strip
332 Vectors.strp_times.push_back(strip_times.at(sIdx));
333 cluster_time += strip_times.at(sIdx);
334 }
335 Vectors.strip_number.push_back(stripNumbers[sIdx]);
336 Vectors.pcb_strip.push_back( get_PCB_from_channel(stripNumbers[sIdx]));
337 ++sIdx;
338 if(iside==1) Vectors.sector_strip.push_back(get_bin_for_occ_ASide_hist(stationEta,multiplet,gas_gap));
339 if(iside==0) Vectors.sector_strip.push_back(get_bin_for_occ_CSide_hist(stationEta,multiplet,gas_gap));
340 }
342 Vectors.cl_size.push_back(csize);
343 Vectors.pcb.push_back(PCB);
344 cluster_time /= strip_times.size();
345 Vectors.cl_times.push_back(cluster_time);
346 Vectors.charge.push_back(thisCharge);
347 }
348 return StatusCode::SUCCESS;
349}
Scalar phi() const
phi method
int get_bin_for_occ_ASide_hist(const int stationEta, const int multiplet, const int gas_gap) const
int get_bin_for_occ_CSide_hist(const int stationEta, const int multiplet, const int gas_gap) const

◆ fillMMTrigger()

void MMRawDataMonAlg::fillMMTrigger ( const xAOD::NSWMMTPRDOContainer * mmtp,
const int lb ) const
private

Definition at line 397 of file MMRawDataMonAlg.cxx.

397 {
398
399 auto lb_tri=Monitored::Scalar<int>("lb_tri",lb);
400
401 for (const auto* rdo : *mmtp) {
402 auto sourceID = rdo->sourceID();
403 auto moduleID = rdo->moduleID();
404 int s_side = (sourceID >> 16) == 107 ? 1:-1; // 1 for A; -1 for C
405 auto side = Monitored::Scalar<int>("tri_side", s_side);
406 int iside= s_side>0 ? s_side : 0;
407 uint s_sector = (moduleID & 0xF) + 1; //0-15 --> 1-16
408 int oct = (int)((s_sector-1)/2.);
409 float sector_pos=(45/180.)*M_PI*oct; //large
410 if(s_sector%2==0 ) sector_pos=(45*oct+22.5)*M_PI/180.; //small
411 if(sector_pos>M_PI) sector_pos=sector_pos-2*M_PI;
412
413 auto trig_sector = Monitored::Scalar<int>("trig_sector", s_sector*s_side);
414
415 auto event_bcid=rdo->ROD_BCID();
416
417 auto bcid=Monitored::Scalar<int>("bcid",event_bcid);
418
419 std::vector<short unsigned int> art_bcids = rdo->art_BCID();
420 std::vector<unsigned char> layers=rdo->art_layer();
421 auto channels=rdo->art_channel();
422
423 fill("mmTrigger", trig_sector, lb_tri);
424
425 for (long unsigned int i=0; i< rdo->art_BCID().size(); i++ ){
426 auto art_layer=static_cast<unsigned int>(layers[i]);
427 auto art_channel = Monitored::Scalar<int>("art_channel", channels[i]);
428 auto art_sector_layer = Monitored::Scalar<int>("art_sector_layer", s_side*8*(s_sector-1)+art_layer);
429
430 const int rollover=3564;
431 int art_bc=art_bcids[i];
432 int relative = art_bc - event_bcid;;
433 if (relative > rollover / 2) {
434 relative -= rollover;
435 } else if (relative <= -rollover / 2) {
436 relative += rollover;
437 }
438 if (relative > (rollover-2048) / 2) {
439 relative -= (rollover-2048);
440 }
441 auto art_deltaBC=Monitored::Scalar<int>("art_deltaBC",relative);
442 auto art_deltaBC_perSector=Monitored::Scalar<int>("art_deltaBC_"+MM_Side[iside]+"_s"+std::to_string(s_sector),relative);
443 auto art_bc_mon=Monitored::Scalar<int>("art_bc",art_bc);
444
445 fill("mmTrigger", art_channel, trig_sector, art_sector_layer, art_deltaBC, art_bc_mon, bcid, lb_tri, art_deltaBC_perSector);
446 }
447
448 auto bcids =rdo->trig_BCID();
449 auto dthetas=rdo->trig_dTheta();
450 auto rids=rdo->trig_ROI_rID();
451 auto phiids=rdo->trig_ROI_phiID() ;
452
453
454 std::unordered_map<int, int> NROIPerBC;
455 for (int bc : bcids) NROIPerBC[bc]++;
456 for (const auto& [value, count] : NROIPerBC) {
457 auto nROIPerBC=Monitored::Scalar<int>("nROIPerBC",count);
458 fill("mmTrigger_roi", nROIPerBC, trig_sector);
459 }
460
461 int nROI=rdo->trig_BCID().size();
462 for (int i=0; i< nROI; i++ ){
463 auto phiID = (phiids[i] & 0b11111) * ((phiids[i] >> 5) ? 1 : -1);
464 int sign = phiID > 0 ? 1 : -1;
465 auto phi_conv = (phiID-0.5*sign)*(16./31.)*M_PI/180. + sector_pos;
466 if(phi_conv> M_PI)phi_conv = phi_conv - 2*M_PI;
467
468 const float z_ref=7824.46;
469 const float r_step=(5000-900)/256.;
470 auto rID = static_cast<unsigned int>(rids[i]);
471 float r_conv=r_step*rID+900;
472 float eta_conv=-log(0.5*atan(r_conv/z_ref))*s_side;
473 // auto dTheta=Monitored::Scalar<float>("dTheta_roi",static_cast<float>(dthetas[i]));
474 auto deltaBC= Monitored::Scalar<int>("deltaBC", bcids[i]-event_bcid);
475 auto deltaBC_perSector= Monitored::Scalar<int>("deltaBC_"+MM_Side[iside]+"_s"+std::to_string(s_sector), bcids[i]-event_bcid);
476 auto rid=Monitored::Scalar<int>("rid",rID);
477 auto phiid=Monitored::Scalar<int>("phiid",phiID);
478 auto rid_sector=Monitored::Scalar<int>("rid_"+MM_Side[iside]+"_s"+std::to_string(s_sector),rID);
479 auto phiid_sector=Monitored::Scalar<int>("phiid_"+MM_Side[iside]+"_s"+std::to_string(s_sector),phiID);
480 auto r_roi=Monitored::Scalar<float>("r_roi",r_conv);
481 auto phi_roi=Monitored::Scalar<float>("phi_roi",phi_conv);
482 auto eta_roi=Monitored::Scalar<float>("eta_roi",eta_conv);
483 auto x_roi_sideA=Monitored::Scalar<float>("x_roi_sideA", r_conv*cos(phi_roi));
484 auto y_roi_sideA=Monitored::Scalar<float>("y_roi_sideA", r_conv*sin(phi_roi));
485 auto x_roi_sideC=Monitored::Scalar<float>("x_roi_sideC", r_conv*cos(phi_roi) );
486 auto y_roi_sideC=Monitored::Scalar<float>("y_roi_sideC", r_conv*sin(phi_roi));
487
488 fill("mmTrigger_roi", deltaBC, phiid, rid, trig_sector, phi_roi, eta_roi,r_roi, lb_tri, rid_sector, phiid_sector, deltaBC_perSector);
489 if(s_side>0) fill("mmTrigger_roi", x_roi_sideA, y_roi_sideA);
490 if(s_side<0) fill("mmTrigger_roi", x_roi_sideC, y_roi_sideC);
491
492 }
493 }
494
495}
#define M_PI
unsigned int uint
int sign(int a)
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.
setEventNumber setTimeStamp bcid

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ get_bin_for_feb_occ()

int MMRawDataMonAlg::get_bin_for_feb_occ ( const int gas_gap,
const int FEB ) const
private

Definition at line 136 of file MMRawDataUtils.cxx.

136 {
137
138 static const int max_feb = 16;
139
140 return (gas_gap-1)*max_feb + (FEB-1);
141
142}

◆ get_bin_for_occ()

int MMRawDataMonAlg::get_bin_for_occ ( const int gas_gap,
const int PCB ) const
private

Definition at line 128 of file MMRawDataUtils.cxx.

128 {
129
130 static const int max_pcb = 8;
131
132 return (gas_gap-1)*max_pcb + (PCB-1);
133
134}

◆ get_bin_for_occ_ASide_hist()

int MMRawDataMonAlg::get_bin_for_occ_ASide_hist ( const int stationEta,
const int multiplet,
const int gas_gap ) const
private

Definition at line 106 of file MMRawDataUtils.cxx.

106 {
107
108 static const int max_gas_gap = 4;
109 static const int max_multiplet = 2;
110
111 return (stationEta-1)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
112
113}

◆ get_bin_for_occ_ASide_pcb_eta1_hist()

int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta1_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB ) const
private

Definition at line 167 of file MMRawDataUtils.cxx.

167 {
168
169 static const int max_pcb = 5;
170 static const int max_gas_gap = 4;
171 if (stationEta != 1) return -1;
172
173 return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
174}

◆ get_bin_for_occ_ASide_pcb_eta2_hist()

int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta2_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB ) const
private

Definition at line 156 of file MMRawDataUtils.cxx.

156 {
157
158 static const int max_pcb = 3;
159 static const int max_gas_gap = 4;
160 if (stationEta != 2) return -1;
161
162 return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
163
164}

◆ get_bin_for_occ_CSide_hist()

int MMRawDataMonAlg::get_bin_for_occ_CSide_hist ( const int stationEta,
const int multiplet,
const int gas_gap ) const
private

Definition at line 97 of file MMRawDataUtils.cxx.

97 {
98
99 static const int max_gas_gap = 4;
100 static const int max_multiplet = 2;
101
102 return (stationEta+2)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
103
104}

◆ get_bin_for_occ_CSide_pcb_eta1_hist()

int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta1_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB ) const
private

Definition at line 145 of file MMRawDataUtils.cxx.

145 {
146
147 static const int max_pcb = 5;
148 static const int max_gas_gap = 4;
149 if (stationEta != -1) return -1;
150
151 return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
152
153}

◆ get_bin_for_occ_CSide_pcb_eta2_hist()

int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta2_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB ) const
private

Definition at line 116 of file MMRawDataUtils.cxx.

116 {
117
118 static const int max_pcb = 3;
119 static const int max_gas_gap = 4;
120 if (stationEta != -2) return -1;
121
122 return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
123
124}

◆ get_bin_for_occ_lb_ASide_pcb_eta1_hist()

int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta1_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB,
int isector ) const
private

Definition at line 200 of file MMRawDataUtils.cxx.

200 {
201
202 static const int max_pcb = 5;
203 static const int max_gas_gap = 4;
204 static const int max_isector = 2;
205 if (stationEta != 1) return -1;
206
207 return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
208}

◆ get_bin_for_occ_lb_ASide_pcb_eta2_hist()

int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta2_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB,
const int isector ) const
private

Definition at line 211 of file MMRawDataUtils.cxx.

211 {
212
213 static const int max_pcb = 3;
214 static const int max_gas_gap = 4;
215 static const int max_isector = 2;
216 if (stationEta != 2) return -1;
217
218 return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
219
220}

◆ get_bin_for_occ_lb_CSide_pcb_eta1_hist()

int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta1_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB,
int isector ) const
private

Definition at line 189 of file MMRawDataUtils.cxx.

189 {
190
191 static const int max_pcb = 5;
192 static const int max_gas_gap = 4;
193 static const int max_isector = 2;
194 if (stationEta != -1) return -1;
195
196 return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
197
198}

◆ get_bin_for_occ_lb_CSide_pcb_eta2_hist()

int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta2_hist ( const int stationEta,
const int multiplet,
const int gas_gap,
const int PCB,
const int isector ) const
private

Definition at line 177 of file MMRawDataUtils.cxx.

177 {
178
179 static const int max_pcb = 3;
180 static const int max_gas_gap = 4;
181 static const int max_isector = 2;
182 if (stationEta != -2) return -1;
183
184 return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb+ (PCB-1);
185
186}

◆ get_bin_for_occ_lb_pcb_hist()

int MMRawDataMonAlg::get_bin_for_occ_lb_pcb_hist ( const int multiplet,
const int gas_gap,
const int PCB ) const
private

Definition at line 222 of file MMRawDataUtils.cxx.

222 {
223
224 static const int max_pcb = 8;
225 static const int max_gas_gap = 4;
226
227 return (multiplet-1)*max_gas_gap*max_pcb + (gas_gap-1)*max_pcb + (PCB-1);
228
229}

◆ get_FEB_from_channel()

int MMRawDataMonAlg::get_FEB_from_channel ( const int channel,
const int stEta ) const
private

Definition at line 34 of file MMRawDataUtils.cxx.

34 {
35
36 if(fabs(stEta)==1){
37 if (channel>0 && channel<=512) return 1;
38 if (channel>512 && channel<=1024) return 2;
39
40 if (channel>1024 && channel<=1536) return 3;
41 if (channel>1536 && channel<=2048) return 4;
42
43 if (channel>2048 && channel<=2560) return 5;
44 if (channel>2560 && channel<=3072) return 6;
45
46 if (channel>3072 && channel<=3584) return 7;
47 if (channel>3584 && channel<=4096) return 8;
48
49 if (channel>4096 && channel<=4608) return 9;
50 if (channel>4608 && channel<=5120) return 10;
51 }else if(fabs(stEta)==2){
52 if (channel>0 && channel<=512) return 11;
53 if (channel>512 && channel<=1024) return 12;
54
55 if (channel>1024 && channel<=1536) return 13;
56 if (channel>1536 && channel<=2048) return 14;
57
58 if (channel>2048 && channel<=2560) return 15;
59 if (channel>2560 && channel<=3072) return 16;
60 }
61 throw std::invalid_argument( "channel is not valid!" );
62}

◆ get_PCB_from_channel()

int MMRawDataMonAlg::get_PCB_from_channel ( const int channel) const
private

Definition at line 23 of file MMRawDataUtils.cxx.

23 {
24
25 if (channel>0 && channel<=1024) return 1;
26 if (channel>1024 && channel<=2048) return 2;
27 if (channel>2048 && channel<=3072) return 3;
28 if (channel>3072 && channel<=4096) return 4;
29 if (channel>4096 && channel<=5120) return 5;
30
31 throw std::invalid_argument( "channel is not valid!" );
32}

◆ get_sectorEta_from_stationEta()

int MMRawDataMonAlg::get_sectorEta_from_stationEta ( const int stationEta) const
private

Definition at line 87 of file MMRawDataUtils.cxx.

87 {
88
89 // 1<-0 0-> 1
90 if (std::abs(stationEta)==1) return 0;
91 if (std::abs(stationEta)==2) return 1;
92
93 return -1;
94
95}

◆ get_sectorPhi_from_stationPhi_stName()

int MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName ( const int stationPhi,
const std::string & stName ) const
private

Definition at line 64 of file MMRawDataUtils.cxx.

64 {
65
66 if (stationPhi==1 && stName=="MML") return 1;
67 if (stationPhi==1 && stName=="MMS") return 2;
68 if (stationPhi==2 && stName=="MML") return 3;
69 if (stationPhi==2 && stName=="MMS") return 4;
70 if (stationPhi==3 && stName=="MML") return 5;
71 if (stationPhi==3 && stName=="MMS") return 6;
72 if (stationPhi==4 && stName=="MML") return 7;
73 if (stationPhi==4 && stName=="MMS") return 8;
74 if (stationPhi==5 && stName=="MML") return 9;
75 if (stationPhi==5 && stName=="MMS") return 10;
76 if (stationPhi==6 && stName=="MML") return 11;
77 if (stationPhi==6 && stName=="MMS") return 12;
78 if (stationPhi==7 && stName=="MML") return 13;
79 if (stationPhi==7 && stName=="MMS") return 14;
80 if (stationPhi==8 && stName=="MML") return 15;
81 if (stationPhi==8 && stName=="MMS") return 16;
82
83 throw std::invalid_argument( "stationPhi and stName are not valid!" );
84
85}

◆ GetEventInfo()

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

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

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

Definition at line 111 of file AthMonitorAlgorithm.cxx.

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

◆ getGroup()

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

Get a specific monitoring tool from the tool handle array.

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

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

Definition at line 168 of file AthMonitorAlgorithm.cxx.

168 {
169 // get the pointer to the tool, and check that it exists
170 auto idx = m_toolLookupMap.find(name);
171 if (ATH_LIKELY(idx != m_toolLookupMap.end())) {
172 return m_tools[idx->second];
173 }
174 else {
175 // treat empty tool handle case as in Monitored::Group
176 if (m_toolLookupMap.empty()) {
177 return m_dummy;
178 }
179
180 if (!isInitialized()) {
182 "It seems that the AthMonitorAlgorithm::initialize was not called "
183 "in derived class initialize method");
184 } else {
185 std::string available = std::accumulate(
186 m_toolLookupMap.begin(), m_toolLookupMap.end(), std::string(""),
187 [](const std::string& s, auto h) { return s + "," + h.first; });
188 ATH_MSG_FATAL("The tool " << name << " could not be found in the tool array of the "
189 << "monitoring algorithm " << m_name << ". This probably reflects a discrepancy between "
190 << "your python configuration and c++ filling code. Note: your available groups are {"
191 << available << "}.");
192 }
193 }
194 return m_dummy;
195}
#define ATH_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.

◆ getTrigDecisionTool()

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

Get the trigger decision tool member.

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

Returns
m_trigDecTool

Definition at line 198 of file AthMonitorAlgorithm.cxx.

198 {
199 return m_trigDecTool;
200}

◆ initialize()

StatusCode MMRawDataMonAlg::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 103 of file MMRawDataMonAlg.cxx.

105{
106 //init message stream
107 ATH_MSG_DEBUG("initialize MMRawDataMonAlg");
108 ATH_MSG_DEBUG("******************");
109 ATH_MSG_DEBUG("doMMESD: " << m_doMMESD );
110 ATH_MSG_DEBUG("******************");
111
113 ATH_CHECK(m_DetectorManagerKey.initialize());
114 ATH_CHECK(m_idHelperSvc.retrieve());
115
116 ATH_MSG_INFO(" Found the MuonIdHelperSvc ");
117 ATH_CHECK(m_muonKey.initialize());
118 ATH_CHECK(m_MMContainerKey.initialize());
119 ATH_CHECK(m_meTrkKey.initialize());
120 ATH_CHECK(m_segm_type.initialize());
121 ATH_CHECK(m_mmtpRdoKey.initialize());
122
123 ATH_MSG_DEBUG(" end of initialize " );
124 ATH_MSG_INFO("MMRawDataMonAlg initialization DONE " );
125
126 return StatusCode::SUCCESS;
127}
virtual StatusCode initialize() override
initialize
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey

◆ 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()

◆ MMEfficiency()

void MMRawDataMonAlg::MMEfficiency ( const xAOD::TrackParticleContainer * muonContainer) const
private

Definition at line 747 of file MMRawDataMonAlg.cxx.

748{
749 MMEfficiencyHistogramStruct effPlots[2][2][16][2][4];
750 MMEfficiencyHistogramStruct Gaps[2][2][16][2];
751
752 static const std::array<std::string,2> MM_Side = {"CSide", "ASide"};
753 static const std::array<std::string,2> EtaSector = {"1","2"};
754
755 for (const xAOD::TrackParticle* meTP : *muonContainer) {
756 if (!meTP) continue;
757 auto eta_trk = Monitored::Scalar<float>("eta_trk", meTP->eta());
758 auto phi_trk = Monitored::Scalar<float>("phi_trk", meTP->phi());
759
760 float pt_trk = meTP->pt();
761 if(pt_trk < m_cut_pt) continue;
762 // retrieve the original track
763 const Trk::Track* meTrack = meTP->track();
764 if(!meTrack) continue;
765 // get the vector of measurements on track
766 const DataVector<const Trk::MeasurementBase>* meas = meTrack->measurementsOnTrack();
767
768 for(const Trk::MeasurementBase* it: *meas) {
769 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(it);
770 if (!rot) continue;
771 Identifier rot_id = rot->identify();
772 if (!m_idHelperSvc->isMM(rot_id)) continue;
773
774 const Muon::MMClusterOnTrack* cluster = dynamic_cast<const Muon::MMClusterOnTrack*>(rot);
775 if (!cluster) continue;
776 std::string stName = m_idHelperSvc->mmIdHelper().stationNameString(m_idHelperSvc->mmIdHelper().stationName(rot_id));
777 int stEta= m_idHelperSvc->mmIdHelper().stationEta(rot_id);
778 int stPhi= m_idHelperSvc->mmIdHelper().stationPhi(rot_id);
779 int phi = get_sectorPhi_from_stationPhi_stName(stPhi,stName);
780 int multi = m_idHelperSvc->mmIdHelper().multilayer(rot_id);
781 int gap= m_idHelperSvc->mmIdHelper().gasGap(rot_id);
782 int ch= m_idHelperSvc->mmIdHelper().channel(rot_id);
783 int pcb=get_PCB_from_channel(ch);
784 int abs_stEta= get_sectorEta_from_stationEta(stEta);
785 int iside = (stEta > 0) ? 1 : 0;
786 if( ! (std::find( Gaps[iside][abs_stEta][phi-1][multi-1].nGaps.begin(), Gaps[iside][abs_stEta][phi-1][multi-1].nGaps.end(), gap ) != Gaps[iside][abs_stEta][phi-1][multi-1].nGaps.end()) )
787 Gaps[iside][abs_stEta][phi-1][multi-1].nGaps.push_back(gap);
788 //numerator
789 if(effPlots[iside][abs_stEta][phi-1][multi-1][gap-1].num.size()==0) effPlots[iside][abs_stEta][phi-1][multi-1][gap-1].num.push_back(pcb-1);
790 }
791 } // loop on tracks
792
793 unsigned int nGaptag=3;
794
795 for(int s=0; s<2; ++s) {
796 std::string MM_sideGroup = "MM_sideGroup"+MM_Side[s];
797 for(int e=0; e<2; ++e) {
798 for(int p=0; p<16; ++p) {
799 for(int m=0; m<2; ++m) {
800 if(Gaps[s][e][p][m].nGaps.size()<nGaptag) continue;
801 if(Gaps[s][e][p][m].nGaps.size()>4) continue;
802 //find the missing gap
803 int gapsum=0;
804 for (unsigned int g=0; g<Gaps[s][e][p][m].nGaps.size(); ++g)
805 gapsum+= Gaps[s][e][p][m].nGaps.at(g);
806 int missing_gap=10-gapsum-1;
807 //if missing gap = -1 --> nGaps=4 --> all efficient
808 if(Gaps[s][e][p][m].nGaps.size()==4){
809 for (unsigned int ga=0; ga<Gaps[s][e][p][m].nGaps.size(); ++ga){
810 for (unsigned int i=0; i<effPlots[s][e][p][m][ga].num.size(); ++i){
811 int pcb = effPlots[s][e][p][m][ga].num.at(i);
812 auto traversed_pcb = Monitored::Scalar<int>("pcb_eta"+std::to_string(e+1)+"_"+MM_Side[s]+"_phi"+std::to_string(p)+"_multiplet"+std::to_string(m+1)+"_gas_gap"+std::to_string(ga+1),pcb);
813 int layer=ga+4*m+8*p;
814
815 auto traversed_gap = Monitored::Scalar<int>(MM_Side[s]+"_eta"+std::to_string(e+1),layer);
816 auto isHit = 1;
817 auto hitcut = Monitored::Scalar<int>("hitcut", (int)isHit);
818 fill(MM_sideGroup, traversed_pcb, traversed_gap, hitcut);
819 }
820 }
821 } else {// 3 gaps, the fourth is inefficient
822 int ref_gap = missing_gap+1;
823 if(missing_gap==3) ref_gap=0;
824 if (ref_gap>3){
825 ATH_MSG_FATAL("ref_gap is out of range in MMRawDataMonAlg::MMEfficiency");
826 return;
827 }
828 int ref_pcb=effPlots[s][e][p][m][ref_gap].num.at(0);
829 auto traversed_pcb = Monitored::Scalar<int>("pcb_eta"+std::to_string(e+1)+"_"+MM_Side[s]+"_phi"+std::to_string(p)+"_multiplet"+std::to_string(m+1)+"_gas_gap"+std::to_string(missing_gap+1), ref_pcb);
830 int layer=missing_gap+4*m+8*p;
831 auto traversed_gap = Monitored::Scalar<int>(MM_Side[s]+"_eta"+std::to_string(e+1),layer);
832 auto isHit = 0;
833 auto hitcut = Monitored::Scalar<int>("hitcut", (int)isHit);
834 fill(MM_sideGroup, traversed_pcb, traversed_gap, hitcut);
835 }
836
837
838 }
839 }
840 }
841 }
842}
Gaudi::Property< float > m_cut_pt

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ parseList()

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

Parse a string into a vector.

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

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

Definition at line 345 of file AthMonitorAlgorithm.cxx.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ trigChainsArePassed()

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

Check whether triggers are passed.

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

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

Definition at line 203 of file AthMonitorAlgorithm.cxx.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_cut_pt

Gaudi::Property<float> MMRawDataMonAlg::m_cut_pt {this,"cut_pt",15000}
private

Definition at line 109 of file MMRawDataMonAlg.h.

109{this,"cut_pt",15000};

◆ 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> MMRawDataMonAlg::m_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager","Key of input MuonDetectorManager condition data"}
private

Definition at line 65 of file MMRawDataMonAlg.h.

65{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_do_mm_overview

Gaudi::Property<bool> MMRawDataMonAlg::m_do_mm_overview {this,"do_mm_overview",true}
private

Definition at line 107 of file MMRawDataMonAlg.h.

107{this,"do_mm_overview",true};

◆ m_do_stereoCorrection

Gaudi::Property<bool> MMRawDataMonAlg::m_do_stereoCorrection {this,"do_stereoCorrection",false}
private

Definition at line 108 of file MMRawDataMonAlg.h.

108{this,"do_stereoCorrection",false};

◆ m_doDetailedHists

Gaudi::Property<bool> MMRawDataMonAlg::m_doDetailedHists {this,"doDetailedHists",true}
private

Definition at line 110 of file MMRawDataMonAlg.h.

110{this,"doDetailedHists",true};

◆ m_doMMESD

Gaudi::Property<bool> MMRawDataMonAlg::m_doMMESD {this,"DoMMESD",true}
private

Definition at line 106 of file MMRawDataMonAlg.h.

106{this,"DoMMESD",true};

◆ m_DQFilterTools

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

Array of Data Quality filter tools.

Definition at line 346 of file AthMonitorAlgorithm.h.

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

◆ m_dummy

const ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::m_dummy
privateinherited

Definition at line 374 of file AthMonitorAlgorithm.h.

◆ m_enforceExpressTriggers

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

Definition at line 377 of file AthMonitorAlgorithm.h.

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

◆ m_environment

AthMonitorAlgorithm::Environment_t AthMonitorAlgorithm::m_environment
protectedinherited

Instance of the Environment_t enum.

Definition at line 355 of file AthMonitorAlgorithm.h.

◆ m_environmentStr

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

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

Definition at line 357 of file AthMonitorAlgorithm.h.

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

◆ m_EventInfoKey

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

Key for retrieving EventInfo from StoreGate.

Definition at line 367 of file AthMonitorAlgorithm.h.

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

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fileKey

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

Internal Athena name for file.

Definition at line 363 of file AthMonitorAlgorithm.h.

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

◆ m_idHelperSvc

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

Definition at line 62 of file MMRawDataMonAlg.h.

62{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> MMRawDataMonAlg::m_meTrkKey {this, "METrkContainer", "ExtrapolatedMuonTrackParticles"}
private

Definition at line 69 of file MMRawDataMonAlg.h.

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

◆ m_MMContainerKey

SG::ReadHandleKey<Muon::MMPrepDataContainer> MMRawDataMonAlg::m_MMContainerKey {this,"MMPrepDataContainerName","MM_Measurements"}
private

Definition at line 67 of file MMRawDataMonAlg.h.

67{this,"MMPrepDataContainerName","MM_Measurements"};

◆ m_mmtpRdoKey

SG::ReadHandleKey<xAOD::NSWMMTPRDOContainer> MMRawDataMonAlg::m_mmtpRdoKey {this, "NSW_MMTPDataKey", "NSW_MMTrigProcessor_RDO"}
private

Definition at line 70 of file MMRawDataMonAlg.h.

70{this, "NSW_MMTPDataKey", "NSW_MMTrigProcessor_RDO"};

◆ m_muonKey

SG::ReadHandleKey<xAOD::MuonContainer> MMRawDataMonAlg::m_muonKey {this,"MuonKey","Muons","muons"}
private

Definition at line 68 of file MMRawDataMonAlg.h.

68{this,"MuonKey","Muons","muons"};

◆ m_muonSelectionTool

ToolHandle<CP::IMuonSelectionTool> MMRawDataMonAlg::m_muonSelectionTool {this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool"}
private

Definition at line 64 of file MMRawDataMonAlg.h.

64{this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool"};

◆ m_name

std::string AthMonitorAlgorithm::m_name
privateinherited

Definition at line 371 of file AthMonitorAlgorithm.h.

◆ m_segm_type

SG::ReadHandleKey<Trk::SegmentCollection> MMRawDataMonAlg::m_segm_type {this,"Eff_segm_type","TrackMuonSegments","muon segments"}
private

Definition at line 66 of file MMRawDataMonAlg.h.

66{this,"Eff_segm_type","TrackMuonSegments","muon segments"};

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


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