CMS 3D CMS Logo

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