Belle II Software  release-05-02-19
GeneratedVertexDisplacerModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Sascha Dreyer, Savino Longo *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/core/RandomGenerator.h>
16 #include <framework/gearbox/Const.h>
17 #include <mdst/dataobjects/MCParticle.h>
18 #include <TVector3.h>
19 #include <TLorentzVector.h>
20 #include <TF1.h>
21 #include <string>
22 #include <map>
23 
24 
25 namespace Belle2 {
38  class GeneratedVertexDisplacerModule : public Module {
39 
40  public:
41 
46 
48  virtual void initialize() override;
49 
51  virtual void event() override;
52 
54  virtual void terminate() override;
55 
56 
57 
58  protected:
59  // called for a particle, displaces its vertex and of its subsequent daughters
60  void displace(MCParticle& particle, float
61  lifetime);
62  void displaceDaughter(TLorentzVector& motherDisplacementVector,
63  std::vector<MCParticle*>
64  daughters);
65  void getDisplacement(const MCParticle& particle, float lifetime,
66  TLorentzVector& displacement);
67  std::string m_particleList;
70  private:
71  // Parameters
72  std::string m_lifetimeOption;
73  std::vector<float> m_lifetime;
74  std::vector<int> m_pdgVals;
76  bool m_ctau;
77  };
78 
80 }
Belle2::GeneratedVertexDisplacerModule::displaceDaughter
void displaceDaughter(TLorentzVector &motherDisplacementVector, std::vector< MCParticle * > daughters)
Helper function to loop over subsequent daughters and displaces their vertices corresponding to their...
Definition: GeneratedVertexDisplacerModule.cc:123
Belle2::GeneratedVertexDisplacerModule::displace
void displace(MCParticle &particle, float lifetime)
Helper function to displace the mother particles (corresponding to given pdf values).
Definition: GeneratedVertexDisplacerModule.cc:100
Belle2::GeneratedVertexDisplacerModule::event
virtual void event() override
Method is called for each event.
Definition: GeneratedVertexDisplacerModule.cc:70
Belle2::GeneratedVertexDisplacerModule::m_mcparticles
StoreArray< MCParticle > m_mcparticles
store array for the MCParticles
Definition: GeneratedVertexDisplacerModule.h:76
Belle2::GeneratedVertexDisplacerModule::m_pdgVals
std::vector< int > m_pdgVals
Set the particles whose vertices should be displaced
Definition: GeneratedVertexDisplacerModule.h:82
Belle2::GeneratedVertexDisplacerModule::m_lifetimeOption
std::string m_lifetimeOption
Set the lifetime option, either fixed, flat exponential.
Definition: GeneratedVertexDisplacerModule.h:80
Belle2::GeneratedVertexDisplacerModule::m_maxDecayTime
float m_maxDecayTime
Set the maximal decayTime for the options 'flat' and 'exponential'.
Definition: GeneratedVertexDisplacerModule.h:83
Belle2::GeneratedVertexDisplacerModule::m_particleList
std::string m_particleList
The name of the MCParticle collection.
Definition: GeneratedVertexDisplacerModule.h:75
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GeneratedVertexDisplacerModule::m_lifetime
std::vector< float > m_lifetime
Set the numerical value of the lifetime ctau [cm]
Definition: GeneratedVertexDisplacerModule.h:81
Belle2::GeneratedVertexDisplacerModule::getDisplacement
void getDisplacement(const MCParticle &particle, float lifetime, TLorentzVector &displacement)
Helper function to calculate the numerical value of the vertex displacement (x,y,z,...
Definition: GeneratedVertexDisplacerModule.cc:144
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::StoreArray< MCParticle >
Belle2::GeneratedVertexDisplacerModule::m_ctau
bool m_ctau
Input unit option.
Definition: GeneratedVertexDisplacerModule.h:84
Belle2::GeneratedVertexDisplacerModule::terminate
virtual void terminate() override
Terminates the module.
Definition: GeneratedVertexDisplacerModule.cc:170
Belle2::GeneratedVertexDisplacerModule::GeneratedVertexDisplacerModule
GeneratedVertexDisplacerModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: GeneratedVertexDisplacerModule.cc:28
Belle2::GeneratedVertexDisplacerModule::initialize
virtual void initialize() override
Register input and output data, initialises the module.
Definition: GeneratedVertexDisplacerModule.cc:53