ATLAS Offline Software
Loading...
Searching...
No Matches
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
14namespace MuonVal {
16public:
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 const std::string& evtKey="EventInfo");
35
36 bool fill(const EventContext& ctx) override final;
37 bool init() override final;
38
40 static void setNumLHE(unsigned int numLHE) ATLAS_THREAD_SAFE;
41 static unsigned int getNumLHE();
42
44 static std::atomic<unsigned int> s_num_lhe ATLAS_THREAD_SAFE;
46 SG::ReadHandleKey<xAOD::EventInfo> m_key{"EventInfo"};
49 std::vector<EvtInfoDecor> m_prwKeys{};
50 unsigned int m_writemask{0};
51
52
53 ScalarBranch<unsigned long long>& m_evtNumber{parent().newScalar<unsigned long long>("eventNumber")};
55
58
61
68 ScalarBranch<uint32_t>& m_mcChannel{parent().newScalar<uint32_t>("mcChannelNumber")};
70 ScalarBranch<double>& m_weight{parent().newScalar<double>("mcEventWeight")};
71 std::map<unsigned int, std::shared_ptr<ScalarBranch<double>>> m_lhe_weights{};
72
75 ScalarBranch<uint32_t>& m_rnd_run{parent().newScalar<uint32_t>("randomRunNumber")};
76 ScalarBranch<uint32_t>& m_rnd_lumi_block{parent().newScalar<uint32_t>("randomLumiBlockNumber")};
78};
79}
80#endif
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
#define ATLAS_THREAD_SAFE
ScalarBranch< uint32_t > & m_mcChannel
###################################################################### Disabled if the job runs on da...
ScalarBranch< uint32_t > & m_rnd_lumi_block
ScalarBranch< float > & m_average_mu
Toggled by the Write PileUp flag.
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
EventInfoBranch(MuonTesterTree &tree, unsigned int write_mask, const std::string &evtKey="EventInfo")
static void setNumLHE(unsigned int numLHE) ATLAS_THREAD_SAFE
Specify the number of LHE variations that are available in the sample.
ScalarBranch< uint32_t > & m_rnd_run
ScalarBranch< double > & m_weight
Removed from output if writeLHE is switched on.
static unsigned int getNumLHE()
static std::atomic< unsigned int > s_num_lhe ATLAS_THREAD_SAFE
@ writePileUp
Write pile-up information.
@ writeTrigger
Write the trigger information.
@ writePRW
Write the corrected pile-up.
@ isMC
Flag determining whether the branch is simulation.
@ writeLHE
Write each of the LHE weights.
@ writeBeamSpot
Write the beamspot weight.
ScalarBranch< uint32_t > & m_runNumber
ScalarBranch< uint32_t > & m_bcid
std::vector< EvtInfoDecor > m_prwKeys
ScalarBranch< double > & m_prwWeight
Branches toggled by the write prw Flag.
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...
ScalarBranch< unsigned long long > & m_evtNumber
std::map< unsigned int, std::shared_ptr< ScalarBranch< double > > > m_lhe_weights
ScalarBranch< float > & m_actual_mu
ScalarBranch< double > & m_beamSpotWeight
SG::ReadDecorHandleKey< xAOD::EventInfo > EvtInfoDecor
Access to the pile up weights if requested.
SG::ReadHandleKey< xAOD::EventInfo > m_key
Common access to the EventInfo.
ScalarBranch< uint32_t > & m_l1id
Toggled by the write trigger flag.
ScalarBranch< uint32_t > & m_lbNumber
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
ScalarBranch< T > & newScalar(const std::string &name)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19
Forward declaration.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TChain * tree
#define private