test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripMonitorTrack.cc
Go to the documentation of this file.
2 
6 
19 
21 
23 #include "TMath.h"
24 
26  conf_(conf),
27  tracksCollection_in_EventTree(true),
28  firstEvent(-1),
29  genTriggerEventFlag_(new GenericTriggerEventFlag(conf.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this))
30 {
31  Cluster_src_ = conf.getParameter<edm::InputTag>("Cluster_src");
32  Mod_On_ = conf.getParameter<bool>("Mod_On");
33  Trend_On_ = conf.getParameter<bool>("Trend_On");
34  TkHistoMap_On_ = conf.getParameter<bool>("TkHistoMap_On");
35 
36  TrackProducer_ = conf_.getParameter<std::string>("TrackProducer");
37  TrackLabel_ = conf_.getParameter<std::string>("TrackLabel");
38 
39  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
40 
41  clusterToken_ = consumes<edmNew::DetSetVector<SiStripCluster> >(Cluster_src_);
42  trackToken_ = consumes<reco::TrackCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
43  trackTrajToken_ = consumes<TrajTrackAssociationCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
44 
45  // cluster quality conditions
46  edm::ParameterSet cluster_condition = conf_.getParameter<edm::ParameterSet>("ClusterConditions");
47  applyClusterQuality_ = cluster_condition.getParameter<bool>("On");
48  sToNLowerLimit_ = cluster_condition.getParameter<double>("minStoN");
49  sToNUpperLimit_ = cluster_condition.getParameter<double>("maxStoN");
50  widthLowerLimit_ = cluster_condition.getParameter<double>("minWidth");
51  widthUpperLimit_ = cluster_condition.getParameter<double>("maxWidth");
52 
53 
54  // Create DCS Status
55  bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering");
56  if (checkDCS) dcsStatus_ = new SiStripDCSStatus(consumesCollector());
57  else dcsStatus_ = 0;
58 }
59 
60 //------------------------------------------------------------------------
62  if (dcsStatus_) delete dcsStatus_;
64 }
65 
66 //------------------------------------------------------------------------
68 {
69  //get geom
71  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::beginRun] There are "<<tkgeom_->detUnits().size() <<" detectors instantiated in the geometry" << std::endl;
73 
74 
75  // Initialize the GenericTriggerEventFlag
77 }
78 
79 //------------------------------------------------------------------------
81 {
82  //Retrieve tracker topology from geometry
84  es.get<TrackerTopologyRcd>().get(tTopoHandle);
85  const TrackerTopology* const tTopo = tTopoHandle.product();
86  book(ibooker , tTopo);
87 }
88 
89 // ------------ method called to produce the data ------------
91 {
92  // Filter out events if DCS checking is requested
93  if (dcsStatus_ && !dcsStatus_->getStatus(e,es)) return;
94 
95  // Filter out events if Trigger Filtering is requested
96  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( e, es) ) return;
97 
98  //initialization of global quantities
99  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::analyse] " << "Run " << e.id().run() << " Event " << e.id().event() << std::endl;
100  eventNb = e.id().event();
101  vPSiStripCluster.clear();
102 
103  iLumisection = e.orbitNumber()/262144.0;
104 
105  // initialise # of clusters
106  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin();
107  iSubDet != SubDetMEsMap.end(); iSubDet++) {
108  iSubDet->second.totNClustersOnTrack = 0;
109  iSubDet->second.totNClustersOffTrack = 0;
110  }
111 
112  //Perform track study
113  trackStudy(e, es);
114 
115  //Perform Cluster Study (irrespectively to tracks)
116 
117  AllClusters(e, es); //analyzes the off Track Clusters
118 
119  //Summary Counts of clusters
120  std::map<std::string, MonitorElement*>::iterator iME;
121  std::map<std::string, LayerMEs>::iterator iLayerME;
122 
123  if (Trend_On_) {
124  // for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin(), iterEnd=SubDetMEsMaps.end();
125  // iSubDet != iterEnd; ++iSubDet) {
126  for (auto const &iSubDet : SubDetMEsMap) {
127  SubDetMEs subdet_mes = iSubDet.second;
128  if (subdet_mes.totNClustersOnTrack > 0) {
129  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
130  }
131  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
134  }
135  } else {
136  for (auto const &iSubDet : SubDetMEsMap) {
137  SubDetMEs subdet_mes = iSubDet.second;
138  if (subdet_mes.totNClustersOnTrack > 0) {
139  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
140  }
141  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
142  }
143  }
144 }
145 
146 //------------------------------------------------------------------------
148 {
149 
150  SiStripFolderOrganizer folder_organizer;
151  folder_organizer.setSiStripFolderName(topFolderName_);
152  //******** TkHistoMaps
153  if (TkHistoMap_On_) {
154  tkhisto_StoNCorrOnTrack = new TkHistoMap(ibooker , topFolderName_ ,"TkHMap_StoNCorrOnTrack", 0.0,true);
155  tkhisto_NumOnTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOnTrackCluster", 0.0,true);
156  tkhisto_NumOffTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOfffTrackCluster",0.0,true);
157  tkhisto_ClChPerCMfromTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_ChargePerCMfromTrack",0.0,true);
158  tkhisto_NumMissingHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberMissingHits",0.0,true);
159  tkhisto_NumberInactiveHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberInactiveHits",0.0,true);
160  tkhisto_NumberValidHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberValidHits",0.0,true);
161  }
163  tkhisto_ClChPerCMfromOrigin = new TkHistoMap(ibooker , topFolderName_, "TkHMap_ChargePerCMfromOrigin",0.0,true);
164  //******** TkHistoMaps
165 
166  std::vector<uint32_t> vdetId_;
167  SiStripDetCabling_->addActiveDetectorsRawIds(vdetId_);
168  const char* tec = "TEC";
169  const char* tid = "TID";
170  //Histos for each detector, layer and module
171  SiStripHistoId hidmanager;
172 
173  if(Mod_On_) {
174  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
175  uint32_t detid = *detid_iter;
176 
177  if (detid < 1){
178  edm::LogError("SiStripMonitorTrack")<< "[" <<__PRETTY_FUNCTION__ << "] invalid detid " << detid<< std::endl;
179  continue;
180  }
181 
182 
183  //std::string name;
184 
185  // book Layer and RING plots
186  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,false);
187  /*
188  std::string thickness;
189  std::pair<std::string,int32_t> det_layer_pair_test = folder_organizer.GetSubDetAndLayerThickness(detid,tTopo,thickness);
190  std::cout << "[SiStripMonitorTrack::book] det_layer_pair " << det_layer_pair.first << " " << det_layer_pair.second << " " << thickness << std::endl;
191  */
192 
193  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, false);
194 
195  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
196  if(iLayerME==LayerMEsMap.end()){
197  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, false);
198  bookLayerMEs(ibooker , detid, layer_id);
199  }
200 
201  const char* subdet = det_layer_pair.first.c_str();
202  if ( std::strstr(subdet, tec) != NULL || std::strstr(subdet, tid) != NULL ) {
203  std::string ring_id = hidmanager.getSubdetid(detid, tTopo, true);
204  std::map<std::string, RingMEs>::iterator iRingME = RingMEsMap.find(ring_id);
205  if(iRingME==RingMEsMap.end()){
206  std::pair<std::string,int32_t> det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true);
207  folder_organizer.setLayerFolder(detid, tTopo, det_ring_pair.second, true);
208  bookRingMEs(ibooker , detid, ring_id);
209  }
210  }
211 
212  // book sub-detector plots
213  std::pair<std::string,std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
214  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()){
215  ibooker.setCurrentFolder(sdet_pair.first);
216  bookSubDetMEs(ibooker , sdet_pair.second);
217  }
218  // book module plots
219  folder_organizer.setDetectorFolder(detid,tTopo);
220  bookModMEs(ibooker , *detid_iter);
221  }//end loop on detectors detid
222  } else {
223  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
224  uint32_t detid = *detid_iter;
225 
226  if (detid < 1){
227  edm::LogError("SiStripMonitorTrack")<< "[" <<__PRETTY_FUNCTION__ << "] invalid detid " << detid<< std::endl;
228  continue;
229  }
230 
231 
232  //std::string name;
233 
234  // book Layer and RING plots
235  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,false);
236  /*
237  std::string thickness;
238  std::pair<std::string,int32_t> det_layer_pair_test = folder_organizer.GetSubDetAndLayerThickness(detid,tTopo,thickness);
239  std::cout << "[SiStripMonitorTrack::book] det_layer_pair " << det_layer_pair.first << " " << det_layer_pair.second << " " << thickness << std::endl;
240  */
241 
242  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, false);
243 
244  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
245  if(iLayerME==LayerMEsMap.end()){
246  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, false);
247  bookLayerMEs(ibooker , detid, layer_id);
248  }
249 
250  const char* subdet = det_layer_pair.first.c_str();
251  if ( std::strstr(subdet, tec) != NULL || std::strstr(subdet, tid) != NULL ) {
252  std::string ring_id = hidmanager.getSubdetid(detid, tTopo, true);
253  std::map<std::string, RingMEs>::iterator iRingME = RingMEsMap.find(ring_id);
254  if(iRingME==RingMEsMap.end()){
255  std::pair<std::string,int32_t> det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true);
256  folder_organizer.setLayerFolder(detid, tTopo, det_ring_pair.second, true);
257  bookRingMEs(ibooker , detid, ring_id);
258  }
259  }
260 
261  // book sub-detector plots
262  std::pair<std::string,std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
263  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()){
264  ibooker.setCurrentFolder(sdet_pair.first);
265  bookSubDetMEs(ibooker , sdet_pair.second);
266  }
267  }//end loop on detectors detid
268  }
269 }
270 
271 //--------------------------------------------------------------------------------
272 void SiStripMonitorTrack::bookModMEs(DQMStore::IBooker & ibooker , const uint32_t id)//Histograms at MODULE level
273 {
274  std::string name = "det";
275  SiStripHistoId hidmanager;
276  std::string hid = hidmanager.createHistoId("",name,id);
277  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(hid);
278  if(iModME==ModMEsMap.end()){
279  ModMEs theModMEs;
280  theModMEs.ClusterStoNCorr = 0;
281  theModMEs.ClusterCharge = 0;
282  theModMEs.ClusterChargeCorr = 0;
283  theModMEs.ClusterWidth = 0;
284  theModMEs.ClusterPos = 0;
285  theModMEs.ClusterPGV = 0;
286  theModMEs.ClusterChargePerCMfromTrack = 0;
287  theModMEs.ClusterChargePerCMfromOrigin = 0;
288 
289  // Cluster Width
290  theModMEs.ClusterWidth=bookME1D(ibooker , "TH1ClusterWidth", hidmanager.createHistoId("ClusterWidth_OnTrack",name,id).c_str());
291  ibooker.tag(theModMEs.ClusterWidth,id);
292  // Cluster Charge
293  theModMEs.ClusterCharge=bookME1D(ibooker , "TH1ClusterCharge", hidmanager.createHistoId("ClusterCharge_OnTrack",name,id).c_str());
294  ibooker.tag(theModMEs.ClusterCharge,id);
295  // Cluster Charge Corrected
296  theModMEs.ClusterChargeCorr=bookME1D(ibooker , "TH1ClusterChargeCorr", hidmanager.createHistoId("ClusterChargeCorr_OnTrack",name,id).c_str());
297  ibooker.tag(theModMEs.ClusterChargeCorr,id);
298  // Cluster StoN Corrected
299  theModMEs.ClusterStoNCorr=bookME1D(ibooker , "TH1ClusterStoNCorrMod", hidmanager.createHistoId("ClusterStoNCorr_OnTrack",name,id).c_str());
300  ibooker.tag(theModMEs.ClusterStoNCorr,id);
301  // Cluster Position
302  short total_nr_strips = SiStripDetCabling_->nApvPairs(id) * 2 * 128;
303  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);
304  ibooker.tag(theModMEs.ClusterPos,id);
305  // Cluster PGV
306  theModMEs.ClusterPGV=bookMEProfile(ibooker , "TProfileClusterPGV", hidmanager.createHistoId("PGV_OnTrack",name,id).c_str());
307  ibooker.tag(theModMEs.ClusterPGV,id);
308  // Cluster Charge per cm
309  theModMEs.ClusterChargePerCMfromTrack = bookME1D(ibooker , "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromTrack",name,id).c_str());
310  ibooker.tag(theModMEs.ClusterChargePerCMfromTrack,id);
311 
312  theModMEs.ClusterChargePerCMfromOrigin = bookME1D(ibooker , "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromOrigin",name,id).c_str());
313  ibooker.tag(theModMEs.ClusterChargePerCMfromOrigin,id);
314 
315  ModMEsMap[hid]=theModMEs;
316  }
317 }
318 
320 
322  bool view = false;
323  view = (conf_.getParameter<edm::ParameterSet>(histoParameters.c_str())).getParameter<bool>(viewParameter.c_str());
324  if ( id.find("TEC") == std::string::npos && id.find("TID") == std::string::npos ) {
325  me = bookME1D(ibooker , histoParameters.c_str(), histoName.c_str());
326  } else {
327  if (view) {
328  // histoName = histoName + "__" + thickness;
329  me = bookME1D(ibooker , histoParameters.c_str(), histoName.c_str());
330  }
331  }
332  return me;
333 }
334 
335 //
336 // -- Book Layer Level Histograms and Trend plots
337 //
338 //------------------------------------------------------------------------
339 void SiStripMonitorTrack::bookLayerMEs(DQMStore::IBooker & ibooker , const uint32_t mod_id, std::string& layer_id)
340 {
341  std::string name = "layer";
342  std::string view = "layerView";
343  std::string hname;
344  std::string hpar;
345  SiStripHistoId hidmanager;
346 
347  LayerMEs theLayerMEs;
348  theLayerMEs.ClusterStoNCorrOnTrack = 0;
349  theLayerMEs.ClusterChargeCorrOnTrack = 0;
350  theLayerMEs.ClusterChargeOnTrack = 0;
351  theLayerMEs.ClusterChargeOffTrack = 0;
352  theLayerMEs.ClusterNoiseOnTrack = 0;
353  theLayerMEs.ClusterNoiseOffTrack = 0;
354  theLayerMEs.ClusterWidthOnTrack = 0;
355  theLayerMEs.ClusterWidthOffTrack = 0;
356  theLayerMEs.ClusterPosOnTrack = 0;
357  theLayerMEs.ClusterPosOffTrack = 0;
358  theLayerMEs.ClusterChargePerCMfromTrack = 0;
359  theLayerMEs.ClusterChargePerCMfromOriginOnTrack = 0;
360  theLayerMEs.ClusterChargePerCMfromOriginOffTrack = 0;
361 
362  // Signal/Noise (w/ cluster charge corrected)
363  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr",name,layer_id,"OnTrack");
364  hpar = "TH1ClusterStoNCorr";
365  theLayerMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
366 
367  // Cluster Charge Corrected
368  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr",name,layer_id,"OnTrack");
369  hpar = "TH1ClusterChargeCorr";
370  theLayerMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
371 
372  // Cluster Charge (On and Off Track)
373  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OnTrack");
374  hpar = "TH1ClusterCharge";
375  theLayerMEs.ClusterChargeOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
376 
377  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OffTrack");
378  hpar = "TH1ClusterCharge";
379  theLayerMEs.ClusterChargeOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
380 
381  // Cluster Noise (On and Off Track)
382  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OnTrack");
383  hpar = "TH1ClusterNoise";
384  theLayerMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
385 
386  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OffTrack");
387  hpar = "TH1ClusterNoise";
388  theLayerMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
389 
390  // Cluster Width (On and Off Track)
391  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OnTrack");
392  hpar = "TH1ClusterWidth";
393  theLayerMEs.ClusterWidthOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
394 
395  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OffTrack");
396  hpar = "TH1ClusterWidth";
397  theLayerMEs.ClusterWidthOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
398 
399  //Cluster Position
400  short total_nr_strips = SiStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
401  if (layer_id.find("TEC") != std::string::npos) total_nr_strips = 3 * 2 * 128;
402 
403  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OnTrack");
404  hpar = "TH1ClusterPos";
405  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);
406 
407  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OffTrack");
408  hpar = "TH1ClusterPos";
409  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);
410 
411  // dQ/dx
412  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack",name,layer_id,"");
413  hpar = "TH1ClusterChargePerCM";
414  theLayerMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
415 
416  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,layer_id,"OnTrack");
417  hpar = "TH1ClusterChargePerCM";
418  theLayerMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
419 
420  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,layer_id,"OffTrack");
421  hpar = "TH1ClusterChargePerCM";
422  theLayerMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
423 
424  //bookeeping
425  LayerMEsMap[layer_id]=theLayerMEs;
426 
427 }
428 
430 {
431 
432  std::string name = "ring";
433  std::string view = "ringView";
434  std::string hname;
435  std::string hpar;
436  SiStripHistoId hidmanager;
437 
438  RingMEs theRingMEs;
439  theRingMEs.ClusterStoNCorrOnTrack = 0;
440  theRingMEs.ClusterChargeCorrOnTrack = 0;
441  theRingMEs.ClusterChargeOnTrack = 0;
442  theRingMEs.ClusterChargeOffTrack = 0;
443  theRingMEs.ClusterNoiseOnTrack = 0;
444  theRingMEs.ClusterNoiseOffTrack = 0;
445  theRingMEs.ClusterWidthOnTrack = 0;
446  theRingMEs.ClusterWidthOffTrack = 0;
447  theRingMEs.ClusterPosOnTrack = 0;
448  theRingMEs.ClusterPosOffTrack = 0;
449  theRingMEs.ClusterChargePerCMfromTrack = 0;
452 
453  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr",name,ring_id,"OnTrack");
454  hpar = "TH1ClusterStoNCorr";
455  theRingMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
456 
457  // Cluster Charge Corrected
458  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr",name,ring_id,"OnTrack");
459  hpar = "TH1ClusterChargeCorr";
460  theRingMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
461 
462  // Cluster Charge (On and Off Track)
463  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,ring_id,"OnTrack");
464  hpar = "TH1ClusterCharge";
465  theRingMEs.ClusterChargeOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
466 
467  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,ring_id,"OffTrack");
468  hpar = "TH1ClusterCharge";
469  theRingMEs.ClusterChargeOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
470 
471  // Cluster Noise (On and Off Track)
472  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,ring_id,"OnTrack");
473  hpar = "TH1ClusterNoise";
474  theRingMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
475 
476  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,ring_id,"OffTrack");
477  hpar = "TH1ClusterNoise";
478  theRingMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
479 
480  // Cluster Width (On and Off Track)
481  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,ring_id,"OnTrack");
482  hpar = "TH1ClusterWidth";
483  theRingMEs.ClusterWidthOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
484 
485  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,ring_id,"OffTrack");
486  hpar = "TH1ClusterWidth";
487  theRingMEs.ClusterWidthOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
488 
489  //Cluster Position
490  short total_nr_strips = SiStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
491  if (ring_id.find("TEC") != std::string::npos) total_nr_strips = 3 * 2 * 128;
492 
493  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,ring_id,"OnTrack");
494  hpar = "TH1ClusterPos";
495  if ( ring_id.find("TIB") != std::string::npos || ring_id.find("TOB") != std::string::npos || (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);
496 
497  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,ring_id,"OffTrack");
498  hpar = "TH1ClusterPos";
499  if ( ring_id.find("TIB") != std::string::npos || ring_id.find("TOB") != std::string::npos || (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);
500 
501  // dQ/dx
502  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack",name,ring_id,"");
503  hpar = "TH1ClusterChargePerCM";
504  theRingMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
505 
506  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,ring_id,"OnTrack");
507  hpar = "TH1ClusterChargePerCM";
508  theRingMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
509 
510  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,ring_id,"OffTrack");
511  hpar = "TH1ClusterChargePerCM";
512  theRingMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
513 
514  //bookeeping
515  RingMEsMap[ring_id]=theRingMEs;
516 
517 }
518 //------------------------------------------------------------------------
519 //
520 // -- Book Histograms at Sub-Detector Level
521 //
523 
525  subdet_tag = "__" + name;
526  std::string completeName;
527  std::string axisName;
528 
529  SubDetMEs theSubDetMEs;
530  theSubDetMEs.totNClustersOnTrack = 0;
531  theSubDetMEs.totNClustersOffTrack = 0;
532  theSubDetMEs.nClustersOnTrack = 0;
533  theSubDetMEs.nClustersTrendOnTrack = 0;
534  theSubDetMEs.nClustersOffTrack = 0;
535  theSubDetMEs.nClustersTrendOffTrack = 0;
536  theSubDetMEs.ClusterStoNCorrOnTrack = 0;
537  theSubDetMEs.ClusterChargeOnTrack = 0;
538  theSubDetMEs.ClusterChargeOffTrack = 0;
539  theSubDetMEs.ClusterStoNOffTrack = 0;
540  theSubDetMEs.ClusterChargePerCMfromTrack = 0;
541  theSubDetMEs.ClusterChargePerCMfromOriginOnTrack = 0;
542  theSubDetMEs.ClusterChargePerCMfromOriginOffTrack = 0;
543 
544  // TotalNumber of Cluster OnTrack
545  completeName = "Summary_TotalNumberOfClusters_OnTrack" + subdet_tag;
546  axisName = "Number of on-track clusters in " + name;
547  theSubDetMEs.nClustersOnTrack = bookME1D(ibooker , "TH1nClustersOn", completeName.c_str());
548  theSubDetMEs.nClustersOnTrack->setAxisTitle(axisName.c_str());
549  theSubDetMEs.nClustersOnTrack->getTH1()->StatOverflows(kTRUE);
550 
551  // TotalNumber of Cluster OffTrack
552  completeName = "Summary_TotalNumberOfClusters_OffTrack" + subdet_tag;
553  axisName = "Number of off-track clusters in " + name;
554  theSubDetMEs.nClustersOffTrack = bookME1D(ibooker , "TH1nClustersOff", completeName.c_str());
555  theSubDetMEs.nClustersOffTrack->setAxisTitle(axisName.c_str());
556  theSubDetMEs.nClustersOffTrack->getTH1()->StatOverflows(kTRUE);
557 
558  // Cluster StoN On Track
559  completeName = "Summary_ClusterStoNCorr_OnTrack" + subdet_tag;
560  theSubDetMEs.ClusterStoNCorrOnTrack = bookME1D(ibooker , "TH1ClusterStoNCorr", completeName.c_str());
561 
562  // Cluster Charge On Track
563  completeName = "Summary_ClusterCharge_OnTrack" + subdet_tag;
564  theSubDetMEs.ClusterChargeOnTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
565 
566  // Cluster Charge Off Track
567  completeName = "Summary_ClusterCharge_OffTrack" + subdet_tag;
568  theSubDetMEs.ClusterChargeOffTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
569 
570  // Cluster Charge StoN Off Track
571  completeName = "Summary_ClusterStoN_OffTrack" + subdet_tag;
572  theSubDetMEs.ClusterStoNOffTrack = bookME1D(ibooker , "TH1ClusterStoN", completeName.c_str());
573 
574  // cluster charge per cm on track
575  completeName = "Summary_ClusterChargePerCMfromTrack" + subdet_tag;
576  theSubDetMEs.ClusterChargePerCMfromTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
577 
578  // cluster charge per cm on track
579  completeName = "Summary_ClusterChargePerCMfromOrigin_OnTrack" + subdet_tag;
580  theSubDetMEs.ClusterChargePerCMfromOriginOnTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
581 
582  // cluster charge per cm off track
583  completeName = "Summary_ClusterChargePerCMfromOrigin_OffTrack" + subdet_tag;
584  theSubDetMEs.ClusterChargePerCMfromOriginOffTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
585 
586  if(Trend_On_){
587  // TotalNumber of Cluster
588  completeName = "Trend_TotalNumberOfClusters_OnTrack" + subdet_tag;
589  theSubDetMEs.nClustersTrendOnTrack = bookMETrend(ibooker , completeName.c_str());
590  completeName = "Trend_TotalNumberOfClusters_OffTrack" + subdet_tag;
591  theSubDetMEs.nClustersTrendOffTrack = bookMETrend(ibooker , completeName.c_str());
592  }
593 
594  //bookeeping
595  SubDetMEsMap[name]=theSubDetMEs;
596 
597 }
598 //--------------------------------------------------------------------------------
599 
600 inline MonitorElement* SiStripMonitorTrack::bookME1D(DQMStore::IBooker & ibooker , const char* ParameterSetLabel, const char* HistoName)
601 {
602  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
603  return ibooker.book1D(HistoName,HistoName,
604  Parameters.getParameter<int32_t>("Nbinx"),
605  Parameters.getParameter<double>("xmin"),
606  Parameters.getParameter<double>("xmax")
607  );
608 }
609 
610 //--------------------------------------------------------------------------------
611 inline MonitorElement* SiStripMonitorTrack::bookME2D(DQMStore::IBooker & ibooker , const char* ParameterSetLabel, const char* HistoName)
612 {
613  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
614  return ibooker.book2D(HistoName,HistoName,
615  Parameters.getParameter<int32_t>("Nbinx"),
616  Parameters.getParameter<double>("xmin"),
617  Parameters.getParameter<double>("xmax"),
618  Parameters.getParameter<int32_t>("Nbiny"),
619  Parameters.getParameter<double>("ymin"),
620  Parameters.getParameter<double>("ymax")
621  );
622 }
623 
624 //--------------------------------------------------------------------------------
625 inline MonitorElement* SiStripMonitorTrack::bookME3D(DQMStore::IBooker & ibooker , const char* ParameterSetLabel, const char* HistoName)
626 {
627  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
628  return ibooker.book3D(HistoName,HistoName,
629  Parameters.getParameter<int32_t>("Nbinx"),
630  Parameters.getParameter<double>("xmin"),
631  Parameters.getParameter<double>("xmax"),
632  Parameters.getParameter<int32_t>("Nbiny"),
633  Parameters.getParameter<double>("ymin"),
634  Parameters.getParameter<double>("ymax"),
635  Parameters.getParameter<int32_t>("Nbinz"),
636  Parameters.getParameter<double>("zmin"),
637  Parameters.getParameter<double>("zmax")
638  );
639 }
640 
641 //--------------------------------------------------------------------------------
642 inline MonitorElement* SiStripMonitorTrack::bookMEProfile(DQMStore::IBooker & ibooker , const char* ParameterSetLabel, const char* HistoName)
643 {
644  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
645  return ibooker.bookProfile(HistoName,HistoName,
646  Parameters.getParameter<int32_t>("Nbinx"),
647  Parameters.getParameter<double>("xmin"),
648  Parameters.getParameter<double>("xmax"),
649  Parameters.getParameter<int32_t>("Nbiny"),
650  Parameters.getParameter<double>("ymin"),
651  Parameters.getParameter<double>("ymax"),
652  "" );
653 }
654 
655 //--------------------------------------------------------------------------------
657 {
658  edm::ParameterSet ParametersTrend = conf_.getParameter<edm::ParameterSet>("Trending");
659  MonitorElement* me = ibooker.bookProfile(HistoName,HistoName,
660  ParametersTrend.getParameter<int32_t>("Nbins"),
661  ParametersTrend.getParameter<double>("xmin"),
662  ParametersTrend.getParameter<double>("xmax"),
663  0 , 0 , "" );
664  if (me->kind() == MonitorElement::DQM_KIND_TPROFILE) me->getTH1()->SetCanExtend(TH1::kAllAxes);
665 
666  if(!me) return me;
667  me->setAxisTitle("Lumisection",1);
668  return me;
669 }
670 
671 //------------------------------------------------------------------------------------------
672 void SiStripMonitorTrack::trajectoryStudy(const edm::Ref<std::vector<Trajectory> > traj, const edm::EventSetup& es, bool track_ok) {
673  const std::vector<TrajectoryMeasurement> & measurements = traj->measurements();
674  for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin(), traj_mes_end=measurements.end();
675  traj_mes_iterator!=traj_mes_end;++traj_mes_iterator){//loop on measurements
676  //trajectory local direction and position on detector
677  LocalVector statedirection;
678 
679  TrajectoryStateOnSurface updatedtsos=traj_mes_iterator->updatedState();
680  ConstRecHitPointer ttrh=traj_mes_iterator->recHit();
681 
682 
683  if (TkHistoMap_On_ ) {
684  uint32_t thedetid=ttrh->rawId();
685  if ( SiStripDetId(thedetid).subDetector() >=3 && SiStripDetId(thedetid).subDetector() <=6) { //TIB/TID + TOB + TEC only
686  if ( (ttrh->getType()==1) )
687  tkhisto_NumMissingHits->add(thedetid,1.);
688  if ( (ttrh->getType()==2) )
689  tkhisto_NumberInactiveHits->add(thedetid,1.);
690  if ( (ttrh->getType()==0) )
691  tkhisto_NumberValidHits->add(thedetid,1.);
692  }
693  }
694 
695  if (!ttrh->isValid()) continue;
696 
697  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( ttrh->hit() );
698  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>( ttrh->hit() );
699  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>( ttrh->hit() );
700  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>( ttrh->hit() );
701 
702  // RecHitType type=Single;
703 
704  if(matchedhit){
705  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
706  // type=Matched;
707 
708  const GluedGeomDet * gdet=static_cast<const GluedGeomDet *>(tkgeom_->idToDet(matchedhit->geographicalId()));
709  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
710  //mono side
711  const GeomDetUnit * monodet=gdet->monoDet();
712  statedirection=monodet->toLocal(gtrkdirup);
713  SiStripRecHit2D m = matchedhit->monoHit();
714  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
715  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es,track_ok);
716  //stereo side
717  const GeomDetUnit * stereodet=gdet->stereoDet();
718  statedirection=stereodet->toLocal(gtrkdirup);
719  SiStripRecHit2D s = matchedhit->stereoHit();
720  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
721  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es,track_ok);
722  }
723  else if(projhit){
724  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
725  // type=Projected;
726  const GluedGeomDet * gdet=static_cast<const GluedGeomDet *>(tkgeom_->idToDet(projhit->geographicalId()));
727 
728  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
729  const SiStripRecHit2D originalhit=projhit->originalHit();
730  const GeomDetUnit * det;
731  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
732  //mono side
733  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
734  det=gdet->monoDet();
735  statedirection=det->toLocal(gtrkdirup);
736  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es,track_ok);
737  }
738  else{
739  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
740  //stereo side
741  det=gdet->stereoDet();
742  statedirection=det->toLocal(gtrkdirup);
743  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es,track_ok);
744  }
745  }else if (hit2D){
746  statedirection=updatedtsos.localMomentum();
747  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es,track_ok);
748  } else if (hit1D) {
749  statedirection=updatedtsos.localMomentum();
750  if(statedirection.mag()) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es,track_ok);
751  } else {
752  LogDebug ("SiStripMonitorTrack")
753  << " LocalMomentum: "<<statedirection
754  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
755  }
756 
757  }
758 
759 }
760 //------------------------------------------------------------------------
762  const ProjectedSiStripRecHit2D* projhit,
763  const SiStripMatchedRecHit2D* matchedhit,
764  const SiStripRecHit2D* hit2D,
765  const SiStripRecHit1D* hit1D,
766  LocalVector localMomentum,
767  const bool track_ok
768  ) {
769  LocalVector statedirection;
770  if(matchedhit){ // type=Matched;
771  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
772 
773  const GluedGeomDet * gdet=static_cast<const GluedGeomDet *>(tkgeom_->idToDet(matchedhit->geographicalId()));
774 
775  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
776 
777  //mono side
778  const GeomDetUnit * monodet=gdet->monoDet();
779  statedirection=monodet->toLocal(gtrkdirup);
780  SiStripRecHit2D m = matchedhit->monoHit();
781  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es,track_ok);
782 
783  //stereo side
784  const GeomDetUnit * stereodet=gdet->stereoDet();
785  statedirection=stereodet->toLocal(gtrkdirup);
786  SiStripRecHit2D s = matchedhit->stereoHit();
787  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es,track_ok);
788  }
789  else if(projhit){ // type=Projected;
790  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
791 
792  const GluedGeomDet * gdet=static_cast<const GluedGeomDet *>(tkgeom_->idToDet(projhit->geographicalId()));
793 
794  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
795  const SiStripRecHit2D originalhit=projhit->originalHit();
796 
797  const GeomDetUnit * det;
798  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
799  //mono side
800  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
801  det=gdet->monoDet();
802  statedirection=det->toLocal(gtrkdirup);
803  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es,track_ok);
804  }
805  else{
806  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
807  //stereo side
808  det=gdet->stereoDet();
809  statedirection=det->toLocal(gtrkdirup);
810  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es,track_ok);
811  }
812  } else if (hit2D){ // type=2D
813  statedirection=localMomentum;
814  if(statedirection.mag()) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es,track_ok);
815  } else if (hit1D) { // type=1D
816  statedirection=localMomentum;
817  if(statedirection.mag()) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es,track_ok);
818  } else {
819  LogDebug ("SiStripMonitorTrack")
820  << " LocalMomentum: "<<statedirection
821  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
822  }
823 
824 }
825 //------------------------------------------------------------------------
827 
828 using namespace std;
829 using namespace edm;
830 using namespace reco;
831 
832  // trajectory input
833  edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection;
834  ev.getByToken(trackTrajToken_, TItkAssociatorCollection);
835  if( TItkAssociatorCollection.isValid()){
836  trackStudyFromTrajectory(TItkAssociatorCollection,es);
837  } else {
838  edm::LogError("SiStripMonitorTrack")<<"Association not found ... try w/ track collection"<<std::endl;
839 
840  // edm::Handle<std::vector<Trajectory> > trajectories;
841  // ev.getByToken(trajectoryToken_, trajectories);
842 
843  // track input
844  edm::Handle<reco::TrackCollection > trackCollectionHandle;
845  ev.getByToken(trackToken_, trackCollectionHandle);//takes the track collection
846  if (trackCollectionHandle.isValid()){
847  trackStudyFromTrack(trackCollectionHandle,es);
848  } else {
849  edm::LogError("SiStripMonitorTrack")<<"also Track Collection is not valid !! " << TrackLabel_<<std::endl;
850  return;
851  }
852  }
853 }
854 
855 //------------------------------------------------------------------------
856 // Should return true if the track is good, false if it should be discarded.
858  if (track.pt() < 0.8) return false;
859  if (track.p() < 2.0) return false;
860  if (track.hitPattern().numberOfValidTrackerHits() <= 6) return false;
861  if (track.normalizedChi2() > 10.0) return false;
862  return true;
863 }
864 //------------------------------------------------------------------------
866 
867  // edm::ESHandle<TransientTrackBuilder> builder;
868  // es.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
869  // const TransientTrackBuilder* transientTrackBuilder = builder.product();
870 
871  //numTracks = trackCollectionHandle->size();
872  reco::TrackCollection trackCollection = *trackCollectionHandle;
873  for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
874  track!=etrack; ++track) {
875 
876  bool track_ok = trackFilter(*track);
877  // const reco::TransientTrack transientTrack = transientTrackBuilder->build(track);
878 
879  for (trackingRecHit_iterator hit = track->recHitsBegin(), ehit = track->recHitsEnd();
880  hit!=ehit; ++hit) {
881 
882  if (TkHistoMap_On_ ) {
883  uint32_t thedetid=(*hit)->rawId();
884  if ( SiStripDetId(thedetid).subDetector() >=3 && SiStripDetId(thedetid).subDetector() <=6) { //TIB/TID + TOB + TEC only
885  if ( ((*hit)->getType()==1) )
886  tkhisto_NumMissingHits->add(thedetid,1.);
887  if ( ((*hit)->getType()==2) )
888  tkhisto_NumberInactiveHits->add(thedetid,1.);
889  if ( ((*hit)->getType()==0) )
890  tkhisto_NumberValidHits->add(thedetid,1.);
891  }
892  }
893 
894  if (!(*hit)->isValid()) continue;
895  DetId detID = (*hit)->geographicalId();
896  if (detID.det() != DetId::Tracker) continue;
897  const TrackingRecHit* theHit = (*hit);
898  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( (theHit) );
899  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*> ( (theHit) );
900  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*> ( (theHit) );
901  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*> ( (theHit) );
902 
903  // GlobalPoint globalPoint = hit->globalPosition();
904  // reco::TrajectoryStateOnSurface stateOnSurface = transientTrack->stateOnSurface(globalPoint);
905 
906  LocalVector localMomentum;
907  hitStudy(es,projhit,matchedhit,hit2D,hit1D,localMomentum,track_ok);
908  }
909 
910  // hit pattern of the track
911  // const reco::HitPattern & hitsPattern = track->hitPattern();
912  // loop over the hits of the track
913  // for (int i=0; i<hitsPattern.numberOfHits(); i++) {
914  // for (int i=0; i<hitsPattern.numberOfHits(reco::HitPattern::TRACK_HITS); i++) {
915  // uint32_t hit = hitsPattern.getHitPattern(reco::HitPattern::TRACK_HITS,i);
916 
917  // if the hit is valid and in pixel barrel, print out the layer
918  // if (hitsPattern.validHitFilter(hit) && hitsPattern.pixelBarrelHitFilter(hit))
919 
920  // if (!hitsPattern.validHitFilter(hit)) continue;
921 // if (hitsPattern.pixelHitFilter(hit)) std::cout << "pixel" << std::endl; // pixel
922 // if (hitsPattern.pixelBarrelHitFilter(hit)) std::cout << "pixel barrel" << std::endl; // pixel barrel
923 // if (hitsPattern.pixelEndcapHitFilter(hit)) std::cout << "pixel endcap" << std::endl; // pixel endcap
924 // if (hitsPattern.stripHitFilter(hit)) std::cout << "strip" << std::endl; // strip
925 // if (hitsPattern.stripTIBHitFilter(hit)) std::cout << "TIB" << std::endl; // strip TIB
926 // if (hitsPattern.stripTIDHitFilter(hit)) std::cout << "TID" << std::endl; // strip TID
927 // if (hitsPattern.stripTOBHitFilter(hit)) std::cout << "TOB" << std::endl; // strip TOB
928 // if (hitsPattern.stripTECHitFilter(hit)) std::cout << "TEC" << std::endl; // strip TEC
929 // if (hitsPattern.muonDTHitFilter(hit)) std::cout << "DT" << std::endl; // muon DT
930 // if (hitsPattern.muonCSCHitFilter(hit)) std::cout << "CSC" << std::endl; // muon CSC
931 // if (hitsPattern.muonRPCHitFilter(hit)) std::cout << "RPC" << std::endl; // muon RPC
932 //
933 // // expert level: printout the hit in 10-bit binary format
934 // std::cout << "hit in 10-bit binary format = ";
935 // for (int j=9; j>=0; j--) {
936 // int bit = (hit >> j) & 0x1;
937 // std::cout << bit;
938 // }
939 // std::cout << std::endl;
940  // }
941  }
942 }
943 //------------------------------------------------------------------------
945  //Perform track study
946  numTracks = TItkAssociatorCollection->size();
947  int i=0;
948  for(TrajTrackAssociationCollection::const_iterator it = TItkAssociatorCollection->begin();it != TItkAssociatorCollection->end(); ++it){
949  const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
950 
951  // Trajectory Map, extract Trajectory for this track
952  //reco::TrackRef trackref = it->val;
953  LogDebug("SiStripMonitorTrack")
954  << "Track number "<< ++i << std::endl;
955  // << "\n\tmomentum: " << trackref->momentum()
956  // << "\n\tPT: " << trackref->pt()
957  // << "\n\tvertex: " << trackref->vertex()
958  // << "\n\timpact parameter: " << trackref->d0()
959  // << "\n\tcharge: " << trackref->charge()
960  // << "\n\tnormalizedChi2: " << trackref->normalizedChi2()
961  // <<"\n\tFrom EXTRA : "
962  // <<"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
963 
964  // trajectoryStudy(traj_iterator,trackref,es);
965  bool track_ok = trackFilter(*(it->val));
966  trajectoryStudy(traj_iterator,es,track_ok);
967 
968  }
969 }
970 //------------------------------------------------------------------------
971 template <class T> void SiStripMonitorTrack::RecHitInfo(const T* tkrecHit, LocalVector LV, const edm::EventSetup& es, bool track_ok){
972 
973  if(!tkrecHit->isValid()){
974  LogTrace("SiStripMonitorTrack") <<"\t\t Invalid Hit " << std::endl;
975  return;
976  }
977 
978  const uint32_t& detid = tkrecHit->geographicalId().rawId();
979 
980  LogTrace("SiStripMonitorTrack")
981  <<"\n\t\tRecHit on det "<<detid
982  <<"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
983  <<"\n\t\tRecHit in GP "<<tkgeom_->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
984  <<"\n\t\tRecHit trackLocal vector "<<LV.x() << " " << LV.y() << " " << LV.z() <<std::endl;
985 
986 
987  //Retrieve tracker topology from geometry
988  edm::ESHandle<TrackerTopology> tTopoHandle;
989  es.get<TrackerTopologyRcd>().get(tTopoHandle);
990  const TrackerTopology* const tTopo = tTopoHandle.product();
991 
992  //Get SiStripCluster from SiStripRecHit
993  if ( tkrecHit != NULL ){
994  const SiStripCluster* SiStripCluster_ = &*(tkrecHit->cluster());
995  SiStripClusterInfo SiStripClusterInfo_(*SiStripCluster_,es,detid);
996 
997  const Det2MEs MEs = findMEs(tTopo, detid);
998  if (clusterInfos(&SiStripClusterInfo_,detid, OnTrack, track_ok, LV, MEs))
999  {
1000  vPSiStripCluster.insert(SiStripCluster_);
1001  }
1002  }
1003  else
1004  {
1005  edm::LogError("SiStripMonitorTrack") << "NULL hit" << std::endl;
1006  }
1007  }
1008 
1009 //------------------------------------------------------------------------
1011 {
1012 
1013  //Retrieve tracker topology from geometry
1014  edm::ESHandle<TrackerTopology> tTopoHandle;
1015  es.get<TrackerTopologyRcd>().get(tTopoHandle);
1016  const TrackerTopology* const tTopo = tTopoHandle.product();
1017 
1019  ev.getByToken( clusterToken_, siStripClusterHandle);
1020  if (siStripClusterHandle.isValid()){
1021  //Loop on Dets
1022  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=siStripClusterHandle->begin(), DSVEnd=siStripClusterHandle->end();
1023  DSViter!=DSVEnd; ++DSViter) {
1024 
1025  uint32_t detid=DSViter->id();
1026  const Det2MEs MEs = findMEs(tTopo, detid);
1027 
1028  LogDebug("SiStripMonitorTrack") << "on detid "<< detid << " N Cluster= " << DSViter->size();
1029 
1030  //Loop on Clusters
1031  for(edmNew::DetSet<SiStripCluster>::const_iterator ClusIter = DSViter->begin(), ClusEnd = DSViter->end();
1032  ClusIter!=ClusEnd; ++ClusIter) {
1033 
1034  if (vPSiStripCluster.find(&*ClusIter) == vPSiStripCluster.end()) {
1035  SiStripClusterInfo SiStripClusterInfo_(*ClusIter,es,detid);
1036  clusterInfos(&SiStripClusterInfo_,detid,OffTrack, /*track_ok*/ false,LV,MEs);
1037  }
1038  }
1039  }
1040  } else {
1041  edm::LogError("SiStripMonitorTrack")<< "ClusterCollection is not valid!!" << std::endl;
1042  return;
1043  }
1044 }
1045 
1046 //------------------------------------------------------------------------
1048  SiStripHistoId hidmanager1;
1049 
1050  std::string layer_id = hidmanager1.getSubdetid(detid, tTopo, false);
1051  std::string ring_id = hidmanager1.getSubdetid(detid, tTopo, true);
1052  std::string sdet_tag = folderOrganizer_.getSubDetFolderAndTag(detid, tTopo).second;
1053 
1054  Det2MEs me;
1055  me.iLayer = nullptr;
1056  me.iRing = nullptr;
1057  me.iSubdet = nullptr;
1058 
1059  std::map<std::string, LayerMEs>::iterator iLayer = LayerMEsMap.find(layer_id);
1060  if (iLayer != LayerMEsMap.end()) {
1061  me.iLayer = &(iLayer->second);
1062  }
1063 
1064  std::map<std::string, RingMEs>::iterator iRing = RingMEsMap.find(ring_id);
1065  if (iRing != RingMEsMap.end()) {
1066  me.iRing = &(iRing->second);
1067  }
1068 
1069  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(sdet_tag);
1070  if (iSubdet != SubDetMEsMap.end()) {
1071  me.iSubdet = &(iSubdet->second);
1072  }
1073 
1074  return me;
1075 }
1076 
1077 //------------------------------------------------------------------------
1079 bool SiStripMonitorTrack::clusterInfos(SiStripClusterInfo* cluster, const uint32_t detid, enum ClusterFlags flag, bool track_ok, const LocalVector LV, const Det2MEs& MEs)
1080 {
1081 
1082  if (cluster==NULL) return false;
1083  // if one imposes a cut on the clusters, apply it
1084  if( (applyClusterQuality_) &&
1085  (cluster->signalOverNoise() < sToNLowerLimit_ ||
1086  cluster->signalOverNoise() > sToNUpperLimit_ ||
1087  cluster->width() < widthLowerLimit_ ||
1088  cluster->width() > widthUpperLimit_) ) return false;
1089  // start of the analysis
1090 
1091  float cosRZ = -2;
1092  LogDebug("SiStripMonitorTrack")<< "\n\tLV " << LV.x() << " " << LV.y() << " " << LV.z() << " " << LV.mag() << std::endl;
1093  if (LV.mag()){
1094  cosRZ= fabs(LV.z())/LV.mag();
1095  LogDebug("SiStripMonitorTrack")<< "\n\t cosRZ " << cosRZ << std::endl;
1096  }
1097 
1098  // Filling SubDet/Layer Plots (on Track + off Track)
1099  float StoN = cluster->signalOverNoise();
1100  float noise = cluster->noiseRescaledByGain();
1101  uint16_t charge = cluster->charge();
1102  uint16_t width = cluster->width();
1103  float position = cluster->baryStrip();
1104 
1105  // new dE/dx (chargePerCM)
1106  // https://indico.cern.ch/event/342236/session/5/contribution/10/material/slides/0.pdf
1107  float dQdx_fromTrack = siStripClusterTools::chargePerCM(detid, *cluster, LV);
1108  // from straigth line origin-sensor centre
1109  const StripGeomDetUnit* DetUnit = static_cast<const StripGeomDetUnit*>(tkgeom_->idToDetUnit(DetId(detid)));
1110  LocalPoint locVtx = DetUnit->toLocal(GlobalPoint(0.0, 0.0, 0.0));
1111  LocalVector locDir(locVtx.x(), locVtx.y(), locVtx.z());
1112  float dQdx_fromOrigin = siStripClusterTools::chargePerCM(detid, *cluster, locDir);
1113 
1114  if (TkHistoMap_On_ && (flag == OnTrack)) {
1115  uint32_t adet=cluster->detId();
1116  if(track_ok) tkhisto_ClChPerCMfromTrack->fill(adet,dQdx_fromTrack);
1117  }
1118  if (clchCMoriginTkHmap_On_ && (flag == OffTrack)){
1119  uint32_t adet=cluster->detId();
1120  if(track_ok) tkhisto_ClChPerCMfromOrigin->fill(adet,dQdx_fromOrigin);
1121  }
1122 
1123  if(flag==OnTrack){
1124  if (MEs.iSubdet != nullptr) MEs.iSubdet->totNClustersOnTrack++;
1125  // layerMEs
1126  if (MEs.iLayer != nullptr) {
1127  if(noise > 0.0) fillME(MEs.iLayer->ClusterStoNCorrOnTrack, StoN*cosRZ);
1128  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << cluster->noiseRescaledByGain() << std::endl;
1129  fillME(MEs.iLayer->ClusterChargeCorrOnTrack, charge*cosRZ);
1130  fillME(MEs.iLayer->ClusterChargeOnTrack, charge);
1131  fillME(MEs.iLayer->ClusterNoiseOnTrack, noise);
1132  fillME(MEs.iLayer->ClusterWidthOnTrack, width);
1133  fillME(MEs.iLayer->ClusterPosOnTrack, position);
1134  if(track_ok) fillME(MEs.iLayer->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1135  if(track_ok) fillME(MEs.iLayer->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1136  }
1137  // ringMEs
1138  if (MEs.iRing != nullptr) {
1139  if(noise > 0.0) fillME(MEs.iRing->ClusterStoNCorrOnTrack, StoN*cosRZ);
1140  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << cluster->noiseRescaledByGain() << std::endl;
1141  fillME(MEs.iRing->ClusterChargeCorrOnTrack, charge*cosRZ);
1142  fillME(MEs.iRing->ClusterChargeOnTrack, charge);
1143  fillME(MEs.iRing->ClusterNoiseOnTrack, noise);
1144  fillME(MEs.iRing->ClusterWidthOnTrack, width);
1145  fillME(MEs.iRing->ClusterPosOnTrack, position);
1146  if(track_ok) fillME(MEs.iRing->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1147  if(track_ok) fillME(MEs.iRing->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1148  }
1149  // subdetMEs
1150  if(MEs.iSubdet != nullptr){
1151  fillME(MEs.iSubdet->ClusterChargeOnTrack,charge);
1152  if(noise > 0.0) fillME(MEs.iSubdet->ClusterStoNCorrOnTrack,StoN*cosRZ);
1153  if(track_ok) fillME(MEs.iSubdet->ClusterChargePerCMfromTrack,dQdx_fromTrack);
1154  if(track_ok) fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOnTrack,dQdx_fromOrigin);
1155  }
1156  //******** TkHistoMaps
1157  if (TkHistoMap_On_) {
1158  uint32_t adet=cluster->detId();
1159  tkhisto_NumOnTrack->add(adet,1.);
1160  if(noise > 0.0) tkhisto_StoNCorrOnTrack->fill(adet,cluster->signalOverNoise()*cosRZ);
1161  if(noise == 0.0)
1162  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << noise << std::endl;
1163  }
1164  // Module plots filled only for onTrack Clusters
1165  if(Mod_On_){
1166  SiStripHistoId hidmanager2;
1167  std::string name = hidmanager2.createHistoId("","det",detid);
1168  //fillModMEs
1169  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(name);
1170  if(iModME!=ModMEsMap.end()){
1171  if(noise > 0.0) fillME(iModME->second.ClusterStoNCorr ,StoN*cosRZ);
1172  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << name << " in Event " << eventNb << " noise " << noise << std::endl;
1173  fillME(iModME->second.ClusterCharge,charge);
1174 
1175  fillME(iModME->second.ClusterChargeCorr,charge*cosRZ);
1176 
1177  fillME(iModME->second.ClusterWidth ,width);
1178  fillME(iModME->second.ClusterPos ,position);
1179 
1180  if(track_ok) fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1181  if(track_ok) fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1182 
1183  //fill the PGV histo
1184  float PGVmax = cluster->maxCharge();
1185  int PGVposCounter = cluster->maxIndex();
1186  for (int i= int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmin"));i<PGVposCounter;++i)
1187  fillME(iModME->second.ClusterPGV, i,0.);
1188  for (auto it=cluster->stripCharges().begin();it<cluster->stripCharges().end();++it) {
1189  fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
1190  }
1191  for (int i= PGVposCounter;i<int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmax"));++i)
1192  fillME(iModME->second.ClusterPGV, i,0.);
1193  //end fill the PGV histo
1194  }
1195  }
1196  } else {
1197  if (flag == OffTrack) {
1198  if (MEs.iSubdet != nullptr) MEs.iSubdet->totNClustersOffTrack++;
1199  //******** TkHistoMaps
1200  if (TkHistoMap_On_) {
1201  uint32_t adet=cluster->detId();
1202  tkhisto_NumOffTrack->add(adet,1.);
1203  if(charge > 250){
1204  LogDebug("SiStripMonitorTrack") << "Module firing " << detid << " in Event " << eventNb << std::endl;
1205  }
1206  }
1207  }
1208  // layerMEs
1209  if (MEs.iLayer != nullptr) {
1210  fillME(MEs.iLayer->ClusterChargeOffTrack, charge);
1211  fillME(MEs.iLayer->ClusterNoiseOffTrack, noise);
1212  fillME(MEs.iLayer->ClusterWidthOffTrack, width);
1213  fillME(MEs.iLayer->ClusterPosOffTrack, position);
1214  fillME(MEs.iLayer->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1215  }
1216  // ringMEs
1217  if (MEs.iRing != nullptr) {
1218  fillME(MEs.iRing->ClusterChargeOffTrack, charge);
1219  fillME(MEs.iRing->ClusterNoiseOffTrack, noise);
1220  fillME(MEs.iRing->ClusterWidthOffTrack, width);
1221  fillME(MEs.iRing->ClusterPosOffTrack, position);
1222  fillME(MEs.iRing->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1223  }
1224  // subdetMEs
1225  if(MEs.iSubdet != nullptr){
1226  fillME(MEs.iSubdet->ClusterChargeOffTrack,charge);
1227  if(noise > 0.0) fillME(MEs.iSubdet->ClusterStoNOffTrack,StoN);
1228  fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOffTrack,dQdx_fromOrigin);
1229  }
1230  }
1231  return true;
1232 }
1233 //--------------------------------------------------------------------------------
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
uint8_t maxCharge() const
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
int i
Definition: DBlmapReader.cc:9
MonitorElement * ClusterChargePerCMfromTrack
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
TkHistoMap * tkhisto_NumOffTrack
SiStripMonitorTrack(const edm::ParameterSet &)
void setSiStripFolderName(std::string name)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::EventSetup &es)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void trackStudyFromTrajectory(edm::Handle< TrajTrackAssociationCollection > TItkAssociatorCollection, const edm::EventSetup &es)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
void fillME(MonitorElement *ME, float value1)
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
SiStripDCSStatus * dcsStatus_
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:556
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
float noiseRescaledByGain() const
void book(DQMStore::IBooker &, const TrackerTopology *tTopo)
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
std::map< std::string, RingMEs > RingMEsMap
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
float chargePerCM(DetId detid, Iter a, Iter b)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float baryStrip() const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ParameterSet conf_
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
#define NULL
Definition: scimark2.h:8
MonitorElement * ClusterChargePerCMfromTrack
bool ev
MonitorElement * ClusterChargeCorrOnTrack
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
data_type const * const_iterator
Definition: DetSetNew.h:30
bool trackFilter(const reco::Track &track)
key_type key() const
Accessor for product key.
Definition: Ref.h:264
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
uint16_t maxIndex() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * ClusterChargePerCMfromOriginOffTrack
auto stripCharges() const -> decltype(cluster() ->amplitudes())
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
LocalVector localMomentum() const
edm::ESHandle< TrackerGeometry > tkgeom_
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
math::XYZTLorentzVectorD LV
float signalOverNoise() const
T mag() const
Definition: PV3DBase.h:67
vector< ParameterSet > Parameters
edm::EventNumber_t eventNb
TkHistoMap * tkhisto_NumMissingHits
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
uint16_t charge() const
std::unordered_set< const SiStripCluster * > vPSiStripCluster
std::map< std::string, SubDetMEs > SubDetMEsMap
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
double pt() const
track transverse momentum
Definition: TrackBase.h:616
const std::string subdet_tag("SubDet")
T z() const
Definition: PV3DBase.h:64
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
uint16_t width() const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:288
TH1 * getTH1(void) const
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
int orbitNumber() const
Definition: EventBase.h:66
MonitorElement * ClusterChargePerCMfromOrigin
MonitorElement * ClusterChargePerCMfromOriginOffTrack
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterChargePerCMfromTrack
bool isValid() const
Definition: HandleBase.h:75
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
#define LogTrace(id)
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
edm::EDGetTokenT< TrajTrackAssociationCollection > trackTrajToken_
void bookModMEs(DQMStore::IBooker &, const uint32_t)
TkHistoMap * tkhisto_NumberInactiveHits
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
TkHistoMap * tkhisto_ClChPerCMfromOrigin
SiStripRecHit2D stereoHit() const
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void hitStudy(const edm::EventSetup &es, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * ClusterChargePerCMfromTrack
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, bool track_ok, LocalVector LV, const Det2MEs &MEs)
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &es)
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
TkHistoMap * tkhisto_ClChPerCMfromTrack
std::string HistoName
int numberOfValidTrackerHits() const
Definition: HitPattern.h:828
TkHistoMap * tkhisto_NumOnTrack
SiStripRecHit2D monoHit() const
uint32_t detId() const
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * ClusterChargePerCMfromOriginOnTrack
edm::EventID id() const
Definition: EventBase.h:59
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
static int position[264][3]
Definition: ReadPGInfo.cc:509
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
TkHistoMap * tkhisto_StoNCorrOnTrack
DetId geographicalId() const
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
MonitorElement * ClusterChargePerCMfromOriginOnTrack
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:151
long double T
T x() const
Definition: PV3DBase.h:62
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
MonitorElement * ClusterChargePerCMfromOriginOnTrack
void trajectoryStudy(const edm::Ref< std::vector< Trajectory > > traj, const edm::EventSetup &es, bool track_ok)
void add(uint32_t &detid, float value)
Definition: TkHistoMap.cc:213
TkHistoMap * tkhisto_NumberValidHits
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
Definition: Run.h:43
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::EventSetup &, bool ok)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * ClusterChargePerCMfromOriginOffTrack