Belle II Software development

Modules

 top data objects
 
 top modules
 

Classes

class  TOPDatabaseImporter
 TOP database importer. More...
 
class  TOPASICChannel
 Calibration constants of a singe ASIC channel: pedestals, gains and time axis. More...
 
class  TOPASICGains
 Calibration constants of a single ASIC window: gains. More...
 
class  TOPASICPedestals
 Calibration constants of a single ASIC window: pedestals. More...
 
class  TOPCalAsicShift
 Calibration constants for ASIC shifts of all 16 modules. More...
 
class  TOPCalChannelMask
 Channel status for all 512 channels of 16 modules. More...
 
class  TOPCalChannelNoise
 r.m.s. More...
 
class  TOPCalChannelPulseHeight
 Pulse height parameterizations for all 512 channels of 16 modules. More...
 
class  TOPCalChannelRQE
 Class to store relative quantum efficiency of channels w.r.t initial one measured in PMT QA QE is expected to decrease during the experiment due to aging induced by acuumulated charge. More...
 
class  TOPCalChannelT0
 Channel T0 calibration constants for all 512 channels of 16 modules. More...
 
class  TOPCalChannelThreshold
 Value of the threshold (in ADC counts) used for the pulse identification, for all 512 channels of 16 modules. More...
 
class  TOPCalChannelThresholdEff
 Class to store the threshold efficiency (i.e. More...
 
class  TOPCalCommonT0
 Common T0 calibration constant. More...
 
class  TOPCalEventT0Offset
 Class to store the calibrated EventT0 offsets of other detector components The offsets are measured relative to TOP EventT0 (e.g CDC - TOP etc) More...
 
class  TOPCalFillPatternOffset
 Class to store the offset of reconstructed fill pattern. More...
 
class  TOPCalIntegratedCharge
 Class to store integrated charge per channel. More...
 
class  TOPCalModuleAlignment
 Alignment constants for all 16 modules. More...
 
class  TOPCalModuleT0
 Module T0 calibration constants for all 16 modules. More...
 
class  TOPCalPhotonYields
 Class to store photon pixel yields for PMT ageing studies, and equalized alpha ratios for finding optically decoupled PMT's. More...
 
class  TOPCalTimebase
 Sample time calibration constants for all channels. More...
 
class  TOPCalTimeWalk
 Calibration constants for time-walk correction and for tuning of electronic time resolution in digitization. More...
 
class  TOPChannelMap
 Map of pixels and channels within the carrier board. More...
 
class  TOPFrontEndMap
 Mapping of a boardstack number within a module to SCROD and COPPER/Finesse. More...
 
class  TOPFrontEndSetting
 Front-end settings: storage depths, lookback, readout windows etc. More...
 
class  TOPGeoBarSegment
 Geometry parameters of a quartz bar segment. More...
 
class  TOPGeoBase
 Base class for geometry parameters. More...
 
class  TOPGeoColdPlate
 Geometry parameters of cold plate (simplified) More...
 
class  TOPGeoEndPlate
 Geometry parameters of forward end plate (simplified) More...
 
class  TOPGeoFrontEnd
 Geometry parameters of board stack (front-end electronic module) More...
 
class  TOPGeoHoneycombPanel
 Geometry parameters of honeycomb panel. More...
 
class  TOPGeometry
 Geometry parameters of TOP. More...
 
class  TOPGeoMirrorSegment
 Geometry parameters of a mirror segment. More...
 
class  TOPGeoModule
 Geometry parameters of a module (optical components + positioning) More...
 
class  TOPGeoModuleDisplacement
 Displacement parameters of a TOP module. More...
 
class  TOPGeoPMT
 Geometry parameters of MCP-PMT. More...
 
class  TOPGeoPMTArray
 Geometry parameters of MCP-PMT array. More...
 
class  TOPGeoPMTArrayDisplacement
 Displacement parameters of MCP-PMT array. More...
 
class  TOPGeoPrism
 Geometry parameters of prism. More...
 
class  TOPGeoPrismEnclosure
 Geometry parameters of prism enclosure (simplified) More...
 
class  TOPGeoQBB
 Geometry parameters of Quartz Bar Box (mother class) More...
 
class  TOPGeoSideRails
 Geometry parameters of side rails (simplified) More...
 
class  TOPNominalQE
 Nominal quantum efficiency of PMT. More...
 
class  TOPNominalTDC
 Nominal time-to-digit conversion parameters (simplified model) More...
 
class  TOPNominalTTS
 Nominal time transition spread of PMT. More...
 
class  TOPPmtGainPar
 Parameterized PMT gain (from laser testing at Nagoya) More...
 
class  TOPPmtInstallation
 PMT position within a module. More...
 
class  TOPPmtObsoleteData
 PMT specs from Hamamatsu. More...
 
class  TOPPmtQE
 Nagoya measurements of quantum efficiency. More...
 
class  TOPPmtTTSHisto
 Raw measurements of TTS (histograms) for each PMT pixel. More...
 
class  TOPPmtTTSPar
 Parameterized TTS for each PMT pixel. More...
 
struct  TOPPulseHeightPar
 Struct holding the pulse height parameterizations for the TOP counter. More...
 
class  TOPSampleTimes
 Calibration constants of a singe ASIC channel: time axis (sample times) More...
 
class  TOPSignalShape
 Normalized shape of single photon pulse (waveform) Pulse must be positive. More...
 
class  TOPWavelengthFilter
 Bulk transmittance of wavelength filter. More...
 

Typedefs

typedef map< unsigned, size_t >::const_iterator Iterator
 Iteratior for m_map.
 
typedef std::pair< double, double > Pair
 Shorthand for std::pair<double, double>
 

Functions

void importSampleTimeCalibration (std::string fileNames, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import sample time calibration constants to database Output of TOPTimeBaseCalibrator (root files with histograms)
 
void importLocalT0Calibration (std::string fileNames, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import channel-by-channel T0 calibration constants to database The input is the root file with ntuple produced by TOPLaserCalibrator.
 
void importChannelT0 (std::string fileName, int expNo, int firstRun, int lastRun)
 Import channel T0 calibration constants The input is a root file with 1D histograms (one per slot, named "channelT0_slot*")
 
void importAsicShifts_BS13d (double s0, double s1, double s2, double s3, int expNo, int firstRun, int lastRun)
 Import ASIC shifts of BS13d.
 
void importOfflineCommonT0Calibration (std::string fileName, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import common T0 calibration constants derived form the offline data reprocessing to database The input is a root file containing a tree (one per run).
 
void importCommonT0 (double value, double error, int expNo, int firstRun, int lastRun, bool roughlyCalibrated=false)
 Import common T0 calibration constants.
 
void importModuleT0Calibration (std::string fileName, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import module T0 calibration constants to database The input is the text file.
 
void importModuleT0 (std::string fileName, int expNo, int firstRun, int lastRun)
 Import module T0 calibration constants The input is a root file with 1D histogram (name is "moduleT0")
 
void printSampleTimeCalibrationInfo ()
 Prints sample time calibration info about constants stored in database.
 
void printSampleTimeCalibration ()
 Print sample time calibration constants stored in database.
 
void importChannelMask (std::string fileName, int expNo, int firstRun, int lastRun)
 Import channel mask from a root file (given as 1D histograms, one per slot).
 
void generateFakeChannelMask (double fractionDead, double fractionHot, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Generate and import a (random, fake) channel mask for testing.
 
void importPmtQEData (std::string fileName, std::string treeName="qePmtData", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import PMT Quantum Efficiency data to database.
 
void importPmtGainData (std::string fileName, std::string treeName="gainPmtData", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import PMT gain parameters data to database.
 
void importPmtInstallationData (std::string fileName, std::string treeName="installationPmtData", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import PMT installation data to database.
 
void importPmtObsoleteData (std::string fileName, std::string treeName="obsPmtData", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import PMT specifications from Hamamatsu (not to be used!)
 
void importPmtTTSPar (std::string fileName, std::string treeName="ttsPmtPar", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import gaussians fitting the TTS distributions.
 
void importPmtTTSHisto (std::string fileName, std::string treeName="ttsPmtHisto", int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import histograms used for PMT TTS determination.
 
void importPmtPulseHeightFitResult (std::string fileName, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 Import fit results of pulse height disribution for channel gain and threshold efficiency.
 
void exportPmtTTSHisto (std::string outFileName="RetrievedHistos.root")
 Example of exporting TTS histograms.
 
void importFrontEndSettings (int lookback, int readoutWin, int extraWin, int offset, int expNo, int firstRun, int lastRun)
 Import front-end settings.
 
void importDummyCalModuleAlignment (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalModuleAlignment DB objects
 
void importDummyCalModuleT0 (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalCalModuleT0 DB objects
 
void importDummyCalChannelT0 (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelT0 DB objects
 
void importDummyCalTimebase (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalTimebase DB objects
 
void importDummyCalChannelNoise (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelNoise DB objects
 
void importDummyCalChannelPulseHeight (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelPulseHeight DB objects
 
void importDummyCalChannelRQE (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelRQE DB objects
 
void importDummyCalChannelThresholdEff (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelThresholdEff DB objects
 
void importDummyCalChannelThreshold (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalChannelThreshold DB objects
 
void importDummyCalCommonT0 (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalCommonT0 DB objects
 
void importDummyCalIntegratedCharge (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalIntegratedCharge DB objects
 
void importDummyCalAsicShift (int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 import a dummy payload of TOPCalAsicShift DB objects
 
void correctTOPPmtQE ()
 correct QE values in database for the reflection on window surface be sure that you run the function only once! see: BII-4230
 
void importTimeWalk (PyObject *list, double a, double b, int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
 payload TOPCalTimeWalk import parameters for time-walk correction and electronic time resolution tuning
 
void importTest (int runNumber, double syncTimeBase)
 for testing purposes only! - will be removed ...
 
void importTest ()
 for testing purposes only! - will be removed ...
 
bool setGains (const std::vector< float > &gains, float error=0)
 Set gains.
 
int setPedestals (const TProfile *profile, double average=0)
 Set pedestals from profile histogram with c_WindowSize bins.
 
unsigned getOptimizedOffset (const std::vector< unsigned > &values, const std::vector< unsigned > &errors, unsigned maxDif, unsigned maxErr)
 Return the offset that can allow for the maximal number of good pedestal samples.
 
void setT0 (int moduleID, unsigned asic, double T0)
 Sets calibration for a single ASIC and switches status to calibrated.
 
void setUnusable (int moduleID, unsigned asic)
 Switches calibration status to unusable to flag badly calibrated constant.
 
double getT0 (int moduleID, unsigned asic) const
 Returns T0 of a single asic.
 
bool isCalibrated (int moduleID, unsigned asic) const
 Returns calibration status.
 
bool isDefault (int moduleID, unsigned asic) const
 Returns calibration status.
 
bool isUnusable (int moduleID, unsigned asic) const
 Returns calibration status.
 
void setStatus (int moduleID, unsigned channel, EStatus status)
 Sets the status for a single channel.
 
void setActive (int moduleID, unsigned channel)
 Sets a specific channel as active.
 
void setDead (int moduleID, unsigned channel)
 Sets a specific channel as dead.
 
void setNoisy (int moduleID, unsigned channel)
 Sets a specific channel as noisy.
 
EStatus getStatus (int moduleID, unsigned channel) const
 Returns the status of a single channel.
 
bool isActive (int moduleID, unsigned channel) const
 Returns false if the channel is dead or noisy, and true is the channel is active.
 
bool check (const int module, const unsigned channel) const
 Check input module and channel arguments are sane.
 
int getNumOf (EStatus check) const
 Counts and returns the number of channels having a given status.
 
int getNumOf (EStatus check, int moduleID) const
 Counts and returns the number of channels od a module having a given status.
 
void setT0 (int moduleID, unsigned channel, double T0, double errT0)
 Sets calibration for a single channel and switches status to calibrated.
 
void setUnusable (int moduleID, unsigned channel)
 Switches calibration status to unusable to flag badly calibrated constant.
 
void suppressAverage ()
 Subtracts arithmetic average of a module from constants whose status is not c_Default.
 
double getT0 (int moduleID, unsigned channel) const
 Returns T0 of a single channel.
 
double getT0Error (int moduleID, unsigned channel) const
 Returns error on T0 of a single channel.
 
bool isCalibrated (int moduleID, unsigned channel) const
 Returns calibration status.
 
bool isDefault (int moduleID, unsigned channel) const
 Returns calibration status.
 
bool isUnusable (int moduleID, unsigned channel) const
 Returns calibration status.
 
void setAlpha (int moduleID, double alpha, double errAlpha)
 Sets the angle alpha on a single module.
 
void setBeta (int moduleID, double beta, double errBeta)
 Sets the angle beta on a single module.
 
void setGamma (int moduleID, double gamma, double errGamma)
 Sets the angle gamma on a single module.
 
void setX (int moduleID, double x, double errX)
 Sets the displacement x on a single module.
 
void setY (int moduleID, double y, double errY)
 Sets the displacement y on a single module.
 
void setZ (int moduleID, double z, double errZ)
 Sets the displacement z on a single module.
 
void setCalibrated (int moduleID)
 Switches calibration status to calibrated.
 
void setUnusable (int moduleID)
 Switches calibration status to unusable to flag badly calibrated constant.
 
double getAlpha (int moduleID) const
 Gets the angle alpha on a single module.
 
double getBeta (int moduleID) const
 Gets the angle beta on a single module.
 
double getGamma (int moduleID) const
 Gets the angle gamma on a single module.
 
double getX (int moduleID) const
 Returns the shift x on a single module.
 
double getY (int moduleID) const
 Returns the shift y on a single module.
 
double getZ (int moduleID) const
 Returns the shift z on a single module.
 
double getAlphaErr (int moduleID) const
 Returns the error on alpha on a single module.
 
double getBetaErr (int moduleID) const
 Returns the error on beta on a single module.
 
double getGammaErr (int moduleID) const
 Returns the error on gamma on a single module.
 
double getXErr (int moduleID) const
 Returns the error on x on a single module.
 
double getYErr (int moduleID) const
 Returns the error on y on a single module.
 
double getZErr (int moduleID) const
 Returns the error on z on a single module.
 
bool isCalibrated (int moduleID) const
 Returns calibration status.
 
bool isDefault (int moduleID) const
 Returns calibration status.
 
bool isUnusable (int moduleID) const
 Returns calibration status.
 
bool areAllCalibrated () const
 Returns true if all modules are calibrated.
 
bool areAllPrecise (double spatialPrecision, double angularPrecision) const
 Returns true if calibration precision for all modules is within specified values.
 
void setTransformations () const
 Sets the transformation cache.
 
const ROOT::Math::Transform3D & getTransformation (int moduleID) const
 Returns transformation from local to nominal frame.
 
void setT0 (int moduleID, double T0, double errT0)
 Sets calibration for a single module and switches status to calibrated.
 
void setUnusable (int moduleID)
 Switches calibration status to unusable to flag badly calibrated constant.
 
void suppressAverage ()
 Subtracts arithmetic average from constants whose status is not c_Default.
 
double getT0 (int moduleID) const
 Returns T0 of a module.
 
double getT0Error (int moduleID) const
 Returns error on T0 of a module.
 
bool isCalibrated (int moduleID) const
 Returns calibration status.
 
bool isDefault (int moduleID) const
 Returns calibration status.
 
bool isUnusable (int moduleID) const
 Returns calibration status.
 
void set (int slot, const TH1F *photonYields, const TH1F *backgroundYields, const TH1F *alphaRatio, const TH1F *activePixels, const TH2F *pulseHeights, const TH1F *muonZ)
 Sets the data of a given slot.
 
void copyContent (const TH1F *input, TH2F &output)
 Copy content of 1D histogram into 2D histogram.
 
const TH2F * getPhotonYields (int slot) const
 Returns a 2D histogram of photon pixel yields.
 
const TH2F * getBackgroundYields (int slot) const
 Returns a 2D histogram of background pixel yields.
 
const TH2F * getAlphaRatio (int slot) const
 Returns a 2D histogram of equalized pixel alpha ratio.
 
const TH2F * getActivePixels (int slot) const
 Returns a 2D histogram of active pixels.
 
const TH2F * getPulseHeights (int slot) const
 Returns a 2D histogram of pixel pulse-heights.
 
const TH1F * getMuonZ (int slot) const
 Returns z distribution of tracks used to determine pixel yields.
 
void append (unsigned scrodID, unsigned channel, const std::vector< double > &sampleTimes, bool replace=true)
 Appends calibration of a single ASIC channel.
 
const TOPSampleTimesgetSampleTimes (unsigned scrodID, unsigned channel) const
 Returns calibration constants for given SCROD and channel.
 
bool isAvailable (unsigned scrodID, unsigned channel) const
 Checks if calibration is available.
 
void createMap () const
 Creates a map in cache.
 
void set (const std::vector< double > &timeWalkParams, double noise, double quadratic)
 Sets all the parameters and switches status to calibrated.
 
double getTimeWalk (int pulseHeight) const
 Returns time-walk at given pulse height.
 
double getSigmaSq (int pulseHeight) const
 Returns an excess of electronic time resolution at given pulse height.
 
double getSigma (int pulseHeight) const
 Returns an excess of electronic time resolution at given pulse height.
 
void setWindowShifts (std::vector< int > shifts)
 Sets window shifts.
 
virtual bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="Bar segment geometry parameters") const override
 Print the content of the class.
 
std::vector< std::pair< double, double > > getBrokenGlueContour () const
 Returns the x-y contour of broken glue.
 
void constructContour (double A, double B, double fraction, double angle, std::vector< std::pair< double, double > > &contour) const
 Construct a 2D contour.
 
virtual void print (const std::string &title) const
 Print the content of the class.
 
void printUnderlined (const std::string &title) const
 Print the content of the class.
 
virtual void printSurface (const GeoOpticalSurface &surface) const
 Print the content of optical surface.
 
double getReflectivity (const GeoOpticalSurface &surface, double energy) const
 Returns reflectivity of optical surface at given photon energy.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB cold plate geometry parameters") const override
 Print the content of the class.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB forward end plate geometry parameters") const override
 Print the content of the class.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="Front-end geometry parameters") const override
 Print the content of the class.
 
void appendContour (std::vector< std::pair< double, double > > &contour, double y0, bool fromLeftToRight) const
 Appends curved surface to contour.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB honeycomb panel geometry parameters") const override
 Print the content of the class.
 
void appendModule (const TOPGeoModule &module)
 Appends module (if its ID differs from already appended modules)
 
bool isModuleIDValid (int moduleID) const
 Checks if module exists in m_modules.
 
const TOPGeoModulegetModule (int moduleID) const
 Returns module.
 
const TOPNominalTTSgetTTS (unsigned type) const
 Returns time transition spread of a given PMT type.
 
double getPDETuningFactor (unsigned type) const
 Returns photon detection efficiency tuning factor of a given PMT type.
 
double getInnerRadius () const
 Returns inner radius of the volume devoted to TOP counter.
 
double getOuterRadius () const
 Returns outer radius of the volume devoted to TOP counter.
 
double getRadius () const
 Returns average radius of modules.
 
double getBackwardZ () const
 Returns backward z of the volume devoted to TOP counter.
 
double getForwardZ () const
 Returns forward z of the volume devoted to TOP counter.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="TOP geometry parameters") const override
 Print the content of the class.
 
double getZc () const
 Returns spherical mirror center of curvature in z (in local frame of this segment)
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Mirror segment geometry parameters") const override
 Print the content of the class.
 
 TOPGeoModule (const TOPGeoModule &module)
 Copy constructor.
 
TOPGeoModuleoperator= (const TOPGeoModule &module)
 Assignment operator.
 
 ~TOPGeoModule ()
 Destructor.
 
void setTransformation () const
 Sets transformation cache.
 
void setBrokenGlue (int glueID, double fraction, double angle, const std::string &material)
 Sets glue to be broken (delaminated)
 
void setPeelOffRegions (double thickness, const std::string &material)
 Sets parameters of the peel-off cookie volumes.
 
ROOT::Math::XYZPoint pointToGlobal (const ROOT::Math::XYZPoint &point) const
 Transforms 3D point from module internal (= nominal & displaced) frame to Belle II frame.
 
ROOT::Math::XYZVector momentumToGlobal (const ROOT::Math::XYZVector &momentum) const
 Transforms momentum vector from module internal (= nominal & displaced) frame to Belle II frame.
 
ROOT::Math::XYZPoint pointToLocal (const ROOT::Math::XYZPoint &point) const
 Transforms 3D point from Belle II to module internal (= nominal & displaced) frame.
 
ROOT::Math::XYZVector momentumToLocal (const ROOT::Math::XYZVector &momentum) const
 Transforms momentum vector from Belle II to module internal (= nominal & displaced) frame.
 
ROOT::Math::XYZPoint pointNominalToGlobal (const ROOT::Math::XYZPoint &point) const
 Transforms 3D point from module nominal frame to Belle II frame.
 
ROOT::Math::XYZVector momentumNominalToGlobal (const ROOT::Math::XYZVector &momentum) const
 Transforms momentum vector from module nominal frame to Belle II frame.
 
ROOT::Math::XYZPoint pointGlobalToNominal (const ROOT::Math::XYZPoint &point) const
 Transforms 3D point from Belle II to module nominal frame.
 
ROOT::Math::XYZVector momentumGlobalToNominal (const ROOT::Math::XYZVector &momentum) const
 Transforms momentum vector from Belle II to module nominal frame.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Module geometry parameters") const override
 Print the content of the class.
 
void print (const std::string &title="Module displacement parameters") const override
 Print the content of the class.
 
ROOT::Math::Transform3D getTransformation () const
 Returns transformation from local to nominal frame.
 
unsigned getPixelColumn (double x) const
 Converts x-coordinate to pixel column (1-based)
 
unsigned getPixelRow (double y) const
 Converts y-coordinate to pixel row (1-based)
 
unsigned getPixelID (double x, double y) const
 Converts x and y coordinates to PMT pixel ID (1-based)
 
double getX (unsigned col) const
 Returns x coordinate of pixel center.
 
double getY (unsigned row) const
 Returns y coordinate of pixel center.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="MCP-PMT geometry parameters") const override
 Print the content of the class.
 
unsigned getPmtID (unsigned row, unsigned col) const
 Converts row and column numbers to PMT ID (1-based)
 
unsigned getRow (unsigned pmtID) const
 Converts PMT ID to row number (1-based)
 
unsigned getColumn (unsigned pmtID) const
 Converts PMT ID to column number (1-based)
 
int getPixelID (double x, double y, unsigned pmtID) const
 Converts (digitizes) x, y and PMT ID to pixel ID (1-based)
 
int getPixelID (unsigned pmtID, unsigned pmtPixelID) const
 Returns pixel ID (1-based)
 
void generateDecoupledPMTs (double fraction)
 Generate randomly a fraction of PMT's to be optically decoupled.
 
bool isPMTDecoupled (unsigned pmtID) const
 Checks if PMT is optically decoupled.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="PMT array geometry parameters") const override
 Print the content of the class.
 
void print (const std::string &title="PMT array displacement parameters") const override
 Print the content of the class.
 
 UnfoldedWindow (const ROOT::Math::XYVector &orig, const ROOT::Math::XYVector &dir, const ROOT::Math::XYVector &norm, const ROOT::Math::XYVector &slanted)
 constructor
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Prism geometry parameters") const override
 Print the content of the class.
 
void appendPeelOffRegion (unsigned ID, double fraction, double angle)
 Appends peel-off cookie region.
 
std::vector< std::pair< double, double > > getPeelOffContour (const PeelOffRegion &region) const
 Returns the x-y contour of the peel-off region.
 
void unfold () const
 Unfold prism exit window.
 
void reflect (const ROOT::Math::XYVector *points, const ROOT::Math::XYVector *normals, const ROOT::Math::XYVector &orig, const ROOT::Math::XYVector &surf, const ROOT::Math::XYVector &norm, const ROOT::Math::XYVector &slanted, int k, std::vector< UnfoldedWindow > &result) const
 Do unfolding.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB prism enclosure geometry parameters") const override
 Print the content of the class.
 
std::vector< std::pair< double, double > > getForwardContour () const
 Returns forward x-y contour.
 
void printForwardContour () const
 Print forward contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getInnerPanelContour () const
 Returns inner honeycomb panel x-y contour.
 
void printInnerPanelContour () const
 Print inner honeycomb panel contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getOuterPanelContour () const
 Returns outer honeycomb panel x-y contour.
 
void printOuterPanelContour () const
 Print outer honeycomb panel contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getBackwardContour () const
 Returns backward x-y contour.
 
void printBackwardContour () const
 Print backward contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getPrismEnclosureContour () const
 Returns prism enclosure wall x-y contour.
 
void printPrismEnclosureContour () const
 Print prism enclosure contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getBackPlateContour () const
 Returns prism enclosure back plate x-y contour.
 
void printBackPlateContour () const
 Print prism enclosure back plate contour (polygon) - for debugging.
 
std::vector< std::pair< double, double > > getFrontPlateContour () const
 Returns prism enclosure front plate x-y contour.
 
void printFrontPlateContour () const
 Print prism enclosure front plate contour (polygon) - for debugging.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB geometry parameters") const override
 Print the content of the class.
 
bool isConsistent () const override
 Check for consistency of data members.
 
virtual void print (const std::string &title="QBB side rails geometry parameters") const override
 Print the content of the class.
 
void applyFilterTransmission (const TOPWavelengthFilter &filter)
 Multiplies quantum efficiency data points with filter transmission.
 
double getQE (double lambda) const
 Returns quantum efficiency at given photon wavelength using linear interpolation.
 
double getMinLambda () const
 Returns wavelength of the first nonzero QE data point.
 
double getMaxLambda () const
 Returns wavelength of the last nonzero QE data point.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Nominal quantum efficiency") const override
 Print the content of the class.
 
 TOPNominalTDC (int numWindows, int subBits, double syncTimeBase, int numofBunches, double offset, double pileupTime, double doubleHitResolution, double timeJitter, double efficiency, const std::string &name="TOPNominalTDC")
 Useful constructor (new xml file version)
 
int getTDCcount (double time) const
 Converts time to TDC count.
 
int getSample (double time) const
 Converts time to sample number.
 
bool isSampleValid (int sample) const
 Check for the validity of sample number.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Nominal time-to-digit conversion parameters") const override
 Print the content of the class.
 
void appendGaussian (double norm, double mean, double sigma)
 Append Gaussian.
 
double normalize ()
 Normalize the distribution (fractions)
 
double generateTTS () const
 Generate time according to TTS distribution.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Nominal TTS distribution") const override
 Print the content of the class.
 
void print () const
 Print the class content.
 
const std::vector< float > & getQE (unsigned pmtPixel) const
 Returns quantum efficiency data points for a given pixel.
 
double getQE (unsigned pmtPixel, double lambda) const
 Returns quantum efficiency for a given pixel and wavelength, using linear interpolation.
 
const std::vector< float > & getEnvelopeQE () const
 Returns envelope quantum efficiency data points (maximum over pixels)
 
double getEnvelopeQE (double lambda) const
 Returns envelope quantum efficiency for a given wavelength (maximum over pixels), using linear interpolation.
 
double getEfficiency (unsigned pmtPixel, double lambda, bool BfieldOn) const
 Returns quantum times collection efficiency for a given pixel and wavelength, using linear interpolation.
 
double getCE (bool BfieldOn) const
 Returns collection efficiency.
 
double getLambdaLast () const
 Returns wavelenght of the last data point (maximal of pixels)
 
double getLambdaLast (unsigned pmtPixel) const
 Returns wavelenght of the last data point for a given pixel.
 
void setEnvelopeQE () const
 Sets envelope quantum efficiency.
 
double interpolate (double lambda, const std::vector< float > &QE) const
 Interpolate between QE datapoints (linear interpolation).
 
void setTimeAxis (double syncTimeBase)
 Sets equidistant time axis (uncalibrated).
 
void setTimeAxis (const std::vector< double > &sampleTimes, double syncTimeBase)
 Sets time axis from calibration data and switches status to calibrated.
 
std::vector< double > getTimeAxis () const
 Returns time axis (sample times)
 
double getFullTime (int window, double sample) const
 Returns time with respect to sample 0 of window 0.
 
double getSample (int window, double time) const
 Returns sample with respect to sample 0 of the specified ASIC window (inverse of getTime).
 
double getTimeBin (int window, int sampleNumber) const
 Returns time bin of a given sample number and window (e.g.
 
 TOPSignalShape (std::vector< double > shape, double timeBin, double tau, double pole1, double pole2)
 Full constructor.
 
double getValue (double t) const
 Returns value at time t of the normalized waveform using interpolator.
 
double getPeakingTime () const
 Returns peaking time of the signal.
 
float getBulkTransmittance (double lambda) const
 Returns bulk transmittance at given wavelength using linear interpolation.
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Wavelength filter bulk transmittance") const override
 Print the content of the class.
 

Variables

static double s_unit = Unit::cm
 conversion unit for length
 
static std::string s_unitName
 conversion unit name
 

Detailed Description

Typedef Documentation

◆ Iterator

typedef map<unsigned,size_t>::const_iterator Iterator

Iteratior for m_map.

Definition at line 21 of file TOPCalTimebase.cc.

◆ Pair

typedef std::pair< double, double > Pair

Shorthand for std::pair<double, double>

Definition at line 57 of file TOPGeoBarSegment.cc.

Function Documentation

◆ append()

void append ( unsigned  scrodID,
unsigned  channel,
const std::vector< double > &  sampleTimes,
bool  replace = true 
)

Appends calibration of a single ASIC channel.

Parameters
scrodIDSCROD ID
channelchannel number within SCROD (0 - 127)
sampleTimesvector of 256 elements (at least) defining time axis
replacereplace or not if constants for this scrod/channel are already in

Definition at line 24 of file TOPCalTimebase.cc.

27 {
28 // sanitary checks for NaN's
29 for (double t : sampleTimes) {
30 if (isnan(t)) {
31 B2ERROR("TOPCalTimebase::append: sampleTimes contain NaN's - constants rejected."
32 << LogVar("scrodID", scrodID)
33 << LogVar("channel", channel));
34 return;
35 }
36 }
37
38 // append
39 unsigned key = (scrodID << 16) + (channel % 128);
40 Iterator it = m_map.find(key);
41 if (it == m_map.end()) { // constants not appended yet
42 m_sampleTimes.push_back(TOPSampleTimes(scrodID, channel, m_syncTimeBase));
43 m_sampleTimes.back().setTimeAxis(sampleTimes, m_syncTimeBase);
44 m_map[key] = m_sampleTimes.size() - 1;
45 } else { // constants already there
46 if (replace) {
47 m_sampleTimes[it->second].setTimeAxis(sampleTimes, m_syncTimeBase);
48 B2WARNING("TOPCalTimebase::append: constants replaced."
49 << LogVar("scrodID", scrodID)
50 << LogVar("channel", channel));
51 } else {
52 B2WARNING("TOPCalTimebase::append old constants kept."
53 << LogVar("scrodID", scrodID)
54 << LogVar("channel", channel));
55 }
56 }
57
58 }
double m_syncTimeBase
synchronization time base (width of 2 ASIC windows)
std::vector< TOPSampleTimes > m_sampleTimes
calibration constants
std::map< unsigned, size_t > m_map
cache for a map
Class to store variables with their name which were sent to the logging service.
map< unsigned, size_t >::const_iterator Iterator
Iteratior for m_map.

◆ appendContour()

void appendContour ( std::vector< std::pair< double, double > > &  contour,
double  y0,
bool  fromLeftToRight 
) const

Appends curved surface to contour.

Parameters
contour2D contour
y0offset in y0
fromLeftToRightif true, going from left to right otherwise oposite

Definition at line 21 of file TOPGeoHoneycombPanel.cc.

24 {
25 if (m_N <= 0) return;
26
27 typedef std::pair<double, double> Pair;
28
29 double R = getRadius();
30 double yc = getMaxThickness() - getMinThickness() - R;
31 double x0 = sqrt(R * R - yc * yc);
32 if (!fromLeftToRight) x0 = -x0;
33 double dx = 2.0 * x0 / m_N;
34 double x = -x0;
35 contour.push_back(Pair(x, y0));
36 for (int i = 1; i < m_N; i++) {
37 x += dx;
38 double y = y0 + sqrt(R * R - x * x) + yc;
39 contour.push_back(Pair(x, y));
40 }
41 contour.push_back(Pair(x0, y0));
42
43 }
double R
typedef autogenerated by FFTW
int m_N
number of flat surfaces to approximate curved surface
double getMaxThickness() const
Returns panel maximal thickness.
double getMinThickness() const
Returns panel minimal thickness.
double getRadius() const
Returns radius of curved surface.
std::pair< double, double > Pair
Shorthand for std::pair<double, double>

◆ appendGaussian()

void appendGaussian ( double  norm,
double  mean,
double  sigma 
)

Append Gaussian.

Parameters
normnormalization (area)
meanmean value [ns]
sigmasigma (width) [ns]

Definition at line 22 of file TOPNominalTTS.cc.

23 {
24 if (norm <= 0) {
25 B2ERROR("TOPNominalTTS::appendGaussian: normalization is non-positive number");
26 return;
27 }
28 Gauss gauss;
29 gauss.fraction = norm;
30 gauss.position = mean;
31 gauss.sigma = sigma;
32 m_tts.push_back(gauss);
33 m_normalized = false;
34 }
bool m_normalized
normalization flag
std::vector< Gauss > m_tts
TTS distribution composed of a sum of Gaussians.

◆ appendModule()

void appendModule ( const TOPGeoModule module)

Appends module (if its ID differs from already appended modules)

Parameters
modulemodule geometry parameters

Definition at line 22 of file TOPGeometry.cc.

23 {
24 if (isModuleIDValid(module.getModuleID())) {
25 B2ERROR("TOPGeometry::appendModule: module already appended."
26 << LogVar("ID", module.getModuleID()));
27 return;
28 }
29 m_modules.push_back(module);
30 }
std::vector< TOPGeoModule > m_modules
geometry parameters of modules
Definition: TOPGeometry.h:283
bool isModuleIDValid(int moduleID) const
Checks if module exists in m_modules.
Definition: TOPGeometry.cc:33

◆ appendPeelOffRegion()

void appendPeelOffRegion ( unsigned  ID,
double  fraction,
double  angle 
)

Appends peel-off cookie region.

Parameters
IDregion ID (1-based)
fractionfraction of the area
angleangle of the area

Definition at line 94 of file TOPGeoPrism.cc.

95 {
96 for (const auto& region : m_peelOffRegions) {
97 if (region.ID == ID) {
98 B2ERROR("TOPGeoPrism::appendPeelOffRegion: region already appended."
99 << LogVar("region ID", ID));
100 return;
101 }
102 }
103 PeelOffRegion region;
104 region.ID = ID;
105 region.fraction = fraction;
106 region.angle = angle;
107 double halfSize = (getWidth() - getPeelOffSize()) / 2;
108 if (fabs(getPeelOffCenter(region)) > halfSize) {
109 B2ERROR("TOPGeoPrism::appendPeelOffRegion: region doesn't fit into prism."
110 << LogVar("region ID", ID));
111 return;
112 }
113 m_peelOffRegions.push_back(region);
114 }
double getWidth() const
Returns bar segment width.
double getPeelOffCenter(const PeelOffRegion &region) const
Returns peel-off offset in x of the given region.
Definition: TOPGeoPrism.h:198
std::vector< PeelOffRegion > m_peelOffRegions
peel-off regions
Definition: TOPGeoPrism.h:284
double getPeelOffSize() const
Returns cookie size in x (corresponding to 2x2 PMT)
Definition: TOPGeoPrism.h:173

◆ applyFilterTransmission()

void applyFilterTransmission ( const TOPWavelengthFilter filter)

Multiplies quantum efficiency data points with filter transmission.

Parameters
filterwavelength filter

Definition at line 21 of file TOPNominalQE.cc.

22 {
23 for (size_t i = 0; i < m_QE.size(); i++) {
24 double lambda = m_lambdaFirst + m_lambdaStep * i;
25 m_QE[i] *= filter.getBulkTransmittance(lambda);
26 }
27 }
std::vector< float > m_QE
QE data points.
Definition: TOPNominalQE.h:168
float m_lambdaStep
wavelength step [nm]
Definition: TOPNominalQE.h:166
float m_lambdaFirst
wavelength of the first data point [nm]
Definition: TOPNominalQE.h:165
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38

◆ areAllCalibrated()

bool areAllCalibrated ( ) const

Returns true if all modules are calibrated.

Definition at line 260 of file TOPCalModuleAlignment.cc.

261 {
262 for (int i = 0; i < c_numModules; i++) {
263 if (m_status[i] != c_Calibrated) return false;
264 }
265 return true;
266 }
EStatus m_status[c_numModules]
calibration status
@ c_Calibrated
good calibrated value

◆ areAllPrecise()

bool areAllPrecise ( double  spatialPrecision,
double  angularPrecision 
) const

Returns true if calibration precision for all modules is within specified values.

Parameters
spatialPrecisionprecision for displacements
angularPrecisionprecision for rotations

Definition at line 268 of file TOPCalModuleAlignment.cc.

270 {
271 for (int i = 0; i < c_numModules; i++) {
272 if (m_errAlpha[i] > angularPrecision) return false;
273 if (m_errBeta[i] > angularPrecision) return false;
274 if (m_errGamma[i] > angularPrecision) return false;
275 if (m_errX[i] > spatialPrecision) return false;
276 if (m_errY[i] > spatialPrecision) return false;
277 if (m_errZ[i] > spatialPrecision) return false;
278 }
279 return true;
280 }
float m_errGamma[c_numModules]
error on gamma
float m_errX[c_numModules]
error on the x displacement
float m_errBeta[c_numModules]
error on beta
float m_errY[c_numModules]
error on the y displacement
float m_errZ[c_numModules]
error on the z displacement
float m_errAlpha[c_numModules]
error on alpha

◆ check()

bool check ( const int  module,
const unsigned  channel 
) const
private

Check input module and channel arguments are sane.

Definition at line 82 of file TOPCalChannelMask.cc.

83 {
84 if (module >= c_numModules) {
85 B2ERROR("Invalid module number (" << ClassName() << ")");
86 return false;
87 }
88 if (module < 0) {
89 B2ERROR("Invalid module number (" << ClassName() << ")");
90 return false;
91 }
92 if (channel >= c_numChannels) {
93 B2ERROR("Invalid channel number (" << ClassName() << ")");
94 return false;
95 }
96 return true;
97 }
@ c_numChannels
number of channels per module
@ c_numModules
number of modules

◆ constructContour()

void constructContour ( double  A,
double  B,
double  fraction,
double  angle,
std::vector< std::pair< double, double > > &  contour 
) const
protected

Construct a 2D contour.

Parameters
Adimension in x
Bdimension in y
fractionsurface fraction
angleangle
contourclock-wise polygon to return

Definition at line 70 of file TOPGeoBarSegment.cc.

72 {
73 if (fraction <= 0.) {
74 return;
75 }
76 if (fraction >= 1.) {
77 contour.push_back(Pair(-A, B));
78 contour.push_back(Pair(A, B));
79 contour.push_back(Pair(A, -B));
80 contour.push_back(Pair(-A, -B));
81 return;
82 }
83
84 double alpha0 = atan(B / A);
85 double halfPi = alpha0 > 0 ? M_PI / 2 : -M_PI / 2;
86 int quadrant = 0;
87 while (fabs(angle) > alpha0) {
88 angle -= halfPi;
89 alpha0 = M_PI / 2 - alpha0;
90 double a = A;
91 A = B;
92 B = a;
93 quadrant++;
94 }
95 quadrant = quadrant % 4;
96 if (halfPi < 0) quadrant = (4 - quadrant) % 4;
97
98 double tanAngle = tan(fabs(angle));
99 double S0 = A / B * tanAngle / 2;
100 if (fraction <= S0) {
101 double x = sqrt(8 * A * B * fraction / tanAngle);
102 double y = x * tanAngle;
103 if (angle > 0) {
104 contour.push_back(Pair(-A, B - y));
105 contour.push_back(Pair(-A, B));
106 contour.push_back(Pair(-A + x, B));
107 } else {
108 contour.push_back(Pair(A, B - y));
109 contour.push_back(Pair(A - x, B));
110 contour.push_back(Pair(A, B));
111 }
112 } else if (1 - fraction <= S0) {
113 double x = sqrt(8 * A * B * (1 - fraction) / tanAngle);
114 double y = x * tanAngle;
115 if (angle > 0) {
116 contour.push_back(Pair(A, -B + y));
117 contour.push_back(Pair(A - x, -B));
118 contour.push_back(Pair(-A, -B));
119 contour.push_back(Pair(-A, B));
120 contour.push_back(Pair(A, B));
121 } else {
122 contour.push_back(Pair(-A + x, -B));
123 contour.push_back(Pair(-A, -B + y));
124 contour.push_back(Pair(-A, B));
125 contour.push_back(Pair(A, B));
126 contour.push_back(Pair(A, -B));
127 }
128 } else {
129 double y = (1 - 2 * fraction) * B;
130 double dy = angle > 0 ? A * tanAngle : -A * tanAngle;
131 contour.push_back(Pair(-A, y - dy));
132 contour.push_back(Pair(-A, B));
133 contour.push_back(Pair(A, B));
134 contour.push_back(Pair(A, y + dy));
135 }
136
137 switch (quadrant) {
138 case 0:
139 break;
140 case 1:
141 for (auto& point : contour) {
142 double x = -point.second;
143 double y = point.first;
144 point.first = x;
145 point.second = y;
146 }
147 break;
148 case 2:
149 for (auto& point : contour) {
150 double x = -point.first;
151 double y = -point.second;
152 point.first = x;
153 point.second = y;
154 }
155 break;
156 case 3:
157 for (auto& point : contour) {
158 double x = point.second;
159 double y = -point.first;
160 point.first = x;
161 point.second = y;
162 }
163 break;
164 default:
165 B2ERROR("TOPGeoBarSegment::constructContour: bug!");
166 }
167
168 }
double atan(double a)
atan for double
Definition: beamHelpers.h:34
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ copyContent()

void copyContent ( const TH1F *  input,
TH2F &  output 
)
private

Copy content of 1D histogram into 2D histogram.

Parameters
input1D histogram
output2D histogram

Definition at line 51 of file TOPCalPhotonYields.cc.

52 {
53 for (int bin = 1; bin <= input->GetNbinsX(); bin++) {
54 int row = (bin - 1) / 64 + 1;
55 int col = (bin - 1) % 64 + 1;
56 output.SetBinContent(col, row, input->GetBinContent(bin));
57 output.SetBinError(col, row, input->GetBinError(bin));
58 }
59 }

◆ correctTOPPmtQE()

void correctTOPPmtQE ( )

correct QE values in database for the reflection on window surface be sure that you run the function only once! see: BII-4230

Definition at line 1405 of file TOPDatabaseImporter.cc.

1406 {
1407 B2ERROR("Function disabled since the corrected payload TOPPmtQEs already imported");
1408 return;
1409
1410 DBArray<TOPPmtQE> pmtQEData;
1411 DBImportArray<TOPPmtQE> pmtQECorrected;
1412
1413 for (const auto& pmt : pmtQEData) {
1414 auto* pmtCorr = pmtQECorrected.appendNew(pmt.getSerialNumber(),
1415 pmt.getLambdaFirst(),
1416 pmt.getLambdaStep(),
1417 pmt.getCE(false),
1418 pmt.getCE(true));
1419 for (unsigned pmtPixel = 1; pmtPixel <= TOPPmtQE::c_NumPmtPixels; pmtPixel++) {
1420 auto qeData = pmt.getQE(pmtPixel);
1421 float lambda = pmt.getLambdaFirst();
1422 float step = pmt.getLambdaStep();
1423 for (auto& qe : qeData) {
1424 double n = TOPGeometryPar::Instance()->getPhaseIndex(TOPGeometryPar::c_hc / lambda); // quartz refractive index
1425 double reflectance = pow((n - 1) / (n + 1), 2);
1426 qe /= (1 - reflectance);
1427 lambda += step;
1428 }
1429 pmtCorr->setQE(pmtPixel, qeData);
1430 }
1431 }
1432
1433 IntervalOfValidity iov(0, 0, -1, -1);
1434 pmtQECorrected.import(iov);
1435
1436 B2RESULT("Corrected PMT QE data imported to database for "
1437 << pmtQECorrected.getEntries() << " PMT's.");
1438
1439 }
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
static const double c_hc
Planck constant times speed of light in [eV*nm].
double getPhaseIndex(double energy) const
Returns phase refractive index of quartz at given photon energy.

◆ createMap()

void createMap ( ) const
private

Creates a map in cache.

Definition at line 87 of file TOPCalTimebase.cc.

88 {
89 for (size_t i = 0; i < m_sampleTimes.size(); i++) {
90 const auto& sampleTime = m_sampleTimes[i];
91 unsigned key = (sampleTime.getScrodID() << 16) + sampleTime.getChannel();
92 m_map[key] = i;
93 }
94
95 B2DEBUG(29, "TOPCalTimebase: map created, size = " << m_map.size());
96 }

◆ exportPmtTTSHisto()

void exportPmtTTSHisto ( std::string  outFileName = "RetrievedHistos.root")

Example of exporting TTS histograms.

Parameters
outFileNamename of the root file where data will be saved

Definition at line 1219 of file TOPDatabaseImporter.cc.

1220 {
1221
1222 // this is just an example on how to retrieve TTS histograms
1223 DBArray<TOPPmtTTSHisto> elements("TOPPmtTTSHistos");
1224
1225 TFile file(outFileName.c_str(), "recreate");
1226
1227 // prints serialNum of PMTs and hv setting used, and saves TTS histograms to root file
1228 for (const auto& element : elements) {
1229
1230 B2INFO("serialNum = " << element.getSerialNumber() << ", HV = " << element.getHV());
1231 for (int ic = 0; ic < element.getNumOfPixels(); ic++) {
1232 const auto* ttsHisto = element.getHistogram(ic + 1);
1233 if (ttsHisto) ttsHisto->Write();
1234 }
1235 }
1236
1237 file.Close();
1238
1239 return;
1240 }

◆ generateDecoupledPMTs()

void generateDecoupledPMTs ( double  fraction)

Generate randomly a fraction of PMT's to be optically decoupled.

Parameters
fractiondecoupled fraction

Definition at line 74 of file TOPGeoPMTArray.cc.

75 {
76 if (fraction <= 0) return;
77
78 for (unsigned i = 0; i < getSize(); i++) {
79 if (gRandom->Rndm() < fraction) setDecoupledPMT(i + 1);
80 }
81
82 }
void setDecoupledPMT(unsigned pmtID)
Sets PMT as optically decoupled.
unsigned getSize() const
Returns array size.

◆ generateFakeChannelMask()

void generateFakeChannelMask ( double  fractionDead,
double  fractionHot,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Generate and import a (random, fake) channel mask for testing.

Parameters
fractionDeadthe fraction of dead PMs to randomly assign
fractionHotthe fraction of noisy PMs to randomly assign
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 673 of file TOPDatabaseImporter.cc.

677 {
678 // declare db object to be imported -- and construct it
679 DBImportObjPtr<TOPCalChannelMask> channelMask;
680 channelMask.construct();
681
682 // set up for loop channel mapper
683 auto& chMapper = TOPGeometryPar::Instance()->getChannelMapper();
684 const size_t nModules = TOPGeometryPar::Instance()->getGeometry()->getNumModules();
685 unsigned ncall = 0;
686 unsigned nall = 0;
687
688 // loop over module (1-based)
689 for (size_t moduleID = 1; moduleID <= nModules; moduleID++) {
690
691 // loop over boardStack*carrierBoard*assic*channel to get channel (0 to 512)
692 // TODO: get these loop limits from some sensible enum somewhere
693 for (int boardStack = 0; boardStack < 4; boardStack++) {
694 for (int carrierBoard = 0; carrierBoard < 4; carrierBoard++) {
695 for (int asic = 0; asic < 4; asic++) {
696 for (int chan = 0; chan < 8; chan++) {
697 auto channel = chMapper.getChannel(boardStack, carrierBoard, asic, chan);
698 nall++;
699 if (gRandom->Rndm() < fractionDead) {
700 channelMask->setDead(moduleID, channel);
701 ncall++;
702 }
703 if (gRandom->Rndm() < fractionHot) {
704 channelMask->setNoisy(moduleID, channel);
705 ncall++;
706 }
707 }
708 }
709 }
710 }
711 } // module
712
713 // declare interval of validity
714 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
715 channelMask.import(iov);
716
717 B2RESULT("Generated and imported a fake channel mask to database for testing: "
718 << ncall << "/" << nall);
719 return;
720 }
unsigned getNumModules() const
Returns number of modules.
Definition: TOPGeometry.h:136
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)

◆ generateTTS()

double generateTTS ( ) const

Generate time according to TTS distribution.

Returns
time [ns]

Definition at line 46 of file TOPNominalTTS.cc.

47 {
48 double prob = gRandom->Rndm();
49 double s = 0;
50 for (const auto& tts : m_tts) {
51 s = s + tts.fraction;
52 if (prob < s) {
53 return gRandom->Gaus(tts.position, tts.sigma);
54 }
55 }
56 return 0;
57 }

◆ getActivePixels()

const TH2F * getActivePixels ( int  slot) const

Returns a 2D histogram of active pixels.

Parameters
slotslot ID
Returns
pixel image of active pixels (nullptr if N/A)

Definition at line 86 of file TOPCalPhotonYields.cc.

87 {
88 unsigned index = slot - 1;
89 if (index < m_activePixels.size()) return &m_activePixels[index];
90 return 0;
91 }
std::vector< TH2F > m_activePixels
active pixels (index = slot - 1)

◆ getAlpha()

double getAlpha ( int  moduleID) const

Gets the angle alpha on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
alpha rotation angle around x

Definition at line 119 of file TOPCalModuleAlignment.cc.

120 {
121 unsigned module = moduleID - 1;
122 if (module >= c_numModules) {
123 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
124 return 0;
125 }
126 return m_alpha[module];
127 }
float m_alpha[c_numModules]
rotation angle around the x axis

◆ getAlphaErr()

double getAlphaErr ( int  moduleID) const

Returns the error on alpha on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errAlpha error on the alpha angle

Definition at line 179 of file TOPCalModuleAlignment.cc.

180 {
181 unsigned module = moduleID - 1;
182 if (module >= c_numModules) {
183 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
184 return 0;
185 }
186 return m_errAlpha[module];
187 }

◆ getAlphaRatio()

const TH2F * getAlphaRatio ( int  slot) const

Returns a 2D histogram of equalized pixel alpha ratio.

For optically well coupled pixels this ratio is around 1 and it is around 0.5 for those which are not.

Parameters
slotslot ID
Returns
pixel image of alpha ratio (nullptr if N/A)

Definition at line 78 of file TOPCalPhotonYields.cc.

79 {
80 unsigned index = slot - 1;
81 if (index < m_alphaRatio.size()) return &m_alphaRatio[index];
82 return 0;
83 }
std::vector< TH2F > m_alphaRatio
equalized alpha ratio per pixel (index = slot - 1)

◆ getBackgroundYields()

const TH2F * getBackgroundYields ( int  slot) const

Returns a 2D histogram of background pixel yields.

These are inefficiency corrected number of background hits per track in a pixel.

Parameters
slotslot ID
Returns
pixel image of photon yields (nullptr if N/A)

Definition at line 70 of file TOPCalPhotonYields.cc.

71 {
72 unsigned index = slot - 1;
73 if (index < m_backgroundYields.size()) return &m_backgroundYields[index];
74 return 0;
75 }
std::vector< TH2F > m_backgroundYields
background yields per pixel (index = slot - 1)

◆ getBackPlateContour()

std::vector< std::pair< double, double > > getBackPlateContour ( ) const

Returns prism enclosure back plate x-y contour.

Returns
polygon

Definition at line 174 of file TOPGeoQBB.cc.

175 {
176 typedef std::pair<double, double> Pair;
177 std::vector<Pair> contour;
178
179 double x1 = getWidth() / 2;
180 double x2 = x1 - m_prismEnclosure.getHeight() * tan(m_prismEnclosure.getAngle());
182 double y2 = y1 - m_sideRails.getHeight();
183 double y3 = y2 - m_prismEnclosure.getHeight();
184 contour.push_back(Pair(-x1, y1));
185 contour.push_back(Pair(x1, y1));
186 contour.push_back(Pair(x1, y2));
187 contour.push_back(Pair(x2, y3));
188 contour.push_back(Pair(-x2, y3));
189 contour.push_back(Pair(-x1, y2));
190
191 return contour;
192 }
double getY() const
Returns y position of the flat surface in local (bar) frame.
double getHeight() const
Returns height up to the side rails.
double getAngle() const
Returns angle of side wall.
double getWidth() const
Returns full width.
Definition: TOPGeoQBB.h:102
TOPGeoPrismEnclosure m_prismEnclosure
prism enclosure
Definition: TOPGeoQBB.h:274
TOPGeoHoneycombPanel m_outerPanel
outer honeycomb panel
Definition: TOPGeoQBB.h:272
TOPGeoSideRails m_sideRails
side rails
Definition: TOPGeoQBB.h:273
double getHeight() const
Returns height.

◆ getBackwardContour()

std::vector< std::pair< double, double > > getBackwardContour ( ) const

Returns backward x-y contour.

Returns
polygon

Definition at line 106 of file TOPGeoQBB.cc.

107 {
108 typedef std::pair<double, double> Pair;
109 std::vector<Pair> contour;
110
111 double x1 = getWidth() / 2;
112 double x2 = x1 - m_prismEnclosure.getHeight() * tan(m_prismEnclosure.getAngle());
113 double x3 = getWidth() / 6;
116 double y3 = y2 - m_sideRails.getHeight();
117 double y4 = y3 - m_prismEnclosure.getHeight();
118 contour.push_back(Pair(-x1, y2));
119 contour.push_back(Pair(-x3, y1));
120 contour.push_back(Pair(x3, y1));
121 contour.push_back(Pair(x1, y2));
122 contour.push_back(Pair(x1, y3));
123 contour.push_back(Pair(x2, y4));
124 contour.push_back(Pair(-x2, y4));
125 contour.push_back(Pair(-x1, y3));
126
127 return contour;
128 }

◆ getBackwardZ()

double getBackwardZ ( ) const

Returns backward z of the volume devoted to TOP counter.

Returns
minimal z

Definition at line 102 of file TOPGeometry.cc.

103 {
104 if (m_modules.empty()) return 0;
105
106 double z = m_modules[0].getBackwardZ();
107 for (auto& module : m_modules) {
108 double tmp = module.getBackwardZ() - module.getPrism().getFullLength();
109 if (tmp < z) z = tmp;
110 }
111 return z;
112 }

◆ getBeta()

double getBeta ( int  moduleID) const

Gets the angle beta on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
beta rotation angle around y

Definition at line 129 of file TOPCalModuleAlignment.cc.

130 {
131 unsigned module = moduleID - 1;
132 if (module >= c_numModules) {
133 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
134 return 0;
135 }
136 return m_beta[module];
137 }
float m_beta[c_numModules]
rotation angle around the y axis

◆ getBetaErr()

double getBetaErr ( int  moduleID) const

Returns the error on beta on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errBeta error on the beta angle

Definition at line 189 of file TOPCalModuleAlignment.cc.

190 {
191 unsigned module = moduleID - 1;
192 if (module >= c_numModules) {
193 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
194 return 0;
195 }
196 return m_errBeta[module];
197 }

◆ getBrokenGlueContour()

std::vector< std::pair< double, double > > getBrokenGlueContour ( ) const

Returns the x-y contour of broken glue.

Definition at line 59 of file TOPGeoBarSegment.cc.

60 {
61
62 std::vector<Pair> contour;
64 contour);
65
66 return contour;
67 }
double getThickness() const
Returns bar segment thickness.
float m_brokenFraction
fraction of broken (delaminated) glue
float m_brokenAngle
angle of broken (delaminated) glue
void constructContour(double A, double B, double fraction, double angle, std::vector< std::pair< double, double > > &contour) const
Construct a 2D contour.

◆ getBulkTransmittance()

float getBulkTransmittance ( double  lambda) const

Returns bulk transmittance at given wavelength using linear interpolation.

Parameters
lambdaphoton wavelength in [nm]
Returns
bulk transmittance

Definition at line 21 of file TOPWavelengthFilter.cc.

22 {
23 if (m_transmittances.empty()) return 1; // old payload from DB (filter included in QE)
24
25 double dlam = lambda - m_lambdaFirst;
26 if (dlam < 0) return 0;
27 if (dlam > (m_transmittances.size() - 1) * m_lambdaStep) return m_transmittances.back();
28 unsigned i = int(dlam / m_lambdaStep);
29 if (i > m_transmittances.size() - 2) return m_transmittances.back();
30 return m_transmittances[i] + (m_transmittances[i + 1] - m_transmittances[i]) / m_lambdaStep * (dlam - i * m_lambdaStep);
31 }
float m_lambdaStep
wavelength step [nm]
std::vector< float > m_transmittances
bulk transmittance data points
float m_lambdaFirst
wavelength of the first data point [nm]

◆ getCE()

double getCE ( bool  BfieldOn) const

Returns collection efficiency.

Parameters
BfieldOntrue for magnetic field being ON
Returns
collection efficiency

Definition at line 59 of file TOPPmtQE.cc.

60 {
61 if (BfieldOn) {
62 return m_CE_withB;
63 } else {
64 return m_CE_noB;
65 }
66 }
float m_CE_withB
relative collection efficiency, with B field
Definition: TOPPmtQE.h:160
float m_CE_noB
relative collection efficiency, without B field
Definition: TOPPmtQE.h:159

◆ getColumn()

unsigned getColumn ( unsigned  pmtID) const

Converts PMT ID to column number (1-based)

Parameters
pmtIDPMT ID (1-based)
Returns
column number or 0 for invalid PMT ID

Definition at line 34 of file TOPGeoPMTArray.cc.

35 {
36 if (pmtID == 0 or pmtID > getSize()) return 0;
37 return (pmtID - 1) % m_numColumns + 1;
38 }
unsigned m_numColumns
number of columns

◆ getEfficiency()

double getEfficiency ( unsigned  pmtPixel,
double  lambda,
bool  BfieldOn 
) const

Returns quantum times collection efficiency for a given pixel and wavelength, using linear interpolation.

Parameters
pmtPixelpmtPixel number (1-based)
lambdawavelength in [nm]
BfieldOntrue for magnetic field being ON
Returns
quantum efficiency

Definition at line 50 of file TOPPmtQE.cc.

51 {
52 if (BfieldOn) {
53 return getQE(pmtPixel, lambda) * m_CE_withB;
54 } else {
55 return getQE(pmtPixel, lambda) * m_CE_noB;
56 }
57 }
const std::vector< float > & getQE(unsigned pmtPixel) const
Returns quantum efficiency data points for a given pixel.
Definition: TOPPmtQE.cc:21

◆ getEnvelopeQE() [1/2]

const std::vector< float > & getEnvelopeQE ( ) const

Returns envelope quantum efficiency data points (maximum over pixels)

Returns
envelope quantum efficiency data points

Definition at line 38 of file TOPPmtQE.cc.

39 {
41 return m_envelopeQE;
42 }
std::vector< float > m_envelopeQE
cache for envelope QE
Definition: TOPPmtQE.h:163
void setEnvelopeQE() const
Sets envelope quantum efficiency.
Definition: TOPPmtQE.cc:87

◆ getEnvelopeQE() [2/2]

double getEnvelopeQE ( double  lambda) const

Returns envelope quantum efficiency for a given wavelength (maximum over pixels), using linear interpolation.

Parameters
lambdawavelength in [nm]
Returns
quantum efficiency

Definition at line 44 of file TOPPmtQE.cc.

45 {
47 return interpolate(lambda, m_envelopeQE);
48 }
double interpolate(double lambda, const std::vector< float > &QE) const
Interpolate between QE datapoints (linear interpolation).
Definition: TOPPmtQE.cc:105

◆ getForwardContour()

std::vector< std::pair< double, double > > getForwardContour ( ) const

Returns forward x-y contour.

Returns
polygon

Definition at line 21 of file TOPGeoQBB.cc.

22 {
23 typedef std::pair<double, double> Pair;
24 std::vector<Pair> contour;
25
26 double x1 = getWidth() / 2;
27 double x2 = x1 - m_sideRails.getThickness();
28 double x3 = getWidth() / 6;
31 double y3 = y2 - m_sideRails.getHeight();
33 contour.push_back(Pair(-x1, y2));
34 contour.push_back(Pair(-x3, y1));
35 contour.push_back(Pair(x3, y1));
36 contour.push_back(Pair(x1, y2));
37 contour.push_back(Pair(x1, y3));
38 contour.push_back(Pair(x2, y4));
39 contour.push_back(Pair(-x2, y4));
40 contour.push_back(Pair(-x1, y3));
41
42 return contour;
43 }
TOPGeoHoneycombPanel m_innerPanel
inner honeycomb panel
Definition: TOPGeoQBB.h:271
double getThickness() const
Returns thickness.

◆ getForwardZ()

double getForwardZ ( ) const

Returns forward z of the volume devoted to TOP counter.

Returns
maximal z

Definition at line 114 of file TOPGeometry.cc.

115 {
116 if (m_modules.empty()) return 0;
117
118 double z = m_modules[0].getForwardZ();
119 for (auto& module : m_modules) {
120 double tmp = module.getForwardZ();
121 if (tmp > z) z = tmp;
122 }
123 return z;
124 }

◆ getFrontPlateContour()

std::vector< std::pair< double, double > > getFrontPlateContour ( ) const

Returns prism enclosure front plate x-y contour.

Returns
polygon

Definition at line 203 of file TOPGeoQBB.cc.

204 {
205 typedef std::pair<double, double> Pair;
206 std::vector<Pair> contour;
207
208 double x1 = getWidth() / 2;
209 double x2 = x1 - m_prismEnclosure.getHeight() * tan(m_prismEnclosure.getAngle());
211 double y2 = y1 - m_sideRails.getHeight();
212 double y3 = y2 - m_prismEnclosure.getHeight();
213 contour.push_back(Pair(x1, y2));
214 contour.push_back(Pair(x2, y3));
215 contour.push_back(Pair(-x2, y3));
216 contour.push_back(Pair(-x1, y2));
217
218 return contour;
219 }

◆ getFullTime()

double getFullTime ( int  window,
double  sample 
) const

Returns time with respect to sample 0 of window 0.

Note: sample is float - digits that follow the decimal point are used to interpolate the time btw. two samples

Parameters
windowASIC window number
samplesample counted from the first one in the specified ASIC window
Returns
time in [ns]

Definition at line 58 of file TOPSampleTimes.cc.

59 {
60
61 int sampleNum = int(sample);
62 if (sample < 0) sampleNum--;
63 double frac = sample - sampleNum;
64
65 sampleNum += window * c_WindowSize; // counted from window 0
66 int n = sampleNum / c_TimeAxisSize;
67 int k = sampleNum % c_TimeAxisSize;
68 if (k < 0) {
69 n--;
70 k += c_TimeAxisSize;
71 }
72
73 double time = n * getTimeRange() + m_timeAxis[k]; // from sample 0 window 0
74 time += (m_timeAxis[k + 1] - m_timeAxis[k]) * frac; // add fraction
75
76 return time;
77 }
float m_timeAxis[c_TimeAxisSize+1]
time axis + right border point
double getTimeRange() const
Returns time axis range (time interval corresponding to 4 asic windows)

◆ getGamma()

double getGamma ( int  moduleID) const

Gets the angle gamma on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
gamma rotation angle around z

Definition at line 139 of file TOPCalModuleAlignment.cc.

140 {
141 unsigned module = moduleID - 1;
142 if (module >= c_numModules) {
143 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
144 return 0;
145 }
146 return m_gamma[module];
147 }
float m_gamma[c_numModules]
rotation angle around the z axis

◆ getGammaErr()

double getGammaErr ( int  moduleID) const

Returns the error on gamma on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errGamma error on the gamma angle

Definition at line 199 of file TOPCalModuleAlignment.cc.

200 {
201 unsigned module = moduleID - 1;
202 if (module >= c_numModules) {
203 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
204 return 0;
205 }
206 return m_errGamma[module];
207 }

◆ getInnerPanelContour()

std::vector< std::pair< double, double > > getInnerPanelContour ( ) const

Returns inner honeycomb panel x-y contour.

Returns
polygon

Definition at line 54 of file TOPGeoQBB.cc.

55 {
56 typedef std::pair<double, double> Pair;
57 std::vector<Pair> contour;
58
59 double x1 = getPanelWidth() / 2;
60 double y1 = m_innerPanel.getY();
61 double y2 = y1 - m_innerPanel.getMaxThickness();
62 contour.push_back(Pair(-x1, y1));
63 contour.push_back(Pair(x1, y1));
64 contour.push_back(Pair(x1, y2));
65 m_innerPanel.appendContour(contour, y2, false);
66 contour.push_back(Pair(-x1, y2));
67
68 return contour;
69 }
double getPanelWidth() const
Returns panel width used in x-y contours of honeycomb panels.
Definition: TOPGeoQBB.h:108
void appendContour(std::vector< std::pair< double, double > > &contour, double y0, bool fromLeftToRight) const
Appends curved surface to contour.

◆ getInnerRadius()

double getInnerRadius ( ) const

Returns inner radius of the volume devoted to TOP counter.

Returns
inner radius

Definition at line 64 of file TOPGeometry.cc.

65 {
66 if (m_modules.empty()) return 0;
67
68 double R = m_modules[0].getRadius();
69 for (auto& module : m_modules) {
70 double tmp = module.getRadius() + module.getBarThickness() / 2
71 - module.getPrism().getExitThickness();
72 if (tmp < R) R = tmp;
73 }
74 return R;
75 }

◆ getLambdaLast() [1/2]

double getLambdaLast ( ) const

Returns wavelenght of the last data point (maximal of pixels)

Returns
wavelength in [nm]

Definition at line 68 of file TOPPmtQE.cc.

69 {
70 size_t size = 0;
71 for (unsigned pixel = 0; pixel < c_NumPmtPixels; pixel++) {
72 const auto& QE = m_QE[pixel];
73 size = std::max(size, QE.size());
74 }
75 return m_lambdaFirst + (size - 1) * m_lambdaStep;
76 }
float m_lambdaStep
wavelength step [nm]
Definition: TOPPmtQE.h:158
float m_lambdaFirst
wavelength of the first data point [nm]
Definition: TOPPmtQE.h:157
std::vector< float > m_QE[c_NumPmtPixels]
QE data points.
Definition: TOPPmtQE.h:156

◆ getLambdaLast() [2/2]

double getLambdaLast ( unsigned  pmtPixel) const

Returns wavelenght of the last data point for a given pixel.

Parameters
pmtPixelpmtPixel number (1-based)
Returns
wavelength in [nm]

Definition at line 78 of file TOPPmtQE.cc.

79 {
80 pmtPixel--;
81 if (pmtPixel < c_NumPmtPixels) {
82 return m_lambdaFirst + (m_QE[pmtPixel].size() - 1) * m_lambdaStep;
83 }
84 return 0;
85 }

◆ getMaxLambda()

double getMaxLambda ( ) const

Returns wavelength of the last nonzero QE data point.

Returns
wavelength of the last nonzero QE data point

Definition at line 49 of file TOPNominalQE.cc.

50 {
51 for (size_t i = m_QE.size() - 1; i < m_QE.size(); i--) {
52 if (m_QE[i] > 0) return m_lambdaFirst + m_lambdaStep * i;
53 }
54 return m_lambdaFirst;
55 }

◆ getMinLambda()

double getMinLambda ( ) const

Returns wavelength of the first nonzero QE data point.

Returns
wavelength of the first nonzero QE data point

Definition at line 40 of file TOPNominalQE.cc.

41 {
42 for (size_t i = 0; i < m_QE.size(); i++) {
43 if (m_QE[i] > 0) return m_lambdaFirst + m_lambdaStep * i;
44 }
45 return getLambdaLast();
46 }
double getLambdaLast() const
Returns wavelenght of the last data point.
Definition: TOPNominalQE.h:121

◆ getModule()

const TOPGeoModule & getModule ( int  moduleID) const

Returns module.

Parameters
moduleIDvalid module ID (1-based)
Returns
module geometry parameters

Definition at line 42 of file TOPGeometry.cc.

43 {
44 for (const auto& module : m_modules) {
45 if (module.getModuleID() == moduleID) return module;
46 }
47 B2FATAL("TOPGeometry::getModule: invalid module, ID = " << moduleID);
48 }

◆ getMuonZ()

const TH1F * getMuonZ ( int  slot) const

Returns z distribution of tracks used to determine pixel yields.

Parameters
slotslot ID
Returns
z distribution in local frame (nullptr if N/A)

Definition at line 102 of file TOPCalPhotonYields.cc.

103 {
104 unsigned index = slot - 1;
105 if (index < m_muonZ.size()) return &m_muonZ[index];
106 return 0;
107 }
std::vector< TH1F > m_muonZ
local z distribution of tracks (index = slot - 1)

◆ getNumOf() [1/2]

int getNumOf ( EStatus  check) const
private

Counts and returns the number of channels having a given status.

Parameters
checkstatus to be checked
Returns
number of channels of this status

Definition at line 99 of file TOPCalChannelMask.cc.

100 {
101 int n = 0;
102 for (const auto& statuses : m_status) {
103 for (const auto status : statuses) {
104 if (status == check) n++;
105 }
106 }
107 return n;
108 }
EStatus m_status[c_numModules][c_numChannels]
channel status
bool check(const int module, const unsigned channel) const
Check input module and channel arguments are sane.

◆ getNumOf() [2/2]

int getNumOf ( EStatus  check,
int  moduleID 
) const
private

Counts and returns the number of channels od a module having a given status.

Parameters
checkstatus to be checked
moduleIDmodule (slot) ID (1-based)
Returns
number of channels of this status

Definition at line 110 of file TOPCalChannelMask.cc.

111 {
112 unsigned module = moduleID - 1;
113 if (module < c_numModules) {
114 int n = 0;
115 const auto& statuses = m_status[module];
116 for (const auto status : statuses) {
117 if (status == check) n++;
118 }
119 return n;
120 }
121 B2ERROR("Invalid module number (" << ClassName() << ")");
122 return 0;
123 }

◆ getOptimizedOffset()

unsigned getOptimizedOffset ( const std::vector< unsigned > &  values,
const std::vector< unsigned > &  errors,
unsigned  maxDif,
unsigned  maxErr 
)
private

Return the offset that can allow for the maximal number of good pedestal samples.

Parameters
valuespedestal values
errorspedestal errors
maxDifmaximal number that can be stored in c_Bits
maxErrmaximal number that can be stored in 16 - c_Bits
Returns
offset value

Definition at line 65 of file TOPASICPedestals.cc.

69 {
70
71 std::set<unsigned> sortedValues;
72 for (unsigned i = 0; i < values.size(); i++) {
73 if (errors[i] > maxErr) continue;
74 sortedValues.insert(values[i]);
75 }
76
77 unsigned nprev = sortedValues.size();
78 unsigned nl = 0;
79 for (auto it = sortedValues.begin(); it != sortedValues.end(); ++it) {
80 unsigned nr = 0;
81 for (auto back = sortedValues.crbegin(); *back - *it > maxDif; ++back) {
82 nr++;
83 }
84 unsigned nbad = nl + nr;
85 if (nbad == 0) return *it;
86 if (nbad >= nprev) return *(--it);
87 nprev = nbad;
88 nl++;
89 }
90
91 return *sortedValues.begin();
92
93 }

◆ getOuterPanelContour()

std::vector< std::pair< double, double > > getOuterPanelContour ( ) const

Returns outer honeycomb panel x-y contour.

Returns
polygon

Definition at line 80 of file TOPGeoQBB.cc.

81 {
82 typedef std::pair<double, double> Pair;
83 std::vector<Pair> contour;
84
85 double x1 = getPanelWidth() / 2;
86 double y1 = m_outerPanel.getY();
87 double y2 = y1 + m_outerPanel.getMinThickness();
88 contour.push_back(Pair(-x1, y2));
89 m_outerPanel.appendContour(contour, y2, true);
90 contour.push_back(Pair(x1, y2));
91 contour.push_back(Pair(x1, y1));
92 contour.push_back(Pair(-x1, y1));
93
94 return contour;
95 }

◆ getOuterRadius()

double getOuterRadius ( ) const

Returns outer radius of the volume devoted to TOP counter.

Returns
outer radius

Definition at line 77 of file TOPGeometry.cc.

78 {
79 if (m_modules.empty()) return 0;
80
81 double R = m_modules[0].getRadius();
82 for (auto& module : m_modules) {
83 double x = module.getBarWidth() / 2;
84 double y = module.getRadius() + module.getBarThickness() / 2;
85 double tmp = sqrt(x * x + y * y);
86 if (tmp > R) R = tmp;
87 }
88 return R;
89 }

◆ getPDETuningFactor()

double getPDETuningFactor ( unsigned  type) const

Returns photon detection efficiency tuning factor of a given PMT type.

Parameters
typePMT type
Returns
tuning factor

Definition at line 57 of file TOPGeometry.cc.

58 {
59 std::map<unsigned, float>::const_iterator it = m_tuneFactorsPDE.find(type);
60 if (it == m_tuneFactorsPDE.end()) return 1.0;
61 return it->second;
62 }
std::map< unsigned, float > m_tuneFactorsPDE
PDE tuning factors of PMT types.
Definition: TOPGeometry.h:294

◆ getPeakingTime()

double getPeakingTime ( ) const

Returns peaking time of the signal.

Returns
peaking time [ns]

Definition at line 93 of file TOPSignalShape.cc.

94 {
95 if (m_peakTime == 0) {
96 double t1 = 0;
97 double t2 = 1;
98 while (getValue(t2) > 0.5) t2 += 1;
99 for (int i = 0; i < 20; i++) {
100 double t = (t1 + t2) / 2;
101 if (m_interpolator->Derivative(t) > 0) {
102 t1 = t;
103 } else {
104 t2 = t;
105 }
106 }
107 m_peakTime = (t1 + t2) / 2;
108 }
109
110 return m_peakTime;
111 }
double m_peakTime
do not write out
TSpline5 * m_interpolator
cache for the interpolator
double getValue(double t) const
Returns value at time t of the normalized waveform using interpolator.

◆ getPeelOffContour()

std::vector< Pair > getPeelOffContour ( const PeelOffRegion region) const

Returns the x-y contour of the peel-off region.

Parameters
regionpeel-off region
Returns
clock-wise polygon

Definition at line 118 of file TOPGeoPrism.cc.

119 {
120 std::vector<Pair> contour;
122 region.fraction, region.angle,
123 contour);
124
125 return contour;
126 }
double getExitThickness() const
Returns prism thickness at PMT side.
Definition: TOPGeoPrism.h:126

◆ getPhotonYields()

const TH2F * getPhotonYields ( int  slot) const

Returns a 2D histogram of photon pixel yields.

These are background subtracted and inefficiency corrected number of photons per track in a pixel.

Parameters
slotslot ID
Returns
pixel image of photon yields (nullptr if N/A)

Definition at line 62 of file TOPCalPhotonYields.cc.

63 {
64 unsigned index = slot - 1;
65 if (index < m_photonYields.size()) return &m_photonYields[index];
66 return 0;
67 }
std::vector< TH2F > m_photonYields
photon yields per pixel (index = slot - 1)

◆ getPixelColumn()

unsigned getPixelColumn ( double  x) const

Converts x-coordinate to pixel column (1-based)

Parameters
xcoordinate
Returns
pixel column or 0 if x outside sensitive area

Definition at line 21 of file TOPGeoPMT.cc.

22 {
23 x *= s_unit;
24 if (fabs(x) >= m_sensSizeX / 2) return 0;
25 return m_numColumns - int((x + m_sensSizeX / 2) / m_sensSizeX * m_numColumns);
26 }
unsigned m_numColumns
number of pixel columns
Definition: TOPGeoPMT.h:317
float m_sensSizeX
sensitive volume (photo-cathode) size in x
Definition: TOPGeoPMT.h:314
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86

◆ getPixelID() [1/3]

unsigned getPixelID ( double  x,
double  y 
) const

Converts x and y coordinates to PMT pixel ID (1-based)

Parameters
xcoordinate
ycoordinate
Returns
pixel ID or 0 if x or y outside sensitive area

Definition at line 36 of file TOPGeoPMT.cc.

37 {
38 auto col = getPixelColumn(x);
39 if (col == 0) return 0;
40 auto row = getPixelRow(y);
41 if (row == 0) return 0;
42
43 return (row - 1) * m_numColumns + col;
44 }
unsigned getPixelColumn(double x) const
Converts x-coordinate to pixel column (1-based)
Definition: TOPGeoPMT.cc:21
unsigned getPixelRow(double y) const
Converts y-coordinate to pixel row (1-based)
Definition: TOPGeoPMT.cc:29

◆ getPixelID() [2/3]

int getPixelID ( double  x,
double  y,
unsigned  pmtID 
) const

Converts (digitizes) x, y and PMT ID to pixel ID (1-based)

Parameters
xcoordinate in PMT local frame
ycoordinate in PMT local frame
pmtIDPMT ID (1-based)
Returns
pixel ID or 0 if (x,y) outside sensitive area or pmtID invalid

Definition at line 40 of file TOPGeoPMTArray.cc.

41 {
42 if (pmtID == 0 or pmtID > getSize()) return 0;
43 pmtID--;
44
45 unsigned col = m_pmt.getPixelColumn(x);
46 if (col == 0) return 0;
47 col--;
48
49 unsigned row = m_pmt.getPixelRow(y);
50 if (row == 0) return 0;
51 row--;
52
53 col += (pmtID % m_numColumns) * m_pmt.getNumColumns();
54 row += (pmtID / m_numColumns) * m_pmt.getNumRows();
55 return row * m_numColumns * m_pmt.getNumColumns() + col + 1;
56 }
TOPGeoPMT m_pmt
PMT geometry parameters.
unsigned getNumColumns() const
Returns number of pixel columns.
Definition: TOPGeoPMT.h:183
unsigned getNumRows() const
Returns number of pixel rows.
Definition: TOPGeoPMT.h:189

◆ getPixelID() [3/3]

int getPixelID ( unsigned  pmtID,
unsigned  pmtPixelID 
) const

Returns pixel ID (1-based)

Parameters
pmtIDPMT ID (1-based)
pmtPixelIDPMT pixel ID (1-based)
Returns
pixel ID or 0 for invalid input ID's

Definition at line 58 of file TOPGeoPMTArray.cc.

59 {
60 pmtID--;
61 if (pmtID >= getSize()) return 0;
62
63 pmtPixelID--;
64 if (pmtPixelID >= m_pmt.getNumPixels()) return 0;
65
66 unsigned col = pmtPixelID % m_pmt.getNumColumns();
67 unsigned row = pmtPixelID / m_pmt.getNumColumns();
68
69 col += (pmtID % m_numColumns) * m_pmt.getNumColumns();
70 row += (pmtID / m_numColumns) * m_pmt.getNumRows();
71 return row * m_numColumns * m_pmt.getNumColumns() + col + 1;
72 }
unsigned getNumPixels() const
Returns number of pixels.
Definition: TOPGeoPMT.h:195

◆ getPixelRow()

unsigned getPixelRow ( double  y) const

Converts y-coordinate to pixel row (1-based)

Parameters
ycoordinate
Returns
pixel row or 0 if y outside sensitive area

Definition at line 29 of file TOPGeoPMT.cc.

30 {
31 y *= s_unit;
32 if (fabs(y) >= m_sensSizeY / 2) return 0;
33 return int((y + m_sensSizeY / 2) / m_sensSizeY * m_numRows) + 1;
34 }
unsigned m_numRows
number of pixel rows
Definition: TOPGeoPMT.h:318
float m_sensSizeY
sensitive volume (photo-cathode) size in y
Definition: TOPGeoPMT.h:315

◆ getPmtID()

unsigned getPmtID ( unsigned  row,
unsigned  col 
) const

Converts row and column numbers to PMT ID (1-based)

Parameters
rowrow number (1-based)
colcolumn number (1-based)
Returns
PMT ID or 0 for invalid row or column

Definition at line 21 of file TOPGeoPMTArray.cc.

22 {
23 if (row == 0 or row > m_numRows) return 0;
24 if (col == 0 or col > m_numColumns) return 0;
25 return (row - 1) * m_numColumns + col;
26 }
unsigned m_numRows
number of rows

◆ getPrismEnclosureContour()

std::vector< std::pair< double, double > > getPrismEnclosureContour ( ) const

Returns prism enclosure wall x-y contour.

Returns
polygon

Definition at line 139 of file TOPGeoQBB.cc.

140 {
141 typedef std::pair<double, double> Pair;
142 std::vector<Pair> contour;
143
144 double tanAngle = tan(m_prismEnclosure.getAngle());
145 double x1 = getWidth() / 2;
146 double x2 = x1 - m_prismEnclosure.getHeight() * tanAngle;
147 double x3 = x1 - m_prismEnclosure.getSideThickness();
150 double y2 = y1 - m_prismEnclosure.getHeight();
151 double y3 = y2 + m_prismEnclosure.getBottomThickness();
152 double x4 = x1 - m_prismEnclosure.getSideThickness() - (y1 - y3) * tanAngle;
153 contour.push_back(Pair(x1, y1));
154 contour.push_back(Pair(x2, y2));
155 contour.push_back(Pair(-x2, y2));
156 contour.push_back(Pair(-x1, y1));
157 contour.push_back(Pair(-x3, y1));
158 contour.push_back(Pair(-x4, y3));
159 contour.push_back(Pair(x4, y3));
160 contour.push_back(Pair(x3, y1));
161
162 return contour;
163 }
double getBottomThickness() const
Returns bottom thickness.
double getSideThickness() const
Returns side wall thickness.

◆ getPulseHeights()

const TH2F * getPulseHeights ( int  slot) const

Returns a 2D histogram of pixel pulse-heights.

Parameters
slotslot ID
Returns
pixel pulse-heights (nullptr if N/A)

Definition at line 94 of file TOPCalPhotonYields.cc.

95 {
96 unsigned index = slot - 1;
97 if (index < m_pulseHeights.size()) return &m_pulseHeights[index];
98 return 0;
99 }
std::vector< TH2F > m_pulseHeights
pixel pulse-heights (index = slot - 1)

◆ getQE() [1/3]

double getQE ( double  lambda) const

Returns quantum efficiency at given photon wavelength using linear interpolation.

Parameters
lambdaphoton wavelength in [nm]
Returns
quantum efficiency

Definition at line 30 of file TOPNominalQE.cc.

31 {
32 double dlam = lambda - m_lambdaFirst;
33 if (dlam < 0 or dlam > (m_QE.size() - 1) * m_lambdaStep) return 0;
34 unsigned i = int(dlam / m_lambdaStep);
35 if (i > m_QE.size() - 2) return m_QE.back();
36 return m_QE[i] + (m_QE[i + 1] - m_QE[i]) / m_lambdaStep * (dlam - i * m_lambdaStep);
37 }

◆ getQE() [2/3]

const std::vector< float > & getQE ( unsigned  pmtPixel) const

Returns quantum efficiency data points for a given pixel.

Parameters
pmtPixelpmtPixel number (1-based)
Returns
quantum efficiency data points (empty vector for invalid pixel)

Definition at line 21 of file TOPPmtQE.cc.

22 {
23 pmtPixel--;
24 if (pmtPixel < c_NumPmtPixels) return m_QE[pmtPixel];
25
26 B2ERROR("TOPPmtQE::getQE: invalid pixel ID, returning empty vector");
27 m_envelopeQE.clear();
28 return m_envelopeQE;
29 }

◆ getQE() [3/3]

double getQE ( unsigned  pmtPixel,
double  lambda 
) const

Returns quantum efficiency for a given pixel and wavelength, using linear interpolation.

Parameters
pmtPixelpmtPixel number (1-based)
lambdawavelength in [nm]
Returns
quantum efficiency

Definition at line 31 of file TOPPmtQE.cc.

32 {
33 pmtPixel--;
34 if (pmtPixel < c_NumPmtPixels) return interpolate(lambda, m_QE[pmtPixel]);
35 return 0;
36 }

◆ getRadius()

double getRadius ( ) const

Returns average radius of modules.

Returns
radius

Definition at line 91 of file TOPGeometry.cc.

92 {
93 if (m_modules.empty()) return 0;
94
95 double R = 0;
96 for (auto& module : m_modules) {
97 R += module.getRadius();
98 }
99 return R / m_modules.size();
100 }

◆ getReflectivity()

double getReflectivity ( const GeoOpticalSurface surface,
double  energy 
) const

Returns reflectivity of optical surface at given photon energy.

Parameters
surfaceoptical surface parameters
energyphoton energy in [eV]

Definition at line 72 of file TOPGeoBase.cc.

73 {
74 energy *= Unit::eV;
75 if (surface.hasProperties()) {
76 for (const auto& property : surface.getProperties()) {
77 if (property.getName() == "REFLECTIVITY") {
78 auto energies = property.getEnergies();
79 auto values = property.getValues();
80 if (energies.size() < 2) return 0;
81 if (energy < energies[0] or energy > energies.back()) {
82 B2WARNING("TOPGeoBase::getReflectivity: photon energy out of range - return value not reliable");
83 }
84 auto spline = TSpline3("tmp", energies.data(), values.data(), energies.size());
85 return spline.Eval(energy);
86 }
87 }
88 }
89
90 B2ERROR("Optical surface " << surface.getName() << " has no property REFLECTIVITY");
91 return 0;
92 }
static const double eV
[electronvolt]
Definition: Unit.h:112

◆ getRow()

unsigned getRow ( unsigned  pmtID) const

Converts PMT ID to row number (1-based)

Parameters
pmtIDPMT ID (1-based)
Returns
row number or 0 for invalid PMT ID

Definition at line 28 of file TOPGeoPMTArray.cc.

29 {
30 if (pmtID == 0 or pmtID > getSize()) return 0;
31 return (pmtID - 1) / m_numColumns + 1;
32 }

◆ getSample() [1/2]

int getSample ( double  time) const

Converts time to sample number.

Use isSampleValid(int) to check the validity of sample number

Parameters
time[ns]
Returns
sample number

Definition at line 67 of file TOPNominalTDC.cc.

68 {
69 time += m_offset;
70 if (time > 0) {
71 return int(time / m_sampleWidth);
72 } else {
73 return int(time / m_sampleWidth) - 1;
74 }
75 }
float m_offset
time offset
float m_sampleWidth
time between two samples

◆ getSample() [2/2]

double getSample ( int  window,
double  time 
) const

Returns sample with respect to sample 0 of the specified ASIC window (inverse of getTime).

Note: sample is float - digits that follow the decimal point are used to interpolate the time btw. two samples

Parameters
windowASIC window number
timetime with respect to SSTin of specified ASIC window
Returns
sample

Definition at line 80 of file TOPSampleTimes.cc.

81 {
82 time += window * getTimeRange() / 4.0;
83 int n = int(time / getTimeRange());
84 if (time < 0) n--;
85
86 double t = time - getTimeRange() * n;
87 int i1 = 0;
88 int i2 = c_TimeAxisSize;
89 while (i2 - i1 > 1) {
90 int i = (i1 + i2) / 2;
91 if (t > m_timeAxis[i]) {
92 i1 = i;
93 } else {
94 i2 = i;
95 }
96 }
97
98 return (n * c_TimeAxisSize - window * c_WindowSize + i1 +
99 (t - m_timeAxis[i1]) / (m_timeAxis[i2] - m_timeAxis[i1]));
100
101 }

◆ getSampleTimes()

const TOPSampleTimes * getSampleTimes ( unsigned  scrodID,
unsigned  channel 
) const

Returns calibration constants for given SCROD and channel.

If calibration is not available, return equidistant sample times.

Parameters
scrodIDSCROD ID
channelchannel number (within SCROD or within module)
Returns
calibration constants (always valid pointer)

Definition at line 61 of file TOPCalTimebase.cc.

63 {
64 if (m_map.empty()) createMap();
65
66 unsigned key = (scrodID << 16) + (channel % 128);
67 Iterator it = m_map.find(key);
68 if (it == m_map.end()) {
69 if (!m_sampleTime) m_sampleTime = new TOPSampleTimes(0, 0, m_syncTimeBase);
70 return m_sampleTime;
71 }
72 return &m_sampleTimes[it->second];
73 }
TOPSampleTimes * m_sampleTime
cache for default (equidistant) sample times
void createMap() const
Creates a map in cache.

◆ getSigma()

double getSigma ( int  pulseHeight) const

Returns an excess of electronic time resolution at given pulse height.

Parameters
pulseHeightpulse height [ADC counts]
Returns
excess sigma [ns]

Definition at line 48 of file TOPCalTimeWalk.cc.

49 {
50 return sqrt(getSigmaSq(pulseHeight));
51 }
double getSigmaSq(int pulseHeight) const
Returns an excess of electronic time resolution at given pulse height.

◆ getSigmaSq()

double getSigmaSq ( int  pulseHeight) const

Returns an excess of electronic time resolution at given pulse height.

Parameters
pulseHeightpulse height [ADC counts]
Returns
excess sigma squared [ns^2]

Definition at line 41 of file TOPCalTimeWalk.cc.

42 {
43 if (pulseHeight <= 0) return 0;
44 double x = pulseHeight;
45 return pow(m_noise / x, 2) + pow(m_quadratic * x * x, 2);
46 }
double m_quadratic
quadratic term coefficient [ns]
double m_noise
noise term excess coefficient [ns]

◆ getStatus()

TOPCalChannelMask::EStatus getStatus ( int  moduleID,
unsigned  channel 
) const

Returns the status of a single channel.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
status channel status (1: active 0: dead -1: noisy )

Definition at line 61 of file TOPCalChannelMask.cc.

63 {
64 int module = moduleID - 1;
65 if (!check(module, channel)) {
66 B2WARNING("Returning dead channel value");
67 return c_Dead;
68 }
69 return m_status[module][channel];
70 }

◆ getT0() [1/3]

double getT0 ( int  moduleID) const

Returns T0 of a module.

Parameters
moduleIDmodule ID (1-based)
Returns
T0

Definition at line 63 of file TOPCalModuleT0.cc.

64 {
65 unsigned module = moduleID - 1;
66 if (module >= c_numModules) {
67 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
68 return 0;
69 }
70 return m_T0[module];
71 }
float m_T0[c_numModules]
calibration constants
@ c_numModules
number of modules

◆ getT0() [2/3]

double getT0 ( int  moduleID,
unsigned  asic 
) const

Returns T0 of a single asic.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)
Returns
T0

Definition at line 51 of file TOPCalAsicShift.cc.

52 {
53 unsigned module = moduleID - 1;
54 if (module >= c_numModules) {
55 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
56 return 0;
57 }
58 if (asic >= c_numAsics) {
59 B2WARNING("Invalid asic number, returning 0 (" << ClassName() << ")");
60 return 0;
61 }
62 return m_T0[module][asic];
63 }
@ c_numModules
number of modules
@ c_numAsics
number of ASIC's per module
float m_T0[c_numModules][c_numAsics]
calibration constants

◆ getT0() [3/3]

double getT0 ( int  moduleID,
unsigned  channel 
) const

Returns T0 of a single channel.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
T0

Definition at line 73 of file TOPCalChannelT0.cc.

74 {
75 unsigned module = moduleID - 1;
76 if (module >= c_numModules) {
77 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
78 return 0;
79 }
80 if (channel >= c_numChannels) {
81 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
82 return 0;
83 }
84 return m_T0[module][channel];
85 }
float m_T0[c_numModules][c_numChannels]
calibration constants
@ c_numChannels
number of channels per module
@ c_numModules
number of modules

◆ getT0Error() [1/2]

double getT0Error ( int  moduleID) const

Returns error on T0 of a module.

Parameters
moduleIDmodule ID (1-based)
Returns
error on T0

Definition at line 74 of file TOPCalModuleT0.cc.

75 {
76 unsigned module = moduleID - 1;
77 if (module >= c_numModules) {
78 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
79 return 0;
80 }
81 return m_errT0[module];
82 }
float m_errT0[c_numModules]
errors on constants

◆ getT0Error() [2/2]

double getT0Error ( int  moduleID,
unsigned  channel 
) const

Returns error on T0 of a single channel.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
error on T0

Definition at line 88 of file TOPCalChannelT0.cc.

89 {
90 unsigned module = moduleID - 1;
91 if (module >= c_numModules) {
92 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
93 return 0;
94 }
95 if (channel >= c_numChannels) {
96 B2WARNING("Invalid channel number, returning 0 (" << ClassName() << ")");
97 return 0;
98 }
99 return m_errT0[module][channel];
100 }
float m_errT0[c_numModules][c_numChannels]
errors on constants

◆ getTDCcount()

int getTDCcount ( double  time) const

Converts time to TDC count.

For times being outside TDC range, TDC overflow value is returned.

Parameters
time[ns]
Returns
TDC count

Definition at line 58 of file TOPNominalTDC.cc.

59 {
60 time += m_offset;
61 int overflow = getOverflowValue();
62 if (time < 0) return overflow;
63 if (time > overflow * m_binWidth) return overflow;
64 return int(time / m_binWidth);
65 }
int getOverflowValue() const
Returns TDC overflow value.
float m_binWidth
time width of a TDC bin

◆ getTimeAxis()

std::vector< double > getTimeAxis ( ) const

Returns time axis (sample times)

Returns
vector of sample times

Definition at line 48 of file TOPSampleTimes.cc.

49 {
50 std::vector<double> timeAxis;
51 for (unsigned i = 0; i < c_TimeAxisSize + 1; i++) {
52 timeAxis.push_back(m_timeAxis[i]);
53 }
54 return timeAxis;
55 }

◆ getTimeBin()

double getTimeBin ( int  window,
int  sampleNumber 
) const

Returns time bin of a given sample number and window (e.g.

time interval to the next sample)

Parameters
windowASIC window number
sampleNumbersample number counted from begin of the specified ASIC window
Returns
time bin in [ns]

Definition at line 104 of file TOPSampleTimes.cc.

105 {
106 int i = (window * c_WindowSize + sampleNumber) % c_TimeAxisSize;
107 if (i < 0) i += c_TimeAxisSize;
108 return m_timeAxis[i + 1] - m_timeAxis[i];
109 }

◆ getTimeWalk()

double getTimeWalk ( int  pulseHeight) const

Returns time-walk at given pulse height.

Parameters
pulseHeightpulse height [ADC counts]
Returns
time-walk [ns]

Definition at line 27 of file TOPCalTimeWalk.cc.

28 {
29 /* time walk parameters are coefficients in a polynomial
30 * that is evaluated at x = pulseHeight here */
31
32 double f = 0;
33 double x = 1;
34 for (auto p : m_timeWalkParams) {
35 f += p * x;
36 x *= pulseHeight;
37 }
38 return f;
39 }
std::vector< double > m_timeWalkParams
parameters of calibration curve [ns]

◆ getTransformation() [1/2]

Transform3D getTransformation ( ) const

Returns transformation from local to nominal frame.

Translation is always given in basf2 units.

Returns
transformation (rotation and then a translation)

Definition at line 37 of file TOPGeoModuleDisplacement.cc.

38 {
39 RotationX Rx(m_alpha);
40 RotationY Ry(m_beta);
41 RotationZ Rz(m_gamma);
42 Translation3D t(m_x, m_y, m_z);
43 return Transform3D(Rz * Ry * Rx, t);
44 }
float m_beta
rotation angle around y
float m_alpha
rotation angle around x
float m_gamma
rotation angle around z

◆ getTransformation() [2/2]

const Transform3D & getTransformation ( int  moduleID) const

Returns transformation from local to nominal frame.

Transformation is: rotation first then translation.

Parameters
moduleIDmodule ID (1-based)
Returns
transformation

Definition at line 298 of file TOPCalModuleAlignment.cc.

299 {
300 if (m_transforms.empty()) setTransformations();
301 unsigned module = moduleID - 1;
302 if (module >= c_numModules) {
303 B2ERROR("Invalid module number, returning identity transformation (" << ClassName() << ")");
305 }
306 return m_transforms[module];
307 }
std::vector< ROOT::Math::Transform3D > m_transforms
cache for transformations (from local to nominal)
void setTransformations() const
Sets the transformation cache.

◆ getTTS()

const TOPNominalTTS & getTTS ( unsigned  type) const

Returns time transition spread of a given PMT type.

Parameters
typePMT type
Returns
TTS of a given PMT type if found, otherwise nominal TTS

Definition at line 50 of file TOPGeometry.cc.

51 {
52 std::map<unsigned, TOPNominalTTS>::const_iterator it = m_tts.find(type);
53 if (it == m_tts.end()) return m_nominalTTS;
54 return it->second;
55 }
TOPNominalTTS m_nominalTTS
nominal time transition spread of PMT
Definition: TOPGeometry.h:288
std::map< unsigned, TOPNominalTTS > m_tts
TTS of PMT types.
Definition: TOPGeometry.h:293

◆ getValue()

double getValue ( double  t) const

Returns value at time t of the normalized waveform using interpolator.

Parameters
ttime [ns] (t = 0 is at 50% CF leading edge crossing)
Returns
normalized value (normalization: peaking value = 1)

Definition at line 75 of file TOPSignalShape.cc.

76 {
77 if (m_shape.empty()) {
78 B2ERROR("TOPSignalShape::getValue: object not initialized");
79 return 0;
80 }
81 if (isnan(t)) return 0; // to prevent interpolator to crash with seg. fault
82 if (t < m_tmin) return 0;
83 if (t > m_tmax) return m_shape.back() * exp(-(t - m_tmax) / m_tau);
84 if (!m_interpolator) {
85 std::vector<double> shape(m_shape); // since argument in TSpline5 is not const!
86 m_interpolator = new TSpline5("signalShape", m_tmin, m_tmax,
87 shape.data(), shape.size());
88 }
89 return m_interpolator->Eval(t);
90 }
std::vector< double > m_shape
waveform values
double m_tau
time constant of the exponential tail [ns]
double m_tmin
time of the first waveform sample [ns]
double m_tmax
time of the last waveform sample [ns]

◆ getX() [1/2]

double getX ( int  moduleID) const

Returns the shift x on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
x shift along the x direction

Definition at line 149 of file TOPCalModuleAlignment.cc.

150 {
151 unsigned module = moduleID - 1;
152 if (module >= c_numModules) {
153 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
154 return 0;
155 }
156 return m_x[module];
157 }
float m_x[c_numModules]
displacement along the x axis

◆ getX() [2/2]

double getX ( unsigned  col) const

Returns x coordinate of pixel center.

Parameters
colvalid column number (1-based)
Returns
x coordinate of pixel center

Definition at line 47 of file TOPGeoPMT.cc.

48 {
49 return (int)(m_numColumns + 1 - 2 * col) / 2.0 * getDx();
50 }
double getDx() const
Returns pixel size in x.
Definition: TOPGeoPMT.h:285

◆ getXErr()

double getXErr ( int  moduleID) const

Returns the error on x on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errX error on the x shift

Definition at line 209 of file TOPCalModuleAlignment.cc.

210 {
211 unsigned module = moduleID - 1;
212 if (module >= c_numModules) {
213 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
214 return 0;
215 }
216 return m_errX[module];
217 }

◆ getY() [1/2]

double getY ( int  moduleID) const

Returns the shift y on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
y shift along the y direction

Definition at line 159 of file TOPCalModuleAlignment.cc.

160 {
161 unsigned module = moduleID - 1;
162 if (module >= c_numModules) {
163 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
164 return 0;
165 }
166 return m_y[module];
167 }
float m_y[c_numModules]
displacement along the y axis

◆ getY() [2/2]

double getY ( unsigned  row) const

Returns y coordinate of pixel center.

Parameters
rowvalid row number (1-based)
Returns
y coordinate of pixel center

Definition at line 52 of file TOPGeoPMT.cc.

53 {
54 return (int)(2 * row - m_numRows - 1) / 2.0 * getDy();
55 }
double getDy() const
Returns pixel size in y.
Definition: TOPGeoPMT.h:291

◆ getYErr()

double getYErr ( int  moduleID) const

Returns the error on y on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errY error on the y shift

Definition at line 219 of file TOPCalModuleAlignment.cc.

220 {
221 unsigned module = moduleID - 1;
222 if (module >= c_numModules) {
223 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
224 return 0;
225 }
226 return m_errY[module];
227 }

◆ getZ()

double getZ ( int  moduleID) const

Returns the shift z on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
z shift along the z direction

Definition at line 169 of file TOPCalModuleAlignment.cc.

170 {
171 unsigned module = moduleID - 1;
172 if (module >= c_numModules) {
173 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
174 return 0;
175 }
176 return m_z[module];
177 }
float m_z[c_numModules]
displacement along the z axis

◆ getZc()

double getZc ( ) const

Returns spherical mirror center of curvature in z (in local frame of this segment)

Returns
center of curvature in z

Definition at line 21 of file TOPGeoMirrorSegment.cc.

22 {
23 double dx = fabs(getXc()) - getWidth() / 2;
24 double dy = fabs(getYc()) - getThickness() / 2;
25 double z = getOuterRadius();
26 if (dx > 0) z = sqrt(z * z - dx * dx);
27 if (dy > 0) z = sqrt(z * z - dy * dy);
28
29 return getFullLength() / 2 - z;
30 }
double getFullLength() const
Returns bar segment length including glue.
double getYc() const
Returns spherical mirror center of curvature in y.
double getOuterRadius() const
Returns spherical mirror outer radius of curvature.
double getXc() const
Returns spherical mirror center of curvature in x.

◆ getZErr()

double getZErr ( int  moduleID) const

Returns the error on z on a single module.

Parameters
moduleIDmodule ID (1-based)
Returns
errZ error on the z shift

Definition at line 229 of file TOPCalModuleAlignment.cc.

230 {
231 unsigned module = moduleID - 1;
232 if (module >= c_numModules) {
233 B2WARNING("Invalid module number, returning 0 (" << ClassName() << ")");
234 return 0;
235 }
236 return m_errZ[module];
237 }

◆ importAsicShifts_BS13d()

void importAsicShifts_BS13d ( double  s0,
double  s1,
double  s2,
double  s3,
int  expNo,
int  firstRun,
int  lastRun 
)

Import ASIC shifts of BS13d.

Parameters
s0shift of carrier 0 [ns]
s1shift of carrier 1 [ns]
s2shift of carrier 2 [ns]
s3shift of carrier 3 [ns]
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV

Definition at line 342 of file TOPDatabaseImporter.cc.

344 {
345
346 std::vector<double> shifts;
347 shifts.push_back(s0);
348 shifts.push_back(s1);
349 shifts.push_back(s2);
350 shifts.push_back(s3);
351
352 DBImportObjPtr<TOPCalAsicShift> asicShift;
353 asicShift.construct();
354
355 int moduleID = 13;
356 unsigned bs = 3;
357 for (unsigned carrier = 0; carrier < 4; carrier++) {
358 for (unsigned a = 0; a < 4; a++) {
359 unsigned asic = a + carrier * 4 + bs * 16;
360 asicShift->setT0(moduleID, asic, shifts[carrier]);
361 }
362 }
363
364 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
365 asicShift.import(iov);
366
367 B2INFO("ASIC shifts of BS13d imported for exp " << expNo << " run " << firstRun <<
368 " to " << lastRun);
369 }

◆ importChannelMask()

void importChannelMask ( std::string  fileName,
int  expNo,
int  firstRun,
int  lastRun 
)

Import channel mask from a root file (given as 1D histograms, one per slot).

Parameters
fileNameroot file name
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV

Definition at line 621 of file TOPDatabaseImporter.cc.

623 {
624 // declare db object to be imported -- and construct it
625 DBImportObjPtr<TOPCalChannelMask> channelMask;
626 channelMask.construct();
627
628 // open the root file
629 TFile* file = TFile::Open(fileName.c_str(), "r");
630 if (!file) {
631 B2ERROR("openFile: " << fileName << " *** failed to open");
632 return;
633 }
634 B2INFO(fileName << ": open for reading");
635
636 // loop over slots and set channel mask
638 int active = 0, dead = 0, noisy = 0;
639 for (int moduleID = 1; moduleID <= nModules; moduleID++) {
640 std::string name = "slot_" + std::to_string(moduleID);
641 auto* h = (TH1F*) file->Get(name.c_str());
642 if (!h) {
643 B2ERROR("Histogram with name '" + name + "' not found");
644 continue;
645 }
646 for (int channel = 0; channel < h->GetNbinsX(); channel++) {
647 int value = h->GetBinContent(channel + 1);
648 if (value == 0) {
649 channelMask->setActive(moduleID, channel);
650 active++;
651 } else if (value == 1) {
652 channelMask->setDead(moduleID, channel);
653 dead++;
654 } else {
655 channelMask->setNoisy(moduleID, channel);
656 noisy++;
657 }
658 }
659 }
660 file->Close();
661
662 // import to database
663 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
664 channelMask.import(iov);
665
666 B2INFO("Channel mask for exp " << expNo << " run " << firstRun << " to " << lastRun
667 << " imported. Active channels: " << active << ", dead: " << dead
668 << ", noisy: " << noisy);
669
670 }

◆ importChannelT0()

void importChannelT0 ( std::string  fileName,
int  expNo,
int  firstRun,
int  lastRun 
)

Import channel T0 calibration constants The input is a root file with 1D histograms (one per slot, named "channelT0_slot*")

Parameters
fileNameroot file name
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV

Definition at line 290 of file TOPDatabaseImporter.cc.

292 {
293 // declare db object to be imported -- and construct it
294 DBImportObjPtr<TOPCalChannelT0> channelT0;
295 channelT0.construct();
296
297 // open the root file
298 TFile* file = TFile::Open(fileName.c_str(), "r");
299 if (!file) {
300 B2ERROR("openFile: " << fileName << " *** failed to open");
301 return;
302 }
303 B2INFO(fileName << ": open for reading");
304
305 // loop over slots and set channel T0
307 int count = 0; // counter of calibrated constants
308 for (int moduleID = 1; moduleID <= nModules; moduleID++) {
309 std::string name = "channelT0_slot";
310 if (moduleID < 10) name += "0";
311 name += std::to_string(moduleID);
312 auto* h = (TH1F*) file->Get(name.c_str());
313 if (!h) {
314 B2ERROR("Histogram with name '" + name + "' not found");
315 continue;
316 }
317 for (int channel = 0; channel < h->GetNbinsX(); channel++) {
318 double value = h->GetBinContent(channel + 1);
319 double error = h->GetBinError(channel + 1);
320 channelT0->setT0(moduleID, channel, value, error);
321 if (error > 0) {
322 count++;
323 } else {
324 channelT0->setUnusable(moduleID, channel);
325 }
326 }
327 }
328 file->Close();
329
330 channelT0->suppressAverage();
331
332 // import to database
333 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
334 channelT0.import(iov);
335
336 B2INFO("Channel T0 for exp " << expNo << " run " << firstRun << " to " << lastRun
337 << " imported. Calibrated channels: " << count << "/" << nModules * 512);
338
339 }

◆ importCommonT0()

void importCommonT0 ( double  value,
double  error,
int  expNo,
int  firstRun,
int  lastRun,
bool  roughlyCalibrated = false 
)

Import common T0 calibration constants.

Parameters
valuecentral value of T0
erroruncertainty on T0
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV
roughlyCalibratedif true set payload status to roughly calibrated

Definition at line 446 of file TOPDatabaseImporter.cc.

449 {
450 DBImportObjPtr<TOPCalCommonT0> commonT0;
451 commonT0.construct(value, error);
452 if (roughlyCalibrated) commonT0->setRoughlyCalibrated();
453
454 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
455 commonT0.import(iov);
456
457 B2INFO("--> constants for exp = " << expNo
458 << " run = " << firstRun << " to " << lastRun << " imported");
459 }

◆ importDummyCalAsicShift()

void importDummyCalAsicShift ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalAsicShift DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1395 of file TOPDatabaseImporter.cc.

1397 {
1398 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1399 DBImportObjPtr<TOPCalAsicShift> asicShift;
1400 asicShift.construct();
1401 asicShift.import(iov);
1402 B2INFO("Dummy TOPCalAsicShift imported");
1403 }

◆ importDummyCalChannelNoise()

void importDummyCalChannelNoise ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelNoise DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1318 of file TOPDatabaseImporter.cc.

1320 {
1321 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1322 DBImportObjPtr<TOPCalChannelNoise> channelNoise;
1323 channelNoise.construct();
1324 channelNoise.import(iov);
1325 B2INFO("Dummy TOPCalChannelNoise imported");
1326 return;
1327 }

◆ importDummyCalChannelPulseHeight()

void importDummyCalChannelPulseHeight ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelPulseHeight DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1329 of file TOPDatabaseImporter.cc.

1331 {
1332 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1333 DBImportObjPtr<TOPCalChannelPulseHeight> pulseHeight;
1334 pulseHeight.construct();
1335 pulseHeight.import(iov);
1336 B2INFO("Dummy TOPCalChannelPulseHeight imported");
1337 return;
1338 }

◆ importDummyCalChannelRQE()

void importDummyCalChannelRQE ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelRQE DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1340 of file TOPDatabaseImporter.cc.

1342 {
1343 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1344 DBImportObjPtr<TOPCalChannelRQE> channelRQE;
1345 channelRQE.construct();
1346 channelRQE.import(iov);
1347 B2INFO("Dummy TOPCalChannelRQE imported");
1348 return;
1349 }

◆ importDummyCalChannelT0()

void importDummyCalChannelT0 ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelT0 DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1296 of file TOPDatabaseImporter.cc.

1298 {
1299 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1300 DBImportObjPtr<TOPCalChannelT0> channelT0;
1301 channelT0.construct();
1302 channelT0.import(iov);
1303 B2INFO("Dummy TOPCalChannelT0 imported");
1304 return;
1305 }

◆ importDummyCalChannelThreshold()

void importDummyCalChannelThreshold ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelThreshold DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1362 of file TOPDatabaseImporter.cc.

1364 {
1365 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1366 DBImportObjPtr<TOPCalChannelThreshold> channelThreshold;
1367 channelThreshold.construct();
1368 channelThreshold.import(iov);
1369 B2INFO("Dummy TOPCalChannelThreshold imported");
1370 return;
1371 }

◆ importDummyCalChannelThresholdEff()

void importDummyCalChannelThresholdEff ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalChannelThresholdEff DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1351 of file TOPDatabaseImporter.cc.

1353 {
1354 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1355 DBImportObjPtr<TOPCalChannelThresholdEff> channelThresholdEff;
1356 channelThresholdEff.construct();
1357 channelThresholdEff.import(iov);
1358 B2INFO("Dummy TOPCalChannelThresholdEff imported");
1359 return;
1360 }

◆ importDummyCalCommonT0()

void importDummyCalCommonT0 ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalCommonT0 DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1373 of file TOPDatabaseImporter.cc.

1375 {
1376 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1377 DBImportObjPtr<TOPCalCommonT0> commonT0;
1378 commonT0.construct();
1379 commonT0.import(iov);
1380 B2INFO("Dummy TOPCalCommonT0 imported");
1381 return;
1382 }

◆ importDummyCalIntegratedCharge()

void importDummyCalIntegratedCharge ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalIntegratedCharge DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1384 of file TOPDatabaseImporter.cc.

1386 {
1387 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1388 DBImportObjPtr<TOPCalIntegratedCharge> integratedCharge;
1389 integratedCharge.construct();
1390 integratedCharge.import(iov);
1391 B2INFO("Dummy TOPCalIntegratedCharge imported");
1392 return;
1393 }

◆ importDummyCalModuleAlignment()

void importDummyCalModuleAlignment ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalModuleAlignment DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1274 of file TOPDatabaseImporter.cc.

1276 {
1277 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1278 DBImportObjPtr<TOPCalModuleAlignment> moduleAlignment;
1279 moduleAlignment.construct();
1280 moduleAlignment.import(iov);
1281 B2INFO("Dummy TOPCalModuleAlignment imported");
1282 return;
1283 }

◆ importDummyCalModuleT0()

void importDummyCalModuleT0 ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalCalModuleT0 DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1285 of file TOPDatabaseImporter.cc.

1287 {
1288 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1289 DBImportObjPtr<TOPCalModuleT0> moduleT0;
1290 moduleT0.construct();
1291 moduleT0.import(iov);
1292 B2INFO("Dummy TOPCalModuleT0 imported");
1293 return;
1294 }

◆ importDummyCalTimebase()

void importDummyCalTimebase ( int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

import a dummy payload of TOPCalTimebase DB objects

Parameters
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1307 of file TOPDatabaseImporter.cc.

1309 {
1310 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1311 DBImportObjPtr<TOPCalTimebase> timebase;
1312 timebase.construct();
1313 timebase.import(iov);
1314 B2INFO("Dummy TOPCalTimebase imported");
1315 return;
1316 }

◆ importFrontEndSettings()

void importFrontEndSettings ( int  lookback,
int  readoutWin,
int  extraWin,
int  offset,
int  expNo,
int  firstRun,
int  lastRun 
)

Import front-end settings.

Parameters
lookbackthe number of lookback windows
readoutWinthe number of readout windows
extraWinthe number of extra windows btw. lookback and readout window
offsetoffset to photon peak [RF clocks]
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV

Definition at line 1242 of file TOPDatabaseImporter.cc.

1245 {
1246 DBImportObjPtr<TOPFrontEndSetting> feSetting;
1247 feSetting.construct();
1248
1249 // write-window depths (write-window is 128 samples)
1250 std::vector<int> writeDepths;
1251 for (int i = 0; i < 3; i++) {
1252 writeDepths.push_back(214);
1253 writeDepths.push_back(212);
1254 writeDepths.push_back(214);
1255 }
1256 feSetting->setWriteDepths(writeDepths);
1257 feSetting->setLookbackWindows(lookback);
1258 feSetting->setReadoutWindows(readoutWin);
1259 feSetting->setExtraWindows(extraWin);
1260 feSetting->setOffset(offset);
1261
1262 // window shifts
1263 std::vector<int> shifts = {0, 0, 1, 1, 1, 2};
1264 feSetting->setWindowShifts(shifts);
1265
1266 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
1267 feSetting.import(iov);
1268
1269 B2INFO("Front-end settings imported for exp " << expNo << " run " << firstRun <<
1270 " to " << lastRun);
1271 }

◆ importLocalT0Calibration()

void importLocalT0Calibration ( std::string  fileNames,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import channel-by-channel T0 calibration constants to database The input is the root file with ntuple produced by TOPLaserCalibrator.

Parameters
fileNamesfile names separated by space (since vector doesn't work!)
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 195 of file TOPDatabaseImporter.cc.

198 {
199 vector<string> fileNames;
200 stringstream ss(fNames);
201 string fName;
202 while (ss >> fName) {
203 fileNames.push_back(fName);
204 }
205
206 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
207
208 DBImportObjPtr<TOPCalChannelT0> channelT0;
209 channelT0.construct();
210
211 int nCal[16] = {0}; // number of calibrated channels per slot
212
213 for (const auto& fileName : fileNames) {
214 TFile* file = TFile::Open(fileName.c_str(), "r");
215 B2INFO("--> Opening constants file " << fileName);
216
217 if (!file) {
218 B2ERROR("openFile: " << fileName << " *** failed to open");
219 continue;
220 }
221 B2INFO("--> " << fileName << ": open for reading");
222
223 TTree* treeCal = (TTree*)file->Get("chT0");
224
225 if (!treeCal) {
226 B2ERROR("openFile: no tree named chT0 found in " << fileName);
227 file->Close();
228 continue;
229 }
230
231 double t0Cal = 0.;
232 double t0CalErr = 0.;
233 int channelID = 0; // 0-511
234 int slotID = 0; // 1-16
235 int fitStatus = 0; // fit status, 0 = OK
236
237 treeCal->SetBranchAddress("channel", &channelID);
238 treeCal->SetBranchAddress("slot", &slotID);
239 treeCal->SetBranchAddress("channelT0", &t0Cal);
240 treeCal->SetBranchAddress("channelT0Err", &t0CalErr);
241 treeCal->SetBranchAddress("fitStatus", &fitStatus);
242
243 B2INFO("--> importing constats");
244
245 for (int iCal = 0; iCal < treeCal->GetEntries(); iCal++) {
246 treeCal->GetEntry(iCal);
247 if (!geo->isModuleIDValid(slotID)) {
248 B2ERROR("Slot ID is not valid (fileName = " << fileName
249 << ", SlotID = " << slotID << ", ChannelID = " << channelID <<
250 "). Skipping the entry.");
251 continue;
252 }
253 if (channelID < 0 or channelID > 511) {
254 B2ERROR("Channel ID is not valid (fileName = " << fileName
255 << ", SlotID = " << slotID << ", ChannelID = " << channelID <<
256 "). Skipping the entry.");
257 continue;
258 }
259 channelT0->setT0(slotID, channelID, t0Cal, t0CalErr);
260 if (fitStatus == 0) {
261 nCal[slotID - 1]++;
262 } else {
263 channelT0->setUnusable(slotID, channelID);
264 }
265 }
266
267 file->Close();
268 B2INFO("--> Input file closed");
269 }
270 channelT0->suppressAverage();
271
272 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
273 channelT0.import(iov);
274
275 short nCalTot = 0;
276 B2INFO("Summary: ");
277 for (int iSlot = 1; iSlot < 17; iSlot++) {
278 B2INFO("--> Number of calibrated channels on Slot " << iSlot << " : " << nCal[iSlot - 1] << "/512");
279 B2INFO("--> Cal on ch 1, 256 and 511: " << channelT0->getT0(iSlot, 0) << ", " << channelT0->getT0(iSlot,
280 257) << ", " << channelT0->getT0(iSlot, 511));
281 nCalTot += nCal[iSlot - 1];
282 }
283
284
285 B2RESULT("Channel T0 calibration constants imported to database, calibrated channels: "
286 << nCalTot << "/ 8192");
287 }

◆ importModuleT0()

void importModuleT0 ( std::string  fileName,
int  expNo,
int  firstRun,
int  lastRun 
)

Import module T0 calibration constants The input is a root file with 1D histogram (name is "moduleT0")

Parameters
fileNameroot file name
expNoexperiment number of IOV
firstRunfirst run number of IOV
lastRunlast run number of IOV

Definition at line 514 of file TOPDatabaseImporter.cc.

516 {
517
518 // construct DB import object
519 DBImportObjPtr<TOPCalModuleT0> moduleT0;
520 moduleT0.construct();
521
522 // open the root file
523 TFile* file = TFile::Open(fileName.c_str(), "r");
524 if (!file) {
525 B2ERROR("openFile: " << fileName << " *** failed to open");
526 return;
527 }
528 B2INFO(fileName << ": open for reading");
529
530 // get histogram and set the DB import object
531 auto* h = (TH1F*) file->Get("moduleT0");
532 if (not h) {
533 B2ERROR("no histogram 'moduleT0' found in the file, nothing imported");
534 return;
535 }
536 int count = 0; // counter of calibrated
537 for (int slot = 1; slot <= h->GetNbinsX(); slot++) {
538 double value = h->GetBinContent(slot);
539 double error = h->GetBinError(slot);
540 moduleT0->setT0(slot, value, error);
541 if (error > 0) {
542 count++;
543 } else {
544 moduleT0->setUnusable(slot);
545 }
546 }
547 file->Close();
548
549 moduleT0->suppressAverage();
550
551 // import the object
552 IntervalOfValidity iov(expNo, firstRun, expNo, lastRun);
553 moduleT0.import(iov);
554
555 B2INFO("Module T0 for exp " << expNo << " run " << firstRun << " to " << lastRun
556 << " imported. Calibrated modules: " << count << "/" << 16);
557
558 }

◆ importModuleT0Calibration()

void importModuleT0Calibration ( std::string  fileName,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import module T0 calibration constants to database The input is the text file.

Parameters
fileNamename of the dat file with constants of all modules
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 461 of file TOPDatabaseImporter.cc.

464 {
465
466
467 DBImportObjPtr<TOPCalModuleT0> moduleT0;
468 moduleT0.construct();
469
470
471 ifstream inFile(fileName);
472 B2INFO("--> Opening constants file " << fileName);
473
474 if (!inFile) {
475 B2ERROR("openFile: " << fileName << " *** failed to open");
476 return;
477 }
478 B2INFO("--> " << fileName << ": open for reading");
479
480
481 B2INFO("--> importing constants");
482
483 while (!inFile.eof()) {
484 int slot = 0;
485 int dummy = 0;
486 double T0 = 0;
487 double T0_err = 0;
488
489 inFile >> slot >> dummy >> T0 >> T0_err;
490 if (slot < 1 or slot > 16) {
491 B2ERROR("Module ID is not valid. Skipping the entry.");
492 continue;
493 }
494 moduleT0->setT0(slot, T0, T0_err);
495
496 }
497 inFile.close();
498 B2INFO("--> Input file closed");
499
500 moduleT0->suppressAverage();
501
502 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
503 moduleT0.import(iov);
504
505 B2INFO("Summary: ");
506 for (int iSlot = 1; iSlot < 17; iSlot++) {
507 B2INFO("--> Time offset of Slot " << iSlot << " = " << moduleT0->getT0(iSlot));
508 }
509
510
511 }

◆ importOfflineCommonT0Calibration()

void importOfflineCommonT0Calibration ( std::string  fileName,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import common T0 calibration constants derived form the offline data reprocessing to database The input is a root file containing a tree (one per run).

In the future we may add a furter implementation that reads the IOV from the root file itself.

Parameters
fileNamename of the root file with constants of all modules
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 372 of file TOPDatabaseImporter.cc.

375 {
376 TFile* file = TFile::Open(fileName.c_str(), "r");
377 B2INFO("--> Opening constants file " << fileName);
378
379 if (!file) {
380 B2ERROR("openFile: " << fileName << " *** failed to open");
381 return;
382 }
383 B2INFO("--> " << fileName << ": open for reading");
384
385 TTree* treeCal = (TTree*)file->Get("tree");
386
387 if (!treeCal) {
388 B2ERROR("openFile: no tree named tree found in " << fileName);
389 file->Close();
390 return;
391 }
392
393 float t0 = 0.;
394 float t0Err = 0;
395 float chi2 = 0;
396 float integral = 0;
397 float sigma = 0;
398 int runNum = 0;
399 int fitStatus = 0;
400
401 treeCal->SetBranchAddress("offset", &t0);
402 treeCal->SetBranchAddress("runNum", &runNum);
403 treeCal->SetBranchAddress("sigma", &sigma);
404 treeCal->SetBranchAddress("offsetErr", &t0Err);
405 treeCal->SetBranchAddress("chi2", &chi2);
406 treeCal->SetBranchAddress("integral", &integral);
407 treeCal->SetBranchAddress("fitStatus", &fitStatus);
408
409 treeCal->GetEntry(0);
410
411 if (lastRun == -1 and firstRun == -1) {
412 lastRun = runNum;
413 firstRun = runNum;
414 B2INFO("Using the run number from the tree ");
415 } else {
416 B2INFO("Using the run numbers passed to the importer");
417 }
418 B2INFO("IOV = (" << firstExp << ", " << firstRun << ", "
419 << lastExp << ", " << lastRun << ")");
420
421 DBImportObjPtr<TOPCalCommonT0> commonT0;
422 commonT0.construct(t0, t0Err);
423
424 if (fitStatus == 0 and integral > 10 and sigma > 0.05 and sigma < 0.33) {
425 B2INFO("Good calibration found ");
426 B2INFO("t0 = " << t0 << " +- " << t0Err);
427 B2INFO("sigma = " << sigma);
428 B2INFO("chi2 = " << chi2);
429 } else {
430 B2INFO("BAD calibration found - set calibration to 'unusable'");
431 B2INFO("t0 = " << t0 << " +- " << t0Err);
432 B2INFO("sigma = " << sigma);
433 B2INFO("chi2 = " << chi2);
434 B2INFO("fit status = " << fitStatus);
435 commonT0->setUnusable();
436 }
437
438 file->Close();
439
440 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
441 commonT0.import(iov);
442 B2INFO("--> constants imported");
443 B2INFO(" ");
444 }

◆ importPmtGainData()

void importPmtGainData ( std::string  fileName,
std::string  treeName = "gainPmtData",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import PMT gain parameters data to database.

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 796 of file TOPDatabaseImporter.cc.

799 {
800
801 // declare db objects to be imported
802 DBImportArray<TOPPmtGainPar> pmtGains;
803
804 static const int nChann = 16;
805 std::string* serialNum = 0;
806 float gain_const[nChann], gain_slope[nChann], gain_ratio[nChann];
807 float hv_op0, hv_op;
808
809 // open root file and get tree
810 TFile* file = TFile::Open(fileName.c_str(), "r");
811 if (!file) {
812 B2ERROR("Cannot open the file " << fileName);
813 return;
814 }
815 TTree* tGainData = (TTree*)file->Get(treeName.c_str());
816 if (!tGainData) {
817 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
818 file->Close();
819 return;
820 }
821
822 tGainData->SetBranchAddress("serialNum", &serialNum);
823 tGainData->SetBranchAddress("gain_const", &gain_const);
824 tGainData->SetBranchAddress("gain_slope", &gain_slope);
825 tGainData->SetBranchAddress("gain_ratio", &gain_ratio);
826 tGainData->SetBranchAddress("hv_op0", &hv_op0);
827 tGainData->SetBranchAddress("hv_op", &hv_op);
828
829
830 // loop on input tree entries and construct the pmtGain objects
831 int countPMTs = 0;
832
833 for (int ient = 0; ient < tGainData->GetEntries(); ient++) {
834 tGainData->GetEntry(ient);
835 auto* pmtGain = pmtGains.appendNew(*serialNum);
836
837 for (int ic = 0; ic < nChann; ic++) {
838 pmtGain->setPmtPixelData(ic + 1, gain_const[ic], gain_slope[ic], gain_ratio[ic]);
839 pmtGain->setNominalHV0(-fabs(hv_op0));
840 pmtGain->setNominalHV(-fabs(hv_op));
841 }
842 countPMTs++;
843 }
844 file->Close();
845
846 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
847 pmtGains.import(iov);
848
849 B2RESULT("PMT gain data imported to database for " << countPMTs << " PMT's.");
850
851 return;
852 }

◆ importPmtInstallationData()

void importPmtInstallationData ( std::string  fileName,
std::string  treeName = "installationPmtData",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import PMT installation data to database.

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 855 of file TOPDatabaseImporter.cc.

858 {
859
860 // declare db objects to be imported
861 DBImportArray<TOPPmtInstallation> pmtInst;
862
863 std::string* serialNum = 0;
864 int moduleCNum, slotNum, arrayNum, PMTposition;
866
867 // open root file and get tree
868 TFile* file = TFile::Open(fileName.c_str(), "r");
869 if (!file) {
870 B2ERROR("Cannot open the file " << fileName);
871 return;
872 }
873 TTree* tInstData = (TTree*)file->Get(treeName.c_str());
874 if (!tInstData) {
875 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
876 file->Close();
877 return;
878 }
879
880 tInstData->SetBranchAddress("serialNum", &serialNum);
881 tInstData->SetBranchAddress("moduleCNum", &moduleCNum);
882 tInstData->SetBranchAddress("slotNum", &slotNum);
883 tInstData->SetBranchAddress("arrayNum", &arrayNum);
884 tInstData->SetBranchAddress("PMTposition", &PMTposition);
885 tInstData->SetBranchAddress("type", &type);
886
887 // loop on input tree entries and construct the pmtInstallation objects
888 int countPMTs = 0;
889
890 for (int ient = 0; ient < tInstData->GetEntries(); ient++) {
891 tInstData->GetEntry(ient);
892 pmtInst.appendNew(*serialNum, moduleCNum, slotNum, arrayNum, PMTposition, type);
893 countPMTs++;
894 }
895 file->Close();
896
897 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
898 pmtInst.import(iov);
899
900 B2RESULT("PMT installation data imported to database for " << countPMTs << " PMT's.");
901
902 }

◆ importPmtObsoleteData()

void importPmtObsoleteData ( std::string  fileName,
std::string  treeName = "obsPmtData",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import PMT specifications from Hamamatsu (not to be used!)

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 905 of file TOPDatabaseImporter.cc.

908 {
909
910 // declare db objects to be imported
911 DBImportArray<TOPPmtObsoleteData> pmtObsData;
912
913 std::string* serialNum = 0;
914 std::string* cathode = 0;
915 float hv_spec, dark_spec, qe380_spec;
917
918 // open root file and get tree
919 TFile* file = TFile::Open(fileName.c_str(), "r");
920 if (!file) {
921 B2ERROR("Cannot open the file " << fileName);
922 return;
923 }
924 TTree* tObsData = (TTree*)file->Get(treeName.c_str());
925 if (!tObsData) {
926 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
927 file->Close();
928 return;
929 }
930
931 tObsData->SetBranchAddress("serialNum", &serialNum);
932 tObsData->SetBranchAddress("cathode", &cathode);
933 tObsData->SetBranchAddress("hv_spec", &hv_spec);
934 tObsData->SetBranchAddress("dark_spec", &dark_spec);
935 tObsData->SetBranchAddress("qe380_spec", &qe380_spec);
936 tObsData->SetBranchAddress("type", &type);
937
938 // loop on input tree entries and construct the pmt obsolete data objects
939 int countPMTs = 0;
940
941 for (int ient = 0; ient < tObsData->GetEntries(); ient++) {
942 tObsData->GetEntry(ient);
943
944 // make sure the HV from specifications is negative
945 hv_spec = -fabs(hv_spec);
946
947 pmtObsData.appendNew(*serialNum, type, *cathode, hv_spec, dark_spec, qe380_spec);
948 countPMTs++;
949 }
950
951 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
952 pmtObsData.import(iov);
953
954 B2RESULT("PMT obsolete data imported to database for " << countPMTs << " PMT's.");
955
956 file->Close();
957
958 delete serialNum;
959 delete cathode;
960
961 return;
962 }

◆ importPmtPulseHeightFitResult()

void importPmtPulseHeightFitResult ( std::string  fileName,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import fit results of pulse height disribution for channel gain and threshold efficiency.

Parameters
fileName: name of the root file containing relevant data, which is obtained from TOPGainEfficiencyMonitor
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1129 of file TOPDatabaseImporter.cc.

1132 {
1133 // declare db objects to be imported
1134 DBImportObjPtr<TOPCalChannelPulseHeight> calChannelPulseHeight;
1135 DBImportObjPtr<TOPCalChannelThresholdEff> calChannelThresholdEff;
1136 calChannelPulseHeight.construct();
1137 calChannelThresholdEff.construct();
1138
1139 TFile* file = TFile::Open(fileName.c_str());
1140 if (!file) {
1141 B2ERROR("openFile: " << fileName << " *** failed to open");
1142 return;
1143 }
1144 TTree* tr = (TTree*)file->Get("tree"); // defined in TOPGainEfficiencyCalculatorModule
1145 if (!tr) {
1146 B2ERROR("No TTree with name tree found in " << fileName);
1147 file->Close();
1148 return;
1149 }
1150
1151 short slotId = 0;
1152 short pixelId = 0;
1153 float p1 = -1;
1154 float p2 = -1;
1155 float x0 = -1;
1156 float threshold = -1;
1157 float efficiency = -1;
1158 float chisquare = -1;
1159 int ndf = 0;
1160 tr->SetBranchAddress("slotId", &slotId);
1161 tr->SetBranchAddress("pixelId", &pixelId);
1162 tr->SetBranchAddress("p1UseIntegral", &p1);
1163 tr->SetBranchAddress("p2UseIntegral", &p2);
1164 tr->SetBranchAddress("x0UseIntegral", &x0);
1165 tr->SetBranchAddress("thresholdForIntegral", &threshold);
1166 tr->SetBranchAddress("efficiencyUseIntegral", &efficiency);
1167 tr->SetBranchAddress("chisquareUseIntegral", &chisquare);
1168 tr->SetBranchAddress("ndfUseIntegral", &ndf);
1169
1170 const auto& channelMapper = TOPGeometryPar::Instance()->getChannelMapper();
1171 if (!channelMapper.isValid()) {
1172 B2ERROR("No valid channel mapper found");
1173 file->Close();
1174 return;
1175 }
1176
1177 long nEntries = tr->GetEntries();
1178 std::map<short, float> reducedChisqMap;
1179 for (long iEntry = 0 ; iEntry < nEntries ; iEntry++) {
1180 tr->GetEntry(iEntry);
1181
1182 if (efficiency < 0) continue;
1183
1184 if (!channelMapper.isPixelIDValid(pixelId)) {
1185 B2ERROR("invalid pixelID" << pixelId);
1186 continue;
1187 }
1188 auto channel = channelMapper.getChannel(pixelId);
1189 short globalChannelNumber = slotId * 1000 + channel;
1190 float redChisq = chisquare / ndf;
1191
1192 //in case entries for the same channel appears multiple time, use data with smaller reduced chisquare
1193 //(This can happen when distribution is fit manually and results are appended for channels with fit failure)
1194 if (reducedChisqMap.count(globalChannelNumber) == 0
1195 or reducedChisqMap[globalChannelNumber] > redChisq) {
1196 reducedChisqMap[globalChannelNumber] = redChisq;
1197 calChannelPulseHeight->setParameters(slotId, channel, x0, p1, p2);
1198 calChannelThresholdEff->setThrEff(slotId, channel, efficiency, (short)threshold);
1199
1200 if (redChisq > 10.) {
1201 calChannelPulseHeight->setUnusable(slotId, channel);
1202 calChannelThresholdEff->setUnusable(slotId, channel);
1203 }
1204 }
1205 }
1206 file->Close();
1207
1208 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1209 calChannelPulseHeight.import(iov);
1210 calChannelThresholdEff.import(iov);
1211
1212 B2RESULT("Imported channel-by-channel gain and efficiency data from fitting of pulse height distribution for "
1213 << reducedChisqMap.size() << " channels from " << fileName << " file.");
1214
1215 return;
1216 }

◆ importPmtQEData()

void importPmtQEData ( std::string  fileName,
std::string  treeName = "qePmtData",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import PMT Quantum Efficiency data to database.

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 723 of file TOPDatabaseImporter.cc.

726 {
727
728 // declare db objects to be imported
729 DBImportArray<TOPPmtQE> pmtQEs;
730
731 static const int nChann = 16;
732 std::string* serialNum = 0;
733 std::vector<float>* QE_data[nChann];
734 float lambdaFirst, lambdaStep, collEff0, collEff;
735
736 TBranch* bQE_data[nChann];
737
738 // open root file and get tree
739 TFile* file = TFile::Open(fileName.c_str(), "r");
740 if (!file) {
741 B2ERROR("Cannot open the file " << fileName);
742 return;
743 }
744 TTree* tQeData = (TTree*)file->Get(treeName.c_str());
745 if (!tQeData) {
746 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
747 file->Close();
748 return;
749 }
750
751 tQeData->SetBranchAddress("serialNum", &serialNum);
752 tQeData->SetBranchAddress("lambdaFirst", &lambdaFirst);
753 tQeData->SetBranchAddress("lambdaStep", &lambdaStep);
754 tQeData->SetBranchAddress("collEff0", &collEff0);
755 tQeData->SetBranchAddress("collEff", &collEff);
756
757 for (int ic = 0; ic < nChann; ic++) {
758 // must initialize vectors and branches
759 QE_data[ic] = new std::vector<float>;
760 bQE_data[ic] = new TBranch();
761
762 TString cString = "QE_ch";
763 cString += ic + 1;
764 tQeData->SetBranchAddress(cString, &QE_data[ic], &bQE_data[ic]);
765 }
766
767 // loop on input tree entries and construct the pmtQE objects
768 int countPMTs = 0;
769
770 for (int ient = 0; ient < tQeData->GetEntries(); ient++) {
771
772 tQeData->GetEntry(ient);
773
774 auto* pmtQE = pmtQEs.appendNew(*serialNum, lambdaFirst, lambdaStep, collEff0, collEff);
775
776 for (int ic = 0; ic < nChann; ic++) {
777 int tEntry = tQeData->LoadTree(ient);
778 bQE_data[ic]->GetEntry(tEntry);
779
780 pmtQE->setQE(ic + 1, *QE_data[ic]);
781 } // end loop on channels
782
783 countPMTs++;
784 }
785 file->Close();
786
787 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
788 pmtQEs.import(iov);
789
790 B2RESULT("PMT QE data imported to database for " << countPMTs << " PMT's.");
791
792 return;
793 }

◆ importPmtTTSHisto()

void importPmtTTSHisto ( std::string  fileName,
std::string  treeName = "ttsPmtHisto",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import histograms used for PMT TTS determination.

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1066 of file TOPDatabaseImporter.cc.

1070 {
1071
1072 // declare db objects to be imported
1073 DBImportArray<TOPPmtTTSHisto> pmtTtsHistos;
1074
1075 static const int nChann = 16;
1076 std::string* serialNum = 0;
1077 float hv = 0;
1078 TH1F* histo[nChann] = {0};
1079
1080 // open root file and get tree
1081 TFile* file = TFile::Open(fileName.c_str(), "r");
1082 if (!file) {
1083 B2ERROR("Cannot open the file " << fileName);
1084 return;
1085 }
1086 TTree* tTtsHisto = (TTree*)file->Get(treeName.c_str());
1087 if (!tTtsHisto) {
1088 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
1089 file->Close();
1090 return;
1091 }
1092
1093 tTtsHisto->SetBranchAddress("serialNum", &serialNum);
1094 tTtsHisto->SetBranchAddress("hv", &hv);
1095 for (int ic = 0; ic < nChann; ic++) {
1096 TString hString = "hist_ch";
1097 hString += ic + 1;
1098 tTtsHisto->SetBranchAddress(hString, &histo[ic]);
1099 }
1100
1101 // loop on input tree entries and construct the pmt tts histo objects
1102 int countHists = 0;
1103
1104 for (int ient = 0; ient < tTtsHisto->GetEntries(); ient++) {
1105
1106 tTtsHisto->GetEntry(ient);
1107
1108 // make sure the HV used in the test is negative
1109 hv = -fabs(hv);
1110
1111 B2INFO("Saving TTS histograms for PMT " << *serialNum << ", HV = " << hv);
1112
1113 auto* pmtTtsHisto = pmtTtsHistos.appendNew(*serialNum, hv);
1114 for (int ic = 0; ic < nChann; ic++) {
1115 pmtTtsHisto->setHistogram(ic + 1, histo[ic]);
1116 }
1117 countHists++;
1118 }
1119 file->Close();
1120
1121 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1122 pmtTtsHistos.import(iov);
1123
1124 B2RESULT("Imported " << countHists << " sets of TTS histograms from " << fileName << " file.");
1125
1126 return;
1127 }

◆ importPmtTTSPar()

void importPmtTTSPar ( std::string  fileName,
std::string  treeName = "ttsPmtPar",
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import gaussians fitting the TTS distributions.

Parameters
fileName: name of the root file containing relevant data
treeName: name of the tree containing relevant data
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 965 of file TOPDatabaseImporter.cc.

968 {
969
970 // declare db objects to be imported
971 DBImportArray<TOPPmtTTSPar> pmtTtsPars;
972
973 static const int nChann = 16;
974 std::string* serialNum = 0;
975 std::vector<float>* gausFrac[nChann];
976 std::vector<float>* gausMean[nChann];
977 std::vector<float>* gausSigma[nChann];
978
979 TBranch* bGFrac[nChann];
980 TBranch* bGMean[nChann];
981 TBranch* bGSigma[nChann];
982
983
984 // open root file and get tree
985 TFile* file = TFile::Open(fileName.c_str(), "r");
986 if (!file) {
987 B2ERROR("Cannot open the file " << fileName);
988 return;
989 }
990 TTree* tTtsPar = (TTree*)file->Get(treeName.c_str());
991 if (!tTtsPar) {
992 B2ERROR("No TTree with name " << treeName << " in file " << fileName);
993 file->Close();
994 return;
995 }
996
997 tTtsPar->SetBranchAddress("serialNum", &serialNum);
998 for (int ic = 0; ic < nChann; ic++) {
999 // must initialize vectors and branches
1000 gausFrac[ic] = new std::vector<float>;
1001 gausMean[ic] = new std::vector<float>;
1002 gausSigma[ic] = new std::vector<float>;
1003
1004 bGFrac[ic] = new TBranch();
1005 bGMean[ic] = new TBranch();
1006 bGSigma[ic] = new TBranch();
1007
1008
1009 TString cStringF = "gausFrac_ch";
1010 TString cStringM = "gausMean_ch";
1011 TString cStringS = "gausSigma_ch";
1012
1013 cStringF += ic + 1;
1014 cStringM += ic + 1;
1015 cStringS += ic + 1;
1016
1017 tTtsPar->SetBranchAddress(cStringF, &gausFrac[ic], &bGFrac[ic]);
1018 tTtsPar->SetBranchAddress(cStringM, &gausMean[ic], &bGMean[ic]);
1019 tTtsPar->SetBranchAddress(cStringS, &gausSigma[ic], &bGSigma[ic]);
1020 }
1021
1022 // loop on input tree entries and construct the pmt tts par objects
1023 int countPMTs = 0;
1024
1025 for (int ient = 0; ient < tTtsPar->GetEntries(); ient++) {
1026
1027 tTtsPar->GetEntry(ient);
1028
1029 auto* pmtTtsPar = pmtTtsPars.appendNew(*serialNum);
1030
1031 for (int ic = 0; ic < nChann; ic++) {
1032
1033 int tEntry = tTtsPar->LoadTree(ient);
1034 bGFrac[ic]->GetEntry(tEntry);
1035 bGMean[ic]->GetEntry(tEntry);
1036 bGSigma[ic]->GetEntry(tEntry);
1037
1038 // check that the vectors have the same size. Otherwise skip the channel
1039 if ((gausFrac[ic]->size() != gausMean[ic]->size()) ||
1040 (gausFrac[ic]->size() != gausSigma[ic]->size())) {
1041
1042 B2ERROR("The TTSPar vectors for PMT " << serialNum << ", channel " << ic + 1 << " have different sizes! Skipping channel...");
1043 continue;
1044 }
1045
1046 for (uint iv = 0; iv < gausFrac[ic]->size(); iv++) {
1047 pmtTtsPar->appendGaussian(ic + 1,
1048 gausFrac[ic]->at(iv),
1049 gausMean[ic]->at(iv),
1050 gausSigma[ic]->at(iv));
1051 }
1052 }
1053 countPMTs++;
1054 }
1055 file->Close();
1056
1057 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1058 pmtTtsPars.import(iov);
1059
1060 B2RESULT("PMT TTS parameters imported to database for " << countPMTs << " PMT's.");
1061
1062 return;
1063 }

◆ importSampleTimeCalibration()

void importSampleTimeCalibration ( std::string  fileNames,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

Import sample time calibration constants to database Output of TOPTimeBaseCalibrator (root files with histograms)

Parameters
fileNamesfile names separated by space (since vector doesn't work!)
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 69 of file TOPDatabaseImporter.cc.

72 {
73
74 // make vector out of files separated with space
75
76 vector<string> fileNames;
77 stringstream ss(fNames);
78 string fName;
79 while (ss >> fName) {
80 fileNames.push_back(fName);
81 }
82
83 // prepare what is needed
84
85 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
86 auto syncTimeBase = geo->getNominalTDC().getSyncTimeBase();
87
88 DBImportObjPtr<TOPCalTimebase> timeBase;
89 timeBase.construct(syncTimeBase);
90
91 set<int> scrodIDs;
92
93 // read constants from files and put them to DB object
94
95 for (const auto& fileName : fileNames) {
96 TFile* file = TFile::Open(fileName.c_str(), "r");
97 if (!file) {
98 B2ERROR("openFile: " << fileName << " *** failed to open");
99 continue;
100 }
101 B2INFO(fileName << ": open for reading");
102
103 TH1F* hsuccess = (TH1F*) file->Get("success");
104 if (!hsuccess) {
105 B2ERROR("Fit status histogram '" << hsuccess << "' not found");
106 file->Close();
107 continue;
108 }
109
110 int goodChannels = 0;
111 int numChannels = hsuccess->GetNbinsX();
112 for (int channel = 0; channel < numChannels; channel++) {
113 if (hsuccess->GetBinContent(channel + 1) == 0) continue;
114
115 string hname = "sampleTimes_ch" + to_string(channel);
116
117 TH1F* hsampleTimes = (TH1F*) file->Get(hname.c_str());
118 if (!hsampleTimes) {
119 B2ERROR("Histogram '" << hname << "' with calibration constants not found");
120 continue;
121 }
122 // parse scrodID from histogram title
123 string title = hsampleTimes->GetTitle();
124 auto iscrod = title.find("scrod");
125 auto ichannel = title.find("channel");
126 if (iscrod == string::npos or ichannel == string::npos) {
127 B2ERROR("Unsuccessful parsing of scrodID from '" << title << "'");
128 continue;
129 }
130 iscrod += 5;
131 int len = ichannel - iscrod;
132 if (len < 1) {
133 B2ERROR("Unsuccessful parsing of scrodID from '" << title << "'");
134 continue;
135 }
136 int scrodID = stoi(title.substr(iscrod, len));
137 scrodIDs.insert(scrodID);
138
139 double rescale = 1;
140 if (hsampleTimes->GetBinContent(257) > 0)
141 rescale = 2 * syncTimeBase / hsampleTimes->GetBinContent(257);
142
143 vector<double> sampleTimes;
144 for (int isamp = 0; isamp < 256; isamp++) {
145 sampleTimes.push_back(hsampleTimes->GetBinContent(isamp + 1) * rescale);
146 }
147 goodChannels++;
148
149 timeBase->append(scrodID, channel, sampleTimes);
150 }
151
152 file->Close();
153 B2INFO("--> number of calibrated channels: " << goodChannels);
154 B2INFO("file closed");
155 }
156
157 // set calibration for missing ones, using previous calibrated channel within asic
158
159 B2INFO("set constants for uncalibrated channels using nearest calibrated channel within an ASIC");
160 for (auto scrodID : scrodIDs) {
161 int nasic = 128 / 8;
162 for (int as = 0; as < nasic; as++) {
163 const TOPSampleTimes* sampleTimes = 0;
164 for (int ch = 0; ch < 15; ch++) {
165 int channel = as * 8 + (ch % 8);
166 if (timeBase->isAvailable(scrodID, channel)) {
167 sampleTimes = timeBase->getSampleTimes(scrodID, channel);
168 } else if (sampleTimes) {
169 timeBase->append(scrodID, channel, sampleTimes->getTimeAxis());
170 }
171 }
172 if (!sampleTimes) {
173 B2INFO("No calibration available for ASIC " << as << " of scrodID " << scrodID);
174 }
175 }
176 }
177
178 // import constants
179 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
180 timeBase.import(iov);
181
182 // final message
183
184 int nall = timeBase->getSampleTimes().size();
185 int ncal = 0;
186 for (const auto& sampleTimes : timeBase->getSampleTimes()) {
187 if (sampleTimes.isCalibrated()) ncal++;
188 }
189
190 B2RESULT("Sample time calibration constants imported to database, calibrated channels: "
191 << ncal << "/" << nall);
192 }
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
Definition: TOPGeometry.h:218
double getSyncTimeBase() const
Returns synchonization time base (time width of c_syncWindows)

◆ importTest() [1/2]

void importTest ( )

for testing purposes only! - will be removed ...

Definition at line 1506 of file TOPDatabaseImporter.cc.

1507 {
1508
1509 DBImportArray<TOPPmtGainPar> pmtGains;
1510
1511 auto* pmtGain = pmtGains.appendNew("JT00123");
1512 pmtGain->setNominalHV(3520);
1513 for (unsigned channel = 1; channel <= 16; channel++) {
1514 pmtGain->setPmtPixelData(channel, -13.77, 0.0042, 0.4);
1515 }
1516
1517 pmtGain = pmtGains.appendNew("JT02135");
1518 pmtGain->setNominalHV(3450);
1519 for (unsigned channel = 1; channel <= 16; channel++) {
1520 pmtGain->setPmtPixelData(channel, -12.77, 0.0045, 0.4);
1521 }
1522
1523 for (const auto& gain : pmtGains) gain.print();
1524
1525 // IntervalOfValidity iov(0, 0, -1, -1); // all experiments and runs
1526 // pmtGains.import(iov);
1527
1528
1529 }

◆ importTest() [2/2]

void importTest ( int  runNumber,
double  syncTimeBase 
)

for testing purposes only! - will be removed ...

Definition at line 1473 of file TOPDatabaseImporter.cc.

1474 {
1475
1476 DBImportObjPtr<TOPCalTimebase> timeBase;
1477 vector<double> timeAxis;
1478 for (int i = 0; i < 256; i++) {
1479 timeAxis.push_back(syncTimeBase / 128.0 * i);
1480 }
1481
1482
1483 timeBase.construct(syncTimeBase);
1484 for (unsigned scrodID = 0; scrodID < 64; scrodID++) {
1485 for (unsigned channel = 0; channel < 128; channel++) {
1486 timeBase->append(scrodID, channel, timeAxis);
1487 }
1488 }
1489
1490 if (runNumber == 3) {
1491 timeBase.addEventDependency(10);
1492 timeBase.construct(syncTimeBase + 100);
1493 for (unsigned scrodID = 0; scrodID < 64; scrodID++) {
1494 for (unsigned channel = 0; channel < 128; channel++) {
1495 timeBase->append(scrodID, channel, timeAxis);
1496 }
1497 }
1498 }
1499
1500 IntervalOfValidity iov(1, runNumber, 1, runNumber);
1501 timeBase.import(iov);
1502
1503 }

◆ importTimeWalk()

void importTimeWalk ( PyObject *  list,
double  a,
double  b,
int  firstExp = 0,
int  firstRun = 0,
int  lastExp = -1,
int  lastRun = -1 
)

payload TOPCalTimeWalk import parameters for time-walk correction and electronic time resolution tuning

Parameters
listPython list of parameters of time-walk calibration curve [ns]
aelectronic time resolution: noise term excess parameter [ns]
belectronic time resolution: quadratic term parameter [ns]
firstExpfirst experiment number of IOV
firstRunfirst run number of IOV
lastExpfirst experiment number of IOV
lastRunlast run number of IOV

Definition at line 1442 of file TOPDatabaseImporter.cc.

1445 {
1446
1447 std::vector<double> params;
1448 if (PyList_Check(list)) {
1449 for (Py_ssize_t i = 0; i < PyList_Size(list); i++) {
1450 PyObject* value = PyList_GetItem(list, i);
1451 params.push_back(PyFloat_AsDouble(value));
1452 B2INFO(i << " " << params.back());
1453 }
1454 } else {
1455 B2ERROR("Input Python object is not a list");
1456 return;
1457 }
1458
1459 DBImportObjPtr<TOPCalTimeWalk> timeWalk;
1460 timeWalk.construct();
1461 timeWalk->set(params, a, b);
1462
1463 IntervalOfValidity iov(firstExp, firstRun, lastExp, lastRun);
1464 timeWalk.import(iov);
1465
1466 B2RESULT("Time-walk constants imported");
1467 }

◆ interpolate()

double interpolate ( double  lambda,
const std::vector< float > &  QE 
) const
private

Interpolate between QE datapoints (linear interpolation).

Parameters
lambdawavelength in [nm]
QEquantum efficiency data points
Returns
quantum efficiency at lambda

Definition at line 105 of file TOPPmtQE.cc.

106 {
107 double dlam = lambda - m_lambdaFirst;
108 if (dlam < 0 or dlam > (QE.size() - 1) * m_lambdaStep) return 0;
109 unsigned i = int(dlam / m_lambdaStep);
110 if (i > QE.size() - 2) return QE.back();
111 return QE[i] + (QE[i + 1] - QE[i]) / m_lambdaStep * (dlam - i * m_lambdaStep);
112 }

◆ isActive()

bool isActive ( int  moduleID,
unsigned  channel 
) const

Returns false if the channel is dead or noisy, and true is the channel is active.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 72 of file TOPCalChannelMask.cc.

73 {
74 int module = moduleID - 1;
75 if (!check(module, channel)) {
76 B2WARNING("Returning false");
77 return false;
78 }
79 return (m_status[module][channel] == c_Active);
80 }

◆ isAvailable()

bool isAvailable ( unsigned  scrodID,
unsigned  channel 
) const

Checks if calibration is available.

Parameters
scrodIDSCROD ID
channelchannel number (within SCROD or within module)
Returns
true if available

Definition at line 76 of file TOPCalTimebase.cc.

77 {
78 if (m_map.empty()) createMap();
79
80 unsigned key = (scrodID << 16) + (channel % 128);
81 Iterator it = m_map.find(key);
82 return (it != m_map.end());
83
84 }

◆ isCalibrated() [1/4]

bool isCalibrated ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if good calibrated

Definition at line 239 of file TOPCalModuleAlignment.cc.

240 {
241 unsigned module = moduleID - 1;
242 if (module >= c_numModules) return false ;
243 return m_status[module] == c_Calibrated;
244 }

◆ isCalibrated() [2/4]

bool isCalibrated ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if good calibrated

Definition at line 85 of file TOPCalModuleT0.cc.

86 {
87 unsigned module = moduleID - 1;
88 if (module >= c_numModules) return false;
89 return m_status[module] == c_Calibrated;
90 }
EStatus m_status[c_numModules]
calibration status
@ c_Calibrated
good calibrated value

◆ isCalibrated() [3/4]

bool isCalibrated ( int  moduleID,
unsigned  asic 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)
Returns
true, if good calibrated

Definition at line 66 of file TOPCalAsicShift.cc.

67 {
68 unsigned module = moduleID - 1;
69 if (module >= c_numModules) return false;
70 if (asic >= c_numAsics) return false;
71 return m_status[module][asic] == c_Calibrated;
72 }
EStatus m_status[c_numModules][c_numAsics]
calibration status
@ c_Calibrated
good calibrated value

◆ isCalibrated() [4/4]

bool isCalibrated ( int  moduleID,
unsigned  channel 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if good calibrated

Definition at line 103 of file TOPCalChannelT0.cc.

104 {
105 unsigned module = moduleID - 1;
106 if (module >= c_numModules) return false;
107 if (channel >= c_numChannels) return false;
108 return m_status[module][channel] == c_Calibrated;
109 }
EStatus m_status[c_numModules][c_numChannels]
calibration status
@ c_Calibrated
good calibrated value

◆ isConsistent() [1/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Reimplemented in TOPGeoMirrorSegment, and TOPGeoPrism.

Definition at line 23 of file TOPGeoBarSegment.cc.

24 {
25 if (m_width <= 0) return false;
26 if (m_thickness <= 0) return false;
27 if (m_length <= 0) return false;
28 if (m_material.empty()) return false;
29 if (m_glueThickness <= 0) return false;
30 if (m_glueMaterial.empty()) return false;
31 if (m_surface.getName().empty() and !m_surface.hasProperties()) return false;
32 if (m_sigmaAlpha < 0) return false;
33 if (m_brokenFraction > 0 and m_brokenGlueMaterial.empty()) return false;
34 return true;
35 }
const std::string & getName() const
get name of the optical surface
bool hasProperties() const
check if the material has at least one property
float m_glueThickness
glue thickness
std::string m_material
bar segment material name
std::string m_brokenGlueMaterial
broken glue material name
GeoOpticalSurface m_surface
optical surface
float m_thickness
bar segment thickness
std::string m_glueMaterial
glue material name
float m_sigmaAlpha
geant4 parameter for surface roughness
float m_length
bar segment length
float m_width
bar segment width

◆ isConsistent() [2/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 20 of file TOPGeoColdPlate.cc.

21 {
22 if (m_baseThickness <= 0) return false;
23 if (m_baseMaterial.empty()) return false;
24 if (m_coolThickness <= 0) return false;
25 if (m_coolWidth <= 0) return false;
26 if (m_coolMaterial.empty()) return false;
27 return true;
28 }
std::string m_baseMaterial
base plate material name
float m_coolThickness
cooling plate thickness
std::string m_coolMaterial
cooling plate material name
float m_coolWidth
cooling plate width
float m_baseThickness
base plate thickness

◆ isConsistent() [3/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 20 of file TOPGeoEndPlate.cc.

21 {
22 if (m_thickness <= 0) return false;
23 if (m_height <= 0) return false;
24 if (m_material.empty()) return false;
25 return true;
26 }
std::string m_material
material name
float m_thickness
thickness

◆ isConsistent() [4/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 20 of file TOPGeoFrontEnd.cc.

21 {
22 if (m_FBWidth <= 0) return false;
23 if (m_FBHeight <= 0) return false;
24 if (m_FBThickness <= 0) return false;
25 if (m_FBGap < 0) return false;
26 if (m_FBMaterial.empty()) return false;
27
28 if (m_HVWidth <= 0) return false;
29 if (m_HVLength <= 0) return false;
30 if (m_HVThickness <= 0) return false;
31 if (m_HVGap < 0) return false;
32 if (m_HVMaterial.empty()) return false;
33
34 if (m_BSWidth <= 0) return false;
35 if (m_BSHeight <= 0) return false;
36 if (m_BSLength <= 0) return false;
37 if (m_BSGap < 0) return false;
38 if (m_BSMaterial.empty()) return false;
39 if (m_spacerWidth <= 0) return false;
40 if (m_spacerMaterial.empty()) return false;
41
42 return true;
43 }
float m_HVGap
gap between HV board and front board
float m_FBGap
gap between front board and PMT array
float m_HVWidth
HV board width.
float m_BSHeight
board stack height
float m_HVLength
HV board length.
std::string m_BSMaterial
board stack material
float m_BSWidth
board stack width
float m_BSLength
board stack length
float m_spacerWidth
board stack spacer width
float m_FBThickness
front board thickness
std::string m_FBMaterial
front board material
std::string m_HVMaterial
HV board material.
float m_FBHeight
front board height
float m_BSGap
gap between board stack and front board
std::string m_spacerMaterial
board stack spacer material
float m_HVThickness
HV board thickness.
float m_FBWidth
front board width

◆ isConsistent() [5/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 46 of file TOPGeoHoneycombPanel.cc.

47 {
48 if (m_width <= 0) return false;
49 if (m_length <= 0) return false;
50 if (m_minThickness <= 0) return false;
51 if (m_maxThickness < m_minThickness) return false;
52 if (m_radius <= 0) return false;
53 if (m_edgeWidth <= 0) return false;
54 if (m_material.empty()) return false;
55 if (m_edgeMaterial.empty()) return false;
56 return true;
57 }
std::string m_material
material name
std::string m_edgeMaterial
material name of reinforced edge
float m_radius
radius of curved surface
float m_minThickness
minimal thickness
float m_maxThickness
maximal thickness
float m_edgeWidth
width of the reinforced edge

◆ isConsistent() [6/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 126 of file TOPGeometry.cc.

127 {
128 if (m_modules.empty()) return false;
129 for (const auto& module : m_modules) {
130 if (!module.isConsistent()) return false;
131 }
132 if (!m_frontEnd.isConsistent()) return false;
133 if (!m_QBB.isConsistent()) return false;
134 if (m_numBoardStacks == 0) return false;
135 if (!m_nominalQE.isConsistent()) return false;
136 if (!m_nominalTTS.isConsistent()) return false;
137 if (!m_nominalTDC.isConsistent()) return false;
138 if (!m_wavelengthFilter.isConsistent()) return false;
139 return true;
140 }
TOPGeoFrontEnd m_frontEnd
geometry parameters of front-end electronics
Definition: TOPGeometry.h:284
TOPGeoQBB m_QBB
geometry parameters of quartz bar box
Definition: TOPGeometry.h:285
TOPNominalQE m_nominalQE
nominal quantum efficiency of PMT
Definition: TOPGeometry.h:287
unsigned m_numBoardStacks
number of boardstacks per module
Definition: TOPGeometry.h:286
TOPNominalTDC m_nominalTDC
nominal time-to-digit conversion parameters
Definition: TOPGeometry.h:289
TOPWavelengthFilter m_wavelengthFilter
transmittance of wavelength filter
Definition: TOPGeometry.h:292
bool isConsistent() const override
Check for consistency of data members.

◆ isConsistent() [7/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBarSegment.

Definition at line 33 of file TOPGeoMirrorSegment.cc.

34 {
35 if (m_radius <= 0) return false;
36 if (m_coatingThickness <= 0) return false;
37 if (m_coatingMaterial.empty()) return false;
38 if (m_coatingSurface.getName().empty() and !m_coatingSurface.hasProperties()) return false;
39 if (!TOPGeoBarSegment::isConsistent()) return false;
40 return true;
41 }
float m_coatingThickness
reflective coating thickness
float m_radius
spherical mirror radius
std::string m_coatingMaterial
reflective coating material
GeoOpticalSurface m_coatingSurface
reflective coating optical surface

◆ isConsistent() [8/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 150 of file TOPGeoModule.cc.

151 {
152 if (m_moduleID <= 0) return false;
153 if (!m_bar1.isConsistent()) return false;
154 if (!m_bar2.isConsistent()) return false;
155 if (!m_mirror.isConsistent()) return false;
156 if (!m_prism.isConsistent()) return false;
157 if (!m_pmtArray.isConsistent()) return false;
158 return true;
159 }
int m_moduleID
module ID
Definition: TOPGeoModule.h:418
TOPGeoPMTArray m_pmtArray
geometry parameters of PMT array
Definition: TOPGeoModule.h:428
TOPGeoMirrorSegment m_mirror
mirror segment
Definition: TOPGeoModule.h:426
TOPGeoPrism m_prism
prism
Definition: TOPGeoModule.h:427
TOPGeoBarSegment m_bar2
bar segment 2 (backward bar)
Definition: TOPGeoModule.h:425
TOPGeoBarSegment m_bar1
bar segment 1 (forward bar)
Definition: TOPGeoModule.h:424

◆ isConsistent() [9/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 58 of file TOPGeoPMT.cc.

59 {
60 if (m_sizeX <= 0) return false;
61 if (m_sizeY <= 0) return false;
62 if (m_sizeZ <= 0) return false;
63 if (m_wallThickness <= 0) return false;
64
65 if (m_sensSizeX <= 0) return false;
66 if (m_sensSizeY <= 0) return false;
67 if (m_sensThickness <= 0) return false;
68 if (m_numColumns == 0) return false;
69 if (m_numRows == 0) return false;
70 if (m_sensMaterial.empty()) return false;
71
72 if (m_winThickness <= 0) return false;
73 if (m_winMaterial.empty()) return false;
74
75 if (m_botThickness <= 0) return false;
76 if (m_botMaterial.empty()) return false;
77
78 if (m_reflEdgeWidth <= 0) return false;
79 if (m_reflEdgeThickness <= 0) return false;
80
81 return true;
82 }
float m_wallThickness
side wall thickness
Definition: TOPGeoPMT.h:310
float m_sizeX
full size in x
Definition: TOPGeoPMT.h:307
float m_botThickness
bottom thickness
Definition: TOPGeoPMT.h:324
std::string m_winMaterial
window material
Definition: TOPGeoPMT.h:322
float m_sizeZ
full size in z
Definition: TOPGeoPMT.h:309
float m_sizeY
full size in y
Definition: TOPGeoPMT.h:308
float m_sensThickness
sensitive volume (photo-cathode) thickness
Definition: TOPGeoPMT.h:316
std::string m_botMaterial
bottom material
Definition: TOPGeoPMT.h:325
std::string m_sensMaterial
sensitive material
Definition: TOPGeoPMT.h:319
float m_reflEdgeWidth
reflective edge width
Definition: TOPGeoPMT.h:327
float m_reflEdgeThickness
reflective edge thickness
Definition: TOPGeoPMT.h:328
float m_winThickness
window thickness
Definition: TOPGeoPMT.h:321

◆ isConsistent() [10/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 93 of file TOPGeoPMTArray.cc.

94 {
95 if (m_numRows == 0) return false;
96 if (m_numColumns == 0) return false;
97 if (m_dx <= 0) return false;
98 if (m_dy <= 0) return false;
99 if (m_material.empty()) return false;
100 if (!m_pmt.isConsistent()) return false;
101 if (m_cookieThickness <= 0) return false;
102 if (m_cookieMaterial.empty()) return false;
103 if (m_filterThickness <= 0) return false;
104 if (m_filterMaterial.empty()) return false;
105 return true;
106 }
std::string m_cookieMaterial
silicone cookie material
std::string m_material
material name into which PMT's are inserted
float m_dy
spacing in y
std::string m_filterMaterial
wavelength filter material
float m_dx
spacing in x
float m_filterThickness
wavelength filter thickness
float m_cookieThickness
silicone cookie thickness

◆ isConsistent() [11/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBarSegment.

Definition at line 36 of file TOPGeoPrism.cc.

37 {
38 if (m_exitThickness <= 0) return false;
39 if (m_flatLength < 0) return false;
40 if (m_width <= 0) return false;
41 if (m_thickness <= 0) return false;
42 if (m_length <= 0) return false;
43 if (m_material.empty()) return false;
44 if (m_surface.getName().empty() and !m_surface.hasProperties()) return false;
45 if (m_sigmaAlpha < 0) return false;
46 if (m_brokenFraction > 0 and m_brokenGlueMaterial.empty()) return false;
47 if (!m_peelOffRegions.empty()) {
48 if (m_peelOffSize <= 0) return false;
49 if (m_peelOffThickness <= 0) return false;
50 if (m_peelOffMaterial.empty()) return false;
51 double halfSize = (getWidth() - getPeelOffSize()) / 2;
52 for (const auto& region : m_peelOffRegions) {
53 if (fabs(getPeelOffCenter(region)) > halfSize) return false;
54 }
55 }
56 return true;
57 }
float m_flatLength
length of the flat part at the bottom
Definition: TOPGeoPrism.h:278
float m_peelOffThickness
thickness of peel-off volume
Definition: TOPGeoPrism.h:282
float m_peelOffSize
size in x of peel-off volume
Definition: TOPGeoPrism.h:280
std::string m_peelOffMaterial
material name of peel-off volume
Definition: TOPGeoPrism.h:283
float m_exitThickness
thickness at PMT side
Definition: TOPGeoPrism.h:277

◆ isConsistent() [12/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 21 of file TOPGeoPrismEnclosure.cc.

22 {
23 if (m_length <= 0) return false;
24 if (m_height <= 0) return false;
25 if (m_bottomThickness <= 0) return false;
26 if (m_sideThickness <= 0) return false;
27 if (m_backThickness <= 0) return false;
28 if (m_frontThickness <= 0) return false;
29 if (m_extensionThickness <= 0) return false;
30 if (m_material.empty()) return false;
31 return true;
32 }
std::string m_material
material name
float m_extensionThickness
extension plate thickness
float m_backThickness
back wall thickness
float m_frontThickness
front wall thickness
float m_bottomThickness
bottom thickness
float m_height
height up to the side rails
float m_sideThickness
side wall thickness

◆ isConsistent() [13/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 230 of file TOPGeoQBB.cc.

231 {
232 if (m_width <= 0) return false;
233 if (m_length <= 0) return false;
234 if (m_prismPosition <= 0) return false;
235 if (m_material.empty()) return false;
236 if (!m_innerPanel.isConsistent()) return false;
237 if (!m_outerPanel.isConsistent()) return false;
238 if (!m_sideRails.isConsistent()) return false;
239 if (!m_prismEnclosure.isConsistent()) return false;
240 if (!m_endPlate.isConsistent()) return false;
241 if (!m_coldPlate.isConsistent()) return false;
242 return true;
243 }
std::string m_material
material inside QBB
Definition: TOPGeoQBB.h:270
float m_prismPosition
position of prism-bar joint wrt QBB back
Definition: TOPGeoQBB.h:269
TOPGeoEndPlate m_endPlate
forward end plate
Definition: TOPGeoQBB.h:275
TOPGeoColdPlate m_coldPlate
cold plate
Definition: TOPGeoQBB.h:276
float m_length
full length
Definition: TOPGeoQBB.h:268
float m_width
full width
Definition: TOPGeoQBB.h:267

◆ isConsistent() [14/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 20 of file TOPGeoSideRails.cc.

21 {
22 if (m_thickness <= 0) return false;
23 if (m_reducedThickness <= 0) return false;
24 if (m_height <= 0) return false;
25 if (m_material.empty()) return false;
26 return true;
27 }
std::string m_material
material name
float m_reducedThickness
thickness at prism enclosure
float m_thickness
thickness

◆ isConsistent() [15/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 58 of file TOPNominalQE.cc.

59 {
60 if (m_lambdaFirst <= 0) return false;
61 if (m_lambdaStep <= 0) return false;
62 if (m_CE <= 0) return false;
63 if (m_QE.empty()) return false;
64 return true;
65 }
float m_CE
collection efficiency
Definition: TOPNominalQE.h:167

◆ isConsistent() [16/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 84 of file TOPNominalTDC.cc.

85 {
86 if (m_pileupTime < 0) return false;
87 if (m_doubleHitResolution < 0) return false;
88 if (m_timeJitter < 0) return false;
89 if (m_efficiency <= 0 or m_efficiency > 1) return false;
90 return true;
91 }
float m_pileupTime
pile-up time
float m_doubleHitResolution
double hit resolution time
float m_timeJitter
r.m.s.

◆ isConsistent() [17/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 60 of file TOPNominalTTS.cc.

61 {
62 if (m_tts.empty()) return false;
63 if (!m_normalized) return false;
64 return true;
65 }

◆ isConsistent() [18/18]

bool isConsistent ( ) const
overridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from TOPGeoBase.

Definition at line 34 of file TOPWavelengthFilter.cc.

35 {
36 if (getName().empty()) return true; // old payload from DB (filter included in QE)
37
38 if (m_lambdaFirst <= 0) return false;
39 if (m_lambdaStep <= 0) return false;
40 if (m_transmittances.empty()) return false;
41 return true;
42 }
const std::string & getName() const
Returns object name.
Definition: TOPGeoBase.h:51

◆ isDefault() [1/4]

bool isDefault ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if default (not calibrated)

Definition at line 246 of file TOPCalModuleAlignment.cc.

247 {
248 unsigned module = moduleID - 1;
249 if (module >= c_numModules) return false ;
250 return m_status[module] == c_Default;
251 }
@ c_Default
uncalibrated default value

◆ isDefault() [2/4]

bool isDefault ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if default (not calibrated)

Definition at line 93 of file TOPCalModuleT0.cc.

94 {
95 unsigned module = moduleID - 1;
96 if (module >= c_numModules) return false;
97 return m_status[module] == c_Default;
98 }
@ c_Default
uncalibrated default value

◆ isDefault() [3/4]

bool isDefault ( int  moduleID,
unsigned  asic 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)
Returns
true, if default (not calibrated)

Definition at line 75 of file TOPCalAsicShift.cc.

76 {
77 unsigned module = moduleID - 1;
78 if (module >= c_numModules) return false;
79 if (asic >= c_numAsics) return false;
80 return m_status[module][asic] == c_Default;
81 }
@ c_Default
uncalibrated default value

◆ isDefault() [4/4]

bool isDefault ( int  moduleID,
unsigned  channel 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if default (not calibrated)

Definition at line 112 of file TOPCalChannelT0.cc.

113 {
114 unsigned module = moduleID - 1;
115 if (module >= c_numModules) return false;
116 if (channel >= c_numChannels) return false;
117 return m_status[module][channel] == c_Default;
118 }
@ c_Default
uncalibrated default value

◆ isModuleIDValid()

bool isModuleIDValid ( int  moduleID) const

Checks if module exists in m_modules.

Parameters
moduleIDmodule ID (1-based)
Returns
true if exists

Definition at line 33 of file TOPGeometry.cc.

34 {
35 for (const auto& module : m_modules) {
36 if (module.getModuleID() == moduleID) return true;
37 }
38 return false;
39 }

◆ isPMTDecoupled()

bool isPMTDecoupled ( unsigned  pmtID) const

Checks if PMT is optically decoupled.

Returns
true if decoupled

Definition at line 84 of file TOPGeoPMTArray.cc.

85 {
86 for (const auto& pmt : m_decoupledPMTs) {
87 if (pmtID == pmt) return true;
88 }
89 return false;
90 }
std::vector< unsigned > m_decoupledPMTs
ID's of decoupled PMT's.

◆ isSampleValid()

bool isSampleValid ( int  sample) const

Check for the validity of sample number.

Parameters
samplesample number
Returns
true if sample number is valid

Definition at line 77 of file TOPNominalTDC.cc.

78 {
79 if (sample < 0) return false;
80 if (sample >= (int) m_numWindows * c_WindowSize) return false;
81 return true;
82 }
@ c_WindowSize
number of samples per ASIC window
Definition: TOPNominalTDC.h:28
unsigned m_numWindows
number of ASIC windows per waveform

◆ isUnusable() [1/4]

bool isUnusable ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if bad calibrated

Definition at line 253 of file TOPCalModuleAlignment.cc.

254 {
255 unsigned module = moduleID - 1;
256 if (module >= c_numModules) return false ;
257 return m_status[module] == c_Unusable;
258 }

◆ isUnusable() [2/4]

bool isUnusable ( int  moduleID) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
Returns
true, if bad calibrated

Definition at line 101 of file TOPCalModuleT0.cc.

102 {
103 unsigned module = moduleID - 1;
104 if (module >= c_numModules) return false;
105 return m_status[module] == c_Unusable;
106 }
@ c_Unusable
bad calibrated value

◆ isUnusable() [3/4]

bool isUnusable ( int  moduleID,
unsigned  asic 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)
Returns
true, if bad calibrated

Definition at line 84 of file TOPCalAsicShift.cc.

85 {
86 unsigned module = moduleID - 1;
87 if (module >= c_numModules) return false;
88 if (asic >= c_numAsics) return false;
89 return m_status[module][asic] == c_Unusable;
90 }
@ c_Unusable
bad calibrated value

◆ isUnusable() [4/4]

bool isUnusable ( int  moduleID,
unsigned  channel 
) const

Returns calibration status.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
Returns
true, if bad calibrated

Definition at line 121 of file TOPCalChannelT0.cc.

122 {
123 unsigned module = moduleID - 1;
124 if (module >= c_numModules) return false;
125 if (channel >= c_numChannels) return false;
126 return m_status[module][channel] == c_Unusable;
127 }
@ c_Unusable
bad calibrated value

◆ momentumGlobalToNominal()

XYZVector momentumGlobalToNominal ( const ROOT::Math::XYZVector &  momentum) const

Transforms momentum vector from Belle II to module nominal frame.

Parameters
momentummomentum vector in Belle II frame
Returns
momentum vector in module nominal frame

Definition at line 143 of file TOPGeoModule.cc.

144 {
146 return m_transformNominal->ApplyInverse(momentum);
147 }
ROOT::Math::Transform3D * m_transformNominal
do not write out
Definition: TOPGeoModule.h:435
void setTransformation() const
Sets transformation cache.
Definition: TOPGeoModule.cc:64

◆ momentumNominalToGlobal()

XYZVector momentumNominalToGlobal ( const ROOT::Math::XYZVector &  momentum) const

Transforms momentum vector from module nominal frame to Belle II frame.

Parameters
momentummomentum vector in module nominal frame
Returns
momentum vector in Belle II frame

Definition at line 131 of file TOPGeoModule.cc.

132 {
134 return *m_transformNominal * momentum;
135 }

◆ momentumToGlobal()

XYZVector momentumToGlobal ( const ROOT::Math::XYZVector &  momentum) const

Transforms momentum vector from module internal (= nominal & displaced) frame to Belle II frame.

Parameters
momentummomentum vector in module internal frame
Returns
momentum vector in Belle II frame

Definition at line 107 of file TOPGeoModule.cc.

108 {
110 return *m_transform * momentum;
111 }
ROOT::Math::Transform3D * m_transform
cache for transformation from internal (= nominal & displaced) to Belle II frame
Definition: TOPGeoModule.h:433

◆ momentumToLocal()

XYZVector momentumToLocal ( const ROOT::Math::XYZVector &  momentum) const

Transforms momentum vector from Belle II to module internal (= nominal & displaced) frame.

Parameters
momentummomentum vector in Belle II frame
Returns
momentum vector in module internal frame

Definition at line 119 of file TOPGeoModule.cc.

120 {
122 return m_transform->ApplyInverse(momentum);
123 }

◆ normalize()

double normalize ( )

Normalize the distribution (fractions)

Returns
value used to normalize fractions

Definition at line 36 of file TOPNominalTTS.cc.

37 {
38 float sum = 0;
39 for (const auto& tts : m_tts) sum += tts.fraction;
40 if (sum == 0) return 0;
41 for (auto& tts : m_tts) tts.fraction /= sum;
42 m_normalized = true;
43 return sum;
44 }

◆ operator=()

TOPGeoModule & operator= ( const TOPGeoModule module)

Assignment operator.

Definition at line 33 of file TOPGeoModule.cc.

34 {
35 if (this != &module) {
36 TOPGeoBase::operator=(module);
37 m_moduleID = module.getModuleID();
38 m_radius = module.getRadius();
39 m_phi = module.getPhi();
40 m_backwardZ = module.getBackwardZ();
41 m_moduleCNumber = module.getModuleCNumber();
42 m_bar1 = module.getBarSegment1();
43 m_bar2 = module.getBarSegment2();
44 m_mirror = module.getMirrorSegment();
45 m_prism = module.getPrism();
46 m_pmtArray = module.getPMTArray();
47 m_arrayDisplacement = module.getPMTArrayDisplacement();
48 m_moduleDisplacement = module.getModuleDisplacement();
49
50 if (m_transform) delete m_transform;
52 m_transform = 0;
54 }
55 return *this;
56 }
TOPGeoPMTArrayDisplacement m_arrayDisplacement
PMT array displacement.
Definition: TOPGeoModule.h:429
float m_backwardZ
z position of prism-bar joint in Belle II frame
Definition: TOPGeoModule.h:421
float m_phi
azimuthal angle in Belle II frame
Definition: TOPGeoModule.h:420
float m_radius
radius of bar central plane in Belle II frame
Definition: TOPGeoModule.h:419
TOPGeoModuleDisplacement m_moduleDisplacement
module displacement
Definition: TOPGeoModule.h:430
unsigned m_moduleCNumber
module construction number, 0 = ideal module
Definition: TOPGeoModule.h:423

◆ pointGlobalToNominal()

XYZPoint pointGlobalToNominal ( const ROOT::Math::XYZPoint &  point) const

Transforms 3D point from Belle II to module nominal frame.

Parameters
point3D point in Belle II frame (basf2 units!)
Returns
3D point in module nominal frame (basf2 units!)

Definition at line 137 of file TOPGeoModule.cc.

138 {
140 return m_transformNominal->ApplyInverse(point);
141 }

◆ pointNominalToGlobal()

XYZPoint pointNominalToGlobal ( const ROOT::Math::XYZPoint &  point) const

Transforms 3D point from module nominal frame to Belle II frame.

Parameters
point3D point in module nominal frame (basf2 units!)
Returns
3D point in Belle II frame (basf2 units!)

Definition at line 125 of file TOPGeoModule.cc.

126 {
128 return *m_transformNominal * point;
129 }

◆ pointToGlobal()

XYZPoint pointToGlobal ( const ROOT::Math::XYZPoint &  point) const

Transforms 3D point from module internal (= nominal & displaced) frame to Belle II frame.

Parameters
point3D point in module internal frame (basf2 units!)
Returns
3D point in Belle II frame (basf2 units!)

Definition at line 101 of file TOPGeoModule.cc.

102 {
104 return *m_transform * point;
105 }

◆ pointToLocal()

XYZPoint pointToLocal ( const ROOT::Math::XYZPoint &  point) const

Transforms 3D point from Belle II to module internal (= nominal & displaced) frame.

Parameters
point3D point in Belle II frame (basf2 units!)
Returns
3D point in module internal frame (basf2 units!)

Definition at line 113 of file TOPGeoModule.cc.

114 {
116 return m_transform->ApplyInverse(point);
117 }

◆ print() [1/22]

void print ( ) const

Print the class content.

Definition at line 21 of file TOPPmtGainPar.cc.

22 {
23 cout << "PMT gain parameters:" << endl;
24 cout << " Serial number: " << getSerialNumber() << endl;
25 cout << " Nominal HV: " << getNominalHV() << " V" << endl;
26 for (unsigned channel = 1; channel <= c_NumPmtPixels; channel++) {
27 cout << setw(4) << channel;
28 cout << setw(12) << getConstant(channel);
29 cout << setw(12) << getSlope(channel);
30 cout << setw(12) << getRatio(channel);
31 cout << setw(12) << getGain0(channel, getNominalHV());
32 cout << endl;
33 }
34 cout << endl;
35 }
double getSlope(unsigned pmtPixel) const
Returns slope of the gain vs HV fitting function.
Definition: TOPPmtGainPar.h:95
double getRatio(unsigned pmtPixel) const
Returns ratio of gains between 1.5T and 0T.
double getConstant(unsigned pmtPixel) const
Returns constant of the gain vs HV fitting function.
Definition: TOPPmtGainPar.h:83
float getNominalHV() const
Returns nominal HV (corresponding to a gain of 5x10^5 at B = 1.5T)
double getGain0(unsigned pmtPixel, double HV) const
Returns pmtPixel gain at B = 0 for a given high voltage.
const std::string & getSerialNumber() const
Returns PMT serial number.
Definition: TOPPmtGainPar.h:76

◆ print() [2/22]

void print ( const std::string &  title) const
virtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented in TOPGeoBarSegment, TOPGeoFrontEnd, TOPGeoPMT, TOPGeoMirrorSegment, TOPGeoModuleDisplacement, TOPGeoModule, TOPNominalQE, TOPNominalTDC, TOPNominalTTS, TOPGeoPMTArrayDisplacement, TOPGeoPMTArray, TOPGeoPrism, TOPGeoColdPlate, TOPGeoEndPlate, TOPGeoQBB, TOPGeoHoneycombPanel, TOPGeoPrismEnclosure, TOPGeoSideRails, TOPGeometry, and TOPWavelengthFilter.

Definition at line 28 of file TOPGeoBase.cc.

29 {
30 cout << title << ":" << endl;
31 cout << " name: " << m_name << endl;
32 }
std::string m_name
geometry object name
Definition: TOPGeoBase.h:89

◆ print() [3/22]

void print ( const std::string &  title = "Bar segment geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Reimplemented in TOPGeoMirrorSegment, and TOPGeoPrism.

Definition at line 38 of file TOPGeoBarSegment.cc.

39 {
40 TOPGeoBase::print(title);
41 cout << " Vendor: " << getVendor() << ", serial number: " << getSerialNumber() << endl;
42 cout << " Dimensions: " << getWidth() << " X " << getThickness() << " X " << getLength()
43 << " " << s_unitName << endl;
44 cout << " Material: " << getMaterial() << endl;
45 cout << " Glue: " << getGlueMaterial() << ", thickness = " << getGlueThickness()
46 << " " << s_unitName;
47 cout << ", broken fraction = " << getBrokenGlueFraction();
48 if (getBrokenGlueFraction() > 0) {
49 cout << ", angle = " << getBrokenGlueAngle() / Unit::deg << " deg";
50 cout << ", material = " << getBrokenGlueMaterial();
51 }
52 cout << endl;
54 cout << " - sigmaAlpha: " << getSigmaAlpha() << endl;
55 }
double getBrokenGlueAngle() const
Returns angle of the delaminated surface.
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
double getBrokenGlueFraction() const
Returns fraction of the delaminated surface.
const std::string & getMaterial() const
Returns bar segment material name.
const std::string & getVendor() const
Returns vendor's name.
double getLength() const
Returns bar segment length.
virtual double getGlueThickness() const
Returns glue thickness (glue on -z side)
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
const std::string & getSerialNumber() const
Returns serial number.
static const double deg
degree to radians
Definition: Unit.h:109
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
Definition: TOPGeoBase.cc:44
virtual void print(const std::string &title) const
Print the content of the class.
Definition: TOPGeoBase.cc:28
static std::string s_unitName
conversion unit name
Definition: TOPGeoBase.h:87

◆ print() [4/22]

void print ( const std::string &  title = "Front-end geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 46 of file TOPGeoFrontEnd.cc.

47 {
49
50 cout << " Front board: " << getFrontBoardWidth() << " X " <<
52 cout << ", gap = " << getFrontBoardGap() << " " << s_unitName;
53 cout << ", y = " << getFrontBoardY() << " " << s_unitName;
54 cout << ", material = " << getFrontBoardMaterial() << endl;
55
56 cout << " HV board: " << getHVBoardWidth() << " X " <<
57 getHVBoardLength() << " X " << getHVBoardThickness() << " " << s_unitName;
58 cout << ", gap = " << getHVBoardGap() << " " << s_unitName;
59 cout << ", y = " << getHVBoardY() << " " << s_unitName;
60 cout << ", material = " << getHVBoardMaterial() << endl;
61
62 cout << " Board stack: " << getBoardStackWidth() << " X " <<
63 getBoardStackHeight() << " X " << getBoardStackLength() << " " << s_unitName;
64 cout << ", gap = " << getBoardStackGap() << " " << s_unitName;
65 cout << ", y = " << getBoardStackY() << " " << s_unitName;
66 cout << ", material = " << getBoardStackMaterial() << endl;
67
68 cout << " spacers: width = " << getSpacerWidth() << " " << s_unitName;
69 cout << ", material = " << getSpacerMaterial() << endl;
70
71 }
double getHVBoardGap() const
Returns gap between HV board and front board.
const std::string & getHVBoardMaterial() const
Returns HV board material.
double getFrontBoardGap() const
Returns gap between front board and PMT array.
double getHVBoardThickness() const
Returns HV board thickness.
double getFrontBoardThickness() const
Returns front board thickness.
double getHVBoardLength() const
Returns HV board length.
const std::string & getBoardStackMaterial() const
Returns board stack material.
double getBoardStackLength() const
Returns board stack length.
double getBoardStackY() const
Returns position of board stack center in bar frame.
double getBoardStackWidth() const
Returns board stack width.
double getFrontBoardWidth() const
Returns front board width.
const std::string & getFrontBoardMaterial() const
Returns front board material.
double getBoardStackHeight() const
Returns board stack height.
double getBoardStackGap() const
Returns gap between board stack and front board.
double getHVBoardY() const
Returns position of HV board center in bar frame.
double getHVBoardWidth() const
Returns HV board width.
double getFrontBoardY() const
Returns position of front board center in bar frame.
double getFrontBoardHeight() const
Returns front board height.
const std::string & getSpacerMaterial() const
Returns board stack spacer material.
double getSpacerWidth() const
Returns board stack spacer width.
void printUnderlined(const std::string &title) const
Print the content of the class.
Definition: TOPGeoBase.cc:35

◆ print() [5/22]

void print ( const std::string &  title = "MCP-PMT geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 85 of file TOPGeoPMT.cc.

86 {
87 TOPGeoBase::print(title);
88
89 cout << " outer dimensions: " << getSizeX() << " X " << getSizeY()
90 << " X " << getSizeZ() << " " << s_unitName << endl;
91 cout << " wall thickness: " << getWallThickness() << " " << s_unitName << endl;
92 cout << " window thickness: " << getWinThickness() << " " << s_unitName << endl;
93 cout << " bottom thickness: " << getBotThickness() << " " << s_unitName << endl;
94 cout << " sensitive area: " << getSensSizeX() << " X " << getSensSizeY()
95 << " " << s_unitName;
96 cout << ", thickness: " << getSensThickness() << " " << s_unitName << endl;
97 cout << " number of pixels: " << getNumColumns() << " X " << getNumRows() << endl;
98 cout << " casing material: " << getWallMaterial() << endl;
99 cout << " inner material: " << getFillMaterial() << endl;
100 cout << " window material: " << getWinMaterial() << endl;
101 cout << " bottom material: " << getBotMaterial() << endl;
102 cout << " sensitive material: " << getSensMaterial() << endl;
103 cout << " reflective edge: " << endl;
104 cout << " - width: " << getReflEdgeWidth() << " " << s_unitName;
105 cout << ", thickness: " << getReflEdgeThickness() << " " << s_unitName << endl;
106
108 }
double getSizeZ() const
Returns full size in z.
Definition: TOPGeoPMT.h:141
double getReflEdgeThickness() const
Returns reflective edge thickness.
Definition: TOPGeoPMT.h:237
const std::string & getSensMaterial() const
Returns sensitive material name.
Definition: TOPGeoPMT.h:201
double getWinThickness() const
Returns entrance window thickness.
Definition: TOPGeoPMT.h:207
double getBotThickness() const
Returns bottom thickness.
Definition: TOPGeoPMT.h:219
GeoOpticalSurface m_reflEdgeSurface
reflective edge optical surface
Definition: TOPGeoPMT.h:329
const std::string & getWallMaterial() const
Returns wall (casing) material name.
Definition: TOPGeoPMT.h:153
double getReflEdgeWidth() const
Returns reflective edge width.
Definition: TOPGeoPMT.h:231
const std::string & getFillMaterial() const
Returns fill (inside) material name.
Definition: TOPGeoPMT.h:159
double getSensSizeX() const
Returns sensitive volume (photo-cathode) size in x.
Definition: TOPGeoPMT.h:165
double getSizeX() const
Returns full size in x.
Definition: TOPGeoPMT.h:129
double getSizeY() const
Returns full size in y.
Definition: TOPGeoPMT.h:135
double getWallThickness() const
Returns wall thickness.
Definition: TOPGeoPMT.h:147
double getSensThickness() const
Returns sensitive volume (photo-cathode) thickness.
Definition: TOPGeoPMT.h:177
const std::string & getWinMaterial() const
Returns entrance window material name.
Definition: TOPGeoPMT.h:213
const std::string & getBotMaterial() const
Returns bottom material name.
Definition: TOPGeoPMT.h:225
double getSensSizeY() const
Returns sensitive volume (photo-cathode) size in y.
Definition: TOPGeoPMT.h:171

◆ print() [6/22]

void print ( const std::string &  title = "Mirror segment geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBarSegment.

Definition at line 44 of file TOPGeoMirrorSegment.cc.

45 {
47 cout << " Radius of curvature: " << getRadius() << " " << s_unitName << endl;
48 cout << " Center of curvature: (" << getXc() << ", " << getYc()
49 << ") " << s_unitName << endl;
50 cout << " Reflective coating: " << getCoatingMaterial() << ", thickness: " <<
51 getCoatingThickness() << " " << s_unitName << endl;
53
54 }
double getCoatingThickness() const
Returns reflective coating thickness.
const std::string & getCoatingMaterial() const
Returns reflective coating material.
double getRadius() const
Returns spherical mirror radius of curvature.
virtual void print(const std::string &title="Bar segment geometry parameters") const override
Print the content of the class.

◆ print() [7/22]

void print ( const std::string &  title = "Module displacement parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 25 of file TOPGeoModuleDisplacement.cc.

26 {
27 TOPGeoBase::print(title);
28 cout << " translation vector: (" << getX() << ", "
29 << getY() << ", " << getZ() << ")" << " " << s_unitName << endl;
30 cout << " rotation angles: ";
31 cout << getAlpha() << " ";
32 cout << getBeta() << " ";
33 cout << getGamma() << " ";
34 cout << endl;
35 }
double getGamma() const
Returns rotation angle around z.
double getX() const
Returns translation in x.
double getAlpha() const
Returns rotation angle around x.
double getZ() const
Returns translation in z.
double getY() const
Returns translation in y.
double getBeta() const
Returns rotation angle around y.

◆ print() [8/22]

void print ( const std::string &  title = "Module geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 162 of file TOPGeoModule.cc.

163 {
164 cout << "Slot " << getModuleID() << " geometry parameters:" << endl;
165 cout << "---------------------------" << endl;
166 cout << " name: " << m_name << endl;
167 cout << " moduleID = " << getModuleID();
168 cout << ", radius = " << getRadius() << " " << s_unitName;
169 cout << ", phi = " << getPhi() / Unit::deg << " deg";
170 cout << ", backward z = " << getBackwardZ() << " " << s_unitName;
171 cout << ", construction number = " << getModuleCNumber() << endl;
172 cout << endl;
173
174 m_prism.print();
175 cout << endl;
176 m_bar2.print("Bar segment 2 (backward) geometry parameters");
177 cout << endl;
178 m_bar1.print("Bar segment 1 (forward) geometry parameters");
179 cout << endl;
180 m_mirror.print();
181 cout << endl;
183 cout << endl;
185 cout << endl;
187 cout << endl;
188
189 }
unsigned getModuleCNumber() const
Returns module construction number (0 = ideal module)
Definition: TOPGeoModule.h:194
double getPhi() const
Returns module azimuthal angle in Belle II frame.
Definition: TOPGeoModule.h:182
int getModuleID() const
Returns module ID.
Definition: TOPGeoModule.h:170
double getRadius() const
Returns radius of the bar central plane in Belle II frame.
Definition: TOPGeoModule.h:176
double getBackwardZ() const
Returns the z position of prism-bar joint in Belle II frame.
Definition: TOPGeoModule.h:188
void print(const std::string &title="PMT array geometry parameters") const override
Print the content of the class.
void print(const std::string &title="Module displacement parameters") const override
Print the content of the class.
void print(const std::string &title="PMT array displacement parameters") const override
Print the content of the class.
void print(const std::string &title="Prism geometry parameters") const override
Print the content of the class.
Definition: TOPGeoPrism.cc:60
void print(const std::string &title="Mirror segment geometry parameters") const override
Print the content of the class.

◆ print() [9/22]

void print ( const std::string &  title = "Nominal quantum efficiency") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 68 of file TOPNominalQE.cc.

69 {
71 cout << " first point: " << getLambdaFirst() << " nm";
72 cout << ", step: " << getLambdaStep() << " nm";
73 cout << ", CE: " << getCE() << endl;
74 cout << " QE: [";
75 for (const auto& qe : m_QE) cout << qe << ", ";
76 cout << "]" << endl;
77 }
double getLambdaStep() const
Returns wavelenght step.
Definition: TOPNominalQE.h:130
double getCE() const
Returns collection efficiency.
Definition: TOPNominalQE.h:148
double getLambdaFirst() const
Returns wavelenght of the first data point.
Definition: TOPNominalQE.h:115

◆ print() [10/22]

void print ( const std::string &  title = "Nominal time-to-digit conversion parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 93 of file TOPNominalTDC.cc.

94 {
96 cout << " range: [" << getTimeMin() << ", " << getTimeMax() << "] ns" << endl;
97 cout << " offset: " << getOffset() << " ns" << endl;
98 cout << " number of bits: " << getNumBits() << endl;
99 cout << " bin width: " << getBinWidth() / Unit::ps << " ps" << endl;
100 cout << " number of ASIC windows: " << getNumWindows() << endl;
101 cout << " number of bits per sample: " << getSubBits() << endl;
102 cout << " synchonization time base: " << getSyncTimeBase() << " ns" << endl;
103 cout << " pile-up time: " << getPileupTime() << " ns" << endl;
104 cout << " double hit resolution: " << getDoubleHitResolution() << " ns" << endl;
105 cout << " r.m.s. of time jitter: " << getTimeJitter() / Unit::ps << " ps" << endl;
106 cout << " electronic efficiency: " << getEfficiency() << endl;
107 }
double getTimeJitter() const
Returns r.m.s.
double getPileupTime() const
Returns pile-up time.
double getTimeMin() const
Returns time range lower limit.
double getTimeMax() const
Returns time range upper limit.
double getOffset() const
Returns time offset.
double getDoubleHitResolution() const
Returns double hit resolution time.
double getEfficiency() const
Returns electronic efficiency.
unsigned getSubBits() const
Returns number of bits per sample.
double getBinWidth() const
Returns time width of a TDC bin.
unsigned getNumWindows() const
Returns number of ASIC windows per waveform.
unsigned getNumBits() const
Returns number of bits.
static const double ps
[picosecond]
Definition: Unit.h:98

◆ print() [11/22]

void print ( const std::string &  title = "Nominal TTS distribution") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 68 of file TOPNominalTTS.cc.

69 {
71 if (m_tts.empty()) {
72 cout << " -> vector is empty!" << endl;
73 return;
74 }
75 cout << " PMT type: " << m_type << endl;
76
77 int i = 0;
78 for (const auto& tts : m_tts) {
79 i++;
80 cout << " Gaussian " << i << ": ";
81 cout << tts.fraction << ", ";
82 cout << tts.position << " ns, ";
83 cout << tts.sigma << " ns" << endl;
84 }
85 if (!m_normalized) cout << " warning: fractions not normalized" << endl;
86 }
unsigned m_type
PMT type (see TOPPmtObsoleteData::EType)

◆ print() [12/22]

void print ( const std::string &  title = "PMT array displacement parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 20 of file TOPGeoPMTArrayDisplacement.cc.

21 {
22 TOPGeoBase::print(title);
23 cout << " translation vector: (" << getX() << ", " << getY() << ")"
24 << " " << s_unitName << endl;
25 cout << " rotation angle: " << m_alpha << endl;
26 }
double getX() const
Returns translation in x.
double getY() const
Returns translation in y.

◆ print() [13/22]

void print ( const std::string &  title = "PMT array geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 108 of file TOPGeoPMTArray.cc.

109 {
110 TOPGeoBase::print(title);
111 cout << " size: " << getNumColumns() << " X " << getNumRows();
112 cout << ", dimensions: " << getSizeX() << " X " << getSizeY() << " X " << getSizeZ();
113 cout << " " << s_unitName << endl;
114 cout << " cell: " << getDx() << " X " << getDy() << " " << s_unitName << endl;
115 cout << " material: " << getMaterial() << endl;
116 if (m_cookieThickness > 0) { // new version of payload
117 cout << " silicone cookies: thickness = " << getCookieThickness() << " "
118 << s_unitName << ", material = " << getCookieMaterial() << endl;
119 cout << " wavelength filter: thickness = " << getFilterThickness() << " "
120 << s_unitName << ", material = " << getFilterMaterial() << endl;
121 }
122 cout << " air gap (decoupled PMT's): " << getAirGap() << " " << s_unitName << endl;
123 cout << " optically decoupled PMT's:";
124 if (m_decoupledPMTs.empty()) {
125 cout << " None";
126 } else {
127 for (const auto& pmt : m_decoupledPMTs) cout << " " << pmt;
128 }
129 cout << endl;
130 cout << endl;
131 m_pmt.print();
132 }
const std::string & getCookieMaterial() const
Returns silicone cookie material.
double getSizeZ() const
Returns array volume dimension in z.
unsigned getNumColumns() const
Returns number of array columns.
double getDx() const
Returns spacing in x (column width)
double getFilterThickness() const
Returns wavelength filter thickness.
double getDy() const
Returns spacing in y (row height)
double getSizeX() const
Returns array volume dimension in x.
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
double getSizeY() const
Returns array volume dimension in y.
const std::string & getMaterial() const
Returns material name into which PMT's are inserted.
unsigned getNumRows() const
Returns number of array rows.
double getCookieThickness() const
Returns silicone cookie thickness.
double getAirGap() const
Returns air gap.
void print(const std::string &title="MCP-PMT geometry parameters") const override
Print the content of the class.
Definition: TOPGeoPMT.cc:85

◆ print() [14/22]

void print ( const std::string &  title = "Prism geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBarSegment.

Definition at line 60 of file TOPGeoPrism.cc.

61 {
62 TOPGeoBase::print(title);
63 cout << " Vendor: " << getVendor() << ", serial number: " << getSerialNumber() << endl;
64 cout << " Dimensions: " << getWidth() << " X " << getThickness() << " X " << getLength()
65 << " " << s_unitName << endl;
66 cout << " Exit window dimensions: " << getWidth() << " X "
67 << getExitThickness() << " " << s_unitName << endl;
68 cout << " Prism angle: " << getAngle() / Unit::deg << " deg";
69 cout << ", flat surface length: " << getFlatLength() << " " << s_unitName << endl;
70 cout << " Material: " << getMaterial() << endl;
71 if (getFilterThickness() > 0) { // old payload
72 cout << " Wavelenght filter: " << getFilterMaterial()
73 << ", thickness: " << getFilterThickness() << " " << s_unitName << endl;
74 }
75 if (!m_peelOffRegions.empty()) {
76 cout << " Peel-off cookie regions: ";
77 cout << " size = " << getPeelOffSize() << " " << s_unitName;
78 cout << " thickness = " << getPeelOffThickness() << " " << s_unitName;
79 cout << " material = " << getPeelOffMaterial() << endl;
80 for (const auto& region : m_peelOffRegions) {
81 cout << " ID = " << region.ID << ", fraction = " << region.fraction
82 << ", angle = " << region.angle / Unit::deg << " deg"
83 << ", xc = " << getPeelOffCenter(region) << " " << s_unitName << endl;
84 }
85 } else {
86 cout << " Peel-off regions: None" << endl;
87 }
89 cout << " - sigmaAlpha: " << getSigmaAlpha() << endl;
90
91 }
const std::string & getPeelOffMaterial() const
Returns peel-off material.
Definition: TOPGeoPrism.h:185
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
Definition: TOPGeoPrism.h:154
double getAngle() const
Returns prism angle.
Definition: TOPGeoPrism.h:144
double getPeelOffThickness() const
Returns peel-off thickness.
Definition: TOPGeoPrism.h:179
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
Definition: TOPGeoPrism.h:161
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
Definition: TOPGeoPrism.h:132

◆ print() [15/22]

void print ( const std::string &  title = "QBB cold plate geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 31 of file TOPGeoColdPlate.cc.

32 {
33 TOPGeoBase::print(title);
34
35 cout << " base plate: thickness = " << getBaseThickness() << " " << s_unitName;
36 cout << ", material = " << getBaseMaterial() << endl;
37
38 cout << " cooling plate: thickness = " << getCoolThickness() << " " << s_unitName;
39 cout << ", width = " << getCoolWidth() << " " << s_unitName;
40 cout << ", material = " << getCoolMaterial() << endl;
41
42 }
const std::string & getCoolMaterial() const
Returns cooling plate material name.
double getCoolWidth() const
Returns cooling plate width.
const std::string & getBaseMaterial() const
Returns base plate material name.
double getCoolThickness() const
Returns cooling plate thickness.
double getBaseThickness() const
Returns base plate thickness.

◆ print() [16/22]

void print ( const std::string &  title = "QBB forward end plate geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 29 of file TOPGeoEndPlate.cc.

30 {
31 TOPGeoBase::print(title);
32
33 cout << " thickness = " << getThickness() << " " << s_unitName;
34 cout << ", height = " << getHeight() << " " << s_unitName;
35 cout << ", material = " << getMaterial() << endl;
36
37 }
double getHeight() const
Returns height.
double getThickness() const
Returns thickness.
const std::string & getMaterial() const
Returns material name.

◆ print() [17/22]

void print ( const std::string &  title = "QBB geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 246 of file TOPGeoQBB.cc.

247 {
249
250 cout << " width = " << getWidth() << " " << s_unitName;
251 cout << ", length = " << getLength() << " " << s_unitName;
252 cout << ", prism-bar joint = " << getPrismPosition() << " " << s_unitName;
253 cout << ", inside material = " << getMaterial() << endl;
254
255 m_innerPanel.print("QBB inner honeycomb panel geometry parameters");
256 m_outerPanel.print("QBB outer honeycomb panel geometry parameters");
261
262 }
double getPrismPosition() const
Returns the position of prism-bar joint wrt QBB back.
Definition: TOPGeoQBB.h:132
const std::string & getMaterial() const
Returns the name of material inside QBB.
Definition: TOPGeoQBB.h:138
double getLength() const
Returns full length.
Definition: TOPGeoQBB.h:117
virtual void print(const std::string &title="QBB side rails geometry parameters") const override
Print the content of the class.
virtual void print(const std::string &title="QBB forward end plate geometry parameters") const override
Print the content of the class.
virtual void print(const std::string &title="QBB honeycomb panel geometry parameters") const override
Print the content of the class.
virtual void print(const std::string &title="QBB prism enclosure geometry parameters") const override
Print the content of the class.
virtual void print(const std::string &title="QBB cold plate geometry parameters") const override
Print the content of the class.

◆ print() [18/22]

void print ( const std::string &  title = "QBB honeycomb panel geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 60 of file TOPGeoHoneycombPanel.cc.

61 {
62 TOPGeoBase::print(title);
63
64 cout << " width = " << getWidth() << " " << s_unitName;
65 cout << ", length = " << getLength() << " " << s_unitName;
66 cout << ", thickness: min = " << getMinThickness() << " " << s_unitName;
67 cout << ", max = " << getMaxThickness() << " " << s_unitName;
68 cout << ", radius = " << getRadius() << " " << s_unitName << endl;
69
70 cout << " edge width = " << getEdgeWidth() << " " << s_unitName;
71 cout << ", y = " << getY() << " " << s_unitName;
72 cout << ", N = " << m_N << endl;
73
74 cout << " materials: body = " << getMaterial();
75 cout << ", edge = " << getEdgeMaterial() << endl;
76 }
double getWidth() const
Returns panel width.
const std::string & getEdgeMaterial() const
Returns material name of reinforced edge.
const std::string & getMaterial() const
Returns material name.
double getEdgeWidth() const
Returns width of the reinforced edge.
double getLength() const
Returns panel length.

◆ print() [19/22]

void print ( const std::string &  title = "QBB prism enclosure geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 35 of file TOPGeoPrismEnclosure.cc.

36 {
37 TOPGeoBase::print(title);
38
39 cout << " length = " << getLength() << " " << s_unitName;
40 cout << ", height = " << getHeight() << " " << s_unitName;
41 cout << ", angle = " << getAngle() / Unit::deg << " deg";
42 cout << ", material = " << getMaterial() << endl;
43
44 cout << " thicknesses: bottom = " << getBottomThickness() << " " << s_unitName;
45 cout << ", side = " << getSideThickness() << " " << s_unitName;
46 cout << ", back = " << getBackThickness() << " " << s_unitName;
47 cout << ", front = " << getFrontThickness() << " " << s_unitName;
48 cout << ", extension plate = " << getExtensionThickness() << " " << s_unitName << endl;
49 }
double getBackThickness() const
Returns back wall thickness.
const std::string & getMaterial() const
Returns material name.
double getExtensionThickness() const
Returns extension plate thickness.
double getFrontThickness() const
Returns front wall thickness.
double getLength() const
Returns full length.

◆ print() [20/22]

void print ( const std::string &  title = "QBB side rails geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 30 of file TOPGeoSideRails.cc.

31 {
32 TOPGeoBase::print(title);
33
34 cout << " thickness = " << getThickness() << " " << s_unitName;
35 cout << ", reduced thickness = " << getReducedThickness() << " " << s_unitName;
36 cout << ", height = " << getHeight() << " " << s_unitName;
37 cout << ", material = " << getMaterial() << endl;
38
39 }
const std::string & getMaterial() const
Returns material name.
double getReducedThickness() const
Returns thickness at prism enclosure.

◆ print() [21/22]

void print ( const std::string &  title = "TOP geometry parameters") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 142 of file TOPGeometry.cc.

143 {
144 cout << endl;
145 cout << "Geometry parameters of TOP counter:" << endl;
146 cout << "===================================" << endl;
147 cout << " name: " << m_name << endl;
148 cout << " number of modules: " << m_modules.size() << endl << endl;
149
150 for (const auto& module : m_modules) {
151 module.print();
152 cout << endl;
153 }
155 cout << " Number of board stacks: " << m_numBoardStacks << endl;
156 cout << endl;
157 m_QBB.print();
158 cout << endl;
160 cout << endl;
161 cout << "Photo-detection efficiency tuning factors" << endl;
162 cout << "-----------------------------------------" << endl;
163 if (m_tuneFactorsPDE.empty()) {
164 cout << " Not available" << endl;
165 } else {
166 for (const auto& x : m_tuneFactorsPDE) {
167 cout << " PMT type: " << x.first << " factor = " << x.second << endl;
168 }
169 }
170 cout << endl;
172 cout << endl;
173 for (const auto& tts : m_tts) {
174 tts.second.print("TTS distribution");
175 cout << endl;
176 }
178 cout << endl;
180 cout << endl;
181
182 }
void print(const std::string &title="Nominal quantum efficiency") const override
Print the content of the class.
Definition: TOPNominalQE.cc:68
virtual void print(const std::string &title="QBB geometry parameters") const override
Print the content of the class.
Definition: TOPGeoQBB.cc:246
void print(const std::string &title="Nominal time-to-digit conversion parameters") const override
Print the content of the class.
void print(const std::string &title="Wavelength filter bulk transmittance") const override
Print the content of the class.
void print(const std::string &title="Nominal TTS distribution") const override
Print the content of the class.
virtual void print(const std::string &title="Front-end geometry parameters") const override
Print the content of the class.

◆ print() [22/22]

void print ( const std::string &  title = "Wavelength filter bulk transmittance") const
overridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from TOPGeoBase.

Definition at line 45 of file TOPWavelengthFilter.cc.

46 {
48 cout << " first point: " << getLambdaFirst() << " nm";
49 cout << ", step: " << getLambdaStep() << " nm" << endl;
50 cout << " bulk transmittances: [";
51 for (const auto& trE : m_transmittances) cout << setprecision(3) << trE << ", ";
52 cout << "]" << endl;
53 if (getName().empty()) {
54 cout << "(Old geometry payload, filter transmittance is included in QE)" << endl;
55 }
56
57 }
float getLambdaStep() const
Returns wavelength step.
float getLambdaFirst() const
Returns wavelength of the first data point.

◆ printBackPlateContour()

void printBackPlateContour ( ) const

Print prism enclosure back plate contour (polygon) - for debugging.

Definition at line 194 of file TOPGeoQBB.cc.

195 {
196 auto contour = getBackPlateContour();
197 cout << "Prism enclosure back plate contour [" << s_unitName << "]:" << endl;
198 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
199 cout << endl;
200 }
std::vector< std::pair< double, double > > getBackPlateContour() const
Returns prism enclosure back plate x-y contour.
Definition: TOPGeoQBB.cc:174

◆ printBackwardContour()

void printBackwardContour ( ) const

Print backward contour (polygon) - for debugging.

Definition at line 130 of file TOPGeoQBB.cc.

131 {
132 auto contour = getBackwardContour();
133 cout << "Backward contour [" << s_unitName << "]:" << endl;
134 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
135 cout << endl;
136 }
std::vector< std::pair< double, double > > getBackwardContour() const
Returns backward x-y contour.
Definition: TOPGeoQBB.cc:106

◆ printForwardContour()

void printForwardContour ( ) const

Print forward contour (polygon) - for debugging.

Definition at line 45 of file TOPGeoQBB.cc.

46 {
47 auto contour = getForwardContour();
48 cout << "Forward contour [" << s_unitName << "]:" << endl;
49 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
50 cout << endl;
51 }
std::vector< std::pair< double, double > > getForwardContour() const
Returns forward x-y contour.
Definition: TOPGeoQBB.cc:21

◆ printFrontPlateContour()

void printFrontPlateContour ( ) const

Print prism enclosure front plate contour (polygon) - for debugging.

Definition at line 221 of file TOPGeoQBB.cc.

222 {
223 auto contour = getFrontPlateContour();
224 cout << "Prism enclosure front plate contour [" << s_unitName << "]:" << endl;
225 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
226 cout << endl;
227 }
std::vector< std::pair< double, double > > getFrontPlateContour() const
Returns prism enclosure front plate x-y contour.
Definition: TOPGeoQBB.cc:203

◆ printInnerPanelContour()

void printInnerPanelContour ( ) const

Print inner honeycomb panel contour (polygon) - for debugging.

Definition at line 71 of file TOPGeoQBB.cc.

72 {
73 auto contour = getInnerPanelContour();
74 cout << "Inner panel contour [" << s_unitName << "]:" << endl;
75 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
76 cout << endl;
77 }
std::vector< std::pair< double, double > > getInnerPanelContour() const
Returns inner honeycomb panel x-y contour.
Definition: TOPGeoQBB.cc:54

◆ printOuterPanelContour()

void printOuterPanelContour ( ) const

Print outer honeycomb panel contour (polygon) - for debugging.

Definition at line 97 of file TOPGeoQBB.cc.

98 {
99 auto contour = getOuterPanelContour();
100 cout << "Outer panel contour [" << s_unitName << "]:" << endl;
101 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
102 cout << endl;
103 }
std::vector< std::pair< double, double > > getOuterPanelContour() const
Returns outer honeycomb panel x-y contour.
Definition: TOPGeoQBB.cc:80

◆ printPrismEnclosureContour()

void printPrismEnclosureContour ( ) const

Print prism enclosure contour (polygon) - for debugging.

Definition at line 165 of file TOPGeoQBB.cc.

166 {
167 auto contour = getPrismEnclosureContour();
168 cout << "Prism enclosure contour [" << s_unitName << "]:" << endl;
169 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
170 cout << endl;
171 }
std::vector< std::pair< double, double > > getPrismEnclosureContour() const
Returns prism enclosure wall x-y contour.
Definition: TOPGeoQBB.cc:139

◆ printSampleTimeCalibration()

void printSampleTimeCalibration ( )

Print sample time calibration constants stored in database.

Definition at line 601 of file TOPDatabaseImporter.cc.

602 {
603
604 DBObjPtr<TOPCalTimebase> timeBase;
605 if (!timeBase.isValid()) {
606 B2ERROR("No time base calibration available");
607 return;
608 }
609
610 for (const auto& sampleTimes : timeBase->getSampleTimes()) {
611 cout << sampleTimes.getScrodID() << " " << sampleTimes.getChannel() << endl;
612 for (const auto& time : sampleTimes.getTimeAxis()) {
613 cout << time << " ";
614 }
615 cout << endl;
616 }
617
618 }

◆ printSampleTimeCalibrationInfo()

void printSampleTimeCalibrationInfo ( )

Prints sample time calibration info about constants stored in database.

Definition at line 561 of file TOPDatabaseImporter.cc.

562 {
563 DBObjPtr<TOPCalTimebase> timeBase;
564 if (!timeBase.isValid()) {
565 B2ERROR("No time base calibration available");
566 return;
567 }
568
569 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
570 int numModules = geo->getNumModules();
571 auto& feMapper = TOPGeometryPar::Instance()->getFrontEndMapper();
572
573 cout << "Time base calibration: number of calibrated channels in database" << endl << endl;
574 for (int moduleID = 1; moduleID <= numModules; moduleID++) {
575 int ncal[4] = {0, 0, 0, 0};
576 int scrodID[4] = {0, 0, 0, 0};
577 for (int bs = 0; bs < 4; bs++) {
578 auto* femap = feMapper.getMap(moduleID, bs);
579 if (!femap) {
580 B2ERROR("No FrontEnd map available for boardstack " << bs << " of module " << moduleID);
581 continue;
582 }
583 scrodID[bs] = femap->getScrodID();
584 for (int channel = 0; channel < 128; channel++) {
585 if (timeBase->isAvailable(scrodID[bs], channel)) ncal[bs]++;
586 }
587 }
588
589 cout << "Slot " << moduleID << endl;
590 for (int bs = 0; bs < 4; bs++) {
591 cout << " scrodID " << scrodID[bs] << ": " << ncal[bs] << "/128";
592 if (ncal[bs] < 128) cout << " (" << 128 - ncal[bs] << " missing)";
593 cout << endl;
594 }
595 }
596
597 cout << endl;
598 }
const FrontEndMapper & getFrontEndMapper() const
Returns front-end mapper (mapping of SCROD's to positions within TOP modules)

◆ printSurface()

void printSurface ( const GeoOpticalSurface surface) const
virtual

Print the content of optical surface.

Parameters
surfaceoptical surface parameters

Definition at line 44 of file TOPGeoBase.cc.

45 {
46 cout << " Optical surface: ";
47 if (surface.getName().empty() and !surface.hasProperties()) {
48 cout << "not defined" << endl;
49 return;
50 }
51 cout << surface.getName();
52 cout << ", model: " << surface.getModel();
53 cout << ", finish: " << surface.getFinish();
54 cout << ", type: " << surface.getType();
55 cout << ", value: " << surface.getValue();
56 cout << endl;
57 if (surface.hasProperties()) {
58 for (const auto& property : surface.getProperties()) {
59 cout << " - property: ";
60 cout << property.getName() << " [";
61 for (const auto& value : property.getValues()) cout << value << ", ";
62 cout << "], @[";
63 for (const auto& value : property.getEnergies()) cout << value / Unit::eV << ", ";
64 cout << "] eV" << endl;
65 }
66 } else {
67 cout << " - properties: None" << endl;
68 }
69
70 }

◆ printUnderlined()

void printUnderlined ( const std::string &  title) const
protected

Print the content of the class.

Parameters
titletitle to be printed

Definition at line 35 of file TOPGeoBase.cc.

36 {
37 cout << title << ":" << endl;
38 for (size_t i = 0; i <= title.length(); i++) cout << "-";
39 cout << endl;
40 cout << " name: " << m_name << endl;
41 }

◆ reflect()

void reflect ( const ROOT::Math::XYVector *  points,
const ROOT::Math::XYVector *  normals,
const ROOT::Math::XYVector &  orig,
const ROOT::Math::XYVector &  surf,
const ROOT::Math::XYVector &  norm,
const ROOT::Math::XYVector &  slanted,
int  k,
std::vector< UnfoldedWindow > &  result 
) const
private

Do unfolding.

Parameters
pointspoints defining position of upper and slanted surfaces
normalsnormals of upper and slanted surfaces
origorigin of exit window
surfexit window surface direction
normexit window surface normal
slantedslanted surface normal
kindex of the surface to start unfolding (0 or 1)
resultthe result of unfolding

Definition at line 152 of file TOPGeoPrism.cc.

156 {
157 XYVector rp[2] = {points[0], points[1]};
158 XYVector n[2] = {normals[0], normals[1]};
159 auto r = orig;
160 auto s = surf;
161 auto q = norm;
162 auto sl = slanted;
163
164 while (rp[k].Y() < 0) {
165 r -= 2 * ((r - rp[k]).Dot(n[k])) * n[k]; // reflect window origin
166 s -= 2 * s.Dot(n[k]) * n[k]; // reflect window surface direction
167 q -= 2 * q.Dot(n[k]) * n[k]; // reflect window normal
168 sl -= 2 * sl.Dot(n[k]) * n[k]; // reflect slanted normal
169 result.push_back(UnfoldedWindow(r, s, q, sl));
170 if (result.size() > 100) {
171 B2ERROR("TOPGeoPrism::reflect: too many reflections -> must be a bug");
172 return;
173 }
174 int i = (k + 1) % 2; // index of opposite surface
175 rp[i] -= 2 * (rp[i] - rp[k]).Dot(n[k]) * n[k]; // reflect point on the opposite surface
176 n[i] -= 2 * n[i].Dot(n[k]) * n[k]; // reflect normal of opposite surface
177 k = i; // toggle the reflection surface
178 }
179 }

◆ set() [1/2]

void set ( const std::vector< double > &  timeWalkParams,
double  noise,
double  quadratic 
)

Sets all the parameters and switches status to calibrated.

Parameters
timeWalkParamspolynomial coefficients of time-walk calibration curve [ns]
noisenoise term excess coefficient of electronic time resolution [ns]
quadraticquadratic term coefficient of electronic time resolution [ns]

Definition at line 18 of file TOPCalTimeWalk.cc.

20 {
21 m_timeWalkParams = timeWalkParams;
22 m_noise = noise;
23 m_quadratic = quadratic;
25 }
EStatus m_status
calibration status
@ c_Calibrated
good calibrated value

◆ set() [2/2]

void set ( int  slot,
const TH1F *  photonYields,
const TH1F *  backgroundYields,
const TH1F *  alphaRatio,
const TH1F *  activePixels,
const TH2F *  pulseHeights,
const TH1F *  muonZ 
)

Sets the data of a given slot.

The data are given as 1D histograms of 512 bins that correspond to pixelID's. Note: the setter must be called in the ascending order of slot ID's, e.g slot = 1, 2, ... , 16

Parameters
slotslot ID
photonYieldspixel photon yields
backgroundYieldspixel background yields
alphaRatioequalized alpha ratio
activePixelsactive pixels
pulseHeightspixel pulse-heights
muonZz-distribution of tracks

Definition at line 20 of file TOPCalPhotonYields.cc.

22 {
23 string slotName = (slot < 10) ? "_0" + to_string(slot) : "_" + to_string(slot);
24
25 m_photonYields.push_back(TH2F(("photonYields" + slotName).c_str(),
26 ("Photon yields for slot " + to_string(slot) + "; pixel column; pixel row").c_str(),
27 c_numCols, 0.5, c_numCols + 0.5, c_numRows, 0.5, c_numRows + 0.5));
28 copyContent(photonYields, m_photonYields.back());
29
30 m_backgroundYields.push_back(TH2F(("backgroundYields" + slotName).c_str(),
31 ("Background yields for slot " + to_string(slot) + "; pixel column; pixel row").c_str(),
32 c_numCols, 0.5, c_numCols + 0.5, c_numRows, 0.5, c_numRows + 0.5));
33 copyContent(backgroundYields, m_backgroundYields.back());
34
35 m_alphaRatio.push_back(TH2F(("alphaRatio" + slotName).c_str(),
36 ("Equalized alpha ratio for slot " + to_string(slot) + "; pixel column; pixel row").c_str(),
37 c_numCols, 0.5, c_numCols + 0.5, c_numRows, 0.5, c_numRows + 0.5));
38 copyContent(alphaRatio, m_alphaRatio.back());
39
40 m_activePixels.push_back(TH2F(("activePixels" + slotName).c_str(),
41 ("Active pixels for slot " + to_string(slot) + "; pixel column; pixel row").c_str(),
42 c_numCols, 0.5, c_numCols + 0.5, c_numRows, 0.5, c_numRows + 0.5));
43 copyContent(activePixels, m_activePixels.back());
44 m_activePixels.back().Scale(1 / muonZ->GetEntries());
45
46 m_pulseHeights.push_back(*pulseHeights);
47 m_muonZ.push_back(*muonZ);
48 }
@ c_numCols
number of pixel columns
@ c_numRows
number of pixel rows
void copyContent(const TH1F *input, TH2F &output)
Copy content of 1D histogram into 2D histogram.

◆ setActive()

void setActive ( int  moduleID,
unsigned  channel 
)

Sets a specific channel as active.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 31 of file TOPCalChannelMask.cc.

32 {
33 int module = moduleID - 1;
34 if (!check(module, channel)) {
35 B2WARNING("Channel status 'active' not set");
36 return;
37 }
38 m_status[module][channel] = c_Active;
39 }

◆ setAlpha()

void setAlpha ( int  moduleID,
double  alpha,
double  errAlpha 
)

Sets the angle alpha on a single module.

Parameters
moduleIDmodule ID (1-based)
alpharotation angle around x
errAlphaerror on alpha

Definition at line 25 of file TOPCalModuleAlignment.cc.

26 {
27 unsigned module = moduleID - 1;
28 if (module >= c_numModules) {
29 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
30 return;
31 }
32 m_alpha[module] = alpha;
33 m_errAlpha[module] = errAlpha;
34 m_transforms.clear();
35 }

◆ setBeta()

void setBeta ( int  moduleID,
double  beta,
double  errBeta 
)

Sets the angle beta on a single module.

Parameters
moduleIDmodule ID (1-based)
betarotation angle around y
errBetaerror on beta

Definition at line 37 of file TOPCalModuleAlignment.cc.

38 {
39 unsigned module = moduleID - 1;
40 if (module >= c_numModules) {
41 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
42 return;
43 }
44 m_beta[module] = beta;
45 m_errBeta[module] = errBeta;
46 m_transforms.clear();
47 }

◆ setBrokenGlue()

void setBrokenGlue ( int  glueID,
double  fraction,
double  angle,
const std::string &  material 
)

Sets glue to be broken (delaminated)

Parameters
glueIDglue ID: bar-mirror (1), bar-bar (2), prism-bar (3)
fractionfraction of the delaminated surface
angleangle of the delaminated surface
materialmaterial name to simulate the delaminated glue

Definition at line 72 of file TOPGeoModule.cc.

74 {
75 switch (glueID) {
76 case 1:
77 m_mirror.setGlueDelamination(fraction, angle, material);
78 break;
79 case 2:
80 m_bar1.setGlueDelamination(fraction, angle, material);
81 break;
82 case 3:
83 m_bar2.setGlueDelamination(fraction, angle, material);
84 break;
85 default:
86 B2ERROR("TOPGeoModule::setBrokenGlue: invalid glue ID."
87 << LogVar("glue ID", glueID));
88 }
89 }
virtual void setGlueDelamination(double fraction, double angle, const std::string &material)
Sets glue to be broken (delaminated)

◆ setCalibrated()

void setCalibrated ( int  moduleID)

Switches calibration status to calibrated.

Parameters
moduleIDmodule ID (1-based)

Definition at line 97 of file TOPCalModuleAlignment.cc.

98 {
99 unsigned module = moduleID - 1;
100 if (module >= c_numModules) {
101 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
102 return;
103 }
104 m_status[module] = c_Calibrated;
105 m_transforms.clear();
106 }

◆ setDead()

void setDead ( int  moduleID,
unsigned  channel 
)

Sets a specific channel as dead.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 41 of file TOPCalChannelMask.cc.

42 {
43 int module = moduleID - 1;
44 if (!check(module, channel)) {
45 B2WARNING("Channel status 'dead' not set");
46 return;
47 }
48 m_status[module][channel] = c_Dead;
49 }

◆ setEnvelopeQE()

void setEnvelopeQE ( ) const
private

Sets envelope quantum efficiency.

Definition at line 87 of file TOPPmtQE.cc.

88 {
89 if (!m_envelopeQE.empty()) return;
90
91 size_t size = 0;
92 for (unsigned pixel = 0; pixel < c_NumPmtPixels; pixel++) {
93 const auto& QE = m_QE[pixel];
94 size = std::max(size, QE.size());
95 }
96 m_envelopeQE.resize(size, 0);
97 for (unsigned pixel = 0; pixel < c_NumPmtPixels; pixel++) {
98 const auto& QE = m_QE[pixel];
99 for (size_t i = 0; i < QE.size(); i++) {
100 m_envelopeQE[i] = std::max(m_envelopeQE[i], QE[i]);
101 }
102 }
103 }

◆ setGains()

bool setGains ( const std::vector< float > &  gains,
float  error = 0 
)

Set gains.

Parameters
gainsvector of relative gains (size must be c_WindowSize)
errorerror on gains
Returns
true, on success

Definition at line 20 of file TOPASICGains.cc.

21 {
22
23 if (gains.size() != c_WindowSize) {
24 B2ERROR("TOPASICGains::setGains: vector with wrong number of elements");
25 return false;
26 }
27
28 for (int i = 0; i < c_WindowSize; i++) {
29 float gain = gains[i] * m_unit;
30 if (gain > 0 and (gain + 0.5) < 0x10000) {
31 m_gains[i] = int(gain + 0.5);
32 } else {
33 return false;
34 }
35 }
36 error *= m_unit;
37 m_gainError = int(error + 0.5);
38 return true;
39
40 }
unsigned short m_gains[c_WindowSize]
gains (in fixed point format)
Definition: TOPASICGains.h:98
@ c_WindowSize
number of samples
Definition: TOPASICGains.h:28
unsigned short m_gainError
gain error (fixed point format)
Definition: TOPASICGains.h:97
unsigned short m_unit
unit of fixed point number
Definition: TOPASICGains.h:96

◆ setGamma()

void setGamma ( int  moduleID,
double  gamma,
double  errGamma 
)

Sets the angle gamma on a single module.

Parameters
moduleIDmodule ID (1-based)
gammarotation angle around z
errGammaerror on gamma

Definition at line 49 of file TOPCalModuleAlignment.cc.

50 {
51 unsigned module = moduleID - 1;
52 if (module >= c_numModules) {
53 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
54 return;
55 }
56 m_gamma[module] = gamma;
57 m_errGamma[module] = errGamma;
58 m_transforms.clear();
59 }

◆ setNoisy()

void setNoisy ( int  moduleID,
unsigned  channel 
)

Sets a specific channel as noisy.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 51 of file TOPCalChannelMask.cc.

52 {
53 int module = moduleID - 1;
54 if (!check(module, channel)) {
55 B2WARNING("Channel status 'noisy' not set");
56 return;
57 }
58 m_status[module][channel] = c_Noisy;
59 }

◆ setPedestals()

int setPedestals ( const TProfile *  profile,
double  average = 0 
)

Set pedestals from profile histogram with c_WindowSize bins.

Parameters
profileprofile histogram
averageoptional value to add
Returns
number of pedestals that can not be packed into 16-bit word

Definition at line 23 of file TOPASICPedestals.cc.

24 {
25 int bad = c_WindowSize;
26
27 if (!profile) return bad;
28
29 if (profile->GetNbinsX() != c_WindowSize) {
30 B2ERROR("TOPASICPedestals::setPedestals: TProfile with wrong number of bins");
31 return bad;
32 }
33
34 if (profile->GetEntries() == 0) {
35 B2WARNING("TOPASICPedestals::setPedestals: TProfile with no entries");
36 return bad;
37 }
38
39 std::vector<unsigned> values;
40 std::vector<unsigned> errors;
41 for (int i = 0; i < c_WindowSize; i++) {
42 values.push_back(int(profile->GetBinContent(i + 1) + average + 0.5));
43 errors.push_back(int(profile->GetBinError(i + 1) + 0.5));
44 }
45
46 unsigned maxDif = 1 << c_Bits; maxDif--;
47 unsigned maxErr = 1 << (sizeof(unsigned short) * 8 - c_Bits); maxErr--;
48 m_offset = getOptimizedOffset(values, errors, maxDif, maxErr);
49
50 for (int i = 0; i < c_WindowSize; i++) {
51 unsigned dif = values[i] - m_offset;
52 if (dif > maxDif) continue;
53 unsigned err = errors[i];
54 if (err > maxErr) continue;
55 if (err == 0) err = 1;
56 m_pedestals[i] = dif + (err << c_Bits);
57 bad--;
58 }
59
60 return bad;
61
62 }
unsigned short m_pedestals[c_WindowSize]
pedestals (packed: value, error)
unsigned short m_offset
common pedestal offset
@ c_Bits
number of bits reserved for pedestal value
@ c_WindowSize
number of samples
unsigned getOptimizedOffset(const std::vector< unsigned > &values, const std::vector< unsigned > &errors, unsigned maxDif, unsigned maxErr)
Return the offset that can allow for the maximal number of good pedestal samples.

◆ setPeelOffRegions()

void setPeelOffRegions ( double  thickness,
const std::string &  material 
)

Sets parameters of the peel-off cookie volumes.

Parameters
thicknessvolume thickness
materialmaterial name

Definition at line 92 of file TOPGeoModule.cc.

93 {
94 double size = 2 * m_pmtArray.getDx();
95 double offset = (m_pmtArray.getX(1) + m_pmtArray.getX(2)) / 2 +
97 m_prism.setPeelOffRegions(size, offset, thickness, material);
98 }
double getX(unsigned col) const
Returns x coordinate of column center.
void setPeelOffRegions(double size, double offset, double thickness, const std::string &material)
Sets parameters of the peel-off cookie volumes.
Definition: TOPGeoPrism.h:105

◆ setStatus()

void setStatus ( int  moduleID,
unsigned  channel,
EStatus  status 
)

Sets the status for a single channel.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
statuschannel status (0: active 1: dead 2: noisy )

Definition at line 21 of file TOPCalChannelMask.cc.

22 {
23 int module = moduleID - 1;
24 if (!check(module, channel)) {
25 B2WARNING("Channel status not set");
26 return;
27 }
28 m_status[module][channel] = status;
29 }

◆ setT0() [1/3]

void setT0 ( int  moduleID,
double  T0,
double  errT0 
)

Sets calibration for a single module and switches status to calibrated.

Parameters
moduleIDmodule ID (1-based)
T0module T0
errT0error on T0

Definition at line 20 of file TOPCalModuleT0.cc.

21 {
22 unsigned module = moduleID - 1;
23 if (module >= c_numModules) {
24 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
25 return;
26 }
27 m_T0[module] = T0;
28 m_errT0[module] = errT0;
29 m_status[module] = c_Calibrated;
30 }

◆ setT0() [2/3]

void setT0 ( int  moduleID,
unsigned  asic,
double  T0 
)

Sets calibration for a single ASIC and switches status to calibrated.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)
T0shift in time [ns]

Definition at line 20 of file TOPCalAsicShift.cc.

21 {
22 unsigned module = moduleID - 1;
23 if (module >= c_numModules) {
24 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
25 return;
26 }
27 if (asic >= c_numAsics) {
28 B2ERROR("Invalid asic number, constant not set (" << ClassName() << ")");
29 return;
30 }
31 m_T0[module][asic] = T0;
32 m_status[module][asic] = c_Calibrated;
33 }

◆ setT0() [3/3]

void setT0 ( int  moduleID,
unsigned  channel,
double  T0,
double  errT0 
)

Sets calibration for a single channel and switches status to calibrated.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)
T0channel T0
errT0error on T0

Definition at line 20 of file TOPCalChannelT0.cc.

21 {
22 unsigned module = moduleID - 1;
23 if (module >= c_numModules) {
24 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
25 return;
26 }
27 if (channel >= c_numChannels) {
28 B2ERROR("Invalid channel number, constant not set (" << ClassName() << ")");
29 return;
30 }
31 m_T0[module][channel] = T0;
32 m_errT0[module][channel] = errT0;
33 m_status[module][channel] = c_Calibrated;
34 }

◆ setTimeAxis() [1/2]

void setTimeAxis ( const std::vector< double > &  sampleTimes,
double  syncTimeBase 
)

Sets time axis from calibration data and switches status to calibrated.

Parameters
sampleTimesvector of 256 elements of sample times
syncTimeBasesinchronization time base (width of 2 ASIC windows)

Definition at line 33 of file TOPSampleTimes.cc.

35 {
36 if (sampleTimes.size() < c_TimeAxisSize) {
37 B2FATAL("TOPSampleTimes::setTimeAxis: vector too short");
38 return;
39 }
40
41 for (unsigned i = 0; i < c_TimeAxisSize; i++) m_timeAxis[i] = sampleTimes[i];
42 double DTime = 2 * syncTimeBase;
43 m_timeAxis[c_TimeAxisSize] = DTime;
45 }
@ c_Calibrated
good calibrated value
EStatus m_calibrated
calibration status

◆ setTimeAxis() [2/2]

void setTimeAxis ( double  syncTimeBase)

Sets equidistant time axis (uncalibrated).

Parameters
syncTimeBasesinchronization time base (width of 2 ASIC windows)

Definition at line 23 of file TOPSampleTimes.cc.

24 {
25 double DTime = 2 * syncTimeBase;
26 double timeBin = DTime / static_cast<double>(c_TimeAxisSize);
27 for (unsigned i = 0; i < c_TimeAxisSize; i++) m_timeAxis[i] = timeBin * i;
28 m_timeAxis[c_TimeAxisSize] = DTime;
30 }
@ c_Default
uncalibrated default value

◆ setTransformation()

void setTransformation ( ) const
private

Sets transformation cache.

Definition at line 64 of file TOPGeoModule.cc.

65 {
66 RotationZ Rz(m_phi - M_PI / 2);
67 m_transformNominal = new Transform3D(Rz, Rz * XYZVector(0, m_radius, getZc() * s_unit));
69 }
double getZc() const
Returns z of bar center (w/o prism) in Belle II frame.
Definition: TOPGeoModule.h:314
ROOT::Math::Transform3D getTransformation() const
Returns transformation from local to nominal frame.

◆ setTransformations()

void setTransformations ( ) const
private

Sets the transformation cache.

Definition at line 282 of file TOPCalModuleAlignment.cc.

283 {
284 for (int i = 0; i < c_numModules; i++) {
285 Transform3D T;
286 if (m_status[i] == c_Calibrated) {
287 RotationX Rx(m_alpha[i]);
288 RotationY Ry(m_beta[i]);
289 RotationZ Rz(m_gamma[i]);
290 Translation3D t(m_x[i], m_y[i], m_z[i]);
291 T = Transform3D(Rz * Ry * Rx, t);
292 }
293 m_transforms.push_back(T);
294 }
295 m_transforms.push_back(Transform3D()); // for invalid module ID
296 }

◆ setUnusable() [1/4]

void setUnusable ( int  moduleID)

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)

Definition at line 108 of file TOPCalModuleAlignment.cc.

109 {
110 unsigned module = moduleID - 1;
111 if (module >= c_numModules) {
112 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
113 return;
114 }
115 m_status[module] = c_Unusable;
116 m_transforms.clear();
117 }

◆ setUnusable() [2/4]

void setUnusable ( int  moduleID)

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)

Definition at line 33 of file TOPCalModuleT0.cc.

34 {
35 unsigned module = moduleID - 1;
36 if (module >= c_numModules) {
37 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
38 return;
39 }
40 m_status[module] = c_Unusable;
41 }

◆ setUnusable() [3/4]

void setUnusable ( int  moduleID,
unsigned  asic 
)

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)
asicASIC number within a module (0 - 63)

Definition at line 36 of file TOPCalAsicShift.cc.

37 {
38 unsigned module = moduleID - 1;
39 if (module >= c_numModules) {
40 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
41 return;
42 }
43 if (asic >= c_numAsics) {
44 B2ERROR("Invalid asic number, status not set (" << ClassName() << ")");
45 return;
46 }
47 m_status[module][asic] = c_Unusable;
48 }

◆ setUnusable() [4/4]

void setUnusable ( int  moduleID,
unsigned  channel 
)

Switches calibration status to unusable to flag badly calibrated constant.

Parameters
moduleIDmodule ID (1-based)
channelhardware channel number (0-based)

Definition at line 37 of file TOPCalChannelT0.cc.

38 {
39 unsigned module = moduleID - 1;
40 if (module >= c_numModules) {
41 B2ERROR("Invalid module number, status not set (" << ClassName() << ")");
42 return;
43 }
44 if (channel >= c_numChannels) {
45 B2ERROR("Invalid channel number, status not set (" << ClassName() << ")");
46 return;
47 }
48 m_status[module][channel] = c_Unusable;
49 }

◆ setWindowShifts()

void setWindowShifts ( std::vector< int >  shifts)

Sets window shifts.

Parameters
shiftsvector of size = 6 with window shifts according to revo9count

Definition at line 20 of file TOPFrontEndSetting.cc.

21 {
22 if (shifts.size() != 6) {
23 B2ERROR("TOPFrontEndSetting::setWindowShifts: vector size must be 6");
24 return;
25 }
26 for (int i = 0; i < 6; i++) m_windowShifts[i] = shifts[i];
27 }
int m_windowShifts[6]
window shifts as a function of revo9count%6

◆ setX()

void setX ( int  moduleID,
double  x,
double  errX 
)

Sets the displacement x on a single module.

Parameters
moduleIDmodule ID (1-based)
xdisplacement along the x axis
errXerror on the displacement

Definition at line 61 of file TOPCalModuleAlignment.cc.

62 {
63 unsigned module = moduleID - 1;
64 if (module >= c_numModules) {
65 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
66 return;
67 }
68 m_x[module] = x;
69 m_errX[module] = errX;
70 m_transforms.clear();
71 }

◆ setY()

void setY ( int  moduleID,
double  y,
double  errY 
)

Sets the displacement y on a single module.

Parameters
moduleIDmodule ID (1-based)
ydisplacement along the y axis
errYerror on the displacement

Definition at line 73 of file TOPCalModuleAlignment.cc.

74 {
75 unsigned module = moduleID - 1;
76 if (module >= c_numModules) {
77 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
78 return;
79 }
80 m_y[module] = y;
81 m_errY[module] = errY;
82 m_transforms.clear();
83 }

◆ setZ()

void setZ ( int  moduleID,
double  z,
double  errZ 
)

Sets the displacement z on a single module.

Parameters
moduleIDmodule ID (1-based)
zdisplacement along the z axis
errZerror on the displacement

Definition at line 85 of file TOPCalModuleAlignment.cc.

86 {
87 unsigned module = moduleID - 1;
88 if (module >= c_numModules) {
89 B2ERROR("Invalid module number, constant not set (" << ClassName() << ")");
90 return;
91 }
92 m_z[module] = z;
93 m_errZ[module] = errZ;
94 m_transforms.clear();
95 }

◆ suppressAverage() [1/2]

void suppressAverage ( )

Subtracts arithmetic average of a module from constants whose status is not c_Default.

Arithmetic average is calculated from those whose status is c_Calibrated.

Definition at line 52 of file TOPCalChannelT0.cc.

53 {
54 for (int m = 0; m < c_numModules; m++) {
55 float s = 0;
56 int n = 0;
57 for (int i = 0; i < c_numChannels; i++) {
58 if (m_status[m][i] == c_Calibrated) {
59 s += m_T0[m][i];
60 n++;
61 }
62 }
63 if (n == 0) continue;
64 s /= n;
65 for (int i = 0; i < c_numChannels; i++) {
66 if (m_status[m][i] != c_Default) m_T0[m][i] -= s;
67 }
68 B2INFO("Slot " << m + 1 << ": average of " << s << " ns subtracted.");
69 }
70 }

◆ suppressAverage() [2/2]

void suppressAverage ( )

Subtracts arithmetic average from constants whose status is not c_Default.

Arithmetic average is calculated from those whose status is c_Calibrated.

Definition at line 44 of file TOPCalModuleT0.cc.

45 {
46 float s = 0;
47 int n = 0;
48 for (int i = 0; i < c_numModules; i++) {
49 if (m_status[i] == c_Calibrated) {
50 s += m_T0[i];
51 n++;
52 }
53 }
54 if (n == 0) return;
55 s /= n;
56 for (int i = 0; i < c_numModules; i++) {
57 if (m_status[i] != c_Default) m_T0[i] -= s;
58 }
59 B2INFO("Average of " << s << " ns subtracted.");
60 }

◆ TOPGeoModule()

TOPGeoModule ( const TOPGeoModule module)

Copy constructor.

Definition at line 26 of file TOPGeoModule.cc.

26 : TOPGeoBase(module.getName())
27 {
28 *this = module;
29 m_transform = 0;
31 }
TOPGeoBase()
Default constructor.
Definition: TOPGeoBase.h:31

◆ TOPNominalTDC()

TOPNominalTDC ( int  numWindows,
int  subBits,
double  syncTimeBase,
int  numofBunches,
double  offset,
double  pileupTime,
double  doubleHitResolution,
double  timeJitter,
double  efficiency,
const std::string &  name = "TOPNominalTDC" 
)

Useful constructor (new xml file version)

Parameters
numWindowsnumber of ASIC windows per waveform
subBitsnumber of bits per sample
syncTimeBasesynchonization time base (time width of c_syncWindows)
numofBunchesnumber of bunches per syncTimeBase
offsettime offset
pileupTimepile-up time
doubleHitResolutiondouble hit resolution time
timeJitterr.m.s. of time jitter
efficiencyelectronic efficiency (fraction of hits above threshold)
nameobject name

Definition at line 22 of file TOPNominalTDC.cc.

31 :
32 TOPGeoBase(name),
33 m_numWindows(numWindows), m_subBits(subBits), m_syncTimeBase(syncTimeBase),
34 m_numofBunches(numofBunches),
35 m_offset(offset), m_pileupTime(pileupTime), m_doubleHitResolution(doubleHitResolution),
36 m_timeJitter(timeJitter), m_efficiency(efficiency)
37 {
38 if (numWindows <= 0)
39 B2FATAL("TOPNominalTDC: numWindows must be > 0");
40 if (subBits < 0)
41 B2FATAL("TOPNominalTDC: subBits must be >= 0");
42
43 int numSamples = numWindows * c_WindowSize;
44 int numBits = subBits - 1;
45 int k = numSamples;
46 do {
47 numBits++;
48 k /= 2;
49 } while (k > 0);
50 if (numSamples > (1 << (numBits - subBits))) numBits++;
51 m_numBits = numBits;
52
53 int syncSamples = c_syncWindows * c_WindowSize;
54 m_sampleWidth = syncTimeBase / syncSamples;
55 m_binWidth = m_sampleWidth / (1 << subBits);
56 }
float m_efficiency
electronic efficiency (fract.
unsigned m_numBits
number of bits
unsigned m_subBits
number of bits per sample
float m_syncTimeBase
time width of c_syncWindows
@ c_syncWindows
number of windows corresponding to syncTimeBase
Definition: TOPNominalTDC.h:29
unsigned m_numofBunches
number of bunches per syncTimeBase

◆ TOPSignalShape()

TOPSignalShape ( std::vector< double >  shape,
double  timeBin,
double  tau,
double  pole1,
double  pole2 
)

Full constructor.

Parameters
shapewaveform values (unnormalized) of positive pulse
timeBintime difference between two samples [ns]
tautime constant of the exponential tail used for extrapolation [ns]
pole1noise bandwidth: first pole [GHz]
pole2noise bandwidth: second pole [GHz]

Definition at line 21 of file TOPSignalShape.cc.

22 :
23 m_shape(shape), m_tau(tau), m_pole1(pole1), m_pole2(pole2)
24 {
25 m_tmax = m_tmin + (shape.size() - 1) * timeBin;
26
27 // find peaking value (positive pulse maximum!)
28
29 int samplePeak = 0;
30 for (unsigned i = 0; i < shape.size(); i++) {
31 if (shape[i] > shape[samplePeak]) samplePeak = i;
32 }
33
34 TSpline5 spline("spline", m_tmin, m_tmax, shape.data(), shape.size());
35 double t1 = m_tmin + (samplePeak - 1) * timeBin;
36 double t2 = m_tmin + (samplePeak + 1) * timeBin;
37 for (int i = 0; i < 20; i++) {
38 double t = (t1 + t2) / 2;
39 if (spline.Derivative(t) > 0) {
40 t1 = t;
41 } else {
42 t2 = t;
43 }
44 }
45 double vPeak = spline.Eval((t1 + t2) / 2);
46
47 // normalize waveform
48
49 for (auto& value : m_shape) value /= vPeak;
50
51 // find 50% CF crossing time (positive pulse!)
52
53 auto sampleRise = samplePeak;
54 while (sampleRise >= 0 and m_shape[sampleRise] > 0.5) sampleRise--;
55 t1 = m_tmin + sampleRise * timeBin;
56 t2 = m_tmin + (sampleRise + 1) * timeBin;
57 for (int i = 0; i < 20; i++) {
58 double t = (t1 + t2) / 2;
59 if (spline.Eval(t) < vPeak / 2) {
60 t1 = t;
61 } else {
62 t2 = t;
63 }
64 }
65 double crossingTime = (t1 + t2) / 2;
66
67 // set 50% CF crossing to happen at t = 0
68
69 m_tmin -= crossingTime;
70 m_tmax -= crossingTime;
71
72 }
double m_pole2
noise bandwidth: second pole [GHz]
double m_pole1
noise bandwidth: first pole [GHz]

◆ unfold()

void unfold ( ) const
private

Unfold prism exit window.

Definition at line 129 of file TOPGeoPrism.cc.

130 {
131 double z = -(m_length - m_flatLength);
132 double yUp = m_thickness / 2;
133 double yDown = yUp - m_exitThickness;
134 XYVector points[2] = {XYVector(yUp, z), XYVector(yDown, z)}; // points on upper and slanted surfaces
135
136 double alpha = getAngle();
137 XYVector normals[2] = {XYVector(1, 0), XYVector(-cos(alpha), sin(alpha))}; // normals of upper and slanted surfaces
138
139 XYVector orig(0, z); // window origin
140 XYVector surf(1, 0); // window surface direction (= upper surface normal)
141 XYVector norm(0, -1); // window normal
142 auto slanted = normals[1]; // slanted surface normal
143
144 reflect(points, normals, orig, surf, norm, slanted, 1, m_unfoldedWindows); // unfolding down
145 std::reverse(m_unfoldedWindows.begin(), m_unfoldedWindows.end());
146 m_unfoldedWindows.push_back(UnfoldedWindow(orig, surf, norm, slanted)); // true window
147 m_k0 = m_unfoldedWindows.size() - 1;
148 reflect(points, normals, orig, surf, norm, slanted, 0, m_unfoldedWindows); // unfolding up
149 }
int m_k0
do not write out
Definition: TOPGeoPrism.h:289
std::vector< UnfoldedWindow > m_unfoldedWindows
cache for unfolded prism exit windows
Definition: TOPGeoPrism.h:287
void reflect(const ROOT::Math::XYVector *points, const ROOT::Math::XYVector *normals, const ROOT::Math::XYVector &orig, const ROOT::Math::XYVector &surf, const ROOT::Math::XYVector &norm, const ROOT::Math::XYVector &slanted, int k, std::vector< UnfoldedWindow > &result) const
Do unfolding.
Definition: TOPGeoPrism.cc:152

◆ UnfoldedWindow()

UnfoldedWindow ( const ROOT::Math::XYVector &  orig,
const ROOT::Math::XYVector &  dir,
const ROOT::Math::XYVector &  norm,
const ROOT::Math::XYVector &  slanted 
)

constructor

Parameters
origwindow origin
dirwindow surface direction (= upper surface normal)
normwindow surface normal (pointing out of prism)
slantedslanted surface normal

Definition at line 25 of file TOPGeoPrism.cc.

26 :
27 y0(orig.X()), z0(orig.Y()), sy(dir.X()), sz(dir.Y()), ny(norm.X()), nz(norm.Y())
28 {
29 nsy[0] = sy;
30 nsz[0] = sz;
31 nsy[1] = slanted.X();
32 nsz[1] = slanted.Y();
33 }
double ny
normal to window surface, y component
Definition: TOPGeoPrism.h:48
double nsz[2]
normals to upper [0] and slanted [1] surfaces, z component
Definition: TOPGeoPrism.h:51
double nz
normal to window surface, z component
Definition: TOPGeoPrism.h:49
double nsy[2]
normals to upper [0] and slanted [1] surfaces, y component
Definition: TOPGeoPrism.h:50
double sz
window surface direction in z
Definition: TOPGeoPrism.h:47
double z0
window origin in z
Definition: TOPGeoPrism.h:45
double sy
window surface direction in y
Definition: TOPGeoPrism.h:46
double y0
window origin in y
Definition: TOPGeoPrism.h:44

◆ ~TOPGeoModule()

Destructor.

Definition at line 58 of file TOPGeoModule.cc.

59 {
60 if (m_transform) delete m_transform;
62 }

Variable Documentation

◆ s_unit

double s_unit = Unit::cm
staticprotected

conversion unit for length

Definition at line 86 of file TOPGeoBase.h.

◆ s_unitName

std::string s_unitName
staticprotected

conversion unit name

Definition at line 87 of file TOPGeoBase.h.