ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_TrackSegmentsMaker_BarrelCosmics.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//
7// TRT_TrackSegmentsMaker_BarrelCosmics.h, (c) ATLAS Detector software
8//
9// TRT standalone segment finder for TRT barrel
10// specialized for cosmics and L2 trigger, plan to make it working in a magnetic field
11//
13
14#ifndef TRT_TrackSegmentsMaker_BarrelCosmics_H
15#define TRT_TrackSegmentsMaker_BarrelCosmics_H
16
17
22
24#include <vector>
25#include <string>
26#include <memory>
27#include <iosfwd>
28
29class MsgStream;
30class TRT_ID;
31
32namespace InDet{
33
41
43
44 public:
45
46 TRT_TrackSegmentsMaker_BarrelCosmics(const std::string &, const std::string &, const IInterface*);
48
50 // methods inherited from ITRT_TrackSegmentsMaker
51 // in each event, methods are called in this order:
52 // - newEvent() in the offline, newRegion(...) for L2 (directed search)
53 // - find() finds all segments
54 // - next() many times (returns next segment), untill next() returns 0 pointer
56
57 virtual StatusCode initialize() override;
58 virtual StatusCode finalize () override;
59
60 virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newEvent(const EventContext& ctx) const override;
61 virtual std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> newRegion(const EventContext& ctx, const std::vector<IdentifierHash>&) const override;
62 void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override;
63
64 virtual void find(const EventContext &ctx,
68 &event_data) const override;
69
70 virtual MsgStream& dump (MsgStream & out) const override
71 { return out; };
72 virtual std::ostream& dump (std::ostream& out) const override
73 { return out; };
74
75
76 protected:
77 class EventData;
78 class EventData : public Trk::EventDataBase<EventData,InDet::ITRT_TrackSegmentsMaker::IEventData>
79 {
81 public:
82 EventData(const TRT_DriftCircleContainer *trtcontainer) :m_trtcontainer(trtcontainer) {}
84
85 void clear() {
86 m_listHits.clear();
87 m_listHitCenter.clear();
89 m_segments.clear();
91 }
92
93 protected:
94 const TRT_DriftCircleContainer *m_trtcontainer = nullptr;
96 std::vector< const InDet::TRT_DriftCircle * > m_listHits;
97 std::vector< Amg::Vector3D > m_listHitCenter;
98
99 std::vector< std::vector<const InDet::TRT_DriftCircle *> > m_segmentDriftCircles; // vector of DriftCircles associated to the segments
100 std::vector< Trk::TrackSegment * > m_segments;
101 };
102
104 // Protected data and methods
106
107
108
109 SG::ReadHandleKey<InDet::TRT_DriftCircleContainer> m_driftCirclesName{this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve Drift Circles"} ;
110 StringProperty m_TRTManagerName{this, "TrtManagerLocation", "TRT",
111 "Name of TRT det. manager"};
112
113 const TRT_ID* m_trtid{nullptr};
114
115 private:
116
117 // other methods specific for this algorithm
118
119 int findSeed(double xmin,
120 double xmax,
121 double phimin,
122 double phimax,
123 double *bestParameters,
125
126 void findSeedInverseR(double *par, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const;
127
128 // follow
129 // convert lists of TRT circles (std::vector<const InDet::TRT_DriftCircle *>) to track segments (Trk::TrackSegment * -> fill m_segments):
130 void convert(std::vector<const InDet::TRT_DriftCircle *> &hits,
131 double *trackpar,
133
134 void findOld(TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const; // old function - need to debug an increased cpu consumption
135
136
137 static void linearRegressionParabolaFit(double *mean, double *a); // input: elsewhere calculated mean, output: result a
139
140 static bool sortHits( const InDet::TRT_DriftCircle *, const InDet::TRT_DriftCircle * );
141
142 static void segFit(double *measx, double *measy, int nhits, double *residuals = 0, double *result = 0);
143
144 // protect against high occupancy events
145 // 21k corresponds to 20% occupancy
146 // if set to 0, this requirement is not used. total number of TRT barrel straws is 105088
147 IntegerProperty m_maxTotalHits{this, "MaxTotalNumberOfBarrelHits", 21000};
148
149 IntegerProperty m_minHitsForSeed{this, "MinNumberOfHitsForSeed", -1};
150 IntegerProperty m_minHitsForSegment{this, "MinimalNumberOfTRTHits", 20};
151 IntegerProperty m_minHitsAboveTOT{this, "MinNumberOfHitsAboveTOT", -1};
152 IntegerProperty m_nBinsInX{this, "NbinsInX", 100};
153 IntegerProperty m_nBinsInPhi{this, "NbinsInPhi", 10};
154
155 DoubleProperty m_minSeedTOT{this, "MinimalTOTForSeedSearch", 10.,
156 "minimal time over threshold for seed search - default ~ 10 ns"};
157 BooleanProperty m_magneticField{this, "IsMagneticFieldOn", true,
158 "search for lines (if False) or circles (if True)"};
159 BooleanProperty m_mergeSegments{this, "MergeSegments", false}; // default: False, should not be turned on yet
160
161 };
162
163} // end namespace InDet
164
165#endif // TRT_TrackSegmentsMaker_BarrelCosmics_H
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:
std::vector< std::vector< const InDet::TRT_DriftCircle * > > m_segmentDriftCircles
std::vector< Trk::TrackSegment * > m_segments
List of found segments.
virtual std::ostream & dump(std::ostream &out) const override
virtual MsgStream & dump(MsgStream &out) const override
void findSeedInverseR(double *par, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
TRT_TrackSegmentsMaker_BarrelCosmics(const std::string &, const std::string &, const IInterface *)
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
static void segFit(double *measx, double *measy, int nhits, double *residuals=0, double *result=0)
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newRegion(const EventContext &ctx, const std::vector< IdentifierHash > &) const override
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_driftCirclesName
Container with TRT clusters.
int findSeed(double xmin, double xmax, double phimin, double phimax, double *bestParameters, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
void findOld(TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
virtual void find(const EventContext &ctx, InDet::ITRT_TrackSegmentsMaker::IEventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
void convert(std::vector< const InDet::TRT_DriftCircle * > &hits, double *trackpar, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
void endEvent(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > newEvent(const EventContext &ctx) const override
static bool sortHits(const InDet::TRT_DriftCircle *, const InDet::TRT_DriftCircle *)
sort hits on segment such that they are ordered from larger y to smaller (from top down)
SiSpacePointsSeedMakerEventData EventData
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.
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...
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60
Primary Vertex Finder.