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