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 () override
 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 const MCParticle* mcParticle = hit.getRelated<MCParticle>();
260 // hits without a related MCParticle can never be in the requested id list and are skipped below
261 int mcParticleId = mcParticle ? mcParticle->getArrayIndex() : -1;
262 if (mcParticle) {
263 nHitsByMCParticleId[mcParticleId]++;
264 }
265 bool useMCParticleId = std::count(m_param_useMCParticleIds.begin(),
267 mcParticleId);
268 if (not useMCParticleId) continue;
269 }
270
271 WireID wireID(hit.getID());
272 if (not wireTopology.isValidWireID(wireID)) {
273 B2WARNING("Skip invalid wire id " << hit.getID());
274 continue;
275 }
276
277 // ignore hit if it is on a bad wire
278 if (not m_param_useBadWires and geometryPar.isBadWire(wireID)) {
279 continue;
280 }
281
282 // Exclude hit with large drift time
283 // 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.
284 const double approxDriftTime = tdcCountTranslator.getDriftTime(hit.getTDCCount(), wireID, 0, 0, hit.getADCCount());
285 ISuperLayer iSL = wireID.getISuperLayer();
286
287 // If input module parameter is set to positive value, use it. Otherwise use DB
288 if (m_maxDriftTimes.at(iSL) > 0) {
289 if (approxDriftTime > m_maxDriftTimes.at(iSL)) continue;
290 } else {
291 if (m_DBCDClayerTimeCut->getLayerTimeCut(iSL) > 0 && approxDriftTime > m_DBCDClayerTimeCut->getLayerTimeCut(iSL)) continue;
292 }
293
294 if (not m_useSuperLayers[iSL]) continue;
295 unsigned short layer = wireID.getICLayer();
296 if (not m_useLayers[layer]) continue;
297
298 const CDCWire& wire = wireTopology.getWire(wireID);
299
300 const ROOT::Math::XYVector& pos2D = wire.getRefPos2D();
301
302 // Check whether the position is outside the selected sector
303 if (VectorUtil::isBetween(pos2D, m_useSector[1], m_useSector[0])) continue;
304
305 // Only use some MCParticles if request - mostly for debug
306 if (not m_param_useMCParticleIds.empty()) {
307 const MCParticle* mcParticle = hit.getRelated<MCParticle>();
308 // hits without a related MCParticle can never be in the requested id list and are skipped below
309 int mcParticleId = mcParticle ? mcParticle->getArrayIndex() : -1;
310 if (mcParticle) {
311 nHitsByMCParticleId[mcParticleId]++;
312 }
313 bool useMCParticleId = std::count(m_param_useMCParticleIds.begin(),
315 mcParticleId);
316 if (not useMCParticleId) continue;
317 }
318
319
320
321 // Consider the particle as incoming in the top part of the CDC for a downwards flight direction
322 bool isIncoming = m_flightTimeEstimation == EPreferredDirection::c_Downwards and pos2D.y() > 0;
323 const double alpha = isIncoming ? M_PI : 0;
324 const double beta = 1;
325 const double flightTimeEstimate =
327
328 const double driftTime = tdcCountTranslator.getDriftTime(hit.getTDCCount(),
329 wire.getWireID(),
330 flightTimeEstimate,
331 wire.getRefZ(),
332 hit.getADCCount());
333 const bool left = false;
334 const bool right = true;
335 const double theta = M_PI / 2;
336
337 const double leftRefDriftLength =
338 tdcCountTranslator.getDriftLength(hit.getTDCCount(),
339 wire.getWireID(),
340 flightTimeEstimate,
341 left,
342 wire.getRefZ(),
343 alpha,
344 theta);
345
346 const double rightRefDriftLength =
347 tdcCountTranslator.getDriftLength(hit.getTDCCount(),
348 wire.getWireID(),
349 flightTimeEstimate,
350 right,
351 wire.getRefZ(),
352 alpha,
353 theta);
354
355 const double refDriftLength =
356 (leftRefDriftLength + rightRefDriftLength) / 2.0;
357
358 const double leftRefDriftLengthVariance =
359 tdcCountTranslator.getDriftLengthResolution(refDriftLength,
360 wire.getWireID(),
361 left,
362 wire.getRefZ(),
363 alpha,
364 theta);
365
366 const double rightRefDriftLengthVariance =
367 tdcCountTranslator.getDriftLengthResolution(refDriftLength,
368 wire.getWireID(),
369 right,
370 wire.getRefZ(),
371 alpha,
372 theta);
373
374 const double refDriftLengthVariance =
375 (leftRefDriftLengthVariance + rightRefDriftLengthVariance) / 2.0;
376
377 const double leftRefChargeDeposit =
378 adcCountTranslator.getCharge(hit.getADCCount(),
379 wire.getWireID(),
380 left,
381 wire.getRefZ(),
382 theta);
383
384 const double rightRefChargeDeposit =
385 adcCountTranslator.getCharge(hit.getADCCount(),
386 wire.getWireID(),
387 right,
388 wire.getRefZ(),
389 theta);
390
391 const double refChargeDeposit =
392 (leftRefChargeDeposit + rightRefChargeDeposit) / 2.0;
393
394 outputWireHits.emplace_back(&hit, refDriftLength, refDriftLengthVariance, refChargeDeposit, driftTime);
395 }
396
397 std::sort(outputWireHits.begin(), outputWireHits.end());
398
399 if (not m_param_useMCParticleIds.empty()) {
400 for (const std::pair<int, size_t> nHitsForMCParticleId : nHitsByMCParticleId) {
401 B2DEBUG(25,
402 "MC particle " << nHitsForMCParticleId.first << " #hits "
403 << nHitsForMCParticleId.second);
404 }
405 }
406}
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:234
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: