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  * $Date: 2009/11/19 14:31:34 $
9  * $Revision: 1.4 $
10  * \author P. Wittich
11  * $Id: L1TCompare.h,v 1.4 2009/11/19 14:31:34 puigh Exp $
12  * $Log: L1TCompare.h,v $
13  * Revision 1.4 2009/11/19 14:31:34 puigh
14  * modify beginJob
15  *
16  * Revision 1.3 2008/03/01 00:40:00 lat
17  * DQM core migration.
18  *
19  * Revision 1.2 2007/06/08 08:37:42 wittich
20  * Add ECAL TP - RCT comparisons. Lingering problems with
21  * mismatches right now - still needs work.
22  *
23  *
24  *
25  *
26 */
27 
28 // system include files
29 #include <memory>
30 #include <functional>
31 #include <unistd.h>
32 
33 
34 #include <iostream>
35 #include <fstream>
36 #include <vector>
37 
38 
39 // user include files
42 
45 
47 
50 
51 // DQM
54 
55 
56 // Trigger Headers
57 
58 
59 
60 //
61 // class declaration
62 //
63 
64 class L1TCompare : public edm::EDAnalyzer {
65 
66 public:
67 
68 // Constructor
69  L1TCompare(const edm::ParameterSet& ps);
70 
71 // Destructor
72  virtual ~L1TCompare();
73 
74 protected:
75 // Analyze
76  void analyze(const edm::Event& e, const edm::EventSetup& c);
77 
78 // BeginJob
79  void beginJob(void);
80 
81 // EndJob
82 void endJob(void);
83 
84 private:
85  // ----------member data ---------------------------
87 
88  // ++ RCT-GCT
89  // - iso
93  // - non-iso
97 
98  // ++ ECAL TPG - RCT
103 
104 
105 
106  int nev_; // Number of events processed
107  std::string outputFile_; //file name for ROOT ouput
108  bool verbose_;
109  bool verbose() const { return verbose_; };
110  bool monitorDaemon_;
111  ofstream logFile_;
112 
116 
117  class RctObject {
118  public:
119  RctObject(int eta, int phi, int rank):
120  eta_(eta), phi_(phi), rank_(rank)
121  {}
122  virtual ~RctObject() {}
123  int eta_, phi_;
124  int rank_;
125 
126  };
127  typedef std::vector<L1TCompare::RctObject> RctObjectCollection;
128 
129  // functor for sorting the above collection based on rank.
130  // note it's then reverse-sorted (low to high) so you have to use
131  // the rbegin() and rend() and reverse_iterators.
132  class RctObjectComp: public std::binary_function<L1TCompare::RctObject,
133  L1TCompare::RctObject, bool>
134  {
135  public:
136  bool operator()(const RctObject &a, const RctObject &b) const
137  {
138  // for equal rank I don't know what the appropriate sorting is.
139  if ( a.rank_ == b.rank_ ) {
140  if ( a.eta_ == b.eta_ ) {
141  return a.phi_ < b.phi_;
142  }
143  else {
144  return a.eta_ < b.eta_;
145  }
146  }
147  else {
148  return a.rank_ < b.rank_;
149  }
150  }
151  };
152 
153 
154 };
155 
156 #endif // L1TCOMPARE_H
DQMStore * dbe
Definition: L1TCompare.h:86
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:92
bool verbose() const
Definition: L1TCompare.h:109
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:118
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:90
edm::InputTag rctSource_
Definition: L1TCompare.h:113
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:100
void endJob(void)
Definition: L1TCompare.cc:253
T eta() const
edm::InputTag gctSource_
Definition: L1TCompare.h:114
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:102
bool verbose_
Definition: L1TCompare.h:108
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:94
virtual ~L1TCompare()
Definition: L1TCompare.cc:160
bool operator()(const RctObject &a, const RctObject &b) const
Definition: L1TCompare.h:136
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: L1TCompare.cc:265
ofstream logFile_
Definition: L1TCompare.h:111
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:91
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:127
double b
Definition: hdecay.h:120
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:99
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:115
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:95
void beginJob(void)
Definition: L1TCompare.cc:164
double a
Definition: hdecay.h:121
std::string outputFile_
Definition: L1TCompare.h:107
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:96
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:119
bool monitorDaemon_
Definition: L1TCompare.h:109
Definition: DDAxes.h:10
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:101