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 <unistd.h>
22 
23 #include <iostream>
24 #include <fstream>
25 #include <vector>
26 
27 // user include files
29 
32 
34 
37 
38 // GCT and RCT data formats
42 
43 // L1Extra
47 
48 // Ecal
50 
51 // DQM
53 
55 // Trigger Headers
56 
57 //
58 // class declaration
59 //
60 
61 class L1TCompare : public DQMEDAnalyzer {
62 public:
63  // Constructor
64  L1TCompare(const edm::ParameterSet& ps);
65 
66  // Destructor
67  ~L1TCompare() override;
68 
69 protected:
70  // Analyze
71  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
72 
73  // BeginRun
74  void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&, edm::EventSetup const&) override;
75  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
76 
77 private:
78  // ----------member data ---------------------------
79 
80  // ++ RCT-GCT
81  // - iso
85  // - non-iso
89 
90  // ++ ECAL TPG - RCT
95 
96  int nev_; // Number of events processed
97  std::string outputFile_; //file name for ROOT ouput
98  bool verbose_;
99  bool verbose() const { return verbose_; };
100  bool monitorDaemon_;
101  std::ofstream logFile_;
102 
109 
110  //define Token(-s)
114 
115  class RctObject {
116  public:
117  RctObject(int eta, int phi, int rank) : eta_(eta), phi_(phi), rank_(rank) {}
118  virtual ~RctObject() {}
119  int eta_, phi_;
120  int rank_;
121  };
122  typedef std::vector<L1TCompare::RctObject> RctObjectCollection;
123 
124  // function for sorting the above collection based on rank.
125  // note it's then reverse-sorted (low to high) so you have to use
126  // the rbegin() and rend() and reverse_iterators.
127  static bool rctObjectComp(const RctObject& a, const RctObject& b) {
128  // for equal rank I don't know what the appropriate sorting is.
129  if (a.rank_ == b.rank_) {
130  if (a.eta_ == b.eta_) {
131  return a.phi_ < b.phi_;
132  } else {
133  return a.eta_ < b.eta_;
134  }
135  } else {
136  return a.rank_ < b.rank_;
137  }
138  }
139 };
140 
141 #endif // L1TCOMPARE_H
~L1TCompare() override
Definition: L1TCompare.cc:125
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmCandsToken_
Definition: L1TCompare.h:113
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceRctEmRgn_token_
Definition: L1TCompare.h:104
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:84
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:90
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:82
edm::InputTag rctSource_
Definition: L1TCompare.h:105
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:127
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:92
static bool rctObjectComp(const RctObject &a, const RctObject &b)
Definition: L1TCompare.h:127
edm::InputTag gctSource_
Definition: L1TCompare.h:106
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:94
bool verbose_
Definition: L1TCompare.h:98
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:86
std::ofstream logFile_
Definition: L1TCompare.h:101
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsToken_
Definition: L1TCompare.h:111
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEm_token_
Definition: L1TCompare.h:103
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:83
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:122
double b
Definition: hdecay.h:118
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:91
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:107
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:87
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmCandsToken_
Definition: L1TCompare.h:112
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:131
double a
Definition: hdecay.h:119
std::string outputFile_
Definition: L1TCompare.h:97
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTpgSource_token_
Definition: L1TCompare.h:108
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:88
bool verbose() const
Definition: L1TCompare.h:99
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:117
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TCompare.cc:191
Definition: Run.h:45
bool monitorDaemon_
Definition: L1TCompare.h:99
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:93