forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultCalibrator.h
More file actions
120 lines (98 loc) · 4.07 KB
/
Copy pathmultCalibrator.h
File metadata and controls
120 lines (98 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//
// This code calculates a centrality calibration based on output
// from the multiplicityQa task.
//
// Comments, suggestions, questions? Please write to:
// - victor.gonzalez@cern.ch
// - david.dobrigkeit.chinellato@cern.ch
//
#ifndef COMMON_TOOLS_MULTIPLICITY_MULTCALIBRATOR_H_
#define COMMON_TOOLS_MULTIPLICITY_MULTCALIBRATOR_H_
#include <TH1.h>
#include <TNamed.h>
#include <TString.h>
#include <Rtypes.h>
#include <RtypesCore.h>
#include <iostream>
class multCalibrator : public TNamed
{
public:
// Constructors/Destructor
multCalibrator();
explicit multCalibrator(const char* name, const char* title = "Multiplicity Calibration Class");
~multCalibrator();
// void Print(Option_t *option="") const;
//_________________________________________________________________________
// Interface: steering functions to be used in calibration macro
// Set Filenames
void SetInputFile(TString lFile) { fInputFileName = lFile.Data(); }
void SetOutputFile(TString lFile) { fOutputFileName = lFile.Data(); }
// Set Boundaries to find
void SetBoundaries(Long_t lNB, Double_t* lB)
{
if (lNB < 2 || lNB > 1e+6) {
std::cout << "Please make sure you are using a reasonable number of boundaries!" << std::endl;
lNB = -1;
}
lDesiredBoundaries = lB;
lNDesiredBoundaries = lNB;
}
void SetAnchorPointRaw(Float_t lRaw) { fAnchorPointValue = lRaw; }
void SetAnchorPointPercentage(Float_t lPer) { fAnchorPointPercentage = lPer; }
void SetStandardAdaptiveBoundaries(); // standard adaptive (pp-like)
void SetRun3AdaptiveBoundaries(); // Run 3 adaptive (down to 0.00001%)
void SetStandardOnePercentBoundaries(); // standard 1% (Pb-Pb like)
bool IsBinningSane(TH1* histogram); // for safety
// Master Function in this Class: To be called once filenames are set
Bool_t Calibrate();
// Aux function. Keep public, accessible outside as rather useful utility
TH1F* GetCalibrationHistogram(TH1* histoRaw, TString lHistoName = "hCalib");
// Auxiliary functions
Double_t GetRawMax(TH1* histo);
Double_t GetBoundaryForPercentile(TH1* histo, Double_t lPercentileRequested, Double_t& lPrecisionEstimate);
// Precision bookkeeping
TH1D* GetPrecisionHistogram() { return fPrecisionHistogram; } // gets precision histogram from current object
void ResetPrecisionHistogram(); // Reset precision histogram, if it exists
// Aliases for centrality estimators
enum fCentEstim {
kCentRawV0M = 0,
kCentRawT0M,
kCentRawFDD,
kCentRawNTracks,
kCentZeqV0M,
kCentZeqT0M,
kCentZeqFDD,
kCentZeqNTracks,
kNCentEstim
};
static const TString fCentEstimName[kNCentEstim]; //! name (internal)
private:
// Calibration Boundaries to locate
Double_t* lDesiredBoundaries;
Long_t lNDesiredBoundaries;
Double_t fkPrecisionWarningThreshold;
TString fInputFileName; // Filename for TTree object for calibration purposes
TString fBufferFileName; // Filename for TTree object (buffer file)
TString fOutputFileName; // Filename for calibration OADB output
// Anchor point functionality
Float_t fAnchorPointValue; // AP value (raw estimator)
Float_t fAnchorPointPercentage; // AP percentage
// TList object for storing histograms
TList* fCalibHists;
TH1D* fPrecisionHistogram; // for bookkeeping of precision report
ClassDef(multCalibrator, 1);
//(this classdef is only for bookkeeping, class will not usually
// be streamed according to current workflow except in very specific
// tests!)
};
#endif // COMMON_TOOLS_MULTIPLICITY_MULTCALIBRATOR_H_