Belle II Software  release-06-01-15
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  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

 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...
 
 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 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 printModuleParams () const
 Prints module parameters.
 
bool isInsideSlit (const TVector3 &point, const TVector3 &direction) const
 Checks if photon flies through the slit. More...
 
TVector3 getDirectionGaussian () const
 Return photon direction according to a projected 2D gaussian distribution based on numerical aperture NA.
 
TVector3 getDirectionUniform () const
 Return photon direction according to a projected uniform distribution with opening angle alpha. More...
 
TVector3 getDirectionLambertian () const
 Return photon direction according to a lambertian distribution with opening angle alpha.
 
TVector3 getDirectionCustom () const
 Return photon direction according to a a custom distribution of theta.
 
 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...
 
 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.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action. 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 198 of file TOPTBCComparatorModule.cc.

199  {
200  // Here the histograms are filled
201  // WARNING! What root calls "RMS" is actually a standard deviation
202 
203  // Sanity check on the parsed parameters
204  if (m_slotID < 0 || m_boardstackID < 0 || m_scrodID < 0) {
205  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");
206  return 0;
207  }
208 
209  // Loop over all the histograms that should be found in the file
210  for (short iChannel = 0; iChannel < 128; iChannel++) {
211 
212  // Pics up one histogram just to check that the channel iChannel was actually used to calculate the calibrations
213  if (!m_calSetFile->Get(str(format("timeDiff_ch%1%") % (iChannel)).c_str())) {
214  continue;
215  }
216 
217 
218  // ---------
219  // 1) Define some channel numbering quantities
220  // Watchout: m_slotID is in [1..16] so slot m_slotID is on the element m_slotID-1 of the array
221  // ---------
222 
223  short hardwareChannel = iChannel + 128 * m_boardstackID; // 0-511 across the whole module, BS by BS
224  auto& chMapper = TOP::TOPGeometryPar::Instance()->getChannelMapper();
225  short pixelID = chMapper.getPixelID(hardwareChannel); // 1-512 across the whole module, in rows
226  short colNum = (pixelID - 1) % 64 + 1; // 1- 64 column ID (right to left looking from the quartz to the PMTs)
227  short rowNum = (pixelID - 1) / 64 + 1 ; // 1- 8 row ID (bottom to top looking from the quartz to the PMTs)
228  short globalChannel = hardwareChannel + 512 * (m_slotID -
229  1); // channel number across the whole detector, 0-8191. Used for cal monitorin only
230 
231 
232  // ---------
233  // 2) Channel-by-channel DeltaT summaries (average on the 256 samples of each set)
234  // ---------
235 
236  // Checks that the histogram needed here is not corrupted before using it
237  if (!m_calSetFile->Get(str(format("timeDiffcal_ch%1%") % (iChannel)).c_str())) {
238  B2WARNING("Error opening " << str(format("timeDiffcal_ch%1%") % (iChannel)));
239  } else {
240  TH2F* h_timeDiffcal = (TH2F*)m_calSetFile->Get(str(format("timeDiffcal_ch%1%") % (iChannel)).c_str());
241  TH1D* h_projection = h_timeDiffcal->ProjectionY("h_projection", 1, m_numSamples); // full projection
242 
243  m_slotAverageDeltaT[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, h_projection->GetMean());
244  m_slotAverageDeltaT[m_slotID - 1][m_calSetID]->SetBinError(hardwareChannel + 1,
245  h_projection->GetMeanError()); // Do we trust root on this?
246  m_slotSigmaDeltaT[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1,
247  h_projection->GetRMS()); // WARNING! What root calls "RMS" is actually a standard deviation
248  m_slotSigmaDeltaT[m_slotID - 1][m_calSetID]->SetBinError(hardwareChannel + 1,
249  h_projection->GetRMSError()); // WARNING! What root calls "RMS" is actually a standard deviation
250 
251  m_slotAverageDeltaTMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, h_projection->GetMean());
252  m_slotSigmaDeltaTMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum,
253  h_projection->GetRMS());
254 
255  m_topAverageDeltaT[m_calSetID]->SetBinContent(globalChannel + 1, h_projection->GetMean());
256  m_topSigmaDeltaT[m_calSetID]->SetBinContent(globalChannel + 1, h_projection->GetRMS());
257  }
258 
259  // ---------
260  // 3) Channel-by-channel average occupancy
261  // ---------
262 
263  // Checks that the histogram needed here is not corrupted before using it
264  if (!m_calSetFile->Get(str(format("sampleOccup_ch%1%") % (iChannel)).c_str())) {
265  B2WARNING("Error opening " << str(format("sampleOccup_ch%1%") % (iChannel)));
266  } else {
267  TH1F* h_sampleOccup = (TH1F*)m_calSetFile->Get(str(format("sampleOccup_ch%1%") % (iChannel)).c_str());
268 
269  // reads the occupancy histogram bin-by-by to look for (almost) empty samples
270  int nEmpty = 0;
271  for (int iSample = 1; iSample < m_numSamples + 1 ; iSample++) {
272  if (h_sampleOccup->GetBinContent(iSample) < m_minCalPulses) nEmpty++;
273  }
274 
275  m_slotSampleOccupancy[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, h_sampleOccup->Integral() / m_numSamples);
276  m_slotEmptySamples[m_slotID - 1][m_calSetID]->SetBinContent(hardwareChannel + 1, nEmpty);
277 
278  m_slotSampleOccupancyMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, h_sampleOccup->Integral() / m_numSamples);
279  m_slotEmptySamplesMap[m_slotID - 1][m_calSetID]->SetBinContent(colNum, rowNum, nEmpty);
280 
281  m_topSampleOccupancy[m_calSetID]->SetBinContent(globalChannel + 1, h_sampleOccup->Integral() / m_numSamples);
282 
283  }
284 
285 
286 
287  }
288  return 1;
289  }
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 189 of file TOPPDFDebuggerModule.cc.

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

