PandaTree
EventBase.h
1 #ifndef PandaTree_Objects_EventBase_h
2 #define PandaTree_Objects_EventBase_h
3 #include "../../Framework/interface/TreeEntry.h"
4 #include "Constants.h"
5 #include "HLTBits.h"
6 #include "Parton.h"
7 #include "Vertex.h"
8 #include "Run.h"
9 #include "TList.h"
10 #include "TFile.h"
11 #include "TKey.h"
12 #include "HLTObjectStore.h"
13 #include "GenParticleBase.h"
14 #include "PandaTree/Framework/interface/RRNG.h"
15 
16 namespace panda {
17 
18  class EventBase : public TreeEntry {
19  public:
20  EventBase();
21  EventBase(EventBase const&);
22  ~EventBase();
23  EventBase& operator=(EventBase const&);
24 
25  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
26  void dump(std::ostream& = std::cout) const override;
27 
28  virtual GenParticleBaseCollection const* genParticleCollection() const { return nullptr; }
29  virtual GenParticleBaseCollection* genParticleCollection() { return nullptr; }
30 
31  HLTBits triggers = HLTBits("triggers");
32  PartonCollection partons = PartonCollection("partons", 8);
33  Vertex genVertex = Vertex("genVertex");
34 
35  UInt_t runNumber{};
36  UInt_t lumiNumber{};
37  ULong64_t eventNumber{};
38  Bool_t isData{};
39  Float_t weight{};
40  UShort_t npv{};
41  UShort_t npvTrue{};
42 
43  static utils::BranchList getListOfBranches(Bool_t direct = kFALSE);
44 
45  protected:
46  void doSetStatus_(TTree&, utils::BranchList const&) override;
47  utils::BranchList doGetStatus_(TTree&) const override;
48  utils::BranchList doGetBranchNames_() const override;
49  void doSetAddress_(TTree&, utils::BranchList const&, Bool_t setStatus) override;
50  void doBook_(TTree&, utils::BranchList const&) override;
51  void doGetEntry_(TTree&) override;
52  void doInit_() override;
53  void doUnlink_(TTree&) override;
54 
55  public:
56  /* BEGIN CUSTOM EventBase.h.classdef */
57 
60 
62  void setReadRunTree(Bool_t s) { readRunTree_ = s; }
63 
65 
72  UInt_t registerTrigger(char const* path) { return run.registerTrigger(path); }
73 
75 
80  Bool_t triggerFired(UInt_t token) const;
81 
84 
86 
90  void registerTriggerObjects(char const* filter) { triggerObjects.registerFilter(filter); }
91 
93  RRNG rng{0,0,nullptr};
94 
95  private:
97  void setTriggerFilters_();
98 
100  Bool_t readRunTree_{kTRUE};
101 
103 
106  std::map<TTree*, std::pair<Int_t, TTree*>> runTrees_;
107 
108  /* END CUSTOM */
109  };
110 
111  /* BEGIN CUSTOM EventBase.h.global */
112  /* END CUSTOM */
113 
114 }
115 
116 #endif
Definition: Vertex.h:12
Bool_t triggerFired(UInt_t token) const
Trigger decision of the event.
Definition: EventBase.cc:288
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: EventBase.cc:99
RRNG rng
Repeatable random number generator, initialized to be empty.
Definition: EventBase.h:93
void registerFilter(char const *filter)
Use to declare a trigger filter name (key in the triggerObjects map) to be used in the analysis...
Definition: HLTObjectStore.h:32
void setStatus(TTree &, utils::BranchList const &blist) final
Set status of branches to true (matching branch) or false (vetoed branch)
Definition: TreeEntry.cc:5
Run run
Current run object.
Definition: EventBase.h:59
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: EventBase.cc:79
List of branch names.
Definition: IOUtils.h:64
void registerTriggerObjects(char const *filter)
Use to declare a trigger filter name (key in the triggerObjects map) to be used in the analysis...
Definition: EventBase.h:90
Definition: RRNG.h:13
void setReadRunTree(Bool_t s)
Turn run synch feature on/off (default on)
Definition: EventBase.h:62
Definition: EventBase.h:18
Template class for dynamic-size container implementations. Inherits from base_type::collection_type o...
Definition: Collection.h:19
UInt_t registerTrigger(char const *path)
See description on Event::registerTrigger.
Definition: Run.cc:188
Definition: HLTBits.h:12
Definition: HLTObjectStore.h:12
HLTObjectStore triggerObjects
Trigger object collection with additional features.
Definition: EventBase.h:83
Definition: Run.h:9
Base class for objects representing one full entry of a tree (e.g. Event).
Definition: TreeEntry.h:19
Definition: Array.h:11
UInt_t registerTrigger(char const *path)
Use to declare a trigger path to be used in the analysis. Returns a token for the path...
Definition: EventBase.h:72