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 (std::string_view name) const
 Get a specific monitoring tool from the tool handle array.
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool () const
 Get the trigger decision tool member.
bool trigChainsArePassed (const std::vector< std::string > &vTrigNames) const
 Check whether triggers are passed.
SG::ReadHandle< xAOD::EventInfoGetEventInfo (const EventContext &) const
 Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
virtual float lbAverageInteractionsPerCrossing (const EventContext &ctx) const
 Calculate the average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx) const
 Calculate instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx) const
 Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbLuminosityPerBCID (const EventContext &ctx) const
 Calculate the instantaneous luminosity per bunch crossing.
virtual double lbDuration (const EventContext &ctx) const
 Calculate the duration of the luminosity block (in seconds).
virtual float lbAverageLivefraction (const EventContext &ctx) const
 Calculate the average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx) const
 Calculate the live fraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx) const
 Calculate the average integrated luminosity multiplied by the live fraction.
virtual StatusCode parseList (const std::string &line, std::vector< std::string > &result) const
 Parse a string into a vector.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

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

Protected Attributes

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

Private Types

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, CxxUtils::TransparentStringHash, std::equal_to<> > 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 373 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 197 of file AthMonitorAlgorithm.h.

197 {
198 userDefined = 0,
199 monteCarlo,
200 collisions,
201 cosmics,
202 heavyIonCollisions,
203 };
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 178 of file AthMonitorAlgorithm.h.

178 {
179 user = 0,
180 online,
181 tier0,
182 tier0Raw,
183 tier0ESD,
184 AOD,
185 altprod,
186 };

Constructor & Destructor Documentation

◆ MMRawDataMonAlg()

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

Definition at line 97 of file MMRawDataMonAlg.cxx.

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

◆ ~MMRawDataMonAlg()

virtual MMRawDataMonAlg::~MMRawDataMonAlg ( )
virtualdefault

Member Function Documentation

◆ clusterFromSegments()

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

Definition at line 844 of file MMRawDataMonAlg.cxx.

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

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

227{ 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 211 of file AthMonitorAlgorithm.h.

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

◆ envStringToEnum()

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

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

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

Definition at line 116 of file AthMonitorAlgorithm.cxx.

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

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

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

Applies filters and trigger requirements.

Then, calls fillHistograms().

Parameters
ctxevent context for reentrant Athena call
Returns
StatusCode

Definition at line 77 of file AthMonitorAlgorithm.cxx.

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

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ fillHistograms()

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

129{
130 int lumiblock = -1;
131 lumiblock = GetEventInfo(ctx)->lumiBlock();
132 ATH_MSG_DEBUG("MMRawDataMonAlg::MM RawData Monitoring Histograms being filled" );
133
134 SG::ReadHandle<Muon::MMPrepDataContainer> mm_container(m_MMContainerKey,ctx);
135 ATH_MSG_DEBUG("****** mmContainer->size() : " << mm_container->size());
136
137 if(m_doMMESD) {
138 MMOverviewHistogramStruct overviewPlots;
139 MMSummaryHistogramStruct summaryPlots[2][16][2][2][4];
140 MMByPhiStruct occupancyPlots[16][2];
141
142 //loop in MMPrepDataContainer
143 for(const Muon::MMPrepDataCollection* coll : *mm_container) {
144 for(const Muon::MMPrepData* prd : *coll) {
145 ATH_CHECK(fillMMOverviewVects(prd, overviewPlots, occupancyPlots));
146 ATH_CHECK(fillMMSummaryVects(prd, summaryPlots));
148 }
149 }
150
151 if(m_do_mm_overview) fillMMOverviewHistograms(overviewPlots, occupancyPlots, lumiblock);
152
153 ATH_CHECK(fillMMSummaryHistograms(summaryPlots));
154 SG::ReadHandle<xAOD::TrackParticleContainer> meTPContainer{m_meTrkKey,ctx};
155 if (!meTPContainer.isValid()) {
156 ATH_MSG_FATAL("Nope. Could not retrieve "<<m_meTrkKey.fullKey());
157 return StatusCode::FAILURE;
158 }
159 clusterFromTrack(meTPContainer.cptr(),lumiblock);
160 MMEfficiency(meTPContainer.cptr());
161
162
163
164 //trigger
165 SG::ReadHandle<xAOD::NSWMMTPRDOContainer> rdos = SG::ReadHandle<xAOD::NSWMMTPRDOContainer>{m_mmtpRdoKey, ctx};
166 if (not rdos.isValid()) {
167 ATH_MSG_INFO("NSW MMTP failed. Skipping");
168 // return StatusCode::SUCCESS;
169 } else fillMMTrigger(rdos.cptr(),lumiblock);
170
171 SG::ReadHandle<Trk::SegmentCollection> segms(m_segm_type, ctx);
172
173 if (!segms.isValid()) {
174 ATH_MSG_INFO("evtStore() does not contain MM segms Collection with name " << m_segm_type);
175 // return StatusCode::FAILURE;
176 }else
177 clusterFromSegments(segms.cptr(),lumiblock);
178 }
179
180
181 return StatusCode::SUCCESS;
182}
#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 392 of file MMRawDataMonAlg.cxx.

392 {
393 return StatusCode::SUCCESS;
394}

◆ fillMMOverviewHistograms()

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

Definition at line 258 of file MMRawDataMonAlg.cxx.

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

◆ fillMMOverviewVects()

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

Definition at line 184 of file MMRawDataMonAlg.cxx.

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

350 {
351
352 for(int iside=0; iside<2; ++iside) {
353 std::string MM_sideGroup = "MM_sideGroup" + MM_Side[iside];
354
355
356
357 for(int statPhi=0; statPhi<16; ++statPhi) {
358 for(int multiplet=0; multiplet<2; ++multiplet) {
359
360
361 for(int statEta=0; statEta<2; ++statEta) {
362
363 for(int gas_gap=0; gas_gap<4; ++gas_gap) {
364 auto& Vectors = vects[iside][statPhi][statEta][multiplet][gas_gap];
365 auto sector_strip = Monitored::Collection("sector_strip_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1), Vectors.sector_strip);
366 auto strip_number = Monitored::Collection("strip_number_" + MM_Side[iside] + "_phi" + std::to_string(statPhi+1), Vectors.strip_number);
368 if(!Vectors.strip_number.empty())
369 {
370 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);
371 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);
372 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);
373 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);
374 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);
375 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);
376 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);
377 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);
378 fill(MM_sideGroup, cluster_size, strip_times, cluster_time, charge_perPCB, pcb_mon, pcb_strip_mon, charge_perlayer, cluster_size_perlayer);
379 }
380 }
381
382 fill(MM_sideGroup, strip_number, sector_strip);
383 }
384 }
385 }
386 }
387 }
388
389 return StatusCode::SUCCESS;
390}

