Belle II Software  release-08-01-10
top modules
Collaboration diagram for top modules:

Classes

class  TOPAlignmentCollectorModule
 Collector for geometrical alignment of a TOP module with dimuons or Bhabhas. More...
 
class  TOPAsicShiftsBS13dCollectorModule
 Collector for carrier shifts of BS13d. More...
 
class  TOPChannelMaskCollectorModule
 Collector for preparing masks of hot and dead channels. More...
 
class  TOPCommonT0BFCollectorModule
 Collector for common T0 calibration with a fit of bunch finder residuals (method BF) More...
 
class  TOPCommonT0LLCollectorModule
 Collector for common T0 calibration with neg. More...
 
class  TOPModuleT0DeltaTCollectorModule
 Collector for module T0 calibration with chi2 minimization of time differences between slots (method DeltaT). More...
 
class  TOPModuleT0LLCollectorModule
 Collector for module T0 calibration with neg. More...
 
class  TOPOffsetCollectorModule
 Collector for eventT0 and fill pattern offset calibrations. More...
 
class  TOPPhotonYieldsCollectorModule
 Collector for photon pixel yields aimed for PMT ageing studies and for finding optically decoupled PMT's. More...
 
class  TOPPulseHeightCollectorModule
 Collector for channel pulse-height distributions. More...
 
class  TOPValidationCollectorModule
 Collector for automatic validation of calibration with dimuon events. More...
 
class  OpticalGunModule
 Source of optical photons for the simulation of the TOP laser system. More...
 
class  TOPAlignerModule
 Alignment of TOP. More...
 
class  TOPBackgroundModule
 TOP backgound module. More...
 
class  TOPBunchFinderModule
 Bunch finder: searches for the bunch crossing where the interaction happened using track-based TOP likelihood. More...
 
class  TOPChannelMaskerModule
 Masks dead PMs from the reconstruction. More...
 
class  TOPChannelT0CalibratorModule
 A module for alternative channel T0 calibration with collision data Note: after this kind of calibration one cannot do the geometrical alignment This module can also be used to check the calibration. More...
 
class  TOPChannelT0MCModule
 TOP Channel T0 MC Extraction module (under development) More...
 
class  TOPCommonT0CalibratorModule
 A module for common T0 calibration with collision data (dimuons or bhabhas) More...
 
class  TOPCosmicT0FinderModule
 Event T0 finder for global cosmic runs. More...
 
class  TOPDigitizerModule
 TOP digitizer. More...
 
class  TOPTriggerDigitizerModule
 Digitizer that provides time stamps for TOP trigger. More...
 
class  TOPCalPulseGeneratorModule
 Generator of calibration pulses Output to TOPSimCalPulses. More...
 
class  TOPDoublePulseGeneratorModule
 Generator of double calibration pulses Output to TOPDigits. More...
 
class  TOPDQMModule
 TOP DQM histogrammer. More...
 
class  TOPGainEfficiencyCalculatorModule
 Module for channel-by-channel gain/efficiency analysis. More...
 
class  TOPLaserHitSelectorModule
 Module for pixel-by-pixel gain/efficiency analysis. More...
 
class  TOPGeometryParInitializerModule
 Class for initializing TOPGeometryPar. More...
 
class  TOPInterimFENtupleModule
 Module to produce ntuple from TOPDigits and TOPRawDigits. More...
 
class  TOPLaserCalibratorModule
 T0 Laser calibration module (under development) More...
 
class  TOPLaserCalibratorCollectorModule
 Collector module for the TOP channelT0 calibration and, more in general, for the time resolution studies using the laser and pulser data. More...
 
class  TOPLLScannerModule
 A module to perform the TOP PID likelihood scan and find the actual minimum as function of the mass. More...
 
class  TOPMCTrackMakerModule
 Constructs Tracks and ExtHits from MCParticles and TOPBarHits Utility needed for testing and debugging of TOP reconstruction. More...
 
class  TOPModuleT0CalibratorModule
 A module for module T0 calibration with collision data (dimuons or bhabhas) Useful when the geometrical alignment need not to be repeated. More...
 
class  TOPNtupleModule
 Module to write out a ntuple summarizing TOP reconstruction output. More...
 
class  TOPPackerModule
 Raw data packer. More...
 
class  TOPPDFCheckerModule
 Module for checking analytic PDF used in likelihood calculation. More...
 
class  TOPPDFDebuggerModule
 TOP reconstruction module. More...
 
class  TOPRawDigitConverterModule
 TOPRawDigits to TOPDigits converter. More...
 
class  TOPReconstructorModule
 TOP reconstruction module. More...
 
class  TOPRingPlotterModule
 A module to plot the x-t images from TOP, and in general study the distribution of the digits associated to the particles in a particleList. More...
 
class  TOPTBCComparatorModule
 Module for the comparison of different sets of time base correction (TBC) constants and to produce monitoring plots out of a given set. More...
 
struct  Hit
 Structure to hold some of the calpulse data. More...
 
struct  TwoTimes
 Structure to hold calpulse raw times expressed in samples since sample 0 of window 0. More...
 
class  TOPTimeBaseCalibratorModule
 Time base calibrator. More...
 
class  TOPTimeRecalibratorModule
 Utility module for re-calibrating time of TOPDigits pulseWidth and timeError are not changed although they may depend no calibration! More...
 
class  TOPUnpackerModule
 Raw data unpacker. More...
 
class  TOPWaveformFeatureExtractorModule
 Waveform feature extractor: module adds rawDigits that are found in waveforms by feature extraction but are not already present in RawDigits. More...
 
class  TOPWaveformQualityPlotterModule
 Plots and histograms of waveforms and feature extracted parameters. More...
 
class  TOPXTalkChargeShareSetterModule
 Crosstalk & chargeshare flag setter. More...
 

Enumerations