◆ basicDebuggingPlots()

void basicDebuggingPlots ( const TOPRawWaveform rawwave)

Fills the debugging 1D histograms and hitmaps.

Parameters
rawwavethe raw waveform

Definition at line 73 of file TOPWaveformQualityPlotterModule.cc.

74  {
75  int scrodid = v.getScrodID();
76  int asicid = v.getASICNumber();
77  int channelid = v.getASICChannel();
78  int carrierid = v.getCarrierNumber();
79  m_scrod_id->Fill(scrodid);
80  m_asic_ch->Fill(channelid);
81  m_asic->Fill(asicid);
82  m_carrier->Fill(carrierid);
83  m_asic_win->Fill(v.getStorageWindow());
84  m_entries->Fill(v.getWaveform().size());
85  m_moduleID->Fill(v.getModuleID());
86  m_pixelID->Fill(v.getPixelID());
87 
88  if (m_hitmap.find(scrodid) == m_hitmap.end()) {
89  // cppcheck-suppress stlFindInsert
90  m_hitmap[scrodid] = new TH2F((string("scrod ") + to_string(scrodid) + string("Hitmap")).c_str(),
91  (string("scrod ") + to_string(scrodid) + string("carrier vs. asic;asic;carrier")).c_str(), 4, 0, 4, 4, 0, 4);
92  }
93  m_hitmap[scrodid]->Fill(asicid, carrierid);
94  const vector<short>& waveform = v.getWaveform();
95  if (waveform.empty()) {
96  return;
97  }
98  for (short adc : waveform) {
99  m_samples->Fill(adc);
100  }
101  }
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/17]

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 168 of file OpticalGunModule.cc.

169  {
170  }

◆ beginRun() [2/17]

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 192 of file TOPBackgroundModule.cc.

193  {
194  // Print run number
195  B2INFO("TOPBackground: Processing:");
196 
197  }

◆ beginRun() [3/17]

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() [4/17]

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 146 of file TOPDoublePulseGeneratorModule.cc.

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

◆ beginRun() [5/17]

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 370 of file TOPDQMModule.cc.

