Belle II Software development
TOPAlignerModule.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 <top/reconstruction_cpp/ModuleAlignment.h>
13#include <top/utilities/TrackSelector.h>
14#include <framework/datastore/StoreArray.h>
15#include <framework/datastore/StoreObjPtr.h>
16#include <mdst/dataobjects/Track.h>
17#include <tracking/dataobjects/ExtHit.h>
18#include <top/dataobjects/TOPDigit.h>
19#include <top/dataobjects/TOPRecBunch.h>
20#include <framework/gearbox/Const.h>
21
22#include <string>
23#include <vector>
24
25#include <TFile.h>
26#include <TTree.h>
27
28namespace Belle2 {
33
37 class TOPAlignerModule : public Module {
38
39 public:
40
45
50 {}
51
56 virtual void initialize() override;
57
61 virtual void event() override;
62
67 virtual void terminate() override;
68
69 private:
70
71 // module paramenets
74 std::string m_sample;
76 double m_deltaEcms;
77 double m_dr;
78 double m_dz;
79 double m_minZ;
80 double m_maxZ;
81 std::string m_outFileName;
83 double m_stepAngle;
84 double m_stepTime;
85 std::vector<double> m_parInit;
86 std::vector<std::string> m_parFixed;
87
88 // alignment procedure
92 int m_countFails = 0;
93
94 // output
95 TFile* m_file = 0;
96 TTree* m_alignTree = 0;
97 // tree variables
98 int m_iter = 0;
99 int m_ntrk = 0;
100 int m_errorCode = 0;
101 std::vector<float> m_vAlignPars;
102 std::vector<float> m_vAlignParsErr;
103 bool m_valid = false;
104 int m_numPhot = 0;
105 float m_x = 0;
106 float m_y = 0;
107 float m_z = 0;
108 float m_p = 0;
109 float m_theta = 0;
110 float m_phi = 0;
111 float m_pocaR = 0;
112 float m_pocaZ = 0;
113 float m_pocaX = 0;
114 float m_pocaY = 0;
115 float m_cmsE = 0;
116 int m_charge = 0;
117 int m_PDG = 0;
118
119 // datastore objects
124
125 };
126
128} // Belle2 namespace
129
Provides a type-safe way to pass members of the chargedStableSet set.
Definition Const.h:589
static const ChargedStable muon
muon particle
Definition Const.h:660
Module()
Constructor.
Definition Module.cc:30
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:96
std::vector< float > m_vAlignParsErr
error on alignment parameters
Const::ChargedStable m_chargedStable
track hypothesis
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
virtual ~TOPAlignerModule()
Destructor.
int m_PDG
track MC truth (simulated data only)
float m_phi
track: extrapolated hit momentum in local (module) frame
double m_minMomentum
minimal track momentum if sample is "cosmics"
std::vector< float > m_vAlignPars
alignment parameters
double m_dz
cut on POCA in z
std::vector< std::string > m_parFixed
names of parameters to be fixed
double m_stepTime
step size for t0
int m_targetMid
target module to align.
TOP::ModuleAlignment m_align
alignment object
double m_maxZ
maximal local z of extrapolated hit
int m_countFails
counter for failed iterations
int m_iter
iteration counter
double m_stepPosition
step size for translations
double m_minZ
minimal local z of extrapolated hit
float m_p
track: extrapolated hit momentum in local (module) frame
bool m_valid
true if alignment parameters are valid
double m_dr
cut on POCA in r
StoreArray< Track > m_tracks
collection of tracks
int m_errorCode
error code of the alignment procedure
double m_stepAngle
step size for rotations
std::vector< double > m_parInit
initial parameter values
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
int m_maxFails
maximum allowed number of failed iterations
int m_numPhot
number of photons used for log likelihood in this iteration
float m_y
track: extrapolated hit coordinate in local (module) frame
StoreArray< TOPDigit > m_digits
collection of digits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
TTree * m_alignTree
TTree containing alignment parameters.
std::string m_outFileName
Root output file name containing results.
float m_z
track: extrapolated hit coordinate in local (module) frame
float m_x
track: extrapolated hit coordinate in local (module) frame
std::string m_sample
sample type
int m_ntrk
number of tracks used
float m_theta
track: extrapolated hit momentum in local (module) frame
Alignment of a TOP module.
Utility for the track selection - used in various calibration modules.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void terminate() override
Termination action.
Abstract base class for different kinds of events.