Belle II Software  release-05-02-19
TOPRecBunch.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/datastore/RelationsObject.h>
14 #include <TH1F.h>
15 #include <vector>
16 
17 namespace Belle2 {
27  class TOPRecBunch : public RelationsObject {
28  public:
29 
33  TOPRecBunch()
34  {}
35 
39  void clearReconstructed()
40  {
42  m_recTime = 0;
43  m_currentOffset = 0;
44  m_averageOffset = 0;
48  m_usedTracks = 0;
49  m_nodEdx = 0;
50  m_fineSearch = false;
51  m_histograms.clear();
52  m_recValid = false;
53  }
54 
65  void setReconstructed(int bunchNo, double time,
66  double currentOffset, double currentOffsetError,
67  double averageOffset, double averageOffsetError,
68  bool fineSearch)
69  {
70  m_recBunchNo = bunchNo;
71  m_recTime = time;
72  m_currentOffset = currentOffset;
73  m_averageOffset = averageOffset;
74  m_currentOffsetError = currentOffsetError;
75  m_averageOffsetError = averageOffsetError;
76  m_fineSearch = fineSearch;
77  m_recValid = true;
78  }
79 
86  void setNumTracks(int numTracks, int usedTracks, int nodEdx)
87  {
88  m_numTracks = numTracks;
89  m_usedTracks = usedTracks;
90  m_nodEdx = nodEdx;
91  }
92 
97  void setRevo9Counter(unsigned short revo9Counter) {m_revo9Counter = revo9Counter;}
98 
103  void addHistogram(const TH1F& histo)
104  {
105  m_histograms.push_back(histo);
106  }
107 
113  void setSimulated(int bunchNo, double time)
114  {
115  m_simBunchNo = bunchNo;
116  m_simTime = time;
117  m_simValid = true;
118  }
119 
125  int getBunchNo() const {return m_recBunchNo;}
126 
132  int getAbsoluteBunchNo(int offset) const
133  {
134  return (m_recBunchNo + m_revo9Counter * 4 - offset) % 5120;
135  }
136 
142  double getTime() const {return m_recTime;}
143 
148  double getCurrentOffset() const {return m_currentOffset;}
149 
154  double getCurrentOffsetError() const {return m_currentOffsetError;}
155 
160  double getAverageOffset() const {return m_averageOffset;}
161 
166  double getAverageOffsetError() const {return m_averageOffsetError;}
167 
172  int getNumTracks() const {return m_numTracks;}
173 
178  int getUsedTracks() const {return m_usedTracks;}
179 
184  int getNodEdxTracks() const {return m_nodEdx;}
185 
190  const std::vector<TH1F>& getHistograms() const {return m_histograms;}
191 
196  bool isReconstructed() const {return m_recValid;}
197 
202  bool isFineSearch() const {return m_fineSearch;}
203 
208  int getMCBunchNo() const {return m_simBunchNo;}
209 
214  double getMCTime() const {return m_simTime;}
215 
220  bool isSimulated() const {return m_simValid;}
221 
226  unsigned short getRevo9Counter() const {return m_revo9Counter;}
227 
228  private:
229 
230  int m_recBunchNo = 0;
231  float m_recTime = 0;
232  float m_currentOffset = 0;
233  float m_averageOffset = 0;
235  float m_averageOffsetError = 0;
236  int m_numTracks = 0;
237  int m_usedTracks = 0;
238  int m_nodEdx = 0;
239  bool m_fineSearch = false;
240  std::vector<TH1F> m_histograms;
241  bool m_recValid = false;
243  int m_simBunchNo = 0;
244  float m_simTime = 0;
245  bool m_simValid = false;
247  unsigned short m_revo9Counter = 0;
251  };
252 
253 
255 } // end namespace Belle2
256 
Belle2::TOPRecBunch::m_recBunchNo
int m_recBunchNo
reconstructed relative bunch number
Definition: TOPRecBunch.h:238
Belle2::TOPRecBunch
Class to store results of TOPBunchFinder.
Definition: TOPRecBunch.h:35
Belle2::TOPRecBunch::setNumTracks
void setNumTracks(int numTracks, int usedTracks, int nodEdx)
Set number of tracks.
Definition: TOPRecBunch.h:94
Belle2::TOPRecBunch::m_simValid
bool m_simValid
status of sim
Definition: TOPRecBunch.h:253
Belle2::TOPRecBunch::getMCTime
double getMCTime() const
Returns simulated bunch time (= time used as event start time)
Definition: TOPRecBunch.h:222
Belle2::TOPRecBunch::getMCBunchNo
int getMCBunchNo() const
Returns simulated bunch number (= bunch used for the event start time)
Definition: TOPRecBunch.h:216
Belle2::TOPRecBunch::getTime
double getTime() const
Returns reconstructed bunch time relative to L1 trigger signal at TOP (time to be subtracted to corre...
Definition: TOPRecBunch.h:150
Belle2::TOPRecBunch::isSimulated
bool isSimulated() const
Check if simulated return values are valid.
Definition: TOPRecBunch.h:228
Belle2::TOPRecBunch::m_recValid
bool m_recValid
status of rec
Definition: TOPRecBunch.h:249
Belle2::TOPRecBunch::getCurrentOffsetError
double getCurrentOffsetError() const
Returns uncertainly of current offset.
Definition: TOPRecBunch.h:162
Belle2::TOPRecBunch::addHistogram
void addHistogram(const TH1F &histo)
Add histogram.
Definition: TOPRecBunch.h:111
Belle2::TOPRecBunch::getUsedTracks
int getUsedTracks() const
Returns number of tracks used for bunch reconstruction.
Definition: TOPRecBunch.h:186
Belle2::TOPRecBunch::getNumTracks
int getNumTracks() const
Returns number of tracks in acceptance of TOP.
Definition: TOPRecBunch.h:180
Belle2::TOPRecBunch::getCurrentOffset
double getCurrentOffset() const
Returns current offset to reconstructed bunch.
Definition: TOPRecBunch.h:156
Belle2::TOPRecBunch::isFineSearch
bool isFineSearch() const
Check if fine search is done.
Definition: TOPRecBunch.h:210
Belle2::TOPRecBunch::getRevo9Counter
unsigned short getRevo9Counter() const
Returns 127 MHz clock ticks since last revo9 marker.
Definition: TOPRecBunch.h:234
Belle2::TOPRecBunch::m_currentOffsetError
float m_currentOffsetError
uncertainty of current offset
Definition: TOPRecBunch.h:242
Belle2::TOPRecBunch::getHistograms
const std::vector< TH1F > & getHistograms() const
Returns histograms.
Definition: TOPRecBunch.h:198
Belle2::TOPRecBunch::m_currentOffset
float m_currentOffset
current offset
Definition: TOPRecBunch.h:240
Belle2::TOPRecBunch::m_numTracks
int m_numTracks
number of tracks in acceptance of TOP
Definition: TOPRecBunch.h:244
Belle2::TOPRecBunch::setRevo9Counter
void setRevo9Counter(unsigned short revo9Counter)
Sets number of global clock tics since last revo9 flag.
Definition: TOPRecBunch.h:105
Belle2::TOPRecBunch::m_averageOffsetError
float m_averageOffsetError
uncertainty of running average of offset
Definition: TOPRecBunch.h:243
Belle2::TOPRecBunch::clearReconstructed
void clearReconstructed()
Clear reconstruction data members.
Definition: TOPRecBunch.h:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPRecBunch::m_revo9Counter
unsigned short m_revo9Counter
number of clock ticks since last revo9 flag
Definition: TOPRecBunch.h:255
Belle2::TOPRecBunch::setSimulated
void setSimulated(int bunchNo, double time)
Set simulated relative bunch number and time.
Definition: TOPRecBunch.h:121
Belle2::TOPRecBunch::setReconstructed
void setReconstructed(int bunchNo, double time, double currentOffset, double currentOffsetError, double averageOffset, double averageOffsetError, bool fineSearch)
Set reconstructed relative bunch number and time.
Definition: TOPRecBunch.h:73
Belle2::TOPRecBunch::isReconstructed
bool isReconstructed() const
Check if reconstructed return values are valid.
Definition: TOPRecBunch.h:204
Belle2::TOPRecBunch::getBunchNo
int getBunchNo() const
Returns reconstructed bunch number relative to L1 trigger signal at TOP note: depends on the "look ba...
Definition: TOPRecBunch.h:133
Belle2::TOPRecBunch::getAverageOffset
double getAverageOffset() const
Returns average offset to reconstructed bunch.
Definition: TOPRecBunch.h:168
Belle2::TOPRecBunch::getNodEdxTracks
int getNodEdxTracks() const
Returns number of used tracks without dEdx information.
Definition: TOPRecBunch.h:192
Belle2::TOPRecBunch::m_recTime
float m_recTime
reconstructed relative bunch time
Definition: TOPRecBunch.h:239
Belle2::TOPRecBunch::m_averageOffset
float m_averageOffset
running average of offset
Definition: TOPRecBunch.h:241
Belle2::TOPRecBunch::m_nodEdx
int m_nodEdx
number of used tracks with no dEdx information
Definition: TOPRecBunch.h:246
Belle2::TOPRecBunch::TOPRecBunch
TOPRecBunch()
Default constructor.
Definition: TOPRecBunch.h:41
Belle2::TOPRecBunch::m_histograms
std::vector< TH1F > m_histograms
histograms, like chi2 vs t0
Definition: TOPRecBunch.h:248
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::TOPRecBunch::ClassDef
ClassDef(TOPRecBunch, 3)
ClassDef.
Belle2::TOPRecBunch::getAverageOffsetError
double getAverageOffsetError() const
Returns uncertainly of average offset.
Definition: TOPRecBunch.h:174
Belle2::TOPRecBunch::m_fineSearch
bool m_fineSearch
if true, fine search was done
Definition: TOPRecBunch.h:247
Belle2::TOPRecBunch::getAbsoluteBunchNo
int getAbsoluteBunchNo(int offset) const
Returns reconstructed absolute bunch number within the ring.
Definition: TOPRecBunch.h:140
Belle2::TOPRecBunch::m_simTime
float m_simTime
simulated relative bunch time
Definition: TOPRecBunch.h:252
Belle2::TOPRecBunch::m_usedTracks
int m_usedTracks
number of tracks used for bunch reconstruction
Definition: TOPRecBunch.h:245
Belle2::TOPRecBunch::m_simBunchNo
int m_simBunchNo
simulated relative bunch number
Definition: TOPRecBunch.h:251