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 
24 #include <iostream>
25 #include <fstream>
26 #include <vector>
27 
28 
29 // user include files
32 
35 
37 
40 
41 // GCT and RCT data formats
45 
46 // L1Extra
50 
51 // Ecal
53 
54 // DQM
57 
59 // Trigger Headers
60 
61 
62 
63 //
64 // class declaration
65 //
66 
67 class L1TCompare : public DQMEDAnalyzer {
68 
69 public:
70 
71 // Constructor
72  L1TCompare(const edm::ParameterSet& ps);
73 
74 // Destructor
75  ~L1TCompare() override;
76 
77 protected:
78 // Analyze
79  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
80 
81 // BeginRun
82  void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const&, edm::EventSetup const&) override;
83  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
84 
85 private:
86  // ----------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  std::ofstream logFile_;
112 
119 
120  //define Token(-s)
124 
125  class RctObject {
126  public:
127  RctObject(int eta, int phi, int rank):
128  eta_(eta), phi_(phi), rank_(rank)
129  {}
130  virtual ~RctObject() {}
131  int eta_, phi_;
132  int rank_;
133 
134  };
135  typedef std::vector<L1TCompare::RctObject> RctObjectCollection;
136 
137  // function for sorting the above collection based on rank.
138  // note it's then reverse-sorted (low to high) so you have to use
139  // the rbegin() and rend() and reverse_iterators.
140  static bool rctObjectComp(const RctObject &a, const RctObject &b)
141  {
142  // for equal rank I don't know what the appropriate sorting is.
143  if ( a.rank_ == b.rank_ ) {
144  if ( a.eta_ == b.eta_ ) {
145  return a.phi_ < b.phi_;
146  }
147  else {
148  return a.eta_ < b.eta_;
149  }
150  }
151  else {
152  return a.rank_ < b.rank_;
153  }
154  }
155 
156 
157 };
158 
159 #endif // L1TCOMPARE_H
~L1TCompare() override
Definition: L1TCompare.cc:131
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmCandsToken_
Definition: L1TCompare.h:123
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceRctEmRgn_token_
Definition: L1TCompare.h:114
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:92
bool verbose() const
Definition: L1TCompare.h:109
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:91
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:90
edm::InputTag rctSource_
Definition: L1TCompare.h:115
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:135
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:100
static bool rctObjectComp(const RctObject &a, const RctObject &b)
Definition: L1TCompare.h:140
edm::InputTag gctSource_
Definition: L1TCompare.h:116
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:102
bool verbose_
Definition: L1TCompare.h:108
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:94
std::ofstream logFile_
Definition: L1TCompare.h:111
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsToken_
Definition: L1TCompare.h:121
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEm_token_
Definition: L1TCompare.h:113
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:91
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:135
double b
Definition: hdecay.h:120
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:99
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:117
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:95
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmCandsToken_
Definition: L1TCompare.h:122
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:107
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTpgSource_token_
Definition: L1TCompare.h:118
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:96
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:127
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TCompare.cc:214
Definition: Run.h:45
bool monitorDaemon_
Definition: L1TCompare.h:109
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:101