◆ fillMMSummaryVects()

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

Definition at line 294 of file MMRawDataMonAlg.cxx.

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

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

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ 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 ( std::string_view name) const
inherited

Get a specific monitoring tool from the tool handle array.

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

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

Definition at line 168 of file AthMonitorAlgorithm.cxx.

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

203 {
204 return m_trigDecTool;
205}

◆ initialize()

StatusCode MMRawDataMonAlg::initialize ( )
overridevirtual

initialize

Returns
StatusCode

Reimplemented from AthMonitorAlgorithm.

Definition at line 102 of file MMRawDataMonAlg.cxx.

104{
105 //init message stream
106 ATH_MSG_DEBUG("initialize MMRawDataMonAlg");
107 ATH_MSG_DEBUG("******************");
108 ATH_MSG_DEBUG("doMMESD: " << m_doMMESD );
109 ATH_MSG_DEBUG("******************");
110
112 ATH_CHECK(m_DetectorManagerKey.initialize());
113 ATH_CHECK(m_idHelperSvc.retrieve());
114
115 ATH_MSG_INFO(" Found the MuonIdHelperSvc ");
116 ATH_CHECK(m_muonKey.initialize());
117 ATH_CHECK(m_MMContainerKey.initialize());
118 ATH_CHECK(m_meTrkKey.initialize());
119 ATH_CHECK(m_segm_type.initialize());
120 ATH_CHECK(m_mmtpRdoKey.initialize());
121
122 ATH_MSG_DEBUG(" end of initialize " );
123 ATH_MSG_INFO("MMRawDataMonAlg initialization DONE " );
124
125 return StatusCode::SUCCESS;
126}
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()

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

Specify if the algorithm is clonable.

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

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

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ MMEfficiency()

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

Definition at line 746 of file MMRawDataMonAlg.cxx.

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

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ trigChainsArePassed()

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

Check whether triggers are passed.

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

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

Definition at line 208 of file AthMonitorAlgorithm.cxx.

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

◆ 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 359 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 361 of file AthMonitorAlgorithm.h.

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

◆ m_defaultLBDuration

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

Default duration of one lumi block.

Definition at line 368 of file AthMonitorAlgorithm.h.

368{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 369 of file AthMonitorAlgorithm.h.

369{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 349 of file AthMonitorAlgorithm.h.

349{this,"FilterTools",{}};

◆ m_dummy

const ToolHandle<GenericMonitoringTool> AthMonitorAlgorithm::m_dummy
privateinherited

Definition at line 377 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 380 of file AthMonitorAlgorithm.h.

380 {this,
381 "EnforceExpressTriggers", false,
382 "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 358 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 360 of file AthMonitorAlgorithm.h.

360{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 370 of file AthMonitorAlgorithm.h.

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

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fileKey

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

Internal Athena name for file.

Definition at line 366 of file AthMonitorAlgorithm.h.

366{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 353 of file AthMonitorAlgorithm.h.

354{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 351 of file AthMonitorAlgorithm.h.

352{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 374 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, CxxUtils::TransparentStringHash, std::equal_to<> > AthMonitorAlgorithm::m_toolLookupMap
privateinherited

Definition at line 375 of file AthMonitorAlgorithm.h.

◆ m_tools

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

Array of Generic Monitoring Tools.

Definition at line 344 of file AthMonitorAlgorithm.h.

344{this,"GMTools",{}};

◆ m_trigDecTool

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

Tool to tell whether a specific trigger is passed.

Definition at line 348 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 363 of file AthMonitorAlgorithm.h.

363{this,"TriggerChain",""};

◆ m_trigLiveFractionDataKey

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

Definition at line 355 of file AthMonitorAlgorithm.h.

356{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 367 of file AthMonitorAlgorithm.h.

367{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 364 of file AthMonitorAlgorithm.h.


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