00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "DQM/SiPixelMonitorCluster/interface/SiPixelClusterModule.h"
00022 #include "DQMServices/Core/interface/DQMStore.h"
00023 #include "DQM/SiPixelCommon/interface/SiPixelHistogramId.h"
00025 #include "FWCore/ServiceRegistry/interface/Service.h"
00026
00027 #include <vector>
00028 #include <memory>
00029 #include <string>
00030 #include <iostream>
00031 #include <stdlib.h>
00032
00033
00034 #include "DataFormats/SiPixelDetId/interface/PixelBarrelName.h"
00035 #include "DataFormats/SiPixelDetId/interface/PixelBarrelNameUpgrade.h"
00036 #include "DataFormats/SiPixelDetId/interface/PixelEndcapName.h"
00037 #include "DataFormats/SiPixelDetId/interface/PixelEndcapNameUpgrade.h"
00038 #include "DataFormats/DetId/interface/DetId.h"
00039 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00040
00041
00042
00043 SiPixelClusterModule::SiPixelClusterModule() : id_(0),
00044 ncols_(416),
00045 nrows_(160) { }
00047 SiPixelClusterModule::SiPixelClusterModule(const uint32_t& id) :
00048 id_(id),
00049 ncols_(416),
00050 nrows_(160)
00051 {
00052 }
00054 SiPixelClusterModule::SiPixelClusterModule(const uint32_t& id, const int& ncols, const int& nrows) :
00055 id_(id),
00056 ncols_(ncols),
00057 nrows_(nrows)
00058 {
00059 }
00060
00061
00062
00063 SiPixelClusterModule::~SiPixelClusterModule() {}
00064
00065
00066
00067 void SiPixelClusterModule::book(const edm::ParameterSet& iConfig, int type, bool twoD, bool reducedSet, bool isUpgrade) {
00068
00069 bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
00070 bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
00071 bool isHalfModule = false;
00072 if(barrel){
00073 if (!isUpgrade) {
00074 isHalfModule = PixelBarrelName(DetId(id_)).isHalfModule();
00075 } else if (isUpgrade) {
00076 isHalfModule = PixelBarrelNameUpgrade(DetId(id_)).isHalfModule();
00077 }
00078 }
00079 int nbinx = ncols_/2;
00080 int nbiny = nrows_/2;
00081
00082 std::string hid;
00083
00084 edm::InputTag src = iConfig.getParameter<edm::InputTag>( "src" );
00085
00086 DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00087 if(type==0){
00088 SiPixelHistogramId* theHistogramId = new SiPixelHistogramId( src.label() );
00089
00090 hid = theHistogramId->setHistoId("nclusters",id_);
00091 meNClusters_ = theDMBE->book1D(hid,"Number of Clusters",8,0.,8.);
00092 meNClusters_->setAxisTitle("Number of Clusters",1);
00093
00094 hid = theHistogramId->setHistoId("charge",id_);
00095 meCharge_ = theDMBE->book1D(hid,"Cluster charge",100,0.,200.);
00096 meCharge_->setAxisTitle("Charge [kilo electrons]",1);
00097
00098 hid = theHistogramId->setHistoId("size",id_);
00099 meSize_ = theDMBE->book1D(hid,"Total cluster size",30,0.,30.);
00100 meSize_->setAxisTitle("Cluster size [number of pixels]",1);
00101 if(!reducedSet){
00102
00103 hid = theHistogramId->setHistoId("minrow",id_);
00104 meMinRow_ = theDMBE->book1D(hid,"Lowest cluster row",200,0.,200.);
00105 meMinRow_->setAxisTitle("Lowest cluster row",1);
00106
00107 hid = theHistogramId->setHistoId("maxrow",id_);
00108 meMaxRow_ = theDMBE->book1D(hid,"Highest cluster row",200,0.,200.);
00109 meMaxRow_->setAxisTitle("Highest cluster row",1);
00110
00111 hid = theHistogramId->setHistoId("mincol",id_);
00112 meMinCol_ = theDMBE->book1D(hid,"Lowest cluster column",500,0.,500.);
00113 meMinCol_->setAxisTitle("Lowest cluster column",1);
00114
00115 hid = theHistogramId->setHistoId("maxcol",id_);
00116 meMaxCol_ = theDMBE->book1D(hid,"Highest cluster column",500,0.,500.);
00117 meMaxCol_->setAxisTitle("Highest cluster column",1);
00118
00119 hid = theHistogramId->setHistoId("x",id_);
00120 meX_ = theDMBE->book1D(hid,"Cluster barycenter X (row #)",200,0.,200.);
00121 meX_->setAxisTitle("Barycenter x-position [row #]",1);
00122
00123 hid = theHistogramId->setHistoId("y",id_);
00124 meY_ = theDMBE->book1D(hid,"Cluster barycenter Y (column #)",500,0.,500.);
00125 meY_->setAxisTitle("Barycenter y-position [column #]",1);
00126
00127 hid = theHistogramId->setHistoId("sizeX",id_);
00128 meSizeX_ = theDMBE->book1D(hid,"Cluster x-width (rows)",10,0.,10.);
00129 meSizeX_->setAxisTitle("Cluster x-size [rows]",1);
00130
00131 hid = theHistogramId->setHistoId("sizeY",id_);
00132 meSizeY_ = theDMBE->book1D(hid,"Cluster y-width (columns)",15,0.,15.);
00133 meSizeY_->setAxisTitle("Cluster y-size [columns]",1);
00134 int nbinx = ncols_/2;
00135 int nbiny = nrows_/2;
00136 hid = theHistogramId->setHistoId("hitmap",id_);
00137 if(twoD){
00138
00139 mePixClusters_ = theDMBE->book2D(hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
00140 mePixClusters_->setAxisTitle("Columns",1);
00141 mePixClusters_->setAxisTitle("Rows",2);
00142 }else{
00143
00144 mePixClusters_px_ = theDMBE->book1D(hid+"_px","Number of Clusters (1bin=two columns)",nbinx,0.,float(ncols_));
00145 mePixClusters_py_ = theDMBE->book1D(hid+"_py","Number of Clusters (1bin=two rows)",nbiny,0.,float(nrows_));
00146 mePixClusters_px_->setAxisTitle("Columns",1);
00147 mePixClusters_py_->setAxisTitle("Rows",1);
00148 }
00149 }
00150 delete theHistogramId;
00151 }
00152
00153
00154 if(barrel && type==7){
00155 hid = src.label() + "_Barrel";
00156 meSizeYvsEtaBarrel_= theDMBE->book2D("sizeYvsEta_" + hid,"Cluster size along beamline vs. Cluster position #eta",60,-3.,3.,40,0.,40.);
00157 meSizeYvsEtaBarrel_->setAxisTitle("Cluster #eta",1);
00158 meSizeYvsEtaBarrel_->setAxisTitle("Cluster size along beamline [number of pixels]",2);
00159 }
00160 if(type==1 && barrel){
00161 uint32_t DBladder;
00162 if (!isUpgrade) { DBladder = PixelBarrelName(DetId(id_)).ladderName(); }
00163 else if (isUpgrade) { DBladder = PixelBarrelNameUpgrade(DetId(id_)).ladderName(); }
00164 char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
00165 hid = src.label() + "_" + sladder;
00166 if(isHalfModule) hid += "H";
00167 else hid += "F";
00168
00169 meNClustersLad_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00170 meNClustersLad_->setAxisTitle("Number of Clusters",1);
00171
00172 meChargeLad_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00173 meChargeLad_->setAxisTitle("Charge [kilo electrons]",1);
00174
00175 meSizeLad_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00176 meSizeLad_->setAxisTitle("Cluster size [number of pixels]",1);
00177 if(!reducedSet){
00178
00179 meMinRowLad_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00180 meMinRowLad_->setAxisTitle("Lowest cluster row",1);
00181
00182 meMaxRowLad_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00183 meMaxRowLad_->setAxisTitle("Highest cluster row",1);
00184
00185 meMinColLad_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00186 meMinColLad_->setAxisTitle("Lowest cluster column",1);
00187
00188 meMaxColLad_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00189 meMaxColLad_->setAxisTitle("Highest cluster column",1);
00190
00191 meXLad_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00192 meXLad_->setAxisTitle("Barycenter x-position [row #]",1);
00193
00194 meYLad_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00195 meYLad_->setAxisTitle("Barycenter y-position [column #]",1);
00196
00197 meSizeXLad_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00198 meSizeXLad_->setAxisTitle("Cluster x-size [rows]",1);
00199
00200 meSizeYLad_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00201 meSizeYLad_->setAxisTitle("Cluster y-size [columns]",1);
00202 if(twoD){
00203
00204 mePixClustersLad_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
00205 mePixClustersLad_->setAxisTitle("Columns",1);
00206 mePixClustersLad_->setAxisTitle("Rows",2);
00207 }else{
00208
00209 mePixClustersLad_px_ = theDMBE->book1D("hitmap_" + hid+"_px","Number of Clusters (1bin=two columns)",nbinx,0.,float(ncols_));
00210 mePixClustersLad_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",nbiny,0.,float(nrows_));
00211 mePixClustersLad_px_->setAxisTitle("Columns",1);
00212 mePixClustersLad_py_->setAxisTitle("Rows",1);
00213 }
00214 }
00215 }
00216
00217 if(type==2 && barrel){
00218
00219 uint32_t DBlayer;
00220 if (!isUpgrade) { DBlayer = PixelBarrelName(DetId(id_)).layerName(); }
00221 else if (isUpgrade) { DBlayer = PixelBarrelNameUpgrade(DetId(id_)).layerName(); }
00222 char slayer[80]; sprintf(slayer,"Layer_%i",DBlayer);
00223 hid = src.label() + "_" + slayer;
00224
00225 meNClustersLay_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00226 meNClustersLay_->setAxisTitle("Number of Clusters",1);
00227
00228 meChargeLay_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00229 meChargeLay_->setAxisTitle("Charge [kilo electrons]",1);
00230
00231 meSizeLay_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00232 meSizeLay_->setAxisTitle("Cluster size [in pixels]",1);
00233 if(!reducedSet){
00234
00235 meMinRowLay_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00236 meMinRowLay_->setAxisTitle("Lowest cluster row",1);
00237
00238 meMaxRowLay_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00239 meMaxRowLay_->setAxisTitle("Highest cluster row",1);
00240
00241 meMinColLay_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00242 meMinColLay_->setAxisTitle("Lowest cluster column",1);
00243
00244 meMaxColLay_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00245 meMaxColLay_->setAxisTitle("Highest cluster column",1);
00246
00247 meXLay_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00248 meXLay_->setAxisTitle("Barycenter x-position [row #]",1);
00249
00250 meYLay_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00251 meYLay_->setAxisTitle("Barycenter y-position [column #]",1);
00252
00253 meSizeXLay_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00254 meSizeXLay_->setAxisTitle("Cluster x-size [rows]",1);
00255
00256 meSizeYLay_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00257 meSizeYLay_->setAxisTitle("Cluster y-size [columns]",1);
00258 if(twoD){
00259
00260 if(isHalfModule){
00261 mePixClustersLay_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
00262 }else{
00263 mePixClustersLay_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
00264 }
00265 mePixClustersLay_->setAxisTitle("Columns",1);
00266 mePixClustersLay_->setAxisTitle("Rows",2);
00267 }else{
00268
00269 mePixClustersLay_px_ = theDMBE->book1D("hitmap_" + hid+"_px","Number of Clusters (1bin=two columns)",nbinx,0.,float(ncols_));
00270 if(isHalfModule){
00271 mePixClustersLay_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",2*nbiny,0.,float(2*nrows_));
00272 }else{
00273 mePixClustersLay_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",nbiny,0.,float(nrows_));
00274 }
00275 mePixClustersLay_px_->setAxisTitle("Columns",1);
00276 mePixClustersLay_py_->setAxisTitle("Rows",1);
00277 }
00278 }
00279 }
00280 if(type==3 && barrel){
00281 uint32_t DBmodule;
00282 if (!isUpgrade) { DBmodule = PixelBarrelName(DetId(id_)).moduleName(); }
00283 else if (isUpgrade) { DBmodule = PixelBarrelNameUpgrade(DetId(id_)).moduleName(); }
00284 char smodule[80]; sprintf(smodule,"Ring_%i",DBmodule);
00285 hid = src.label() + "_" + smodule;
00286
00287 meNClustersPhi_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00288 meNClustersPhi_->setAxisTitle("Number of Clusters",1);
00289
00290 meChargePhi_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00291 meChargePhi_->setAxisTitle("Charge [kilo electrons]",1);
00292
00293 meSizePhi_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00294 meSizePhi_->setAxisTitle("Cluster size [number of pixels]",1);
00295 if(!reducedSet){
00296
00297 meMinRowPhi_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00298 meMinRowPhi_->setAxisTitle("Lowest cluster row",1);
00299
00300 meMaxRowPhi_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00301 meMaxRowPhi_->setAxisTitle("Highest cluster row",1);
00302
00303 meMinColPhi_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00304 meMinColPhi_->setAxisTitle("Lowest cluster column",1);
00305
00306 meMaxColPhi_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00307 meMaxColPhi_->setAxisTitle("Highest cluster column",1);
00308
00309 meXPhi_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00310 meXPhi_->setAxisTitle("Barycenter x-position [row #]",1);
00311
00312 meYPhi_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00313 meYPhi_->setAxisTitle("Barycenter y-position [column #]",1);
00314
00315 meSizeXPhi_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00316 meSizeXPhi_->setAxisTitle("Cluster x-size [rows]",1);
00317
00318 meSizeYPhi_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00319 meSizeYPhi_->setAxisTitle("Cluster y-size [columns]",1);
00320 if(twoD){
00321
00322 if(isHalfModule){
00323 mePixClustersPhi_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
00324 }else{
00325 mePixClustersPhi_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
00326 }
00327 mePixClustersPhi_->setAxisTitle("Columns",1);
00328 mePixClustersPhi_->setAxisTitle("Rows",2);
00329 }else{
00330
00331 mePixClustersPhi_px_ = theDMBE->book1D("hitmap_" + hid+"_px","Number of Clusters (1bin=two columns)",nbinx,0.,float(ncols_));
00332 if(isHalfModule){
00333 mePixClustersPhi_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",2*nbiny,0.,float(2*nrows_));
00334 }else{
00335 mePixClustersPhi_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",nbiny,0.,float(nrows_));
00336 }
00337 mePixClustersPhi_px_->setAxisTitle("Columns",1);
00338 mePixClustersPhi_py_->setAxisTitle("Rows",1);
00339 }
00340 }
00341 }
00342
00343 if(type==4 && endcap){
00344 uint32_t blade;
00345 if (!isUpgrade) { blade = PixelEndcapName(DetId(id_)).bladeName(); }
00346 else if (isUpgrade) { blade = PixelEndcapNameUpgrade(DetId(id_)).bladeName(); }
00347
00348 char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
00349 hid = src.label() + "_" + sblade;
00350
00351 meNClustersBlade_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00352 meNClustersBlade_->setAxisTitle("Number of Clusters",1);
00353
00354 meChargeBlade_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00355 meChargeBlade_->setAxisTitle("Charge [kilo electrons]",1);
00356
00357 meSizeBlade_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00358 meSizeBlade_->setAxisTitle("Cluster size [number of pixels]",1);
00359 if(!reducedSet){
00360
00361 meMinRowBlade_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00362 meMinRowBlade_->setAxisTitle("Lowest cluster row",1);
00363
00364 meMaxRowBlade_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00365 meMaxRowBlade_->setAxisTitle("Highest cluster row",1);
00366
00367 meMinColBlade_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00368 meMinColBlade_->setAxisTitle("Lowest cluster column",1);
00369
00370 meMaxColBlade_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00371 meMaxColBlade_->setAxisTitle("Highest cluster column",1);
00372
00373 meXBlade_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00374 meXBlade_->setAxisTitle("Barycenter x-position [row #]",1);
00375
00376 meYBlade_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00377 meYBlade_->setAxisTitle("Barycenter y-position [column #]",1);
00378
00379 meSizeXBlade_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00380 meSizeXBlade_->setAxisTitle("Cluster x-size [rows]",1);
00381
00382 meSizeYBlade_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00383 meSizeYBlade_->setAxisTitle("Cluster y-size [columns]",1);
00384 }
00385 }
00386 if(type==5 && endcap){
00387 uint32_t disk;
00388 if (!isUpgrade) { disk = PixelEndcapName(DetId(id_)).diskName(); }
00389 else if (isUpgrade) { disk = PixelEndcapNameUpgrade(DetId(id_)).diskName(); }
00390
00391 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
00392 hid = src.label() + "_" + sdisk;
00393
00394 meNClustersDisk_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00395 meNClustersDisk_->setAxisTitle("Number of Clusters",1);
00396
00397 meChargeDisk_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00398 meChargeDisk_->setAxisTitle("Charge [kilo electrons]",1);
00399
00400 meSizeDisk_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00401 meSizeDisk_->setAxisTitle("Cluster size [number of pixels]",1);
00402 if(!reducedSet){
00403
00404 meMinRowDisk_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00405 meMinRowDisk_->setAxisTitle("Lowest cluster row",1);
00406
00407 meMaxRowDisk_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00408 meMaxRowDisk_->setAxisTitle("Highest cluster row",1);
00409
00410 meMinColDisk_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00411 meMinColDisk_->setAxisTitle("Lowest cluster column",1);
00412
00413 meMaxColDisk_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00414 meMaxColDisk_->setAxisTitle("Highest cluster column",1);
00415
00416 meXDisk_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00417 meXDisk_->setAxisTitle("Barycenter x-position [row #]",1);
00418
00419 meYDisk_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00420 meYDisk_->setAxisTitle("Barycenter y-position [column #]",1);
00421
00422 meSizeXDisk_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00423 meSizeXDisk_->setAxisTitle("Cluster x-size [rows]",1);
00424
00425 meSizeYDisk_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00426 meSizeYDisk_->setAxisTitle("Cluster y-size [columns]",1);
00427 }
00428 }
00429
00430 if(type==6 && endcap){
00431 uint32_t panel;
00432 uint32_t module;
00433 if (!isUpgrade) {
00434 panel= PixelEndcapName(DetId(id_)).pannelName();
00435 module= PixelEndcapName(DetId(id_)).plaquetteName();
00436 } else if (isUpgrade) {
00437 panel= PixelEndcapNameUpgrade(DetId(id_)).pannelName();
00438 module= PixelEndcapNameUpgrade(DetId(id_)).plaquetteName();
00439 }
00440
00441 char slab[80]; sprintf(slab, "Panel_%i_Ring_%i",panel, module);
00442 hid = src.label() + "_" + slab;
00443
00444 meNClustersRing_ = theDMBE->book1D("nclusters_" + hid,"Number of Clusters",8,0.,8.);
00445 meNClustersRing_->setAxisTitle("Number of Clusters",1);
00446
00447 meChargeRing_ = theDMBE->book1D("charge_" + hid,"Cluster charge",100,0.,200.);
00448 meChargeRing_->setAxisTitle("Charge [kilo electrons]",1);
00449
00450 meSizeRing_ = theDMBE->book1D("size_" + hid,"Total cluster size",30,0.,30.);
00451 meSizeRing_->setAxisTitle("Cluster size [number of pixels]",1);
00452 if(!reducedSet){
00453
00454 meMinRowRing_ = theDMBE->book1D("minrow_" + hid,"Lowest cluster row",200,0.,200.);
00455 meMinRowRing_->setAxisTitle("Lowest cluster row",1);
00456
00457 meMaxRowRing_ = theDMBE->book1D("maxrow_" + hid,"Highest cluster row",200,0.,200.);
00458 meMaxRowRing_->setAxisTitle("Highest cluster row",1);
00459
00460 meMinColRing_ = theDMBE->book1D("mincol_" + hid,"Lowest cluster column",500,0.,500.);
00461 meMinColRing_->setAxisTitle("Lowest cluster column",1);
00462
00463 meMaxColRing_ = theDMBE->book1D("maxcol_" + hid,"Highest cluster column",500,0.,500.);
00464 meMaxColRing_->setAxisTitle("Highest cluster column",1);
00465
00466 meXRing_ = theDMBE->book1D("x_" + hid,"Cluster barycenter X (row #)",200,0.,200.);
00467 meXRing_->setAxisTitle("Barycenter x-position [row #]",1);
00468
00469 meYRing_ = theDMBE->book1D("y_" + hid,"Cluster barycenter Y (column #)",500,0.,500.);
00470 meYRing_->setAxisTitle("Barycenter y-position [column #]",1);
00471
00472 meSizeXRing_ = theDMBE->book1D("sizeX_" + hid,"Cluster x-width (rows)",10,0.,10.);
00473 meSizeXRing_->setAxisTitle("Cluster x-size [rows]",1);
00474
00475 meSizeYRing_ = theDMBE->book1D("sizeY_" + hid,"Cluster y-width (columns)",15,0.,15.);
00476 meSizeYRing_->setAxisTitle("Cluster y-size [columns]",1);
00477 if(twoD){
00478
00479 mePixClustersRing_ = theDMBE->book2D("hitmap_" + hid,"Number of Clusters (1bin=four pixels)",nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
00480 mePixClustersRing_->setAxisTitle("Columns",1);
00481 mePixClustersRing_->setAxisTitle("Rows",2);
00482 }else{
00483
00484 mePixClustersRing_px_ = theDMBE->book1D("hitmap_" + hid+"_px","Number of Clusters (1bin=two columns)",nbinx,0.,float(ncols_));
00485 mePixClustersRing_py_ = theDMBE->book1D("hitmap_" + hid+"_py","Number of Clusters (1bin=two rows)",nbiny,0.,float(nrows_));
00486 mePixClustersRing_px_->setAxisTitle("Columns",1);
00487 mePixClustersRing_py_->setAxisTitle("Rows",1);
00488 }
00489 }
00490 }
00491
00492 }
00493
00494
00495
00496 int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input, const TrackerGeometry* tracker,bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon, bool twoD, bool reducedSet, bool smileyon, bool isUpgrade) {
00497
00498 bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
00499 bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
00500
00501 edmNew::DetSetVector<SiPixelCluster>::const_iterator isearch = input.find(id_);
00502 unsigned int numberOfClusters = 0;
00503 unsigned int numberOfFpixClusters = 0;
00504
00505 if( isearch != input.end() ) {
00506
00507
00508
00509 edmNew::DetSet<SiPixelCluster>::const_iterator di;
00510
00511 for(di = isearch->begin(); di != isearch->end(); di++) {
00512 numberOfClusters++;
00513 if(endcap) numberOfFpixClusters++;
00514 float charge = 0.001*(di->charge());
00515 float x = di->x();
00516 float y = di->y();
00517 int size = di->size();
00518 int sizeX = di->sizeX();
00519 int sizeY = di->sizeY();
00520 int minPixelRow = di->minPixelRow();
00521 int maxPixelRow = di->maxPixelRow();
00522 int minPixelCol = di->minPixelCol();
00523 int maxPixelCol = di->maxPixelCol();
00524
00525
00526
00527
00528
00529
00530
00531
00532 const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(DetId(id_)) );
00533
00534 const PixelTopology * topol = &(theGeomDet->specificTopology());
00535 LocalPoint clustlp = topol->localPosition( MeasurementPoint(x, y) );
00536 GlobalPoint clustgp = theGeomDet->surface().toGlobal( clustlp );
00537
00538 if(modon){
00539 (meCharge_)->Fill((float)charge);
00540 (meSize_)->Fill((int)size);
00541 DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00542 std::string currDir = theDMBE->pwd();
00543 theDMBE->cd("Pixel/Clusters/OffTrack/");
00544 MonitorElement * me;
00545 if(barrel){
00546 uint32_t DBlayer;
00547 if (!isUpgrade) { DBlayer = PixelBarrelName(DetId(id_)).layerName(); }
00548 else if (isUpgrade) { DBlayer = PixelBarrelNameUpgrade(DetId(id_)).layerName(); }
00549 switch(DBlayer){
00550 case 1: {
00551 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_Layer_1");
00552 if(me) me->Fill(clustgp.z(),clustgp.phi());
00553 break;
00554 } case 2: {
00555 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_Layer_2");
00556 if(me) me->Fill(clustgp.z(),clustgp.phi());
00557 break;
00558 } case 3: {
00559 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_Layer_3");
00560 if(me) me->Fill(clustgp.z(),clustgp.phi());
00561 break;
00562 } case 4: {
00563 if (isUpgrade) {
00564 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_Layer_4");
00565 if(me) me->Fill(clustgp.z(),clustgp.phi());
00566 break;
00567 }
00568 }}
00569 }else if(endcap){
00570 uint32_t DBdisk;
00571 if (!isUpgrade) { DBdisk = PixelEndcapName(DetId(id_)).diskName(); }
00572 else if (isUpgrade) { DBdisk = PixelEndcapNameUpgrade(DetId(id_)).diskName(); }
00573 if(clustgp.z()>0){
00574 switch(DBdisk){
00575 case 1: {
00576 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_pz_Disk_1");
00577 if(me) me->Fill(clustgp.x(),clustgp.y());
00578 break;
00579 } case 2: {
00580 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_pz_Disk_2");
00581 if(me) me->Fill(clustgp.x(),clustgp.y());
00582 break;
00583 } case 3: {
00584 if (isUpgrade) {
00585 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_pz_Disk_3");
00586 if(me) me->Fill(clustgp.x(),clustgp.y());
00587 break;
00588 }
00589 }}
00590 }else{
00591 switch(DBdisk){
00592 case 1: {
00593 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_mz_Disk_1");
00594 if(me) me->Fill(clustgp.x(),clustgp.y());
00595 break;
00596 } case 2: {
00597 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_mz_Disk_2");
00598 if(me) me->Fill(clustgp.x(),clustgp.y());
00599 break;
00600 } case 3: {
00601 if (isUpgrade) {
00602 me = theDMBE->get("Pixel/Clusters/OffTrack/position_siPixelClusters_mz_Disk_3");
00603 if(me) me->Fill(clustgp.x(),clustgp.y());
00604 break;
00605 }
00606 }}
00607 }
00608 }
00609 theDMBE->cd(currDir);
00610 if(!reducedSet)
00611 {
00612 (meMinRow_)->Fill((int)minPixelRow);
00613 (meMaxRow_)->Fill((int)maxPixelRow);
00614 (meMinCol_)->Fill((int)minPixelCol);
00615 (meMaxCol_)->Fill((int)maxPixelCol);
00616 (meSizeX_)->Fill((int)sizeX);
00617 (meSizeY_)->Fill((int)sizeY);
00618 (meX_)->Fill((float)x);
00619 (meY_)->Fill((float)y);
00620 if(twoD)(mePixClusters_)->Fill((float)y,(float)x);
00621 else{
00622 (mePixClusters_px_)->Fill((float)y);
00623 (mePixClusters_py_)->Fill((float)x);
00624 }
00625 }
00626
00627
00628 }
00629
00630 if(barrel && smileyon){
00631 (meSizeYvsEtaBarrel_)->Fill(clustgp.eta(),sizeY);
00632
00633 }
00634 if(ladon && barrel){
00635 (meChargeLad_)->Fill((float)charge);
00636 (meSizeLad_)->Fill((int)size);
00637 if(!reducedSet)
00638 {
00639 (meMinRowLad_)->Fill((int)minPixelRow);
00640 (meMaxRowLad_)->Fill((int)maxPixelRow);
00641 (meMinColLad_)->Fill((int)minPixelCol);
00642 (meMaxColLad_)->Fill((int)maxPixelCol);
00643 (meXLad_)->Fill((float)x);
00644 (meYLad_)->Fill((float)y);
00645 (meSizeXLad_)->Fill((int)sizeX);
00646 (meSizeYLad_)->Fill((int)sizeY);
00647 if(twoD) (mePixClustersLad_)->Fill((float)y,(float)x);
00648 else{
00649 (mePixClustersLad_px_)->Fill((float)y);
00650 (mePixClustersLad_py_)->Fill((float)x);
00651 }
00652 }
00653 }
00654 if(layon && barrel){
00655 (meChargeLay_)->Fill((float)charge);
00656 (meSizeLay_)->Fill((int)size);
00657 if(!reducedSet)
00658 {
00659 (meMinRowLay_)->Fill((int)minPixelRow);
00660 (meMaxRowLay_)->Fill((int)maxPixelRow);
00661 (meMinColLay_)->Fill((int)minPixelCol);
00662 (meMaxColLay_)->Fill((int)maxPixelCol);
00663 (meXLay_)->Fill((float)x);
00664 (meYLay_)->Fill((float)y);
00665 (meSizeXLay_)->Fill((int)sizeX);
00666 (meSizeYLay_)->Fill((int)sizeY);
00667 if(twoD) (mePixClustersLay_)->Fill((float)y,(float)x);
00668 else{
00669 (mePixClustersLay_px_)->Fill((float)y);
00670 (mePixClustersLay_py_)->Fill((float)x);
00671 }
00672 }
00673 }
00674 if(phion && barrel){
00675 (meChargePhi_)->Fill((float)charge);
00676 (meSizePhi_)->Fill((int)size);
00677 if(!reducedSet)
00678 {
00679 (meMinRowPhi_)->Fill((int)minPixelRow);
00680 (meMaxRowPhi_)->Fill((int)maxPixelRow);
00681 (meMinColPhi_)->Fill((int)minPixelCol);
00682 (meMaxColPhi_)->Fill((int)maxPixelCol);
00683 (meXPhi_)->Fill((float)x);
00684 (meYPhi_)->Fill((float)y);
00685 (meSizeXPhi_)->Fill((int)sizeX);
00686 (meSizeYPhi_)->Fill((int)sizeY);
00687 if(twoD) (mePixClustersPhi_)->Fill((float)y,(float)x);
00688 else{
00689 (mePixClustersPhi_px_)->Fill((float)y);
00690 (mePixClustersPhi_py_)->Fill((float)x);
00691 }
00692 }
00693 }
00694 if(bladeon && endcap){
00695 (meChargeBlade_)->Fill((float)charge);
00696 (meSizeBlade_)->Fill((int)size);
00697 if(!reducedSet)
00698 {
00699 (meMinRowBlade_)->Fill((int)minPixelRow);
00700 (meMaxRowBlade_)->Fill((int)maxPixelRow);
00701 (meMinColBlade_)->Fill((int)minPixelCol);
00702 (meMaxColBlade_)->Fill((int)maxPixelCol);
00703 (meXBlade_)->Fill((float)x);
00704 (meYBlade_)->Fill((float)y);
00705 (meSizeXBlade_)->Fill((int)sizeX);
00706 (meSizeYBlade_)->Fill((int)sizeY);
00707 }
00708 }
00709 if(diskon && endcap){
00710 (meChargeDisk_)->Fill((float)charge);
00711 (meSizeDisk_)->Fill((int)size);
00712 if(!reducedSet)
00713 {
00714 (meMinRowDisk_)->Fill((int)minPixelRow);
00715 (meMaxRowDisk_)->Fill((int)maxPixelRow);
00716 (meMinColDisk_)->Fill((int)minPixelCol);
00717 (meMaxColDisk_)->Fill((int)maxPixelCol);
00718 (meXDisk_)->Fill((float)x);
00719 (meYDisk_)->Fill((float)y);
00720 (meSizeXDisk_)->Fill((int)sizeX);
00721 (meSizeYDisk_)->Fill((int)sizeY);
00722 }
00723 }
00724
00725 if(ringon && endcap){
00726 (meChargeRing_)->Fill((float)charge);
00727 (meSizeRing_)->Fill((int)size);
00728 if(!reducedSet)
00729 {
00730 (meMinRowRing_)->Fill((int)minPixelRow);
00731 (meMaxRowRing_)->Fill((int)maxPixelRow);
00732 (meMinColRing_)->Fill((int)minPixelCol);
00733 (meMaxColRing_)->Fill((int)maxPixelCol);
00734 (meXRing_)->Fill((float)x);
00735 (meYRing_)->Fill((float)y);
00736 (meSizeXRing_)->Fill((int)sizeX);
00737 (meSizeYRing_)->Fill((int)sizeY);
00738 if(twoD) (mePixClustersRing_)->Fill((float)y,(float)x);
00739 else{
00740 (mePixClustersRing_px_)->Fill((float)y);
00741 (mePixClustersRing_py_)->Fill((float)x);
00742 }
00743 }
00744 }
00745 }
00746 if(modon) (meNClusters_)->Fill((float)numberOfClusters);
00747 if(ladon && barrel) (meNClustersLad_)->Fill((float)numberOfClusters);
00748 if(layon && barrel) (meNClustersLay_)->Fill((float)numberOfClusters);
00749 if(phion && barrel) (meNClustersPhi_)->Fill((float)numberOfClusters);
00750 if(bladeon && endcap) (meNClustersBlade_)->Fill((float)numberOfClusters);
00751 if(diskon && endcap) (meNClustersDisk_)->Fill((float)numberOfClusters);
00752 if(ringon && endcap) (meNClustersRing_)->Fill((float)numberOfClusters);
00753
00754
00755
00756
00757 }
00758
00759
00760
00761 return numberOfFpixClusters;
00762
00763 }