ATLAS Offline Software
Loading...
Searching...
No Matches
TRTMonitoringRun3RAW_Alg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
21
22// Tool interfaces
27
30
32
33#include "CLHEP/Units/SystemOfUnits.h"
34
35// STDLIB
36#include <string>
37#include <vector>
38#include <set>
39
40namespace InDetDD {
42}
43
45class TRT_ID;
46class Identifier;
49
51public:
52 TRTMonitoringRun3RAW_Alg( const std::string& name, ISvcLocator* pSvcLocator );
54 virtual StatusCode initialize() override;
55 virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
56
57private:
61
62 std::vector<std::vector<unsigned char>> m_mat_chip_E{64, std::vector<unsigned char>(3840)};
63 std::vector<std::vector<unsigned char>> m_mat_chip_B{64, std::vector<unsigned char>(1642)};
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 BooleanProperty m_doStraws{this, "doStraws", true, ""};
72 BooleanProperty m_doExpert{this, "doExpert", false, ""};
73 BooleanProperty m_doChips{this, "doChips", true, ""};
74 BooleanProperty m_doTracksMon{this, "doTracksMon", true, ""};
75 BooleanProperty m_doRDOsMon{this, "doRDOsMon", true, ""};
76 BooleanProperty m_doShift{this, "doShift", true, ""};
77 BooleanProperty m_doMaskStraws{this, "doMaskStraws", true, ""};
78 BooleanProperty m_useHoleFinder{this, "useHoleFinder", false, ""};
79 BooleanProperty m_doHitsMon{this, "DoHitsMon", true, ""};
80 FloatProperty m_DistToStraw{this, "DistanceToStraw", 0.4, ""};
81 FloatProperty m_usedEvents{this, "totalEvents", -1, ""};
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
90 IntegerProperty m_min_si_hits{this, "min_si_hits", 1, ""};
91 IntegerProperty m_min_pixel_hits{this, "min_pixel_hits", 0, ""};
92 IntegerProperty m_min_sct_hits{this, "min_sct_hits", 0, ""};
93 IntegerProperty m_min_trt_hits{this, "min_trt_hits", 10, ""};
94 IntegerProperty m_minTRThits{this, "MinTRTHitCut", 10, ""};
95 IntegerProperty m_every_xth_track{this, "every_xth_track", 1, ""};
96 FloatProperty m_max_abs_d0{this, "max_abs_d0", 10 * CLHEP::mm, ""};
97 FloatProperty m_max_abs_z0{this, "max_abs_z0", 300 * CLHEP::mm, ""};
98 FloatProperty m_max_abs_eta{this, "max_abs_eta", 2.5, ""};
99 FloatProperty m_minP{this, "MinTrackP", 0.0 * CLHEP::GeV, ""};
100 FloatProperty m_min_pT{this, "min_pT", 0.5 * CLHEP::GeV, ""};
101
102 StatusCode fillTRTRDOs(const EventContext& ctx,
103 const TRT_RDO_Container& rdoContainer,
104 const xAOD::EventInfo& eventInfo,
105 const InDetTimeCollection* trtBCIDCollection) const;
106 StatusCode fillTRTEfficiency(const EventContext& ctx,
107 const TrackCollection& combTrackCollection) const;
108 StatusCode fillTRTHits(const EventContext& ctx,
109 const TrackCollection& trackCollection) const;
110
111 int chipToBoard(int chip) const;
112 int chipToBoard_EndCap(int chip) const;
113 StatusCode checkTRTReadoutIntegrity(const xAOD::EventInfo& eventInfo) const;
114 std::vector<std::vector<std::vector<int>>> initScaleVectors(const EventContext& ctx) const;
115 bool checkEventBurst(const TRT_RDO_Container& rdoContainer) const;
116 int strawNumberEndCap(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const;
117 int strawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const;
118 int strawLayerNumber(int strawLayerNumber, int LayerNumber) const;
119 float radToDegrees(float radValue) const;
120 int strawNumber_reverse(int inp_strawnumber, int* strawNumber, int* strawlayerNumber, int* LayerNumber) const;
121 int strawLayerNumber_reverse(int strawLayerNumInp,int* strawLayerNumber, int* LayerNumber) const;
122
123 // Services
124 ToolHandle<ITRT_StrawStatusSummaryTool> m_sumTool{this, "InDetTRTStrawStatusSummaryTool", "TRT_StrawStatusSummaryTool", ""};
125 ServiceHandle<ITRT_StrawNeighbourSvc> m_TRTStrawNeighbourSvc{this, "StrawNeighbourSvc", "TRT_StrawNeighbourSvc", ""};
126 ServiceHandle<ITRT_ByteStream_ConditionsSvc> m_BSSvc{this, "TRT_ByteStream_ConditionsSvc", "TRT_ByteStream_ConditionsSvc", ""};
127 ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool{this, "TrackSelectionTool", "InDet::InDetTrackSelectionTool/TrackSelectionTool", ""};
128
129 // Data handles
130 SG::ReadHandleKey<TRT_RDO_Container> m_rdoContainerKey{this, "TRTRawDataObjectName", "TRT_RDOs", "Name of TRT RDOs container"};
131 SG::ReadHandleKey<InDetTimeCollection> m_TRT_BCIDCollectionKey{this, "TRTBCIDCollectionName", "TRT_BCID", "Name of TRT BCID collection"};
132 SG::ReadHandleKey<TrackCollection> m_combTrackCollectionKey{this, "track_collection_hole_finder", "CombinedInDetTracks", "Name of tracks container used for hole finder"};
133 SG::ReadHandleKey<TrackCollection> m_trackCollectionKey{this, "TRTTracksObjectName", "CombinedInDetTracks", "Name of tracks container"};
134
135 SG::ReadHandleKey<TRT_BSErrContainer> m_bsErrContKey{this,"ByteStreamErrors","TRT_ByteStreamErrs","SG key of TRT ByteStream Error container"};
136
137 // Tools
138 ToolHandle<Trk::ITrackHoleSearchTool> m_trt_hole_finder{this, "trt_hole_search", "TRTTrackHoleSearchTool", "Track hole search tool name"};
139 ToolHandle<Trk::ITrackSummaryTool> m_TrackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryTool", "Track summary tool name"};
140
141 enum GasType{ Xe = 0, Ar = 1, Kr = 2 };
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
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
161 BooleanProperty m_isCosmics{this, "IsCosmics", false};
162 IntegerProperty m_EventBurstCut{this, "EventBurstCut", -1};
163
164};
165#endif
#define ATH_MSG_FATAL(x)
Service for accessing TRT ByteStream conditions information.
abstract interface to TRT calibration constants
Abstract interface to information on straws electronic grouping.
std::vector< std::pair< uint32_t, unsigned int > > InDetTimeCollection
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
InDetRawDataContainer< InDetRawDataCollection< TRT_RDORawData > > TRT_RDO_Container
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
abstract interface to TRT straw status constants
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
Property holding a SG store/key/clid from which a ReadHandle is made.
GasType Straw_Gastype(int stat) const
const AtlasDetectorID * m_idHelper
ToolHandle< ITRT_StrawStatusSummaryTool > m_sumTool
SG::ReadHandleKey< TRT_RDO_Container > m_rdoContainerKey
SG::ReadHandleKey< TRT_BSErrContainer > m_bsErrContKey
SG::ReadHandleKey< InDetTimeCollection > m_TRT_BCIDCollectionKey
const InDetDD::TRT_DetectorManager * m_mgr
Gaudi::Property< std::vector< int > > m_iChipMax
Gaudi::Property< std::vector< int > > m_strawMax
ToolHandle< Trk::ITrackHoleSearchTool > m_trt_hole_finder
SG::ReadHandleKey< TrackCollection > m_combTrackCollectionKey
std::vector< std::vector< unsigned char > > m_mat_chip_B
std::vector< std::vector< unsigned char > > m_mat_chip_E
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
SG::ReadHandleKey< TrackCollection > m_trackCollectionKey
ToolHandle< Trk::ITrackSummaryTool > m_TrackSummaryTool
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
ServiceHandle< ITRT_ByteStream_ConditionsSvc > m_BSSvc
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Message Stream Member.
EventInfo_v1 EventInfo
Definition of the latest event info version.
void initialize()