Belle II Software  release-08-01-10
KLMReconstructorModule.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/bklm/geometry/GeometryPar.h>
13 #include <klm/dataobjects/bklm/BKLMHit1d.h>
14 #include <klm/dataobjects/eklm/EKLMAlignmentHit.h>
15 #include <klm/dataobjects/KLMDigit.h>
16 #include <klm/dataobjects/KLMHit2d.h>
17 #include <klm/dbobjects/KLMTimeCableDelay.h>
18 #include <klm/dbobjects/KLMTimeConstants.h>
19 #include <klm/dbobjects/KLMTimeResolution.h>
20 #include <klm/dbobjects/KLMChannelStatus.h>
21 #include <klm/dbobjects/KLMTimeWindow.h>
22 #include <klm/eklm/geometry/GeometryData.h>
23 #include <klm/eklm/geometry/TransformData.h>
24 
25 /* Basf2 headers. */
26 #include <framework/core/Module.h>
27 #include <framework/database/DBObjPtr.h>
28 #include <framework/dataobjects/EventT0.h>
29 #include <framework/datastore/StoreArray.h>
30 #include <framework/datastore/StoreObjPtr.h>
31 #include <mdst/dataobjects/EventLevelClusteringInfo.h>
32 
33 namespace Belle2 {
43  class KLMReconstructorModule : public Module {
44 
45  public:
46 
51 
56 
60  void initialize() override;
61 
65  void beginRun() override;
66 
70  void event() override;
71 
75  void endRun() override;
76 
80  void terminate() override;
81 
82  private:
83 
84  /* Functions. */
85 
89  void reconstructBKLMHits();
90 
94  void reconstructEKLMHits();
95 
101  bool isNormal(const KLMDigit* digit) const;
102 
108  void correctCableDelay(double& td, const KLMDigit* digit);
109 
110  /* Common member variables. */
111 
117 
119  double m_PromptTime;
120 
126 
129 
132 
134  double m_DelayRPCPhi = 0.0;
135 
137  double m_DelayRPCZ = 0.0;
138 
141 
144 
150 
153 
156 
159 
162 
165 
168 
171 
174 
177 
180 
183 
184  /* BKLM member variables. */
185 
188 
191 
194 
197 
198  /* EKLM member variables. */
199 
205 
208 
211 
214 
217 
220 
221  };
222 
224 }
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
EKLM element numbers.
EKLM geometry data.
Definition: GeometryData.h:38
Transformation data.
Definition: TransformData.h:35
KLM digit (class representing a digitized hit in RPCs or scintillators).
Definition: KLMDigit.h:29
KLM element numbers.
Create BKLMHit1ds from BKLMDigits and then create KLMHit2ds from BKLMHit1ds; create KLMHit2ds from EK...
OptionalDBObjPtr< KLMTimeResolution > m_TimeResolution
KLM time resolution.
void reconstructEKLMHits()
Reconstruct EKLNM 2d hits.
bool m_TimeCableDelayCorrection
Perform cable delay time correction (true) or not (false).
StoreArray< KLMDigit > m_Digits
KLM digits.
DBObjPtr< KLMChannelStatus > m_ChannelStatus
Channel status.
EKLM::TransformData * m_eklmTransformData
Transformation data.
void initialize() override
Initializer.
void event() override
Called for each event.
const KLMElementNumbers * m_ElementNumbers
KLM element numbers.
bklm::GeometryPar * m_bklmGeoPar
BKLM GeometryPar singleton.
StoreArray< EKLMAlignmentHit > m_eklmAlignmentHits
Alignment Hits.
double m_CoincidenceWindow
Half-width of the time coincidence window used to create a 2D hit from 1D digits/hits.
void endRun() override
Called if the current run ends.
const EKLMElementNumbers * m_eklmElementNumbers
EKLM element numbers.
double m_DelayBKLMScintillators
Delay (ns / cm) for BKLM scintillators.
void terminate() override
Called at the end of the event processing.
bool m_bklmIfAlign
Perform alignment correction (true) or not (false).
StoreObjPtr< EventLevelClusteringInfo > m_EventLevelClusteringInfo
EventLevelClusteringInfo.
double m_EventT0Value
Value of the EventT0.
void reconstructBKLMHits()
Reconstruct BKLM 2d hits.
double m_PromptTime
Nominal time of prompt KLMHit2ds.
double m_DelayRPCPhi
Delay (ns / cm) for RPC phi plane.
void beginRun() override
Called when entering a new run.
bool isNormal(const KLMDigit *digit) const
Check if channel is normal or dead.
OptionalDBObjPtr< KLMTimeCableDelay > m_TimeCableDelay
KLM time cable delay.
void correctCableDelay(double &td, const KLMDigit *digit)
Time correction by subtract cable delay.
double m_PromptWindow
Half-width of the time window relative to the prompt time for KLMHit2ds.
StoreArray< BKLMHit1d > m_bklmHit1ds
BKLM 1d hits.
const EKLM::GeometryData * m_eklmGeoDat
Geometry data.
double m_DelayEKLMScintillators
Delay (ns / cm) for EKLM scintillators.
StoreObjPtr< EventT0 > m_EventT0
EventT0.
bool m_EventT0Correction
Perform EventT0 correction (true) or not (false).
bool m_bklmIgnoreScintillators
Ignore scintillators (to debug their electronics mapping).
bool m_IgnoreHotChannels
Use only normal and dead (for debugging) channels during 2d hit reconstruction.
OptionalDBObjPtr< KLMTimeConstants > m_TimeConstants
KLM time constants.
double m_DelayRPCZ
Delay (ns / cm) for RPC Z plane.
DBObjPtr< KLMTimeWindow > m_TimeWindow
KLM time window.
bool m_eklmCheckSegmentIntersection
Check if segments intersect.
StoreArray< KLMHit2d > m_Hit2ds
KLM 2d hits.
Base class for Modules.
Definition: Module.h:72
Optional DBObjPtr: This class behaves the same as the DBObjPtr except that it will not raise errors w...
Definition: DBObjPtr.h:48
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Provides BKLM geometry parameters for simulation, reconstruction etc (from Gearbox or DataBase)
Definition: GeometryPar.h:37
Abstract base class for different kinds of events.