#include <DQM/SiPixelMonitorDigi/interface/SiPixelDigiModule.h>
Definition at line 30 of file SiPixelDigiModule.h.
typedef edm::DetSet<PixelDigi>::const_iterator SiPixelDigiModule::DigiIterator |
Definition at line 43 of file SiPixelDigiModule.h.
SiPixelDigiModule::SiPixelDigiModule | ( | ) |
SiPixelDigiModule::SiPixelDigiModule | ( | const uint32_t & | id | ) |
SiPixelDigiModule::~SiPixelDigiModule | ( | ) |
void SiPixelDigiModule::book | ( | const edm::ParameterSet & | iConfig, | |
int | type = 0 , |
|||
bool | twoD = true , |
|||
bool | hiRes = false | |||
) |
Book histograms.
Definition at line 47 of file SiPixelDigiModule.cc.
References GeomDetEnumerators::barrel, DetId::DetId(), muonGeometry::disk, GeomDetEnumerators::endcap, edm::ParameterSet::getParameter(), id_, edm::InputTag::label(), meADC_, meADCBlade_, meADCDisk_, meADCLad_, meADCLay_, meADCPhi_, meADCRing_, meNDigis_, meNDigisBlade_, meNDigisDisk_, meNDigisLad_, meNDigisLay_, meNDigisPhi_, meNDigisRing_, mePixDigis_, mePixDigis_px_, mePixDigis_py_, mePixDigisLad_, mePixDigisLad_px_, mePixDigisLad_py_, mePixDigisLay_, mePixDigisLay_px_, mePixDigisLay_py_, mePixDigisPhi_, mePixDigisPhi_px_, mePixDigisPhi_py_, mePixDigisRing_, mePixDigisRing_px_, mePixDigisRing_py_, ncols_, nrows_, PixelSubdetector::PixelBarrel, PixelBarrelName::PixelBarrelName(), PixelSubdetector::PixelEndcap, PixelEndcapName::PixelEndcapName(), MonitorElement::setAxisTitle(), SiPixelHistogramId::setHistoId(), and HLT_VtxMuL3::src.
00047 { 00048 bool barrel = DetId::DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel); 00049 bool endcap = DetId::DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap); 00050 bool isHalfModule = false; 00051 if(barrel){ 00052 isHalfModule = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).isHalfModule(); 00053 } 00054 00055 std::string hid; 00056 // Get collection name and instantiate Histo Id builder 00057 edm::InputTag src = iConfig.getParameter<edm::InputTag>( "src" ); 00058 00059 00060 // Get DQM interface 00061 DQMStore* theDMBE = edm::Service<DQMStore>().operator->(); 00062 00063 int nbinx=ncols_/2, nbiny=nrows_/2; 00064 std::string twodtitle = "Number of Digis (1bin=four pixels)"; 00065 std::string pxtitle = "Number of Digis (1bin=two columns)"; 00066 std::string pytitle = "Number of Digis (1bin=two rows)"; 00067 if(hiRes){ 00068 nbinx = ncols_; 00069 nbiny = nrows_; 00070 twodtitle = "Number of Digis (1bin=one pixel)"; 00071 pxtitle = "Number of Digis (1bin=one column)"; 00072 pytitle = "Number of Digis (1bin=one row)"; 00073 } 00074 00075 00076 if(type==0){ 00077 SiPixelHistogramId* theHistogramId = new SiPixelHistogramId( src.label() ); 00078 // Number of digis 00079 hid = theHistogramId->setHistoId("ndigis",id_); 00080 meNDigis_ = theDMBE->book1D(hid,"Number of Digis",50,0.,50.); 00081 meNDigis_->setAxisTitle("Number of digis",1); 00082 // Charge in ADC counts 00083 hid = theHistogramId->setHistoId("adc",id_); 00084 meADC_ = theDMBE->book1D(hid,"Digi charge",256,0.,256.); 00085 meADC_->setAxisTitle("ADC counts",1); 00086 if(twoD){ 00087 // 2D hit map 00088 hid = theHistogramId->setHistoId("hitmap",id_); 00089 mePixDigis_ = theDMBE->book2D(hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_)); 00090 mePixDigis_->setAxisTitle("Columns",1); 00091 mePixDigis_->setAxisTitle("Rows",2); 00092 } 00093 else{ 00094 // projections of 2D hit map 00095 hid = theHistogramId->setHistoId("hitmap",id_); 00096 mePixDigis_px_ = theDMBE->book1D(hid+"_px",pxtitle,nbinx,0.,float(ncols_)); 00097 mePixDigis_py_ = theDMBE->book1D(hid+"_py",pytitle,nbiny,0.,float(nrows_)); 00098 mePixDigis_px_->setAxisTitle("Columns",1); 00099 mePixDigis_py_->setAxisTitle("Rows",1); 00100 } 00101 delete theHistogramId; 00102 00103 } 00104 00105 if(type==1 && barrel){ 00106 uint32_t DBladder = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).ladderName(); 00107 char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder); 00108 hid = src.label() + "_" + sladder; 00109 if(isHalfModule) hid += "H"; 00110 else hid += "F"; 00111 // Number of digis 00112 meNDigisLad_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00113 meNDigisLad_->setAxisTitle("Number of digis",1); 00114 // Charge in ADC counts 00115 meADCLad_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00116 meADCLad_->setAxisTitle("ADC counts",1); 00117 if(twoD){ 00118 // 2D hit map 00119 mePixDigisLad_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_)); 00120 mePixDigisLad_->setAxisTitle("Columns",1); 00121 mePixDigisLad_->setAxisTitle("Rows",2); 00122 } 00123 else{ 00124 // projections of 2D hit map 00125 mePixDigisLad_px_ = theDMBE->book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_)); 00126 mePixDigisLad_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_)); 00127 mePixDigisLad_px_->setAxisTitle("Columns",1); 00128 mePixDigisLad_py_->setAxisTitle("Rows",1); 00129 } 00130 } 00131 if(type==2 && barrel){ 00132 uint32_t DBlayer = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).layerName(); 00133 char slayer[80]; sprintf(slayer,"Layer_%i",DBlayer); 00134 hid = src.label() + "_" + slayer; 00135 // Number of digis 00136 meNDigisLay_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00137 meNDigisLay_->setAxisTitle("Number of digis",1); 00138 // Charge in ADC counts 00139 meADCLay_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00140 meADCLay_->setAxisTitle("ADC counts",1); 00141 if(twoD){ 00142 // 2D hit map 00143 if(isHalfModule){ 00144 mePixDigisLay_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_)); 00145 } 00146 else{ 00147 mePixDigisLay_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_)); 00148 } 00149 mePixDigisLay_->setAxisTitle("Columns",1); 00150 mePixDigisLay_->setAxisTitle("Rows",2); 00151 } 00152 else{ 00153 // projections of 2D hit map 00154 mePixDigisLay_px_ = theDMBE->book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_)); 00155 if(isHalfModule){ 00156 mePixDigisLay_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_)); 00157 } 00158 else{ 00159 mePixDigisLay_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_)); 00160 } 00161 mePixDigisLay_px_->setAxisTitle("Columns",1); 00162 mePixDigisLay_py_->setAxisTitle("Rows",1); 00163 } 00164 } 00165 if(type==3 && barrel){ 00166 uint32_t DBmodule = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).moduleName(); 00167 char smodule[80]; sprintf(smodule,"Ring_%i",DBmodule); 00168 hid = src.label() + "_" + smodule; 00169 // Number of digis 00170 meNDigisPhi_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00171 meNDigisPhi_->setAxisTitle("Number of digis",1); 00172 // Charge in ADC counts 00173 meADCPhi_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00174 meADCPhi_->setAxisTitle("ADC counts",1); 00175 if(twoD){ 00176 // 2D hit map 00177 if(isHalfModule){ 00178 mePixDigisPhi_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_)); 00179 } 00180 else { 00181 mePixDigisPhi_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_)); 00182 } 00183 mePixDigisPhi_->setAxisTitle("Columns",1); 00184 mePixDigisPhi_->setAxisTitle("Rows",2); 00185 } 00186 else{ 00187 // projections of 2D hit map 00188 mePixDigisPhi_px_ = theDMBE->book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_)); 00189 if(isHalfModule){ 00190 mePixDigisPhi_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_)); 00191 } 00192 else{ 00193 mePixDigisPhi_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_)); 00194 } 00195 mePixDigisPhi_px_->setAxisTitle("Columns",1); 00196 mePixDigisPhi_py_->setAxisTitle("Rows",1); 00197 } 00198 00199 00200 } 00201 if(type==4 && endcap){ 00202 uint32_t blade= PixelEndcapName::PixelEndcapName(DetId::DetId(id_)).bladeName(); 00203 00204 char sblade[80]; sprintf(sblade, "Blade_%02i",blade); 00205 hid = src.label() + "_" + sblade; 00206 // Number of digis 00207 meNDigisBlade_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00208 meNDigisBlade_->setAxisTitle("Number of digis",1); 00209 // Charge in ADC counts 00210 meADCBlade_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00211 meADCBlade_->setAxisTitle("ADC counts",1); 00212 } 00213 if(type==5 && endcap){ 00214 uint32_t disk = PixelEndcapName::PixelEndcapName(DetId::DetId(id_)).diskName(); 00215 00216 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); 00217 hid = src.label() + "_" + sdisk; 00218 // Number of digis 00219 meNDigisDisk_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00220 meNDigisDisk_->setAxisTitle("Number of digis",1); 00221 // Charge in ADC counts 00222 meADCDisk_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00223 meADCDisk_->setAxisTitle("ADC counts",1); 00224 } 00225 if(type==6 && endcap){ 00226 uint32_t panel= PixelEndcapName::PixelEndcapName(DetId::DetId(id_)).pannelName(); 00227 uint32_t module= PixelEndcapName::PixelEndcapName(DetId::DetId(id_)).plaquetteName(); 00228 char slab[80]; sprintf(slab, "Panel_%i_Ring_%i",panel, module); 00229 hid = src.label() + "_" + slab; 00230 // Number of digis 00231 meNDigisRing_ = theDMBE->book1D("ndigis_"+hid,"Number of Digis",50,0.,50.); 00232 meNDigisRing_->setAxisTitle("Number of digis",1); 00233 // Charge in ADC counts 00234 meADCRing_ = theDMBE->book1D("adc_" + hid,"Digi charge",256,0.,256.); 00235 meADCRing_->setAxisTitle("ADC counts",1); 00236 if(twoD){ 00237 // 2D hit map 00238 mePixDigisRing_ = theDMBE->book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_)); 00239 mePixDigisRing_->setAxisTitle("Columns",1); 00240 mePixDigisRing_->setAxisTitle("Rows",2); 00241 } 00242 else{ 00243 // projections of 2D hit map 00244 mePixDigisRing_px_ = theDMBE->book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_)); 00245 mePixDigisRing_py_ = theDMBE->book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_)); 00246 mePixDigisRing_px_->setAxisTitle("Columns",1); 00247 mePixDigisRing_py_->setAxisTitle("Rows",1); 00248 } 00249 00250 } 00251 }
void SiPixelDigiModule::fill | ( | const edm::DetSetVector< PixelDigi > & | input, | |
bool | modon = true , |
|||
bool | ladon = false , |
|||
bool | layon = false , |
|||
bool | phion = false , |
|||
bool | bladeon = false , |
|||
bool | diskon = false , |
|||
bool | ringon = false , |
|||
bool | twoD = true | |||
) |
Fill histograms.
Definition at line 257 of file SiPixelDigiModule.cc.
References ecalMGPA::adc(), GeomDetEnumerators::barrel, edm::DetSetVector< T >::begin(), parsecf::pyparsing::col(), DetId::DetId(), edm::DetSetVector< T >::end(), GeomDetEnumerators::endcap, edm::DetSetVector< T >::find(), id_, meADC_, meADCBlade_, meADCDisk_, meADCLad_, meADCLay_, meADCPhi_, meADCRing_, meNDigis_, meNDigisBlade_, meNDigisDisk_, meNDigisLad_, meNDigisLay_, meNDigisPhi_, meNDigisRing_, mePixDigis_, mePixDigis_px_, mePixDigis_py_, mePixDigisLad_, mePixDigisLad_px_, mePixDigisLad_py_, mePixDigisLay_, mePixDigisLay_px_, mePixDigisLay_py_, mePixDigisPhi_, mePixDigisPhi_px_, mePixDigisPhi_py_, mePixDigisRing_, mePixDigisRing_px_, mePixDigisRing_py_, PixelSubdetector::PixelBarrel, PixelBarrelName::PixelBarrelName(), PixelSubdetector::PixelEndcap, and row.
00257 { 00258 bool barrel = DetId::DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel); 00259 bool endcap = DetId::DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap); 00260 bool isHalfModule = false; 00261 uint32_t DBladder = 0; 00262 if(barrel){ 00263 isHalfModule = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).isHalfModule(); 00264 DBladder = PixelBarrelName::PixelBarrelName(DetId::DetId(id_)).ladderName(); 00265 } 00266 00267 // Get DQM interface 00268 //DQMStore* theDMBE = edm::Service<DQMStore>().operator->(); 00269 //std::cout<<"id_ = "<<id_<<" , dmbe="<<theDMBE->pwd()<<std::endl; 00270 //std::cout<<"********************"<<std::endl; 00271 edm::DetSetVector<PixelDigi>::const_iterator isearch = input.find(id_); // search digis of detid 00272 00273 if( isearch != input.end() ) { // Not an empty iterator 00274 00275 unsigned int numberOfDigis = 0; 00276 00277 // Look at digis now 00278 edm::DetSet<PixelDigi>::const_iterator di; 00279 for(di = isearch->data.begin(); di != isearch->data.end(); di++) { 00280 numberOfDigis++; 00281 int adc = di->adc(); // charge 00282 int col = di->column(); // column 00283 int row = di->row(); // row 00284 if(modon){ 00285 if(twoD) (mePixDigis_)->Fill((float)col,(float)row); 00286 else { 00287 (mePixDigis_px_)->Fill((float)col); 00288 (mePixDigis_py_)->Fill((float)row); 00289 } 00290 (meADC_)->Fill((float)adc); 00291 } 00292 if(ladon && barrel){ 00293 if(twoD) (mePixDigisLad_)->Fill((float)col,(float)row); 00294 else { 00295 (mePixDigisLad_px_)->Fill((float)col); 00296 (mePixDigisLad_py_)->Fill((float)row); 00297 } 00298 (meADCLad_)->Fill((float)adc); 00299 } 00300 if(layon && barrel){ 00301 if(twoD){ 00302 if(isHalfModule && DBladder==1){ 00303 (mePixDigisLay_)->Fill((float)col,(float)row+80); 00304 } 00305 else (mePixDigisLay_)->Fill((float)col,(float)row); 00306 } 00307 else { 00308 (mePixDigisLay_px_)->Fill((float)col); 00309 if(isHalfModule && DBladder==1) { 00310 (mePixDigisLay_py_)->Fill((float)row+80); 00311 } 00312 else (mePixDigisLay_py_)->Fill((float)row); 00313 } 00314 (meADCLay_)->Fill((float)adc); 00315 } 00316 if(phion && barrel){ 00317 if(twoD){ 00318 if(isHalfModule && DBladder==1){ 00319 (mePixDigisPhi_)->Fill((float)col,(float)row+80); 00320 } 00321 else (mePixDigisPhi_)->Fill((float)col,(float)row); 00322 } 00323 else { 00324 (mePixDigisPhi_px_)->Fill((float)col); 00325 if(isHalfModule && DBladder==1) { 00326 (mePixDigisPhi_py_)->Fill((float)row+80); 00327 } 00328 else (mePixDigisPhi_py_)->Fill((float)row); 00329 } 00330 (meADCPhi_)->Fill((float)adc); 00331 } 00332 if(bladeon && endcap){ 00333 (meADCBlade_)->Fill((float)adc); 00334 } 00335 if(diskon && endcap){ 00336 (meADCDisk_)->Fill((float)adc); 00337 } 00338 if(ringon && endcap){ 00339 if(twoD) (mePixDigisRing_)->Fill((float)col,(float)row); 00340 else { 00341 (mePixDigisRing_px_)->Fill((float)col); 00342 (mePixDigisRing_py_)->Fill((float)row); 00343 } 00344 (meADCRing_)->Fill((float)adc); 00345 } 00346 } 00347 if(modon) (meNDigis_)->Fill((float)numberOfDigis); 00348 if(ladon && barrel) (meNDigisLad_)->Fill((float)numberOfDigis); 00349 if(layon && barrel) (meNDigisLay_)->Fill((float)numberOfDigis); 00350 if(phion && barrel) (meNDigisPhi_)->Fill((float)numberOfDigis); 00351 if(bladeon && endcap) (meNDigisBlade_)->Fill((float)numberOfDigis); 00352 if(diskon && endcap) (meNDigisDisk_)->Fill((float)numberOfDigis); 00353 if(ringon && endcap) (meNDigisRing_)->Fill((float)numberOfDigis); 00354 //std::cout<<"number of digis="<<numberOfDigis<<std::endl; 00355 00356 } 00357 00358 00359 //std::cout<<"number of detector units="<<numberOfDetUnits<<std::endl; 00360 00361 }
uint32_t SiPixelDigiModule::id_ [private] |
MonitorElement* SiPixelDigiModule::meADC_ [private] |
MonitorElement* SiPixelDigiModule::meADCBlade_ [private] |
MonitorElement* SiPixelDigiModule::meADCDisk_ [private] |
MonitorElement* SiPixelDigiModule::meADCLad_ [private] |
MonitorElement* SiPixelDigiModule::meADCLay_ [private] |
MonitorElement* SiPixelDigiModule::meADCPhi_ [private] |
MonitorElement* SiPixelDigiModule::meADCRing_ [private] |
MonitorElement* SiPixelDigiModule::meNDigis_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisBlade_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisDisk_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisLad_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisLay_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisPhi_ [private] |
MonitorElement* SiPixelDigiModule::meNDigisRing_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigis_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigis_px_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigis_py_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigisLad_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigisLay_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigisPhi_ [private] |
MonitorElement* SiPixelDigiModule::mePixDigisRing_ [private] |
int SiPixelDigiModule::ncols_ [private] |
int SiPixelDigiModule::nrows_ [private] |