CMS 3D CMS Logo

L1TdeGEMTPG.cc
Go to the documentation of this file.
1 #include <string>
2 
4 
6  : data_token_(consumes<GEMPadDigiClusterCollection>(ps.getParameter<edm::InputTag>("data"))),
7  emul_token_(consumes<GEMPadDigiClusterCollection>(ps.getParameter<edm::InputTag>("emul"))),
8  monitorDir_(ps.getParameter<std::string>("monitorDir")),
9  verbose_(ps.getParameter<bool>("verbose")),
10 
11  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
12  dataEmul_(ps.getParameter<std::vector<std::string>>("dataEmul")),
13 
14  // variables
15  clusterVars_(ps.getParameter<std::vector<std::string>>("clusterVars")),
16 
17  // binning
18  clusterNBin_(ps.getParameter<std::vector<unsigned>>("clusterNBin")),
19  clusterMinBin_(ps.getParameter<std::vector<double>>("clusterMinBin")),
20  clusterMaxBin_(ps.getParameter<std::vector<double>>("clusterMaxBin")) {}
21 
23 
26 
27  // chamber type
28  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
29  // data vs emulator
30  for (unsigned iData = 0; iData < dataEmul_.size(); iData++) {
31  // cluster variable
32  for (unsigned iVar = 0; iVar < clusterVars_.size(); iVar++) {
33  const std::string key("cluster_" + clusterVars_[iVar] + "_" + dataEmul_[iData]);
34  const std::string histName(key + "_" + chambers_[iType]);
35  const std::string histTitle(chambers_[iType] + " Cluster " + clusterVars_[iVar] + " (" + dataEmul_[iData] +
36  ")");
37  chamberHistos[iType][key] =
38  iBooker.book1D(histName, histTitle, clusterNBin_[iVar], clusterMinBin_[iVar], clusterMaxBin_[iVar]);
39  chamberHistos[iType][key]->getTH1()->SetMinimum(0);
40  }
41  }
42  }
43 }
44 
46  if (verbose_)
47  edm::LogInfo("L1TdeGEMTPG") << "L1TdeGEMTPG: analyzing collections" << std::endl;
48 
49  // handles
52  e.getByToken(data_token_, dataClusters);
53  e.getByToken(emul_token_, emulClusters);
54 
55  for (auto it = dataClusters->begin(); it != dataClusters->end(); it++) {
56  auto range = dataClusters->get((*it).first);
57  const int type = ((*it).first).station() - 1;
58  for (auto cluster = range.first; cluster != range.second; cluster++) {
59  if (cluster->isValid()) {
60  chamberHistos[type]["cluster_size_data"]->Fill(cluster->pads().size());
61  chamberHistos[type]["cluster_pad_data"]->Fill(cluster->pads().front());
62  chamberHistos[type]["cluster_bx_data"]->Fill(cluster->bx());
63  }
64  }
65  }
66 
67  for (auto it = emulClusters->begin(); it != emulClusters->end(); it++) {
68  auto range = emulClusters->get((*it).first);
69  const int type = ((*it).first).station() - 1;
70  for (auto cluster = range.first; cluster != range.second; cluster++) {
71  if (cluster->isValid()) {
72  chamberHistos[type]["cluster_size_emul"]->Fill(cluster->pads().size());
73  chamberHistos[type]["cluster_pad_emul"]->Fill(cluster->pads().front());
74  chamberHistos[type]["cluster_bx_emul"]->Fill(cluster->bx());
75  }
76  }
77  }
78 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
electrons_cff.bool
bool
Definition: electrons_cff.py:366
L1TdeGEMTPG::chamberHistos
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
Definition: L1TdeGEMTPG.h:38
L1TdeGEMTPG::clusterNBin_
std::vector< unsigned > clusterNBin_
Definition: L1TdeGEMTPG.h:32
L1TdeGEMTPG::chambers_
std::vector< std::string > chambers_
Definition: L1TdeGEMTPG.h:28
edm::Run
Definition: Run.h:45
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TdeGEMTPG::dataEmul_
std::vector< std::string > dataEmul_
Definition: L1TdeGEMTPG.h:29
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
L1TdeGEMTPG::L1TdeGEMTPG
L1TdeGEMTPG(const edm::ParameterSet &ps)
Definition: L1TdeGEMTPG.cc:5
edm::Handle< GEMPadDigiClusterCollection >
L1TdeGEMTPG::monitorDir_
std::string monitorDir_
Definition: L1TdeGEMTPG.h:25
L1TdeGEMTPG::~L1TdeGEMTPG
~L1TdeGEMTPG() override
Definition: L1TdeGEMTPG.cc:22
L1TdeGEMTPG::clusterMinBin_
std::vector< double > clusterMinBin_
Definition: L1TdeGEMTPG.h:33
GEMPadDigiClusterCollection
L1TdeGEMTPG::bookHistograms
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
Definition: L1TdeGEMTPG.cc:24
edm::ParameterSet
Definition: ParameterSet.h:47
B2GTnPMonitor_cfi.histTitle
histTitle
Definition: B2GTnPMonitor_cfi.py:112
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
L1TdeGEMTPG::verbose_
bool verbose_
Definition: L1TdeGEMTPG.h:26
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
L1TdeGEMTPG::clusterVars_
std::vector< std::string > clusterVars_
Definition: L1TdeGEMTPG.h:31
L1TdeGEMTPG::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1TdeGEMTPG.cc:45
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TdeGEMTPG::clusterMaxBin_
std::vector< double > clusterMaxBin_
Definition: L1TdeGEMTPG.h:34
std
Definition: JetResolutionObject.h:76
L1TdeGEMTPG::emul_token_
edm::EDGetTokenT< GEMPadDigiClusterCollection > emul_token_
Definition: L1TdeGEMTPG.h:24
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TdeGEMTPG::data_token_
edm::EDGetTokenT< GEMPadDigiClusterCollection > data_token_
Definition: L1TdeGEMTPG.h:23
L1TdeGEMTPG.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
crabWrapper.key
key
Definition: crabWrapper.py:19
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