CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/HeavyIonEvent/interface/CentralityBins.h

Go to the documentation of this file.
00001 #ifndef __Cent_Bin_h__
00002 #define __Cent_Bin_h__
00003 
00004 #include <TNamed.h>
00005 #include <TFile.h>
00006 #include <vector>
00007 #include <map>
00008 
00009 class CBin : public TObject {
00010  public:
00011    CBin(){;}
00012    ~CBin(){;}
00013 
00014    float bin_edge;
00015    float n_part_mean;
00016    float n_part_var;
00017    float n_coll_mean;
00018    float n_coll_var;
00019    float n_hard_mean;
00020    float n_hard_var;
00021    float b_mean;
00022    float b_var;
00023 
00024    float eccRP_mean;
00025    float eccRP_var;
00026    float ecc2_mean;
00027    float ecc2_var;
00028    float ecc3_mean;
00029    float ecc3_var;
00030 
00031    float s_mean;
00032    float s_var;
00033 
00034    ClassDef(CBin,1)
00035 };
00036 
00037 class CentralityBins : public TNamed {
00038    
00039  public:
00040    typedef std::map<int, const CentralityBins*> RunMap;
00041 
00042    CentralityBins(){;}
00043    CentralityBins(const char* name, const char* title, int nbins) : TNamed(name,title) {
00044       table_.reserve(nbins);
00045       for(int j = 0; j < nbins; ++j){
00046          CBin b;
00047          table_.push_back(b); 
00048       }
00049    }
00050       ~CentralityBins() {;}
00051       int getBin(double value) const;
00052       int getNbins() const {return table_.size();}
00053       float lowEdge(double value) const { return lowEdgeOfBin(getBin(value));}
00054       float lowEdgeOfBin(int bin) const { return table_[bin].bin_edge;}
00055       float NpartMean(double value) const { return NpartMeanOfBin(getBin(value));}
00056       float NpartMeanOfBin(int bin) const { return table_[bin].n_part_mean;}
00057       float NpartSigma(double value) const { return NpartSigmaOfBin(getBin(value));}
00058       float NpartSigmaOfBin(int bin) const { return table_[bin].n_part_var;}
00059       float NcollMean(double value) const { return NcollMeanOfBin(getBin(value));}
00060       float NcollMeanOfBin(int bin) const { return table_[bin].n_coll_mean;}
00061       float NcollSigma(double value) const { return NcollSigmaOfBin(getBin(value));}
00062       float NcollSigmaOfBin(int bin) const { return table_[bin].n_coll_var;}
00063       float NhardMean(double value) const { return NhardMeanOfBin(getBin(value));}
00064       float NhardMeanOfBin(int bin) const { return table_[bin].n_hard_mean;}
00065       float NhardSigma(double value) const { return NhardSigmaOfBin(getBin(value));}
00066       float NhardSigmaOfBin(int bin) const { return table_[bin].n_hard_var;}
00067       float bMean(double value) const { return bMeanOfBin(getBin(value));}
00068       float bMeanOfBin(int bin) const { return table_[bin].b_mean;}
00069       float bSigma(double value) const { return bSigmaOfBin(getBin(value));}
00070       float bSigmaOfBin(int bin) const { return table_[bin].b_var;}
00071 
00072       float eccentricityRPMean(double value) const { return eccentricityRPMeanOfBin(getBin(value));}
00073       float eccentricityRPMeanOfBin(int bin) const { return table_[bin].eccRP_mean;}
00074       float eccentricityRPSigma(double value) const { return eccentricityRPSigmaOfBin(getBin(value));}
00075       float eccentricityRPSigmaOfBin(int bin) const { return table_[bin].eccRP_var;}
00076       float eccentricityMean(double value) const { return eccentricityMeanOfBin(getBin(value));}
00077       float eccentricityMeanOfBin(int bin) const { return table_[bin].ecc2_mean;}
00078       float eccentricitySigma(double value) const { return eccentricitySigmaOfBin(getBin(value));}
00079       float eccentricitySigmaOfBin(int bin) const { return table_[bin].ecc2_var;}      
00080       float triangularityMean(double value) const { return triangularityMeanOfBin(getBin(value));}
00081       float triangularityMeanOfBin(int bin) const { return table_[bin].ecc3_mean;}
00082       float triangularitySigma(double value) const { return triangularitySigmaOfBin(getBin(value));}
00083       float triangularitySigmaOfBin(int bin) const { return table_[bin].ecc3_var;}
00084       float areaMean(double value) const { return areaMeanOfBin(getBin(value));}
00085       float areaMeanOfBin(int bin) const { return table_[bin].s_mean;}
00086       float areaSigma(double value) const { return areaSigmaOfBin(getBin(value));}
00087       float areaSigmaOfBin(int bin) const { return table_[bin].s_var;}
00088 
00089       // private:
00090       std::vector<CBin> table_;
00091       ClassDef(CentralityBins,1)
00092 };
00093 
00094 CentralityBins::RunMap getCentralityFromFile(TDirectoryFile*, const char* dir, const char* tag, int firstRun = 0, int lastRun = 10);
00095 CentralityBins::RunMap getCentralityFromFile(TDirectoryFile*, const char* tag, int firstRun = 0, int lastRun = 10);
00096 
00097 
00098 
00099 
00100 
00101 #endif