PandaTree
Parton.h
1 #ifndef PandaTree_Objects_Parton_h
2 #define PandaTree_Objects_Parton_h
3 #include "Constants.h"
4 #include "ParticleM.h"
5 #include "../../Framework/interface/Array.h"
6 #include "../../Framework/interface/Collection.h"
7 #include "../../Framework/interface/Ref.h"
8 #include "../../Framework/interface/RefVector.h"
9 
10 namespace panda {
11 
12  class Parton : public ParticleM {
13  public:
14  struct datastore : public ParticleM::datastore {
16  ~datastore() { deallocate(); }
17 
18  Int_t* pdgid{0};
19 
20  void allocate(UInt_t n) override;
21  void deallocate() override;
22  void setStatus(TTree&, TString const&, utils::BranchList const&) override;
23  utils::BranchList getStatus(TTree&, TString const&) const override;
24  utils::BranchList getBranchNames(TString const& = "") const override;
25  void setAddress(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
26  void book(TTree&, TString const&, utils::BranchList const& = {"*"}, Bool_t dynamic = kTRUE) override;
27  void releaseTree(TTree&, TString const&) override;
28  void resizeVectors_(UInt_t) override;
29  };
30 
31  typedef Array<Parton> array_type;
33 
34  typedef ParticleM base_type;
35 
36  Parton(char const* name = "");
37  Parton(Parton const&);
38  Parton(datastore&, UInt_t idx);
39  ~Parton();
40  Parton& operator=(Parton const&);
41 
42  static char const* typeName() { return "Parton"; }
43 
44  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
45  void dump(std::ostream& = std::cout) const override;
46 
47  Int_t& pdgid;
48 
49  /* BEGIN CUSTOM Parton.h.classdef */
50  /* END CUSTOM */
51 
52  static utils::BranchList getListOfBranches();
53 
54  void destructor(Bool_t recursive = kFALSE);
55 
56  protected:
57  Parton(ArrayBase*);
58 
59  void doBook_(TTree&, TString const&, utils::BranchList const& = {"*"}) override;
60  void doInit_() override;
61  };
62 
63  typedef Array<Parton> PartonArray;
65  typedef Ref<Parton> PartonRef;
67 
68  /* BEGIN CUSTOM Parton.h.global */
69  /* END CUSTOM */
70 
71 }
72 
73 #endif
Base class for fixed-size containers.
Definition: ArrayBase.h:13
A reference to an element in a container.
Definition: Ref.h:20
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: Parton.cc:169
Base class for dynamic-size containers.
Definition: CollectionBase.h:16
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: Parton.h:14
Definition: Parton.h:12
Definition: ParticleM.h:13
void resizeVectors_(UInt_t) override
Override when there are vector members.
Definition: Parton.cc:75
Definition: ParticleM.h:15
Base class for elements of containers.
Definition: Element.h:32
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: Parton.cc:161
Definition: Array.h:11
A vector of references to elements in a container.
Definition: RefVector.h:18