EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackPoint.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackPoint.h
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
23 #ifndef genfit_TrackPoint_h
24 #define genfit_TrackPoint_h
25 
26 #include "AbsMeasurement.h"
27 #include "AbsFitterInfo.h"
28 #include "ThinScatterer.h"
29 
30 #include <TObject.h>
31 
32 #include <map>
33 #include <vector>
34 #include <memory>
35 
36 
37 namespace genfit {
38 
39 class Track;
40 class KalmanFitterInfo;
41 
46 class TrackPoint : public TObject {
47 
48  public:
49 
50  TrackPoint();
51  TrackPoint(Track* track);
52 
59  TrackPoint(const std::vector< genfit::AbsMeasurement* >& rawMeasurements, Track* track);
60 
67  TrackPoint(genfit::AbsMeasurement* rawMeasurement, Track* track);
68 
69  TrackPoint(const TrackPoint&); // copy constructor
70  TrackPoint& operator=(TrackPoint); // assignment operator
71  void swap(TrackPoint& other);
72 
77  TrackPoint(const TrackPoint& rhs,
78  const std::map<const genfit::AbsTrackRep*, genfit::AbsTrackRep*>& map,
79  const std::vector<const genfit::AbsTrackRep*> * repsToIgnore = nullptr);
80 
81  virtual ~TrackPoint();
82 
83 
84  double getSortingParameter() const {return sortingParameter_;}
85 
86  Track* getTrack() const {return track_;}
87  void setTrack(Track* track) {track_ = track;}
88 
89  const std::vector< genfit::AbsMeasurement* >& getRawMeasurements() const {return rawMeasurements_;}
90  AbsMeasurement* getRawMeasurement(int i = 0) const;
91  unsigned int getNumRawMeasurements() const {return rawMeasurements_.size();}
92  bool hasRawMeasurements() const {return (rawMeasurements_.size() != 0);}
94  std::vector< genfit::AbsFitterInfo* > getFitterInfos() const;
96  AbsFitterInfo* getFitterInfo(const AbsTrackRep* rep = nullptr) const;
98  KalmanFitterInfo* getKalmanFitterInfo(const AbsTrackRep* rep = nullptr) const;
99  bool hasFitterInfo(const AbsTrackRep* rep) const {
100  return (fitterInfos_.find(rep) != fitterInfos_.end());
101  }
102 
104  bool hasThinScatterer() const {return thinScatterer_.get() != nullptr;}
105 
106 
107  void setSortingParameter(double sortingParameter) {sortingParameter_ = sortingParameter;}
109  void addRawMeasurement(genfit::AbsMeasurement* rawMeasurement) {assert(rawMeasurement!=nullptr); rawMeasurement->setTrackPoint(this); rawMeasurements_.push_back(rawMeasurement);}
110  void deleteRawMeasurements();
112  void setFitterInfo(genfit::AbsFitterInfo* fitterInfo);
113  void deleteFitterInfo(const AbsTrackRep* rep) {delete fitterInfos_[rep]; fitterInfos_.erase(rep);}
114 
115  void setScatterer(ThinScatterer* scatterer) {thinScatterer_.reset(scatterer);}
116 
117  void Print(const Option_t* = "") const;
118 
126  void fixupRepsForReading();
127 
128  private:
130 
133 
135  std::vector<AbsMeasurement*> rawMeasurements_; // Ownership
136 
137  std::map< const AbsTrackRep*, AbsFitterInfo* > fitterInfos_;
138 
145  std::map<unsigned int, AbsFitterInfo*> vFitterInfos_;
146 
147  std::unique_ptr<ThinScatterer> thinScatterer_; // Ownership
148 
149  public:
150 
151  ClassDef(TrackPoint,1)
152 
153 };
154 
155 } /* End of namespace genfit */
158 #endif // genfit_TrackPoint_h