Belle II Software  release-08-01-10
KLMCalibrationChecker.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 /* KLM headers. */
12 #include <klm/dataobjects/KLMElementNumbers.h>
13 
14 /* Basf2 headers. */
15 #include <framework/database/DBObjPtr.h>
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <framework/datastore/StoreObjPtr.h>
18 #include <framework/logging/Logger.h>
19 
20 /* C++ headers. */
21 #include <string>
22 
23 namespace Belle2 {
33 
34  public:
35 
40 
45 
49  void setExperimentRun(int experiment, int run);
50 
54  void setTestingPayload(const std::string& testingPayloadName)
55  {
56  m_testingPayloadName = testingPayloadName;
57  }
58 
62  void setGlobalTag(const std::string& globalTagName)
63  {
64  m_GlobalTagName = globalTagName;
65  }
66 
70  void setAlignmentResultsFile(const std::string& alignmentResultsFile)
71  {
72  m_AlignmentResultsFile = alignmentResultsFile;
73  }
74 
79  const std::string& stripEfficiencyResultsFile)
80  {
81  m_StripEfficiencyResultsFile = stripEfficiencyResultsFile;
82  }
83 
88  const std::string& timeCableDelayResultsFile)
89  {
90  m_TimeCableDelayResultsFile = timeCableDelayResultsFile;
91  }
92 
97  const std::string& timeConstantsResultsFile)
98  {
99  m_TimeConstantsResultsFile = timeConstantsResultsFile;
100  }
101 
102 
106  void checkAlignment();
107 
111  void checkStripEfficiency();
112 
117 
121  void checkTimeCableDelay();
122 
126  void checkTimeConstants();
127 
128 
129  private:
130 
134  void initializeDatabase();
135 
139  void resetDatabase();
140 
144  template<class T> void printPayloadInformation(DBObjPtr<T>& dbObject)
145  {
146  B2INFO("Analyzing the following payload:"
147  << LogVar("Global Tag", m_GlobalTagName.c_str())
148  << LogVar("Name", dbObject.getName())
149  << LogVar("Revision", dbObject.getRevision())
150  << LogVar("IoV", dbObject.getIoV()));
151  }
152 
155 
157  int m_run;
158 
160  std::string m_testingPayloadName = "";
161 
163  std::string m_GlobalTagName = "";
164 
166  std::string m_AlignmentResultsFile = "alignment.root";
167 
169  std::string m_StripEfficiencyResultsFile = "strip_efficiency.root";
170 
172  std::string m_TimeCableDelayResultsFile = "timeCableDelay.root";
173 
175  std::string m_TimeConstantsResultsFile = "timeConstants.root";
176 
179 
182 
183  };
184 
186 }
187 
IntervalOfValidity getIoV() const
Return current IoV of the object.
const std::string & getName() const
Return name under which the object is saved in the DBStore.
unsigned int getRevision() const
Return current revision of the object.
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
void setTestingPayload(const std::string &testingPayloadName)
Set testing payload name.
void checkTimeCableDelay()
Check time cable delay.
void setGlobalTag(const std::string &globalTagName)
Set Global Tag name.
void checkTimeConstants()
Check time constants.
void checkStripEfficiency()
Check strip efficiency.
void resetDatabase()
Reset the database.
void initializeDatabase()
Initialize the database.
void setTimeConstantsResultsFile(const std::string &timeConstantsResultsFile)
Set time constants result file.
void setExperimentRun(int experiment, int run)
Set experiment and run numbers.
void checkAlignment()
Check alignment.
void setTimeCableDelayResultsFile(const std::string &timeCableDelayResultsFile)
Set time cable delay results file.
const KLMElementNumbers * m_ElementNumbers
Element numbers.
std::string m_GlobalTagName
Global Tag name.
void setStripEfficiencyResultsFile(const std::string &stripEfficiencyResultsFile)
Set strip efficiency results file.
std::string m_AlignmentResultsFile
Output file for alignment results.
std::string m_testingPayloadName
Testing payload location.
std::string m_TimeCableDelayResultsFile
Output file for time cable delay results.
std::string m_StripEfficiencyResultsFile
Output file for alignment results.
std::string m_TimeConstantsResultsFile
Output file for time constants results.
void createStripEfficiencyHistograms()
Create strip efficiency histograms.
void printPayloadInformation(DBObjPtr< T > &dbObject)
Print payload information.
void setAlignmentResultsFile(const std::string &alignmentResultsFile)
Set alignment results file.
StoreObjPtr< EventMetaData > m_EventMetaData
Event metadata.
KLM element numbers.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.