Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:20

0001 #ifndef __Cent_Bin_h__
0002 #define __Cent_Bin_h__
0003 
0004 #include <TNamed.h>
0005 #include <TFile.h>
0006 #include <vector>
0007 #include <map>
0008 
0009 class CBin : public TObject {
0010 public:
0011   CBin() { ; }
0012   ~CBin() override { ; }
0013 
0014   float bin_edge;
0015   float n_part_mean;
0016   float n_part_var;
0017   float n_coll_mean;
0018   float n_coll_var;
0019   float n_hard_mean;
0020   float n_hard_var;
0021   float b_mean;
0022   float b_var;
0023 
0024   float eccRP_mean;
0025   float eccRP_var;
0026   float ecc2_mean;
0027   float ecc2_var;
0028   float ecc3_mean;
0029   float ecc3_var;
0030 
0031   float s_mean;
0032   float s_var;
0033 
0034   ClassDefOverride(CBin, 1)
0035 };
0036 
0037 class CentralityBins : public TNamed {
0038 public:
0039   typedef std::map<int, const CentralityBins*> RunMap;
0040 
0041   CentralityBins() { ; }
0042   CentralityBins(const char* name, const char* title, int nbins) : TNamed(name, title) {
0043     table_.reserve(nbins);
0044     for (int j = 0; j < nbins; ++j) {
0045       CBin b;
0046       table_.push_back(b);
0047     }
0048   }
0049   ~CentralityBins() override { ; }
0050   int getBin(double value) const;
0051   int getNbins() const { return table_.size(); }
0052   float lowEdge(double value) const { return lowEdgeOfBin(getBin(value)); }
0053   float lowEdgeOfBin(int bin) const { return table_[bin].bin_edge; }
0054   float NpartMean(double value) const { return NpartMeanOfBin(getBin(value)); }
0055   float NpartMeanOfBin(int bin) const { return table_[bin].n_part_mean; }
0056   float NpartSigma(double value) const { return NpartSigmaOfBin(getBin(value)); }
0057   float NpartSigmaOfBin(int bin) const { return table_[bin].n_part_var; }
0058   float NcollMean(double value) const { return NcollMeanOfBin(getBin(value)); }
0059   float NcollMeanOfBin(int bin) const { return table_[bin].n_coll_mean; }
0060   float NcollSigma(double value) const { return NcollSigmaOfBin(getBin(value)); }
0061   float NcollSigmaOfBin(int bin) const { return table_[bin].n_coll_var; }
0062   float NhardMean(double value) const { return NhardMeanOfBin(getBin(value)); }
0063   float NhardMeanOfBin(int bin) const { return table_[bin].n_hard_mean; }
0064   float NhardSigma(double value) const { return NhardSigmaOfBin(getBin(value)); }
0065   float NhardSigmaOfBin(int bin) const { return table_[bin].n_hard_var; }
0066   float bMean(double value) const { return bMeanOfBin(getBin(value)); }
0067   float bMeanOfBin(int bin) const { return table_[bin].b_mean; }
0068   float bSigma(double value) const { return bSigmaOfBin(getBin(value)); }
0069   float bSigmaOfBin(int bin) const { return table_[bin].b_var; }
0070 
0071   float eccentricityRPMean(double value) const { return eccentricityRPMeanOfBin(getBin(value)); }
0072   float eccentricityRPMeanOfBin(int bin) const { return table_[bin].eccRP_mean; }
0073   float eccentricityRPSigma(double value) const { return eccentricityRPSigmaOfBin(getBin(value)); }
0074   float eccentricityRPSigmaOfBin(int bin) const { return table_[bin].eccRP_var; }
0075   float eccentricityMean(double value) const { return eccentricityMeanOfBin(getBin(value)); }
0076   float eccentricityMeanOfBin(int bin) const { return table_[bin].ecc2_mean; }
0077   float eccentricitySigma(double value) const { return eccentricitySigmaOfBin(getBin(value)); }
0078   float eccentricitySigmaOfBin(int bin) const { return table_[bin].ecc2_var; }
0079   float triangularityMean(double value) const { return triangularityMeanOfBin(getBin(value)); }
0080   float triangularityMeanOfBin(int bin) const { return table_[bin].ecc3_mean; }
0081   float triangularitySigma(double value) const { return triangularitySigmaOfBin(getBin(value)); }
0082   float triangularitySigmaOfBin(int bin) const { return table_[bin].ecc3_var; }
0083   float areaMean(double value) const { return areaMeanOfBin(getBin(value)); }
0084   float areaMeanOfBin(int bin) const { return table_[bin].s_mean; }
0085   float areaSigma(double value) const { return areaSigmaOfBin(getBin(value)); }
0086   float areaSigmaOfBin(int bin) const { return table_[bin].s_var; }
0087 
0088   // private:
0089   std::vector<CBin> table_;
0090   ClassDefOverride(CentralityBins, 1)
0091 };
0092 
0093 CentralityBins::RunMap getCentralityFromFile(
0094     TDirectoryFile*, const char* dir, const char* tag, int firstRun = 0, int lastRun = 10);
0095 CentralityBins::RunMap getCentralityFromFile(TDirectoryFile*, const char* tag, int firstRun = 0, int lastRun = 10);
0096 
0097 #endif