Belle II Software  release-05-02-19
TOPCommonT0CalibratorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - 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 <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 <top/utilities/TrackSelector.h>
21 #include <top/utilities/Chi2MinimumFinder1D.h>
22 #include <top/reconstruction/TOPreco.h>
23 
24 #include <framework/database/DBObjPtr.h>
25 #include <top/dbobjects/TOPCalCommonT0.h>
26 
27 #include <string>
28 
29 #include <TFile.h>
30 #include <TTree.h>
31 #include <TH1F.h>
32 #include <TH2F.h>
33 
34 namespace Belle2 {
43  class TOPCommonT0CalibratorModule : public Module {
44 
45  public:
46 
51 
56 
61  virtual void initialize() override;
62 
67  virtual void beginRun() override;
68 
72  virtual void event() override;
73 
78  virtual void endRun() override;
79 
84  virtual void terminate() override;
85 
86  private:
87 
93 
97  enum {c_numModules = 16,
98  c_numSets = 32,
99  };
100 
101  // steering parameters
102  int m_numBins;
103  double m_timeRange;
104  double m_minBkgPerBar;
105  double m_scaleN0;
106  double m_sigmaSmear;
107  std::string m_sample;
108  double m_minMomentum;
109  double m_deltaEcms;
110  double m_dr;
111  double m_dz;
112  double m_minZ;
113  double m_maxZ;
114  std::string m_outFileName;
115  std::string m_pdfOption;
117  // procedure
120  TOP::TOPreco::PDFoption m_PDFOption = TOP::TOPreco::c_Rough;
121  double m_bunchTimeSep = 0;
123  // datastore objects
129  // database
132  // output root file
133  TFile* m_file = 0;
135  // control histograms
136  TH1F m_hits1D;
137  TH2F m_hits2D;
139  // tree and its variables
140  TTree* m_tree = 0;
141  int m_moduleID = 0;
142  int m_numPhotons = 0;
143  float m_x = 0;
144  float m_y = 0;
145  float m_z = 0;
146  float m_p = 0;
147  float m_theta = 0;
148  float m_phi = 0;
149  float m_pocaR = 0;
150  float m_pocaZ = 0;
151  float m_pocaX = 0;
152  float m_pocaY = 0;
153  float m_cmsE = 0;
154  int m_charge = 0;
155  int m_PDG = 0;
157  };
158 
160 } // Belle2 namespace
161 
Belle2::TOPCommonT0CalibratorModule::m_pocaR
float m_pocaR
r of POCA
Definition: TOPCommonT0CalibratorModule.h:157
Belle2::TOPCommonT0CalibratorModule::m_cmsE
float m_cmsE
c.m.s.
Definition: TOPCommonT0CalibratorModule.h:161
Belle2::TOPCommonT0CalibratorModule::m_finders
TOP::Chi2MinimumFinder1D m_finders[c_numSets]
finders
Definition: TOPCommonT0CalibratorModule.h:127
Belle2::TOPCommonT0CalibratorModule::c_numSets
@ c_numSets
number of statistically independent subsamples
Definition: TOPCommonT0CalibratorModule.h:106
Belle2::TOPCommonT0CalibratorModule::m_file
TFile * m_file
TFile.
Definition: TOPCommonT0CalibratorModule.h:141
Belle2::TOPCommonT0CalibratorModule::m_moduleID
int m_moduleID
slot to which the track is extrapolated to
Definition: TOPCommonT0CalibratorModule.h:149
Belle2::TOPCommonT0CalibratorModule::m_numPhotons
int m_numPhotons
number of photons in this slot
Definition: TOPCommonT0CalibratorModule.h:150
Belle2::TOPCommonT0CalibratorModule::TOPCommonT0CalibratorModule
TOPCommonT0CalibratorModule()
Constructor.
Definition: TOPCommonT0CalibratorModule.cc:49
Belle2::TOPCommonT0CalibratorModule::c_numModules
@ c_numModules
number of modules
Definition: TOPCommonT0CalibratorModule.h:105
Belle2::TOPCommonT0CalibratorModule::m_maxZ
double m_maxZ
maximal local z of extrapolated hit
Definition: TOPCommonT0CalibratorModule.h:121
Belle2::TOPCommonT0CalibratorModule::event
virtual void event() override
Event processor.
Definition: TOPCommonT0CalibratorModule.cc:187
Belle2::TOPCommonT0CalibratorModule::m_PDG
int m_PDG
track MC truth (simulated data only)
Definition: TOPCommonT0CalibratorModule.h:163
Belle2::TOPCommonT0CalibratorModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPCommonT0CalibratorModule.cc:286
Belle2::TOPCommonT0CalibratorModule::m_recBunch
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
Definition: TOPCommonT0CalibratorModule.h:135
Belle2::TOPCommonT0CalibratorModule::m_pocaY
float m_pocaY
y of POCA
Definition: TOPCommonT0CalibratorModule.h:160
Belle2::TOPCommonT0CalibratorModule::m_hits1D
TH1F m_hits1D
number of photon hits in a slot
Definition: TOPCommonT0CalibratorModule.h:144
Belle2::TOPCommonT0CalibratorModule::m_sample
std::string m_sample
sample type
Definition: TOPCommonT0CalibratorModule.h:115
Belle2::TOP::Chi2MinimumFinder1D
Minimum finder using tabulated chi^2 values in one dimension.
Definition: Chi2MinimumFinder1D.h:37
Belle2::TOPCommonT0CalibratorModule::m_deltaEcms
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
Definition: TOPCommonT0CalibratorModule.h:117
Belle2::TOPCommonT0CalibratorModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPCommonT0CalibratorModule.cc:183
Belle2::TOPCommonT0CalibratorModule::m_bunchTimeSep
double m_bunchTimeSep
time between two bunches
Definition: TOPCommonT0CalibratorModule.h:129
Belle2::TOPCommonT0CalibratorModule::m_y
float m_y
track: extrapolated hit coordinate in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:152
Belle2::TOPCommonT0CalibratorModule::m_charge
int m_charge
track charge
Definition: TOPCommonT0CalibratorModule.h:162
Belle2::TOPCommonT0CalibratorModule::m_outFileName
std::string m_outFileName
Root output file name containing results.
Definition: TOPCommonT0CalibratorModule.h:122
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::TOPCommonT0CalibratorModule::m_dz
double m_dz
cut on POCA in z
Definition: TOPCommonT0CalibratorModule.h:119
Belle2::TOPCommonT0CalibratorModule::m_tracks
StoreArray< Track > m_tracks
collection of tracks
Definition: TOPCommonT0CalibratorModule.h:133
Belle2::TOPCommonT0CalibratorModule::m_scaleN0
double m_scaleN0
scale factor for figure-of-merit N0
Definition: TOPCommonT0CalibratorModule.h:113
Belle2::TOPCommonT0CalibratorModule::m_minMomentum
double m_minMomentum
minimal track momentum if sample is "cosmics"
Definition: TOPCommonT0CalibratorModule.h:116
Belle2::TOPCommonT0CalibratorModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TOPCommonT0CalibratorModule.cc:282
Belle2::TOPCommonT0CalibratorModule::m_commonT0
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
Definition: TOPCommonT0CalibratorModule.h:138
Belle2::TOPCommonT0CalibratorModule::~TOPCommonT0CalibratorModule
virtual ~TOPCommonT0CalibratorModule()
Destructor.
Definition: TOPCommonT0CalibratorModule.cc:88
Belle2::TOPCommonT0CalibratorModule::m_minBkgPerBar
double m_minBkgPerBar
minimal assumed background photons per module
Definition: TOPCommonT0CalibratorModule.h:112
Belle2::TOPCommonT0CalibratorModule::m_selector
TOP::TrackSelector m_selector
track selection utility
Definition: TOPCommonT0CalibratorModule.h:126
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::TOPCommonT0CalibratorModule::m_pocaZ
float m_pocaZ
z of POCA
Definition: TOPCommonT0CalibratorModule.h:158
Belle2::TOPCommonT0CalibratorModule::m_minZ
double m_minZ
minimal local z of extrapolated hit
Definition: TOPCommonT0CalibratorModule.h:120
Belle2::TOP::TrackSelector
Utility for the track selection - used in various calibration modules.
Definition: TrackSelector.h:37
Belle2::TOPCommonT0CalibratorModule::m_p
float m_p
track: extrapolated hit momentum in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:154
Belle2::TOPCommonT0CalibratorModule::m_dr
double m_dr
cut on POCA in r
Definition: TOPCommonT0CalibratorModule.h:118
Belle2::TOPCommonT0CalibratorModule::m_PDFOption
TOP::TOPreco::PDFoption m_PDFOption
PDF option.
Definition: TOPCommonT0CalibratorModule.h:128
Belle2::TOPCommonT0CalibratorModule::m_tree
TTree * m_tree
TTree containing selected track parameters etc.
Definition: TOPCommonT0CalibratorModule.h:148
Belle2::TOPCommonT0CalibratorModule::m_digits
StoreArray< TOPDigit > m_digits
collection of digits
Definition: TOPCommonT0CalibratorModule.h:132
Belle2::TOPCommonT0CalibratorModule::m_timeRange
double m_timeRange
time range in which to search for the minimum [ns]
Definition: TOPCommonT0CalibratorModule.h:111
Belle2::TOPCommonT0CalibratorModule::m_z
float m_z
track: extrapolated hit coordinate in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:153
Belle2::TOPCommonT0CalibratorModule::m_theta
float m_theta
track: extrapolated hit momentum in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:155
Belle2::TOP::TOPreco::PDFoption
PDFoption
Options for PDF: rough: no dependence on y fine: y dependent PDF everywhere optimal: y dependent PDF ...
Definition: TOPreco.h:44
Belle2::TOPCommonT0CalibratorModule::m_x
float m_x
track: extrapolated hit coordinate in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:151
Belle2::TOPCommonT0CalibratorModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPCommonT0CalibratorModule.cc:92
Belle2::TOPCommonT0CalibratorModule::m_extHits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
Definition: TOPCommonT0CalibratorModule.h:134
Belle2::TOPCommonT0CalibratorModule::m_pdfOption
std::string m_pdfOption
PDF option name.
Definition: TOPCommonT0CalibratorModule.h:123
Belle2::TOPCommonT0CalibratorModule::m_hits2D
TH2F m_hits2D
hit times vs.
Definition: TOPCommonT0CalibratorModule.h:145
Belle2::TOPCommonT0CalibratorModule::m_sigmaSmear
double m_sigmaSmear
additional smearing of PDF in [ns]
Definition: TOPCommonT0CalibratorModule.h:114
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOPCommonT0CalibratorModule::m_phi
float m_phi
track: extrapolated hit momentum in local (module) frame
Definition: TOPCommonT0CalibratorModule.h:156
Belle2::TOPCommonT0CalibratorModule::m_numBins
int m_numBins
number of bins to which search region is divided
Definition: TOPCommonT0CalibratorModule.h:110
Belle2::TOPCommonT0CalibratorModule::m_pocaX
float m_pocaX
x of POCA
Definition: TOPCommonT0CalibratorModule.h:159
Belle2::TOPCommonT0CalibratorModule::isRunningOffsetSubtracted
bool isRunningOffsetSubtracted()
Checks if running offset is subtracted in TOPDigits.
Definition: TOPCommonT0CalibratorModule.cc:348