ATLAS Offline Software
SegmentSeed.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "CxxUtils/sincos.h"
7 namespace MuonR4{
8  using namespace SegmentFit;
9 
10  SegmentSeed::SegmentSeed(double tanTheta, double interceptY, double tanPhi,
11  double interceptX, double counts,
12  std::vector<HitType>&& hits,
13  const SpacePointBucket* bucket):
14  m_parent{bucket},
15  m_hits{std::move(hits)},
16  m_hasPhiExt{true},
17  m_counts{counts}{
18  Amg::Vector3D dir{tanPhi, tanTheta, 1.};
19  m_pars[toInt(ParamDefs::x0)] = interceptX;
20  m_pars[toInt(ParamDefs::y0)] = interceptY;
21  m_pars[toInt(ParamDefs::theta)] = dir.theta();
22  m_pars[toInt(ParamDefs::phi)] = dir.phi();
23  }
25  m_parent{toCopy.parentBucket()},
26  m_hits{toCopy.getHitsInMax()},
27  m_counts{toCopy.getCounts()}{
28  Amg::Vector3D dir{0., toCopy.tanTheta(), 1.};
29  m_pars[toInt(ParamDefs::y0)] = toCopy.interceptY();
30  m_pars[toInt(ParamDefs::theta)] = dir.theta();
31  m_pars[toInt(ParamDefs::phi)] = dir.phi();
32  }
35 
36  double SegmentSeed::interceptX() const { return m_pars[toInt(ParamDefs::x0)]; }
37  double SegmentSeed::interceptY() const {return m_pars[toInt(ParamDefs::y0)]; }
38  const Parameters& SegmentSeed::parameters() const{ return m_pars;}
39  double SegmentSeed::getCounts() const{ return m_counts;}
40  const std::vector<SegmentSeed::HitType>& SegmentSeed::getHitsInMax() const { return m_hits; }
43  bool SegmentSeed::hasPhiExtension() const{ return m_hasPhiExt; }
48  return Amg::Vector3D(phi.cs*theta.sn,phi.sn*theta.sn,theta.cs);
49  }
50 }
MuonR4::SegmentSeed::parentBucket
const SpacePointBucket * parentBucket() const
Returns the bucket out of which the seed was formed.
Definition: SegmentSeed.cxx:41
MuonR4::SegmentSeed::m_hits
std::vector< HitType > m_hits
List of associated hits.
Definition: SegmentSeed.h:76
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
SegmentSeed.h
MuonR4::SegmentSeed::tanPhi
double tanPhi() const
Returns the angle from the phi extension.
Definition: SegmentSeed.cxx:33
MuonR4::SegmentSeed::Parameters
SegmentFit::Parameters Parameters
Definition: SegmentSeed.h:17
sincos.h
Helper to simultaneously calculate sin and cos of the same angle.
MuonR4::SegmentSeed::positionInChamber
Amg::Vector3D positionInChamber() const
Returns the position of the seed in the chamber frame.
Definition: SegmentSeed.cxx:44
MuonGMR4::MuonChamber
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonChamber.h:42
MuonR4::SegmentSeed::m_counts
double m_counts
Effective countsfrom the hough seed.
Definition: SegmentSeed.h:80
MuonR4::SegmentFit::ParamDefs::phi
@ phi
MuonR4::SegmentSeed::SegmentSeed
SegmentSeed(double tanTheta, double interceptY, double tanPhi, double interceptX, double counts, std::vector< HitType > &&hits, const SpacePointBucket *bucket)
Constructor to write a segment seed from an eta maximum and a valid phi extension.
Definition: SegmentSeed.cxx:10
MuonR4::SegmentSeed::tanTheta
double tanTheta() const
Returns the angular coordinate of the eta transform.
Definition: SegmentSeed.cxx:34
MuonR4::SegmentSeed::hasPhiExtension
bool hasPhiExtension() const
check whether the segment seed includes a valid phi extension
Definition: SegmentSeed.cxx:43
MuonR4::HoughMaximum::parentBucket
const SpacePointBucket * parentBucket() const
getter
Definition: HoughMaximum.h:51
MuonR4::SegmentSeed::interceptY
double interceptY() const
Returns the intercept coordinate of the eta transform.
Definition: SegmentSeed.cxx:37
MuonR4::SegmentSeed::getHitsInMax
const std::vector< HitType > & getHitsInMax() const
Returns the list of assigned hits.
Definition: SegmentSeed.cxx:40
MuonR4::SegmentSeed::m_hasPhiExt
bool m_hasPhiExt
Does the sed have a phi extension.
Definition: SegmentSeed.h:78
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
MuonR4::SegmentSeed::m_parent
const SpacePointBucket * m_parent
Pointer to the parent.
Definition: SegmentSeed.h:74
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonR4::SegmentSeed::m_pars
Parameters m_pars
Set of defining parameters.
Definition: SegmentSeed.h:72
beamspotman.dir
string dir
Definition: beamspotman.py:623
MuonR4::SegmentFit::ParamDefs::y0
@ y0
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
MuonR4::SegmentSeed::interceptX
double interceptX() const
Returns the intercept from the phi extension.
Definition: SegmentSeed.cxx:36
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::SegmentSeed::getCounts
double getCounts() const
Definition: SegmentSeed.cxx:39
MuonR4::HoughMaximum
Data class to represent an eta maximum in hough space.
Definition: HoughMaximum.h:14
MuonR4::SegmentSeed::parameters
const Parameters & parameters() const
Returns the parameter array.
Definition: SegmentSeed.cxx:38
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
MuonR4::SegmentSeed::chamber
const MuonGMR4::MuonChamber * chamber() const
Returns the associated chamber.
Definition: SegmentSeed.cxx:42
MuonR4::SpacePointBucket::chamber
const MuonGMR4::MuonChamber * chamber() const
returns th associated muonChamber
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:35
MuonR4::SegmentSeed::directionInChamber
Amg::Vector3D directionInChamber() const
Returns the direction of the seed in the chamber frame.
Definition: SegmentSeed.cxx:45
MuonR4::SegmentFit::ParamDefs::theta
@ theta