Belle II Software development
KLMHit2d.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/* KLM headers. */
12#include <klm/dataobjects/bklm/BKLMHit1d.h>
13#include <klm/dataobjects/KLMElementNumbers.h>
14
15/* Basf2 headers. */
16#include <framework/datastore/RelationsObject.h>
17
18/* ROOT headers. */
19#include <Math/Vector3D.h>
20
21/* CLHEP headers. */
22#include <CLHEP/Vector/ThreeVector.h>
23
24namespace Belle2 {
33 class KLMHit2d : public RelationsObject {
34
35 public:
36
40 KLMHit2d();
41
47 explicit KLMHit2d(KLMDigit* digit1, KLMDigit* digit2);
48
64 KLMHit2d(const BKLMHit1d* hitPhi, const BKLMHit1d* hitZ,
65 const CLHEP::Hep3Vector& globalPos, double time);
66
71 {
72 }
73
78 int getSubdetector() const
79 {
80 return m_Subdetector;
81 }
82
87 void setSubdetector(int subdetector)
88 {
89 m_Subdetector = subdetector;
90 }
91
96 int getSection() const
97 {
98 return m_Section;
99 }
100
105 void setSection(int section)
106 {
107 m_Section = section;
108 }
109
114 int getSector() const
115 {
116 return m_Sector;
117 }
118
123 void setSector(int sector)
124 {
125 m_Sector = sector;
126 }
127
132 int getLayer() const
133 {
134 return m_Layer;
135 }
136
141 void setLayer(int layer)
142 {
143 m_Layer = layer;
144 }
145
150 void setXStripMin(int strip)
151 {
152 m_Strip[0] = strip;
153 }
154
159 void setXStripMax(int strip)
160 {
161 m_LastStrip[0] = strip;
162 }
163
168 void setYStripMin(int strip)
169 {
170 m_Strip[1] = strip;
171 }
172
177 void setYStripMax(int strip)
178 {
179 m_LastStrip[1] = strip;
180 }
181
185 bool inRPC() const
186 {
189 }
190
194 int getZStripMin() const
195 {
197 }
198
202 int getZStripMax() const
203 {
205 }
206
210 double getZStripAve() const
211 {
212 return 0.5 * (getZStripMin() + getZStripMax());
213 }
214
218 int getPhiStripMin() const
219 {
221 }
222
226 int getPhiStripMax() const
227 {
229 }
230
234 double getPhiStripAve() const
235 {
236 return 0.5 * (getPhiStripMin() + getPhiStripMax());
237 }
238
242 int getXStripMin() const
243 {
244 return m_Strip[0];
245 }
246
250 int getXStripMax() const
251 {
252 return m_LastStrip[0];
253 }
254
258 int getYStripMin() const
259 {
260 return m_Strip[1];
261 }
262
266 int getYStripMax() const
267 {
268 return m_LastStrip[1];
269 }
270
277 void setPosition(float x, float y, float z)
278 {
279 m_GlobalX = x;
280 m_GlobalY = y;
281 m_GlobalZ = z;
282 }
283
288 float getPositionX() const
289 {
290 return m_GlobalX;
291 }
292
297 float getPositionY() const
298 {
299 return m_GlobalY;
300 }
301
306 float getPositionZ() const
307 {
308 return m_GlobalZ;
309 }
310
315 ROOT::Math::XYZVector getPosition() const
316 {
317 return ROOT::Math::XYZVector(m_GlobalX, m_GlobalY, m_GlobalZ);
318 }
319
324 float getTime() const
325 {
326 return m_Time;
327 }
328
333 void setTime(float time)
334 {
335 m_Time = time;
336 }
337
342 void setMCTime(float t)
343 {
344 m_MCTime = t;
345 }
346
351 float getMCTime() const
352 {
353 return m_MCTime;
354 }
355
360 float getEnergyDeposit() const
361 {
362 return m_EnergyDeposit;
363 }
364
369 void setEnergyDeposit(float energyDeposit)
370 {
371 m_EnergyDeposit = energyDeposit;
372 }
373
378 float getChiSq() const
379 {
380 return m_ChiSq;
381 }
382
387 void setChiSq(float chisq)
388 {
389 m_ChiSq = chisq;
390 }
391
395 bool isOutOfTime() const
396 {
397 return m_IsOutOfTime;
398 }
399
403 void isOutOfTime(bool outOfTime)
404 {
405 m_IsOutOfTime = outOfTime;
406 }
407
412 bool isOnTrack() const
413 {
414 return m_IsOnTrack;
415 }
416
420 void isOnTrack(bool onTrack)
421 {
422 m_IsOnTrack = onTrack;
423 }
424
429 bool isOnStaTrack() const
430 {
431 return m_IsOnStaTrack;
432 }
433
437 void isOnStaTrack(bool onStaTrack)
438 {
439 m_IsOnStaTrack = onStaTrack;
440 }
441
442 private:
443
446
448 int m_Section = 0;
449
451 int m_Sector = 0;
452
454 int m_Layer = 0;
455
458
461
463 float m_GlobalX = 0.0;
464
466 float m_GlobalY = 0.0;
467
469 float m_GlobalZ = 0.0;
470
472 float m_Time = 0.0;
473
475 float m_MCTime = 0.0;
476
478 float m_EnergyDeposit = 0.0;
479
480 /* From EKLMHit2d. */
481
483 float m_ChiSq = 0.0;
484
485 /* From BKLMHit2d. */
486
488 bool m_IsOutOfTime = false;
489
491 bool m_IsOnTrack = false;
492
494 bool m_IsOnStaTrack = false;
495
498
499 };
500
502}
@ c_FirstRPCLayer
First RPC layer.
Store one reconstructed BKLM 1D hit as a ROOT object.
Definition: BKLMHit1d.h:30
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
static constexpr int getMaximalPlaneNumber()
Get maximal plane number.
KLM 2d hit.
Definition: KLMHit2d.h:33
void setEnergyDeposit(float energyDeposit)
Set energy deposit.
Definition: KLMHit2d.h:369
bool inRPC() const
Determine whether this 2D hit is in RPC or scintillator.
Definition: KLMHit2d.h:185
float m_ChiSq
Chi^2 of the hit.
Definition: KLMHit2d.h:483
int m_LastStrip[KLMElementNumbers::getMaximalPlaneNumber()]
Number of last strip in each plane.
Definition: KLMHit2d.h:460
int getSubdetector() const
Get subdetector number.
Definition: KLMHit2d.h:78
int m_Strip[KLMElementNumbers::getMaximalPlaneNumber()]
Number of strip in each plane.
Definition: KLMHit2d.h:457
void isOutOfTime(bool outOfTime)
Set whether this 2D hit is outside the trigger-coincidence window.
Definition: KLMHit2d.h:403
int getYStripMin() const
Get first strip number for EKLM hit in the y-measuring plane.
Definition: KLMHit2d.h:258
int getLayer() const
Get layer number.
Definition: KLMHit2d.h:132
float m_GlobalY
Global position Y coordinate.
Definition: KLMHit2d.h:466
float getChiSq() const
Get Chi^2 of the crossing point.
Definition: KLMHit2d.h:378
double getZStripAve() const
Get average strip number for z plane.
Definition: KLMHit2d.h:210
double getPhiStripAve() const
Get average strip number for phi plane.
Definition: KLMHit2d.h:234
void setSection(int section)
Set section number.
Definition: KLMHit2d.h:105
float m_Time
Time of the hit.
Definition: KLMHit2d.h:472
float getTime() const
Get hit time.
Definition: KLMHit2d.h:324
void setChiSq(float chisq)
Set Chi^2 of the crossing point.
Definition: KLMHit2d.h:387
int getZStripMax() const
Get last strip number for z plane.
Definition: KLMHit2d.h:202
int m_Section
Number of section.
Definition: KLMHit2d.h:448
int getSection() const
Get section number.
Definition: KLMHit2d.h:96
float getPositionZ() const
Get hit global position z coordinate.
Definition: KLMHit2d.h:306
ClassDef(Belle2::KLMHit2d, 1)
Class version.
float m_MCTime
MC time.
Definition: KLMHit2d.h:475
void isOnStaTrack(bool onStaTrack)
Set whether this 2D hit is associated with a BKLM stand-alone track.
Definition: KLMHit2d.h:437
void setXStripMin(int strip)
Set first strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:150
float m_EnergyDeposit
Energy deposition.
Definition: KLMHit2d.h:478
bool isOnStaTrack() const
Determine whether this 2D hit is associated with a BKLM stand-alone track.
Definition: KLMHit2d.h:429
int getSector() const
Get sector number.
Definition: KLMHit2d.h:114
KLMHit2d()
Constructor.
Definition: KLMHit2d.cc:17
float getPositionX() const
Get hit global position x coordinate.
Definition: KLMHit2d.h:288
float m_GlobalZ
Global position Z coordinate.
Definition: KLMHit2d.h:469
int getPhiStripMin() const
Get strip number for phi plane.
Definition: KLMHit2d.h:218
void setTime(float time)
Set hit time.
Definition: KLMHit2d.h:333
void setYStripMin(int strip)
Set first strip number for EKLM hit in the y-measuring plane.
Definition: KLMHit2d.h:168
void setSubdetector(int subdetector)
Set subdetector number.
Definition: KLMHit2d.h:87
int m_Sector
Number of sector.
Definition: KLMHit2d.h:451
float getMCTime() const
Get MC time.
Definition: KLMHit2d.h:351
bool isOnTrack() const
Determine whether this 2D hit is associated with a muid-extrapolated track.
Definition: KLMHit2d.h:412
void setSector(int sector)
Set sector number.
Definition: KLMHit2d.h:123
int getZStripMin() const
Get strip number for z plane.
Definition: KLMHit2d.h:194
int getXStripMax() const
Get last strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:250
int m_Layer
Number of layer.
Definition: KLMHit2d.h:454
ROOT::Math::XYZVector getPosition() const
Get hit global position.
Definition: KLMHit2d.h:315
bool m_IsOutOfTime
Whether this 2D hit is outside the trigger-coincidence window.
Definition: KLMHit2d.h:488
int getPhiStripMax() const
Get last strip number for phi plane.
Definition: KLMHit2d.h:226
float getPositionY() const
Get hit global position y coordinate.
Definition: KLMHit2d.h:297
void setMCTime(float t)
Set MC time.
Definition: KLMHit2d.h:342
int m_Subdetector
Number of subdetector.
Definition: KLMHit2d.h:445
bool m_IsOnTrack
Whether this 2D hit is associated with a muid-extrapolated track.
Definition: KLMHit2d.h:491
float getEnergyDeposit() const
Get energy deposit.
Definition: KLMHit2d.h:360
void setXStripMax(int strip)
Set last strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:159
float m_GlobalX
Global position X coordinate.
Definition: KLMHit2d.h:463
bool m_IsOnStaTrack
Whether this 2D hit is associated with a BKLM stand-alone track.
Definition: KLMHit2d.h:494
int getYStripMax() const
Get last strip number for EKLM hit in the y-measuring plane.
Definition: KLMHit2d.h:266
void isOnTrack(bool onTrack)
Set whether this 2D hit is associated with a muid-extrapolated track.
Definition: KLMHit2d.h:420
bool isOutOfTime() const
Determine whether this 2D hit is outside the trigger-coincidence window.
Definition: KLMHit2d.h:395
void setYStripMax(int strip)
Set last strip number for EKLM hit in y-measuring plane.
Definition: KLMHit2d.h:177
int getXStripMin() const
Get first strip number for EKLM hit in the x-measuring plane.
Definition: KLMHit2d.h:242
void setLayer(int layer)
Set layer number.
Definition: KLMHit2d.h:141
~KLMHit2d()
Destructor.
Definition: KLMHit2d.h:70
void setPosition(float x, float y, float z)
Set hit global position.
Definition: KLMHit2d.h:277
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.