forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFFitWeights.h
More file actions
83 lines (70 loc) · 2.45 KB
/
FFitWeights.h
File metadata and controls
83 lines (70 loc) · 2.45 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
// 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.
/// \file FFitWeights.h
/// \brief Class for handling fit weights for ESE framework. Hold methods for loading and calculating all ESE splines. Supports FT0C, in the future it will support FT0A, FV0A and TPC.
///
/// \author Joachim C. K. B. Hansen
#ifndef COMMON_CORE_FFITWEIGHTS_H_
#define COMMON_CORE_FFITWEIGHTS_H_
#include <TCollection.h>
#include <TFile.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TH3D.h>
#include <TMath.h>
#include <TNamed.h>
#include <TObjArray.h>
#include <TString.h>
#include <algorithm>
#include <complex>
#include <memory>
#include <string>
#include <utility>
#include <vector>
class FFitWeights : public TNamed
{
public:
FFitWeights();
explicit FFitWeights(const char* name);
~FFitWeights();
void init();
void fillWeights(float centrality, float qn, int nh, const char* pf = "");
TObjArray* getDataArray() { return fW_data; }
void setCentBin(int bin) { CentBin = bin; }
void setBinAxis(int bin, float min, float max)
{
qAxis = new TAxis(bin, min, max);
}
TAxis* getqVecAx() { return qAxis; }
Long64_t Merge(TCollection* collist);
void qSelection(const std::vector<int>& nhv, const std::vector<std::string>& stv);
float eval(float centr, const float& dqn, const int nh, const char* pf = "");
void setResolution(int res) { nResolution = res; }
int getResolution() const { return nResolution; }
void setQnType(const std::vector<std::pair<int, std::string>>& qninp) { qnTYPE = qninp; }
private:
TObjArray* fW_data;
int CentBin;
TAxis* qAxis; //!
int nResolution;
std::vector<std::pair<int, std::string>> qnTYPE;
const char* getQName(const int nh, const char* pf = "")
{
return Form("q%i%s", nh, pf);
};
const char* getAxisName(const int nh, const char* pf = "")
{
return Form(";Centrality;q_{%i}^{%s}", nh, pf);
};
void addArray(TObjArray* targ, TObjArray* sour);
ClassDef(FFitWeights, 1); // calibration class
};
#endif // COMMON_CORE_FFITWEIGHTS_H_