/usr/include/ThePEG/Vectors/HepMCConverter.h is in libthepeg-dev 1.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | // -*- C++ -*-
//
// HepMCConverter.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef ThePEG_HepMCConverter_H
#define ThePEG_HepMCConverter_H
// This is the declaration of the HepMCConverter class.
#include "ThePEG/Config/ThePEG.h"
#include "ThePEG/EventRecord/Event.h"
#include "HepMCTraits.h"
namespace ThePEG {
/**
* The HepMCConverter defines only one public static function which
* converts a ThePEG::Event object to a
* <code>HepMC::GenEvent</code>. All mother-daughter relationships and
* colour information is preserved.
*
* @see Event
* @see Particle
*
* @author Leif Lönnblad
*/
template <typename HepMCEventT, typename Traits = HepMCTraits<HepMCEventT> >
class HepMCConverter {
public:
/** @cond EXCEPTIONCLASSES */
/** Exception class for HepMCConverter. */
struct HepMCConverterException: public Exception {};
/** @endcond */
/**
* Help class to represent a temporary vertex which can be
* converted to a GenVertex.
*/
struct Vertex {
/** Particles going in to the vertex. */
tcParticleSet in;
/** Particles going out of the vertex. */
tcParticleSet out;
};
/** Forward typedefs from Traits class. */
typedef typename Traits::ParticleT GenParticle;
/** Forward typedefs from Traits class. */
typedef typename Traits::EventT GenEvent;
/** Forward typedefs from Traits class. */
typedef typename Traits::VertexT GenVertex;
/** Forward typedefs from Traits class. */
typedef typename Traits::PdfInfoT PdfInfo;
/** Map ThePEG particles to HepMC particles. */
typedef map<tcPPtr,GenParticle*> ParticleMap;
/** Map ThePEG colour lines to HepMC colour indices. */
typedef map<tcColinePtr,long> FlowMap;
/** Map ThePEG particles to vertices. */
typedef map<tcPPtr,Vertex*> VertexMap;
/** Map vertices to GenVertex */
typedef map<const Vertex *, GenVertex*> GenVertexMap;
public:
/**
* Convert a ThePEG::Event to a HepMC::GenEvent. The caller is
* responsible for deleting the constructed GenEvent object. If \a
* nocopies is true, only final copies of particles connected with
* Particle::previous() and Particle::next() will be entered in the
* HepMC::GenEvent. In the GenEvent object, the energy/momentum
* variables will be in units of \a eunit and lengths variables in
* units of \a lunit.
*/
static GenEvent * convert(const Event & ev, bool nocopies = false,
Energy eunit = Traits::defaultEnergyUnit(),
Length lunit = Traits::defaultLengthUnit());
/**
* Convert a ThePEG::Event to a HepMC::GenEvent. The caller supplies
* a GenEvent object, \a gev, which will be filled. If \a nocopies
* is true, only final copies of particles connected with
* Particle::previous() and Particle::next() will be entered in the
* HepMC::GenEvent. In the GenEvent object, the energy/momentum
* variables will be in units of \a eunit and lengths variables in
* units of \a lunit.
*/
static void
convert(const Event & ev, GenEvent & gev, bool nocopies,
Energy eunit, Length lunit);
/**
* Convert a ThePEG::Event to a HepMC::GenEvent. The caller supplies
* a GenEvent object, \a gev, which will be filled. If \a nocopies
* is true, only final copies of particles connected with
* Particle::previous() and Particle::next() will be entered in the
* HepMC::GenEvent. In the GenEvent object, the energy/momentum
* variables will be in units of \a eunit and lengths variables in
* units of \a lunit.
*/
static void
convert(const Event & ev, GenEvent & gev, bool nocopies = false);
private:
/**
* The proper constructors are private. The class is only
* instantiated within the convert method.
*/
HepMCConverter(const Event & ev, bool nocopies, Energy eunit, Length lunit);
/**
* The proper constructors are private. The class is only
* instantiated within the convert method.
*/
HepMCConverter(const Event & ev, GenEvent & gev, bool nocopies,
Energy eunit, Length lunit);
/**
* Common init function used by the constructors.
*/
void init(const Event & ev, bool nocopies);
/**
* Default constructor is unimplemented and private and should never be used.
*/
HepMCConverter();
/**
* Copy constructor is unimplemented and private and should never be used.
*/
HepMCConverter(const HepMCConverter &);
/**
* Assignment is unimplemented and private and should never be used.
*/
HepMCConverter & operator=(const HepMCConverter &);
private:
/**
* Create a GenParticle from a ThePEG Particle.
*/
GenParticle * createParticle(tcPPtr p) const;
/**
* Join the decay vertex of the parent with the decay vertex of the
* child.
*/
void join(tcPPtr parent, tcPPtr child);
/**
* Create a GenVertex from a temporary Vertex.
*/
GenVertex * createVertex(Vertex * v);
/**
* Create and set a PdfInfo object for the event
*/
void setPdfInfo(const Event & e);
private:
/**
* The constructed GenEvent.
*/
GenEvent * geneve;
/**
* The translation table between the ThePEG particles and the
* GenParticles.
*/
ParticleMap pmap;
/**
* The translation table between ThePEG ColourLine objects and HepMC
* Flow indices.
*/
FlowMap flowmap;
/**
* All temporary vertices created.
*/
vector<Vertex> vertices;
/**
* The mapping of particles to their production vertices.
*/
VertexMap prov;
/**
* The mapping of particles to their decy vertices.
*/
VertexMap decv;
/**
* The mapping between temporary vertices and the created GenVertex Objects.
*/
GenVertexMap vmap;
/**
* The energy unit to be used in the GenEvent.
*/
Energy energyUnit;
/**
* The length unit to be used in the GenEvent.
*/
Length lengthUnit;
};
}
#include "HepMCConverter.tcc"
#endif /* ThePEG_HepMCConverter_H */
|