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 34 of file MdtVsTgcRawDataValAlg.cxx.

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

91 {
92 ATH_MSG_INFO( " deleting MdtVsTgcRawDataValAlg " );
93}
#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 134 of file MdtVsTgcRawDataValAlg.cxx.

134 {
135/*----------------------------------------------------------------------------------*/
136 ATH_MSG_DEBUG( "TGC RawData Monitoring Histograms being booked" );
137
138 //declare a group of histograms
139 std::string generic_path_mdtvstgclv1 = "Muon/MuonRawDataMonitoring/MDTvsTGC";
140 //MonGroup mdtvstgclv1_expert( this, generic_path_mdtvstgclv1+"/Global", expert, run );
141 MonGroup mdtvstgclv1_expert_a( this, generic_path_mdtvstgclv1+"/TGCEA", run, ATTRIB_UNMANAGED );
142 MonGroup mdtvstgclv1_expert_c( this, generic_path_mdtvstgclv1+"/TGCEC", run, ATTRIB_UNMANAGED );
143
144 if(newRunFlag()){
145 ATH_MSG_INFO( "MdtVsTgc RawData Monitoring : begin of run" );
146
147 ATH_CHECK( bookmaphists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
148 ATH_CHECK( bookeffhists(mdtvstgclv1_expert_a, mdtvstgclv1_expert_c) );
149 }//isNewRun
150 return StatusCode::SUCCESS;
151}
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 36 of file MdtVsTgcRawData_PRDonTrack.cxx.

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

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

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

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

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

◆ initialize()

StatusCode MdtVsTgcRawDataValAlg::initialize ( )
virtual

Reimplemented from ManagedMonitorToolBase.

Definition at line 98 of file MdtVsTgcRawDataValAlg.cxx.

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

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

◆ maphistsfinalize()

void MdtVsTgcRawDataValAlg::maphistsfinalize ( )
private

Definition at line 141 of file MdtVsTgcRawData_maptgchits.cxx.

141 {
142
143}// 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 33 of file MdtVsTgcRawData_SegmMatching.cxx.

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

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

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

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

◆ 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 29 of file MdtVsTgcRawData_SegmSorting.cxx.

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

◆ 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 36 of file MdtVsTgcRawData_TGCEffCheck.cxx.

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

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

◆ TGCgetlayer()

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

Definition at line 196 of file MdtVsTgcRawData_TGCEffCheck.cxx.

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

◆ TGClayer2stationindex()

int MdtVsTgcRawDataValAlg::TGClayer2stationindex ( int l)
private

Definition at line 234 of file MdtVsTgcRawData_TGCEffCheck.cxx.

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

◆ TGCstationname2stationindex()

int MdtVsTgcRawDataValAlg::TGCstationname2stationindex ( int stationName)
private

Definition at line 246 of file MdtVsTgcRawData_TGCEffCheck.cxx.

246 {
247 if(stationName==41||stationName==42)return 0;
248 else if(stationName==43||stationName==44)return 1;
249 else if(stationName==45||stationName==46)return 2;
250 else if(stationName==47||stationName==48)return 3;
251 else{
252 ATH_MSG_WARNING( "TGCstationname2stationindex passed invalid stationName n=" << stationName );
253 return -1;
254 }
255}// 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: