Belle II Software development
WireHitCreator Class Referenceabstract

Combines the geometrical information and the raw hit information into wire hits, which can be used from all modules after that. More...

#include <WireHitCreator.h>

Inheritance diagram for WireHitCreator:
Findlet< TrackingUtilities::CDCWireHit > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using IOTypes
 Types that should be served to apply on invocation.
 
using IOTypes
 Types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 

Public Member Functions

 WireHitCreator ()
 Default constructor.
 
 ~WireHitCreator ()
 Default destructor.
 
std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void initialize () final
 Signals the beginning of the event processing.
 
void beginRun () final
 Signal the beginning of a new run.
 
void apply (std::vector< TrackingUtilities::CDCWireHit > &outputWireHits) final
 Main algorithm creating the wire hits.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector
 Short hand for ToRangeImpl.
 
using ToVector
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = TrackingUtilities::Findlet<TrackingUtilities::CDCWireHit>
 Type of the base class.
 

Private Attributes

std::string m_param_wirePosition = "base"
 Parameter : Geometry set to be used. Either "base", "misalign" or " aligned".
 
bool m_param_ignoreWireSag = false
 Parameter : Switch to deactivate the sag of the wires for the concerns of the track finders.
 
std::string m_param_flightTimeEstimation = "none"
 Parameter : Method for the initial time of flight estimation as string.
 
std::tuple< double, double, double > m_param_triggerPoint = {0.0, 0.0, 0.0}
 Parameter : Location of the flight time zero.
 
std::vector< int > m_param_useSuperLayers
 Parameter : List of super layers to be used - mostly for debugging.
 
std::vector< uint > m_param_useLayers
 Parameter : List of layers to be used.
 
std::vector< uint > m_param_ignoreLayers
 Parameter : List of layers to be ignored in tracking e.g. for simulating too high occupancy.
 
std::vector< float > m_param_maxDriftTimes = { -1, -1, -1, -1, -1, -1, -1, -1, -1}
 Parameter : Cut for approximate drift time (super-layer dependent)
 
bool m_param_useSecondHits = false
 Parameter : If true, the second hit information will be used to create Wire Hits.
 
bool m_param_useBadWires = false
 Parameter : If true, the hits on bad wires are not ignored.
 
std::tuple< double, double > m_param_useDegreeSector {INFINITY, INFINITY}
 Parameter : Angular range in degrees for which hits should be unpacked.
 
std::vector< int > m_param_useMCParticleIds {}
 Parameter : Indices of the Monte Carlo particles for which hits should be used.
 
CDC::EWirePosition m_wirePosition = CDC::EWirePosition::c_Base
 Geometry set to be used.
 
std::array< float, CDC::ISuperLayerUtil::c_Nm_maxDriftTimes = { -1, -1, -1, -1, -1, -1, -1, -1, -1}
 Cut for approximate drift time (super-layer dependent)
 
EPreferredDirection m_flightTimeEstimation = EPreferredDirection::c_None
 Method for the initial time of flight estimation.
 
ROOT::Math::XYZVector m_triggerPoint = ROOT::Math::XYZVector(0.0, 0.0, 0.0)
 Central location of the flight time zero position. Usually the location of the trigger.
 
std::array< bool, CDC::ISuperLayerUtil::c_Nm_useSuperLayers {}
 Bits for the used super layers.
 
std::array< bool, c_maxNSenseLayers > m_useLayers {}
 Bits for the used layers.
 
std::array< ROOT::Math::XYVector, 2 > m_useSector {}
 Unit vectors denoting the sector for which hits should be created.
 
std::unique_ptr< CDC::TDCCountTranslatorBasem_tdcCountTranslator
 TDC Count translator to be used to calculate the initial dirft length estiamtes.
 
std::unique_ptr< CDC::ADCCountTranslatorBasem_adcCountTranslator
 ADC Count translator to be used to calculate the charge deposit in the drift cell.
 
DBObjPtr< CDClayerTimeCutm_DBCDClayerTimeCut
 Cut for approximate drift time (super-layer dependent)
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized
 Flag to keep track whether initialization happened before.
 
