ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootRun.h
Revision: 1.4
Committed: Wed Jun 10 11:17:06 2009 UTC (15 years, 10 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, all_3_2_5_01, all_2_2_9_03, all_2_2_9_02, all_2_2_9_01, HEAD
Branch point for: CMSSW_2_2_X_br
Changes since 1.3: +86 -85 lines
Log Message:
Better protection against missing collection / Cleaning data format selection / Last iteration for migration to PAT of Photons

File Contents

# Content
1 #ifndef TRootRun_h
2 #define TRootRun_h
3
4 #include <string>
5 #include <iostream>
6 #include <vector>
7
8 #include "Rtypes.h"
9 #include "TObject.h"
10 #include "TVector3.h"
11
12 using namespace std;
13
14 class TRootRun : public TObject
15 {
16
17 public:
18
19 TRootRun() :
20 xsection_(-1.)
21 ,description_("MVCM")
22 ,nHLTEvents_(0)
23 ,nHLTWasRun_(0)
24 ,nHLTAccept_(0)
25 ,nHLTErrors_(0)
26 ,hltWasRun_(0)
27 ,hltAccept_(0)
28 ,hltErrors_(0)
29 ,hltNames_(0)
30 {;}
31
32 ~TRootRun() {;}
33
34 Double_t xsection() const { return xsection_; }
35 std::string description() const { return description_; }
36
37 unsigned int nHLTPaths() const { return hltNames_.size(); }
38 unsigned int nHLTEvents() const { return nHLTEvents_; }
39 unsigned int nHLTWasRun() const { return nHLTWasRun_; }
40 unsigned int nHLTAccept() const { return nHLTAccept_; }
41 unsigned int nHLTErrors() const { return nHLTErrors_; }
42
43 std::vector<unsigned int> hltWasRun() const { return hltWasRun_; }
44 std::vector<unsigned int> hltAccept() const { return hltAccept_; }
45 std::vector<unsigned int> hltErrors() const { return hltErrors_; }
46 std::vector<std::string> hltNames() const { return hltNames_; }
47
48 unsigned int hltWasRun(unsigned ipath) const { return (hltWasRun_.size()>ipath ? hltWasRun_.at(ipath) : 0 ); }
49 unsigned int hltAccept(unsigned ipath) const { return (hltAccept_.size()>ipath ? hltAccept_.at(ipath) : 0 ); }
50 unsigned int hltErrors(unsigned ipath) const { return (hltErrors_.size()>ipath ? hltErrors_.at(ipath) : 0 ); }
51 std::string hltNames(unsigned ipath) const { return (hltNames_.size()>ipath ? hltNames_.at(ipath) : "noname" ); }
52
53 void setXsection(Double_t xsection) { xsection_=xsection; }
54 void setDescription(std::string description) { description_=description; }
55 void setNHLTEvents(unsigned int nHLTEvents) { nHLTEvents_=nHLTEvents; }
56 void setNHLTWasRun(unsigned int nHLTWasRun) { nHLTWasRun_=nHLTWasRun; }
57 void setNHLTAccept(unsigned int nHLTAccept) { nHLTAccept_=nHLTAccept; }
58 void setNHLTErrors(unsigned int nHLTErrors) { nHLTErrors_=nHLTErrors; }
59
60 void setHLTWasRun(std::vector<unsigned int> hltWasRun)
61 {
62 hltWasRun_.resize(hltWasRun.size());
63 hltWasRun_=hltWasRun;
64 }
65
66 void setHLTAccept(std::vector<unsigned int> hltAccept)
67 {
68 hltAccept_.resize(hltAccept.size());
69 hltAccept_=hltAccept;
70 }
71
72 void setHLTErrors(std::vector<unsigned int> hltErrors)
73 {
74 hltErrors_.resize(hltErrors.size());
75 hltErrors_=hltErrors;
76 }
77
78 void setHLTNames(std::vector<std::string> hltNames)
79 {
80 hltNames_.resize(hltNames.size());
81 hltNames_=hltNames;
82 }
83
84
85 private:
86
87 Double_t xsection_; // dataset cross-section
88 std::string description_; // dataset description
89
90 unsigned int nHLTEvents_; // Nb of events
91 unsigned int nHLTWasRun_; // Nb of events where at least one HLT was run
92 unsigned int nHLTAccept_; // Nb of accepted events
93 unsigned int nHLTErrors_; // Nb of events where at least one HLT had error
94
95 std::vector<unsigned int> hltWasRun_; // # where HLT[i] was run
96 std::vector<unsigned int> hltAccept_; // # of events accepted by HLT[i]
97 std::vector<unsigned int> hltErrors_; // # of events with error in HLT[i]
98 std::vector<std::string> hltNames_; // name of each HLT algorithm
99
100 ClassDef (TRootRun,2);
101
102 };
103
104 #endif