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
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::rctSourceEm_token_
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEm_token_
Definition: L1TCompare.h:104
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
L1TCompare::rctGctLeadingNonIsoEmEta_
MonitorElement * rctGctLeadingNonIsoEmEta_
Definition: L1TCompare.h:87
MessageLogger.h
L1TCompare::RctObjectCollection
std::vector< L1TCompare::RctObject > RctObjectCollection
Definition: L1TCompare.h:123
L1GctCollections.h
L1TCompare::RctObject::phi_
int phi_
Definition: L1TCompare.h:120
edm::Run
Definition: Run.h:45
L1TCompare::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:131
edm::EDGetTokenT< L1CaloEmCollection >
L1TCompare::rctGctLeadingIsoEmPhi_
MonitorElement * rctGctLeadingIsoEmPhi_
Definition: L1TCompare.h:84
L1TCompare::nev_
int nev_
Definition: L1TCompare.h:97
L1TCompare::gctCenJetsToken_
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsToken_
Definition: L1TCompare.h:112
L1TCompare::ecalTpgSource_token_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTpgSource_token_
Definition: L1TCompare.h:109
DQMStore.h
L1TCompare::ecalTpgSource_
edm::InputTag ecalTpgSource_
Definition: L1TCompare.h:108
L1TCompare::rctGctLeadingNonIsoEmPhi_
MonitorElement * rctGctLeadingNonIsoEmPhi_
Definition: L1TCompare.h:88
EDAnalyzer.h
L1TCompare::logFile_
std::ofstream logFile_
Definition: L1TCompare.h:102
L1TCompare::gctIsoEmCandsToken_
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmCandsToken_
Definition: L1TCompare.h:113
L1TCompare::monitorDaemon_
bool monitorDaemon_
Definition: L1TCompare.h:100
L1TCompare::verbose
bool verbose() const
Definition: L1TCompare.h:100
MakerMacros.h
L1TCompare::ecalTpgRctLeadingEmPhi_
MonitorElement * ecalTpgRctLeadingEmPhi_
Definition: L1TCompare.h:94
L1TCompare::RctObject
Definition: L1TCompare.h:116
L1TCompare::outputFile_
std::string outputFile_
Definition: L1TCompare.h:98
L1TCompare::ecalTpgRctLeadingEmEta_
MonitorElement * ecalTpgRctLeadingEmEta_
Definition: L1TCompare.h:92
L1TCompare::gctNonIsoEmCandsToken_
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmCandsToken_
Definition: L1TCompare.h:114
Service.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1TCompare::rctGctLeadingNonIsoEmRank_
MonitorElement * rctGctLeadingNonIsoEmRank_
Definition: L1TCompare.h:89
EcalDigiCollections.h
L1TCompare::rctGctLeadingIsoEmRank_
MonitorElement * rctGctLeadingIsoEmRank_
Definition: L1TCompare.h:85
L1TCompare::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TCompare.cc:191
b
double b
Definition: hdecay.h:118
L1TCompare::rctSourceRctEmRgn_token_
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceRctEmRgn_token_
Definition: L1TCompare.h:105
DQMEDAnalyzer.h
L1EmParticleFwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
L1CaloRegionDetId.h
L1TCompare::RctObject::rank_
int rank_
Definition: L1TCompare.h:121
L1JetParticleFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
L1EtMissParticleFwd.h
Event.h
L1TCompare::~L1TCompare
~L1TCompare() override
Definition: L1TCompare.cc:125
L1TCompare::L1TCompare
L1TCompare(const edm::ParameterSet &ps)
Definition: L1TCompare.cc:90
L1TCompare::dqmBeginRun
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TCompare.cc:127
L1CaloCollections.h
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1TCompare::ecalTpgRctLeadingEmRank_
MonitorElement * ecalTpgRctLeadingEmRank_
Definition: L1TCompare.h:95
DDAxes::phi
L1TCompare::verbose_
bool verbose_
Definition: L1TCompare.h:99
L1TCompare::rctGctLeadingIsoEmEta_
MonitorElement * rctGctLeadingIsoEmEta_
Definition: L1TCompare.h:83
Frameworkfwd.h
L1TCompare::rctSource_
edm::InputTag rctSource_
Definition: L1TCompare.h:106
L1TCompare::RctObject::eta_
int eta_
Definition: L1TCompare.h:120
L1TCompare::ecalTpgRctLeadingEmEta2_
MonitorElement * ecalTpgRctLeadingEmEta2_
Definition: L1TCompare.h:93
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
L1TCompare::gctSource_
edm::InputTag gctSource_
Definition: L1TCompare.h:107
L1TCompare::rctObjectComp
static bool rctObjectComp(const RctObject &a, const RctObject &b)
Definition: L1TCompare.h:128
L1TCompare
Definition: L1TCompare.h:62
edm::Event
Definition: Event.h:73
L1TCompare::RctObject::RctObject
RctObject(int eta, int phi, int rank)
Definition: L1TCompare.h:118
edm::InputTag
Definition: InputTag.h:15
L1TCompare::RctObject::~RctObject
virtual ~RctObject()
Definition: L1TCompare.h:119
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37