Belle II Software  release-05-02-19
TOPAlignerModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
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 <top/reconstruction/TOPalign.h>
15 
16 #include <framework/datastore/StoreArray.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <tracking/dataobjects/ExtHit.h>
19 #include <top/dataobjects/TOPDigit.h>
20 #include <top/dataobjects/TOPRecBunch.h>
21 #include <framework/gearbox/Const.h>
22 
23 #include <string>
24 
25 #include "TFile.h"
26 #include "TTree.h"
27 
28 namespace Belle2 {
37  class TOPAlignerModule : public Module {
38 
39  public:
40 
45 
49  virtual ~TOPAlignerModule();
50 
55  virtual void initialize() override;
56 
61  virtual void beginRun() override;
62 
66  virtual void event() override;
67 
72  virtual void endRun() override;
73 
78  virtual void terminate() override;
79 
80  private:
81 
86  bool selectTrack(const TOP::TOPtrack& trk);
87 
88  // module paramenets
89  double m_minBkgPerBar;
90  double m_scaleN0;
91  int m_targetMid;
92  int m_maxFails;
93  std::string m_sample;
94  double m_minMomentum;
95  double m_deltaEcms;
96  double m_dr;
97  double m_dz;
98  double m_minZ;
99  double m_maxZ;
100  std::string m_outFileName;
101  double m_stepPosition;
102  double m_stepAngle;
103  double m_stepTime;
104  double m_stepRefind;
105  std::vector<int> m_gridSize;
106  std::vector<double> m_parInit;
107  std::vector<std::string> m_parFixed;
109  // alignment procedure
112  int m_countFails = 0;
114  // output
115  TFile* m_file = 0;
116  TTree* m_alignTree = 0;
117  // tree variables
118  int m_iter = 0;
119  int m_ntrk = 0;
120  int m_errorCode = 0;
121  std::vector<float> m_vAlignPars;
122  std::vector<float> m_vAlignParsErr;
123  bool m_valid = false;
124  float m_x = 0;
125  float m_y = 0;
126  float m_z = 0;
127  float m_p = 0;
128  float m_theta = 0;
129  float m_phi = 0;
130  float m_pocaR = 0;
131  float m_pocaZ = 0;
132  float m_pocaX = 0;
133  float m_pocaY = 0;
134  float m_cmsE = 0;
135  int m_charge = 0;
136  int m_PDG = 0;
138  // datastore objects
144  };
145 
147 } // Belle2 namespace
148 
Belle2::TOPAlignerModule::m_y
float m_y
track: extrapolated hit coordinate in local (module) frame
Definition: TOPAlignerModule.h:133
Belle2::TOPAlignerModule::m_parFixed
std::vector< std::string > m_parFixed
names of parameters to be fixed
Definition: TOPAlignerModule.h:115
Belle2::TOPAlignerModule::m_phi
float m_phi
track: extrapolated hit momentum in local (module) frame
Definition: TOPAlignerModule.h:137
Belle2::TOPAlignerModule::m_iter
int m_iter
iteration counter
Definition: TOPAlignerModule.h:126
Belle2::TOPAlignerModule::m_z
float m_z
track: extrapolated hit coordinate in local (module) frame
Definition: TOPAlignerModule.h:134
Belle2::TOPAlignerModule::m_ntrk
int m_ntrk
number of tracks used
Definition: TOPAlignerModule.h:127
Belle2::TOPAlignerModule::m_minZ
double m_minZ
minimal local z of extrapolated hit
Definition: TOPAlignerModule.h:106
Belle2::TOPAlignerModule::m_x
float m_x
track: extrapolated hit coordinate in local (module) frame
Definition: TOPAlignerModule.h:132
Belle2::TOPAlignerModule::m_vAlignParsErr
std::vector< float > m_vAlignParsErr
error on alignment parameters
Definition: TOPAlignerModule.h:130
Belle2::TOPAlignerModule::m_stepTime
double m_stepTime
step size for t0
Definition: TOPAlignerModule.h:111
Belle2::TOPAlignerModule::m_minBkgPerBar
double m_minBkgPerBar
minimal assumed background photons per module
Definition: TOPAlignerModule.h:97
Belle2::TOP::TOPtrack
Class to hold reconstructed track, interface to fortran.
Definition: TOPtrack.h:42
Belle2::TOPAlignerModule::m_vAlignPars
std::vector< float > m_vAlignPars
alignment parameters
Definition: TOPAlignerModule.h:129
Belle2::TOPAlignerModule::m_maxZ
double m_maxZ
maximal local z of extrapolated hit
Definition: TOPAlignerModule.h:107
Belle2::TOPAlignerModule::m_minMomentum
double m_minMomentum
minimal track momentum if sample is "cosmics"
Definition: TOPAlignerModule.h:102
Belle2::TOPAlignerModule::m_pocaY
float m_pocaY
y of POCA
Definition: TOPAlignerModule.h:141
Belle2::TOPAlignerModule::event
virtual void event() override
Event processor.
Definition: TOPAlignerModule.cc:193
Belle2::TOPAlignerModule::m_maxFails
int m_maxFails
maximum allowed number of failed iterations
Definition: TOPAlignerModule.h:100
Belle2::TOPAlignerModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPAlignerModule.cc:280
Belle2::TOPAlignerModule::m_pocaZ
float m_pocaZ
z of POCA
Definition: TOPAlignerModule.h:139
Belle2::TOPAlignerModule::m_stepRefind
double m_stepRefind
step size for scaling of refractive index (dn/n)
Definition: TOPAlignerModule.h:112
Belle2::TOPAlignerModule::m_deltaEcms
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
Definition: TOPAlignerModule.h:103
Belle2::TOPAlignerModule::m_parInit
std::vector< double > m_parInit
initial parameter values
Definition: TOPAlignerModule.h:114
Belle2::TOPAlignerModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPAlignerModule.cc:189
Belle2::TOPAlignerModule::m_dr
double m_dr
cut on POCA in r
Definition: TOPAlignerModule.h:104
Belle2::TOPAlignerModule::m_PDG
int m_PDG
track MC truth (simulated data only)
Definition: TOPAlignerModule.h:144
Belle2::TOPAlignerModule::m_pocaR
float m_pocaR
r of POCA
Definition: TOPAlignerModule.h:138
Belle2::TOPAlignerModule::TOPAlignerModule
TOPAlignerModule()
Constructor.
Definition: TOPAlignerModule.cc:54
Belle2::TOPAlignerModule::m_countFails
int m_countFails
counter for failed iterations
Definition: TOPAlignerModule.h:120
Belle2::TOPAlignerModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TOPAlignerModule.cc:276
Belle2::TOPAlignerModule::m_valid
bool m_valid
true if alignment parameters are valid
Definition: TOPAlignerModule.h:131
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPAlignerModule::m_cmsE
float m_cmsE
c.m.s.
Definition: TOPAlignerModule.h:142
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::TOP::TOPalign
Alignment of a TOP module: core of the method is coded in fortran.
Definition: TOPalign.h:38
Belle2::TOPAlignerModule::m_align
TOP::TOPalign m_align
alignment object
Definition: TOPAlignerModule.h:118
Belle2::TOPAlignerModule::m_dz
double m_dz
cut on POCA in z
Definition: TOPAlignerModule.h:105
Belle2::TOPAlignerModule::m_recBunch
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
Definition: TOPAlignerModule.h:150
Belle2::TOPAlignerModule::m_theta
float m_theta
track: extrapolated hit momentum in local (module) frame
Definition: TOPAlignerModule.h:136
Belle2::TOPAlignerModule::m_pocaX
float m_pocaX
x of POCA
Definition: TOPAlignerModule.h:140
Belle2::TOPAlignerModule::m_stepPosition
double m_stepPosition
step size for translations
Definition: TOPAlignerModule.h:109
Belle2::TOPAlignerModule::m_stepAngle
double m_stepAngle
step size for rotations
Definition: TOPAlignerModule.h:110
Belle2::TOPAlignerModule::m_targetMid
int m_targetMid
target module to align.
Definition: TOPAlignerModule.h:99
Belle2::TOPAlignerModule::m_digits
StoreArray< TOPDigit > m_digits
collection of digits
Definition: TOPAlignerModule.h:147
Belle2::TOPAlignerModule::m_errorCode
int m_errorCode
error code of the alignment procedure
Definition: TOPAlignerModule.h:128
Belle2::TOPAlignerModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPAlignerModule.cc:111
Belle2::TOPAlignerModule::m_outFileName
std::string m_outFileName
Root output file name containing results.
Definition: TOPAlignerModule.h:108
Belle2::TOPAlignerModule::m_gridSize
std::vector< int > m_gridSize
grid size
Definition: TOPAlignerModule.h:113
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::TOPAlignerModule::m_charge
int m_charge
track charge
Definition: TOPAlignerModule.h:143
Belle2::TOPAlignerModule::~TOPAlignerModule
virtual ~TOPAlignerModule()
Destructor.
Definition: TOPAlignerModule.cc:107
Belle2::Const::muon
static const ChargedStable muon
muon particle
Definition: Const.h:534
Belle2::TOPAlignerModule::m_sample
std::string m_sample
sample type
Definition: TOPAlignerModule.h:101
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOPAlignerModule::m_alignTree
TTree * m_alignTree
TTree containing alignment parameters.
Definition: TOPAlignerModule.h:124
Belle2::TOPAlignerModule::m_tracks
StoreArray< Track > m_tracks
collection of tracks
Definition: TOPAlignerModule.h:148
Belle2::TOPAlignerModule::m_extHits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
Definition: TOPAlignerModule.h:149
Belle2::TOPAlignerModule::m_scaleN0
double m_scaleN0
scale factor for figure-of-merit N0
Definition: TOPAlignerModule.h:98
Belle2::TOPAlignerModule::m_file
TFile * m_file
TFile.
Definition: TOPAlignerModule.h:123
Belle2::TOPAlignerModule::selectTrack
bool selectTrack(const TOP::TOPtrack &trk)
track selection
Definition: TOPAlignerModule.cc:348
Belle2::TOPAlignerModule::m_chargedStable
Const::ChargedStable m_chargedStable
track hypothesis
Definition: TOPAlignerModule.h:119
Belle2::TOPAlignerModule::m_p
float m_p
track: extrapolated hit momentum in local (module) frame
Definition: TOPAlignerModule.h:135