enum  {
  c_NChannelPerAsic = 8 ,
  c_NModule = 16 ,
  c_NChannelPerPMT = 16 ,
  c_NChannelPerPMTRow = 4 ,
  c_NPMTPerRow = 16 ,
  c_NPMTPerModule = 32 ,
  c_NPixelPerRow = 64 ,
  c_NPixelPerModule = 512
}
 enum for maximum number of array elements (# of hits per event)
 

Functions

 REG_MODULE (TOPAlignmentCollector)
 Register module.
 
 REG_MODULE (TOPAsicShiftsBS13dCollector)
 Register module.
 
 REG_MODULE (TOPChannelMaskCollector)
 Register module.
 
 REG_MODULE (TOPCommonT0BFCollector)
 Register module.
 
 REG_MODULE (TOPCommonT0LLCollector)
 Register module.
 
 REG_MODULE (TOPModuleT0DeltaTCollector)
 Register module.
 
 REG_MODULE (TOPModuleT0LLCollector)
 Register module.
 
 REG_MODULE (TOPOffsetCollector)
 Register module.
 
 REG_MODULE (TOPPhotonYieldsCollector)
 Register module.
 
 REG_MODULE (TOPPulseHeightCollector)
 Register module.
 
 REG_MODULE (TOPValidationCollector)
 Register module.
 
 REG_MODULE (OpticalGun)
 Register module.
 
 REG_MODULE (TOPAligner)
 Register module.
 
 REG_MODULE (TOPBackground)
 Register the Module.
 
 REG_MODULE (TOPBunchFinder)
 Register module.
 
 REG_MODULE (TOPChannelMasker)
 Register the Module.
 
 REG_MODULE (TOPChannelT0Calibrator)
 Register module.
 
 REG_MODULE (TOPChannelT0MC)
 Register module.
 
 REG_MODULE (TOPCommonT0Calibrator)
 Register module.
 
 REG_MODULE (TOPCosmicT0Finder)
 Register module.
 
 REG_MODULE (TOPDigitizer)
 Register the Module.
 
 REG_MODULE (TOPTriggerDigitizer)
 Register the Module.
 
 REG_MODULE (TOPCalPulseGenerator)
 Register module.
 
 REG_MODULE (TOPDoublePulseGenerator)
 Register module.
 
 REG_MODULE (TOPDQM)
 Register module.
 
 REG_MODULE (TOPGainEfficiencyCalculator)
 Register the Module.
 
 REG_MODULE (TOPLaserHitSelector)
 Register the Module.
 
 REG_MODULE (TOPGeometryParInitializer)
 Register module.
 
 REG_MODULE (TOPInterimFENtuple)
 Register module.
 
 REG_MODULE (TOPLaserCalibrator)
 Register module.
 
 REG_MODULE (TOPMCTrackMaker)
 Register module.
 
 REG_MODULE (TOPModuleT0Calibrator)
 Register module.
 
 REG_MODULE (TOPNtuple)
 Register module.
 
 REG_MODULE (TOPPacker)
 Register module.
 
 REG_MODULE (TOPPDFChecker)
 Register module.
 
 REG_MODULE (TOPPDFDebugger)
 Register the Module.
 
 REG_MODULE (TOPRawDigitConverter)
 Register module.
 
 REG_MODULE (TOPReconstructor)
 Register the Module.
 
 REG_MODULE (TOPTBCComparator)
 Register module.
 
 REG_MODULE (TOPTimeBaseCalibrator)
 Register module.
 
 REG_MODULE (TOPTimeRecalibrator)
 Register module.
 
 REG_MODULE (TOPUnpacker)
 Register module.
 
 REG_MODULE (TOPWaveformFeatureExtractor)
 Register module.
 
 REG_MODULE (TOPWaveformQualityPlotter)
 Register module.
 
 TOPAlignmentCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPAsicShiftsBS13dCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPChannelMaskCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPCommonT0BFCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPCommonT0LLCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPModuleT0DeltaTCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPModuleT0LLCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPOffsetCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPPhotonYieldsCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPPulseHeightCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
 TOPValidationCollectorModule ()
 Constructor.
 
virtual void prepare () final
 Replacement for initialize(). More...
 
virtual void startRun () final
 Replacement for beginRun(). More...
 
virtual void collect () final
 Replacement for event(). More...
 
virtual void closeRun () final
 Replacement for endRun(). More...
 
 OpticalGunModule ()
 Constructor.
 
virtual ~OpticalGunModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
bool isInsideSlit (const ROOT::Math::XYZPoint &point, const ROOT::Math::XYZVector &direction) const
 Checks if photon passes the slit. More...
 
ROOT::Math::XYZVector getDirectionGaussian () const
 Return photon direction according to a projected 2D gaussian distribution based on numerical aperture NA. More...
 
ROOT::Math::XYZVector getDirectionUniform () const
 Return photon direction according to a projected uniform distribution with opening angle alpha. More...
 
ROOT::Math::XYZVector getDirectionLambertian () const
 Return photon direction according to a lambertian distribution with opening angle alpha. More...
 
ROOT::Math::XYZVector getDirectionCustom () const
 Return photon direction according to a custom angular distribution given by TFormula. More...
 
 TOPAlignerModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
 TOPBackgroundModule ()
 Constructor.
 
virtual ~TOPBackgroundModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor. More...
 
void myprint (TH1F *histo, const char *path, const char *xtit, const char *ytit, double tresh)
 Print histogram 1D, helper function.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
void printModuleParams () const
 Prints module parameters.
 
 TOPBunchFinderModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
Const::ChargedStable getMostProbable (const Track &track)
 Returns most probable charged stable particle according to dEdx and predefined prior probabilities. More...
 
int setFinder (TOP::Chi2MinimumFinder1D &finder, const TOP::PDFConstructor &reco, double timeMin, double timeMax)
 Sets finder object with chi2 values. More...
 
TimeSeed getTimeSeed ()
 Returns a time seed. More...
 
bool isBucketFilled (int bunchNo)
 Does reconstructed bunch number correspond to filled bucket. More...
 
 TOPChannelMaskerModule ()
 Constructor: Sets the description of the module.
 
virtual void initialize () override
 initialize method: registers datastore objects (the TOP hits)
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 event method: removes channels from the reconstruction pdf, flags hits from noisy channels as junk
 
 TOPChannelT0CalibratorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
 TOPChannelT0MCModule ()
 Constructor.
 
virtual ~TOPChannelT0MCModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action.
 
virtual void terminate () override
 Termination action. More...
 
 TOPCommonT0CalibratorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
bool isRunningOffsetSubtracted ()
 Checks if running offset is subtracted in TOPDigits. More...
 
 TOPCosmicT0FinderModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
 TOPDigitizerModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
TimeOffset getTimeOffset (double trgOffset, int moduleID, int pixelID)
 Returns a complete time offset by adding time mis-calibration to trgOffset. More...
 
double generatePulseHeight (int moduleID, int pixelID) const
 Generates and returns pulse height. More...
 
 TOPTriggerDigitizerModule ()
 Constructor.
 
virtual ~TOPTriggerDigitizerModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action.
 
virtual void terminate () override
 Termination action. More...
 
 TOPCalPulseGeneratorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 TOPDoublePulseGeneratorModule ()
 Constructor.
 
virtual ~TOPDoublePulseGeneratorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
void storeSampleTimes (std::string fileName)
 Optionally store sample times used by the generator as root histograms fileName root output file name.
 
void saveAsHistogram (const std::vector< double > &vec, const std::string &name, const std::string &title, const std::string &xTitle="", const std::string &yTitle="") const
 Save vector to histogram and write it out. More...
 
 TOPDQMModule ()
 Constructor.
 
virtual ~TOPDQMModule ()
 Destructor.
 
virtual void defineHisto () override
 Histogram definitions such as TH1(), TH2(), TNtuple(), TTree().... More...
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
int getModuleID (const Track &track) const
 Returns slot ID of the module that is hit by the track. More...
 
 TOPGainEfficiencyCalculatorModule ()
 Constructor.
 
virtual ~TOPGainEfficiencyCalculatorModule ()
 Destructor.
 
virtual void initialize () override
 Load time vs charge 2D histogram from a given input file (paramter "inputFile") and prepare hit timing and pulse charge distribution for each channel.
 
virtual void defineHisto () override
 Define TTree branches to store fit results for each channel This TTree is saved in an output file given by "histoFileName" parameter of "HistoManager" module.
 
virtual void beginRun () override
 The main processes, fitting charge distribution and calculating gain/efficiency, are done in this function.
 
virtual void event () override
 This will be empty as the all the processes are done in beginRun() function thus input file can be a dummy file.
 
virtual void endRun () override
 Draw plots to show fitting results for each channel and save them into a given PDF file (outputPDFFile).
 
virtual void terminate () override
 Termination action. More...
 
void LoadHistograms (const std::string &histotype)
 Load 2D histograms from a given input file (output of TOPLaserHitSelector) and create timing and charge distribution as projection histograms for the x- and y-axis, respectively. More...
 
void FitHistograms (EHistogramType LoadHisto)
 Fit charge (or integrated charged) distribution to calculate gain and efficiency for each channel.
 
void DummyFillBranch (EHistogramType LoadHisto)
 Fill Dummy for Branch. More...
 
void DrawResult (const std::string &histotype, EHistogramType LoadHisto)
 Draw results of gain/efficiency calculation for each channel to a given output file.
 
static double TOPGainFunc (double *var, double *par)
 Fit function of pulse charge (or charnge) distribution for channel(pixel)-by-channel gain extraction, given by "[0]*pow(x-[4],[1])*exp(-pow(x-[4],[2])/[3])" smeared by Gaussian with a constant sigma to consider baseline fluctuation.
 
static double FindPeakForSmallerXThan (TH1 *histo, double xmax=0)
 Find peak and return its position for a limited range of x (x smaller than the given value (xmax))
 
 TOPLaserHitSelectorModule ()
 Constructor.
 
virtual ~TOPLaserHitSelectorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void defineHisto () override
 create timing-height 2D histograms for all 8192 pixels
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPGeometryParInitializerModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
 TOPInterimFENtupleModule ()
 Constructor.
 
virtual ~TOPInterimFENtupleModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void defineHisto () override
 Module funcions to define histograms.
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
void getReferenceTiming ()
 Find reference timing. More...
 
 TOPLaserCalibratorModule ()
 Constructor.
 
virtual ~TOPLaserCalibratorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPMCTrackMakerModule ()
 Constructor.
 
virtual ~TOPMCTrackMakerModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPModuleT0CalibratorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
bool isRunningOffsetSubtracted ()
 Checks if running offset is subtracted in TOPDigits. More...
 
 TOPNtupleModule ()
 Constructor.
 
virtual ~TOPNtupleModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPPackerModule ()
 Constructor.
 
virtual ~TOPPackerModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
void packProductionDraft ()
 Pack in format: c_Draft (tentative production format) this format was never implemented in firmware!
 
void packType0Ver16 ()
 Pack in format: c_Type0Ver16 (Feature-extracted data) this format was never implemented in firmware!
 
void packProductionDebug ()
 Pack in format: Production Debugging Data Format 01.
 
 TOPPDFCheckerModule ()
 Constructor.
 
virtual void defineHisto () override
 Histogram definitions such as TH1(), TH2(), TNtuple(), TTree().... More...
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Termination action. More...
 
bool isFromThisParticle (const TOPDigit &digit, const MCParticle *particle)
 Checks if digit comes from given MC particle. More...
 
 TOPPDFDebuggerModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void associatePDFPeaks (const TOP::PDFConstructor &pdfConstructor)
 Associate PDF peaks with photons using S-plot technique. More...
 
 TOPRawDigitConverterModule ()
 Constructor.
 
virtual ~TOPRawDigitConverterModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPReconstructorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 TOPTBCComparatorModule ()
 Constructor.
 
void defineHisto () override
 Defining the histograms. More...
 
int analyzeCalFile ()
 Analyzes the calibrations stored in the file m_calSetFile. More...
 
int makeComparisons ()
 Last function to be called, compared the histograms of different datasets filled by analyzeCalFile() Every new comparison histogram added to the module has to be filled here.
 
void initialize () override
 Initialize the module.
 
void beginRun () override
 Called when entering a new run.
 
void event () override
 Event processor.
 
void endRun () override
 End-of-run action. More...
 
void terminate () override
 Termination action. More...
 
int parseInputDirectoryLine (std::string)
 Utility function to get the directory name and the label from a line of the m_inputDirectoryList file Sets the values of m_calSetDirectory and m_calSetLabel.
 
int parseSlotAndScrodIDfromFileName (std::string)
 Utility function to parse the slot and BS id from the calibration file names.
 
TH1F * calculateHistoRatio (TH1F *, TH1F *, TH1F *)
 Utility function to take the ratio of two histograms using TH1::Divide(), without overwriting the output name and title initialized in defineHisto().
 
TH2F * calculateHistoRatio (TH2F *, TH2F *, TH2F *)
 Utility function to take the ratio of two histograms using TH2::Divide(), without overwriting the output name and title initialized in defineHisto().
 
 TOPTimeBaseCalibratorModule ()
 Constructor.
 
virtual ~TOPTimeBaseCalibratorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
bool calibrateChannel (std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
 calibrate single channel More...
 
bool matrixInversion (const std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, double meanTimeDifference, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
 Method by matrix inversion. More...
 
bool iterativeTBC (const std::vector< TwoTimes > &ntuple, unsigned scrodID, unsigned scrodChannel, double meanTimeDifference, TH1F &Hchi2, TH1F &Hndf, TH1F &HDeltaT)
 Method by iteration of chi2 minimization. More...
 
void Iteration (const std::vector< TwoTimes > &ntuple, std::vector< double > &xval)
 Iteration function called by iterativeTBC() More...
 
double Chisq (const std::vector< TwoTimes > &ntuple, const std::vector< double > &xxval)
 Return the chisqure of one set of TBC constants (xval) in iTBC calculaton. More...
 
void saveAsHistogram (const std::vector< double > &vec, const std::string &name, const std::string &title, const std::string &xTitle="", const std::string &yTitle="") const
 Save vector to histogram and write it out. More...
 
void saveAsHistogram (const std::vector< double > &vec, const std::vector< double > &err, const std::string &name, const std::string &title, const std::string &xTitle="", const std::string &yTitle="") const
 Save vector and errors to histogram and write it out. More...
 
void saveAsHistogram (const TMatrixDSym &M, const std::string &name, const std::string &title) const
 Save matrix to histogram and write it out. More...
 
 TOPTimeRecalibratorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
 TOPUnpackerModule ()
 Constructor.
 
virtual ~TOPUnpackerModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
std::string getFrontEndName (RawTOP &raw, int finesse) const
 Returns the name of the front-end. More...
 
bool printTheError ()
 Error messages suppression logic. More...
 
void unpackProductionDraft (const int *buffer, int bufferSize)
 Unpack raw data given in a tentative production format (will vanish in future) More...
 
void unpackType0Ver16 (const int *buffer, int bufferSize)
 Unpack raw data given in feature-extraction production format. More...
 
bool unpackHeadersInterimFEVer01 (const int *buffer, int bufferSize, bool swapBytes)
 Tries to unpack raw data assuming it is in feature-extraction interim format. More...
 
int unpackInterimFEVer01 (const int *buffer, int bufferSize, bool pedestalSubtracted)
 Unpack raw data given in feature-extraction interim format. More...
 
int unpackProdDebug (const int *buffer, int bufferSize, TOP::RawDataType dataFormat, bool pedestalSubtracted)
 Unpack raw data given in production debugging format. More...
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPWaveformFeatureExtractorModule ()
 Constructor.
 
virtual ~TOPWaveformFeatureExtractorModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. More...
 
 TOPWaveformQualityPlotterModule ()
 Constructor.
 
void defineHisto () override
 Books the empty histograms.
 
void initialize () override
 Module initialization, calls defineHisto and gets waveform.
 
void basicDebuggingPlots (const TOPRawWaveform &rawwave)
 Fills the debugging 1D histograms and hitmaps. More...
 
void drawWaveforms (const TOPRawWaveform &rawwave)
 Draws the full waveforms onto the TProfiles. More...
 
void event () override
 Event processor.
 
void endRun () override
 End-of-run action. More...
 

Detailed Description

Function Documentation

◆ analyzeCalFile()

int analyzeCalFile ( )

Analyzes the calibrations stored in the file m_calSetFile.

This is the main function in which the analysis and the hisogram filling takes place. Every new monitoring histogram added to the module has to be filled here.

Definition at line 207 of file TOPTBCComparatorModule.cc.

208  {
209  // Here the histograms are filled
210  // WARNING! What root calls "RMS" is actually a standard deviation
211 
212  // Sanity check on the parsed parameters
213  if (m_slotID < 0 || m_boardstackID < 0 || m_scrodID < 0) {
214  B2WARNING("Negative slot, BS or scrod ID found while calling analyzeCalFile(). Looks like they have not been initialized, or that a function re-initialized them");
215  return 0;
216  }
217 
218  // Loop over all the histograms that should be found in the file
219  for (short iChannel = 0; iChannel < 128; iChannel++) {
220 
221  // Pics up one histogram just to check that the channel iChannel was actually used to calculate the calibrations
222  if (!m_calSetFile->Get(str(format("timeDiff_ch%1%") % (iChannel)).c_str())) {
223  continue;
224  }
225 
226 
227  // ---------
228  // 1) Define some channel numbering quantities
229  // Watchout: m_slotID is in [1..16] so slot m_slotID is on the element m_slotID-1 of the array
230  // ---------
231 
232  short hardwareChannel = iChannel + 128 * m_boardstackID; // 0-511 across the whole module, BS by BS
233  auto& chMapper = TOP::TOPGeometryPar::Instance()->getChannelMapper();
234  short pixelID = chMapper.getPixelID(hardwareChannel); // 1-512 across the whole module, in rows
235  short colNum = (pixelID - 1) % 64 + 1; // 1- 64 column ID (right to left looking from the quartz to the PMTs)
236  short rowNum = (pixelID - 1) / 64 + 1 ; // 1- 8 row ID (bottom to top looking from the quartz to the PMTs)
237  short globalChannel = hardwareChannel + 512 * (m_slotID -
238  1); // channel number across the whole detector, 0-8191. Used for cal monitorin only
239 
240 
241  // ---------
242  // 2) Channel-by-channel DeltaT summaries (average on the 256 samples of each set)
243  // ---------
244 
245  // Checks that the histogram needed here is not corrupted before using it
246  if (!m_calSetFile->Get(str(format("timeDiffcal_ch%1%") % (iChannel)).c_str())) {
247  B2WARNING("Error opening " << str(format("timeDiffcal_ch%1%") % (iChannel)));
248  } else {
249  TH2F* h_timeDiffcal = (TH2F*)m_calSetFile->Get(str(format("timeDiffcal_ch%1%") % (iChannel)).c_str());
250  TH1D* h_projection = h_timeDiffcal->ProjectionY("h_projection", 1, m_numSamples); // full projection
251 
252  m_slotAverageDeltaT[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, h_projection->GetMean());
253  m_slotAverageDeltaT[m_slotID - 1][m_calSetID]->SetBinError(hardwareChannel + 1,
254  h_projection->GetMeanError()); // Do we trust root on this?
255  m_slotSigmaDeltaT[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1,
256  h_projection->GetRMS()); // WARNING! What root calls "RMS" is actually a standard deviation
257  m_slotSigmaDeltaT[m_slotID - 1][m_calSetID]->SetBinError(hardwareChannel + 1,
258  h_projection->GetRMSError()); // WARNING! What root calls "RMS" is actually a standard deviation
259 
260  m_slotAverageDeltaTMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, h_projection->GetMean());
261  m_slotSigmaDeltaTMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum,
262  h_projection->GetRMS());
263 
264  m_topAverageDeltaT[m_calSetID]->SetBinContent(globalChannel + 1, h_projection->GetMean());
265  m_topSigmaDeltaT[m_calSetID]->SetBinContent(globalChannel + 1, h_projection->GetRMS());
266  }
267 
268  // ---------
269  // 3) Channel-by-channel average occupancy
270  // ---------
271 
272  // Checks that the histogram needed here is not corrupted before using it
273  if (!m_calSetFile->Get(str(format("sampleOccup_ch%1%") % (iChannel)).c_str())) {
274  B2WARNING("Error opening " << str(format("sampleOccup_ch%1%") % (iChannel)));
275  } else {
276  TH1F* h_sampleOccup = (TH1F*)m_calSetFile->Get(str(format("sampleOccup_ch%1%") % (iChannel)).c_str());
277 
278  // reads the occupancy histogram bin-by-by to look for (almost) empty samples
279  int nEmpty = 0;
280  for (int iSample = 1; iSample < m_numSamples + 1 ; iSample++) {
281  if (h_sampleOccup->GetBinContent(iSample) < m_minCalPulses) nEmpty++;
282  }
283 
284  m_slotSampleOccupancy[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, h_sampleOccup->Integral() / m_numSamples);
285  m_slotEmptySamples[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, nEmpty);
286 
287  m_slotSampleOccupancyMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, h_sampleOccup->Integral() / m_numSamples);
288  m_slotEmptySamplesMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, nEmpty);
289 
290  m_topSampleOccupancy[m_calSetID]->SetBinContent(globalChannel + 1, h_sampleOccup->Integral() / m_numSamples);
291 
292  }
293 
294 
295 
296  }
297  return 1;
298  }
short m_boardstackID
ID of the slot whose calibrations are being analyzed.
std::vector< TH1F * > m_slotSigmaDeltaT[16]
Standard deviation of the DeltaT (time difference petween the calibraiton pulses) distribution,...
std::vector< TH1F * > m_slotSampleOccupancy[16]
Average number of calpulses per sample used in the minimization, as function of the channel number.
short m_numSamples
Number of samples that have been calibrated.
std::vector< TH1F * > m_topSigmaDeltaT
Standard deviation of the DeltaT (time difference petween the calibraiton pulses) distribution,...
std::vector< TH2F * > m_slotAverageDeltaTMap[16]
Map of the average of the DeltaT (time difference petween the calibraiton pulses) distribution.
std::vector< TH1F * > m_topSampleOccupancy
Average number of calpulses per sample used in the minimization, as function of the channel number on...
short m_calSetID
Internal ID of the calibration set that is being analyzed.
TFile * m_calSetFile
File containing the calibration constants of the SCROD being analyzed.
std::vector< TH1F * > m_slotEmptySamples[16]
Number of (semi-)empty samples in each channel.
short m_slotID
ID of the slot whose calibrations are being analyzed.
short m_minCalPulses
Minimum number of calpulses to declare a sample as non-empty.
std::vector< TH1F * > m_slotAverageDeltaT[16]
Average of the DeltaT (time difference petween the calibraiton pulses) distribution,...
short m_scrodID
ID of the scrod whose calibrations are being analyzed.
std::vector< TH2F * > m_slotEmptySamplesMap[16]
Map of the number of (semi-)empty samples.
std::vector< TH2F * > m_slotSigmaDeltaTMap[16]
Map of the Standard deviation of the DeltaT (time difference petween the calibraiton pulses) distribu...
std::vector< TH1F * > m_topAverageDeltaT
Average of the DeltaT (time difference petween the calibraiton pulses) distribution,...
std::vector< TH2F * > m_slotSampleOccupancyMap[16]
Map of the average number of calpulses per sample used in the minimizat on.
int getPixelID(unsigned channel) const
Converts hardware channel number to pixel ID (1-based)
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)

◆ associatePDFPeaks()

void associatePDFPeaks ( const TOP::PDFConstructor pdfConstructor)
private

Associate PDF peaks with photons using S-plot technique.

Parameters
pdfConstructorreconstruction object for given track and hypothesis

Definition at line 192 of file TOPPDFDebuggerModule.cc.

193  {
194 
195  const auto& signalPDFs = pdfConstructor.getSignalPDF();
196  auto signalPhotons = pdfConstructor.getExpectedSignalPhotons();
197  auto bkgPhotons = pdfConstructor.getExpectedBkgPhotons();
198  auto deltaPhotons = pdfConstructor.getExpectedDeltaPhotons();
199  int PDGCode = pdfConstructor.getHypothesis().getPDGCode();
200 
201  for (const auto& digit : m_digits) {
202  if (digit.getModuleID() != pdfConstructor.getModuleID()) continue;
203  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
204  int pixelID = digit.getPixelID();
205  unsigned index = pixelID - 1;
206  if (index >= signalPDFs.size()) continue;
207  const auto& signalPDF = signalPDFs[index];
208  const auto* tts = signalPDF.getTTS();
209  const auto& pdfPeaks = signalPDF.getPDFPeaks();
210  const auto& extraInfos = signalPDF.getPDFExtraInfo();
211  if (extraInfos.size() != pdfPeaks.size()) {
212  B2ERROR("associatePDFPeaks: sizes of PDFPeaks and ExtraInfo's differ");
213  continue;
214  }
215 
216  auto* associatedPDF = m_associatedPDFs.appendNew(PDGCode);
217  digit.addRelationTo(associatedPDF);
218 
219  double bkgLevel = pdfConstructor.getBackgroundPDF()->getPDFValue(pixelID) * bkgPhotons;
220  associatedPDF->setBackgroundWeight(bkgLevel);
221  double deltaLevel = pdfConstructor.getDeltaRayPDF().getPDFValue(pixelID, digit.getTime()) * deltaPhotons;
222  associatedPDF->setDeltaRayWeight(deltaLevel);
223 
224  float time = digit.getTime();
225  float timeErr = digit.getTimeError();
226 
227  for (size_t k = 0; k < pdfPeaks.size(); k++) {
228  const auto& pdfPeak = pdfPeaks[k];
229  const auto& pdfExtra = extraInfos[k];
230  TOPAssociatedPDF::PDFPeak peak;
231  peak.position = pdfPeak.t0;
232  peak.width = sqrt(pdfPeak.wid);
233  peak.numPhotons = pdfPeak.nph * signalPhotons;
234  float wt = 0;
235  for (const auto& gaus : tts->getTTS()) {
236  float sig2 = peak.width * peak.width + gaus.sigma * gaus.sigma + timeErr * timeErr;
237  float x = pow(time - peak.position - gaus.position, 2) / sig2;
238  if (x > 20) continue;
239  wt += peak.numPhotons * gaus.fraction / sqrt(2 * M_PI * sig2) * exp(-x / 2);
240  }
241  if (wt > 0) {
242  peak.fic = pdfPeak.fic;
243  peak.e = pdfExtra.e;
244  peak.sige = pdfExtra.sige;
245  peak.nx = abs(pdfExtra.Nxm) + abs(pdfExtra.Nxb) + abs(pdfExtra.Nxe);
246  peak.ny = abs(pdfExtra.Nym) + abs(pdfExtra.Nyb) + abs(pdfExtra.Nye);
247  peak.nxm = abs(pdfExtra.Nxm);
248  peak.nym = abs(pdfExtra.Nym);
249  peak.nxe = abs(pdfExtra.Nxe);
250  peak.nye = abs(pdfExtra.Nye);
251  peak.xd = pdfExtra.xD;
252  peak.yd = pdfExtra.yD;
253  peak.type = pdfExtra.type;
254  peak.kxe = pdfExtra.kxE;
255  peak.kye = pdfExtra.kyE;
256  peak.kze = pdfExtra.kzE;
257  peak.kxd = pdfExtra.kxD;
258  peak.kyd = pdfExtra.kyD;
259  peak.kzd = pdfExtra.kzD;
260  associatedPDF->appendPeak(peak, wt);
261  }
262  }
263  }
264 
265  }
StoreArray< TOPAssociatedPDF > m_associatedPDFs
collection of associated PDF's
StoreArray< TOPDigit > m_digits
collection of digits
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ basicDebuggingPlots()

