Project
Loading...
Searching...
No Matches
TrackGenerator.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_MID_TRACKGENERATOR_H
18#define O2_MID_TRACKGENERATOR_H
19
20#include <array>
21#include <vector>
22#include <random>
24
25namespace o2
26{
27namespace mid
28{
31{
32 public:
33 std::vector<Track> generate();
34 std::vector<Track> generate(int nTracks);
35
37 inline void setSeed(unsigned int seed) { mGenerator.seed(seed); }
38
40 void setMeanTracksPerEvent(int meanTracksPerEvent) { mMeanTracksPerEvent = meanTracksPerEvent; }
42 void setSlopeLimits(float slopeXmin, float slopeXmax, float slopeYmin, float slopeYmax)
43 {
44 mSlopeLimits = {{slopeXmin, slopeXmax, slopeYmin, slopeYmax}};
45 }
47 void setPositionLimits(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
48 {
49 mPositionLimits = {{xMin, xMax, yMin, yMax, zMin, zMax}};
50 }
51
52 private:
53 std::array<float, 4> getLimitsForAcceptance(std::array<float, 3> pos);
54
55 int mMeanTracksPerEvent = 1;
56 std::array<float, 4> mSlopeLimits{{-0.2, 0.2, -0.5, 0.5}};
57 std::array<float, 6> mPositionLimits{{-2., 2, -2., 2., -5., 5.}};
58 std::default_random_engine mGenerator{std::default_random_engine()};
59};
60} // namespace mid
61} // namespace o2
62
63#endif /* O2_MID_TRACKGENERATOR_H */
Reconstructed MID track.
float float float & zMax
float float & zMin
float & yMax
uint16_t pos
Definition RawData.h:3
Class to generate tracks for MID.
std::vector< Track > generate()
void setSeed(unsigned int seed)
Sets the seed.
void setMeanTracksPerEvent(int meanTracksPerEvent)
Sets the mean number of track per events.
void setSlopeLimits(float slopeXmin, float slopeXmax, float slopeYmin, float slopeYmax)
Sets the limits of the track slope.
void setPositionLimits(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
Sets the limits of the track origin.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...