Project
Loading...
Searching...
No Matches
o2aod_mc_to_hepmc.cxx
Go to the documentation of this file.
1// Copyright 2023-2099 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
17//--------------------------------------------------------------------
48struct AodToHepmc {
51
56 "Dump HepMC event to output"};
60 o2::framework::Configurable<bool> onlyGen{"hepmc-only-generated", false,
61 "Only export generated"};
64 "Export as tree"};
67 "Export precision in dump"};
70 "Recenter the events at (0,0,0,0)"};
72
75
78
103 {
104 mConverter.configs = {(std::string)configs.dump, (bool)configs.onlyGen, (bool)configs.useTree, (int)configs.precision, (bool)configs.recenter};
106 trigger->ptr = &mConverter;
107 }
116 void process(Header const& collision,
117 Tracks const& tracks,
118 XSections const& xsections,
119 PdfInfos const& pdfs,
120 HeavyIons const& heavyions)
121 {
122 // Do not run this if --hepmc-no-aux was passed
123 if (doPlain) {
124 return;
125 }
126 LOG(debug) << "=== Processing everything ===";
128 mConverter.process(collision,
129 xsections,
130 pdfs,
131 heavyions);
132 mConverter.process(collision, tracks);
134 }
140 void processPlain(Header const& collision,
141 Tracks const& tracks)
142 {
143 // Do not run this if --hepmc-no-aux was not passed
144 if (not doPlain) {
145 return;
146 }
147
148 LOG(debug) << "=== Processing only tracks ===";
150 mConverter.process(collision, tracks);
152 }
162 "hepmc-no-aux", false,
163 "Do not process auxiliary "
164 "information"})
166 "hepmc-no-aux", false,
167 "Do not process auxiliary "
168 "information"};
169};
170
171//--------------------------------------------------------------------
172// This _must_ be included after our "customize" function above, or
173// that function will not be taken into account.
175
176//--------------------------------------------------------------------
180
183{
185
186 // Task: Two entry: header, tracks, and header, tracks, auxiliary
187 return WorkflowSpec{adaptAnalysisTask<AodToHepmc>(cfg)};
188}
189//
190// EOF
191//
std::ostringstream debug
GLenum GLint GLint * precision
Definition glcorearb.h:1899
DataProcessorSpec adaptAnalysisTask(ConfigContext const &ctx, Args &&... args)
std::vector< DataProcessorSpec > WorkflowSpec
WorkflowSpec defineDataProcessing(ConfigContext const &cfg)
This function hooks up the the workflow specifications into the DPL driver.
o2::framework::WorkflowSpec WorkflowSpec
o2::framework::Configurable< bool > recenter
Converter mConverter
o2::framework::Configurable< bool > onlyGen
Converter::PdfInfo PdfInfo
Converter::HeavyIon HeavyIon
o2::framework::Service< o2::framework::AODToHepMCPostRun > trigger
Converter::HeavyIons HeavyIons
void process(Header const &collision, Tracks const &tracks, XSections const &xsections, PdfInfos const &pdfs, HeavyIons const &heavyions)
Converter::XSection XSection
Converter::PdfInfos PdfInfos
void processPlain(Header const &collision, Tracks const &tracks)
void init(o2::framework::InitContext &)
Converter::Headers Headers
o2::framework::Configurable< std::string > dump
Converter::XSections XSections
o2::framework::Configurable< bool > useTree
decltype(o2::framework::ProcessConfigurable{&AodToHepmc::processPlain, "hepmc-no-aux", false, "Do not process auxiliary " "information"}) doPlain
Converter::Tracks Tracks
struct o2::eventgen::AODToHepMC::@467 configs
virtual void process(Header const &collision, Tracks const &tracks)
o2::aod::McCollisions Headers
Definition AODToHepMC.h:280
o2::aod::HepMCHeavyIons HeavyIons
Definition AODToHepMC.h:293
o2::aod::HepMCPdfInfos PdfInfos
Definition AODToHepMC.h:291
typename PdfInfos::iterator PdfInfo
Definition AODToHepMC.h:298
typename HeavyIons::iterator HeavyIon
Definition AODToHepMC.h:300
o2::aod::McParticles Tracks
Definition AODToHepMC.h:284
o2::aod::McCollision Header
Definition AODToHepMC.h:282
o2::aod::HepMCXSections XSections
Definition AODToHepMC.h:288
virtual void startEvent()
virtual void endEvent()
typename XSections::iterator XSection
Definition AODToHepMC.h:295
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"