Project
Loading...
Searching...
No Matches
ROframe.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.
15
16#ifndef O2_MFT_ROFRAME_H_
17#define O2_MFT_ROFRAME_H_
18
19#include <array>
20#include <vector>
21#include <utility>
22#include <cassert>
23#include <gsl/gsl>
24#include <map>
25
26#include "MFTTracking/Cluster.h"
28#include "MFTTracking/Cell.h"
29#include "MFTTracking/TrackCA.h"
30#include "MFTTracking/Road.h"
31
34
35namespace o2
36{
37namespace mft
38{
39
40template <typename T>
42{
43 public:
44 void Reserve(int nClusters = 0, float fraction = 0.12f)
45 {
47 while (layer--) {
48 mClusters[layer].reserve(nClusters * fraction);
49 mClusterExternalIndices[layer].reserve(nClusters * fraction);
50 mClusterSizes[layer].reserve(nClusters * fraction);
51 }
52 mTracks.reserve(nClusters * fraction);
53 }
54 Int_t getTotalClusters() const;
55
56 std::vector<Cluster>& getClustersInLayer(Int_t layerId) { return mClusters[layerId]; }
57
58 const MCCompLabel& getClusterLabels(Int_t layerId, const Int_t clusterId) const { return mClusterLabels[layerId][clusterId]; }
59
60 const Int_t getClusterExternalIndex(Int_t layerId, const Int_t clusterId) const { return mClusterExternalIndices[layerId][clusterId]; }
61
62 const Int_t getClusterSize(Int_t layerId, const Int_t clusterId) const { return mClusterSizes[layerId][clusterId]; }
63
64 std::vector<T>& getTracks() { return mTracks; }
65 T& getCurrentTrack() { return mTracks.back(); }
66
67 Road& getCurrentRoad() { return mRoads.back(); }
68
69 template <typename... C>
70 void addClusterToLayer(Int_t layer, C&&... args)
71 {
72 mClusters[layer].emplace_back(std::forward<C>(args)...);
73 }
74 void addClusterLabelToLayer(Int_t layer, const MCCompLabel label) { mClusterLabels[layer].emplace_back(label); }
75 void addClusterExternalIndexToLayer(Int_t layer, const Int_t idx) { mClusterExternalIndices[layer].push_back(idx); }
76 void addClusterSizeToLayer(Int_t layer, const Int_t clusterSize) { mClusterSizes[layer].push_back(clusterSize); }
77
78 void addTrack(bool isCA = false)
79 {
80 mTracks.emplace_back(isCA);
81 }
82
83 void addRoad() { mRoads.emplace_back(); }
84
86
87 void clear()
88 {
89
90 for (Int_t iLayer = 0; iLayer < constants::mft::LayersNumber; ++iLayer) {
91 mClusters[iLayer].clear();
92 mClusterLabels[iLayer].clear();
93 mClusterExternalIndices[iLayer].clear();
94 mClusterSizes[iLayer].clear();
95 }
96 mTracks.clear();
97 mRoads.clear();
98 }
99
100 const Int_t getNClustersInLayer(Int_t layerId) const { return mClusters[layerId].size(); }
101
102 private:
103 std::array<std::vector<Cluster>, constants::mft::LayersNumber> mClusters;
104 std::array<std::vector<MCCompLabel>, constants::mft::LayersNumber> mClusterLabels;
105 std::array<std::vector<Int_t>, constants::mft::LayersNumber> mClusterExternalIndices;
106 std::array<std::vector<Int_t>, constants::mft::LayersNumber> mClusterSizes;
107 std::vector<T> mTracks;
108 std::vector<Road> mRoads;
109};
110
111} // namespace mft
112} // namespace o2
113
114#endif /* O2_MFT_ROFRAME_H_ */
A segment connecting two clusters from two planes.
A simple structure for the MFT cluster, used by the standalone track finder.
Some constants, fixed parameters and look-up-table functions.
Definition of a container to keep Monte Carlo truth external to simulation objects.
A cylindrical volume, around a seed line connecting two outer clusters, inside which the cellular aut...
Standalone classes for the track found by the Linear-Track-Finder (LTF) and by the Cellular-Automaton...
int clusterSize
int nClusters
void Reserve(int nClusters=0, float fraction=0.12f)
Definition ROframe.h:44
void addClusterToLayer(Int_t layer, C &&... args)
Definition ROframe.h:70
const MCCompLabel & getClusterLabels(Int_t layerId, const Int_t clusterId) const
Definition ROframe.h:58
std::vector< T > & getTracks()
Definition ROframe.h:64
const Int_t getNClustersInLayer(Int_t layerId) const
Definition ROframe.h:100
std::vector< Cluster > & getClustersInLayer(Int_t layerId)
Definition ROframe.h:56
Road & getCurrentRoad()
Definition ROframe.h:67
void addRoad()
Definition ROframe.h:83
const Int_t getClusterSize(Int_t layerId, const Int_t clusterId) const
Definition ROframe.h:62
void addClusterLabelToLayer(Int_t layer, const MCCompLabel label)
Definition ROframe.h:74
void addClusterExternalIndexToLayer(Int_t layer, const Int_t idx)
Definition ROframe.h:75
void addClusterSizeToLayer(Int_t layer, const Int_t clusterSize)
Definition ROframe.h:76
const Int_t getClusterExternalIndex(Int_t layerId, const Int_t clusterId) const
Definition ROframe.h:60
T & getCurrentTrack()
Definition ROframe.h:65
void addTrack(bool isCA=false)
Definition ROframe.h:78
Int_t getTotalClusters() const
Definition ROframe.cxx:25
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
constexpr Int_t LayersNumber
Definition Constants.h:37
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...