Project
Loading...
Searching...
No Matches
Track.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef O2_MCH_TRACK_H_
18#define O2_MCH_TRACK_H_
19
20#include <list>
21#include <memory>
22
25
26namespace o2
27{
28namespace mch
29{
30
32class Track
33{
34 public:
35 Track() = default;
36 ~Track() = default;
37
38 Track(const Track& track);
39 Track& operator=(const Track& track) = delete;
40 Track(Track&&) = delete;
41 Track& operator=(Track&&) = delete;
42
44 int getNClusters() const { return mParamAtClusters.size(); }
45
47 int getNDF() const { return 2 * getNClusters() - 5; }
48
50 const TrackParam& first() const { return mParamAtClusters.front(); }
52 const TrackParam& last() const { return mParamAtClusters.back(); }
53
55 auto begin() { return mParamAtClusters.begin(); }
56 auto begin() const { return mParamAtClusters.begin(); }
58 auto end() { return mParamAtClusters.end(); }
59 auto end() const { return mParamAtClusters.end(); }
61 auto rbegin() { return mParamAtClusters.rbegin(); }
62 auto rbegin() const { return mParamAtClusters.rbegin(); }
64 auto rend() { return mParamAtClusters.rend(); }
65 auto rend() const { return mParamAtClusters.rend(); }
66
70 auto removeParamAtCluster(std::list<TrackParam>::iterator& itParam) { return mParamAtClusters.erase(itParam); }
71
72 int getNClustersInCommon(const Track& track, int stMin = 0, int stMax = 4) const;
73
74 bool isBetter(const Track& track) const;
75
76 void tagRemovableClusters(uint8_t requestedStationMask, bool request2ChInSameSt45);
77
78 void setCurrentParam(const TrackParam& param, int chamber);
81 int& getCurrentChamber() { return mCurrentChamber; }
83 bool hasCurrentParam() const { return mCurrentParam ? true : false; }
85 bool areCurrentParamValid() const { return (mCurrentChamber > -1); }
87 void invalidateCurrentParam() { mCurrentChamber = -1; }
88
90 void connected(bool connected = true) { mConnected = connected; }
92 bool isConnected() const { return mConnected; }
93
95 void removable(bool removable = true) { mRemovable = removable; }
97 bool isRemovable() const { return mRemovable; }
98
99 void print() const;
100
101 private:
102 std::list<TrackParam> mParamAtClusters{};
103 std::unique_ptr<TrackParam> mCurrentParam{};
104 int mCurrentChamber = -1;
105 bool mConnected = false;
106 bool mRemovable = false;
107};
108
109} // namespace mch
110} // namespace o2
111
112#endif // O2_MCH_TRACK_H_
Definition of the MCH cluster minimal structure.
Definition of the MCH track parameters for internal use.
track parameters for internal use
Definition TrackParam.h:34
track for internal use
Definition Track.h:33
void invalidateCurrentParam()
invalidate the current parameters
Definition Track.h:87
TrackParam & createParamAtCluster(const Cluster &cluster)
Definition Track.cxx:42
bool hasCurrentParam() const
check whether the current track parameters exist
Definition Track.h:83
~Track()=default
auto begin() const
Definition Track.h:56
Track()=default
void tagRemovableClusters(uint8_t requestedStationMask, bool request2ChInSameSt45)
Definition Track.cxx:136
bool isRemovable() const
return the flag telling if this track should be deleted
Definition Track.h:97
bool isBetter(const Track &track) const
Definition Track.cxx:126
int getNClusters() const
Return the number of attached clusters.
Definition Track.h:44
auto rend()
Return a reverse iterator passing the track parameters at first cluster.
Definition Track.h:64
bool isConnected() const
return the flag telling if this track shares cluster(s) with another
Definition Track.h:92
int & getCurrentChamber()
get a reference to the current chamber on which the current parameters are given
Definition Track.h:81
auto end() const
Definition Track.h:59
void print() const
Definition Track.cxx:218
Track & operator=(const Track &track)=delete
auto rbegin() const
Definition Track.h:62
auto end()
Return an iterator passing the track parameters at last cluster.
Definition Track.h:58
Track(Track &&)=delete
auto begin()
Return an iterator to the track parameters at clusters (point to the first one)
Definition Track.h:55
int getNClustersInCommon(const Track &track, int stMin=0, int stMax=4) const
Definition Track.cxx:92
const TrackParam & first() const
Return a reference to the track parameters at first cluster.
Definition Track.h:50
void connected(bool connected=true)
set the flag telling if this track shares cluster(s) with another
Definition Track.h:90
void removable(bool removable=true)
set the flag telling if this track should be deleted
Definition Track.h:95
TrackParam & getCurrentParam()
Definition Track.cxx:208
void setCurrentParam(const TrackParam &param, int chamber)
Definition Track.cxx:195
auto rbegin()
Return a reverse iterator to the track parameters at clusters (point to the last one)
Definition Track.h:61
const TrackParam & last() const
Return a reference to the track parameters at last cluster.
Definition Track.h:52
auto rend() const
Definition Track.h:65
int getNDF() const
Return the number of degrees of freedom of the track.
Definition Track.h:47
auto removeParamAtCluster(std::list< TrackParam >::iterator &itParam)
Remove the given track parameters from the internal list and return an iterator to the parameters tha...
Definition Track.h:70
bool areCurrentParamValid() const
check if the current parameters are valid
Definition Track.h:85
Track & operator=(Track &&)=delete
void addParamAtCluster(const TrackParam &param)
Definition Track.cxx:67
GLenum GLfloat param
Definition glcorearb.h:271
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
cluster minimal structure
Definition Cluster.h:31