Belle II Software  release-05-01-25
MCInitialParticles.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <framework/dataobjects/MCInitialParticles.h>
12 
13 using namespace Belle2;
14 
15 std::string MCInitialParticles::getGenerationFlagString(const std::string& separator) const
16 {
17  std::string flags = "";
18  const std::vector<std::pair<int, std::string>> flagvalues{
19  {c_generateCMS, "generateCMS"},
20  {c_smearBeamEnergy, "smearBeamEnergy"},
21  {c_smearBeamDirection, "smearBeamDirection"},
22  {c_smearVertex, "smearVertex"}
23  };
24  for (auto& i : flagvalues) {
25  if (hasGenerationFlags(i.first)) {
26  if (flags.size() > 0) flags += separator;
27  flags += i.second;
28  }
29  }
30  return flags;
31 }
Belle2::MCInitialParticles::c_smearBeamEnergy
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
Definition: MCInitialParticles.h:44
Belle2::MCInitialParticles::c_smearBeamDirection
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
Definition: MCInitialParticles.h:46
Belle2::MCInitialParticles::getGenerationFlagString
std::string getGenerationFlagString(const std::string &separator=" ") const
Return string representation of all active flags for printing.
Definition: MCInitialParticles.cc:15
Belle2::MCInitialParticles::c_smearVertex
@ c_smearVertex
smear vertex
Definition: MCInitialParticles.h:50
Belle2::MCInitialParticles::c_generateCMS
@ c_generateCMS
generate initial event in CMS instead of lab
Definition: MCInitialParticles.h:42
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MCInitialParticles::hasGenerationFlags
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.
Definition: MCInitialParticles.h:173