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
float ecc2_var
float s_mean
float areaMean(double value) const
float eccRP_var
float NcollSigmaOfBin(int bin) const
float NpartSigmaOfBin(int bin) const
float eccentricityRPSigmaOfBin(int bin) const
float bin_edge
float NhardMean(double value) const
float triangularitySigmaOfBin(int bin) const
float eccentricityMean(double value) const
float eccentricityRPSigma(double value) const
float areaSigma(double value) const
float NcollMean(double value) const
float n_part_mean
float eccentricityRPMean(double value) const
float NhardMeanOfBin(int bin) const
float NhardSigmaOfBin(int bin) const
float lowEdgeOfBin(int bin) const
std::map< int, const CentralityBins * > RunMap
float n_hard_var
float eccentricitySigma(double value) const
float b_var
float areaMeanOfBin(int bin) const
float NcollMeanOfBin(int bin) const
float n_hard_mean
float lowEdge(double value) const
float ecc2_mean
float triangularitySigma(double value) const
float bMeanOfBin(int bin) const
Definition: value.py:1
float eccentricityMeanOfBin(int bin) const
float NcollSigma(double value) const
float eccRP_mean
float ecc3_var
float n_coll_mean
float triangularityMean(double value) const
float bSigma(double value) const
float NpartMeanOfBin(int bin) const
double b
Definition: hdecay.h:120
float NhardSigma(double value) const
float bSigmaOfBin(int bin) const
float areaSigmaOfBin(int bin) const
float n_part_var
~CBin() override
float b_mean
int getBin(double value) const
float eccentricitySigmaOfBin(int bin) const
~CentralityBins() override
float eccentricityRPMeanOfBin(int bin) const
float triangularityMeanOfBin(int bin) const
float s_var
int getNbins() const
std::vector< CBin > table_
float NpartSigma(double value) const
float NpartMean(double value) const
CentralityBins(const char *name, const char *title, int nbins)
float ecc3_mean
float n_coll_var
float bMean(double value) const
CentralityBins::RunMap getCentralityFromFile(TDirectoryFile *, const char *dir, const char *tag, int firstRun=0, int lastRun=10)