CMS 3D CMS Logo

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 
60 // Trigger Headers
61 
62 
63 
64 //
65 // class declaration
66 //
67 
68 class L1TCompare : public DQMEDAnalyzer {
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) override;
81 
82 // BeginRun
83  virtual void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const&, edm::EventSetup const&) override;
84  virtual void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
85 
86 private:
87  // ----------member data ---------------------------
88 
89  // ++ RCT-GCT
90  // - iso
94  // - non-iso
98 
99  // ++ ECAL TPG - RCT
104 
105 
106 
107  int nev_; // Number of events processed
108  std::string outputFile_; //file name for ROOT ouput
109  bool verbose_;
110  bool verbose() const { return verbose_; };
111  bool monitorDaemon_;
112  std::ofstream logFile_;
113 
120 
121  //define Token(-s)
125 
126  class RctObject {
127  public:
128  RctObject(int eta, int phi, int rank):
129  eta_(eta), phi_(phi), rank_(rank)
130  {}
131  virtual ~RctObject() {}
132  int eta_, phi_;
133  int rank_;
134 
135  };
136  typedef std::vector<L1TCompare::RctObject> RctObjectCollection;
137 
138  // functor for sorting the above collection based on rank.
139  // note it's then reverse-sorted (low to high) so you have to use
140  // the rbegin() and rend() and reverse_iterators.
141  class RctObjectComp: public std::binary_function<L1TCompare::RctObject,
142  L1TCompare::RctObject, bool>
143  {
144  public:
145  bool operator()(const RctObject &a, const RctObject &b) const
146  {
147  // for equal rank I don't know what the appropriate sorting is.
148  if ( a.rank_ == b.rank_ ) {
149  if ( a.eta_ == b.eta_ ) {
150  return a.phi_ < b.phi_;
151  }
152  else {
153  return a.eta_ < b.eta_;
154  }
155  }
156  else {
157  return a.rank_ < b.rank_;
158  }
159  }
160  };
161 
162 
163 };
164 
165 #endif // L1TCOMPARE_H
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmCandsToken_
Definition: L1TCompare.h:124
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceRctEmRgn_token_
Definition: L1TCompare.h:115
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:93
bool verbose() const
Definition: L1TCompare.h:110
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:91
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:91
edm::InputTag rctSource_
Definition: L1TCompare.h:116
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:135
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:101
edm::InputTag gctSource_
Definition: L1TCompare.h:117
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:103
bool verbose_
Definition: L1TCompare.h:109
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:95
virtual ~L1TCompare()
Definition: L1TCompare.cc:131
bool operator()(const RctObject &a, const RctObject &b) const
Definition: L1TCompare.h:145
std::ofstream logFile_
Definition: L1TCompare.h:112
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsToken_
Definition: L1TCompare.h:122
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEm_token_
Definition: L1TCompare.h:114
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:92
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:136
double b
Definition: hdecay.h:120
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:100
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:118
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:96
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmCandsToken_
Definition: L1TCompare.h:123
virtual void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:139
double a
Definition: hdecay.h:121
std::string outputFile_
Definition: L1TCompare.h:108
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTpgSource_token_
Definition: L1TCompare.h:119
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:97
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:128
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TCompare.cc:214
Definition: Run.h:42
bool monitorDaemon_
Definition: L1TCompare.h:110
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:102