ATLAS Offline Software
TRT_TrackSegmentsMaker_ATLxk.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Header file for class TRT_TrackSegmentsMaker_ATLxk
8 // (c) ATLAS Detector software
10 // Class for track candidates generation using InDet::TRT_DriftCircles
11 // for standard Atlas geometry
13 // Version 1.0 11/10/2005 I.Gavrilenko
15 
16 #ifndef TRT_TrackSegmentsMaker_ATLxk_H
17 #define TRT_TrackSegmentsMaker_ATLxk_H
18 
19 #include <list>
20 #include <map>
21 
22 #include "GaudiKernel/ServiceHandle.h"
23 #include "GaudiKernel/ToolHandle.h"
35 
37 
38 class MsgStream;
39 
40 namespace InDet{
41 
42  class ITRT_TrackExtensionTool;
43 
45  virtual public ITRT_TrackSegmentsMaker, public AthAlgTool
46  {
48  // Public methods:
50 
51  public:
52 
54  // Standard tool methods
56 
58  (const std::string&,const std::string&,const IInterface*);
60  virtual StatusCode initialize() override;
61  virtual StatusCode finalize () override;
62 
64  // Methods to initialize tool for new event or region
66 
67  virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newEvent (const EventContext& ctx) const override;
68  virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newRegion(const EventContext& ctx, const std::vector<IdentifierHash>&) const override;
69  void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
70 
72  // Methods of seeds production without vertex constraint
74 
75  virtual void find(const EventContext &ctx,
78 
80  // Iterator through seeds pseudo collection produced accordingly
81  // methods find
83 
84  virtual Trk::TrackSegment* next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
85 
87  // Print internal tool parameters and status
89 
90  virtual MsgStream& dump (MsgStream & out) const override;
91  virtual std::ostream& dump (std::ostream& out) const override;
92 
93  protected:
94 
95  class EventData;
96  class EventData : public Trk::EventDataBase<EventData,InDet::ITRT_TrackSegmentsMaker::IEventData>
97  {
99  public:
100  EventData(const TRT_DriftCircleContainer *trtcontainer, unsigned int cirsize) : m_trtcontainer(trtcontainer) {
101  m_segiterator = m_segments.begin();
102  m_sizebin_iterator = m_sizebin.rend();
103  m_circles = new TRT_DriftCircleLinkN_xk[cirsize];
104  }
105 
106  ~EventData() { delete [] m_circles; }
107  EventData (const EventData&) = delete;
108  EventData& operator= (const EventData&) = delete;
109 
110  protected:
112  std::unique_ptr<InDet::ITRT_TrackExtensionTool::IEventData> m_extEventData;
113  int m_clusters = 0 ;
114  int m_nlocal = 0 ;
115  int m_nsegments = 0 ;
116 
117  std::multimap<unsigned int,unsigned int> m_bincluster ;
118  std::multimap<unsigned int,unsigned int> m_sizebin ;
119 
120  std::list<Trk::TrackSegment*> m_segments ;
122 
123  std::multimap<unsigned int,unsigned int>::reverse_iterator m_sizebin_iterator;
124 
125  union {unsigned char H[227500*4]; unsigned int H4[227500];} m_U;
126 
127  std::multimap<const InDet::TRT_DriftCircle*,Trk::TrackSegment*> m_clusterSegment;
128  std::multimap<int ,Trk::TrackSegment*> m_qualitySegment;
129 
131 
132  };
133 
135  // Protected data and methods
137 
138  StringProperty m_fieldmode{this, "MagneticFieldMode", "MapSolenoid",
139  "Mode of magnetic field"};
140  ToolHandle<ITRT_TrackExtensionTool> m_extensionTool
141  {this, "TrackExtensionTool", "InDet::TRT_TrackExtensionTool_xk"} ; // TRT track extension tool
142 
143  Trk::MagneticFieldProperties m_fieldprop ; // Magnetic field properties
144  const TRT_ID * m_trtid{} ;
145  SG::ReadHandleKey<InDet::TRT_DriftCircleContainer> m_trtname{this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve TRT_DriftCircles"}; // TRTs container ; // Name TRT container
146  SG::ReadCondHandleKey<InDet::TRT_TrackSegmentsToolCondData_xk> m_condDataKey{this, "CondDataKey","TRT_TrackSegmentsToolCondData_xk", "Key of TRT_TrackSegmentsToolCondData"};
148  {this,"PRDtoTrackMap",""};
149 
150  BooleanProperty m_removeNoise{this, "RemoveNoiseDriftCircles", true};
151  IntegerProperty m_clustersCut{this, "MinNumberDriftCircles", 10};
152  FloatProperty m_pTmin{this, "pTmin", 500.};
153  FloatProperty m_sharedfrac{this, "sharedFrac", 0.3};
154  IntegerProperty m_nPhi{this, "NumberAzimuthalChannel", 500,
155  "number azimuthal channel"};
156  IntegerProperty m_nMom{this, "NumberMomentumChannel", 70,
157  "number momentum channel"};
158 
160  int m_Ts{} ;
161  int m_Ns128{} ;
162  float m_Psi{} ;
163  float m_Psi128{} ;
164  float m_A{} ;
165  float m_Ai{} ;
166  int m_histsize{} ; // histogram size
167 
168 
170  // Protected methods
172 
173  inline
176  if (not condDataHandle.isValid()) {
177  ATH_MSG_FATAL("Failed to get " << m_condDataKey.key());
178  }
179  return *condDataHandle;
180  }
181 
182  void magneticFieldInit();
184  void fillHistogramm (float,int, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const;
185  void analyseHistogramm(unsigned char&,unsigned int&,float,int,TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const;
186  unsigned int localMaximum(unsigned int, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const;
187 
188  void findLocaly(const EventContext &ctx,
189  unsigned int,
190  const Trk::PRDtoTrackMap *prd_to_track_map,
193 
195 
196  MsgStream& dumpConditions(MsgStream & out) const;
197  static MsgStream& dumpEvent (MsgStream & out,InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) ;
198  };
199 
200 } // end of name space
201 
202 #endif // TRT_TrackSegmentsMaker_ATLxk_H
203 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
used
PRDtoTrackMap.h
InDet::TRT_TrackSegmentsMaker_ATLxk::findLocaly
void findLocaly(const EventContext &ctx, unsigned int, const Trk::PRDtoTrackMap *prd_to_track_map, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:589
Trk::EventDataBase
Base for a helper class to pass mutable storage to tools.
Definition: EventDataBase.h:17
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::TRT_TrackSegmentsMaker_ATLxk::m_outputlevel
int m_outputlevel
Definition: TRT_TrackSegmentsMaker_ATLxk.h:159
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_qualitySegment
std::multimap< int,Trk::TrackSegment * > m_qualitySegment
Definition: TRT_TrackSegmentsMaker_ATLxk.h:128
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::EventData
EventData(const EventData &)=delete
InDet::TRT_TrackSegmentsMaker_ATLxk::dumpEvent
static MsgStream & dumpEvent(MsgStream &out, InDet::ITRT_TrackSegmentsMaker::IEventData &event_data)
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:486
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
TRT_DetectorManager.h
InDet::TRT_TrackSegmentsToolCondData_xk
Definition: TRT_TrackSegmentsToolCondData_xk.h:13
InDet::TRT_TrackSegmentsMaker_ATLxk::m_histsize
int m_histsize
Definition: TRT_TrackSegmentsMaker_ATLxk.h:166
InDet::TRT_TrackSegmentsMaker_ATLxk::dump
virtual MsgStream & dump(MsgStream &out) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:393
EventDataBase.h
InDet::TRT_TrackSegmentsMaker_ATLxk::m_nMom
IntegerProperty m_nMom
Definition: TRT_TrackSegmentsMaker_ATLxk.h:156
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
InDet::TRT_TrackSegmentsMaker_ATLxk::m_Ai
float m_Ai
Definition: TRT_TrackSegmentsMaker_ATLxk.h:165
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::TRT_TrackSegmentsMaker_ATLxk::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TRT_TrackSegmentsMaker_ATLxk.h:148
InDet::TRT_TrackSegmentsMaker_ATLxk
Definition: TRT_TrackSegmentsMaker_ATLxk.h:46
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_trtcontainer
const InDet::TRT_DriftCircleContainer * m_trtcontainer
Definition: TRT_TrackSegmentsMaker_ATLxk.h:111
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_clusterSegment
std::multimap< const InDet::TRT_DriftCircle *, Trk::TrackSegment * > m_clusterSegment
Definition: TRT_TrackSegmentsMaker_ATLxk.h:127
InDet::TRT_TrackSegmentsMaker_ATLxk::newEvent
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newEvent(const EventContext &ctx) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:109
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_extEventData
std::unique_ptr< InDet::ITRT_TrackExtensionTool::IEventData > m_extEventData
Definition: TRT_TrackSegmentsMaker_ATLxk.h:112
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_segiterator
std::list< Trk::TrackSegment * >::iterator m_segiterator
Definition: TRT_TrackSegmentsMaker_ATLxk.h:121
InDet::TRT_TrackSegmentsMaker_ATLxk::m_trtid
const TRT_ID * m_trtid
Definition: TRT_TrackSegmentsMaker_ATLxk.h:144
Trk::TrackSegment
Definition: TrackSegment.h:56
InDet::TRT_TrackSegmentsMaker_ATLxk::dumpConditions
MsgStream & dumpConditions(MsgStream &out) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:403
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer >
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_nsegments
int m_nsegments
Definition: TRT_TrackSegmentsMaker_ATLxk.h:115
InDet::TRT_TrackSegmentsMaker_ATLxk::m_sharedfrac
FloatProperty m_sharedfrac
Definition: TRT_TrackSegmentsMaker_ATLxk.h:153
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::H4
unsigned int H4[227500]
Definition: TRT_TrackSegmentsMaker_ATLxk.h:125
InDet::TRT_TrackSegmentsMaker_ATLxk::fillHistogramm
void fillHistogramm(float, int, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:548
InDet::TRT_TrackSegmentsMaker_ATLxk::analyseHistogramm
void analyseHistogramm(unsigned char &, unsigned int &, float, int, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:569
MagneticFieldProperties.h
InDet::TRT_TrackSegmentsMaker_ATLxk::getConditionsData
const TRT_TrackSegmentsToolCondData_xk * getConditionsData() const
Definition: TRT_TrackSegmentsMaker_ATLxk.h:174
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::~EventData
~EventData()
Definition: TRT_TrackSegmentsMaker_ATLxk.h:106
InDet::ITRT_TrackSegmentsMaker
Definition: ITRT_TrackSegmentsMaker.h:47
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData
Definition: TRT_TrackSegmentsMaker_ATLxk.h:97
InDet::TRT_TrackSegmentsMaker_ATLxk::endEvent
void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:281
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_clusters
int m_clusters
Definition: TRT_TrackSegmentsMaker_ATLxk.h:113
InDet::TRT_TrackSegmentsMaker_ATLxk::m_Ts
int m_Ts
Definition: TRT_TrackSegmentsMaker_ATLxk.h:160
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
ITRT_TrackSegmentsMaker.h
InDet::TRT_DriftCircleLinkN_xk
Definition: TRT_DriftCircleLinkN_xk.h:23
ITRT_TrackExtensionTool.h
InDet::TRT_TrackSegmentsMaker_ATLxk::segmentsPreparation
static void segmentsPreparation(TRT_TrackSegmentsMaker_ATLxk::EventData &event_data)
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:733
InDet::TRT_TrackSegmentsMaker_ATLxk::initialize
virtual StatusCode initialize() override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:50
InDet::TRT_TrackSegmentsMaker_ATLxk::m_pTmin
FloatProperty m_pTmin
Definition: TRT_TrackSegmentsMaker_ATLxk.h:152
InDet::TRT_TrackSegmentsMaker_ATLxk::m_trtname
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_trtname
Definition: TRT_TrackSegmentsMaker_ATLxk.h:145
InDet::TRT_TrackSegmentsMaker_ATLxk::m_extensionTool
ToolHandle< ITRT_TrackExtensionTool > m_extensionTool
Definition: TRT_TrackSegmentsMaker_ATLxk.h:141
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_nlocal
int m_nlocal
Definition: TRT_TrackSegmentsMaker_ATLxk.h:114
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_bincluster
std::multimap< unsigned int, unsigned int > m_bincluster
Definition: TRT_TrackSegmentsMaker_ATLxk.h:117
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::H
unsigned char H[227500 *4]
Definition: TRT_TrackSegmentsMaker_ATLxk.h:125
TRT_TrackSegmentsToolCondData_xk.h
InDet::TRT_DriftCircleContainer
Trk::PrepRawDataContainer< TRT_DriftCircleCollection > TRT_DriftCircleContainer
Definition: TRT_DriftCircleContainer.h:27
TRT_DriftCircleContainer.h
TRT_DriftCircleLinkN_xk.h
InDet::TRT_TrackSegmentsMaker_ATLxk::eraseHistogramm
void eraseHistogramm(TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:525
InDet::TRT_TrackSegmentsMaker_ATLxk::~TRT_TrackSegmentsMaker_ATLxk
virtual ~TRT_TrackSegmentsMaker_ATLxk()
InDet::TRT_TrackSegmentsMaker_ATLxk::m_condDataKey
SG::ReadCondHandleKey< InDet::TRT_TrackSegmentsToolCondData_xk > m_condDataKey
Definition: TRT_TrackSegmentsMaker_ATLxk.h:146
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::EventData
EventData(const TRT_DriftCircleContainer *trtcontainer, unsigned int cirsize)
Definition: TRT_TrackSegmentsMaker_ATLxk.h:100
InDet::TRT_TrackSegmentsMaker_ATLxk::next
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:380
InDet::TRT_TrackSegmentsMaker_ATLxk::m_removeNoise
BooleanProperty m_removeNoise
Definition: TRT_TrackSegmentsMaker_ATLxk.h:150
InDet::TRT_TrackSegmentsMaker_ATLxk::m_Psi
float m_Psi
Definition: TRT_TrackSegmentsMaker_ATLxk.h:162
InDet::TRT_TrackSegmentsMaker_ATLxk::m_fieldprop
Trk::MagneticFieldProperties m_fieldprop
Definition: TRT_TrackSegmentsMaker_ATLxk.h:143
InDet::TRT_TrackSegmentsMaker_ATLxk::find
virtual void find(const EventContext &ctx, InDet::ITRT_TrackSegmentsMaker::IEventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:295
InDet::TRT_TrackSegmentsMaker_ATLxk::m_nPhi
IntegerProperty m_nPhi
Definition: TRT_TrackSegmentsMaker_ATLxk.h:154
SG::ReadCondHandleKey< InDet::TRT_TrackSegmentsToolCondData_xk >
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_segments
std::list< Trk::TrackSegment * > m_segments
Definition: TRT_TrackSegmentsMaker_ATLxk.h:120
TRT_ID
Definition: TRT_ID.h:84
InDet::TRT_TrackSegmentsMaker_ATLxk::m_Ns128
int m_Ns128
Definition: TRT_TrackSegmentsMaker_ATLxk.h:161
InDet::TRT_TrackSegmentsMaker_ATLxk::m_fieldmode
StringProperty m_fieldmode
Definition: TRT_TrackSegmentsMaker_ATLxk.h:138
InDet::TRT_TrackSegmentsMaker_ATLxk::m_A
float m_A
Definition: TRT_TrackSegmentsMaker_ATLxk.h:164
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_circles
TRT_DriftCircleLinkN_xk * m_circles
Definition: TRT_TrackSegmentsMaker_ATLxk.h:130
InDet::TRT_TrackSegmentsMaker_ATLxk::m_Psi128
float m_Psi128
Definition: TRT_TrackSegmentsMaker_ATLxk.h:163
InDet::TRT_TrackSegmentsMaker_ATLxk::finalize
virtual StatusCode finalize() override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:99
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::operator=
EventData & operator=(const EventData &)=delete
InDet::TRT_TrackSegmentsMaker_ATLxk::m_clustersCut
IntegerProperty m_clustersCut
Definition: TRT_TrackSegmentsMaker_ATLxk.h:151
InDet::TRT_TrackSegmentsMaker_ATLxk::magneticFieldInit
void magneticFieldInit()
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:790
InDet::TRT_TrackSegmentsMaker_ATLxk::newRegion
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newRegion(const EventContext &ctx, const std::vector< IdentifierHash > &) const override
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:198
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_U
union InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::@97 m_U
AthAlgTool
Definition: AthAlgTool.h:26
InDet::TRT_TrackSegmentsMaker_ATLxk::localMaximum
unsigned int localMaximum(unsigned int, TRT_TrackSegmentsMaker_ATLxk::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:763
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_sizebin_iterator
std::multimap< unsigned int, unsigned int >::reverse_iterator m_sizebin_iterator
Definition: TRT_TrackSegmentsMaker_ATLxk.h:123
InDet::ITRT_TrackSegmentsMaker::IEventData
Definition: ITRT_TrackSegmentsMaker.h:53
IGeoModelSvc.h
InDet::TRT_TrackSegmentsMaker_ATLxk::EventData::m_sizebin
std::multimap< unsigned int, unsigned int > m_sizebin
Definition: TRT_TrackSegmentsMaker_ATLxk.h:118
InDet::TRT_TrackSegmentsMaker_ATLxk::TRT_TrackSegmentsMaker_ATLxk
TRT_TrackSegmentsMaker_ATLxk(const std::string &, const std::string &, const IInterface *)
Definition: TRT_TrackSegmentsMaker_ATLxk.cxx:32