Belle II Software  release-05-02-19
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.
 
double getPositiveT0 (const WireID &)
 Modify t0 for negative-t0 case.
 
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_treatNegT0WiresAsGood
 A switch for negative-t0 wires.
 
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, DQMHistAnalysisSVDDoseModule, SVDDQMInjectionModule, PXDDQMEfficiencySelftrackModule, DQMHistComparitorModule, PXDDQMEfficiencyModule, PyModule, PXDGatedDHCDQMModule, SVDDQMDoseModule, PXDROIFinderAnalysisModule, AlignDQMModule, SVDDQMExpressRecoModule, DQMHistAnalysisInputRootFileModule, SVDDQMClustersOnTrackModule, SVDUnpackerDQMModule, TrackDQMModule, PXDTrackClusterDQMModule, PXDRawDQMModule, PXDclusterFilterModule, PXDdigiFilterModule, DQMHistAnalysisPXDERModule, PXDDQMCorrModule, PXDROIDQMModule, PXDDQMExpressRecoModule, DelayDQMModule, PXDDQMClustersModule, VXDDQMExpressRecoModule, vxdDigitMaskingModule, PXDRawDQMCorrModule, DAQMonitorModule, DQMHistAnalysisIPModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisExampleFlagsModule, V0ObjectsDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGGRLUnpackerModule, TRGCDCETFUnpackerModule, MaterialScanModule, TOPUnpackerModule, B2BIIConvertMdstModule, ECLWaveformFitModule, FindletModule< AFindlet >, FindletModule< FacetCreator >, FindletModule< TrackFinderAutomaton >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< CKFToCDCFindlet >, 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< TrackFinderCosmics >, FindletModule< SuperClusterCreator >, FindletModule< HitBasedT0Extractor >, 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< TrackQualityEstimator >, FindletModule< CKFToPXDFindlet >, 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, KLMDQMModule, CDCDedxValidationModule, TOPDQMModule, CDCDQMModule, TOPDigitizerModule, TOPLaserHitSelectorModule, DQMHistAnalysisKLMModule, BKLMDigitAnalyzerModule, TOPModuleT0CalibratorModule, DQMHistAnalysisTRGGDLModule, GearboxModule, KLMUnpackerModule, TOPChannelT0CalibratorModule, TOPCommonT0CalibratorModule, ParticleVertexFitterModule, 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, CDCUnpackerModule, ECLSplitterN1Module, PXDPerformanceModule, TOPPDFCheckerModule, ARICHRelateModule, CsIStudyModule, CDCPackerModule, DQMHistAnalysisMiraBelleModule, ECLDigitCalibratorModule, ECLDQMEXTENDEDModule, TOPPDFDebuggerModule, ARICHUnpackerModule, BKLMSimHistogrammerModule, SVDROIFinderAnalysisModule, VXDTFTrainingDataCollectorModule, ARICHMCParticlesModule, ARICHRateCalModule, TOPBackgroundModule, TOPTimeRecalibratorModule, TrackFinderMCTruthRecoTracksModule, ReprocessorModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, EclDisplayModule, EvtGenDecayModule, EKLMADCModule, SVDDQMHitTimeModule, TOPDoublePulseGeneratorModule, SVDROIFinderModule, TRGCDCT3DConverterModule, TRGGRLMatchModule, BGOverlayExecutorModule, DQMHistAnalysisECLModule, ECLLocalMaximumFinderModule, SoftwareTriggerHLTDQMModule, SVDPackerModule, TOPBunchFinderModule, VXDSimpleClusterizerModule, ARICHRawUnpackerModule, NtuplePhase1_v6Module, TpcDigitizerModule, ExportGeometryModule, 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, 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, ECLUnpackerModule, MVAExpertModule, MVAMultipleExpertsModule, SVDLatencyCalibrationModule, SVDB4CommissioningPlotsModule, SVDClusterEvaluationModule, EffPlotsModule, SecMapTrainerBaseModule, He3DigitizerModule, DQMHistAnalysisMonObjModule, DQMHistSnapshotsModule, 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, TRGGDLDQMModule, VXDMisalignmentModule, TreeFitterModule, DQMHistAnalysisInputModule, SwitchDataStoreModule, TRGECLQAMModule, TRGECLTimingCalModule, IoVDependentConditionModule, StatisticsTimingHLTDQMModule, PhysicsObjectsMiraBelleModule, KLMTriggerModule, cdcDQM7Module, DQMHistAnalysisInputSrvModule, SeqRootOutputModule, DQMHistAnalysisEventT0Module, DQMHistAnalysisSVDGeneralModule, PhysicsObjectsMiraBelleDst2Module, PhysicsObjectsMiraBelleDstModule, HistoModule, TxModule, TRGGRLDQMModule, 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, DQMHistAnalysisSVDDoseModule, 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< CKFToSVDSeedFindlet >, FindletModule< CKFToCDCFindlet >, 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< TrackFinderCosmics >, FindletModule< SuperClusterCreator >, FindletModule< HitBasedT0Extractor >, 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< TrackQualityEstimator >, FindletModule< CKFToPXDFindlet >, 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, KLMDQMModule, TOPDQMModule, CDCDQMModule, TOPLaserHitSelectorModule, TOPModuleT0CalibratorModule, DQMHistAnalysisKLMModule, DQMHistAnalysisTRGGDLModule, BKLMDigitAnalyzerModule, TOPChannelT0CalibratorModule, TOPCommonT0CalibratorModule, KLMUnpackerModule, TOPRawDigitConverterModule, TOPReconstructorModule, ARICHFillHitsModule, DQMHistAnalysisCDCMonObjModule, KLMReconstructorModule, CDCCRTestModule, KLMDigitizerModule, ECLDigitizerPureCsIModule, EKLMDataCheckerModule, ARICHReconstructorModule, ECLLocalRunCalibratorModule, KLMPackerModule, MdstPIDModule, FullSimModule, ARICHDQMModule, CDCUnpackerModule, DQMHistAnalysisARICHModule, ECLCRFinderModule, TOPAlignerModule, TOPPDFDebuggerModule, ARICHPackerModule, BelleMCOutputModule, BeamBkgMixerModule, CDCPackerModule, TOPBackgroundModule, TOPPDFCheckerModule, ARICHRelateModule, BeamBkgHitRateMonitorModule, CsIDigitizerModule, DQMHistAnalysisMiraBelleModule, ARICHUnpackerModule, 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, ECLDQMEXTENDEDModule, 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, 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, ECLUnpackerModule, SVDClusterCalibrationsMonitorModule, TOPChannelT0MCModule, EffPlotsModule, CurlTaggerModule, BeamDigitizerModule, He3DigitizerModule, 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, TRGGDLDQMModule, DQMHistAnalysisOutputMonObjModule, TRGECLQAMModule, TRGECLTimingCalModule, MCV0MatcherModule, DQMHistAnalysisInputModule, cdcDQM7Module, SwitchDataStoreModule, PhysicsObjectsMiraBelleModule, HistoModule, TRGGRLDQMModule, KLMTriggerModule, DQMHistAnalysisEventT0Module, DQMHistAnalysisInputSrvModule, SeqRootOutputModule, 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 250 of file CDCDigitizerModule.cc.

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

