CMS 3D CMS Logo

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