CMS 3D CMS Logo

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