src
SimDataFormats
GeneratorProducts
interface
HepMCProduct.h
Go to the documentation of this file.
1
#ifndef SimDataFormats_GeneratorProducts_HepMCProduct_h
2
#define SimDataFormats_GeneratorProducts_HepMCProduct_h
3
9
#include "
DataFormats/Common/interface/Ref.h
"
10
#include <TMatrixD.h>
11
#include <HepMC/GenEvent.h>
12
#include <cstddef>
13
14
namespace
HepMC
{
15
class
FourVector;
16
class
GenParticle
;
17
class
GenVertex;
18
}
// namespace HepMC
19
20
namespace
edm
{
21
class
HepMCProduct
{
22
public
:
23
HepMCProduct
() :
evt_
(nullptr),
isVtxGenApplied_
(
false
),
isVtxBoostApplied_
(
false
),
isPBoostApplied_
(
false
) {}
24
25
explicit
HepMCProduct
(
HepMC::GenEvent
*evt);
26
virtual
~HepMCProduct
();
27
28
void
addHepMCData
(
HepMC::GenEvent
*evt);
29
30
void
applyVtxGen
(HepMC::FourVector
const
*vtxShift) {
applyVtxGen
(*vtxShift); }
31
void
applyVtxGen
(HepMC::FourVector
const
&vtxShift);
32
33
void
boostToLab
(TMatrixD
const
*lorentz,
std::string
const
&
type
);
34
35
const
HepMC::GenEvent
&
getHepMCData
()
const
;
36
37
const
HepMC::GenEvent
*
GetEvent
()
const
{
return
evt_
; }
38
39
bool
isVtxGenApplied
()
const
{
return
isVtxGenApplied_
; }
40
bool
isVtxBoostApplied
()
const
{
return
isVtxBoostApplied_
; }
41
bool
isPBoostApplied
()
const
{
return
isPBoostApplied_
; }
42
43
HepMCProduct
(
HepMCProduct
const
&orig);
44
HepMCProduct
&
operator=
(
HepMCProduct
const
&
other
);
45
HepMCProduct
(
HepMCProduct
&&orig);
46
HepMCProduct
&
operator=
(
HepMCProduct
&&
other
);
47
void
swap
(
HepMCProduct
&
other
);
48
49
private
:
50
HepMC::GenEvent
*
evt_
;
51
52
bool
isVtxGenApplied_
;
53
bool
isVtxBoostApplied_
;
54
bool
isPBoostApplied_
;
55
};
56
57
// This allows edm::Refs to work with HepMCProduct
58
namespace
refhelper {
59
template
<>
60
struct
FindTrait
<
edm
::
HepMCProduct
,
HepMC::GenParticle
> {
61
struct
Find {
62
using
first_argument_type
=
edm::HepMCProduct
const
&;
63
using
second_argument_type
=
int
;
64
using
result_type
=
HepMC::GenParticle
const
*;
65
66
result_type
operator()
(
first_argument_type
iContainer,
second_argument_type
iBarCode) {
67
return
iContainer.getHepMCData().barcode_to_particle(iBarCode);
68
}
69
};
70
71
typedef
Find
value
;
72
};
73
74
template
<>
75
struct
FindTrait
<
edm
::
HepMCProduct
, HepMC::GenVertex> {
76
struct
Find {
77
using
first_argument_type
=
edm::HepMCProduct
const
&;
78
using
second_argument_type
=
int
;
79
using
result_type
= HepMC::GenVertex
const
*;
80
81
result_type
operator()
(
first_argument_type
iContainer,
second_argument_type
iBarCode) {
82
return
iContainer.getHepMCData().barcode_to_vertex(iBarCode);
83
}
84
};
85
86
typedef
Find
value
;
87
};
88
}
// namespace refhelper
89
}
// namespace edm
90
91
#endif // SimDataFormats_GeneratorProducts_HepMCProduct_h
GenParticle.GenParticle
GenParticle
Definition:
GenParticle.py:18
edm::HepMCProduct::HepMCProduct
HepMCProduct()
Definition:
HepMCProduct.h:23
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenParticle >::Find::result_type
HepMC::GenParticle const * result_type
Definition:
HepMCProduct.h:64
edm::HepMCProduct::~HepMCProduct
virtual ~HepMCProduct()
Definition:
HepMCProduct.cc:20
GenParticle
Definition:
GenParticle.py:1
edm::HepMCProduct::isVtxGenApplied
bool isVtxGenApplied() const
Definition:
HepMCProduct.h:39
funct::false
false
Definition:
Factorize.h:29
edm::HepMCProduct::swap
void swap(HepMCProduct &other)
Definition:
HepMCProduct.cc:133
edm::HepMCProduct::getHepMCData
const HepMC::GenEvent & getHepMCData() const
Definition:
HepMCProduct.cc:120
edm::HepMCProduct::addHepMCData
void addHepMCData(HepMC::GenEvent *evt)
Definition:
HepMCProduct.cc:28
edm::HepMCProduct::evt_
HepMC::GenEvent * evt_
Definition:
HepMCProduct.h:50
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenVertex >::Find::first_argument_type
edm::HepMCProduct const & first_argument_type
Definition:
HepMCProduct.h:77
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenVertex >::Find::second_argument_type
int second_argument_type
Definition:
HepMCProduct.h:78
edm::HepMCProduct::isPBoostApplied_
bool isPBoostApplied_
Definition:
HepMCProduct.h:54
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:39
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenParticle >::Find::first_argument_type
edm::HepMCProduct const & first_argument_type
Definition:
HepMCProduct.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::HepMCProduct::operator=
HepMCProduct & operator=(HepMCProduct const &other)
Definition:
HepMCProduct.cc:142
createfilelist.int
int
Definition:
createfilelist.py:10
HepMC::GenEvent
Definition:
hepmc_rootio.cc:9
edm::HepMCProduct::isVtxGenApplied_
bool isVtxGenApplied_
Definition:
HepMCProduct.h:52
trackingPlots.other
other
Definition:
trackingPlots.py:1464
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenVertex >::value
Find value
Definition:
HepMCProduct.h:86
edm::HepMCProduct::applyVtxGen
void applyVtxGen(HepMC::FourVector const *vtxShift)
Definition:
HepMCProduct.h:30
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenParticle >::Find::second_argument_type
int second_argument_type
Definition:
HepMCProduct.h:63
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition:
HepMCProduct.h:37
edm::HepMCProduct::boostToLab
void boostToLab(TMatrixD const *lorentz, std::string const &type)
Definition:
HepMCProduct.cc:58
Ref.h
edm::HepMCProduct::isPBoostApplied
bool isPBoostApplied() const
Definition:
HepMCProduct.h:41
edm::HepMCProduct::isVtxBoostApplied_
bool isVtxBoostApplied_
Definition:
HepMCProduct.h:53
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::HepMCProduct
Definition:
HepMCProduct.h:21
HepMC
Definition:
GenParticle.h:15
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenVertex >::Find::operator()
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition:
HepMCProduct.h:81
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenParticle >::value
Find value
Definition:
HepMCProduct.h:71
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenVertex >::Find::result_type
HepMC::GenVertex const * result_type
Definition:
HepMCProduct.h:79
edm::refhelper::FindTrait
Definition:
RefTraits.h:41
edm::HepMCProduct::isVtxBoostApplied
bool isVtxBoostApplied() const
Definition:
HepMCProduct.h:40
edm::refhelper::FindTrait< edm::HepMCProduct, HepMC::GenParticle >::Find::operator()
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition:
HepMCProduct.h:66
Generated for CMSSW Reference Manual by
1.8.14