Project
Loading...
Searching...
No Matches
genEvents.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
14
15#ifndef GENEVENTS_H
16#define GENEVENTS_H
17
18#include "GPUCommonDef.h"
19#include <cmath>
20
21namespace o2::gpu
22{
23class GPUChainTracking;
24struct GPUParam;
26#if !defined(GPUCA_BUILD_QA) || defined(_WIN32)
28{
29 public:
32 int32_t GenerateEvent(const GPUParam& sectorParam, const char* filename) { return 1; }
34
35 static void RunEventGenerator(GPUChainTracking* rec, const std::string& dir) {};
36};
37
38#else
39
40class genEvents
41{
42 public:
43 genEvents(GPUChainTracking* rec) : mRec(rec) {}
44 void InitEventGenerator();
45 int32_t GenerateEvent(const GPUParam& sectorParam, const char* filename);
47
48 static void RunEventGenerator(GPUChainTracking* rec, const std::string& dir);
49
50 private:
51 int32_t GetSector(double GlobalPhi);
52 int32_t GetDSector(double LocalPhi);
53 double GetSectorAngle(int32_t iSector);
54 int32_t RecalculateSector(GPUTPCGMPhysicalTrackModel& t, int32_t& iSector);
55 double GetGaus(double sigma);
56
57 TH1F* mClusterError[3][2] = {{nullptr, nullptr}, {nullptr, nullptr}, {nullptr, nullptr}};
58
59 struct GenCluster {
60 int32_t sector;
61 int32_t row;
62 int32_t mcID;
63 float x;
64 float y;
65 float z;
66 uint32_t id;
67 };
68
69 const double mTwoPi = 2 * M_PI;
70 const double mSectorDAngle = mTwoPi / 18.;
71 const double mSectorAngleOffset = mSectorDAngle / 2;
72
73 GPUChainTracking* mRec;
74};
75
76#endif
77} // namespace o2::gpu
78
79#endif
genEvents(GPUChainTracking *rec)
Definition genEvents.h:30
void InitEventGenerator()
Definition genEvents.h:31
int32_t GenerateEvent(const GPUParam &sectorParam, const char *filename)
Definition genEvents.h:32
void FinishEventGenerator()
Definition genEvents.h:33
static void RunEventGenerator(GPUChainTracking *rec, const std::string &dir)
Definition genEvents.h:35
GLint GLenum GLint x
Definition glcorearb.h:403
GLint y
Definition glcorearb.h:270
GLuint id
Definition glcorearb.h:650
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::string filename()
GPUReconstruction * rec
std::vector< int > row