371  {
372  m_BoolEvtMonitor->Reset();
373 
374  m_recoTimeDiff->Reset();
375  m_recoTimeDiff_Phic->Reset();
376  m_recoPull->Reset();
377  m_recoPull_Phic->Reset();
378  m_recoTime->Reset();
379  m_recoTimeBg->Reset();
380  m_recoTimeMinT0->Reset();
381 
382  m_goodHits->Reset();
383  m_badHits->Reset();
384  m_window_vs_slot->Reset();
385  m_bunchOffset->Reset();
386  m_time->Reset();
387  m_goodTDCAll->Reset();
388  m_badTDCAll->Reset();
389  m_goodHitsPerEventProf->Reset();
390  m_goodHitsPerEventAll->Reset();
391  m_badHitsPerEventProf->Reset();
392  m_badHitsPerEventAll->Reset();
393  m_TOPOccAfterInjLER->Reset();
394  m_TOPOccAfterInjHER->Reset();
395  m_TOPEOccAfterInjLER->Reset();
396  m_TOPEOccAfterInjHER->Reset();
397 
398  for (int i = 0; i < m_numModules; i++) {
399  m_window_vs_asic[i]->Reset();
400  m_goodHitsXY[i]->Reset();
401  m_badHitsXY[i]->Reset();
402  m_goodHitsAsics[i]->Reset();
403  m_badHitsAsics[i]->Reset();
404  m_goodTdc[i]->Reset();
405  m_badTdc[i]->Reset();
406  m_goodTiming[i]->Reset();
407  m_goodChannelHits[i]->Reset();
408  m_badChannelHits[i]->Reset();
409  m_goodHitsPerEvent[i]->Reset();
410  m_badHitsPerEvent[i]->Reset();
411  m_goodHitsXYTrack[i]->Reset();
412  m_goodHitsXYTrackBkg[i]->Reset();
413  }
414  }
TH1F * m_badHits
Histogram for number of accumulated bad hits.
Definition: TOPDQMModule.h:113
std::vector< TH2F * > m_window_vs_asic
Histograms window w.r.t reference vs.
Definition: TOPDQMModule.h:124
std::vector< TH1F * > m_badChannelHits
Histograms for bad channel hits.
Definition: TOPDQMModule.h:133
int m_numModules
number of TOP modules
Definition: TOPDQMModule.h:140
std::vector< TH2F * > m_goodHitsXY
Histograms (2D) for good hits in x-y.
Definition: TOPDQMModule.h:125
std::vector< TH2F * > m_goodHitsAsics
Histograms (2D) for good hits for asics.
Definition: TOPDQMModule.h:127
std::vector< TH1F * > m_goodHitsPerEvent
Histograms for good hits per event.
Definition: TOPDQMModule.h:134
TH1F * m_BoolEvtMonitor
Event desynchronization monitoring.
Definition: TOPDQMModule.h:98
std::vector< TH2F * > m_badHitsXY
Histograms (2D) for bad hits in x-y.
Definition: TOPDQMModule.h:126
TH1F * m_bunchOffset
reconstructed bunch: current offset
Definition: TOPDQMModule.h:115
std::vector< TProfile2D * > m_goodHitsXYTrack
Histograms (2D) for good hits in x-y per module with track.
Definition: TOPDQMModule.h:136
TH1F * m_recoPull
pull distribution
Definition: TOPDQMModule.h:104
std::vector< TH1F * > m_goodChannelHits
Histograms for good channel hits.
Definition: TOPDQMModule.h:132
TProfile * m_badHitsPerEventProf
a profile histogram of bad hits per event
Definition: TOPDQMModule.h:118
TH2F * m_recoTimeDiff_Phic
residuals vs phiCer
Definition: TOPDQMModule.h:105
TH1F * m_recoTime
time distribution
Definition: TOPDQMModule.h:100
TH2F * m_window_vs_slot
Histogram window w.r.t reference vs.
Definition: TOPDQMModule.h:114
TH1F * m_recoTimeMinT0
time distribution in respect to the first peak
Definition: TOPDQMModule.h:102
TH1F * m_TOPEOccAfterInjHER
Histogram for Nr Entries (=Triggrs) for normalization after HER injection.
Definition: TOPDQMModule.h:122
std::vector< TH1F * > m_goodTdc
Histograms for TDC distribution of good hits.
Definition: TOPDQMModule.h:129
TH1F * m_badHitsPerEventAll
Histograms for bad hits per event (all slots)
Definition: TOPDQMModule.h:108
TH1F * m_TOPEOccAfterInjLER
Histogram for Nr Entries (=Triggrs) for normalization after LER injection.
Definition: TOPDQMModule.h:121
std::vector< TH1F * > m_goodTiming
Histograms for timing distribution of good hits.
Definition: TOPDQMModule.h:131
TH1F * m_time
time distribution of good hits
Definition: TOPDQMModule.h:116
TH1F * m_goodTDCAll
Histograms for TDC distribution of good hits (all slots)
Definition: TOPDQMModule.h:109
TH1F * m_TOPOccAfterInjLER
Histogram Ndigits after LER injection.
Definition: TOPDQMModule.h:119
TProfile * m_recoPull_Phic
pulls vs phiCer
Definition: TOPDQMModule.h:106
TH1F * m_recoTimeBg
time distribution background
Definition: TOPDQMModule.h:101
TH1F * m_goodHits
Histogram for number of accumulated good hits.
Definition: TOPDQMModule.h:112
std::vector< TProfile2D * > m_goodHitsXYTrackBkg
Histograms (2D) for good hits in x-y per module with bkg track.
Definition: TOPDQMModule.h:137
std::vector< TH1F * > m_badHitsPerEvent
Histograms for bad hits per event.
Definition: TOPDQMModule.h:135
TProfile * m_goodHitsPerEventProf
a profile histogram of good hits per event
Definition: TOPDQMModule.h:117
std::vector< TH1F * > m_badTdc
Histograms for TDC distribution of bad hits.
Definition: TOPDQMModule.h:130
std::vector< TH2F * > m_badHitsAsics
Histograms (2D) for bad hits for asics.
Definition: TOPDQMModule.h:128
TH1F * m_TOPOccAfterInjHER
Histogram Ndigits after HER injection.
Definition: TOPDQMModule.h:120
TH1F * m_badTDCAll
Histograms for TDC distribution of bad hits (all slots)
Definition: TOPDQMModule.h:110
TH1F * m_recoTimeDiff
residual distribution
Definition: TOPDQMModule.h:103
TH1F * m_goodHitsPerEventAll
Histograms for good hits per event (all slots)
Definition: TOPDQMModule.h:107

◆ beginRun() [6/17]

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() [7/17]

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 152 of file TOPInterimFENtupleModule.cc.

153  {
154  }

◆ beginRun() [8/17]

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 79 of file TOPLaserCalibratorModule.cc.

80  {
81  }

◆ beginRun() [9/17]

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() [10/17]

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() [11/17]

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 121 of file TOPNtupleModule.cc.

122  {
123  }

◆ beginRun() [12/17]

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 97 of file TOPPackerModule.cc.

98  {
99  }

◆ beginRun() [13/17]

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() [14/17]

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 140 of file TOPTimeBaseCalibratorModule.cc.

141  {
142  }

◆ beginRun() [15/17]

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 83 of file TOPTimeRecalibratorModule.cc.

84  {
85  StoreObjPtr<EventMetaData> evtMetaData;
86 
87  // check if calibrations are available when needed - if not, terminate
88 
90  if (not m_timebase.isValid()) {
91  B2FATAL("Sample time calibration requested but not available for run "
92  << evtMetaData->getRun()
93  << " of experiment " << evtMetaData->getExperiment());
94  }
95  }
97  if (not m_channelT0.isValid()) {
98  B2FATAL("Channel T0 calibration requested but not available for run "
99  << evtMetaData->getRun()
100  << " of experiment " << evtMetaData->getExperiment());
101  }
102  }
104  if (not m_asicShift.isValid()) {
105  B2FATAL("ASIC shifts calibration requested but not available for run "
106  << evtMetaData->getRun()
107  << " of experiment " << evtMetaData->getExperiment());
108  }
109  }
111  if (not m_moduleT0.isValid()) {
112  B2FATAL("Module T0 calibration requested but not available for run "
113  << evtMetaData->getRun()
114  << " of experiment " << evtMetaData->getExperiment());
115  }
116  }
118  if (not m_commonT0.isValid()) {
119  B2FATAL("Common T0 calibration requested but not available for run "
120  << evtMetaData->getRun()
121  << " of experiment " << evtMetaData->getExperiment());
122  }
123  }
125  if (not m_timeWalk.isValid()) {
126  // B2FATAL("Time-walk calibration requested but not available for run "
127  B2WARNING("Time-walk calibration is not available for run "
128  << evtMetaData->getRun()
129  << " of experiment " << evtMetaData->getExperiment());
130  }
131  }
132 
133  if (not m_feSetting.isValid()) {
134  B2FATAL("Front-end settings are not available for run "
135  << evtMetaData->getRun()
136  << " of experiment " << evtMetaData->getExperiment());
137  }
138 
139  }
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() [16/17]

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 111 of file TOPUnpackerModule.cc.

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

◆ beginRun() [17/17]

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 308 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 664 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 271 of file TOPValidationCollectorModule.cc.

272  {
273 
274  // module T0 pulls
275 
276  for (int module = 0; module < c_numModules; module++) {
277  std::vector<double> pos, err;
278  for (int set = 0; set < c_numSets; set++) {
279  const auto& minimum = m_finders[set][module].getMinimum();
280  if (minimum.valid) {
281  pos.push_back(minimum.position);
282  err.push_back(minimum.error);
283  }
284  }
285  auto h_pulls = getObjectPtr<TH1F>("moduleT0_pulls");
286  for (unsigned i = 0; i < pos.size(); i++) {
287  for (unsigned j = i + 1; j < pos.size(); j++) {
288  double pull = (pos[i] - pos[j]) / sqrt(err[i] * err[i] + err[j] * err[j]);
289  h_pulls->Fill(pull);
290  }
291  }
292  }
293 
294  // module T0 residuals
295 
296  for (int module = 0; module < c_numModules; module++) {
297  auto& finder = m_finders[0][module];
298  for (int set = 1; set < c_numSets; set++) {
299  finder.add(m_finders[set][module]);
300  }
301  const auto& minimum = finder.getMinimum();
302  if (minimum.valid) {
303  m_treeEntry.moduleT0[module] = minimum.position;
304  m_treeEntry.moduleT0Err[module] = minimum.error;
305  }
306  }
307 
308  // common T0 residual
309 
310  auto& finder = m_finders[0][0];
311  for (int module = 1; module < c_numModules; module++) {
312  finder.add(m_finders[0][module]);
313  }
314  const auto& minimum = finder.getMinimum();
315  if (minimum.valid) {
316  m_treeEntry.commonT0 = minimum.position;
317  m_treeEntry.commonT0Err = minimum.error;
318  }
319 
320  // fill the tree
321 
322  auto tree = getObjectPtr<TTree>("tree");
323  tree->Fill();
324  }
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/9]

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.Mag();
276  m_theta = localMomentum.Theta();
277  m_phi = localMomentum.Phi();
278  const auto& pocaPosition = m_selector.getPOCAPosition();
279  m_pocaR = pocaPosition.Perp();
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 TVector3 & getLocalMomentum() const
Returns momentum at TOP in local frame of the track in last isSelected call.
const TVector3 & getLocalPosition() const
Returns position at TOP in local frame of the track in last isSelected call.
bool isSelected(const TOPTrack &track) const
Returns selection status.
const Const::ChargedStable & getChargedStable() const
Returns track hypothesis.
const TVector3 & getPOCAPosition() const
Returns position of POCA of the track in last isSelected call.

◆ collect() [2/9]

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/9]

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/9]

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/9]

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/9]

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/9]

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/9]

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() [9/9]

void collect ( )
finalprivatevirtual

Replacement for event().

Fill your calibration data objects here

Reimplemented from CalibrationCollectorModule.

Definition at line 216 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 82 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 66 of file TOPPDFCheckerModule.cc.

67  {
68 
69  // time vs. pixel ID
70  m_hits = new TH2F("hits", "photon hits", 512, 0.5, 512.5,
72  m_hits->SetXTitle("pixel ID");
73  m_hits->SetYTitle("time [ns]");
74 
75  m_pdf = new TH2F("pdf", "PDF", 512, 0.5, 512.5,
77  m_pdf->SetXTitle("pixel ID");
78  m_pdf->SetYTitle("time [ns]");
79 
80  // time vs pixel column
81  m_hitsCol = new TH2F("hitsCol", "photon hits", 64, 0.5, 64.5,
83  m_hitsCol->SetXTitle("pixel column");
84  m_hitsCol->SetYTitle("time [ns]");
85 
86  m_pdfCol = new TH2F("pdfCol", "PDF", 64, 0.5, 64.5,
88  m_pdfCol->SetXTitle("pixel column");
89  m_pdfCol->SetYTitle("time [ns]");
90 
91  }
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 52 of file TOPTBCComparatorModule.cc.

◆ drawWaveforms()

void drawWaveforms ( const TOPRawWaveform rawwave)

Draws the full waveforms onto the TProfiles.

Parameters
rawwavethe raw waveform

Definition at line 104 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/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 247 of file OpticalGunModule.cc.

◆ endRun() [2/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 399 of file TOPBackgroundModule.cc.

◆ endRun() [3/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 217 of file TOPDoublePulseGeneratorModule.cc.

◆ endRun() [4/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 548 of file TOPDQMModule.cc.

◆ endRun() [5/16]

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() [6/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 324 of file TOPInterimFENtupleModule.cc.

◆ endRun() [7/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 107 of file TOPLaserCalibratorModule.cc.

◆ endRun() [8/16]

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() [9/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 237 of file TOPNtupleModule.cc.

◆ endRun() [10/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 121 of file TOPPackerModule.cc.

◆ endRun() [11/16]

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() [12/16]

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 347 of file TOPTBCComparatorModule.cc.

◆ endRun() [13/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 213 of file TOPTimeBaseCalibratorModule.cc.

◆ endRun() [14/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 1243 of file TOPUnpackerModule.cc.

◆ endRun() [15/16]

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() [16/16]

void endRun ( void  )
overridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from HistoModule.

Definition at line 174 of file TOPWaveformQualityPlotterModule.cc.

◆ event()

void event ( void  )
overridevirtual

Event processor.

Convert TOPSimHits of the event to TOPHits.

Reimplemented from Module.

Definition at line 199 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 530 of file TOPDigitizerModule.cc.

531  {
532  if (m_useDatabase) {
533  const auto& channelMapper = TOPGeometryPar::Instance()->getChannelMapper();
534  auto channel = channelMapper.getChannel(pixelID);
535  if (m_pulseHeights->isCalibrated(moduleID, channel)) {
536  const auto& par = m_pulseHeights->getParameters(moduleID, channel);
537  PulseHeightGenerator generator(par.x0, par.p1, par.p2, m_ADCmax);
538  return generator.generate();
539  }
540  }
541 
543  }
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.

◆ getDirectionUniform()

TVector3 getDirectionUniform ( ) const
private

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

Be careful.

Definition at line 293 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 217 of file TOPUnpackerModule.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 493 of file TOPBunchFinderModule.cc.

494  {
495 
496  std::vector<double> logL;
497  std::vector<double> priors;
498 
499  if (m_usePIDLikelihoods) {
500  const auto* pid = track.getRelated<PIDLikelihood>();
501  if (not pid) {
502  m_nodEdxCount++;
503  return Const::pion;
504  }
505  auto subset = Const::PIDDetectorSet(Const::SVD);
506  subset += Const::PIDDetectorSet(Const::CDC);
507  for (const auto& type : Const::chargedStableSet) {
508  logL.push_back(pid->getLogL(type, subset));
509  priors.push_back(m_priors[abs(type.getPDGCode())]);
510  }
511  } else {
512  const auto* cdcdedx = track.getRelated<CDCDedxLikelihood>();
513  const auto* vxddedx = track.getRelated<VXDDedxLikelihood>();
514  if (not cdcdedx and not vxddedx) {
515  m_nodEdxCount++;
516  return Const::pion;
517  }
518  for (const auto& type : Const::chargedStableSet) {
519  if (cdcdedx and vxddedx) {
520  logL.push_back(cdcdedx->getLogL(type) + vxddedx->getLogL(type));
521  } else if (cdcdedx) {
522  logL.push_back(cdcdedx->getLogL(type));
523  } else {
524  logL.push_back(vxddedx->getLogL(type));
525  }
526  priors.push_back(m_priors[abs(type.getPDGCode())]);
527  }
528  }
529 
530  // get maximal logL
531  auto logL_max = logL[0];
532  for (auto x : logL) {
533  if (x > logL_max) logL_max = x;
534  }
535 
536  // calculate probabilities, normalizaton is not needed
537  std::vector<double> probability(logL.size());
538  for (unsigned i = 0; i < logL.size(); ++i) {
539  probability[i] = exp(logL[i] - logL_max) * priors[i];
540  }
541 
542  // find most probable
543  unsigned i0 = 0;
544  for (unsigned i = 0; i < probability.size(); ++i) {
545  if (probability[i] > probability[i0]) i0 = i;
546  }
547  return Const::chargedStableSet.at(i0);
548 
549  }
const ParticleType & at(unsigned int index) const
Return particle at given index, or end() if out of range.
Definition: Const.h:430
RestrictedDetectorSet< PIDDetectors > PIDDetectorSet
Typedef for set of PID detectors.
Definition: Const.h:260
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:499
static const ChargedStable pion
charged pion particle
Definition: Const.h:542
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 332 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 493 of file TOPDigitizerModule.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 93 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 83 of file TOPAlignerModule.cc.

84  {
85  // check if target module ID is valid
86 
87  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
88  if (not geo->isModuleIDValid(m_targetMid)) {
89  B2ERROR("Target module ID = " << m_targetMid << " is invalid.");
90  }
91 
92  // check if sample type is valid
93 
94  if (not(m_sample == "dimuon" or m_sample == "bhabha" or m_sample == "cosmics")) {
95  B2ERROR("Invalid sample type '" << m_sample << "'");
96  }
97  if (m_sample == "bhabha") m_chargedStable = Const::electron;
98 
99  // set track selector
100 
101  m_selector = TrackSelector(m_sample);
106 
107  // set alignment object
108 
112  for (const auto& parName : m_parFixed) {
113  m_align.fixParameter(parName);
114  }
115 
116  // input
117 
118  m_digits.isRequired();
119  m_tracks.isRequired();
120  m_extHits.isRequired();
121  m_recBunch.isOptional();
122 
123  // open output file
124 
125  m_file = TFile::Open(m_outFileName.c_str(), "RECREATE");
126  if (m_file->IsZombie()) {
127  B2FATAL("Couldn't open file '" << m_outFileName << "' for writing!");
128  return;
129  }
130 
131  // create output tree
132 
133  m_alignTree = new TTree("alignTree", "TOP alignment results");
134  m_alignTree->Branch("ModuleId", &m_targetMid);
135  m_alignTree->Branch("iter", &m_iter);
136  m_alignTree->Branch("ntrk", &m_ntrk);
137  m_alignTree->Branch("errorCode", &m_errorCode);
138  m_alignTree->Branch("iterPars", &m_vAlignPars);
139  m_alignTree->Branch("iterParsErr", &m_vAlignParsErr);
140  m_alignTree->Branch("valid", &m_valid);
141  m_alignTree->Branch("numPhot", &m_numPhot);
142  m_alignTree->Branch("x", &m_x);
143  m_alignTree->Branch("y", &m_y);
144  m_alignTree->Branch("z", &m_z);
145  m_alignTree->Branch("p", &m_p);
146  m_alignTree->Branch("theta", &m_theta);
147  m_alignTree->Branch("phi", &m_phi);
148  m_alignTree->Branch("r_poca", &m_pocaR);
149  m_alignTree->Branch("z_poca", &m_pocaZ);
150  m_alignTree->Branch("x_poca", &m_pocaX);
151  m_alignTree->Branch("y_poca", &m_pocaY);
152  m_alignTree->Branch("Ecms", &m_cmsE);
153  m_alignTree->Branch("charge", &m_charge);
154  m_alignTree->Branch("PDG", &m_PDG);
155 
156  }
static const ChargedStable electron
electron particle
Definition: Const.h:540
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:62
void setMinMomentum(double minMomentum)
Sets momentum cut (used for "cosmics" only)
Definition: TrackSelector.h:56
void setCutOnPOCA(double dr, double dz)
Sets cut on point of closest approach to (0, 0, 0)
Definition: TrackSelector.h:69
void setCutOnLocalZ(double minZ, double maxZ)
Sets cut on local z coordinate (module frame) of the track extrapolated to TOP.
Definition: TrackSelector.h:80

◆ 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 113 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 105 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, 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, 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 76 of file TOPCosmicT0FinderModule.cc.

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

◆ 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 100 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 67 of file TOPTriggerDigitizerModule.cc.

68  {
69  // input
70  StoreArray<TOPRawWaveform> waveforms;
71  waveforms.isRequired();
72 
73  // output
74  StoreArray<TOPTriggerDigit> digits;
75  digits.registerInDataStore();
76  digits.registerRelationTo(waveforms);
77  StoreObjPtr<TOPTriggerMCInfo> mcInfo;
78  mcInfo.registerInDataStore();
79 
80  if (m_samplingPhase < 0 or m_samplingPhase >= c_SamplingCycle)
81  B2ERROR("samplingPhase must be positive and less than " << c_SamplingCycle);
82 
83  }
@ 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 66 of file TOPCalPulseGeneratorModule.cc.

67  {
68  // Output
69 
70  m_calPulses.registerInDataStore();
71 
72  // prepare vectors to loop on
73 
74  const auto* geo = TOPGeometryPar::Instance()->getGeometry();
75 
76  if (m_moduleIDs.empty()) {
77  for (const auto& module : geo->getModules()) {
78  m_moduleIDs.push_back(module.getModuleID());
79  }
80  } else {
81  for (auto moduleID : m_moduleIDs) {
82  if (!geo->isModuleIDValid(moduleID))
83  B2ERROR("Invalid module ID found in input list: " << moduleID);
84  }
85  }
86 
87  if (m_asicChannels.empty()) {
88  for (unsigned ch = 0; ch < 8; ch++) m_asicChannels.push_back(ch);
89  } else {
90  for (unsigned ch : m_asicChannels) {
91  if (ch > 7)
92  B2ERROR("Invalid ASIC channel found in input list: " << ch);
93  }
94  }
95 
96  }
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 88 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 357 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 51 of file TOPGeometryParInitializerModule.cc.

52  {
53  auto* gp = TOPGeometryPar::Instance();
54  if (gp->isValid()) {
55  B2WARNING("TOPGeometryPar has already been initialized");
56  return;
57  }
58 
59  if (m_useDB) {
60  gp->Initialize();
61  } else {
62  bool found = false;
63  GearDir detectorDir("/Detector");
64  for (const GearDir& component : detectorDir.getNodes("DetectorComponent")) {
65  if (component.getString("@name") == "TOP") {
66  gp->Initialize(GearDir(component, "Content"));
67  found = true;
68  break;
69  }
70  }
71  if (not found) B2ERROR("Component TOP does not exist or is empty");
72  }
73 
74  }
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 73 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 73 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 69 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 68 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 93 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 69 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 68 of file TOPReconstructorModule.cc.

69  {
70  // input
71 
73  m_tracks.isRequired();
74  m_extHits.isRequired();
75  m_barHits.isOptional();
76  m_recBunch.isOptional();
77 
78  // output
79 
80  m_likelihoods.registerInDataStore(m_topLikelihoodCollectionName);
81  m_likelihoods.registerRelationTo(m_extHits);
82  m_likelihoods.registerRelationTo(m_barHits);
83  m_tracks.registerRelationTo(m_likelihoods);
84 
87  }
@ 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 103 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 69 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 80 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.

◆ 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 204 of file TOPPDFCheckerModule.cc.

◆ isInsideSlit()

bool isInsideSlit ( const TVector3 &  point,
const TVector3 &  direction 
) const
private

Checks if photon flies through the slit.

Parameters
pointphoton emission point
directionphoton emission direction
Returns
true, if photon flies through the slit

Definition at line 259 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 618 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 533 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 395 of file TOPTimeBaseCalibratorModule.cc.

◆ prepare() [1/9]

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/9]

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/9]

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/9]

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/9]

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/9]

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/9]

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/9]

void prepare ( )
finalprivatevirtual

Replacement for initialize().

Register calibration dataobjects here as well

Reimplemented from CalibrationCollectorModule.

Definition at line 52 of file TOPPulseHeightCollectorModule.cc.

◆ prepare() [9/9]

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 232 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 297 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 706 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 725 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 745 of file TOPTimeBaseCalibratorModule.cc.

◆ startRun()

void startRun ( )
finalprivatevirtual

Replacement for beginRun().

Do anything you would normally do in beginRun here

Reimplemented from CalibrationCollectorModule.

Definition at line 161 of file TOPValidationCollectorModule.cc.

◆ terminate() [1/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 251 of file OpticalGunModule.cc.

◆ terminate() [2/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 248 of file TOPAlignerModule.cc.

◆ terminate() [3/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 404 of file TOPBackgroundModule.cc.

◆ terminate() [4/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 486 of file TOPBunchFinderModule.cc.

◆ terminate() [5/25]

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() [6/25]

void terminate ( void  )
overridevirtual

Termination action.

Output MC extraction

Reimplemented from Module.

Definition at line 93 of file TOPChannelT0MCModule.cc.

◆ terminate() [7/25]

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() [8/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 247 of file TOPCosmicT0FinderModule.cc.

◆ terminate() [9/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 153 of file TOPTriggerDigitizerModule.cc.

◆ terminate() [10/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 221 of file TOPDoublePulseGeneratorModule.cc.

◆ terminate() [11/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from HistoModule.

Definition at line 552 of file TOPDQMModule.cc.

◆ terminate() [12/25]

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() [13/25]

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() [14/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from HistoModule.

Definition at line 328 of file TOPInterimFENtupleModule.cc.

◆ terminate() [15/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 111 of file TOPLaserCalibratorModule.cc.

◆ terminate() [16/25]

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() [17/25]

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() [18/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 241 of file TOPNtupleModule.cc.

◆ terminate() [19/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 125 of file TOPPackerModule.cc.

◆ terminate() [20/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from HistoModule.

Definition at line 179 of file TOPPDFCheckerModule.cc.

◆ terminate() [21/25]

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() [22/25]

void terminate ( void  )
overridevirtual

Termination action.

The historam writing takes place here

Reimplemented from HistoModule.

Definition at line 444 of file TOPTBCComparatorModule.cc.

◆ terminate() [23/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 217 of file TOPTimeBaseCalibratorModule.cc.

◆ terminate() [24/25]

void terminate ( void  )
overridevirtual

Termination action.

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

Reimplemented from Module.

Definition at line 1252 of file TOPUnpackerModule.cc.

◆ terminate() [25/25]

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 343 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 413 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 819 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 241 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 277 of file TOPUnpackerModule.cc.