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

#include <MdtVsTgcRawDataValAlg.h>

Inheritance diagram for MdtVsTgcRawDataValAlg:
Collaboration diagram for MdtVsTgcRawDataValAlg:

Public Types

enum  Interval_t {
  file = 0 , eventsBlock , lumiBlock , lowStat ,
  medStat , higStat , run , fill ,
  all
}
 An enumeration describing how detailed a particular monitoring object is. More...
enum  MgmtAttr_t { ATTRIB_MANAGED = 0 , ATTRIB_UNMANAGED = 1 , ATTRIB_X_VS_LB = 2 }
 An enumeration describing how the class handles the histogram. More...

Public Member Functions

 MdtVsTgcRawDataValAlg (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~MdtVsTgcRawDataValAlg ()
StatusCode initialize ()
virtual StatusCode bookHistogramsRecurrent ()
 An inheriting class should either override this function, bookHists() or bookHistograms().
virtual StatusCode fillHistograms (const EventContext &ctx)
 An inheriting class should either override this function or fillHists().
virtual StatusCode procHistograms ()
 An inheriting class should either override this function or finalHists().
virtual StreamNameFcnstreamNameFunction ()
 Returns the function object that converts logical paramters into a physical stream name.
virtual StatusCode bookHists ()
 Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.
virtual StatusCode fillHists (const EventContext &ctx)
 Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over, calls procHists( bool, bool, bool ) and bookHists( bool, bool, bool ).
virtual StatusCode finalHists ()
 Calls procHists( true, true, true ).
virtual StatusCode bookHistograms ()
 An inheriting class should either override this function or bookHists().
virtual void setMonManager (AthenaMonManager *manager)
 Takes a pointer to a managing object to get information from it when needed.
virtual StatusCode regHist (TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.
virtual StatusCode regHist (TH1 *h, const MonGroup &group)
 Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.
virtual StatusCode getHist (TH1 *&h, const std::string &hName, const std::string &system, Interval_t interval)
 Returns a TH1 via the pointer passed as the first argument.
virtual StatusCode getHist (TH1 *&h, const std::string &hName, const MonGroup &group)
 Returns a TH1 via the pointer passed as the first argument.
virtual StatusCode getHist (TH2 *&h, const std::string &hName, const std::string &system, Interval_t interval)
 Returns a TH2 via the pointer passed as the first argument.
virtual StatusCode getHist (TH2 *&h, const std::string &hName, const MonGroup &group)
 Returns a TH2 via the pointer passed as the first argument.
virtual StatusCode regEfficiency (TEfficiency *e, const MonGroup &group)
 Registers a TEfficiency to be included in the output stream using logical parameters that describe the plot.
virtual StatusCode regGraph (TGraph *g, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TGraph to be included in the output stream using logical parameters that describe the graph.
virtual StatusCode regGraph (TGraph *g, const MonGroup &group)
 Registers a TGraph to be included in the output stream using logical parameters that describe the graph.
virtual StatusCode regTree (TTree *t, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
 Registers a TTree to be included in the output stream using logical parameters that describe it.
virtual StatusCode regTree (TTree *t, const MonGroup &group)
 Registers a TTree to be included in the output stream using logical parameters that describe it.
virtual StatusCode writeAndDelete (TH1 *h, const MonGroup &group)
 Write out histogram and delete it.
virtual StatusCode deregHist (TH1 *h)
 De-registers a TH1 from the THistSvc, but does NOT delete the object.
virtual StatusCode deregGraph (TGraph *g)
 De-registers a TGraph from the THistSvc, but does NOT delete the object.
virtual StatusCode deregObject (const std::string &objName, const std::string &system, Interval_t interval)
 De-registers a TObject from the THistSvc, but does NOT delete the object.
virtual StatusCode deregObject (const std::string &objName, const MonGroup &group)
 De-registers a TObject from the THistSvc, but does NOT delete the object.
virtual StatusCode setupOutputStreams (std::vector< std::string > Mapping=std::vector< std::string >())
 This implementation does nothing—streams in this class should be managed by the AthenaMonManager.
virtual StatusCode runStat ()
 This implementation does nothing; equivalent functionality may be provided by procHists( true, true, true ).
virtual StatusCode checkHists (bool calledFromFinalize)
 This implementation does nothing; equivalent functionality may be provided by procHists(...) with appropriate arguments.
virtual bool preSelector ()
virtual float lbAverageInteractionsPerCrossing (const EventContext &ctx) const
 Average mu, i.e.
virtual float lbInteractionsPerCrossing (const EventContext &ctx) const
 Instantaneous number of interactions, i.e.
virtual float lbAverageLuminosity (const EventContext &ctx) const
 Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbLuminosityPerBCID (const EventContext &ctx) const
 Instantaneous luminosity.
virtual double lbDuration (const EventContext &ctx) const
 Luminosity block time (in seconds).
virtual float lbAverageLivefraction (const EventContext &ctx) const
 Average luminosity livefraction.
virtual float livefractionPerBCID (const EventContext &ctx) const
 Livefraction per bunch crossing ID.
virtual double lbLumiWeight (const EventContext &ctx) const
 Average Integrated Luminosity Live Fraction.
 MMTB_DEPRECATED (newLowStatInterval)
 MMTB_DEPRECATED (newMedStatInterval)
 MMTB_DEPRECATED (newHigStatInterval)
 MMTB_DEPRECATED (newLowStat)
 MMTB_DEPRECATED (newLumiBlock)
 MMTB_DEPRECATED (newRun)
 MMTB_DEPRECATED (newEventsBlock)
 MMTB_DEPRECATED (endOfEventsBlock)
 MMTB_DEPRECATED (endOfLowStat)
 MMTB_DEPRECATED (endOfLumiBlock)
 MMTB_DEPRECATED (endOfRun)
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 sysInitialize () override
 Perform system initialization for an algorithm.
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

Static Public Member Functions

static std::string intervalEnumToString (Interval_t interval)
 Converts a LevelOfDetail_t to a string of the same name.
static Interval_t intervalStringToEnum (const std::string &str)
 Converts a string to the corresponding Interval_t.
static const InterfaceID & interfaceID ()

Protected Types

typedef std::map< std::string, OutputMetadata * > MDMap_t

Protected Member Functions

StatusCode regManagedHistograms (std::vector< MgmtParams< TH1 > > &templateHistograms)
StatusCode regManagedGraphs (std::vector< MgmtParams< TGraph > > &templateGraphs)
StatusCode regManagedTrees (std::vector< MgmtParams< TTree > > &templateTrees)
StatusCode regManagedEfficiencies (std::vector< MgmtParams< TEfficiency > > &templateEfficiencies)
StatusCode parseList (const std::string &, std::vector< std::string > &)
void updateTriggersForGroups (std::vector< std::string > &)
StatusCode registerMetadata (const std::string &streamName, const std::string &hName, const MonGroup &group)
StatusCode THistSvc_deReg_fixTGraph (TFile *file, TGraph *theGraph, std::string &directoryName)
 Fixes THistSvc->deReg(obj) when obj is TGraph instance.
unsigned int get_nEvents () const
long get_procNEventsProp () const
virtual bool trigChainsArePassed (std::vector< std::string > &)
virtual StreamNameFcngetNewStreamNameFcn () const
bool newLowStatIntervalFlag () const
 Flag functions allowing clients to determine when to book new and process old histograms; values are updated by fillHists() based on counting lumiBlocks, and are correctly set when fillHistograms(), bookHistograms() and procHistograms() are called.
bool newMedStatIntervalFlag () const
bool newHigStatIntervalFlag () const
bool newLowStatFlag () const
bool newLumiBlockFlag () const
bool newRunFlag () const
bool newEventsBlockFlag () const
bool endOfEventsBlockFlag () const
bool endOfLowStatFlag () const
bool endOfLumiBlockFlag () const
bool endOfRunFlag () const
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

std::map< Interval_t, std::vector< MgmtParams< TH1 > > > m_templateHistograms
std::map< Interval_t, std::vector< MgmtParams< TGraph > > > m_templateGraphs
std::map< Interval_t, std::vector< MgmtParams< TTree > > > m_templateTrees
std::map< Interval_t, std::vector< MgmtParams< TEfficiency > > > m_templateEfficiencies
std::vector< std::string > m_vTrigChainNames
std::vector< std::string > m_vTrigGroupNames
MDMap_t m_metadataMap
AthenaMonManagerm_manager
std::string m_managerNameProp
std::string m_fileKey
std::string m_dataTypeStr
std::string m_environmentStr
unsigned int m_detailLevel
AthenaMonManager::DataType_t m_dataType
AthenaMonManager::Environment_t m_environment
StreamNameFcnm_streamNameFcn
ServiceHandle< ITHistSvc > m_THistSvc
PublicToolHandle< Trig::ITrigDecisionToolm_trigDecTool {this, "TrigDecisionTool",""}
PublicToolHandle< ITriggerTranslatorToolm_trigTranslator {this,"TriggerTranslatorTool",""}
ToolHandleArray< IDQFilterToolm_DQFilterTools {this,"FilterTools",{}}
long m_procNEventsProp
std::string m_path
long m_preScaleProp
std::string m_triggerChainProp
std::string m_triggerGroupProp
bool m_useTrigger
unsigned int m_lastLumiBlock
unsigned int m_lastRun
int m_lastLowStatInterval
int m_lastMedStatInterval
int m_lastHigStatInterval
unsigned int m_nEvents
unsigned int m_nEventsIgnoreTrigger
unsigned int m_nLumiBlocks
bool m_haveClearedLastEventBlock

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void correlation (const Muon::MdtPrepDataContainer *mdt_hit_container, const Muon::TgcCoinDataContainer *tgc_trigger_container)
int numberOfSL (const Muon::TgcCoinDataContainer *tgctrgcontainer)
void roi2etaphi (const Muon::TgcCoinData &cd, int &eta, int &phi)
int phi2sector (int phi, int ef)
int roiphi2mdtSector (int roiphi, int ef)
int roitotalphi2sectorphi (int phi)
int stationGasGap2layer (int station, int GasGap)
void prepareTREarray (const MuonGM::MuonDetectorManager *MuonDetMgrDS)
int TGCgetlayer (int stationName, int g)
int TGClayer2stationindex (int l)
int TGCstationname2stationindex (int stationName)
StatusCode bookmaphists (MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
void maphists (const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void maphistsfinalize ()
StatusCode bookeffhists (MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
void tgceffcalc (const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void SortMDTSegments (const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
void DQCheckMDTSegments (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])
void MatchMDTSegments (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
void CheckTGConTrack (std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck (std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void tgceffcalcfinalize ()
int getStationMapIndex (int x, int l, int stationFE, int stationEta, int stationPhi)
void labelStationMap (TH2 *h2, int i=-1, int k=-1)
void putBox (TH2 *h2, float x1, float y1, float x2, float y2)
void BlankPhi24 (TH2 *h2, int binx)
void BlankStationMap (TH2 *h2, int ws)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

MuonDQAHistMap m_stationHists
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
bool m_checkCabling
bool m_tgclv1file
std::string m_chamberName
std::string m_StationSize
int m_sector
int m_side
int m_lastEvent
int m_cosmicStation
SG::ReadHandleKey< Muon::TgcPrepDataContainerm_tgc_PrepDataContainerName {this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}
SG::ReadHandleKey< Muon::TgcCoinDataContainerm_tgc_CoinContainerName {this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"}
SG::ReadHandleKey< Muon::MdtPrepDataContainerm_mdt_PrepDataContainerName {this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}
SG::ReadHandleKey< xAOD::MuonSegmentContainerm_mdt_SegmentCollectionName {this,"MdtSegmentCollection","MuonSegments","muon segments"}
int m_MdtAdcCut
int m_MdtTdcCut
const MuonGM::TgcReadoutElementm_TREarray [8][2][9][49] {}
TH1 * m_mvt_cutspassed [2] {}
TH2 * m_mdt_segmmap [2][4] {}
TH2 * m_eff_stationmapbase [2][2][4] {}
TH2 * m_eff_stationmapmid [2][2][4] {}
TH2 * m_eff_stationmap [2][2][4] {}
TH1 * m_mvt_extrprdsag [2][4][2][2][4] {}
TH1 * m_mvt_extrprdsag2 [2][4][2][2][4] {}
TH1 * m_tgc_prdcompsag [2][2][4] {}
TH1 * m_mdt_segmmatchsag [2][4][4][4] {}
TH1 * m_mdt_segmposdirsag [2][4][4] {}
TH1 * m_mdt_trackdirdirsag [2][4][4][4] {}
TH1 * m_mdt_trackchecksag [2][4][4][4][2] {}
bool m_newLowStatInterval
bool m_newMedStatInterval
bool m_newHigStatInterval
bool m_newLowStat
bool m_newLumiBlock
bool m_newRun
bool m_newEventsBlock
bool m_endOfEventsBlock
bool m_endOfLowStat
bool m_endOfLumiBlock
bool m_endOfRun
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"}
bool m_bookHistogramsInitial
bool m_useLumi
float m_defaultLBDuration
std::set< Interval_tm_supportedIntervalsForRebooking
Impm_d
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 38 of file MdtVsTgcRawDataValAlg.h.

Member Typedef Documentation

◆ MDMap_t

typedef std::map<std::string,OutputMetadata*> ManagedMonitorToolBase::MDMap_t
protectedinherited

Definition at line 827 of file ManagedMonitorToolBase.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ Interval_t

An enumeration describing how detailed a particular monitoring object is.

summary: used to summarize the state of the system

runstat: same as summary

shift: used to flag potential problems

expert: essential for diagnosing problems identified by shift-level objects

debug: useful for standalone debugging, but not for routine monitoring; not essential for diagnosing problems during normal running

transient: too detailed to ever be written; always summarized by the user by means of another object An enumeration describing the interval over which a particular monitoring object is filled (i.e., interval over which the method Fill(...) is called). This information may be stored with the monitoring object if an application is only able to partially fill the object (i.e., a job sees only part of a run or fill). This information may be ignored in some running Environments. The 'fill' interval corresponds to a fill of the LHC. The 'all' interval corresponds to all available data. The 'lumiBlock' and 'fill' intervals are only valid for the 'collisions' DataType_t.

Enumerator
file 
eventsBlock 
lumiBlock 
lowStat 
medStat 
higStat 
run 
fill 
all 

Definition at line 114 of file ManagedMonitorToolBase.h.

◆ MgmtAttr_t

An enumeration describing how the class handles the histogram.

attrib_unmanaged: histograms with this attribute will not be rebooked automatically and must be managed by the user code.

attrib_x_is_lb: indicates that the x-axis of the histogram is the luminosity block number and that the histogram should be rebooked as necessary if the current LB exceeds the range.

Enumerator
ATTRIB_MANAGED 
ATTRIB_UNMANAGED 
ATTRIB_X_VS_LB 

Definition at line 131 of file ManagedMonitorToolBase.h.

Constructor & Destructor Documentation

◆ MdtVsTgcRawDataValAlg()

MdtVsTgcRawDataValAlg::MdtVsTgcRawDataValAlg ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 33 of file MdtVsTgcRawDataValAlg.cxx.

34 :ManagedMonitorToolBase( type, name, parent )
35{
36 // Declare the properties
37 declareProperty("CheckCabling", m_checkCabling=false);
38 declareProperty("TgcLv1File", m_tgclv1file=true);
39 declareProperty("ChamberName", m_chamberName="XXX");
40 declareProperty("StationSize", m_StationSize="XXX");
41 declareProperty("Sector", m_sector=0);
42 declareProperty("Side", m_side=0);
43 declareProperty("LastEvent", m_lastEvent=0);
44 declareProperty("CosmicStation", m_cosmicStation=0);
45 declareProperty("MdtAdcCut", m_MdtAdcCut=50);
46 declareProperty("MdtTdcCut", m_MdtTdcCut=1600);
47
48 // initialize class members
49
50 for(int ac=0; ac<2; ac++){
51 m_mvt_cutspassed[ac] = nullptr;
52 for(int jMDT=0; jMDT<4; jMDT++){
53 m_mdt_segmmap[ac][jMDT] = nullptr;
54 for(int sMDT=0; sMDT<4; sMDT++){
55 m_mdt_segmposdirsag[ac][jMDT][sMDT] = nullptr;
56 for(int iREPT=0; iREPT<4; iREPT++){
57 m_mdt_segmmatchsag[ac][jMDT][sMDT][iREPT] = nullptr;
58 m_mdt_trackdirdirsag[ac][jMDT][sMDT][iREPT] = nullptr;
59 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][0] = nullptr;
60 m_mdt_trackchecksag[ac][jMDT][sMDT][iREPT][1] = nullptr;
61 }
62 }
63 }
64 for(int WS=0; WS<2; WS++){
65 for(int EffNDE=0; EffNDE<4; EffNDE++){
66 m_eff_stationmapbase[ac][WS][EffNDE] = nullptr;
67 m_eff_stationmapmid[ac][WS][EffNDE] = nullptr;
68 m_eff_stationmap[ac][WS][EffNDE] = nullptr;
69 }
70 }
71 }
72
73 // Initialize to zero
74 for(int i=0;i<2;i++)// AC
75 for(int jTGC=0;jTGC<4;jTGC++)// TGC Station
76 for(int f=0;f<2;f++)// FE
77 for(int k=0;k<2;k++)// WireStrip
78 for(int x=0;x<4;x++){
79 m_mvt_extrprdsag[i][jTGC][f][k][x]=nullptr;
80 m_mvt_extrprdsag2[i][jTGC][f][k][x]=nullptr;
81 }
82 for(int k=0;k<2;k++)
83 for(int i=0;i<2;i++)
84 for(int x=0;x<4;x++){
85 m_tgc_prdcompsag[i][k][x]=nullptr;
86 }
87
88}
#define x
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
TH1 * m_mvt_extrprdsag[2][4][2][2][4]
TH1 * m_mvt_extrprdsag2[2][4][2][2][4]
TH1 * m_mdt_trackdirdirsag[2][4][4][4]
TH1 * m_mdt_segmmatchsag[2][4][4][4]
TH1 * m_mdt_trackchecksag[2][4][4][4][2]

◆ ~MdtVsTgcRawDataValAlg()

MdtVsTgcRawDataValAlg::~MdtVsTgcRawDataValAlg ( )
virtual

Definition at line 90 of file MdtVsTgcRawDataValAlg.cxx.

90 {
91 ATH_MSG_INFO( " deleting MdtVsTgcRawDataValAlg " );
92}
#define ATH_MSG_INFO(x)

Member Function Documentation

◆ BlankPhi24()

void MdtVsTgcRawDataValAlg::BlankPhi24 ( TH2 * h2,
int binx )
private

Definition at line 144 of file MdtVsTgcRawData_functions.cxx.

144 {
145 float x1=h->GetXaxis()->GetBinLowEdge(binx);
146 float x2=h->GetXaxis()->GetBinUpEdge(binx);
147 for(int i=0;i<24;i++){
148 int biny = (i+1)*2;
149 float y1=h->GetYaxis()->GetBinLowEdge(biny);
150 float y2=h->GetYaxis()->GetBinUpEdge(biny);
151 putBox(h, x1, y1, x2, y2);
152 }
153}
void putBox(TH2 *h2, float x1, float y1, float x2, float y2)

◆ BlankStationMap()

void MdtVsTgcRawDataValAlg::BlankStationMap ( TH2 * h2,
int ws )
private

Definition at line 155 of file MdtVsTgcRawData_functions.cxx.

155 {
156 bool rebin=true;
157 if(rebin){//use new bin
158 for(int i=33; i<44;i++)BlankPhi24(h,i);
159 int x1=h->GetXaxis()->GetBinLowEdge(40);
160 int x2=h->GetXaxis()->GetBinUpEdge(40);
161 int x3=h->GetXaxis()->GetBinLowEdge(41);
162 int x4=h->GetXaxis()->GetBinUpEdge(41);
163 int y1=h->GetYaxis()->GetBinLowEdge(19);
164 int y2=h->GetYaxis()->GetBinUpEdge(19);
165 putBox(h, x1, y1, x2, y2);
166 putBox(h, x3, y1, x4, y2);
167 y1=h->GetYaxis()->GetBinLowEdge(35);
168 y2=h->GetYaxis()->GetBinUpEdge(35);
169 putBox(h, x1, y1, x2, y2);
170 putBox(h, x3, y1, x4, y2);
171 y1=h->GetYaxis()->GetBinLowEdge(43);
172 y2=h->GetYaxis()->GetBinUpEdge(43);
173 putBox(h, x1, y1, x2, y2);
174 putBox(h, x3, y1, x4, y2);
175
176 if(ws==1){//Strip
177 x1=h->GetXaxis()->GetBinLowEdge(2);
178 y1=h->GetYaxis()->GetBinLowEdge(1);
179 x2=h->GetXaxis()->GetBinUpEdge(2);
180 y2=h->GetYaxis()->GetBinUpEdge(48);
181 putBox(h, x1, y1, x2, y2);
182 x1=h->GetXaxis()->GetBinLowEdge(9);
183 x2=h->GetXaxis()->GetBinUpEdge(9);
184 putBox(h, x1, y1, x2, y2);
185 x1=h->GetXaxis()->GetBinLowEdge(16);
186 x2=h->GetXaxis()->GetBinUpEdge(16);
187 putBox(h, x1, y1, x2, y2);
188 x1=h->GetXaxis()->GetBinLowEdge(23);
189 x2=h->GetXaxis()->GetBinUpEdge(23);
190 putBox(h, x1, y1, x2, y2);
191 x1=h->GetXaxis()->GetBinLowEdge(34);
192 x2=h->GetXaxis()->GetBinUpEdge(34);
193 putBox(h, x1, y1, x2, y2);
194 }
195 }else{//use old bin, logically dead code, comment out
196// BlankPhi24(h, 5);
197// BlankPhi24(h, 10);
198// BlankPhi24(h, 15);
199// BlankPhi24(h, 21);
200// BlankPhi24(h, 27);
201// BlankPhi24(h, 33);
202// BlankPhi24(h, 39);
203// BlankPhi24(h, 40);
204// BlankPhi24(h, 41);
205// BlankPhi24(h, 42);
206// BlankPhi24(h, 43);
207// int x1=h->GetXaxis()->GetBinLowEdge(40);
208// int x2=h->GetXaxis()->GetBinUpEdge(40);
209// int x3=h->GetXaxis()->GetBinLowEdge(42);
210// int x4=h->GetXaxis()->GetBinUpEdge(42);
211// int y1=h->GetYaxis()->GetBinLowEdge(19);
212// int y2=h->GetYaxis()->GetBinUpEdge(19);
213// putBox(h, x1, y1, x2, y2);
214// putBox(h, x3, y1, x4, y2);
215// y1=h->GetYaxis()->GetBinLowEdge(35);
216// y2=h->GetYaxis()->GetBinUpEdge(35);
217// putBox(h, x1, y1, x2, y2);
218// putBox(h, x3, y1, x4, y2);
219// y1=h->GetYaxis()->GetBinLowEdge(43);
220// y2=h->GetYaxis()->GetBinUpEdge(43);
221// putBox(h, x1, y1, x2, y2);
222// putBox(h, x3, y1, x4, y2);
223 }
224}
void BlankPhi24(TH2 *h2, int binx)
rebin(binning, data)

◆ bookeffhists()

StatusCode MdtVsTgcRawDataValAlg::bookeffhists ( MonGroup & mdtvstgclv1_expert_a,
MonGroup & mdtvstgclv1_expert_c )
private

Definition at line 100 of file MdtVsTgcRawData_bookhistograms.cxx.

101 {
102
103 std::stringstream sst;
104 std::string AC[2]= {"A","C"};
105 std::string RhoEtaPhiThe[4]={"Rho","Eta","Phi","Theta"};
106 std::string RhoEtaPhiZ[4]= {"Rho","Eta","Phi","Z"};
107 std::string FE[2]= {"F","E"};// Forward, Endcap
108 std::string EffNumDenom[4]= {"","num","denom","error"};
109 std::string WireStrip[2]= {"Wire","Strip"};
110 int nbins3D_1[4]= { 0, 0, 0, 0};
111 float fGlobalCoords3Dlo[4]= { 0, 0, 0, 0};
112 float fGlobalCoords3Dup[4]= { 0, 0, 0, 0};
113 // **************************************************************
114 // ** EffCheck
115 // **************************************************************
117 // Efficiencies
118 nbins3D_1[0]= 100; nbins3D_1[1]= 8; nbins3D_1[2]= 48; nbins3D_1[3]= 100;
119 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI; fGlobalCoords3Dlo[3]= 0;
120 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
121 for(int i=0;i<2;i++){// AC
122 for(int k=0;k<2;k++){// WireStrip
123 for(int e=0;e<4;e++){// EffNumDenom
124 // Station Efficiency Map Segm Track
125 sst<<WireStrip[k];
126 sst<<"_EfficiencyAgainstMDT";
127 sst<<"_MapSegmTrack"<<EffNumDenom[e];
128 sst<<"_"<<AC[i];
129 ATH_MSG_DEBUG("Eff_StationMapBase "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
130 m_eff_stationmapbase[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
131 if(i==0){
132 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmapbase[i][k][e]) );
133 }else{
134 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmapbase[i][k][e]) );
135 }
136
138 sst.str("");
139
140 // Station Efficiency Map Midstation Segments
141 sst<<WireStrip[k];
142 sst<<"_EfficiencyAgainstMDT";
143 sst<<"_MapMidOnly"<<EffNumDenom[e];
144 sst<<"_"<<AC[i];
145 ATH_MSG_DEBUG("Eff_StationMapMid "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
146 m_eff_stationmapmid[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
147 if(i==0){
148 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmapmid[i][k][e]) );
149 }else{
150 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmapmid[i][k][e]) );
151 }
152
154 sst.str("");
155
156 // Station Efficiency Map Total
157 sst<<WireStrip[k];
158 sst<<"_EfficiencyAgainstMDT";
159 sst<<"_Map"<<EffNumDenom[e];
160 sst<<"_"<<AC[i];
161 ATH_MSG_DEBUG("Eff_StationMap "<<i<<" "<<k<<" "<<e<<sst.str().c_str() );
162 m_eff_stationmap[i][k][e]=new TH2F( sst.str().c_str(), sst.str().c_str(),43, 0, 43, 48, 0, 48 );
163 if(i==0){
164 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_eff_stationmap[i][k][e]) );
165 }else{
166 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_eff_stationmap[i][k][e]) );
167 }
168
169 labelStationMap(m_eff_stationmap[i][k][e], i,k);
170 sst.str("");
171 }// EffNumDenom
172 }// WireStrip
173 }// AC
174
176 // Sagittas
177
178
179 nbins3D_1[0]= 8000; nbins3D_1[1]= 200; nbins3D_1[2]= 4096; nbins3D_1[3]= 40000;
180 fGlobalCoords3Dlo[0]= -8000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI; fGlobalCoords3Dlo[3]= -200000;
181 fGlobalCoords3Dup[0]= 8000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI; fGlobalCoords3Dup[3]= 200000;
182 for(int i=0;i<2;i++){// AC
183 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
184 for(int f=0;f<2;f++){// FE
185 for(int k=0;k<2;k++){// WireStrip
186 for(int x=0;x<4;x++){// RhoEtaPhi
187 if(x==0||x==2){ // Only interested in Rho and Phi
188 // TGC EIFI vs MDT extrapolated position, Sagitta
189 sst<<"TGC_SegmTrack_"<<RhoEtaPhiZ[x];
190 sst<<"Sagitta_T"<<jTGC+1;
191 sst<<FE[f];
192 sst<<WireStrip[k];
193 sst<<"_"<<AC[i];
194 ATH_MSG_DEBUG("TGC_Sagitta "<<i<<" "<<jTGC<<" "<<f<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
195 m_mvt_extrprdsag[i][jTGC][f][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
196 if(i==0){
197 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_extrprdsag[i][jTGC][f][k][x]) );
198 }else{
199 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_extrprdsag[i][jTGC][f][k][x]) );
200 }
201
202 m_mvt_extrprdsag[i][jTGC][f][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
203 sst.str("");
204
205 // TGC EIFI vs MDT extrapolated position, Sagitta
206 sst<<"TGC_MidSegm_"<<RhoEtaPhiZ[x];
207 sst<<"Sagitta_T"<<jTGC+1;
208 sst<<FE[f];
209 sst<<WireStrip[k];
210 sst<<"_"<<AC[i];
211 ATH_MSG_DEBUG("TGC_Sagitta "<<i<<" "<<jTGC<<" "<<f<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
212 m_mvt_extrprdsag2[i][jTGC][f][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
213 if(i==0){
214 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_extrprdsag2[i][jTGC][f][k][x]) );
215 }else{
216 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_extrprdsag2[i][jTGC][f][k][x]) );
217 }
218
219 m_mvt_extrprdsag2[i][jTGC][f][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
220 sst.str("");
221 }
222 }// RhoEtaPhi
223 }// WireStrip
224 }// FE
225 }// TGC Station
226 }// AC
227
228
229 for(int k=0;k<2;k++){// WireStrip
230 if(k==0){
231 nbins3D_1[0]= 10000; nbins3D_1[1]= 1200; nbins3D_1[2]= 8192; nbins3D_1[3]= 40000;
232 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -3; fGlobalCoords3Dlo[2]=-1*M_PI/8; fGlobalCoords3Dlo[3]= -200000;
233 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 200000;
234 }
235 else{
236 nbins3D_1[0]= 10000; nbins3D_1[1]= 1200; nbins3D_1[2]= 8192; nbins3D_1[3]= 40000;
237 fGlobalCoords3Dlo[0]= -5000; fGlobalCoords3Dlo[1]= -3; fGlobalCoords3Dlo[2]=-1*M_PI/8; fGlobalCoords3Dlo[3]= -200000;
238 fGlobalCoords3Dup[0]= 5000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 200000;
239 }
240 for(int i=0;i<2;i++){// AC
241 for(int x=0;x<4;x++){// RhoEtaPhiZ
242 if(x==0||x==2){ // Only interested in Rho and Phi
243 // TGC PRD comparison for Mid Only Check
244 sst<<"TGC_MidStationPRD_"<<RhoEtaPhiZ[x];
245 sst<<"Sagitta_"<<WireStrip[k];
246 sst<<"_"<<AC[i];
247 ATH_MSG_DEBUG("TGC_PRDonly_Sagitta "<<i<<" "<<" "<<k<<" "<<x<<" "<<sst.str().c_str() );
248 m_tgc_prdcompsag[i][k][x] =new TH1F(sst.str().c_str(), sst.str().c_str(), nbins3D_1[x],fGlobalCoords3Dlo[x],fGlobalCoords3Dup[x]);
249 if(i==0){
250 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_tgc_prdcompsag[i][k][x]) );
251 }else{
252 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_tgc_prdcompsag[i][k][x]) );
253 }
254
255 m_tgc_prdcompsag[i][k][x]->GetXaxis()->SetTitle(RhoEtaPhiZ[x].c_str());
256 sst.str("");
257 }
258 }// WireStrip
259 }// RhoEtaPhiThe
260 }// AC
261
262
264 // Segment Positions
265
266 // Initialize to zero
267 for(int i=0;i<2;i++)// AC
268 for(int jMDT1=0;jMDT1<4;jMDT1++)// MDT Station1
269 for(int jMDT2=0;jMDT2<4;jMDT2++)// MDT Station2
270 for(int x=0;x<4;x++){
271 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]=nullptr;
272 }
273
274 nbins3D_1[0]= 2000; nbins3D_1[1]= 200; nbins3D_1[2]= 4096; nbins3D_1[3]= 1024;
275 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -M_PI/8; fGlobalCoords3Dlo[3]= 0;
276 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= M_PI/8; fGlobalCoords3Dup[3]= 0.5*M_PI;
277 for(int i=0;i<2;i++){// AC
278 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station1
279 for(int jMDT2=0;jMDT2<4;jMDT2++){// MDT Station2
280 //if(jMDT1==jMDT2)continue;
281 for(int x=0;x<4;x++){// RhoEtaPhiThe
282 if(x==0||x==2||x==3){// Not interested in Eta
283 // Segm Matching Sag
284 sst<<"MDT_Matching_"<<RhoEtaPhiThe[x];
285 sst<<"Sagitta_MDT"<<jMDT1+1;
286 sst<<"vsMDT"<<jMDT2+1;
287 sst<<"_"<<AC[i];
288 ATH_MSG_DEBUG("MDT_MatchingSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
289 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
290 if(i==0){
291 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]) );
292 }else{
293 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]) );
294 }
295
296 m_mdt_segmmatchsag[i][jMDT1][jMDT2][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
297 sst.str("");
298 }
299 }
300 }
301 }
302 }
303
304
306 // Segment Directions
307
308 for(int i=0;i<2;i++)// AC
309 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station2
310 for(int x=0;x<4;x++){// RhoEtaPhiThe
311 m_mdt_segmposdirsag[i][jMDT1][x]=nullptr;
312 }
313 for(int jMDT2=0;jMDT2<4;jMDT2++){
314 for(int x=0;x<4;x++){
315 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]=nullptr;
316 for(int v=0;v<2;v++){
317 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]=nullptr;
318 }
319 }
320 }
321 }
322
323 nbins3D_1[0]= 2000; nbins3D_1[1]= 200; nbins3D_1[2]= 8192; nbins3D_1[3]= 2048;
324 fGlobalCoords3Dlo[0]= -1000; fGlobalCoords3Dlo[1]= -1; fGlobalCoords3Dlo[2]= -2*M_PI; fGlobalCoords3Dlo[3]=-0.5*M_PI;
325 fGlobalCoords3Dup[0]= 1000; fGlobalCoords3Dup[1]= 1; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
326 for(int i=0;i<2;i++){// AC
327 for(int jMDT1=0;jMDT1<4;jMDT1++){// MDT Station2
328 for(int x=0;x<4;x++){// RhoEtaPhiThe
329 if(x==2||x==3){ // Only interested in Phi & Theta
330 // Segm Pos-Dir Sag
331 sst<<"MDT_PosDir_"<<RhoEtaPhiThe[x];
332 sst<<"Sagitta_MDT"<<jMDT1+1;
333 sst<<"_"<<AC[i];
334 ATH_MSG_DEBUG("MDT_PosDirSagitta "<<i<<" "<<jMDT1<<" "<<x<<" "<<sst.str().c_str() );
335 m_mdt_segmposdirsag[i][jMDT1][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
336 if(i==0){
337 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmposdirsag[i][jMDT1][x]) );
338 }else{
339 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmposdirsag[i][jMDT1][x]) );
340 }
341 m_mdt_segmposdirsag[i][jMDT1][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
342 sst.str("");
343 }
344 }// RhoEtaPhiThe
345
346 for(int jMDT2=0;jMDT2<4;jMDT2++){// MDT Station2
347 //if(jMDT1==jMDT2)continue;// Cut same station comparison
348 for(int x=0;x<4;x++){// RhoEtaPhiThe
349 if(x==2||x==3){ // Only interested in Phi & Theta
350 // Track Dir-Dir Sag
351 sst<<"MDT_DirDir_"<<RhoEtaPhiThe[x];
352 sst<<"Sagitta_MDT"<<jMDT1+1;
353 sst<<"vsMDT"<<jMDT2+1;
354 sst<<"_"<<AC[i];
355 ATH_MSG_DEBUG("MDT_DirDirSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
356 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
357 if(i==0){
358 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]) );
359 }else{
360 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]) );
361 }
362
363 m_mdt_trackdirdirsag[i][jMDT1][jMDT2][x]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
364 sst.str("");
365
366 for(int v=0;v<2;v++){
367 if(jMDT1>=jMDT2)continue;// Regard vector comparison between two stations as
368 // Track Direction Check
369 sst<<"MDT_TrackCheck_"<<RhoEtaPhiThe[x];
370 sst<<"Sagitta_MDT"<<jMDT1+1;
371 sst<<"vs"<<jMDT2+1;
372 sst<<"_MDT";
373 if(v==0)sst<<jMDT1+1;
374 else sst<<jMDT2+1;
375 sst<<"_"<<AC[i];
376 ATH_MSG_DEBUG("MDT_TrackCheckSagitta "<<i<<" "<<jMDT1<<" "<<jMDT2<<" "<<x<<" "<<sst.str().c_str() );
377 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v] =new TH1F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[x], fGlobalCoords3Dlo[x], fGlobalCoords3Dup[x]);
378 if(i==0){
379 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]) );
380 }else{
381 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]) );
382 }
383 m_mdt_trackchecksag[i][jMDT1][jMDT2][x][v]->GetXaxis()->SetTitle(RhoEtaPhiThe[x].c_str());
384 sst.str("");
385 }
386 }
387 }// RhoEtaPhiThe
388 }// MDT Station2
389 }// MDT Station1
390 }// AC
391
392 return StatusCode::SUCCESS;
393}
#define M_PI
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
void labelStationMap(TH2 *h2, int i=-1, int k=-1)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ bookHistograms()

