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