Belle II Software  release-06-00-14
InitialParticleGeneration.h
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 #pragma once
10 #ifndef GENERATORS_UTILITIES_INITIALPARTICLEGENERATION_H
11 #define GENERATORS_UTILITIES_INITIALPARTICLEGENERATION_H
12 
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/database/DBObjPtr.h>
15 #include <framework/utilities/MultivariateNormalGenerator.h>
16 #include <framework/dbobjects/BeamParameters.h>
17 #include <framework/dataobjects/MCInitialParticles.h>
18 
19 namespace Belle2 {
34  public:
39  explicit InitialParticleGeneration(int allowedFlags = 0): m_allowedFlags(allowedFlags | MCInitialParticles::c_generateCMS) {};
40 
43 
61  TVector3 updateVertex(bool force = false);
62 
64  const BeamParameters& getBeamParameters() const { return *m_beamParams; }
65 
67  void initialize();
68 
70  void setAllowedFlags(int allowedFlags)
71  {
73  }
74 
75  private:
76 
81  MCInitialParticles& generate(int allowedFlags);
82 
88  TVector3 generateVertex(const TVector3& initial, const TMatrixDSym& cov, MultivariateNormalGenerator& gen);
94  TLorentzVector generateBeam(const TLorentzVector& initial, const TMatrixDSym& cov, MultivariateNormalGenerator& gen);
107  };
108 
109 
111 } //Belle2 namespace
112 #endif // GENERATORS_UTILITIES_INITIALPARTICLEGENERATION_H
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
InitialParticleGeneration(int allowedFlags=0)
constructor
DBObjPtr< BeamParameters > m_beamParams
Datastore object containing the nominal beam parameters.
int m_allowedFlags
Allowed generation flags.
MultivariateNormalGenerator m_generateHER
Generator for HER.
StoreObjPtr< MCInitialParticles > m_event
Datastore object containing the generated event.
MultivariateNormalGenerator m_generateLER
Generator for LER.
MultivariateNormalGenerator m_generateVertex
Generator for Vertex.
const BeamParameters & getBeamParameters() const
Return reference to nominal beam parameters.
void setAllowedFlags(int allowedFlags)
Set allowed flags.
This class contains the initial state for the given event.
@ c_generateCMS
generate initial event in CMS instead of lab
Class to generate normal distributed, correlated random numbers given the mean values and the covaria...
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
TVector3 updateVertex(bool force=false)
Update the vertex position:
void initialize()
function to be executed on initialize()
MCInitialParticles & generate()
Generate a new event.
TVector3 generateVertex(const TVector3 &initial, const TMatrixDSym &cov, MultivariateNormalGenerator &gen)
generate the vertex
TLorentzVector generateBeam(const TLorentzVector &initial, const TMatrixDSym &cov, MultivariateNormalGenerator &gen)
generate 4 vector for one beam
Abstract base class for different kinds of events.