14std::atomic<unsigned int> EventInfoBranch::s_num_lhe = 0;
18 const std::string& evtKey):
24 for (
unsigned int lhe = 1; lhe < s_num_lhe ; ++lhe ) {
25 std::shared_ptr<ScalarBranch<double>>& new_br =
m_lhe_weights[lhe];
26 new_br = std::make_shared<ScalarBranch<double>>(
tree.tree(),
"mcEventWeight_LHE_" + std::to_string(lhe),0.);
27 if (!
tree.addBranch(new_br)) {
28 THROW_EXCEPTION(
"EventInfoBranch: Failed to create Scalar branch in c'tor");
59 if (!evt_info.isValid()) {
69 m_average_mu = evt_info->averageInteractionsPerCrossing();
70 m_actual_mu = evt_info->actualInteractionsPerCrossing();
72 m_l1id = evt_info->extendedLevel1ID();
76 m_weight = evt_info->mcEventWeight(0);
77 const unsigned int n_weights = evt_info->mcEventWeights().size();
79 (*lhe_branch) = lhe_idx < n_weights ? evt_info->mcEventWeight(lhe_idx) : 0.;
95 return !declare_dependency(decor);
Handle class for reading from StoreGate.
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()
@ 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)
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TTree * tree() override final
Returns the underlying TTree object.
SG::ConstAccessor< T, ALLOC > ConstAccessor
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Class to store array like branches into the n-tuples.
#define THROW_EXCEPTION(MESSAGE)