ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_TrackSegmentsMaker_ECcosmics.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// 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
26
30
31#include <iosfwd>
32#include <list>
33
34class MsgStream;
35
36class TF1;
37
38class TRT_ID;
39namespace InDet{
40 class TRT_DriftCircle;
41}
42
43namespace InDetDD{
45}
46
47namespace Trk{
48 class TrackSegment;
49 class Segment;
50}
51
53
54
55namespace InDet{
56
64 class TRT_TrackSegmentsMaker_ECcosmics : // This class read and write gErrorIgnoreLevel without a global lock for ROOT.
65 virtual public ITRT_TrackSegmentsMaker, public AthAlgTool
66 {
68 // Public methods:
70
71 public:
72
74 // Standard tool methods
76
79 (const std::string&,const std::string&,const IInterface*);
81 virtual StatusCode initialize() override;
82 virtual StatusCode finalize () override;
83
85 // Methods to initialize tool for new event or region
87
88 virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newEvent(const EventContext& ctx) const override;
89 virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newRegion(const EventContext& ctx, const std::vector<IdentifierHash>&) const override;
90 void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
91
93 // Methods of seeds production without vertex constraint
95
96 virtual void find(const EventContext &ctx,
99
101 // Iterator through seeds pseudo collection produced accordingly
102 // methods find
104
105 virtual Trk::TrackSegment* next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
106
108 // Print internal tool parameters and status
110
111 virtual MsgStream& dump (MsgStream & out) const override;
112 virtual std::ostream& dump (std::ostream& out) const override;
113
114 protected:
115 class EventData;
116 class EventData : public Trk::EventDataBase<EventData,InDet::ITRT_TrackSegmentsMaker::IEventData>
117 {
119 public:
121 m_segiterator = m_segments.begin();
122 }
123
125 std::vector<std::vector<const InDet::TRT_DriftCircle*> *>::iterator sit,sitE;
126 sit= m_seeds.begin();
127 sitE= m_seeds.end();
128 for(;sit!=sitE;++sit){
129 (*sit)->clear();
130 delete(*sit);
131 }
132 }
133
134 protected:
135 std::list<const InDet::TRT_DriftCircle*> m_noiseHits;
136 std::list<const InDet::TRT_DriftCircle*> m_goodHits;
137
138
139 std::list<const InDet::TRT_DriftCircle*> m_sectors[2][20][16];
140
141 std::vector<std::vector<const InDet::TRT_DriftCircle*> *> m_seeds;
142 std::list<Trk::TrackSegment*> m_segments ;
143 std::list<Trk::TrackSegment*>::iterator m_segiterator ;
144
145 double m_a_z[1000];
146 double m_a_phi[1000];
147 double m_a_phi_err[1000];
148 double m_a_tan[1000];
149 double m_a_tan_err[1000];
150 double m_a_z_err[1000];
151 double m_a_steigung[1000];
152
153 // Fitting functions
154 TF1 *m_fitf_ztanphi=nullptr;
155 TF1 *m_fitf_zphi=nullptr;
156
158 TF1 *m_fitf_zphi_approx=nullptr;
159
160 };
161
163 // Protected data and methods
165
166 BooleanProperty m_phaseMode{this, "Phase", false,
167 "Switch to destinguish between phase calculation and full reco"};
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"};
173
174 ToolHandle<Trk::IRIO_OnTrackCreator> m_riomakerD
175 {this, "RIOonTrackToolYesDr",
176 "InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool",
177 "RI0_onTrack creator with drift information"};
178 ToolHandle<Trk::IRIO_OnTrackCreator> m_riomakerN
179 {this, "RIOonTrackToolNoDr",
180 "InDet::TRT_DriftCircleOnTrackNoDriftTimeTool/TRT_DriftCircleOnTrackNoDriftTimeTool",
181 "RI0_onTrack creator without drift information"};
182
183 BooleanProperty m_useDriftTime{this, "UseDriftTime", false,
184 "Shall the drifttime be used or only tube hits?"};
185 DoubleProperty m_scaleTube{this, "ScaleFactorTube", 2.,
186 "Scalefactor for uncertainty of tube hits"};
187 DoubleProperty m_scaleFactorDrift{this, "ScaleFactorDrift", 1.,
188 "Scalefactor for uncertainty of drifttime hits"};
189 DoubleProperty m_scaleTubeNoise{this, "ScaleFactorTubeNoise", 1.,
190 "Scalefactor for uncertainty of tube hits flagged as noise"};
191 DoubleProperty m_cutToTLoose{this, "ToTCutLoose", 7.,
192 "Loose cut on ToT (preselection)"};
193 DoubleProperty m_cutToTTight{this, "ToTCutTight", 18.,
194 "Hard cut on ToT (preselection)"};
195 DoubleProperty m_cutToTUpper{this, "ToTCutUpper", 32.,
196 "Upper cut on ToT (preselection)"};
197 IntegerProperty m_minDCSeed{this, "MinDCperSeed", 7,
198 "Minimum number of driftcircles to form a seed"};
199 IntegerProperty m_hitLimit{this, "HitLimit", 2000,
200 "Maximum number of good hits (i.e. after noise cut) in endcap"};
201
202 static std::mutex s_fitMutex; // @TODO not sufficient need a global root lock
203
205 // Protected methods
207
211
214 bool find_seed(int endcap, int zslice, int sector,TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const;
215
218 int evaluate_seed(int endcap,int zslice,int sector,const double *p, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const;
219
222 void create_segment(std::vector<const InDet::TRT_DriftCircle*> *seed,
224
226
230
233 bool is_suspicious(const InDet::TRT_DriftCircle* dc, std::vector<const InDet::TRT_DriftCircle*> *seed) const;
234
237 static double phidiff(double a,double b);
238
241 bool accepted(const std::list<const InDet::TRT_DriftCircle*>::iterator compareIt,
242 std::list<const InDet::TRT_DriftCircle*> & container,
243 double phiLimit, double dzLimit) const;
244
245 };
246
247} // end of name space
248
249
251{
252 double c=a-b;
253
254 if(std::abs(c)>100)
255 c/=int(c/(2*M_PI));
256 while(c>=M_PI) c-=2*M_PI;
257 while(c<-M_PI) c+=2*M_PI;
258 return c;
259}
260
261#endif // TRT_TrackSegmentsMaker_ECcosmics_H
262
#define M_PI
static Double_t a
Property holding a SG store/key/clid from which a ReadHandle is made.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
std::vector< std::vector< const InDet::TRT_DriftCircle * > * > m_seeds
Vector of seeds.
std::list< const InDet::TRT_DriftCircle * > m_goodHits
List containing potenitally good hits.
std::list< const InDet::TRT_DriftCircle * > m_noiseHits
List containing potentially noise hits.
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.
std::list< Trk::TrackSegment * >::iterator m_segiterator
Iterator over found segments.
std::list< Trk::TrackSegment * > m_segments
List of found segments.
AlgTool that creates TrackSegments out of TRT Driftcircles in the special case of cosmic runs in SR1.
virtual void find(const EventContext &ctx, InDet::ITRT_TrackSegmentsMaker::IEventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_trtname
TRTs container.
ToolHandle< Trk::IRIO_OnTrackCreator > m_riomakerN
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?
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
void setFitFunctions(TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
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.
void create_segment(std::vector< const InDet::TRT_DriftCircle * > *seed, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Create segment out of a seed.
TRT_TrackSegmentsMaker_ECcosmics(const std::string &, const std::string &, const IInterface *)
Constructor with parameters.
ToolHandle< Trk::IRIO_OnTrackCreator > m_riomakerD
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.
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newEvent(const EventContext &ctx) const override
void retrieveHits(TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
sort hits into good/noise lists
bool find_seed(int endcap, int zslice, int sector, TRT_TrackSegmentsMaker_ECcosmics::EventData &event_data) const
Find seed in the given sector/zslice/endcap.
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.
static double phidiff(double a, double b)
provide the proper subtraction of two phi values
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newRegion(const EventContext &ctx, const std::vector< IdentifierHash > &) const override
A PRD is mapped onto all contributing particles.
Property holding a SG store/key/clid from which a ReadHandle is made.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Base for a helper class to pass mutable storage to tools.
Base class for all TrackSegment implementations, extends the common MeasurementBase.
Class for a generic track segment that holdes polymorphic Trk::MeasurementBase objects,...
holding In fact this class is here in order to allow STL container for all features This class is sho...
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
Message Stream Member.
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file