CMS 3D CMS Logo

CentralityBins.h
Go to the documentation of this file.
1 #ifndef __Cent_Bin_h__
2 #define __Cent_Bin_h__
3 
4 #include <TNamed.h>
5 #include <TFile.h>
6 #include <vector>
7 #include <map>
8 
9 class CBin : public TObject {
10 public:
11  CBin() { ; }
12  ~CBin() override { ; }
13 
14  float bin_edge;
15  float n_part_mean;
16  float n_part_var;
17  float n_coll_mean;
18  float n_coll_var;
19  float n_hard_mean;
20  float n_hard_var;
21  float b_mean;
22  float b_var;
23 
24  float eccRP_mean;
25  float eccRP_var;
26  float ecc2_mean;
27  float ecc2_var;
28  float ecc3_mean;
29  float ecc3_var;
30 
31  float s_mean;
32  float s_var;
33 
34  ClassDefOverride(CBin, 1)
35 };
36 
37 class CentralityBins : public TNamed {
38 public:
39  typedef std::map<int, const CentralityBins*> RunMap;
40 
42  CentralityBins(const char* name, const char* title, int nbins) : TNamed(name, title) {
43  table_.reserve(nbins);
44  for (int j = 0; j < nbins; ++j) {
45  CBin b;
46  table_.push_back(b);
47  }
48  }
49  ~CentralityBins() override { ; }
50  int getBin(double value) const;
51  int getNbins() const { return table_.size(); }
52  float lowEdge(double value) const { return lowEdgeOfBin(getBin(value)); }
53  float lowEdgeOfBin(int bin) const { return table_[bin].bin_edge; }
54  float NpartMean(double value) const { return NpartMeanOfBin(getBin(value)); }
55  float NpartMeanOfBin(int bin) const { return table_[bin].n_part_mean; }
56  float NpartSigma(double value) const { return NpartSigmaOfBin(getBin(value)); }
57  float NpartSigmaOfBin(int bin) const { return table_[bin].n_part_var; }
58  float NcollMean(double value) const { return NcollMeanOfBin(getBin(value)); }
59  float NcollMeanOfBin(int bin) const { return table_[bin].n_coll_mean; }
60  float NcollSigma(double value) const { return NcollSigmaOfBin(getBin(value)); }
61  float NcollSigmaOfBin(int bin) const { return table_[bin].n_coll_var; }
62  float NhardMean(double value) const { return NhardMeanOfBin(getBin(value)); }
63  float NhardMeanOfBin(int bin) const { return table_[bin].n_hard_mean; }
64  float NhardSigma(double value) const { return NhardSigmaOfBin(getBin(value)); }
65  float NhardSigmaOfBin(int bin) const { return table_[bin].n_hard_var; }
66  float bMean(double value) const { return bMeanOfBin(getBin(value)); }
67  float bMeanOfBin(int bin) const { return table_[bin].b_mean; }
68  float bSigma(double value) const { return bSigmaOfBin(getBin(value)); }
69  float bSigmaOfBin(int bin) const { return table_[bin].b_var; }
70 
71  float eccentricityRPMean(double value) const { return eccentricityRPMeanOfBin(getBin(value)); }
72  float eccentricityRPMeanOfBin(int bin) const { return table_[bin].eccRP_mean; }
74  float eccentricityRPSigmaOfBin(int bin) const { return table_[bin].eccRP_var; }
75  float eccentricityMean(double value) const { return eccentricityMeanOfBin(getBin(value)); }
76  float eccentricityMeanOfBin(int bin) const { return table_[bin].ecc2_mean; }
77  float eccentricitySigma(double value) const { return eccentricitySigmaOfBin(getBin(value)); }
78  float eccentricitySigmaOfBin(int bin) const { return table_[bin].ecc2_var; }
79  float triangularityMean(double value) const { return triangularityMeanOfBin(getBin(value)); }
80  float triangularityMeanOfBin(int bin) const { return table_[bin].ecc3_mean; }
81  float triangularitySigma(double value) const { return triangularitySigmaOfBin(getBin(value)); }
82  float triangularitySigmaOfBin(int bin) const { return table_[bin].ecc3_var; }
83  float areaMean(double value) const { return areaMeanOfBin(getBin(value)); }
84  float areaMeanOfBin(int bin) const { return table_[bin].s_mean; }
85  float areaSigma(double value) const { return areaSigmaOfBin(getBin(value)); }
86  float areaSigmaOfBin(int bin) const { return table_[bin].s_var; }
87 
88  // private:
89  std::vector<CBin> table_;
90  ClassDefOverride(CentralityBins, 1)
91 };
92 
94  TDirectoryFile*, const char* dir, const char* tag, int firstRun = 0, int lastRun = 10);
95 CentralityBins::RunMap getCentralityFromFile(TDirectoryFile*, const char* tag, int firstRun = 0, int lastRun = 10);
96 
97 #endif
CentralityBins::eccentricityRPSigmaOfBin
float eccentricityRPSigmaOfBin(int bin) const
Definition: CentralityBins.h:74
dataset.firstRun
firstRun
Definition: dataset.py:940
CentralityBins::table_
std::vector< CBin > table_
Definition: CentralityBins.h:89
CBin::~CBin
~CBin() override
Definition: CentralityBins.h:12
CentralityBins::triangularitySigmaOfBin
float triangularitySigmaOfBin(int bin) const
Definition: CentralityBins.h:82
CentralityBins::~CentralityBins
~CentralityBins() override
Definition: CentralityBins.h:49
CentralityBins::bMean
float bMean(double value) const
Definition: CentralityBins.h:66
CBin::ecc3_var
float ecc3_var
Definition: CentralityBins.h:29
CBin::n_hard_var
float n_hard_var
Definition: CentralityBins.h:20
CBin::n_coll_var
float n_coll_var
Definition: CentralityBins.h:18
CentralityBins::RunMap
std::map< int, const CentralityBins * > RunMap
Definition: CentralityBins.h:39
SiStripBadComponentsDQMServiceTemplate_cfg.lastRun
lastRun
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:27
getCentralityFromFile
CentralityBins::RunMap getCentralityFromFile(TDirectoryFile *, const char *dir, const char *tag, int firstRun=0, int lastRun=10)
Definition: CentralityBins.cc:21
CentralityBins::eccentricityRPMean
float eccentricityRPMean(double value) const
Definition: CentralityBins.h:71
CentralityBins::areaMean
float areaMean(double value) const
Definition: CentralityBins.h:83
CentralityBins::NpartSigma
float NpartSigma(double value) const
Definition: CentralityBins.h:56
CentralityBins::NpartMean
float NpartMean(double value) const
Definition: CentralityBins.h:54
CBin::s_var
float s_var
Definition: CentralityBins.h:32
CentralityBins::NcollSigmaOfBin
float NcollSigmaOfBin(int bin) const
Definition: CentralityBins.h:61
CentralityBins::lowEdge
float lowEdge(double value) const
Definition: CentralityBins.h:52
CBin::ecc2_mean
float ecc2_mean
Definition: CentralityBins.h:26
CentralityBins::eccentricityRPSigma
float eccentricityRPSigma(double value) const
Definition: CentralityBins.h:73
CBin::b_mean
float b_mean
Definition: CentralityBins.h:21
CBin::eccRP_mean
float eccRP_mean
Definition: CentralityBins.h:24
CentralityBins::NcollMean
float NcollMean(double value) const
Definition: CentralityBins.h:58
CBin
Definition: CentralityBins.h:9
CentralityBins::NhardMean
float NhardMean(double value) const
Definition: CentralityBins.h:62
CBin::bin_edge
float bin_edge
Definition: CentralityBins.h:14
CentralityBins::eccentricityMean
float eccentricityMean(double value) const
Definition: CentralityBins.h:75
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
CentralityBins
Definition: CentralityBins.h:37
CentralityBins::areaMeanOfBin
float areaMeanOfBin(int bin) const
Definition: CentralityBins.h:84
CBin::eccRP_var
float eccRP_var
Definition: CentralityBins.h:25
CentralityBins::bMeanOfBin
float bMeanOfBin(int bin) const
Definition: CentralityBins.h:67
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
CBin::n_part_var
float n_part_var
Definition: CentralityBins.h:16
CentralityBins::areaSigma
float areaSigma(double value) const
Definition: CentralityBins.h:85
CentralityBins::NhardMeanOfBin
float NhardMeanOfBin(int bin) const
Definition: CentralityBins.h:63
CentralityBins::eccentricityMeanOfBin
float eccentricityMeanOfBin(int bin) const
Definition: CentralityBins.h:76
b
double b
Definition: hdecay.h:118
CentralityBins::NcollSigma
float NcollSigma(double value) const
Definition: CentralityBins.h:60
CentralityBins::NhardSigmaOfBin
float NhardSigmaOfBin(int bin) const
Definition: CentralityBins.h:65
CentralityBins::lowEdgeOfBin
float lowEdgeOfBin(int bin) const
Definition: CentralityBins.h:53
CentralityBins::triangularityMean
float triangularityMean(double value) const
Definition: CentralityBins.h:79
CBin::ecc3_mean
float ecc3_mean
Definition: CentralityBins.h:28
CBin::ecc2_var
float ecc2_var
Definition: CentralityBins.h:27
CentralityBins::bSigma
float bSigma(double value) const
Definition: CentralityBins.h:68
CentralityBins::NcollMeanOfBin
float NcollMeanOfBin(int bin) const
Definition: CentralityBins.h:59
CentralityBins::triangularityMeanOfBin
float triangularityMeanOfBin(int bin) const
Definition: CentralityBins.h:80
CentralityBins::NhardSigma
float NhardSigma(double value) const
Definition: CentralityBins.h:64
value
Definition: value.py:1
CentralityBins::triangularitySigma
float triangularitySigma(double value) const
Definition: CentralityBins.h:81
CentralityBins::eccentricitySigma
float eccentricitySigma(double value) const
Definition: CentralityBins.h:77
CBin::b_var
float b_var
Definition: CentralityBins.h:22
CentralityBins::CentralityBins
CentralityBins()
Definition: CentralityBins.h:41
CBin::n_hard_mean
float n_hard_mean
Definition: CentralityBins.h:19
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
CentralityBins::bSigmaOfBin
float bSigmaOfBin(int bin) const
Definition: CentralityBins.h:69
CBin::CBin
CBin()
Definition: CentralityBins.h:11
CentralityBins::areaSigmaOfBin
float areaSigmaOfBin(int bin) const
Definition: CentralityBins.h:86
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CBin::n_part_mean
float n_part_mean
Definition: CentralityBins.h:15
CBin::s_mean
float s_mean
Definition: CentralityBins.h:31
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CBin::n_coll_mean
float n_coll_mean
Definition: CentralityBins.h:17
CentralityBins::getNbins
int getNbins() const
Definition: CentralityBins.h:51
CentralityBins::NpartMeanOfBin
float NpartMeanOfBin(int bin) const
Definition: CentralityBins.h:55
CentralityBins::eccentricityRPMeanOfBin
float eccentricityRPMeanOfBin(int bin) const
Definition: CentralityBins.h:72
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
CentralityBins::getBin
int getBin(double value) const
Definition: CentralityBins.cc:5
CentralityBins::CentralityBins
CentralityBins(const char *name, const char *title, int nbins)
Definition: CentralityBins.h:42
CentralityBins::NpartSigmaOfBin
float NpartSigmaOfBin(int bin) const
Definition: CentralityBins.h:57
CentralityBins::eccentricitySigmaOfBin
float eccentricitySigmaOfBin(int bin) const
Definition: CentralityBins.h:78