void basicDebuggingPlots ( const TOPRawWaveform rawwave)

Fills the debugging 1D histograms and hitmaps.

Parameters
rawwavethe raw waveform

Definition at line 81 of file TOPWaveformQualityPlotterModule.cc.

82  {
83  int scrodid = v.getScrodID();
84  int asicid = v.getASICNumber();
85  int channelid = v.getASICChannel();
86  int carrierid = v.getCarrierNumber();
87  m_scrod_id->Fill(scrodid);
88  m_asic_ch->Fill(channelid);
89  m_asic->Fill(asicid);
90  m_carrier->Fill(carrierid);
91  m_asic_win->Fill(v.getStorageWindow());
92  m_entries->Fill(v.getWaveform().size());
93  m_moduleID->Fill(v.getModuleID());
94  m_pixelID->Fill(v.getPixelID());
95 
96  if (m_hitmap.find(scrodid) == m_hitmap.end()) {
97  m_hitmap[scrodid] = new TH2F((string("scrod ") + to_string(scrodid) + string("Hitmap")).c_str(),
98  (string("scrod ") + to_string(scrodid) + string("carrier vs. asic;asic;carrier")).c_str(), 4, 0, 4, 4, 0, 4);
99  }
100  m_hitmap[scrodid]->Fill(asicid, carrierid);
101  const vector<short>& waveform = v.getWaveform();
102  if (waveform.empty()) {
103  return;
104  }
105  for (short adc : waveform) {
106  m_samples->Fill(adc);
107  }
108  }
TH1F * m_asic_ch
plot of ASIC channel ID debugging
TH1F * m_pixelID
plot of pixel ID for debugging
std::map< int, TH2F * > m_hitmap
hitmaps for each SCROD
TH1F * m_carrier
plot of carrier IDs for debugging
TH1F * m_scrod_id
plot of SCROD IDs for debugging
TH1F * m_asic
plot of ASIC number for debugging

