Belle II Software  release-05-01-25
ECLBhabhaTCollectorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: *
7  * Ewan Hill *
8  * Mikhail Remnev *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #ifndef ECLBHABHATCOLLECTORMODULE_H
14 #define ECLBHABHATCOLLECTORMODULE_H
15 
16 #include <framework/core/Module.h>
17 #include <ecl/utility/ECLChannelMapper.h>
18 #include <ecl/utility/ECLTimingUtilities.h>
19 
20 #include <calibration/CalibrationCollectorModule.h>
21 #include <framework/database/DBObjPtr.h>
22 #include <framework/datastore/StoreArray.h>
23 #include <framework/dataobjects/EventT0.h>
24 
25 class TTree;
26 
27 namespace Belle2 {
32  class ECLDigit;
33  class ECLCalDigit;
34  class Track;
35  class ECLCrystalCalib;
36  class ECLCluster;
37  class ECLChannelMapper;
38 
39 
46 
47  public:
48 
51 
56 
58  void inDefineHisto();
59 
61  void prepare();
62 
64  void collect();
65 
66  private:
67 
69  bool m_saveTree;
70 
71  /****** Parameters END ******/
72 
73 
79 
83  std::vector<float> m_Electronics;
87  std::vector<float> m_ElectronicsTime;
91  std::vector<float> m_FlightTime;
95  std::vector<float> m_PreviousCrystalTime;
96  std::vector<float> m_PreviousCrystalTimeUnc;
100  std::vector<float> m_CrateTime;
101  std::vector<float> m_CrateTimeUnc;
107  TTree* m_dbgTree_tracks;
108  TTree* m_dbgTree_crystals;
109  TTree* m_dbgTree_event;
110  TTree* m_dbgTree_allCuts;
111  TTree* m_dbgTree_evt_allCuts;
112  TTree* m_dbgTree_crys_allCuts;
113 
114  /*** tree branches ***/
115  /*** See inDefineHisto method for branches description ***/
118  double m_tree_phi;
119  double m_tree_theta;
121  double m_tree_en;
122  double m_tree_E1Etot;
125  double m_tree_E1E2;
128  double m_tree_E1p;
132  double m_tree_timeF;
133  double m_tree_time;
137  double m_tree_t0;
138  double m_tree_t0_unc;
141  double m_tree_d0;
142  double m_tree_z0;
143  double m_tree_p;
152  double m_tree_enPlus;
153  double m_tree_enNeg;
161  double m_tree_tClust;
169  int m_charge;
170  double m_E_DIV_p;
174  /*** tree branches END ***/
175 
176 
181  std::vector<float> m_EperCrys;
182  std::vector<int> m_eclCalDigitID;
183  std::vector<int> m_eclDigitID;
188  /****** Parameters for cuts ******/
189  short m_timeAbsMax;
194  /* d0 and z0 values of the loose and tight tracks*/
195  double m_looseTrkZ0;
196  double m_tightTrkZ0;
197  double m_looseTrkD0;
198  double m_tightTrkD0;
199 
201  int m_runNum;
203  bool m_storeCalib = true;
206  // For the energy dependence correction to the time
207  // t-t0 = p1 + pow( (p3/(amplitude+p2)), p4 ) + p5*exp(-amplitude/p6) ("Energy dependence equation")
208 
209  std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil =
210  std::make_unique<Belle2::ECL::ECLTimingUtilities>();
221  };
223 }
224 
225 #endif /* ECLBHABHATCOLLECTORMODULE_H */
226 
Belle2::CalibrationCollectorModule
Calibration collector module base class.
Definition: CalibrationCollectorModule.h:44
Belle2::ECLBhabhaTCollectorModule::m_timeAbsMax
short m_timeAbsMax
Events with abs(time) > m_timeAbsMax are excluded, mostly for histogram x-range purposes.
Definition: ECLBhabhaTCollectorModule.h:189
Belle2::ECLBhabhaTCollectorModule::m_eventT0
StoreObjPtr< EventT0 > m_eventT0
StoreObjPtr for T0.
Definition: ECLBhabhaTCollectorModule.h:78
Belle2::ECLBhabhaTCollectorModule::inDefineHisto
void inDefineHisto()
Replacement for defineHisto() in CalibrationCollector modules.
Definition: ECLBhabhaTCollectorModule.cc:85
Belle2::ECLBhabhaTCollectorModule::m_tree_amp
int m_tree_amp
Fitting amplitude from ECL for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:120
Belle2::ECLBhabhaTCollectorModule
This module generates time vs crystal 2D histograms to later (in eclBhabhaTAlgorithm) find time cryst...
Definition: ECLBhabhaTCollectorModule.h:45
Belle2::ECLBhabhaTCollectorModule::collect
void collect()
Select events and crystals and accumulate histograms.
Definition: ECLBhabhaTCollectorModule.cc:324
Belle2::ECLBhabhaTCollectorModule::m_eclClusterArray
StoreArray< ECLCluster > m_eclClusterArray
Required input array of ECLClusters.
Definition: ECLBhabhaTCollectorModule.h:179
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitTime
double m_tree_ECLCalDigitTime
Time of an ECLCalDigit within a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:163
Belle2::ECLBhabhaTCollectorModule::m_tree_E1p
double m_tree_E1p
Energy of crystal with maximum energy within ECL cluster divided by total cluster energy divided by t...
Definition: ECLBhabhaTCollectorModule.h:128
Belle2::ECLBhabhaTCollectorModule::m_runNum
int m_runNum
run number
Definition: ECLBhabhaTCollectorModule.h:201
Belle2::ECLBhabhaTCollectorModule::m_tree_maxEcrystPosClust
double m_tree_maxEcrystPosClust
Time of the highest energy crystal in the cluster associated to positively charged track,...
Definition: ECLBhabhaTCollectorModule.h:156
Belle2::ECLBhabhaTCollectorModule::m_maxCrystal
int m_maxCrystal
Last CellId to handle.
Definition: ECLBhabhaTCollectorModule.h:192
Belle2::ECLBhabhaTCollectorModule::m_tree_maxEcrystNegClust
double m_tree_maxEcrystNegClust
Time of the highest energy crystal in the cluster associated to negatively charged track,...
Definition: ECLBhabhaTCollectorModule.h:158
Belle2::ECLBhabhaTCollectorModule::m_tree_z0
double m_tree_z0
Track d0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:142
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeUnc
std::vector< float > m_CrateTimeUnc
uncertainty vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:101
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p5
double m_energyDependenceTimeOffsetFitParam_p5
p5 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:217
Belle2::ECLBhabhaTCollectorModule::m_tree_E1E2
double m_tree_E1E2
Energy of crystal with maximum energy within ECL cluster divided by second most energetic crystal in ...
Definition: ECLBhabhaTCollectorModule.h:125
Belle2::ECLBhabhaTCollectorModule::m_massInvTracks
double m_massInvTracks
invariant mass of the two tracks, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:171
Belle2::ECLBhabhaTCollectorModule::m_tree_quality
int m_tree_quality
ECL fit quality for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:131
Belle2::ECLBhabhaTCollectorModule::m_tree_tClustPos
double m_tree_tClustPos
Cluster time of cluster associated to positively charged track, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:154
Belle2::ECLBhabhaTCollectorModule::prepare
void prepare()
Define histograms and read payloads from DB.
Definition: ECLBhabhaTCollectorModule.cc:215
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeDB
DBObjPtr< ECLCrystalCalib > m_PreviousCrystalTimeDB
Time offset from previous crystal time calibration (this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:94
Belle2::ECLBhabhaTCollectorModule::m_FlightTimeDB
DBObjPtr< ECLCrystalCalib > m_FlightTimeDB
Time offset from flight time b/w IP and crystal from database.
Definition: ECLBhabhaTCollectorModule.h:90
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsDB
DBObjPtr< ECLCrystalCalib > m_ElectronicsDB
electronics amplitude calibration from database Scale amplitudefor each crystal and for dead pre-amps
Definition: ECLBhabhaTCollectorModule.h:82
Belle2::ECLBhabhaTCollectorModule::m_eclDigitID
std::vector< int > m_eclDigitID
ECL digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:183
Belle2::ECLBhabhaTCollectorModule::m_tree_clustCrysE
double m_tree_clustCrysE
ratio of crystal energy to energy of the crystal that has the maximum energy, only for the crystals t...
Definition: ECLBhabhaTCollectorModule.h:148
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitID
std::vector< int > m_eclCalDigitID
ECL cal digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:182
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTimeDB
DBObjPtr< ECLCrystalCalib > m_ElectronicsTimeDB
Time offset from electronics calibration from database.
Definition: ECLBhabhaTCollectorModule.h:86
Belle2::ECLBhabhaTCollectorModule::m_storeCalib
bool m_storeCalib
Boolean for whether or not to store the previous calibration calibration constants.
Definition: ECLBhabhaTCollectorModule.h:203
Belle2::ECLBhabhaTCollectorModule::m_tree_time
double m_tree_time
Time for Ts distribution for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:133
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::ECLBhabhaTCollectorModule::m_tree_nCDChits
double m_tree_nCDChits
Track momentum for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:144
Belle2::ECLBhabhaTCollectorModule::m_tree_timetsPreviousTimeCalibs
double m_tree_timetsPreviousTimeCalibs
Time for Ts distribution after application of previous time calibrations for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:134
Belle2::ECLBhabhaTCollectorModule::m_tree_tClust
double m_tree_tClust
Cluster time of a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:161
Belle2::ECLBhabhaTCollectorModule::m_tree_theta
double m_tree_theta
theta position for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:119
Belle2::ECLBhabhaTCollectorModule::ECLBhabhaTCollectorModule
ECLBhabhaTCollectorModule()
Module constructor.
Definition: ECLBhabhaTCollectorModule.cc:46
Belle2::ECLBhabhaTCollectorModule::tracks
StoreArray< Track > tracks
StoreArray for tracks.
Definition: ECLBhabhaTCollectorModule.h:74
Belle2::ECLBhabhaTCollectorModule::m_charge
int m_charge
particle charge, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:169
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p1
double m_energyDependenceTimeOffsetFitParam_p1
p1 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:213
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p2
double m_energyDependenceTimeOffsetFitParam_p2
p2 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:214
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitE
double m_tree_ECLCalDigitE
Energy of an ECLCalDigit within a cluster, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:164
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p6
double m_energyDependenceTimeOffsetFitParam_p6
p6 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:218
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::ECLBhabhaTCollectorModule::m_tree_cid
int m_tree_cid
ECL Cell ID (1..8736) for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:117
Belle2::ECLBhabhaTCollectorModule::m_E_DIV_p
double m_E_DIV_p
Energy divided by momentum, for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:170
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeDB
DBObjPtr< ECLCrystalCalib > m_CrateTimeDB
Time offset from crate time calibration (also this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:99
Belle2::ECLBhabhaTCollectorModule::m_tree_clustCrysE_DIV_maxEcrys
double m_tree_clustCrysE_DIV_maxEcrys
Number of CDC hits along the track for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:145
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p3
double m_energyDependenceTimeOffsetFitParam_p3
p3 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:215
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitArray
StoreArray< ECLCalDigit > m_eclCalDigitArray
Required input array of ECLCalDigits.
Definition: ECLBhabhaTCollectorModule.h:178
Belle2::ECLBhabhaTCollectorModule::m_tree_E1Etot
double m_tree_E1Etot
Energy of crystal with maximum energy within ECL cluster divided by total cluster energy,...
Definition: ECLBhabhaTCollectorModule.h:122
Belle2::ECLBhabhaTCollectorModule::m_tree_p
double m_tree_p
Track z0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:143
Belle2::ECLBhabhaTCollectorModule::m_Electronics
std::vector< float > m_Electronics
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:83
Belle2::ECLBhabhaTCollectorModule::m_minCrystal
int m_minCrystal
First CellId to handle.
Definition: ECLBhabhaTCollectorModule.h:191
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_electrons
TTree * m_dbgTree_electrons
Output tree with detailed event data.
Definition: ECLBhabhaTCollectorModule.h:106
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_ECLclosestCDC
double m_tree_t0_ECLclosestCDC
EventT0 (from ECL) closest to CDC for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:139
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeUnc
std::vector< float > m_PreviousCrystalTimeUnc
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:96
Belle2::ECLBhabhaTCollectorModule::m_tree_enPlus
double m_tree_enPlus
crystal energy, only for the crystals that meet all the selection criteria for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:152
Belle2::ECLBhabhaTCollectorModule::m_FlightTime
std::vector< float > m_FlightTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:91
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTime
std::vector< float > m_PreviousCrystalTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:95
Belle2::ECLBhabhaTCollectorModule::m_tree_tClustNeg
double m_tree_tClustNeg
Cluster time of cluster associated to negatively charged track, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:155
Belle2::ECLBhabhaTCollectorModule::m_tree_t0
double m_tree_t0
EventT0 (not from ECL) for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:137
Belle2::ECLBhabhaTCollectorModule::m_saveTree
bool m_saveTree
If true, save TTree with more detailed event info.
Definition: ECLBhabhaTCollectorModule.h:69
Belle2::ECLBhabhaTCollectorModule::m_tree_timeF
double m_tree_timeF
ECL fitting time for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:132
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLDigitAmplitude
double m_tree_ECLDigitAmplitude
Amplitude (used to calculate energy) of an ECLDigit within a cluster, for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:165
Belle2::ECLBhabhaTCollectorModule::m_CrateTime
std::vector< float > m_CrateTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:100
Belle2::ECLBhabhaTCollectorModule::m_tree_evtNum
int m_tree_evtNum
Event number for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:116
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_unc
double m_tree_t0_unc
EventT0 uncertainty for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:138
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLBhabhaTCollectorModule::m_crystalCrate
int m_crystalCrate
Crate id for the crystal.
Definition: ECLBhabhaTCollectorModule.h:200
Belle2::ECLBhabhaTCollectorModule::m_tree_enNeg
double m_tree_enNeg
Energy of cluster associated to negatively charged track, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:153
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTime
std::vector< float > m_ElectronicsTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:87
Belle2::ECLBhabhaTCollectorModule::m_ECLTimeUtil
std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil
ECL timing tools.
Definition: ECLBhabhaTCollectorModule.h:209
Belle2::ECLBhabhaTCollectorModule::m_tree_phi
double m_tree_phi
phi position for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:118
Belle2::ECLBhabhaTCollectorModule::m_energyDependenceTimeOffsetFitParam_p4
double m_energyDependenceTimeOffsetFitParam_p4
p4 in "energy dependence equation"
Definition: ECLBhabhaTCollectorModule.h:216
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_ECL_minChi2
double m_tree_t0_ECL_minChi2
EventT0 (from ECL) min chi2 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:140
Belle2::ECLBhabhaTCollectorModule::m_tree_en
double m_tree_en
Energy of crystal with maximum energy within ECL cluster, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:121
Belle2::ECLBhabhaTCollectorModule::~ECLBhabhaTCollectorModule
virtual ~ECLBhabhaTCollectorModule()
Module destructor.
Definition: ECLBhabhaTCollectorModule.cc:81
Belle2::ECLBhabhaTCollectorModule::m_eclDigitArray
StoreArray< ECLDigit > m_eclDigitArray
Required input array of ECLDigits.
Definition: ECLBhabhaTCollectorModule.h:177
Belle2::ECLBhabhaTCollectorModule::m_EperCrys
std::vector< float > m_EperCrys
ECL digit energy for each crystal.
Definition: ECLBhabhaTCollectorModule.h:181