CMS 3D CMS Logo

SiPixelClusterSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelMonitorCluster
4 // Class: SiPixelClusterSource
5 //
13 //
14 // Original Author: Vincenzo Chiochia & Andrew York
15 // Created:
16 //
17 //
18 // Updated by: Lukas Wehrli
19 // for pixel offline DQM
21 // Framework
24 // DQM Framework
27 // Geometry
33 // DataFormats
41 //
42 #include <string>
43 #include <stdlib.h>
44 
45 using namespace std;
46 using namespace edm;
47 
49  conf_(iConfig),
50  src_( conf_.getParameter<edm::InputTag>( "src" ) ),
51  digisrc_( conf_.getParameter<edm::InputTag>( "digisrc" ) ),
52  saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
53  isPIB( conf_.getUntrackedParameter<bool>("isPIB",false) ),
54  slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
55  modOn( conf_.getUntrackedParameter<bool>("modOn",true) ),
56  twoDimOn( conf_.getUntrackedParameter<bool>("twoDimOn",true) ),
57  reducedSet( conf_.getUntrackedParameter<bool>("reducedSet",false) ),
58  ladOn( conf_.getUntrackedParameter<bool>("ladOn",false) ),
59  layOn( conf_.getUntrackedParameter<bool>("layOn",false) ),
60  phiOn( conf_.getUntrackedParameter<bool>("phiOn",false) ),
61  ringOn( conf_.getUntrackedParameter<bool>("ringOn",false) ),
62  bladeOn( conf_.getUntrackedParameter<bool>("bladeOn",false) ),
63  diskOn( conf_.getUntrackedParameter<bool>("diskOn",false) ),
64  smileyOn(conf_.getUntrackedParameter<bool>("smileyOn",false) ),
65  bigEventSize( conf_.getUntrackedParameter<int>("bigEventSize",100) ),
66  isUpgrade( conf_.getUntrackedParameter<bool>("isUpgrade",false) ),
67  noOfLayers(0),
68  noOfDisks(0)
69 {
70  LogInfo ("PixelDQM") << "SiPixelClusterSource::SiPixelClusterSource: Got DQM BackEnd interface"<<endl;
71 
72  //set Token(-s)
73  srcToken_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(conf_.getParameter<edm::InputTag>("src"));
74  digisrcToken_ = consumes<edm::DetSetVector<PixelDigi> >(conf_.getParameter<edm::InputTag>("digisrc"));
75  firstRun = true;
76  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
77 }
78 
79 
81 {
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84  LogInfo ("PixelDQM") << "SiPixelClusterSource::~SiPixelClusterSource: Destructor"<<endl;
85 
86  std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
87  for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++){
88  delete struct_iter->second;
89  struct_iter->second = 0;
90  }
91 }
92 
93 
94 
96  LogInfo ("PixelDQM") << " SiPixelClusterSource::beginJob - Initialisation ... " << std::endl;
97  LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/"
98  << layOn << "/" << phiOn << std::endl;
99  LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/"
100  << ringOn << std::endl;
101  LogInfo ("PixelDQM") << "2DIM IS " << twoDimOn << "\n";
102  LogInfo ("PixelDQM") << "Smiley (Cluster sizeY vs. Cluster eta) is " << smileyOn << "\n";
103 
104  if(firstRun){
105  eventNo = 0;
106  lumSec = 0;
107  nLumiSecs = 0;
108  nBigEvents = 0;
109  // Build map
110  buildStructure(iSetup);
111 
112  firstRun = false;
113  }
114 }
115 
117  bookMEs(iBooker, iSetup);
118  // Book occupancy maps in global coordinates for all clusters:
119  iBooker.setCurrentFolder(topFolderName_+"/Clusters/OffTrack");
120  //bpix
121  std::stringstream ss1, ss2;
122  for (int i = 1; i <= noOfLayers; i++)
123  {
124  ss1.str(std::string()); ss1 << "position_siPixelClusters_Layer_" << i;
125  ss2.str(std::string()); ss2 << "Clusters Layer" << i << ";Global Z (cm);Global #phi";
126  meClPosLayer.push_back(iBooker.book2D(ss1.str(),ss2.str(),200,-30.,30.,128,-3.2,3.2));
127  }
128  for (int i = 1; i <= noOfDisks; i++)
129  {
130  ss1.str(std::string()); ss1 << "position_siPixelClusters_pz_Disk_" << i;
131  ss2.str(std::string()); ss2 << "Clusters +Z Disk" << i << ";Global X (cm);Global Y (cm)";
132  meClPosDiskpz.push_back(iBooker.book2D(ss1.str(),ss2.str(),80,-20.,20.,80,-20.,20.));
133  ss1.str(std::string()); ss1 << "position_siPixelClusters_mz_Disk_" << i;
134  ss2.str(std::string()); ss2 << "Clusters -Z Disk" << i << ";Global X (cm);Global Y (cm)";
135  meClPosDiskmz.push_back(iBooker.book2D(ss1.str(),ss2.str(),80,-20.,20.,80,-20.,20.));
136  }
137 
138  //Book trend cluster plots for barrel and endcap. Lumisections for offline and second for online - taken from strips
139  iBooker.setCurrentFolder(topFolderName_+"/Barrel");
140  ss1.str(std::string()); ss1 << "totalNumberOfClustersProfile_siPixelClusters_Barrel";
141  ss2.str(std::string()); ss2 << "Total number of barrel clusters profile;Lumisection;";
142  meClusBarrelProf = iBooker.bookProfile(ss1.str(),ss2.str(),2400,0.,150,0,0,"");
143  meClusBarrelProf->getTH1()->SetCanExtend(TH1::kAllAxes);
144 
145  iBooker.setCurrentFolder(topFolderName_+"/Endcap");
146 
147  ss1.str(std::string()); ss1 << "totalNumberOfClustersProfile_siPixelClusters_FPIX+";
148  ss2.str(std::string()); ss2 << "Total number of FPIX+ clusters profile;Lumisection;";
149  meClusFpixPProf = iBooker.bookProfile(ss1.str(),ss2.str(),2400,0.,150,0,0,"");
150  meClusFpixPProf->getTH1()->SetCanExtend(TH1::kAllAxes);
151 
152  ss1.str(std::string()); ss1 << "totalNumberOfClustersProfile_siPixelClusters_FPIX-";
153  ss2.str(std::string()); ss2 << "Total number of FPIX- clusters profile;Lumisection;";
154  meClusFpixMProf = iBooker.bookProfile(ss1.str(),ss2.str(),2400,0.,150,0,0,"");
155  meClusFpixMProf->getTH1()->SetCanExtend(TH1::kAllAxes);
156 
157  iBooker.setCurrentFolder(topFolderName_+"/Barrel");
158  for (int i = 1; i <= noOfLayers; i++) {
159  int ybins = -1; float ymin = 0.; float ymax = 0.;
160  if (i==1) { ybins = 42; ymin = -10.5; ymax = 10.5; }
161  if (i==2) { ybins = 66; ymin = -16.5; ymax = 16.5; }
162  if (i==3) { ybins = 90; ymin = -22.5; ymax = 22.5; }
163  ss1.str(std::string()); ss1 << "pix_bar Occ_roc_online_" + digisrc_. label() + "_layer_" << i;
164  ss2.str(std::string()); ss2 << "Pixel Barrel Occupancy, ROC level (Online): Layer " << i;
165  meZeroRocBPIX.push_back(iBooker.book2D(ss1.str(),ss2.str(),72,-4.5,4.5,ybins,ymin,ymax));
166  meZeroRocBPIX.at(i-1)->setAxisTitle("ROC / Module",1);
167  meZeroRocBPIX.at(i-1)->setAxisTitle("ROC / Ladder",2);
168  }
169 
170  iBooker.setCurrentFolder(topFolderName_+"/Endcap");
171  meZeroRocFPIX = iBooker.book2D("ROC_endcap_occupancy","Pixel Endcap Occupancy, ROC level (Online)",72, -4.5, 4.5,288,-12.5,12.5);
172  meZeroRocFPIX->setBinLabel(1, "Disk-2 Pnl2",1);
173  meZeroRocFPIX->setBinLabel(9, "Disk-2 Pnl1",1);
174  meZeroRocFPIX->setBinLabel(19, "Disk-1 Pnl2",1);
175  meZeroRocFPIX->setBinLabel(27, "Disk-1 Pnl1",1);
176  meZeroRocFPIX->setBinLabel(41, "Disk+1 Pnl1",1);
177  meZeroRocFPIX->setBinLabel(49, "Disk+1 Pnl2",1);
178  meZeroRocFPIX->setBinLabel(59, "Disk+2 Pnl1",1);
179  meZeroRocFPIX->setBinLabel(67, "Disk+2 Pnl2",1);
180  meZeroRocFPIX->setAxisTitle("Blades in Inner (>0) / Outer(<) Halves",2);
181  meZeroRocFPIX->setAxisTitle("ROC occupancy",3);
182 
183 }
184 
185 //------------------------------------------------------------------
186 // Method called for every event
187 //------------------------------------------------------------------
189 {
190  eventNo++;
191 
192  if(meClPosLayer.at(0) && meClPosLayer.at(0)->getEntries()>150000){
193  for (int i = 0; i < noOfLayers; i++)
194  {
195  meClPosLayer.at(i)->Reset();
196  }
197  for (int i = 0; i < noOfDisks; i++)
198  {
199  meClPosDiskpz.at(i)->Reset();
200  meClPosDiskmz.at(i)->Reset();
201  }
202  }
203 
204  // get input data
206  iEvent.getByToken(srcToken_, input);
207  auto const & clustColl = *(input.product());
208 
210  iSetup.get<TrackerDigiGeometryRecord> ().get (pDD);
211  const TrackerGeometry* tracker = &(* pDD);
212 
214  iEvent.getByToken( digisrcToken_, digiinput );
215  const edm::DetSetVector<PixelDigi> diginp = *(digiinput.product());
216 
217  edm::ESHandle<TrackerTopology> tTopoHandle;
218  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
219  const TrackerTopology *pTT = tTopoHandle.product();
220 
221 
222  int lumiSection = (int)iEvent.luminosityBlock();
223  int nEventFpixClusters = 0;
224 
225  int nEventsBarrel = 0;
226  int nEventsFPIXm = 0;
227  int nEventsFPIXp = 0;
228 
229 
230  std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
231  for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {
232 
233  int numberOfFpixClusters = (*struct_iter).second->fill(*input, tracker,
234  &nEventsBarrel, &nEventsFPIXp, &nEventsFPIXm,
235  meClPosLayer,
238  modOn, ladOn, layOn, phiOn,
239  bladeOn, diskOn, ringOn,
241  nEventFpixClusters = nEventFpixClusters + numberOfFpixClusters;
242 
243  }
244 
245  if(nEventFpixClusters>bigEventSize){
247  bigFpixClusterEventRate->Fill(lumiSection,1./23.);
248  }
249  }
250 
251  float trendVar = iEvent.orbitNumber()/262144.0; //lumisection : seconds - matches strip trend plot
252 
253  meClusBarrelProf->Fill(trendVar,nEventsBarrel);
254  meClusFpixPProf->Fill(trendVar,nEventsFPIXp);
255  meClusFpixMProf->Fill(trendVar,nEventsFPIXm);
256 
257  //std::cout<<"nEventFpixClusters: "<<nEventFpixClusters<<" , nLumiSecs: "<<nLumiSecs<<" , nBigEvents: "<<nBigEvents<<std::endl;
258 
259  for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
260 
261  DetId detId = (*it)->geographicalId();
262 
263  // fill barrel
264  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
265  getrococcupancy(detId,diginp,pTT,meZeroRocBPIX);
266  }
267 
268  // fill endcap
269  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
270  getrococcupancye(detId,clustColl,pTT,pDD,meZeroRocFPIX);
271  }
272 
273  }
274 
275  // slow down...
276  if(slowDown) usleep(10000);
277 
278 }
279 
280 //------------------------------------------------------------------
281 // Build data structure
282 //------------------------------------------------------------------
284 
285  LogInfo ("PixelDQM") <<" SiPixelClusterSource::buildStructure" ;
287  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
288 
289  edm::ESHandle<TrackerTopology> tTopoHandle;
290  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
291  const TrackerTopology *pTT = tTopoHandle.product();
292 
293  LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
294  LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl;
295  LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl;
296 
297  for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
298 
299  if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
300 
301  DetId detId = (*it)->geographicalId();
302  const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
303  const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
304  int nrows = (pixDet->specificTopology()).nrows();
305  int ncols = (pixDet->specificTopology()).ncolumns();
306 
307 
308  if((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) ||
309  (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap))){
310  uint32_t id = detId();
311  SiPixelClusterModule* theModule = new SiPixelClusterModule(id, ncols, nrows);
312  if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
313  if(isPIB) continue;
314  LogDebug ("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
315  int layer = PixelBarrelName(DetId(id),pTT,isUpgrade).layerName();
316  if (layer > noOfLayers) noOfLayers = layer;
317  thePixelStructure.insert(pair<uint32_t,SiPixelClusterModule*> (id,theModule));
318  }else if ( detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap ) ) {
319  LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
321  int disk = PixelEndcapName(DetId(id),pTT,isUpgrade).diskName();
322  if (disk>noOfDisks) noOfDisks=disk;
323  int blade = PixelEndcapName(DetId(id),pTT,isUpgrade).bladeName();
324  int panel = PixelEndcapName(DetId(id),pTT,isUpgrade).pannelName();
326  char sside[80]; sprintf(sside, "HalfCylinder_%i",side);
327  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
328  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
329  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
330  char smodule[80];sprintf(smodule,"Module_%i",module);
331  std::string side_str = sside;
332  std::string disk_str = sdisk;
333  bool mask = side_str.find("HalfCylinder_1")!=string::npos||
334  side_str.find("HalfCylinder_2")!=string::npos||
335  side_str.find("HalfCylinder_4")!=string::npos||
336  disk_str.find("Disk_2")!=string::npos;
337  // clutch to take all of FPIX, but no BPIX:
338  mask = false;
339  if(isPIB && mask) continue;
340  thePixelStructure.insert(pair<uint32_t,SiPixelClusterModule*> (id,theModule));
341  }
342  }
343  }
344  }
345  LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
346 }
347 //------------------------------------------------------------------
348 // Book MEs
349 //------------------------------------------------------------------
351 
352  // Get DQM interface
354  char title[256]; snprintf(title, 256, "Rate of events with >%i FPIX clusters;LumiSection;Rate of large FPIX events per LS [Hz]",bigEventSize);
355  bigFpixClusterEventRate = iBooker.book1D("bigFpixClusterEventRate",title,5000,0.,5000.);
356 
357 
358  std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
359 
360  SiPixelFolderOrganizer theSiPixelFolder(false);
361 
362  for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
363 
365  if(modOn){
366  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,0,isUpgrade)){
367  (*struct_iter).second->book( conf_,iSetup,iBooker,0,twoDimOn,reducedSet,isUpgrade);
368  } else {
369 
370  if(!isPIB) throw cms::Exception("LogicError")
371  << "[SiPixelClusterSource::bookMEs] Creation of DQM folder failed";
372  }
373  }
374  if(ladOn){
375  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,1,isUpgrade)){
376  (*struct_iter).second->book( conf_,iSetup,iBooker,1,twoDimOn,reducedSet,isUpgrade);
377  } else {
378  LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
379  }
380  }
381  if(layOn){
382  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,2,isUpgrade)){
383  (*struct_iter).second->book( conf_,iSetup,iBooker,2,twoDimOn,reducedSet,isUpgrade);
384  } else {
385  LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
386  }
387  }
388  if(phiOn){
389  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,3,isUpgrade)){
390  (*struct_iter).second->book( conf_,iSetup,iBooker,3,twoDimOn,reducedSet,isUpgrade);
391  } else {
392  LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
393  }
394  }
395  if(bladeOn){
396  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,4,isUpgrade)){
397  (*struct_iter).second->book( conf_,iSetup,iBooker,4,twoDimOn,reducedSet,isUpgrade);
398  } else {
399  LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
400  }
401  }
402  if(diskOn){
403  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,5,isUpgrade)){
404  (*struct_iter).second->book( conf_,iSetup,iBooker,5,twoDimOn,reducedSet,isUpgrade);
405  } else {
406  LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
407  }
408  }
409  if(ringOn){
410  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,6,isUpgrade)){
411  (*struct_iter).second->book( conf_,iSetup,iBooker,6,twoDimOn,reducedSet,isUpgrade);
412  } else {
413  LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
414  }
415  }
416  if(smileyOn){
417  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,7,isUpgrade)){
418  (*struct_iter).second->book( conf_,iSetup,iBooker,7,twoDimOn,reducedSet,isUpgrade);
419  } else {
420  LogDebug ("PixelDQM") << "PROBLEM WITH BARREL-FOLDER\n";
421  }
422  }
423 
424  }
425 
426 }
427 
429  std::vector<MonitorElement*> const & meinput) {
430 
431  edm::DetSetVector<PixelDigi>::const_iterator ipxsearch = diginp.find(detId);
432  if( ipxsearch != diginp.end() ) {
433 
434  // Look at digis now
436  for (pxdi = ipxsearch->begin(); pxdi != ipxsearch->end(); pxdi++) {
437 
438  bool isHalfModule = PixelBarrelName(DetId(detId),tTopo,isUpgrade).isHalfModule();
439  int DBlayer = PixelBarrelName(DetId(detId),tTopo,isUpgrade).layerName();
440  int DBmodule = PixelBarrelName(DetId(detId),tTopo,isUpgrade).moduleName();
441  int DBladder = PixelBarrelName(DetId(detId),tTopo,isUpgrade).ladderName();
442  int DBshell = PixelBarrelName(DetId(detId),tTopo,isUpgrade).shell();
443 
444  // add sign to the modules
445  if (DBshell==1 || DBshell==2) { DBmodule = -DBmodule; }
446  if (DBshell==1 || DBshell==3) { DBladder = -DBladder; }
447 
448  int col = pxdi->column();
449  int row = pxdi->row();
450 
451  float modsign = (float)DBmodule/(abs((float)DBmodule));
452  float ladsign = (float)DBladder/(abs((float)DBladder));
453  float rocx = ((float)col/(52.*8.))*modsign + ((float)DBmodule-(modsign)*0.5);
454  float rocy = ((float)row/(80.*2.))*ladsign + ((float)DBladder-(ladsign)*0.5);
455 
456  // do the flip where need
457  bool flip = false;
458  if ( (DBladder%2==0) && (!isHalfModule) ) { flip = true; }
459  if ((flip) && (DBladder>0)) {
460  if ( ( ((float)DBladder-(ladsign)*0.5)<=rocy) && (rocy<(float)DBladder)) { rocy = rocy + ladsign*0.5; }
461  else if ( ( ((float)DBladder)<=rocy) && (rocy<((float)DBladder+(ladsign)*0.5)) ) { rocy = rocy - ladsign*0.5; }
462  }
463 
464  // tweak border effect for negative modules/ladders
465  if (modsign<0) { rocx = rocx -0.0001; }
466  if (ladsign<0) { rocy = rocy -0.0001; } else { rocy = rocy +0.0001; }
467  if (abs(DBladder)==1) { rocy = rocy + ladsign*0.5; } //take care of the half module
468  meinput[DBlayer-1]->Fill(rocx,rocy);
469  } // end of looping over pxdi
470  }
471 }
472 
473 
475  const TrackerTopology* const pTT, edm::ESHandle<TrackerGeometry> pDD,MonitorElement* meinput) {
476 
477  edmNew::DetSetVector<SiPixelCluster>::const_iterator ipxsearch = clustColl.find(detId);
478  if( ipxsearch != clustColl.end() ) {
479 
480  // Look at clusters now
482  for (pxclust = ipxsearch->begin(); pxclust != ipxsearch->end(); pxclust++) {
483 
484  const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
485  const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
486  const PixelTopology * topol = &(pixDet->specificTopology());
487  LocalPoint clustlp = topol->localPosition( MeasurementPoint(pxclust->x(),pxclust->y()) );
488  GlobalPoint clustgp = geoUnit->surface().toGlobal( clustlp );
489 
490  float xclust = pxclust->x();
491  float yclust = pxclust->y();
492  float z = clustgp.z();
493 
494  int pxfside = PixelEndcapName(detId,pTT,isUpgrade).halfCylinder();
495  int pxfpanel = PixelEndcapName(detId,pTT,isUpgrade).pannelName();
496  int pxfmodule = PixelEndcapName(detId,pTT,isUpgrade).plaquetteName();
497  int pxfdisk = PixelEndcapName(detId,pTT,isUpgrade).diskName();
498  int pxfblade = PixelEndcapName(detId,pTT,isUpgrade).bladeName();
499 
500  if ( (pxfside==1) || (pxfside==3) ) { pxfblade = -1.*pxfblade; }
501 
502  if (z<0.) { pxfdisk = -1.*pxfdisk; }
503 
504  int clu_sdpx = ((pxfdisk>0) ? 1 : -1) * (2 * (abs(pxfdisk) - 1) + pxfpanel);
505  int binselx = (pxfpanel==1&&(pxfmodule==1||pxfmodule==4)) ? (pxfmodule==1) : ((pxfpanel==1&& xclust<80.0)||(pxfpanel==2&&xclust>=80.0));
506  int nperpan = 2 * pxfmodule + pxfpanel - 1 + binselx;
507  int clu_roc_binx = ((pxfdisk>0) ? nperpan : 9 - nperpan) + (clu_sdpx + 4) * 8 - 2 * ((abs(pxfdisk)==1) ? pxfdisk : 0);
508 
509  int clu_roc_biny = -99.;
510  int nrocly = pxfmodule + pxfpanel;
511  for (int i=0; i<nrocly; i++) {
512  int j = (pxfdisk<0) ? i : nrocly - 1 - i;
513  if (yclust>=(j*52.0)&& yclust<((j+1)*52.0))
514  clu_roc_biny = 6 - nrocly + 2 * i + ((pxfblade>0) ? pxfblade-1 : pxfblade + 12)*12 + 1;
515  }
516  if (pxfblade>0) { clu_roc_biny = clu_roc_biny+144; }
517 
518  meinput->setBinContent(clu_roc_binx,clu_roc_biny, meinput->getBinContent(clu_roc_binx,clu_roc_biny)+1);
519  meinput->setBinContent(clu_roc_binx,clu_roc_biny+1, meinput->getBinContent(clu_roc_binx,clu_roc_biny+1)+1);
520 
521  }
522  }
523 
524 }
525 
526 
527 
528 //define this as a plug-in
#define LogDebug(id)
int plaquetteName() const
plaquetteId (in pannel)
virtual void buildStructure(edm::EventSetup const &)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void setBinContent(int binx, double content)
set content of bin (1-D)
const_iterator end(bool update=false) const
iterator find(det_id_type id)
Definition: DetSetVector.h:290
int moduleName() const
module id (index in z)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< MonitorElement * > meClPosDiskmz
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
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::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
void getrococcupancy(DetId detId, const edm::DetSetVector< PixelDigi > &diginp, const TrackerTopology *const tTopo, std::vector< MonitorElement * > const &meinput)
data_type const * const_iterator
Definition: DetSetNew.h:30
virtual void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > srcToken_
std::vector< MonitorElement * > meZeroRocBPIX
MonitorElement * meZeroRocFPIX
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
SiPixelClusterSource(const edm::ParameterSet &conf)
static std::string const input
Definition: EdmProvDump.cc:44
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int bladeName() const
blade id
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int iEvent
Definition: GenABIO.cc:230
std::vector< MonitorElement * > meClPosDiskpz
bool isHalfModule() const
full or half module
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.
T z() const
Definition: PV3DBase.h:64
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meClusBarrelProf
TH1 * getTH1(void) const
std::vector< MonitorElement * > meClPosLayer
int orbitNumber() const
Definition: EventBase.h:67
MonitorElement * meClusFpixMProf
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
edm::ParameterSet conf_
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void getrococcupancye(DetId detId, const edmNew::DetSetVector< SiPixelCluster > &clustColl, const TrackerTopology *const pTT, edm::ESHandle< TrackerGeometry > pDD, MonitorElement *meinput)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > digisrcToken_
const T & get() const
Definition: EventSetup.h:55
MonitorElement * meClusFpixPProf
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int layerName() const
layer id
Shell shell() const
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const_iterator find(id_type i, bool update=false) const
double getBinContent(int binx) const
get content of bin (1-D)
HLT enums.
int pannelName() const
pannel id
col
Definition: cuy.py:1008
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
int diskName() const
disk id
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
std::map< uint32_t, SiPixelClusterModule * > thePixelStructure
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
HalfCylinder halfCylinder() const
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:208
MonitorElement * bigFpixClusterEventRate
const_iterator begin(bool update=false) const
Definition: Run.h:42