CMS 3D CMS Logo

SiStripMonitorTrack.cc
Go to the documentation of this file.
3 
5 
17 
19 #include "TMath.h"
20 
23 
25  : conf_(conf),
26  siStripClusterInfo_(consumesCollector()),
27  trackerGeometryToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
28  siStripDetCablingToken_(esConsumes<SiStripDetCabling, SiStripDetCablingRcd, edm::Transition::BeginRun>()),
29  trackerTopologyRunToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()),
30  tkDetMapToken_(esConsumes<TkDetMap, TrackerTopologyRcd, edm::Transition::BeginRun>()),
31  trackerTopologyEventToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>()),
32  tracksCollection_in_EventTree(true),
33  firstEvent(-1),
34  genTriggerEventFlag_(new GenericTriggerEventFlag(
35  conf.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this)) {
36  Cluster_src_ = conf.getParameter<edm::InputTag>("Cluster_src");
37  Mod_On_ = conf.getParameter<bool>("Mod_On");
38  Trend_On_ = conf.getParameter<bool>("Trend_On");
39  TkHistoMap_On_ = conf.getParameter<bool>("TkHistoMap_On");
40  clchCMoriginTkHmap_On_ = conf.getParameter<bool>("clchCMoriginTkHmap_On");
41 
42  TrackProducer_ = conf_.getParameter<std::string>("TrackProducer");
43  TrackLabel_ = conf_.getParameter<std::string>("TrackLabel");
44 
45  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
46 
47  digiToken_ = consumes<edm::DetSetVector<SiStripDigi>>(conf.getParameter<edm::InputTag>("ADCDigi_src"));
48  clusterToken_ = consumes<edmNew::DetSetVector<SiStripCluster>>(Cluster_src_);
49  trackToken_ = consumes<reco::TrackCollection>(edm::InputTag(TrackProducer_, TrackLabel_));
50 
51  // cluster quality conditions
52  edm::ParameterSet cluster_condition = conf_.getParameter<edm::ParameterSet>("ClusterConditions");
53  applyClusterQuality_ = cluster_condition.getParameter<bool>("On");
54  sToNLowerLimit_ = cluster_condition.getParameter<double>("minStoN");
55  sToNUpperLimit_ = cluster_condition.getParameter<double>("maxStoN");
56  widthLowerLimit_ = cluster_condition.getParameter<double>("minWidth");
57  widthUpperLimit_ = cluster_condition.getParameter<double>("maxWidth");
58 
59  // Create DCS Status
60  bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering");
61  if (checkDCS)
62  dcsStatus_ = new SiStripDCSStatus(consumesCollector());
63  else
64  dcsStatus_ = nullptr;
65 }
66 
67 //------------------------------------------------------------------------
69  if (dcsStatus_)
70  delete dcsStatus_;
72  delete genTriggerEventFlag_;
73 }
74 
75 //------------------------------------------------------------------------
78  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::beginRun] There are " << tkgeom_->detUnits().size()
79  << " detectors instantiated in the geometry" << std::endl;
81 
82  // Initialize the GenericTriggerEventFlag
83  if (genTriggerEventFlag_->on())
85 }
86 
87 //------------------------------------------------------------------------
89  const edm::Run& run,
90  const edm::EventSetup& iSetup) {
91  const TrackerTopology* trackerTopology = &iSetup.getData(trackerTopologyRunToken_);
92  const TkDetMap* tkDetMap = &iSetup.getData(tkDetMapToken_);
93 
94  book(ibooker, trackerTopology, tkDetMap);
95 }
96 
97 // ------------ method called to produce the data ------------
100 
101  // Filter out events if DCS checking is requested
102  if (dcsStatus_ && !dcsStatus_->getStatus(e, iSetup))
103  return;
104 
105  // Filter out events if Trigger Filtering is requested
106  if (genTriggerEventFlag_->on() && !genTriggerEventFlag_->accept(e, iSetup))
107  return;
108 
109  //initialization of global quantities
110  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::analyse] "
111  << "Run " << e.id().run() << " Event " << e.id().event() << std::endl;
112  eventNb = e.id().event();
113  vPSiStripCluster.clear();
114 
115  iLumisection = e.orbitNumber() / 262144.0;
116 
117  // initialise # of clusters
118  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin(); iSubDet != SubDetMEsMap.end();
119  iSubDet++) {
120  iSubDet->second.totNClustersOnTrack = 0;
121  iSubDet->second.totNClustersOffTrack = 0;
122  }
123 
125 
126  //Perform track study
127  trackStudy(e);
128 
129  //Perform Cluster Study (irrespectively to tracks)
130 
131  AllClusters(e); //analyzes the off Track Clusters
132 
133  //Summary Counts of clusters
134  std::map<std::string, MonitorElement*>::iterator iME;
135  std::map<std::string, LayerMEs>::iterator iLayerME;
136 
137  if (!(topFolderName_.find("IsolatedBunches") != std::string::npos)) {
139  }
140 
141  if (Trend_On_) {
142  // for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin(), iterEnd=SubDetMEsMaps.end();
143  // iSubDet != iterEnd; ++iSubDet) {
144  for (auto const& iSubDet : SubDetMEsMap) {
145  SubDetMEs subdet_mes = iSubDet.second;
146  if (subdet_mes.totNClustersOnTrack > 0) {
147  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
148  }
149  if (subdet_mes.totNClustersOnTrackMono > 0) {
150  fillME(subdet_mes.nClustersOnTrackMono, subdet_mes.totNClustersOnTrackMono);
151  }
152  if (subdet_mes.totNClustersOnTrackStereo > 0) {
154  }
155  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
158  }
159  } else {
160  for (auto const& iSubDet : SubDetMEsMap) {
161  SubDetMEs subdet_mes = iSubDet.second;
162  if (subdet_mes.totNClustersOnTrack > 0) {
163  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
164  }
165  if (subdet_mes.totNClustersOnTrackMono > 0) {
166  fillME(subdet_mes.nClustersOnTrackMono, subdet_mes.totNClustersOnTrackMono);
167  }
168  if (subdet_mes.totNClustersOnTrackStereo > 0) {
170  }
171 
172  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
173  }
174  }
175 }
176 
177 //------------------------------------------------------------------------
178 void SiStripMonitorTrack::book(DQMStore::IBooker& ibooker, const TrackerTopology* tTopo, const TkDetMap* tkDetMap) {
179  SiStripFolderOrganizer folder_organizer;
180  folder_organizer.setSiStripFolderName(topFolderName_);
181  //******** TkHistoMaps
182  if (TkHistoMap_On_) {
184  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_StoNCorrOnTrack", 0.0, true);
186  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NumberOfOnTrackCluster", 0.0, true);
188  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NumberOfOfffTrackCluster", 0.0, true);
190  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_ChargePerCMfromTrack", 0.0, true);
192  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NumberMissingHits", 0.0, true, true);
194  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NumberInactiveHits", 0.0, true, true);
196  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NumberValidHits", 0.0, true, true);
197  tkhisto_NoiseOnTrack = std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NoiseOnTrack", 0.0, true);
198  tkhisto_NoiseOffTrack = std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_NoiseOffTrack", 0.0, true);
200  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_ClusterWidthOnTrack", 0.0, true);
202  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_ClusterWidthOffTrack", 0.0, true);
203  }
206  std::make_unique<TkHistoMap>(tkDetMap, topFolderName_, "TkHMap_ChargePerCMfromOrigin", 0.0, true);
207  //******** TkHistoMaps
208 
209  std::vector<uint32_t> vdetId_;
211  const char* tec = "TEC";
212  const char* tid = "TID";
213  //Histos for each detector, layer and module
214  SiStripHistoId hidmanager;
215 
216  if (Mod_On_) {
217  for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
218  detid_iter != detid_end;
219  ++detid_iter) { //loop on all the active detid
220  uint32_t detid = *detid_iter;
221 
222  if (detid < 1) {
223  edm::LogError("SiStripMonitorTrack") << "[" << __PRETTY_FUNCTION__ << "] invalid detid " << detid << std::endl;
224  continue;
225  }
226 
227  //std::string name;
228 
229  // book Layer and RING plots
230  std::pair<std::string, int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo, false);
231  /*
232  std::string thickness;
233  std::pair<std::string,int32_t> det_layer_pair_test = folder_organizer.GetSubDetAndLayerThickness(detid,tTopo,thickness);
234  std::cout << "[SiStripMonitorTrack::book] det_layer_pair " << det_layer_pair.first << " " << det_layer_pair.second << " " << thickness << std::endl;
235  */
236 
237  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, false);
238 
239  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
240  if (iLayerME == LayerMEsMap.end()) {
241  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, false);
242  bookLayerMEs(ibooker, detid, layer_id);
243  }
244 
245  const char* subdet = det_layer_pair.first.c_str();
246  if (std::strstr(subdet, tec) != nullptr || std::strstr(subdet, tid) != nullptr) {
247  std::string ring_id = hidmanager.getSubdetid(detid, tTopo, true);
248  std::map<std::string, RingMEs>::iterator iRingME = RingMEsMap.find(ring_id);
249  if (iRingME == RingMEsMap.end()) {
250  std::pair<std::string, int32_t> det_ring_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo, true);
251  folder_organizer.setLayerFolder(detid, tTopo, det_ring_pair.second, true);
252  bookRingMEs(ibooker, detid, ring_id);
253  }
254  }
255 
256  // book sub-detector plots
257  std::pair<std::string, std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
258  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()) {
259  ibooker.setCurrentFolder(sdet_pair.first);
260  bookSubDetMEs(ibooker, sdet_pair.second);
261  }
262  // book module plots
263  folder_organizer.setDetectorFolder(detid, tTopo);
264  bookModMEs(ibooker, *detid_iter);
265  } //end loop on detectors detid
266  } else {
267  for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
268  detid_iter != detid_end;
269  ++detid_iter) { //loop on all the active detid
270  uint32_t detid = *detid_iter;
271 
272  if (detid < 1) {
273  edm::LogError("SiStripMonitorTrack") << "[" << __PRETTY_FUNCTION__ << "] invalid detid " << detid << std::endl;
274  continue;
275  }
276 
277  //std::string name;
278 
279  // book Layer and RING plots
280  std::pair<std::string, int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo, false);
281  /*
282  std::string thickness;
283  std::pair<std::string,int32_t> det_layer_pair_test = folder_organizer.GetSubDetAndLayerThickness(detid,tTopo,thickness);
284  std::cout << "[SiStripMonitorTrack::book] det_layer_pair " << det_layer_pair.first << " " << det_layer_pair.second << " " << thickness << std::endl;
285  */
286 
287  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, false);
288 
289  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
290  if (iLayerME == LayerMEsMap.end()) {
291  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, false);
292  bookLayerMEs(ibooker, detid, layer_id);
293  }
294 
295  const char* subdet = det_layer_pair.first.c_str();
296  if (std::strstr(subdet, tec) != nullptr || std::strstr(subdet, tid) != nullptr) {
297  std::string ring_id = hidmanager.getSubdetid(detid, tTopo, true);
298  std::map<std::string, RingMEs>::iterator iRingME = RingMEsMap.find(ring_id);
299  if (iRingME == RingMEsMap.end()) {
300  std::pair<std::string, int32_t> det_ring_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo, true);
301  folder_organizer.setLayerFolder(detid, tTopo, det_ring_pair.second, true);
302  bookRingMEs(ibooker, detid, ring_id);
303  }
304  }
305 
306  // book sub-detector plots
307  std::pair<std::string, std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
308  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()) {
309  ibooker.setCurrentFolder(sdet_pair.first);
310  bookSubDetMEs(ibooker, sdet_pair.second);
311  }
312  } //end loop on detectors detid
313  }
314 
315  //book control view plots
316  if (!(topFolderName_.find("IsolatedBunches") != std::string::npos)) {
317  ibooker.setCurrentFolder(topFolderName_ + "/ControlView/");
318 
320  ibooker.book1D("ClusterStoNCorr_OnTrack_TIBTID", "TIB/TID [FECCrate=1] (OnTrack)", 100, 0., 100.);
322 
324  ibooker.book1D("ClusterStoNCorr_OnTrack_TOB", "TOB [FECCrate=4] (OnTrack)", 100, 0., 100.);
326 
328  ibooker.book1D("ClusterStoNCorr_OnTrack_TECM", "TECM [FECCrate=3] (OnTrack)", 100, 0., 100.);
330 
332  ibooker.book1D("ClusterStoNCorr_OnTrack_TECP", "TECP [FECCrate=2] (OnTrack)", 100, 0., 100.);
334 
336  ibooker.book2D("ClusterStoNCorr_OnTrack_FECCratevsFECSlot", " S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
338  ClusterStoNCorr_OnTrack_FECCratevsFECSlot->setAxisTitle("FEC Crate (TTC partition)", 2);
343 
344  ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID = ibooker.book2D("ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID",
345  "TIB/TID [FECCrate=1] (OnTrack)",
346  10,
347  -0.5,
348  9.5,
349  22,
350  0.5,
351  22.5);
354 
356  "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB", "TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
359 
361  "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM", "TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
364 
366  "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP", "TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
369 
370  //----------------------------------------
371  // for conting the number of clusters, for the mean S/N calculation
372  //book control view plots
373 
375  ibooker.book2D("ClusterCount_OnTrack_FECCratevsFECSlot", " S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
377  ClusterCount_OnTrack_FECCratevsFECSlot->setAxisTitle("FEC Crate (TTC partition)", 2);
382 
384  "ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID", "TIB/TID [FECCrate=1] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
387 
389  "ClusterCount_OnTrack_FECSlotVsFECRing_TOB", "TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
392 
394  "ClusterCount_OnTrack_FECSlotVsFECRing_TECM", "TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
397 
399  "ClusterCount_OnTrack_FECSlotVsFECRing_TECP", "TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
402  }
403 }
404 
405 //--------------------------------------------------------------------------------
406 void SiStripMonitorTrack::bookModMEs(DQMStore::IBooker& ibooker, const uint32_t id) //Histograms at MODULE level
407 {
408  std::string name = "det";
409  SiStripHistoId hidmanager;
410  std::string hid = hidmanager.createHistoId("", name, id);
411  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(hid);
412  if (iModME == ModMEsMap.end()) {
413  ModMEs theModMEs;
414 
415  // Cluster Width
416  theModMEs.ClusterWidth =
417  bookME1D(ibooker, "TH1ClusterWidth", hidmanager.createHistoId("ClusterWidth_OnTrack", name, id).c_str());
418  // Cluster Gain
419  theModMEs.ClusterGain =
420  bookME1D(ibooker, "TH1ClusterGain", hidmanager.createHistoId("ClusterGain", name, id).c_str());
421  // Cluster Charge
422  theModMEs.ClusterCharge =
423  bookME1D(ibooker, "TH1ClusterCharge", hidmanager.createHistoId("ClusterCharge_OnTrack", name, id).c_str());
424  // Cluster Charge Raw (no gain )
425  theModMEs.ClusterChargeRaw = bookME1D(
426  ibooker, "TH1ClusterChargeRaw", hidmanager.createHistoId("ClusterChargeRaw_OnTrack", name, id).c_str());
427  // Cluster Charge Corrected
428  theModMEs.ClusterChargeCorr = bookME1D(
429  ibooker, "TH1ClusterChargeCorr", hidmanager.createHistoId("ClusterChargeCorr_OnTrack", name, id).c_str());
430  // Cluster StoN Corrected
431  theModMEs.ClusterStoNCorr = bookME1D(
432  ibooker, "TH1ClusterStoNCorrMod", hidmanager.createHistoId("ClusterStoNCorr_OnTrack", name, id).c_str());
433  // Cluster Position
434  short total_nr_strips = siStripDetCabling_->nApvPairs(id) * 2 * 128;
435  theModMEs.ClusterPos = ibooker.book1D(hidmanager.createHistoId("ClusterPosition_OnTrack", name, id).c_str(),
436  hidmanager.createHistoId("ClusterPosition_OnTrack", name, id).c_str(),
437  total_nr_strips,
438  0.5,
439  total_nr_strips + 0.5);
440  // Cluster PGV
441  theModMEs.ClusterPGV =
442  bookMEProfile(ibooker, "TProfileClusterPGV", hidmanager.createHistoId("PGV_OnTrack", name, id).c_str());
443  // Cluster Charge per cm
445  ibooker, "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromTrack", name, id).c_str());
446 
448  ibooker, "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromOrigin", name, id).c_str());
449 
450  ModMEsMap[hid] = theModMEs;
451  }
452 }
453 
455  std::string& viewParameter,
456  std::string& id,
459  MonitorElement* me = nullptr;
460  bool view = false;
461  view = (conf_.getParameter<edm::ParameterSet>(histoParameters.c_str())).getParameter<bool>(viewParameter.c_str());
462  if (id.find("TEC") == std::string::npos && id.find("TID") == std::string::npos) {
463  me = bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
464  } else {
465  if (view) {
466  // histoName = histoName + "__" + thickness;
467  me = bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
468  }
469  }
470  return me;
471 }
472 
473 //
474 // -- Book Layer Level Histograms and Trend plots
475 //
476 //------------------------------------------------------------------------
477 void SiStripMonitorTrack::bookLayerMEs(DQMStore::IBooker& ibooker, const uint32_t mod_id, std::string& layer_id) {
478  std::string name = "layer";
479  std::string view = "layerView";
480  std::string hname;
481  std::string hpar;
482  SiStripHistoId hidmanager;
483 
484  LayerMEs theLayerMEs;
485 
486  // Signal/Noise (w/ cluster harge corrected)
487  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr", name, layer_id, "OnTrack");
488  hpar = "TH1ClusterStoNCorr";
489  theLayerMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
490 
491  // Cluster Gain
492  hname = hidmanager.createHistoLayer("Summary_ClusterGain", name, layer_id, "");
493  hpar = "TH1ClusterGain";
494  theLayerMEs.ClusterGain = handleBookMEs(ibooker, view, layer_id, hpar, hname);
495 
496  // Cluster Charge Corrected
497  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr", name, layer_id, "OnTrack");
498  hpar = "TH1ClusterChargeCorr";
499  theLayerMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
500 
501  // Cluster Charge (On and Off Track)
502  hname = hidmanager.createHistoLayer("Summary_ClusterCharge", name, layer_id, "OnTrack");
503  hpar = "TH1ClusterCharge";
504  theLayerMEs.ClusterChargeOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
505 
506  hname = hidmanager.createHistoLayer("Summary_ClusterCharge", name, layer_id, "OffTrack");
507  hpar = "TH1ClusterCharge";
508  theLayerMEs.ClusterChargeOffTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
509 
510  // Cluster Charge Raw (On and Off Track)
511  hname = hidmanager.createHistoLayer("Summary_ClusterChargeRaw", name, layer_id, "OnTrack");
512  hpar = "TH1ClusterChargeRaw";
513  theLayerMEs.ClusterChargeRawOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
514 
515  hname = hidmanager.createHistoLayer("Summary_ClusterChargeRaw", name, layer_id, "OffTrack");
516  hpar = "TH1ClusterChargeRaw";
517  theLayerMEs.ClusterChargeRawOffTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
518 
519  // Cluster Noise (On and Off Track)
520  hname = hidmanager.createHistoLayer("Summary_ClusterNoise", name, layer_id, "OnTrack");
521  hpar = "TH1ClusterNoise";
522  theLayerMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
523 
524  hname = hidmanager.createHistoLayer("Summary_ClusterNoise", name, layer_id, "OffTrack");
525  hpar = "TH1ClusterNoise";
526  theLayerMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
527 
528  // Cluster Width (On and Off Track)
529  hname = hidmanager.createHistoLayer("Summary_ClusterWidth", name, layer_id, "OnTrack");
530  hpar = "TH1ClusterWidth";
531  theLayerMEs.ClusterWidthOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
532 
533  hname = hidmanager.createHistoLayer("Summary_ClusterWidth", name, layer_id, "OffTrack");
534  hpar = "TH1ClusterWidth";
535  theLayerMEs.ClusterWidthOffTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
536 
537  //Cluster Position
538  short total_nr_strips = siStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
539  if (layer_id.find("TEC") != std::string::npos)
540  total_nr_strips = 3 * 2 * 128;
541 
542  hname = hidmanager.createHistoLayer("Summary_ClusterPosition", name, layer_id, "OnTrack");
543  hpar = "TH1ClusterPos";
544  if (layer_id.find("TIB") != std::string::npos || layer_id.find("TOB") != std::string::npos ||
545  (conf_.getParameter<edm::ParameterSet>(hpar.c_str())).getParameter<bool>(view.c_str()))
546  theLayerMEs.ClusterPosOnTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5, total_nr_strips + 0.5);
547 
548  //----------------------
549  //add 2D z-phi map per layer
550  hname = hidmanager.createHistoLayer("Summary_ClusterPosition2D", name, layer_id, "OnTrack");
551  hpar = "TH2ClusterPosTOB";
552  if (layer_id.find("TOB") != std::string::npos)
553  theLayerMEs.ClusterPosOnTrack2D = ibooker.book2D(hname, hname, 12, -110, 110, 300, -3.2, 3.2);
554 
555  hname = hidmanager.createHistoLayer("Summary_ClusterPosition2D", name, layer_id, "OnTrack");
556  hpar = "TH2ClusterPosTIB";
557  if (layer_id.find("TIB") != std::string::npos)
558  theLayerMEs.ClusterPosOnTrack2D = ibooker.book2D(hname, hname, 12, -65, 65, 450, -3.2, 3.2);
559 
560  hname = hidmanager.createHistoLayer("Summary_ClusterPosition2D", name, layer_id, "OnTrack");
561  hpar = "TH2ClusterPosTEC";
562  if (layer_id.find("TEC") != std::string::npos) {
563  static constexpr int nbinR = 8;
564  static constexpr float rval[9] = {0, 21.2, 30.8, 40.4, 50.0, 60.0, 75.0, 90.0, 110.0};
565  static constexpr int nmodulesPhi = 40 * 6; //max number of APV for a ring
566  float phival[nmodulesPhi];
567  for (int i = 0; i < nmodulesPhi; i++)
568  phival[i] = -3.2 + 2 * i * 3.2 / nmodulesPhi;
569 
570  TH2F* temp = new TH2F("tmp", "tmp", nbinR, rval, nmodulesPhi - 1, phival);
571  theLayerMEs.ClusterPosOnTrack2D = ibooker.book2D(hname, temp);
572  }
573 
574  hname = hidmanager.createHistoLayer("Summary_ClusterPosition2D", name, layer_id, "OnTrack");
575  hpar = "TH2ClusterPosTID";
576  if (layer_id.find("TID") != std::string::npos) {
577  static constexpr int nbinR = 4;
578  static constexpr float rval[5] = {0, 21.2, 30.8, 40.4, 50.0};
579  static constexpr int nmodulesPhi = 80 * 4; //max number of APV for a ring
580  float phival[nmodulesPhi];
581  for (int i = 0; i < nmodulesPhi; i++)
582  phival[i] = -3.2 + i * 2 * 3.2 / nmodulesPhi;
583 
584  TH2F* temp = new TH2F("tmp", "tmp", nbinR, rval, nmodulesPhi - 1, phival);
585  theLayerMEs.ClusterPosOnTrack2D = ibooker.book2D(hname, temp);
586  }
587 
588  hname = hidmanager.createHistoLayer("Summary_ClusterPosition", name, layer_id, "OffTrack");
589  hpar = "TH1ClusterPos";
590  if (layer_id.find("TIB") != std::string::npos || layer_id.find("TOB") != std::string::npos ||
591  (conf_.getParameter<edm::ParameterSet>(hpar.c_str())).getParameter<bool>(view.c_str()))
592  theLayerMEs.ClusterPosOffTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5, total_nr_strips + 0.5);
593 
594  // dQ/dx
595  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack", name, layer_id, "");
596  hpar = "TH1ClusterChargePerCM";
597  theLayerMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
598 
599  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin", name, layer_id, "OnTrack");
600  hpar = "TH1ClusterChargePerCM";
601  theLayerMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
602 
603  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin", name, layer_id, "OffTrack");
604  hpar = "TH1ClusterChargePerCM";
605  theLayerMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker, view, layer_id, hpar, hname);
606 
607  //bookeeping
608  LayerMEsMap[layer_id] = theLayerMEs;
609 }
610 
612  std::string name = "ring";
613  std::string view = "ringView";
614  std::string hname;
615  std::string hpar;
616  SiStripHistoId hidmanager;
617 
618  RingMEs theRingMEs;
619 
620  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr", name, ring_id, "OnTrack");
621  hpar = "TH1ClusterStoNCorr";
622  theRingMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
623 
624  // Cluster Gain
625  hname = hidmanager.createHistoLayer("Summary_ClusterGain", name, ring_id, "");
626  hpar = "TH1ClusterGain";
627  theRingMEs.ClusterGain = handleBookMEs(ibooker, view, ring_id, hpar, hname);
628 
629  // Cluster Charge Corrected
630  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr", name, ring_id, "OnTrack");
631  hpar = "TH1ClusterChargeCorr";
632  theRingMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
633 
634  // Cluster Charge (On and Off Track)
635  hname = hidmanager.createHistoLayer("Summary_ClusterCharge", name, ring_id, "OnTrack");
636  hpar = "TH1ClusterCharge";
637  theRingMEs.ClusterChargeOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
638 
639  hname = hidmanager.createHistoLayer("Summary_ClusterCharge", name, ring_id, "OffTrack");
640  hpar = "TH1ClusterCharge";
641  theRingMEs.ClusterChargeOffTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
642 
643  // Cluster Charge Raw (no-gain), On and off track
644  hname = hidmanager.createHistoLayer("Summary_ClusterChargeRaw", name, ring_id, "OnTrack");
645  hpar = "TH1ClusterChargeRaw";
646  theRingMEs.ClusterChargeRawOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
647 
648  hname = hidmanager.createHistoLayer("Summary_ClusterChargeRaw", name, ring_id, "OffTrack");
649  hpar = "TH1ClusterChargeRaw";
650  theRingMEs.ClusterChargeRawOffTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
651 
652  // Cluster Noise (On and Off Track)
653  hname = hidmanager.createHistoLayer("Summary_ClusterNoise", name, ring_id, "OnTrack");
654  hpar = "TH1ClusterNoise";
655  theRingMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
656 
657  hname = hidmanager.createHistoLayer("Summary_ClusterNoise", name, ring_id, "OffTrack");
658  hpar = "TH1ClusterNoise";
659  theRingMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
660 
661  // Cluster Width (On and Off Track)
662  hname = hidmanager.createHistoLayer("Summary_ClusterWidth", name, ring_id, "OnTrack");
663  hpar = "TH1ClusterWidth";
664  theRingMEs.ClusterWidthOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
665 
666  hname = hidmanager.createHistoLayer("Summary_ClusterWidth", name, ring_id, "OffTrack");
667  hpar = "TH1ClusterWidth";
668  theRingMEs.ClusterWidthOffTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
669 
670  //Cluster Position
671  short total_nr_strips = siStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
672  if (ring_id.find("TEC") != std::string::npos)
673  total_nr_strips = 3 * 2 * 128;
674 
675  hname = hidmanager.createHistoLayer("Summary_ClusterPosition", name, ring_id, "OnTrack");
676  hpar = "TH1ClusterPos";
677  if ((conf_.getParameter<edm::ParameterSet>(hpar.c_str())).getParameter<bool>(view.c_str()))
678  theRingMEs.ClusterPosOnTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5, total_nr_strips + 0.5);
679 
680  hname = hidmanager.createHistoLayer("Summary_ClusterPosition", name, ring_id, "OffTrack");
681  hpar = "TH1ClusterPos";
682  if ((conf_.getParameter<edm::ParameterSet>(hpar.c_str())).getParameter<bool>(view.c_str()))
683  theRingMEs.ClusterPosOffTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5, total_nr_strips + 0.5);
684 
685  // dQ/dx
686  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack", name, ring_id, "");
687  hpar = "TH1ClusterChargePerCM";
688  theRingMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
689 
690  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin", name, ring_id, "OnTrack");
691  hpar = "TH1ClusterChargePerCM";
692  theRingMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
693 
694  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin", name, ring_id, "OffTrack");
695  hpar = "TH1ClusterChargePerCM";
696  theRingMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker, view, ring_id, hpar, hname);
697 
698  //bookeeping
699  RingMEsMap[ring_id] = theRingMEs;
700 }
701 //------------------------------------------------------------------------
702 //
703 // -- Book Histograms at Sub-Detector Level
704 //
707  subdet_tag = "__" + name;
708  std::string completeName;
709  std::string axisName;
710 
711  SubDetMEs theSubDetMEs;
712 
713  // TotalNumber of Cluster OnTrack
714  completeName = "Summary_TotalNumberOfClusters_OnTrack" + subdet_tag;
715  axisName = "Number of on-track clusters in " + name;
716  theSubDetMEs.nClustersOnTrack = bookME1D(ibooker, "TH1nClustersOn", completeName.c_str());
717  theSubDetMEs.nClustersOnTrack->setAxisTitle(axisName);
718  theSubDetMEs.nClustersOnTrack->setStatOverflows(kTRUE);
719 
720  // TotalNumber of Cluster OnTrack
721  completeName = "Summary_TotalNumberOfClusters_OnTrackStereo" + subdet_tag;
722  axisName = "Number of on-track stereo clusters in " + name;
723  theSubDetMEs.nClustersOnTrackStereo = bookME1D(ibooker, "TH1nClustersOnStereo", completeName.c_str());
724  theSubDetMEs.nClustersOnTrackStereo->setAxisTitle(axisName);
725  theSubDetMEs.nClustersOnTrackStereo->setStatOverflows(kTRUE);
726 
727  // TotalNumber of Cluster OffTrack
728  completeName = "Summary_TotalNumberOfClusters_OffTrack" + subdet_tag;
729  axisName = "Number of off-track clusters in " + name;
730  theSubDetMEs.nClustersOffTrack = bookME1D(ibooker, "TH1nClustersOff", completeName.c_str());
731  theSubDetMEs.nClustersOffTrack->setAxisTitle(axisName);
732 
733  double xmaximum = 0;
734  if (name.find("TIB") != std::string::npos) {
735  xmaximum = 40000.0;
736  theSubDetMEs.nClustersOffTrack->setAxisRange(0.0, xmaximum, 1);
737  }
738  if (name.find("TOB") != std::string::npos) {
739  xmaximum = 40000.0;
740  theSubDetMEs.nClustersOffTrack->setAxisRange(0.0, xmaximum, 1);
741  }
742  if (name.find("TID") != std::string::npos) {
743  xmaximum = 10000.0;
744  theSubDetMEs.nClustersOffTrack->setAxisRange(0.0, xmaximum, 1);
745  }
746  if (name.find("TEC") != std::string::npos) {
747  xmaximum = 40000.0;
748  theSubDetMEs.nClustersOffTrack->setAxisRange(0.0, xmaximum, 1);
749  }
750 
751  theSubDetMEs.nClustersOffTrack->setStatOverflows(kTRUE);
752 
753  // Cluster Gain
754  completeName = "Summary_ClusterGain" + subdet_tag;
755  theSubDetMEs.ClusterGain = bookME1D(ibooker, "TH1ClusterGain", completeName.c_str());
756 
757  // Cluster StoN On Track
758  completeName = "Summary_ClusterStoNCorr_OnTrack" + subdet_tag;
759  theSubDetMEs.ClusterStoNCorrOnTrack = bookME1D(ibooker, "TH1ClusterStoNCorr", completeName.c_str());
760 
761  completeName = "Summary_ClusterStoNCorrThin_OnTrack" + subdet_tag;
762  if (subdet_tag.find("TEC") != std::string::npos)
763  theSubDetMEs.ClusterStoNCorrThinOnTrack = bookME1D(ibooker, "TH1ClusterStoNCorr", completeName.c_str());
764 
765  completeName = "Summary_ClusterStoNCorrThick_OnTrack" + subdet_tag;
766  if (subdet_tag.find("TEC") != std::string::npos)
767  theSubDetMEs.ClusterStoNCorrThickOnTrack = bookME1D(ibooker, "TH1ClusterStoNCorr", completeName.c_str());
768 
769  // Cluster Charge Corrected
770  completeName = "Summary_ClusterChargeCorr_OnTrack" + subdet_tag;
771  theSubDetMEs.ClusterChargeCorrOnTrack = bookME1D(ibooker, "TH1ClusterChargeCorr", completeName.c_str());
772 
773  completeName = "Summary_ClusterChargeCorrThin_OnTrack" + subdet_tag;
774  if (subdet_tag.find("TEC") != std::string::npos)
775  theSubDetMEs.ClusterChargeCorrThinOnTrack = bookME1D(ibooker, "TH1ClusterChargeCorr", completeName.c_str());
776 
777  completeName = "Summary_ClusterChargeCorrThick_OnTrack" + subdet_tag;
778  if (subdet_tag.find("TEC") != std::string::npos)
779  theSubDetMEs.ClusterChargeCorrThickOnTrack = bookME1D(ibooker, "TH1ClusterChargeCorr", completeName.c_str());
780 
781  // Cluster Charge On Track
782  completeName = "Summary_ClusterCharge_OnTrack" + subdet_tag;
783  theSubDetMEs.ClusterChargeOnTrack = bookME1D(ibooker, "TH1ClusterCharge", completeName.c_str());
784 
785  // Cluster Charge On Track, Raw (no-gain)
786  completeName = "Summary_ClusterChargeRaw_OnTrack" + subdet_tag;
787  theSubDetMEs.ClusterChargeRawOnTrack = bookME1D(ibooker, "TH1ClusterChargeRaw", completeName.c_str());
788 
789  // Cluster Charge Off Track
790  completeName = "Summary_ClusterCharge_OffTrack" + subdet_tag;
791  theSubDetMEs.ClusterChargeOffTrack = bookME1D(ibooker, "TH1ClusterCharge", completeName.c_str());
792 
793  // Cluster Charge Off Track, Raw (no-gain)
794  completeName = "Summary_ClusterChargeRaw_OffTrack" + subdet_tag;
795  theSubDetMEs.ClusterChargeRawOffTrack = bookME1D(ibooker, "TH1ClusterChargeRaw", completeName.c_str());
796 
797  // Cluster Charge StoN Off Track
798  completeName = "Summary_ClusterStoN_OffTrack" + subdet_tag;
799  theSubDetMEs.ClusterStoNOffTrack = bookME1D(ibooker, "TH1ClusterStoN", completeName.c_str());
800 
801  // cluster charge per cm on track
802  completeName = "Summary_ClusterChargePerCMfromTrack" + subdet_tag;
803  theSubDetMEs.ClusterChargePerCMfromTrack = bookME1D(ibooker, "TH1ClusterChargePerCM", completeName.c_str());
804 
805  // cluster charge per cm on track
806  completeName = "Summary_ClusterChargePerCMfromOrigin_OnTrack" + subdet_tag;
807  theSubDetMEs.ClusterChargePerCMfromOriginOnTrack = bookME1D(ibooker, "TH1ClusterChargePerCM", completeName.c_str());
808 
809  // cluster charge per cm off track
810  completeName = "Summary_ClusterChargePerCMfromOrigin_OffTrack" + subdet_tag;
811  theSubDetMEs.ClusterChargePerCMfromOriginOffTrack = bookME1D(ibooker, "TH1ClusterChargePerCM", completeName.c_str());
812 
813  if (Trend_On_) {
814  // TotalNumber of Cluster
815  completeName = "Trend_TotalNumberOfClusters_OnTrack" + subdet_tag;
816  theSubDetMEs.nClustersTrendOnTrack = bookMETrend(ibooker, completeName.c_str());
817  completeName = "Trend_TotalNumberOfClusters_OffTrack" + subdet_tag;
818  theSubDetMEs.nClustersTrendOffTrack = bookMETrend(ibooker, completeName.c_str());
819  }
820 
821  //bookeeping
822  SubDetMEsMap[name] = theSubDetMEs;
823 }
824 //--------------------------------------------------------------------------------
825 
827  const char* ParameterSetLabel,
828  const char* HistoName) {
829  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
830  return ibooker.book1D(HistoName,
831  HistoName,
832  Parameters.getParameter<int32_t>("Nbinx"),
833  Parameters.getParameter<double>("xmin"),
834  Parameters.getParameter<double>("xmax"));
835 }
836 
837 //--------------------------------------------------------------------------------
839  const char* ParameterSetLabel,
840  const char* HistoName) {
841  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
842  return ibooker.book2D(HistoName,
843  HistoName,
844  Parameters.getParameter<int32_t>("Nbinx"),
845  Parameters.getParameter<double>("xmin"),
846  Parameters.getParameter<double>("xmax"),
847  Parameters.getParameter<int32_t>("Nbiny"),
848  Parameters.getParameter<double>("ymin"),
849  Parameters.getParameter<double>("ymax"));
850 }
851 
852 //--------------------------------------------------------------------------------
854  const char* ParameterSetLabel,
855  const char* HistoName) {
856  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
857  return ibooker.book3D(HistoName,
858  HistoName,
859  Parameters.getParameter<int32_t>("Nbinx"),
860  Parameters.getParameter<double>("xmin"),
861  Parameters.getParameter<double>("xmax"),
862  Parameters.getParameter<int32_t>("Nbiny"),
863  Parameters.getParameter<double>("ymin"),
864  Parameters.getParameter<double>("ymax"),
865  Parameters.getParameter<int32_t>("Nbinz"),
866  Parameters.getParameter<double>("zmin"),
867  Parameters.getParameter<double>("zmax"));
868 }
869 
870 //--------------------------------------------------------------------------------
872  const char* ParameterSetLabel,
873  const char* HistoName) {
874  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
875  return ibooker.bookProfile(HistoName,
876  HistoName,
877  Parameters.getParameter<int32_t>("Nbinx"),
878  Parameters.getParameter<double>("xmin"),
879  Parameters.getParameter<double>("xmax"),
880  Parameters.getParameter<int32_t>("Nbiny"),
881  Parameters.getParameter<double>("ymin"),
882  Parameters.getParameter<double>("ymax"),
883  "");
884 }
885 
886 //--------------------------------------------------------------------------------
888  const char* HistoName) {
889  edm::ParameterSet ParametersTrend = conf_.getParameter<edm::ParameterSet>("Trending");
891  HistoName,
892  ParametersTrend.getParameter<int32_t>("Nbins"),
893  ParametersTrend.getParameter<double>("xmin"),
894  ParametersTrend.getParameter<double>("xmax"),
895  0,
896  0,
897  "");
898  if (me->kind() == MonitorElement::Kind::TPROFILE)
899  me->setCanExtend(TH1::kAllAxes);
900 
901  if (!me)
902  return me;
903  me->setAxisTitle("Lumisection", 1);
904  return me;
905 }
906 
907 //------------------------------------------------------------------------------------------
909  const edm::DetSetVector<SiStripDigi>& digilist,
910  const edm::Event& ev,
911  bool track_ok) {
912  auto const& trajParams = track.extra()->trajParams();
913  assert(trajParams.size() == track.recHitsSize());
914  auto hb = track.recHitsBegin();
915  for (unsigned int h = 0; h < track.recHitsSize(); h++) {
916  auto ttrh = *(hb + h);
917 
918  if (TkHistoMap_On_) {
919  uint32_t thedetid = ttrh->rawId();
920  if (SiStripDetId(thedetid).subDetector() >= 3 &&
921  SiStripDetId(thedetid).subDetector() <= 6) { //TIB/TID + TOB + TEC only
922  if ((ttrh->getType() == 1))
923  tkhisto_NumMissingHits->fill(thedetid, 1.);
924  if ((ttrh->getType() == 2))
925  tkhisto_NumberInactiveHits->fill(thedetid, 1.);
926  if ((ttrh->getType() == 0))
927  tkhisto_NumberValidHits->fill(thedetid, 1.);
928  }
929  }
930 
931  if (!ttrh->isValid())
932  continue;
933 
934  //trajectory local direction and position on detector
935  auto statedirection = trajParams[h].momentum();
936 
937  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>(ttrh->hit());
938  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>(ttrh->hit());
939  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>(ttrh->hit());
940  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>(ttrh->hit());
941 
942  // RecHitType type=Single;
943 
944  if (matchedhit) {
945  LogTrace("SiStripMonitorTrack") << "\nMatched recHit found" << std::endl;
946  // type=Matched;
947 
948  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tkgeom_->idToDet(matchedhit->geographicalId()));
949  GlobalVector gtrkdirup = gdet->toGlobal(statedirection);
950  //mono side
951  const GeomDetUnit* monodet = gdet->monoDet();
952  statedirection = monodet->toLocal(gtrkdirup);
953  SiStripRecHit2D m = matchedhit->monoHit();
954  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref);
955  if (statedirection.mag())
956  RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, track_ok);
957  //stereo side
958  const GeomDetUnit* stereodet = gdet->stereoDet();
959  statedirection = stereodet->toLocal(gtrkdirup);
960  SiStripRecHit2D s = matchedhit->stereoHit();
961  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref);
962  if (statedirection.mag())
963  RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, track_ok);
964  } else if (projhit) {
965  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found" << std::endl;
966  // type=Projected;
967  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tkgeom_->idToDet(projhit->geographicalId()));
968 
969  GlobalVector gtrkdirup = gdet->toGlobal(statedirection);
970  const SiStripRecHit2D originalhit = projhit->originalHit();
971  const GeomDetUnit* det;
972  if (!StripSubdetector(originalhit.geographicalId().rawId()).stereo()) {
973  //mono side
974  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found MONO" << std::endl;
975  det = gdet->monoDet();
976  statedirection = det->toLocal(gtrkdirup);
977  if (statedirection.mag())
978  RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist, ev, track_ok);
979  } else {
980  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found STEREO" << std::endl;
981  //stereo side
982  det = gdet->stereoDet();
983  statedirection = det->toLocal(gtrkdirup);
984  if (statedirection.mag())
985  RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist, ev, track_ok);
986  }
987  } else if (hit2D) {
988  if (statedirection.mag())
989  RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, track_ok);
990  } else if (hit1D) {
991  if (statedirection.mag())
992  RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, track_ok);
993  } else {
994  LogDebug("SiStripMonitorTrack") << " LocalMomentum: " << statedirection
995  << "\nLocal x-z plane angle: " << atan2(statedirection.x(), statedirection.z());
996  }
997  }
998 }
999 //------------------------------------------------------------------------
1001  const edm::DetSetVector<SiStripDigi>& digilist,
1002  const ProjectedSiStripRecHit2D* projhit,
1003  const SiStripMatchedRecHit2D* matchedhit,
1004  const SiStripRecHit2D* hit2D,
1005  const SiStripRecHit1D* hit1D,
1006  LocalVector localMomentum,
1007  const bool track_ok) {
1008  LocalVector statedirection;
1009  if (matchedhit) { // type=Matched;
1010  LogTrace("SiStripMonitorTrack") << "\nMatched recHit found" << std::endl;
1011 
1012  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tkgeom_->idToDet(matchedhit->geographicalId()));
1013 
1014  GlobalVector gtrkdirup = gdet->toGlobal(localMomentum);
1015 
1016  //mono side
1017  const GeomDetUnit* monodet = gdet->monoDet();
1018  statedirection = monodet->toLocal(gtrkdirup);
1019  SiStripRecHit2D m = matchedhit->monoHit();
1020  if (statedirection.mag())
1021  RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, track_ok);
1022 
1023  //stereo side
1024  const GeomDetUnit* stereodet = gdet->stereoDet();
1025  statedirection = stereodet->toLocal(gtrkdirup);
1026  SiStripRecHit2D s = matchedhit->stereoHit();
1027  if (statedirection.mag())
1028  RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, track_ok);
1029  } else if (projhit) { // type=Projected;
1030  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found" << std::endl;
1031 
1032  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tkgeom_->idToDet(projhit->geographicalId()));
1033 
1034  GlobalVector gtrkdirup = gdet->toGlobal(localMomentum);
1035  const SiStripRecHit2D originalhit = projhit->originalHit();
1036 
1037  const GeomDetUnit* det;
1038  if (!StripSubdetector(originalhit.geographicalId().rawId()).stereo()) {
1039  //mono side
1040  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found MONO" << std::endl;
1041  det = gdet->monoDet();
1042  statedirection = det->toLocal(gtrkdirup);
1043  if (statedirection.mag())
1044  RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist, ev, track_ok);
1045  } else {
1046  LogTrace("SiStripMonitorTrack") << "\nProjected recHit found STEREO" << std::endl;
1047  //stereo side
1048  det = gdet->stereoDet();
1049  statedirection = det->toLocal(gtrkdirup);
1050  if (statedirection.mag())
1051  RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist, ev, track_ok);
1052  }
1053  } else if (hit2D) { // type=2D
1054  statedirection = localMomentum;
1055  if (statedirection.mag())
1056  RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, track_ok);
1057  } else if (hit1D) { // type=1D
1058  statedirection = localMomentum;
1059  if (statedirection.mag())
1060  RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, track_ok);
1061  } else {
1062  LogDebug("SiStripMonitorTrack") << " LocalMomentum: " << statedirection
1063  << "\nLocal x-z plane angle: " << atan2(statedirection.x(), statedirection.z());
1064  }
1065 }
1066 //------------------------------------------------------------------------
1068  using namespace std;
1069  using namespace edm;
1070  using namespace reco;
1071 
1072  // edm::Handle<std::vector<Trajectory> > trajectories;
1073  // ev.getByToken(trajectoryToken_, trajectories);
1074 
1075  // track input
1076  edm::Handle<reco::TrackCollection> trackCollectionHandle;
1077  ev.getByToken(trackToken_, trackCollectionHandle); //takes the track collection
1078 
1079  // digis list
1081  ev.getByToken(digiToken_, digihandle);
1083  auto& digilist = digihandle.isValid() ? *(digihandle.product()) : dummy;
1084 
1085  if (trackCollectionHandle.isValid()) {
1086  trackStudyFromTrajectory(trackCollectionHandle, digilist, ev);
1087  } else {
1088  edm::LogError("SiStripMonitorTrack") << "also Track Collection is not valid !! " << TrackLabel_ << std::endl;
1089  return;
1090  }
1091 }
1092 
1093 //------------------------------------------------------------------------
1094 // Should return true if the track is good, false if it should be discarded.
1096  if (track.pt() < 0.8)
1097  return false;
1098  if (track.p() < 2.0)
1099  return false;
1100  if (track.hitPattern().numberOfValidTrackerHits() <= 6)
1101  return false;
1102  if (track.normalizedChi2() > 10.0)
1103  return false;
1104  return true;
1105 }
1106 //------------------------------------------------------------------------
1108  const edm::DetSetVector<SiStripDigi>& digilist,
1109  const edm::Event& ev) {
1110  //numTracks = trackCollectionHandle->size();
1111  reco::TrackCollection trackCollection = *trackCollectionHandle;
1112  for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
1113  track != etrack;
1114  ++track) {
1115  bool track_ok = trackFilter(*track);
1116  // const reco::TransientTrack transientTrack = transientTrackBuilder->build(track);
1117 
1118  for (trackingRecHit_iterator hit = track->recHitsBegin(), ehit = track->recHitsEnd(); hit != ehit; ++hit) {
1119  if (TkHistoMap_On_) {
1120  uint32_t thedetid = (*hit)->rawId();
1121  if (SiStripDetId(thedetid).subDetector() >= 3 &&
1122  SiStripDetId(thedetid).subDetector() <= 6) { //TIB/TID + TOB + TEC only
1123  if (((*hit)->getType() == 1))
1124  tkhisto_NumMissingHits->add(thedetid, 1.);
1125  if (((*hit)->getType() == 2))
1126  tkhisto_NumberInactiveHits->add(thedetid, 1.);
1127  if (((*hit)->getType() == 0))
1128  tkhisto_NumberValidHits->add(thedetid, 1.);
1129  }
1130  }
1131 
1132  if (!(*hit)->isValid())
1133  continue;
1134  DetId detID = (*hit)->geographicalId();
1135  if (detID.det() != DetId::Tracker)
1136  continue;
1137  const TrackingRecHit* theHit = (*hit);
1138  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>((theHit));
1139  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>((theHit));
1140  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>((theHit));
1141  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>((theHit));
1142 
1143  // GlobalPoint globalPoint = hit->globalPosition();
1144  // reco::TrajectoryStateOnSurface stateOnSurface = transientTrack->stateOnSurface(globalPoint);
1145 
1146  LocalVector localMomentum;
1147  hitStudy(ev, digilist, projhit, matchedhit, hit2D, hit1D, localMomentum, track_ok);
1148  }
1149 
1150  // hit pattern of the track
1151  // const reco::HitPattern & hitsPattern = track->hitPattern();
1152  // loop over the hits of the track
1153  // for (int i=0; i<hitsPattern.numberOfAllHits(); i++) {
1154  // for (int i=0; i<hitsPattern.numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) {
1155  // uint32_t hit = hitsPattern.getHitPattern(reco::HitPattern::TRACK_HITS,i);
1156 
1157  // if the hit is valid and in pixel barrel, print out the layer
1158  // if (hitsPattern.validHitFilter(hit) && hitsPattern.pixelBarrelHitFilter(hit))
1159 
1160  // if (!hitsPattern.validHitFilter(hit)) continue;
1161  // if (hitsPattern.pixelHitFilter(hit)) std::cout << "pixel" << std::endl; // pixel
1162  // if (hitsPattern.pixelBarrelHitFilter(hit)) std::cout << "pixel barrel" << std::endl; // pixel barrel
1163  // if (hitsPattern.pixelEndcapHitFilter(hit)) std::cout << "pixel endcap" << std::endl; // pixel endcap
1164  // if (hitsPattern.stripHitFilter(hit)) std::cout << "strip" << std::endl; // strip
1165  // if (hitsPattern.stripTIBHitFilter(hit)) std::cout << "TIB" << std::endl; // strip TIB
1166  // if (hitsPattern.stripTIDHitFilter(hit)) std::cout << "TID" << std::endl; // strip TID
1167  // if (hitsPattern.stripTOBHitFilter(hit)) std::cout << "TOB" << std::endl; // strip TOB
1168  // if (hitsPattern.stripTECHitFilter(hit)) std::cout << "TEC" << std::endl; // strip TEC
1169  // if (hitsPattern.muonDTHitFilter(hit)) std::cout << "DT" << std::endl; // muon DT
1170  // if (hitsPattern.muonCSCHitFilter(hit)) std::cout << "CSC" << std::endl; // muon CSC
1171  // if (hitsPattern.muonRPCHitFilter(hit)) std::cout << "RPC" << std::endl; // muon RPC
1172  //
1173  // // expert level: printout the hit in 10-bit binary format
1174  // std::cout << "hit in 10-bit binary format = ";
1175  // for (int j=9; j>=0; j--) {
1176  // int bit = (hit >> j) & 0x1;
1177  // std::cout << bit;
1178  // }
1179  // std::cout << std::endl;
1180  // }
1181  }
1182 }
1183 //------------------------------------------------------------------------
1185  const edm::DetSetVector<SiStripDigi>& digilist,
1186  const edm::Event& ev) {
1187  //Perform track study
1188  int i = 0;
1189  reco::TrackCollection trackCollection = *trackCollectionHandle;
1190  numTracks = trackCollection.size();
1191  for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
1192  track != etrack;
1193  ++track) {
1194  LogDebug("SiStripMonitorTrack") << "Track number " << ++i << std::endl;
1195  // << "\n\tmomentum: " << trackref->momentum()
1196  // << "\n\tPT: " << trackref->pt()
1197  // << "\n\tvertex: " << trackref->vertex()
1198  // << "\n\timpact parameter: " << trackref->d0()
1199  // << "\n\tcharge: " << trackref->charge()
1200  // << "\n\tnormalizedChi2: " << trackref->normalizedChi2()
1201  // <<"\n\tFrom EXTRA : "
1202  // <<"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
1203 
1204  // trajectoryStudy(traj_iterator,trackref);
1205  bool track_ok = trackFilter(*track);
1206  trajectoryStudy(*track, digilist, ev, track_ok);
1207  }
1208 }
1209 //------------------------------------------------------------------------
1210 template <class T>
1211 void SiStripMonitorTrack::RecHitInfo(const T* tkrecHit,
1212  LocalVector LV,
1213  const edm::DetSetVector<SiStripDigi>& digilist,
1214  const edm::Event& ev,
1215  bool track_ok) {
1216  if (!tkrecHit->isValid()) {
1217  LogTrace("SiStripMonitorTrack") << "\t\t Invalid Hit " << std::endl;
1218  return;
1219  }
1220 
1221  const uint32_t& detid = tkrecHit->geographicalId().rawId();
1222 
1223  LogTrace("SiStripMonitorTrack")
1224  << "\n\t\tRecHit on det " << detid << "\n\t\tRecHit in LP " << tkrecHit->localPosition() << "\n\t\tRecHit in GP "
1225  << tkgeom_->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
1226  << "\n\t\tRecHit trackLocal vector " << LV.x() << " " << LV.y() << " " << LV.z() << std::endl;
1227 
1228  //Get SiStripCluster from SiStripRecHit
1229  if (tkrecHit != nullptr && tkrecHit->isValid()) {
1230  const DetId detid = tkrecHit->geographicalId();
1231  int subDet = detid.subdetId();
1232  //std::cout << __LINE__ << std::endl;
1233  float clust_Pos1 = -1000;
1234  float clust_Pos2 = -1000;
1235 
1236  GlobalPoint theGlobalPos =
1237  tkgeom_->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition());
1238  if (subDet == SiStripDetId::TIB || subDet == SiStripDetId::TOB) {
1239  clust_Pos1 = theGlobalPos.z();
1240  clust_Pos2 = theGlobalPos.phi();
1241  } else {
1242  clust_Pos1 = pow(theGlobalPos.x() * theGlobalPos.x() + theGlobalPos.y() * theGlobalPos.y(), 0.5);
1243  clust_Pos2 = theGlobalPos.phi();
1244  }
1245 
1246  const SiStripCluster* SiStripCluster_ = &*(tkrecHit->cluster());
1247  siStripClusterInfo_.setCluster(*SiStripCluster_, detid);
1248 
1249  const Det2MEs MEs = findMEs(trackerTopology_, detid);
1251  detid,
1252  OnTrack,
1253  track_ok,
1254  LV,
1255  MEs,
1259  digilist,
1260  clust_Pos1,
1261  clust_Pos2)) {
1262  vPSiStripCluster.insert(SiStripCluster_);
1263  }
1264  } else {
1265  edm::LogError("SiStripMonitorTrack") << "NULL hit" << std::endl;
1266  }
1267 }
1268 
1269 //------------------------------------------------------------------------
1271  const TrackerTopology* tTopo = trackerTopology_;
1272 
1274  ev.getByToken(digiToken_, digihandle);
1275 
1277  auto& digilist = digihandle.isValid() ? *(digihandle.product()) : dummy;
1278 
1280  ev.getByToken(clusterToken_, siStripClusterHandle);
1281 
1282  /*edm::ESHandle<StripClusterParameterEstimator> parameterestimator;
1283  es.get<TkStripCPERecord>().get("StripCPEfromTrackAngle", parameterestimator);
1284  const StripClusterParameterEstimator &stripcpe(*parameterestimator);*/
1285 
1286  if (siStripClusterHandle.isValid()) {
1287  //Loop on Dets
1288  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = siStripClusterHandle->begin(),
1289  DSVEnd = siStripClusterHandle->end();
1290  DSViter != DSVEnd;
1291  ++DSViter) {
1292  uint32_t detid = DSViter->id();
1293  const Det2MEs MEs = findMEs(tTopo, detid);
1294 
1295  LogDebug("SiStripMonitorTrack") << "on detid " << detid << " N Cluster= " << DSViter->size();
1296 
1297  //Loop on Clusters
1298  for (edmNew::DetSet<SiStripCluster>::const_iterator ClusIter = DSViter->begin(), ClusEnd = DSViter->end();
1299  ClusIter != ClusEnd;
1300  ++ClusIter) {
1301  if (vPSiStripCluster.find(&*ClusIter) == vPSiStripCluster.end()) {
1303 
1304  /*const StripGeomDetUnit * stripdet = (const StripGeomDetUnit*) tkgeom->idToDetUnit(detid);
1305  StripClusterParameterEstimator::LocalValues parameters=stripcpe.localParameters(*ClusIter, *stripdet);
1306  LocalPoint lp = parameters.first;
1307  const Surface& surface = tracker->idToDet(detid)->surface();
1308  GlobalPoint gp = surface.toGlobal(lp);*/
1309 
1311  detid,
1312  OffTrack,
1313  /*track_ok*/ false,
1314  LV,
1315  MEs,
1316  tTopo,
1319  digilist,
1320  0,
1321  0);
1322  }
1323  }
1324  }
1325  } else {
1326  edm::LogError("SiStripMonitorTrack") << "ClusterCollection is not valid!!" << std::endl;
1327  return;
1328  }
1329 }
1330 
1331 //------------------------------------------------------------------------
1333  SiStripHistoId hidmanager1;
1334 
1335  std::string layer_id = hidmanager1.getSubdetid(detid, tTopo, false);
1336  std::string ring_id = hidmanager1.getSubdetid(detid, tTopo, true);
1337  std::string sdet_tag = folderOrganizer_.getSubDetFolderAndTag(detid, tTopo).second;
1338 
1339  Det2MEs me;
1340  me.iLayer = nullptr;
1341  me.iRing = nullptr;
1342  me.iSubdet = nullptr;
1343 
1344  std::map<std::string, LayerMEs>::iterator iLayer = LayerMEsMap.find(layer_id);
1345  if (iLayer != LayerMEsMap.end()) {
1346  me.iLayer = &(iLayer->second);
1347  }
1348 
1349  std::map<std::string, RingMEs>::iterator iRing = RingMEsMap.find(ring_id);
1350  if (iRing != RingMEsMap.end()) {
1351  me.iRing = &(iRing->second);
1352  }
1353 
1354  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(sdet_tag);
1355  if (iSubdet != SubDetMEsMap.end()) {
1356  me.iSubdet = &(iSubdet->second);
1357  }
1358 
1359  return me;
1360 }
1361 
1363  const TrackerTopology* tTopo = trackerTopology_;
1364 
1366  ev.getByToken(trackToken_, tracks); //takes the track collection
1367 
1368  //check that tracks are valid
1369  if (!tracks.isValid())
1370  return false;
1371 
1372  // loop over the tracks
1373  for (const auto& track : *tracks) {
1374  // loop over the rechits of this track
1375  for (trackingRecHit_iterator hit = track.recHitsBegin(), ehit = track.recHitsEnd(); hit != ehit; ++hit) {
1376  uint32_t thedetid = (*hit)->rawId();
1377  if (!(DetId(thedetid).subdetId() >= 3 && DetId(thedetid).subdetId() <= 6)) {
1378  continue;
1379  }
1380 
1381  if (!(*hit)->isValid())
1382  continue;
1383 
1384  const TrackingRecHit* theHit = (*hit);
1385  if (theHit == nullptr) {
1386  continue;
1387  }
1388 
1389  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>(theHit);
1390  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>(theHit);
1391 
1392  float sovn = -1.;
1393  if (hit1D && !hit2D) {
1394  const SiStripCluster* SiStripCluster_ = &*(hit1D->cluster());
1395  siStripClusterInfo_.setCluster(*SiStripCluster_, thedetid);
1397  }
1398 
1399  else if (!hit1D && hit2D) {
1400  const SiStripCluster* SiStripCluster_ = &*(hit2D->cluster());
1401  siStripClusterInfo_.setCluster(*SiStripCluster_, thedetid);
1403  }
1404 
1405  std::vector<const FedChannelConnection*> getFedChanConnections;
1406  getFedChanConnections = siStripDetCabling_->getConnections(thedetid);
1407 
1408  // SiStripFolderOrganizer folder_organizer;
1409  // std::string sistripsubdet = folder_organizer.getSubDetFolderAndTag(thedetid, tTopo).second;
1410 
1411  // loop over the fed chan connections
1412  for (const auto& getFedChanConnection : getFedChanConnections) {
1413  if (getFedChanConnection == nullptr) {
1414  continue;
1415  }
1416 
1417  int binfeccrate = getFedChanConnection->fecCrate();
1418  int binfecslot = getFedChanConnection->fecSlot();
1419  int binfecring = getFedChanConnection->fecRing();
1420  //int binccuchan = getFedChanConnections[i0]->ccuChan(); //will be used in a new PR
1421  //int binccuadd = getFedChanConnections[i0]->ccuAddr(); //will be used in a new PR
1422 
1425  binfecslot,
1426  binfeccrate,
1427  sovn);
1428 
1429  // TIB/TID
1430  // if ((sistripsubdet.find("TIB")) || (sistripsubdet.find("TID"))) {
1431  if ((DetId(thedetid).subdetId() == SiStripDetId::TIB) || ((DetId(thedetid).subdetId() == SiStripDetId::TID))) {
1435  binfecring,
1436  binfecslot,
1437  sovn);
1438  }
1439 
1440  // TOB
1441  if (DetId(thedetid).subdetId() == SiStripDetId::TOB) {
1445  binfecring,
1446  binfecslot,
1447  sovn);
1448  }
1449 
1450  // TECM
1451  if ((DetId(thedetid).subdetId() == SiStripDetId::TEC) && (tTopo->tecSide(thedetid) == 1)) {
1455  binfecring,
1456  binfecslot,
1457  sovn);
1458  }
1459 
1460  // TECP
1461  if ((DetId(thedetid).subdetId() == SiStripDetId::TEC) && (tTopo->tecSide(thedetid) == 2)) {
1465  binfecring,
1466  binfecslot,
1467  sovn);
1468  }
1469 
1470  } // end of looping over the fed chan connections
1471  } // end of looping over the rechits of the track
1472  } // end of looping over the tracks
1473 
1474  return true;
1475 }
1476 
1478  if (input1->getBinContent(binx, biny) == 0.) {
1479  input1->setBinContent(binx, biny, value);
1480  input2->setBinContent(binx, biny, 1);
1481  } else {
1482  double nentries = input2->getBinContent(binx, biny);
1483  double theMeanSoN = (input1->getBinContent(binx, biny) * nentries + value) / (nentries + 1);
1484  //input1->setBinContent(binx,biny,((input1->getBinContent(binx,biny)+value)/2.));
1485  input1->setBinContent(binx, biny, theMeanSoN);
1486  input2->setBinContent(binx, biny, input2->getBinContent(binx, biny) + 1);
1487  }
1488 }
1489 
1490 //------------------------------------------------------------------------
1493  const uint32_t detid,
1494  enum ClusterFlags flag,
1495  bool track_ok,
1496  const LocalVector LV,
1497  const Det2MEs& MEs,
1498  const TrackerTopology* tTopo,
1499  const SiStripGain* stripGain,
1500  const SiStripQuality* stripQuality,
1501  const edm::DetSetVector<SiStripDigi>& digilist,
1502  float valX,
1503  float valY) {
1504  if (cluster == nullptr)
1505  return false;
1506  // if one imposes a cut on the clusters, apply it
1507  if ((applyClusterQuality_) &&
1508  (cluster->signalOverNoise() < sToNLowerLimit_ || cluster->signalOverNoise() > sToNUpperLimit_ ||
1509  cluster->width() < widthLowerLimit_ || cluster->width() > widthUpperLimit_))
1510  return false;
1511  // start of the analysis
1512 
1513  float cosRZ = -2;
1514  LogDebug("SiStripMonitorTrack") << "\n\tLV " << LV.x() << " " << LV.y() << " " << LV.z() << " " << LV.mag()
1515  << std::endl;
1516  if (LV.mag()) {
1517  cosRZ = fabs(LV.z()) / LV.mag();
1518  LogDebug("SiStripMonitorTrack") << "\n\t cosRZ " << cosRZ << std::endl;
1519  }
1520 
1521  // Filling SubDet/Layer Plots (on Track + off Track)
1522  float StoN = cluster->signalOverNoise();
1523  float noise = cluster->noiseRescaledByGain();
1524  uint16_t charge = cluster->charge();
1525  uint16_t width = cluster->width();
1526  float position = cluster->baryStrip();
1527 
1528  // Getting raw charge with strip gain.
1529  double chargeraw = 0;
1530  double clustergain = 0;
1531  auto digi_it = digilist.find(detid); //(digilist.isValid() ? digilist.find(detid) : digilist.end());
1532  // SiStripClusterInfo.stripCharges() <==> SiStripCluster.amplitudes()
1533  for (size_t chidx = 0; chidx < cluster->stripCharges().size(); ++chidx) {
1534  if (cluster->stripCharges()[chidx] <= 0) {
1535  continue;
1536  } // nonzero amplitude
1537  if (stripQuality->IsStripBad(stripQuality->getRange(detid), cluster->firstStrip() + chidx)) {
1538  continue;
1539  }
1540  clustergain += stripGain->getStripGain(cluster->firstStrip() + chidx, stripGain->getRange(detid));
1541  // Getting raw adc charge from digi collections
1542  if (digi_it == digilist.end()) {
1543  continue;
1544  } // skipping if not found
1545  for (const auto& digiobj : *digi_it) {
1546  if (digiobj.strip() == cluster->firstStrip() + chidx) {
1547  chargeraw += digiobj.adc();
1548  }
1549  }
1550  }
1551 
1552  clustergain /= double(cluster->stripCharges().size()); // calculating average gain inside cluster
1553 
1554  // new dE/dx (chargePerCM)
1555  // https://indico.cern.ch/event/342236/session/5/contribution/10/material/slides/0.pdf
1556  float dQdx_fromTrack = siStripClusterTools::chargePerCM(detid, *cluster, LV);
1557  // from straigth line origin-sensor centre
1558  const StripGeomDetUnit* DetUnit = static_cast<const StripGeomDetUnit*>(tkgeom_->idToDetUnit(DetId(detid)));
1559  LocalPoint locVtx = DetUnit->toLocal(GlobalPoint(0.0, 0.0, 0.0));
1560  LocalVector locDir(locVtx.x(), locVtx.y(), locVtx.z());
1561  float dQdx_fromOrigin = siStripClusterTools::chargePerCM(detid, *cluster, locDir);
1562 
1563  if (TkHistoMap_On_ && (flag == OnTrack)) {
1564  uint32_t adet = cluster->detId();
1565  if (track_ok)
1566  tkhisto_ClChPerCMfromTrack->fill(adet, dQdx_fromTrack);
1567  }
1568  if (clchCMoriginTkHmap_On_ && (flag == OffTrack)) {
1569  uint32_t adet = cluster->detId();
1570  if (track_ok)
1571  tkhisto_ClChPerCMfromOrigin->fill(adet, dQdx_fromOrigin);
1572  }
1573 
1574  if (flag == OnTrack) {
1575  if (MEs.iSubdet != nullptr) {
1576  MEs.iSubdet->totNClustersOnTrack++;
1577  if (StripSubdetector(detid).stereo() == 1)
1578  MEs.iSubdet->totNClustersOnTrackStereo++;
1579  else
1580  MEs.iSubdet->totNClustersOnTrackMono++;
1581  }
1582  // layerMEs
1583  if (MEs.iLayer != nullptr) {
1584  if (noise > 0.0)
1585  fillME(MEs.iLayer->ClusterStoNCorrOnTrack, StoN * cosRZ);
1586  if (noise == 0.0)
1587  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise "
1588  << cluster->noiseRescaledByGain() << std::endl;
1589  fillME(MEs.iLayer->ClusterGain, clustergain);
1590  fillME(MEs.iLayer->ClusterChargeCorrOnTrack, charge * cosRZ);
1591  fillME(MEs.iLayer->ClusterChargeOnTrack, charge);
1592  fillME(MEs.iLayer->ClusterChargeRawOnTrack, chargeraw);
1593  fillME(MEs.iLayer->ClusterNoiseOnTrack, noise);
1594  fillME(MEs.iLayer->ClusterWidthOnTrack, width);
1595  fillME(MEs.iLayer->ClusterPosOnTrack, position);
1596  //auto clustgp = cluster->globalPosition();
1597 
1598  fillME(MEs.iLayer->ClusterPosOnTrack2D, valX, valY);
1599 
1600  if (track_ok)
1601  fillME(MEs.iLayer->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1602  if (track_ok)
1603  fillME(MEs.iLayer->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1604  }
1605  // ringMEs
1606  if (MEs.iRing != nullptr) {
1607  if (noise > 0.0)
1608  fillME(MEs.iRing->ClusterStoNCorrOnTrack, StoN * cosRZ);
1609  if (noise == 0.0)
1610  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise "
1611  << cluster->noiseRescaledByGain() << std::endl;
1612  fillME(MEs.iRing->ClusterGain, clustergain);
1613  fillME(MEs.iRing->ClusterChargeCorrOnTrack, charge * cosRZ);
1614  fillME(MEs.iRing->ClusterChargeOnTrack, charge);
1615  fillME(MEs.iRing->ClusterChargeRawOnTrack, chargeraw);
1616  fillME(MEs.iRing->ClusterNoiseOnTrack, noise);
1617  fillME(MEs.iRing->ClusterWidthOnTrack, width);
1618  fillME(MEs.iRing->ClusterPosOnTrack, position);
1619  if (track_ok)
1620  fillME(MEs.iRing->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1621  if (track_ok)
1622  fillME(MEs.iRing->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1623  }
1624  // subdetMEs
1625  if (MEs.iSubdet != nullptr) {
1626  fillME(MEs.iSubdet->ClusterGain, clustergain);
1627  fillME(MEs.iSubdet->ClusterChargeOnTrack, charge);
1628  fillME(MEs.iSubdet->ClusterChargeRawOnTrack, chargeraw);
1629  if (noise > 0.0)
1630  fillME(MEs.iSubdet->ClusterStoNCorrOnTrack, StoN * cosRZ);
1631  fillME(MEs.iSubdet->ClusterChargeCorrOnTrack, charge * cosRZ);
1632  if (track_ok)
1633  fillME(MEs.iSubdet->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1634  if (track_ok)
1635  fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1636  if (tTopo->moduleGeometry(detid) == SiStripModuleGeometry::W5 ||
1637  tTopo->moduleGeometry(detid) == SiStripModuleGeometry::W6 ||
1638  tTopo->moduleGeometry(detid) == SiStripModuleGeometry::W7) {
1639  if (noise > 0.0)
1640  fillME(MEs.iSubdet->ClusterStoNCorrThickOnTrack, StoN * cosRZ);
1641  fillME(MEs.iSubdet->ClusterChargeCorrThickOnTrack, charge * cosRZ);
1642  } else {
1643  if (noise > 0.0)
1644  fillME(MEs.iSubdet->ClusterStoNCorrThinOnTrack, StoN * cosRZ);
1645  fillME(MEs.iSubdet->ClusterChargeCorrThinOnTrack, charge * cosRZ);
1646  }
1647  }
1648  //******** TkHistoMaps
1649  if (TkHistoMap_On_) {
1650  uint32_t adet = cluster->detId();
1651  tkhisto_NumOnTrack->add(adet, 1.);
1652  if (noise > 0.0)
1653  tkhisto_StoNCorrOnTrack->fill(adet, cluster->signalOverNoise() * cosRZ);
1654  if (noise == 0.0)
1655  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << noise
1656  << std::endl;
1657  }
1658  if (TkHistoMap_On_ && (flag == OnTrack)) {
1659  uint32_t adet = cluster->detId();
1660  tkhisto_ClusterWidthOnTrack->fill(adet, cluster->width());
1661  if (noise > 0.0)
1662  tkhisto_NoiseOnTrack->fill(adet, cluster->noiseRescaledByGain() * cosRZ);
1663  }
1664 
1665  // Module plots filled only for onTrack Clusters
1666  if (Mod_On_) {
1667  SiStripHistoId hidmanager2;
1668  std::string name = hidmanager2.createHistoId("", "det", detid);
1669  //fillModMEs
1670  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(name);
1671  if (iModME != ModMEsMap.end()) {
1672  if (noise > 0.0)
1673  fillME(iModME->second.ClusterStoNCorr, StoN * cosRZ);
1674  if (noise == 0.0)
1675  LogDebug("SiStripMonitorTrack")
1676  << "Module " << name << " in Event " << eventNb << " noise " << noise << std::endl;
1677  fillME(iModME->second.ClusterGain, clustergain);
1678  fillME(iModME->second.ClusterCharge, charge);
1679  fillME(iModME->second.ClusterChargeRaw, chargeraw);
1680 
1681  fillME(iModME->second.ClusterChargeCorr, charge * cosRZ);
1682 
1683  fillME(iModME->second.ClusterWidth, width);
1684  fillME(iModME->second.ClusterPos, position);
1685 
1686  if (track_ok)
1687  fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1688  if (track_ok)
1689  fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1690 
1691  //fill the PGV histo
1692  float PGVmax = cluster->maxCharge();
1693  int PGVposCounter = cluster->maxIndex();
1694  for (int i = int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmin"));
1695  i < PGVposCounter;
1696  ++i)
1697  fillME(iModME->second.ClusterPGV, i, 0.);
1698  for (auto it = cluster->stripCharges().begin(); it < cluster->stripCharges().end(); ++it) {
1699  fillME(iModME->second.ClusterPGV, PGVposCounter++, (*it) / PGVmax);
1700  }
1701  for (int i = PGVposCounter;
1702  i < int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmax"));
1703  ++i)
1704  fillME(iModME->second.ClusterPGV, i, 0.);
1705  //end fill the PGV histo
1706  }
1707  }
1708  } else {
1709  if (flag == OffTrack) {
1710  if (MEs.iSubdet != nullptr)
1711  MEs.iSubdet->totNClustersOffTrack++;
1712  //******** TkHistoMaps
1713  if (TkHistoMap_On_) {
1714  uint32_t adet = cluster->detId();
1715  tkhisto_NumOffTrack->add(adet, 1.);
1716  if (charge > 250) {
1717  LogDebug("SiStripMonitorTrack") << "Module firing " << detid << " in Event " << eventNb << std::endl;
1718  }
1719  }
1720  if (TkHistoMap_On_) {
1721  uint32_t adet = cluster->detId();
1722  tkhisto_ClusterWidthOffTrack->fill(adet, cluster->width());
1723  if (noise > 0.0)
1724  tkhisto_NoiseOffTrack->fill(adet, cluster->noiseRescaledByGain());
1725  }
1726  }
1727  // layerMEs
1728  if (MEs.iLayer != nullptr) {
1729  fillME(MEs.iLayer->ClusterGain, clustergain);
1730  fillME(MEs.iLayer->ClusterChargeOffTrack, charge);
1731  fillME(MEs.iLayer->ClusterChargeRawOffTrack, chargeraw);
1732  fillME(MEs.iLayer->ClusterNoiseOffTrack, noise);
1733  fillME(MEs.iLayer->ClusterWidthOffTrack, width);
1734  fillME(MEs.iLayer->ClusterPosOffTrack, position);
1735  fillME(MEs.iLayer->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1736  }
1737  // ringMEs
1738  if (MEs.iRing != nullptr) {
1739  fillME(MEs.iRing->ClusterGain, clustergain);
1740  fillME(MEs.iRing->ClusterChargeOffTrack, charge);
1741  fillME(MEs.iRing->ClusterChargeRawOffTrack, chargeraw);
1742  fillME(MEs.iRing->ClusterNoiseOffTrack, noise);
1743  fillME(MEs.iRing->ClusterWidthOffTrack, width);
1744  fillME(MEs.iRing->ClusterPosOffTrack, position);
1745  fillME(MEs.iRing->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1746  }
1747  // subdetMEs
1748  if (MEs.iSubdet != nullptr) {
1749  fillME(MEs.iSubdet->ClusterGain, clustergain);
1750  fillME(MEs.iSubdet->ClusterChargeOffTrack, charge);
1751  fillME(MEs.iSubdet->ClusterChargeRawOffTrack, chargeraw);
1752  if (noise > 0.0)
1753  fillME(MEs.iSubdet->ClusterStoNOffTrack, StoN);
1754  fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1755  }
1756  }
1757  return true;
1758 }
1759 //--------------------------------------------------------------------------------
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID
std::unique_ptr< TkHistoMap > tkhisto_NoiseOffTrack
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyRunToken_
void return2DME(MonitorElement *input1, MonitorElement *input2, int binx, int biny, double value)
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
MonitorElement * ClusterStoNCorr_OnTrack_TECP
MonitorElement * ClusterChargePerCMfromTrack
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripRecHit2D stereoHit() const
SiStripMonitorTrack(const edm::ParameterSet &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyEventToken_
iterator find(det_id_type id)
Definition: DetSetVector.h:264
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromOrigin
void setSiStripFolderName(std::string name)
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > siStripDetCablingToken_
void setCluster(const SiStripCluster &cluster, int detId)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
void fillME(MonitorElement *ME, float value1)
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
SiStripDCSStatus * dcsStatus_
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev)
T z() const
Definition: PV3DBase.h:61
static constexpr auto TID
Definition: SiStripDetId.h:38
math::XYZTLorentzVectorD LV
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::map< std::string, RingMEs > RingMEsMap
const TrackerGeometry * tkgeom_
T const * product() const
Definition: Handle.h:70
float chargePerCM(DetId detid, Iter a, Iter b)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ParameterSet conf_
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, bool track_ok, LocalVector LV, const Det2MEs &MEs, const TrackerTopology *tTopo, const SiStripGain *stripGain, const SiStripQuality *stripQuality, const edm::DetSetVector< SiStripDigi > &digilist, float clustZ, float clustPhi)
const SiStripGain * siStripGain() const
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
MonitorElement * ClusterChargePerCMfromTrack
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:75
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
MonitorElement * ClusterChargeCorrOnTrack
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
data_type const * const_iterator
Definition: DetSetNew.h:31
bool trackFilter(const reco::Track &track)
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, bool track_ok)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
assert(be >=bs)
const Range getRange(const uint32_t detID) const
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
void bookHistograms(DQMStore::IBooker &, edm::Run const &, const edm::EventSetup &) override
MonitorElement * ClusterChargePerCMfromOriginOffTrack
ClusterRef cluster() const
#define input2
Definition: AMPTWrapper.h:159
auto stripCharges() const -> decltype(cluster() ->amplitudes())
#define LogTrace(id)
MonitorElement * ClusterChargeCorrThinOnTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
float signalOverNoise() const
void Fill(long long x)
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
MonitorElement * ClusterCount_OnTrack_FECCratevsFECSlot
MonitorElement * ClusterChargeRawOnTrack
MonitorElement * ClusterStoNCorr_OnTrack_TOB
edm::EventNumber_t eventNb
std::unordered_set< const SiStripCluster * > vPSiStripCluster
std::map< std::string, SubDetMEs > SubDetMEsMap
uint32_t detId() const
unsigned int tecSide(const DetId &id) const
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:77
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
const std::string subdet_tag("SubDet")
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromTrack
T mag() const
Definition: PV3DBase.h:64
uint8_t maxCharge() const
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
Transition
Definition: Transition.h:12
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
#define input1
Definition: AMPTWrapper.h:139
const SiStripQuality * siStripQuality() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
void book(DQMStore::IBooker &, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
SiStripClusterInfo siStripClusterInfo_
Definition: value.py:1
std::unique_ptr< TkHistoMap > tkhisto_NumOffTrack
MonitorElement * ClusterChargePerCMfromOrigin
MonitorElement * ClusterChargePerCMfromOriginOffTrack
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterChargePerCMfromTrack
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
trackCollection
Definition: JetHT_cfg.py:51
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > digiToken_
const TrackerGeomDet * idToDet(DetId) const override
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
MonitorElement * ClusterChargeCorrThickOnTrack
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
float noiseRescaledByGain() const
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECM
uint16_t firstStrip() const
SiStripModuleGeometry moduleGeometry(const DetId &id) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
uint16_t maxIndex() const
Definition: DetId.h:17
void bookModMEs(DQMStore::IBooker &, const uint32_t)
void trajectoryStudy(const reco::Track &track, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, bool track_ok)
DetId geographicalId() const
MonitorElement * ClusterStoNCorr_OnTrack_FECCratevsFECSlot
bool IsStripBad(uint32_t detid, short strip) const
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOffTrack
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void AllClusters(const edm::Event &ev)
MonitorElement * ClusterChargePerCMfromTrack
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
bool fillControlViewHistos(const edm::Event &ev)
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
std::map< std::string, ModMEs > ModMEsMap
virtual DQM_DEPRECATED void setStatOverflows(bool value)
uint16_t width() const
std::unique_ptr< TkHistoMap > tkhisto_StoNCorrOnTrack
static constexpr auto TIB
Definition: SiStripDetId.h:37
std::string HistoName
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB
bool isValid() const
Definition: HandleBase.h:70
void trackStudyFromTrajectory(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterStoNCorr_OnTrack_TIBTID
GenericTriggerEventFlag * genTriggerEventFlag_
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOnTrack
MonitorElement * ClusterChargePerCMfromOriginOnTrack
fixed size matrix
HLT enums.
std::unique_ptr< TkHistoMap > tkhisto_NumMissingHits
SiStripRecHit2D originalHit() const
static int position[264][3]
Definition: ReadPGInfo.cc:289
const SiStripDetCabling * siStripDetCabling_
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &) override
std::unique_ptr< TkHistoMap > tkhisto_NoiseOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumberValidHits
std::unique_ptr< TkHistoMap > tkhisto_NumOnTrack
SiStripRecHit2D monoHit() const
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID
std::unique_ptr< TkHistoMap > tkhisto_NumberInactiveHits
uint16_t charge() const
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
MonitorElement * ClusterChargePerCMfromOriginOnTrack
edm::ParameterSet Parameters
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void initEvent(const edm::EventSetup &iSetup)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void hitStudy(const edm::Event &ev, const edm::DetSetVector< SiStripDigi > &digilist, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
float baryStrip() const
long double T
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
Definition: DQMStore.h:367
void trackStudy(const edm::Event &ev)
ClusterRef cluster() const
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
MonitorElement * ClusterStoNCorrThickOnTrack
MonitorElement * ClusterChargePerCMfromOriginOnTrack
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
const uint16_t nApvPairs(uint32_t det_id) const
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
static constexpr auto TEC
Definition: SiStripDetId.h:40
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECP
Definition: Run.h:45
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
MonitorElement * ClusterStoNCorr_OnTrack_TECM
const TrackerTopology * trackerTopology_
MonitorElement * ClusterChargeRawOffTrack
#define LogDebug(id)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * ClusterChargePerCMfromOriginOffTrack