Belle II Software  release-05-01-25
CDCDigitizerModule Class Reference

The Class for Detailed Digitization of CDC. More...

#include <CDCDigitizerModule.h>

Inheritance diagram for CDCDigitizerModule:
Collaboration diagram for CDCDigitizerModule:

Classes

struct  SignalInfo
 Structure for saving the signal information. More...
 
struct  XTalkInfo
 Structure for saving the x-talk information. More...
 

Public Types

enum  EModulePropFlags {
  c_Input = 1,
  c_Output = 2,
  c_ParallelProcessingCertified = 4,
  c_HistogramManager = 8,
  c_InternalSerializer = 16,
  c_TerminateInAllProcesses = 32,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 CDCDigitizerModule ()
 Constructor.
 
void initialize () override
 Initialize variables, print info, and start CPU clock.
 
void event () override
 Actual digitization of all hits in the CDC. More...
 
void terminate () override
 Terminate func.
 
virtual std::vector< std::string > getFileNames (__attribute__((unused)) bool outputFiles)
 Return a list of output filenames for this modules. More...
 
virtual void beginRun ()
 Called when entering a new run. More...
 
virtual void endRun ()
 This method is called if the current run ends. More...
 
const std::string & getName () const
 Returns the name of the module. More...
 
const std::string & getType () const
 Returns the type of the module (i.e. More...
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module. More...
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties. More...
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level. More...
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module. More...
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module. More...
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module. More...
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true. More...
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer). More...
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished. More...
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module. More...
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter. More...
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module. More...
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module. More...
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters. More...
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python. More...
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side. More...
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module. More...
 
void setType (const std::string &type)
 Set the module type. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module. More...
 
void setReturnValue (int value)
 Sets the return value for this module as integer. More...
 
void setReturnValue (bool value)
 Sets the return value for this module as bool. More...
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Private Member Functions

double smearDriftLength (double driftLength, double dDdt)
 Method used to smear the drift length. More...
 
double getdDdt (double driftLength)
 The method to get dD/dt. More...
 
double getDriftTime (double driftLength, bool addTof, bool addDelay)
 The method to get drift time based on drift length. More...
 
unsigned short getADCCount (const WireID &wid, double edep, double dx, double costh)
 Edep to ADC Count converter.
 
void setFEElectronics ()
 Set FEE parameters (from DB)
 
void setRunGain ()
 Set run-gain (from DB)
 
void addXTalk ()
 Add crosstalk.
 
std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects. More...
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary. More...
 

Private Attributes

StoreArray< MCParticlem_mcParticles
 Set edep-to-ADC conversion params. More...
 
StoreArray< CDCSimHitm_simHits
 CDCSimHit array.
 
StoreArray< CDCHitm_cdcHits
 CDCHit array.
 
StoreArray< CDCHitm_cdcHits4Trg
 CDCHit4trg array.
 
std::string m_inputCDCSimHitsName
 Input array name. More...
 
std::string m_outputCDCHitsName
 Output array name.
 
std::string m_outputCDCHitsName4Trg
 Output array name for trigger.
 
std::string m_MCParticlesToSimHitsName
 Relation for origin of incoming SimHits.
 
std::string m_SimHitsTOCDCHitsName
 Relation for outgoing CDCHits.
 
bool m_useSimpleDigitization
 Use float Gaussian Smearing instead of proper digitization.
 
double m_fraction
 Fraction of the first Gaussian used to smear drift length.
 
double m_mean1
 Mean value of the first Gassian used to smear drift length.
 
double m_resolution1
 Resolution of the first Gassian used to smear drift length.
 
double m_mean2
 Mean value of the second Gassian used to smear drift length.
 
double m_resolution2
 Resolution of the second Gassian used to smear drift length.
 
double m_tdcThreshold4Outer
 TDC threshold for outer layers in unit of eV.
 
double m_tdcThreshold4Inner
 TDC threshold for inner layers in unit of eV.
 
double m_gasToGasWire
 Approx. More...
 
double m_scaleFac = 1.
 Factor to mutiply to edep.
 
int m_adcThreshold
 Threshold for ADC in unit of count.
 
double m_tMin
 Lower edge of time window in ns.
 
double m_tMaxOuter
 Upper edge of time window in ns for the outer layers.
 
double m_tMaxInner
 Upper edge of time window in ns for the inner layers.
 
double m_trigTimeJitter
 Magnitude of trigger timing jitter (ns).
 
CDC::CDCGeometryParm_cdcgp
 Cached Pointer to CDCGeometryPar.
 
CDC::CDCGeoControlParm_gcp
 Cached pointer to CDCGeoControlPar.
 
CDCSimHitm_aCDCSimHit
 Pointer to CDCSimHit.
 
WireID m_wireID
 WireID of this hit.
 
unsigned short m_posFlag
 left or right flag of this hit
 
unsigned short m_boardID = 0
 FEE board ID.
 
TVector3 m_posWire
 wire position of this hit
 
TVector3 m_posTrack
 track position of this hit
 
TVector3 m_momentum
 3-momentum of this hit
 
double m_driftLength
 drift length of this hit
 
double m_flightTime
 flight time of this hit
 
double m_globalTime
 global time of this hit
 
double m_tdcBinWidth
 Width of a TDC bin (in ns)
 
double m_tdcBinWidthInv
 m_tdcBinWidth^-1 (in ns^-1)
 
double m_tdcResol
 TDC resolution (in ns)
 
double m_driftV
 Nominal drift velocity (in cm/ns)
 
double m_driftVInv
 m_driftV^-1 (in ns/cm)
 
double m_propSpeedInv
 Inv. More...
 
double m_tdcThresholdOffset
 Offset for TDC(digital) threshold (mV)
 
double m_analogGain
 analog gain (V/pC)
 
double m_digitalGain
 digital gain (V/pC)
 
double m_adcBinWidth
 ADC bin width (mV)
 
double m_addFudgeFactorForSigma
 additional fudge factor for space resol.
 
double m_totalFudgeFactor = 1.
 total fudge factor for space resol.
 
double m_runGain = 1.
 run gain.
 
double m_overallGainFactor = 1.
 Overall gain factor.
 
bool m_doSmearing
 A switch to control drift length smearing.
 
bool m_addTimeWalk
 A switch used to control adding time-walk delay into the total drift time or not.
 
bool m_addInWirePropagationDelay
 A switch used to control adding propagation delay into the total drift time or not.
 
bool m_addTimeOfFlight
 A switch used to control adding time of flight into the total drift time or not.
 
bool m_addInWirePropagationDelay4Bg
 A switch used to control adding propagation delay into the total drift time or not for beam bg.
 
bool m_addTimeOfFlight4Bg
 A switch used to control adding time of flight into the total drift time or not for beam bg.
 
bool m_outputNegativeDriftTime
 A switch to output negative drift time to CDCHit.
 
bool m_output2ndHit
 A switch to output 2nd hit.
 
bool m_align
 A switch to control alignment.
 
bool m_correctForWireSag
 A switch to control wire sag.
 
bool m_useDB4FEE
 Fetch FEE params from DB.
 
DBArray< CDCFEElectronics > * m_fEElectronicsFromDB = nullptr
 Pointer to FE electronics params. More...
 
float m_lowEdgeOfTimeWindow [nBoards] = {0}
 Lower edge of time-window.
 
float m_uprEdgeOfTimeWindow [nBoards] = {0}
 Upper edge of time-window.
 
float m_tdcThresh [nBoards] = {0}
 Threshold for timing-signal.
 
float m_adcThresh [nBoards] = {0}
 Threshold for FADC.
 
unsigned short m_widthOfTimeWindow [nBoards] = {0}
 Width of time window.
 
bool m_useDB4EDepToADC
 Fetch edep-to-ADC conversion params. More...
 
bool m_useDB4RunGain
 Fetch run gain from DB.
 
bool m_spaceChargeEffect
 Space charge effect.
 
DBObjPtr< CDCDedxRunGain > * m_runGainFromDB = nullptr
 Pointer to run gain from DB.
 
bool m_addXTalk
 Flag to switch on/off crosstalk.
 
bool m_issue2ndHitWarning
 Flag to switch on/off a warning on the 2nd TDC hit.
 
bool m_includeEarlyXTalks
 Flag to switch on/off xtalks earlier than the hit.
 
int m_debugLevel4XTalk
 Debug level for crosstalk.
 
DBObjPtr< CDCCrossTalkLibrary > * m_xTalkFromDB = nullptr
 Pointer to cross-talk from DB.
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

The Class for Detailed Digitization of CDC.

Currently a float Gaussian with steerable parameters is used for the digitization. If there are two or more hits in one cell, only the shortest drift length is selected. The signal amplitude is the sum of all hits deposited energy in this cell.

Definition at line 60 of file CDCDigitizerModule.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 79 of file Module.h.

Member Function Documentation

◆ beginRun()

virtual void beginRun ( )
inlinevirtualinherited

Called when entering a new run.

Called at the beginning of each run, the method gives you the chance to change run dependent constants like alignment parameters, etc.

This method can be implemented by subclasses.

Reimplemented in DQMHistAnalysisPXDTrackChargeModule, DQMHistOutputToEPICSModule, DQMHistInjectionModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisTrackingModule, PXDDigitizerModule, ECLDQMInjectionModule, PXDGatedModeDQMModule, PXDDAQDQMModule, PXDInjectionDQMModule, PXDBgTupleProducerModule, PXDMCBgTupleProducerModule, SVDDQMInjectionModule, PXDDQMEfficiencySelftrackModule, DQMHistComparitorModule, PXDDQMEfficiencyModule, PyModule, PXDGatedDHCDQMModule, PXDROIFinderAnalysisModule, AlignDQMModule, SVDDQMExpressRecoModule, DQMHistAnalysisInputRootFileModule, SVDDQMClustersOnTrackModule, SVDUnpackerDQMModule, TrackDQMModule, PXDTrackClusterDQMModule, PXDRawDQMModule, PXDclusterFilterModule, PXDdigiFilterModule, DQMHistAnalysisPXDERModule, PXDDQMCorrModule, PXDDQMExpressRecoModule, PXDROIDQMModule, PXDDQMClustersModule, DelayDQMModule, VXDDQMExpressRecoModule, vxdDigitMaskingModule, PXDRawDQMCorrModule, DQMHistAnalysisIPModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisExampleFlagsModule, V0ObjectsDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGGRLUnpackerModule, TRGCDCETFUnpackerModule, MaterialScanModule, TOPUnpackerModule, B2BIIConvertMdstModule, ECLWaveformFitModule, FindletModule< AFindlet >, FindletModule< FacetCreator >, FindletModule< TrackFinderAutomaton >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialStraightTrackFinder >, FindletModule< SegmentLinker >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentOrienter >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< CKFToSVDFindlet >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackRejecter >, FindletModule< SegmentCreatorMCTruth >, FindletModule< HitBasedT0Extractor >, FindletModule< TrackFinderCosmics >, FindletModule< SuperClusterCreator >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< TrackExporter >, FindletModule< ClusterPreparer >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< AxialTrackFinderHough >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackFinder >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< SegmentPairCreator >, FindletModule< HitReclaimer >, FindletModule< CKFToPXDFindlet >, FindletModule< TrackQualityEstimator >, FindletModule< StereoHitFinder >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< SegmentFitter >, FindletModule< SegmentRejecter >, FindletModule< WireHitPreparer >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTrackCombiner >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleStereoHitFinder >, FindletModule< TrackCombiner >, FindletModule< AxialSegmentPairCreator >, FindletModule< WireHitBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFindlet >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< TrackQualityAsserter >, FindletModule< WireHitCreator >, SVDBackgroundModule, TOPTimeBaseCalibratorModule, TOPTBCComparatorModule, B2BIIFixMdstModule, ECLChargedPIDModule, SVDDigitizerModule, ARICHNtupleModule, ECLDigitizerModule, BeamBkgTagSetterModule, PXDBackgroundModule, ParticleKinematicFitterModule, ECLShowerShapeModule, TOPGainEfficiencyCalculatorModule, SoftwareTriggerModule, ChargedPidMVAModule, ChargedPidMVAMulticlassModule, KLMClustersReconstructorModule, OpticalGunModule, SegmentNetworkProducerModule, TagVertexModule, CDCDedxValidationModule, TOPDQMModule, KLMDQMModule, CDCDQMModule, TOPDigitizerModule, TOPLaserHitSelectorModule, BKLMDigitAnalyzerModule, TOPModuleT0CalibratorModule, DQMHistAnalysisTRGGDLModule, GearboxModule, KLMUnpackerModule, TOPChannelT0CalibratorModule, TOPCommonT0CalibratorModule, ParticleVertexFitterModule, DQMHistAnalysisKLMModule, ECLCRFinderModule, KLMReconstructorModule, SVDUnpackerModule, TOPRawDigitConverterModule, DQMHistAnalysisCDCMonObjModule, ECLDigitizerPureCsIModule, ECLLocalRunCalibratorModule, KLMDigitizerModule, CDCCRTestModule, EKLMDataCheckerModule, TOPReconstructorModule, TrackFinderVXDBasicPathFinderModule, TrackFinderVXDCellOMatModule, ECLDataAnalysisModule, KLMPackerModule, FullSimModule, TOPChannelMaskerModule, TRGGDLUnpackerModule, HLTDQM2ZMQModule, ECLShowerCorrectorModule, MdstPIDModule, SVDCoGTimeEstimatorModule, ARICHDigitizerModule, ARICHDQMModule, BelleMCOutputModule, CsIDigitizerModule, DQMHistAnalysisARICHModule, ECLDQMModule, TOPAlignerModule, ARICHFillHitsModule, ARICHPackerModule, ARICHReconstructorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, CDCCosmicAnalysisModule, ECLSplitterN1Module, PXDPerformanceModule, TOPPDFCheckerModule, ARICHRelateModule, CsIStudyModule, CDCPackerModule, DQMHistAnalysisMiraBelleModule, ECLDigitCalibratorModule, TOPPDFDebuggerModule, ARICHUnpackerModule, BKLMSimHistogrammerModule, SVDROIFinderAnalysisModule, VXDTFTrainingDataCollectorModule, ARICHMCParticlesModule, ARICHRateCalModule, CDCUnpackerModule, TOPBackgroundModule, TOPTimeRecalibratorModule, TrackFinderMCTruthRecoTracksModule, ReprocessorModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, EclDisplayModule, EvtGenDecayModule, EKLMADCModule, SVDDQMHitTimeModule, TOPDoublePulseGeneratorModule, SVDROIFinderModule, TRGCDCT3DConverterModule, TRGGRLMatchModule, BGOverlayExecutorModule, DQMHistAnalysisECLModule, ECLLocalMaximumFinderModule, SVDPackerModule, TOPBunchFinderModule, VXDSimpleClusterizerModule, ARICHRawUnpackerModule, NtuplePhase1_v6Module, TpcDigitizerModule, ExportGeometryModule, SoftwareTriggerHLTDQMModule, KLMClusterEfficiencyModule, CDCDedxDQMModule, SVDLocalCalibrationsMonitorModule, SVDPerformanceModule, TOPCalPulseGeneratorModule, TOPNtupleModule, TOPPackerModule, TOPWaveformFeatureExtractorModule, ExtModule, MCTrackCandClassifierModule, MuidModule, SPTCmomentumSeedRetrieverModule, TrackFinderVXDAnalizerModule, TRGTOPDQMModule, BeamBkgGeneratorModule, DQMHistAnalysisInputPVSrvModule, ECLClusterPSDModule, EventInfoPrinterModule, BKLMTrackingModule, KLMExpertModule, SVDOccupancyAnalysisModule, TOPInterimFENtupleModule, TOPMCTrackMakerModule, BGOverlayInputModule, CDCRecoTrackFilterModule, ECLBackgroundModule, ECLDQMEXTENDEDModule, EvtGenInputModule, OverrideGenerationFlagsModule, MCMatcherKLMClustersModule, PIDNtupleModule, SVDDataFormatCheckModule, SPTCvirtualIPRemoverModule, HitXPModule, arichBtestModule, BgoStudyModule, CsiStudy_v2Module, FANGSDigitizerModule, MicrotpcStudyModule, PlumeDigitizerModule, DQMHistAnalysisARICHMonObjModule, PXDClustersFromTracksModule, EventT0DQMModule, TOPXTalkChargeShareSetterModule, PXDROIFinderModule, VXDQualityEstimatorMVAModule, AnalysisPhase1StudyModule, DosiStudyModule, He3tubeStudyModule, ECLCovarianceMatrixModule, ECLFinalizerModule, ECLSplitterN2Module, KKGenInputModule, BKLMAnaModule, SVDLocalCalibrationsCheckModule, SVDClusterEvaluationTrueInfoModule, TOPTriggerDigitizerModule, TrackingPerformanceEvaluationModule, SecMapTrainerVXDTFModule, TRGECLRawdataAnalysisModule, TRGTOPUnpackerModule, BgoDigitizerModule, CsiDigitizer_v2Module, DosiDigitizerModule, TPCStudyModule, PinDigitizerModule, ECLShowerCalibratorModule, MVAExpertModule, MVAMultipleExpertsModule, SVDLatencyCalibrationModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, EffPlotsModule, SecMapTrainerBaseModule, He3DigitizerModule, DQMHistAnalysisMonObjModule, DQMHistSnapshotsModule, ECLUnpackerModule, MCMatcherECLClustersModule, KlongValidationModule, TOPCosmicT0FinderModule, TrackQualityEstimatorMVAModule, BeamabortStudyModule, ClawStudyModule, ClawsStudyModule, PindiodeStudyModule, QcsmonitorStudyModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisHLTMonObjModule, IPDQMExpressRecoModule, PXDRawDQMChipsModule, SVDClusterCalibrationsMonitorModule, SVDMissingAPVsClusterCreatorModule, SectorMapBootstrapModule, CurlTaggerModule, BeamDigitizerModule, ECLPackerModule, EventLimiterModule, RandomBarrierModule, V0findingPerformanceEvaluationModule, DQMHistDeltaHistoModule, StatisticsSummaryModule, MVAPrototypeModule, DataWriterModule, SVDClusterFilterModule, SVDMaxStripTTreeModule, SVDShaperDigitsFromTracksModule, SVD3SamplesEmulatorModule, QualityEstimatorVXDModule, VXDQETrainingDataCollectorModule, MCMatcherTRGECLModule, TRGGDLModule, EventKinematicsModule, ClawDigitizerModule, ClawsDigitizerModule, ECLHitDebugModule, SubEventModule, SVDCoGTimeCalibrationsMonitorModule, SVDHotStripFinderModule, TOPLaserCalibratorModule, BeamSpotMonitorModule, TrackQETrainingDataCollectorModule, CDCTriggerNeuroDQMModule, TRGECLModule, FANGSStudyModule, QcsmonitorDigitizerModule, DQMHistAnalysisTOPModule, TOPChannelT0MCModule, B2BIIConvertBeamParamsModule, ProgressModule, TRGECLFAMModule, B2BIIMdstInputModule, CsiModule, CreateFieldMapModule, TRGGRLModule, DQMHistAnalysisSVDOnMiraBelleModule, Convert2RawDetModule, TRGGRLProjectsModule, TRGCDCModule, DQMHistAnalysisOutputMonObjModule, CosmicsAlignmentValidationModule, TRGCDCTSStreamModule, VXDMisalignmentModule, TreeFitterModule, DQMHistAnalysisInputModule, SwitchDataStoreModule, TRGECLQAMModule, TRGECLTimingCalModule, IoVDependentConditionModule, StatisticsTimingHLTDQMModule, PhysicsObjectsMiraBelleModule, KLMTriggerModule, cdcDQM7Module, DQMHistAnalysisInputSrvModule, SeqRootOutputModule, DQMHistAnalysisEventT0Module, DQMHistAnalysisSVDGeneralModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, HistoModule, TxModule, TRGGRLDQMModule, TRGGDLDQMModule, DQMHistAnalysisOutputNSMModule, DQMHistAnalysisPlotOnlyModule, DQMHistAnalysisSVDEfficiencyModule, RxModule, svdDumpModule, B2BIIMCParticlesMonitorModule, DQMHistAnalysisExampleModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisOutputFileModule, MCV0MatcherModule, TRGECLDQMModule, DQMHistAnalysisOutputModule, HistoManagerModule, SeqRootInputModule, TRGCDCT2DDQMModule, TRGCDCT3DDQMModule, TRGGDLSummaryModule, PhysicsObjectsDQMModule, TRGCDCTSFDQMModule, TRGGDLDSTModule, CalibrationCollectorModule, DQMHistAnalysisHLTModule, CDCTriggerUnpackerModule, ARICHBackgroundModule, TRGECLUnpackerModule, EvReductionModule, Raw2DsModule, RawInputModule, StorageDeserializerModule, BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, SerializerModule, FastRbuf2DsModule, Ds2SampleModule, DeSerializerPXDModule, Rbuf2RbufModule, Rbuf2DsModule, TxSocketModule, DqmHistoManagerModule, Ds2RawModule, Ds2RawFileModule, Ds2RbufModule, StorageSerializerModule, GetEventFromSocketModule, ReceiveEventModule, ElapsedTimeModule, GenRawSendModule, MonitorDataCOPPERModule, RxSocketModule, CertifyParallelModule, SeqRootMergerModule, DAQPerfModule, MonitorDataModule, TrackAnaModule, and PartialSeqRootReaderModule.

Definition at line 149 of file Module.h.

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 181 of file Module.cc.

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 441 of file Module.h.

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 422 of file Module.h.

◆ endRun()

virtual void endRun ( )
inlinevirtualinherited

This method is called if the current run ends.

Use this method to store information, which should be aggregated over one run.

This method can be implemented by subclasses.

Reimplemented in DQMHistAnalysisPXDTrackChargeModule, DQMHistOutputToEPICSModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisPXDChargeModule, PyModule, DQMHistComparitorModule, TrackSetEvaluatorHopfieldNNDEVModule, DQMHistAnalysisInputRootFileModule, AlignDQMModule, SVDUnpackerDQMModule, DQMHistAnalysisPXDERModule, vxdDigitMaskingModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisExampleFlagsModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGGRLUnpackerModule, TRGCDCETFUnpackerModule, TOPUnpackerModule, FindletModule< AFindlet >, FindletModule< FacetCreator >, FindletModule< TrackFinderAutomaton >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialStraightTrackFinder >, FindletModule< SegmentLinker >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentOrienter >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< CKFToSVDFindlet >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackRejecter >, FindletModule< SegmentCreatorMCTruth >, FindletModule< HitBasedT0Extractor >, FindletModule< TrackFinderCosmics >, FindletModule< SuperClusterCreator >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< TrackExporter >, FindletModule< ClusterPreparer >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< AxialTrackFinderHough >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackFinder >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< SegmentPairCreator >, FindletModule< HitReclaimer >, FindletModule< CKFToPXDFindlet >, FindletModule< TrackQualityEstimator >, FindletModule< StereoHitFinder >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< SegmentFitter >, FindletModule< SegmentRejecter >, FindletModule< WireHitPreparer >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTrackCombiner >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleStereoHitFinder >, FindletModule< TrackCombiner >, FindletModule< AxialSegmentPairCreator >, FindletModule< WireHitBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFindlet >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< TrackQualityAsserter >, FindletModule< WireHitCreator >, ECLWaveformFitModule, B2BIIConvertMdstModule, TOPTimeBaseCalibratorModule, TOPTBCComparatorModule, ECLChargedPIDModule, SVDBackgroundModule, ARICHNtupleModule, ECLDigitizerModule, BeamBkgTagSetterModule, TOPGainEfficiencyCalculatorModule, ECLShowerShapeModule, KLMClustersReconstructorModule, OpticalGunModule, ParticleKinematicFitterModule, PXDBackgroundModule, CDCDedxValidationModule, ARICHDigitizerModule, TOPDQMModule, CDCDQMModule, KLMDQMModule, TOPLaserHitSelectorModule, TOPModuleT0CalibratorModule, DQMHistAnalysisTRGGDLModule, BKLMDigitAnalyzerModule, TOPChannelT0CalibratorModule, TOPCommonT0CalibratorModule, KLMUnpackerModule, TOPRawDigitConverterModule, TOPReconstructorModule, ARICHFillHitsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisKLMModule, KLMReconstructorModule, CDCCRTestModule, KLMDigitizerModule, ECLDigitizerPureCsIModule, EKLMDataCheckerModule, ARICHReconstructorModule, ECLLocalRunCalibratorModule, KLMPackerModule, MdstPIDModule, FullSimModule, ARICHDQMModule, DQMHistAnalysisARICHModule, ECLCRFinderModule, TOPAlignerModule, TOPPDFDebuggerModule, ARICHPackerModule, BelleMCOutputModule, BeamBkgMixerModule, CDCPackerModule, TOPBackgroundModule, TOPPDFCheckerModule, ARICHRelateModule, BeamBkgHitRateMonitorModule, CsIDigitizerModule, DQMHistAnalysisMiraBelleModule, ARICHUnpackerModule, CDCUnpackerModule, ARICHMCParticlesModule, ARICHRateCalModule, CDCCosmicAnalysisModule, ECLShowerCorrectorModule, SVDCoGTimeEstimatorModule, SVDUnpackerModule, SVDROIFinderAnalysisModule, ECLDataAnalysisModule, EclDisplayModule, TOPDoublePulseGeneratorModule, TOPWaveformQualityPlotterModule, BGOverlayExecutorModule, ECLChargedPIDDataAnalysisValidationModule, ECLDigitCalibratorModule, ECLSplitterN1Module, EvtGenDecayModule, EKLMADCModule, SVDROIFinderModule, TRGGDLUnpackerModule, ARICHRawUnpackerModule, NtuplePhase1_v6Module, ECLDQMModule, TOPCalPulseGeneratorModule, TOPNtupleModule, TOPPackerModule, TOPWaveformFeatureExtractorModule, TrackFinderMCTruthRecoTracksModule, VXDTFTrainingDataCollectorModule, BeamBkgGeneratorModule, EventInfoPrinterModule, BKLMSimHistogrammerModule, KLMClusterEfficiencyModule, PXDPerformanceModule, TOPInterimFENtupleModule, TOPMCTrackMakerModule, VXDSimpleClusterizerModule, BGOverlayInputModule, TpcDigitizerModule, PIDNtupleModule, SPTCvirtualIPRemoverModule, arichBtestModule, ReprocessorModule, CsIStudyModule, ECLChargedPIDDataAnalysisModule, OverrideGenerationFlagsModule, MCMatcherKLMClustersModule, PrintDataModule, SPTCmomentumSeedRetrieverModule, TrackFinderVXDAnalizerModule, TRGGRLMatchModule, DQMHistAnalysisARICHMonObjModule, ECLLocalMaximumFinderModule, CDCDedxDQMModule, FANGSDigitizerModule, CDCRecoTrackFilterModule, ECLClusterPSDModule, SVDLocalCalibrationsMonitorModule, TOPTriggerDigitizerModule, ExtModule, MCTrackCandClassifierModule, MuidModule, HLTDQM2ZMQModule, DQMHistAnalysisECLModule, IPDQMExpressRecoModule, BKLMTrackingModule, TOPCosmicT0FinderModule, HitXPModule, TRGCDCT3DConverterModule, DQMHistAnalysisMonObjModule, ECLBackgroundModule, EventT0DQMModule, SVDDataFormatCheckModule, TRGTOPDQMModule, BgoStudyModule, CsiStudy_v2Module, MicrotpcStudyModule, PlumeDigitizerModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisHLTMonObjModule, PXDClustersFromTracksModule, SVDPackerModule, SVDClusterEvaluationTrueInfoModule, TOPXTalkChargeShareSetterModule, SecMapTrainerVXDTFModule, AnalysisPhase1StudyModule, DosiStudyModule, He3tubeStudyModule, ECLCovarianceMatrixModule, ECLDQMEXTENDEDModule, ECLFinalizerModule, ECLSplitterN2Module, MCMatcherECLClustersModule, BKLMAnaModule, SVDHotStripFinderModule, SVDPerformanceModule, SecMapTrainerBaseModule, NoKickCutsEvalModule, TRGECLRawdataAnalysisModule, TRGTOPUnpackerModule, BgoDigitizerModule, CsiDigitizer_v2Module, DosiDigitizerModule, TPCStudyModule, PinDigitizerModule, HLTDs2ZMQModule, DQMHistAnalysisInputPVSrvModule, ECLShowerCalibratorModule, SVDLatencyCalibrationModule, SVDOccupancyAnalysisModule, TOPLaserCalibratorModule, PXDROIFinderModule, KlongValidationModule, TrackingPerformanceEvaluationModule, MCMatcherTRGECLModule, BeamabortStudyModule, ClawStudyModule, ClawsStudyModule, PindiodeStudyModule, QcsmonitorStudyModule, ECLHitDebugModule, SVDClusterCalibrationsMonitorModule, TOPChannelT0MCModule, EffPlotsModule, CurlTaggerModule, BeamDigitizerModule, He3DigitizerModule, ECLUnpackerModule, StatisticsSummaryModule, DataWriterModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, SVDClusterFilterModule, SVDShaperDigitsFromTracksModule, SVD3SamplesEmulatorModule, RT2SPTCConverterModule, SVDROIDQMModule, TRGGDLModule, EventKinematicsModule, ClawDigitizerModule, ClawsDigitizerModule, DQMHistSnapshotsModule, ECLPackerModule, PrintEventRateModule, SVDCoGTimeCalibrationsMonitorModule, V0findingPerformanceEvaluationModule, TRGECLModule, CosmicsAlignmentValidationModule, FANGSStudyModule, QcsmonitorDigitizerModule, SectorMapBootstrapModule, CsiModule, DQMHistDeltaHistoModule, RandomBarrierModule, TRGGRLModule, GenfitVisModule, CDCTriggerNeuroDQMModule, TRGECLFAMModule, TRGGRLProjectsModule, B2BIIMdstInputModule, DQMHistAnalysisTOPModule, SubEventModule, TRGCDCModule, DQMHistAnalysisSVDOnMiraBelleModule, TRGCDCTSStreamModule, Convert2RawDetModule, DQMHistAnalysisOutputMonObjModule, TRGECLQAMModule, TRGECLTimingCalModule, MCV0MatcherModule, DQMHistAnalysisInputModule, cdcDQM7Module, SwitchDataStoreModule, PhysicsObjectsMiraBelleModule, HistoModule, TRGGRLDQMModule, KLMTriggerModule, DQMHistAnalysisEventT0Module, DQMHistAnalysisInputSrvModule, SeqRootOutputModule, TRGGDLDQMModule, DQMHistAnalysisSVDGeneralModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, TxModule, B2BIIMCParticlesMonitorModule, DQMHistAnalysisOutputNSMModule, DQMHistAnalysisPlotOnlyModule, DQMHistAnalysisSVDEfficiencyModule, RxModule, Root2BinaryModule, DQMHistAnalysisExampleModule, DQMHistAnalysisOutputRelayMsgModule, svdDumpModule, TRGECLDQMModule, DQMHistAnalysisOutputFileModule, TRGCDCT2DDQMModule, DQMHistAnalysisOutputModule, SeqRootInputModule, TRGCDCT3DDQMModule, TRGGDLSummaryModule, HistoManagerModule, TRGCDCTSFDQMModule, TRGGDLDSTModule, PhysicsObjectsDQMModule, CalibrationCollectorModule, ARICHBackgroundModule, TRGECLUnpackerModule, EvReductionModule, Raw2DsModule, RawInputModule, StorageDeserializerModule, BeamabortModule, BgoModule, CaveModule, ClawModule, CLAWSModule, DosiModule, FANGSModule, He3tubeModule, MicrotpcModule, Ph1bpipeModule, Ph1sustrModule, PindiodeModule, PlumeModule, QcsmonitorModule, SrsensorModule, SerializerModule, FastRbuf2DsModule, Ds2SampleModule, DeSerializerPXDModule, Rbuf2RbufModule, GenRawSendModule, Rbuf2DsModule, TxSocketModule, Ds2RawModule, Ds2RawFileModule, DqmHistoManagerModule, Ds2RbufModule, StorageSerializerModule, GetEventFromSocketModule, ReceiveEventModule, ElapsedTimeModule, MonitorDataCOPPERModule, Root2RawModule, RxSocketModule, CertifyParallelModule, SeqRootMergerModule, DAQPerfModule, MonitorDataModule, TrackAnaModule, and PartialSeqRootReaderModule.

Definition at line 168 of file Module.h.

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 98 of file Module.cc.

◆ event()

void event ( )
overridevirtual

Actual digitization of all hits in the CDC.

The digitized hits are written into the DataStore.

Reimplemented from Module.

Definition at line 248 of file CDCDigitizerModule.cc.

249 {
250  // Get SimHit array, MCParticle array, and relation between the two.
251  RelationArray mcParticlesToCDCSimHits(m_mcParticles, m_simHits); //RelationArray created by CDC SensitiveDetector
252 
253 
254  //--- Start Digitization --------------------------------------------------------------------------------------------
255  // Merge the hits in the same cell and save them into CDC signal map.
256 
257  // Define signal map
258  map<WireID, SignalInfo> signalMap;
259  map<WireID, SignalInfo>::iterator iterSignalMap;
260  // Define adc map
261  map<WireID, unsigned short> adcMap;
262  map<WireID, unsigned short>::iterator iterADCMap;
263  // map<WireID, double> adcMap;
264  // map<WireID, double>::iterator iterADCMap;
265 
266  // signal map for trigger
267  map<pair<WireID, unsigned>, SignalInfo> signalMapTrg;
268  map<pair<WireID, unsigned>, SignalInfo>::iterator iterSignalMapTrg;
269 
270  // Set trigger timing jitter for this event
271  double trigTiming = m_trigTimeJitter == 0. ? 0. : m_trigTimeJitter * (gRandom->Uniform() - 0.5);
272  // std::cout << "trigTiming= " << trigTiming << std::endl;
273  // Loop over all hits
274  int nHits = m_simHits.getEntries();
275  B2DEBUG(29, "Number of CDCSimHits in the current event: " << nHits);
276  for (int iHits = 0; iHits < nHits; ++iHits) {
277  // Get a hit
278  m_aCDCSimHit = m_simHits[iHits];
279 
280  // Hit geom. info
282  // B2DEBUG(29, "Encoded wire number of current CDCSimHit: " << m_wireID);
283 
286  // B2DEBUG(29, "m_boardID= " << m_boardID);
293 
294  //include alignment effects
295  //basically align flag should be always on since on/off is controlled by the input alignment.xml file itself.
296  m_align = true;
297 
298  TVector3 bwpAlign = m_cdcgp->wireBackwardPosition(m_wireID, CDCGeometryPar::c_Aligned);
299  TVector3 fwpAlign = m_cdcgp->wireForwardPosition(m_wireID, CDCGeometryPar::c_Aligned);
300 
301  TVector3 bwp = m_cdcgp->wireBackwardPosition(m_wireID);
302  TVector3 fwp = m_cdcgp->wireForwardPosition(m_wireID);
303 
304  //skip correction for wire-position alignment if unnecessary
305  if ((bwpAlign - bwp).Mag() == 0. && (fwpAlign - fwp).Mag() == 0.) m_align = false;
306  // std::cout << "a m_align= " << m_align << std::endl;
307 
308  if (m_align || m_correctForWireSag) {
309 
310  bwp = bwpAlign;
311  fwp = fwpAlign;
312 
313  if (m_correctForWireSag) {
314  double zpos = m_posWire.z();
315  double bckYSag = bwp.y();
316  double forYSag = fwp.y();
317 
318  // CDCGeometryPar::EWirePosition set = m_align ?
319  // CDCGeometryPar::c_Aligned : CDCGeometryPar::c_Base;
320  CDCGeometryPar::EWirePosition set = CDCGeometryPar::c_Aligned;
321  const int layerID = m_wireID.getICLayer();
322  const int wireID = m_wireID.getIWire();
323  m_cdcgp->getWireSagEffect(set, layerID, wireID, zpos, bckYSag, forYSag);
324  bwp.SetY(bckYSag);
325  fwp.SetY(forYSag);
326  }
327 
328  const TVector3 L = 5. * m_momentum.Unit(); //(cm) tentative
329  TVector3 posIn = m_posTrack - L;
330  TVector3 posOut = m_posTrack + L;
331  TVector3 posTrack = m_posTrack;
332  TVector3 posWire = m_posWire;
333 
334  // m_driftLength = m_cdcgp->ClosestApproach(bwp, fwp, posIn, posOut, posTrack, posWire);
335  m_driftLength = ClosestApproach(bwp, fwp, posIn, posOut, posTrack, posWire);
336  // std::cout << "base-dl, sag-dl, diff= " << m_aCDCSimHit->getDriftLength() <<" "<< m_driftLength <<" "<< m_driftLength - m_aCDCSimHit->getDriftLength() << std::endl;
337  m_posTrack = posTrack;
338  m_posWire = posWire;
339 
340  double deltaTime = 0.; //tentative (probably ok...)
341  // double deltaTime = (posTrack - m_posTrack).Mag() / speed;
342  m_flightTime += deltaTime;
343  m_globalTime += deltaTime;
345  }
346 
347  // Calculate measurement time.
348  // Smear drift length
349  double hitDriftLength = m_driftLength;
350  double dDdt = getdDdt(hitDriftLength);
351  if (m_doSmearing) {
352  hitDriftLength = smearDriftLength(hitDriftLength, dDdt);
353  }
354 
355  //set flags
356  bool addTof = m_addTimeOfFlight4Bg;
357  bool addDelay = m_addInWirePropagationDelay4Bg;
358  if (m_aCDCSimHit->getBackgroundTag() == 0) {
359  addTof = m_addTimeOfFlight;
360  addDelay = m_addInWirePropagationDelay;
361  }
362  double hitDriftTime = getDriftTime(hitDriftLength, addTof, addDelay);
363 
364  //add randamized event time for a beam bg. hit
365  if (m_aCDCSimHit->getBackgroundTag() != 0) {
366  hitDriftTime += m_globalTime - m_flightTime;
367  }
368 
369  //add trigger timing jitter
370  hitDriftTime += trigTiming;
371 
372  //apply time window cut
373  double tMin = m_tMin;
374  double tMax = m_tMaxOuter;
375  if (m_wireID.getISuperLayer() == 0) tMax = m_tMaxInner;
376  if (m_useDB4FEE) {
379  }
380  if (hitDriftTime < tMin || hitDriftTime > tMax) continue;
381 
382  //Sum ADC count
383  const double stepLength = m_aCDCSimHit->getStepLength() * Unit::cm;
384  const double costh = m_momentum.z() / m_momentum.Mag();
385  const double hitdE = m_scaleFac * m_aCDCSimHit->getEnergyDep();
386  // B2DEBUG(29, "m_scaleFac,UnitGeV= " << m_scaleFac <<" "<< Unit::GeV);
387  unsigned short layerID = m_wireID.getICLayer();
388  unsigned short cellID = m_wireID.getIWire();
389  // unsigned short adcCount = getADCCount(layerID, cellID, hitdE, stepLength, costh);
390  unsigned short adcCount = getADCCount(m_wireID, hitdE, stepLength, costh);
391  const unsigned short adcTh = m_useDB4FEE ? m_adcThresh[m_boardID] : m_adcThreshold;
392  // B2DEBUG(29, "adcTh,adcCount= " << adcTh <<" "<< adcCount);
393  if (adcCount < adcTh) adcCount = 0;
394  iterADCMap = adcMap.find(m_wireID);
395  if (iterADCMap == adcMap.end()) {
396  adcMap.insert(make_pair(m_wireID, adcCount));
397  // adcMap.insert(make_pair(m_wireID, hitdE));
398  } else {
399  iterADCMap->second += adcCount;
400  // iterADCMap->second += hitdE;
401  }
402 
403  //Apply energy threshold
404  // If hitdE < dEThreshold, the hit is ignored
405  // M. Uchida 2012.08.31
406  double dEThreshold = 0.;
408  dEThreshold = (m_tdcThresh[m_boardID] / m_cdcgp->getEDepToADCMainFactor(layerID, cellID)) * Unit::keV;
409  } else {
411  dEThreshold *= Unit::eV;
412  }
413  B2DEBUG(29, "hitdE,dEThreshold,driftLength " << hitdE << " " << dEThreshold << " " << hitDriftLength);
414 
415  if (hitdE < dEThreshold) {
416  B2DEBUG(29, "Below Ethreshold: " << hitdE << " " << dEThreshold);
417  continue;
418  }
419 
420  // add one hit per trigger time window to the trigger signal map
421  unsigned short trigWindow = floor((hitDriftTime - m_tMin) * m_tdcBinWidthInv / 32);
422  iterSignalMapTrg = signalMapTrg.find(make_pair(m_wireID, trigWindow));
423  if (iterSignalMapTrg == signalMapTrg.end()) {
424  // signalMapTrg.insert(make_pair(make_pair(m_wireID, trigWindow),
425  // SignalInfo(iHits, hitDriftTime, hitdE)));
426  signalMapTrg.insert(make_pair(make_pair(m_wireID, trigWindow),
427  SignalInfo(iHits, hitDriftTime, adcCount)));
428  } else {
429  if (hitDriftTime < iterSignalMapTrg->second.m_driftTime) {
430  iterSignalMapTrg->second.m_driftTime = hitDriftTime;
431  iterSignalMapTrg->second.m_simHitIndex = iHits;
432  }
433  // iterSignalMapTrg->second.m_charge += hitdE;
434  iterSignalMapTrg->second.m_charge += adcCount;
435  }
436 
437  // Reject totally-dead wire; to be replaced by isDeadWire() in future
438  if (m_cdcgp->isBadWire(m_wireID)) {
439  // std::cout<<"badwire= " << m_wireID.getICLayer() <<" "<< m_wireID.getIWire() << std::endl;
440  continue;
441  }
442  // Reject partly-dead wire as well
443  double eff = 1.;
444  if (m_cdcgp->isDeadWire(m_wireID, eff)) {
445  // std::cout << "wid,eff= " << m_wireID << " " << eff << std::endl;
446  if (eff < gRandom->Uniform()) continue;
447  }
448 
449  // For TOT simulation, calculate drift length from In to the wire, and Out to the wire. The calculation is apprximate ignoring wire sag (this would be ok because TOT simulation is not required to be so accurate).
450  const double a = bwpAlign.X();
451  const double b = bwpAlign.Y();
452  const double c = bwpAlign.Z();
453  const TVector3 fmbAlign = fwpAlign - bwpAlign;
454  const double lmn = 1. / fmbAlign.Mag();
455  const double l = fmbAlign.X() * lmn;
456  const double m = fmbAlign.Y() * lmn;
457  const double n = fmbAlign.Z() * lmn;
458 
459  double dx = m_aCDCSimHit->getPosIn().X() - a;
460  double dy = m_aCDCSimHit->getPosIn().Y() - b;
461  double dz = m_aCDCSimHit->getPosIn().Z() - c;
462  double sub = l * dx + m * dy + n * dz;
463  const double driftLFromIn = sqrt(dx * dx + dy * dy + dz * dz - sub * sub);
464 
465  dx = m_aCDCSimHit->getPosOut().X() - a;
466  dy = m_aCDCSimHit->getPosOut().Y() - b;
467  dz = m_aCDCSimHit->getPosOut().Z() - c;
468  sub = l * dx + m * dy + n * dz;
469  const double driftLFromOut = sqrt(dx * dx + dy * dy + dz * dz - sub * sub);
470 
471  const double maxDriftL = std::max(driftLFromIn, driftLFromOut);
472  const double minDriftL = m_driftLength;
473  B2DEBUG(29, "driftLFromIn= " << driftLFromIn << " driftLFromOut= " << driftLFromOut << " minDriftL= " << minDriftL << " maxDriftL= "
474  <<
475  maxDriftL << "m_driftLength= " << m_driftLength);
476 
477  iterSignalMap = signalMap.find(m_wireID);
478 
479  if (iterSignalMap == signalMap.end()) {
480  // new entry
481  // signalMap.insert(make_pair(m_wireID, SignalInfo(iHits, hitDriftTime, hitdE)));
482  signalMap.insert(make_pair(m_wireID, SignalInfo(iHits, hitDriftTime, adcCount, maxDriftL, minDriftL)));
483  B2DEBUG(29, "Creating new Signal with encoded wire number: " << m_wireID);
484  } else {
485  // ... smallest drift time has to be checked, ...
486  if (hitDriftTime < iterSignalMap->second.m_driftTime) {
487  iterSignalMap->second.m_driftTime3 = iterSignalMap->second.m_driftTime2;
488  iterSignalMap->second.m_simHitIndex3 = iterSignalMap->second.m_simHitIndex2;
489  iterSignalMap->second.m_driftTime2 = iterSignalMap->second.m_driftTime;
490  iterSignalMap->second.m_simHitIndex2 = iterSignalMap->second.m_simHitIndex;
491  iterSignalMap->second.m_driftTime = hitDriftTime;
492  iterSignalMap->second.m_simHitIndex = iHits;
493  B2DEBUG(29, "hitDriftTime of current Signal: " << hitDriftTime << ", hitDriftLength: " << hitDriftLength);
494  } else if (hitDriftTime < iterSignalMap->second.m_driftTime2) {
495  iterSignalMap->second.m_driftTime3 = iterSignalMap->second.m_driftTime2;
496  iterSignalMap->second.m_simHitIndex3 = iterSignalMap->second.m_simHitIndex2;
497  iterSignalMap->second.m_driftTime2 = hitDriftTime;
498  iterSignalMap->second.m_simHitIndex2 = iHits;
499  } else if (hitDriftTime < iterSignalMap->second.m_driftTime3) {
500  iterSignalMap->second.m_driftTime3 = hitDriftTime;
501  iterSignalMap->second.m_simHitIndex3 = iHits;
502  }
503  // ... total charge has to be updated.
504  // iterSignalMap->second.m_charge += hitdE;
505  iterSignalMap->second.m_charge += adcCount;
506 
507  // set max and min driftLs
508  if (iterSignalMap->second.m_maxDriftL < maxDriftL) iterSignalMap->second.m_maxDriftL = maxDriftL;
509  if (iterSignalMap->second.m_minDriftL > minDriftL) iterSignalMap->second.m_minDriftL = minDriftL;
510  B2DEBUG(29, "maxDriftL in struct= " << iterSignalMap->second.m_maxDriftL << "minDriftL in struct= " <<
511  iterSignalMap->second.m_minDriftL);
512  }
513 
514  } // end loop over SimHits.
515 
516  //--- Now Store the results into CDCHits and
517  // create corresponding relations between SimHits and CDCHits.
518 
519  unsigned int iCDCHits = 0;
520  RelationArray cdcSimHitsToCDCHits(m_simHits, m_cdcHits); //SimHit<->CDCHit
521  RelationArray mcParticlesToCDCHits(m_mcParticles, m_cdcHits); //MCParticle<->CDCHit
522 
523  for (iterSignalMap = signalMap.begin(); iterSignalMap != signalMap.end(); ++iterSignalMap) {
524 
525  //add time-walk (here for simplicity)
526  // unsigned short adcCount = getADCCount(iterSignalMap->second.m_charge);
527  // unsigned short adcCount = iterSignalMap->second.m_charge;
528  iterADCMap = adcMap.find(iterSignalMap->first);
529  unsigned short adcCount = iterADCMap != adcMap.end() ? iterADCMap->second : 0;
530  /*
531  unsigned short adcCount = 0;
532  if (iterADCMap != adcMap.end()) {
533  adcCount = getADCCount(iterSignalMap->first, iterADCMap->second, 1., 0.);
534  unsigned short boardID = m_cdcgp->getBoardID(iterSignalMap->first);
535  // B2DEBUG(29, "boardID= " << boardID);
536  const unsigned short adcTh = m_useDB4FEE ? m_adcThresh[boardID] : m_adcThreshold;
537  if (adcCount < adcTh) adcCount = 0;
538  }
539  */
540 
541  if (m_addTimeWalk) {
542  B2DEBUG(29, "timewalk= " << m_cdcgp->getTimeWalk(iterSignalMap->first, adcCount));
543  iterSignalMap->second.m_driftTime += m_cdcgp->getTimeWalk(iterSignalMap->first, adcCount);
544  }
545 
546  //remove negative drift time (TDC) upon request
548  iterSignalMap->second.m_driftTime < 0.) {
549  continue;
550  }
551 
552  //N.B. No bias (+ or -0.5 count) is introduced on average in digitization by the real TDC (info. from KEK electronics division). So round off (t0 - drifttime) below.
553  unsigned short tdcCount = static_cast<unsigned short>((m_cdcgp->getT0(iterSignalMap->first) - iterSignalMap->second.m_driftTime) *
554  m_tdcBinWidthInv + 0.5);
555 
556  //calculate tot; hard-coded currently
557  double deltaDL = iterSignalMap->second.m_maxDriftL - iterSignalMap->second.m_minDriftL;
558  if (deltaDL < 0.) {
559  B2DEBUG(29, "negative deltaDL= " << deltaDL);
560  deltaDL = 0.;
561  }
562  const unsigned short boardID = m_cdcgp->getBoardID(iterSignalMap->first);
563  unsigned short tot = std::min(std::round(5.92749 * deltaDL + 2.59706), static_cast<double>(m_widthOfTimeWindow[boardID]));
564  if (m_adcThresh[boardID] > 0) {
565  tot = std::min(static_cast<int>(tot), static_cast<int>(adcCount / m_adcThresh[boardID]));
566  }
567 
568  CDCHit* firstHit = m_cdcHits.appendNew(tdcCount, adcCount, iterSignalMap->first, 0, tot);
569  // std::cout <<"firsthit?= " << firstHit->is2ndHit() << std::endl;
570  //set a relation: CDCSimHit -> CDCHit
571  cdcSimHitsToCDCHits.add(iterSignalMap->second.m_simHitIndex, iCDCHits);
572 
573  //set a relation: MCParticle -> CDCHit
574  RelationVector<MCParticle> rels = m_simHits[iterSignalMap->second.m_simHitIndex]->getRelationsFrom<MCParticle>();
575  if (rels.size() != 0) {
576  //assumption: only one MCParticle
577  const MCParticle* mcparticle = rels[0];
578  double weight = rels.weight(0);
579  mcparticle->addRelationTo(firstHit, weight);
580  }
581 
582  //Set 2nd-hit related things if it exists
583  if (m_output2ndHit && iterSignalMap->second.m_simHitIndex2 >= 0) {
584  unsigned short tdcCount2 = static_cast<unsigned short>((m_cdcgp->getT0(iterSignalMap->first) - iterSignalMap->second.m_driftTime2) *
585  m_tdcBinWidthInv + 0.5);
586  if (tdcCount2 != tdcCount) {
587  CDCHit* secondHit = m_cdcHits.appendNew(tdcCount2, adcCount, iterSignalMap->first, 0, tot);
588  secondHit->set2ndHitFlag();
589  secondHit->setOtherHitIndices(firstHit);
590  // std::cout <<"2ndhit?= " << secondHit->is2ndHit() << std::endl;
591  // std::cout <<"1st-otherhitindex= " << firstHit->getOtherHitIndex() << std::endl;
592  // std::cout <<"2nd-otherhitindex= " << secondHit->getOtherHitIndex() << std::endl;
593  // secondHit->setOtherHitIndex(firstHit->getArrayIndex());
594  // firstHit->setOtherHitIndex(secondHit->getArrayIndex());
595  // std::cout <<"1st-otherhitindex= " << firstHit->getOtherHitIndex() << std::endl;
596  // std::cout <<"2nd-otherhitindex= " << secondHit->getOtherHitIndex() << std::endl;
597 
598  //set a relation: CDCSimHit -> CDCHit
599  ++iCDCHits;
600  cdcSimHitsToCDCHits.add(iterSignalMap->second.m_simHitIndex2, iCDCHits);
601  // std::cout << "settdc2 " << firstHit->getTDCCount() << " " << secondHit->getTDCCount() << std::endl;
602 
603  //set a relation: MCParticle -> CDCHit
604  rels = m_simHits[iterSignalMap->second.m_simHitIndex2]->getRelationsFrom<MCParticle>();
605  if (rels.size() != 0) {
606  //assumption: only one MCParticle
607  const MCParticle* mcparticle = rels[0];
608  double weight = rels.weight(0);
609  mcparticle->addRelationTo(secondHit, weight);
610  }
611  } else { //Check the 3rd hit when tdcCount = tdcCount2
612  // std::cout << "tdcCount1=2" << std::endl;
613  if (iterSignalMap->second.m_simHitIndex3 >= 0) {
614  unsigned short tdcCount3 = static_cast<unsigned short>((m_cdcgp->getT0(iterSignalMap->first) - iterSignalMap->second.m_driftTime3) *
615  m_tdcBinWidthInv + 0.5);
616  // std::cout << "tdcCount3= " << tdcCount3 << " " << tdcCount << std::endl;
617  if (tdcCount3 != tdcCount) {
618  CDCHit* secondHit = m_cdcHits.appendNew(tdcCount3, adcCount, iterSignalMap->first, 0, tot);
619  secondHit->set2ndHitFlag();
620  secondHit->setOtherHitIndices(firstHit);
621  // secondHit->setOtherHitIndex(firstHit->getArrayIndex());
622  // firstHit->setOtherHitIndex(secondHit->getArrayIndex());
623  // std::cout <<"2ndhit?= " << secondHit->is2ndHit() << std::endl;
624 
625  //set a relation: CDCSimHit -> CDCHit
626  ++iCDCHits;
627  cdcSimHitsToCDCHits.add(iterSignalMap->second.m_simHitIndex3, iCDCHits);
628  // std::cout << "settdc3 " << firstHit->getTDCCount() << " " << secondHit->getTDCCount() << std::endl;
629 
630  //set a relation: MCParticle -> CDCHit
631  rels = m_simHits[iterSignalMap->second.m_simHitIndex3]->getRelationsFrom<MCParticle>();
632  if (rels.size() != 0) {
633  //assumption: only one MCParticle
634  const MCParticle* mcparticle = rels[0];
635  double weight = rels.weight(0);
636  mcparticle->addRelationTo(secondHit, weight);
637  }
638  }
639  }
640  } //end of checking tdcCount 1=2 ?
641  } //end of 2nd hit setting
642 
643  // std::cout <<"t0= " << m_cdcgp->getT0(iterSignalMap->first) << std::endl;
644  /* unsigned short tdcInCommonStop = static_cast<unsigned short>((m_tdcOffset - iterSignalMap->second.m_driftTime) * m_tdcBinWidthInv);
645  float driftTimeFromTDC = static_cast<float>(m_tdcOffset - (tdcInCommonStop + 0.5)) * m_tdcBinWidth;
646  std::cout <<"driftT bf digitization, TDC in common stop, digitized driftT = " << iterSignalMap->second.m_driftTime <<" "<< tdcInCommonStop <<" "<< driftTimeFromTDC << std::endl;
647  */
648  ++iCDCHits;
649  }
650 
651  //Add crosstalk
652  if (m_addXTalk) addXTalk();
653 
654  // Store the results with trigger time window in a separate array
655  // with corresponding relations.
656  for (iterSignalMapTrg = signalMapTrg.begin(); iterSignalMapTrg != signalMapTrg.end(); ++iterSignalMapTrg) {
657  /*
658  unsigned short adcCount = getADCCount(iterSignalMapTrg->first.first, iterSignalMapTrg->second.m_charge, 1., 0.);
659  unsigned short boardID = m_cdcgp->getBoardID(iterSignalMapTrg->first.first);
660  // B2DEBUG(29, "boardID= " << boardID);
661  const unsigned short adcTh = m_useDB4FEE ? m_adcThresh[boardID] : m_adcThreshold;
662  if (adcCount < adcTh) adcCount = 0;
663  */
664  // unsigned short adcCount = getADCCount(iterSignalMapTrg->second.m_charge);
665  unsigned short adcCount = iterSignalMapTrg->second.m_charge;
666  unsigned short tdcCount =
667  static_cast<unsigned short>((m_cdcgp->getT0(iterSignalMapTrg->first.first) -
668  iterSignalMapTrg->second.m_driftTime) * m_tdcBinWidthInv + 0.5);
669  const CDCHit* cdcHit = m_cdcHits4Trg.appendNew(tdcCount, adcCount, iterSignalMapTrg->first.first);
670 
671  // relations
672  m_simHits[iterSignalMapTrg->second.m_simHitIndex]->addRelationTo(cdcHit);
673  RelationVector<MCParticle> rels = m_simHits[iterSignalMapTrg->second.m_simHitIndex]->getRelationsFrom<MCParticle>();
674  if (rels.size() != 0) {
675  //assumption: only one MCParticle
676  const MCParticle* mcparticle = rels[0];
677  double weight = rels.weight(0);
678  mcparticle->addRelationTo(cdcHit, weight);
679  }
680  }
681 
682  /*
683  std::cout << " " << std::endl;
684  RelationIndex<MCParticle, CDCHit> mcp_to_hit(mcParticles, cdcHits);
685  if (!mcp_to_hit) B2FATAL("No MCParticle -> CDCHit relation founf!");
686  typedef RelationIndex<MCParticle, CDCHit>::Element RelationElement;
687  int ncdcHits = cdcHits.getEntries();
688  for (int j = 0; j < ncdcHits; ++j) {
689  for (const RelationElement& rel : mcp_to_hit.getElementsTo(cdcHits[j])) {
690  std::cout << j << " " << cdcHits[j]->is2ndHit() <<" "<< rel.from->getIndex() << " " << rel.weight << std::endl;
691  }
692  }
693  */
694 }

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 135 of file Module.cc.

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).