◆ bookHistogramsRecurrent()

StatusCode MdtVsTgcRawDataValAlg::bookHistogramsRecurrent ( )
virtual

An inheriting class should either override this function, bookHists() or bookHistograms().

Reimplemented from ManagedMonitorToolBase.

Definition at line 133 of file MdtVsTgcRawDataValAlg.cxx.

133 {
134/*----------------------------------------------------------------------------------*/
135 ATH_MSG_DEBUG( "TGC RawData Monitoring Histograms being booked" );
136
137 //declare a group of histograms
138 std::string generic_path_mdtvstgclv1 = "Muon/MuonRawDataMonitoring/MDTvsTGC";
139 //MonGroup mdtvstgclv1_expert( this, generic_path_mdtvstgclv1+"/Global", expert, run );
140 MonGroup mdtvstgclv1_expert_a( this, generic_path_mdtvstgclv1+"/TGCEA", run, ATTRIB_UNMANAGED );
141 MonGroup mdtvstgclv1_expert_c( this, generic_path_mdtvstgclv1+"/TGCEC", run, ATTRIB_UNMANAGED );
142
143 if(newRunFlag()){
144 ATH_MSG_INFO( "MdtVsTgc RawData Monitoring : begin of run" );
145
146 ATH_CHECK( bookmaphists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
147 ATH_CHECK( bookeffhists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
148 }//isNewRun
149 return StatusCode::SUCCESS;
150}
A container of information describing a monitoring object.
StatusCode bookmaphists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)
StatusCode bookeffhists(MonGroup &mdtvstgclv1_expert_a, MonGroup &mdtvstgclv1_expert_c)

◆ bookHists()

StatusCode ManagedMonitorToolBase::bookHists ( )
virtualinherited

Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.

Implements IMonitorToolBase.

Definition at line 730 of file ManagedMonitorToolBase.cxx.

732{
733 // The Run/LumiBlock numbers are not set when beginRun() is called. Therefore,
734 // book histograms on the first call to fillHists(), which is called from execute().
735 return StatusCode::SUCCESS;
736}

◆ bookmaphists()

StatusCode MdtVsTgcRawDataValAlg::bookmaphists ( MonGroup & mdtvstgclv1_expert_a,
MonGroup & mdtvstgclv1_expert_c )
private

Definition at line 27 of file MdtVsTgcRawData_bookhistograms.cxx.

28 {
29
30 std::stringstream sst;
31 std::string AC[2]= {"A","C"};
32 int nbins3D_1[4]= { 0, 0, 0, 0};
33 float fGlobalCoords3Dlo[4]= { 0, 0, 0, 0};
34 float fGlobalCoords3Dup[4]= { 0, 0, 0, 0};
35 // **************************************************************
36 // ** maphists
37 // **************************************************************
39 // Number of~ hists
40 nbins3D_1[0]= 480; nbins3D_1[1]= 120; nbins3D_1[2]= 128; nbins3D_1[3]= 100;
41 fGlobalCoords3Dlo[0]= 0; fGlobalCoords3Dlo[1]= 0; fGlobalCoords3Dlo[2]= 0; fGlobalCoords3Dlo[3]= 0;
42 fGlobalCoords3Dup[0]= 12000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
43 for(int i=0;i<2;i++){// AC
44 // nEvents passing cut criteria
45 sst<<"EffCheck_CutsPassed_"<<AC[i];
46 ATH_MSG_DEBUG("EffCheck_CutsPassed "<<i<<" "<<sst.str().c_str() );
47 m_mvt_cutspassed[i] =new TH1I(sst.str().c_str(), sst.str().c_str(), 14, 1, 15);
48 if(i==0){
49 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mvt_cutspassed[i]) );
50 }else{
51 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mvt_cutspassed[i]) );
52 }
53
54 m_mvt_cutspassed[i]->GetYaxis()->SetTitle("nEvents");
55 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(1, "Events");
56 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(2, "matchedSegm=0");
57 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(3, "matchedSegm>1");
58 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(4, "matchedSegm=1");
59 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(5, "+HasEIFI");
60 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(6, "EIFIMatch");
61 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(7, "+HasT1");
62 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(8, "T1Match");
63 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(9,"+HasT2");
64 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(10,"T2Match");
65 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(11,"+HasT3");
66 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(12,"T3Match");
67 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(13,"AllStationsMatch");
68 m_mvt_cutspassed[i]->GetXaxis()->SetBinLabel(14,"AllLayersMatch");
69 sst.str("");
70 }// AC
71
72
74 // Distributions
75 nbins3D_1[0]= 600; nbins3D_1[1]= 120; nbins3D_1[2]= 128; nbins3D_1[3]= 128;
76 fGlobalCoords3Dlo[0]= 0; fGlobalCoords3Dlo[1]= 0; fGlobalCoords3Dlo[2]= 0; fGlobalCoords3Dlo[3]= 0;
77 fGlobalCoords3Dup[0]= 12000; fGlobalCoords3Dup[1]= 3; fGlobalCoords3Dup[2]= 2*M_PI; fGlobalCoords3Dup[3]= 0.5*M_PI;
78 for(int i=0;i<2;i++){// AC
79 for(int jMDT=0;jMDT<4;jMDT++){// MDT Station
80 // MDT Segm Eta vs Phi
81 sst<<"MDT_SegmMap_MDT"<<jMDT+1;
82 sst<<"_"<<AC[i];
83 ATH_MSG_DEBUG("MDT_SegmMap "<<i<<" "<<jMDT<<" "<<sst.str().c_str() );
84 m_mdt_segmmap[i][jMDT] =new TH2F(sst.str().c_str(),sst.str().c_str(), nbins3D_1[2], fGlobalCoords3Dlo[2], fGlobalCoords3Dup[2], nbins3D_1[1], fGlobalCoords3Dlo[1], fGlobalCoords3Dup[1]);
85 if(i==0){
86 ATH_CHECK( mdtvstgclv1_expert_a.regHist(m_mdt_segmmap[i][jMDT]) );
87 }else{
88 ATH_CHECK( mdtvstgclv1_expert_c.regHist(m_mdt_segmmap[i][jMDT]) );
89 }
90
91 m_mdt_segmmap[i][jMDT]->GetXaxis()->SetTitle("MDT Phi");
92 m_mdt_segmmap[i][jMDT]->GetYaxis()->SetTitle("MDT Eta");
93 sst.str("");
94 }// MDT Station
95 }// AC
96 return StatusCode::SUCCESS;
97}

◆ checkHists()

StatusCode ManagedMonitorToolBase::checkHists ( bool calledFromFinalize)
virtualinherited

This implementation does nothing; equivalent functionality may be provided by procHists(...) with appropriate arguments.

Implements IMonitorToolBase.

Reimplemented in CscCalibMonToolBase.

Definition at line 1670 of file ManagedMonitorToolBase.cxx.

1672{
1673 // Histograms will be checked using the data-quality monitoring framework (DQMF)
1674
1675 return StatusCode::SUCCESS;
1676}

◆ CheckTGConTrack()

void MdtVsTgcRawDataValAlg::CheckTGConTrack ( std::vector< SegmTrack >(&) matchedSegments[2],
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 35 of file MdtVsTgcRawData_PRDonTrack.cxx.

36 {
37 // Define Cuts:
38 // Loose cut for PRD and Extrapolated
39 const float dPhiCut_Loose = M_PI/8;
40 // Cut for Global Position Efficiencies
41 const float dPhiCutGlobal[2] = {static_cast<float>(M_PI/24),static_cast<float>(M_PI/12)}; //[WireStrip]
42 const float dRhoCutGlobal[2] = { 0.08, 0.5}; //[WireStrip]
43 // Cut for Sector Efficiencies
44 const float dPhiCutSector[2] = { 0.2, 0.1}; //[WireStrip]
45 const float dRhoCutSector[2] = { 200, 2000}; //[WireStrip]
46
47 // Loop over sides
48 for(int i=0;i<2;i++){// AC
49 // Get number of tracks
50 unsigned int nTrack=matchedSegments[i].size();
51
52 // Fill nEvents histograms
53 m_mvt_cutspassed[i]->Fill(1);
54 if(nTrack==0)m_mvt_cutspassed[i]->Fill(2);
55 if(nTrack>1)m_mvt_cutspassed[i]->Fill(3);
56 if(nTrack==1)m_mvt_cutspassed[i]->Fill(4);
57
58 // Cut events without exactly one set of matched Segments
59 if(nTrack!=1)continue;
60
61 // Declare Position variables for inner
62 //Trk::GlobalPosition innerSegmPos;
63 Amg::Vector3D innerSegmPos = {0, 0, 0};
64
65 // float innerSegmEta=0;
66 float innerSegmRho=0; float innerSegmPhi=0; float innerSegmZ=0;
67 //Trk::GlobalDirection innerSegmDirzunit;
68 Amg::Vector3D innerSegmDirzunit = {0, 0, 0};
69
70 // Declare Position variables for midstation
71 //Trk::GlobalPosition midSegmPos;
72 Amg::Vector3D midSegmPos = {0, 0, 0};
73
74 // float midSegmRho =0; float midSegmEta =0;
75 float midSegmPhi =0; float midSegmZ =0;
76 //Trk::GlobalDirection midSegmDirzunit;
77 Amg::Vector3D midSegmDirzunit = {0, 0, 0};
78
79 // Check which layers have sufficienct segments to operate on for global coordinates
80 bool canCheckGlobal[4] = {0, 0, 0, 0};// [TGCStation]
81 if(matchedSegments[i].at(0).at(2)!=nullptr){
82 // Check Midstation
83 canCheckGlobal[0]=true; canCheckGlobal[1]=true; canCheckGlobal[2]=true;
84 // Read Midstation Segment Values into variables
85 midSegmPos = Amg::Vector3D(matchedSegments[i].at(0).at(2)->globalPosition());
86 midSegmPhi = midSegmPos.phi();
87 midSegmZ = midSegmPos.z();
88 if(midSegmPhi<0)midSegmPhi+=2*M_PI;
89 midSegmDirzunit = Amg::Vector3D(midSegmPos/std::abs(midSegmZ));
90 }
91 if((matchedSegments[i].at(0).at(0)!=nullptr)&&(matchedSegments[i].at(0).at(2)!=nullptr)){
92 // Check EIFI
93 canCheckGlobal[3]=true;
94 // Read Inner Segment Values
95 innerSegmPos = Amg::Vector3D(matchedSegments[i].at(0).at(0)->globalPosition());
96 innerSegmRho = std::abs(innerSegmPos.perp());
97 innerSegmZ = std::abs(innerSegmPos.z());
98 // Modify position
99 innerSegmPhi = midSegmPhi;
100
101 innerSegmPos = Amg::Vector3D(innerSegmRho*std::cos(innerSegmPhi), innerSegmRho*std::sin(innerSegmPhi), innerSegmZ);
102 innerSegmDirzunit = Amg::Vector3D(innerSegmPos/std::abs(innerSegmZ));
103 }
104
105 // If no layers can be checked (i.e. no midstation segment matched) skip side
106 bool skipSide = true;
107 for(int jTGC=0;jTGC<4;jTGC++)if(canCheckGlobal[jTGC]==true)skipSide=false;
108 if(skipSide==true)continue;
109
110 // Initialize variables for TRE array search
111 int TGCStationNames[8] ={41, 42, 43, 44, 45, 46, 47, 48};
112 int TGCstation_StationFE[4] ={-1,-1,-1,-1};// [TGCStation]
113 int TGCstation_StationEta[4]={ 0, 0, 0, 0};// [TGCStation]
114 int TGCstation_StationPhi[4]={ 0, 0, 0, 0};// [TGCStation]
115 int nStationMatch[4] ={ 0, 0, 0, 0};// [TGCStation]
116 bool canCheckSector[4] ={ true, true, true, true};// [TGCStation]
117
118 // Loop through TRE array, finding sectors which match the track in each layer
119 for(int stationnameindex=0; stationnameindex<8; stationnameindex++){// Station {T1F,T1E,T2F,T2E,T3F,T3E,T4F,T4E}
120 // Skip stations which don't have sufficient Segments to run efficiency check
121 int stationName = TGCStationNames[stationnameindex];
122 int stationIndex= TGCstationname2stationindex(stationName);
123 if(stationIndex<0) continue;
124 if(!canCheckGlobal[stationIndex])continue;
125
126 // Loop over StationEta&StationPhi
127 for(int stationeta=1; stationeta<=8; stationeta++){// AbsStationEta
128 for(int stationphi=1; stationphi<=48; stationphi++){// StationPhi
129 // Cut Station EtaPhi combinations with no TGC element
130 if(m_TREarray[stationnameindex][i][stationeta][stationphi]==nullptr)continue;
131 const MuonGM::TgcReadoutElement *tre=m_TREarray[stationnameindex][i][stationeta][stationphi];
132
133 // Extrapolate position from nearest Station's Segment to Sector's Z
134 float sectorZ=tre->globalPosition().z();
135 //Trk::GlobalPosition sectorExtrapolatedPos;
136 Amg::Vector3D sectorExtrapolatedPos;
137
138 if(stationIndex==3){// Inner
139 float dZ_sector=std::abs(sectorZ)-std::abs(innerSegmZ);
140 //sectorExtrapolatedPos = Trk::GlobalPosition(innerSegmPos+(innerSegmDirzunit*dZ_sector));
141 sectorExtrapolatedPos = Amg::Vector3D(innerSegmPos+(innerSegmDirzunit*dZ_sector));
142 }
143 else{// Midstation
144 float dZ_sector=std::abs(sectorZ)-std::abs(midSegmZ);
145 sectorExtrapolatedPos = Amg::Vector3D(midSegmPos+(midSegmDirzunit*dZ_sector));
146 }
147
148 // Convert extrapolated position to local position on the Sector
149 Identifier sector_id=tre->identify();
150 const Amg::Vector3D sectorLocalPos3D=tre->globalToLocalTransf(sector_id)*sectorExtrapolatedPos;
151 Amg::Vector2D sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
152
153 double avWidth = (tre->getLongSsize()+tre->getSsize())/2;
154 //double dWidth = (tre->longWidth()-tre->shortWidth());
155 double length = tre->length();
156
157 // Cut sectors which the track does not go through the central 80% of (avoids double counts)
158 double tol1=-0.1*(avWidth/2);
159 double tol2=-0.1*(length/2);
160
161 bool insideSectorBounds=tre->bounds().inside(sectorLocalPos2D,tol1,tol2);
162 if(!insideSectorBounds)continue;
163
164 // Assign values to matching station variables
165 TGCstation_StationFE[stationIndex]= (tre->isForward()==false);
166 TGCstation_StationEta[stationIndex]=stationeta;
167 TGCstation_StationPhi[stationIndex]=stationphi;
168 nStationMatch[stationIndex]++;
169 }// StationPhi
170 }// StationEta
171 }// StationName
172
173 // Don't check stations that don't have exactly 1 match for this track
174 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
175 if(nStationMatch[jTGC]==0){
176 canCheckSector[jTGC]=false;
177 }
178 else if(nStationMatch[jTGC]>1){
179 canCheckSector[jTGC]=false;
180 // Should be impossible, but happens due a problem with the bounds().inside function
181 // commenting out until this bug is resolved
182 //m_log << MSG::WARNING << "SegmTrack: Number of matches for TGC" << jTGC+1 << " is " << nStationMatch[jTGC] << endl;
183 }
184 }// TGC Station
185
186 // Loop through segments to check number of TGC Strips in each
187 int nTGCStrips[4] = {0, 0, 0, 0};//[TGCStation]
188 for(int jMDT=0;jMDT<4;jMDT++){// MDT Station
189 if(matchedSegments[i].at(0).at(jMDT)==nullptr)continue;
190 const Muon::MuonSegment *segm=matchedSegments[i].at(0).at(jMDT);
191 // Loop through contained ROTs and identify used stations
192 const std::vector<const Trk::MeasurementBase*> mMeasTrk = segm->containedMeasurements();
193 ATH_MSG_DEBUG( "number of MeasurementBase: "<<mMeasTrk.size() );
194 for (unsigned int i=0; i<mMeasTrk.size(); i++) {
195 const Trk::MeasurementBase* m = mMeasTrk[i];
196 //const Trk::RIO_OnTrack* rio = dynamic_cast<const Trk::RIO_OnTrack*>(m);
197 const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(m);
198 if(crot) {
199 for(const auto& rio : crot->containedROTs()){
200 //const Trk::RIO_OnTrack* rio = crot->rioOnTrack(iROT);
201 Identifier id = rio->identify();
202 int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
203 // 41=T1F 42=T1E 43=T2F 44=T2E 45=T3F 46=T3E 47=T4F 48=T4E
204 if(m_idHelperSvc->tgcIdHelper().isStrip(id)){
205 if((jMDT==2)&&((stationName==41)||(stationName==42)))nTGCStrips[0]++;// TGC
206 if((jMDT==2)&&((stationName==43)||(stationName==44)))nTGCStrips[1]++;// TGC
207 if((jMDT==2)&&((stationName==45)||(stationName==46)))nTGCStrips[2]++;// TGC
208 if((jMDT==0)&&((stationName==47)||(stationName==48)))nTGCStrips[3]++;// TGC
209 }
210
211 ATH_MSG_DEBUG( " check if TGC strip: "<<m_idHelperSvc->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName );
212 }
213 }
214 }
215 }// MDT Station
216
217
218 // Don't check mid-stations when there are no strips in other mid-stations
219 if((nTGCStrips[1]==0)&&(nTGCStrips[2]==0)){canCheckSector[0]=false;canCheckGlobal[0]=false;}
220 if((nTGCStrips[0]==0)&&(nTGCStrips[2]==0)){canCheckSector[1]=false;canCheckGlobal[1]=false;}
221 if((nTGCStrips[0]==0)&&(nTGCStrips[1]==0)){canCheckSector[2]=false;canCheckGlobal[2]=false;}
222
223 // Initialise hit registered arrays
224 // bool hitregistered[9][2];
225 bool sectorhitregistered[9][2];
226 for(int l=0;l<9;l++){// Layer
227 for(int k=0;k<2;k++){// WireStrip
228 // hitregistered[l][k]=false;
229 sectorhitregistered[l][k]=false;
230 }// WireStrip
231 }// Layer
232
233 // Initialise flags for whether a layer in this event has PRD and PRD which matched the current track
234 bool HasPRD[9] ={false,false,false,false,false,false,false,false,false};
235 bool PRDMatch[9]={false,false,false,false,false,false,false,false,false};
236
237 // Loop over TGC Prep Data container
238 Muon::TgcPrepDataContainer::const_iterator prepit_end=tgc_prepcontainer->end();
239 for( Muon::TgcPrepDataContainer::const_iterator prepit=tgc_prepcontainer->begin();
240 prepit!=prepit_end;
241 ++prepit){
242
243 //loop over TGC Prep Data collection
244 Muon::TgcPrepDataCollection::const_iterator prepitc_end=(*prepit)->end();
245 for( Muon::TgcPrepDataCollection::const_iterator prepitc=(*prepit)->begin();
246 prepitc!= prepitc_end;
247 ++prepitc){
248 // Get PRD and variables
249 const Muon::TgcPrepData* tpd=*prepitc;
250 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
251 const std::string stationType = tre->getStationType();
252
253 // Get id values
254 Identifier tgcid=(*prepitc)->identify();
255 int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1
256 int tgcFE=(tre->isForward()==false);//isNotForward f:0, e:1
257 int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1
258 int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
259 int stationEta = std::abs(tre->getStationEta());
260 int stationPhi = tre->getStationPhi();
261 int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid);
262
263 // Cut hits except those from same side EIFI & Midstation
264 if(tgcAC!=i) continue;
265 if(stationName>48 || stationName<41) continue;
266
267 // Get layer number and stationIndex
268 int layer = TGCgetlayer(stationName,gasGap);
269 int stationIndex = TGCstationname2stationindex(stationName);
270
271 // Skip PRD in stations which can't be checked
272 if(stationIndex<0) continue;
273 if(!(canCheckGlobal[stationIndex]||canCheckSector[stationIndex]))continue;
274 if(layer<0) continue;
275 HasPRD[layer]=true;
276
277 // Get position variables
278 // const Trk::GlobalPosition prdPos = tpd->globalPosition();
279 const Amg::Vector3D prdPos = tpd->globalPosition();
280 float tgcRho = std::abs(prdPos.perp());
281 float tgcPhi = prdPos.phi();
282 float tgcZ = prdPos.z();
283 if(tgcPhi<0)tgcPhi+=2*M_PI;
284
285 // Run Extrapolation
286 // Trk::GlobalPosition tgcExtrapolatedPos;
287 Amg::Vector3D tgcExtrapolatedPos;
288 if(stationIndex==3){// Extrapolate position from Inner Position to PRD Z position
289 //if(innerSegmPos=0)m_log << MSG::WARNING << "MidstationOnly: innerSegmPos=0 but passed canCheckGlobal" );
290 float dZ = std::abs(tgcZ) - std::abs(innerSegmZ);
291 //tgcExtrapolatedPos = Trk::GlobalPosition(innerSegmPos+(innerSegmDirzunit*dZ));
292 tgcExtrapolatedPos = Amg::Vector3D(innerSegmPos+(innerSegmDirzunit*dZ));
293 }
294 else{// Extrapolate position from Midstation Position to PRD Z position
295 float dZ = std::abs(tgcZ) - std::abs(midSegmZ);
296 //tgcExtrapolatedPos = Trk::GlobalPosition(midSegmPos+(midSegmDirzunit*dZ));
297 tgcExtrapolatedPos = Amg::Vector3D(midSegmPos+(midSegmDirzunit*dZ));
298 }
299 float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp());
300 float tgcExtrPhi = tgcExtrapolatedPos.phi();
301 if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI;
302
303 // Get differences between extrapolated and segm2 positions
304 float dRho = tgcRho-tgcExtrRho;
305 float dPhi = tgcPhi-tgcExtrPhi;
306 if(dPhi<-M_PI)dPhi+=2*M_PI;
307 if(dPhi> M_PI)dPhi-=2*M_PI;
308
309 // Pass through loose phi cut to eliminate some noise
310 if(std::abs(dPhi)<dPhiCut_Loose){
311 // Fill PRD sagitta histograms
312 if(m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho);
313 if(m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi);
314
315 // Global efficiency check
316 if(canCheckGlobal[stationIndex]){
317 // Do check
318 float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho;
319 if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){
320 }
321 }
322
323 // Sector Efficiency Check
324 if(canCheckSector[stationIndex]){// If this station can be checked
325 if((stationEta==TGCstation_StationEta[stationIndex])&&
326 (stationPhi==TGCstation_StationPhi[stationIndex])&&
327 (tgcFE==TGCstation_StationFE[stationIndex])){// If Station FE&Eta&Phi match
328 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
329 sectorhitregistered[layer][tgcWS]=true;
330 }
331 }// Station EtaPhi
332 }
333
334 }// dPhi Loose Cut
335 }// TGC PRD Collection
336 }// TGC PRD Container
337
338 // Fill Efficiency Histograms
339 for(int l=0;l<9;l++){// Layer
340 // Get Station Number
341 int stationIndex=TGClayer2stationindex(l);
342 if(stationIndex<0) continue;
343 for(int k=0;k<2;k++){// WireStrip
344 // If Segment Track matches a Sector
345 if(canCheckSector[stationIndex]){
346 if((TGCstation_StationFE[stationIndex]<0)||(TGCstation_StationEta[stationIndex]==0)||(TGCstation_StationPhi[stationIndex]==0)){
347 ATH_MSG_WARNING( "SegmTrack: canCheckSector passed for jTGC=" << stationIndex
348 << " but, FE=" << TGCstation_StationFE[stationIndex]
349 << " Eta=" << TGCstation_StationEta[stationIndex]
350 << " Phi=" << TGCstation_StationPhi[stationIndex] );
351 continue;
352 }
353 // Get Sector histogram indexes
354 int stationMap_EtaIndex=getStationMapIndex(1, l, TGCstation_StationFE[stationIndex], TGCstation_StationEta[stationIndex], TGCstation_StationPhi[stationIndex]);
355 int stationMap_PhiIndex=getStationMapIndex(2, l, TGCstation_StationFE[stationIndex], TGCstation_StationEta[stationIndex], TGCstation_StationPhi[stationIndex]);
356 // Fill Sector efficiency histograms
357 if(sectorhitregistered[l][k]){// Hit in Sector matches extrapolated track
358 m_eff_stationmapbase[i][k][1]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
359 }
360 m_eff_stationmapbase[i][k][2]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
361 }
362 }// WireStrip
363 }// Layer
364
365 // Fill +Has Station bins of histogram
366 if(HasPRD[0]||HasPRD[1]||HasPRD[2])m_mvt_cutspassed[i]->Fill(7);
367 if(HasPRD[3]||HasPRD[4])m_mvt_cutspassed[i]->Fill(9);
368 if(HasPRD[5]||HasPRD[6])m_mvt_cutspassed[i]->Fill(11);
369 if(HasPRD[7]||HasPRD[8])m_mvt_cutspassed[i]->Fill(5);
370
371 // Fill Match Station bins of histogram
372 if(PRDMatch[0]||PRDMatch[1]||PRDMatch[2])m_mvt_cutspassed[i]->Fill(8);
373 if(PRDMatch[3]||PRDMatch[4])m_mvt_cutspassed[i]->Fill(10);
374 if(PRDMatch[5]||PRDMatch[6])m_mvt_cutspassed[i]->Fill(12);
375 if(PRDMatch[7]||PRDMatch[8])m_mvt_cutspassed[i]->Fill(6);
376 if((PRDMatch[0]||PRDMatch[1]||PRDMatch[2])&&
377 (PRDMatch[3]||PRDMatch[4])&&
378 (PRDMatch[5]||PRDMatch[6])&&
379 (PRDMatch[7]||PRDMatch[8]))m_mvt_cutspassed[i]->Fill(13);
380 if((PRDMatch[0]&&PRDMatch[1]&&PRDMatch[2])&&
381 (PRDMatch[3]&&PRDMatch[4])&&
382 (PRDMatch[5]&&PRDMatch[6])&&
383 (PRDMatch[7]&&PRDMatch[8]))m_mvt_cutspassed[i]->Fill(14);
384
385
386 }// AC
387}// End of function
#define ATH_MSG_WARNING(x)
double length(const pvec &v)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
int TGCgetlayer(int stationName, int g)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
int getStationMapIndex(int x, int l, int stationFE, int stationEta, int stationPhi)
const MuonGM::TgcReadoutElement * m_TREarray[8][2][9][49]
int TGCstationname2stationindex(int stationName)
virtual const Trk::SurfaceBounds & bounds() const override
Return the boundaries of the element.
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
Returns the global -> local transformation.
bool isForward() const
Returns true if the chamber is mounted on the most inner ring, i.e. a TxF chamber.
const std::vector< std::unique_ptr< const MuonClusterOnTrack > > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const =0
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
mapped_type at(key_type key) const
Look up an element in the map.
constexpr uint8_t stationPhi
station Phi 1 to 8
l
Printing final latex table to .tex output file.
@ layer
Definition HitInfo.h:79
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)

