Belle II Software  release-05-02-19
TOPChannelT0CalibratorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - 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 <string>
25 #include <vector>
26 
27 #include <TFile.h>
28 #include <TTree.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 
32 namespace Belle2 {
43  class TOPChannelT0CalibratorModule : 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 
91  enum {c_numModules = 16,
92  c_numChannels = 512
93  };
94 
95  // module parameters
96  int m_numBins;
97  double m_timeRange;
98  double m_minBkgPerBar;
99  double m_scaleN0;
100  double m_sigmaSmear;
101  std::string m_sample;
102  double m_minMomentum;
103  double m_deltaEcms;
104  double m_dr;
105  double m_dz;
106  double m_minZ;
107  double m_maxZ;
108  std::string m_outFileName;
109  std::string m_pdfOption;
111  // procedure
114  TOP::TOPreco::PDFoption m_PDFOption = TOP::TOPreco::c_Rough;
116  // datastore objects
122  // output root file
123  TFile* m_file = 0;
125  // histograms
126  std::vector<TH1F> m_hits1D;
127  std::vector<TH2F> m_hits2D;
129  // tree and its variables
130  TTree* m_tree = 0;
131  int m_moduleID = 0;
132  int m_numPhotons = 0;
133  float m_x = 0;
134  float m_y = 0;
135  float m_z = 0;
136  float m_p = 0;
137  float m_theta = 0;
138  float m_phi = 0;
139  float m_pocaR = 0;
140  float m_pocaZ = 0;
141  float m_pocaX = 0;
142  float m_pocaY = 0;
143  float m_cmsE = 0;
144  int m_charge = 0;
145  int m_PDG = 0;
147  };
148 
150 } // Belle2 namespace
151 
Belle2::TOPChannelT0CalibratorModule::m_minMomentum
double m_minMomentum
minimal track momentum if sample is "cosmics"
Definition: TOPChannelT0CalibratorModule.h:110
Belle2::TOPChannelT0CalibratorModule::c_numModules
@ c_numModules
number of modules
Definition: TOPChannelT0CalibratorModule.h:99
Belle2::TOPChannelT0CalibratorModule::m_x
float m_x
track: extrapolated hit coordinate in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:141
Belle2::TOPChannelT0CalibratorModule::m_pocaY
float m_pocaY
y of POCA
Definition: TOPChannelT0CalibratorModule.h:150
Belle2::TOPChannelT0CalibratorModule::m_selector
TOP::TrackSelector m_selector
track selection utility
Definition: TOPChannelT0CalibratorModule.h:120
Belle2::TOPChannelT0CalibratorModule::m_pocaR
float m_pocaR
r of POCA
Definition: TOPChannelT0CalibratorModule.h:147
Belle2::TOPChannelT0CalibratorModule::m_p
float m_p
track: extrapolated hit momentum in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:144
Belle2::TOPChannelT0CalibratorModule::m_tree
TTree * m_tree
TTree containing selected track parameters etc.
Definition: TOPChannelT0CalibratorModule.h:138
Belle2::TOPChannelT0CalibratorModule::m_recBunch
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
Definition: TOPChannelT0CalibratorModule.h:128
Belle2::TOPChannelT0CalibratorModule::m_deltaEcms
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
Definition: TOPChannelT0CalibratorModule.h:111
Belle2::TOPChannelT0CalibratorModule::event
virtual void event() override
Event processor.
Definition: TOPChannelT0CalibratorModule.cc:203
Belle2::TOPChannelT0CalibratorModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPChannelT0CalibratorModule.cc:307
Belle2::TOPChannelT0CalibratorModule::m_digits
StoreArray< TOPDigit > m_digits
collection of digits
Definition: TOPChannelT0CalibratorModule.h:125
Belle2::TOPChannelT0CalibratorModule::m_file
TFile * m_file
TFile.
Definition: TOPChannelT0CalibratorModule.h:131
Belle2::TOPChannelT0CalibratorModule::m_PDG
int m_PDG
track MC truth (simulated data only)
Definition: TOPChannelT0CalibratorModule.h:153
Belle2::TOPChannelT0CalibratorModule::m_theta
float m_theta
track: extrapolated hit momentum in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:145
Belle2::TOP::Chi2MinimumFinder1D
Minimum finder using tabulated chi^2 values in one dimension.
Definition: Chi2MinimumFinder1D.h:37
Belle2::TOPChannelT0CalibratorModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPChannelT0CalibratorModule.cc:199
Belle2::TOPChannelT0CalibratorModule::m_hits1D
std::vector< TH1F > m_hits1D
number photon hits in a channel
Definition: TOPChannelT0CalibratorModule.h:134
Belle2::TOPChannelT0CalibratorModule::m_z
float m_z
track: extrapolated hit coordinate in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:143
Belle2::TOPChannelT0CalibratorModule::m_finders
TOP::Chi2MinimumFinder1D m_finders[2][c_numModules][c_numChannels]
finders
Definition: TOPChannelT0CalibratorModule.h:121
Belle2::TOPChannelT0CalibratorModule::m_pdfOption
std::string m_pdfOption
PDF option name.
Definition: TOPChannelT0CalibratorModule.h:117
Belle2::TOPChannelT0CalibratorModule::m_maxZ
double m_maxZ
maximal local z of extrapolated hit
Definition: TOPChannelT0CalibratorModule.h:115
Belle2::TOPChannelT0CalibratorModule::m_minZ
double m_minZ
minimal local z of extrapolated hit
Definition: TOPChannelT0CalibratorModule.h:114
Belle2::TOPChannelT0CalibratorModule::~TOPChannelT0CalibratorModule
virtual ~TOPChannelT0CalibratorModule()
Destructor.
Definition: TOPChannelT0CalibratorModule.cc:92
Belle2::TOPChannelT0CalibratorModule::m_y
float m_y
track: extrapolated hit coordinate in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:142
Belle2::TOPChannelT0CalibratorModule::m_outFileName
std::string m_outFileName
Root output file name containing results.
Definition: TOPChannelT0CalibratorModule.h:116
Belle2::TOPChannelT0CalibratorModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TOPChannelT0CalibratorModule.cc:303
Belle2::TOPChannelT0CalibratorModule::m_scaleN0
double m_scaleN0
scale factor for figure-of-merit N0
Definition: TOPChannelT0CalibratorModule.h:107
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPChannelT0CalibratorModule::m_hits2D
std::vector< TH2F > m_hits2D
hit times vs.
Definition: TOPChannelT0CalibratorModule.h:135
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::TOPChannelT0CalibratorModule::m_extHits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
Definition: TOPChannelT0CalibratorModule.h:127
Belle2::TOP::TrackSelector
Utility for the track selection - used in various calibration modules.
Definition: TrackSelector.h:37
Belle2::TOPChannelT0CalibratorModule::m_phi
float m_phi
track: extrapolated hit momentum in local (module) frame
Definition: TOPChannelT0CalibratorModule.h:146
Belle2::TOPChannelT0CalibratorModule::m_tracks
StoreArray< Track > m_tracks
collection of tracks
Definition: TOPChannelT0CalibratorModule.h:126
Belle2::TOPChannelT0CalibratorModule::m_dr
double m_dr
cut on POCA in r
Definition: TOPChannelT0CalibratorModule.h:112
Belle2::TOPChannelT0CalibratorModule::m_minBkgPerBar
double m_minBkgPerBar
minimal assumed background photons per module
Definition: TOPChannelT0CalibratorModule.h:106
Belle2::TOPChannelT0CalibratorModule::m_cmsE
float m_cmsE
c.m.s.
Definition: TOPChannelT0CalibratorModule.h:151
Belle2::TOPChannelT0CalibratorModule::m_numPhotons
int m_numPhotons
number of photons in this slot
Definition: TOPChannelT0CalibratorModule.h:140
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::TOPChannelT0CalibratorModule::m_moduleID
int m_moduleID
slot to which the track is extrapolated to
Definition: TOPChannelT0CalibratorModule.h:139
Belle2::TOPChannelT0CalibratorModule::m_sample
std::string m_sample
sample type
Definition: TOPChannelT0CalibratorModule.h:109
Belle2::TOPChannelT0CalibratorModule::m_timeRange
double m_timeRange
time range in which to search for the minimum [ns]
Definition: TOPChannelT0CalibratorModule.h:105
Belle2::TOPChannelT0CalibratorModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPChannelT0CalibratorModule.cc:96
Belle2::TOPChannelT0CalibratorModule::m_pocaZ
float m_pocaZ
z of POCA
Definition: TOPChannelT0CalibratorModule.h:148
Belle2::TOPChannelT0CalibratorModule::m_pocaX
float m_pocaX
x of POCA
Definition: TOPChannelT0CalibratorModule.h:149
Belle2::TOPChannelT0CalibratorModule::m_sigmaSmear
double m_sigmaSmear
additional smearing of PDF in [ns]
Definition: TOPChannelT0CalibratorModule.h:108
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOPChannelT0CalibratorModule::TOPChannelT0CalibratorModule
TOPChannelT0CalibratorModule()
Constructor.
Definition: TOPChannelT0CalibratorModule.cc:50
Belle2::TOPChannelT0CalibratorModule::c_numChannels
@ c_numChannels
number of channels per module
Definition: TOPChannelT0CalibratorModule.h:100
Belle2::TOPChannelT0CalibratorModule::m_PDFOption
TOP::TOPreco::PDFoption m_PDFOption
PDF option.
Definition: TOPChannelT0CalibratorModule.h:122
Belle2::TOPChannelT0CalibratorModule::m_dz
double m_dz
cut on POCA in z
Definition: TOPChannelT0CalibratorModule.h:113
Belle2::TOPChannelT0CalibratorModule::m_numBins
int m_numBins
number of bins to which search region is divided
Definition: TOPChannelT0CalibratorModule.h:104
Belle2::TOPChannelT0CalibratorModule::m_charge
int m_charge
track charge
Definition: TOPChannelT0CalibratorModule.h:152