Belle II Software  release-05-02-19
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/EventMetaData.h>
24 #include <framework/dataobjects/EventT0.h>
25 
26 class TTree;
27 
28 namespace Belle2 {
33  class ECLDigit;
34  class ECLCalDigit;
35  class Track;
36  class ECLCrystalCalib;
37  class ECLReferenceCrystalPerCrateCalib;
38  class ECLCluster;
39  class ECLChannelMapper;
40 
41  const static double realNaN = std::numeric_limits<double>::quiet_NaN();
42  const static int intNaN = std::numeric_limits<int>::quiet_NaN();
50 
51  public:
52 
55 
60 
62  void inDefineHisto() override;
63 
65  void prepare() override;
66 
68  void collect() override;
69 
70  private:
71 
73  bool m_saveTree;
74 
75  /****** Parameters END ******/
76 
77 
83 
86 
90  std::vector<float> m_Electronics;
94  std::vector<float> m_ElectronicsTime;
98  std::vector<float> m_FlightTime;
102  std::vector<float> m_PreviousCrystalTime;
103  std::vector<float> m_PreviousCrystalTimeUnc;
107  std::vector<float> m_CrateTime;
108  std::vector<float> m_CrateTimeUnc;
112  std::vector<short> m_RefCrystalsCalib;
117  TTree* m_dbgTree_electrons = nullptr;
118  TTree* m_dbgTree_tracks = nullptr;
119  TTree* m_dbgTree_crystals = nullptr;
120  TTree* m_dbgTree_event = nullptr;
121  TTree* m_dbgTree_allCuts = nullptr;
122  TTree* m_dbgTree_evt_allCuts = nullptr;
123  TTree* m_dbgTree_crys_allCuts = nullptr;
125  /*** tree branches ***/
126  /*** See inDefineHisto method for branches description ***/
129  double m_tree_phi;
130  double m_tree_theta;
132  double m_tree_en;
133  double m_tree_E1Etot;
136  double m_tree_E1E2;
139  double m_tree_E1p;
143  double m_tree_timeF;
144  double m_tree_time;
148  double m_tree_t0 = realNaN;
152  double m_tree_d0 = realNaN;
153  double m_tree_z0 = realNaN;
154  double m_tree_p = realNaN;
163  double m_tree_enPlus;
164  double m_tree_enNeg;
172  double m_tree_tClust;
180  int m_charge;
181  double m_E_DIV_p;
185  /*** tree branches END ***/
186 
187 
192  std::vector<float> m_EperCrys;
193  std::vector<int> m_eclCalDigitID;
194  std::vector<int> m_eclDigitID;
199  /****** Parameters for cuts ******/
200  short m_timeAbsMax;
205  /* d0 and z0 values of the loose and tight tracks*/
212  int m_runNum;
214  bool m_storeCalib = true;
217  // For the energy dependence correction to the time
218  // t-t0 = p1 + pow( (p3/(amplitude+p2)), p4 ) + p5*exp(-amplitude/p6) ("Energy dependence equation")
219 
220  std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil =
221  std::make_unique<Belle2::ECL::ECLTimingUtilities>();
226 
227  };
229 }
230 
231 #endif /* ECLBHABHATCOLLECTORMODULE_H */
232 
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:200
Belle2::ECLBhabhaTCollectorModule::m_eventT0
StoreObjPtr< EventT0 > m_eventT0
StoreObjPtr for T0.
Definition: ECLBhabhaTCollectorModule.h:82
Belle2::ECLBhabhaTCollectorModule::m_EventMetaData
StoreObjPtr< EventMetaData > m_EventMetaData
Event metadata.
Definition: ECLBhabhaTCollectorModule.h:85
Belle2::ECLBhabhaTCollectorModule::collect
void collect() override
Select events and crystals and accumulate histograms.
Definition: ECLBhabhaTCollectorModule.cc:315
Belle2::ECLBhabhaTCollectorModule::m_looseTrkD0
double m_looseTrkD0
Loose track d0 minimum cut.
Definition: ECLBhabhaTCollectorModule.h:208
Belle2::ECLBhabhaTCollectorModule::m_tightTrkD0
double m_tightTrkD0
Tight track d0 minimum cut.
Definition: ECLBhabhaTCollectorModule.h:209
Belle2::ECLBhabhaTCollectorModule::m_tree_amp
int m_tree_amp
Fitting amplitude from ECL for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:131
Belle2::ECLBhabhaTCollectorModule
This module generates time vs crystal 2D histograms to later (in eclBhabhaTAlgorithm) find time cryst...
Definition: ECLBhabhaTCollectorModule.h:49
Belle2::ECLBhabhaTCollectorModule::m_eclClusterArray
StoreArray< ECLCluster > m_eclClusterArray
Required input array of ECLClusters.
Definition: ECLBhabhaTCollectorModule.h:190
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitTime
double m_tree_ECLCalDigitTime
Time of an ECLCalDigit within a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:174
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:139
Belle2::ECLBhabhaTCollectorModule::m_runNum
int m_runNum
run number
Definition: ECLBhabhaTCollectorModule.h:212
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_tracks
TTree * m_dbgTree_tracks
Debug TTree output per track.
Definition: ECLBhabhaTCollectorModule.h:118
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:167
Belle2::ECLBhabhaTCollectorModule::m_maxCrystal
int m_maxCrystal
Last CellId to handle.
Definition: ECLBhabhaTCollectorModule.h:203
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:169
Belle2::ECLBhabhaTCollectorModule::m_tree_z0
double m_tree_z0
Track z0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:153
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeUnc
std::vector< float > m_CrateTimeUnc
uncertainty vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:108
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_crystals
TTree * m_dbgTree_crystals
Debug TTree output per crystal.
Definition: ECLBhabhaTCollectorModule.h:119
Belle2::intNaN
const static int intNaN
constant for integer NaN
Definition: ECLBhabhaTCollectorModule.h:42
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:136
Belle2::ECLBhabhaTCollectorModule::m_massInvTracks
double m_massInvTracks
invariant mass of the two tracks, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:182
Belle2::ECLBhabhaTCollectorModule::m_tree_quality
int m_tree_quality
ECL fit quality for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:142
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:165
Belle2::ECLBhabhaTCollectorModule::m_RefCrystalsCalib
std::vector< short > m_RefCrystalsCalib
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:112
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeDB
DBObjPtr< ECLCrystalCalib > m_PreviousCrystalTimeDB
Time offset from previous crystal time calibration (this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:101
Belle2::ECLBhabhaTCollectorModule::m_FlightTimeDB
DBObjPtr< ECLCrystalCalib > m_FlightTimeDB
Time offset from flight time b/w IP and crystal from database.
Definition: ECLBhabhaTCollectorModule.h:97
Belle2::ECLBhabhaTCollectorModule::m_RefCrystalsCalibDB
DBObjPtr< ECLReferenceCrystalPerCrateCalib > m_RefCrystalsCalibDB
Crystal IDs of the one reference crystal per crate from database.
Definition: ECLBhabhaTCollectorModule.h:111
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:89
Belle2::ECLBhabhaTCollectorModule::m_eclDigitID
std::vector< int > m_eclDigitID
ECL digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:194
Belle2::ECLBhabhaTCollectorModule::m_tree_clustCrysE
double m_tree_clustCrysE
crystal energy, only for the crystals that meet all the selection criteria for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:159
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitID
std::vector< int > m_eclCalDigitID
ECL cal digit id sorter.
Definition: ECLBhabhaTCollectorModule.h:193
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTimeDB
DBObjPtr< ECLCrystalCalib > m_ElectronicsTimeDB
Time offset from electronics calibration from database.
Definition: ECLBhabhaTCollectorModule.h:93
Belle2::ECLBhabhaTCollectorModule::m_storeCalib
bool m_storeCalib
Boolean for whether or not to store the previous calibration calibration constants.
Definition: ECLBhabhaTCollectorModule.h:214
Belle2::ECLBhabhaTCollectorModule::m_tree_time
double m_tree_time
Time for Ts distribution for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:144
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::ECLBhabhaTCollectorModule::m_tree_nCDChits
double m_tree_nCDChits
Number of CDC hits along the track for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:155
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:145
Belle2::ECLBhabhaTCollectorModule::m_tree_tClust
double m_tree_tClust
Cluster time of a cluster, ns for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:172
Belle2::ECLBhabhaTCollectorModule::m_tree_theta
double m_tree_theta
theta position for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:130
Belle2::ECLBhabhaTCollectorModule::ECLBhabhaTCollectorModule
ECLBhabhaTCollectorModule()
Module constructor.
Definition: ECLBhabhaTCollectorModule.cc:47
Belle2::ECLBhabhaTCollectorModule::m_hadronEventT0_TO_bhabhaEventT0_correction
double m_hadronEventT0_TO_bhabhaEventT0_correction
correction to apply to CDC event t0 values in bhabha events to correct for CDC event t0 bias compared...
Definition: ECLBhabhaTCollectorModule.h:225
Belle2::ECLBhabhaTCollectorModule::tracks
StoreArray< Track > tracks
StoreArray for tracks.
Definition: ECLBhabhaTCollectorModule.h:78
Belle2::ECLBhabhaTCollectorModule::m_charge
int m_charge
particle charge, for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:180
Belle2::ECLBhabhaTCollectorModule::m_tree_ECLCalDigitE
double m_tree_ECLCalDigitE
Energy of an ECLCalDigit within a cluster, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:175
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:128
Belle2::ECLBhabhaTCollectorModule::m_looseTrkZ0
double m_looseTrkZ0
Loose track z0 minimum cut.
Definition: ECLBhabhaTCollectorModule.h:206
Belle2::ECLBhabhaTCollectorModule::m_E_DIV_p
double m_E_DIV_p
Energy divided by momentum, for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:181
Belle2::ECLBhabhaTCollectorModule::m_CrateTimeDB
DBObjPtr< ECLCrystalCalib > m_CrateTimeDB
Time offset from crate time calibration (also this calibration) from database.
Definition: ECLBhabhaTCollectorModule.h:106
Belle2::ECLBhabhaTCollectorModule::m_tree_clustCrysE_DIV_maxEcrys
double m_tree_clustCrysE_DIV_maxEcrys
ratio of crystal energy to energy of the crystal that has the maximum energy, only for the crystals t...
Definition: ECLBhabhaTCollectorModule.h:156
Belle2::ECLBhabhaTCollectorModule::m_eclCalDigitArray
StoreArray< ECLCalDigit > m_eclCalDigitArray
Required input array of ECLCalDigits.
Definition: ECLBhabhaTCollectorModule.h:189
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:133
Belle2::ECLBhabhaTCollectorModule::m_tree_p
double m_tree_p
Track momentum for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:154
Belle2::ECLBhabhaTCollectorModule::m_Electronics
std::vector< float > m_Electronics
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:90
Belle2::ECLBhabhaTCollectorModule::m_minCrystal
int m_minCrystal
First CellId to handle.
Definition: ECLBhabhaTCollectorModule.h:202
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_electrons
TTree * m_dbgTree_electrons
Output tree with detailed event data.
Definition: ECLBhabhaTCollectorModule.h:117
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_ECLclosestCDC
double m_tree_t0_ECLclosestCDC
EventT0 (from ECL) closest to CDC for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:150
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_crys_allCuts
TTree * m_dbgTree_crys_allCuts
Debug TTree output per crystal after all cuts.
Definition: ECLBhabhaTCollectorModule.h:123
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTimeUnc
std::vector< float > m_PreviousCrystalTimeUnc
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:103
Belle2::realNaN
static const double realNaN
shortcut for NaN of double type
Definition: TagVertexModule.cc:64
Belle2::ECLBhabhaTCollectorModule::m_tree_enPlus
double m_tree_enPlus
Energy of cluster associated to positively charged track, GeV for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:163
Belle2::ECLBhabhaTCollectorModule::prepare
void prepare() override
Define histograms and read payloads from DB.
Definition: ECLBhabhaTCollectorModule.cc:219
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_allCuts
TTree * m_dbgTree_allCuts
Debug TTree output after all cuts.
Definition: ECLBhabhaTCollectorModule.h:121
Belle2::ECLBhabhaTCollectorModule::m_FlightTime
std::vector< float > m_FlightTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:98
Belle2::ECLBhabhaTCollectorModule::m_PreviousCrystalTime
std::vector< float > m_PreviousCrystalTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:102
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:166
Belle2::ECLBhabhaTCollectorModule::m_tree_t0
double m_tree_t0
EventT0 (not from ECL) for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:148
Belle2::ECLBhabhaTCollectorModule::m_saveTree
bool m_saveTree
If true, save TTree with more detailed event info.
Definition: ECLBhabhaTCollectorModule.h:73
Belle2::ECLBhabhaTCollectorModule::m_tree_timeF
double m_tree_timeF
ECL fitting time for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:143
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:176
Belle2::ECLBhabhaTCollectorModule::m_CrateTime
std::vector< float > m_CrateTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:107
Belle2::ECLBhabhaTCollectorModule::m_tree_evtNum
int m_tree_evtNum
Event number for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:127
Belle2::ECLBhabhaTCollectorModule::m_tree_t0_unc
double m_tree_t0_unc
EventT0 uncertainty for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:149
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_event
TTree * m_dbgTree_event
Debug TTree output per event.
Definition: ECLBhabhaTCollectorModule.h:120
Belle2::ECLBhabhaTCollectorModule::m_dbgTree_evt_allCuts
TTree * m_dbgTree_evt_allCuts
Debug TTree output per event after all cuts.
Definition: ECLBhabhaTCollectorModule.h:122
Belle2::ECLBhabhaTCollectorModule::m_crystalCrate
int m_crystalCrate
Crate id for the crystal.
Definition: ECLBhabhaTCollectorModule.h:211
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:164
Belle2::ECLBhabhaTCollectorModule::m_ElectronicsTime
std::vector< float > m_ElectronicsTime
vector obtained from DB object
Definition: ECLBhabhaTCollectorModule.h:94
Belle2::ECLBhabhaTCollectorModule::m_tree_d0
double m_tree_d0
Track d0 for debug TTree output.
Definition: ECLBhabhaTCollectorModule.h:152
Belle2::ECLBhabhaTCollectorModule::m_ECLTimeUtil
std::unique_ptr< Belle2::ECL::ECLTimingUtilities > m_ECLTimeUtil
ECL timing tools.
Definition: ECLBhabhaTCollectorModule.h:220
Belle2::ECLBhabhaTCollectorModule::m_tree_phi
double m_tree_phi
phi position for debug TTree output
Definition: ECLBhabhaTCollectorModule.h:129
Belle2::ECLBhabhaTCollectorModule::inDefineHisto
void inDefineHisto() override
Replacement for defineHisto() in CalibrationCollector modules.
Definition: ECLBhabhaTCollectorModule.cc:89
Belle2::ECLBhabhaTCollectorModule::m_tightTrkZ0
double m_tightTrkZ0
Tight track z0 minimum cut.
Definition: ECLBhabhaTCollectorModule.h:207
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:151
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:132
Belle2::ECLBhabhaTCollectorModule::~ECLBhabhaTCollectorModule
virtual ~ECLBhabhaTCollectorModule()
Module destructor.
Definition: ECLBhabhaTCollectorModule.cc:85
Belle2::ECLBhabhaTCollectorModule::m_eclDigitArray
StoreArray< ECLDigit > m_eclDigitArray
Required input array of ECLDigits.
Definition: ECLBhabhaTCollectorModule.h:188
Belle2::ECLBhabhaTCollectorModule::m_EperCrys
std::vector< float > m_EperCrys
ECL cal digit energy for each crystal.
Definition: ECLBhabhaTCollectorModule.h:192