bool m_terminated
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Combines the geometrical information and the raw hit information into wire hits, which can be used from all modules after that.

Definition at line 48 of file WireHitCreator.h.

Member Typedef Documentation

◆ IOTypes [1/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOTypes [2/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors [1/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ IOVectors [2/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

Type of the base class.

Definition at line 52 of file WireHitCreator.h.

◆ ToVector [1/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

◆ ToVector [2/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26

◆ apply()

void apply ( std::vector< TrackingUtilities::CDCWireHit > & outputWireHits)
final

Main algorithm creating the wire hits.

Definition at line 218 of file WireHitCreator.cc.

219{
220 // Wire hits have been created before
221 if (not outputWireHits.empty()) return;
222
223 const CDCWireTopology& wireTopology = CDCWireTopology::getInstance();
224 CDC::TDCCountTranslatorBase& tdcCountTranslator = *m_tdcCountTranslator;
225 CDC::ADCCountTranslatorBase& adcCountTranslator = *m_adcCountTranslator;
226 CDC::CDCGeometryPar& geometryPar = CDC::CDCGeometryPar::Instance();
227
228 // Create the wire hits into a vector
229 StoreArray<CDCHit> hits;
230 std::size_t nHits = hits.getEntries();
231 if (nHits == 0) {
232 B2WARNING("Event with no hits");
233 outputWireHits.clear();
234 }
235
236 std::map<int, size_t> nHitsByMCParticleId;
237
238 outputWireHits.reserve(nHits);
239
240 // make sure that DB object for time cut is valid:
241 if (not m_DBCDClayerTimeCut.isValid()) {
242 B2FATAL("CDClayerTimeCut DB object is invalid");
243 }
244
245 for (const CDCHit& hit : hits) {
246
247 if (hit.getICLayer() < geometryPar.getOffsetOfFirstLayer() or
248 hit.getISuperLayer() < geometryPar.getOffsetOfFirstSuperLayer()) {
249 continue;
250 }
251
252 // ignore this hit if it contains the information of a 2nd hit
253 if (!m_param_useSecondHits && hit.is2ndHit()) {
254 continue;
255 }
256
257 // Only use some MCParticles if request - mostly for debug
258 if (not m_param_useMCParticleIds.empty()) {
259 MCParticle* mcParticle = hit.getRelated<MCParticle>();
260 int mcParticleId = mcParticle->getArrayIndex();
261 if (mcParticle) {
262 nHitsByMCParticleId[mcParticleId]++;
263 }
264 bool useMCParticleId = std::count(m_param_useMCParticleIds.begin(),
266 mcParticleId);
267 if (not useMCParticleId) continue;
268 }
269
270 WireID wireID(hit.getID());
271 if (not wireTopology.isValidWireID(wireID)) {
272 B2WARNING("Skip invalid wire id " << hit.getID());
273 continue;
274 }
275
276 // ignore hit if it is on a bad wire
277 if (not m_param_useBadWires and geometryPar.isBadWire(wireID)) {
278 continue;
279 }
280
281 // Exclude hit with large drift time
282 // In the following, the tof correction is off; the propagation-delay corr. is off (default of the translator); the event time corr. is on when it is available.
283 const double approxDriftTime = tdcCountTranslator.getDriftTime(hit.getTDCCount(), wireID, 0, 0, hit.getADCCount());
284 ISuperLayer iSL = wireID.getISuperLayer();
285
286 // If input module parameter is set to positive value, use it. Otherwise use DB
287 if (m_maxDriftTimes.at(iSL) > 0) {
288 if (approxDriftTime > m_maxDriftTimes.at(iSL)) continue;
289 } else {
290 if (m_DBCDClayerTimeCut->getLayerTimeCut(iSL) > 0 && approxDriftTime > m_DBCDClayerTimeCut->getLayerTimeCut(iSL)) continue;
291 }
292
293 if (not m_useSuperLayers[iSL]) continue;
294 unsigned short layer = wireID.getICLayer();
295 if (not m_useLayers[layer]) continue;
296
297 const CDCWire& wire = wireTopology.getWire(wireID);
298
299 const ROOT::Math::XYVector& pos2D = wire.getRefPos2D();
300
301 // Check whether the position is outside the selected sector
302 if (VectorUtil::isBetween(pos2D, m_useSector[1], m_useSector[0])) continue;
303
304 // Only use some MCParticles if request - mostly for debug
305 if (not m_param_useMCParticleIds.empty()) {
306 MCParticle* mcParticle = hit.getRelated<MCParticle>();
307 int mcParticleId = mcParticle->getArrayIndex();
308 if (mcParticle) {
309 nHitsByMCParticleId[mcParticleId]++;
310 }
311 bool useMCParticleId = std::count(m_param_useMCParticleIds.begin(),
313 mcParticleId);
314 if (not useMCParticleId) continue;
315 }
316
317
318
319 // Consider the particle as incoming in the top part of the CDC for a downwards flight direction
320 bool isIncoming = m_flightTimeEstimation == EPreferredDirection::c_Downwards and pos2D.y() > 0;
321 const double alpha = isIncoming ? M_PI : 0;
322 const double beta = 1;
323 const double flightTimeEstimate =
325
326 const double driftTime = tdcCountTranslator.getDriftTime(hit.getTDCCount(),
327 wire.getWireID(),
328 flightTimeEstimate,
329 wire.getRefZ(),
330 hit.getADCCount());
331 const bool left = false;
332 const bool right = true;
333 const double theta = M_PI / 2;
334
335 const double leftRefDriftLength =
336 tdcCountTranslator.getDriftLength(hit.getTDCCount(),
337 wire.getWireID(),
338 flightTimeEstimate,
339 left,
340 wire.getRefZ(),
341 alpha,
342 theta);
343
344 const double rightRefDriftLength =
345 tdcCountTranslator.getDriftLength(hit.getTDCCount(),
346 wire.getWireID(),
347 flightTimeEstimate,
348 right,
349 wire.getRefZ(),
350 alpha,
351 theta);
352
353 const double refDriftLength =
354 (leftRefDriftLength + rightRefDriftLength) / 2.0;
355
356 const double leftRefDriftLengthVariance =
357 tdcCountTranslator.getDriftLengthResolution(refDriftLength,
358 wire.getWireID(),
359 left,
360 wire.getRefZ(),
361 alpha,
362 theta);
363
364 const double rightRefDriftLengthVariance =
365 tdcCountTranslator.getDriftLengthResolution(refDriftLength,
366 wire.getWireID(),
367 right,
368 wire.getRefZ(),
369 alpha,
370 theta);
371
372 const double refDriftLengthVariance =
373 (leftRefDriftLengthVariance + rightRefDriftLengthVariance) / 2.0;
374
375 const double leftRefChargeDeposit =
376 adcCountTranslator.getCharge(hit.getADCCount(),
377 wire.getWireID(),
378 left,
379 wire.getRefZ(),
380 theta);
381
382 const double rightRefChargeDeposit =
383 adcCountTranslator.getCharge(hit.getADCCount(),
384 wire.getWireID(),
385 right,
386 wire.getRefZ(),
387 theta);
388
389 const double refChargeDeposit =
390 (leftRefChargeDeposit + rightRefChargeDeposit) / 2.0;
391
392 outputWireHits.emplace_back(&hit, refDriftLength, refDriftLengthVariance, refChargeDeposit, driftTime);
393 }
394
395 std::sort(outputWireHits.begin(), outputWireHits.end());
396
397 if (not m_param_useMCParticleIds.empty()) {
398 for (const std::pair<int, size_t> nHitsForMCParticleId : nHitsByMCParticleId) {
399 B2DEBUG(25,
400 "MC particle " << nHitsForMCParticleId.first << " #hits "
401 << nHitsForMCParticleId.second);
402 }
403 }
404}
virtual float getCharge(unsigned short adcCount=0, const WireID &wireID=WireID(), bool ambiguityDiscriminator=false, float z=0, float theta=static_cast< float >(TMath::Pi()/2.))=0
Function, for which this actually was meant.
ushort getOffsetOfFirstLayer() const
Get the offset of the first layer.
bool isBadWire(const WireID &wid)
Inquire if the wire is totally-dead.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
ushort getOffsetOfFirstSuperLayer() const
Get the offset of the first super layer.
const CDCWire & getWire(const WireID &wireId) const
Getter for wire getter by wireID object.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
bool isValidWireID(const WireID &wireID) const
Checks the validity of a wireID convenience object.
const ROOT::Math::XYVector & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Definition CDCWire.h:221
const WireID & getWireID() const
Getter for the wire id.
Definition CDCWire.h:114
double getRefZ() const
Getter for the wire reference z coordinate Gives the wire's reference z coordinate.
Definition CDCWire.h:228
virtual double getDriftLength(unsigned short tdcCount=0, const WireID &wireID=WireID(), double timeOfFlightEstimator=0., bool ambiguityDiscriminator=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0)=0
Function for getting a drift length estimation.
virtual double getDriftLengthResolution(double driftLength=0., const WireID &wireID=WireID(), bool ambiguityDiscriminator=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.))=0
Uncertainty corresponding to drift length from getDriftLength of this class.
virtual double getDriftTime(unsigned short tdcCount, const WireID &wireID, double timeOfFlightEstimator, double z, unsigned short adcCount)=0
Get Drift time.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
Definition MCParticle.h:233
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
int getEntries() const
Get the number of objects in the array.
Definition StoreArray.h:216
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
virtual double getFlightTime2D(const ROOT::Math::XYVector &, double, double=1) const
Default estimator for the flight time.
EPreferredDirection m_flightTimeEstimation
Method for the initial time of flight estimation.
std::vector< int > m_param_useMCParticleIds
Parameter : Indices of the Monte Carlo particles for which hits should be used.
std::array< ROOT::Math::XYVector, 2 > m_useSector
Unit vectors denoting the sector for which hits should be created.
std::array< float, CDC::ISuperLayerUtil::c_N > m_maxDriftTimes
Cut for approximate drift time (super-layer dependent)
std::unique_ptr< CDC::TDCCountTranslatorBase > m_tdcCountTranslator
TDC Count translator to be used to calculate the initial dirft length estiamtes.
DBObjPtr< CDClayerTimeCut > m_DBCDClayerTimeCut
Cut for approximate drift time (super-layer dependent)
std::array< bool, c_maxNSenseLayers > m_useLayers
Bits for the used layers.
std::unique_ptr< CDC::ADCCountTranslatorBase > m_adcCountTranslator
ADC Count translator to be used to calculate the charge deposit in the drift cell.
bool m_param_useBadWires
Parameter : If true, the hits on bad wires are not ignored.
std::array< bool, CDC::ISuperLayerUtil::c_N > m_useSuperLayers
Bits for the used super layers.
bool m_param_useSecondHits
Parameter : If true, the second hit information will be used to create Wire Hits.
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24

◆ beginEvent()

void beginEvent ( )
overrideinherited

Receive and dispatch signal for the start of a new event.

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
finalvirtual

Signal the beginning of a new run.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 211 of file WireHitCreator.cc.

212{
214 CDCWireTopology& wireTopology = CDCWireTopology::getInstance();
216}
void reinitialize(EWirePosition wirePosition, bool ignoreWireSag)
Reload all geometry parameters form the CDCGeometryPar to adjust to changes in geometry.
bool m_param_ignoreWireSag
Parameter : Switch to deactivate the sag of the wires for the concerns of the track finders.
CDC::EWirePosition m_wirePosition
Geometry set to be used.

◆ endRun()

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
void endRun() override
Receive and dispatch signal for the end of the run.
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
finalvirtual

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 48 of file WireHitCreator.cc.

49{
50 moduleParamList->addParameter(prefixed(prefix, "wirePosition"),
52 "Set of geometry parameters to be used in the track finding. "
53 "Either 'base', 'misaligned' or 'aligned'.",
55
56 moduleParamList->addParameter(prefixed(prefix, "ignoreWireSag"),
58 "Assume a wire sag coefficient of zero "
59 "such that the wires appear to be straight for "
60 "the track finders",
62
63 moduleParamList->addParameter(prefixed(prefix, "flightTimeEstimation"),
65 "Option which flight direction should be assumed for "
66 "an initial time of flight estimation. Options are: "
67 "'none' (no TOF correction), "
68 "'outwards', "
69 "'downwards'.",
71
72 moduleParamList->addParameter(prefixed(prefix, "triggerPoint"),
74 "Point relative to which the flight times are calculated",
76
77 moduleParamList->addParameter(prefixed(prefix, "useSuperLayers"),
79 "List of super layers to be used.",
81
82 moduleParamList->addParameter(prefixed(prefix, "maxDriftTimes"),
84 "Maximum drift time (nsec) allowed per super layer (in order of super layer#0-8). Default payload-based cut is applied if this value is negative",
86
87 moduleParamList->addParameter(prefixed(prefix, "useLayers"),
89 "List of layers to be used. "
90 "If a layer number is given in 'ignoreLayers', too, this will result on a B2FATAL. "
91 "Either use 'useLayers' and provide a set of layers to be used, "
92 "or use 'ignoreLayers' and provide a list of layers to be ignored, but not both at the same time.",
94
95 moduleParamList->addParameter(prefixed(prefix, "ignoreLayers"),
97 "List of layers to be ignored. "
98 "If a layer number is given in 'useLayers', too, this will result on a B2FATAL. "
99 "Either use 'useLayers' and provide a set of layers to be used, "
100 "or use 'ignoreLayers' and provide a list of layers to be ignored, but not both at the same time.",
102
103 moduleParamList->addParameter(prefixed(prefix, "useSecondHits"),
105 "Use the second hit information in the track finding.",
107
108 moduleParamList->addParameter(prefixed(prefix, "useBadWires"),
110 "Also create the hits that are on bad wires.",
112
113 moduleParamList->addParameter(prefixed(prefix, "useDegreeSector"),
115 "To angles in degrees for which hits should be created - mostly for debugging",
117
118 moduleParamList->addParameter(prefixed(prefix, "useMCParticleIds"),
120 "Ids of the MC particles to use. Default does not look at the MCParticles - most for debugging",
122}
std::string m_param_wirePosition
Parameter : Geometry set to be used. Either "base", "misalign" or " aligned".
std::tuple< double, double, double > m_param_triggerPoint
Parameter : Location of the flight time zero.
std::string m_param_flightTimeEstimation
Parameter : Method for the initial time of flight estimation as string.
std::vector< uint > m_param_useLayers
Parameter : List of layers to be used.
std::vector< uint > m_param_ignoreLayers
Parameter : List of layers to be ignored in tracking e.g. for simulating too high occupancy.
std::tuple< double, double > m_param_useDegreeSector
Parameter : Angular range in degrees for which hits should be unpacked.
std::vector< int > m_param_useSuperLayers
Parameter : List of super layers to be used - mostly for debugging.
std::vector< float > m_param_maxDriftTimes
Parameter : Cut for approximate drift time (super-layer dependent)
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< TrackingUtilities::CDCWireHit >.

Definition at line 42 of file WireHitCreator.cc.

43{
44 return "Combines the geometrical information and the raw hit information into wire hits, "
45 "which can be used from all modules after that";
46}

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
finalvirtual

Signals the beginning of the event processing.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 124 of file WireHitCreator.cc.

125{
126 StoreArray<CDCHit> hits;
127 hits.isRequired();
128
129 // Create the wires and layers once during initialisation
131
132 if (m_param_wirePosition == "base") {
133 m_wirePosition = EWirePosition::c_Base;
134 } else if (m_param_wirePosition == "misaligned") {
135 m_wirePosition = EWirePosition::c_Misaligned;
136 } else if (m_param_wirePosition == "aligned") {
137 m_wirePosition = EWirePosition::c_Aligned;
138 } else {
139 B2ERROR("Received unknown wirePosition " << m_param_wirePosition);
140 }
141
142 m_tdcCountTranslator.reset(new CDC::RealisticTDCCountTranslator);
143 m_adcCountTranslator.reset(new CDC::LinearGlobalADCCountTranslator);
144
145 if (m_param_flightTimeEstimation != std::string("")) {
146 try {
148 } catch (std::invalid_argument& e) {
149 B2ERROR("Unexpected 'flightTimeEstimation' parameter : '" << m_param_flightTimeEstimation);
150 }
151 }
152
153 m_triggerPoint = ROOT::Math::XYZVector(std::get<0>(m_param_triggerPoint),
154 std::get<1>(m_param_triggerPoint),
155 std::get<2>(m_param_triggerPoint));
156
157 if (m_flightTimeEstimation == EPreferredDirection::c_Symmetric) {
158 B2ERROR("Unexpected 'flightTimeEstimation' parameter : '" << m_param_flightTimeEstimation);
159 } else if (m_flightTimeEstimation == EPreferredDirection::c_Downwards) {
160 FlightTimeEstimator::instance(std::make_unique<CosmicRayFlightTimeEstimator>(m_triggerPoint));
161 } else if (m_flightTimeEstimation == EPreferredDirection::c_Outwards) {
162 FlightTimeEstimator::instance(std::make_unique<BeamEventFlightTimeEstimator>());
163 }
164
165 int nSL = m_param_maxDriftTimes.size();
166 for (int iSL = 0; iSL < nSL; ++iSL) {
167 m_maxDriftTimes.at(iSL) = m_param_maxDriftTimes.at(iSL);
168 }
169
170 if (not m_param_useSuperLayers.empty()) {
171 for (const ISuperLayer iSL : m_param_useSuperLayers) {
172 m_useSuperLayers.at(iSL) = true;
173 }
174 } else {
175 m_useSuperLayers.fill(true);
176 }
177
178 // Check for common value in the two vectors for using / ignoring layers
179 for (const uint useLayer : m_param_useLayers) {
180 for (const uint ingoreLayer : m_param_ignoreLayers) {
181 if (useLayer == ingoreLayer) {
182 B2FATAL("You chose to use and ignore CDC layer " << useLayer << " at the same time. "
183 "Please decide to either use or to ignore the layer.");
184 }
185 }
186 }
187
188 // fill all layers that should be used
189 if (not m_param_useLayers.empty()) {
190 for (const uint layer : m_param_useLayers) {
191 m_useLayers.at(layer) = true;
192 }
193 } else {
194 m_useLayers.fill(true);
195 }
196 // set layers that should be ignored to false
197 if (not m_param_ignoreLayers.empty()) {
198 for (const uint layer : m_param_ignoreLayers) {
199 m_useLayers.at(layer) = false;
200 }
201 }
202
203 if (std::isfinite(std::get<0>(m_param_useDegreeSector))) {
204 m_useSector[0] = VectorUtil::Phi(std::get<0>(m_param_useDegreeSector) * Unit::deg);
205 m_useSector[1] = VectorUtil::Phi(std::get<1>(m_param_useDegreeSector) * Unit::deg);
206 }
207
209}
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
ROOT::Math::XYZVector m_triggerPoint
Central location of the flight time zero position. Usually the location of the trigger.
static const double deg
degree to radians
Definition Unit.h:109

◆ terminate()

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
void terminate() override
Receive and dispatch Signal for termination of the event processing.
virtual void terminate()
Receive Signal for termination of the event processing.

Member Data Documentation

◆ m_adcCountTranslator

std::unique_ptr<CDC::ADCCountTranslatorBase> m_adcCountTranslator
private

ADC Count translator to be used to calculate the charge deposit in the drift cell.

Definition at line 140 of file WireHitCreator.h.

◆ m_DBCDClayerTimeCut

DBObjPtr<CDClayerTimeCut> m_DBCDClayerTimeCut
private

Cut for approximate drift time (super-layer dependent)

Definition at line 143 of file WireHitCreator.h.

◆ m_flightTimeEstimation

EPreferredDirection m_flightTimeEstimation = EPreferredDirection::c_None
private

Method for the initial time of flight estimation.

Definition at line 121 of file WireHitCreator.h.

◆ m_initialized

bool m_initialized
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_maxDriftTimes

std::array<float, CDC::ISuperLayerUtil::c_N> m_maxDriftTimes = { -1, -1, -1, -1, -1, -1, -1, -1, -1}
private

Cut for approximate drift time (super-layer dependent)

Definition at line 118 of file WireHitCreator.h.

118{ -1, -1, -1, -1, -1, -1, -1, -1, -1};

◆ m_param_flightTimeEstimation

std::string m_param_flightTimeEstimation = "none"
private

Parameter : Method for the initial time of flight estimation as string.

Definition at line 84 of file WireHitCreator.h.

◆ m_param_ignoreLayers

std::vector<uint> m_param_ignoreLayers
private

Parameter : List of layers to be ignored in tracking e.g. for simulating too high occupancy.

Definition at line 96 of file WireHitCreator.h.

◆ m_param_ignoreWireSag

bool m_param_ignoreWireSag = false
private

Parameter : Switch to deactivate the sag of the wires for the concerns of the track finders.

Definition at line 81 of file WireHitCreator.h.

◆ m_param_maxDriftTimes

std::vector<float> m_param_maxDriftTimes = { -1, -1, -1, -1, -1, -1, -1, -1, -1}
private

Parameter : Cut for approximate drift time (super-layer dependent)

Definition at line 99 of file WireHitCreator.h.

99{ -1, -1, -1, -1, -1, -1, -1, -1, -1};

◆ m_param_triggerPoint

std::tuple<double, double, double> m_param_triggerPoint = {0.0, 0.0, 0.0}
private

Parameter : Location of the flight time zero.

Definition at line 87 of file WireHitCreator.h.

87{0.0, 0.0, 0.0};

◆ m_param_useBadWires

bool m_param_useBadWires = false
private

Parameter : If true, the hits on bad wires are not ignored.

Definition at line 105 of file WireHitCreator.h.

◆ m_param_useDegreeSector

std::tuple<double, double> m_param_useDegreeSector {INFINITY, INFINITY}
private

Parameter : Angular range in degrees for which hits should be unpacked.

Definition at line 108 of file WireHitCreator.h.

108{INFINITY, INFINITY};

◆ m_param_useLayers

std::vector<uint> m_param_useLayers
private

Parameter : List of layers to be used.

Definition at line 93 of file WireHitCreator.h.

◆ m_param_useMCParticleIds

std::vector<int> m_param_useMCParticleIds {}
private

Parameter : Indices of the Monte Carlo particles for which hits should be used.

Definition at line 111 of file WireHitCreator.h.

111{};

◆ m_param_useSecondHits

bool m_param_useSecondHits = false
private

Parameter : If true, the second hit information will be used to create Wire Hits.

Definition at line 102 of file WireHitCreator.h.

◆ m_param_useSuperLayers

std::vector<int> m_param_useSuperLayers
private

Parameter : List of super layers to be used - mostly for debugging.

Definition at line 90 of file WireHitCreator.h.

◆ m_param_wirePosition

std::string m_param_wirePosition = "base"
private

Parameter : Geometry set to be used. Either "base", "misalign" or " aligned".

Definition at line 78 of file WireHitCreator.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_tdcCountTranslator

std::unique_ptr<CDC::TDCCountTranslatorBase> m_tdcCountTranslator
private

TDC Count translator to be used to calculate the initial dirft length estiamtes.

Definition at line 137 of file WireHitCreator.h.

◆ m_terminated

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_triggerPoint

ROOT::Math::XYZVector m_triggerPoint = ROOT::Math::XYZVector(0.0, 0.0, 0.0)
private

Central location of the flight time zero position. Usually the location of the trigger.

Definition at line 124 of file WireHitCreator.h.

◆ m_useLayers

std::array<bool, c_maxNSenseLayers> m_useLayers {}
private

Bits for the used layers.

Definition at line 130 of file WireHitCreator.h.

130{};

◆ m_useSector

std::array<ROOT::Math::XYVector, 2> m_useSector {}
private

Unit vectors denoting the sector for which hits should be created.

Definition at line 133 of file WireHitCreator.h.

133{};

◆ m_useSuperLayers

std::array<bool, CDC::ISuperLayerUtil::c_N> m_useSuperLayers {}
private

Bits for the used super layers.

Definition at line 127 of file WireHitCreator.h.

127{};

◆ m_wirePosition

CDC::EWirePosition m_wirePosition = CDC::EWirePosition::c_Base
private

Geometry set to be used.

Definition at line 115 of file WireHitCreator.h.


The documentation for this class was generated from the following files: