CMS 3D CMS Logo

GEMPadDigiClusterSource.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
8  consumes<GEMPadDigiClusterCollection>(cfg.getParameter<edm::InputTag>("padDigiClusterInputLabel"));
9  lumiScalers_ = consumes<LumiScalersCollection>(
10  cfg.getUntrackedParameter<edm::InputTag>("lumiCollection", edm::InputTag("scalersRawToDigi")));
11  nBXMin_ = cfg.getParameter<int>("bxMin");
12  nBXMax_ = cfg.getParameter<int>("bxMax");
13  nCLSMax_ = cfg.getParameter<int>("clsMax");
14  nClusterSizeBinNum_ = cfg.getParameter<int>("ClusterSizeBinNum");
15 }
16 
19  desc.add<edm::InputTag>("padDigiClusterInputLabel", edm::InputTag("muonCSCDigis", "MuonGEMPadDigiCluster"));
20  desc.addUntracked<std::string>("runType", "online");
21  desc.addUntracked<std::string>("logCategory", "GEMPadDigiClusterSource");
22  desc.add<int>("bxMin", -15);
23  desc.add<int>("bxMax", 15);
24  desc.add<int>("clsMax", 9);
25  desc.add<int>("ClusterSizeBinNum", 9);
26  descriptions.add("GEMPadDigiClusterSource", desc);
27 }
28 
30  edm::Run const&,
31  edm::EventSetup const& iSetup) {
32  initGeometry(iSetup);
33  if (GEMGeometry_ == nullptr)
34  return;
35  loadChambers();
36 
37  strFolderMain_ = "GEM/PadDigiCluster";
38 
39  fRadiusMin_ = 120.0;
40  fRadiusMax_ = 250.0;
41 
43  "delta_pad_bx",
44  "Difference of Trigger Primitive Pad Number and BX ",
45  81,
46  -40 - 0.5,
47  40 + 0.5,
48  21,
49  -10 - 0.5,
50  10 + 0.5,
51  "Lay1 - Lay2 cluster central pad",
52  "Lay1 - Lay2 cluster BX");
54  "delta_pad",
55  "Difference of Trigger Primitive Pad Number ",
56  81,
57  -40 - 0.5,
58  40 + 0.5,
59  "Lay1 - Lay2 cluster central pad");
61  this, "delta_bx", "Difference of Trigger Primitive BX ", 21, -10 - 0.5, 10 + 0.5, "Lay1 - Lay2 cluster BX");
62 
63  mapBXCLSPerCh_ = MEMap4Inf(this, "bx", " Trigger Primitive Cluster BX ", 14, -0.5, 13.5, "Bunch crossing");
65  MEMap4Inf(this, "occ", "Trigger Primitive Occupancy ", 1, -0.5, 1.5, 1, 0.5, 1.5, "Pad number", "i#eta");
67  "pad",
68  "Trigger Primitive Pad Number and BX ",
69  1536,
70  0.5,
71  1536.5,
72  15,
73  -0.5,
74  15 - 0.5,
75  "Pad number",
76  "Cluster BX");
78  MEMap4Inf(this, "cls", "Trigger Primitive Cluster Size ", 9, 0.5, 9 + 0.5, 1, 0.5, 1.5, "Cluster Size", "i#eta");
79 
80  ibooker.cd();
82  GenerateMEPerChamber(ibooker);
83 }
84 
86 
88 
91  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/pad_bx_difference");
94 
95  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/pad_difference");
98 
99  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/bx_difference");
102 
103  return 0;
104 }
105 
107  ME3IdsKey key3 = key4Tokey3(key);
108  MEStationInfo& stationInfo = mapStationInfo_[key3];
109 
110  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/occupancy_" + getNameDirLayer(key3));
111 
112  int nNumVFATPerEta = stationInfo.nMaxVFAT_ / stationInfo.nNumEtaPartitions_;
113  int nNumCh = stationInfo.nNumDigi_;
114 
115  mapPadDigiOccPerCh_.SetBinConfX(nNumCh * nNumVFATPerEta / 2, -0.5);
119 
120  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/pads in time_" + getNameDirLayer(key3));
121  mapPadBxPerCh_.SetBinConfX(nNumCh * nNumVFATPerEta * stationInfo.nNumEtaPartitions_ / 2, -0.5);
123 
124  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/cluster size_" + getNameDirLayer(key3));
125 
129 
130  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/bx_cluster_" + getNameDirLayer(key3));
133  return 0;
134 }
135 
137  edm::Handle<GEMPadDigiClusterCollection> gemPadDigiClusters;
138  event.getByToken(this->tagPadDigiCluster_, gemPadDigiClusters);
140  event.getByToken(lumiScalers_, lumiScalers);
141 
142  int med_pad1, med_pad2;
143 
144  for (auto it = gemPadDigiClusters->begin(); it != gemPadDigiClusters->end(); it++) {
145  auto range = gemPadDigiClusters->get((*it).first);
146 
147  for (auto cluster = range.first; cluster != range.second; cluster++) {
148  if (cluster->isValid()) {
149  ME4IdsKey key4Ch{
150  ((*it).first).region(), ((*it).first).station(), ((*it).first).layer(), ((*it).first).chamber()};
151  ME3IdsKey key3Ch{((*it).first).region(), ((*it).first).station(), ((*it).first).chamber()};
152 
153  //Plot the bx of each cluster.
154  mapBXCLSPerCh_.Fill(key4Ch, cluster->bx());
155 
156  //Plot the size of clusters for each chamber and layer
157  Int_t nCLS = cluster->pads().size();
158  Int_t nCLSCutOff = std::min(nCLS, nCLSMax_);
159  mapPadCLSPerCh_.Fill(key4Ch, nCLSCutOff, ((*it).first).roll());
160 
161  //Plot of pad and bx diff of two layers per chamer.
162  med_pad1 = floor((cluster->pads().front() + cluster->pads().front() + cluster->pads().size() - 1) / 2);
163  for (auto it2 = gemPadDigiClusters->begin(); it2 != gemPadDigiClusters->end(); it2++) {
164  auto range2 = gemPadDigiClusters->get((*it2).first);
165 
166  for (auto cluster2 = range2.first; cluster2 != range2.second; cluster2++) {
167  if (cluster2->isValid()) {
168  med_pad2 = floor((cluster2->pads().front() + cluster2->pads().front() + cluster2->pads().size() - 1) / 2);
169 
170  if (((*it).first).chamber() == ((*it2).first).chamber() &&
171  ((*it).first).station() == ((*it2).first).station() &&
172  ((*it).first).region() == ((*it2).first).region() && ((*it).first).layer() == 1 &&
173  ((*it2).first).layer() == 2) {
174  if (abs(med_pad1 - med_pad2) <= 40 && abs(((*it).first).roll() - ((*it2).first).roll()) <= 1) {
175  mapPadBXDiffPerCh_.Fill(key3Ch, med_pad1 - med_pad2, cluster->bx() - cluster2->bx());
176  mapPadDiffPerCh_.Fill(key3Ch, med_pad1 - med_pad2);
177  mapBXDiffPerCh_.Fill(key3Ch, cluster->bx() - cluster2->bx());
178  }
179  }
180  }
181  }
182  }
183 
184  for (auto pad = cluster->pads().front(); pad < (cluster->pads().front() + cluster->pads().size()); pad++) {
185  //Plot of pad and bx for each chamber and layer
186  mapPadDigiOccPerCh_.Fill(key4Ch, pad, ((*it).first).roll());
187  mapPadBxPerCh_.Fill(key4Ch, pad + (192 * (8 - ((*it).first).roll())), cluster->bx());
188  }
189  }
190  }
191  }
192 }
193 
int ProcessWithMEMap2WithChamber(BookingHelper &bh, ME3IdsKey key) override
MEMapInfT< MEMap4Ids, ME4IdsKey > MEMap4Inf
Definition: GEMDQMBase.h:475
int ProcessWithMEMap4WithChamber(BookingHelper &bh, ME4IdsKey key) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
Definition: GEMDQMBase.h:474
int initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMBase.cc:27
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:651
int loadChambers()
Definition: GEMDQMBase.cc:56
int Fill(K key, Double_t x)
Definition: GEMDQMBase.h:395
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key) override
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
Definition: GEMDQMBase.cc:197
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< LumiScalersCollection > lumiScalers_
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key) override
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:629
GEMPadDigiClusterSource(const edm::ParameterSet &cfg)
int SetLabelForIEta(K key, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:357
void add(std::string const &label, ParameterSetDescription const &psetDescription)
DQMStore::IBooker * getBooker()
Definition: GEMDQMBase.h:94
std::string getNameDirLayer(ME3IdsKey key3)
Definition: GEMDQMBase.h:746
int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key) override
int bookND(BookingHelper &bh, K key)
Definition: GEMDQMBase.h:307
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:596
HLT enums.
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
void SetBinConfX(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:281
void SetBinConfY(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:289
Definition: event.py:1
Definition: Run.h:45
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override