Belle II Software  release-08-01-10
ECLReferenceCrystalPerCrateCalib.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 /**************************************************************************
10  * Title: ECLReferenceCrystalPerCrateCalib *
11  * *
12  * General database object to keep track of the reference crystals, *
13  * one for each crate. This was Originally designed for *
14  * determining which crystal to define as having a crystal time *
15  * calibration consant fixed to a specific value to ensure there are *
16  * no extra degrees of freedom with the combiation of crystal and crate *
17  * time calibration constants. *
18  * *
19  * 1 <= cell id <= 8736 *
20  **************************************************************************/
21 
22 #pragma once
23 
24 /* ECL headers. */
25 #include <ecl/dataobjects/ECLElementNumbers.h>
26 
27 /* Basf2 headers. */
28 #include <framework/logging/Logger.h>
29 
30 /* ROOT headers. */
31 #include <TObject.h>
32 
33 namespace Belle2 {
41  class ECLReferenceCrystalPerCrateCalib: public TObject {
42 
43  public:
44 
47 
49  const std::vector<short>& getReferenceCrystals() const {return m_refCrystals;};
50 
52  void setCalibVector(const std::vector<short>& refCrystals)
53  {
54  if (refCrystals.size() != 52) {B2FATAL("ECLReferenceCrystalPerCrateCalib: wrong size vector uploaded, " << refCrystals.size() << " instead of 52 (one crystal per crate)");}
55  for (int i = 0; i < 52; i++) {
56  if ((refCrystals[i] < 1) ||
57  (refCrystals[i] > ECLElementNumbers::c_NCrystals)) {
58  B2FATAL(
59  "ECLReferenceCrystalPerCrateCalib: cell id outside valid range from 1 to "
60  << ECLElementNumbers::c_NCrystals << ". Crate " << i <<
61  " has reference cid = " << refCrystals[i]);
62  }
63  }
64  m_refCrystals = refCrystals;
65  };
66 
67  private:
68  std::vector<short> m_refCrystals;
71  };
73 }
General DB object to store one reference crystal per per ECL crate for calibration purposes.
ClassDef(ECLReferenceCrystalPerCrateCalib, 3)
ClassDef.
const std::vector< short > & getReferenceCrystals() const
Get vector of calibration constants.
void setCalibVector(const std::vector< short > &refCrystals)
Set vector of constants with uncertainties.
std::vector< short > m_refCrystals
Calibration constants.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.