◆ correlation()

void MdtVsTgcRawDataValAlg::correlation ( const Muon::MdtPrepDataContainer * mdt_hit_container,
const Muon::TgcCoinDataContainer * tgc_trigger_container )
private

<<"mmdtStationName "<<mdtStationName

Definition at line 24 of file MdtVsTgcRawData_correlation.cxx.

25 {
26
27 ATH_MSG_DEBUG("inside correlation" );
28 //StatusCode sc=StatusCode::SUCCESS;
29
30 // MuonDetectorManager from the conditions store
31 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey};
32 const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.cptr();
33 if(MuonDetMgr==nullptr){
34 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object");
35 return;
36 }
37
38 //loop over TGC RoI container
39 Muon::TgcCoinDataContainer::const_iterator it_end=tgccontainer->end();
40 for( Muon::TgcCoinDataContainer::const_iterator it=tgccontainer->begin();
41 it!=it_end;
42 ++it){
43
44
45 ATH_MSG_DEBUG( "size of tgc collection is " << (*it) -> size() );
46
47 //loop over TGC RoI collection
49 for( Muon::TgcCoinDataCollection::const_iterator itc=(*it)->begin();
50 itc!= itc_end;
51 ++itc){
52
53 const Muon::TgcCoinData* tcd=*itc;
54 Identifier tgcid=(*itc)->identify();
55
56 if( tcd->type() != Muon::TgcCoinData::TYPE_SL )continue;
57
58 int ac=(tcd->isAside()==false);//isNotAside a:0, c:1
59 int ef=(tcd->isForward()==false);//isNotForward f:0, e:1
60 int phi48=tcd->phi();//48(24)
61 int roi=tcd->roi();
62 int roieta;//1-53
63 int roiphi;//1-192
64
65 roi2etaphi(*tcd, roieta, roiphi);
66
67 //int tgcMdtSector=roiphi2mdtSector(roiphi,ef);
68
69 const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(tgcid);
70 const Amg::Vector3D pos = pReadoutElementTGC->channelPos(tgcid);
71
72 float tgcEta = std::abs(pos.eta());
73 float tgcPhi = pos.phi();
74 if(tgcPhi<0)tgcPhi+=2*M_PI;
75
76
77 ATH_MSG_DEBUG("ac "<<ac
78 <<" ef "<<ef
79 <<" phi48 "<<phi48
80 <<" roi "<<roi
81 <<" roieta "<<roieta
82 <<" roiphi "<<roiphi
83 <<" tgcEta "<<tgcEta
84 <<" tgcPhi "<<tgcPhi );
85
86
87 //loop over MDT container
88 Muon::MdtPrepDataContainer::const_iterator containerIt;
89 Muon::MdtPrepDataContainer::const_iterator container_end=mdt_hit_container->end();
90 for (containerIt = mdt_hit_container->begin() ;
91 containerIt != container_end ;
92 ++containerIt){
93
94 Identifier mdt_id = (*containerIt)->identify();
95 // Field Range Notes
96 // ==============================================================================
97 // StationName unsigned integer maps to "BIL", "EMS" ,etc.
98 // StationEta [-6,-1] backward endcap (-1 at lowest R)
99 // [-8,8] barrel (increases with Z)
100 // [-6,-1]+[1,6] forward endcap (1 at lowest R)
101 // StationPhi [1,8] increases with phi
102 // Technology [0] maps to "MDT"
103 // Multilayer [1,2] barrel: increases with R
104 // endcap: increases with |Z|
105 // TubeLayer [1,4] barrel: increases with R
106 // endcap: increases with |Z|
107 // Tube [1,n] barrel: increases with |Z|
108 // endcap: increases with R
109 // ==============================================================================
110
111 int mdtStationName = int(m_idHelperSvc->mdtIdHelper().stationName(mdt_id)) ;
112
113 //SN Layer Tube Radial
114 //13:EIL 2x4 x54 x4
115 //49:EIS 2x4 x36 x2
116 //17:EML 2x3 x64 x5
117 //18:EMS 2x3 x64 x5
118 //20:EOL 2x3 x48 x6
119 //21:EOS 2x3 x48 x6
120
121 //only Endcap MDT
122 //if(mdtStationName!=13 && mdtStationName!=49 && mdtStationName!=17 && mdtStationName!=18 && mdtStationName!=20 && mdtStationName!=21 )continue;
123
124 //if (m_debuglevel){
125 //m_log<<MSG::DEBUG
127 // <<endmsg;
128 //}
129
130 //only Endcap middle MDT
131 if(mdtStationName!=17 && mdtStationName!=18 )continue;
132
133 int mdtStationEta = int(m_idHelperSvc->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R)
134 int mdtStationPhi = int(m_idHelperSvc->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8]
135 int mdtAC = (mdtStationEta<0);//a:0, c:1
136
137 float mdtSector=mdtStationPhi*2.-1.;
138 if(mdtStationName==18)mdtSector+=1;
139 double mdtSectorPhi = (mdtSector-1.)*M_PI/8.;
140
141 //same Side
142 if(ac!=mdtAC)continue;
143 ATH_MSG_DEBUG( "size of mdt collection is " << (*containerIt) -> size() );
144
145 ATH_MSG_DEBUG("mdtStationName "<<mdtStationName
146 <<" mdtStationEta "<<mdtStationEta
147 <<" mdtStationPhi "<<mdtStationPhi
148 <<" mdtSectorPhi "<<mdtSectorPhi );
149
150 //loop over MDT PRD Collection
151 Muon::MdtPrepDataCollection::const_iterator collection_it_end=(*containerIt)->end();
152
153
154 int tmp[2][4][64];
155 for(int i=0;i<2;i++)
156 for(int j=0;j<4;j++)
157 for(int k=0;k<64;k++)
158 tmp[i][j][k]=0;
159
160 for(Muon::MdtPrepDataCollection::const_iterator mdtCollection=(*containerIt)->begin();
161 mdtCollection!= collection_it_end;
162 ++mdtCollection){
163
164 Identifier mdt_id2 = (*mdtCollection)->identify();
165
166 int mdtMultiLayer = int(m_idHelperSvc->mdtIdHelper().multilayer(mdt_id2));
167 int mdtTubeLayer = int(m_idHelperSvc->mdtIdHelper().tubeLayer(mdt_id2));
168 int mdtTube = int(m_idHelperSvc->mdtIdHelper().tube(mdt_id2));
169 int mdtTubeIdForEM = (std::abs(mdtStationEta)-1)*64 + mdtTube -1;
170
171 ATH_MSG_DEBUG("mdtMultiLayer "<<mdtMultiLayer
172 <<" mdtTubeLayer "<<mdtTubeLayer
173 <<" mdtTube "<<mdtTube
174 <<" mdtTubeIdForEM "<<mdtTubeIdForEM );
175
176 if(tmp[mdtMultiLayer-1][mdtTubeLayer-1][mdtTube-1]==1)continue;
177 tmp[mdtMultiLayer-1][mdtTubeLayer-1][mdtTube-1]=1;
178
179 int adc = (*mdtCollection)->adc();
180 int tdc = (*mdtCollection)->tdc();
181
182 if(adc < m_MdtAdcCut )continue;
183
184 const MuonGM::MdtReadoutElement* pReadoutElementMDT = MuonDetMgr->getMdtReadoutElement(mdt_id2);
185 const Amg::Vector3D mdtgPos = pReadoutElementMDT->tubePos(mdt_id2); //global position of the wire
186 float mdtEta = std::abs(mdtgPos.eta());
187 float mdtPhi = mdtgPos.phi();
188 float mdtr = mdtgPos.perp();
189 float mdtz = mdtgPos.z();
190 if(mdtPhi<0)mdtPhi+=2*M_PI;
191
192 ATH_MSG_DEBUG(" Name "<<mdtStationName
193 <<" Eta "<<mdtStationEta
194 <<" Phi "<<mdtStationPhi
195 <<" MultiLayer "<<mdtMultiLayer
196 <<" TubeLayer "<<mdtTubeLayer
197 <<" Tube "<<mdtTube
198 <<" TubeIdForEM "<<mdtTubeIdForEM
199 <<" Eta "<<mdtEta
200 <<" Phi "<<mdtPhi
201 <<" r "<<mdtr
202 <<" z "<<mdtz
203 <<" Sec "<<mdtSector
204 <<" SecPhi "<<mdtSectorPhi
205 <<" ADC "<<adc
206 <<" TDC "<<tdc );
207
208 }//MDT collection
209 }//MDT container
210 }//TGC collection
211 }//TGC container
212}
#define ATH_MSG_ERROR(x)
size_t size() const
Number of registered mappings.
void roi2etaphi(const Muon::TgcCoinData &cd, int &eta, int &phi)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip).
int roi() const
return ROI number
CoinDataType type() const
return the coincidence type (HIPT, LPT, SL)
bool isAside() const
Aside or Cside.
int phi() const
return phi number of trigger sector
bool isForward() const
Forward region or Endcap region.
const_pointer_type cptr()
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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>

◆ deregGraph()

StatusCode ManagedMonitorToolBase::deregGraph ( TGraph * g)
virtualinherited

De-registers a TGraph from the THistSvc, but does NOT delete the object.

Definition at line 1624 of file ManagedMonitorToolBase.cxx.

1626{
1627 return m_THistSvc->deReg( g );
1628}
ServiceHandle< ITHistSvc > m_THistSvc

◆ deregHist()

StatusCode ManagedMonitorToolBase::deregHist ( TH1 * h)
virtualinherited

De-registers a TH1 from the THistSvc, but does NOT delete the object.

Definition at line 1616 of file ManagedMonitorToolBase.cxx.

1618{
1619 return m_THistSvc->deReg( h );
1620}

◆ deregObject() [1/2]

StatusCode ManagedMonitorToolBase::deregObject ( const std::string & objName,
const MonGroup & group )
virtualinherited

De-registers a TObject from the THistSvc, but does NOT delete the object.

(NB: LightWeight histograms are not even registered until readout).

Definition at line 1642 of file ManagedMonitorToolBase.cxx.

1644{
1645 std::string streamName = streamNameFunction()->getStreamName( this, group, objName );
1646 return m_THistSvc->deReg( streamName );
1647}
virtual std::string getStreamName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)=0
A function that converts a MonGroup of logical parameters into a physical output stream name.
virtual StreamNameFcn * streamNameFunction()
Returns the function object that converts logical paramters into a physical stream name.

◆ deregObject() [2/2]

StatusCode ManagedMonitorToolBase::deregObject ( const std::string & objName,
const std::string & system,
Interval_t interval )
virtualinherited

De-registers a TObject from the THistSvc, but does NOT delete the object.

(NB: LightWeight histograms are not even registered until readout).

Definition at line 1632 of file ManagedMonitorToolBase.cxx.

1635{
1636 MonGroup group( this, system, interval );
1637 return deregObject( objName, group );
1638}
virtual StatusCode deregObject(const std::string &objName, const std::string &system, Interval_t interval)
De-registers a TObject from the THistSvc, but does NOT delete the object.

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ DQCheckMDTSegments()

void MdtVsTgcRawDataValAlg::DQCheckMDTSegments ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4] )
private

Definition at line 33 of file MdtVsTgcRawData_SegmDQ.cxx.

34 {
35 // Define Cuts:
36 // Cut for miniumum number of measurements necessary to use Segments
37 const int nMeasCutMdt[4] = { 4, 2, 4, 5}; //[MDTStation]
38 const int nMeasCutTgcStrip[4] = { 0, 0, 1, 0}; //[MDTStation]
39 // Cut for differences between direction and position vectors
40 const float dPhiCutPosDir[4] = {0.05,0.05,0.08,0.1 };
41 const float dTheCutPosDir[4] = { 0.2, 0.4, 0.6,0.5 };
42
43 // Loop over sides
44 for(int i=0;i<2;i++){// AC
45 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
46 bool segmDisqual; // used to flag a segment which has been found DQ insufficient
47 //bool HasStationDQSegm[4] = {false, false, false, false};// flags for whether the there are segments in each MDT station with sufficienct DQ
48
49 for(int jMDT=0;jMDT<4;jMDT++){// MDT Stations
50 // Get number of segments
51 int nSegm=sortedSegments[i][jMDT].size();
52
53 // Loop over segments in this MDT Station
54 for(int n=0; n<nSegm;n++){
55 segmDisqual = false;// set disqualified flag to false
56 // Get segment
57 const Muon::MuonSegment *segm=sortedSegments[i][jMDT].at(n);
58 if(segm==nullptr)continue;// Cut empty entries
59
60 // Check disqualifiedSegments for current segment
61 skipSegm=false;
62 nDisqualifiedSegm=disqualifiedSegments[i][jMDT].size();
63 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm==disqualifiedSegments[i][jMDT].at(ndis))skipSegm=true;
64 if(skipSegm)continue;
65
67 // Apply nHits cuts to segments
69 int stationName=0;
70 int nMdtMeas = 0; // nMDTHits in this Segment
71 int nTgcMeas[2] = {0,0};// [WireStrip] nTGCHits in this Segment
72
73 // Loop through contained ROTs and identify used stations
74 for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT) {
75 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
76 if(!rio){
77 ATH_MSG_DEBUG("no RIO");
78 continue;
79 }
80 Identifier id = rio->identify();
81 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
82 int isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id);
83
84 if((stationName==41)||(stationName==42))nTgcMeas[isStrip]++;// TGC
85 if((stationName==43)||(stationName==44))nTgcMeas[isStrip]++;// TGC
86 if((stationName==45)||(stationName==46))nTgcMeas[isStrip]++;// TGC
87 if((stationName==47)||(stationName==48))nTgcMeas[isStrip]++;// TGC
88
89 if((stationName==13)||(stationName==49))nMdtMeas++;// MDT
90 if((stationName==14)||(stationName==15))nMdtMeas++;// MDT
91 if((stationName==17)||(stationName==18))nMdtMeas++;// MDT
92 if((stationName==20)||(stationName==21))nMdtMeas++;// MDT
93 }
94
95 // Cut Segments with insufficient numbers of hits in the stations
96 if(nMdtMeas<nMeasCutMdt[jMDT]||nTgcMeas[1]<nMeasCutTgcStrip[jMDT]){
97 segmDisqual = true;
98 }
99
101 // Apply Direction-Position cuts to segments
103 // Get Position and Direction Variables
104 // const Trk::GlobalPosition segmGlobalPos = segm->globalPosition();
105 const Amg::Vector3D segmGlobalPos = segm->globalPosition();
106
107 float segmPosPhi = segmGlobalPos.phi();
108 float segmPosThe = segmGlobalPos.theta();
109 if(segmPosPhi<0) segmPosPhi+=2*M_PI;
110 if(segmPosThe>M_PI/2) segmPosThe=M_PI-segmPosThe;
111 //const Trk::GlobalDirection segmGlobalDir = segm->globalDirection();
112 const Amg::Vector3D segmGlobalDir = segm->globalDirection();
113
114 float segmDirPhi = segmGlobalDir.phi();
115 float segmDirThe = segmGlobalDir.theta();
116 if(segmDirPhi<0) segmDirPhi+=2*M_PI;
117 if(segmDirThe>M_PI/2) segmDirThe=M_PI-segmDirThe;
118
119 // Get Differences between Position and Direction vectors
120 float dPhi_Pos_Dir = segmPosPhi-segmDirPhi;
121 float dThe_Pos_Dir = segmPosThe-segmDirThe;
122 if(dPhi_Pos_Dir<-M_PI)dPhi_Pos_Dir+=2*M_PI;
123 if(dPhi_Pos_Dir> M_PI)dPhi_Pos_Dir-=2*M_PI;
124
125 if(!segmDisqual){
126 if(m_mdt_segmposdirsag[i][jMDT][2]) m_mdt_segmposdirsag[i][jMDT][2]->Fill(dPhi_Pos_Dir);
127 if(m_mdt_segmposdirsag[i][jMDT][3]) m_mdt_segmposdirsag[i][jMDT][3]->Fill(dThe_Pos_Dir);
128 }
129
130 // Cut Segments with too great a difference between position and direction vectors
131 if(std::abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||std::abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){
132 segmDisqual = true;
133 }
134
136 // Add disqualified segments to the disqualified list
138 if(segmDisqual){
139 disqualifiedSegments[i][jMDT].push_back(segm);
140 }
141 else{
142 //HasStationDQSegm[jMDT]=true;// Flag event as having a DQ sufficient segment in the current station
143 }
144 }// Segments in station
145 }// MDT Stations
146 }// AC
147
148 return;
149}// End of function
const Trk::RIO_OnTrack * rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
virtual const Amg::Vector3D & globalPosition() const override final
global position
Identifier identify() const
return the identifier -extends MeasurementBase

◆ endOfEventsBlockFlag()

bool ManagedMonitorToolBase::endOfEventsBlockFlag ( ) const
inlineprotectedinherited

Definition at line 795 of file ManagedMonitorToolBase.h.

◆ endOfLowStatFlag()

bool ManagedMonitorToolBase::endOfLowStatFlag ( ) const
inlineprotectedinherited

Definition at line 796 of file ManagedMonitorToolBase.h.

◆ endOfLumiBlockFlag()

bool ManagedMonitorToolBase::endOfLumiBlockFlag ( ) const
inlineprotectedinherited

Definition at line 797 of file ManagedMonitorToolBase.h.

◆ endOfRunFlag()

bool ManagedMonitorToolBase::endOfRunFlag ( ) const
inlineprotectedinherited

Definition at line 798 of file ManagedMonitorToolBase.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ fillHistograms()

StatusCode MdtVsTgcRawDataValAlg::fillHistograms ( const EventContext & ctx)
virtual

An inheriting class should either override this function or fillHists().

Reimplemented from ManagedMonitorToolBase.

Definition at line 154 of file MdtVsTgcRawDataValAlg.cxx.

