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