|
ATLAS Offline Software
|
Go to the documentation of this file.
14 std::atomic<unsigned int> EventInfoBranch::s_num_lhe = 0;
18 const std::string& evtKey):
21 m_writemask{write_mask}{
23 if (m_writemask & WriteOpts::writeLHE) {
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");
33 tree.disableBranch(m_mcChannel.name());
34 tree.disableBranch(m_weight.name());
35 m_writemask&= ~(WriteOpts::writePRW | WriteOpts::writeBeamSpot);
38 if (m_writemask & WriteOpts::writePRW) {
43 tree.disableBranch(m_prwWeight.name());
44 tree.disableBranch(m_rnd_run.name());
45 tree.disableBranch(m_rnd_lumi_block.name());
47 if (!(m_writemask & WriteOpts::writeBeamSpot))
tree.disableBranch(m_beamSpotWeight.name());
48 if (!(m_writemask & WriteOpts::writePileUp)) {
49 tree.disableBranch(m_average_mu.name());
50 tree.disableBranch(m_actual_mu.name());
52 if (!(m_writemask & WriteOpts::writeTrigger))
tree.disableBranch(m_l1id.name());
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);
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
EventInfoBranch(MuonTesterTree &tree, unsigned int write_mask, const std::string &evtKey="EventInfo")
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.
#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