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