ATLAS Offline Software
EventInfoBranch.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONTESTERTREE_EVENTINFOBRANCH_H
5 #define MUONTESTERTREE_EVENTINFOBRANCH_H
12 #include <atomic>
13 
14 namespace MuonVal {
16 public:
17 
18  enum WriteOpts {
20  isMC = 1,
22  writePileUp = 1 << 1,
24  writePRW = 1 << 2,
26  writeBeamSpot = 1 << 3,
28  writeTrigger = 1 << 4,
30  writeLHE = 1<<5
31  };
32 
33  EventInfoBranch(MuonTesterTree& tree, unsigned int write_mask);
34 
35  bool fill(const EventContext& ctx) override final;
36  bool init() override final;
37 
39  static void setNumLHE(unsigned int numLHE) ATLAS_THREAD_SAFE;
40  static unsigned int getNumLHE();
41 
42 private:
43  static std::atomic<unsigned int> s_num_lhe ATLAS_THREAD_SAFE;
45  SG::ReadHandleKey<xAOD::EventInfo> m_key{"EventInfo"};
48  std::vector<EvtInfoDecor> m_prwKeys{};
49  unsigned int m_writemask{0};
50 
51 
52  ScalarBranch<unsigned long long>& m_evtNumber{parent().newScalar<unsigned long long>("eventNumber")};
54 
57 
60 
69  ScalarBranch<double>& m_weight{parent().newScalar<double>("mcEventWeight")};
70  std::map<unsigned int, std::shared_ptr<ScalarBranch<double>>> m_lhe_weights{};
71 
76  ScalarBranch<double>& m_beamSpotWeight{parent().newScalar<double>("BeamSpotWeight")};
77 };
78 }
79 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonVal::EventInfoBranch::fill
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition: EventInfoBranch.cxx:55
MuonVal::EventInfoBranch::m_average_mu
ScalarBranch< float > & m_average_mu
Toggled by the Write PileUp flag.
Definition: EventInfoBranch.h:62
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
MuonVal::EventInfoBranch::setNumLHE
static void setNumLHE(unsigned int numLHE) ATLAS_THREAD_SAFE
Specify the number of LHE variations that are available in the sample.
Definition: EventInfoBranch.cxx:15
MuonVal::EventInfoBranch::m_mcChannel
ScalarBranch< uint32_t > & m_mcChannel
Definition: EventInfoBranch.h:67
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
MuonVal::EventInfoBranch::m_lbNumber
ScalarBranch< uint32_t > & m_lbNumber
Definition: EventInfoBranch.h:55
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
MuonVal::EventInfoBranch::isMC
@ isMC
Flag determining whether the branch is simulation.
Definition: EventInfoBranch.h:20
MuonVal::EventInfoBranch::m_weight
ScalarBranch< double > & m_weight
Removed from output if writeLHE is switched on.
Definition: EventInfoBranch.h:69
MuonVal::MuonTesterBranch
Definition: MuonTesterBranch.h:21
MuonVal::EventInfoBranch::writeBeamSpot
@ writeBeamSpot
Write the beamspot weight.
Definition: EventInfoBranch.h:26
MuonVal::EventInfoBranch::m_key
SG::ReadHandleKey< xAOD::EventInfo > m_key
Common access to the EventInfo.
Definition: EventInfoBranch.h:45
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
MuonTesterTree.h
MuonVal::EventInfoBranch::EventInfoBranch
EventInfoBranch(MuonTesterTree &tree, unsigned int write_mask)
Definition: EventInfoBranch.cxx:17
MuonVal::EventInfoBranch::m_runNumber
ScalarBranch< uint32_t > & m_runNumber
Definition: EventInfoBranch.h:53
MuonVal::EventInfoBranch
Definition: EventInfoBranch.h:15
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition: MuonTesterBranch.cxx:53
MuonVal::EventInfoBranch::m_rnd_lumi_block
ScalarBranch< uint32_t > & m_rnd_lumi_block
Definition: EventInfoBranch.h:75
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonVal::EventInfoBranch::m_rnd_run
ScalarBranch< uint32_t > & m_rnd_run
Definition: EventInfoBranch.h:74
MuonVal::EventInfoBranch::m_actual_mu
ScalarBranch< float > & m_actual_mu
Definition: EventInfoBranch.h:63
ScalarBranch.h
MuonVal
Class to store array like branches into the n-tuples.
Definition: MuonTPMetaDataAlg.cxx:25
MuonVal::EventInfoBranch::WriteOpts
WriteOpts
Definition: EventInfoBranch.h:18
MuonVal::EventInfoBranch::m_l1id
ScalarBranch< uint32_t > & m_l1id
Toggled by the write trigger flag.
Definition: EventInfoBranch.h:59
MuonVal::ScalarBranch< unsigned long long >
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
MuonVal::EventInfoBranch::m_prwWeight
ScalarBranch< double > & m_prwWeight
Branches toggled by the write prw Flag.
Definition: EventInfoBranch.h:73
MuonVal::MuonTesterTree::newScalar
ScalarBranch< T > & newScalar(const std::string &name)
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
MuonVal::EventInfoBranch::m_beamSpotWeight
ScalarBranch< double > & m_beamSpotWeight
Definition: EventInfoBranch.h:76
MuonVal::EventInfoBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition: EventInfoBranch.cxx:90
MuonTesterBranch.h
EventInfo.h
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
MuonVal::EventInfoBranch::m_evtNumber
ScalarBranch< unsigned long long > & m_evtNumber
Definition: EventInfoBranch.h:52
MuonVal::EventInfoBranch::writePRW
@ writePRW
Write the corrected pile-up.
Definition: EventInfoBranch.h:24
MuonVal::EventInfoBranch::writePileUp
@ writePileUp
Write pile-up information.
Definition: EventInfoBranch.h:22
MuonVal::EventInfoBranch::m_prwKeys
std::vector< EvtInfoDecor > m_prwKeys
Definition: EventInfoBranch.h:48
MuonVal::EventInfoBranch::ATLAS_THREAD_SAFE
static std::atomic< unsigned int > s_num_lhe ATLAS_THREAD_SAFE
Definition: EventInfoBranch.h:43
MuonVal::EventInfoBranch::writeTrigger
@ writeTrigger
Write the trigger information.
Definition: EventInfoBranch.h:28
MuonVal::EventInfoBranch::writeLHE
@ writeLHE
Write each of the LHE weights.
Definition: EventInfoBranch.h:30
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
MuonVal::EventInfoBranch::getNumLHE
static unsigned int getNumLHE()
Definition: EventInfoBranch.cxx:16
MuonVal::EventInfoBranch::m_writemask
unsigned int m_writemask
Definition: EventInfoBranch.h:49
MuonVal::EventInfoBranch::m_bcid
ScalarBranch< uint32_t > & m_bcid
Definition: EventInfoBranch.h:56
MuonVal::EventInfoBranch::m_lhe_weights
std::map< unsigned int, std::shared_ptr< ScalarBranch< double > > > m_lhe_weights
Definition: EventInfoBranch.h:70