Belle II Software  light-2205-abys
TrackIsoCalculatorModule.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/StoreObjPtr.h>
13 #include <framework/dataobjects/EventMetaData.h>
14 #include <framework/logging/LogConfig.h>
15 #include <analysis/dataobjects/Particle.h>
16 #include <analysis/dataobjects/ParticleList.h>
17 #include <analysis/VariableManager/Manager.h>
18 #include <analysis/VariableManager/Utility.h>
19 #include <analysis/DecayDescriptor/DecayDescriptor.h>
20 #include <framework/datastore/StoreArray.h>
21 
22 
23 namespace Belle2 {
34 
35  public:
43  DetSurfCylBoundaries(float rho, float zfwd, float zbwd, float th_fwd, float th_fwd_brl, float th_bwd_brl, float th_bwd)
44  {
45  m_rho = rho;
46  m_zfwd = zfwd;
47  m_zbwd = zbwd;
48  m_th_fwd = th_fwd;
49  m_th_fwd_brl = th_fwd_brl;
50  m_th_bwd_brl = th_bwd_brl;
51  m_th_bwd = th_bwd;
52  };
53  float m_rho;
54  float m_zfwd;
55  float m_zbwd;
56  float m_th_fwd;
57  float m_th_fwd_brl;
58  float m_th_bwd_brl;
59  float m_th_bwd;
60  };
61 
69 
70  public:
71 
76 
80  ~TrackIsoCalculatorModule() override;
81 
88  void initialize() override;
89 
95  void event() override;
96 
100  void terminate() override;
101 
102  private:
103 
108 
112  std::string m_decayString;
113 
117  unsigned short m_nSelectedDaughters;
118 
122  std::string m_pListReferenceName;
123 
127  std::string m_detSurface;
128 
132  std::unordered_map<std::string, bool> m_isSurfaceInDet;
133 
137  std::string m_extraInfoName;
138 
143  std::unordered_map<std::string, DetSurfCylBoundaries> m_detSurfBoundaries = {
144  {"CDC0", DetSurfCylBoundaries(16.8, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
145  {"CDC1", DetSurfCylBoundaries(25.7, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
146  {"CDC2", DetSurfCylBoundaries(36.52, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
147  {"CDC3", DetSurfCylBoundaries(47.69, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
148  {"CDC4", DetSurfCylBoundaries(58.41, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
149  {"CDC5", DetSurfCylBoundaries(69.53, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
150  {"CDC6", DetSurfCylBoundaries(80.25, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
151  {"CDC7", DetSurfCylBoundaries(91.37, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
152  {"CDC8", DetSurfCylBoundaries(102.09, 150.0, -75.0, 0.0, 0.29, 2.61, 3.14)},
153  {"TOP0", DetSurfCylBoundaries(117.8, 193.0, -94.0, 0.24, 0.52, 2.23, 3.14)},
154  {"ARICH0", DetSurfCylBoundaries(117.8, 193.0, -94.0, 0.24, 0.52, 2.23, 3.14)},
155  {"ECL0", DetSurfCylBoundaries(125.0, 196.0, -102.0, 0.21, 0.56, 2.24, 2.70)},
156  {"ECL1", DetSurfCylBoundaries(140.0, 211.0, -117.0, 0.21, 0.56, 2.24, 2.70)},
157  {"KLM0", DetSurfCylBoundaries(202.0, 283.9, -189.9, 0.40, 0.82, 2.13, 2.60)},
158  };
159 
164 
169 
174 
179 
185 
190  double getDistAtDetSurface(const Particle* iParticle, const Particle* jParticle);
191 
196 
197  };
199 }
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Simple class to encapsulate a detector surface's boundaries in cylindrical coordinates.
DetSurfCylBoundaries()
Default constructor.
DetSurfCylBoundaries(float rho, float zfwd, float zbwd, float th_fwd, float th_fwd_brl, float th_bwd_brl, float th_bwd)
Constructor with parameters.
float m_zfwd
Inner surface z fwd [cm].
float m_th_fwd_brl
fwd/barrel separation theta [rad]
float m_th_fwd
Lower theta edge of fwd region [rad].
float m_th_bwd_brl
bwd/barrel separation theta [rad]
float m_zbwd
Inner surface z bwd [cm].
float m_rho
Inner surface radius [cm].
float m_th_bwd
Upper theta edge of bwd region [rad].
Base class for Modules.
Definition: Module.h:72
Class to store reconstructed particles.
Definition: Particle.h:74
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Calculate track isolation variables on the input ParticleList.
std::unordered_map< std::string, DetSurfCylBoundaries > m_detSurfBoundaries
Map that associates to each detector its valid cylindrical surface layer's boundaries.
StoreObjPtr< EventMetaData > m_event_metadata
The event information.
~TrackIsoCalculatorModule() override
Destructor, use this to clean up anything you created in the constructor.
void initialize() override
Use this to initialize resources or memory your module needs.
void event() override
Called once for each event.
std::string m_decayString
The name of the input charged stable particle list, or composite particle w/ charged stable daughters...
StoreObjPtr< ParticleList > m_pListTarget
The input ParticleList object for which distances are to be calculated.
StoreArray< Particle > m_particles
StoreArray of Particles.
void terminate() override
Module terminate().
std::string m_pListReferenceName
The name of the input ParticleList of reference tracks.
bool onlySelectedStdChargedInDecay()
Check whether input particle list and reference list are of a valid charged stable particle.
DecayDescriptor m_decaydescriptor
< Decay descriptor of decays to look for.
std::unordered_map< std::string, bool > m_isSurfaceInDet
Associate the detector flag to a boolean flag to quickly tell which detector it belongs too.
TrackIsoCalculatorModule()
Constructor: Sets the description, the properties and the parameters of the module.
std::string m_extraInfoName
The name of the distance variable to be added to each particle as extraInfo.
double getDistAtDetSurface(const Particle *iParticle, const Particle *jParticle)
Calculate the distance between the points where the two input extrapolated track helices cross the gi...
unsigned short m_nSelectedDaughters
The number of selected daughters in the decay string.
StoreObjPtr< ParticleList > m_pListReference
The input ParticleList object of reference tracks.
std::string m_detSurface
The name of the detector at whose inner (cylindrical) surface we extrapolate each track's polar and a...
bool m_useHighestProbMassForExt
If this option is set, the helix extrapolation for the target and reference particles will use the tr...
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:23