Belle II Software  release-06-02-00
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 /* Belle 2 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 
87  void checkAlignment();
88 
92  void checkStripEfficiency();
93 
98 
99  private:
100 
104  void initializeDatabase();
105 
109  void resetDatabase();
110 
114  template<class T> void printPayloadInformation(DBObjPtr<T>& dbObject)
115  {
116  B2INFO("Analyzing the following payload:"
117  << LogVar("Global Tag", m_GlobalTagName.c_str())
118  << LogVar("Name", dbObject.getName())
119  << LogVar("Revision", dbObject.getRevision())
120  << LogVar("IoV", dbObject.getIoV()));
121  }
122 
125 
127  int m_run;
128 
130  std::string m_testingPayloadName = "";
131 
133  std::string m_GlobalTagName = "";
134 
136  std::string m_AlignmentResultsFile = "alignment.root";
137 
139  std::string m_StripEfficiencyResultsFile = "strip_efficiency.root";
140 
143 
146 
147  };
148 
150 }
151 
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 setGlobalTag(const std::string &globalTagName)
Set Global Tag name.
void checkStripEfficiency()
Check strip efficiency.
void resetDatabase()
Reset the database.
void initializeDatabase()
Initialize the database.
void setExperimentRun(int experiment, int run)
Set experiment and run numbers.
void checkAlignment()
Check alignment.
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_StripEfficiencyResultsFile
Output file for alignment 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:95
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.