ATLAS Offline Software
TRTMonitoringRun3ESD_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 TRTMONITORINGRUN3ESD_ALG_H
6 #define TRTMONITORINGRUN3ESD_ALG_H
7 
10 
11 #include "GaudiKernel/StatusCode.h"
12 
13 // Data handles
14 #include "StoreGate/ReadHandle.h"
23 
24 // Tool interfaces
30 
31 // STDLIB
32 #include <string>
33 #include <vector>
34 
35 namespace Trk {
36  class Track;
37  class TrackStateOnSurface;
38 }
39 
40 namespace InDetDD {
41  class TRT_DetectorManager;
42 }
43 
44 namespace InDet {
45  class IInDetTrackSelectionTool;
46 }
47 
48 class AtlasDetectorID;
49 class TRT_ID;
50 class Identifier;
51 class ComTime;
53 class ITRT_CalDbTool;
55 class ITRT_ConditionsSvc;
58 
60 public:
61  TRTMonitoringRun3ESD_Alg( const std::string& name, ISvcLocator* pSvcLocator );
62  virtual ~TRTMonitoringRun3ESD_Alg();
63  virtual StatusCode initialize() override;
64  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
65 private:
66  BooleanProperty m_ArgonXenonSplitter{this, "doArgonXenonSeparation", true};
67  enum GasType{ Xe = 0, Ar = 1, Kr = 2 };
68 
70 
72  const xAOD::TrigDecision* trigDecision,
73  const ComTime* comTimeObject,
74  const xAOD::EventInfo& eventInfo) const;
76  const xAOD::EventInfo& eventInfo, const EventContext& ctx) const;
77  int strawLayerNumber(int strawLayerNumber, int LayerNumber) const;
78 
79 
80  // Returns the straw number (0-1641) given the layerNumber, strawlayerNumber, and strawNumber, all gotten from Athena IDHelper
81  int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const;
82  // Returns Barrel Board Number
83  int chipToBoard(int chip) const;
84  // Returns EndCap Board Number
85  int chipToBoard_EndCap(int chip) const;
86 
87  // Returns Degrees, converted from radians (Athena Standard units)
88  float radToDegrees(float radValue) const;
89  int strawNumber_reverse (int inp_strawnumber, int* strawNumber, int* strawlayerNumber, int* LayerNumber) const;
90  int strawLayerNumber_reverse(int strawLayerNumInp,int* strawLayerNumber, int* LayerNumber) const;
91  int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const;
92  bool checkEventBurst(const TRT_RDO_Container& rdoContainer) const;
93 
94 private:
95  static const int s_numberOfBarrelStacks;
96  static const int s_numberOfEndCapStacks;
97  static const int s_Straw_max[2];
98  static const int s_iStack_max[2];
99  static const int s_iChip_max[2];
100  static const int s_numberOfStacks[2];
101  static const int s_moduleNum[2];
102 
103  // Services
104  ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool;
106  ToolHandle<ITRT_CalDbTool> m_TRTCalDbTool;
107 
108  // Data handles
109  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackCollectionKey{this, "TrackParticleContainerKeys", "InDetTrackParticles", "Keys for TrackParticle Container"};
110  SG::ReadHandleKey<xAOD::EventInfo> m_xAODEventInfoKey{this, "xAODEventInfo", "EventInfo", "Name of EventInfo object"};
111  SG::ReadHandleKey<InDetTimeCollection> m_TRT_BCIDCollectionKey{this, "TRTBCIDCollectionName", "TRT_BCID", "Name of TRT BCID collection"};
112  SG::ReadHandleKey<ComTime> m_comTimeObjectKey{this, "ComTimeObjectName", "TRT_Phase", "Name of ComTime object"};
113  SG::ReadHandleKey<xAOD::TrigDecision> m_trigDecisionKey{this, "TrigDecisionObjectName", "xTrigDecision", "Name of trigger decision object"};
114 
115  // Tools
116  ToolHandle<Trk::ITrackSummaryTool> m_TrackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryTool", "Track summary tool name"};
117  ToolHandle<ITRT_DriftFunctionTool> m_drifttool;
118 
121 
124  bool m_doChips;
125  bool m_doShift;
127 
128  std::vector<std::vector<unsigned char>> m_mat_chip_B{64, std::vector<unsigned char>(1642)};
129  std::vector<std::vector<unsigned char>> m_mat_chip_E{64, std::vector<unsigned char>(3840)};
130 
133 
139  float m_minP;
140  float m_min_pT;
141 
142  // Deciphers status HT to GasType Enumerator
143  inline GasType Straw_Gastype(int stat) const {
144  // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton}.
145  // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
146  GasType Gas = Xe; // Xenon is default
147  if (m_ArgonXenonSplitter) {
148  // int stat=m_sumSvc->getStatusHT(TRT_Identifier);
149  if ( stat==2 || stat==3 ) { Gas = Xe; } // Xe
150  else if ( stat==1 || stat==4 ) { Gas = Ar; } // Ar
151  else if ( stat==5 ) { Gas = Kr; } // Kr
152  else if ( stat==6 ) { Gas = Xe; } // Emulate Ar (so treat as Xe here)
153  else if ( stat==7 ) { Gas = Xe; } // Emulate Kr (so treat as Xe here)
154  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!");
155  throw std::exception();
156  }
157  }
158  return Gas;
159  }
160 
162  ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool;
163 };
164 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TRTMonitoringRun3ESD_Alg::initialize
virtual StatusCode initialize() override
initialize
Definition: TRTMonitoringRun3ESD_Alg.cxx:78
TRTMonitoringRun3ESD_Alg::m_min_pixel_hits
int m_min_pixel_hits
Definition: TRTMonitoringRun3ESD_Alg.h:135
TRTMonitoringRun3ESD_Alg::m_minP
float m_minP
Definition: TRTMonitoringRun3ESD_Alg.h:139
ITrackSummaryTool.h
IInDetConditionsSvc
Definition: IInDetConditionsSvc.h:24
TRTMonitoringRun3ESD_Alg::strawNumberEndCap
int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:291
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TrigDecision.h
ComTime.h
TRTMonitoringRun3ESD_Alg::m_TRT_BCIDCollectionKey
SG::ReadHandleKey< InDetTimeCollection > m_TRT_BCIDCollectionKey
Definition: TRTMonitoringRun3ESD_Alg.h:111
TRTMonitoringRun3ESD_Alg::fillTRTTracks
StatusCode fillTRTTracks(const xAOD::TrackParticleContainer &trackCollection, const xAOD::TrigDecision *trigDecision, const ComTime *comTimeObject, const xAOD::EventInfo &eventInfo) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:414
TRTMonitoringRun3ESD_Alg::s_iStack_max
static const int s_iStack_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:98
TRTMonitoringRun3ESD_Alg::s_numberOfStacks
static const int s_numberOfStacks[2]
Definition: TRTMonitoringRun3ESD_Alg.h:100
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TRTMonitoringRun3ESD_Alg
Definition: TRTMonitoringRun3ESD_Alg.py:1
TRTMonitoringRun3ESD_Alg::m_min_si_hits
int m_min_si_hits
Definition: TRTMonitoringRun3ESD_Alg.h:134
TRTMonitoringRun3ESD_Alg::m_DistToStraw
float m_DistToStraw
Definition: TRTMonitoringRun3ESD_Alg.h:131
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
SG::ReadHandleKey< xAOD::TrackParticleContainer >
ComTime
Definition: ComTime.h:17
TRTMonitoringRun3ESD_Alg::radToDegrees
float radToDegrees(float radValue) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:369
TRTMonitoringRun3ESD_Alg::m_sumTool
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
Definition: TRTMonitoringRun3ESD_Alg.h:104
TRTMonitoringRun3ESD_Alg::m_pTRTHelper
const TRT_ID * m_pTRTHelper
Definition: TRTMonitoringRun3ESD_Alg.h:119
TRTMonitoringRun3ESD_Alg::s_numberOfBarrelStacks
static const int s_numberOfBarrelStacks
Definition: TRTMonitoringRun3ESD_Alg.h:95
TRT::Hit::side
@ side
Definition: HitInfo.h:83
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
TRTMonitoringRun3ESD_Alg::chipToBoard_EndCap
int chipToBoard_EndCap(int chip) const
TRTMonitoringRun3ESD_Alg::m_ArgonXenonSplitter
BooleanProperty m_ArgonXenonSplitter
Definition: TRTMonitoringRun3ESD_Alg.h:66
TRTMonitoringRun3ESD_Alg::m_mgr
const InDetDD::TRT_DetectorManager * m_mgr
Definition: TRTMonitoringRun3ESD_Alg.h:120
TRTMonitoringRun3ESD_Alg::m_doStraws
bool m_doStraws
Definition: TRTMonitoringRun3ESD_Alg.h:123
TRTMonitoringRun3ESD_Alg::Straw_Gastype
GasType Straw_Gastype(int stat) const
Definition: TRTMonitoringRun3ESD_Alg.h:143
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRTMonitoringRun3ESD_Alg::m_xAODEventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_xAODEventInfoKey
Definition: TRTMonitoringRun3ESD_Alg.h:110
AthMonitorAlgorithm.h
TRTMonitoringRun3ESD_Alg::m_TRTStrawNeighbourSvc
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Definition: TRTMonitoringRun3ESD_Alg.h:105
TrackCollection.h
calibdata.exception
exception
Definition: calibdata.py:496
TRTMonitoringRun3ESD_Alg::chipToBoard
int chipToBoard(int chip) const
TRTMonitoringRun3ESD_Alg::m_doTracksMon
bool m_doTracksMon
Definition: TRTMonitoringRun3ESD_Alg.h:122
TRTMonitoringRun3ESD_Alg::GasType
GasType
Definition: TRTMonitoringRun3ESD_Alg.h:67
TRTMonitoringRun3ESD_Alg::m_doExpert
bool m_doExpert
Definition: TRTMonitoringRun3ESD_Alg.h:126
TRTMonitoringRun3ESD_Alg::s_numberOfEndCapStacks
static const int s_numberOfEndCapStacks
Definition: TRTMonitoringRun3ESD_Alg.h:96
TRTMonitoringRun3ESD_Alg::strawNumber
int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:243
TRTMonitoringRun3ESD_Alg::m_isCosmics
bool m_isCosmics
Definition: TRTMonitoringRun3ESD_Alg.h:132
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
TRTMonitoringRun3ESD_Alg::TRTMonitoringRun3ESD_Alg
TRTMonitoringRun3ESD_Alg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRTMonitoringRun3ESD_Alg.cxx:41
ITRT_ConditionsSvc
Definition: ITRT_ConditionsSvc.h:34
ITRT_CalDbTool
Definition: ITRT_CalDbTool.h:30
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
IInDetTrackSelectionTool.h
beamspotman.stat
stat
Definition: beamspotman.py:266
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
ITRT_StrawStatusSummaryTool
Definition: ITRT_StrawStatusSummaryTool.h:27
ReadCondHandleKey.h
ITrackHoleSearchTool.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
TRTMonitoringRun3ESD_Alg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TRTMonitoringRun3ESD_Alg.h:69
TRTMonitoringRun3ESD_Alg::s_moduleNum
static const int s_moduleNum[2]
Definition: TRTMonitoringRun3ESD_Alg.h:101
ITRT_DriftFunctionTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold
StatusCode fillTRTHighThreshold(const xAOD::TrackParticleContainer &trackCollection, const xAOD::EventInfo &eventInfo, const EventContext &ctx) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:1236
TRTMonitoringRun3ESD_Alg::m_trigDecisionKey
SG::ReadHandleKey< xAOD::TrigDecision > m_trigDecisionKey
Definition: TRTMonitoringRun3ESD_Alg.h:113
TRTMonitoringRun3ESD_Alg::m_minTRThits
int m_minTRThits
Definition: TRTMonitoringRun3ESD_Alg.h:138
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
TRTMonitoringRun3ESD_Alg::strawNumber_reverse
int strawNumber_reverse(int inp_strawnumber, int *strawNumber, int *strawlayerNumber, int *LayerNumber) const
TRTMonitoringRun3ESD_Alg::m_trackSelTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
Definition: TRTMonitoringRun3ESD_Alg.h:162
ITRT_DAQ_ConditionsSvc
Definition: ITRT_DAQ_ConditionsSvc.h:19
TRTMonitoringRun3ESD_Alg::Kr
@ Kr
Definition: TRTMonitoringRun3ESD_Alg.h:67
TRTMonitoringRun3ESD_Alg::m_mat_chip_E
std::vector< std::vector< unsigned char > > m_mat_chip_E
Definition: TRTMonitoringRun3ESD_Alg.h:129
TRT_ID
Definition: TRT_ID.h:84
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
ITRT_StrawNeighbourSvc
Definition: ITRT_StrawNeighbourSvc.h:23
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
TRTMonitoringRun3ESD_Alg::~TRTMonitoringRun3ESD_Alg
virtual ~TRTMonitoringRun3ESD_Alg()
Definition: TRTMonitoringRun3ESD_Alg.cxx:76
TRTMonitoringRun3ESD_Alg::m_drifttool
ToolHandle< ITRT_DriftFunctionTool > m_drifttool
Definition: TRTMonitoringRun3ESD_Alg.h:117
TRTMonitoringRun3ESD_Alg::m_min_sct_hits
int m_min_sct_hits
Definition: TRTMonitoringRun3ESD_Alg.h:136
TRTMonitoringRun3ESD_Alg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TRTMonitoringRun3ESD_Alg.cxx:1461
TRTMonitoringRun3ESD_Alg::m_mat_chip_B
std::vector< std::vector< unsigned char > > m_mat_chip_B
Definition: TRTMonitoringRun3ESD_Alg.h:128
TRTMonitoringRun3ESD_Alg::m_TRTCalDbTool
ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool
Definition: TRTMonitoringRun3ESD_Alg.h:106
TRTMonitoringRun3ESD_Alg::m_doChips
bool m_doChips
Definition: TRTMonitoringRun3ESD_Alg.h:124
TRTMonitoringRun3ESD_Alg::strawLayerNumber
int strawLayerNumber(int strawLayerNumber, int LayerNumber) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:225
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
InDetTimeCollection.h
ReadHandle.h
Handle class for reading from StoreGate.
InDetRawDataCLASS_DEF.h
TRTMonitoringRun3ESD_Alg::m_min_trt_hits
int m_min_trt_hits
Definition: TRTMonitoringRun3ESD_Alg.h:137
TRTMonitoringRun3ESD_Alg::Xe
@ Xe
Definition: TRTMonitoringRun3ESD_Alg.h:67
TRTMonitoringRun3ESD_Alg::m_doShift
bool m_doShift
Definition: TRTMonitoringRun3ESD_Alg.h:125
TRTMonitoringRun3ESD_Alg::checkEventBurst
bool checkEventBurst(const TRT_RDO_Container &rdoContainer) const
Definition: TRTMonitoringRun3ESD_Alg.cxx:382
TRTMonitoringRun3ESD_Alg::Ar
@ Ar
Definition: TRTMonitoringRun3ESD_Alg.h:67
TRTMonitoringRun3ESD_Alg::m_min_pT
float m_min_pT
Definition: TRTMonitoringRun3ESD_Alg.h:140
TRTMonitoringRun3ESD_Alg::s_iChip_max
static const int s_iChip_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:99
xAOD::TrigDecision_v1
Interface to the raw trigger decision information of the event.
Definition: TrigDecision_v1.h:44
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
TRTMonitoringRun3ESD_Alg::s_Straw_max
static const int s_Straw_max[2]
Definition: TRTMonitoringRun3ESD_Alg.h:97
TRTMonitoringRun3ESD_Alg::m_TrackSummaryTool
ToolHandle< Trk::ITrackSummaryTool > m_TrackSummaryTool
Definition: TRTMonitoringRun3ESD_Alg.h:116
TRTMonitoringRun3ESD_Alg::m_EventBurstCut
int m_EventBurstCut
Definition: TRTMonitoringRun3ESD_Alg.h:161
TRTMonitoringRun3ESD_Alg::m_comTimeObjectKey
SG::ReadHandleKey< ComTime > m_comTimeObjectKey
Definition: TRTMonitoringRun3ESD_Alg.h:112
ServiceHandle< ITRT_StrawNeighbourSvc >
TRTMonitoringRun3ESD_Alg::strawLayerNumber_reverse
int strawLayerNumber_reverse(int strawLayerNumInp, int *strawLayerNumber, int *LayerNumber) const
Identifier
Definition: IdentifierFieldParser.cxx:14
TRTMonitoringRun3ESD_Alg::m_trackCollectionKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackCollectionKey
Definition: TRTMonitoringRun3ESD_Alg.h:109