154 {
155/*----------------------------------------------------------------------------------*/
156 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg::TGC RawData Monitoring Histograms being filled" );
157
158 //TGC PRD
159 SG::ReadHandle<Muon::TgcPrepDataContainer> tgc_prd_container(m_tgc_PrepDataContainerName, ctx);
160
161 //TGC Coincidence
162 SG::ReadHandle<Muon::TgcCoinDataContainer> tgc_coin_container(m_tgc_CoinContainerName, ctx);
163
164 ATH_MSG_DEBUG( "size of tgc container is " << tgc_coin_container -> size() );
165
166 //MDT PRD
167 SG::ReadHandle<Muon::MdtPrepDataContainer> mdt_prd_container(m_mdt_PrepDataContainerName, ctx);
168
169 SG::ReadHandle<xAOD::MuonSegmentContainer> mdt_segment_collection(m_mdt_SegmentCollectionName, ctx) ;
170 tgceffcalc(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
171 maphists(mdt_segment_collection.cptr(), tgc_prd_container.cptr());
172
173 //only analyze nSL==1
174 int nSL = numberOfSL(tgc_coin_container.cptr());
175
176 if(nSL==1){
177 //fill MDT hit vs TGC RoI
178 correlation(mdt_prd_container.cptr(), tgc_coin_container.cptr());
179 }
180
181
182 return StatusCode::SUCCESS; // statuscode check
183}
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgc_PrepDataContainerName
void correlation(const Muon::MdtPrepDataContainer *mdt_hit_container, const Muon::TgcCoinDataContainer *tgc_trigger_container)
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_mdt_SegmentCollectionName
SG::ReadHandleKey< Muon::TgcCoinDataContainer > m_tgc_CoinContainerName
void tgceffcalc(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void maphists(const xAOD::MuonSegmentContainer *m_newsegment, const Muon::TgcPrepDataContainer *tgc_prepcontainer)
int numberOfSL(const Muon::TgcCoinDataContainer *tgctrgcontainer)
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdt_PrepDataContainerName

◆ fillHists()

StatusCode ManagedMonitorToolBase::fillHists ( const EventContext & ctx)
virtualinherited

Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over, calls procHists( bool, bool, bool ) and bookHists( bool, bool, bool ).

Implements IMonitorToolBase.

Definition at line 740 of file ManagedMonitorToolBase.cxx.

742{
743
744 if (m_d->m_warnAboutMissingInitialize) {
745 m_d->m_warnAboutMissingInitialize = false;
746 msg(MSG::WARNING) << "ManagedMonitorToolBase::initialize() never called from reimplementation!" << endmsg;
747 }
748
749
750 bool isNewEventsBlock = ( m_procNEventsProp > 0 && ((m_nEvents % m_procNEventsProp) == 1) && m_haveClearedLastEventBlock );
751 if (isNewEventsBlock) m_haveClearedLastEventBlock = false;
752
753 m_newLowStat = false;
754 m_newLumiBlock = false;
755 m_newRun = false;
756 newLowStat = false;
757 newLumiBlock = false;
758 newRun = false;
759
760 m_newLowStatInterval = false;
761 m_newMedStatInterval = false;
762 m_newHigStatInterval = false;
763 newLowStatInterval = false;
764 newMedStatInterval = false;
765 newHigStatInterval = false;
766
767 m_useTrigger = ( (m_triggerChainProp != "" || m_triggerGroupProp != "") && (!m_trigDecTool.empty()) );
768
769 if( m_manager != 0 ) {
770 m_newLumiBlock = ( (m_lastLumiBlock != m_manager->lumiBlockNumber()) || m_manager->forkedProcess());
771 m_newRun = ( m_lastRun != m_manager->runNumber() );
772 newLumiBlock = m_newLumiBlock;
773 newRun = m_newRun;
774
775 if(m_newRun) {
776 m_newLumiBlock = true;
777 newLumiBlock = m_newLumiBlock;
778 isNewEventsBlock = true;
779 }
780
781 m_newEventsBlock = isNewEventsBlock;
782 newEventsBlock = m_newEventsBlock;
783
784 if( m_newLumiBlock ) {
785 // check if a new LB interval has started
786 // lowest lumiBlockNumber() is 1
787 // m_lastLowStatInterval is -1 initially
788 int currentLB = m_manager->lumiBlockNumber();
789 int LBsLowStat = m_manager->getLBsLowStat();
790 int LBsMedStat = m_manager->getLBsMedStat();
791 int LBsHigStat = m_manager->getLBsHigStat();
792
793 if( LBsLowStat*LBsMedStat*LBsHigStat == 0) {
794 msg(MSG::WARNING) << "zero LBs requested for interval" << endmsg;
795 }
796 else {
797 if( ((currentLB-1)/LBsLowStat) != m_lastLowStatInterval ) m_newLowStatInterval = true;
798 if( ((currentLB-1)/LBsMedStat) != m_lastMedStatInterval ) m_newMedStatInterval = true;
799 if( ((currentLB-1)/LBsHigStat) != m_lastHigStatInterval ) m_newHigStatInterval = true;
800 newLowStatInterval = m_newLowStatInterval;
801 newMedStatInterval = m_newHigStatInterval;
802 newHigStatInterval = m_newHigStatInterval;
803 }
804 }
805
806 // Allow inheriting classes the option of using the lastLumiBloc/lastRun values
807 // before updating them
808 }
809
810
811 StatusCode sc0( StatusCode::SUCCESS );
812 StatusCode sc1( StatusCode::SUCCESS );
813 StatusCode sc2( StatusCode::SUCCESS );
814 StatusCode sc3( StatusCode::SUCCESS );
815
816 // Set end of LowStat, LumiBlock and Run variables
817 // These are needed to be used in procHistograms().
822 endOfEventsBlock = m_newEventsBlock;
823 endOfLowStat = m_newLowStatInterval;
824 endOfLumiBlock = m_newLumiBlock;
826
827 // just duplicates m_newLowStatInterval
829 newLowStat = m_newLowStatInterval;
830
832 ATH_MSG_DEBUG("Interval transition processing");
833 // Process histograms from the previous lumiBlock/run
834 if( m_nEvents != 1 ) {
835 m_d->benchPreProcHistograms();
836 sc0 = procHistograms();
837 m_d->benchPostProcHistograms();
838 }
839 // Re-book new histograms
840 m_d->benchPreBookHistograms();
841
843 sc1 = bookHistograms();
845 } else {
846 std::vector<Interval_t> intervals_to_process;
847 if (m_newEventsBlock) intervals_to_process.push_back(eventsBlock);
848 if (m_newLumiBlock) intervals_to_process.push_back(lumiBlock);
849 if (m_newLowStatInterval) intervals_to_process.push_back(lowStat);
850 if (m_newRun) intervals_to_process.push_back(run);
851 for (const auto interval: intervals_to_process) {
853 sc1 = regManagedGraphs(m_templateGraphs[interval]);
854 sc1 = regManagedTrees(m_templateTrees[interval]);
855 }
856 }
857 for (const auto& interval: std::vector<Interval_t>{ eventsBlock, lumiBlock, lowStat, run }) {
858 for (const auto& it: m_templateHistograms[interval]) {
859 // is histogram too small in x axis for LB range?
860 if (it.m_group.histo_mgmt() == ATTRIB_X_VS_LB) {
861 //ATH_MSG_WARNING("We are rebinning for " << it.m_templateHist->GetName());
862 while ( it.m_templateHist->GetXaxis()->GetXmax() <= AthenaMonManager::lumiBlockNumber() ) {
863 it.m_templateHist->LabelsInflate("X");
864 }
865 }
866 }
867 for (auto& it: m_templateEfficiencies[interval]) {
868 if (it.m_group.histo_mgmt() == ATTRIB_X_VS_LB) {
869 // get the underlying passed and total TH1's from the TEfficiency
870 TH1* passedHist = it.m_templateHist->GetCopyPassedHisto();
871 TH1* totalHist = it.m_templateHist->GetCopyTotalHisto();
872 // inflate them until they exceed the lumi-block number
873 while (passedHist->GetXaxis()->GetXmax() <= AthenaMonManager::lumiBlockNumber() ) {
874 passedHist->LabelsInflate("X");
875 totalHist->LabelsInflate("X");
876 }
877 // Replace them in the TEfficiency. First one has force ("f") option, since the
878 // histograms will not be consistent. This is corrected in the next line, so we
879 // do check for consistency then.
880 it.m_templateHist->SetPassedHistogram(*passedHist, "f");
881 it.m_templateHist->SetTotalHistogram(*totalHist, " ");
882 delete passedHist; // not owned by THistSvc, so need to be deleted.
883 delete totalHist;
884 }
885 }
886 }
887
888 if (auto streamname = dynamic_cast<OfflineStream*>(streamNameFunction())) {
889 streamname->updateRunLB();
890 }
891
893
894 m_d->benchPostBookHistograms();
895
896 }//end if new RUN/LB/Block
897
898 // check filters
899 bool filterresult(true);
900 if (! m_DQFilterTools.empty()) {
901 ToolHandleArray<IDQFilterTool>::const_iterator ifilter(m_DQFilterTools.begin()), filterend(m_DQFilterTools.end());
902 for (; filterresult && (ifilter != filterend);
903 ++ifilter) {
904 filterresult = (filterresult && (*ifilter)->accept(ctx));
905 }
906 }
907
908
909 // ...and fill as normal
910 if(filterresult &&
914 ATH_MSG_DEBUG("Passed trigger, presumably");
915 m_d->benchPreFillHistograms();
916 fillHistograms(ctx).ignore();
918 m_d->benchPostFillHistograms();
919 ++m_nEvents;
920 } else { ATH_MSG_DEBUG("Failed trigger, presumably"); }
921
923 if( m_newLumiBlock && (m_nEventsIgnoreTrigger != 1) ) {
925 }
926 if( m_manager != 0 ) {
927 m_lastRun = m_manager->runNumber();
928 if( m_newLumiBlock ) {
929 m_lastLumiBlock = m_manager->lumiBlockNumber();
930
931 int LBsLowStat = m_manager->getLBsLowStat();
932 int LBsMedStat = m_manager->getLBsMedStat();
933 int LBsHigStat = m_manager->getLBsHigStat();
934 if( LBsLowStat*LBsMedStat*LBsHigStat > 0) {
938 }
939 }
940 }
941
942 return StatusCode::SUCCESS;
943}
#define endmsg
MsgStream & msg() const
static unsigned int lumiBlockNumber()
StatusCode regManagedTrees(std::vector< MgmtParams< TTree > > &templateTrees)
ToolHandleArray< IDQFilterTool > m_DQFilterTools
virtual StatusCode fillHistograms(const EventContext &ctx)
An inheriting class should either override this function or fillHists().
virtual StatusCode bookHistogramsRecurrent()
An inheriting class should either override this function, bookHists() or bookHistograms().
std::vector< std::string > m_vTrigGroupNames
std::map< Interval_t, std::vector< MgmtParams< TH1 > > > m_templateHistograms
PublicToolHandle< Trig::ITrigDecisionTool > m_trigDecTool
StatusCode regManagedGraphs(std::vector< MgmtParams< TGraph > > &templateGraphs)
std::map< Interval_t, std::vector< MgmtParams< TGraph > > > m_templateGraphs
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
std::vector< std::string > m_vTrigChainNames
std::map< Interval_t, std::vector< MgmtParams< TTree > > > m_templateTrees
std::map< Interval_t, std::vector< MgmtParams< TEfficiency > > > m_templateEfficiencies
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
StatusCode regManagedHistograms(std::vector< MgmtParams< TH1 > > &templateHistograms)
virtual bool trigChainsArePassed(std::vector< std::string > &)
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ finalHists()

StatusCode ManagedMonitorToolBase::finalHists ( )
virtualinherited

Calls procHists( true, true, true ).

Implements IMonitorToolBase.

Definition at line 1255 of file ManagedMonitorToolBase.cxx.

1257{
1258
1259 // This assumes that the end of a file will naturally end a run, which is not always true.
1260 // A merging application run afterwards should be able to put parts of a run together.
1261 if( m_nEvents != 1 ) {
1262 m_d->benchPreProcHistograms();
1263
1264 // Set end flags for the LowStat, LumiBlock and Run variables.
1265 // This is needed to be used in the procHistograms method below.
1266 m_endOfEventsBlock = true;
1267 m_endOfLowStat = true;
1268 m_endOfLumiBlock = true;
1269 m_endOfRun = true;
1270 endOfEventsBlock = true;
1271 endOfLowStat = true;
1272 endOfLumiBlock = true;
1273 endOfRun = true;
1274
1276
1277 m_d->benchPostProcHistograms();
1278 return sc;
1279 }
1280 return StatusCode::SUCCESS;
1281}
static Double_t sc

◆ get_nEvents()

unsigned int ManagedMonitorToolBase::get_nEvents ( ) const
inlineprotectedinherited

Definition at line 693 of file ManagedMonitorToolBase.h.

693 {
694 return m_nEvents;
695 }

◆ get_procNEventsProp()

long ManagedMonitorToolBase::get_procNEventsProp ( ) const
inlineprotectedinherited

Definition at line 697 of file ManagedMonitorToolBase.h.

697 {
698 return m_procNEventsProp;
699 }

◆ getHist() [1/4]

StatusCode ManagedMonitorToolBase::getHist ( TH1 *& h,
const std::string & hName,
const MonGroup & group )
virtualinherited

Returns a TH1 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1418 of file ManagedMonitorToolBase.cxx.

1420{
1421 std::string streamName = streamNameFunction()->getStreamName( this, group, hName );
1422 return m_THistSvc->getHist( streamName, h );
1423}

◆ getHist() [2/4]

StatusCode ManagedMonitorToolBase::getHist ( TH1 *& h,
const std::string & hName,
const std::string & system,
Interval_t interval )
virtualinherited

Returns a TH1 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1408 of file ManagedMonitorToolBase.cxx.

1411{
1412 MonGroup group( this, system, interval );
1413 return getHist( h, hName, group );
1414}
virtual StatusCode getHist(TH1 *&h, const std::string &hName, const std::string &system, Interval_t interval)
Returns a TH1 via the pointer passed as the first argument.

◆ getHist() [3/4]

StatusCode ManagedMonitorToolBase::getHist ( TH2 *& h,
const std::string & hName,
const MonGroup & group )
virtualinherited

Returns a TH2 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1437 of file ManagedMonitorToolBase.cxx.

1439{
1440 std::string streamName = streamNameFunction()->getStreamName( this, group, hName );
1441 return m_THistSvc->getHist( streamName, h );
1442}

◆ getHist() [4/4]

StatusCode ManagedMonitorToolBase::getHist ( TH2 *& h,
const std::string & hName,
const std::string & system,
Interval_t interval )
virtualinherited

Returns a TH2 via the pointer passed as the first argument.

The histogram name, without the leading path or stream name, must be given as the second argument.

Definition at line 1427 of file ManagedMonitorToolBase.cxx.

1430{
1431 MonGroup group( this, system, interval );
1432 return getHist( h, hName, group );
1433}

◆ getNewStreamNameFcn()

ManagedMonitorToolBase::StreamNameFcn * ManagedMonitorToolBase::getNewStreamNameFcn ( ) const
protectedvirtualinherited

Definition at line 2156 of file ManagedMonitorToolBase.cxx.

2158{
2159 StreamNameFcn* fcn(0);
2160
2161 switch( m_environment ) {
2163 fcn = new NoOutputStream();
2164 break;
2166 fcn = new OnlineStream();
2167 break;
2169 fcn = new DefaultStream( m_fileKey );
2170 break;
2176 default:
2178 }
2179
2180 return fcn;
2181}
A function-object base class allowing the specific implementation of getStreamName to be decided at r...
AthenaMonManager::Environment_t m_environment
AthenaMonManager::DataType_t m_dataType

◆ getStationMapIndex()

int MdtVsTgcRawDataValAlg::getStationMapIndex ( int x,
int l,
int stationFE,
int stationEta,
int stationPhi )
private

Definition at line 258 of file MdtVsTgcRawData_TGCEffCheck.cxx.

258 {
259 // Display error messages if invalid TRE variables are passed in
260 if((stationFE!=0)&&(stationFE!=1)) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationFE=" << stationFE );
261 if((l<0)||(l>8)) ATH_MSG_WARNING( "getStationMapIndex passed invalid layer index l=" << l );
262 if(stationEta<1) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationEta=" << stationEta );
263 if(stationPhi<1) ATH_MSG_WARNING( "getStationMapIndex passed invalid stationPhi=" << stationPhi );
264 int index=0;
265 switch(x){
266 case 1:// Getting Eta Index //use old eta bin
267 if(l==0||l==1||l==2){// T1
268 if(stationEta>4) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
269 if(stationFE==0)index=32+l;
270 else{
272 index=index*7+l;
273 }
274 }
275 else if(l==3||l==4){// T2
276 if(stationEta>5) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
277 if(stationFE==0)index=32+l;
278 else {
280 index=index*7+l;
281 if(stationEta==1)index=25+l;
282 }
283 }
284 else if(l==5||l==6){// T3
285 if(stationEta>5) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
286 if(stationFE==0)index=32+l;
287 else{
289 index=index*7+l;
290 if(stationEta==1)index=25+l;
291 }
292 }
293 else if(l==7||l==8){// T4
294 if(stationEta>1) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " stationEta=" << stationEta );
295 if(stationFE==0){
296 if(l==7){index=41;}
297 else if(l==8){index=42;}
298 }else{
299 if(l==7){index=39;}
300 else if(l==8){index=40;}
301 }
302 }
303 break;
304 case 2:// Getting Phi Index
305 if(stationFE==0){// Forward
306 if((l==7)||(l==8)){// FI
307 if(stationPhi>24) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
308 index=(stationPhi-1)*2;
309 }
310 else{// Forward Midstation
311 if(stationPhi>24) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
312 index=(stationPhi-1)*2;
313 }
314 }
315 else{// Endcap
316 if((l==7)||(l==8)){// EI
317 if(stationPhi>21) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
318 index=(stationPhi-1);
319 if(index>7)index++;
320 if(index>15)index++;
321 if(index>19)index++;
322 index*=2;
323 }
324 else{// Endcap Midstation
325 if(stationPhi>48) ATH_MSG_WARNING( "getStationMapIndex(" << x << ") passed invalid l=" << l << " FE=" << stationFE << " stationPhi=" << stationPhi );
327 }
328 }
329 // Adjust to set A01phi0(stationPhi=47 for Midstation)at 0
330 index+=2;
331 if(index>47)index-=48;
332 break;
333 default:
334 ATH_MSG_WARNING( "getStationMapIndex(" << x << ") is invalid" );
335 break;
336 }
337 return index;
338}// End of function
str index
Definition DeMoScan.py:362

◆ initialize()

StatusCode MdtVsTgcRawDataValAlg::initialize ( )
virtual

Reimplemented from ManagedMonitorToolBase.

Definition at line 97 of file MdtVsTgcRawDataValAlg.cxx.

97 {
99 ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" );
100 // MuonDetectorManager from the conditions store
101 ATH_CHECK(m_DetectorManagerKey.initialize());
102 ATH_CHECK(m_idHelperSvc.retrieve());
103
104 //MDT z position
105 //Name MultiLayer TubeLayer z
106 //17 1 1 14142.5
107 //17 1 2 14168.5
108 //17 1 3 14194.5
109 //17 2 1 14394.6
110 //17 2 2 14420.6
111 //17 2 3 14446.6
112 //18 1 1 13726.5
113 //18 1 2 13752.5
114 //18 1 3 13778.5
115 //18 2 1 13978.6
116 //18 2 2 14004.6
117 //18 2 3 14030.6
118
119 // Retrieve the MuonDetectorManager
120 const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr;
121 ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) );
122 ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " );
123 prepareTREarray(MuonDetMgrDS);
128 return StatusCode::SUCCESS;
129}
const ServiceHandle< StoreGateSvc > & detStore() const
void prepareTREarray(const MuonGM::MuonDetectorManager *MuonDetMgrDS)

◆ inputHandles()

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

◆ interfaceID()

const InterfaceID & IMonitorToolBase::interfaceID ( )
inlinestaticinherited

Definition at line 30 of file IMonitorToolBase.h.

30{ return IID_IMonitorToolBase; }
static const InterfaceID IID_IMonitorToolBase("IMonitorToolBase", 1, 0)

◆ intervalEnumToString()

std::string ManagedMonitorToolBase::intervalEnumToString ( Interval_t interval)
staticinherited

Converts a LevelOfDetail_t to a string of the same name.

Converts a string to the corresponding LevelOfDetail_t. Converts a Interval_t to a string of the same name.

Definition at line 536 of file ManagedMonitorToolBase.cxx.

538{
539 std::string str("file");
540
541 switch( interval ) {
542 case all:
543 str = "all";
544 break;
545 case fill:
546 str = "fill";
547 break;
548 case run:
549 str = "run";
550 break;
551 case lowStat:
552 str = "lowStat";
553 break;
554 case medStat:
555 str = "medStat";
556 break;
557 case higStat:
558 str = "higStat";
559 break;
560 case lumiBlock:
561 str = "lumiBlock";
562 break;
563 case eventsBlock:
564 str = "eventsBlock";
565 break;
566 case file:
567 str = "file";
568 break;
569 default:
570 str = "unknown";
571 }
572
573 return str;
574}

◆ intervalStringToEnum()

ManagedMonitorToolBase::Interval_t ManagedMonitorToolBase::intervalStringToEnum ( const std::string & str)
staticinherited

Converts a string to the corresponding Interval_t.

Definition at line 578 of file ManagedMonitorToolBase.cxx.

580{
581 std::string lcstr( strToLower(str) );
582
583 if( lcstr == "all" )
584 return all;
585 else if( lcstr == "fill" )
586 return fill;
587 else if( lcstr == "run" )
588 return run;
589 else if( lcstr == "lowStat" )
590 return lowStat;
591 else if( lcstr == "medStat" )
592 return medStat;
593 else if( lcstr == "higStat" )
594 return higStat;
595 else if( lcstr == "lumiBlock" )
596 return lumiBlock;
597 else if( lcstr == "eventsBlock" )
598 return eventsBlock;
599 else if( lcstr == "file" )
600 return file;
601
602 if( Imp::s_svcLocator ) {
603 SmartIF<IMessageSvc> ms{Imp::s_svcLocator.load()->service( "MessageSvc" )};
604 if( ms.isValid() ) {
605 MsgStream log( ms, "ManagedMonitorToolBase::intervalStringToEnum()" );
606 log << MSG::WARNING << "Unknown ManagedMonitorToolBase::Interval_t \""
607 << str << "\", returning \"file\"" << endmsg;
608 }
609 }
610
611 return file;
612}
static std::atomic< ISvcLocator * > s_svcLocator

◆ labelStationMap()

void MdtVsTgcRawDataValAlg::labelStationMap ( TH2 * h2,
int i = -1,
int k = -1 )
private

Definition at line 397 of file MdtVsTgcRawData_bookhistograms.cxx.

397 {
398 // Blank non-existent chambers
399 BlankStationMap(h2,ws);
400
401 std::stringstream sst;
402 std::string AC[2]={"A","C"};
403 int nChambers[9]={5,5,5,6,6,6,6,2,2};
404 std::string chamber1[6]={"E1", "E2", "E3", "E4", "F"};
405 std::string chamber3[6]={"E1", "E2", "E3", "E4", "E5", "F"};
406 std::string chamberE[2]={"EI", "FI"};
407
408 bool rebin=true;
409 // Name StationEtas/Layers
410 int ibin=1;
411 if(rebin){//use new bin
412 for(int l=0 ; l<9 ; l++ ){// Layer
413 //cppcheck-suppress negativeIndex
414 for( int c=0 ; c<nChambers[l] ; c++ ){// Chamber
415 sst << "L" << l+1 << "_";
416 if(nChambers[l]==5)sst<<chamber1[c];
417 else if(nChambers[l]==6)sst<<chamber3[c];
418 else if(nChambers[l]==2)sst<<chamberE[c];
419 if(l+1>0 && l+1<=3 && c+1<5)ibin=7*c+(l+1);
420 else if(l+1>3 && l+1<=7 && c+1<5)ibin=7*c+(l+1);
421 else if(l+1>3 && l+1<=7 && c+1==5)ibin=25+(l+1);
422 else if(l+1==1 && c+1==5)ibin=33;
423 else if(l+1==2 && c+1==5)ibin=34;
424 else if(l+1==3 && c+1==5)ibin=35;
425 else if(l+1==4 && c+1==6)ibin=36;
426 else if(l+1==5 && c+1==6)ibin=37;
427 else if(l+1==6 && c+1==6)ibin=38;
428 else if(l+1==7 && c+1==6)ibin=39;
429 else if(l+1==8 && c+1==1)ibin=40;
430 else if(l+1==8 && c+1==2)ibin=42;
431 else if(l+1==9 && c+1==1)ibin=41;
432 else if(l+1==9 && c+1==2)ibin=43;
433 h2->GetXaxis()->SetBinLabel(ibin, sst.str().c_str());
434 h2->GetXaxis()->SetBit(TAxis::kLabelsVert);
435 sst.str("");
436 }// Chamber
437 }// Layer
438 }else{//use old bin logically dead code, comment out
439// for(int l=0 ; l<9 ; l++ ){// Layer
440// for( int c=0 ; c<nChambers[l] ; c++ ){// Chamber
441// sst << "L" << l+1 << "_";
442// if(nChambers[l]==5)sst<<chamber1[c];
443// else if(nChambers[l]==6)sst<<chamber3[c];
444// else if(nChambers[l]==2)sst<<chamberE[c];
445// h2->GetXaxis()->SetBinLabel(ibin, sst.str().c_str());
446// sst.str(""); ibin++;
447// }// Chamber
448// }// Layer
449// h2->GetXaxis()->LabelsOption("v");
450 }
451 // Name Phi Sectors
452 for(int isec=1;isec<=12;isec++){// Sector
453 for(int iphi=0;iphi<=3;iphi+=4){// Phi number
454 if(ac==0||ac==1)sst << AC[ac];
455 if(isec<10)sst << "0";
456 sst << isec << "phi" << iphi;
457 ibin=(isec-1)*4+iphi+1;
458 h2->GetYaxis()->SetBinLabel(ibin, sst.str().c_str());
459 sst.str("");
460 }// Phi number
461 }// Sector
462}// End of function
void BlankStationMap(TH2 *h2, int ws)

◆ lbAverageInteractionsPerCrossing()

float ManagedMonitorToolBase::lbAverageInteractionsPerCrossing ( const EventContext & ctx) const
virtualinherited

Average mu, i.e.

<mu>

Definition at line 1692 of file ManagedMonitorToolBase.cxx.

1694{
1695 if (!m_lumiDataKey.empty()) {
1696 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1697 return lumi->lbAverageInteractionsPerCrossing();
1698 } else {
1699 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageInteractionsPerCrossing() can't work properly! ");
1700 ATH_MSG_DEBUG("Warning: lbAverageInteractionsPerCrossing() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1701 return -1.0;
1702 }
1703 // not reached
1704}
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey

◆ lbAverageLivefraction()

float ManagedMonitorToolBase::lbAverageLivefraction ( const EventContext & ctx) const
virtualinherited

Average luminosity livefraction.

Definition at line 1761 of file ManagedMonitorToolBase.cxx.

1763{
1765 return 1.0;
1766
1767 if (!m_trigLiveFractionDataKey.empty()) {
1768 SG::ReadCondHandle<TrigLiveFractionCondData> live (m_trigLiveFractionDataKey, ctx);
1769 return live->lbAverageLiveFraction();
1770 } else {
1771 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageLivefraction() can't work properly! ");
1772 ATH_MSG_DEBUG("Warning: lbAverageLivefraction() - luminosity not availble (i.e. EnableLumi = False)");
1773 return -1.0;
1774 }
1775 // not reached
1776}
SG::ReadCondHandleKey< TrigLiveFractionCondData > m_trigLiveFractionDataKey

◆ lbAverageLuminosity()

float ManagedMonitorToolBase::lbAverageLuminosity ( const EventContext & ctx) const
virtualinherited

Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).

Definition at line 1728 of file ManagedMonitorToolBase.cxx.

