cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
PhotosFilter.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2019-2022 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <Photos/Log.h>
20#include <Photos/Photos.h>
21#include <Photos/PhotosEvent.h>
22#include <Photos/PhotosHepMC3Event.h>
23
26#include "CepGen/Event/Event.h"
29#include "CepGen/Physics/PDG.h"
30#include "CepGen/Utils/String.h"
32
33using namespace Photospp;
34
35namespace cepgen {
36 namespace hadr {
38 class PhotosFilter : public EventModifier {
39 public:
40 explicit PhotosFilter(const ParametersList&);
42
44
45 void initialise() override;
46 bool run(Event& ev, double& weight, bool fast) override;
47 };
48
50 if (steer<bool>("debug"))
51 Log::LogAll(true);
52 Photos::setMomentumConservationThreshold(1.e-10);
53 Photos::maxWtInterference(steer<double>("maxWtInterference"));
54 Photos::setInfraredCutOff(steer<double>("infraredCutOff"));
55 Photos::setInterference(steer<bool>("interference"));
56 Photos::setDoubleBrem(steer<bool>("doubleBrem"));
57 Photos::setQuatroBrem(steer<bool>("quatroBrem"));
58 Photos::setCorrectionWtForW(steer<bool>("correctionWtForW"));
59 Photos::setExponentiation(steer<bool>("exponentiation"));
60 Photos::setPairEmission(steer<bool>("pairEmission"));
61 Photos::setPhotonEmission(steer<bool>("photonEmission"));
62 Photos::setMeCorrectionWtForScalar(steer<bool>("meCorrectionWtForScalar"));
63 Photos::setMeCorrectionWtForW(steer<bool>("meCorrectionWtForW"));
64 Photos::setMeCorrectionWtForZ(steer<bool>("meCorrectionWtForZ"));
65 Photos::setTopProcessRadiation(steer<bool>("topProcessRadiation"));
66 }
67
68 PhotosFilter::~PhotosFilter() { Log::SummaryAtExit(); }
69
71 Photos::setMomentumUnit(Photos::GEV);
72 Photos::setAlphaQED(constants::ALPHA_EM);
73 Photos::initialize();
74 }
75
76 bool PhotosFilter::run(Event& ev, double& weight, bool) {
77 weight = 1.;
78
79 HepMC3::CepGenEvent hepmc_evt(ev);
80 PhotosHepMC3Event evt(&hepmc_evt);
81 //evt.dump();
82 evt.process();
83 hepmc_evt.merge(ev);
84 ev.dump();
85
86 return true;
87 }
88
90 auto desc = EventModifier::description();
91 desc.add<bool>("debug", false).setDescription("log all debugging information?");
92 desc.add<double>("maxWtInterference", 1.).setDescription("maximum interference weight");
93 desc.add<double>("infraredCutOff", 0.01)
94 .setDescription("minimal energy (in units of decaying particle mass) for photons to be explicitly generated");
95 desc.add<bool>("interference", true).setDescription("key for interference, matrix element weight");
96 desc.add<bool>("doubleBrem", true).setDescription("set double bremsstrahlung generation");
97 desc.add<bool>("quatroBrem", false).setDescription("set bremsstrahlung generation up to multiplicity of 4");
98 desc.add<bool>("correctionWtForW", true)
99 .setDescription("key for partial effects of matrix element (in leptonic W decays)");
100 desc.add<bool>("exponentiation", true).setDescription("set exponentiation mode");
101 desc.add<bool>("pairEmission", false).setDescription("set pair emission");
102 desc.add<bool>("photonEmission", true).setDescription("set photon emission");
103 desc.add<bool>("meCorrectionWtForScalar", false)
104 .setDescription("switch for complete effects of the matrix element (in scalar to two scalar decays)");
105 desc.add<bool>("meCorrectionWtForW", false)
106 .setDescription("switch for complete effects of matrix element (in leptonic W decays)");
107 desc.add<bool>("meCorrectionWtForZ", false)
108 .setDescription("switch for complete effects of matrix element (in leptonic Z decays)");
109 desc.add<bool>("topProcessRadiation", true)
110 .setDescription("set photon emission in top pair production in quark (gluon) pair annihilation");
111 return desc;
112 }
113 } // namespace hadr
114} // namespace cepgen
115
116// register event modifier
#define REGISTER_MODIFIER(name, obj)
Add a generic event modification module definition to the factory.
cepgen::hadr::PhotosFilter PhotosFilter
Interfacing between CepGen and HepMC event definitions.
void merge(cepgen::Event &) const
Merge this event with another CepGen event record.
Class template to interface (external/internal) events modification algorithms.
static ParametersDescription description()
Container for the information on the in- and outgoing particles' kinematics.
Definition Event.h:28
void dump() const
Dump all the known information on every Particle object contained in this Event container in the outp...
Definition Event.cpp:423
A description object for parameters collection.
Interface to the Photos decay routine.
PhotosFilter(const ParametersList &)
bool run(Event &ev, double &weight, bool fast) override
Modify an event.
static ParametersDescription description()
constexpr double ALPHA_EM
Electromagnetic coupling constant .
Definition Constants.h:28
Common namespace for this Monte Carlo generator.