Belle II Software  release-06-01-15
MCInitialParticles.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <framework/dataobjects/MCInitialParticles.h>
10 
11 using namespace Belle2;
12 
13 std::string MCInitialParticles::getGenerationFlagString(const std::string& separator) const
14 {
15  std::string flags = "";
16  const std::vector<std::pair<int, std::string>> flagvalues{
17  {c_generateCMS, "generateCMS"},
18  {c_smearBeamEnergy, "smearBeamEnergy"},
19  {c_smearBeamDirection, "smearBeamDirection"},
20  {c_smearVertex, "smearVertex"}
21  };
22  for (auto& i : flagvalues) {
23  if (hasGenerationFlags(i.first)) {
24  if (flags.size() > 0) flags += separator;
25  flags += i.second;
26  }
27  }
28  return flags;
29 }
@ c_generateCMS
generate initial event in CMS instead of lab
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
std::string getGenerationFlagString(const std::string &separator=" ") const
Return string representation of all active flags for printing.
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.
Abstract base class for different kinds of events.