Belle II Software  release-05-02-19
TOPDatabaseImporter.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric, Umberto Tamponi *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <Python.h>
14 #include <string>
15 #include <vector>
16 
17 namespace Belle2 {
28  class TOPDatabaseImporter {
29 
30  public:
31 
36  {}
37 
38 
42  virtual ~TOPDatabaseImporter()
43  {}
44 
54  void importSampleTimeCalibration(std::string fileNames,
55  int firstExp = 0, int firstRun = 0,
56  int lastExp = -1, int lastRun = -1);
57 
58 
68  void importLocalT0Calibration(std::string fileNames,
69  int firstExp = 0, int firstRun = 0,
70  int lastExp = -1, int lastRun = -1);
71 
72 
81  void importChannelT0(std::string fileName,
82  int expNo, int firstRun, int lastRun);
83 
84 
95  void importAsicShifts_BS13d(double s0, double s1, double s2, double s3,
96  int expNo, int firstRun, int lastRun);
97 
107  void importModuleT0Calibration(std::string fileName,
108  int firstExp = 0, int firstRun = 0,
109  int lastExp = -1, int lastRun = -1);
110 
119  void importModuleT0(std::string fileName,
120  int expNo, int firstRun, int lastRun);
121 
132  void importOfflineCommonT0Calibration(std::string fileName,
133  int firstExp = 0, int firstRun = 0,
134  int lastExp = -1, int lastRun = -1);
135 
136 
146  void importCommonT0(double value, double error,
147  int expNo, int firstRun, int lastRun,
148  bool roughlyCalibrated = false);
149 
154 
159 
167  void importChannelMask(std::string fileName,
168  int expNo, int firstRun, int lastRun);
169 
179  void generateFakeChannelMask(double fractionDead, double fractionHot,
180  int firstExp = 0, int firstRun = 0,
181  int lastExp = -1, int lastRun = -1);
182 
192  void importPmtQEData(std::string fileName,
193  std::string treeName = "qePmtData",
194  int firstExp = 0, int firstRun = 0,
195  int lastExp = -1, int lastRun = -1);
196 
206  void importPmtGainData(std::string fileName,
207  std::string treeName = "gainPmtData",
208  int firstExp = 0, int firstRun = 0,
209  int lastExp = -1, int lastRun = -1);
210 
220  void importPmtInstallationData(std::string fileName,
221  std::string treeName = "installationPmtData",
222  int firstExp = 0, int firstRun = 0,
223  int lastExp = -1, int lastRun = -1);
224 
234  void importPmtObsoleteData(std::string fileName,
235  std::string treeName = "obsPmtData",
236  int firstExp = 0, int firstRun = 0,
237  int lastExp = -1, int lastRun = -1);
238 
248  void importPmtTTSPar(std::string fileName,
249  std::string treeName = "ttsPmtPar",
250  int firstExp = 0, int firstRun = 0,
251  int lastExp = -1, int lastRun = -1);
252 
262  void importPmtTTSHisto(std::string fileName,
263  std::string treeName = "ttsPmtHisto",
264  int firstExp = 0, int firstRun = 0,
265  int lastExp = -1, int lastRun = -1);
266 
275  void importPmtPulseHeightFitResult(std::string fileName,
276  int firstExp = 0, int firstRun = 0,
277  int lastExp = -1, int lastRun = -1);
278 
283  void exportPmtTTSHisto(std::string outFileName = "RetrievedHistos.root");
284 
295  void importFrontEndSettings(int lookback, int readoutWin, int extraWin, int offset,
296  int expNo, int firstRun, int lastRun);
297 
305  void importDummyCalModuleAlignment(int firstExp = 0, int firstRun = 0,
306  int lastExp = -1, int lastRun = -1);
307 
315  void importDummyCalModuleT0(int firstExp = 0, int firstRun = 0,
316  int lastExp = -1, int lastRun = -1);
324  void importDummyCalChannelT0(int firstExp = 0, int firstRun = 0,
325  int lastExp = -1, int lastRun = -1);
333  void importDummyCalTimebase(int firstExp = 0, int firstRun = 0,
334  int lastExp = -1, int lastRun = -1);
342  void importDummyCalChannelNoise(int firstExp = 0, int firstRun = 0,
343  int lastExp = -1, int lastRun = -1);
351  void importDummyCalChannelPulseHeight(int firstExp = 0, int firstRun = 0,
352  int lastExp = -1, int lastRun = -1);
360  void importDummyCalChannelRQE(int firstExp = 0, int firstRun = 0,
361  int lastExp = -1, int lastRun = -1);
369  void importDummyCalChannelThresholdEff(int firstExp = 0, int firstRun = 0,
370  int lastExp = -1, int lastRun = -1);
378  void importDummyCalChannelThreshold(int firstExp = 0, int firstRun = 0,
379  int lastExp = -1, int lastRun = -1);
387  void importDummyCalCommonT0(int firstExp = 0, int firstRun = 0,
388  int lastExp = -1, int lastRun = -1);
396  void importDummyCalIntegratedCharge(int firstExp = 0, int firstRun = 0,
397  int lastExp = -1, int lastRun = -1);
398 
406  void importDummyCalAsicShift(int firstExp = 0, int firstRun = 0,
407  int lastExp = -1, int lastRun = -1);
408 
414  void correctTOPPmtQE();
415 
427  void importTimeWalk(PyObject* list, double a, double b,
428  int firstExp = 0, int firstRun = 0,
429  int lastExp = -1, int lastRun = -1);
433  void importTest(int runNumber, double syncTimeBase);
434 
438  void importTest();
439 
440 
441  private:
442 
443  // ClassDef(TOPDatabaseImporter, 1); /**< ClassDef - why this is needed? */
444  };
445 
447 } // Belle2 namespace
Belle2::TOPDatabaseImporter::importDummyCalModuleAlignment
void importDummyCalModuleAlignment(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalModuleAlignment DB objects
Definition: TOPDatabaseImporter.cc:1277
Belle2::TOPDatabaseImporter::importDummyCalChannelT0
void importDummyCalChannelT0(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelT0 DB objects
Definition: TOPDatabaseImporter.cc:1299
Belle2::TOPDatabaseImporter::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 tuni...
Definition: TOPDatabaseImporter.cc:1445
Belle2::TOPDatabaseImporter::importDummyCalChannelPulseHeight
void importDummyCalChannelPulseHeight(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelPulseHeight DB objects
Definition: TOPDatabaseImporter.cc:1332
Belle2::TOPDatabaseImporter::importDummyCalTimebase
void importDummyCalTimebase(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalTimebase DB objects
Definition: TOPDatabaseImporter.cc:1310
Belle2::TOPDatabaseImporter::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!)
Definition: TOPDatabaseImporter.cc:908
Belle2::TOPDatabaseImporter::importAsicShifts_BS13d
void importAsicShifts_BS13d(double s0, double s1, double s2, double s3, int expNo, int firstRun, int lastRun)
Import ASIC shifts of BS13d.
Definition: TOPDatabaseImporter.cc:346
Belle2::TOPDatabaseImporter::getSampleTimeCalibrationInfo
void getSampleTimeCalibrationInfo()
Prints sample time calibration info about constants stored in database.
Definition: TOPDatabaseImporter.cc:565
Belle2::TOPDatabaseImporter::correctTOPPmtQE
void correctTOPPmtQE()
correct QE values in database for the reflection on window surface be sure that you run the function ...
Definition: TOPDatabaseImporter.cc:1408
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:465
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:858
Belle2::TOPDatabaseImporter::importDummyCalChannelThreshold
void importDummyCalChannelThreshold(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelThreshold DB objects
Definition: TOPDatabaseImporter.cc:1365
Belle2::TOPDatabaseImporter::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 inp...
Definition: TOPDatabaseImporter.cc:376
Belle2::TOPDatabaseImporter::~TOPDatabaseImporter
virtual ~TOPDatabaseImporter()
Destructor.
Definition: TOPDatabaseImporter.h:50
Belle2::TOPDatabaseImporter::importTest
void importTest()
for testing purposes only! - will be removed ...
Definition: TOPDatabaseImporter.cc:1509
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:1132
Belle2::TOPDatabaseImporter::importCommonT0
void importCommonT0(double value, double error, int expNo, int firstRun, int lastRun, bool roughlyCalibrated=false)
Import common T0 calibration constants.
Definition: TOPDatabaseImporter.cc:450
Belle2::TOPDatabaseImporter::importFrontEndSettings
void importFrontEndSettings(int lookback, int readoutWin, int extraWin, int offset, int expNo, int firstRun, int lastRun)
Import front-end settings.
Definition: TOPDatabaseImporter.cc:1245
Belle2::TOPDatabaseImporter::importDummyCalChannelNoise
void importDummyCalChannelNoise(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelNoise DB objects
Definition: TOPDatabaseImporter.cc:1321
Belle2::TOPDatabaseImporter::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"...
Definition: TOPDatabaseImporter.cc:518
Belle2::TOPDatabaseImporter::importDummyCalChannelRQE
void importDummyCalChannelRQE(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelRQE DB objects
Definition: TOPDatabaseImporter.cc:1343
Belle2::TOPDatabaseImporter::TOPDatabaseImporter
TOPDatabaseImporter()
Default constructor.
Definition: TOPDatabaseImporter.h:43
Belle2::TOPDatabaseImporter::importDummyCalChannelThresholdEff
void importDummyCalChannelThresholdEff(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalChannelThresholdEff DB objects
Definition: TOPDatabaseImporter.cc:1354
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPDatabaseImporter::exportPmtTTSHisto
void exportPmtTTSHisto(std::string outFileName="RetrievedHistos.root")
Example of exporting TTS histograms.
Definition: TOPDatabaseImporter.cc:1222
Belle2::TOPDatabaseImporter::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).
Definition: TOPDatabaseImporter.cc:624
Belle2::TOPDatabaseImporter::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...
Definition: TOPDatabaseImporter.cc:73
Belle2::TOPDatabaseImporter::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,...
Definition: TOPDatabaseImporter.cc:294
Belle2::TOPDatabaseImporter::printSampleTimeCalibration
void printSampleTimeCalibration()
Print sample time calibration constants stored in database.
Definition: TOPDatabaseImporter.cc:604
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:676
Belle2::TOPDatabaseImporter::importDummyCalCommonT0
void importDummyCalCommonT0(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalCommonT0 DB objects
Definition: TOPDatabaseImporter.cc:1376
Belle2::TOPDatabaseImporter::importDummyCalAsicShift
void importDummyCalAsicShift(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalAsicShift DB objects
Definition: TOPDatabaseImporter.cc:1398
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:799
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:968
Belle2::TOPDatabaseImporter::importDummyCalModuleT0
void importDummyCalModuleT0(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalCalModuleT0 DB objects
Definition: TOPDatabaseImporter.cc:1288
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:1069
Belle2::TOPDatabaseImporter::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...
Definition: TOPDatabaseImporter.cc:199
Belle2::TOPDatabaseImporter::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.
Definition: TOPDatabaseImporter.cc:726
Belle2::TOPDatabaseImporter::importDummyCalIntegratedCharge
void importDummyCalIntegratedCharge(int firstExp=0, int firstRun=0, int lastExp=-1, int lastRun=-1)
import a dummy payload of TOPCalIntegratedCharge DB objects
Definition: TOPDatabaseImporter.cc:1387