Belle II Software development
GeneratedVertexDisplacerModule.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
11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/core/RandomGenerator.h>
14#include <framework/gearbox/Const.h>
15#include <mdst/dataobjects/MCParticle.h>
16#include <Math/Vector4D.h>
17#include <TF1.h>
18#include <string>
19#include <map>
20
21
22namespace Belle2 {
33
34 public:
35
40
42 virtual void initialize() override;
43
45 virtual void event() override;
46
48 virtual void terminate() override;
49
50
51
52 protected:
53 // called for a particle, displaces its vertex and its subsequent daughters
55 void displace(MCParticle& particle, float lifetime);
57 void displaceDaughter(ROOT::Math::PxPyPzEVector& motherDisplacementVector, std::vector<MCParticle*> daughters);
59 void getDisplacement(const MCParticle& particle, float lifetime, ROOT::Math::PxPyPzEVector& displacement);
60 std::string m_particleList;
63 private:
64 // Parameters
65 std::string m_lifetimeOption;
66 std::vector<float> m_lifetime;
67 std::vector<int> m_pdgVals;
69 bool m_ctau;
70 };
71
73}
"Takes a list of PDG values and lifetime paramters to displaces the vertex of MCParticles with matchi...
void getDisplacement(const MCParticle &particle, float lifetime, ROOT::Math::PxPyPzEVector &displacement)
Helper function to calculate the numerical value of the vertex displacement (x,y,z,...
virtual void initialize() override
Register input and output data, initialises the module.
virtual void event() override
Method is called for each event.
StoreArray< MCParticle > m_mcparticles
store array for the MCParticles
float m_maxDecayTime
Set the maximal decayTime for the options 'flat' and 'exponential'.
void displaceDaughter(ROOT::Math::PxPyPzEVector &motherDisplacementVector, std::vector< MCParticle * > daughters)
Helper function to loop over subsequent daughters and displaces their vertices corresponding to their...
virtual void terminate() override
Terminates the module.
GeneratedVertexDisplacerModule()
Constructor: Sets the description, the properties and the parameters of the module.
void displace(MCParticle &particle, float lifetime)
Helper function to displace the mother particles (corresponding to given pdf values).
std::string m_lifetimeOption
Set the lifetime option, either fixed, flat exponential.
std::vector< int > m_pdgVals
Set the particles whose vertices should be displaced
std::string m_particleList
The name of the MCParticle collection.
std::vector< float > m_lifetime
Set the numerical value of the lifetime ctau [cm]
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.