Definition at line 115 of file Module.cc.

◆ getdDdt()

double getdDdt ( double  driftLength)
private

The method to get dD/dt.

In this method, X-T function will be used to calculate dD/dt (drift velocity).

Parameters
driftLengthThe value of drift length.
Returns
dDdt.

Definition at line 741 of file CDCDigitizerModule.cc.

◆ getDriftTime()

double getDriftTime ( double  driftLength,
bool  addTof,
bool  addDelay 
)
private

The method to get drift time based on drift length.

In this method, X-T function will be used to calculate drift time.

Parameters
driftLengthThe value of drift length.
addTofSwitch for adding time of flight.
addDelaySwitch for adding signal propagation delay in the wire.
Returns
Drift time.

Definition at line 787 of file CDCDigitizerModule.cc.

◆ getFileNames()

virtual std::vector<std::string> getFileNames ( __attribute__((unused)) bool  outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Definition at line 136 of file Module.h.

◆ getName()

const std::string& getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 189 of file Module.h.

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 281 of file Module.cc.

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 383 of file Module.h.

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 43 of file Module.cc.

◆ hasProperties()

bool hasProperties ( unsigned int  propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 162 of file Module.cc.

◆ if_false()

void if_false ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 87 of file Module.cc.

◆ if_true()

void if_true ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 92 of file Module.cc.

◆ if_value()

void if_value ( const std::string &  expression,
const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://confluence.desy.de/display/BI/Software+ModCondTut or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 81 of file Module.cc.

◆ setDescription()

void setDescription ( const std::string &  description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 216 of file Module.cc.

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 75 of file Module.cc.

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 216 of file Module.h.

◆ setParamPython()

void setParamPython ( const std::string &  name,
const boost::python::object &  pyObj 
)
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 236 of file Module.cc.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict &  dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 251 of file Module.cc.

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 210 of file Module.cc.

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 229 of file Module.cc.

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 222 of file Module.cc.

◆ setType()

void setType ( const std::string &  type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 50 of file Module.cc.

◆ smearDriftLength()

double smearDriftLength ( double  driftLength,
double  dDdt 
)
private

Method used to smear the drift length.

Parameters
driftLengthThe value of drift length.
fractionFraction of the first Gaussian used to smear drift length.
mean1Mean value of the first Gassian used to smear drift length.
resolution1Resolution of the first Gassian used to smear drift length.
mean2Mean value of the second Gassian used to smear drift length.
resolution2Resolution of the second Gassian used to smear drift length.
Returns
Drift length after smearing.

Definition at line 696 of file CDCDigitizerModule.cc.

Member Data Documentation

◆ m_fEElectronicsFromDB

DBArray<CDCFEElectronics>* m_fEElectronicsFromDB = nullptr
private

Pointer to FE electronics params.

from DB.

Definition at line 215 of file CDCDigitizerModule.h.

◆ m_gasToGasWire

double m_gasToGasWire
private

Approx.

ratio of dE(gas) to dE(gas+wire)

Definition at line 162 of file CDCDigitizerModule.h.

◆ m_inputCDCSimHitsName

std::string m_inputCDCSimHitsName
private

Input array name.


Definition at line 146 of file CDCDigitizerModule.h.

◆ m_mcParticles

StoreArray<MCParticle> m_mcParticles
private

Set edep-to-ADC conversion params.

(from DB) MCParticle array

Definition at line 141 of file CDCDigitizerModule.h.

◆ m_propSpeedInv

double m_propSpeedInv
private

Inv.

of nominal signal propagation speed in a wire (in ns/cm)

Definition at line 189 of file CDCDigitizerModule.h.

◆ m_useDB4EDepToADC

bool m_useDB4EDepToADC
private

Fetch edep-to-ADC conversion params.

from DB

Definition at line 222 of file CDCDigitizerModule.h.


The documentation for this class was generated from the following files:
Belle2::RelationVector::size
size_t size() const
Get number of relations.
Definition: RelationVector.h:98
Belle2::CDCDigitizerModule::smearDriftLength
double smearDriftLength(double driftLength, double dDdt)
Method used to smear the drift length.
Definition: CDCDigitizerModule.cc:696
Belle2::CDCSimHit::getFlightTime
double getFlightTime() const
The method to get flight time.
Definition: CDCSimHit.h:201
Belle2::Unit::cm
static const double cm
Standard units with the value = 1.
Definition: Unit.h:57
Belle2::CDCDigitizerModule::m_cdcgp
CDC::CDCGeometryPar * m_cdcgp
Cached Pointer to CDCGeometryPar.
Definition: CDCDigitizerModule.h:171
Belle2::CDCSimHit::getPosOut
TVector3 getPosOut() const
The method to get position of post-step.
Definition: CDCSimHit.h:228
Belle2::RelationArray
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:72
Belle2::CDCSimHit::getLeftRightPassageRaw
int getLeftRightPassageRaw() const
The method to get new left/right info. for digitization.
Definition: CDCSimHit.h:246
Belle2::CDCHit::setOtherHitIndices
void setOtherHitIndices(CDCHit *otherHit)
Setter for the other hit indices.
Definition: CDCHit.h:158
Belle2::CDCDigitizerModule::m_aCDCSimHit
CDCSimHit * m_aCDCSimHit
Pointer to CDCSimHit.
Definition: CDCDigitizerModule.h:173
Belle2::CDC::CDCGeometryPar::wireForwardPosition
const TVector3 wireForwardPosition(int layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
Definition: CDCGeometryPar.cc:1625
Belle2::CDCDigitizerModule::m_tMin
double m_tMin
Lower edge of time window in ns.
Definition: CDCDigitizerModule.h:165
Belle2::CDC::CDCGeometryPar::isDeadWire
bool isDeadWire(const WireID &wid, double &eff)
Inquire if the wire is dead.
Definition: CDCGeometryPar.h:853
Belle2::CDCSimHit::getPosTrack
TVector3 getPosTrack() const
The method to get position on the track.
Definition: CDCSimHit.h:234
Belle2::CDCDigitizerModule::m_outputNegativeDriftTime
bool m_outputNegativeDriftTime
A switch to output negative drift time to CDCHit.
Definition: CDCDigitizerModule.h:208
Belle2::CDCHit
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:51
Belle2::CDCDigitizerModule::m_posTrack
TVector3 m_posTrack
track position of this hit
Definition: CDCDigitizerModule.h:178
Belle2::WireID::getISuperLayer
unsigned short getISuperLayer() const
Getter for Super-Layer.
Definition: WireID.h:140
Belle2::CDCDigitizerModule::m_driftLength
double m_driftLength
drift length of this hit
Definition: CDCDigitizerModule.h:180
Belle2::CDCDigitizerModule::m_flightTime
double m_flightTime
flight time of this hit
Definition: CDCDigitizerModule.h:181
Belle2::CDCDigitizerModule::m_doSmearing
bool m_doSmearing
A switch to control drift length smearing.
Definition: CDCDigitizerModule.h:202
Belle2::CDCDigitizerModule::m_uprEdgeOfTimeWindow
float m_uprEdgeOfTimeWindow[nBoards]
Upper edge of time-window.
Definition: CDCDigitizerModule.h:217
Belle2::RelationsInterface::addRelationTo
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Definition: RelationsObject.h:144
Belle2::CDCDigitizerModule::m_momentum
TVector3 m_momentum
3-momentum of this hit
Definition: CDCDigitizerModule.h:179
Belle2::CDCDigitizerModule::m_widthOfTimeWindow
unsigned short m_widthOfTimeWindow[nBoards]
Width of time window.
Definition: CDCDigitizerModule.h:220
Belle2::CDC::CDCGeometryPar::getNewLeftRightRaw
unsigned short getNewLeftRightRaw(const TVector3 &posOnWire, const TVector3 &posOnTrack, const TVector3 &momentum) const
Returns new left/right_raw.
Definition: CDCGeometryPar.cc:2652
Belle2::CDCDigitizerModule::m_align
bool m_align
A switch to control alignment.
Definition: CDCDigitizerModule.h:210
Belle2::CDCDigitizerModule::m_tMaxOuter
double m_tMaxOuter
Upper edge of time window in ns for the outer layers.
Definition: CDCDigitizerModule.h:166
Belle2::CDCDigitizerModule::m_addTimeOfFlight4Bg
bool m_addTimeOfFlight4Bg
A switch used to control adding time of flight into the total drift time or not for beam bg.
Definition: CDCDigitizerModule.h:207
Belle2::CDCDigitizerModule::m_tdcThreshold4Outer
double m_tdcThreshold4Outer
TDC threshold for outer layers in unit of eV.
Definition: CDCDigitizerModule.h:160
Belle2::CDC::ClosestApproach
double ClosestApproach(const TVector3 &bwp, const TVector3 &fwp, const TVector3 &posIn, const TVector3 &posOut, TVector3 &hitPosition, TVector3 &wirePosition)
Returns a closest distance between a track and a wire.
Definition: ClosestApproach.cc:27
Belle2::CDCDigitizerModule::m_posWire
TVector3 m_posWire
wire position of this hit
Definition: CDCDigitizerModule.h:177
Belle2::CDCDigitizerModule::m_tdcBinWidthInv
double m_tdcBinWidthInv
m_tdcBinWidth^-1 (in ns^-1)
Definition: CDCDigitizerModule.h:185
Belle2::CDC::CDCGeometryPar::getEDepToADCMainFactor
double getEDepToADCMainFactor(unsigned short layer, unsigned short cell)
Return edep-to-ADC conversion main factor (in count/keV)
Definition: CDCGeometryPar.h:280
Belle2::CDCDigitizerModule::m_addInWirePropagationDelay4Bg
bool m_addInWirePropagationDelay4Bg
A switch used to control adding propagation delay into the total drift time or not for beam bg.
Definition: CDCDigitizerModule.h:206
Belle2::CDCDigitizerModule::m_useDB4EDepToADC
bool m_useDB4EDepToADC
Fetch edep-to-ADC conversion params.
Definition: CDCDigitizerModule.h:222
Belle2::CDCDigitizerModule::m_globalTime
double m_globalTime
global time of this hit
Definition: CDCDigitizerModule.h:182
Belle2::CDCDigitizerModule::getdDdt
double getdDdt(double driftLength)
The method to get dD/dt.
Definition: CDCDigitizerModule.cc:741
Belle2::CDCDigitizerModule::m_mcParticles
StoreArray< MCParticle > m_mcParticles
Set edep-to-ADC conversion params.
Definition: CDCDigitizerModule.h:141
Belle2::CDCDigitizerModule::m_adcThresh
float m_adcThresh[nBoards]
Threshold for FADC.
Definition: CDCDigitizerModule.h:219
Belle2::CDCDigitizerModule::m_addInWirePropagationDelay
bool m_addInWirePropagationDelay
A switch used to control adding propagation delay into the total drift time or not.
Definition: CDCDigitizerModule.h:204
Belle2::Unit::keV
static const double keV
[kiloelectronvolt]
Definition: Unit.h:123
Belle2::Unit::eV
static const double eV
[electronvolt]
Definition: Unit.h:122
Belle2::CDCDigitizerModule::addXTalk
void addXTalk()
Add crosstalk.
Definition: CDCDigitizerModule.cc:940
Belle2::CDCDigitizerModule::m_useDB4FEE
bool m_useDB4FEE
Fetch FEE params from DB.
Definition: CDCDigitizerModule.h:214
Belle2::CDCDigitizerModule::m_adcThreshold
int m_adcThreshold
Threshold for ADC in unit of count.
Definition: CDCDigitizerModule.h:164
Belle2::CDC::CDCGeometryPar::isBadWire
bool isBadWire(const WireID &wid)
Inquire if the wire is totally-dead.
Definition: CDCGeometryPar.h:840
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2::CDC::CDCGeometryPar::wireBackwardPosition
const TVector3 wireBackwardPosition(int layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
Definition: CDCGeometryPar.cc:1662
Belle2::CDCDigitizerModule::m_cdcHits
StoreArray< CDCHit > m_cdcHits
CDCHit array.
Definition: CDCDigitizerModule.h:143
Belle2::CDCDigitizerModule::m_addXTalk
bool m_addXTalk
Flag to switch on/off crosstalk.
Definition: CDCDigitizerModule.h:230
Belle2::CDCDigitizerModule::m_addTimeWalk
bool m_addTimeWalk
A switch used to control adding time-walk delay into the total drift time or not.
Definition: CDCDigitizerModule.h:203
Belle2::CDCDigitizerModule::m_addTimeOfFlight
bool m_addTimeOfFlight
A switch used to control adding time of flight into the total drift time or not.
Definition: CDCDigitizerModule.h:205
Belle2::CDCHit::set2ndHitFlag
void set2ndHitFlag()
Setter for 2nd hit flag.
Definition: CDCHit.h:124
Belle2::CDC::CDCGeometryPar::getBoardID
unsigned short getBoardID(const WireID &wID) const
Returns frontend board id. corresponding to the wire id.
Definition: CDCGeometryPar.h:576
Belle2::CDCDigitizerModule::m_simHits
StoreArray< CDCSimHit > m_simHits
CDCSimHit array.
Definition: CDCDigitizerModule.h:142
Belle2::CDCDigitizerModule::m_scaleFac
double m_scaleFac
Factor to mutiply to edep.
Definition: CDCDigitizerModule.h:163
Belle2::CDCSimHit::getGlobalTime
float getGlobalTime() const override
The method to get global time.
Definition: CDCSimHit.h:265
Belle2::CDCSimHit::getDriftLength
double getDriftLength() const
The method to get drift length.
Definition: CDCSimHit.h:198
Belle2::CDCDigitizerModule::getADCCount
unsigned short getADCCount(const WireID &wid, double edep, double dx, double costh)
Edep to ADC Count converter.
Definition: CDCDigitizerModule.cc:854
Belle2::CDCDigitizerModule::getDriftTime
double getDriftTime(double driftLength, bool addTof, bool addDelay)
The method to get drift time based on drift length.
Definition: CDCDigitizerModule.cc:787
Belle2::CDCSimHit::getPosIn
TVector3 getPosIn() const
The method to get position of pre-step.
Definition: CDCSimHit.h:222
Belle2::CDCSimHit::getPosWire
TVector3 getPosWire() const
The method to get position on wire.
Definition: CDCSimHit.h:216
Belle2::CDC::CDCGeometryPar::getT0
float getT0(const WireID &wireID) const
Returns t0 parameter of the specified sense wire.
Definition: CDCGeometryPar.h:565
Belle2::CDCDigitizerModule::m_boardID
unsigned short m_boardID
FEE board ID.
Definition: CDCDigitizerModule.h:176
Belle2::CDC::CDCGeometryPar::EWirePosition
EWirePosition
Wire position set.
Definition: CDCGeometryPar.h:80
Belle2::RelationVector::weight
float weight(int index) const
Get weight with index.
Definition: RelationVector.h:120
Belle2::SimHitBase::getBackgroundTag
virtual unsigned short getBackgroundTag() const
Get background tag.
Definition: SimHitBase.h:56
Belle2::CDCDigitizerModule::m_tdcThresh
float m_tdcThresh[nBoards]
Threshold for timing-signal.
Definition: CDCDigitizerModule.h:218
Belle2::CDCDigitizerModule::m_lowEdgeOfTimeWindow
float m_lowEdgeOfTimeWindow[nBoards]
Lower edge of time-window.
Definition: CDCDigitizerModule.h:216
Belle2::CDC::CDCGeometryPar::getWireSagEffect
void getWireSagEffect(EWirePosition set, unsigned layerID, unsigned cellID, double zw, double &ywb_sag, double &ywf_sag) const
Compute effects of the sense wire sag.
Definition: CDCGeometryPar.cc:1858
Belle2::CDCSimHit::getMomentum
TVector3 getMomentum() const
The method to get momentum.
Definition: CDCSimHit.h:210
Belle2::CDCDigitizerModule::m_tMaxInner
double m_tMaxInner
Upper edge of time window in ns for the inner layers.
Definition: CDCDigitizerModule.h:167
Belle2::CDCDigitizerModule::m_wireID
WireID m_wireID
WireID of this hit.
Definition: CDCDigitizerModule.h:174
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::CDC::CDCGeometryPar::getTimeWalk
double getTimeWalk(const WireID &wID, unsigned short adcCount) const
Returns time-walk.
Definition: CDCGeometryPar.h:612
Belle2::CDCDigitizerModule::m_trigTimeJitter
double m_trigTimeJitter
Magnitude of trigger timing jitter (ns).
Definition: CDCDigitizerModule.h:169
Belle2::CDCSimHit::getEnergyDep
double getEnergyDep() const
The method to get deposited energy.
Definition: CDCSimHit.h:204
Belle2::CDCDigitizerModule::m_output2ndHit
bool m_output2ndHit
A switch to output 2nd hit.
Definition: CDCDigitizerModule.h:209
Belle2::WireID::getIWire
unsigned short getIWire() const
Getter for wire within the layer.
Definition: WireID.h:155
Belle2::CDCDigitizerModule::m_tdcThreshold4Inner
double m_tdcThreshold4Inner
TDC threshold for inner layers in unit of eV.
Definition: CDCDigitizerModule.h:161
Belle2::WireID::getICLayer
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition: WireID.cc:26
Belle2::CDCSimHit::getWireID
WireID getWireID() const
Getter for WireID object.
Definition: CDCSimHit.h:189
Belle2::CDCSimHit::getStepLength
double getStepLength() const
The method to get step length.
Definition: CDCSimHit.h:207
Belle2::CDCDigitizerModule::m_posFlag
unsigned short m_posFlag
left or right flag of this hit
Definition: CDCDigitizerModule.h:175
Belle2::CDCDigitizerModule::m_cdcHits4Trg
StoreArray< CDCHit > m_cdcHits4Trg
CDCHit4trg array.
Definition: CDCDigitizerModule.h:144
Belle2::CDCDigitizerModule::m_correctForWireSag
bool m_correctForWireSag
A switch to control wire sag.
Definition: CDCDigitizerModule.h:211