Belle II Software development
CrudeT0CalibrationAlgorithm.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 <calibration/CalibrationAlgorithm.h>
12#include <TH1D.h>
13#include <vector>
14
15namespace Belle2 {
20 namespace CDC {
25 public:
34
39 void setFitWindow(std::vector<unsigned short> window)
40 {
41 if (window.size() != 2) {
42 B2FATAL("Please specify [TDC_min, TDC_max]");
43 }
44 m_tdcMin = window.at(0);
45 m_tdcMax = window.at(1);
46 }
47
50 void setInitialValue(float t)
51 {
52 m_initT0 = t;
53 }
54
58 void setZOffset(float z)
59 {
60 m_zOffset = z;
61 }
62
67 void setCosmics(bool b)
68 {
69 m_cosmic = b;
70 }
71
76 void saveHisto();
77 protected:
79 EResult calibrate() override;
81 virtual void createHisto(StoreObjPtr<EventMetaData>& evtPtr);
83 virtual void write(StoreObjPtr<EventMetaData>& evtPtr);
84 private:
85
86 double m_t0b[300];
87 double m_t0[56][400];
88 bool m_flag[56][400] = {{false}};
89
90 TH1D* m_hTDC[56][400];
91 TH1D* m_hTDCBoard[300];
92 TH1D* m_hT0All;
93 unsigned short m_tdcMin = 4500;
94 unsigned short m_tdcMax = 5000;
95 float m_initT0 = 4887.;
96 unsigned short m_minEntries = 100;
97 float m_zOffset = 0.0;
98 bool m_cosmic = true;
99 };
100 }
101
102}
103
TH1D * m_hT0All
T0 distribution of all channel.
void setInitialValue(float t)
Set initial value for fitting.
unsigned short m_tdcMax
maximum of TDC hist for fitting
TH1D * m_hTDCBoard[300]
T0 distribution of each board.
void setFitWindow(std::vector< unsigned short > window)
Set window for fitting.
float m_initT0
Common initial T0 for fitting.
bool m_flag[56][400]
flag =1 for good, =0 for low statistic or bad fit
void saveHisto()
Save hitograms of the calibration results.
bool m_cosmic
for cosmic case, tof of upper sector will be negative
virtual void createHisto(StoreObjPtr< EventMetaData > &evtPtr)
create histo for each channel
unsigned short m_tdcMin
minimum of TDC hist for fitting
virtual void write(StoreObjPtr< EventMetaData > &evtPtr)
write output or store db
unsigned short m_minEntries
minimum entries required by histo.
EResult calibrate() override
Run algo on data.
TH1D * m_hTDC[56][400]
TDC distribution histo.
float m_zOffset
z offset for calculate prop time, it is position of trigger counter,
EResult
The result of calibration.
CalibrationAlgorithm(const std::string &collectorModuleName)
Constructor - sets the prefix for collected objects (won't be accesses until execute(....
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
Abstract base class for different kinds of events.