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