1730{
1731 if (!m_lumiDataKey.empty()) {
1732 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1733 return lumi->lbAverageLuminosity();
1734 } else {
1735 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbAverageLuminosity() can't work properly! ");
1736 ATH_MSG_DEBUG("Warning: lbAverageLuminosity() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1737 return -1.0;
1738 }
1739 // not reached
1740}

◆ lbDuration()

double ManagedMonitorToolBase::lbDuration ( const EventContext & ctx) const
virtualinherited

Luminosity block time (in seconds).

Definition at line 1815 of file ManagedMonitorToolBase.cxx.

1817{
1819 return m_defaultLBDuration;
1820 }
1821 if (!m_lbDurationDataKey.empty()) {
1822 SG::ReadCondHandle<LBDurationCondData> dur (m_lbDurationDataKey, ctx);
1823 return dur->lbDuration();
1824 } else {
1825 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbDuration() can't work properly! ");
1826 ATH_MSG_DEBUG("Warning: lbDuration() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1827 return m_defaultLBDuration;
1828 }
1829 // not reached
1830}
SG::ReadCondHandleKey< LBDurationCondData > m_lbDurationDataKey

◆ lbInteractionsPerCrossing()

float ManagedMonitorToolBase::lbInteractionsPerCrossing ( const EventContext & ctx) const
virtualinherited

Instantaneous number of interactions, i.e.

mu

Definition at line 1708 of file ManagedMonitorToolBase.cxx.

1710{
1711 if (!m_lumiDataKey.empty()) {
1712 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1713 float muToLumi = lumi->muToLumi();
1714 if (muToLumi > 0) {
1715 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id()) / muToLumi;
1716 }
1717 return 0;
1718 } else {
1719 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbInteractionsPerCrossing() can't work properly! ");
1720 ATH_MSG_DEBUG("Warning: lbInteractionsPerCrossing() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1721 return -1.0;
1722 }
1723 // not reached
1724}

◆ lbLuminosityPerBCID()

float ManagedMonitorToolBase::lbLuminosityPerBCID ( const EventContext & ctx) const
virtualinherited

Instantaneous luminosity.

Definition at line 1744 of file ManagedMonitorToolBase.cxx.

1746{
1747 if (!m_lumiDataKey.empty()) {
1748 SG::ReadCondHandle<LuminosityCondData> lumi (m_lumiDataKey, ctx);
1749 return lumi->lbLuminosityPerBCIDVector().at (ctx.eventID().bunch_crossing_id());
1750 } else {
1751 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbLuminosityPerBCID() can't work properly! ");
1752 ATH_MSG_DEBUG("Warning: lbLuminosityPerBCID() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1753 return -1.0;
1754 }
1755 // not reached
1756}

◆ lbLumiWeight()

double ManagedMonitorToolBase::lbLumiWeight ( const EventContext & ctx) const
virtualinherited

Average Integrated Luminosity Live Fraction.

Definition at line 1799 of file ManagedMonitorToolBase.cxx.

1801{
1802 if (!m_lumiDataKey.empty()) {
1804 } else{
1805 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! lbLumiWeight() can't work properly! ");
1806 ATH_MSG_DEBUG("Warning: lbLumiWeight() - luminosity tools are not retrieved or turned on (i.e. EnableLumi = False)");
1807 return -1.0;
1808 }
1809 // not reached
1810}
virtual double lbDuration(const EventContext &ctx) const
Luminosity block time (in seconds).
virtual float lbAverageLivefraction(const EventContext &ctx) const
Average luminosity livefraction.
virtual float lbAverageLuminosity(const EventContext &ctx) const
Average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).

◆ livefractionPerBCID()

float ManagedMonitorToolBase::livefractionPerBCID ( const EventContext & ctx) const
virtualinherited

Livefraction per bunch crossing ID.

Definition at line 1780 of file ManagedMonitorToolBase.cxx.

1782{
1784 return 1.0;
1785
1786 if (!m_trigLiveFractionDataKey.empty()) {
1787 SG::ReadCondHandle<TrigLiveFractionCondData> live (m_trigLiveFractionDataKey, ctx);
1788 return live->l1LiveFractionVector().at (ctx.eventID().bunch_crossing_id());
1789 } else {
1790 //ATH_MSG_FATAL("! Luminosity tool has been disabled ! livefractionPerBCID() can't work properly! ");
1791 ATH_MSG_DEBUG("Warning: livefractionPerBCID() - luminosity retrieved available (i.e. EnableLumi = False)");
1792 return -1.0;
1793 }
1794 // not reached
1795}

◆ maphists()

void MdtVsTgcRawDataValAlg::maphists ( const xAOD::MuonSegmentContainer * m_newsegment,
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 36 of file MdtVsTgcRawData_maptgchits.cxx.

37 {//use new mdt segment
38 ATH_MSG_DEBUG("inside maptgchits" );
39
41 // loop over MDT Segment Collection
42 xAOD::MuonSegmentContainer::const_iterator mdtseg_itr = newsegment->begin();
43 xAOD::MuonSegmentContainer::const_iterator mdtseg_end = newsegment->end();
44 for(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
45 if(!(*mdtseg_itr)->muonSegment().isValid())continue;
46 // Get segm
47 const Muon::MuonSegment* segm = dynamic_cast<const Muon::MuonSegment*>(*(*mdtseg_itr)->muonSegment());
48 if (segm == nullptr) {
49 ATH_MSG_ERROR( "no pointer to segm!!!" );
50 break;
51 }
52 // Initialize variables
53 int stationName=0;
54 int nMdtMeas[4] = {0,0,0,0};
55 bool isMdt=false, isEndcap=false;
56
57 // Loop through contained ROTs and count used MDT and TGC stations
58 for(unsigned int i=0;i<segm->numberOfContainedROTs();++i){
59 // Get station information
60 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(i);
61 if(!rio) continue;
62 Identifier id = rio->identify();
63 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
64 // Flag Segments with ROTs in the MDT & Endcap
65 if(m_idHelperSvc->isMdt(id))isMdt=true;
66 if(m_idHelperSvc->isEndcap(id))isEndcap=true;
67 // If ROT is MDT
68 if((stationName==13)||(stationName==49)){nMdtMeas[0]++;}
69 if((stationName==14)||(stationName==15)){nMdtMeas[1]++;}
70 if((stationName==17)||(stationName==18)){nMdtMeas[2]++;}
71 if((stationName==20)||(stationName==21)){nMdtMeas[3]++;}
72 }
73 if(!isMdt)continue;
74 if(!isEndcap)continue;
75
76 // Establish which MDT stations the Segment is in
77 int nStations = 0;
78 for(int jMDT=0;jMDT<4;jMDT++){
79 if(nMdtMeas[jMDT]){
80 nStations++;
81 }
82 }
83 // Check that the Segment only occupies one Station
84 if(nStations!=1)continue;
85
86 // Get Position pointer and segmAC index
87 const Amg::Vector3D segmGlobalPos = segm->globalPosition();
88 int segmAC = (segmGlobalPos.z()<0);// a:0, c:1
89
90 // Fill MDT data
91 for(int jMDT=0;jMDT<4;jMDT++){// jMDT
92 if(nMdtMeas[jMDT]){// If hits in this Station
93 // Get position variables
94 float segmGlobalEta = std::abs(segmGlobalPos.eta());
95 float segmGlobalPhi = segmGlobalPos.phi();
96 if(segmGlobalPhi<0) segmGlobalPhi+=2*M_PI;
97 // Fill position histogram
98 m_mdt_segmmap[segmAC][jMDT]->Fill(segmGlobalPhi, segmGlobalEta);
99 }// If hits in Station
100 }// jMDT
101 }// MDT Segment Collection
102
104 //loop over TGC Prep Data container
105 Muon::TgcPrepDataContainer::const_iterator tgc_it_end=tgc_prepcontainer->end();
106 for( Muon::TgcPrepDataContainer::const_iterator tgc_it=tgc_prepcontainer->begin();
107 tgc_it!=tgc_it_end;
108 ++tgc_it){
109
110 //loop over TGC Prep Data collection
111 Muon::TgcPrepDataCollection::const_iterator tgc_itc_end=(*tgc_it)->end();
112 for( Muon::TgcPrepDataCollection::const_iterator tgc_itc=(*tgc_it)->begin();
113 tgc_itc!= tgc_itc_end;
114 ++tgc_itc){
115 const Muon::TgcPrepData* tpd=*tgc_itc;
116
117 // Get detector information
118 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
119 const std::string tgcStationType = tre->getStationType();
120
121 // Get detector variables
122 Identifier tgcid=(*tgc_itc)->identify();
123 int tgcStationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
124
125 // Get position variables
126 const Amg::Vector3D tgcGlobalPos = tpd->globalPosition();
127 float tgcGlobalPhi = tgcGlobalPos.phi();
128 if(tgcGlobalPhi<0)tgcGlobalPhi+=2*M_PI;
129
130 // Cut non-TGC-Endcap
131 if(tgcStationName<41 || tgcStationName>48)continue;
132 }// TGC PRD Collection
133 }// TGC PRD Container
134
135 return;
136}// End of function

◆ maphistsfinalize()

void MdtVsTgcRawDataValAlg::maphistsfinalize ( )
private

Definition at line 139 of file MdtVsTgcRawData_maptgchits.cxx.

139 {
140
141}// End of function

◆ MatchMDTSegments()

void MdtVsTgcRawDataValAlg::MatchMDTSegments ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4],
std::vector< SegmTrack >(&) matchedSegments[2] )
private

Definition at line 32 of file MdtVsTgcRawData_SegmMatching.cxx.

34 {// Define Cuts:
35 // Cut for matching Segments
36 const float dRhoCutSegmentMatching = 1000;
37 const float dPhiCutSegmentMatching = M_PI/8;
38 const float dPhiCutSegmentDirectionChecking[4][4]={{ 0,M_PI/8, 0.1, 0.01},
39 {M_PI/8, 0,M_PI/8,M_PI/8},
40 { 0.06,M_PI/8, 0, 0.01},
41 { 0.05,M_PI/8, 0.05, 0}};
42 const float dTheCutSegmentDirectionChecking[4][4]={{ 0,M_PI/8, 0.05, 0.06},
43 {M_PI/8, 0,M_PI/8,M_PI/8},
44 { 0.04,M_PI/8, 0, 0.005},
45 { 0.02,M_PI/8, 0.005, 0}};
46 // Loop over sides
47 for(int i=0;i<2;i++){// AC
48 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
49 //bool HasStationMatchSegm[4] = {false, false, false, false};// flags for whether the there are segments in each MDT station which were included in tracks
50 //bool HasMatchedTrack = false;// flag for whether a track was found on current side
51
52 for(int jMDT1=3;jMDT1>=0;jMDT1--){// MDT Stations in reverse]
53 // Get number of segments
54 int nSegm1=sortedSegments[i][jMDT1].size();
55
56 // Loop over Segments in Station
57 for(int n1=0; n1<nSegm1;n1++){
58 // Get segment
59 const Muon::MuonSegment *segm1 = sortedSegments[i][jMDT1].at(n1);
60
61 // Check disqualifiedSegments for current segment
62 skipSegm=false;
63 nDisqualifiedSegm=disqualifiedSegments[i][jMDT1].size();
64 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][jMDT1].at(ndis))skipSegm=true;
65 if(skipSegm)continue;
66
67 // Get position variables
68 const Amg::Vector3D segm1Pos = segm1->globalPosition();
69
70 float segm1PosPhi = segm1Pos.phi();
71 float segm1PosZ = segm1Pos.z();
72 if(segm1PosPhi<0)segm1PosPhi+=2*M_PI;
73 Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ));
74 Amg::Vector3D segm1Dir = segm1->globalDirection();
75
76 float segm1DirThe = segm1Dir.theta();
77 float segm1DirPhi = segm1Dir.phi();
78 if(segm1DirThe>M_PI/2) segm1DirThe=M_PI-segm1DirThe;
79 if(segm1DirPhi<0) segm1DirPhi+=2*M_PI;
80
81 // Initialise segment matching variables
82 bool stationMatchFound[4] = {false,false,false,false};
83 std::vector<const Muon::MuonSegment*> matchingSegments[4];
84 for(int jMDT2=0;jMDT2<4;jMDT2++)matchingSegments[jMDT2] = std::vector<const Muon::MuonSegment*>();
85 matchingSegments[jMDT1].push_back(segm1);
86 int nStationMatch=0;
87
88 for(int jMDT2=3;jMDT2>=0;jMDT2--){// MDT Station in reverse
89 // Get number of segments
90 int nSegm2=sortedSegments[i][jMDT2].size();
91
92 // Loop over Segments in Station
93 for(int n2=0; n2<nSegm2;n2++){
94 // Get segment
95 const Muon::MuonSegment *segm2 = sortedSegments[i][jMDT2].at(n2);
96 if(segm1==segm2)continue; //do not compare same segments
97
98 // Check disqualifiedSegments for current segment
99 skipSegm = false;
100 nDisqualifiedSegm=disqualifiedSegments[i][jMDT2].size();
101 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][jMDT2].at(ndis))skipSegm=true;
102 if(skipSegm)continue;
103
105 // Position Cut
106 // Fill position variables
107 const Amg::Vector3D segm2Pos = segm2->globalPosition();
108
109 float segm2PosRho = std::abs(segm2Pos.perp());
110 float segm2PosPhi = segm2Pos.phi();
111 float segm2PosThe = segm2Pos.theta();
112 float segm2PosZ = segm2Pos.z();
113 if(segm2PosThe>M_PI/2) segm2PosThe=M_PI-segm2PosThe;
114 if(segm2PosPhi<0)segm2PosPhi+=2*M_PI;
115 Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ));
116
117 // Apply preliminary phi cut between segm1 and segm2 positions
118 float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
119 if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI;
120 if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI;
121 if(std::abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue;
122
123 // Extrapolate segm1 position to segm2's Z position
124 float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ);
125 Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ));
126
127 float extrPosRho = std::abs(extrPos.perp());
128 float extrPosThe = extrPos.theta();
129 float extrPosPhi = extrPos.phi();
130 if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe;
131 if(extrPosPhi<0)extrPosPhi+=2*M_PI;
132
133 // Get differences between extrapolated and segm2 positions
134 float dRho_Extr_Segm2 = extrPosRho-segm2PosRho;
135 float dPhi_Extr_Segm2 = extrPosPhi-segm2PosPhi;
136 float dThe_Extr_Segm2 = extrPosThe-segm2PosThe;
137 if(dPhi_Extr_Segm2<-M_PI)dPhi_Extr_Segm2+=2*M_PI;
138 if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI;
139
140 // Fill difference histograms
141 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][0]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][0]->Fill(dRho_Extr_Segm2);
142 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][2]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][2]->Fill(dPhi_Extr_Segm2);
143 if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]->Fill(dThe_Extr_Segm2);
144
145 // Cut segments (segm2) which are outside difference cuts
146 if(std::abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue;
147 if(std::abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue;
148
150 // Direction Cut
151 // Fill direction variables
152 //const Trk::GlobalDirection segm2Dir = segm2->globalDirection();
153 const Amg::Vector3D segm2Dir = segm2->globalDirection();
154
155 float segm2DirThe = segm2Dir.theta();
156 float segm2DirPhi = segm2Dir.phi();
157 if(segm2DirThe>M_PI/2) segm2DirThe=M_PI-segm2DirThe;
158 if(segm2DirPhi<0) segm2DirPhi+=2*M_PI;
159
160 // Vector Method
161 // Make vector between segment positions
162 //Trk::GlobalDirection segmVector;
163 Amg::Vector3D segmVector;
164
165 if(jMDT2>jMDT1)segmVector = segm2Pos-segm1Pos;
166 else segmVector = segm1Pos-segm2Pos;
167 float segmVecThe = segmVector.theta();
168 float segmVecPhi = segmVector.phi();
169 if(segmVecThe>M_PI/2) segmVecThe=M_PI-segmVecThe;
170 if(segmVecPhi<0) segmVecPhi+=2*M_PI;
171
172 // Get difference between vector direction and segment directions
173 float dThe_Vec_Segm1 = segmVecThe-segm1DirThe;
174 float dPhi_Vec_Segm1 = segmVecPhi-segm1DirPhi;
175 if(dPhi_Vec_Segm1<-M_PI)dPhi_Vec_Segm1+=2*M_PI;
176 if(dPhi_Vec_Segm1> M_PI)dPhi_Vec_Segm1-=2*M_PI;
177 float dThe_Vec_Segm2 = segmVecThe-segm2DirThe;
178 float dPhi_Vec_Segm2 = segmVecPhi-segm2DirPhi;
179 if(dPhi_Vec_Segm2<-M_PI)dPhi_Vec_Segm2+=2*M_PI;
180 if(dPhi_Vec_Segm2> M_PI)dPhi_Vec_Segm2-=2*M_PI;
181
182 // Fill histograms
183 if(jMDT1>jMDT2){
184 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][2][0]) m_mdt_trackchecksag[i][jMDT2][jMDT1][2][0]->Fill(dPhi_Vec_Segm2);
185 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][3][0]) m_mdt_trackchecksag[i][jMDT2][jMDT1][3][0]->Fill(dThe_Vec_Segm2);
186 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][2][1]) m_mdt_trackchecksag[i][jMDT2][jMDT1][2][1]->Fill(dPhi_Vec_Segm1);
187 if(m_mdt_trackchecksag[i][jMDT2][jMDT1][3][1]) m_mdt_trackchecksag[i][jMDT2][jMDT1][3][1]->Fill(dThe_Vec_Segm1);
188 }
189 else if(jMDT1<jMDT2){
190 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][2][0]) m_mdt_trackchecksag[i][jMDT1][jMDT2][2][0]->Fill(dPhi_Vec_Segm1);
191 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][3][0]) m_mdt_trackchecksag[i][jMDT1][jMDT2][3][0]->Fill(dThe_Vec_Segm1);
192 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][2][1]) m_mdt_trackchecksag[i][jMDT1][jMDT2][2][1]->Fill(dPhi_Vec_Segm2);
193 if(m_mdt_trackchecksag[i][jMDT1][jMDT2][3][1]) m_mdt_trackchecksag[i][jMDT1][jMDT2][3][1]->Fill(dThe_Vec_Segm2);
194 }
195
196 // Direction Comparison Method
197 float dTheDir_Segm1_Segm2 = segm1DirThe-segm2DirThe;
198 float dPhiDir_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
199 if(dPhiDir_Segm1_Segm2<-M_PI)dPhiDir_Segm1_Segm2+=2*M_PI;
200 if(dPhiDir_Segm1_Segm2> M_PI)dPhiDir_Segm1_Segm2-=2*M_PI;
201 if(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][2]) m_mdt_trackdirdirsag[i][jMDT1][jMDT2][2]->Fill(dTheDir_Segm1_Segm2);
202 if(m_mdt_trackdirdirsag[i][jMDT1][jMDT2][3]) m_mdt_trackdirdirsag[i][jMDT1][jMDT2][3]->Fill(dPhiDir_Segm1_Segm2);
203 // Cut using Vector Method
204 if(dPhi_Vec_Segm1>dPhiCutSegmentDirectionChecking[jMDT1][jMDT2] ||
205 dThe_Vec_Segm1>dTheCutSegmentDirectionChecking[jMDT1][jMDT2] ||
206 dPhi_Vec_Segm2>dPhiCutSegmentDirectionChecking[jMDT2][jMDT1] ||
207 dThe_Vec_Segm2>dTheCutSegmentDirectionChecking[jMDT2][jMDT1]) continue;
208
209 // Match is found, increment counter and assign segm2 to match found array
210 matchingSegments[jMDT2].push_back(segm2);
211 }// nSegms2
212
213 if(matchingSegments[jMDT2].size()==1){
214 stationMatchFound[jMDT2]=true;
215 nStationMatch++;
216 }
217 }// Reverse MDT Stations2
218
219 // If matches found add to matchedSegments and disqualify all segments in array
220 if(nStationMatch>1){
221 //HasMatchedTrack=true;
222 const Muon::MuonSegment *segmArray[4] = {nullptr,nullptr,nullptr,nullptr};
223 for(int jMDT2=0;jMDT2<4;jMDT2++){
224 if(stationMatchFound[jMDT2]){
225 segmArray[jMDT2]=matchingSegments[jMDT2].at(0);
226 //HasStationMatchSegm[jMDT2]=true;
227 disqualifiedSegments[i][jMDT2].push_back(matchingSegments[jMDT2].at(0));
228 }
229 }
230 SegmTrack newTrack(segmArray);
231 matchedSegments[i].push_back(newTrack);
232 }// If Matched Track Found
233
234 }// nSegms1
235 }// Reverse MDT Stations1
236
237 }// AC
238
239 return;
240}// End of function

◆ MidstationOnlyCheck()

void MdtVsTgcRawDataValAlg::MidstationOnlyCheck ( std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4],
std::vector< const Muon::MuonSegment * >(&) disqualifiedSegments[2][4],
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 33 of file MdtVsTgcRawData_MidstationMatching.cxx.

