Belle II Software  release-08-01-10
KLMHit2d.cc
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 /* Own header. */
10 #include <klm/dataobjects/KLMHit2d.h>
11 
12 /* Basf2 headers. */
13 #include <framework/logging/Logger.h>
14 
15 using namespace Belle2;
16 
18  m_ChiSq(-1)
19 {
20 }
21 
23  m_ChiSq(-1)
24 {
26  B2FATAL("Trying to construct a KLMHit2d using KLMDigit from BKLM.");
28  setSection(digit1->getSection());
29  setLayer(digit1->getLayer());
30  setSector(digit1->getSector());
31  // multi-strip hit will have a range of struck scintillators => worse position resolution in ext/muid
32  // see docs.belle2.org/record/255 Figure 2 for strip orientations of planes 1 and 2 in each sector
33  if (getSector() <= 2) { // sectors 1 and 2
34  // digit1 (digit2) from EKLM plane 1 (2) measures global y (x) coordinate
35  setYStripMin(digit1->getStrip());
36  setYStripMax(std::max(digit1->getStrip(), digit1->getLastStrip()));
37  setXStripMin(digit2->getStrip());
38  setXStripMax(std::max(digit2->getStrip(), digit2->getLastStrip()));
39  } else { // sectors 3 and 4
40  // digit1 (digit2) from EKLM plane 1 (2) measures global x (y) coordinate
41  setXStripMin(digit1->getStrip());
42  setXStripMax(std::max(digit1->getStrip(), digit1->getLastStrip()));
43  setYStripMin(digit2->getStrip());
44  setYStripMax(std::max(digit2->getStrip(), digit2->getLastStrip()));
45  }
46 }
47 
48 // Constructor with orthogonal 1D hits
49 KLMHit2d::KLMHit2d(const BKLMHit1d* hitPhi, const BKLMHit1d* hitZ, const CLHEP::Hep3Vector& globalPos, double time) :
51 {
53  hitZ->getModuleID()))
54  B2WARNING("Attempt to form a 2D hit from distinct-module 1D hits");
56  m_Section = hitPhi->getSection();
57  m_Sector = hitPhi->getSector();
58  m_Layer = hitPhi->getLayer();
63  m_GlobalX = globalPos.x();
64  m_GlobalY = globalPos.y();
65  m_GlobalZ = globalPos.z();
66  m_Time = time;
68  addRelationTo(hitPhi);
69  addRelationTo(hitZ);
70 }
static bool hitsFromSameModule(int module1, int module2)
Check whether the hits are from the same module.
Store one reconstructed BKLM 1D hit as a ROOT object.
Definition: BKLMHit1d.h:30
int getStripMin() const
Get lowest strip number of this 1D hit.
Definition: BKLMHit1d.h:97
int getLayer() const
Get layer number.
Definition: BKLMHit1d.h:75
int getSection() const
Get section number.
Definition: BKLMHit1d.h:61
int getSector() const
Get sector number.
Definition: BKLMHit1d.h:68
int getModuleID() const
Get detector-module identifier.
Definition: BKLMHit1d.h:119
float getEnergyDeposit() const
Get energy deposition.
Definition: BKLMHit1d.h:140
int getStripMax() const
Get highest strip number of this 1D hit.
Definition: BKLMHit1d.h:104
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
int getSubdetector() const
Get subdetector number.
Definition: KLMDigit.h:72
int getLayer() const
Get layer number.
Definition: KLMDigit.h:126
int getSection() const
Get section number.
Definition: KLMDigit.h:90
int getStrip() const
Get strip number.
Definition: KLMDigit.h:162
int getSector() const
Get sector number.
Definition: KLMDigit.h:108
int getLastStrip() const
Get last strip number (for multi-strip digits).
Definition: KLMDigit.h:180
int m_LastStrip[KLMElementNumbers::getMaximalPlaneNumber()]
Number of last strip in each plane.
Definition: KLMHit2d.h:466
int m_Strip[KLMElementNumbers::getMaximalPlaneNumber()]
Number of strip in each plane.
Definition: KLMHit2d.h:463
float m_GlobalY
Global position Y coordinate.
Definition: KLMHit2d.h:472
void setSection(int section)
Set section number.
Definition: KLMHit2d.h:105
float m_Time
Time of the hit.
Definition: KLMHit2d.h:478
int m_Section
Number of section.
Definition: KLMHit2d.h:454
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:484
int getSector() const
Get sector number.
Definition: KLMHit2d.h:114
KLMHit2d()
Constructor.
Definition: KLMHit2d.cc:17
float m_GlobalZ
Global position Z coordinate.
Definition: KLMHit2d.h:475
void setYStripMin(int strip)
Set first strip number for EKLM hit in the y-measuring plane.
Definition: KLMHit2d.h:168
int m_Sector
Number of sector.
Definition: KLMHit2d.h:457
void setSector(int sector)
Set sector number.
Definition: KLMHit2d.h:123
int m_Layer
Number of layer.
Definition: KLMHit2d.h:460
int m_Subdetector
Number of subdetector.
Definition: KLMHit2d.h:451
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:469
void setYStripMax(int strip)
Set last strip number for EKLM hit in y-measuring plane.
Definition: KLMHit2d.h:177
void setLayer(int layer)
Set layer number.
Definition: KLMHit2d.h:141
Defines interface for accessing relations of objects in StoreArray.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Abstract base class for different kinds of events.