◆ 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 743 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 789 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 698 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 219 of file CDCDigitizerModule.h.

◆ m_gasToGasWire

double m_gasToGasWire
private

Approx.

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

Definition at line 165 of file CDCDigitizerModule.h.

◆ m_inputCDCSimHitsName

std::string m_inputCDCSimHitsName
private

Input array name.


Definition at line 149 of file CDCDigitizerModule.h.

◆ m_mcParticles

StoreArray<MCParticle> m_mcParticles
private

Set edep-to-ADC conversion params.

(from DB) MCParticle array

Definition at line 144 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 192 of file CDCDigitizerModule.h.

◆ m_useDB4EDepToADC

bool m_useDB4EDepToADC
private

Fetch edep-to-ADC conversion params.

from DB

Definition at line 226 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:698
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:174
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:176
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:168
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:211
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:181
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:183
Belle2::CDCDigitizerModule::m_flightTime
double m_flightTime
flight time of this hit
Definition: CDCDigitizerModule.h:184
Belle2::CDCDigitizerModule::m_doSmearing
bool m_doSmearing
A switch to control drift length smearing.
Definition: CDCDigitizerModule.h:205
Belle2::CDCDigitizerModule::m_uprEdgeOfTimeWindow
float m_uprEdgeOfTimeWindow[nBoards]
Upper edge of time-window.
Definition: CDCDigitizerModule.h:221
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:182
Belle2::CDCDigitizerModule::m_widthOfTimeWindow
unsigned short m_widthOfTimeWindow[nBoards]
Width of time window.
Definition: CDCDigitizerModule.h:224
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:213
Belle2::CDCDigitizerModule::m_tMaxOuter
double m_tMaxOuter
Upper edge of time window in ns for the outer layers.
Definition: CDCDigitizerModule.h:169
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:210
Belle2::CDCDigitizerModule::m_tdcThreshold4Outer
double m_tdcThreshold4Outer
TDC threshold for outer layers in unit of eV.
Definition: CDCDigitizerModule.h:163
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:180
Belle2::CDCDigitizerModule::m_tdcBinWidthInv
double m_tdcBinWidthInv
m_tdcBinWidth^-1 (in ns^-1)
Definition: CDCDigitizerModule.h:188
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:209
Belle2::CDCDigitizerModule::m_useDB4EDepToADC
bool m_useDB4EDepToADC
Fetch edep-to-ADC conversion params.
Definition: CDCDigitizerModule.h:226
Belle2::CDCDigitizerModule::m_globalTime
double m_globalTime
global time of this hit
Definition: CDCDigitizerModule.h:185
Belle2::CDCDigitizerModule::getdDdt
double getdDdt(double driftLength)
The method to get dD/dt.
Definition: CDCDigitizerModule.cc:743
Belle2::CDCDigitizerModule::m_mcParticles
StoreArray< MCParticle > m_mcParticles
Set edep-to-ADC conversion params.
Definition: CDCDigitizerModule.h:144
Belle2::CDCDigitizerModule::m_adcThresh
float m_adcThresh[nBoards]
Threshold for FADC.
Definition: CDCDigitizerModule.h:223
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:207
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:942
Belle2::CDCDigitizerModule::m_useDB4FEE
bool m_useDB4FEE
Fetch FEE params from DB.
Definition: CDCDigitizerModule.h:218
Belle2::CDCDigitizerModule::m_adcThreshold
int m_adcThreshold
Threshold for ADC in unit of count.
Definition: CDCDigitizerModule.h:167
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:146
Belle2::CDCDigitizerModule::m_addXTalk
bool m_addXTalk
Flag to switch on/off crosstalk.
Definition: CDCDigitizerModule.h:234
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:206
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:208
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:145
Belle2::CDCDigitizerModule::m_scaleFac
double m_scaleFac
Factor to mutiply to edep.
Definition: CDCDigitizerModule.h:166
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:856
Belle2::CDCDigitizerModule::getDriftTime
double getDriftTime(double driftLength, bool addTof, bool addDelay)
The method to get drift time based on drift length.
Definition: CDCDigitizerModule.cc:789
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::CDCDigitizerModule::m_boardID
unsigned short m_boardID
FEE board ID.
Definition: CDCDigitizerModule.h:179
Belle2::CDC::CDCGeometryPar::EWirePosition
EWirePosition
Wire position set.
Definition: CDCGeometryPar.h:80
Belle2::CDCDigitizerModule::getPositiveT0
double getPositiveT0(const WireID &)
Modify t0 for negative-t0 case.
Definition: CDCDigitizerModule.cc:1098
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:222
Belle2::CDCDigitizerModule::m_lowEdgeOfTimeWindow
float m_lowEdgeOfTimeWindow[nBoards]
Lower edge of time-window.
Definition: CDCDigitizerModule.h:220
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:170
Belle2::CDCDigitizerModule::m_wireID
WireID m_wireID
WireID of this hit.
Definition: CDCDigitizerModule.h:177
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:172
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:212
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:164
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:178
Belle2::CDCDigitizerModule::m_cdcHits4Trg
StoreArray< CDCHit > m_cdcHits4Trg
CDCHit4trg array.
Definition: CDCDigitizerModule.h:147
Belle2::CDCDigitizerModule::m_correctForWireSag
bool m_correctForWireSag
A switch to control wire sag.
Definition: CDCDigitizerModule.h:214