35 {
36 // Define Cuts:
37 // Cut for matching Segments
38 const float dRhoCutSegmentMatching = 1000;
39 const float dPhiCutSegmentMatching = M_PI/8;
40
41 // Cuts for number of Mdt Measurements required for Midstation only track
42 const int nMeasCutMdtMidstation = 5;
43 const int nMeasCutTGCMidPRD[2] = {2,2};
44
45 // Loose cut for PRD and Extrapolated
46 const float dPhiCut_Loose = M_PI/8;
47 // Cut for Global Position Efficiencies
48 const float dPhiCutGlobal[2] = {static_cast<float>(M_PI/24),static_cast<float>(M_PI/12)};//[WireStrip]
49 const float dRhoCutGlobal[2] = { 0.08, 0.5};//[WireStrip]
50 // Cut for Sector Efficiencies
51 const float dPhiCutSector[2] = { 0.2, 0.1};//[WireStrip]
52 const float dRhoCutSector[2] = { 300, 3000};//[WireStrip]
53 // Cut for TgcPrepData comparison
54 const float dPhiCutTPD[2] = { 0.15, 0.02};//[WireStrip]
55 const float dRhoCutTPD[2] = { 150, 3000};//[WireStrip]
56
57 // Loop over sides
58 for(int i=0;i<2;i++){// AC
59 // Number of Segments found which passed all cuts
60 int nValidatedSegm = 0;
61
62 // Following "Fill" variables are only used if one segment passed all cuts
63 // Flags for whether different stations can be checked by the segment
64 //bool canCheckGlobalFill[4] = {0, 0, 0, 0};
65 bool canCheckSectorFill[4] = {0, 0, 0, 0};
66 // Segment Global Position variables
67 // float posThetaFill = 0;
68 // float posPhiFill = 0;
69 // Segment Sector Position
70 int TGCstation_StationFEFill[4] = {-1,-1,-1,-1};// [TGCStation]
71 int TGCstation_StationEtaFill[4] = { 0, 0, 0, 0};// [TGCStation]
72 int TGCstation_StationPhiFill[4] = { 0, 0, 0, 0};// [TGCStation]
73 // Hit registered arrays
74 // bool hitregisteredFill[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
75 bool sectorhitregisteredFill[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
76
77 bool skipSegm;int nDisqualifiedSegm; // used when checking the disqualified list for a segment
78
79 // Make copy of disqualifiedSegment vector array
80 std::vector<const Muon::MuonSegment*> copyDisqualifiedSegments;
81 nDisqualifiedSegm=disqualifiedSegments[i][2].size();
82 copyDisqualifiedSegments.reserve(nDisqualifiedSegm);
83for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)copyDisqualifiedSegments.push_back(disqualifiedSegments[i][2].at(ndis));
84
86 // Apply preliminary nMdtMeas Cut
87 int nSegm = sortedSegments[i][2].size();
88 for(int n0=0; n0<nSegm;n0++){
89 // Get segment
90 const Muon::MuonSegment *segm0 = sortedSegments[i][2].at(n0);
91
92 // Check copyDisqualifiedSegments for current segment
93 skipSegm=false;
94 nDisqualifiedSegm=copyDisqualifiedSegments.size();
95 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm0==copyDisqualifiedSegments.at(ndis))skipSegm=true;
96 if(skipSegm)continue;
97
98 // Apply nMDTMeasurements Cut to Segment Collection
99 int stationName = 0;
100 int nMdtMeas = 0;
101 // Loop through contained ROTs and identify used stations
102 for(unsigned int iROT=0; iROT<segm0->numberOfContainedROTs(); ++iROT) {
103 const Trk::RIO_OnTrack* rio = segm0->rioOnTrack(iROT);
104 if(!rio) continue;
105 Identifier id = rio->identify();
106 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
107
108 if((stationName==17)||(stationName==18))nMdtMeas++;// MDT
109 }
110 // Cut Segments with insufficient numbers of hits in the stations
111 if(nMdtMeas<nMeasCutMdtMidstation){
112 copyDisqualifiedSegments.push_back(segm0);
113 }
114 }
115
116 // Loop over Segments in MidStation
117 for(int n1=0; n1<nSegm;n1++){
119 // Start operation on Segment
120 // Get segment
121 const Muon::MuonSegment *segm1 = sortedSegments[i][2].at(n1);
122
123 // Check copyDisqualifiedSegments for current segment
124 skipSegm=false;
125 nDisqualifiedSegm=copyDisqualifiedSegments.size();
126 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==copyDisqualifiedSegments.at(ndis))skipSegm=true;
127 if(skipSegm)continue;
128
129 // Flag for Grouping cut
130 bool failedGroupingCut = false;
131 // Flags for whether different stations can be checked by the segment
132 bool canCheckGlobal[4] = {true, true, true, false};
133 bool canCheckSector[4] = {true, true, true, false};
134
135 // Get position variables
136 //const Trk::GlobalPosition segm1Pos = segm1->globalPosition();
137 const Amg::Vector3D segm1Pos = segm1->globalPosition();
138
139 float segm1PosPhi = segm1Pos.phi();
140 float segm1PosThe = segm1Pos.theta();
141 float segm1PosZ = segm1Pos.z();
142 if(segm1PosPhi<0)segm1PosPhi+=2*M_PI;
143 if(segm1PosThe>M_PI/2) segm1PosThe=M_PI-segm1PosThe;
144 Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ));
145
146
148 // Apply nTGCStripMeasurements Cut to canCheck arrays
149 int stationName = 0;
150 int nTGCStrips[4] = { 0, 0, 0, 0};
151 // Loop through contained ROTs and identify used stations
152 for(unsigned int iROT=0; iROT<segm1->numberOfContainedROTs(); ++iROT){
153 const Trk::RIO_OnTrack* rio = segm1->rioOnTrack(iROT);
154 if(!rio) continue;
155 Identifier id = rio->identify();
156 stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
157 bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id);
158
159 if(((stationName==41)||(stationName==42))&&isStrip)nTGCStrips[0]++;// TGC
160 if(((stationName==43)||(stationName==44))&&isStrip)nTGCStrips[1]++;// TGC
161 if(((stationName==45)||(stationName==46))&&isStrip)nTGCStrips[2]++;// TGC
162 if(((stationName==47)||(stationName==48))&&isStrip)nTGCStrips[3]++;// TGC
163 }
164
165 // Don't check mid-stations when there are no strips in other mid-stations
166 if((nTGCStrips[1]==0)&&(nTGCStrips[2]==0)){canCheckSector[0]=false;canCheckGlobal[0]=false;}
167 if((nTGCStrips[0]==0)&&(nTGCStrips[2]==0)){canCheckSector[1]=false;canCheckGlobal[1]=false;}
168 if((nTGCStrips[0]==0)&&(nTGCStrips[1]==0)){canCheckSector[2]=false;canCheckGlobal[2]=false;}
169
170
172 // Do Grouping Cut
173 // Ignore any segments which are too close to any other segments not in the original disqualified list
174 for(int n2=0; n2<nSegm;n2++){
175 if(n1==n2)continue; // don't compare segment to itself
176 // Get segment
177 const Muon::MuonSegment *segm2 = sortedSegments[i][2].at(n2);
178
179 // Check disqualifiedSegments for current segment
180 skipSegm=false;
181 nDisqualifiedSegm=disqualifiedSegments[i][2].size();
182 for(int ndis=0;ndis<nDisqualifiedSegm;ndis++)if(segm1==disqualifiedSegments[i][2].at(ndis))skipSegm=true;
183 if(skipSegm)continue;
184
185 // Get position variables
186 const Amg::Vector3D segm2Pos = segm2->globalPosition();
187 float segm2PosRho = std::abs(segm2Pos.perp());
188 float segm2PosPhi = segm2Pos.phi();
189 float segm2PosZ = segm2Pos.z();
190 if(segm2PosPhi<0)segm2PosPhi+=2*M_PI;
191 Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ));
192
193 // Apply preliminary phi cut between segm1 and segm2 positions
194 float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi;
195 if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI;
196 if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI;
197 if(std::abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){
198 failedGroupingCut=true;
199 break;
200 }
201
202 // Extrapolate segm1 position to segm2's Z position
203 float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ);
204 Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ));
205 float extrPosRho = std::abs(extrPos.perp());
206 float extrPosThe = extrPos.theta();
207 float extrPosPhi = extrPos.phi();
208 if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe;
209 if(extrPosPhi<0)extrPosPhi+=2*M_PI;
210
211 // Get differences between extrapolated and segm2 positions
212 float dRho_Extr_Segm2 = extrPosRho-segm2PosRho;
213 float dPhi_Extr_Segm2 = extrPosPhi-segm2PosPhi;
214 if(dPhi_Extr_Segm2<-M_PI)dPhi_Extr_Segm2+=2*M_PI;
215 if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI;
216
217 // Cut segments (segm1) which are inside difference cuts
218 if((std::abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)||
219 (std::abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){
220 failedGroupingCut=true;
221 break;
222 }
223 }// nSegm2
224 if(failedGroupingCut)continue;
225
227 // Check track against TGC Sectors to find which it passes
228 // Initialize variables for TRE array search
229 int TGCStationNames[8] ={41, 42, 43, 44, 45, 46, 47, 48};
230 int TGCstation_StationFE[4] ={-1,-1,-1,-1};// [TGCStation]
231 int TGCstation_StationEta[4]={ 0, 0, 0, 0};// [TGCStation]
232 int TGCstation_StationPhi[4]={ 0, 0, 0, 0};// [TGCStation]
233 int nStationMatch[4] ={ 0, 0, 0, 0};// [TGCStation]
234
235 // Loop through TRE array, finding sectors which match the track in each layer
236 for(int stationnameindex=0; stationnameindex<6; stationnameindex++){// Station {T1F,T1E,T2F,T2E,T3F,T3E}
237 // Skip stations which don't have sufficient Segments to run efficiency check
238 int stationName = TGCStationNames[stationnameindex];
239 int stationIndex= TGCstationname2stationindex(stationName);
240
241 // Loop over StationEta&StationPhi
242 for(int stationeta=1; stationeta<=8; stationeta++){// AbsStationEta
243 for(int stationphi=1; stationphi<=48; stationphi++){// StationPhi
244 // Cut Station EtaPhi combinations with no TGC element
245 if(m_TREarray[stationnameindex][i][stationeta][stationphi]==nullptr)continue;
246 const MuonGM::TgcReadoutElement *tre=m_TREarray[stationnameindex][i][stationeta][stationphi];
247
248 // Extrapolate position from nearest Station's Segment to Sector's Z
249 float sectorZ=tre->globalPosition().z();
250 float dZ_sector=std::abs(sectorZ)-std::abs(segm1PosZ);
251 //Trk::GlobalPosition sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector);
252 Amg::Vector3D sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector);
253
254 // Convert extrapolated position to local position on the Sector
255 Identifier sector_id=tre->identify();
256 //const HepGeom::Point3D<double> sectorLocalPos3D=tre->globalToLocalCoords(sectorExtrapolatedPos, sector_id);
257 const Amg::Vector3D sectorLocalPos3D=tre->globalToLocalTransf(sector_id) * sectorExtrapolatedPos;
258 //Trk::LocalPosition sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
259 Amg::Vector2D sectorLocalPos2D(sectorLocalPos3D.y(),sectorLocalPos3D.z());
260
261 double avWidth = (tre->getLongSsize()+tre->getSsize())/2;
262 //double dWidth = (tre->longWidth()-tre->shortWidth());
263 double length = tre->length();
264
265 // Cut sectors which the track does not go through the central 80% of (avoids double counts)
266 double tol1=-0.1*(avWidth/2);
267 double tol2=-0.1*(length/2);
268
269 bool insideSectorBounds=tre->bounds().inside(sectorLocalPos2D,tol1,tol2);
270 if(!insideSectorBounds)continue;
271 // Assign values to matching station variables
272 if(stationIndex<0) continue;
273 TGCstation_StationFE[stationIndex]= (tre->isForward()==false);
274 TGCstation_StationEta[stationIndex]=stationeta;
275 TGCstation_StationPhi[stationIndex]=stationphi;
276 nStationMatch[stationIndex]++;
277 }// StationPhi
278 }// StationEta
279 }// StationName
280
281 // Don't check stations that don't have exactly 1 match for this track
282 for(int jTGC=0;jTGC<4;jTGC++){// TGC Station
283 if(nStationMatch[jTGC]==0){
284 canCheckSector[jTGC]=false;
285 }
286 else if(nStationMatch[jTGC]>1){
287 canCheckSector[jTGC]=false;
288 // Should be impossible, but happens due a problem with the bounds().inside function
289 // commenting out until this bug is resolved
290 //m_log << MSG::WARNING << "MidstationOnly: Number of matches for TGC" << jTGC+1 << " is " << nStationMatch[jTGC] << endl;
291 }
292 }// TGC Station
293
294 // Cut Segment if no stations can be checked
295 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
297 // Check which PRD matches Segm1
298 // Initialise hit registered arrays
299 bool sectorhitregistered[9][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}};
300 std::vector<const Muon::TgcPrepData*> tpdVector[2];
301
302 // Loop over TGC Prep Data container
303 Muon::TgcPrepDataContainer::const_iterator prepit_end=tgc_prepcontainer->end();
304 for( Muon::TgcPrepDataContainer::const_iterator prepit=tgc_prepcontainer->begin();
305 prepit!=prepit_end;
306 ++prepit){
307
308 //loop over TGC Prep Data collection
309 Muon::TgcPrepDataCollection::const_iterator prepitc_end=(*prepit)->end();
310 for( Muon::TgcPrepDataCollection::const_iterator prepitc=(*prepit)->begin();
311 prepitc!= prepitc_end;
312 ++prepitc){
313 // Get PRD and variables
314 const Muon::TgcPrepData* tpd=*prepitc;
315 const MuonGM::TgcReadoutElement *tre = tpd->detectorElement();
316 const std::string stationType = tre->getStationType();
317
318 // Get id values
319 Identifier tgcid=(*prepitc)->identify();
320 int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1
321 int tgcFE=(tre->isForward()==false);//isNotForward f:0, e:1
322 int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1
323 int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid);
324 int stationEta = std::abs(tre->getStationEta());
325 int stationPhi = tre->getStationPhi();
326 int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid);
327
328 // Cut hits except those from same side Midstation
329 if(tgcAC!=i) continue;
330 if(stationName>46 || stationName<41) continue;
331
332 // Get layer number and stationIndex
333 int layer = TGCgetlayer(stationName,gasGap);
334 int stationIndex = TGCstationname2stationindex(stationName);
335 if(stationIndex==3)continue;
336
337 // Get position variables
338 const Amg::Vector3D prdPos = tpd->globalPosition();
339 float tgcRho = std::abs(prdPos.perp());
340 float tgcPhi = prdPos.phi();
341 float tgcZ = prdPos.z();
342 if(tgcPhi<0)tgcPhi+=2*M_PI;
343
344 // Extrapolate Segm1 to PRD Z position
345 float dZ = std::abs(tgcZ) - std::abs(segm1PosZ);
346 Amg::Vector3D tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ));
347
348 // Get extrapolated variables
349 float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp());
350 float tgcExtrPhi = tgcExtrapolatedPos.phi();
351 if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI;
352
353 // Get differences between extrapolated and segm2 positions
354 float dRho = tgcRho-tgcExtrRho;
355 float dPhi = tgcPhi-tgcExtrPhi;
356 if(dPhi<-M_PI)dPhi+=2*M_PI;
357 if(dPhi> M_PI)dPhi-=2*M_PI;
358
359 // Pass through loose phi cut to eliminate some noise
360 if(std::abs(dPhi)<dPhiCut_Loose){
361 // Fill PRD sagitta histograms
362 if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho);
363 if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi);
364
365 // Do Global check
366 if(canCheckGlobal[stationIndex]){
367 float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho;
368 if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){
369 }
370 }// global
371
372 // Add PRD which matches Segm1 position to vector for further analysis
373 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
374 tpdVector[tgcWS].push_back(tpd);
375 }
376 // Do Sector Efficiency Check
377 if(canCheckSector[stationIndex]){
378 // Do check against PRD from matching Sectors
379 if((stationEta==TGCstation_StationEta[stationIndex])&&
380 (stationPhi==TGCstation_StationPhi[stationIndex])&&
381 (tgcFE==TGCstation_StationFE[stationIndex])){
382 // Do check
383 if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){
384 if(layer>=0)sectorhitregistered[layer][tgcWS]=true;// Sector hit
385 }
386 }
387 }// sector
388
389 }// dPhi Loose Cut
390 }// TGC PRD Collection
391 }// TGC PRD Container
392
393 // Cut Segment if no stations can be checked
394 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
396 // Do PRD checks
397 // Find vector of PRD which forms a coherent line in the vicinity of Segm1
398
399 // Variables to hold best PRD matching results
400 std::vector<const Muon::TgcPrepData*> *bestTPDmatches[2];
401 bestTPDmatches[0] = nullptr;
402 bestTPDmatches[1] = nullptr;
403 if(bestTPDmatches[0]->size()>0) bestTPDmatches[0]->clear();
404 if(bestTPDmatches[1]->size()>0) bestTPDmatches[1]->clear();
405 int bestTPDlayerMatches[2][9] = {{0,0,0,0,0,0,0,0,0},
406 {0,0,0,0,0,0,0,0,0}};
407
408 for(int k=0;k<2;k++){// WireStrip
409 // Variables to record quality of best match found
410 int nPRDMax = 0;
411 int nlayerMax = 0;
412
413 // Loop over PRD vector
414 int nTPD = tpdVector[k].size();
415 for(int iTPD1=0;iTPD1<nTPD;iTPD1++){
416 // Variables to hold matches found for this PRD
417 std::vector<const Muon::TgcPrepData*> thisTPDmatches;
418 int thisTPDlayerMatches[9] = {0,0,0,0,0,0,0,0,0};
419
420 // Get position variables
421 const Amg::Vector3D prdPos1 = tpdVector[k].at(iTPD1)->globalPosition();
422
423 float prd1Phi = prdPos1.phi();
424 float prd1Z = prdPos1.z();
425 if(prd1Phi<0)prd1Phi+=2*M_PI;
426 Amg::Vector3D prd1PosZunit(prdPos1/std::abs(prd1Z));
427
428 // Get id values
429 Identifier tgcid1=(tpdVector[k].at(iTPD1))->identify();
430 int stationName1 = m_idHelperSvc->tgcIdHelper().stationName(tgcid1);
431 int gasGap1 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid1);
432 int layer1 = TGCgetlayer(stationName1,gasGap1);
433 if(layer1>=0)thisTPDlayerMatches[layer1]++;
434
435 // Loop over PRD
436 for(int iTPD2=0;iTPD2<nTPD;iTPD2++){
437 if(iTPD2==iTPD1)continue;// do not check PRD against itself
438
439 // Get position variables
440 const Amg::Vector3D prdPos2 = tpdVector[k].at(iTPD2)->globalPosition();
441 float prd2Rho = std::abs(prdPos2.perp());
442 float prd2Phi = prdPos2.phi();
443 float prd2Z = prdPos2.z();
444 if(prd2Phi<0)prd2Phi+=2*M_PI;
445
446 // Extrapolate PRD1 to PRD2 Z position
447 float dZ = std::abs(prd2Z)- std::abs(prd1Z);
448 Amg::Vector3D prdExtrPos = ((prdPos1)+((prd1PosZunit)*dZ));
449
450 // Get extrapolated variables
451 float prdExtrRho = std::abs(prdExtrPos.perp());
452 float prdExtrPhi = prdExtrPos.phi();
453 if(prdExtrPhi<0)prdExtrPhi+=2*M_PI;
454
455 // Get differences between extrapolated and PRD2 positions
456 float dRho = prd2Rho-prdExtrRho;
457 float dPhi = prd2Phi-prdExtrPhi;
458 if(dPhi<-M_PI)dPhi+=2*M_PI;
459 if(dPhi> M_PI)dPhi-=2*M_PI;
460
461 // Fill PRD comparison sagitta histograms
462 if(m_tgc_prdcompsag[i][k][0]) m_tgc_prdcompsag[i][k][0]->Fill(dRho);
463 if(m_tgc_prdcompsag[i][k][2]) m_tgc_prdcompsag[i][k][2]->Fill(dPhi);
464
465 // Do check
466 if(std::abs(dPhi)<dPhiCutTPD[k] && std::abs(dRho)<dRhoCutTPD[k]){
467 // Get id values
468 Identifier tgcid2=(tpdVector[k].at(iTPD2))->identify();
469 int stationName2 = m_idHelperSvc->tgcIdHelper().stationName(tgcid2);
470 int gasGap2 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid2);
471 int layer2 = TGCgetlayer(stationName2,gasGap2);
472
473 // Add PRD2 to matches for PRD1
474 if(layer2>=0)thisTPDlayerMatches[layer2]++;
475 thisTPDmatches.push_back(tpdVector[k].at(iTPD2));
476 }
477 }// nTPD2
478
479 // Get quality of matching array produced
480 int nPRDCurrent = 0;
481 int nlayerCurrent = 0;
482 for(int l=0;l<9;l++){
483 if(thisTPDlayerMatches[l]>0)nlayerCurrent++;
484 nPRDCurrent+=thisTPDlayerMatches[l];
485 }
486
487 // Check quality variables against maximum found
488 if(nlayerMax <= nlayerCurrent){
489 if(nPRDMax < nPRDCurrent){
490 // Set maximum values to current segment's values
491 nlayerMax = nlayerCurrent;
492 nPRDMax = nPRDCurrent;
493 bestTPDmatches[k] = &thisTPDmatches;
494 for(int l=0;l<9;l++){
495 bestTPDlayerMatches[k][l] = thisTPDlayerMatches[l];
496 }
497 }
498 }
499 }// nTPD1
500
501 // If matching array was somehow empty (should be impossible)
502 if(nlayerMax==0)continue;
503 if(bestTPDmatches[k]->size()==0){
504 ATH_MSG_WARNING( "MidstationOnly: empty bestTPDmatches["<<k<<"] passed" );
505 continue;
506 }
507
508 // Set canCheck variables based on contents of matched PRD array
509 for(int jTGC1=0;jTGC1<3;jTGC1++){// TGC Stations
510 // Number of matched PRD found in other Stations
511 int nMatchOther = 0;
512 for(int l=0;l<9;l++){
513 int jTGC2 = TGClayer2stationindex(l);
514 if(jTGC1==jTGC2)continue;
515 nMatchOther+=bestTPDlayerMatches[k][l];
516 }
517
518 // Check against cut
519 if(nMatchOther<nMeasCutTGCMidPRD[k]){
520 canCheckGlobal[jTGC1]=false;
521 canCheckSector[jTGC1]=false;
522 }
523 }// TGC Stations
524 }// WireStrip
525
526 // Cut Segment if no stations can be checked
527 if((!canCheckGlobal[0])&&(!canCheckGlobal[1])&&(!canCheckGlobal[2])&&(!canCheckGlobal[3]))continue;
529 // Segment has passed all global cuts, fill histogram variables
530 // If no segments have already passed all cuts
531 if(nValidatedSegm==0){
532 for(int jTGC=0;jTGC<4;jTGC++){// TGC Stations
533 // Assign values of variables to fill histograms
534 // posThetaFill = segm1PosThe;
535 // posPhiFill = segm1PosPhi;
536
537 //canCheckGlobalFill[jTGC] = canCheckGlobal[jTGC];
538 canCheckSectorFill[jTGC] = canCheckSector[jTGC];
539
540 TGCstation_StationFEFill[jTGC] = TGCstation_StationFE[jTGC];
541 TGCstation_StationEtaFill[jTGC] = TGCstation_StationEta[jTGC];
542 TGCstation_StationPhiFill[jTGC] = TGCstation_StationPhi[jTGC];
543 }
544 for(int l=0;l<9;l++){
545 for(int k=0;k<2;k++){
546 sectorhitregisteredFill[l][k] = sectorhitregistered[l][k];
547 // hitregisteredFill[l][k] = hitregistered[l][k];
548 }
549 }
550 }// TGC Stations
551 nValidatedSegm++;
552 }// nSegm1
553
554 // If only one Segment was validated on this side
555 if(nValidatedSegm==1){
556 for(int l=0;l<9;l++){//Layer
557 int stationIndex = TGClayer2stationindex(l);
558 for(int k=0;k<2;k++){// WireStrip
559 // If this station can be checked
560 if(canCheckSectorFill[stationIndex]){
561 if((TGCstation_StationFEFill[stationIndex]<0)||(TGCstation_StationEtaFill[stationIndex]==0)||(TGCstation_StationPhiFill[stationIndex]==0)){
562 ATH_MSG_WARNING( "MidstationOnly: canCheckSector passed for jTGC=" << stationIndex
563 << " but, FE="<<TGCstation_StationFEFill[stationIndex]
564 << " Eta="<<TGCstation_StationEtaFill[stationIndex]
565 << " Phi=" << TGCstation_StationPhiFill[stationIndex] );
566 continue;
567 }
568 // Get Sector histogram indexes
569 int stationMap_EtaIndex=getStationMapIndex(1, l, TGCstation_StationFEFill[stationIndex], TGCstation_StationEtaFill[stationIndex], TGCstation_StationPhiFill[stationIndex]);
570 int stationMap_PhiIndex=getStationMapIndex(2, l, TGCstation_StationFEFill[stationIndex], TGCstation_StationEtaFill[stationIndex], TGCstation_StationPhiFill[stationIndex]);
571
572 // Fill Sector efficiency histograms
573 if(sectorhitregisteredFill[l][k]){// Hit in Sector matches extrapolated track
574 m_eff_stationmapmid[i][k][1]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
575 }
576 m_eff_stationmapmid[i][k][2]->Fill(stationMap_EtaIndex, stationMap_PhiIndex);
577 }
578 }// WireStrip
579 }// layer
580 }
581
582 }// AC
583
584}// End of Function

◆ MMTB_DEPRECATED() [1/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfEventsBlock )
inherited

◆ MMTB_DEPRECATED() [2/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfLowStat )
inherited

◆ MMTB_DEPRECATED() [3/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfLumiBlock )
inherited

◆ MMTB_DEPRECATED() [4/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( endOfRun )
inherited

◆ MMTB_DEPRECATED() [5/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newEventsBlock )
inherited

◆ MMTB_DEPRECATED() [6/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newHigStatInterval )
inherited

◆ MMTB_DEPRECATED() [7/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLowStat )
inherited

◆ MMTB_DEPRECATED() [8/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLowStatInterval )
inherited

◆ MMTB_DEPRECATED() [9/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newLumiBlock )
inherited

◆ MMTB_DEPRECATED() [10/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newMedStatInterval )
inherited

◆ MMTB_DEPRECATED() [11/11]

ManagedMonitorToolBase::MMTB_DEPRECATED ( newRun )
inherited

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ newEventsBlockFlag()

bool ManagedMonitorToolBase::newEventsBlockFlag ( ) const
inlineprotectedinherited

Definition at line 794 of file ManagedMonitorToolBase.h.

794{ return m_newEventsBlock; }

◆ newHigStatIntervalFlag()

bool ManagedMonitorToolBase::newHigStatIntervalFlag ( ) const
inlineprotectedinherited

Definition at line 790 of file ManagedMonitorToolBase.h.

790{ return m_newHigStatInterval; }

◆ newLowStatFlag()

bool ManagedMonitorToolBase::newLowStatFlag ( ) const
inlineprotectedinherited

Definition at line 791 of file ManagedMonitorToolBase.h.

791{ return m_newLowStat; }

◆ newLowStatIntervalFlag()

bool ManagedMonitorToolBase::newLowStatIntervalFlag ( ) const
inlineprotectedinherited

Flag functions allowing clients to determine when to book new and process old histograms; values are updated by fillHists() based on counting lumiBlocks, and are correctly set when fillHistograms(), bookHistograms() and procHistograms() are called.

Definition at line 788 of file ManagedMonitorToolBase.h.

788{ return m_newLowStatInterval; }

◆ newLumiBlockFlag()

bool ManagedMonitorToolBase::newLumiBlockFlag ( ) const
inlineprotectedinherited

Definition at line 792 of file ManagedMonitorToolBase.h.

792{ return m_newLumiBlock; }

◆ newMedStatIntervalFlag()

bool ManagedMonitorToolBase::newMedStatIntervalFlag ( ) const
inlineprotectedinherited

Definition at line 789 of file ManagedMonitorToolBase.h.

789{ return m_newMedStatInterval; }

◆ newRunFlag()

bool ManagedMonitorToolBase::newRunFlag ( ) const
inlineprotectedinherited

Definition at line 793 of file ManagedMonitorToolBase.h.

793{ return m_newRun; }

◆ numberOfSL()

int MdtVsTgcRawDataValAlg::numberOfSL ( const Muon::TgcCoinDataContainer * tgctrgcontainer)
private

Definition at line 83 of file MdtVsTgcRawData_functions.cxx.

83 {
84
85 int nSL=0;
86
87 //loop over TGC RoI container
88 Muon::TgcCoinDataContainer::const_iterator it_end=tgctrgcontainer->end();
89 for( Muon::TgcCoinDataContainer::const_iterator it=tgctrgcontainer->begin();
90 it!=it_end;
91 ++it){
92
93
94 ATH_MSG_DEBUG( "size of tgc collection is " << (*it) -> size() );
95
96 //loop over TGC RoI collection
98 for( Muon::TgcCoinDataCollection::const_iterator itc=(*it)->begin();
99 itc!= itc_end;
100 ++itc){
101
102 const Muon::TgcCoinData* tcd=*itc;
103
104 if( tcd->type() != Muon::TgcCoinData::TYPE_SL )continue;
105 ATH_MSG_DEBUG("pt"<<tcd->pt() );
106 nSL++;
107 }
108 }
109
110 return nSL;
111}
int pt() const
return pt threshold value

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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 ManagedMonitorToolBase::parseList ( const std::string & line,
std::vector< std::string > & result )
protectedinherited

Definition at line 2112 of file ManagedMonitorToolBase.cxx.

2113 {
2114 std::string item;
2115 std::stringstream ss(line);
2116
2117 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "ManagedMonitorToolBase::parseList:";
2118
2119 while ( std::getline(ss, item, ',') ) {
2120 std::stringstream iss(item); // remove
2121 iss >> item; // whitespace
2122 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " " << item;
2123 result.push_back(item);
2124 }
2125
2126 msg(MSG::DEBUG) << endmsg;
2127 return StatusCode::SUCCESS;
2128}
static Double_t ss
bool msgLvl(const MSG::Level lvl) const

◆ phi2sector()

int MdtVsTgcRawDataValAlg::phi2sector ( int phi,
int ef )
private

Definition at line 57 of file MdtVsTgcRawData_functions.cxx.

57 {
58 int sector=-1;
59 if(ef==0){//forward
60 sector=phi/2+1;//(phi,sector)= (1,1), (2,2), (3,2), (4,3)
61 }else{//endcap
62 sector=(phi+1)/4+1;//(phi,sector)= (1,1), (2,1), (3,2), (4,2)
63 }
64 if(sector>12)sector=1;
65
66 return sector;
67}
Scalar phi() const
phi method

◆ prepareTREarray()

void MdtVsTgcRawDataValAlg::prepareTREarray ( const MuonGM::MuonDetectorManager * MuonDetMgrDS)
private

Definition at line 85 of file MdtVsTgcRawData_TGCEffCheck.cxx.

85 {
86 int TGCStationNames[8]={41, 42, 43, 44, 45, 46, 47, 48};
87
88 // Make array of TGC Readout Element pointers
89 for(int stationNameIndex=0; stationNameIndex<8; stationNameIndex++){// Station Name
90 int stationName = TGCStationNames[stationNameIndex];
91 for(int stationEta=-8; stationEta<=8; stationEta++){// Station Eta
92 int tgcAC(stationEta<0);
93 int absStationEta = std::abs(stationEta);
94 for(int stationPhi=0; stationPhi<=48; stationPhi++){// Station Phi
95 // Exclude non-existent "zero" sectors included in the array for ease of use
96 if(stationEta==0){
97 m_TREarray[stationNameIndex][0][absStationEta][stationPhi]=nullptr;
98 m_TREarray[stationNameIndex][1][absStationEta][stationPhi]=nullptr;
99 continue;
100 }
101 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]=nullptr;
102 if(stationPhi==0)continue;
103
104 // Exclude sectors known not to exist
105 if(stationNameIndex==6){ // Inner Forward
106 if(std::abs(stationEta)>1)continue;
107 if(stationPhi>24)continue;
108 }
109 else if(stationNameIndex==7){ // Inner Endcap
110 if(std::abs(stationEta)>1)continue;
111 if(stationPhi>21)continue;
112 }
113 else if((stationNameIndex==0)|| // Midstation Forward
114 (stationNameIndex==2)||
115 (stationNameIndex==4)){
116 if(std::abs(stationEta)>1)continue;
117 if(stationPhi>24)continue;
118 }
119 else{ // Midstation Endcap
120 if(std::abs(stationEta)>5)continue;
121 if((stationNameIndex==1)&&
122 (std::abs(stationEta)>4))continue;
123 }
124
125 // Get identifier of TRE at this set of indexes
126 bool isValid{false};
127 Identifier tgc_testId = m_idHelperSvc->tgcIdHelper().elementID(stationName, stationEta, stationPhi, isValid);
128 if(!isValid){continue;}
129
130 // Get TRE and put into to array
131 m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi] = MuonDetMgrDS->getTgcReadoutElement(tgc_testId);
132 if(m_TREarray[stationNameIndex][tgcAC][absStationEta][stationPhi]==nullptr){
133 ATH_MSG_WARNING( "prepareTREarray: TgcReadoutElement==0 passed checks" );
134 continue;
135 }
136 }// Station Phi
137 }// Station Eta
138 }// Station Name
139 return;
140}// End of function

◆ preSelector()

bool ManagedMonitorToolBase::preSelector ( )
virtualinherited

Implements IMonitorToolBase.

Definition at line 1680 of file ManagedMonitorToolBase.cxx.

1682{
1683 if( m_preScaleProp > 1 ) {
1684 return ( (m_nEvents % m_preScaleProp) == 1 );
1685 }
1686 return true;
1687}

◆ procHistograms()

StatusCode MdtVsTgcRawDataValAlg::procHistograms ( )
virtual

An inheriting class should either override this function or finalHists().

Reimplemented from ManagedMonitorToolBase.

Definition at line 185 of file MdtVsTgcRawDataValAlg.cxx.

185 {
186/*----------------------------------------------------------------------------------*/
187
188 ATH_MSG_DEBUG( "MdtVsTgcRawDataValAlg finalize()" );
189 if(endOfRunFlag()){
192 }
193 return StatusCode::SUCCESS;
194}

◆ putBox()

void MdtVsTgcRawDataValAlg::putBox ( TH2 * h2,
float x1,
float y1,
float x2,
float y2 )
private

Definition at line 129 of file MdtVsTgcRawData_functions.cxx.

129 {
130 TBox* box = new TBox(x1, y1, x2, y2);
131// box->SetFillColor(kGray+1);
132// box->SetLineColor(kGray+1);
133// box->SetFillStyle(3013);
134// box->SetFillStyle(3004);
135
136 box->SetFillColor(kGray);
137 box->SetLineColor(kGray);
138
139// box->SetLineStyle(3);
140
141 (h->GetListOfFunctions())->Add(box);
142}

◆ regEfficiency()

StatusCode ManagedMonitorToolBase::regEfficiency ( TEfficiency * e,
const MonGroup & group )
virtualinherited

Registers a TEfficiency to be included in the output stream using logical parameters that describe the plot.

Definition at line 1445 of file ManagedMonitorToolBase.cxx.

1445 {
1446 if (!e)
1447 return StatusCode::FAILURE;
1448
1449 TGraph* g = reinterpret_cast<TGraph*>(e);
1450 std::string name = e->GetName();
1451
1452 // MANAGED
1453 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1454 // warn about not using merge algorithms
1455 if (group.histo_mgmt() == ATTRIB_X_VS_LB && group.merge().empty()) {
1456 ATH_MSG_WARNING("HEY! Attempting to register "<<name<<" as a per-LB histogram, but not setting the merge algorithm! Use \"merge\", at least.");
1457 }
1458 // add the efficiency to rebooking vector
1459 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1460 m_templateEfficiencies[group.interval()].push_back( MgmtParams<TEfficiency>(e, group) );
1461 } else {
1462 ATH_MSG_ERROR("Attempt to book managed graph " << name << " with invalid interval type " << intervalEnumToString(group.interval()));
1463 return StatusCode::FAILURE;
1464 }
1465
1466 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1467 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1468 registerMetadata(streamName, name, group).ignore();
1469 return m_THistSvc->regGraph( streamName, g );
1470 } else {
1471 // UNMANAGED
1472 if( m_manager != 0 ) {
1473 std::string genericName = NoOutputStream().getStreamName( this, group, name );
1474 m_manager->writeAndDelete( genericName );
1475 m_manager->passOwnership( e, genericName );
1476 }
1477
1478 std::string streamName = streamNameFunction()->getStreamName( this, group, name, false );
1479 StatusCode smd = registerMetadata(streamName, name, group);
1480 if (smd != StatusCode::SUCCESS)
1481 return StatusCode::FAILURE;
1482
1483 return m_THistSvc->regGraph( streamName, g );
1484 }
1485}
virtual std::string getStreamName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)
A function that converts a MonGroup of logical parameters into a physical output stream name.
std::set< Interval_t > m_supportedIntervalsForRebooking
StatusCode registerMetadata(const std::string &streamName, const std::string &hName, const MonGroup &group)
static std::string intervalEnumToString(Interval_t interval)
Converts a LevelOfDetail_t to a string of the same name.

◆ regGraph() [1/2]

StatusCode ManagedMonitorToolBase::regGraph ( TGraph * g,
const MonGroup & group )
virtualinherited

Registers a TGraph to be included in the output stream using logical parameters that describe the graph.

