Project
Loading...
Searching...
No Matches
GeneratorHepMC.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
13
14#ifndef ALICEO2_EVENTGEN_GENERATORHEPMC_H_
15#define ALICEO2_EVENTGEN_GENERATORHEPMC_H_
16
21
22#ifdef GENERATORS_WITH_HEPMC3_DEPRECATED
23namespace HepMC
24{
25class Reader;
26class GenEvent;
27class FourVector;
28} // namespace HepMC
29#else
30namespace HepMC3
31{
32class Reader;
33class GenEvent;
34class FourVector;
35class GenParticle;
36} // namespace HepMC3
37#endif
38
39namespace o2
40{
41namespace conf
42{
43class SimConfig;
44}
45namespace eventgen
46{
47
48/*****************************************************************/
49/*****************************************************************/
50
52{
53
54 public:
58 GeneratorHepMC(const Char_t* name,
59 const Char_t* title = "ALICEo2 HepMC Generator");
61 ~GeneratorHepMC() override;
62
64 Bool_t Init() override;
65
70 void setup(const GeneratorFileOrCmdParam& param0,
72 const conf::SimConfig& config);
73 // Generator configuration from external local parameters
74 void setup(const FileOrCmdGenConfig& param0,
75 const HepMCGenConfig& param,
76 const conf::SimConfig& config);
81 Bool_t generateEvent() override;
87 Bool_t importParticles() override;
88
90 void setEventsToSkip(uint64_t val) { mEventsToSkip = val; };
91 void setVersion(const int& ver) { mVersion = ver; };
92
93 protected:
98
100#ifdef GENERATORS_WITH_HEPMC3_DEPRECATED
101 const HepMC::FourVector getBoostedVector(const HepMC::FourVector& vector, Double_t boost);
102#else
103 const HepMC3::FourVector getBoostedVector(const HepMC3::FourVector& vector, Double_t boost);
104#endif
105
107 void updateHeader(o2::dataformats::MCEventHeader* eventHeader) override;
109 bool makeReader();
110
113 typedef bool (*Select)(std::shared_ptr<const HepMC3::GenParticle>);
117
119 uint64_t mEventsToSkip = 0;
121 int mVersion = 0;
122 std::shared_ptr<HepMC3::Reader> mReader;
124 HepMC3::GenEvent* mEvent = nullptr;
126 bool mPrune;
127
129
130};
132/*****************************************************************/
133/*****************************************************************/
134
135} // namespace eventgen
136} // namespace o2
137
138#endif /* ALICEO2_EVENTGEN_GENERATORHEPMC_H_ */
bool(* Select)(std::shared_ptr< const HepMC3::GenParticle >)
void updateHeader(o2::dataformats::MCEventHeader *eventHeader) override
void setEventsToSkip(uint64_t val)
void setVersion(const int &ver)
const HepMC3::FourVector getBoostedVector(const HepMC3::FourVector &vector, Double_t boost)
ClassDefOverride(GeneratorHepMC, 1)
GeneratorHepMC & operator=(const GeneratorHepMC &)
GeneratorHepMC(const GeneratorHepMC &)
std::shared_ptr< HepMC3::Reader > mReader
void setup(const GeneratorFileOrCmdParam &param0, const GeneratorHepMCParam &param, const conf::SimConfig &config)
GLuint const GLchar * name
Definition glcorearb.h:781
GLuint GLfloat * val
Definition glcorearb.h:1582
GLenum GLfloat param
Definition glcorearb.h:271
o2::framework::RootTreeReader Reader
std::vector< InputSpec > select(char const *matcher="")
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...