ATLAS Offline Software
TRTMonitoringRun3RAW_Alg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRTMONITORINGRUN3RAW_ALG_H
6 #define TRTMONITORINGRUN3RAW_ALG_H
7 
10 
11 #include "GaudiKernel/StatusCode.h"
12 
13 // Data handles
14 #include "StoreGate/ReadHandle.h"
21 
22 // Tool interfaces
27 
30 
32 
33 // STDLIB
34 #include <string>
35 #include <vector>
36 #include <set>
37 
38 namespace InDetDD {
39  class TRT_DetectorManager;
40 }
41 
42 class AtlasDetectorID;
43 class TRT_ID;
44 class Identifier;
47 
49 public:
50  TRTMonitoringRun3RAW_Alg( const std::string& name, ISvcLocator* pSvcLocator );
51  virtual ~TRTMonitoringRun3RAW_Alg();
52  virtual StatusCode initialize() override;
53  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
54 
55 private:
59 
60  std::vector<std::vector<unsigned char>> m_mat_chip_E{64, std::vector<unsigned char>(3840)};
61  std::vector<std::vector<unsigned char>> m_mat_chip_B{64, std::vector<unsigned char>(1642)};
62 
63  enum GasType{ Xe = 0, Ar = 1, Kr = 2 };
64 
65  static const int s_Straw_max[2];
66  static const int s_iChip_max[2];
67 
68  static const int s_numberOfBarrelStacks;
69  static const int s_numberOfEndCapStacks;
70 
71  bool m_doStraws;
72  bool m_doExpert;
73  bool m_doChips;
76  bool m_doShift;
81  float m_usedEvents;
82 
83  BooleanProperty m_ArgonXenonSplitter{this, "doArgonXenonSeparation", true};
84 
85  FloatProperty m_longToTCut{this, "LongToTCut", 9.375};
86 
87  Gaudi::Property<std::vector<int>> m_strawMax {this,"strawMax", {-1, -1}};
88  Gaudi::Property<std::vector<int>> m_iChipMax {this,"iChipMax", {-1, -1}};
89 
96  float m_max_abs_d0;
97  float m_max_abs_z0;
99  float m_minP;
100  float m_min_pT;
101 
102  StatusCode fillTRTRDOs(const TRT_RDO_Container& rdoContainer,
103  const xAOD::EventInfo& eventInfo,
104  const InDetTimeCollection* trtBCIDCollection) const;
105  StatusCode fillTRTEfficiency(const TrackCollection& combTrackCollection) const;
106  StatusCode fillTRTHits(const TrackCollection& trackCollection) const;
107 
108  int chipToBoard(int chip) const;
109  int chipToBoard_EndCap(int chip) const;
110  StatusCode checkTRTReadoutIntegrity(const xAOD::EventInfo& eventInfo) const;
111  std::vector<std::vector<std::vector<int>>> initScaleVectors() const;
112  bool checkEventBurst(const TRT_RDO_Container& rdoContainer) const;
113  int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const;
114  int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const;
115  int strawLayerNumber(int strawLayerNumber, int LayerNumber) const;
116  float radToDegrees(float radValue) const;
117  int strawNumber_reverse(int inp_strawnumber, int* strawNumber, int* strawlayerNumber, int* LayerNumber) const;
118  int strawLayerNumber_reverse(int strawLayerNumInp,int* strawLayerNumber, int* LayerNumber) const;
119 
120  // Services
121  ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool;
124  ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool;
125 
126  // Data handles
127  SG::ReadHandleKey<TRT_RDO_Container> m_rdoContainerKey{this, "TRTRawDataObjectName", "TRT_RDOs", "Name of TRT RDOs container"};
128  SG::ReadHandleKey<InDetTimeCollection> m_TRT_BCIDCollectionKey{this, "TRTBCIDCollectionName", "TRT_BCID", "Name of TRT BCID collection"};
129  SG::ReadHandleKey<TrackCollection> m_combTrackCollectionKey{this, "track_collection_hole_finder", "CombinedInDetTracks", "Name of tracks container used for hole finder"};
130  SG::ReadHandleKey<TrackCollection> m_trackCollectionKey{this, "TRTTracksObjectName", "CombinedInDetTracks", "Name of tracks container"};
131 
132  SG::ReadHandleKey<TRT_BSErrContainer> m_bsErrContKey{this,"ByteStreamErrors","TRT_ByteStreamErrs","SG key of TRT ByteStream Error container"};
133 
134  // Tools
135  ToolHandle<Trk::ITrackHoleSearchTool> m_trt_hole_finder{this, "trt_hole_search", "TRTTrackHoleSearchTool", "Track hole search tool name"};
136  ToolHandle<Trk::ITrackSummaryTool> m_TrackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryTool", "Track summary tool name"};
137 
138  //Deciphers status HT to GasType Enumerator
139  inline GasType Straw_Gastype(int stat) const {
140  // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton}.
141  // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
142  GasType Gas = Xe; // Xenon is default
143  if (m_ArgonXenonSplitter) {
144  // int stat=m_sumSvc->getStatusHT(TRT_Identifier);
145  if ( stat==2 || stat==3 ) { Gas = Xe; } // Xe
146  else if ( stat==1 || stat==4 ) { Gas = Ar; } // Ar
147  else if ( stat==5 ) { Gas = Kr; } // Kr
148  else if ( stat==6 ) { Gas = Xe; } // emulate Ar (so treat as Xe here)
149  else if ( stat==7 ) { Gas = Xe; } // emulate Kr (so treat as Xe here)
150  else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)!' or 6 or 7 for emulated types!");
151  throw std::exception();
152  }
153  }
154  return Gas;
155  }
156 
157  BooleanProperty m_isCosmics{this, "IsCosmics", false};
158  IntegerProperty m_EventBurstCut{this, "EventBurstCut", -1};
159 
160 };
161 #endif
TRTMonitoringRun3RAW_Alg::strawLayerNumber
int strawLayerNumber(int strawLayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:629
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TRTMonitoringRun3RAW_Alg::m_EventBurstCut
IntegerProperty m_EventBurstCut
Definition: TRTMonitoringRun3RAW_Alg.h:158
ITrackSummaryTool.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRTMonitoringRun3RAW_Alg::m_doHitsMon
bool m_doHitsMon
Definition: TRTMonitoringRun3RAW_Alg.h:79
TRTMonitoringRun3RAW_Alg::m_BSSvc
ServiceHandle< ITRT_ByteStream_ConditionsSvc > m_BSSvc
Definition: TRTMonitoringRun3RAW_Alg.h:123
TRTMonitoringRun3RAW_Alg::m_useHoleFinder
bool m_useHoleFinder
Definition: TRTMonitoringRun3RAW_Alg.h:78
TRTMonitoringRun3RAW_Alg::m_min_pT
float m_min_pT
Definition: TRTMonitoringRun3RAW_Alg.h:100
TRTMonitoringRun3RAW_Alg::m_trackCollectionKey
SG::ReadHandleKey< TrackCollection > m_trackCollectionKey
Definition: TRTMonitoringRun3RAW_Alg.h:130
TRTMonitoringRun3RAW_Alg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TRTMonitoringRun3RAW_Alg.h:56
TRTMonitoringRun3RAW_Alg::m_min_si_hits
int m_min_si_hits
Definition: TRTMonitoringRun3RAW_Alg.h:90
TRTMonitoringRun3RAW_Alg::m_TRT_BCIDCollectionKey
SG::ReadHandleKey< InDetTimeCollection > m_TRT_BCIDCollectionKey
Definition: TRTMonitoringRun3RAW_Alg.h:128
TRTMonitoringRun3RAW_Alg::strawNumber_reverse
int strawNumber_reverse(int inp_strawnumber, int *strawNumber, int *strawlayerNumber, int *LayerNumber) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:510
TRTMonitoringRun3RAW_Alg::Ar
@ Ar
Definition: TRTMonitoringRun3RAW_Alg.h:63
TRTMonitoringRun3RAW_Alg::m_max_abs_d0
float m_max_abs_d0
Definition: TRTMonitoringRun3RAW_Alg.h:96
TRTMonitoringRun3RAW_Alg::chipToBoard_EndCap
int chipToBoard_EndCap(int chip) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:418
TRTMonitoringRun3RAW_Alg::m_ArgonXenonSplitter
BooleanProperty m_ArgonXenonSplitter
Definition: TRTMonitoringRun3RAW_Alg.h:83
TRTMonitoringRun3RAW_Alg::m_TrackSummaryTool
ToolHandle< Trk::ITrackSummaryTool > m_TrackSummaryTool
Definition: TRTMonitoringRun3RAW_Alg.h:136
TRTMonitoringRun3RAW_Alg::m_rdoContainerKey
SG::ReadHandleKey< TRT_RDO_Container > m_rdoContainerKey
Definition: TRTMonitoringRun3RAW_Alg.h:127
TRTMonitoringRun3RAW_Alg::m_isCosmics
BooleanProperty m_isCosmics
Definition: TRTMonitoringRun3RAW_Alg.h:157
TRTMonitoringRun3RAW_Alg::m_minTRThits
int m_minTRThits
Definition: TRTMonitoringRun3RAW_Alg.h:94
TRTMonitoringRun3RAW_Alg::m_min_trt_hits
int m_min_trt_hits
Definition: TRTMonitoringRun3RAW_Alg.h:93
TRTMonitoringRun3RAW_Alg::chipToBoard
int chipToBoard(int chip) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:388
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TRTMonitoringRun3RAW_Alg::m_doExpert
bool m_doExpert
Definition: TRTMonitoringRun3RAW_Alg.h:72
TRTMonitoringRun3RAW_Alg::m_TRTStrawNeighbourSvc
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Definition: TRTMonitoringRun3RAW_Alg.h:122
TRTMonitoringRun3RAW_Alg::fillTRTEfficiency
StatusCode fillTRTEfficiency(const TrackCollection &combTrackCollection) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:1717
TRTMonitoringRun3RAW_Alg::TRTMonitoringRun3RAW_Alg
TRTMonitoringRun3RAW_Alg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRTMonitoringRun3RAW_Alg.cxx:46
TRTMonitoringRun3RAW_Alg::m_max_abs_z0
float m_max_abs_z0
Definition: TRTMonitoringRun3RAW_Alg.h:97
ITRT_ByteStream_ConditionsSvc.h
Service for accessing TRT ByteStream conditions information.
TRTMonitoringRun3RAW_Alg::strawLayerNumber_reverse
int strawLayerNumber_reverse(int strawLayerNumInp, int *strawLayerNumber, int *LayerNumber) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:647
TRT::Hit::side
@ side
Definition: HitInfo.h:83
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
TRTMonitoringRun3RAW_Alg::fillTRTHits
StatusCode fillTRTHits(const TrackCollection &trackCollection) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:2055
TRTMonitoringRun3RAW_Alg::m_minP
float m_minP
Definition: TRTMonitoringRun3RAW_Alg.h:99
TRTMonitoringRun3RAW_Alg::strawNumber
int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:463
TRTMonitoringRun3RAW_Alg::Straw_Gastype
GasType Straw_Gastype(int stat) const
Definition: TRTMonitoringRun3RAW_Alg.h:139
TRTMonitoringRun3RAW_Alg::initScaleVectors
std::vector< std::vector< std::vector< int > > > initScaleVectors() const
Definition: TRTMonitoringRun3RAW_Alg.cxx:223
TRTMonitoringRun3RAW_Alg::m_doStraws
bool m_doStraws
Definition: TRTMonitoringRun3RAW_Alg.h:71
TRTMonitoringRun3RAW_Alg::radToDegrees
float radToDegrees(float radValue) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:666
TRTMonitoringRun3RAW_Alg::s_Straw_max
static const int s_Straw_max[2]
Definition: TRTMonitoringRun3RAW_Alg.h:65
TRTMonitoringRun3RAW_Alg::m_iChipMax
Gaudi::Property< std::vector< int > > m_iChipMax
Definition: TRTMonitoringRun3RAW_Alg.h:88
TRTMonitoringRun3RAW_Alg::s_numberOfBarrelStacks
static const int s_numberOfBarrelStacks
Definition: TRTMonitoringRun3RAW_Alg.h:68
TRTMonitoringRun3RAW_Alg::Xe
@ Xe
Definition: TRTMonitoringRun3RAW_Alg.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRTMonitoringRun3RAW_Alg::m_doRDOsMon
bool m_doRDOsMon
Definition: TRTMonitoringRun3RAW_Alg.h:75
AthMonitorAlgorithm.h
TrackCollection.h
calibdata.exception
exception
Definition: calibdata.py:496
TRT_BSErrContainer.h
TRTMonitoringRun3RAW_Alg::m_bsErrContKey
SG::ReadHandleKey< TRT_BSErrContainer > m_bsErrContKey
Definition: TRTMonitoringRun3RAW_Alg.h:132
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
TRTMonitoringRun3RAW_Alg::m_usedEvents
float m_usedEvents
Definition: TRTMonitoringRun3RAW_Alg.h:81
TRTMonitoringRun3RAW_Alg::m_combTrackCollectionKey
SG::ReadHandleKey< TrackCollection > m_combTrackCollectionKey
Definition: TRTMonitoringRun3RAW_Alg.h:129
TRTMonitoringRun3RAW_Alg::~TRTMonitoringRun3RAW_Alg
virtual ~TRTMonitoringRun3RAW_Alg()
Definition: TRTMonitoringRun3RAW_Alg.cxx:82
DataVector< Trk::Track >
IInDetTrackSelectionTool.h
beamspotman.stat
stat
Definition: beamspotman.py:266
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TRTMonitoringRun3RAW_Alg
Definition: TRTMonitoringRun3RAW_Alg.py:1
ITRT_StrawStatusSummaryTool
Definition: ITRT_StrawStatusSummaryTool.h:27
TRTMonitoringRun3RAW_Alg::s_numberOfEndCapStacks
static const int s_numberOfEndCapStacks
Definition: TRTMonitoringRun3RAW_Alg.h:69
ReadCondHandleKey.h
TRTMonitoringRun3RAW_Alg::m_mat_chip_B
std::vector< std::vector< unsigned char > > m_mat_chip_B
Definition: TRTMonitoringRun3RAW_Alg.h:61
TRTMonitoringRun3RAW_Alg::initialize
virtual StatusCode initialize() override
initialize
Definition: TRTMonitoringRun3RAW_Alg.cxx:84
TRTMonitoringRun3RAW_Alg::m_doShift
bool m_doShift
Definition: TRTMonitoringRun3RAW_Alg.h:76
ITrackHoleSearchTool.h
InDetTimeCollection
std::vector< std::pair< uint32_t, unsigned int > > InDetTimeCollection
Definition: InDetTimeCollection.h:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRTMonitoringRun3RAW_Alg::m_longToTCut
FloatProperty m_longToTCut
Definition: TRTMonitoringRun3RAW_Alg.h:85
ITRT_ByteStream_ConditionsSvc
Definition: ITRT_ByteStream_ConditionsSvc.h:29
EventInfo.h
TRTMonitoringRun3RAW_Alg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TRTMonitoringRun3RAW_Alg.cxx:2738
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
ITRT_StrawNeighbourSvc.h
Abstract interface to information on straws electronic grouping.
TRTMonitoringRun3RAW_Alg::Kr
@ Kr
Definition: TRTMonitoringRun3RAW_Alg.h:63
TRTMonitoringRun3RAW_Alg::m_mat_chip_E
std::vector< std::vector< unsigned char > > m_mat_chip_E
Definition: TRTMonitoringRun3RAW_Alg.h:60
TRT_ID
Definition: TRT_ID.h:84
TRTMonitoringRun3RAW_Alg::m_every_xth_track
int m_every_xth_track
Definition: TRTMonitoringRun3RAW_Alg.h:95
InDetDD::TRT_DetectorManager
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Definition: TRT_DetectorManager.h:69
TRTMonitoringRun3RAW_Alg::m_trt_hole_finder
ToolHandle< Trk::ITrackHoleSearchTool > m_trt_hole_finder
Definition: TRTMonitoringRun3RAW_Alg.h:135
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
TRTMonitoringRun3RAW_Alg::m_doChips
bool m_doChips
Definition: TRTMonitoringRun3RAW_Alg.h:73
TRTMonitoringRun3RAW_Alg::m_min_pixel_hits
int m_min_pixel_hits
Definition: TRTMonitoringRun3RAW_Alg.h:91
TRTMonitoringRun3RAW_Alg::m_DistToStraw
float m_DistToStraw
Definition: TRTMonitoringRun3RAW_Alg.h:80
TRTMonitoringRun3RAW_Alg::m_strawMax
Gaudi::Property< std::vector< int > > m_strawMax
Definition: TRTMonitoringRun3RAW_Alg.h:87
TRTMonitoringRun3RAW_Alg::m_doMaskStraws
bool m_doMaskStraws
Definition: TRTMonitoringRun3RAW_Alg.h:77
TRTMonitoringRun3RAW_Alg::m_trackSelTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
Definition: TRTMonitoringRun3RAW_Alg.h:124
TRTMonitoringRun3RAW_Alg::strawNumberEndCap
int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:550
TRTMonitoringRun3RAW_Alg::m_sumTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Definition: TRTMonitoringRun3RAW_Alg.h:121
TRTMonitoringRun3RAW_Alg::m_doTracksMon
bool m_doTracksMon
Definition: TRTMonitoringRun3RAW_Alg.h:74
TRTMonitoringRun3RAW_Alg::fillTRTRDOs
StatusCode fillTRTRDOs(const TRT_RDO_Container &rdoContainer, const xAOD::EventInfo &eventInfo, const InDetTimeCollection *trtBCIDCollection) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:732
TRTMonitoringRun3RAW_Alg::s_iChip_max
static const int s_iChip_max[2]
Definition: TRTMonitoringRun3RAW_Alg.h:66
InDetTimeCollection.h
ReadHandle.h
Handle class for reading from StoreGate.
InDetRawDataCLASS_DEF.h
TRTMonitoringRun3RAW_Alg::m_pTRTHelper
const TRT_ID * m_pTRTHelper
Definition: TRTMonitoringRun3RAW_Alg.h:57
TRTMonitoringRun3RAW_Alg::GasType
GasType
Definition: TRTMonitoringRun3RAW_Alg.h:63
TRTMonitoringRun3RAW_Alg::checkEventBurst
bool checkEventBurst(const TRT_RDO_Container &rdoContainer) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:430
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
TRTMonitoringRun3RAW_Alg::checkTRTReadoutIntegrity
StatusCode checkTRTReadoutIntegrity(const xAOD::EventInfo &eventInfo) const
Definition: TRTMonitoringRun3RAW_Alg.cxx:286
TRTMonitoringRun3RAW_Alg::m_max_abs_eta
float m_max_abs_eta
Definition: TRTMonitoringRun3RAW_Alg.h:98
ServiceHandle< ITRT_StrawNeighbourSvc >
TRTMonitoringRun3RAW_Alg::m_min_sct_hits
int m_min_sct_hits
Definition: TRTMonitoringRun3RAW_Alg.h:92
TRTMonitoringRun3RAW_Alg::m_mgr
const InDetDD::TRT_DetectorManager * m_mgr
Definition: TRTMonitoringRun3RAW_Alg.h:58
Identifier
Definition: IdentifierFieldParser.cxx:14