Definition at line 1499 of file ManagedMonitorToolBase.cxx.

1501{
1502 if (!g)
1503 return StatusCode::FAILURE;
1504
1505 // This part of the code deals with MANAGED type
1506 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1507 // Create an unmanaged group based on the original MonGroup instance passed
1508 // This is needed because managed graph is presented as a number of unmanaged
1509 // graphs (one per each interval)
1510 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1511
1512 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1513 m_templateGraphs[group.interval()].push_back( MgmtParams<TGraph>(g, group_unmanaged) );
1514 } else {
1515 ATH_MSG_ERROR("Attempt to book managed graph " << g->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1516 return StatusCode::FAILURE;
1517 }
1518
1519 std::string name = g->GetName();
1520 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1521 registerMetadata(streamName, name, group).ignore();
1522 return m_THistSvc->regGraph( streamName, g );
1523 //return m_THistSvc->regGraph( streamName );
1524 }
1525
1526 // This part of the code deals with UNMANAGED type
1527 std::string gName = g->GetName();
1528
1529 if( m_manager != 0 ) {
1530 std::string genericName = NoOutputStream().getStreamName( this, group, gName );
1531 m_manager->writeAndDelete( genericName );
1532 m_manager->passOwnership( g, genericName );
1533 }
1534
1535 std::string streamName = streamNameFunction()->getStreamName( this, group, gName, false );
1536
1537 StatusCode smd = registerMetadata(streamName, gName, group);
1538 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1539
1540 return m_THistSvc->regGraph( streamName, g );
1541}

◆ regGraph() [2/2]

StatusCode ManagedMonitorToolBase::regGraph ( TGraph * g,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TGraph to be included in the output stream using logical parameters that describe the graph.

Definition at line 1489 of file ManagedMonitorToolBase.cxx.

1492{
1493 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1494 return regGraph( g, group );
1495}
virtual StatusCode regGraph(TGraph *g, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TGraph to be included in the output stream using logical parameters that describe the gra...

◆ regHist() [1/2]

StatusCode ManagedMonitorToolBase::regHist ( TH1 * h,
const MonGroup & group )
virtualinherited

Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.

A histogram is passed via reference to a pointer.

Definition at line 1353 of file ManagedMonitorToolBase.cxx.

1355{
1356// ManagedMonitorToolBase_addHistStatistics(this,h);
1357
1358 if (!h)
1359 return StatusCode::FAILURE;
1360
1361 // This part of the code deals with MANAGED type
1362 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1363 /*
1364 Create an unmanaged group based on the original MonGroup instance passed
1365 It is needed because managed histogram is presented as a number of unmanaged
1366 histograms (one per each interval)
1367 Update (PUEO) - I don't think it actually matters, and need to keep
1368 track of "proper" attribute for X_VS_LB
1369 */
1370
1371 if (group.histo_mgmt() == ATTRIB_X_VS_LB && group.merge().empty()) {
1372 ATH_MSG_WARNING("HEY! You're attempting to register " << h->GetName() << " as a per-LB histogram, but you're not setting the merge algorithm! This is a SUPER-BAD idea! Use \"merge\", at least.");
1373 }
1374
1375 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1376 m_templateHistograms[group.interval()].push_back( MgmtParams<TH1>(h, group) );
1377 } else {
1378 ATH_MSG_ERROR("Attempt to book managed histogram " << h->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1379 return StatusCode::FAILURE;
1380 }
1381
1382 std::string hName = h->GetName();
1383 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1384 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, hName, false );
1385 registerMetadata(streamName, hName, group).ignore();
1386 return m_THistSvc->regHist( streamName, h );
1387 }
1388
1389 // This part of the code deals with UNMANAGED type
1390 std::string hName = h->GetName();
1391
1392 if( m_manager != 0 ) {
1393 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1394 m_manager->writeAndDelete( genericName );
1395 m_manager->passOwnership( h, genericName );
1396 }
1397
1398 std::string streamName = streamNameFunction()->getStreamName( this, group, hName, false );
1399
1400 StatusCode smd = registerMetadata(streamName, hName, group);
1401 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1402
1403 return m_THistSvc->regHist( streamName, h );
1404}

◆ regHist() [2/2]

StatusCode ManagedMonitorToolBase::regHist ( TH1 * h,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical parameters that describe the histogram.

Definition at line 1344 of file ManagedMonitorToolBase.cxx.

1347{
1348 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1349 return regHist( h, group );
1350}
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...

◆ registerMetadata()

StatusCode ManagedMonitorToolBase::registerMetadata ( const std::string & streamName,
const std::string & hName,
const MonGroup & group )
protectedinherited

Definition at line 946 of file ManagedMonitorToolBase.cxx.

948 {
950 TTree* metadata(0);
951 std::string mdStreamName( streamName );
952 size_t found=mdStreamName.rfind('/');
953
954 if ( found != std::string::npos )
955 mdStreamName.replace( found, mdStreamName.length(), "/metadata" );
956
957 MDMap_t::iterator i = m_metadataMap.find( mdStreamName );
958 if( i == m_metadataMap.end() ) {
959 metadata = new TTree( "metadata", "Monitoring Metadata" );
960 if (! metadata) return StatusCode::FAILURE;
961 StatusCode scmd = m_THistSvc->regTree( mdStreamName, metadata );
962 if (scmd == StatusCode::FAILURE) return StatusCode::FAILURE;
963 i = m_metadataMap.emplace( mdStreamName, new OutputMetadata(metadata) ).first;
964 }
965
966 i->second->fill( hName, group.interval(), group.chain(), group.merge() );
967 }
968 return StatusCode::SUCCESS;
969}

◆ regManagedEfficiencies()

StatusCode ManagedMonitorToolBase::regManagedEfficiencies ( std::vector< MgmtParams< TEfficiency > > & templateEfficiencies)
protectedinherited

Definition at line 1140 of file ManagedMonitorToolBase.cxx.

1140 {
1141 bool allIsOk = true;
1142 for( auto& it : templateEfficiencies ) {
1143 // get components of MgmtParams and copy efficiency
1144 MonGroup group = it.m_group;
1145 TEfficiency* theEfficiency = it.m_templateHist;
1146 TEfficiency* e = static_cast<TEfficiency*>(theEfficiency->Clone());
1147 int nbins = theEfficiency->GetTotalHistogram()->GetNbinsX();
1148 int xlow = theEfficiency->GetTotalHistogram()->GetXaxis()->GetXmin();
1149 int xhigh = theEfficiency->GetTotalHistogram()->GetXaxis()->GetXmax();
1150 e->SetBins(nbins,xlow,xhigh); // reset histogram
1151 std::string name = e->GetName();
1152
1153 // make TGraph casts of TEfficiencies
1154 TGraph* theGraph = reinterpret_cast<TGraph*>(theEfficiency);
1155 TGraph* g = reinterpret_cast<TGraph*>(e);
1156
1157 // Get the streamName for the previous interval
1158 std::string streamName = streamNameFunction()->getStreamName( this, group, name, true );
1159
1160 // RE-REGISTER
1161 // 1) De-register the original graph with the THistSvc
1162 StatusCode sc1 = m_THistSvc->deReg( theGraph );
1163 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1164 // 2) Fix THistSvc->deReg for TGraphs
1165 bool doneCleaning = false;
1166 std::string directoryName = streamNameFunction()->getDirectoryName( this, group, name, true );
1167 TSeqCollection *filelist=gROOT->GetListOfFiles();
1168 for (int i=0; i<filelist->GetEntries(); i++) {
1169 ATH_MSG_DEBUG( "List of files: " << filelist->At(i)->GetName());
1170 TFile* file = static_cast<TFile*>(filelist->At(i));
1171 StatusCode sc2 = THistSvc_deReg_fixTGraph(file, theGraph, directoryName);
1172 if (sc2 == StatusCode::SUCCESS) doneCleaning = true;
1173 }
1174 // 3) Check if TGraph fix has been applied successfully
1175 if (!doneCleaning) {
1176 ATH_MSG_ERROR("THistSvc_deReg_fixTGraph: failed to apply TGraph fix for the THist Svc!");
1177 allIsOk = false;
1178 }
1179 // 4) Register cloned histogram under previous interval streamName
1180 StatusCode sc3 = m_THistSvc->regGraph( streamName, g );
1181 if (sc3 == StatusCode::FAILURE)
1182 allIsOk = false;
1183
1184 // get streamname for interval
1185 streamName = streamNameFunction()->getStreamName( this, group, name, false );
1186 // store metadata
1187 StatusCode smd = registerMetadata(streamName, name, group);
1188 if (smd != StatusCode::SUCCESS) allIsOk = false;
1189 // Re-register the original graph
1190 StatusCode sc4 = m_THistSvc->regGraph( streamName, theGraph );
1191 if (sc4 == StatusCode::FAILURE) allIsOk = false;
1192 }
1193
1194 if (!allIsOk) return StatusCode::FAILURE;
1195 return StatusCode::SUCCESS;
1196}
virtual std::string getDirectoryName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, const bool usePreviousInterval)=0
A function that returns TDirectory path in a file that corresponds to a given MonGroup and object nam...
StatusCode THistSvc_deReg_fixTGraph(TFile *file, TGraph *theGraph, std::string &directoryName)
Fixes THistSvc->deReg(obj) when obj is TGraph instance.
filelist
print ("Checking files %s..." % fullfile)
Definition envutil.py:133

◆ regManagedGraphs()

StatusCode ManagedMonitorToolBase::regManagedGraphs ( std::vector< MgmtParams< TGraph > > & templateGraphs)
protectedinherited

Definition at line 1069 of file ManagedMonitorToolBase.cxx.

1071{
1072 // See the description for the regManagedHistograms method
1073 bool allIsOk = true;
1074
1075 for( std::vector< MgmtParams<TGraph> >::iterator it = templateGraphs.begin(); it != templateGraphs.end(); ++it ) {
1076 MonGroup group = (*it).m_group;
1077
1078 // Get a handle to the graph
1079 TGraph* theGraph = (*it).m_templateHist;
1080
1081 // Clone the graph
1082 TGraph* g = static_cast<TGraph*>(theGraph->Clone());
1083 theGraph->Set(0); // equivalent to Reset() for TH1
1084
1085 // Get name
1086 std::string gName = g->GetName();
1087
1088 // Get the streamName for the previous interval
1089 std::string streamName = streamNameFunction()->getStreamName( this, group, gName, true );
1090
1091 // De-register the original graph with the THistSvc
1092 StatusCode sc1 = m_THistSvc->deReg( theGraph );
1093 if (sc1 == StatusCode::FAILURE)
1094 allIsOk = false;
1095
1096 // *** begin ***
1097 // Fix THistSvc->deReg for TGraphs
1098 bool doneCleaning = false;
1099 std::string directoryName = streamNameFunction()->getDirectoryName( this, group, gName, true );
1100 TSeqCollection *filelist=gROOT->GetListOfFiles();
1101 for (int i=0; i<filelist->GetEntries(); i++) {
1102 ATH_MSG_DEBUG( "List of files: " << filelist->At(i)->GetName());
1103 TFile* file = static_cast<TFile*>(filelist->At(i));
1104 StatusCode sc2 = THistSvc_deReg_fixTGraph(file, theGraph, directoryName);
1105 if (sc2 == StatusCode::SUCCESS)
1106 doneCleaning = true;
1107 }
1108
1109 // Check if TGraph fix has been applied successfully
1110 if (!doneCleaning) {
1111 ATH_MSG_ERROR("THistSvc_deReg_fixTGraph: failed to apply TGraph fix for the THist Svc!");
1112 allIsOk = false;
1113 }
1114 // *** end ***
1115
1116 // Register clonned histogram under previous interval streamName
1117 StatusCode sc3 = m_THistSvc->regGraph( streamName, g );
1118 if (sc3 == StatusCode::FAILURE)
1119 allIsOk = false;
1120
1121 // Get streamName for the current interval
1122 streamName = streamNameFunction()->getStreamName( this, group, gName, false );
1123 // Register metadata information with the current interval streamname
1124 StatusCode smd = registerMetadata(streamName, gName, group);
1125 if (smd != StatusCode::SUCCESS)
1126 allIsOk = false;
1127
1128 // Re-register the original graph with the current interval streamName
1129 StatusCode sc4 = m_THistSvc->regGraph( streamName, theGraph );
1130 if (sc4 == StatusCode::FAILURE)
1131 allIsOk = false;
1132
1133 }
1134
1135 if (!allIsOk) return StatusCode::FAILURE;
1136
1137 return StatusCode::SUCCESS;
1138}

◆ regManagedHistograms()

StatusCode ManagedMonitorToolBase::regManagedHistograms ( std::vector< MgmtParams< TH1 > > & templateHistograms)
protectedinherited

Definition at line 972 of file ManagedMonitorToolBase.cxx.

974{
975 // The method registers histograms with the THistSvc and saves them to file.
976
977 // The funky business with registering and deregistering the histogram is needed
978 // to get the correct directory when saving histograms. THistSvc deals with ROOT
979 // to set up proper TDirectory, so we rely on it.
980 // E.g.
981 // m_THistSvc->regHist( streamName, h ): sets the correct TDirectory with streamName
982 // m_THistSvc->deReg( h ) - deregister from THistSvc otherwise THistSvc will try to save it
983 // at the end of execution
984 // use passownership of the histogram and save it to file
985 // m_manager->passOwnership( h, genericName );
986 // m_manager->writeAndDelete( genericName );
987 bool allIsOk = true;
988
989 for( std::vector< MgmtParams<TH1> >::iterator it = templateHistograms.begin(); it != templateHistograms.end(); ++it ) {
990 MonGroup& group = (*it).m_group;
991
992 // Get a handle to the histogram
993 TH1* theHist = (*it).m_templateHist;
994
995 // Clone the histogram
996 TH1* h = static_cast<TH1*>(theHist->Clone());
997 theHist->Reset();
998
999 // Get name
1000 std::string hName = h->GetName();
1001
1002 // Get the streamName for the previous interval
1003 std::string streamName = streamNameFunction()->getStreamName( this, group, hName, true );
1004
1005 // Register the histogram with the THistSvc
1006 StatusCode sc1 = m_THistSvc->deReg( theHist );
1007 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1008
1009 // Register clonned histogram under previous interval streamName
1010 StatusCode sc2 = m_THistSvc->regHist( streamName, h );
1011 if (sc2 == StatusCode::FAILURE) allIsOk = false;
1012
1013 if( m_manager != 0 ) {
1014 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1015 m_manager->passOwnership( h, genericName );
1016 m_manager->writeAndDelete( genericName );
1017 }
1018
1019 // Get streamName for the current interval
1020 streamName = streamNameFunction()->getStreamName( this, group, hName, false );
1021 // Register metadata information with the current interval streamname
1022 StatusCode smd = registerMetadata(streamName, hName, group);
1023 if (smd != StatusCode::SUCCESS) allIsOk = false;
1024
1025 // Re-register the original histogram with the current interval streamName
1026 StatusCode sc3 = m_THistSvc->regHist( streamName, theHist );
1027 if (sc3 == StatusCode::FAILURE) allIsOk = false;
1028
1029 }
1030
1031 if (!allIsOk) return StatusCode::FAILURE;
1032
1033 return StatusCode::SUCCESS;
1034}

◆ regManagedTrees()

StatusCode ManagedMonitorToolBase::regManagedTrees ( std::vector< MgmtParams< TTree > > & templateTrees)
protectedinherited

Definition at line 1200 of file ManagedMonitorToolBase.cxx.

1202{
1203 // See the description for the regManagedHistograms method
1204 bool allIsOk = true;
1205
1206 for( std::vector< MgmtParams<TTree> >::iterator it = templateTrees.begin(); it != templateTrees.end(); ++it ) {
1207 MonGroup group = (*it).m_group;
1208
1209 // Get a handle to the original tree
1210 TTree* theTree = (*it).m_templateHist;
1211
1212 // Clone the tree
1213 TTree* t = static_cast<TTree*>(theTree->Clone());
1214 theTree->Reset();
1215
1216 // Dumping the tree
1217 std::string name = t->GetName();
1218
1219 // Get the streamName for the previous interval
1220 std::string streamName = streamNameFunction()->getStreamName( this, group, name, true );
1221
1222 // De-register original tree with the THistSvc
1223 StatusCode sc1 = m_THistSvc->deReg( theTree );
1224 if (sc1 == StatusCode::FAILURE) allIsOk = false;
1225
1226 // Register clonned tree under previous interval streamName
1227 StatusCode sc2 = m_THistSvc->regTree( streamName, t );
1228 if (sc2 == StatusCode::FAILURE) allIsOk = false;
1229
1230 if( m_manager != 0 ) {
1231 std::string genericName = NoOutputStream().getStreamName( this, group, name );
1232 m_manager->passOwnership( t, genericName );
1233 m_manager->writeAndDelete( genericName );
1234 }
1235
1236 // Get streamName for the current interval
1237 streamName = streamNameFunction()->getStreamName( this, group, name, false );
1238 // Register metadata information with the current interval streamname
1239 StatusCode smd = registerMetadata(streamName, name, group);
1240 if (smd != StatusCode::SUCCESS) allIsOk = false;
1241
1242 // Re-register the original graph with the current interval streamName
1243 StatusCode sc3 = m_THistSvc->regTree( streamName, theTree );
1244 if (sc3 == StatusCode::FAILURE) allIsOk = false;
1245
1246 }
1247
1248 if (!allIsOk) return StatusCode::FAILURE;
1249
1250 return StatusCode::SUCCESS;
1251}

◆ regTree() [1/2]

StatusCode ManagedMonitorToolBase::regTree ( TTree * t,
const MonGroup & group )
virtualinherited

Registers a TTree to be included in the output stream using logical parameters that describe it.

Definition at line 1555 of file ManagedMonitorToolBase.cxx.

1557{
1558
1559 // This part of the code deals with MANAGED type
1560 if ( group.histo_mgmt() != ATTRIB_UNMANAGED ) {
1561 // Create an unmanaged group based on the original MonGroup instance passed
1562 // This is needed because managed tree is presented as a number of unmanaged
1563 // trees (one per each interval)
1564 MonGroup group_unmanaged( this, group.system(), group.interval(), ATTRIB_UNMANAGED, group.chain(), group.merge());
1565
1566 if (m_supportedIntervalsForRebooking.count(group.interval())) {
1567 m_templateTrees[group.interval()].push_back( MgmtParams<TTree>(t, group_unmanaged) );
1568 } else {
1569 ATH_MSG_ERROR("Attempt to book managed tree " << t->GetName() << " with invalid interval type " << intervalEnumToString(group.interval()));
1570 return StatusCode::FAILURE;
1571 }
1572
1573 std::string name = t->GetName();
1574 std::string genericName = NoOutputStream().getStreamName( this, group_unmanaged, name );
1575 std::string streamName = streamNameFunction()->getStreamName( this, group_unmanaged, name, false );
1576 registerMetadata(streamName, name, group).ignore();
1577 return m_THistSvc->regTree( streamName, t );
1578 }
1579
1580
1581 // This part of the code deals with UNMANAGED type
1582 std::string tName = t->GetName();
1583
1584 if( m_manager != 0 ) {
1585 std::string genericName = NoOutputStream().getStreamName( this, group, tName );
1586 m_manager->writeAndDelete( genericName );
1587 m_manager->passOwnership( t, genericName );
1588 }
1589
1590 std::string streamName = streamNameFunction()->getStreamName( this, group, tName, false );
1591
1592 StatusCode smd = registerMetadata(streamName, tName, group);
1593 if (smd != StatusCode::SUCCESS) return StatusCode::FAILURE;
1594
1595 return m_THistSvc->regTree( streamName, t );
1596}

◆ regTree() [2/2]

StatusCode ManagedMonitorToolBase::regTree ( TTree * t,
const std::string & system,
Interval_t interval,
MgmtAttr_t histo_mgmt = ATTRIB_MANAGED,
const std::string & chain = "",
const std::string & merge = "" )
virtualinherited

Registers a TTree to be included in the output stream using logical parameters that describe it.

Definition at line 1545 of file ManagedMonitorToolBase.cxx.

1548{
1549 MonGroup group( this, system, interval, histo_mgmt, chain, merge );
1550 return regTree( t, group );
1551}
virtual StatusCode regTree(TTree *t, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TTree to be included in the output stream using logical parameters that describe it.

◆ 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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ roi2etaphi()

void MdtVsTgcRawDataValAlg::roi2etaphi ( const Muon::TgcCoinData & cd,
int & eta,
int & phi )
private

Definition at line 28 of file MdtVsTgcRawData_functions.cxx.

28 {
29
30 int roiphi=cd.phi();//phi in 1/48(24) sector for endcap(forward)
31 int roi=cd.roi();//0-147(0-63)
32
33 //int localeta=roi/4;
34
35 if(cd.isForward()){//forward
36
37 int localphi=roi%4;
38
39 //eta=roi/4;
40 eta=roi/4+36;
41 phi=(localphi+roiphi*4)*2;
42
43 }else{//endcap
44
45 int sector=phi2sector(roiphi,1);
46
47 phi=roiphi*4 + ( sector%2==0 ? roi%4 : 3-(roi%4) );
48 eta=roi/4;
49 }
50
51 //eta=52-eta;
52 return;
53
54}
Scalar eta() const
pseudorapidity method

◆ roiphi2mdtSector()

int MdtVsTgcRawDataValAlg::roiphi2mdtSector ( int roiphi,
int ef )
private

Definition at line 70 of file MdtVsTgcRawData_functions.cxx.

70 {
71 int mdtSector=-1;
72 if(ef==0){//forward phi1-24
73 mdtSector=roiphi/2+1;//(phi,sector)= (1,1), (2,2), (3,2), (4,3)
74 }else{//endcap
75 mdtSector=(roiphi+1)/4+1;//(phi,sector)= (1,1), (2,1), (3,2), (4,2)
76 }
77 if(mdtSector>8)mdtSector=1;
78
79 return mdtSector;
80}

◆ roitotalphi2sectorphi()

int MdtVsTgcRawDataValAlg::roitotalphi2sectorphi ( int phi)
private

◆ runStat()

StatusCode ManagedMonitorToolBase::runStat ( )
virtualinherited

This implementation does nothing; equivalent functionality may be provided by procHists( true, true, true ).

Implements IMonitorToolBase.

Definition at line 1662 of file ManagedMonitorToolBase.cxx.

1664{
1665 return StatusCode::SUCCESS;
1666}

◆ setMonManager()

void ManagedMonitorToolBase::setMonManager ( AthenaMonManager * manager)
virtualinherited

Takes a pointer to a managing object to get information from it when needed.

Definition at line 1326 of file ManagedMonitorToolBase.cxx.

1328{
1329 ATH_MSG_DEBUG( "ManagedMonitorToolBase::setMonManager():");
1331 if( m_manager != 0 ) {
1332 ATH_MSG_DEBUG( " --> Setting manager");
1333 m_managerNameProp = m_manager->name();
1334 m_fileKey = m_manager->fileKey();
1335 m_dataType = m_manager->dataType();
1336 m_environment = m_manager->environment();
1337 delete m_streamNameFcn;
1339 }
1340 ATH_MSG_DEBUG( " --> Exiting successfully");
1341}
virtual StreamNameFcn * getNewStreamNameFcn() const

◆ setupOutputStreams()

StatusCode ManagedMonitorToolBase::setupOutputStreams ( std::vector< std::string > Mapping = std::vector<std::string>())
virtualinherited

This implementation does nothing—streams in this class should be managed by the AthenaMonManager.

Consider using MonitorToolBase for user-managed streams.

Implements IMonitorToolBase.

Definition at line 1651 of file ManagedMonitorToolBase.cxx.

1653{
1654 // All instances should write to the stream(s) defined by the
1655 // AthenaMonManager.
1656
1657 return StatusCode::SUCCESS;
1658}

◆ SortMDTSegments()

void MdtVsTgcRawDataValAlg::SortMDTSegments ( const xAOD::MuonSegmentContainer * m_newsegment,
std::vector< const Muon::MuonSegment * >(&) sortedSegments[2][4] )
private

Definition at line 28 of file MdtVsTgcRawData_SegmSorting.cxx.

29 {
30
31 // Loop over all segments in event
32 xAOD::MuonSegmentContainer::const_iterator mdtseg_itr = newsegment->begin();
33 xAOD::MuonSegmentContainer::const_iterator mdtseg_end = newsegment->end();
34 for(; mdtseg_itr!=mdtseg_end; ++mdtseg_itr){
35 if(!(*mdtseg_itr)->muonSegment().isValid())continue;
36 // Get segm
37 const Muon::MuonSegment* segm = dynamic_cast<const Muon::MuonSegment*>(*(*mdtseg_itr)->muonSegment());
38 if (segm == nullptr) {
39 ATH_MSG_ERROR( "no pointer to segm!!!" );
40 break;
41 }
42
43 bool isMdt=false, isEndcap=false; // Flags for whether the Segment has hits from the MDT/Endcap
44 int nMdtMeas[4]={0,0,0,0}; // int array to count number of MDT hits in different stations
45
46 // Loop through contained ROTs and identify used stations
47 for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT){
48 const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
49 if(!rio){
50 ATH_MSG_DEBUG("No RIO");
51 continue;
52 }
53 Identifier id = rio->identify();
54
55 // Identify MDT Endcap Segments
56 if(m_idHelperSvc->isMdt(id))isMdt=true;
57 if(m_idHelperSvc->isEndcap(id))isEndcap=true;
58
59 int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id));
60 // Large (L) = odd, greater r, Small (S) = even, lower r
61 // 13=EIL 49=EIS 14=EEL 15=EES 17=EML 18=EMS 20=EOL 21=EOS
62 if((stationName==13)||(stationName==49))nMdtMeas[0]++;// MDT
63 if((stationName==14)||(stationName==15))nMdtMeas[1]++;// MDT
64 if((stationName==17)||(stationName==18))nMdtMeas[2]++;// MDT
65 if((stationName==20)||(stationName==21))nMdtMeas[3]++;// MDT
66 }
67
68 // If not Endcap and does not contain MDT hits
69 if(!isMdt||!isEndcap)continue;
70
71 // Get Side
72 int segmAC = (segm->globalPosition().eta()<0);// a:0, c:1
73
74 // Check MDT Stations included in this Segment
75 int nMDTStations=0; int MDTStationj=-1;
76 for(int jMDT=0;jMDT<4;jMDT++){
77 if(nMdtMeas[jMDT]!=0){
78 nMDTStations++;
79 MDTStationj=jMDT;
80 }
81 }
82
83 // MC data has an odd channel set always triggering segments, this cuts them
84 if((segmAC==0)&&(MDTStationj==0)&&
85 (segm->globalPosition().eta()>1.815)&&(segm->globalPosition().eta()<1.82)&&
86 (segm->globalPosition().phi()>2.857)&&(segm->globalPosition().phi()<2.862))continue;
87
88 // If there is only one station pass the segment data on to the variables
89 if(nMDTStations==1){
90 //HasStationSegm[segmAC][MDTStationj]=true;
91 sortedSegments[segmAC][MDTStationj].push_back(segm);
92 }
93 }// Loop over segments
94}// End of function

◆ stationGasGap2layer()

int MdtVsTgcRawDataValAlg::stationGasGap2layer ( int station,
int GasGap )
private

Definition at line 114 of file MdtVsTgcRawData_functions.cxx.

114 {
115 int layer=0;
116 if(station==41||station==42){
117 layer += GasGap;
118 }else if(station==43||station==44){
119 layer = 3+GasGap;
120 }else if(station==45||station==46){
121 layer = 5+GasGap;
122 }
123 return layer;
124}

◆ streamNameFunction()

ManagedMonitorToolBase::StreamNameFcn * ManagedMonitorToolBase::streamNameFunction ( )
virtualinherited

Returns the function object that converts logical paramters into a physical stream name.

Definition at line 451 of file ManagedMonitorToolBase.cxx.

453{
454 if( m_streamNameFcn == 0 ) {
455 msg(MSG::ERROR) << "!! streamNameFunction() has not been initialized !!" << endmsg;
456 msg(MSG::ERROR) << " --> neither ManagedMonitorToolBase::initialize() nor" << endmsg;
457 msg(MSG::ERROR) << " --> ManagedMonitorToolBase::setMonManager() has been called." << endmsg;
458 msg(MSG::ERROR) << " --> Correct configuration cannot be guaranteed from this point." << endmsg;
460 }
461 return m_streamNameFcn;
462}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

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

