Project
Loading...
Searching...
No Matches
DigiRecoTest.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include <TMath.h>
13#include "Framework/Logger.h"
24
25namespace o2
26{
27namespace zdc
28{
29
30//______________________________________________________________________________
32{
34 if (mCCDBServer.size() > 0) {
35 mgr.setURL(mCCDBServer);
36 mDigi.setCCDBServer(mCCDBServer);
37 }
38 mDigi.init();
39
40 LOG(info) << "Initialization of ZDC Test reconstruction " << mgr.getURL();
41 // CCDB server has been initialized in DigitizerTest
42 long timeStamp = mgr.getTimestamp();
43
44 auto* moduleConfig = mgr.get<o2::zdc::ModuleConfig>(o2::zdc::CCDBPathConfigModule);
45 if (!moduleConfig) {
46 LOG(fatal) << "Missing ModuleConfig configuration object @ " << o2::zdc::CCDBPathConfigModule;
47 return;
48 }
49 LOG(info) << "Loaded ModuleConfig for timestamp " << timeStamp;
50 moduleConfig->print();
51
52 // Configuration parameters for ZDC reconstruction
53 auto* recoConfigZDC = mgr.get<o2::zdc::RecoConfigZDC>(o2::zdc::CCDBPathRecoConfigZDC);
54 if (!recoConfigZDC) {
55 LOG(fatal) << "Missing RecoConfigZDC object";
56 return;
57 }
58 LOG(info) << "Loaded RecoConfigZDC for timestamp " << timeStamp;
59 recoConfigZDC->print();
60
61 // TDC centering
62 auto* tdcParam = mgr.get<o2::zdc::ZDCTDCParam>(o2::zdc::CCDBPathTDCCalib);
63 if (!tdcParam) {
64 LOG(fatal) << "Missing ZDCTDCParam calibration object";
65 return;
66 }
67 LOG(info) << "Loaded TDC centering ZDCTDCParam for timestamp " << timeStamp;
68 tdcParam->print();
69
70 // TDC correction parameters
71 auto* tdcCorr = mgr.get<o2::zdc::ZDCTDCCorr>(o2::zdc::CCDBPathTDCCorr);
72 if (!tdcCorr) {
73 LOG(fatal) << "Missing ZDCTDCCorr calibration object - no correction is applied";
74 } else {
75 if (mVerbosity > DbgZero) {
76 LOG(info) << "Loaded TDC correction parameters for timestamp " << timeStamp;
77 tdcCorr->print();
78 }
79 }
80
81 // Energy calibration
82 auto* energyParam = mgr.get<o2::zdc::ZDCEnergyParam>(o2::zdc::CCDBPathEnergyCalib);
83 if (!energyParam) {
84 LOG(warning)
85 << "Missing ZDCEnergyParam calibration object - using default";
86 } else {
87 LOG(info) << "Loaded Energy calibration ZDCEnergyParam for timestamp " << timeStamp;
88 energyParam->print();
89 }
90
91 // Tower calibration
92 auto* towerParam =
94 if (!towerParam) {
95 LOG(warning)
96 << "Missing ZDCTowerParam calibration object - using default";
97 } else {
98 LOG(info) << "Loaded Tower calibration ZDCTowerParam for timestamp " << timeStamp;
99 towerParam->print();
100 }
101
102 mDR.setModuleConfig(moduleConfig);
103 mDR.setRecoConfigZDC(recoConfigZDC);
104 mDR.setTDCParam(tdcParam);
105 mDR.setTDCCorr(tdcCorr);
106 mDR.setEnergyParam(energyParam);
107 mDR.setTowerParam(towerParam);
108 mDR.setVerbosity(mVerbosity);
109 mDR.init();
110
111 const uint32_t* mask = mDR.getChMask();
112 for (uint32_t ic = 0; ic < NChannels; ic++) {
113 mDigi.setMask(ic, mask[ic]);
114 }
115} // init
116
117} // namespace zdc
118} // namespace o2
ZDC reconstruction parameters.
ZDC reconstruction parameters.
ZDC Energy calibration.
ZDC TDC correction parameters.
Parameters to correct TDCs (produced by QA)
ZDC Tower calibration.
static BasicCCDBManager & instance()
void setTowerParam(const ZDCTowerParam *param)
Definition DigiReco.h:100
void setRecoConfigZDC(const RecoConfigZDC *cfg)
Definition DigiReco.h:104
void setModuleConfig(const ModuleConfig *moduleConfig)
Definition DigiReco.h:92
const uint32_t * getChMask() const
Definition DigiReco.h:142
void setTDCParam(const ZDCTDCParam *param)
Definition DigiReco.h:94
void setVerbosity(int v)
Definition DigiReco.h:74
void setEnergyParam(const ZDCEnergyParam *param)
Definition DigiReco.h:98
void setTDCCorr(const ZDCTDCCorr *param)
Definition DigiReco.h:96
void setCCDBServer(const std::string &s)
void setMask(uint32_t ich, uint32_t mask)
GLint GLuint mask
Definition glcorearb.h:291
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
const std::string CCDBPathTDCCorr
Definition Constants.h:223
constexpr int NChannels
Definition Constants.h:65
const std::string CCDBPathRecoConfigZDC
Definition Constants.h:220
const std::string CCDBPathEnergyCalib
Definition Constants.h:224
const std::string CCDBPathTDCCalib
Definition Constants.h:221
constexpr int DbgZero
Definition Constants.h:207
const std::string CCDBPathTowerCalib
Definition Constants.h:225
const std::string CCDBPathConfigModule
Definition Constants.h:219
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"