CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TCompare.h
Go to the documentation of this file.
1 // -*-C++-*-
2 #ifndef L1TCOMPARE_H
3 #define L1TCOMPARE_H
4 
5 /*
6  * \file L1TCompare.h
7  *
8  * \author P. Wittich
9  *
10  * Revision 1.2 2007/06/08 08:37:42 wittich
11  * Add ECAL TP - RCT comparisons. Lingering problems with
12  * mismatches right now - still needs work.
13  *
14  *
15  *
16  *
17 */
18 
19 // system include files
20 #include <memory>
21 #include <functional>
22 #include <unistd.h>
23 
24 
25 #include <iostream>
26 #include <fstream>
27 #include <vector>
28 
29 
30 // user include files
33 
36 
38 
41 
42 // GCT and RCT data formats
46 
47 // L1Extra
51 
52 // Ecal
54 
55 // DQM
58 
59 
60 // Trigger Headers
61 
62 
63 
64 //
65 // class declaration
66 //
67 
68 class L1TCompare : public edm::EDAnalyzer {
69 
70 public:
71 
72 // Constructor
73  L1TCompare(const edm::ParameterSet& ps);
74 
75 // Destructor
76  virtual ~L1TCompare();
77 
78 protected:
79 // Analyze
80  void analyze(const edm::Event& e, const edm::EventSetup& c);
81 
82 // BeginJob
83  void beginJob(void);
84 
85 // BeginRun
86  void beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup);
87 
88 
89 // EndJob
90  void endJob(void);
91 
92 private:
93  // ----------member data ---------------------------
95 
96  // ++ RCT-GCT
97  // - iso
101  // - non-iso
105 
106  // ++ ECAL TPG - RCT
111 
112 
113 
114  int nev_; // Number of events processed
115  std::string outputFile_; //file name for ROOT ouput
116  bool verbose_;
117  bool verbose() const { return verbose_; };
118  bool monitorDaemon_;
119  std::ofstream logFile_;
120 
127 
128  //define Token(-s)
132 
133  class RctObject {
134  public:
135  RctObject(int eta, int phi, int rank):
136  eta_(eta), phi_(phi), rank_(rank)
137  {}
138  virtual ~RctObject() {}
139  int eta_, phi_;
140  int rank_;
141 
142  };
143  typedef std::vector<L1TCompare::RctObject> RctObjectCollection;
144 
145  // functor for sorting the above collection based on rank.
146  // note it's then reverse-sorted (low to high) so you have to use
147  // the rbegin() and rend() and reverse_iterators.
148  class RctObjectComp: public std::binary_function<L1TCompare::RctObject,
149  L1TCompare::RctObject, bool>
150  {
151  public:
152  bool operator()(const RctObject &a, const RctObject &b) const
153  {
154  // for equal rank I don't know what the appropriate sorting is.
155  if ( a.rank_ == b.rank_ ) {
156  if ( a.eta_ == b.eta_ ) {
157  return a.phi_ < b.phi_;
158  }
159  else {
160  return a.eta_ < b.eta_;
161  }
162  }
163  else {
164  return a.rank_ < b.rank_;
165  }
166  }
167  };
168 
169 
170 };
171 
172 #endif // L1TCOMPARE_H
DQMStore * dbe
Definition: L1TCompare.h:94
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmCandsToken_
Definition: L1TCompare.h:131
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceRctEmRgn_token_
Definition: L1TCompare.h:122
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:100
bool verbose() const
Definition: L1TCompare.h:117
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:91
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:98
edm::InputTag rctSource_
Definition: L1TCompare.h:123
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:108
void endJob(void)
Definition: L1TCompare.cc:234
T eta() const
edm::InputTag gctSource_
Definition: L1TCompare.h:124
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:110
bool verbose_
Definition: L1TCompare.h:116
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:102
virtual ~L1TCompare()
Definition: L1TCompare.cc:143
bool operator()(const RctObject &a, const RctObject &b) const
Definition: L1TCompare.h:152
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: L1TCompare.cc:246
std::ofstream logFile_
Definition: L1TCompare.h:119
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsToken_
Definition: L1TCompare.h:129
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEm_token_
Definition: L1TCompare.h:121
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:99
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:143
double b
Definition: hdecay.h:120
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:107
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:125
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:103
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmCandsToken_
Definition: L1TCompare.h:130
void beginJob(void)
Definition: L1TCompare.cc:147
double a
Definition: hdecay.h:121
std::string outputFile_
Definition: L1TCompare.h:115
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTpgSource_token_
Definition: L1TCompare.h:126
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:104
void beginRun(edm::Run const &iRun, edm::EventSetup const &iSetup)
Definition: L1TCompare.cc:153
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:135
Definition: Run.h:41
bool monitorDaemon_
Definition: L1TCompare.h:117
Definition: DDAxes.h:10
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:109