ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/YieldStats.hh
Revision: 1.4
Committed: Tue Nov 8 20:30:38 2011 UTC (13 years, 5 months ago) by agilbert
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -0 lines
Log Message:
Added files for correction factor calculation

File Contents

# User Rev Content
1 agilbert 1.1 #ifndef HbbAnalysis_YieldStats_hh
2     #define HbbAnalysis_YieldStats_hh
3    
4     #include <stdarg.h>
5     #include <vector>
6     #include <string>
7     #include <map>
8    
9     namespace HbbAnalysis {//namespace
10    
11    
12     class YieldStats {
13     public:
14 agilbert 1.2 YieldStats(std::string sampleName, std::string yieldName);
15 agilbert 1.1 ~YieldStats(){;}
16     YieldStats(){;}
17    
18 agilbert 1.2 //Setters
19     void SetSampleName(std::string const& sampleName);
20     void SetYieldName(std::string const& yieldName);
21     void SetStepNames(std::vector<std::string> const& stepNames);
22     void SetBinNames(std::vector<std::string> const& binNames);
23    
24     //Getters
25     std::vector<std::string> GetStepNames() const;
26     std::vector<std::string> GetBinNames() const;
27     std::string GetSampleName() const { return sampleName_; }
28     std::string GetYieldName() const { return yieldName_; }
29    
30     void IncrementCount(unsigned run, unsigned binIndex, unsigned stepIndex, double value);
31     void IncrementCount(unsigned run, std::string binName, std::string stepName, double value);
32    
33 agilbert 1.3 double CalculateYield(std::string const& stepName) const;
34 agilbert 1.2 double CalculateYield(std::string stepName, unsigned minRun, unsigned maxRun) const;
35 agilbert 1.3 double CalculateYield(std::string stepName, std::vector<std::string> const& binNames) const;
36     double CalculateYield(std::string const& stepName, unsigned minRun, unsigned maxRun, std::vector<std::string> const& binNames) const;
37 agilbert 1.2
38 agilbert 1.4 bool HasStep(std::string const& testStep) const { return stepIndexMap_.count(testStep); }
39    
40 agilbert 1.2 //Access Methods
41     double & at(unsigned runIndex, unsigned binIndex, unsigned stepIndex);
42     double at(unsigned runIndex, unsigned binIndex, unsigned stepIndex) const;
43    
44     void Print() const;
45 agilbert 1.1
46     private:
47 agilbert 1.2 std::string sampleName_;
48 agilbert 1.1 std::string yieldName_;
49 agilbert 1.2 std::vector<double> yieldVector_;
50 agilbert 1.1 std::vector<std::string> stepNames_;
51 agilbert 1.2 std::vector<std::string> binNames_;
52 agilbert 1.1 std::map<std::string,unsigned> stepIndexMap_;
53 agilbert 1.2 std::map<std::string,unsigned> binIndexMap_;
54 agilbert 1.1 std::map<unsigned, unsigned> runIndexMap_;
55     };
56    
57     }//namespace
58    
59     #endif //HbbAnalysis_YieldStats_hh