![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 std::atomic<unsigned int> EventInfoBranch::s_num_lhe = 0;
19 m_writemask{write_mask} {
21 if (m_writemask & WriteOpts::writeLHE) {
22 for (
unsigned int lhe = 1; lhe < s_num_lhe ; ++lhe ) {
23 std::shared_ptr<ScalarBranch<double>>& new_br = m_lhe_weights[lhe];
24 new_br = std::make_shared<ScalarBranch<double>>(
tree.tree(),
"mcEventWeight_LHE_" +
std::to_string(lhe),0.);
25 if (!
tree.addBranch(new_br)) {
26 THROW_EXCEPTION(
"EventInfoBranch: Failed to create Scalar branch in c'tor");
31 tree.disableBranch(m_mcChannel.name());
32 tree.disableBranch(m_weight.name());
33 m_writemask&= ~(WriteOpts::writePRW | WriteOpts::writeBeamSpot);
36 if (m_writemask & WriteOpts::writePRW) {
41 tree.disableBranch(m_prwWeight.name());
42 tree.disableBranch(m_rnd_run.name());
43 tree.disableBranch(m_rnd_lumi_block.name());
45 if (!(m_writemask & WriteOpts::writeBeamSpot))
tree.disableBranch(m_beamSpotWeight.name());
46 if (!(m_writemask & WriteOpts::writePileUp)) {
47 tree.disableBranch(m_average_mu.name());
48 tree.disableBranch(m_actual_mu.name());
50 if (!(m_writemask & WriteOpts::writeTrigger))
tree.disableBranch(m_l1id.name());
75 const unsigned int n_weights =
evt_info->mcEventWeights().size();
77 (*lhe_branch) = lhe_idx < n_weights ?
evt_info->mcEventWeight(lhe_idx) : 0.;
93 return !declare_dependency(decor);
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< float > & m_average_mu
Toggled by the Write PileUp flag.
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_mcChannel
ScalarBranch< uint32_t > & m_lbNumber
static AuxTypeRegistry & instance()
Return the singleton registry instance.
ScalarBranch< double > & m_weight
Removed from output if writeLHE is switched on.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
SG::ReadHandleKey< xAOD::EventInfo > m_key
Common access to the EventInfo.
Helper class to provide constant type-safe access to aux data.
EventInfoBranch(MuonTesterTree &tree, unsigned int write_mask)
#define THROW_EXCEPTION(MSG)
ScalarBranch< uint32_t > & m_runNumber
TTree * tree() override final
Returns the underlying TTree object.
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
ScalarBranch< uint32_t > & m_rnd_lumi_block
ScalarBranch< uint32_t > & m_rnd_run
ScalarBranch< float > & m_actual_mu
Class to store array like branches into the n-tuples.
ScalarBranch< uint32_t > & m_l1id
Toggled by the write trigger flag.
std::string to_string(const DetectorType &type)
ScalarBranch< double > & m_prwWeight
Branches toggled by the write prw Flag.
ScalarBranch< double > & m_beamSpotWeight
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
ScalarBranch< unsigned long long > & m_evtNumber
std::vector< EvtInfoDecor > m_prwKeys
Handle class for reading from StoreGate.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
static unsigned int getNumLHE()
ScalarBranch< uint32_t > & m_bcid
std::map< unsigned int, std::shared_ptr< ScalarBranch< double > > > m_lhe_weights