ATLAS Offline Software
Loading...
Searching...
No Matches
FakeTrackBuilder Class Reference

#include <FakeTrackBuilder.h>

Collaboration diagram for FakeTrackBuilder:

Static Public Member Functions

static Trk::TrackbuildTrack (const InDetDD::SiDetectorElementCollection *elements)
static Trk::TrackbuildBrokenTrack (const InDetDD::SiDetectorElementCollection *elements)
static Rec::TrackParticlebuildTrackParticle (const InDetDD::SiDetectorElementCollection *elements)

Detailed Description

Definition at line 12 of file FakeTrackBuilder.h.

Member Function Documentation

◆ buildBrokenTrack()

Trk::Track * FakeTrackBuilder::buildBrokenTrack ( const InDetDD::SiDetectorElementCollection * elements)
static

Definition at line 159 of file FakeTrackBuilder.cxx.

159 {
160 return nullptr;
161}

◆ buildTrack()

Trk::Track * FakeTrackBuilder::buildTrack ( const InDetDD::SiDetectorElementCollection * elements)
static

Definition at line 45 of file FakeTrackBuilder.cxx.

45 {
46 using namespace Trk;
47 using namespace InDet;
48 //unsigned int counter=0;
49 //std::cout<<counter++<<std::endl;
50 auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
51 PerigeeSurface periSurf;
52 auto trackParameter = std::make_unique<Perigee>(4.0, 3.0, 2.0, 1.0, 0.001, periSurf);
53 //parameters to TrackStateOnSurface are unique_ptr to: RIO_OnTrack, TrackParameters, MaterialEffectsBase
54 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter), nullptr) );
55
56 //std::cout<<counter++<<std::endl;
57
58 // test state #1 - arbitrary TP AtaCylinder
59 Trk::CylinderSurface surface(1.0, 2*M_PI, 4.0);
60 auto trackParameter2=surface.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
61 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter2), nullptr) );
62
63 // test state #2 - arbitrary TP AtaDisc
64 Amg::Translation3D amgtranslation(1.,2.,3.);
65 Amg::Transform3D amgTransf = Amg::Transform3D(amgtranslation);
66 DiscSurface discSf(amgTransf, 1.0, 2.0);
67 auto trackParameter3 = discSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
68 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter3), nullptr) );
69
70 // test state #3 - arbitrary AtaPlane + Estimated Brem
71 Amg::Transform3D amgTransf2(amgtranslation);
72 PlaneSurface planeSf(amgTransf2, 1.0, 2.0);
73 auto trackParameter4 = planeSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
74 auto ebr = std::make_unique<EstimatedBremOnTrack>((0.7), -0.3,0.3, 0.03,planeSf);
75 std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> type1(0);
77 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter4), std::move(ebr),type1) );
78
79 if (elements){
80 // test state #4 - AtaPlane at a valid detector element + MatEffects
81 IdentifierHash idHash(0); // should be first pixel
82 const InDetDD::SiDetectorElement * detEl = elements->getDetectorElement( idHash);
83
84 // MaterialEffects
85 auto eloss = std::make_unique<Trk::EnergyLoss>((0.5),0.19);
86 auto scatt = Trk::ScatteringAngles(.1,.2,.3,.4);
87 std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> mefPattern(0);
91 //std::cout<<counter++<<std::endl;
92
93 //AtaPlane on det el
94 const PlaneSurface& planeDetElSf = dynamic_cast<const PlaneSurface&>(detEl->surface());
95 auto trackParameter5 = planeDetElSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
96
97 auto mefBase = std::make_unique<Trk::MaterialEffectsOnTrack>(70.7,scatt,std::move(eloss),planeDetElSf, mefPattern);
98 std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
100 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter5), std::move(mefBase), typePattern) );
101 }
102 //Curvi
103 Amg::Vector3D pos(1.0,2.0,3.0);
104 Amg::Vector3D mom(4.0,5.0,6.0);
105
106 auto trackParameter6 = std::make_unique<CurvilinearParameters>(pos,mom,1.0);
107 std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
109 trackStateOnSurfaces->push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter6), nullptr, typePattern) );
110
111 AmgSymMatrix(2) locCov;
112 locCov.setIdentity(); // sets it to identity
113 locCov(0,0) = 0.001; locCov(1,1)=0.002;
114
115 if (elements) {
116 const InDetDD::SiDetectorElement * detEl = *(elements->begin());
117 if (!detEl)
118 std::cerr<<"Unable to find any pixel Detector element!! Aborting this part of the test."<<std::endl;
119 else {
120 InDet::PixelClusterOnTrack* fakePix1
121 = new InDet::PixelClusterOnTrack(); // make PRD-less ROT
122 fakePix1->m_detEl = detEl;
123 fakePix1->m_identifier = detEl->identify();
124 Amg::Vector2D locpos( 5.559011, 22.613205);
125 //2 Trk::LocalPosition locpos = Trk::LocalPosition( 7.315356, 21.303871);
126 fakePix1->m_localParams = Trk::LocalParameters(locpos);
127 fakePix1->m_localCovariance = locCov;
128 unsigned int pix2 = 2832020859UL; // CLHEP::bar l1 mod(6,0) index(309,122)
129 Identifier idPix2(pix2);
130 InDet::PixelClusterOnTrack* fakePix2
131 = new InDet::PixelClusterOnTrack();
132 fakePix2->m_detEl = detEl;
133 fakePix2->m_identifier = idPix2;
134 locpos = Amg::Vector2D( 7.315356, 21.303871);
135 fakePix2->m_localParams = Trk::LocalParameters(locpos);
136 locCov(0,0) = 0.001; locCov(1,1)=0.0135;
137 fakePix2->m_localCovariance = locCov;
138 auto childrots = std::vector<const InDet::PixelClusterOnTrack*>();
139 childrots.push_back(fakePix1);
140 childrots.push_back(fakePix2);
141 auto assgnProb = std::vector<double>();
142 assgnProb.push_back(0.4);
143 assgnProb.push_back(0.6);
144 auto cProt = std::make_unique<InDet::CompetingPixelClustersOnTrack>(
145 std::move(childrots), std::move(assgnProb));
146 trackStateOnSurfaces->push_back(
147 new TrackStateOnSurface(std::move(cProt), nullptr, nullptr));
148 }
149 }
150
151 //create Track and add to collection
152 auto fitQuality = std::make_unique<FitQuality>(1.0, 2);
153
154 Trk::TrackInfo info( TrackInfo::Unknown, Trk::undefined);
155 //std::cout<<counter++<<std::endl;
156 return new Trk::Track(info, std::move(trackStateOnSurfaces), std::move(fitQuality));
157}
#define M_PI
#define AmgSymMatrix(dim)
if(febId1==febId2)
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::Surface & surface()
Element Surface.
const InDetDD::SiDetectorElement * m_detEl
corresponding detector element
std::unique_ptr< ParametersT< DIM, T, PlaneSurface > > createUniqueParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
Use the Surface as a ParametersBase constructor, from local parameters.
@ ScatteringEffects
contains material effects due to multiple scattering
@ FittedMaterialEffects
contains values obtained by fitting the scatterer or e-loss
@ EnergyLossEffects
contains energy loss corrections
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
Identifier m_identifier
Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)
@ BremPoint
This represents a brem point on the track, and so will contain TrackParameters and MaterialEffectsBas...
@ Parameter
This TSOS contains a Trk::ParameterBase.
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.

◆ buildTrackParticle()

Rec::TrackParticle * FakeTrackBuilder::buildTrackParticle ( const InDetDD::SiDetectorElementCollection * elements)
static

Definition at line 163 of file FakeTrackBuilder.cxx.

163 {
164 return nullptr;
165}

The documentation for this class was generated from the following files: