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 <cstddef>
13 
14 namespace HepMC3 {
15  class FourVector;
16  class GenParticle;
17  class GenVertex;
18 } // namespace HepMC3
19 
20 namespace edm {
21  class HepMC3Product {
22  public:
24 
25  explicit HepMC3Product(HepMC3::GenEvent *evt);
26  virtual ~HepMC3Product();
27 
28  void addHepMCData(HepMC3::GenEvent *evt);
29 
30  void applyVtxGen(HepMC3::FourVector const *vtxShift) { applyVtxGen(*vtxShift); }
31  void applyVtxGen(HepMC3::FourVector const &vtxShift);
32 
33  void boostToLab(TMatrixD const *lorentz, std::string const &type);
34 
35  const HepMC3::GenEvent &getHepMCData() const;
36 
37  const HepMC3::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  HepMC3Product(HepMC3Product const &orig);
47  void swap(HepMC3Product &other);
48 
49  private:
50  HepMC3::GenEvent *evt_;
51 
55  };
56 
57  // This allows edm::Refs to work with HepMC3Product
58  namespace refhelper {
59  template <>
61  struct Find {
65 
67  //return iContainer.getHepMCData().barcode_to_particle(iBarCode);
68  return nullptr;
69  }
70  };
71 
72  typedef Find value;
73  };
74 
75  template <>
76  struct FindTrait<edm::HepMC3Product, HepMC3::GenVertex> {
77  struct Find {
80  using result_type = HepMC3::GenVertex const *;
81 
83  //return iContainer.getHepMCData().barcode_to_vertex(iBarCode);
84  return nullptr;
85  }
86  };
87 
88  typedef Find value;
89  };
90  } // namespace refhelper
91 } // namespace edm
92 
93 #endif // SimDataFormats_GeneratorProducts_HepMC3Product_h
HepMC3::GenEvent * evt_
Definition: HepMC3Product.h:50
const HepMC3::GenEvent & getHepMCData() const
HepMC3Product & operator=(HepMC3Product const &other)
virtual ~HepMC3Product()
bool isPBoostApplied() const
Definition: HepMC3Product.h:41
void boostToLab(TMatrixD const *lorentz, std::string const &type)
void swap(HepMC3Product &other)
bool isVtxGenApplied() const
Definition: HepMC3Product.h:39
bool isVtxBoostApplied() const
Definition: HepMC3Product.h:40
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition: HepMC3Product.h:82
void applyVtxGen(HepMC3::FourVector const *vtxShift)
Definition: HepMC3Product.h:30
void addHepMCData(HepMC3::GenEvent *evt)
HLT enums.
result_type operator()(first_argument_type iContainer, second_argument_type iBarCode)
Definition: HepMC3Product.h:66
const HepMC3::GenEvent * GetEvent() const
Definition: HepMC3Product.h:37