◆ beginRun() [1/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 195 of file TOPBackgroundModule.cc.

196  {
197  // Print run number
198  B2INFO("TOPBackground: Processing:");
199 
200  }

◆ beginRun() [2/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 54 of file TOPChannelMaskerModule.cc.

55  {
56 
57  if (not m_channelMask.isValid()) {
58  B2FATAL("channel mask not available");
59  }
60  if (not m_channelT0.isValid()) {
61  B2FATAL("channel T0 calibration not available");
62  }
63  if (not m_timebase.isValid()) {
64  B2FATAL("timebase calibration not available");
65  }
66 
67  }
DBObjPtr< TOPCalChannelMask > m_channelMask
list of dead/noisy channels
DBObjPtr< TOPCalTimebase > m_timebase
timebase
DBObjPtr< TOPCalChannelT0 > m_channelT0
channel T0

◆ beginRun() [3/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 148 of file TOPDoublePulseGeneratorModule.cc.

149  {
150  StoreObjPtr<EventMetaData> evtMetaData;
151  if (m_useDatabase) {
152  if (!(*m_timebase).isValid()) {
153  B2FATAL("Sample time calibration requested but not available for run "
154  << evtMetaData->getRun()
155  << " of experiment " << evtMetaData->getExperiment());
156  }
157  }
158 
159  }
bool m_useDatabase
if true, use sample times from database

◆ beginRun() [4/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from HistoModule.

Definition at line 307 of file TOPDQMModule.cc.

308  {
309  m_BoolEvtMonitor->Reset();
310  m_window_vs_slot->Reset();
311  m_eventT0->Reset();
312  m_bunchOffset->Reset();
313  m_time->Reset();
314  m_timeBG->Reset();
315  m_signalHits->Reset();
316  m_backgroundHits->Reset();
317  m_trackHits->Reset();
318  m_goodTDCAll->Reset();
319  m_badTDCAll->Reset();
320  m_goodHitsPerEventAll->Reset();
321  m_badHitsPerEventAll->Reset();
322  m_TOPOccAfterInjLER->Reset();
323  m_TOPOccAfterInjHER->Reset();
324  m_TOPEOccAfterInjLER->Reset();
325  m_TOPEOccAfterInjHER->Reset();
326  m_nhitInjLER->Reset();
327  m_nhitInjHER->Reset();
328  m_nhitInjLERcut->Reset();
329  m_nhitInjHERcut->Reset();
330  m_eventInjLER->Reset();
331  m_eventInjHER->Reset();
332  m_eventInjLERcut->Reset();
333  m_eventInjHERcut->Reset();
334 
335  for (int i = 0; i < m_numModules; i++) {
336  m_window_vs_asic[i]->Reset();
337  m_goodHitsXY[i]->Reset();
338  m_badHitsXY[i]->Reset();
339  m_goodHitsAsics[i]->Reset();
340  m_badHitsAsics[i]->Reset();
341  m_goodTDC[i]->Reset();
342  m_badTDC[i]->Reset();
343  m_goodTiming[i]->Reset();
344  m_goodTimingBG[i]->Reset();
345  m_goodChannelHits[i]->Reset();
346  m_badChannelHits[i]->Reset();
347  m_pulseHeights[i]->Reset();
348  }
349  }
std::vector< TH2F * > m_window_vs_asic
Histograms window w.r.t reference vs.
Definition: TOPDQMModule.h:127
std::vector< TH1F * > m_badChannelHits
Histograms for bad channel hits.
Definition: TOPDQMModule.h:137
int m_numModules
number of TOP modules
Definition: TOPDQMModule.h:141
std::vector< TH2F * > m_goodHitsXY
Histograms (2D) for good hits in pixels.
Definition: TOPDQMModule.h:128
std::vector< TH2F * > m_goodHitsAsics
Histograms (2D) for good hits in asic channels.
Definition: TOPDQMModule.h:130
TH2F * m_eventInjHER
event distribution (HER injection)
Definition: TOPDQMModule.h:123
std::vector< TH2F * > m_badHitsXY
Histograms (2D) for bad hits in pixels.
Definition: TOPDQMModule.h:129
TH1F * m_bunchOffset
reconstructed bunch: current offset
Definition: TOPDQMModule.h:101
TProfile2D * m_nhitInjLER
average number of good digits (LER injection)
Definition: TOPDQMModule.h:118
TProfile * m_backgroundHits
number of hits in the background time window vs.
Definition: TOPDQMModule.h:105
std::vector< TH1F * > m_badTDC
Histograms for TDC distribution of bad hits.
Definition: TOPDQMModule.h:133
std::vector< TH1F * > m_goodChannelHits
Histograms for good channel hits.
Definition: TOPDQMModule.h:136
TH1F * m_eventT0
reconstructed event T0
Definition: TOPDQMModule.h:100
TH2F * m_eventInjLERcut
event distribution after cut (LER injection)
Definition: TOPDQMModule.h:124
TH2F * m_window_vs_slot
Histogram window w.r.t reference vs.
Definition: TOPDQMModule.h:99
std::vector< TH1F * > m_goodTDC
Histograms for TDC distribution of good hits.
Definition: TOPDQMModule.h:132
std::vector< TH1F * > m_goodTimingBG
Histograms for timing distribution of good hits (background)
Definition: TOPDQMModule.h:135
TH1F * m_timeBG
time distribution of good hits (background)
Definition: TOPDQMModule.h:103
TH2F * m_eventInjLER
event distribution (LER injection)
Definition: TOPDQMModule.h:122
TH1F * m_TOPEOccAfterInjHER
Histogram for Nr Entries (=Triggrs) for normalization after HER injection.
Definition: TOPDQMModule.h:116
TProfile2D * m_nhitInjLERcut
average number of good digits after cut (LER injection)
Definition: TOPDQMModule.h:120
TH1F * m_badHitsPerEventAll
Number of bad hits per event (all slots)
Definition: TOPDQMModule.h:109
TH1F * m_TOPEOccAfterInjLER
Histogram for Nr Entries (=Triggrs) for normalization after LER injection.
Definition: TOPDQMModule.h:115
std::vector< TH1F * > m_goodTiming
Histograms for timing distribution of good hits.
Definition: TOPDQMModule.h:134
TH1F * m_time
time distribution of good hits
Definition: TOPDQMModule.h:102
TH1F * m_goodTDCAll
TDC distribution of good hits (all slots)
Definition: TOPDQMModule.h:110
TProfile2D * m_nhitInjHER
average number of good digits (HER injection)
Definition: TOPDQMModule.h:119
TH1F * m_TOPOccAfterInjLER
Histogram Ndigits after LER injection.
Definition: TOPDQMModule.h:113
std::vector< TProfile * > m_pulseHeights
Pulse heights of good hits.
Definition: TOPDQMModule.h:138
TH2F * m_eventInjHERcut
event distribution after cut (HER injection)
Definition: TOPDQMModule.h:125
TProfile * m_signalHits
number of hits in the signal time window vs.
Definition: TOPDQMModule.h:104
TH2F * m_trackHits
counting events w/ and w/o track in the slot vs.
Definition: TOPDQMModule.h:106
TH1D * m_BoolEvtMonitor
Event desynchronization monitoring.
Definition: TOPDQMModule.h:98
TProfile2D * m_nhitInjHERcut
average number of good digits after cut (HER injection)
Definition: TOPDQMModule.h:121
std::vector< TH2F * > m_badHitsAsics
Histograms (2D) for bad hits in asic channels.
Definition: TOPDQMModule.h:131
TH1F * m_TOPOccAfterInjHER
Histogram Ndigits after HER injection.
Definition: TOPDQMModule.h:114
TH1F * m_badTDCAll
TDC distribution of bad hits (all slots)
Definition: TOPDQMModule.h:111
TH1F * m_goodHitsPerEventAll
Number of good hits per event (all slots)
Definition: TOPDQMModule.h:108

◆ beginRun() [5/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from HistoModule.

Definition at line 150 of file TOPLaserHitSelectorModule.cc.

151  {
152  }

◆ beginRun() [6/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from HistoModule.

Definition at line 159 of file TOPInterimFENtupleModule.cc.

160  {
161  }

◆ beginRun() [7/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 81 of file TOPLaserCalibratorModule.cc.

82  {
83  }

◆ beginRun() [8/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 88 of file TOPMCTrackMakerModule.cc.

89  {
90  }

◆ beginRun() [9/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 160 of file TOPModuleT0CalibratorModule.cc.

161  {
162  if (m_moduleT0.hasChanged()) {
163  StoreObjPtr<EventMetaData> evtMetaData;
164  B2WARNING("ModuleT0 payload has changed. Calibration results may not be correct."
165  << LogVar("run", evtMetaData->getRun()));
166  }
167  }
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants
Class to store variables with their name which were sent to the logging service.

◆ beginRun() [10/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 122 of file TOPNtupleModule.cc.

123  {
124  }

◆ beginRun() [11/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 99 of file TOPPackerModule.cc.

100  {
101  }

◆ beginRun() [12/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 132 of file TOPRawDigitConverterModule.cc.

133  {
134 
135  StoreObjPtr<EventMetaData> evtMetaData;
136 
137  // check if calibrations are available when needed - if not, terminate
138 
140  if (not m_timebase.isValid()) {
141  B2FATAL("Sample time calibration requested but not available for run "
142  << evtMetaData->getRun()
143  << " of experiment " << evtMetaData->getExperiment());
144  }
145  }
147  if (not m_channelT0.isValid()) {
148  B2FATAL("Channel T0 calibration requested but not available for run "
149  << evtMetaData->getRun()
150  << " of experiment " << evtMetaData->getExperiment());
151  }
152  }
154  if (not m_asicShift.isValid()) {
155  B2FATAL("ASIC shifts calibration requested but not available for run "
156  << evtMetaData->getRun()
157  << " of experiment " << evtMetaData->getExperiment());
158  }
159  }
161  if (not m_moduleT0.isValid()) {
162  B2FATAL("Module T0 calibration requested but not available for run "
163  << evtMetaData->getRun()
164  << " of experiment " << evtMetaData->getExperiment());
165  }
166  }
168  if (not m_commonT0.isValid()) {
169  B2FATAL("Common T0 calibration requested but not available for run "
170  << evtMetaData->getRun()
171  << " of experiment " << evtMetaData->getExperiment());
172  }
173  }
174  if (not m_timeWalk.isValid()) {
175  // B2FATAL("Time-walk calibration is not available for run "
176  B2WARNING("Time-walk calibration is not available for run "
177  << evtMetaData->getRun()
178  << " of experiment " << evtMetaData->getExperiment());
179  }
180  if (m_pedestalRMS > 0 and not m_noises.isValid()) {
181  B2FATAL("Channel noise levels are not available for run "
182  << evtMetaData->getRun()
183  << " of experiment " << evtMetaData->getExperiment());
184  }
185 
186  if (not m_feSetting.isValid()) {
187  B2FATAL("Front-end settings are not available for run "
188  << evtMetaData->getRun()
189  << " of experiment " << evtMetaData->getExperiment());
190  }
191 
192  }
double m_pedestalRMS
r.m.s of pedestals [ADC counts]
DBObjPtr< TOPCalTimebase > m_timebase
sample time calibration constants
DBObjPtr< TOPCalAsicShift > m_asicShift
ASIC shifts calibration constants.
DBObjPtr< TOPFrontEndSetting > m_feSetting
front-end settings
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
bool m_useAsicShiftCalibration
if true, use asic shifts calibration
bool m_useSampleTimeCalibration
if true, use sample time calibration
DBObjPtr< TOPCalChannelT0 > m_channelT0
channel T0 calibration constants
DBObjPtr< TOPCalChannelNoise > m_noises
r.m.s.
OptionalDBObjPtr< TOPCalTimeWalk > m_timeWalk
time-walk calibration constants
bool m_useChannelT0Calibration
if true, use channel T0 calibration
bool m_useCommonT0Calibration
if true, use common T0 calibration
bool m_useModuleT0Calibration
if true, use module T0 calibration
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants

◆ beginRun() [13/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 143 of file TOPTimeBaseCalibratorModule.cc.

144  {
145  }

◆ beginRun() [14/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 85 of file TOPTimeRecalibratorModule.cc.

86  {
87  StoreObjPtr<EventMetaData> evtMetaData;
88 
89  // check if calibrations are available when needed - if not, terminate
90 
92  if (not m_timebase.isValid()) {
93  B2FATAL("Sample time calibration requested but not available for run "
94  << evtMetaData->getRun()
95  << " of experiment " << evtMetaData->getExperiment());
96  }
97  }
99  if (not m_channelT0.isValid()) {
100  B2FATAL("Channel T0 calibration requested but not available for run "
101  << evtMetaData->getRun()
102  << " of experiment " << evtMetaData->getExperiment());
103  }
104  }
106  if (not m_asicShift.isValid()) {
107  B2FATAL("ASIC shifts calibration requested but not available for run "
108  << evtMetaData->getRun()
109  << " of experiment " << evtMetaData->getExperiment());
110  }
111  }
113  if (not m_moduleT0.isValid()) {
114  B2FATAL("Module T0 calibration requested but not available for run "
115  << evtMetaData->getRun()
116  << " of experiment " << evtMetaData->getExperiment());
117  }
118  }
120  if (not m_commonT0.isValid()) {
121  B2FATAL("Common T0 calibration requested but not available for run "
122  << evtMetaData->getRun()
123  << " of experiment " << evtMetaData->getExperiment());
124  }
125  }
127  if (not m_timeWalk.isValid()) {
128  // B2FATAL("Time-walk calibration requested but not available for run "
129  B2WARNING("Time-walk calibration is not available for run "
130  << evtMetaData->getRun()
131  << " of experiment " << evtMetaData->getExperiment());
132  }
133  }
134 
135  if (not m_feSetting.isValid()) {
136  B2FATAL("Front-end settings are not available for run "
137  << evtMetaData->getRun()
138  << " of experiment " << evtMetaData->getExperiment());
139  }
140 
141  }
DBObjPtr< TOPCalTimebase > m_timebase
sample time calibration constants
DBObjPtr< TOPCalAsicShift > m_asicShift
ASIC shifts calibration constants.
DBObjPtr< TOPFrontEndSetting > m_feSetting
front-end settings
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
bool m_useAsicShiftCalibration
if true, use asic shifts calibration
bool m_useSampleTimeCalibration
if true, use sample time calibration
DBObjPtr< TOPCalChannelT0 > m_channelT0
channel T0 calibration constants
bool m_useTimeWalkCalibration
if true, use time-walk calibration
OptionalDBObjPtr< TOPCalTimeWalk > m_timeWalk
time-walk calibration constants
bool m_useChannelT0Calibration
if true, use channel T0 calibration
bool m_useCommonT0Calibration
if true, use common T0 calibration
bool m_useModuleT0Calibration
if true, use module T0 calibration
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants

◆ beginRun() [15/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 113 of file TOPUnpackerModule.cc.

114  {
115  m_channelStatistics.clear();
116  }
std::map< int, int > m_channelStatistics
counts how many different channels have been parsed in a given SCROD packet

◆ beginRun() [16/16]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 78 of file TOPWaveformFeatureExtractorModule.cc.

79  {
80  }

◆ calibrateChannel()

bool calibrateChannel ( std::vector< TwoTimes > &  ntuple,
unsigned  scrodID,
unsigned  scrodChannel,
TH1F &  Hchi2,
TH1F &  Hndf,
TH1F &  HDeltaT 
)
private

calibrate single channel

Parameters
ntuplentuple data
scrodIDSCROD ID
scrodChannelchannel number within SCROD (0 - 127)
Hchi2histogram to store normalized chi^2
Hndfhistogram to store degrees of freedom
HDeltaThistogram to store fittet double pulse delay
Returns
true on success

Definition at line 311 of file TOPTimeBaseCalibratorModule.cc.

◆ Chisq()

double Chisq ( const std::vector< TwoTimes > &  ntuple,
const std::vector< double > &  xxval 
)
private

Return the chisqure of one set of TBC constants (xval) in iTBC calculaton.

Parameters
ntuplentuple data
xxvalTBC constants of 256 samples, and xxval[0]=0, xxval[256]=2*FTSW

Definition at line 669 of file TOPTimeBaseCalibratorModule.cc.

◆ closeRun()

void closeRun ( )
finalprivatevirtual

Replacement for endRun().

Do anything you would normally do in endRun here.

Reimplemented from CalibrationCollectorModule.

Definition at line 288 of file TOPValidationCollectorModule.cc.

289  {
290 
291  // module T0 pulls
292 
293  for (int module = 0; module < c_numModules; module++) {
294  std::vector<double> pos, err;
295  for (int set = 0; set < c_numSets; set++) {
296  const auto& minimum = m_finders[set][module].getMinimum();
297  if (minimum.valid) {
298  pos.push_back(minimum.position);
299  err.push_back(minimum.error);
300  }
301  }
302  auto h_pulls = getObjectPtr<TH1F>("moduleT0_pulls");
303  for (unsigned i = 0; i < pos.size(); i++) {
304  for (unsigned j = i + 1; j < pos.size(); j++) {
305  double pull = (pos[i] - pos[j]) / sqrt(err[i] * err[i] + err[j] * err[j]);
306  h_pulls->Fill(pull);
307  }
308  }
309  }
310 
311  // module T0 residuals
312 
313  for (int module = 0; module < c_numModules; module++) {
314  auto& finder = m_finders[0][module];
315  for (int set = 1; set < c_numSets; set++) {
316  finder.add(m_finders[set][module]);
317  }
318  const auto& minimum = finder.getMinimum();
319  if (minimum.valid) {
320  m_treeEntry.moduleT0[module] = minimum.position;
321  m_treeEntry.moduleT0Err[module] = minimum.error;
322  }
323  }
324 
325  // common T0 residual
326 
327  auto& finder = m_finders[0][0];
328  for (int module = 1; module < c_numModules; module++) {
329  finder.add(m_finders[0][module]);
330  }
331  const auto& minimum = finder.getMinimum();
332  if (minimum.valid) {
333  m_treeEntry.commonT0 = minimum.position;
334  m_treeEntry.commonT0Err = minimum.error;
335  }
336 
337  // fill the tree
338 
339  auto tree = getObjectPtr<TTree>("tree");
340  tree->Fill();
341  }
TOP::ValidationTreeStruct m_treeEntry
tree entry
@ c_numSets
number of statistically independent subsamples
std::vector< TOP::Chi2MinimumFinder1D > m_finders[c_numSets]
minimum finders, vector index = slot - 1
float commonT0Err
common T0 uncertainty (not scaled)
float moduleT0[c_numModules]
module T0 residuals, index = slot - 1
float moduleT0Err[c_numModules]
module T0 uncertainties (not scaled), index = slot - 1

◆ collect() [1/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 216 of file TOPAlignmentCollectorModule.cc.

217  {
218  // bunch must be reconstructed
219 
220  if (not m_recBunch.isValid()) return;
221  if (not m_recBunch->isReconstructed()) return;
222 
223  // track-by-track iterations
224 
225  for (const auto& track : m_tracks) {
226 
227  // construct TOPTrack from mdst track
228  TOPTrack trk(track);
229  if (not trk.isValid()) continue;
230 
231  // skip if track not hitting target module
232  if (trk.getModuleID() != m_targetMid) continue;
233 
234  // track selection
235  if (not m_selector.isSelected(trk)) continue;
236 
237  // generate sub-sample number
238  int sub = gRandom->Integer(c_numSets);
239  auto& align = m_align[sub];
240  auto& countFails = m_countFails[sub];
241  const auto& name = m_treeNames[sub];
242  auto h1 = getObjectPtr<TH2F>("tracks_per_slot");
243  h1->Fill(trk.getModuleID(), sub);
244 
245  // do an iteration
246  int err = align.iterate(trk, m_selector.getChargedStable());
247  m_iter++;
248 
249  // check number of consecutive failures, and in case reset
250  if (err == 0) {
251  countFails = 0;
252  } else if (countFails <= m_maxFails) {
253  countFails++;
254  } else {
255  B2INFO("Reached maximum allowed number of failed iterations. "
256  "Resetting TOPalign object of set = " << sub << " at iter = " << m_iter);
257  align.reset();
258  countFails = 0;
259  }
260 
261  // get new parameter values and estimated errors
262  m_vAlignPars = align.getParameters();
263  m_vAlignParsErr = align.getErrors();
264  m_ntrk = align.getNumUsedTracks();
265  m_errorCode = err;
266  m_valid = align.isValid();
267  m_numPhot = align.getNumOfPhotons();
268 
269  // set other ntuple variables
270  const auto& localPosition = m_selector.getLocalPosition();
271  m_x = localPosition.X();
272  m_y = localPosition.Y();
273  m_z = localPosition.Z();
274  const auto& localMomentum = m_selector.getLocalMomentum();
275  m_p = localMomentum.R();
276  m_theta = localMomentum.Theta();
277  m_phi = localMomentum.Phi();
278  const auto& pocaPosition = m_selector.getPOCAPosition();
279  m_pocaR = pocaPosition.Rho();
280  m_pocaZ = pocaPosition.Z();
281  m_pocaX = pocaPosition.X();
282  m_pocaY = pocaPosition.Y();
284  m_charge = trk.getCharge();
285  m_PDG = trk.getPDGCode();
286 
287  // fill output tree
288  auto alignTree = getObjectPtr<TTree>(name);
289  alignTree->Fill();
290 
291  // fill control histograms
292  std::string slotName = "_s" + to_string(m_targetMid);
293  auto h2 = getObjectPtr<TH1F>("local_z" + slotName);
294  h2->Fill(m_z);
295  auto h3 = getObjectPtr<TH2F>("cth_vs_p" + slotName);
296  h3->Fill(m_p, cos(m_theta));
297  auto h4 = getObjectPtr<TH2F>("poca_xy" + slotName);
298  h4->Fill(m_pocaX, m_pocaY);
299  auto h5 = getObjectPtr<TH1F>("poca_z" + slotName);
300  h5->Fill(m_pocaZ);
301  auto h6 = getObjectPtr<TH1F>("Ecms" + slotName);
302  h6->Fill(m_cmsE);
303  auto h7 = getObjectPtr<TH1F>("charge" + slotName);
304  h7->Fill(m_charge);
305  auto h8 = getObjectPtr<TH2F>("timeHits" + slotName);
306  for (const auto& digit : m_digits) {
307  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
308  if (digit.getModuleID() != m_targetMid) continue;
309  h8->Fill(digit.getChannel(), digit.getTime());
310  }
311  auto h9 = getObjectPtr<TH1F>("numPhot" + slotName);
312  h9->Fill(m_numPhot);
313 
314  } // tracks
315 
316  }
std::vector< float > m_vAlignParsErr
error on alignment parameters
std::vector< TOP::ModuleAlignment > m_align
alignment objects
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
int m_PDG
track MC truth (simulated data only)
float m_phi
track: extrapolated hit momentum in local (module) frame
std::vector< float > m_vAlignPars
alignment parameters
std::vector< int > m_countFails
counters for failed iterations
std::vector< std::string > m_treeNames
tree names
float m_p
track: extrapolated hit momentum in local (module) frame
bool m_valid
true if alignment parameters are valid
StoreArray< Track > m_tracks
collection of tracks
int m_errorCode
error code of the alignment procedure
int m_maxFails
maximum allowed number of failed iterations
int m_numPhot
number of photons used for log likelihood in this iteration
float m_y
track: extrapolated hit coordinate in local (module) frame
StoreArray< TOPDigit > m_digits
collection of digits
float m_z
track: extrapolated hit coordinate in local (module) frame
@ c_numSets
number of statistically independent subsamples
float m_x
track: extrapolated hit coordinate in local (module) frame
float m_theta
track: extrapolated hit momentum in local (module) frame
double getCMSEnergy() const
Returns c.m.s energy of the track in last isSelected call.
const ROOT::Math::XYZVector & getPOCAPosition() const
Returns position of POCA of the track in last isSelected call.
const ROOT::Math::XYZVector & getLocalMomentum() const
Returns momentum at TOP in local frame of the track in last isSelected call.
bool isSelected(const TOPTrack &track) const
Returns selection status.
const ROOT::Math::XYZPoint & getLocalPosition() const
Returns position at TOP in local frame of the track in last isSelected call.
const Const::ChargedStable & getChargedStable() const
Returns track hypothesis.

◆ collect() [2/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here.

Reimplemented from CalibrationCollectorModule.

Definition at line 91 of file TOPAsicShiftsBS13dCollectorModule.cc.

92  {
93 
94  if (m_requireRecBunch) {
95  if (not m_recBunch.isValid()) return;
96  if (not m_recBunch->isReconstructed()) return;
97  }
98 
99  auto time_vs_BS = getObjectPtr<TH2F>("time_vs_BS");
100  auto timeReference = getObjectPtr<TH1F>("time_reference");
101  std::vector<TH1F*> timeCarriers;
102  for (unsigned i = 0; i < 4; i++) {
103  string name = "time_carr_" + to_string(i);
104  auto h = getObjectPtr<TH1F>(name);
105  timeCarriers.push_back(h);
106  }
107 
108  for (const auto& digit : m_topDigits) {
109  if (digit.getModuleID() != 13) continue;
110  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
111  double time = digit.getTime() - m_timeOffset;
112  time_vs_BS->Fill(digit.getChannel(), time);
113  if (digit.getBoardstackNumber() < 3) {
114  timeReference->Fill(time);
115  } else {
116  auto c = digit.getCarrierNumber();
117  timeCarriers[c]->Fill(time);
118  }
119  }
120 
121  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
bool m_requireRecBunch
if true, require reconstructed bunch
StoreArray< TOPDigit > m_topDigits
collection of TOP digits

◆ collect() [3/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 70 of file TOPChannelMaskCollectorModule.cc.

71  {
72 
73  std::vector<TH1F*> slots;
74  for (const auto& name : m_names) {
75  auto h = getObjectPtr<TH1F>(name);
76  slots.push_back(h);
77  }
78 
79  std::vector<TH2F*> asics;
80  for (const auto& name : m_asicNames) {
81  auto h = getObjectPtr<TH2F>(name);
82  asics.push_back(h);
83  }
84 
85  int NGood = 0;
86  for (const auto& digit : m_digits) {
87  if (digit.getHitQuality() == TOPDigit::c_Junk) continue;
88  NGood++;
89  unsigned m = digit.getModuleID() - 1;
90  if (m < slots.size()) slots[m]->Fill(digit.getChannel());
91  if (m < asics.size()) asics[m]->Fill(digit.getChannel() / 8, digit.getRawTime() / 64 + 220);
92  }
93 
94  auto h = getObjectPtr<TH1F>("nhits");
95  h->Fill(NGood);
96 
97  }
std::vector< std::string > m_asicNames
histogram names: window vs.
std::vector< std::string > m_names
histogram names: channel occupancies
StoreArray< TOPDigit > m_digits
collection of TOP digits

◆ collect() [4/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 68 of file TOPCommonT0BFCollectorModule.cc.

69  {
70 
71  if (not m_recBunch.isValid()) return;
72  if (not m_recBunch->isReconstructed()) return;
73  if (m_recBunch->getNumTracks() != 2) return;
74 
75  auto h1a = getObjectPtr<TH1F>("offset_a");
76  auto h1b = getObjectPtr<TH1F>("offset_b");
77  auto offset = m_recBunch->getCurrentOffset();
78  if (m_commonT0->isCalibrated()) offset += m_commonT0->getT0();
79 
80  // wrap-around into [-1/2, 1/2] of bunch cycle
81  auto a = offset - round(offset / m_bunchTimeSep) * m_bunchTimeSep;
82  h1a->Fill(a);
83 
84  // wrap-around into [0, 1] of bunch cycle
85  auto b = offset - round(offset / m_bunchTimeSep - 0.5) * m_bunchTimeSep;
86  h1b->Fill(b);
87 
88  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
double m_bunchTimeSep
bunch separation in time [ns]

◆ collect() [5/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 148 of file TOPCommonT0LLCollectorModule.cc.

149  {
150  // bunch must be reconstructed
151 
152  if (not m_recBunch.isValid()) return;
153  if (not m_recBunch->isReconstructed()) return;
154 
156  double timeMin = TOPRecoManager::getMinTime();
157  double timeMax = TOPRecoManager::getMaxTime();
158 
159  // correct-back digits for common T0
160 
161  double T0 = 0;
162  if (m_commonT0->isCalibrated()) T0 = m_commonT0->getT0();
163  for (auto& digit : m_digits) {
164  if (digit.isCommonT0Calibrated()) digit.subtractT0(-T0);
165  if (digit.hasStatus(TOPDigit::c_BunchOffsetSubtracted)) digit.subtractT0(-m_recBunch->getAverageOffset());
166  }
167 
168  // loop over reconstructed tracks, make a selection and accumulate log likelihoods
169 
170  int ntra = 0;
171  for (const auto& track : m_tracks) {
172 
173  // track selection
174  TOPTrack trk(track);
175  if (not trk.isValid()) continue;
176 
177  if (not m_selector.isSelected(trk)) continue;
178 
179  // construct PDF
180  PDFConstructor pdfConstructor(trk, m_selector.getChargedStable(), m_PDFOption);
181  if (not pdfConstructor.isValid()) continue;
182 
183  // minimization procedure: accumulate
184  int sub = gRandom->Integer(c_numSets); // generate sub-sample number
185  auto h = getObjectPtr<TH1D>(m_names[sub]);
186  for (int ibin = 0; ibin < h->GetNbinsX(); ibin++) {
187  double t0 = h->GetBinCenter(ibin + 1);
188  double chi = h->GetBinContent(ibin + 1);
189  chi += -2 * pdfConstructor.getLogL(t0, m_sigmaSmear).logL;
190  h->SetBinContent(ibin + 1, chi);
191  }
192  auto h1 = getObjectPtr<TH1F>("tracks_per_set");
193  h1->Fill(sub);
194 
195  // fill histograms of hits
196  auto h2 = getObjectPtr<TH1F>("numHits");
197  auto h3 = getObjectPtr<TH2F>("timeHits");
198  for (const auto& digit : m_digits) {
199  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
200  if (digit.getModuleID() != trk.getModuleID()) continue;
201  if (digit.getTime() < timeMin) continue;
202  if (digit.getTime() > timeMax) continue;
203  h2->Fill(digit.getModuleID());
204  int bs = digit.getBoardstackNumber();
205  h3->Fill((digit.getModuleID() * 4 + bs - 1.5) / 4.0, digit.getTime());
206  }
207  ntra++;
208  }
209 
210  // fill just another control histogram
211 
212  if (ntra > 0) {
213  auto h4 = getObjectPtr<TH1F>("offset");
214  h4->Fill(m_recBunch->getCurrentOffset());
215  }
216 
217  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
double m_sigmaSmear
additional smearing of PDF in [ns]
@ c_numSets
number of statistically independent subsamples
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
TOP::PDFConstructor::EPDFOption m_PDFOption
PDF option.
std::vector< std::string > m_names
histogram names of chi2 scans
StoreArray< Track > m_tracks
collection of tracks
StoreArray< TOPDigit > m_digits
collection of digits
static void setDefaultTimeWindow()
Sets default time window (functions getMinTime(), getMaxTime() will then return default values from D...
static double getMaxTime()
Returns time window upper edge.
static double getMinTime()
Returns time window lower edge.

◆ collect() [6/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 78 of file TOPModuleT0DeltaTCollectorModule.cc.

79  {
80 
81  if (m_timeZeros.getEntries() != 2) return;
82 
83  const auto* timeZero1 = m_timeZeros[0];
84  const auto* timeZero2 = m_timeZeros[1];
85  if (timeZero1->getModuleID() > timeZero2->getModuleID()) {
86  timeZero1 = m_timeZeros[1];
87  timeZero2 = m_timeZeros[0];
88  }
89 
90  int slot1 = timeZero1->getModuleID();
91  int slot2 = timeZero2->getModuleID();
92  if (slot1 > 9 or slot2 - slot1 < 7 or slot2 - slot1 > 9) return;
93  string name = "deltaT0_" + to_string(slot1) + "-" + to_string(slot2);
94  auto h = getObjectPtr<TH1F>(name);
95  if (not h) return;
96 
97  double t1 = timeZero1->getTime();
98  if (m_moduleT0->isCalibrated(slot1)) t1 += m_moduleT0->getT0(slot1);
99  double t2 = timeZero2->getTime();
100  if (m_moduleT0->isCalibrated(slot2)) t2 += m_moduleT0->getT0(slot2);
101  h->Fill(t1 - t2);
102 
103  auto slotPairs = getObjectPtr<TH2F>("slots");
104  slotPairs->Fill(slot1, slot2);
105  }
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants
StoreArray< TOPTimeZero > m_timeZeros
collection of TOP time zero's

◆ collect() [7/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 150 of file TOPModuleT0LLCollectorModule.cc.

151  {
152  // bunch must be reconstructed
153 
154  if (not m_recBunch.isValid()) return;
155  if (not m_recBunch->isReconstructed()) return;
156 
158  double timeMin = TOPRecoManager::getMinTime();
159  double timeMax = TOPRecoManager::getMaxTime();
160 
161  // correct-back digits for module T0
162 
163  for (auto& digit : m_digits) {
164  int slot = digit.getModuleID();
165  if (digit.isModuleT0Calibrated()) digit.subtractT0(-m_moduleT0->getT0(slot));
166  if (digit.hasStatus(TOPDigit::c_BunchOffsetSubtracted)) digit.subtractT0(-m_recBunch->getAverageOffset());
167  }
168 
169  // loop over reconstructed tracks, make a selection and accumulate log likelihoods
170 
171  int ntra = 0;
172  for (const auto& track : m_tracks) {
173 
174  // track selection
175  TOPTrack trk(track);
176  if (not trk.isValid()) continue;
177 
178  if (not m_selector.isSelected(trk)) continue;
179 
180  // construct PDF
181  PDFConstructor pdfConstructor(trk, m_selector.getChargedStable(), m_PDFOption);
182  if (not pdfConstructor.isValid()) continue;
183 
184  // minimization procedure: accumulate
185  int sub = gRandom->Integer(c_numSets); // generate sub-sample number
186  unsigned module = trk.getModuleID() - 1;
187  if (module >= m_names[sub].size()) continue;
188  auto h = getObjectPtr<TH1D>(m_names[sub][module]);
189  for (int ibin = 0; ibin < h->GetNbinsX(); ibin++) {
190  double t0 = h->GetBinCenter(ibin + 1);
191  double chi = h->GetBinContent(ibin + 1);
192  chi += -2 * pdfConstructor.getLogL(t0, m_sigmaSmear).logL;
193  h->SetBinContent(ibin + 1, chi);
194  }
195  auto h1 = getObjectPtr<TH2F>("tracks_per_slot");
196  h1->Fill(trk.getModuleID(), sub);
197 
198  // fill histograms of hits
199  auto h2 = getObjectPtr<TH1F>("numHits");
200  auto h3 = getObjectPtr<TH2F>("timeHits");
201  for (const auto& digit : m_digits) {
202  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
203  if (digit.getModuleID() != trk.getModuleID()) continue;
204  if (digit.getTime() < timeMin) continue;
205  if (digit.getTime() > timeMax) continue;
206  h2->Fill(digit.getModuleID());
207  int bs = digit.getBoardstackNumber();
208  h3->Fill((digit.getModuleID() * 4 + bs - 1.5) / 4.0, digit.getTime());
209  }
210  ntra++;
211  }
212 
213  // fill just another control histogram
214 
215  if (ntra > 0) {
216  auto h4 = getObjectPtr<TH1F>("offset");
217  h4->Fill(m_recBunch->getCurrentOffset());
218  }
219 
220  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
double m_sigmaSmear
additional smearing of PDF in [ns]
TOP::PDFConstructor::EPDFOption m_PDFOption
PDF option.
StoreArray< Track > m_tracks
collection of tracks
@ c_numSets
number of statistically independent subsamples
StoreArray< TOPDigit > m_digits
collection of digits
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants
std::vector< std::string > m_names[c_numSets]
histogram names of chi2 scans

◆ collect() [8/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 61 of file TOPOffsetCollectorModule.cc.

62  {
63  if (m_firstEvent) {
64  m_firstEvent = false;
65  if (m_bunchStructure->isSet()) {
66  auto h = getObjectPtr<TH1F>("fillPattern");
67  int RFBuckets = m_bunchStructure->getRFBucketsPerRevolution();
68  for (int i = 0; i < RFBuckets; i++) {
69  if (m_bunchStructure->getBucket(i)) h->SetBinContent(i + 1, 1);
70  }
71  }
72  }
73 
74  if (not m_recBunch->isReconstructed()) return;
75 
76  for (const auto& x : m_names) {
77  const auto& detector = x.first;
78  if (m_eventT0->hasTemporaryEventT0(detector)) {
79  auto eventT0s = m_eventT0->getTemporaryEventT0s(detector);
80  if (eventT0s.empty()) continue;
81  if (detector == Const::CDC and eventT0s.back().algorithm != "chi2") continue;
82  double t0 = eventT0s.back().eventT0;
83  auto h = getObjectPtr<TH1F>(x.second);
84  h->Fill(t0 - m_recBunch->getTime());
85  }
86  }
87 
88  auto h = getObjectPtr<TH1F>("recBuckets");
89  h->Fill(m_recBunch->getBucketNumber(0, m_bunchStructure->getRFBucketsPerRevolution()));
90  }
std::map< Const::EDetector, std::string > m_names
histogram names
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
StoreObjPtr< EventT0 > m_eventT0
event T0
DBObjPtr< BunchStructure > m_bunchStructure
fill pattern

◆ collect() [9/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 171 of file TOPPhotonYieldsCollectorModule.cc.

172  {
173  // bunch must be reconstructed
174 
175  if (not m_recBunch->isReconstructed()) return;
176 
177  // loop over reconstructed tracks, make a selection and fill histograms
178 
179  for (const auto& track : m_tracks) {
180  // track selection
181  TOPTrack trk(track);
182  if (not trk.isValid()) continue;
183  if (not m_selector.isSelected(trk)) continue;
184 
185  // fill histograms
186  auto timeStamp = getObjectPtr<TProfile>("timeStamp");
187  timeStamp->Fill(0.5, m_eventMetaData->getTime() / 1000000000);
188 
189  int slot = trk.getModuleID();
190  auto numTracks = getObjectPtr<TH1F>("numTracks");
191  numTracks->Fill(slot);
192 
193  auto muonZ = getObjectPtr<TH1F>(m_muonZNames[slot - 1]);
194  muonZ->Fill(m_selector.getLocalPosition().Z());
195 
196  auto signalHits = getObjectPtr<TH1F>(m_signalNames[slot - 1]);
197  auto bkgHits = getObjectPtr<TH1F>(m_bkgNames[slot - 1]);
198  auto pulseHeight = getObjectPtr<TH2F>(m_pulseHeightNames[slot - 1]);
199  for (const auto& digit : m_digits) {
200  if (digit.getModuleID() != slot) continue;
201  if (digit.getHitQuality() != TOPDigit::c_Good) continue; // junk hit or pixel masked-out
202  if (not m_thresholdEff->isCalibrated(slot, digit.getChannel())) continue; // threshold effi. not calibrated
203  double effi = m_thresholdEff->getThrEff(slot, digit.getChannel());
204  if (effi < m_minThresholdEffi) continue; // to suppress possibly unreliable calibration
205  if (std::abs(digit.getTime()) > m_timeWindow) continue;
206  // fill signal and background hits with weight=1/effi to correct for threshold efficiency
207  if (digit.getTime() > 0) {
208  signalHits->Fill(digit.getPixelID(), 1 / effi);
209  pulseHeight->Fill(digit.getPixelID(), digit.getPulseHeight());
210  } else {
211  bkgHits->Fill(digit.getPixelID(), 1 / effi);
212  }
213  }
214 
215  auto activePixels = getObjectPtr<TH1F>(m_activeNames[slot - 1]);
216  const auto& chMapper = TOPGeometryPar::Instance()->getChannelMapper();
217  for (int pixel = 1; pixel <= activePixels->GetNbinsX(); pixel++) {
218  unsigned channel = chMapper.getChannel(pixel);
219  if (not m_thresholdEff->isCalibrated(slot, channel)) continue; // pixel excluded in counting hits
220  if (m_thresholdEff->getThrEff(slot, channel) < m_minThresholdEffi) continue; // pixel excluded in counting hits
221  if (m_channelMask->isActive(slot, channel) and m_asicMask->isActive(slot, channel)) activePixels->Fill(pixel);
222  }
223 
224  if (std::abs(m_selector.getLocalPosition().Z()) > m_excludedZ) {
225  auto alphaLow = getObjectPtr<TH1F>(m_alphaLowNames[slot - 1]);
226  auto alphaHigh = getObjectPtr<TH1F>(m_alphaHighNames[slot - 1]);
227  for (const auto& digit : m_digits) {
228  if (digit.getModuleID() != slot) continue;
229  if (digit.getHitQuality() != TOPDigit::c_Good) continue; // junk hit or pixel masked-out
230  const auto* pdf = digit.getRelated<TOPAssociatedPDF>();
231  if (not pdf) continue;
232  const auto* peak = pdf->getSinglePeak();
233  if (not peak) continue; // hit associated with background
234  double alpha = acos(std::abs(peak->kzd)) / Unit::deg;
235  if (alpha > 60) continue;
236  if (alpha < 30) alphaLow->Fill(digit.getPixelID());
237  else alphaHigh->Fill(digit.getPixelID());
238  }
239  }
240  }
241 
242  }
DBObjPtr< TOPCalChannelMask > m_channelMask
masked channels
double m_minThresholdEffi
minimal threshold efficiency
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
std::vector< std::string > m_activeNames
histogram names for active pixels count
std::vector< std::string > m_alphaHighNames
histogram names for counting hits w/ high impact angle on photo cathode
std::vector< std::string > m_pulseHeightNames
histogram names for pulse heights
DBObjPtr< TOPCalChannelThresholdEff > m_thresholdEff
threshold efficiencies
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data object
std::vector< std::string > m_muonZNames
histogram names for track z-distribution
std::vector< std::string > m_alphaLowNames
histogram names for counting hits w/ low impact angle on photo cathode
const double m_timeWindow
time window for counting photon hits (half size)
StoreArray< Track > m_tracks
collection of tracks
const double m_excludedZ
excluded central region of extrapolated track for photon impact angle counting
std::vector< std::string > m_signalNames
histogram names for signal window hit counts
std::vector< std::string > m_bkgNames
histogram names for background window hit counts
StoreArray< TOPDigit > m_digits
collection of TOP digits
StoreObjPtr< TOPAsicMask > m_asicMask
online masked Asics
static const double deg
degree to radians
Definition: Unit.h:109

◆ collect() [10/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 90 of file TOPPulseHeightCollectorModule.cc.

91  {
92 
93  std::vector<TH2F*> slots;
94  for (const auto& name : m_names) {
95  auto h = getObjectPtr<TH2F>(name);
96  slots.push_back(h);
97  }
98 
99  auto h1a = getObjectPtr<TH1F>("time");
100  auto h1b = getObjectPtr<TH1F>("time_sel");
101  auto h2a = getObjectPtr<TH2F>("ph_vs_width");
102  auto h2b = getObjectPtr<TH2F>("ph_vs_width_sel");
103 
104  for (const auto& digit : m_digits) {
105  if (digit.getHitQuality() != TOPDigit::c_Good) continue;
106  auto t = digit.getTime();
107  auto w = digit.getPulseWidth();
108  auto ph = digit.getPulseHeight();
109  h1a->Fill(t);
110  h2a->Fill(w, ph);
111  if (m_widthWindow.size() == 2) {
112  if (w < m_widthWindow[0] or w > m_widthWindow[1]) continue;
113  }
114  if (m_timeWindow.size() == 2) {
115  if (t < m_timeWindow[0] or t > m_timeWindow[1]) continue;
116  }
117  h1b->Fill(t);
118  h2b->Fill(w, ph);
119  unsigned m = digit.getModuleID() - 1;
120  if (m < slots.size()) slots[m]->Fill(digit.getChannel(), ph);
121  }
122 
123  }
std::vector< std::string > m_names
histogram names
std::vector< double > m_widthWindow
lower and upper bound of pulse-width window
std::vector< double > m_timeWindow
lower and upper bound of time window
StoreArray< TOPDigit > m_digits
collection of TOP digits

◆ collect() [11/11]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 233 of file TOPValidationCollectorModule.cc.

◆ defineHisto() [1/3]

void defineHisto ( )
overridevirtual

Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....

are supposed to be placed in this function.

Reimplemented from HistoModule.

Definition at line 59 of file TOPDQMModule.cc.

◆ defineHisto() [2/3]

void defineHisto ( )
overridevirtual

Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....

are supposed to be placed in this function.

Reimplemented from HistoModule.

Definition at line 69 of file TOPPDFCheckerModule.cc.

70  {
71 
72  // time vs. pixel ID
73  m_hits = new TH2F("hits", "photon hits", 512, 0.5, 512.5,
75  m_hits->SetXTitle("pixel ID");
76  m_hits->SetYTitle("time [ns]");
77 
78  m_pdf = new TH2F("pdf", "PDF", 512, 0.5, 512.5,
80  m_pdf->SetXTitle("pixel ID");
81  m_pdf->SetYTitle("time [ns]");
82 
83  // time vs pixel column
84  m_hitsCol = new TH2F("hitsCol", "photon hits", 64, 0.5, 64.5,
86  m_hitsCol->SetXTitle("pixel column");
87  m_hitsCol->SetYTitle("time [ns]");
88 
89  m_pdfCol = new TH2F("pdfCol", "PDF", 64, 0.5, 64.5,
91  m_pdfCol->SetXTitle("pixel column");
92  m_pdfCol->SetYTitle("time [ns]");
93 
94  }
TH2F * m_pdfCol
histogram of PDF projected to pixel columns
TH2F * m_hits
histogram of photon hits
double m_maxTime
histogram upper bound in time [ns]
double m_minTime
histogram lower bound in time [ns]
TH2F * m_hitsCol
histogram of photon hits projected to pixel columns
int m_numBins
number of bins in time
TH2F * m_pdf
histogram of PDF

◆ defineHisto() [3/3]

void defineHisto ( )
overridevirtual

Defining the histograms.

Reads once the m_inputDirectoryList to initialize the proper amount of histograms. Every new histogram added to the module has to be initialized here.

Reimplemented from HistoModule.

Definition at line 61 of file TOPTBCComparatorModule.cc.

◆ drawWaveforms()

void drawWaveforms ( const TOPRawWaveform rawwave)

Draws the full waveforms onto the TProfiles.

Parameters
rawwavethe raw waveform

Definition at line 111 of file TOPWaveformQualityPlotterModule.cc.

◆ DummyFillBranch()

void DummyFillBranch ( EHistogramType  LoadHisto)

Fill Dummy for Branch.

Use it when there aren't 2D-Histogram.

Definition at line 432 of file TOPGainEfficiencyCalculatorModule.cc.

433  {
434  m_fitMax = -1;
435  m_hitTiming = -1;
436  m_hitTimingSigma = -1;
437  m_nEntries = -1;
438  m_nCalPulse = -1;
439  m_nOverflowEvents = -1;
440  m_meanPulseHeight = -1;
442  m_gain = -1;
443  m_efficiency = -1;
444  m_p0 = -1;
445  m_p1 = -1;
446  m_p2 = -1;
447  m_x0 = -1;
448  m_p0Error = -1;
449  m_p1Error = -1;
450  m_p2Error = -1;
451  m_x0Error = -1;
452  m_chisquare = -1;
453  m_ndf = -1;
458 
459  for (auto itr = m_branch[LoadHisto].begin(); itr != m_branch[LoadHisto].end(); ++itr) {
460  (*itr)->Fill();
461  }
462  }
float m_efficiency
calculated efficiency from fitting of pulse charge distribution
int m_nEntries
entries of pulse charge distribution
float m_funcFitRangeIntegral
integral of fit function for a range [threshold, fitMax]
float m_fitMax
upper limit of fit region for pulse charge distribution, determined based on m_fracFit value
float m_gain
calculated gain from fitting of pulse charge distribution
std::vector< TBranch * > m_branch[4]
ntuple to store summary of gain using height distribution.
int m_nCalPulse
the number of events with calibration pulse(s) identified
float m_funcFullRangeIntegral
integral of fit function for its full range
float m_histoFitRangeIntegral
integral of histogram for a range [threshold, fitMax]
float m_meanPulseHeight
histogram mean of pulse height distribution
float m_hitTimingSigma
Gaussian fit sigma for a peak of laser direct photons in hit timing distribution.
float m_meanPulseHeightError
histogram mean error of pulse height distribution
float m_histoMeanAboveThre
mean of histogram above threshold, ignore overflow bin
float m_hitTiming
timing of laser direct photon hits, given by Gaussian fit mean
int m_nOverflowEvents
the number of events outside histogram range

◆ endRun() [1/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 400 of file TOPBackgroundModule.cc.

◆ endRun() [2/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 219 of file TOPDoublePulseGeneratorModule.cc.

◆ endRun() [3/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 256 of file TOPLaserHitSelectorModule.cc.

◆ endRun() [4/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 331 of file TOPInterimFENtupleModule.cc.

◆ endRun() [5/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 109 of file TOPLaserCalibratorModule.cc.

◆ endRun() [6/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 142 of file TOPMCTrackMakerModule.cc.

◆ endRun() [7/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 246 of file TOPNtupleModule.cc.

◆ endRun() [8/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 123 of file TOPPackerModule.cc.

◆ endRun() [9/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 477 of file TOPRawDigitConverterModule.cc.

◆ endRun() [10/14]

void endRun ( void  )
overridevirtual

End-of-run action.

The main analysis loop over the calibration sets happens here. This function has to be modified only if the directory structure of the TOPTimeBaseCalibrator module output is changed Both the core functions analyzeCalFile() and makeComparisons() are called here.

Reimplemented from HistoModule.

Definition at line 356 of file TOPTBCComparatorModule.cc.

◆ endRun() [11/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 216 of file TOPTimeBaseCalibratorModule.cc.

◆ endRun() [12/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 1245 of file TOPUnpackerModule.cc.

◆ endRun() [13/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 140 of file TOPWaveformFeatureExtractorModule.cc.

◆ endRun() [14/14]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 181 of file TOPWaveformQualityPlotterModule.cc.

◆ event()

void event ( void  )
overridevirtual

Event processor.

Convert TOPSimHits of the event to TOPHits.

Reimplemented from Module.

Definition at line 202 of file TOPBackgroundModule.cc.

◆ generatePulseHeight()

double generatePulseHeight ( int  moduleID,
int  pixelID 
) const
private

Generates and returns pulse height.

Parameters
moduleIDmodule ID (1-based)
pixelIDpixel ID (1-based)
Returns
pulse height [ADC counts]

Definition at line 533 of file TOPDigitizerModule.cc.

534  {
535  if (m_useDatabase) {
536  const auto& channelMapper = TOPGeometryPar::Instance()->getChannelMapper();
537  auto channel = channelMapper.getChannel(pixelID);
538  if (m_pulseHeights->isCalibrated(moduleID, channel)) {
539  const auto& par = m_pulseHeights->getParameters(moduleID, channel);
540  PulseHeightGenerator generator(par.x0, par.p1, par.p2, m_ADCmax);
541  return generator.generate();
542  }
543  }
544 
546  }
TOP::PulseHeightGenerator m_pulseHeightGenerator
default generator
double m_ADCmax
pulse height upper bound of range [ADC counts]
bool m_useDatabase
if true, use calibration constants from database
DBObjPtr< TOPCalChannelPulseHeight > m_pulseHeights
pulse height param.
double generate() const
Returns generated pulse height.

◆ getDirectionCustom()

XYZVector getDirectionCustom ( ) const
private

Return photon direction according to a custom angular distribution given by TFormula.

Returns
photon direction (unit vector)

Definition at line 269 of file OpticalGunModule.cc.

270  {
271  double alpha = m_customDistribution->GetRandom();
272  double phi = 2.0 * M_PI * gRandom->Rndm();
273  return XYZVector(cos(phi) * sin(alpha), sin(phi) * sin(alpha), cos(alpha));
274  }
TF1 * m_customDistribution
Custom angular distribution, that uses m_angularDistribution as formula.

◆ getDirectionGaussian()

XYZVector getDirectionGaussian ( ) const
private

Return photon direction according to a projected 2D gaussian distribution based on numerical aperture NA.

Returns
photon direction (unit vector)

Definition at line 237 of file OpticalGunModule.cc.

◆ getDirectionLambertian()

XYZVector getDirectionLambertian ( ) const
private

Return photon direction according to a lambertian distribution with opening angle alpha.

Returns
photon direction (unit vector)

Definition at line 260 of file OpticalGunModule.cc.

◆ getDirectionUniform()

XYZVector getDirectionUniform ( ) const
private

Return photon direction according to a projected uniform distribution with opening angle alpha.

Be careful.

Returns
photon direction (unit vector)

Definition at line 252 of file OpticalGunModule.cc.

◆ getFrontEndName()

std::string getFrontEndName ( RawTOP raw,
int  finesse 
) const
private

Returns the name of the front-end.

Parameters
rawraw data
finessefinesse number
Returns
front-end name

Definition at line 219 of file TOPUnpackerModule.cc.

◆ getModuleID()

int getModuleID ( const Track track) const
private

Returns slot ID of the module that is hit by the track.

Parameters
trackcharged track
Returns
slotID or 0 if track does not hit any module

Definition at line 515 of file TOPDQMModule.cc.

◆ getMostProbable()

Const::ChargedStable getMostProbable ( const Track track)
private

Returns most probable charged stable particle according to dEdx and predefined prior probabilities.

Parameters
trackreconstructed track
Returns
charged stable

Definition at line 564 of file TOPBunchFinderModule.cc.

565  {
566 
567  std::vector<double> logL;
568  std::vector<double> priors;
569 
570  if (m_usePIDLikelihoods) {
571  const auto* pid = track.getRelated<PIDLikelihood>();
572  if (not pid) {
573  m_nodEdxCount++;
574  return Const::pion;
575  }
576  auto subset = Const::PIDDetectorSet(Const::SVD);
577  subset += Const::PIDDetectorSet(Const::CDC);
578  for (const auto& type : Const::chargedStableSet) {
579  logL.push_back(pid->getLogL(type, subset));
580  priors.push_back(m_priors[abs(type.getPDGCode())]);
581  }
582  } else {
583  const auto* cdcdedx = track.getRelated<CDCDedxLikelihood>();
584  const auto* vxddedx = track.getRelated<VXDDedxLikelihood>();
585  if (not cdcdedx and not vxddedx) {
586  m_nodEdxCount++;
587  return Const::pion;
588  }
589  for (const auto& type : Const::chargedStableSet) {
590  if (cdcdedx and vxddedx) {
591  logL.push_back(cdcdedx->getLogL(type) + vxddedx->getLogL(type));
592  } else if (cdcdedx) {
593  logL.push_back(cdcdedx->getLogL(type));
594  } else {
595  logL.push_back(vxddedx->getLogL(type));
596  }
597  priors.push_back(m_priors[abs(type.getPDGCode())]);
598  }
599  }
600 
601  // get maximal logL
602  auto logL_max = logL[0];
603  for (auto x : logL) {
604  if (x > logL_max) logL_max = x;
605  }
606 
607  // calculate probabilities, normalizaton is not needed
608  std::vector<double> probability(logL.size());
609  for (unsigned i = 0; i < logL.size(); ++i) {
610  probability[i] = exp(logL[i] - logL_max) * priors[i];
611  }
612 
613  // find most probable
614  unsigned i0 = 0;
615  for (unsigned i = 0; i < probability.size(); ++i) {
616  if (probability[i] > probability[i0]) i0 = i;
617  }
618  return Const::chargedStableSet.at(i0);
619 
620  }
const ParticleType & at(unsigned int index) const
Return particle at given index, or end() if out of range.
Definition: Const.h:540
RestrictedDetectorSet< PIDDetectors > PIDDetectorSet
Typedef for set of PID detectors.
Definition: Const.h:370
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:609
static const ChargedStable pion
charged pion particle
Definition: Const.h:652
int m_nodEdxCount
counter of tracks with no dEdx, reset at each event
bool m_usePIDLikelihoods
if true, use PIDLikelihoods (only on cdst files)
std::map< int, double > m_priors
map of PDG codes to prior probabilities
std::bitset< max - min+1 > subset(std::bitset< nbits > set)
extract a subset of bitstring, like substring.
Definition: Cosim.h:120

◆ getReferenceTiming()

void getReferenceTiming ( )
private

Find reference timing.

In case that the waveform analysis is enabled, try to find a pair of calibration pulses and timing of the first one is used as reference timing for the correcponding asic. If not enabled, feature extracted timing for a calibration channel is used.

Definition at line 339 of file TOPInterimFENtupleModule.cc.

◆ getTimeOffset()

TOPDigitizerModule::TimeOffset getTimeOffset ( double  trgOffset,
int  moduleID,
int  pixelID 
)
private

Returns a complete time offset by adding time mis-calibration to trgOffset.

Parameters
trgOffsettrigger related time offset
moduleIDslot ID
pixelIDpixel ID
Returns
time offset and its error squared

Definition at line 496 of file TOPDigitizerModule.cc.

◆ getTimeSeed()

TOPBunchFinderModule::TimeSeed getTimeSeed ( )
private

Returns a time seed.

Returns
time seed

Definition at line 643 of file TOPBunchFinderModule.cc.

◆ initialize() [1/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 90 of file OpticalGunModule.cc.

◆ initialize() [2/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 87 of file TOPAlignerModule.cc.

88  {
89  // check if target module ID is valid
90 
91  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
92  if (not geo->isModuleIDValid(m_targetMid)) {
93  B2ERROR("Target module ID = " << m_targetMid << " is invalid.");
94  }
95 
96  // check if sample type is valid
97 
98  if (not(m_sample == "dimuon" or m_sample == "bhabha" or m_sample == "cosmics")) {
99  B2ERROR("Invalid sample type '" << m_sample << "'");
100  }
101  if (m_sample == "bhabha") m_chargedStable = Const::electron;
102 
103  // set track selector
104 
105  m_selector = TrackSelector(m_sample);
110 
111  // set alignment object
112 
116  for (const auto& parName : m_parFixed) {
117  m_align.fixParameter(parName);
118  }
119 
120  // input
121 
122  m_digits.isRequired();
123  m_tracks.isRequired();
124  m_extHits.isRequired();
125  m_recBunch.isOptional();
126 
127  // open output file
128 
129  m_file = TFile::Open(m_outFileName.c_str(), "RECREATE");
130  if (m_file->IsZombie()) {
131  B2FATAL("Couldn't open file '" << m_outFileName << "' for writing!");
132  return;
133  }
134 
135  // create output tree
136 
137  m_alignTree = new TTree("alignTree", "TOP alignment results");
138  m_alignTree->Branch("ModuleId", &m_targetMid);
139  m_alignTree->Branch("iter", &m_iter);
140  m_alignTree->Branch("ntrk", &m_ntrk);
141  m_alignTree->Branch("errorCode", &m_errorCode);
142  m_alignTree->Branch("iterPars", &m_vAlignPars);
143  m_alignTree->Branch("iterParsErr", &m_vAlignParsErr);
144  m_alignTree->Branch("valid", &m_valid);
145  m_alignTree->Branch("numPhot", &m_numPhot);
146  m_alignTree->Branch("x", &m_x);
147  m_alignTree->Branch("y", &m_y);
148  m_alignTree->Branch("z", &m_z);
149  m_alignTree->Branch("p", &m_p);
150  m_alignTree->Branch("theta", &m_theta);
151  m_alignTree->Branch("phi", &m_phi);
152  m_alignTree->Branch("r_poca", &m_pocaR);
153  m_alignTree->Branch("z_poca", &m_pocaZ);
154  m_alignTree->Branch("x_poca", &m_pocaX);
155  m_alignTree->Branch("y_poca", &m_pocaY);
156  m_alignTree->Branch("Ecms", &m_cmsE);
157  m_alignTree->Branch("charge", &m_charge);
158  m_alignTree->Branch("PDG", &m_PDG);
159 
160  }
static const ChargedStable electron
electron particle
Definition: Const.h:650
std::vector< float > m_vAlignParsErr
error on alignment parameters
Const::ChargedStable m_chargedStable
track hypothesis
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::TrackSelector m_selector
track selection utility
int m_PDG
track MC truth (simulated data only)
float m_phi
track: extrapolated hit momentum in local (module) frame
double m_minMomentum
minimal track momentum if sample is "cosmics"
std::vector< float > m_vAlignPars
alignment parameters
double m_dz
cut on POCA in z
std::vector< std::string > m_parFixed
names of parameters to be fixed
double m_stepTime
step size for t0
int m_targetMid
target module to align.
TOP::ModuleAlignment m_align
alignment object
double m_maxZ
maximal local z of extrapolated hit
int m_iter
iteration counter
double m_stepPosition
step size for translations
double m_minZ
minimal local z of extrapolated hit
float m_p
track: extrapolated hit momentum in local (module) frame
bool m_valid
true if alignment parameters are valid
double m_dr
cut on POCA in r
StoreArray< Track > m_tracks
collection of tracks
int m_errorCode
error code of the alignment procedure
double m_stepAngle
step size for rotations
std::vector< double > m_parInit
initial parameter values
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
int m_numPhot
number of photons used for log likelihood in this iteration
float m_y
track: extrapolated hit coordinate in local (module) frame
StoreArray< TOPDigit > m_digits
collection of digits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
TTree * m_alignTree
TTree containing alignment parameters.
std::string m_outFileName
Root output file name containing results.
float m_z
track: extrapolated hit coordinate in local (module) frame
float m_x
track: extrapolated hit coordinate in local (module) frame
std::string m_sample
sample type
int m_ntrk
number of tracks used
float m_theta
track: extrapolated hit momentum in local (module) frame
void setModuleID(int moduleID)
Sets module ID.
void fixParameter(const std::string &name)
Fixes parameter with its name given as argument.
void setParameters(const std::vector< double > &parInit)
Sets initial values of parameters (overwrites current parameters!) Order is: translations in x,...
void setSteps(double position, double angle, double time)
Sets steps for numerical calculation of derivatives.
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
void setDeltaEcms(double deltaEcms)
Sets cut on c.m.s.
Definition: TrackSelector.h:63
void setMinMomentum(double minMomentum)
Sets momentum cut (used for "cosmics" only)
Definition: TrackSelector.h:57
void setCutOnPOCA(double dr, double dz)
Sets cut on point of closest approach to (0, 0, 0)
Definition: TrackSelector.h:70
void setCutOnLocalZ(double minZ, double maxZ)
Sets cut on local z coordinate (module frame) of the track extrapolated to TOP.
Definition: TrackSelector.h:81

◆ initialize() [3/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 116 of file TOPBackgroundModule.cc.

◆ initialize() [4/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 111 of file TOPBunchFinderModule.cc.

◆ initialize() [5/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 76 of file TOPChannelT0CalibratorModule.cc.

77  {
78  // input collections
79  m_digits.isRequired();
80  m_tracks.isRequired();
81  m_extHits.isRequired();
82  m_recBunch.isOptional();
83 
84  // Parse PDF option
85  if (m_pdfOption == "rough") {
87  } else if (m_pdfOption == "fine") {
89  } else if (m_pdfOption == "optimal") {
91  } else {
92  B2ERROR("TOPPDFDebuggerModule: unknown PDF option '" << m_pdfOption << "'");
93  }
94 
95  // set track selector
96  m_selector = TrackSelector(m_sample);
101 
102  // minimum finders
103  double tmin = -m_timeRange / 2;
104  double tmax = m_timeRange / 2;
105  for (unsigned i = 0; i < 2; i++) {
106  for (unsigned m = 0; m < c_numModules; m++) {
107  for (unsigned c = 0; c < c_numChannels; c++) {
108  m_finders[i][m][c] = Chi2MinimumFinder1D(m_numBins, tmin, tmax);
109  }
110  }
111  }
112 
113  // if file name includes *'s replace them with a run number
114  auto pos = m_outFileName.find("*");
115  if (pos != std::string::npos) {
116  StoreObjPtr<EventMetaData> evtMetaData;
117  auto run = std::to_string(evtMetaData->getRun());
118  while (run.size() < 5) run = "0" + run;
119  while (pos != std::string::npos) {
120  m_outFileName.replace(pos, 1, run);
121  pos = m_outFileName.find("*");
122  }
123  }
124 
125  // open root file for ntuple and histogram output
126  m_file = TFile::Open(m_outFileName.c_str(), "RECREATE");
127  if (not m_file) {
128  B2ERROR("Cannot open output file '" << m_outFileName << "'");
129  return;
130  }
131 
132  // histograms
133  for (unsigned module = 0; module < c_numModules; module++) {
134  int moduleID = module + 1;
135 
136  std::string slotNum = std::to_string(moduleID);
137  if (moduleID < 10) slotNum = "0" + slotNum;
138 
139  std::string name = "numHits_slot" + slotNum;
140  std::string title = "Number of hits per channel for slot " + slotNum;
141  TH1F h1(name.c_str(), title.c_str(), c_numChannels, 0, c_numChannels);
142  h1.SetXTitle("channel number");
143  h1.SetYTitle("hits per channel");
144  m_hits1D.push_back(h1);
145 
146  name = "timeHits_slot" + slotNum;
147  title = "hit time vs. channel for slot " + slotNum;
148  TH2F h2(name.c_str(), title.c_str(), c_numChannels, 0, c_numChannels,
149  200, 0.0, 20.0);
150  h2.SetXTitle("channel number");
151  h2.SetYTitle("time [ns]");
152  m_hits2D.push_back(h2);
153  }
154 
155  // create output tree
156 
157  m_tree = new TTree("tree", "Channel T0 calibration results");
158  m_tree->Branch("slot", &m_moduleID);
159  m_tree->Branch("numPhotons", &m_numPhotons);
160  m_tree->Branch("x", &m_x);
161  m_tree->Branch("y", &m_y);
162  m_tree->Branch("z", &m_z);
163  m_tree->Branch("p", &m_p);
164  m_tree->Branch("theta", &m_theta);
165  m_tree->Branch("phi", &m_phi);
166  m_tree->Branch("r_poca", &m_pocaR);
167  m_tree->Branch("z_poca", &m_pocaZ);
168  m_tree->Branch("x_poca", &m_pocaX);
169  m_tree->Branch("y_poca", &m_pocaY);
170  m_tree->Branch("Ecms", &m_cmsE);
171  m_tree->Branch("charge", &m_charge);
172  m_tree->Branch("PDG", &m_PDG);
173 
174  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TTree * m_tree
TTree containing selected track parameters etc.
TOP::TrackSelector m_selector
track selection utility
int m_PDG
track MC truth (simulated data only)
float m_phi
track: extrapolated hit momentum in local (module) frame
double m_minMomentum
minimal track momentum if sample is "cosmics"
int m_numBins
number of bins to which search region is divided
int m_numPhotons
number of photons in this slot
double m_maxZ
maximal local z of extrapolated hit
int m_moduleID
slot to which the track is extrapolated to
std::vector< TH1F > m_hits1D
number photon hits in a channel
@ c_numChannels
number of channels per module
TOP::PDFConstructor::EPDFOption m_PDFOption
PDF option.
double m_minZ
minimal local z of extrapolated hit
float m_p
track: extrapolated hit momentum in local (module) frame
StoreArray< Track > m_tracks
collection of tracks
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
double m_timeRange
time range in which to search for the minimum [ns]
float m_y
track: extrapolated hit coordinate in local (module) frame
StoreArray< TOPDigit > m_digits
collection of digits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
std::string m_outFileName
Root output file name containing results.
float m_z
track: extrapolated hit coordinate in local (module) frame
float m_x
track: extrapolated hit coordinate in local (module) frame
TOP::Chi2MinimumFinder1D m_finders[2][c_numModules][c_numChannels]
finders
float m_theta
track: extrapolated hit momentum in local (module) frame
@ c_Optimal
y dependent only where necessary
@ c_Fine
y dependent everywhere
@ c_Rough
no dependence on y

◆ initialize() [6/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 56 of file TOPChannelT0MCModule.cc.

57  {
58 
59  m_digits.isRequired();
60 
61  }
StoreArray< TOPDigit > m_digits
collection of digits

◆ initialize() [7/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 73 of file TOPCommonT0CalibratorModule.cc.

74  {
75  // input collections
76  m_digits.isRequired();
77  m_tracks.isRequired();
78  m_extHits.isRequired();
79  m_recBunch.isOptional();
80 
81  // bunch separation in time
82 
83  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
84  m_bunchTimeSep = geo->getNominalTDC().getSyncTimeBase() / 24;
85 
86  // Parse PDF option
87  if (m_pdfOption == "rough") {
89  } else if (m_pdfOption == "fine") {
91  } else if (m_pdfOption == "optimal") {
93  } else {
94  B2ERROR("TOPPDFDebuggerModule: unknown PDF option '" << m_pdfOption << "'");
95  }
96 
97  // set track selector
98  m_selector = TrackSelector(m_sample);
103 
104  // Chi2 minimum finders
105  double tmin = -m_timeRange / 2;
106  double tmax = m_timeRange / 2;
107  for (unsigned i = 0; i < c_numSets; i++) {
108  m_finders[i] = Chi2MinimumFinder1D(m_numBins, tmin, tmax);
109  }
110 
111  // if file name includes *'s replace them with a run number
112  auto pos = m_outFileName.find("*");
113  if (pos != std::string::npos) {
114  StoreObjPtr<EventMetaData> evtMetaData;
115  auto run = std::to_string(evtMetaData->getRun());
116  while (run.size() < 5) run = "0" + run;
117  while (pos != std::string::npos) {
118  m_outFileName.replace(pos, 1, run);
119  pos = m_outFileName.find("*");
120  }
121  }
122 
123  // open root file for ntuple and histogram output
124  m_file = TFile::Open(m_outFileName.c_str(), "RECREATE");
125  if (not m_file) {
126  B2ERROR("Cannot open output file '" << m_outFileName << "'");
127  return;
128  }
129 
130  // control histograms
131  m_hits1D = TH1F("numHits", "Number of photons per slot",
132  c_numModules, 0.5, static_cast<float>(c_numModules) + 0.5);
133  m_hits1D.SetXTitle("slot number");
134  m_hits1D.SetYTitle("hits per slot");
135 
136  m_hits2D = TH2F("timeHits", "Photon times vs. boardstacks",
137  c_numModules * 4, 0.5, static_cast<float>(c_numModules) + 0.5, 200, 0.0, 20.0);
138  m_hits2D.SetXTitle("slot number");
139  m_hits2D.SetYTitle("time [ns]");
140 
141  // create output tree
142  m_tree = new TTree("tree", "Channel T0 calibration results");
143  m_tree->Branch("slot", &m_moduleID);
144  m_tree->Branch("numPhotons", &m_numPhotons);
145  m_tree->Branch("x", &m_x);
146  m_tree->Branch("y", &m_y);
147  m_tree->Branch("z", &m_z);
148  m_tree->Branch("p", &m_p);
149  m_tree->Branch("theta", &m_theta);
150  m_tree->Branch("phi", &m_phi);
151  m_tree->Branch("r_poca", &m_pocaR);
152  m_tree->Branch("z_poca", &m_pocaZ);
153  m_tree->Branch("x_poca", &m_pocaX);
154  m_tree->Branch("y_poca", &m_pocaY);
155  m_tree->Branch("Ecms", &m_cmsE);
156  m_tree->Branch("charge", &m_charge);
157  m_tree->Branch("PDG", &m_PDG);
158 
159  }
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
TOP::Chi2MinimumFinder1D m_finders[c_numSets]
finders
TTree * m_tree
TTree containing selected track parameters etc.
TOP::TrackSelector m_selector
track selection utility
int m_PDG
track MC truth (simulated data only)
float m_phi
track: extrapolated hit momentum in local (module) frame
double m_minMomentum
minimal track momentum if sample is "cosmics"
int m_numBins
number of bins to which search region is divided
int m_numPhotons
number of photons in this slot
double m_maxZ
maximal local z of extrapolated hit
int m_moduleID
slot to which the track is extrapolated to
TOP::PDFConstructor::EPDFOption m_PDFOption
PDF option.
double m_minZ
minimal local z of extrapolated hit
float m_p
track: extrapolated hit momentum in local (module) frame
StoreArray< Track > m_tracks
collection of tracks
@ c_numSets
number of statistically independent subsamples
double m_deltaEcms
c.m.s energy window if sample is "dimuon" or "bhabha"
double m_timeRange
time range in which to search for the minimum [ns]
float m_y
track: extrapolated hit coordinate in local (module) frame
StoreArray< TOPDigit > m_digits
collection of digits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
std::string m_outFileName
Root output file name containing results.
double m_bunchTimeSep
time between two bunches
TH1F m_hits1D
number of photon hits in a slot
float m_z
track: extrapolated hit coordinate in local (module) frame
float m_x
track: extrapolated hit coordinate in local (module) frame
float m_theta
track: extrapolated hit momentum in local (module) frame

◆ initialize() [8/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 78 of file TOPCosmicT0FinderModule.cc.

79  {
80  // input
81 
82  StoreArray<TOPDigit> topDigits;
83  topDigits.isRequired();
84 
85  StoreArray<Track> tracks;
86  tracks.isRequired();
87 
88  StoreArray<ExtHit> extHits;
89  extHits.isRequired();
90 
91  StoreArray<TOPBarHit> barHits;
92  barHits.isOptional();
93 
94  // output
95 
96  StoreArray<TOPTimeZero> timeZeros;
97  timeZeros.registerInDataStore();
98  timeZeros.registerRelationTo(tracks);
99  timeZeros.registerRelationTo(extHits);
100  timeZeros.registerRelationTo(barHits);
101  }

◆ initialize() [9/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 103 of file TOPDigitizerModule.cc.

◆ initialize() [10/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 68 of file TOPTriggerDigitizerModule.cc.

69  {
70  // input
71  StoreArray<TOPRawWaveform> waveforms;
72  waveforms.isRequired();
73 
74  // output
75  StoreArray<TOPTriggerDigit> digits;
76  digits.registerInDataStore();
77  digits.registerRelationTo(waveforms);
78  StoreObjPtr<TOPTriggerMCInfo> mcInfo;
79  mcInfo.registerInDataStore();
80 
81  if (m_samplingPhase < 0 or m_samplingPhase >= c_SamplingCycle)
82  B2ERROR("samplingPhase must be positive and less than " << c_SamplingCycle);
83 
84  }
@ c_SamplingCycle
timestamp sampling period [samples]

◆ initialize() [11/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 68 of file TOPCalPulseGeneratorModule.cc.

69  {
70  // Output
71 
72  m_calPulses.registerInDataStore();
73 
74  // prepare vectors to loop on
75 
76  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
77 
78  if (m_moduleIDs.empty()) {
79  for (const auto& module : geo->getModules()) {
80  m_moduleIDs.push_back(module.getModuleID());
81  }
82  } else {
83  for (auto moduleID : m_moduleIDs) {
84  if (!geo->isModuleIDValid(moduleID))
85  B2ERROR("Invalid module ID found in input list: " << moduleID);
86  }
87  }
88 
89  if (m_asicChannels.empty()) {
90  for (unsigned ch = 0; ch < 8; ch++) m_asicChannels.push_back(ch);
91  } else {
92  for (unsigned ch : m_asicChannels) {
93  if (ch > 7)
94  B2ERROR("Invalid ASIC channel found in input list: " << ch);
95  }
96  }
97 
98  }
std::vector< unsigned > m_asicChannels
ASIC calibration channels.
StoreArray< TOPSimCalPulse > m_calPulses
collection of simulated cal pulses
std::vector< int > m_moduleIDs
slot ID's to generate for

◆ initialize() [12/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 90 of file TOPDoublePulseGeneratorModule.cc.

◆ initialize() [13/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

better use isRequired(), but RawFTSW is not in sim

Reimplemented from HistoModule.

Definition at line 291 of file TOPDQMModule.cc.

◆ initialize() [14/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from HistoModule.

Definition at line 94 of file TOPLaserHitSelectorModule.cc.

◆ initialize() [15/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 53 of file TOPGeometryParInitializerModule.cc.

54  {
55  auto* gp = TOPGeometryPar::Instance();
56  if (gp->isValid()) {
57  B2WARNING("TOPGeometryPar has already been initialized");
58  return;
59  }
60 
61  if (m_useDB) {
62  gp->Initialize();
63  } else {
64  bool found = false;
65  GearDir detectorDir("/Detector");
66  for (const GearDir& component : detectorDir.getNodes("DetectorComponent")) {
67  if (component.getString("@name") == "TOP") {
68  gp->Initialize(GearDir(component, "Content"));
69  found = true;
70  break;
71  }
72  }
73  if (not found) B2ERROR("Component TOP does not exist or is empty");
74  }
75 
76  }
bool m_useDB
If true load the Geometry from the database instead of gearbox.

◆ initialize() [16/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from HistoModule.

Definition at line 80 of file TOPInterimFENtupleModule.cc.

◆ initialize() [17/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 75 of file TOPLaserCalibratorModule.cc.

◆ initialize() [18/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 61 of file TOPMCTrackMakerModule.cc.

◆ initialize() [19/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 72 of file TOPModuleT0CalibratorModule.cc.

◆ initialize() [20/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 70 of file TOPNtupleModule.cc.

◆ initialize() [21/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 70 of file TOPPackerModule.cc.

◆ initialize() [22/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from HistoModule.

Definition at line 96 of file TOPPDFCheckerModule.cc.

◆ initialize() [23/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 72 of file TOPPDFDebuggerModule.cc.

◆ initialize() [24/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 114 of file TOPRawDigitConverterModule.cc.

◆ initialize() [25/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 69 of file TOPReconstructorModule.cc.

70  {
71  // input
72 
74  m_tracks.isRequired();
75  m_extHits.isRequired();
76  m_barHits.isOptional();
77  m_recBunch.isOptional();
78 
79  // output
80 
81  m_likelihoods.registerInDataStore(m_topLikelihoodCollectionName);
82  m_likelihoods.registerRelationTo(m_extHits);
83  m_likelihoods.registerRelationTo(m_barHits);
84  m_tracks.registerRelationTo(m_likelihoods);
85 
88  }
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Definition: DataStore.h:71
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:59
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
StoreArray< TOPLikelihood > m_likelihoods
collection of likelihoods
std::string m_topDigitCollectionName
name of the collection of TOPDigits
StoreArray< Track > m_tracks
collection of tracks
StoreArray< TOPPull > m_topPulls
collection of pulls
std::string m_topLikelihoodCollectionName
name of the collection of created TOPLikelihoods
StoreArray< TOPDigit > m_digits
collection of digits
StoreArray< ExtHit > m_extHits
collection of extrapolated hits
StoreArray< TOPBarHit > m_barHits
collection of MCParticle hits at TOP
std::string m_topPullCollectionName
name of the collection of created TOPPulls

◆ initialize() [26/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 106 of file TOPTimeBaseCalibratorModule.cc.

◆ initialize() [27/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 71 of file TOPTimeRecalibratorModule.cc.

◆ initialize() [28/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 82 of file TOPUnpackerModule.cc.

◆ initialize() [29/29]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 70 of file TOPWaveformFeatureExtractorModule.cc.

◆ isBucketFilled()

bool isBucketFilled ( int  bunchNo)
private

Does reconstructed bunch number correspond to filled bucket.

Parameters
bunchNoreconstructed relative bunch number
Returns
true if filled

Definition at line 670 of file TOPBunchFinderModule.cc.

◆ isFromThisParticle()

bool isFromThisParticle ( const TOPDigit digit,
const MCParticle particle 
)
private

Checks if digit comes from given MC particle.

Parameters
digitTOP digit
particleMC particle

Definition at line 207 of file TOPPDFCheckerModule.cc.

◆ isInsideSlit()

bool isInsideSlit ( const ROOT::Math::XYZPoint &  point,
const ROOT::Math::XYZVector &  direction 
) const
private

Checks if photon passes the slit.

Parameters
pointphoton emission point
directionphoton emission direction
Returns
true on success

Definition at line 218 of file OpticalGunModule.cc.

◆ isRunningOffsetSubtracted() [1/2]

bool isRunningOffsetSubtracted ( )
private

Checks if running offset is subtracted in TOPDigits.

Returns
true if subtracted at least in one digit

Definition at line 305 of file TOPCommonT0CalibratorModule.cc.

◆ isRunningOffsetSubtracted() [2/2]

bool isRunningOffsetSubtracted ( )
private

Checks if running offset is subtracted in TOPDigits.

Returns
true if subtracted at least in one digit

Definition at line 333 of file TOPModuleT0CalibratorModule.cc.

◆ Iteration()

void Iteration ( const std::vector< TwoTimes > &  ntuple,
std::vector< double > &  xval 
)
private

Iteration function called by iterativeTBC()

Parameters
ntuplentuple data
xvalTBC constants of 256 samples, time interval is the difference of nearby xvals, xval[0]=0 and xval[256]=2*m_syncTimeBase

Definition at line 623 of file TOPTimeBaseCalibratorModule.cc.

◆ iterativeTBC()

bool iterativeTBC ( const std::vector< TwoTimes > &  ntuple,
unsigned  scrodID,
unsigned  scrodChannel,
double  meanTimeDifference,
TH1F &  Hchi2,
TH1F &  Hndf,
TH1F &  HDeltaT 
)
private

Method by iteration of chi2 minimization.

Parameters
ntuplentuple data
scrodIDSCROD ID
scrodChannelchannel number within SCROD (0 - 127)
meanTimeDifferenceaverage time difference [samples]
Hchi2histogram to store normalized chi^2
Hndfhistogram to store degrees of freedom
HDeltaThistogram to store fittet double pulse delay
Returns
true on success

Definition at line 538 of file TOPTimeBaseCalibratorModule.cc.

◆ LoadHistograms()

void LoadHistograms ( const std::string &  histotype)

Load 2D histograms from a given input file (output of TOPLaserHitSelector) and create timing and charge distribution as projection histograms for the x- and y-axis, respectively.

Timing cut is also applied for charge distributiion

Definition at line 218 of file TOPGainEfficiencyCalculatorModule.cc.

◆ matrixInversion()

bool matrixInversion ( const std::vector< TwoTimes > &  ntuple,
unsigned  scrodID,
unsigned  scrodChannel,
double  meanTimeDifference,
TH1F &  Hchi2,
TH1F &  Hndf,
TH1F &  HDeltaT 
)
private

Method by matrix inversion.

Parameters
ntuplentuple data
scrodIDSCROD ID
scrodChannelchannel number within SCROD (0 - 127)
meanTimeDifferenceaverage time difference [samples]
Hchi2histogram to store normalized chi^2
Hndfhistogram to store degrees of freedom
HDeltaThistogram to store fittet double pulse delay
Returns
true on success

Definition at line 398 of file TOPTimeBaseCalibratorModule.cc.

◆ prepare() [1/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 79 of file TOPAlignmentCollectorModule.cc.

◆ prepare() [2/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well.

Reimplemented from CalibrationCollectorModule.

Definition at line 52 of file TOPAsicShiftsBS13dCollectorModule.cc.

◆ prepare() [3/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 39 of file TOPChannelMaskCollectorModule.cc.

◆ prepare() [4/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 49 of file TOPCommonT0BFCollectorModule.cc.

◆ prepare() [5/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 75 of file TOPCommonT0LLCollectorModule.cc.

◆ prepare() [6/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 50 of file TOPModuleT0DeltaTCollectorModule.cc.

◆ prepare() [7/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 75 of file TOPModuleT0LLCollectorModule.cc.

◆ prepare() [8/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 41 of file TOPOffsetCollectorModule.cc.

◆ prepare() [9/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 58 of file TOPPhotonYieldsCollectorModule.cc.

◆ prepare() [10/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 52 of file TOPPulseHeightCollectorModule.cc.

◆ prepare() [11/11]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 76 of file TOPValidationCollectorModule.cc.

◆ printTheError()

bool printTheError ( )
private

Error messages suppression logic.

Returns
true to print the error message, false to suppress it

Definition at line 234 of file TOPUnpackerModule.cc.

◆ saveAsHistogram() [1/4]

void saveAsHistogram ( const std::vector< double > &  vec,
const std::string &  name,
const std::string &  title,
const std::string &  xTitle = "",
const std::string &  yTitle = "" 
) const
private

Save vector to histogram and write it out.

Parameters
vecvector of bin values
namehistogram name
titlehistogram title
xTitlex-axis title
yTitley-axis title

Definition at line 299 of file TOPDoublePulseGeneratorModule.cc.

◆ saveAsHistogram() [2/4]

void saveAsHistogram ( const std::vector< double > &  vec,
const std::string &  name,
const std::string &  title,
const std::string &  xTitle = "",
const std::string &  yTitle = "" 
) const
private

Save vector to histogram and write it out.

Parameters
vecvector of bin values
namehistogram name
titlehistogram title
xTitlex-axis title
yTitley-axis title

Definition at line 711 of file TOPTimeBaseCalibratorModule.cc.

◆ saveAsHistogram() [3/4]

void saveAsHistogram ( const std::vector< double > &  vec,
const std::vector< double > &  err,
const std::string &  name,
const std::string &  title,
const std::string &  xTitle = "",
const std::string &  yTitle = "" 
) const
private

Save vector and errors to histogram and write it out.

Parameters
vecvector of bin values
errvector of bin errors
namehistogram name
titlehistogram title
xTitlex-axis title
yTitley-axis title

Definition at line 730 of file TOPTimeBaseCalibratorModule.cc.

◆ saveAsHistogram() [4/4]

void saveAsHistogram ( const TMatrixDSym &  M,
const std::string &  name,
const std::string &  title 
) const
private

Save matrix to histogram and write it out.

Parameters
Mmatrix
namehistogram name
titlehistogram title

Definition at line 750 of file TOPTimeBaseCalibratorModule.cc.

◆ setFinder()

int setFinder ( TOP::Chi2MinimumFinder1D finder,
const TOP::PDFConstructor reco,
double  timeMin,
double  timeMax 
)
private

Sets finder object with chi2 values.

Parameters
finderfinder object
recoreconstruction object
timeMinlower edge of photon time window
timeMaxupper edge of photon time window
Returns
number of photons in the time window

Definition at line 623 of file TOPBunchFinderModule.cc.

◆ startRun()

void startRun ( )
finalprivatevirtual

Replacement for beginRun().

Do anything you would normally do in beginRun here

Reimplemented from CalibrationCollectorModule.

Definition at line 167 of file TOPValidationCollectorModule.cc.

◆ terminate() [1/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 252 of file TOPAlignerModule.cc.

◆ terminate() [2/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 405 of file TOPBackgroundModule.cc.

◆ terminate() [3/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 557 of file TOPBunchFinderModule.cc.

◆ terminate() [4/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 259 of file TOPChannelT0CalibratorModule.cc.

◆ terminate() [5/23]

void terminate ( void  )
overridevirtual

Termination action.

Output MC extraction

Reimplemented from Module.

Definition at line 93 of file TOPChannelT0MCModule.cc.

◆ terminate() [6/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 243 of file TOPCommonT0CalibratorModule.cc.

◆ terminate() [7/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 249 of file TOPCosmicT0FinderModule.cc.

◆ terminate() [8/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 154 of file TOPTriggerDigitizerModule.cc.

◆ terminate() [9/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 223 of file TOPDoublePulseGeneratorModule.cc.

◆ terminate() [10/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from HistoModule.

Definition at line 173 of file TOPGainEfficiencyCalculatorModule.cc.

◆ terminate() [11/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from HistoModule.

Definition at line 260 of file TOPLaserHitSelectorModule.cc.

◆ terminate() [12/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from HistoModule.

Definition at line 335 of file TOPInterimFENtupleModule.cc.

◆ terminate() [13/23]

void terminate ( void  )
overridevirtual

Termination action.

Do fits , clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 113 of file TOPLaserCalibratorModule.cc.

◆ terminate() [14/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 146 of file TOPMCTrackMakerModule.cc.

◆ terminate() [15/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 252 of file TOPModuleT0CalibratorModule.cc.

◆ terminate() [16/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 250 of file TOPNtupleModule.cc.

◆ terminate() [17/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 127 of file TOPPackerModule.cc.

◆ terminate() [18/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from HistoModule.

Definition at line 182 of file TOPPDFCheckerModule.cc.

◆ terminate() [19/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 481 of file TOPRawDigitConverterModule.cc.

◆ terminate() [20/23]

void terminate ( void  )
overridevirtual

Termination action.

The historam writing takes place here

Reimplemented from HistoModule.

Definition at line 453 of file TOPTBCComparatorModule.cc.

◆ terminate() [21/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 220 of file TOPTimeBaseCalibratorModule.cc.

◆ terminate() [22/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 1254 of file TOPUnpackerModule.cc.

◆ terminate() [23/23]

void terminate ( void  )
overridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 144 of file TOPWaveformFeatureExtractorModule.cc.

◆ unpackHeadersInterimFEVer01()

bool unpackHeadersInterimFEVer01 ( const int *  buffer,
int  bufferSize,
bool  swapBytes 
)
private

Tries to unpack raw data assuming it is in feature-extraction interim format.

Does not write out anything, just checks integrity.

Parameters
bufferraw data buffer
bufferSizebuffer size
swapBytesif true, swap bytes in buffer
Returns
true if buffer resembles interim format, false if not.

Definition at line 345 of file TOPUnpackerModule.cc.

◆ unpackInterimFEVer01()

int unpackInterimFEVer01 ( const int *  buffer,
int  bufferSize,
bool  pedestalSubtracted 
)
private

Unpack raw data given in feature-extraction interim format.

Parameters
bufferraw data buffer
bufferSizebuffer size
pedestalSubtractedfalse for version 2, true for version 3
Returns
number of words remaining in data buffer

Definition at line 415 of file TOPUnpackerModule.cc.

◆ unpackProdDebug()

int unpackProdDebug ( const int *  buffer,
int  bufferSize,
TOP::RawDataType  dataFormat,
bool  pedestalSubtracted 
)
private

Unpack raw data given in production debugging format.

Parameters
bufferraw data buffer
bufferSizebuffer size
dataFormatdata format
pedestalSubtractedtrue, if pedestal is subtracted in waveforms
Returns
number of words remaining in data buffer

Definition at line 821 of file TOPUnpackerModule.cc.

◆ unpackProductionDraft()

void unpackProductionDraft ( const int *  buffer,
int  bufferSize 
)
private

Unpack raw data given in a tentative production format (will vanish in future)

Parameters
bufferraw data buffer
bufferSizebuffer size

Definition at line 243 of file TOPUnpackerModule.cc.

◆ unpackType0Ver16()

void unpackType0Ver16 ( const int *  buffer,
int  bufferSize 
)
private

Unpack raw data given in feature-extraction production format.

Parameters
bufferraw data buffer
bufferSizebuffer size

Definition at line 279 of file TOPUnpackerModule.cc.