CMS 3D CMS Logo

HepMC3Product.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_HepMC3Product_h
2 #define SimDataFormats_GeneratorProducts_HepMC3Product_h
3 
10 #include <TMatrixD.h>
11 #include <HepMC3/GenEvent.h>
12 #include <HepMC3/Data/GenEventData.h>
13 #include <cstddef>
14 
15 namespace HepMC3 {
16  class FourVector;
17  class GenParticle;
18  class GenVertex;
19 } // namespace HepMC3
20 
21 namespace edm {
22  class HepMC3Product {
23  public:
25 
26  explicit HepMC3Product(HepMC3::GenEvent *evt);
28 
29  void addHepMCData(HepMC3::GenEvent *evt);
30 
31  void applyVtxGen(HepMC3::FourVector const *vtxShift) { applyVtxGen(*vtxShift); }
32  void applyVtxGen(HepMC3::FourVector const &vtxShift);
33 
34  void boostToLab(TMatrixD const *lorentz, std::string const &type);
35 
36  const HepMC3::GenEventData *GetEvent() const { return &evt_; }
37 
38  bool isVtxGenApplied() const { return isVtxGenApplied_; }
39  bool isVtxBoostApplied() const { return isVtxBoostApplied_; }
40  bool isPBoostApplied() const { return isPBoostApplied_; }
41 
42  private:
43  HepMC3::GenEventData evt_;
44 
48  };
49 
50  // This allows edm::Refs to work with HepMC3Product
51  namespace refhelper {
52  template <>
54  struct Find {
58 
60  //return iContainer.getHepMCData().barcode_to_particle(iBarCode);
61  return nullptr;
62  }
63  };
64 
65  typedef Find value;
66  };
67 
68  template <>
69  struct FindTrait<edm::HepMC3Product, HepMC3::GenVertex> {
70  struct Find {
73  using result_type = HepMC3::GenVertex const *;
74 
76  //return iContainer.getHepMCData().barcode_to_vertex(iBarCode);
77  return nullptr;
78  }
79  };
80 
81  typedef Find value;
82  };
83  } // namespace refhelper
84 } // namespace edm
85 
86 #endif // SimDataFormats_GeneratorProducts_HepMC3Product_h
bool isPBoostApplied() const
Definition: HepMC3Product.h:40
void boostToLab(TMatrixD const *lorentz, std::string const &type)
bool isVtxGenApplied() const
Definition: HepMC3Product.h:38
bool isVtxBoostApplied() const
Definition: HepMC3Product.h:39
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition: HepMC3Product.h:75
void applyVtxGen(HepMC3::FourVector const *vtxShift)
Definition: HepMC3Product.h:31
void addHepMCData(HepMC3::GenEvent *evt)
HLT enums.
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition: HepMC3Product.h:59
HepMC3::GenEventData evt_
Definition: HepMC3Product.h:43
const HepMC3::GenEventData * GetEvent() const
Definition: HepMC3Product.h:36