CMS 3D CMS Logo

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