ATLAS Offline Software
ICscSegmentFinder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ICscSegmentFinder_H
6 #define ICscSegmentFinder_H
7 
8 #include "GaudiKernel/IAlgTool.h"
12 
13 namespace Muon {
14  class MuonSegment;
15  class MdtDriftCircleOnTrack;
16  class MuonClusterOnTrack;
17  class CscClusterOnTrack;
18 } // namespace Muon
19 
20 namespace Trk {
21  class RIO_OnTrack;
22  class MeasurementBase;
23 } // namespace Trk
24 
26 static const InterfaceID IID_ICscSegmentFinder("ICscSegmentFinder", 1, 0);
27 
28 class ICscSegmentFinder : virtual public IAlgTool {
29 public: // Static methods
30  // Return the interface ID.
31  static const InterfaceID& interfaceID() { return IID_ICscSegmentFinder; }
32 
33 public: // Interface methods
34  // for 2d SegmentMaker
35  // virtual MuonSegmentCombinationCollection* find( const std::vector<Muon::CscPrepDataCollection>& pcols) =0;
36  // virtual MuonSegmentCombinationCollection* find( const Muon::CscPrepDataCollection& pcol) =0;
37  // virtual Muon::MuonSegmentCombination* find( const Muon::CscPrepDataCollection& pcol) =0;
38 
39  // using Muon::IMuonSegmentMaker::find;
40  virtual std::unique_ptr<MuonSegmentCombinationCollection> find(const std::vector<const Muon::CscPrepDataCollection*>& pcols,
41  const EventContext& ctx) const = 0;
42 
43  // for 4d SegmentMaker
44  virtual std::unique_ptr<MuonSegmentCombinationCollection> find(const MuonSegmentCombinationCollection& segcols,
45  const EventContext& ctx) const = 0;
46  /*
47 
48  virtual std::vector<const Muon::MuonSegment*>* find( const Trk::TrackRoad& road,
49  const std::vector< std::vector< const Muon::MdtDriftCircleOnTrack* > >& mdts,
50  const std::vector< std::vector< const Muon::MuonClusterOnTrack* > >& clusters,
51  bool updatePhi=false, double momentum = 1e9 ) =0;
52 
53  virtual std::vector<const Muon::MuonSegment*>* find( const Amg::Vector3D&, const Trk::GlobalDirection&,
54  const std::vector< const Muon::MdtDriftCircleOnTrack* > &,
55  const std::vector< const Muon::MuonClusterOnTrack* > & ,
56  bool updatePhi=false, double momentum = 1e9) =0;
57  */
58 
59  struct Cluster {
60  // local representation of a CSC cluster in the AMDB reference system
61  // in this system the x-coordinate corresponds to the phi strips whereas the y coordinate corresponds to the eta strips
62  // the z coordinate is along the strip planes
63  // the methods locX returns the local strip coordinate for the given hit and the locY returns the position along the strip plane
64 
65  Cluster() : cl(NULL), measPhi(0) {}
66  Cluster(const Amg::Vector3D& lp, const Muon::CscClusterOnTrack* c, bool measuresPhi) : lpos(lp), cl(c), measPhi(measuresPhi) {}
69  bool measPhi;
70  double locY() const {
71  if (measPhi)
72  return lpos.x();
73  else
74  return lpos.y();
75  }
76  double locX() const { return lpos.z(); }
77  };
78 
79 public:
80  /* typedef std::vector<Muon::CscClusterOnTrack*> TrkClusters; */
81  /* typedef std::vector<Muon::CscClusterOnTrack*> ChamberTrkClusters[4]; */
82  typedef std::vector<Cluster> TrkClusters;
83  typedef std::vector<Cluster> ChamberTrkClusters[4];
84 
85  typedef std::vector<const Trk::RIO_OnTrack*> RioList;
87 
89 
90  class Segment {
91  public:
92  double s0;
93  double s1;
94  double d0;
95  double d1;
96  double d01;
97  double time;
98  double dtime;
99  double chsq;
100  double zshift;
101  int nunspoil;
102  int nclus;
103 
106  bool operator<(const Segment& rhs) const { return chsq < rhs.chsq; }
107 
108  double res[4];
109  double dres[4];
110 
112  s0(-999.),
113  s1(-999.),
114  d0(-999.),
115  d1(-999.),
116  d01(-999.),
117  time(-9999.),
118  dtime(-9999.),
119  chsq(9999.),
120  zshift(0),
121  nunspoil(0),
122  nclus(0),
123  outlierid(-9) {
124  for (int i = 0; i < 4; ++i) {
125  res[i] = -9999.;
126  dres[i] = -9999.;
127  }
128  clus.resize(4);
129  }
130  };
131 
132  typedef std::vector<Segment> Segments;
133 
135  bool operator()(const Segment& seg1, const Segment& seg2) {
136  // sort by numbers of unspoil cluster
137  if (seg1.nunspoil > seg2.nunspoil)
138  return true;
139  else if (seg1.nunspoil < seg2.nunspoil)
140  return false;
141  // finally take the one with best chi2
142  return seg1.chsq < seg2.chsq;
143  }
144  };
145 };
146 #endif
ICscSegmentFinder
Definition: ICscSegmentFinder.h:28
ICscSegmentFinder::Cluster::Cluster
Cluster()
Definition: ICscSegmentFinder.h:65
ICscSegmentFinder::Segment::d1
double d1
Definition: ICscSegmentFinder.h:95
ICscSegmentFinder::Segment::nunspoil
int nunspoil
Definition: ICscSegmentFinder.h:101
ICscSegmentFinder::Cluster
Definition: ICscSegmentFinder.h:59
ICscSegmentFinder::Segment::outlierid
int outlierid
Definition: ICscSegmentFinder.h:105
ICscSegmentFinder::Segment
Definition: ICscSegmentFinder.h:90
ICscSegmentFinder::find
virtual std::unique_ptr< MuonSegmentCombinationCollection > find(const MuonSegmentCombinationCollection &segcols, const EventContext &ctx) const =0
ICscSegmentFinder::ChamberTrkClusters
std::vector< Cluster > ChamberTrkClusters[4]
Definition: ICscSegmentFinder.h:83
ICscSegmentFinder::Segment::d01
double d01
Definition: ICscSegmentFinder.h:96
ICscSegmentFinder::Cluster::locY
double locY() const
Definition: ICscSegmentFinder.h:70
ICscSegmentFinder::Segment::s1
double s1
Definition: ICscSegmentFinder.h:93
ICscSegmentFinder::MbaseList
DataVector< const Trk::MeasurementBase > MbaseList
Definition: ICscSegmentFinder.h:86
ICscSegmentFinder::find
virtual std::unique_ptr< MuonSegmentCombinationCollection > find(const std::vector< const Muon::CscPrepDataCollection * > &pcols, const EventContext &ctx) const =0
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
ICscSegmentFinder::Segment::dtime
double dtime
Definition: ICscSegmentFinder.h:98
ICscSegmentFinder::Segment::nclus
int nclus
Definition: ICscSegmentFinder.h:102
ICscSegmentFinder::Segment::dres
double dres[4]
Definition: ICscSegmentFinder.h:109
MuonSegmentCombination.h
ICscSegmentFinder::sortByNunspoilAndChsq
Definition: ICscSegmentFinder.h:134
ICscSegmentFinder::Segment::d0
double d0
Definition: ICscSegmentFinder.h:94
ICscSegmentFinder::Segment::clus
TrkClusters clus
Definition: ICscSegmentFinder.h:104
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonSegmentCombinationCollection.h
ICscSegmentFinder::Cluster::lpos
Amg::Vector3D lpos
Definition: ICscSegmentFinder.h:67
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
ICscSegmentFinder::TrkClusters
std::vector< Cluster > TrkClusters
Definition: ICscSegmentFinder.h:82
ICscSegmentFinder::SegmentVec
Muon::MuonSegmentCombination::SegmentVec SegmentVec
Definition: ICscSegmentFinder.h:88
ICscSegmentFinder::sortByNunspoilAndChsq::operator()
bool operator()(const Segment &seg1, const Segment &seg2)
Definition: ICscSegmentFinder.h:135
ICscSegmentFinder::Segments
std::vector< Segment > Segments
Definition: ICscSegmentFinder.h:132
DataVector< Muon::MuonSegmentCombination >
ICscSegmentFinder::Segment::s0
double s0
Definition: ICscSegmentFinder.h:92
ICscSegmentFinder::Segment::Segment
Segment()
Definition: ICscSegmentFinder.h:111
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
CscPrepDataContainer.h
ICscSegmentFinder::Segment::chsq
double chsq
Definition: ICscSegmentFinder.h:99
ICscSegmentFinder::interfaceID
static const InterfaceID & interfaceID()
Definition: ICscSegmentFinder.h:31
ICscSegmentFinder::Cluster::cl
const Muon::CscClusterOnTrack * cl
Definition: ICscSegmentFinder.h:68
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
ICscSegmentFinder::Cluster::Cluster
Cluster(const Amg::Vector3D &lp, const Muon::CscClusterOnTrack *c, bool measuresPhi)
Definition: ICscSegmentFinder.h:66
ICscSegmentFinder::Segment::operator<
bool operator<(const Segment &rhs) const
Definition: ICscSegmentFinder.h:106
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
Muon::MuonSegmentCombination::SegmentVec
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
Definition: MuonSegmentCombination.h:32
ICscSegmentFinder::Cluster::locX
double locX() const
Definition: ICscSegmentFinder.h:76
ICscSegmentFinder::Segment::time
double time
Definition: ICscSegmentFinder.h:97
ICscSegmentFinder::Cluster::measPhi
bool measPhi
Definition: ICscSegmentFinder.h:69
python.compressB64.c
def c
Definition: compressB64.py:93
ICscSegmentFinder::RioList
std::vector< const Trk::RIO_OnTrack * > RioList
Definition: ICscSegmentFinder.h:85
ICscSegmentFinder::Segment::zshift
double zshift
Definition: ICscSegmentFinder.h:100