ATLAS Offline Software
TRT_TrackSegmentsMaker_ECcosmics.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TRT_TrackSegments.h
7 // Header file for class TRT_TrackSegmentsMaker_ECcosmics
9 // (c) ATLAS Detector software
10 //
11 // Based on TRT_TrackSegmentsMaker_CTBxk from I.Gavrilenko
13 // Christian.Schmitt@cern.ch
15 
16 
17 #ifndef TRT_TrackSegmentsMaker_ECcosmics_H
18 #define TRT_TrackSegmentsMaker_ECcosmics_H
19 
20 
21 #include "GaudiKernel/ToolHandle.h"
23 
25 
29 
30 #include <iosfwd>
31 #include <list>
32 
33 class MsgStream;
34 
35 class TF1;
36 
37 class TRT_ID;
38 namespace InDet{
39  class TRT_DriftCircle;
40  // class TRT_DriftCircleContainer;
41 }
42 
43 namespace InDetDD{
44  class TRT_DetectorManager;
45 }
46 
47 namespace Trk{
48  class TrackSegment;
49  class Segment;
50  class IRIO_OnTrackCreator;
51 }
52 
54 
55 
56 namespace InDet{
57 
65  class TRT_TrackSegmentsMaker_ECcosmics : // This class read and write gErrorIgnoreLevel without a global lock for ROOT.
66  virtual public ITRT_TrackSegmentsMaker, public AthAlgTool
67  {
69  // Public methods:
71 
72  public:
73 
75  // Standard tool methods
77 
80  (const std::string&,const std::string&,const IInterface*);
82  virtual StatusCode initialize() override;
83  virtual StatusCode finalize () override;
84 
86  // Methods to initialize tool for new event or region
88 
89  virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newEvent(const EventContext& ctx) const override;
90  virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newRegion(const EventContext& ctx, const std::vector<IdentifierHash>&) const override;
91  void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
92 
94  // Methods of seeds production without vertex constraint
96 
97  virtual void find(const EventContext &ctx,
100 
102  // Iterator through seeds pseudo collection produced accordingly
103  // methods find
105 
106  virtual Trk::TrackSegment* next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
107 
109  // Print internal tool parameters and status
111 
112  virtual MsgStream& dump (MsgStream & out) const override;
113  virtual std::ostream& dump (std::ostream& out) const override;
114 
115  protected:
116  class EventData;
117  class EventData : public Trk::EventDataBase<EventData,InDet::ITRT_TrackSegmentsMaker::IEventData>
118  {
120  public:
122  m_segiterator = m_segments.begin();
123  }
124 
126  std::vector<std::vector<const InDet::TRT_DriftCircle*> *>::iterator sit,sitE;
127  sit= m_seeds.begin();
128  sitE= m_seeds.end();
129  for(;sit!=sitE;++sit){
130  (*sit)->clear();
131  delete(*sit);
132  }
133  }
134 
135  protected:
136  std::list<const InDet::TRT_DriftCircle*> m_noiseHits;
137  std::list<const InDet::TRT_DriftCircle*> m_goodHits;
138 
139 
140  std::list<const InDet::TRT_DriftCircle*> m_sectors[2][20][16];
141 
142  std::vector<std::vector<const InDet::TRT_DriftCircle*> *> m_seeds;
143  std::list<Trk::TrackSegment*> m_segments ;
145 
146  double m_a_z[1000];
147  double m_a_phi[1000];
148  double m_a_phi_err[1000];
149  double m_a_tan[1000];
150  double m_a_tan_err[1000];
151  double m_a_z_err[1000];
152  double m_a_steigung[1000];
153 
154  // Fitting functions
155  TF1 *m_fitf_ztanphi=nullptr;
156  TF1 *m_fitf_zphi=nullptr;
157 
158  TF1 *m_fitf_ztanphi_approx=nullptr;
159  TF1 *m_fitf_zphi_approx=nullptr;
160 
161  };
162 
164  // Protected data and methods
166 
167  bool m_phaseMode ;
168  const TRT_ID* m_trtid{} ;
169 
170  SG::ReadHandleKey<InDet::TRT_DriftCircleContainer> m_trtname{this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve TRT_DriftCircles"};
172  {this,"PRDtoTrackMap",""};
173 
174  ToolHandle<Trk::IRIO_OnTrackCreator> m_riomakerD ;
175  ToolHandle<Trk::IRIO_OnTrackCreator> m_riomakerN ;
176 
178  double m_scaleTube ;
181  double m_cutToTLoose ;
182  double m_cutToTTight ;
183  double m_cutToTUpper ;
184  int m_minDCSeed ;
185  int m_hitLimit ;
186 
187  static std::mutex s_fitMutex; // @TODO not sufficient need a global root lock
188 
190  // Protected methods
192 
196 
199  bool find_seed(int endcap, int zslice, int sector,TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const;
200 
203  int evaluate_seed(int endcap,int zslice,int sector,const double *p, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const;
204 
207  void create_segment(std::vector<const InDet::TRT_DriftCircle*> *seed,
209 
211 
215 
218  bool is_suspicious(const InDet::TRT_DriftCircle* dc, std::vector<const InDet::TRT_DriftCircle*> *seed) const;
219 
222  static double phidiff(double a,double b);
223 
227  std::list<const InDet::TRT_DriftCircle*> & container,
228  double phiLimit, double dzLimit) const;
229 
230  };
231 
232 } // end of name space
233 
234 
236 {
237  double c=a-b;
238 
239  if(std::abs(c)>100)
240  c/=int(c/(2*M_PI));
241  while(c>=M_PI) c-=2*M_PI;
242  while(c<-M_PI) c+=2*M_PI;
243  return c;
244 }
245 
246 #endif // TRT_TrackSegmentsMaker_ECcosmics_H
247 
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_ECcosmics::EventData::m_fitf_ztanphi_approx
TF1 * m_fitf_ztanphi_approx
approx function to fit tan(phi) vs.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:158
Trk::EventDataBase
Base for a helper class to pass mutable storage to tools.
Definition: EventDataBase.h:17
InDet::TRT_TrackSegmentsMaker_ECcosmics::setFitFunctions
void setFitFunctions(TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:141
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_goodHits
std::list< const InDet::TRT_DriftCircle * > m_goodHits
List containing potenitally good hits.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:137
InDet::TRT_TrackSegmentsMaker_ECcosmics::perform_fit
TF1 * perform_fit(int count, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Perform the fit and return a function that provides the fitted phi information.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1760
InDet::TRT_TrackSegmentsMaker_ECcosmics::find_seed
bool find_seed(int endcap, int zslice, int sector, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Find seed in the given sector/zslice/endcap.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:412
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDet::TRT_TrackSegmentsMaker_ECcosmics::accepted
bool accepted(const std::list< const InDet::TRT_DriftCircle * >::iterator compareIt, std::list< const InDet::TRT_DriftCircle * > &container, double phiLimit, double dzLimit) const
is the hit accepted?
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1719
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
EventDataBase.h
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
InDet::TRT_TrackSegmentsMaker_ECcosmics::is_suspicious
bool is_suspicious(const InDet::TRT_DriftCircle *dc, std::vector< const InDet::TRT_DriftCircle * > *seed) const
checks if a hit that matches the segment looks suspicious (i.e.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1846
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_scaleTubeNoise
double m_scaleTubeNoise
Scalefactor for uncertainty of tube hits flagged as noise.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:180
InDet::TRT_TrackSegmentsMaker_ECcosmics::next
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1541
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_scaleFactorDrift
double m_scaleFactorDrift
Scalefactor for uncertainty of drifttime hits
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:179
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_segiterator
std::list< Trk::TrackSegment * >::iterator m_segiterator
Iterator over found segments.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:144
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_riomakerD
ToolHandle< Trk::IRIO_OnTrackCreator > m_riomakerD
RI0_onTrack creator with drift information.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:174
Trk::TrackSegment
Definition: TrackSegment.h:56
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer >
InDet::TRT_TrackSegmentsMaker_ECcosmics::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_ECcosmics.cxx:328
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_fitf_zphi
TF1 * m_fitf_zphi
analytic function to fit phi vs.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:156
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_cutToTTight
double m_cutToTTight
Hard cut on ToT (preselection)
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:182
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_sectors
std::list< const InDet::TRT_DriftCircle * > m_sectors[2][20][16]
Divide into two endcaps and each endcap into 16 sectors in phi and 20 in z.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:140
InDet::TRT_TrackSegmentsMaker_ECcosmics::phidiff
static double phidiff(double a, double b)
provide the proper subtraction of two phi values
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:235
InDet::TRT_TrackSegmentsMaker_ECcosmics::newEvent
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newEvent(const EventContext &ctx) const override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:182
InDet::ITRT_TrackSegmentsMaker
Definition: ITRT_TrackSegmentsMaker.h:47
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_useDriftTime
bool m_useDriftTime
Shall the drifttime be used or only tube hits?
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:177
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_minDCSeed
int m_minDCSeed
Minimum number of driftcircles to form a seed
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:184
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::TRT_TrackSegmentsMaker_ECcosmics::finalize
virtual StatusCode finalize() override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:171
InDet::TRT_TrackSegmentsMaker_ECcosmics::endEvent
void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:274
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_cutToTLoose
double m_cutToTLoose
Loose cut on ToT (preselection)
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:181
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::~EventData
~EventData()
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:125
AthAlgTool.h
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_riomakerN
ToolHandle< Trk::IRIO_OnTrackCreator > m_riomakerN
RI0_onTrack creator without drift information.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:175
ITRT_TrackSegmentsMaker.h
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_z_err
double m_a_z_err[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:151
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_seeds
std::vector< std::vector< const InDet::TRT_DriftCircle * > * > m_seeds
Vector of seeds.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:142
InDet::TRT_TrackSegmentsMaker_ECcosmics::create_segment
void create_segment(std::vector< const InDet::TRT_DriftCircle * > *seed, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Create segment out of a seed.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:825
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_phi_err
double m_a_phi_err[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:148
InDet::TRT_TrackSegmentsMaker_ECcosmics::~TRT_TrackSegmentsMaker_ECcosmics
virtual ~TRT_TrackSegmentsMaker_ECcosmics()
InDet::TRT_TrackSegmentsMaker_ECcosmics::evaluate_seed
int evaluate_seed(int endcap, int zslice, int sector, const double *p, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Evaluate how many dc match this seed.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:770
InDet::TRT_TrackSegmentsMaker_ECcosmics
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:67
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:118
InDet::TRT_TrackSegmentsMaker_ECcosmics::newRegion
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newRegion(const EventContext &ctx, const std::vector< IdentifierHash > &) const override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:229
Trk::RIO_OnTrackType::TRT_DriftCircle
@ TRT_DriftCircle
Definition: RIO_OnTrack.h:59
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_noiseHits
std::list< const InDet::TRT_DriftCircle * > m_noiseHits
List containing potentially noise hits.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:136
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_hitLimit
int m_hitLimit
Maximum number of good hits (i.e.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:185
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_fitf_ztanphi
TF1 * m_fitf_ztanphi
analytic function to fit tan(phi) vs.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:155
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_scaleTube
double m_scaleTube
Scalefactor for uncertainty of tube hits
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:178
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:172
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_tan
double m_a_tan[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:149
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_phaseMode
bool m_phaseMode
Switch to destinguish between phase calculation and full reco.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:167
TRT_ID
Definition: TRT_ID.h:84
a
TList * a
Definition: liststreamerinfos.cxx:10
InDet::TRT_TrackSegmentsMaker_ECcosmics::TRT_TrackSegmentsMaker_ECcosmics
TRT_TrackSegmentsMaker_ECcosmics(const std::string &, const std::string &, const IInterface *)
Constructor with parameters.
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:37
InDet::TRT_TrackSegmentsMaker_ECcosmics::initialize
virtual StatusCode initialize() override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:102
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_tan_err
double m_a_tan_err[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:150
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_trtid
const TRT_ID * m_trtid
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:168
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_z
double m_a_z[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:146
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_fitf_zphi_approx
TF1 * m_fitf_zphi_approx
anpprox function to fit phi vs.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:159
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_cutToTUpper
double m_cutToTUpper
Upper cut on ToT (preselection)
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:183
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_steigung
double m_a_steigung[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:152
AthAlgTool
Definition: AthAlgTool.h:26
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_segments
std::list< Trk::TrackSegment * > m_segments
List of found segments.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:143
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::m_a_phi
double m_a_phi[1000]
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:147
InDet::ITRT_TrackSegmentsMaker::IEventData
Definition: ITRT_TrackSegmentsMaker.h:53
InDet::TRT_TrackSegmentsMaker_ECcosmics::dump
virtual MsgStream & dump(MsgStream &out) const override
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1554
python.compressB64.c
def c
Definition: compressB64.py:93
InDet::TRT_TrackSegmentsMaker_ECcosmics::m_trtname
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_trtname
TRTs container.
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:170
InDet::TRT_TrackSegmentsMaker_ECcosmics::s_fitMutex
static std::mutex s_fitMutex
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:187
InDet::TRT_TrackSegmentsMaker_ECcosmics::EventData::EventData
EventData()
Definition: TRT_TrackSegmentsMaker_ECcosmics.h:121
InDet::TRT_TrackSegmentsMaker_ECcosmics::retrieveHits
void retrieveHits(TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
sort hits into good/noise lists
Definition: TRT_TrackSegmentsMaker_ECcosmics.cxx:1574