ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRT_CALIBDATA__TRACKINFO_H
6#define TRT_CALIBDATA__TRACKINFO_H
7/********************************************************************
8
9NAME: TRT::Track
10PACKAGE: TRT_AlignData
11
12AUTHORS: Jorgen Beck Hansen
13CREATED: December 2005
14
15PURPOSE: "messenger"-class for track information used inside
16 TRT Alignment
17
18********************************************************************/
19
20// INCLUDES:
21
22#include <vector>
24
25namespace TRT {
26 namespace Track{
27 // Declare indices
29 d0 = 0,
36 TNOFV // always leave as last enum and DON*T change
37 };
38 // Declare names
39 const std::string floatVariableName[TNOFV]={
40 "d0",
41 "z0",
42 "phi",
43 "cotTheta",
44 "qOverPT",
45 "chiSquare",
46 "t0"
47 };
48
49 // Declare indices
60 // Declare names
61 const std::string intVariableName[TNOIV]={
62 "run",
63 "event",
64 "trackNumber",
65 "numberOfPixelHits",
66 "numberOfSCTHits",
67 "numberOfTRTHits",
68 "degreesOfFreedom"
69 };
70 }
71
72 class TrackInfo : public std::vector<HitInfo*> {
73 public:
74 // Constructors
75 TrackInfo() : std::vector<HitInfo*>(), m_Ints(Track::TNOIV),m_Floats(Track::TNOFV){}
76 TrackInfo(std::vector<HitInfo*>& orig) : std::vector<HitInfo*>(orig), m_Ints(Track::TNOIV),m_Floats(Track::TNOFV){}
77 TrackInfo(const TrackInfo& orig): std::vector<HitInfo*>(orig), m_Ints(orig.m_Ints),m_Floats(orig.m_Floats){}
78 //assignment
79 TrackInfo & operator=(const TrackInfo & other){
80 if (&other != this){
81 for(auto &i:*this){
82 delete i;
83 }
84 this->clear();
85 *this = other;
86 m_Ints = other.m_Ints;
87 m_Floats = other.m_Floats;
88 }
89 return *this;
90 }
91 // Destructor
92 ~TrackInfo(){for (std::vector<HitInfo*>::iterator i=this->begin();i!=this->end();++i) delete *i; } // We _OWN_ the hits!!!
93 // Access
94 const int& operator[](const Track::IntVariables& theIndex) const {return m_Ints[theIndex];}
95 const float& operator[](const Track::FloatVariables& theIndex) const {return m_Floats[theIndex];}
96 // Set/modify
97 int& operator[](const Track::IntVariables& theIndex) {return m_Ints[theIndex];}
98 float& operator[](const Track::FloatVariables& theIndex) {return m_Floats[theIndex];}
99
100 private:
101 std::vector<int> m_Ints;
102 std::vector<float> m_Floats;
103 };
104}
105
106#endif //TRT_CALIBDATA__TRACKINFO_H
const float & operator[](const Track::FloatVariables &theIndex) const
float & operator[](const Track::FloatVariables &theIndex)
const int & operator[](const Track::IntVariables &theIndex) const
Definition HitInfo.h:33
STL namespace.