PandaTree
UnpackedPFCand.h
1 #ifndef PandaTree_Objects_UnpackedPFCand_h
2 #define PandaTree_Objects_UnpackedPFCand_h
3 #include "Constants.h"
4 #include "PFCandBase.h"
5 #include "PtEtaPhiMMixin.h"
6 #include "../../Framework/interface/Array.h"
7 #include "../../Framework/interface/Collection.h"
8 #include "../../Framework/interface/Ref.h"
9 #include "../../Framework/interface/RefVector.h"
10 
11 namespace panda {
12 
13  class PFCand;
14 
15  class UnpackedPFCand : public PFCandBase, public PtEtaPhiMMixin {
16  public:
19  ~datastore() { deallocate(); }
20 
21  /* PFCandBase
22  UChar_t* ptype{0};
23  ContainerBase const* vertexContainer_{0};
24  Short_t* vertex_{0}; ///< transient
25  ContainerBase const* trackContainer_{0};
26  Short_t* track_{0}; ///< transient
27  Float_t* hCalFrac{0};
28  */
29  /* PtEtaPhiMMixin
30  Float_t* pt_{0};
31  Float_t* eta_{0};
32  Float_t* phi_{0};
33  Float_t* mass_{0};
34  */
35  Float_t* puppiW_{0};
36  Float_t* puppiWNoLep_{0};
37 
38  void allocate(UInt_t n) override;
39  void deallocate() override;
40  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
41  utils::BranchList getStatus(TTree&, TString const&) const override;
42  utils::BranchList getBranchNames(TString const& = "") const override;
43  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
44  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
45  void releaseTree(TTree&, TString const&) override;
46  void resizeVectors_(UInt_t) override;
47  };
48 
51 
52  typedef PFCandBase base_type;
53 
54  UnpackedPFCand(char const* name = "");
56  UnpackedPFCand(datastore&, UInt_t idx);
57  ~UnpackedPFCand();
58  UnpackedPFCand& operator=(UnpackedPFCand const&);
59 
60  static char const* typeName() { return "UnpackedPFCand"; }
61 
62  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
63  void dump(std::ostream& = std::cout) const override;
64 
65  double pt() const override { return pt_; }
66  double eta() const override { return eta_; }
67  double phi() const override { return phi_; }
68  double m() const override { return mass_; }
69  void setPtEtaPhiM(double pt, double eta, double phi, double m) override;
70  void setXYZE(double px, double py, double pz, double e) override;
71  double puppiW() const override { return puppiW_; }
72  double puppiWNoLep() const override { return puppiWNoLep_; }
73  void setPuppiW(double w, double wnl) override { puppiW_ = w; puppiWNoLep_ = wnl; }
74 
75  /* PFCandBase
76  UChar_t& ptype;
77  Ref<RecoVertex> vertex;
78  Ref<PackedTrack> track;
79  Float_t& hCalFrac;
80  */
81 
82  protected:
83  /* PtEtaPhiMMixin
84  Float_t& pt_;
85  Float_t& eta_;
86  Float_t& phi_;
87  Float_t& mass_;
88  */
89  Float_t& puppiW_;
90  Float_t& puppiWNoLep_;
91 
92  public:
93  /* BEGIN CUSTOM UnpackedPFCand.h.classdef */
94  UnpackedPFCand& operator=(PFCand const&);
95  /* END CUSTOM */
96 
97  static utils::BranchList getListOfBranches();
98 
99  void destructor(Bool_t recursive = kFALSE);
100 
101  protected:
103 
104  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
105  void doInit_() override;
106  };
107 
112 
113  /* BEGIN CUSTOM UnpackedPFCand.h.global */
114  /* END CUSTOM */
115 
116 }
117 
118 #endif
Base class for fixed-size containers.
Definition: ArrayBase.h:13
A reference to an element in a container.
Definition: Ref.h:20
Definition: PtEtaPhiMMixin.h:7
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: UnpackedPFCand.cc:225
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: UnpackedPFCand.cc:233
Base class for dynamic-size containers.
Definition: CollectionBase.h:16
Definition: UnpackedPFCand.h:15
Template class for fixed-size container implementations. Inherits from base_type::array_type of the e...
Definition: Array.h:20
List of branch names.
Definition: IOUtils.h:64
Definition: UnpackedPFCand.h:17
Definition: PtEtaPhiMMixin.h:9
Definition: PFCand.h:15
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: UnpackedPFCand.cc:116
Template class for dynamic-size container implementations. Inherits from base_type::collection_type o...
Definition: Collection.h:19
Definition: PFCandBase.h:38
Base class for elements of containers.
Definition: Element.h:32
Definition: Array.h:11
A vector of references to elements in a container.
Definition: RefVector.h:18
Definition: PFCandBase.h:14