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  }
40  }
41  }
42 }
43 
45  if (verbose_)
46  edm::LogInfo("L1TdeGEMTPG") << "L1TdeGEMTPG: analyzing collections" << std::endl;
47 
48  // handles
51  e.getByToken(data_token_, dataClusters);
52  e.getByToken(emul_token_, emulClusters);
53 
54  for (auto it = dataClusters->begin(); it != dataClusters->end(); it++) {
55  auto range = dataClusters->get((*it).first);
56  const int type = ((*it).first).station() - 1;
57  for (auto cluster = range.first; cluster != range.second; cluster++) {
58  if (cluster->isValid()) {
59  chamberHistos[type]["cluster_size_data"]->Fill(cluster->pads().size());
60  chamberHistos[type]["cluster_pad_data"]->Fill(cluster->pads().front());
61  chamberHistos[type]["cluster_bx_data"]->Fill(cluster->bx());
62  }
63  }
64  }
65 
66  for (auto it = emulClusters->begin(); it != emulClusters->end(); it++) {
67  auto range = emulClusters->get((*it).first);
68  const int type = ((*it).first).station() - 1;
69  for (auto cluster = range.first; cluster != range.second; cluster++) {
70  if (cluster->isValid()) {
71  chamberHistos[type]["cluster_size_emul"]->Fill(cluster->pads().size());
72  chamberHistos[type]["cluster_pad_emul"]->Fill(cluster->pads().front());
73  chamberHistos[type]["cluster_bx_emul"]->Fill(cluster->bx());
74  }
75  }
76  }
77 }
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:89281
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:37
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:44
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:46
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