CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripMonitorCluster.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Package: SiStripMonitorCluster
3 // Class: SiStripMonitorCluster
6 // Original Author: Dorian Kcira
7 // Created: Wed Feb 1 16:42:34 CET 2006
8 #include <vector>
9 #include <numeric>
10 #include <fstream>
11 #include <math.h>
12 #include "TNamed.h"
15 
33 
36 
39 
40 #include "TMath.h"
41 #include <iostream>
42 
43 //--------------------------------------------------------------------------------------------
45  : conf_(iConfig), show_mechanical_structure_view(true), show_readout_view(false), show_control_view(false), select_all_detectors(false), reset_each_run(false), m_cacheID_(0)
46  // , genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig, consumesCollector()))
47 {
48 
49  // initialize
50  passBPTXfilter_ = true;
51 
52  // initialize GenericTriggerEventFlag by specific configuration
53  // in this way, one can set specific selections for different MEs
57 
58  firstEvent = -1;
59  eventNb = 0;
60 
61  // Detector Partitions
62  SubDetPhasePartMap["TIB"] = "TI";
63  SubDetPhasePartMap["TID__MINUS"] = "TI";
64  SubDetPhasePartMap["TID__PLUS"] = "TI";
65  SubDetPhasePartMap["TOB"] = "TO";
66  SubDetPhasePartMap["TEC__MINUS"] = "TM";
67  SubDetPhasePartMap["TEC__PLUS"] = "TP";
68 
69  //get on/off option for every cluster from cfi
70  edm::ParameterSet ParametersnClusters = conf_.getParameter<edm::ParameterSet>("TH1nClusters");
71  layerswitchncluson = ParametersnClusters.getParameter<bool>("layerswitchon");
72  moduleswitchncluson = ParametersnClusters.getParameter<bool>("moduleswitchon");
73 
74  edm::ParameterSet ParametersClusterCharge = conf_.getParameter<edm::ParameterSet>("TH1ClusterCharge");
75  layerswitchcluschargeon = ParametersClusterCharge.getParameter<bool>("layerswitchon");
76  moduleswitchcluschargeon = ParametersClusterCharge.getParameter<bool>("moduleswitchon");
77  subdetswitchcluschargeon = ParametersClusterCharge.getParameter<bool>("subdetswitchon");
78 
79  edm::ParameterSet ParametersClusterStoN = conf_.getParameter<edm::ParameterSet>("TH1ClusterStoN");
80  layerswitchclusstonon = ParametersClusterStoN.getParameter<bool>("layerswitchon");
81  moduleswitchclusstonon = ParametersClusterStoN.getParameter<bool>("moduleswitchon");
82 
83  edm::ParameterSet ParametersClusterStoNVsPos = conf_.getParameter<edm::ParameterSet>("TH1ClusterStoNVsPos");
84  layerswitchclusstonVsposon = ParametersClusterStoNVsPos.getParameter<bool>("layerswitchon");
85  moduleswitchclusstonVsposon = ParametersClusterStoNVsPos.getParameter<bool>("moduleswitchon");
86 
87  edm::ParameterSet ParametersClusterPos = conf_.getParameter<edm::ParameterSet>("TH1ClusterPos");
88  layerswitchclusposon = ParametersClusterPos.getParameter<bool>("layerswitchon");
89  moduleswitchclusposon = ParametersClusterPos.getParameter<bool>("moduleswitchon");
90 
91  edm::ParameterSet ParametersClusterDigiPos = conf_.getParameter<edm::ParameterSet>("TH1ClusterDigiPos");
92  layerswitchclusdigiposon = ParametersClusterDigiPos.getParameter<bool>("layerswitchon");
93  moduleswitchclusdigiposon = ParametersClusterDigiPos.getParameter<bool>("moduleswitchon");
94 
95  edm::ParameterSet ParametersClusterNoise = conf_.getParameter<edm::ParameterSet>("TH1ClusterNoise");
96  layerswitchclusnoiseon = ParametersClusterNoise.getParameter<bool>("layerswitchon");
97  moduleswitchclusnoiseon = ParametersClusterNoise.getParameter<bool>("moduleswitchon");
98 
99  edm::ParameterSet ParametersClusterWidth = conf_.getParameter<edm::ParameterSet>("TH1ClusterWidth");
100  layerswitchcluswidthon = ParametersClusterWidth.getParameter<bool>("layerswitchon");
101  moduleswitchcluswidthon = ParametersClusterWidth.getParameter<bool>("moduleswitchon");
102  subdetswitchcluswidthon = ParametersClusterWidth.getParameter<bool>("subdetswitchon");
103 
104  edm::ParameterSet ParametersModuleLocalOccupancy = conf_.getParameter<edm::ParameterSet>("TH1ModuleLocalOccupancy");
105  layerswitchlocaloccupancy = ParametersModuleLocalOccupancy.getParameter<bool>("layerswitchon");
106  moduleswitchlocaloccupancy = ParametersModuleLocalOccupancy.getParameter<bool>("moduleswitchon");
107 
108  edm::ParameterSet ParametersNrOfClusterizedStrips = conf_.getParameter<edm::ParameterSet>("TH1NrOfClusterizedStrips");
109  layerswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.getParameter<bool>("layerswitchon");
110  moduleswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.getParameter<bool>("moduleswitchon");
111 
112  edm::ParameterSet ParametersClusterProf = conf_.getParameter<edm::ParameterSet>("TProfNumberOfCluster");
113  layerswitchnumclusterprofon = ParametersClusterProf.getParameter<bool>("layerswitchon");
114 
115  edm::ParameterSet ParametersClusterWidthProf = conf_.getParameter<edm::ParameterSet>("TProfClusterWidth");
116  layerswitchclusterwidthprofon = ParametersClusterWidthProf.getParameter<bool>("layerswitchon");
117 
118  edm::ParameterSet ParametersTotClusterProf = conf_.getParameter<edm::ParameterSet>("TProfTotalNumberOfClusters");
119  subdetswitchtotclusprofon = ParametersTotClusterProf.getParameter<bool>("subdetswitchon");
120 
121  edm::ParameterSet ParametersTotClusterTH1 = conf_.getParameter<edm::ParameterSet>("TH1TotalNumberOfClusters");
122  subdetswitchtotclusth1on = ParametersTotClusterTH1.getParameter<bool>("subdetswitchon");
123 
124  edm::ParameterSet ParametersClusterApvProf = conf_.getParameter<edm::ParameterSet>("TProfClustersApvCycle");
125  subdetswitchapvcycleprofon = ParametersClusterApvProf.getParameter<bool>("subdetswitchon");
126 
127  edm::ParameterSet ParametersClustersApvTH2 = conf_.getParameter<edm::ParameterSet>("TH2ClustersApvCycle");
128  subdetswitchapvcycleth2on = ParametersClustersApvTH2.getParameter<bool>("subdetswitchon");
129 
130  edm::ParameterSet ParametersApvCycleDBxProf2 = conf_.getParameter<edm::ParameterSet>("TProf2ApvCycleVsDBx");
131  subdetswitchapvcycledbxprof2on = ParametersApvCycleDBxProf2.getParameter<bool>("subdetswitchon");
132 
133  edm::ParameterSet ParametersDBxCycleProf = conf_.getParameter<edm::ParameterSet>("TProfClustersVsDBxCycle");
134  subdetswitchdbxcycleprofon = ParametersDBxCycleProf.getParameter<bool>("subdetswitchon");
135 
136  edm::ParameterSet ParametersCStripVsCPix = conf_.getParameter<edm::ParameterSet>("TH2CStripVsCpixel");
137  globalswitchcstripvscpix = ParametersCStripVsCPix.getParameter<bool>("globalswitchon");
138 
139  edm::ParameterSet ParametersMultiplicityRegionsTH1 = conf_.getParameter<edm::ParameterSet>("TH1MultiplicityRegions");
140  globalswitchMultiRegions = ParametersMultiplicityRegionsTH1.getParameter<bool>("globalswitchon");
141 
142  edm::ParameterSet ParametersApvCycleVsDBxGlobalTH2 = conf_.getParameter<edm::ParameterSet>("TH2ApvCycleVsDBxGlobal");
143  globalswitchapvcycledbxth2on = ParametersApvCycleVsDBxGlobalTH2.getParameter<bool>("globalswitchon");
144 
145  edm::ParameterSet ParametersNoiseStrip2ApvCycle = conf_.getParameter<edm::ParameterSet>("TH1StripNoise2ApvCycle");
146  globalswitchstripnoise2apvcycle = ParametersNoiseStrip2ApvCycle.getParameter<bool>("globalswitchon");
147 
148  edm::ParameterSet ParametersNoiseStrip3ApvCycle = conf_.getParameter<edm::ParameterSet>("TH1StripNoise3ApvCycle");
149  globalswitchstripnoise3apvcycle = ParametersNoiseStrip3ApvCycle.getParameter<bool>("globalswitchon");
150 
151  edm::ParameterSet ParametersMainDiagonalPosition = conf_.getParameter<edm::ParameterSet>("TH1MainDiagonalPosition");
152  globalswitchmaindiagonalposition= ParametersMainDiagonalPosition.getParameter<bool>("globalswitchon");
153 
154  edm::ParameterSet ClusterMultiplicityRegions = conf_.getParameter<edm::ParameterSet>("MultiplicityRegions");
155  k0 = ClusterMultiplicityRegions.getParameter<double>("k0");
156  q0 = ClusterMultiplicityRegions.getParameter<double>("q0");
157  dk0 = ClusterMultiplicityRegions.getParameter<double>("dk0");
158  maxClus = ClusterMultiplicityRegions.getParameter<double>("MaxClus");
159  minPix = ClusterMultiplicityRegions.getParameter<double>("MinPix");
160 
161  edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter<edm::ParameterSet>("NclusVsCycleTimeProf2D");
162  globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.getParameter<bool>("globalswitchon");
163 
164  edm::ParameterSet ParametersClusWidthVsAmpTH2 = conf_.getParameter<edm::ParameterSet>("ClusWidthVsAmpTH2");
165  clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("globalswitchon");
166  layer_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("layerswitchon");
167  subdet_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("subdetswitchon");
168  module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("moduleswitchon");
169 
170  clustertkhistomapon = conf_.getParameter<bool>("TkHistoMap_On");
171  clusterchtkhistomapon = conf_.getParameter<bool>("ClusterChTkHistoMap_On");
172  createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
173  trendVsLs_ = conf_.getParameter<bool>("TrendVsLS");
174  Mod_On_ = conf_.getParameter<bool>("Mod_On");
175  ClusterHisto_ = conf_.getParameter<bool>("ClusterHisto");
176 
177  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
178 
179 
180  // Poducer name of input StripClusterCollection
181  clusterProducerStripToken_ = consumes<edmNew::DetSetVector<SiStripCluster> >(conf_.getParameter<edm::InputTag>("ClusterProducerStrip") );
182  clusterProducerPixToken_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(conf_.getParameter<edm::InputTag>("ClusterProducerPix") );
183  /*
184  clusterProducerStrip_ = conf_.getParameter<edm::InputTag>("ClusterProducerStrip");
185  clusterProducerPix_ = conf_.getParameter<edm::InputTag>("ClusterProducerPix");
186  */
187  // SiStrip Quality Label
188  qualityLabel_ = conf_.getParameter<std::string>("StripQualityLabel");
189  // cluster quality conditions
190  edm::ParameterSet cluster_condition = conf_.getParameter<edm::ParameterSet>("ClusterConditions");
191  applyClusterQuality_ = cluster_condition.getParameter<bool>("On");
192  sToNLowerLimit_ = cluster_condition.getParameter<double>("minStoN");
193  sToNUpperLimit_ = cluster_condition.getParameter<double>("maxStoN");
194  widthLowerLimit_ = cluster_condition.getParameter<double>("minWidth");
195  widthUpperLimit_ = cluster_condition.getParameter<double>("maxWidth");
196 
197  // Event History Producer
198  // historyProducer_ = conf_.getParameter<edm::InputTag>("HistoryProducer");
199  historyProducerToken_ = consumes<EventWithHistory>(conf_.getParameter<edm::InputTag>("HistoryProducer") );
200  // Apv Phase Producer
201  // apvPhaseProducer_ = conf_.getParameter<edm::InputTag>("ApvPhaseProducer");
202  apvPhaseProducerToken_ = consumes<APVCyclePhaseCollection>(conf_.getParameter<edm::InputTag>("ApvPhaseProducer") );
203  // Create DCS Status
204  bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering");
205  if (checkDCS) dcsStatus_ = new SiStripDCSStatus(consumesCollector());
206  else dcsStatus_ = 0;
207 
208 }
209 
211  if (dcsStatus_) delete dcsStatus_;
215 }
216 
217 
218 //--------------------------------------------------------------------------------------------
220 
221  // Initialize the GenericTriggerEventFlag
228 }
229 
230 //--------------------------------------------------------------------------------------------
232 
234 
235  //Retrieve tracker topology from geometry
236  edm::ESHandle<TrackerTopology> tTopoHandle;
237  es.get<TrackerTopologyRcd>().get(tTopoHandle);
238  const TrackerTopology* const tTopo = tTopoHandle.product();
239 
240  // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on
242 
243  // get list of active detectors from SiStripDetCabling
244  std::vector<uint32_t> activeDets;
245  SiStripDetCabling_->addActiveDetectorsRawIds(activeDets);
246 
247  SiStripSubStructure substructure;
248 
249  SiStripFolderOrganizer folder_organizer;
250  folder_organizer.setSiStripFolderName(topFolderName_);
251  folder_organizer.setSiStripFolder();
252 
253 
254  // Create TkHistoMap for Cluster
255  if (clustertkhistomapon) {
256  // std::cout << "[SiStripMonitorCluster::createMEs] topFolderName_: " << topFolderName_ << " ";
257  if ( (topFolderName_ == "SiStrip") or (std::string::npos != topFolderName_.find("HLT")) )
258  tkmapcluster = new TkHistoMap(ibooker , topFolderName_,"TkHMap_NumberOfCluster",0.,true);
259  else tkmapcluster = new TkHistoMap(ibooker , topFolderName_+"/TkHistoMap","TkHMap_NumberOfCluster",0.,false);
260  }
261  if (clusterchtkhistomapon) {
262  if ( (topFolderName_ == "SiStrip") or (std::string::npos != topFolderName_.find("HLT")) )
263  tkmapclusterch = new TkHistoMap(ibooker , topFolderName_,"TkHMap_ClusterCharge",0.,true);
264  else tkmapclusterch = new TkHistoMap(ibooker , topFolderName_+"/TkHistoMap","TkHMap_ClusterCharge",0.,false);
265  }
266 
267  // loop over detectors and book MEs
268  edm::LogInfo("SiStripTkDQM|SiStripMonitorCluster")<<"nr. of activeDets: "<<activeDets.size();
269  for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
270  uint32_t detid = (*detid_iterator);
271  // remove any eventual zero elements - there should be none, but just in case
272  if(detid == 0) {
273  activeDets.erase(detid_iterator);
274  continue;
275  }
276 
277  if (Mod_On_) {
278  ModMEs mod_single;
279  // set appropriate folder using SiStripFolderOrganizer
280  folder_organizer.setDetectorFolder(detid, tTopo); // pass the detid to this method
281  if (reset_each_run) ResetModuleMEs(detid);
282  createModuleMEs(mod_single, detid , ibooker);
283  // append to ModuleMEsMap
284  ModuleMEsMap.insert( std::make_pair(detid, mod_single));
285  }
286 
287  // Create Layer Level MEs if they are not created already
288  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo);
289  SiStripHistoId hidmanager;
290  std::string label = hidmanager.getSubdetid(detid,tTopo,false);
291 
292  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(label);
293  if(iLayerME==LayerMEsMap.end()) {
294 
295  // get detids for the layer
296  int32_t lnumber = det_layer_pair.second;
297  std::vector<uint32_t> layerDetIds;
298  if (det_layer_pair.first == "TIB") {
299  substructure.getTIBDetectors(activeDets,layerDetIds,lnumber,0,0,0);
300  } else if (det_layer_pair.first == "TOB") {
301  substructure.getTOBDetectors(activeDets,layerDetIds,lnumber,0,0);
302  } else if (det_layer_pair.first == "TID" && lnumber > 0) {
303  substructure.getTIDDetectors(activeDets,layerDetIds,2,abs(lnumber),0,0);
304  } else if (det_layer_pair.first == "TID" && lnumber < 0) {
305  substructure.getTIDDetectors(activeDets,layerDetIds,1,abs(lnumber),0,0);
306  } else if (det_layer_pair.first == "TEC" && lnumber > 0) {
307  substructure.getTECDetectors(activeDets,layerDetIds,2,abs(lnumber),0,0,0,0);
308  } else if (det_layer_pair.first == "TEC" && lnumber < 0) {
309  substructure.getTECDetectors(activeDets,layerDetIds,1,abs(lnumber),0,0,0,0);
310  }
311  LayerDetMap[label] = layerDetIds;
312 
313  // book Layer MEs
314  folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second);
315  createLayerMEs(label, layerDetIds.size() , ibooker );
316  }
317  // book sub-detector plots
318  auto sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
319  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()){
320  ibooker.setCurrentFolder(sdet_pair.first);
321 
322  createSubDetMEs(sdet_pair.second , ibooker );
323  }
324  }//end of loop over detectors
325 
326  // Create Global Histogram
328  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
329  edm::ParameterSet GlobalTH2Parameters = conf_.getParameter<edm::ParameterSet>("TH2ApvCycleVsDBxGlobal");
330  std::string HistoName = "DeltaBx_vs_ApvCycle";
331  GlobalApvCycleDBxTH2 = ibooker.book2D(HistoName,HistoName,
332  GlobalTH2Parameters.getParameter<int32_t>("Nbinsx"),
333  GlobalTH2Parameters.getParameter<double>("xmin"),
334  GlobalTH2Parameters.getParameter<double>("xmax"),
335  GlobalTH2Parameters.getParameter<int32_t>("Nbinsy"),
336  GlobalTH2Parameters.getParameter<double>("ymin"),
337  GlobalTH2Parameters.getParameter<double>("ymax"));
338  GlobalApvCycleDBxTH2->setAxisTitle("APV Cycle (Corrected Absolute Bx % 70)",1);
339  GlobalApvCycleDBxTH2->setAxisTitle("Delta Bunch Crossing Cycle",2);
340  }
341 
343  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
344  edm::ParameterSet GlobalTH2Parameters = conf_.getParameter<edm::ParameterSet>("TH2CStripVsCpixel");
345  std::string HistoName = "StripClusVsPixClus";
346  GlobalCStripVsCpix = ibooker.book2D(HistoName,HistoName,
347  GlobalTH2Parameters.getParameter<int32_t>("Nbinsx"),
348  GlobalTH2Parameters.getParameter<double>("xmin"),
349  GlobalTH2Parameters.getParameter<double>("xmax"),
350  GlobalTH2Parameters.getParameter<int32_t>("Nbinsy"),
351  GlobalTH2Parameters.getParameter<double>("ymin"),
352  GlobalTH2Parameters.getParameter<double>("ymax"));
353  GlobalCStripVsCpix->setAxisTitle("Strip Clusters",1);
354  GlobalCStripVsCpix->setAxisTitle("Pix Clusters",2);
355  }
356 
358  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
359  edm::ParameterSet GlobalTH2Parameters = conf_.getParameter<edm::ParameterSet>("TH1MultiplicityRegions");
360  std::string HistoName = "ClusterMultiplicityRegions";
361  PixVsStripMultiplicityRegions = ibooker.book1D(HistoName,HistoName,
362  GlobalTH2Parameters.getParameter<int32_t>("Nbinx"),
363  GlobalTH2Parameters.getParameter<double>("xmin"),
364  GlobalTH2Parameters.getParameter<double>("xmax"));
366  PixVsStripMultiplicityRegions->setBinLabel(1,"Main Diagonal");
367  PixVsStripMultiplicityRegions->setBinLabel(2,"Strip Noise");
368  PixVsStripMultiplicityRegions->setBinLabel(3,"High Strip Noise");
369  PixVsStripMultiplicityRegions->setBinLabel(4,"Beam Background");
370  PixVsStripMultiplicityRegions->setBinLabel(5,"No Strip Clusters");
371  }
372 
374  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
375  edm::ParameterSet GlobalTH1Parameters = conf_.getParameter<edm::ParameterSet>("TH1MainDiagonalPosition");
376  std::string HistoName = "MainDiagonal Position";
377  GlobalMainDiagonalPosition = ibooker.book1D(HistoName,HistoName,
378  GlobalTH1Parameters.getParameter<int32_t>("Nbinsx"),
379  GlobalTH1Parameters.getParameter<double>("xmin"),
380  GlobalTH1Parameters.getParameter<double>("xmax"));
381  GlobalMainDiagonalPosition->setAxisTitle("atan(NPix/(k*NStrip))");
382  }
383 
384  // TO BE ADDED !!!
385  /*
386  if ( globalswitchapvcycledbxth2on or globalswitchcstripvscpix or globalswitchMultiRegions or ClusterHisto_ ) {
387  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
388  std::string HistoName = "BPTX rate";
389  BPTXrateTrend = ibooker.bookProfile(HistoName,HistoName, LSBin, LSMin, LSMax, 0, 10000.,"");
390  BPTXrateTrend->getTH1()->SetCanExtend(TH1::kAllAxes);
391  BPTXrateTrend->setAxisTitle("#Lumi section",1);
392  BPTXrateTrend->setAxisTitle("Number of BPTX events per LS",2);
393  }
394  */
395 
397  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
398  edm::ParameterSet GlobalTH1Parameters = conf_.getParameter<edm::ParameterSet>("TH1StripNoise2ApvCycle");
399  std::string HistoName = "StripNoise_ApvCycle";
400  StripNoise2Cycle = ibooker.book1D(HistoName,HistoName,
401  GlobalTH1Parameters.getParameter<int32_t>("Nbinsx"),
402  GlobalTH1Parameters.getParameter<double>("xmin"),
403  GlobalTH1Parameters.getParameter<double>("xmax"));
404  StripNoise2Cycle->setAxisTitle("APV Cycle");
405  }
406 
408  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
409  edm::ParameterSet GlobalTH1Parameters = conf_.getParameter<edm::ParameterSet>("TH1StripNoise3ApvCycle");
410  std::string HistoName = "HighStripNoise_ApvCycle";
411  StripNoise3Cycle = ibooker.book1D(HistoName,HistoName,
412  GlobalTH1Parameters.getParameter<int32_t>("Nbinsx"),
413  GlobalTH1Parameters.getParameter<double>("xmin"),
414  GlobalTH1Parameters.getParameter<double>("xmax"));
415  StripNoise3Cycle->setAxisTitle("APV Cycle");
416  }
417 
419  const char* HistoName = "StripClusVsBXandOrbit";
420  const char* HistoTitle = "Strip cluster multiplicity vs BX mod(70) and Orbit;Event 1 BX mod(70);time [Orb#]";
421  edm::ParameterSet ParametersNclusVsCycleTimeProf2D = conf_.getParameter<edm::ParameterSet>("NclusVsCycleTimeProf2D");
422  NclusVsCycleTimeProf2D = ibooker.bookProfile2D ( HistoName , HistoTitle ,
423  ParametersNclusVsCycleTimeProf2D.getParameter<int32_t>("Nbins"),
424  ParametersNclusVsCycleTimeProf2D.getParameter<double>("xmin"),
425  ParametersNclusVsCycleTimeProf2D.getParameter<double>("xmax"),
426  ParametersNclusVsCycleTimeProf2D.getParameter<int32_t>("Nbinsy"),
427  ParametersNclusVsCycleTimeProf2D.getParameter<double>("ymin"),
428  ParametersNclusVsCycleTimeProf2D.getParameter<double>("ymax"),
429  0 , 0 );
430  if (NclusVsCycleTimeProf2D->kind() == MonitorElement::DQM_KIND_TPROFILE2D) NclusVsCycleTimeProf2D->getTH1()->SetCanExtend(TH1::kAllAxes);
431  }
433  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
434  edm::ParameterSet ParametersClusWidthVsAmpTH2 = conf_.getParameter<edm::ParameterSet>("ClusWidthVsAmpTH2");
435  const char* HistoName = "ClusterWidths_vs_Amplitudes";
436  const char* HistoTitle = "Cluster widths vs amplitudes;Amplitudes (integrated ADC counts);Cluster widths";
437  ClusWidthVsAmpTH2 = ibooker.book2D(HistoName,HistoTitle,
438  ParametersClusWidthVsAmpTH2.getParameter<int32_t>("Nbinsx"),
439  ParametersClusWidthVsAmpTH2.getParameter<double>("xmin"),
440  ParametersClusWidthVsAmpTH2.getParameter<double>("xmax"),
441  ParametersClusWidthVsAmpTH2.getParameter<int32_t>("Nbinsy"),
442  ParametersClusWidthVsAmpTH2.getParameter<double>("ymin"),
443  ParametersClusWidthVsAmpTH2.getParameter<double>("ymax"));
444  }
445 
446  if (ClusterHisto_){
447  ibooker.setCurrentFolder(topFolderName_+"/MechanicalView/");
448  edm::ParameterSet PixelCluster = conf_.getParameter<edm::ParameterSet>("TH1NClusPx");
449  std::string HistoName = "NumberOfClustersInPixel";
450  NumberOfPixelClus = ibooker.book1D(HistoName, HistoName,
451  PixelCluster.getParameter<int32_t>("Nbinsx"),
452  PixelCluster.getParameter<double>("xmin"),
453  PixelCluster.getParameter<double>("xmax"));
454  NumberOfPixelClus->setAxisTitle("# of Clusters in Pixel", 1);
455  NumberOfPixelClus->setAxisTitle("Number of Events", 2);
456  //
457  edm::ParameterSet StripCluster = conf_.getParameter<edm::ParameterSet>("TH1NClusStrip");
458  HistoName = "NumberOfClustersInStrip";
459  NumberOfStripClus = ibooker.book1D(HistoName, HistoName,
460  StripCluster.getParameter<int32_t>("Nbinsx"),
461  StripCluster.getParameter<double>("xmin"),
462  StripCluster.getParameter<double>("xmax"));
463  NumberOfStripClus->setAxisTitle("# of Clusters in Strip", 1);
464  NumberOfStripClus->setAxisTitle("Number of Events", 2);
465  }
466 
467  }//end of if
468 }//end of method
469 
470 //--------------------------------------------------------------------------------------------
471 
473 {
475  unsigned long long cacheID = es.get<SiStripDetCablingRcd>().cacheIdentifier();
476  if (m_cacheID_ != cacheID) {
477  m_cacheID_ = cacheID;
478  edm::LogInfo("SiStripMonitorCluster") <<"SiStripMonitorCluster::bookHistograms: "
479  << " Creating MEs for new Cabling ";
480 
481  createMEs(es , ibooker);
482  }
483  } else if (reset_each_run) {
484  edm::LogInfo("SiStripMonitorCluster") <<"SiStripMonitorCluster::bookHistograms: "
485  << " Resetting MEs ";
486  for (std::map<uint32_t, ModMEs >::const_iterator idet = ModuleMEsMap.begin() ; idet!=ModuleMEsMap.end() ; idet++) {
487  ResetModuleMEs(idet->first);
488  }
489  }
490 
491 }
492 
493 //--------------------------------------------------------------------------------------------
495 {
496  //Retrieve tracker topology from geometry
497  edm::ESHandle<TrackerTopology> tTopoHandle;
498  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
499  const TrackerTopology* const tTopo = tTopoHandle.product();
500 
501  // Filter out events if Trigger Filtering is requested
502  passBPTXfilter_ = ( iEvent.isRealData() and genTriggerEventFlagBPTXfilter_->on() ) ? genTriggerEventFlagBPTXfilter_->accept( iEvent, iSetup) : true;
505  // std::cout << "passBPTXfilter_ ? " << passBPTXfilter_ << std::endl;
506 
507  // Filter out events if DCS Event if requested
508  if (dcsStatus_ && !dcsStatus_->getStatus(iEvent,iSetup)) return;
509 
510  runNb = iEvent.id().run();
511  eventNb++;
512  trendVar = trendVsLs_ ? iEvent.orbitNumber()/262144.0 : iEvent.orbitNumber()/11223.0; // lumisection : seconds
513 
514  int NPixClusters=0, NStripClusters=0, MultiplicityRegion=0;
515  bool isPixValid=false;
516 
517  edm::ESHandle<SiStripNoises> noiseHandle;
518  iSetup.get<SiStripNoisesRcd>().get(noiseHandle);
519 
520  edm::ESHandle<SiStripGain> gainHandle;
521  iSetup.get<SiStripGainRcd>().get(gainHandle);
522 
523  edm::ESHandle<SiStripQuality> qualityHandle;
524  iSetup.get<SiStripQualityRcd>().get(qualityLabel_,qualityHandle);
525 
527 
528  // get collection of DetSetVector of clusters from Event
530  iEvent.getByToken(clusterProducerStripToken_, cluster_detsetvektor);
531 
532  //get pixel clusters
533  edm::Handle< edmNew::DetSetVector<SiPixelCluster> > cluster_detsetvektor_pix;
534  iEvent.getByToken(clusterProducerPixToken_, cluster_detsetvektor_pix);
535 
536  if (!cluster_detsetvektor.isValid()) return;
537 
538  const edmNew::DetSetVector<SiStripCluster> * StrC= cluster_detsetvektor.product();
539  NStripClusters= StrC->data().size();
540 
541  if (cluster_detsetvektor_pix.isValid()){
542  const edmNew::DetSetVector<SiPixelCluster> * PixC= cluster_detsetvektor_pix.product();
543  NPixClusters= PixC->data().size();
544  isPixValid=true;
545  MultiplicityRegion=FindRegion(NStripClusters,NPixClusters);
546 
548  if (globalswitchcstripvscpix) GlobalCStripVsCpix->Fill(NStripClusters,NPixClusters);
549  if (globalswitchmaindiagonalposition && NStripClusters > 0) GlobalMainDiagonalPosition->Fill(atan(NPixClusters/(k0*NStripClusters)));
551  }
552 
553  if (ClusterHisto_){
555  NumberOfPixelClus->Fill(NPixClusters);
556  if ( passBPTXfilter_ and passStripDCSfilter_ )
557  NumberOfStripClus->Fill(NStripClusters);
558  }
559  }
560  // initialise # of clusters to zero
561  for (std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.begin();
562  iSubdet != SubDetMEsMap.end(); iSubdet++) {
563  iSubdet->second.totNClusters = 0;
564  }
565 
566  SiStripFolderOrganizer folder_organizer;
567  bool found_layer_me = false;
568  for (std::map<std::string, std::vector< uint32_t > >::const_iterator iterLayer = LayerDetMap.begin();
569  iterLayer != LayerDetMap.end(); iterLayer++) {
570 
571  std::string layer_label = iterLayer->first;
572 
573  int ncluster_layer = 0;
574  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_label);
575 
576  //get Layer MEs
577  LayerMEs layer_single;
578  if(iLayerME != LayerMEsMap.end()) {
579  layer_single = iLayerME->second;
580  found_layer_me = true;
581  }
582 
583  bool found_module_me = false;
584  uint16_t iDet = 0;
585  std::string subdet_label = "";
586  // loop over all modules in the layer
587  for (std::vector< uint32_t >::const_iterator iterDets = iterLayer->second.begin() ;
588  iterDets != iterLayer->second.end() ; iterDets++) {
589  iDet++;
590  // detid and type of ME
591  uint32_t detid = (*iterDets);
592 
593  // Get SubDet label once
594  if (subdet_label.size() == 0) subdet_label = folder_organizer.getSubDetFolderAndTag(detid, tTopo).second;
595 
596  // DetId and corresponding set of MEs
597  ModMEs mod_single;
598  if (Mod_On_) {
599  std::map<uint32_t, ModMEs >::iterator imodME = ModuleMEsMap.find(detid);
600  if (imodME != ModuleMEsMap.end()) {
601  mod_single = imodME->second;
602  found_module_me = true;
603  }
604  } else found_module_me = false;
605 
606  edmNew::DetSetVector<SiStripCluster>::const_iterator isearch = cluster_detsetvektor->find(detid); // search clusters of detid
607 
608  if(isearch==cluster_detsetvektor->end()){
609  if(found_module_me && moduleswitchncluson && (mod_single.NumberOfClusters)){
610  (mod_single.NumberOfClusters)->Fill(0.); // no clusters for this detector module,fill histogram with 0
611  }
612  if(clustertkhistomapon) tkmapcluster->fill(detid,0.);
614  if (found_layer_me && layerswitchnumclusterprofon) layer_single.LayerNumberOfClusterProfile->Fill(iDet, 0.0);
615  continue; // no clusters for this detid => jump to next step of loop
616  }
617 
618  //cluster_detset is a structure, cluster_detset.data is a std::vector<SiStripCluster>, cluster_detset.id is uint32_t
619  // edmNew::DetSet<SiStripCluster> cluster_detset = (*cluster_detsetvektor)[detid]; // the statement above makes sure there exists an element with 'detid'
620  edmNew::DetSet<SiStripCluster> cluster_detset = (*isearch);
621 
622  // Filling TkHistoMap with number of clusters for each module
623  if(clustertkhistomapon) {
624  tkmapcluster->fill(detid,static_cast<float>(cluster_detset.size()));
625  }
626 
627  if(moduleswitchncluson && found_module_me && (mod_single.NumberOfClusters != NULL)){ // nr. of clusters per module
628  (mod_single.NumberOfClusters)->Fill(static_cast<float>(cluster_detset.size()));
629  }
630 
631  if (found_layer_me && layerswitchnumclusterprofon)
632  layer_single.LayerNumberOfClusterProfile->Fill(iDet, static_cast<float>(cluster_detset.size()));
633  ncluster_layer += cluster_detset.size();
634 
635  short total_clusterized_strips = 0;
636 
637  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detid);
638  SiStripApvGain::Range detGainRange = gainHandle->getRange(detid);
639  SiStripQuality::Range qualityRange = qualityHandle->getRange(detid);
640 
641  for(edmNew::DetSet<SiStripCluster>::const_iterator clusterIter = cluster_detset.begin(); clusterIter!= cluster_detset.end(); clusterIter++){
642 
643  const auto & ampls = clusterIter->amplitudes();
644  // cluster position
645  float cluster_position = clusterIter->barycenter();
646  // start defined as nr. of first strip beloning to the cluster
647  short cluster_start = clusterIter->firstStrip();
648  // width defined as nr. of strips that belong to cluster
649  short cluster_width = ampls.size();
650  // add nr of strips of this cluster to total nr. of clusterized strips
651  total_clusterized_strips = total_clusterized_strips + cluster_width;
652 
653  if(clusterchtkhistomapon) tkmapclusterch->fill(detid,static_cast<float>(clusterIter->charge()));
654 
655  // cluster signal and noise from the amplitudes
656  float cluster_signal = 0.0;
657  float cluster_noise = 0.0;
658  int nrnonzeroamplitudes = 0;
659  float noise2 = 0.0;
660  float noise = 0.0;
661  for(uint iamp=0; iamp<ampls.size(); iamp++){
662  if(ampls[iamp]>0){ // nonzero amplitude
663  cluster_signal += ampls[iamp];
664  if(!qualityHandle->IsStripBad(qualityRange, clusterIter->firstStrip()+iamp)){
665  noise = noiseHandle->getNoise(clusterIter->firstStrip()+iamp,detNoiseRange)/gainHandle->getStripGain(clusterIter->firstStrip()+iamp, detGainRange);
666  }
667  noise2 += noise*noise;
668  nrnonzeroamplitudes++;
669  }
670  } // End loop over cluster amplitude
671 
672  if (nrnonzeroamplitudes > 0) cluster_noise = sqrt(noise2/nrnonzeroamplitudes);
673 
674  if( applyClusterQuality_ &&
675  (cluster_signal/cluster_noise < sToNLowerLimit_ ||
676  cluster_signal/cluster_noise > sToNUpperLimit_ ||
677  cluster_width < widthLowerLimit_ ||
678  cluster_width > widthUpperLimit_) ) continue;
679 
680  ClusterProperties cluster_properties;
681  cluster_properties.charge = cluster_signal;
682  cluster_properties.position = cluster_position;
683  cluster_properties.start = cluster_start;
684  cluster_properties.width = cluster_width;
685  cluster_properties.noise = cluster_noise;
686 
687  // Fill Module Level MEs
688  if (found_module_me) fillModuleMEs(mod_single, cluster_properties);
689 
690  // Fill Layer Level MEs
691  if (found_layer_me) {
692  fillLayerMEs(layer_single, cluster_properties);
694  layer_single.LayerClusterWidthProfile->Fill(iDet, cluster_width);
695  }
696 
698  {
699  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(subdet_label);
700  if(iSubdet != SubDetMEsMap.end())
701  {
702  if (subdetswitchcluschargeon) iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal);
703  if (subdetswitchcluswidthon) iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width);
704  }
705  }
706 
707 
709  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(subdet_label);
710  if(iSubdet != SubDetMEsMap.end()) iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
711  }
712 
714  ClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
715  }
716 
717  } // end loop over clusters
718 
719  short total_nr_strips = SiStripDetCabling_->nApvPairs(detid) * 2 * 128; // get correct # of avp pairs
720  float local_occupancy = static_cast<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
721  if (found_module_me) {
722  if(moduleswitchnrclusterizedstrip && mod_single.NrOfClusterizedStrips ){ // nr of clusterized strips
723  mod_single.NrOfClusterizedStrips->Fill(static_cast<float>(total_clusterized_strips));
724  }
725 
726  if(moduleswitchlocaloccupancy && mod_single.ModuleLocalOccupancy ){ // Occupancy
727  mod_single.ModuleLocalOccupancy->Fill(local_occupancy);
728  }
729  }
730  if (layerswitchlocaloccupancy && found_layer_me && layer_single.LayerLocalOccupancy) {
731  fillME(layer_single.LayerLocalOccupancy,local_occupancy);
732  if (createTrendMEs)
733  fillME(layer_single.LayerLocalOccupancyTrend,trendVar,local_occupancy);
734  }
735  }
736  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(subdet_label);
737  if(iSubdet != SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer;
738  }
739 
740  // EventHistory
741  edm::Handle<EventWithHistory> event_history;
742  iEvent.getByToken(historyProducerToken_,event_history);
743 
744  // Phase of APV
745  edm::Handle<APVCyclePhaseCollection> apv_phase_collection;
746  iEvent.getByToken(apvPhaseProducerToken_,apv_phase_collection);
747 
748  if (event_history.isValid()
749  && !event_history.failedToGet()
750  && apv_phase_collection.isValid()
751  && !apv_phase_collection.failedToGet()) {
752 
753 
754  long long dbx = event_history->deltaBX();
755  long long tbx = event_history->absoluteBX();
756 
757  bool global_histo_filled = false;
758  bool MultiplicityRegion_Vs_APVcycle_filled=false;
759 
760  for (std::map<std::string, SubDetMEs>::iterator it = SubDetMEsMap.begin();
761  it != SubDetMEsMap.end(); it++) {
762  std::string sdet = it->first;
763  //std::string sdet = sdet_tag.substr(0,sdet_tag.find_first_of("_"));
764  SubDetMEs sdetmes = it->second;
765 
766  int the_phase = APVCyclePhaseCollection::invalid;
767  long long tbx_corr = tbx;
768 
769  if (SubDetPhasePartMap.find(sdet) != SubDetPhasePartMap.end()) the_phase = apv_phase_collection->getPhase(SubDetPhasePartMap[sdet]);
770  if(the_phase==APVCyclePhaseCollection::nopartition ||
773  the_phase=30;
774  //std::cout << " subdet " << it->first << " not valid" << " MR " << MultiplicityRegion <<std::endl;
775  }
776  tbx_corr -= the_phase;
777  long long dbxincycle = event_history->deltaBXinCycle(the_phase);
778  if (globalswitchapvcycledbxth2on && !global_histo_filled) {
779  GlobalApvCycleDBxTH2->Fill(tbx_corr%70,dbx);
780  global_histo_filled = true;
781  }
782 
783  if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){
784  if (globalswitchstripnoise2apvcycle && MultiplicityRegion==2) {StripNoise2Cycle->Fill(tbx_corr%70);}
785  if (globalswitchstripnoise3apvcycle && MultiplicityRegion==3) {StripNoise3Cycle->Fill(tbx_corr%70);}
786  MultiplicityRegion_Vs_APVcycle_filled=true;
787  }
788 
790  sdetmes.SubDetTotClusterTH1->Fill(sdetmes.totNClusters);
794  sdetmes.SubDetClusterApvProf->Fill(tbx_corr%70,sdetmes.totNClusters);
796  sdetmes.SubDetClusterApvTH2->Fill(tbx_corr%70,sdetmes.totNClusters);
798  sdetmes.SubDetClusterDBxCycleProf->Fill(dbxincycle,sdetmes.totNClusters);
800  sdetmes.SubDetApvDBxProf2->Fill(tbx_corr%70,dbx,sdetmes.totNClusters);
801  }
802 
804  {
805  long long tbx_corr = tbx;
806  int the_phase = apv_phase_collection->getPhase("All");
807 
808  if( the_phase == APVCyclePhaseCollection::nopartition ||
810  the_phase == APVCyclePhaseCollection::invalid )
811  the_phase=30;
812 
813  tbx_corr -= the_phase;
814 
815  NclusVsCycleTimeProf2D->Fill( tbx_corr%70 , (int)event_history->_orbit , NStripClusters );
816  }
817  }
818 }
819 //
820 // -- Reset MEs
821 //------------------------------------------------------------------------------
823  std::map<uint32_t, ModMEs >::iterator pos = ModuleMEsMap.find(idet);
824  ModMEs mod_me = pos->second;
825 
837 }
838 //
839 // -- Create Module Level MEs
840 //
841 void SiStripMonitorCluster::createModuleMEs(ModMEs& mod_single, uint32_t detid , DQMStore::IBooker & ibooker) {
842 
843  // use SistripHistoId for producing histogram id (and title)
844  SiStripHistoId hidmanager;
845  std::string hid;
846 
847  //nr. of clusters per module
848  if(moduleswitchncluson) {
849  hid = hidmanager.createHistoId("NumberOfClusters","det",detid);
850  mod_single.NumberOfClusters = bookME1D("TH1nClusters", hid.c_str() , ibooker);
851  ibooker.tag(mod_single.NumberOfClusters, detid);
852  mod_single.NumberOfClusters->setAxisTitle("number of clusters in one detector module");
853  mod_single.NumberOfClusters->getTH1()->StatOverflows(kTRUE); // over/underflows in Mean calculation
854  }
855 
856  //ClusterPosition
858  short total_nr_strips = SiStripDetCabling_->nApvPairs(detid) * 2 * 128; // get correct # of avp pairs
859  hid = hidmanager.createHistoId("ClusterPosition","det",detid);
860  mod_single.ClusterPosition = ibooker.book1D(hid, hid, total_nr_strips, 0.5, total_nr_strips+0.5);
861  ibooker.tag(mod_single.ClusterPosition, detid);
862  mod_single.ClusterPosition->setAxisTitle("cluster position [strip number +0.5]");
863  }
864 
865  //ClusterDigiPosition
867  short total_nr_strips = SiStripDetCabling_->nApvPairs(detid) * 2 * 128; // get correct # of avp pairs
868  hid = hidmanager.createHistoId("ClusterDigiPosition","det",detid);
869  mod_single.ClusterDigiPosition = ibooker.book1D(hid, hid, total_nr_strips, 0.5, total_nr_strips+0.5);
870  ibooker.tag(mod_single.ClusterDigiPosition, detid);
871  mod_single.ClusterDigiPosition->setAxisTitle("digi in cluster position [strip number +0.5]");
872  }
873 
874  //ClusterWidth
876  hid = hidmanager.createHistoId("ClusterWidth","det",detid);
877  mod_single.ClusterWidth = bookME1D("TH1ClusterWidth", hid.c_str() , ibooker);
878  ibooker.tag(mod_single.ClusterWidth, detid);
879  mod_single.ClusterWidth->setAxisTitle("cluster width [nr strips]");
880  }
881 
882  //ClusterCharge
884  hid = hidmanager.createHistoId("ClusterCharge","det",detid);
885  mod_single.ClusterCharge = bookME1D("TH1ClusterCharge", hid.c_str() , ibooker );
886  ibooker.tag(mod_single.ClusterCharge, detid);
887  mod_single.ClusterCharge->setAxisTitle("cluster charge [ADC]");
888  }
889 
890  //ClusterNoise
892  hid = hidmanager.createHistoId("ClusterNoise","det",detid);
893  mod_single.ClusterNoise = bookME1D("TH1ClusterNoise", hid.c_str() , ibooker );
894  ibooker.tag(mod_single.ClusterNoise, detid);
895  mod_single.ClusterNoise->setAxisTitle("cluster noise");
896  }
897 
898  //ClusterSignalOverNoise
900  hid = hidmanager.createHistoId("ClusterSignalOverNoise","det",detid);
901  mod_single.ClusterSignalOverNoise = bookME1D("TH1ClusterStoN", hid.c_str() , ibooker);
902  ibooker.tag(mod_single.ClusterSignalOverNoise, detid);
903  mod_single.ClusterSignalOverNoise->setAxisTitle("ratio of signal to noise for each cluster");
904  }
905 
906  //ClusterSignalOverNoiseVsPos
908  hid = hidmanager.createHistoId("ClusterSignalOverNoiseVsPos","det",detid);
909  Parameters = conf_.getParameter<edm::ParameterSet>("TH1ClusterStoNVsPos");
910  mod_single.ClusterSignalOverNoiseVsPos= ibooker.bookProfile(hid.c_str(),hid.c_str(),
911  Parameters.getParameter<int32_t>("Nbinx"),
912  Parameters.getParameter<double>("xmin"),
913  Parameters.getParameter<double>("xmax"),
914  Parameters.getParameter<int32_t>("Nbiny"),
915  Parameters.getParameter<double>("ymin"),
916  Parameters.getParameter<double>("ymax")
917  );
918  ibooker.tag(mod_single.ClusterSignalOverNoiseVsPos, detid);
919  mod_single.ClusterSignalOverNoiseVsPos->setAxisTitle("pos");
920  }
921 
922  //ModuleLocalOccupancy
924  hid = hidmanager.createHistoId("ClusterLocalOccupancy","det",detid);
925  mod_single.ModuleLocalOccupancy = bookME1D("TH1ModuleLocalOccupancy", hid.c_str() , ibooker);
926  ibooker.tag(mod_single.ModuleLocalOccupancy, detid);
927  mod_single.ModuleLocalOccupancy->setAxisTitle("module local occupancy [% of clusterized strips]");
928  }
929 
930  //NrOfClusterizedStrips
932  hid = hidmanager.createHistoId("NrOfClusterizedStrips","det",detid);
933  mod_single.NrOfClusterizedStrips = bookME1D("TH1NrOfClusterizedStrips", hid.c_str() , ibooker );
934  ibooker.tag(mod_single.NrOfClusterizedStrips, detid);
935  mod_single.NrOfClusterizedStrips->setAxisTitle("number of clusterized strips");
936  }
937 
939  hid = hidmanager.createHistoId("ClusterWidths_vs_Amplitudes","det",detid);
940  Parameters = conf_.getParameter<edm::ParameterSet>("ClusWidthVsAmpTH2");
941  int32_t Nbinsx = Parameters.getParameter<int32_t>("Nbinsx");
942  Nbinsx = Nbinsx/2; //Without this "rebinning" the job is killed on lxplus. We think it's due to the high memory needed to create all those histograms.
943  mod_single.Module_ClusWidthVsAmpTH2 = ibooker.book2D(hid.c_str() , hid.c_str(),
944  Nbinsx,
945  Parameters.getParameter<double>("xmin"),
946  Parameters.getParameter<double>("xmax"),
947  Parameters.getParameter<int32_t>("Nbinsy"),
948  Parameters.getParameter<double>("ymin"),
949  Parameters.getParameter<double>("ymax")
950  );
951  ibooker.tag(mod_single.Module_ClusWidthVsAmpTH2, detid);
952  mod_single.Module_ClusWidthVsAmpTH2->setAxisTitle("Amplitudes (integrated ADC counts)",1);
953  mod_single.Module_ClusWidthVsAmpTH2->setAxisTitle("Cluster widths",2);
954  }
955 
956 }
957 //
958 // -- Create Module Level MEs
959 //
961 
962  SiStripHistoId hidmanager;
963 
964  LayerMEs layerMEs;
965  layerMEs.LayerClusterStoN = 0;
966  layerMEs.LayerClusterStoNTrend = 0;
967  layerMEs.LayerClusterCharge = 0;
968  layerMEs.LayerClusterChargeTrend = 0;
969  layerMEs.LayerClusterNoise = 0;
970  layerMEs.LayerClusterNoiseTrend = 0;
971  layerMEs.LayerClusterWidth = 0;
972  layerMEs.LayerClusterWidthTrend = 0;
973  layerMEs.LayerLocalOccupancy = 0;
974  layerMEs.LayerLocalOccupancyTrend = 0;
975  layerMEs.LayerNumberOfClusterProfile = 0;
976  layerMEs.LayerClusterWidthProfile = 0;
977  layerMEs.LayerClusWidthVsAmpTH2 = 0;
978 
979  //Cluster Width
981  layerMEs.LayerClusterWidth=bookME1D("TH1ClusterWidth", hidmanager.createHistoLayer("Summary_ClusterWidth","layer",label,"").c_str() , ibooker );
982  if (createTrendMEs)
983  layerMEs.LayerClusterWidthTrend=bookMETrend(hidmanager.createHistoLayer("Trend_ClusterWidth","layer",label,"").c_str() , ibooker );
984  }
985 
986  //Cluster Noise
988  layerMEs.LayerClusterNoise=bookME1D("TH1ClusterNoise", hidmanager.createHistoLayer("Summary_ClusterNoise","layer",label,"").c_str() , ibooker );
989  if (createTrendMEs)
990  layerMEs.LayerClusterNoiseTrend=bookMETrend(hidmanager.createHistoLayer("Trend_ClusterNoise","layer",label,"").c_str() , ibooker);
991  }
992 
993  //Cluster Charge
995  layerMEs.LayerClusterCharge=bookME1D("TH1ClusterCharge", hidmanager.createHistoLayer("Summary_ClusterCharge","layer",label,"").c_str() , ibooker );
996  if (createTrendMEs)
997  layerMEs.LayerClusterChargeTrend=bookMETrend(hidmanager.createHistoLayer("Trend_ClusterCharge","layer",label,"").c_str(),ibooker);
998  }
999 
1000  //Cluster StoN
1001  if(layerswitchclusstonon) {
1002  layerMEs.LayerClusterStoN=bookME1D("TH1ClusterStoN", hidmanager.createHistoLayer("Summary_ClusterSignalOverNoise","layer",label,"").c_str() , ibooker );
1003  if (createTrendMEs)
1004  layerMEs.LayerClusterStoNTrend=bookMETrend(hidmanager.createHistoLayer("Trend_ClusterSignalOverNoise","layer",label,"").c_str(),ibooker);
1005  }
1006 
1007  //Cluster Occupancy
1009  layerMEs.LayerLocalOccupancy=bookME1D("TH1ModuleLocalOccupancy", hidmanager.createHistoLayer("Summary_ClusterLocalOccupancy","layer",label,"").c_str() , ibooker );
1010  if (createTrendMEs)
1011  layerMEs.LayerLocalOccupancyTrend=bookMETrend(hidmanager.createHistoLayer("Trend_ClusterLocalOccupancy","layer",label,"").c_str(),ibooker);
1012  }
1013 
1014  // # of Cluster Profile
1016  std::string hid = hidmanager.createHistoLayer("NumberOfClusterProfile","layer",label,"");
1017  layerMEs.LayerNumberOfClusterProfile = ibooker.bookProfile(hid, hid, ndets, 0.5, ndets+0.5,21, -0.5, 20.5);
1018  }
1019 
1020  // Cluster Width Profile
1022  std::string hid = hidmanager.createHistoLayer("ClusterWidthProfile","layer",label,"");
1023  layerMEs.LayerClusterWidthProfile = ibooker.bookProfile(hid, hid, ndets, 0.5, ndets+0.5, 20, -0.5, 19.5);
1024  }
1025 
1027  layerMEs.LayerClusWidthVsAmpTH2=bookME2D("ClusWidthVsAmpTH2", hidmanager.createHistoLayer("ClusterWidths_vs_Amplitudes","layer",label,"").c_str() , ibooker );
1028  }
1029 
1030 
1031  LayerMEsMap[label]=layerMEs;
1032 }
1033 //
1034 // -- Create SubDetector MEs
1035 //
1037 
1038  SubDetMEs subdetMEs;
1039  subdetMEs.totNClusters = 0;
1040  subdetMEs.SubDetTotClusterTH1 = 0;
1041  subdetMEs.SubDetTotClusterProf = 0;
1042  subdetMEs.SubDetClusterApvProf = 0;
1043  subdetMEs.SubDetClusterApvTH2 = 0;
1044  subdetMEs.SubDetClusterDBxCycleProf = 0;
1045  subdetMEs.SubDetApvDBxProf2 = 0;
1046  subdetMEs.SubDetClusterChargeTH1 = 0;
1047  subdetMEs.SubDetClusterWidthTH1 = 0;
1048  subdetMEs.SubDetClusWidthVsAmpTH2 = 0;
1049 
1051  // cluster charge
1053  HistoName = "ClusterCharge__" + label;
1054  subdetMEs.SubDetClusterChargeTH1 = bookME1D("TH1ClusterCharge",HistoName.c_str() , ibooker);
1055  subdetMEs.SubDetClusterChargeTH1->setAxisTitle("Cluster charge [ADC counts]");
1056  subdetMEs.SubDetClusterChargeTH1->getTH1()->StatOverflows(kTRUE); // over/underflows in Mean calculation
1057  }
1058  // cluster width
1060  HistoName = "ClusterWidth__" + label;
1061  subdetMEs.SubDetClusterWidthTH1 = bookME1D("TH1ClusterWidth",HistoName.c_str() , ibooker);
1062  subdetMEs.SubDetClusterWidthTH1->setAxisTitle("Cluster width [strips]");
1063  subdetMEs.SubDetClusterWidthTH1->getTH1()->StatOverflows(kTRUE); // over/underflows in Mean calculation
1064  }
1065  // Total Number of Cluster - 1D
1067  HistoName = "TotalNumberOfCluster__" + label;
1068  subdetMEs.SubDetTotClusterTH1 = bookME1D("TH1TotalNumberOfClusters",HistoName.c_str() , ibooker);
1069  subdetMEs.SubDetTotClusterTH1->setAxisTitle("Total number of clusters in subdetector");
1070  subdetMEs.SubDetTotClusterTH1->getTH1()->StatOverflows(kTRUE); // over/underflows in Mean calculation
1071  }
1072  // Total Number of Cluster vs Time - Profile
1075  HistoName = "TotalNumberOfClusterProfile__" + label;
1076  subdetMEs.SubDetTotClusterProf = ibooker.bookProfile(HistoName,HistoName,
1077  Parameters.getParameter<int32_t>("Nbins"),
1078  Parameters.getParameter<double>("xmin"),
1079  Parameters.getParameter<double>("xmax"),
1080  0 , 0 , "" );
1081  subdetMEs.SubDetTotClusterProf->setAxisTitle(Parameters.getParameter<std::string>("xaxis"),1);
1082  if (subdetMEs.SubDetTotClusterProf->kind() == MonitorElement::DQM_KIND_TPROFILE) subdetMEs.SubDetTotClusterProf->getTH1()->SetCanExtend(TH1::kAllAxes);
1083  }
1084 
1085  // Total Number of Cluster vs APV cycle - Profile
1087  edm::ParameterSet Parameters = conf_.getParameter<edm::ParameterSet>("TProfClustersApvCycle");
1088  HistoName = "Cluster_vs_ApvCycle__" + label;
1089  subdetMEs.SubDetClusterApvProf=ibooker.bookProfile(HistoName,HistoName,
1090  Parameters.getParameter<int32_t>("Nbins"),
1091  Parameters.getParameter<double>("xmin"),
1092  Parameters.getParameter<double>("xmax"),
1093  200, //that parameter should not be there !?
1094  Parameters.getParameter<double>("ymin"),
1095  Parameters.getParameter<double>("ymax"),
1096  "" );
1097  subdetMEs.SubDetClusterApvProf->setAxisTitle("Apv Cycle (Corrected Absolute Bx % 70)",1);
1098  }
1099 
1100  // Total Number of Clusters vs ApvCycle - 2D
1103  HistoName = "Cluster_vs_ApvCycle_2D__" + label;
1104  // Adjusting the scale for 2D histogram
1105  double h2ymax = 9999.0;
1106  double yfact = Parameters.getParameter<double>("yfactor");
1107  if(label.find("TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
1108  else if (label.find("TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
1109  else if (label.find("TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
1110  else if (label.find("TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1111 
1112  subdetMEs.SubDetClusterApvTH2=ibooker.book2D(HistoName,HistoName,
1113  Parameters.getParameter<int32_t>("Nbinsx"),
1114  Parameters.getParameter<double>("xmin"),
1115  Parameters.getParameter<double>("xmax"),
1116  Parameters.getParameter<int32_t>("Nbinsy"),
1117  Parameters.getParameter<double>("ymin"),
1118  h2ymax);
1119  subdetMEs.SubDetClusterApvTH2->setAxisTitle("Apv Cycle (Corrected Absolute Bx % 70))",1);
1120  subdetMEs.SubDetClusterApvTH2->setAxisTitle("Total # of Clusters",2);
1121 
1122  }
1123 
1124  // Cluster widths vs amplitudes - 2D
1127  HistoName = "ClusterWidths_vs_Amplitudes__" + label;
1128  subdetMEs.SubDetClusWidthVsAmpTH2=ibooker.book2D(HistoName,HistoName,
1129  Parameters.getParameter<int32_t>("Nbinsx"),
1130  Parameters.getParameter<double>("xmin"),
1131  Parameters.getParameter<double>("xmax"),
1132  Parameters.getParameter<int32_t>("Nbinsy"),
1133  Parameters.getParameter<double>("ymin"),
1134  Parameters.getParameter<double>("ymax"));
1135  subdetMEs.SubDetClusWidthVsAmpTH2->setAxisTitle("Amplitudes (integrated ADC counts)",1);
1136  subdetMEs.SubDetClusWidthVsAmpTH2->setAxisTitle("Cluster widths",2);
1137 
1138  }
1139 
1140 
1141 
1142  // Total Number of Cluster vs DeltaBxCycle - Profile
1144  edm::ParameterSet Parameters = conf_.getParameter<edm::ParameterSet>("TProfClustersVsDBxCycle");
1145  HistoName = "Cluster_vs_DeltaBxCycle__" + label;
1146  subdetMEs.SubDetClusterDBxCycleProf = ibooker.bookProfile(HistoName,HistoName,
1147  Parameters.getParameter<int32_t>("Nbins"),
1148  Parameters.getParameter<double>("xmin"),
1149  Parameters.getParameter<double>("xmax"),
1150  200, //that parameter should not be there !?
1151  Parameters.getParameter<double>("ymin"),
1152  Parameters.getParameter<double>("ymax"),
1153  "" );
1154  subdetMEs.SubDetClusterDBxCycleProf->setAxisTitle("Delta Bunch Crossing Cycle",1);
1155  }
1156  // DeltaBx vs ApvCycle - 2DProfile
1159  HistoName = "DeltaBx_vs_ApvCycle__" + label;
1160  subdetMEs.SubDetApvDBxProf2 = ibooker.bookProfile2D(HistoName,HistoName,
1161  Parameters.getParameter<int32_t>("Nbinsx"),
1162  Parameters.getParameter<double>("xmin"),
1163  Parameters.getParameter<double>("xmax"),
1164  Parameters.getParameter<int32_t>("Nbinsy"),
1165  Parameters.getParameter<double>("ymin"),
1166  Parameters.getParameter<double>("ymax"),
1167  Parameters.getParameter<double>("zmin"),
1168  Parameters.getParameter<double>("zmax"),
1169  "" );
1170  subdetMEs.SubDetApvDBxProf2->setAxisTitle("APV Cycle (Corrected Absolute Bx % 70)",1);
1171  subdetMEs.SubDetApvDBxProf2->setAxisTitle("Delta Bunch Crossing Cycle",2);
1172  }
1173  SubDetMEsMap[label]=subdetMEs;
1174 }
1175 
1176 //
1177 // -- Fill Module Level Histograms
1178 //
1180 
1181  if(moduleswitchclusposon && (mod_mes.ClusterPosition)) // position of cluster
1182  (mod_mes.ClusterPosition)->Fill(cluster.position);
1183 
1184  // position of digis in cluster
1186  for(int ipos=cluster.start+1; ipos<=cluster.start+cluster.width; ipos++){
1187  (mod_mes.ClusterDigiPosition)->Fill(ipos);
1188  }
1189  }
1190 
1191  if(moduleswitchcluswidthon && (mod_mes.ClusterWidth)) // width of cluster
1192  (mod_mes.ClusterWidth)->Fill(static_cast<float>(cluster.width));
1193 
1194  if(moduleswitchclusstonon && (mod_mes.ClusterSignalOverNoise)) {// SignalToNoise
1195  if (cluster.noise > 0)
1196  (mod_mes.ClusterSignalOverNoise)->Fill(cluster.charge/cluster.noise);
1197  }
1198 
1199  if(moduleswitchclusstonVsposon && (mod_mes.ClusterSignalOverNoiseVsPos)) {// SignalToNoise
1200  if (cluster.noise > 0)
1201  (mod_mes.ClusterSignalOverNoiseVsPos)->Fill(cluster.position,cluster.charge/cluster.noise);
1202  }
1203 
1204  if(moduleswitchclusnoiseon && (mod_mes.ClusterNoise)) // Noise
1205  (mod_mes.ClusterNoise)->Fill(cluster.noise);
1206 
1207  if(moduleswitchcluschargeon && (mod_mes.ClusterCharge)) // charge of cluster
1208  (mod_mes.ClusterCharge)->Fill(cluster.charge);
1209 
1211 }
1212 //
1213 // -- Fill Layer Level MEs
1214 //
1216 
1217  if(layerswitchclusstonon) {
1218  fillME(layerMEs.LayerClusterStoN ,cluster.charge/cluster.noise);
1219  if (createTrendMEs) {
1220  fillME(layerMEs.LayerClusterStoNTrend,trendVar,cluster.charge/cluster.noise);
1221  }
1222  }
1223 
1225  fillME(layerMEs.LayerClusterCharge,cluster.charge);
1226  if (createTrendMEs) {
1227  fillME(layerMEs.LayerClusterChargeTrend,trendVar,cluster.charge);
1228  }
1229  }
1230 
1232  fillME(layerMEs.LayerClusterNoise ,cluster.noise);
1233  if (createTrendMEs) {
1234  fillME(layerMEs.LayerClusterNoiseTrend,trendVar,cluster.noise);
1235  }
1236  }
1237 
1239  fillME(layerMEs.LayerClusterWidth ,cluster.width);
1240  if (createTrendMEs) {
1241  fillME(layerMEs.LayerClusterWidthTrend,trendVar,cluster.width);
1242  }
1243  }
1244 
1246  fillME(layerMEs.LayerClusWidthVsAmpTH2, cluster.charge, cluster.width);
1247  }
1248 }
1249 //------------------------------------------------------------------------------------------
1251 {
1252  edm::ParameterSet ParametersTrend = trendVsLs_ ? conf_.getParameter<edm::ParameterSet>("TrendingLS") : conf_.getParameter<edm::ParameterSet>("Trending");
1253  MonitorElement* me = ibooker.bookProfile(HistoName,HistoName,
1254  ParametersTrend.getParameter<int32_t>("Nbins"),
1255  ParametersTrend.getParameter<double>("xmin"),
1256  ParametersTrend.getParameter<double>("xmax"),
1257  0 , 0 , "" );
1258  if(!me) return me;
1259  me->setAxisTitle(ParametersTrend.getParameter<std::string>("xaxis"),1);
1260  if (me->kind() == MonitorElement::DQM_KIND_TPROFILE) me->getTH1()->SetCanExtend(TH1::kAllAxes);
1261  return me;
1262 }
1263 
1264 //------------------------------------------------------------------------------------------
1265 MonitorElement* SiStripMonitorCluster::bookME1D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker)
1266 {
1267  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
1268  return ibooker.book1D(HistoName,HistoName,
1269  Parameters.getParameter<int32_t>("Nbinx"),
1270  Parameters.getParameter<double>("xmin"),
1271  Parameters.getParameter<double>("xmax")
1272  );
1273 }
1274 
1275 //------------------------------------------------------------------------------------------
1276 MonitorElement* SiStripMonitorCluster::bookME2D(const char* ParameterSetLabel, const char* HistoName , DQMStore::IBooker & ibooker)
1277 {
1278  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
1279  return ibooker.book2D(HistoName,HistoName,
1280  Parameters.getParameter<int32_t>("Nbinsx"),
1281  Parameters.getParameter<double>("xmin"),
1282  Parameters.getParameter<double>("xmax"),
1283  Parameters.getParameter<int32_t>("Nbinsy"),
1284  Parameters.getParameter<double>("ymin"),
1285  Parameters.getParameter<double>("ymax")
1286  );
1287 }
1288 
1289 
1290 int SiStripMonitorCluster::FindRegion(int nstrip,int npix){
1291 
1292  double kplus= k0*(1+dk0/100);
1293  double kminus=k0*(1-dk0/100);
1294  int region=0;
1295 
1296  if (nstrip!=0 && npix >= (nstrip*kminus-q0) && npix <=(nstrip*kplus+q0)) region=1;
1297  else if (nstrip!=0 && npix < (nstrip*kminus-q0) && nstrip <= maxClus) region=2;
1298  else if (nstrip!=0 && npix < (nstrip*kminus-q0) && nstrip > maxClus) region=3;
1299  else if (nstrip!=0 && npix > (nstrip*kplus+q0)) region=4;
1300  else if (npix > minPix && nstrip==0) region=5;
1301  return region;
1302 
1303 }
RunNumber_t run() const
Definition: EventID.h:39
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * bookME1D(const char *ParameterSetLabel, const char *HistoName, DQMStore::IBooker &ibooker)
int FindRegion(int nstrip, int npixel)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void setSiStripFolderName(std::string name)
MonitorElement * PixVsStripMultiplicityRegions
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
MonitorElement * GlobalCStripVsCpix
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)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
#define NULL
Definition: scimark2.h:8
MonitorElement * ClusterSignalOverNoiseVsPos
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * StripNoise2Cycle
data_type const * const_iterator
Definition: DetSetNew.h:30
void createLayerMEs(std::string label, int ndets, DQMStore::IBooker &ibooker)
std::map< std::string, LayerMEs > LayerMEsMap
bool isRealData() const
Definition: EventBase.h:63
std::map< std::string, std::vector< uint32_t > > LayerDetMap
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void Fill(long long x)
MonitorElement * NumberOfPixelClus
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
unsigned long long m_cacheID_
void createSubDetMEs(std::string label, DQMStore::IBooker &ibooker)
std::map< uint32_t, ModMEs > ModuleMEsMap
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
int iEvent
Definition: GenABIO.cc:230
void createMEs(const edm::EventSetup &es, DQMStore::IBooker &ibooker)
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * GlobalApvCycleDBxTH2
vector< ParameterSet > Parameters
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
GenericTriggerEventFlag * genTriggerEventFlagPixelDCSfilter_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:18
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.
data_type const * data(size_t cell) const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:285
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< ContainerIterator, ContainerIterator > Range
MonitorElement * bookMETrend(const char *, DQMStore::IBooker &ibooker)
TH1 * getTH1(void) const
int orbitNumber() const
Definition: EventBase.h:66
MonitorElement * NumberOfStripClus
Kind kind(void) const
Get the type of the monitor element.
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * ClusWidthVsAmpTH2
MonitorElement * GlobalMainDiagonalPosition
MonitorElement * bookME2D(const char *ParameterSetLabel, const char *HistoName, DQMStore::IBooker &ibooker)
SiStripDCSStatus * dcsStatus_
bool failedToGet() const
Definition: HandleBase.h:79
GenericTriggerEventFlag * genTriggerEventFlagBPTXfilter_
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
void fillME(MonitorElement *ME, float value1)
SiStripMonitorCluster(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::string HistoName
MonitorElement * StripNoise3Cycle
void createModuleMEs(ModMEs &mod_single, uint32_t detid, DQMStore::IBooker &ibooker)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0) const
edm::EventID id() const
Definition: EventBase.h:59
iterator end()
Definition: DetSetNew.h:70
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clusterProducerPixToken_
std::map< std::string, SubDetMEs > SubDetMEsMap
void fillLayerMEs(LayerMEs &, ClusterProperties &cluster)
std::pair< ContainerIterator, ContainerIterator > Range
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterProducerStripToken_
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
volatile std::atomic< bool > shutdown_flag false
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:48
size_type size() const
Definition: DetSetNew.h:87
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
GenericTriggerEventFlag * genTriggerEventFlagStripDCSfilter_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * NclusVsCycleTimeProf2D
void fillModuleMEs(ModMEs &mod_mes, ClusterProperties &cluster)
Definition: Run.h:43
int size() const
iterator begin()
Definition: DetSetNew.h:67