◆ tgceffcalc()

void MdtVsTgcRawDataValAlg::tgceffcalc ( const xAOD::MuonSegmentContainer * m_newsegment,
const Muon::TgcPrepDataContainer * tgc_prepcontainer )
private

Definition at line 35 of file MdtVsTgcRawData_TGCEffCheck.cxx.

36 {
37 ATH_MSG_DEBUG("inside tgcEIFIeffcalc" );
39 // Declare vector arrays to hold segment pointers
40
41 // Holds Segments sorted into MDT Stations on each side
42 std::vector<const Muon::MuonSegment*> sortedSegments[2][4]; //[AC][MDTStation]
43
44 // Holds Segments which have been disqualified, any segments in this array are ignored when looping through sortedSegments
45 std::vector<const Muon::MuonSegment*> DQdisqualifiedSegments[2][4]; //[AC][MDTStation] // Segments which have been disqualified by DQ
46 std::vector<const Muon::MuonSegment*> MATCHdisqualifiedSegments[2][4];//[AC][MDTStation] // Segments which have been disqualified by DQ or already been included in a track
47
48 // Holds Segments which have been matched into a track
49 std::vector<SegmTrack> matchedSegments[2]; //[AC]
50
51
53 // Sort and filter Segments
54
55 // Sort Segments from segmcollection into correct bin in sortedSegments array
56 SortMDTSegments(newmdtsegment, sortedSegments);
57 // Disqualify Segments with bad DQ
58 DQCheckMDTSegments(sortedSegments, DQdisqualifiedSegments);
59 for(int i=0;i<2;i++){
60 for(int jMDT=0;jMDT<4;jMDT++){
61 MATCHdisqualifiedSegments[i][jMDT] = DQdisqualifiedSegments[i][jMDT];
62 }
63 }
64
65
67 // Segment Track Method
68 // Match up Segments into tracks
69 MatchMDTSegments(sortedSegments, MATCHdisqualifiedSegments, matchedSegments);
70 // Use tracks to look for TGC hits
71 CheckTGConTrack(matchedSegments, tgc_prepcontainer);
72
73
75 // Midstation-only Method
76
77 // Use segments to check Midstation again
78 MidstationOnlyCheck(sortedSegments, DQdisqualifiedSegments, tgc_prepcontainer);
79
80 return;
81}// End of function
void SortMDTSegments(const xAOD::MuonSegmentContainer *m_newsegment, std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4])
void MatchMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], std::vector< SegmTrack >(&matchedSegments)[2])
void CheckTGConTrack(std::vector< SegmTrack >(&matchedSegments)[2], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void MidstationOnlyCheck(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4], const Muon::TgcPrepDataContainer *tgc_prepcontainer)
void DQCheckMDTSegments(std::vector< const Muon::MuonSegment * >(&sortedSegments)[2][4], std::vector< const Muon::MuonSegment * >(&disqualifiedSegments)[2][4])

◆ tgceffcalcfinalize()

void MdtVsTgcRawDataValAlg::tgceffcalcfinalize ( )
private

Definition at line 144 of file MdtVsTgcRawData_TGCEffCheck.cxx.

144 {
145 int beff, bdenom, berror;
146 float feff, fdenom;
147 for(int i=0;i<2;i++){// AC
148 // Station Coordinate Efficiency Histograms
149 for(int k=0;k<2;k++){// WireStrip
150 // Loop Numerator and Denominator, total up histograms
151 for(int e=1;e<3;e++){
152 TList histlist;
153 histlist.Add(m_eff_stationmapbase[i][k][e]);
154 histlist.Add(m_eff_stationmapmid[i][k][e]);
155 m_eff_stationmap[i][k][e]->Merge(&histlist);
156 }
157
158 const int nhtypes = 3;
159 // Make array of pointers to different efficiency histogram types
160 TH2 *histarray[nhtypes][4] = {{ m_eff_stationmapbase[i][k][0], m_eff_stationmapbase[i][k][1], m_eff_stationmapbase[i][k][2], m_eff_stationmapbase[i][k][3]},
163 for(int h=0;h<nhtypes;h++){
164 // Calculate Efficiency
165 histarray[h][0]->Divide(histarray[h][1], histarray[h][2]);
166
167 // Calculate Error
168 int nX=histarray[h][3]->GetNbinsX();
169 int nY=histarray[h][3]->GetNbinsY();
170 for(int x=1;x<=nX;x++){
171 for(int y=1;y<=nY;y++){
172 beff =histarray[h][0]->GetBin(x,y);
173 bdenom=histarray[h][2]->GetBin(x,y);
174 berror=histarray[h][3]->GetBin(x,y);
175
176 feff =histarray[h][0]->GetBinContent(beff);
177 fdenom=histarray[h][2]->GetBinContent(bdenom);
178
179 float result = 0;
180 if(fdenom>0){
181 result=sqrt(feff*(1-feff)/fdenom);
182 }
183 histarray[h][3]->SetBinContent(berror,result);
184 }// nY Bins
185 }// nX Bins
186 }
187 }// WireStrip
188 }// AC
189
190 return;
191}// End of function
#define y

◆ TGCgetlayer()

int MdtVsTgcRawDataValAlg::TGCgetlayer ( int stationName,
int g )
private

Definition at line 195 of file MdtVsTgcRawData_TGCEffCheck.cxx.

195 {
196 if(g<1){
197 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap g=" << g );
198 return -1;
199 }
200 int l = g-1;
201 if(stationName==41||stationName==42){
202 if(g>3){
203 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
204 return -1;
205 }
206 }else if(stationName==43||stationName==44){
207 if(g>2){
208 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
209 return -1;
210 }
211 l+=3;
212 }else if(stationName==45||stationName==46){
213 if(g>2){
214 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
215 return -1;
216 }
217 l+=5;
218 }else if(stationName==47||stationName==48){
219 if(g>2){
220 ATH_MSG_WARNING( "TGCgetlayer passed invalid gasgap and stationName combination n=" << stationName << " g=" << g );
221 return -1;
222 }
223 l+=7;
224 }else{
225 ATH_MSG_WARNING( "TGCgetlayer passed invalid stationName n=" << stationName );
226 return -1;
227 }
228 return l;
229}// End of function

◆ TGClayer2stationindex()

int MdtVsTgcRawDataValAlg::TGClayer2stationindex ( int l)
private

Definition at line 233 of file MdtVsTgcRawData_TGCEffCheck.cxx.

233 {
234 if(l==0||l==1||l==2)return 0;
235 else if(l==3||l==4)return 1;
236 else if(l==5||l==6)return 2;
237 else if(l==7||l==8)return 3;
238 else{
239 ATH_MSG_WARNING( "TGClayer2Station passed invalid layer number:" << l );
240 return -1;
241 }
242}// End of function

◆ TGCstationname2stationindex()

int MdtVsTgcRawDataValAlg::TGCstationname2stationindex ( int stationName)
private

Definition at line 245 of file MdtVsTgcRawData_TGCEffCheck.cxx.

245 {
246 if(stationName==41||stationName==42)return 0;
247 else if(stationName==43||stationName==44)return 1;
248 else if(stationName==45||stationName==46)return 2;
249 else if(stationName==47||stationName==48)return 3;
250 else{
251 ATH_MSG_WARNING( "TGCstationname2stationindex passed invalid stationName n=" << stationName );
252 return -1;
253 }
254}// End of function

◆ THistSvc_deReg_fixTGraph()

StatusCode ManagedMonitorToolBase::THistSvc_deReg_fixTGraph ( TFile * file,
TGraph * theGraph,
std::string & directoryName )
protectedinherited

Fixes THistSvc->deReg(obj) when obj is TGraph instance.

Read more in source file about this bug.

Definition at line 1037 of file ManagedMonitorToolBase.cxx.

1039{
1040 // THistSvc employs TDirectory Append method when registering TGraph.
1041 // When deReg is used to de-register TGraph object, THistSvc only removes the object
1042 // from its internal management but forgets to delete from TDirectory.
1043 // The current method fixes this problem by removing the TGraph object manually
1044 // after THistSvc->deReg(TGraph* obj) is called.
1045
1046 // Saves and restores gFile and gDirectory
1047 GlobalDirectoryRestore restore;
1048
1049 // This check is true when TGraph object is removed successfully
1050 bool graphRemoved = false;
1051
1052 file->cd("/");
1053 TDirectory* dir = file->GetDirectory(directoryName.c_str());
1054 if (dir != 0) {
1055 dir->cd();
1056 TObject* obj = dir->Remove(theGraph);
1057 if (obj != 0)
1058 graphRemoved = true;
1059 }
1060
1061 if (!graphRemoved) {
1062 return StatusCode::FAILURE;
1063 }
1064
1065 return StatusCode::SUCCESS;
1066}

◆ trigChainsArePassed()

bool ManagedMonitorToolBase::trigChainsArePassed ( std::vector< std::string > & vTrigNames)
protectedvirtualinherited

Definition at line 2093 of file ManagedMonitorToolBase.cxx.

2095{
2096 ATH_MSG_DEBUG( "ManagedMonitorToolBase::trigChainsArePassed:");
2097
2098 for(unsigned int i=0; i<vTrigNames.size(); i++) {
2099 if( m_trigDecTool->isPassed(vTrigNames[i]) ) {
2100 ATH_MSG_DEBUG( " + \"" << vTrigNames[i] << "\" passed, returning \'true\'");
2101 return true;
2102 }
2103 else {
2104 ATH_MSG_DEBUG( " - \"" << vTrigNames[i] << "\" did not pass");
2105 }
2106 }
2107
2108 return false;
2109}

◆ updateTriggersForGroups()

void ManagedMonitorToolBase::updateTriggersForGroups ( std::vector< std::string > & vTrigChainNames)
protectedinherited

Definition at line 2131 of file ManagedMonitorToolBase.cxx.

2132 {
2133 for (size_t i = 0; i < vTrigChainNames.size(); ++i) {
2134 std::string& thisName = vTrigChainNames[i];
2135 if (thisName.compare(0, 9, "CATEGORY_") ==0) {
2136 ATH_MSG_DEBUG("Found a trigger category: " << thisName << ". We will unpack it.");
2137 std::vector<std::string> triggers = m_trigTranslator->translate(thisName.substr(9,std::string::npos));
2138 std::ostringstream oss;
2139 oss << "(";
2140 for (size_t itrig = 0; itrig < triggers.size(); ++itrig) {
2141 if (itrig != 0) {
2142 oss << "|";
2143 }
2144 oss << triggers[itrig];
2145 }
2146 oss << ")";
2147 // replace with new value
2148 std::string newval = oss.str();
2149 ATH_MSG_DEBUG("Replaced with " << newval);
2150 vTrigChainNames[i] = std::move(newval);
2151 }
2152 }
2153}
PublicToolHandle< ITriggerTranslatorTool > m_trigTranslator

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeAndDelete()

StatusCode ManagedMonitorToolBase::writeAndDelete ( TH1 * h,
const MonGroup & group )
virtualinherited

Write out histogram and delete it.

Definition at line 1600 of file ManagedMonitorToolBase.cxx.

1601 {
1602 if (!h)
1603 return StatusCode::FAILURE;
1604
1605 std::string hName = h->GetName();
1606
1607 if( m_manager != 0 ) {
1608 std::string genericName = NoOutputStream().getStreamName( this, group, hName );
1609 m_manager->writeAndDelete( genericName );
1610 }
1611 return StatusCode::SUCCESS;
1612}

Member Data Documentation

◆ m_bookHistogramsInitial

bool ManagedMonitorToolBase::m_bookHistogramsInitial
privateinherited

Definition at line 894 of file ManagedMonitorToolBase.h.

◆ m_chamberName

std::string MdtVsTgcRawDataValAlg::m_chamberName
private

Definition at line 75 of file MdtVsTgcRawDataValAlg.h.

◆ m_checkCabling

bool MdtVsTgcRawDataValAlg::m_checkCabling
private

Definition at line 72 of file MdtVsTgcRawDataValAlg.h.

◆ m_cosmicStation

int MdtVsTgcRawDataValAlg::m_cosmicStation
private

Definition at line 80 of file MdtVsTgcRawDataValAlg.h.

◆ m_d

Imp* ManagedMonitorToolBase::m_d
privateinherited

Definition at line 901 of file ManagedMonitorToolBase.h.

◆ m_dataType

AthenaMonManager::DataType_t ManagedMonitorToolBase::m_dataType
protectedinherited

Definition at line 839 of file ManagedMonitorToolBase.h.

◆ m_dataTypeStr

std::string ManagedMonitorToolBase::m_dataTypeStr
protectedinherited

Definition at line 835 of file ManagedMonitorToolBase.h.

◆ m_defaultLBDuration

float ManagedMonitorToolBase::m_defaultLBDuration
privateinherited

Definition at line 896 of file ManagedMonitorToolBase.h.

◆ m_detailLevel

unsigned int ManagedMonitorToolBase::m_detailLevel
protectedinherited

Definition at line 837 of file ManagedMonitorToolBase.h.

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> MdtVsTgcRawDataValAlg::m_DetectorManagerKey
private
Initial value:
{this, "DetectorManagerKey",
"MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 66 of file MdtVsTgcRawDataValAlg.h.

66 {this, "DetectorManagerKey",
67 "MuonDetectorManager",
68 "Key of input MuonDetectorManager condition data"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DQFilterTools

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

Definition at line 850 of file ManagedMonitorToolBase.h.

850{this,"FilterTools",{}};

◆ m_eff_stationmap

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmap[2][2][4] {}
private

Definition at line 145 of file MdtVsTgcRawDataValAlg.h.

145{}; // [AC][WireStrip][EffNumDenomError] //Filled in postprocessor

◆ m_eff_stationmapbase

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmapbase[2][2][4] {}
private

Definition at line 143 of file MdtVsTgcRawDataValAlg.h.

143{}; // [AC][WireStrip][EffNumDenomError]

◆ m_eff_stationmapmid

TH2* MdtVsTgcRawDataValAlg::m_eff_stationmapmid[2][2][4] {}
private

Definition at line 144 of file MdtVsTgcRawDataValAlg.h.

144{}; // [AC][WireStrip][EffNumDenomError]

◆ m_endOfEventsBlock

bool ManagedMonitorToolBase::m_endOfEventsBlock
privateinherited

Definition at line 824 of file ManagedMonitorToolBase.h.

◆ m_endOfLowStat

bool ManagedMonitorToolBase::m_endOfLowStat
privateinherited

Definition at line 824 of file ManagedMonitorToolBase.h.

◆ m_endOfLumiBlock

bool ManagedMonitorToolBase::m_endOfLumiBlock
privateinherited

Definition at line 824 of file ManagedMonitorToolBase.h.

◆ m_endOfRun

bool ManagedMonitorToolBase::m_endOfRun
privateinherited

Definition at line 824 of file ManagedMonitorToolBase.h.

◆ m_environment

AthenaMonManager::Environment_t ManagedMonitorToolBase::m_environment
protectedinherited

Definition at line 840 of file ManagedMonitorToolBase.h.

◆ m_environmentStr

std::string ManagedMonitorToolBase::m_environmentStr
protectedinherited

Definition at line 836 of file ManagedMonitorToolBase.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fileKey

std::string ManagedMonitorToolBase::m_fileKey
protectedinherited

Definition at line 834 of file ManagedMonitorToolBase.h.

◆ m_haveClearedLastEventBlock

bool ManagedMonitorToolBase::m_haveClearedLastEventBlock
protectedinherited

Definition at line 867 of file ManagedMonitorToolBase.h.

◆ m_idHelperSvc

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

Definition at line 69 of file MdtVsTgcRawDataValAlg.h.

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

◆ m_lastEvent

int MdtVsTgcRawDataValAlg::m_lastEvent
private

Definition at line 79 of file MdtVsTgcRawDataValAlg.h.

◆ m_lastHigStatInterval

int ManagedMonitorToolBase::m_lastHigStatInterval
protectedinherited

Definition at line 862 of file ManagedMonitorToolBase.h.

◆ m_lastLowStatInterval

int ManagedMonitorToolBase::m_lastLowStatInterval
protectedinherited

Definition at line 862 of file ManagedMonitorToolBase.h.

◆ m_lastLumiBlock

unsigned int ManagedMonitorToolBase::m_lastLumiBlock
protectedinherited

Definition at line 860 of file ManagedMonitorToolBase.h.

◆ m_lastMedStatInterval

int ManagedMonitorToolBase::m_lastMedStatInterval
protectedinherited

Definition at line 862 of file ManagedMonitorToolBase.h.

◆ m_lastRun

unsigned int ManagedMonitorToolBase::m_lastRun
protectedinherited

Definition at line 861 of file ManagedMonitorToolBase.h.

◆ m_lbDurationDataKey

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

Definition at line 889 of file ManagedMonitorToolBase.h.

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

◆ m_lumiDataKey

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

Definition at line 887 of file ManagedMonitorToolBase.h.

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

◆ m_manager

AthenaMonManager* ManagedMonitorToolBase::m_manager
protectedinherited

Definition at line 830 of file ManagedMonitorToolBase.h.

◆ m_managerNameProp

std::string ManagedMonitorToolBase::m_managerNameProp
protectedinherited

Definition at line 832 of file ManagedMonitorToolBase.h.

◆ m_mdt_PrepDataContainerName

SG::ReadHandleKey<Muon::MdtPrepDataContainer> MdtVsTgcRawDataValAlg::m_mdt_PrepDataContainerName {this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"}
private

Definition at line 83 of file MdtVsTgcRawDataValAlg.h.

83{this,"MdtPrepDataContainer","MDT_DriftCircles","MDT PRDs"};

◆ m_mdt_SegmentCollectionName

SG::ReadHandleKey<xAOD::MuonSegmentContainer> MdtVsTgcRawDataValAlg::m_mdt_SegmentCollectionName {this,"MdtSegmentCollection","MuonSegments","muon segments"}
private

Definition at line 84 of file MdtVsTgcRawDataValAlg.h.

84{this,"MdtSegmentCollection","MuonSegments","muon segments"};

◆ m_mdt_segmmap

TH2* MdtVsTgcRawDataValAlg::m_mdt_segmmap[2][4] {}
private

Definition at line 111 of file MdtVsTgcRawDataValAlg.h.

111{}; // [AC][StationIndex]

◆ m_mdt_segmmatchsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_segmmatchsag[2][4][4][4] {}
private

Definition at line 150 of file MdtVsTgcRawDataValAlg.h.

150{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_mdt_segmposdirsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_segmposdirsag[2][4][4] {}
private

Definition at line 151 of file MdtVsTgcRawDataValAlg.h.

151{}; // [AC][MDTStation][RhoEtaPhiThe]

◆ m_mdt_trackchecksag

TH1* MdtVsTgcRawDataValAlg::m_mdt_trackchecksag[2][4][4][4][2] {}
private

Definition at line 153 of file MdtVsTgcRawDataValAlg.h.

153{};// [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_mdt_trackdirdirsag

TH1* MdtVsTgcRawDataValAlg::m_mdt_trackdirdirsag[2][4][4][4] {}
private

Definition at line 152 of file MdtVsTgcRawDataValAlg.h.

152{}; // [AC][MDTStation][MDTStation][RhoEtaPhiThe]

◆ m_MdtAdcCut

int MdtVsTgcRawDataValAlg::m_MdtAdcCut
private

Definition at line 86 of file MdtVsTgcRawDataValAlg.h.

◆ m_MdtTdcCut

int MdtVsTgcRawDataValAlg::m_MdtTdcCut
private

Definition at line 87 of file MdtVsTgcRawDataValAlg.h.

◆ m_metadataMap

MDMap_t ManagedMonitorToolBase::m_metadataMap
protectedinherited

Definition at line 828 of file ManagedMonitorToolBase.h.

◆ m_mvt_cutspassed

TH1* MdtVsTgcRawDataValAlg::m_mvt_cutspassed[2] {}
private

Definition at line 109 of file MdtVsTgcRawDataValAlg.h.

109{}; // [AC]

◆ m_mvt_extrprdsag

TH1* MdtVsTgcRawDataValAlg::m_mvt_extrprdsag[2][4][2][2][4] {}
private

Definition at line 147 of file MdtVsTgcRawDataValAlg.h.

147{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]

◆ m_mvt_extrprdsag2

TH1* MdtVsTgcRawDataValAlg::m_mvt_extrprdsag2[2][4][2][2][4] {}
private

Definition at line 148 of file MdtVsTgcRawDataValAlg.h.

148{}; // [AC][TGCStation][FE][WireStrip][RhoEtaPhi]

◆ m_nEvents

unsigned int ManagedMonitorToolBase::m_nEvents
protectedinherited

Definition at line 864 of file ManagedMonitorToolBase.h.

◆ m_nEventsIgnoreTrigger

unsigned int ManagedMonitorToolBase::m_nEventsIgnoreTrigger
protectedinherited

Definition at line 865 of file ManagedMonitorToolBase.h.

◆ m_newEventsBlock

bool ManagedMonitorToolBase::m_newEventsBlock
privateinherited

Definition at line 823 of file ManagedMonitorToolBase.h.

◆ m_newHigStatInterval

bool ManagedMonitorToolBase::m_newHigStatInterval
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_newLowStat

bool ManagedMonitorToolBase::m_newLowStat
privateinherited

Definition at line 822 of file ManagedMonitorToolBase.h.

◆ m_newLowStatInterval

bool ManagedMonitorToolBase::m_newLowStatInterval
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_newLumiBlock

bool ManagedMonitorToolBase::m_newLumiBlock
privateinherited

Definition at line 822 of file ManagedMonitorToolBase.h.

◆ m_newMedStatInterval

bool ManagedMonitorToolBase::m_newMedStatInterval
privateinherited

Definition at line 821 of file ManagedMonitorToolBase.h.

◆ m_newRun

bool ManagedMonitorToolBase::m_newRun
privateinherited

Definition at line 822 of file ManagedMonitorToolBase.h.

◆ m_nLumiBlocks

unsigned int ManagedMonitorToolBase::m_nLumiBlocks
protectedinherited

Definition at line 866 of file ManagedMonitorToolBase.h.

◆ m_path

std::string ManagedMonitorToolBase::m_path
protectedinherited

Definition at line 853 of file ManagedMonitorToolBase.h.

◆ m_preScaleProp

long ManagedMonitorToolBase::m_preScaleProp
protectedinherited

Definition at line 854 of file ManagedMonitorToolBase.h.

◆ m_procNEventsProp

long ManagedMonitorToolBase::m_procNEventsProp
protectedinherited

Definition at line 852 of file ManagedMonitorToolBase.h.

◆ m_sector

int MdtVsTgcRawDataValAlg::m_sector
private

Definition at line 77 of file MdtVsTgcRawDataValAlg.h.

◆ m_side

int MdtVsTgcRawDataValAlg::m_side
private

Definition at line 78 of file MdtVsTgcRawDataValAlg.h.

◆ m_stationHists

MuonDQAHistMap MdtVsTgcRawDataValAlg::m_stationHists
private

Definition at line 63 of file MdtVsTgcRawDataValAlg.h.

◆ m_StationSize

std::string MdtVsTgcRawDataValAlg::m_StationSize
private

Definition at line 76 of file MdtVsTgcRawDataValAlg.h.

◆ m_streamNameFcn

StreamNameFcn* ManagedMonitorToolBase::m_streamNameFcn
protectedinherited

Definition at line 842 of file ManagedMonitorToolBase.h.

◆ m_supportedIntervalsForRebooking

std::set<Interval_t> ManagedMonitorToolBase::m_supportedIntervalsForRebooking
privateinherited

Definition at line 897 of file ManagedMonitorToolBase.h.

◆ m_templateEfficiencies

std::map< Interval_t, std::vector< MgmtParams<TEfficiency> > > ManagedMonitorToolBase::m_templateEfficiencies
protectedinherited

Definition at line 677 of file ManagedMonitorToolBase.h.

◆ m_templateGraphs

std::map< Interval_t, std::vector< MgmtParams<TGraph> > > ManagedMonitorToolBase::m_templateGraphs
protectedinherited

Definition at line 669 of file ManagedMonitorToolBase.h.

◆ m_templateHistograms

std::map< Interval_t, std::vector< MgmtParams<TH1> > > ManagedMonitorToolBase::m_templateHistograms
protectedinherited

Definition at line 665 of file ManagedMonitorToolBase.h.

◆ m_templateTrees

std::map< Interval_t, std::vector< MgmtParams<TTree> > > ManagedMonitorToolBase::m_templateTrees
protectedinherited

Definition at line 673 of file ManagedMonitorToolBase.h.

◆ m_tgc_CoinContainerName

SG::ReadHandleKey<Muon::TgcCoinDataContainer> MdtVsTgcRawDataValAlg::m_tgc_CoinContainerName {this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"}
private

Definition at line 82 of file MdtVsTgcRawDataValAlg.h.

82{this,"OutputCoinCollection","TrigT1CoinDataCollection","TGC coincidences"};

◆ m_tgc_prdcompsag

TH1* MdtVsTgcRawDataValAlg::m_tgc_prdcompsag[2][2][4] {}
private

Definition at line 149 of file MdtVsTgcRawDataValAlg.h.

149{}; // [AC][TGCStation][RhoEtaPhiZ]

◆ m_tgc_PrepDataContainerName

SG::ReadHandleKey<Muon::TgcPrepDataContainer> MdtVsTgcRawDataValAlg::m_tgc_PrepDataContainerName {this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"}
private

Definition at line 81 of file MdtVsTgcRawDataValAlg.h.

81{this,"TgcPrepDataContainer","TGC_Measurements","TGC PRDs"};

◆ m_tgclv1file

bool MdtVsTgcRawDataValAlg::m_tgclv1file
private

Definition at line 73 of file MdtVsTgcRawDataValAlg.h.

◆ m_THistSvc

ServiceHandle<ITHistSvc> ManagedMonitorToolBase::m_THistSvc
protectedinherited

Definition at line 844 of file ManagedMonitorToolBase.h.

◆ m_TREarray

const MuonGM::TgcReadoutElement* MdtVsTgcRawDataValAlg::m_TREarray[8][2][9][49] {}
private

Definition at line 94 of file MdtVsTgcRawDataValAlg.h.

94{}; // [StationName][AC][StationEta][StationPhi]

◆ m_trigDecTool

PublicToolHandle<Trig::ITrigDecisionTool> ManagedMonitorToolBase::m_trigDecTool {this, "TrigDecisionTool",""}
protectedinherited

Definition at line 846 of file ManagedMonitorToolBase.h.

846{this, "TrigDecisionTool",""};

◆ m_triggerChainProp

std::string ManagedMonitorToolBase::m_triggerChainProp
protectedinherited

Definition at line 855 of file ManagedMonitorToolBase.h.

◆ m_triggerGroupProp

std::string ManagedMonitorToolBase::m_triggerGroupProp
protectedinherited

Definition at line 856 of file ManagedMonitorToolBase.h.

◆ m_trigLiveFractionDataKey

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

Definition at line 891 of file ManagedMonitorToolBase.h.

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

◆ m_trigTranslator

PublicToolHandle<ITriggerTranslatorTool> ManagedMonitorToolBase::m_trigTranslator {this,"TriggerTranslatorTool",""}
protectedinherited

Definition at line 848 of file ManagedMonitorToolBase.h.

848{this,"TriggerTranslatorTool",""};

◆ m_useLumi

bool ManagedMonitorToolBase::m_useLumi
privateinherited

Definition at line 895 of file ManagedMonitorToolBase.h.

◆ m_useTrigger

bool ManagedMonitorToolBase::m_useTrigger
protectedinherited

Definition at line 858 of file ManagedMonitorToolBase.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vTrigChainNames

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

Definition at line 681 of file ManagedMonitorToolBase.h.

◆ m_vTrigGroupNames

std::vector<std::string> ManagedMonitorToolBase::m_vTrigGroupNames
protectedinherited

Definition at line 681 of file ManagedMonitorToolBase.h.


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