CMS 3D CMS Logo

L1TdeCSCTPG.cc
Go to the documentation of this file.
1 #include <string>
2 
4 
6  : dataALCT_token_(consumes<CSCALCTDigiCollection>(ps.getParameter<edm::InputTag>("dataALCT"))),
7  emulALCT_token_(consumes<CSCALCTDigiCollection>(ps.getParameter<edm::InputTag>("emulALCT"))),
8  dataCLCT_token_(consumes<CSCCLCTDigiCollection>(ps.getParameter<edm::InputTag>("dataCLCT"))),
9  emulCLCT_token_(consumes<CSCCLCTDigiCollection>(ps.getParameter<edm::InputTag>("emulCLCT"))),
10  dataLCT_token_(consumes<CSCCorrelatedLCTDigiCollection>(ps.getParameter<edm::InputTag>("dataLCT"))),
11  emulLCT_token_(consumes<CSCCorrelatedLCTDigiCollection>(ps.getParameter<edm::InputTag>("emulLCT"))),
12  monitorDir_(ps.getParameter<std::string>("monitorDir")),
13 
14  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
15  dataEmul_(ps.getParameter<std::vector<std::string>>("dataEmul")),
16 
17  // variables
18  alctVars_(ps.getParameter<std::vector<std::string>>("alctVars")),
19  clctVars_(ps.getParameter<std::vector<std::string>>("lctVars")),
20  lctVars_(ps.getParameter<std::vector<std::string>>("lctVars")),
21 
22  // binning
23  alctNBin_(ps.getParameter<std::vector<unsigned>>("alctNBin")),
24  clctNBin_(ps.getParameter<std::vector<unsigned>>("lctNBin")),
25  lctNBin_(ps.getParameter<std::vector<unsigned>>("lctNBin")),
26  alctMinBin_(ps.getParameter<std::vector<double>>("alctMinBin")),
27  clctMinBin_(ps.getParameter<std::vector<double>>("lctMinBin")),
28  lctMinBin_(ps.getParameter<std::vector<double>>("lctMinBin")),
29  alctMaxBin_(ps.getParameter<std::vector<double>>("alctMaxBin")),
30  clctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")),
31  lctMaxBin_(ps.getParameter<std::vector<double>>("lctMaxBin")) {}
32 
34 
37 
38  // chamber type
39  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
40  // data vs emulator
41  for (unsigned iData = 0; iData < dataEmul_.size(); iData++) {
42  // alct variable
43  for (unsigned iVar = 0; iVar < alctVars_.size(); iVar++) {
44  const std::string key("alct_" + alctVars_[iVar] + "_" + dataEmul_[iData]);
45  const std::string histName(key + "_" + chambers_[iType]);
46  const std::string histTitle(chambers_[iType] + " ALCT " + alctVars_[iVar] + " (" + dataEmul_[iData] + ") ");
47  chamberHistos[iType][key] =
48  iBooker.book1D(histName, histTitle, alctNBin_[iVar], alctMinBin_[iVar], alctMaxBin_[iVar]);
49  }
50 
51  // clct variable
52  for (unsigned iVar = 0; iVar < clctVars_.size(); iVar++) {
53  const std::string key("clct_" + clctVars_[iVar] + "_" + dataEmul_[iData]);
54  const std::string histName(key + "_" + chambers_[iType]);
55  const std::string histTitle(chambers_[iType] + " CLCT " + clctVars_[iVar] + " (" + dataEmul_[iData] + ") ");
56  chamberHistos[iType][key] =
57  iBooker.book1D(histName, histTitle, clctNBin_[iVar], clctMinBin_[iVar], clctMaxBin_[iVar]);
58  }
59 
60  // lct variable
61  for (unsigned iVar = 0; iVar < lctVars_.size(); iVar++) {
62  const std::string key("lct_" + lctVars_[iVar] + "_" + dataEmul_[iData]);
63  const std::string histName(key + "_" + chambers_[iType]);
64  const std::string histTitle(chambers_[iType] + " LCT " + lctVars_[iVar] + " (" + dataEmul_[iData] + ") ");
65  chamberHistos[iType][key] =
66  iBooker.book1D(histName, histTitle, lctNBin_[iVar], lctMinBin_[iVar], lctMaxBin_[iVar]);
67  }
68  }
69  }
70 }
71 
73  // handles
80 
81  e.getByToken(dataALCT_token_, dataALCTs);
82  e.getByToken(emulALCT_token_, emulALCTs);
83  e.getByToken(dataCLCT_token_, dataCLCTs);
84  e.getByToken(emulCLCT_token_, emulCLCTs);
85  e.getByToken(dataLCT_token_, dataLCTs);
86  e.getByToken(emulLCT_token_, emulLCTs);
87 
88  for (auto it = dataALCTs->begin(); it != dataALCTs->end(); it++) {
89  auto range = dataALCTs->get((*it).first);
90  const int type = ((*it).first).iChamberType() - 1;
91  for (auto alct = range.first; alct != range.second; alct++) {
92  chamberHistos[type]["alct_quality_data"]->Fill(alct->getQuality());
93  chamberHistos[type]["alct_wiregroup_data"]->Fill(alct->getKeyWG());
94  chamberHistos[type]["alct_bx_data"]->Fill(alct->getBX());
95  }
96  }
97 
98  for (auto it = emulALCTs->begin(); it != emulALCTs->end(); it++) {
99  auto range = emulALCTs->get((*it).first);
100  const int type = ((*it).first).iChamberType() - 1;
101  for (auto alct = range.first; alct != range.second; alct++) {
102  chamberHistos[type]["alct_quality_emul"]->Fill(alct->getQuality());
103  chamberHistos[type]["alct_wiregroup_emul"]->Fill(alct->getKeyWG());
104  chamberHistos[type]["alct_bx_emul"]->Fill(alct->getBX());
105  }
106  }
107 
108  for (auto it = dataCLCTs->begin(); it != dataCLCTs->end(); it++) {
109  auto range = dataCLCTs->get((*it).first);
110  const int type = ((*it).first).iChamberType() - 1;
111  for (auto clct = range.first; clct != range.second; clct++) {
112  chamberHistos[type]["clct_pattern_data"]->Fill(clct->getPattern());
113  chamberHistos[type]["clct_quality_data"]->Fill(clct->getQuality());
114  chamberHistos[type]["clct_halfstrip_data"]->Fill(clct->getKeyStrip());
115  chamberHistos[type]["clct_bend_data"]->Fill(clct->getBend());
116  }
117  }
118 
119  for (auto it = emulCLCTs->begin(); it != emulCLCTs->end(); it++) {
120  auto range = emulCLCTs->get((*it).first);
121  const int type = ((*it).first).iChamberType() - 1;
122  for (auto clct = range.first; clct != range.second; clct++) {
123  chamberHistos[type]["clct_pattern_emul"]->Fill(clct->getPattern());
124  chamberHistos[type]["clct_quality_emul"]->Fill(clct->getQuality());
125  chamberHistos[type]["clct_halfstrip_emul"]->Fill(clct->getKeyStrip());
126  chamberHistos[type]["clct_bend_emul"]->Fill(clct->getBend());
127  }
128  }
129 
130  for (auto it = dataLCTs->begin(); it != dataLCTs->end(); it++) {
131  auto range = dataLCTs->get((*it).first);
132  const int type = ((*it).first).iChamberType() - 1;
133  for (auto lct = range.first; lct != range.second; lct++) {
134  chamberHistos[type]["lct_pattern_data"]->Fill(lct->getCLCTPattern());
135  chamberHistos[type]["lct_quality_data"]->Fill(lct->getQuality());
136  chamberHistos[type]["lct_wiregroup_data"]->Fill(lct->getKeyWG());
137  chamberHistos[type]["lct_halfstrip_data"]->Fill(lct->getStrip());
138  chamberHistos[type]["lct_bend_data"]->Fill(lct->getBend());
139  }
140  }
141 
142  for (auto it = emulLCTs->begin(); it != emulLCTs->end(); it++) {
143  auto range = emulLCTs->get((*it).first);
144  const int type = ((*it).first).iChamberType() - 1;
145  for (auto lct = range.first; lct != range.second; lct++) {
146  chamberHistos[type]["lct_pattern_emul"]->Fill(lct->getCLCTPattern());
147  chamberHistos[type]["lct_quality_emul"]->Fill(lct->getQuality());
148  chamberHistos[type]["lct_wiregroup_emul"]->Fill(lct->getKeyWG());
149  chamberHistos[type]["lct_halfstrip_emul"]->Fill(lct->getStrip());
150  chamberHistos[type]["lct_bend_emul"]->Fill(lct->getBend());
151  }
152  }
153 }
L1TdeCSCTPG::dataLCT_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > dataLCT_token_
Definition: L1TdeCSCTPG.h:29
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
L1TdeCSCTPG::alctVars_
std::vector< std::string > alctVars_
Definition: L1TdeCSCTPG.h:36
L1TdeCSCTPG::lctMaxBin_
std::vector< double > lctMaxBin_
Definition: L1TdeCSCTPG.h:48
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TdeCSCTPG::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1TdeCSCTPG.cc:72
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::Handle< CSCALCTDigiCollection >
L1TdeCSCTPG::alctNBin_
std::vector< unsigned > alctNBin_
Definition: L1TdeCSCTPG.h:40
L1TdeCSCTPG::emulLCT_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > emulLCT_token_
Definition: L1TdeCSCTPG.h:30
L1TdeCSCTPG::alctMinBin_
std::vector< double > alctMinBin_
Definition: L1TdeCSCTPG.h:43
L1TdeCSCTPG::~L1TdeCSCTPG
~L1TdeCSCTPG() override
Definition: L1TdeCSCTPG.cc:33
L1TdeCSCTPG::chamberHistos
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
Definition: L1TdeCSCTPG.h:52
L1TdeCSCTPG::L1TdeCSCTPG
L1TdeCSCTPG(const edm::ParameterSet &ps)
Definition: L1TdeCSCTPG.cc:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TdeCSCTPG.h
edm::ParameterSet
Definition: ParameterSet.h:47
B2GTnPMonitor_cfi.histTitle
histTitle
Definition: B2GTnPMonitor_cfi.py:112
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
L1TdeCSCTPG::alctMaxBin_
std::vector< double > alctMaxBin_
Definition: L1TdeCSCTPG.h:46
CSCALCTDigiCollection
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
CSCCorrelatedLCTDigiCollection
L1TdeCSCTPG::emulALCT_token_
edm::EDGetTokenT< CSCALCTDigiCollection > emulALCT_token_
Definition: L1TdeCSCTPG.h:26
L1TdeCSCTPG::lctNBin_
std::vector< unsigned > lctNBin_
Definition: L1TdeCSCTPG.h:42
L1TdeCSCTPG::chambers_
std::vector< std::string > chambers_
Definition: L1TdeCSCTPG.h:33
L1TdeCSCTPG::clctMaxBin_
std::vector< double > clctMaxBin_
Definition: L1TdeCSCTPG.h:47
L1TdeCSCTPG::clctNBin_
std::vector< unsigned > clctNBin_
Definition: L1TdeCSCTPG.h:41
L1TdeCSCTPG::dataCLCT_token_
edm::EDGetTokenT< CSCCLCTDigiCollection > dataCLCT_token_
Definition: L1TdeCSCTPG.h:27
std
Definition: JetResolutionObject.h:76
L1TdeCSCTPG::bookHistograms
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
Definition: L1TdeCSCTPG.cc:35
L1TdeCSCTPG::lctMinBin_
std::vector< double > lctMinBin_
Definition: L1TdeCSCTPG.h:45
CSCCLCTDigiCollection
L1TdeCSCTPG::emulCLCT_token_
edm::EDGetTokenT< CSCCLCTDigiCollection > emulCLCT_token_
Definition: L1TdeCSCTPG.h:28
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TdeCSCTPG::clctVars_
std::vector< std::string > clctVars_
Definition: L1TdeCSCTPG.h:37
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1TdeCSCTPG::dataEmul_
std::vector< std::string > dataEmul_
Definition: L1TdeCSCTPG.h:34
edm::Event
Definition: Event.h:73
crabWrapper.key
key
Definition: crabWrapper.py:19
L1TdeCSCTPG::monitorDir_
std::string monitorDir_
Definition: L1TdeCSCTPG.h:31
L1TdeCSCTPG::lctVars_
std::vector< std::string > lctVars_
Definition: L1TdeCSCTPG.h:38
L1TdeCSCTPG::clctMinBin_
std::vector< double > clctMinBin_
Definition: L1TdeCSCTPG.h:44
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1TdeCSCTPG::dataALCT_token_
edm::EDGetTokenT< CSCALCTDigiCollection > dataALCT_token_
Definition: L1TdeCSCTPG.h:25