Project
Loading...
Searching...
No Matches
CalibratorPadGainTracks.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
14
16
17using namespace o2::tpc;
18
20{
21 // Here we initialize the vector of our output objects
22 mIntervals.clear();
23 mCalibs.clear();
24 mTimeIntervals.clear();
25}
26
27void CalibratorPadGainTracks::setTruncationRange(const float low, const float high)
28{
29 mLowTruncation = low;
30 mUpTruncation = high;
31}
32
33void CalibratorPadGainTracks::setRelGainRange(const float minRelgain, const float maxRelgain)
34{
35 mMinRelgain = minRelgain;
36 mMaxRelgain = maxRelgain;
37}
38
40{
41 const TFType startTF = slot.getTFStart();
42 const TFType endTF = slot.getTFEnd();
43 LOGP(info, "Finalizing slot {} <= TF <= {}", startTF, endTF);
44
45 auto& calibPadGainTracks = *slot.getContainer();
46 calibPadGainTracks.setNormalizationType(mNormType);
47 calibPadGainTracks.setLogTransformQ(mLogTransformQ);
48 calibPadGainTracks.finalize(mMinEntriesMean, mMinRelgain, mMaxRelgain, mLowTruncation, mUpTruncation);
49 mIntervals.emplace_back(startTF, endTF);
50 mTimeIntervals.emplace_back(slot.getStartTimeMS(), slot.getEndTimeMS());
51 auto& extractedGainMap = calibPadGainTracks.getPadGainMap();
52
53 if (mUseLastExtractedMapAsReference) {
54 // multiply extracted gain map with last extracted gain map
55 if (mGainMapLastIteration) {
56 LOGP(info, "Multiplying gain map with the extracted map from the last iteration");
57 extractedGainMap *= *mGainMapLastIteration;
58 }
59 }
60
61 std::unordered_map<std::string, CalPad> cal({{"GainMap", extractedGainMap}});
62
63 if (mStoreNClCCDB) {
64 cal["NClusters"] = calibPadGainTracks.getNTracksMap();
65 }
66
67 if (mStoreRMSCCDB) {
68 cal["SigmaMap"] = calibPadGainTracks.getSigmaMap();
69 }
70
71 mCalibs.emplace_back(cal);
72
73 if (mUseLastExtractedMapAsReference) {
74 // buffer current extracted gain map
75 LOGP(info, "Buffering extracted gain map from the current iteration");
76 mGainMapLastIteration = std::make_unique<CalPad>(extractedGainMap);
77 }
78
79 if (mWriteDebug) {
80 calibPadGainTracks.dumpToFile(fmt::format("calPadGainTracksBase_TF_{}_to_{}.root", startTF, endTF).data());
81 }
82}
83
85{
86 auto& cont = getSlots();
87 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
88 slot.setContainer(std::make_unique<CalibPadGainTracksBase>());
89 return slot;
90}
TFType getTFEnd() const
Definition TimeSlot.h:47
long getStartTimeMS() const
Definition TimeSlot.h:50
long getEndTimeMS() const
Definition TimeSlot.h:51
const Container * getContainer() const
Definition TimeSlot.h:53
TFType getTFStart() const
Definition TimeSlot.h:46
void setRelGainRange(const float minRelgain=0.1f, const float maxRelgain=2.f)
void finalizeSlot(Slot &slot) final
process time slot (create pad-by-pad gain map from tracks)
void setTruncationRange(const float low=0.05f, const float high=0.6f)
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
Creates new time slot.
void initOutput() final
clearing the output
GLboolean * data
Definition glcorearb.h:298
Global TPC definitions and constants.
Definition SimTraits.h:167