PandaTree
HLTBits.h
1 #ifndef PandaTree_Objects_HLTBits_h
2 #define PandaTree_Objects_HLTBits_h
3 #include "Constants.h"
4 #include "../../Framework/interface/Singlet.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 HLTBits : public Singlet {
13  public:
14  typedef Singlet base_type;
15 
16  HLTBits(char const* name = "");
17  HLTBits(HLTBits const&);
18  ~HLTBits();
19  HLTBits& operator=(HLTBits const&);
20 
21  static char const* typeName() { return "HLTBits"; }
22 
23  void print(std::ostream& = std::cout, UInt_t level = 1) const override;
24  void dump(std::ostream& = std::cout) const override;
25 
26  void set(unsigned iB) { if (iB >= 1024) return; words[iB / 32] |= (1 << (iB % 32)); }
27  bool pass(unsigned iB) const { if (iB >= 1024) return false; return (words[iB / 32] & (1 << (iB % 32))) != 0; }
28 
29  UInt_t words[32]{};
30 
31  /* BEGIN CUSTOM HLTBits.h.classdef */
32  /* END CUSTOM */
33 
34  static utils::BranchList getListOfBranches();
35 
36  protected:
37  void doSetStatus_(TTree&, utils::BranchList const&) override;
38  utils::BranchList doGetStatus_(TTree&) const override;
39  utils::BranchList doGetBranchNames_(Bool_t) const override;
40  void doSetAddress_(TTree&, utils::BranchList const& = {"*"}, Bool_t setStatus = kTRUE) override;
41  void doBook_(TTree&, utils::BranchList const& = {"*"}) override;
42  void doInit_() override;
43  };
44 
45  /* BEGIN CUSTOM HLTBits.h.global */
46  /* END CUSTOM */
47 
48 }
49 
50 #endif
void dump(std::ostream &=std::cout) const override
Dump the object content.
Definition: HLTBits.cc:93
List of branch names.
Definition: IOUtils.h:64
Base class for singlet objects.
Definition: Singlet.h:16
void print(std::ostream &=std::cout, UInt_t level=1) const override
Print the object content.
Definition: HLTBits.cc:85
Definition: HLTBits.h:12
void setStatus(TTree &, utils::BranchList const &blist) final
Set status of branches to true (matching branch) or false (vetoed branch)
Definition: Singlet.cc:4
Definition: Array.h:11