Belle II Software  release-05-01-25
KLMStripEfficiencyCollectorModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Vitaliy Popov, Dmytro Minchenko *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 /* Own header. */
12 #include <klm/modules/KLMStripEfficiencyCollector/KLMStripEfficiencyCollectorModule.h>
13 #include <klm/dataobjects/KLMChannelIndex.h>
14 
15 /* CLHEP headers. */
16 #include <CLHEP/Vector/ThreeVector.h>
17 
18 using namespace Belle2;
19 
20 REG_MODULE(KLMStripEfficiencyCollector)
21 
24  m_ElementNumbers(&(KLMElementNumbers::Instance())),
25  m_eklmElementNumbers(&(EKLMElementNumbers::Instance())),
26  m_GeometryBKLM(nullptr),
27  m_PlaneArrayIndex(&(KLMPlaneArrayIndex::Instance())),
28  m_MatchingFile(nullptr),
29  m_MatchingTree(nullptr),
30  m_MatchingHitData( {0, 0, 0, 0, 0, 0, 0., nullptr, nullptr}),
31  m_MatchedStrip(0)
32 {
33  setDescription("Module for KLM strip efficiency data collection.");
34  addParam("MuonListName", m_MuonListName, "Muon list name.",
35  std::string("mu+:all"));
36  addParam("AllowedDistance1D", m_AllowedDistance1D,
37  "Maximal distance in the units of strip number from ExtHit to "
38  "matching KLMDigit.", double(8));
39  addParam("MinimalMatchingDigits", m_MinimalMatchingDigits,
40  "Minimal number of matching digits.", 0);
41  addParam("MinimalMatchingDigitsOuterLayers",
42  m_MinimalMatchingDigitsOuterLayers,
43  "Minimal number of matching digits in outer layers.", 0);
44  addParam("MinimalMomentumNoOuterLayers", m_MinimalMomentumNoOuterLayers,
45  "Minimal momentum in case there are no hits in outer layers.", 0.0);
46  addParam("RemoveUnusedMuons", m_RemoveUnusedMuons,
47  "Whether to remove unused muons.", false);
48  addParam("IgnoreBackwardPropagation", m_IgnoreBackwardPropagation,
49  "Whether to ignore ExtHits with backward propagation.", false);
50  addParam("Debug", m_Debug, "Debug mode.", false);
51  addParam("DebugFileName", m_MatchingFileName, "Debug file name.", std::string("matching.root"));
52  setPropertyFlags(c_ParallelProcessingCertified);
53 }
54 
56 {
57 }
58 
60 {
61  m_Digits.isRequired();
62  m_tracks.isRequired();
63  m_extHits.isRequired();
64  m_MuonList.isRequired(m_MuonListName);
65  int nPlanes = m_PlaneArrayIndex->getNElements();
66  TH1F* matchedDigitsInPlane = new TH1F(
67  "matchedDigitsInPlane", "Number of matching KLMDigits",
68  nPlanes, -0.5, double(nPlanes) - 0.5);
69  TH1F* allExtHitsInPlane = new TH1F(
70  "allExtHitsInPlane", "Number of ExtHits",
71  nPlanes, -0.5, double(nPlanes) - 0.5);
72  registerObject<TH1F>("matchedDigitsInPlane", matchedDigitsInPlane);
73  registerObject<TH1F>("allExtHitsInPlane", allExtHitsInPlane);
75  if (m_Debug) {
76  m_MatchingFile = new TFile(m_MatchingFileName.c_str(), "recreate");
77  m_MatchingTree = new TTree("t_matching", "");
78  m_MatchingTree->Branch("subdetector", &m_MatchingHitData.subdetector,
79  "subdetector/I");
80  m_MatchingTree->Branch("section", &m_MatchingHitData.section, "section/I");
81  m_MatchingTree->Branch("sector", &m_MatchingHitData.sector, "sector/I");
82  m_MatchingTree->Branch("layer", &m_MatchingHitData.layer, "layer/I");
83  m_MatchingTree->Branch("plane", &m_MatchingHitData.plane, "plane/I");
84  m_MatchingTree->Branch("strip", &m_MatchingHitData.strip, "strip/I");
85  m_MatchingTree->Branch("matchedStrip", &m_MatchedStrip, "matchedStrip/I");
86  }
87 }
88 
90 {
91  if (m_Debug) {
92  m_MatchingFile->cd();
93  m_MatchingTree->Write();
94  delete m_MatchingTree;
95  delete m_MatchingFile;
96  }
97 }
98 
100 {
101  if (!m_ChannelStatus.isValid())
102  B2FATAL("KLM channel status data are not available.");
103  int minimalActivePlanes = -1;
105  for (KLMChannelIndex& klmSector : klmSectors) {
106  KLMChannelIndex klmNextSector(klmSector);
107  ++klmNextSector;
108  int activePlanes = 0;
109  KLMChannelIndex klmPlane(klmSector);
111  for (; klmPlane != klmNextSector; ++klmPlane) {
112  KLMChannelIndex klmNextPlane(klmPlane);
113  ++klmNextPlane;
114  bool isActive = false;
115  KLMChannelIndex klmChannel(klmPlane);
117  for (; klmChannel != klmNextPlane; ++ klmChannel) {
118  uint16_t channel = klmChannel.getKLMChannelNumber();
119  enum KLMChannelStatus::ChannelStatus status =
120  m_ChannelStatus->getChannelStatus(channel);
121  if (status == KLMChannelStatus::c_Unknown)
122  B2FATAL("Incomplete KLM channel status data.");
123  if (status == KLMChannelStatus::c_Normal) {
124  isActive = true;
125  break;
126  }
127  }
128  if (isActive)
129  ++activePlanes;
130  }
131  /*
132  * If a sector is completely off, it is not necessary to reduce
133  * the minimal number of digits, because the efficiencies cannot be
134  * measured for the entire sector anyway.
135  */
136  if (activePlanes == 0)
137  continue;
138  if (minimalActivePlanes < 0)
139  minimalActivePlanes = activePlanes;
140  else if (minimalActivePlanes < activePlanes)
141  minimalActivePlanes = activePlanes;
142  }
143  if ((minimalActivePlanes >= 0) &&
144  (minimalActivePlanes < m_MinimalMatchingDigits)) {
145  B2WARNING("The minimal number of active planes (" << minimalActivePlanes <<
146  ") is less than the minimal number of matching digits (" <<
147  m_MinimalMatchingDigits << "). The minimal number of "
148  "matching digits is reduced to make the calibration possible.");
149  m_MinimalMatchingDigits = minimalActivePlanes;
150  }
151 }
152 
154 {
155 }
156 
158 {
159  std::vector<unsigned int> toRemove;
160  unsigned int nMuons = m_MuonList->getListSize();
161  /*
162  * The getter functions create the object for particular experiment and run.
163  * It is not guaranteed that collectDataTrack() is called if there are
164  * no tracks (e.g. for too short or bad runs). Thus, they are called here
165  * to guarantee the creation of histograms.
166  */
167  TH1F* matchedDigitsInPlane = getObjectPtr<TH1F>("matchedDigitsInPlane");
168  TH1F* allExtHitsInPlane = getObjectPtr<TH1F>("allExtHitsInPlane");
169  for (unsigned int i = 0; i < nMuons; ++i) {
170  const Particle* muon = m_MuonList->getParticle(i);
171  bool trackUsed = collectDataTrack(muon, matchedDigitsInPlane,
172  allExtHitsInPlane);
173  if (m_RemoveUnusedMuons && !trackUsed)
174  toRemove.push_back(muon->getArrayIndex());
175  }
177  m_MuonList->removeParticles(toRemove);
178 }
179 
181  std::map<uint16_t, struct HitData>& hitMap,
182  uint16_t planeGlobal, struct HitData* hitData)
183 {
184  std::map<uint16_t, struct HitData>::iterator it;
185  it = hitMap.find(planeGlobal);
186  /*
187  * There may be more than one such hit e.g. if track crosses the edge
188  * of the strips or WLS fiber groove. Select only one hit per plane.
189  */
190  if (it == hitMap.end()) {
191  hitMap.insert(std::pair<uint16_t, struct HitData>(
192  planeGlobal, *hitData));
193  }
194 }
195 
197  struct HitData* hitData)
198 {
199  for (const KLMDigit& digit : m_Digits) {
200  /*
201  * TODO: multi-strip digits are ugnored for now.
202  * It is necessary to take them into account.
203  */
204  if (digit.isMultiStrip())
205  continue;
206  if (!(digit.getSubdetector() == hitData->subdetector &&
207  digit.getSection() == hitData->section &&
208  digit.getLayer() == hitData->layer &&
209  digit.getSector() == hitData->sector &&
210  digit.getPlane() == hitData->plane))
211  continue;
212  if (fabs(digit.getStrip() - hitData->strip) < m_AllowedDistance1D) {
213  hitData->digit = &digit;
214  return;
215  }
216  }
217 }
218 
220  const Particle* muon, TH1F* matchedDigitsInPlane, TH1F* allExtHitsInPlane)
221 {
222  const int nExtrapolationLayers =
224  const Track* track = muon->getTrack();
225  RelationVector<ExtHit> extHits = track->getRelationsTo<ExtHit>();
226  std::map<uint16_t, struct HitData> selectedHits;
227  std::map<uint16_t, struct HitData>::iterator it;
228  uint16_t channel;
230  struct HitData hitData, hitDataPrevious;
231  TVector3 extHitPosition;
232  CLHEP::Hep3Vector extHitPositionCLHEP, localPosition;
233  int layer;
234  int extHitLayer[nExtrapolationLayers] = {0};
235  int digitLayer[nExtrapolationLayers] = {0};
236  hitDataPrevious.subdetector = -1;
237  for (const ExtHit& hit : extHits) {
238  /*
239  * Choose hits that exit the sensitive volume.
240  * It is not possible to use entry hits because of a bug in Geant4:
241  * the step does not always have a correct status (fGeomBoundary),
242  * and, consequently, ExtHits are not created.
243  */
244  if (hit.getStatus() != EXT_EXIT)
245  continue;
246  /*
247  * Ignore ExtHits with backward propagation. This affects cosmic events
248  * only. The removal of hits with backward propagation is normally
249  * not needed, however, it is added because of backward error propagation
250  * bug in Geant4 10.6.
251  */
253  if (hit.isBackwardPropagated())
254  continue;
255  }
256  uint16_t planeGlobal = 0;
257  hitData.hit = &hit;
258  hitData.digit = nullptr;
259  if (hit.getDetectorID() == Const::EDetector::EKLM) {
260  int stripGlobal = hit.getCopyID();
263  stripGlobal, &hitData.section, &hitData.layer, &hitData.sector,
264  &hitData.plane, &hitData.strip);
266  hitData.section, hitData.sector, hitData.layer,
267  hitData.plane, hitData.strip);
268  status = m_ChannelStatus->getChannelStatus(channel);
269  if (status == KLMChannelStatus::c_Unknown)
270  B2FATAL("Incomplete KLM channel status data.");
271  if (status == KLMChannelStatus::c_Normal) {
273  hitData.subdetector, hitData.layer);
274  extHitLayer[layer - 1]++;
275  planeGlobal = m_ElementNumbers->planeNumberEKLM(
276  hitData.section, hitData.sector, hitData.layer,
277  hitData.plane);
278  addHit(selectedHits, planeGlobal, &hitData);
279  }
280  } else if (hit.getDetectorID() == Const::EDetector::BKLM) {
281  int moduleNumber = hit.getCopyID();
284  moduleNumber, &hitData.section, &hitData.sector, &hitData.layer);
286  /*
287  * For scintillators, the plane and strip numbers are recorded
288  * in the copy number.
289  */
291  moduleNumber, &hitData.section, &hitData.sector, &hitData.layer,
292  &hitData.plane, &hitData.strip);
294  hitData.section, hitData.sector, hitData.layer,
295  hitData.plane, hitData.strip);
296  status = m_ChannelStatus->getChannelStatus(channel);
297  if (status == KLMChannelStatus::c_Unknown)
298  B2FATAL("Incomplete KLM channel status data.");
299  if (status == KLMChannelStatus::c_Normal) {
301  hitData.subdetector, hitData.layer);
302  extHitLayer[layer - 1]++;
303  planeGlobal = m_ElementNumbers->planeNumberBKLM(
304  hitData.section, hitData.sector, hitData.layer,
305  hitData.plane);
306  addHit(selectedHits, planeGlobal, &hitData);
307  }
308  } else {
309  /* For RPCs, the sensitive volume corresponds to both readout planes. */
310  extHitPosition = hit.getPosition();
311  extHitPositionCLHEP.setX(extHitPosition.X());
312  extHitPositionCLHEP.setY(extHitPosition.Y());
313  extHitPositionCLHEP.setZ(extHitPosition.Z());
314  const bklm::Module* module =
315  m_GeometryBKLM->findModule(hitData.section, hitData.sector,
316  hitData.layer);
317  localPosition = module->globalToLocal(extHitPositionCLHEP);
319  hitData.strip = module->getZStrip(localPosition);
320  /*
321  * FIXME
322  * There are 2 hits per module in RPCs, but the plane information is
323  * not available in ExtHit. For now, 2 entries are created (one for
324  * each plane) for the first hit, and the second one is removed.
325  */
326  if (hitData.subdetector == hitDataPrevious.subdetector &&
327  hitData.section == hitDataPrevious.section &&
328  hitData.sector == hitDataPrevious.sector &&
329  hitData.layer == hitDataPrevious.layer)
330  continue;
331  std::memcpy(&hitDataPrevious, &hitData, sizeof(struct HitData));
332  /* The returned strip may be out of the valid range. */
334  hitData.section, hitData.sector, hitData.layer, hitData.plane,
335  hitData.strip, false)) {
337  hitData.section, hitData.sector, hitData.layer,
338  hitData.plane, hitData.strip);
339  status = m_ChannelStatus->getChannelStatus(channel);
340  if (status == KLMChannelStatus::c_Unknown)
341  B2FATAL("Incomplete KLM channel status data.");
342  if (status == KLMChannelStatus::c_Normal) {
344  hitData.subdetector, hitData.layer);
345  extHitLayer[layer - 1]++;
346  hitData.localPosition = localPosition.z();
347  planeGlobal = m_ElementNumbers->planeNumberBKLM(
348  hitData.section, hitData.sector, hitData.layer,
349  hitData.plane);
350  addHit(selectedHits, planeGlobal, &hitData);
351  }
352  }
354  hitData.strip = module->getPhiStrip(localPosition);
355  /* The returned strip may be out of the valid range. */
357  hitData.section, hitData.sector, hitData.layer, hitData.plane,
358  hitData.strip, false)) {
360  hitData.section, hitData.sector, hitData.layer,
361  hitData.plane, hitData.strip);
362  status = m_ChannelStatus->getChannelStatus(channel);
363  if (status == KLMChannelStatus::c_Unknown)
364  B2FATAL("Incomplete KLM channel status data.");
365  if (status == KLMChannelStatus::c_Normal) {
367  hitData.subdetector, hitData.layer);
368  extHitLayer[layer - 1]++;
369  hitData.localPosition = localPosition.y();
370  planeGlobal = m_ElementNumbers->planeNumberBKLM(
371  hitData.section, hitData.sector, hitData.layer,
372  hitData.plane);
373  addHit(selectedHits, planeGlobal, &hitData);
374  }
375  }
376  }
377  } else
378  continue;
379  }
380  /* Find matching digits. */
381  int nDigits = 0;
382  std::map<int, int>::iterator it2;
383  for (it = selectedHits.begin(); it != selectedHits.end(); ++it) {
384  findMatchingDigit(&(it->second));
385  if (it->second.digit != nullptr) {
386  nDigits++;
388  it->second.subdetector, it->second.layer);
389  digitLayer[layer - 1]++;
390  }
391  }
392  if (nDigits < m_MinimalMatchingDigits)
393  return false;
394  /* Write efficiency histograms */
395  for (it = selectedHits.begin(); it != selectedHits.end(); ++it) {
396  int matchingDigits = 0;
397  int matchingDigitsOuterLayers = 0;
398  int extHitsOuterLayers = 0;
400  it->second.subdetector, it->second.layer) - 1;
401  for (int i = 0; i < nExtrapolationLayers; ++i) {
402  if (i != layer)
403  matchingDigits += digitLayer[i];
404  if (i > layer) {
405  matchingDigitsOuterLayers += digitLayer[i];
406  extHitsOuterLayers += extHitLayer[i];
407  }
408  }
409  /* Check the number of matching digits in other layers. */
410  if (matchingDigits < m_MinimalMatchingDigits)
411  continue;
412  /*
413  * Check the number of matching digits in outer layers relatively to
414  * this hit.
415  */
416  if (matchingDigitsOuterLayers < m_MinimalMatchingDigitsOuterLayers) {
422  if (extHitsOuterLayers >= m_MinimalMatchingDigitsOuterLayers)
423  continue;
424  /*
425  * If the number of ExtHits is insufficient, then check the momentum.
426  * The muons with sufficiently large momentum have a very small
427  * probability to get absorbed in the detector.
428  */
429  if (muon->getMomentum().Mag() < m_MinimalMomentumNoOuterLayers)
430  continue;
431  }
432  allExtHitsInPlane->Fill(m_PlaneArrayIndex->getIndex(it->first));
433  if (it->second.digit) {
434  matchedDigitsInPlane->Fill(m_PlaneArrayIndex->getIndex(it->first));
435  if (m_Debug) {
436  std::memcpy(&m_MatchingHitData, &(it->second), sizeof(struct HitData));
437  m_MatchedStrip = it->second.digit->getStrip();
438  m_MatchingTree->Fill();
439  }
440  }
441  }
442  return true;
443 }
Belle2::CalibrationCollectorModule
Calibration collector module base class.
Definition: CalibrationCollectorModule.h:44
Belle2::KLMStripEfficiencyCollectorModule::HitData::layer
int layer
Layer.
Definition: KLMStripEfficiencyCollectorModule.h:75
Belle2::KLMStripEfficiencyCollectorModule::m_MuonList
StoreObjPtr< ParticleList > m_MuonList
Muons.
Definition: KLMStripEfficiencyCollectorModule.h:198
Belle2::KLMStripEfficiencyCollectorModule::HitData::hit
const ExtHit * hit
Extrapolation hit.
Definition: KLMStripEfficiencyCollectorModule.h:90
Belle2::KLMStripEfficiencyCollectorModule::HitData::digit
const KLMDigit * digit
Digit.
Definition: KLMStripEfficiencyCollectorModule.h:93
Belle2::EKLMElementNumbers
EKLM element numbers.
Definition: EKLMElementNumbers.h:34
Belle2::KLMStripEfficiencyCollectorModule::m_ChannelStatus
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
Definition: KLMStripEfficiencyCollectorModule.h:186
Belle2::EKLMElementNumbers::stripNumberToElementNumbers
void stripNumberToElementNumbers(int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
Get element numbers by strip global number.
Definition: EKLMElementNumbers.cc:220
Belle2::KLMStripEfficiencyCollectorModule::collect
void collect() override
This method is called for each event.
Definition: KLMStripEfficiencyCollectorModule.cc:157
Belle2::KLMStripEfficiencyCollectorModule::m_MatchingFile
TFile * m_MatchingFile
Matching data file.
Definition: KLMStripEfficiencyCollectorModule.h:219
Belle2::BKLMElementNumbers::checkChannelNumber
static bool checkChannelNumber(int section, int sector, int layer, int plane, int strip, bool fatalError=true)
Check channel number.
Definition: BKLMElementNumbers.cc:184
Belle2::KLMStripEfficiencyCollectorModule::HitData
Hit data.
Definition: KLMStripEfficiencyCollectorModule.h:66
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::KLMChannelStatus::ChannelStatus
ChannelStatus
Channel status.
Definition: KLMChannelStatus.h:44
Belle2::KLMStripEfficiencyCollectorModule::HitData::subdetector
int subdetector
Subdetector.
Definition: KLMStripEfficiencyCollectorModule.h:69
Belle2::KLMStripEfficiencyCollectorModule::finish
void finish() override
Finish data processing.
Definition: KLMStripEfficiencyCollectorModule.cc:89
Belle2::KLMElementNumbers::planeNumberBKLM
uint16_t planeNumberBKLM(int section, int sector, int layer, int plane) const
Get plane number for BKLM.
Definition: KLMElementNumbers.cc:128
Belle2::KLMStripEfficiencyCollectorModule::m_MatchingFileName
std::string m_MatchingFileName
Matching data file name.
Definition: KLMStripEfficiencyCollectorModule.h:216
Belle2::BKLMElementNumbers::c_ZPlane
@ c_ZPlane
Z.
Definition: BKLMElementNumbers.h:81
Belle2::KLMStripEfficiencyCollectorModule::m_MinimalMatchingDigits
int m_MinimalMatchingDigits
Minimal number of matching digits.
Definition: KLMStripEfficiencyCollectorModule.h:171
Belle2::KLMStripEfficiencyCollectorModule::m_MatchingTree
TTree * m_MatchingTree
Matching data tree.
Definition: KLMStripEfficiencyCollectorModule.h:222
Belle2::KLMElementNumbers::c_EKLM
@ c_EKLM
EKLM.
Definition: KLMElementNumbers.h:50
Belle2::KLMPlaneArrayIndex
KLM plane array index.
Definition: KLMPlaneArrayIndex.h:33
Belle2::KLMStripEfficiencyCollectorModule::~KLMStripEfficiencyCollectorModule
virtual ~KLMStripEfficiencyCollectorModule()
Destructor.
Definition: KLMStripEfficiencyCollectorModule.cc:55
Belle2::KLMStripEfficiencyCollectorModule::m_MatchedStrip
int m_MatchedStrip
Matched strip.
Definition: KLMStripEfficiencyCollectorModule.h:228
Belle2::KLMElementNumbers::channelNumberBKLM
uint16_t channelNumberBKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for BKLM.
Definition: KLMElementNumbers.cc:50
Belle2::KLMStripEfficiencyCollectorModule::m_MinimalMomentumNoOuterLayers
double m_MinimalMomentumNoOuterLayers
Minimal momentum in case there are no hits in outer layers.
Definition: KLMStripEfficiencyCollectorModule.h:177
Belle2::KLMStripEfficiencyCollectorModule::m_GeometryBKLM
const bklm::GeometryPar * m_GeometryBKLM
BKLM geometry.
Definition: KLMStripEfficiencyCollectorModule.h:207
Belle2::KLMChannelIndex::getKLMChannelNumber
uint16_t getKLMChannelNumber() const
Get KLM channel number.
Definition: KLMChannelIndex.cc:145
Belle2::bklm::Module
Define the geometry of a BKLM module Each sector [octant] contains Modules.
Definition: Module.h:86
Belle2::KLMDigit
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:40
Belle2::KLMStripEfficiencyCollectorModule::m_MatchingHitData
struct HitData m_MatchingHitData
Matching hit data.
Definition: KLMStripEfficiencyCollectorModule.h:225
Belle2::KLMStripEfficiencyCollectorModule::HitData::localPosition
double localPosition
Local coordinate.
Definition: KLMStripEfficiencyCollectorModule.h:87
Belle2::KLMChannelIndex::c_IndexLevelSector
@ c_IndexLevelSector
Sector.
Definition: KLMChannelIndex.h:49
Belle2::KLMStripEfficiencyCollectorModule::HitData::section
int section
Section.
Definition: KLMStripEfficiencyCollectorModule.h:72
Belle2::KLMStripEfficiencyCollectorModule::m_IgnoreBackwardPropagation
bool m_IgnoreBackwardPropagation
Whether to ignore ExtHits with backward propagation.
Definition: KLMStripEfficiencyCollectorModule.h:183
Belle2::KLMStripEfficiencyCollectorModule::m_Digits
StoreArray< KLMDigit > m_Digits
KLM digits.
Definition: KLMStripEfficiencyCollectorModule.h:189
Belle2::KLMStripEfficiencyCollectorModule::m_RemoveUnusedMuons
bool m_RemoveUnusedMuons
Whether to remove unused muons.
Definition: KLMStripEfficiencyCollectorModule.h:180
Belle2::KLMStripEfficiencyCollectorModule::HitData::sector
int sector
Sector.
Definition: KLMStripEfficiencyCollectorModule.h:78
Belle2::KLMChannelIndex::c_IndexLevelPlane
@ c_IndexLevelPlane
Plane.
Definition: KLMChannelIndex.h:55
Belle2::KLMStripEfficiencyCollectorModule::m_PlaneArrayIndex
const KLMPlaneArrayIndex * m_PlaneArrayIndex
Plane array index.
Definition: KLMStripEfficiencyCollectorModule.h:210
Belle2::ExtHit
Store one Ext hit as a ROOT object.
Definition: ExtHit.h:40
Belle2::KLMStripEfficiencyCollectorModule::m_AllowedDistance1D
double m_AllowedDistance1D
Maximal distance in the units of strip number from ExtHit to matching KLMDigit.
Definition: KLMStripEfficiencyCollectorModule.h:168
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2::bklm::GeometryPar::instance
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
Definition: GeometryPar.cc:30
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMStripEfficiencyCollectorModule::closeRun
void closeRun() override
This method is called at the end of run.
Definition: KLMStripEfficiencyCollectorModule.cc:153
Belle2::BKLMElementNumbers::channelNumberToElementNumbers
static void channelNumberToElementNumbers(uint16_t channel, int *section, int *sector, int *layer, int *plane, int *strip)
Get element numbers by channel number.
Definition: BKLMElementNumbers.cc:38
Belle2::KLMElementNumbers::c_BKLM
@ c_BKLM
BKLM.
Definition: KLMElementNumbers.h:47
Belle2::KLMStripEfficiencyCollectorModule::addHit
void addHit(std::map< uint16_t, struct HitData > &hitMap, uint16_t planeGlobal, struct HitData *hitData)
Add hit to map.
Definition: KLMStripEfficiencyCollectorModule.cc:180
Belle2::KLMStripEfficiencyCollectorModule::m_MinimalMatchingDigitsOuterLayers
int m_MinimalMatchingDigitsOuterLayers
Minimal number of matching digits in outer layers.
Definition: KLMStripEfficiencyCollectorModule.h:174
Belle2::KLMStripEfficiencyCollectorModule::m_MuonListName
std::string m_MuonListName
Muon list name.
Definition: KLMStripEfficiencyCollectorModule.h:162
Belle2::KLMStripEfficiencyCollectorModule::startRun
void startRun() override
This method is called at the beginning of the run.
Definition: KLMStripEfficiencyCollectorModule.cc:99
Belle2::KLMStripEfficiencyCollectorModule::prepare
void prepare() override
Initializer.
Definition: KLMStripEfficiencyCollectorModule.cc:59
Belle2::KLMElementArrayIndex::getNElements
uint16_t getNElements() const
Get number of elements.
Definition: KLMElementArrayIndex.h:65
Belle2::KLMStripEfficiencyCollectorModule::m_ElementNumbers
const KLMElementNumbers * m_ElementNumbers
Element numbers.
Definition: KLMStripEfficiencyCollectorModule.h:201
Belle2::KLMStripEfficiencyCollectorModule::m_eklmElementNumbers
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
Definition: KLMStripEfficiencyCollectorModule.h:204
Belle2::KLMElementNumbers::getMaximalExtrapolationLayer
static constexpr int getMaximalExtrapolationLayer()
Get maximal extrapolation layer.
Definition: KLMElementNumbers.h:242
Belle2::KLMElementNumbers::planeNumberEKLM
uint16_t planeNumberEKLM(int section, int sector, int layer, int plane) const
Get channel number for EKLM.
Definition: KLMElementNumbers.cc:136
Belle2::KLMStripEfficiencyCollectorModule::HitData::strip
int strip
Strip.
Definition: KLMStripEfficiencyCollectorModule.h:84
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::KLMElementNumbers::channelNumberEKLM
uint16_t channelNumberEKLM(int section, int sector, int layer, int plane, int strip) const
Get channel number for EKLM.
Definition: KLMElementNumbers.cc:64
Belle2::KLMStripEfficiencyCollectorModule::findMatchingDigit
void findMatchingDigit(struct HitData *hitData)
Find matching digit.
Definition: KLMStripEfficiencyCollectorModule.cc:196
Belle2::KLMChannelStatus::c_Unknown
@ c_Unknown
Unknown status (no data).
Definition: KLMChannelStatus.h:47
Belle2::KLMChannelIndex
KLM channel index.
Definition: KLMChannelIndex.h:33
Belle2::KLMStripEfficiencyCollectorModule
Module KLMStripEfficiencyCollectorModule.
Definition: KLMStripEfficiencyCollectorModule.h:59
Belle2::Track
Class that bundles various TrackFitResults.
Definition: Track.h:35
Belle2::KLMElementNumbers
KLM element numbers.
Definition: KLMElementNumbers.h:37
Belle2::KLMStripEfficiencyCollectorModule::collectDataTrack
bool collectDataTrack(const Particle *muon, TH1F *matchedDigitsInPlane, TH1F *allExtHitsInPlane)
Collect the data for one muon.
Definition: KLMStripEfficiencyCollectorModule.cc:219
Belle2::BKLMElementNumbers::c_FirstRPCLayer
@ c_FirstRPCLayer
First RPC layer.
Definition: BKLMElementNumbers.h:71
Belle2::KLMStripEfficiencyCollectorModule::m_Debug
bool m_Debug
Debug mode.
Definition: KLMStripEfficiencyCollectorModule.h:213
Belle2::KLMChannelStatus::c_Normal
@ c_Normal
Normally operating channel.
Definition: KLMChannelStatus.h:50
Belle2::KLMStripEfficiencyCollectorModule::HitData::plane
int plane
Plane.
Definition: KLMStripEfficiencyCollectorModule.h:81
Belle2::bklm::GeometryPar::findModule
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
Definition: GeometryPar.cc:716
Belle2::BKLMElementNumbers::moduleNumberToElementNumbers
static void moduleNumberToElementNumbers(uint16_t module, int *section, int *sector, int *layer)
Get element numbers by module number.
Definition: BKLMElementNumbers.cc:81
Belle2::KLMStripEfficiencyCollectorModule::m_extHits
StoreArray< ExtHit > m_extHits
ExtHits.
Definition: KLMStripEfficiencyCollectorModule.h:195
Belle2::KLMChannelIndex::setIndexLevel
void setIndexLevel(enum IndexLevel indexLevel)
Set index level.
Definition: KLMChannelIndex.cc:67
Belle2::BKLMElementNumbers::c_PhiPlane
@ c_PhiPlane
Phi.
Definition: BKLMElementNumbers.h:84
Belle2::KLMStripEfficiencyCollectorModule::m_tracks
StoreArray< Track > m_tracks
Tracks.
Definition: KLMStripEfficiencyCollectorModule.h:192
Belle2::KLMElementNumbers::getExtrapolationLayer
int getExtrapolationLayer(int subdetector, int layer) const
Get extrapolation layer number (BKLM - from 1 to 15, EKLM - from 16 to 29).
Definition: KLMElementNumbers.cc:236
Belle2::KLMElementArrayIndex::getIndex
uint16_t getIndex(uint16_t number) const
Get element index.
Definition: KLMElementArrayIndex.cc:54
Belle2::KLMChannelIndex::c_IndexLevelStrip
@ c_IndexLevelStrip
Strip.
Definition: KLMChannelIndex.h:58