CMS 3D CMS Logo

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