CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SiPixelDigiModule Class Reference

#include <SiPixelDigiModule.h>

Public Types

typedef edm::DetSet< PixelDigi >
::const_iterator 
DigiIterator
 

Public Member Functions

void book (const edm::ParameterSet &iConfig, const edm::EventSetup &iSetup, DQMStore::IBooker &iBooker, int type=0, bool twoD=true, bool hiRes=false, bool reducedSet=false, bool additInfo=false, bool isUpgrade=false)
 Book histograms. More...
 
int fill (const edm::DetSetVector< PixelDigi > &input, const edm::EventSetup &iSetup, MonitorElement *combBarrel, MonitorElement *chanBarrel, std::vector< MonitorElement * > &chanBarrelL, MonitorElement *combEndcap, const bool modon, const bool ladon, const bool layon, const bool phion, const bool bladeon, const bool diskon, const bool ringon, const bool twoD, const bool reducedSet, const bool twoDimModOn, const bool twoDimOnlyLayDisk, int &nDigisA, int &nDigisB, bool isUpgrade)
 Fill histograms. More...
 
std::pair< int, int > getZeroLoEffROCs ()
 
void resetRocMap ()
 
 SiPixelDigiModule ()
 Default constructor. More...
 
 SiPixelDigiModule (const uint32_t &id)
 Constructor with raw DetId. More...
 
 SiPixelDigiModule (const uint32_t &id, const int &ncols, const int &nrows)
 Constructor with raw DetId and sensor size. More...
 
 ~SiPixelDigiModule ()
 Destructor. More...
 

Private Attributes

uint32_t id_
 
MonitorElementmeADC_
 
MonitorElementmeADCBlade_
 
MonitorElementmeADCDisk_
 
MonitorElementmeADCLad_
 
MonitorElementmeADCLay_
 
MonitorElementmeADCPhi_
 
MonitorElementmeADCRing_
 
MonitorElementmeNDigis_
 
MonitorElementmeNDigisBlade_
 
MonitorElementmeNDigisDisk_
 
MonitorElementmeNDigisLad_
 
MonitorElementmeNDigisLay_
 
MonitorElementmeNDigisPhi_
 
MonitorElementmeNDigisRing_
 
MonitorElementmePixDigis_
 
MonitorElementmePixDigis_px_
 
MonitorElementmePixDigis_py_
 
MonitorElementmePixDigisDisk_
 
MonitorElementmePixDigisLad_
 
MonitorElementmePixDigisLad_px_
 
MonitorElementmePixDigisLad_py_
 
MonitorElementmePixDigisLay_
 
MonitorElementmePixDigisLay_px_
 
MonitorElementmePixDigisLay_py_
 
MonitorElementmePixDigisPhi_
 
MonitorElementmePixDigisPhi_px_
 
MonitorElementmePixDigisPhi_py_
 
MonitorElementmePixDigisRing_
 
MonitorElementmePixDigisRing_px_
 
MonitorElementmePixDigisRing_py_
 
MonitorElementmePixRocsDisk_ = NULL
 
MonitorElementmePixRocsLay_ = NULL
 
MonitorElementmeZeroOccRocsDisk_ = NULL
 
MonitorElementmeZeroOccRocsLay_ = NULL
 
int ncols_
 
int nrows_
 

Detailed Description

Definition at line 45 of file SiPixelDigiModule.h.

Member Typedef Documentation

Definition at line 58 of file SiPixelDigiModule.h.

Constructor & Destructor Documentation

SiPixelDigiModule::SiPixelDigiModule ( )

Default constructor.

Framework.

Definition at line 27 of file SiPixelDigiModule.cc.

27  : id_(0),
28  ncols_(416),
29  nrows_(160)
30 {
31 }
SiPixelDigiModule::SiPixelDigiModule ( const uint32_t &  id)

Constructor with raw DetId.

Definition at line 33 of file SiPixelDigiModule.cc.

33  :
34  id_(id),
35  ncols_(416),
36  nrows_(160)
37 {
38 }
SiPixelDigiModule::SiPixelDigiModule ( const uint32_t &  id,
const int &  ncols,
const int &  nrows 
)

Constructor with raw DetId and sensor size.

Definition at line 40 of file SiPixelDigiModule.cc.

40  :
41  id_(id),
42  ncols_(ncols),
43  nrows_(nrows)
44 {
45 }
SiPixelDigiModule::~SiPixelDigiModule ( )

Destructor.

Definition at line 49 of file SiPixelDigiModule.cc.

49 {}

Member Function Documentation

void SiPixelDigiModule::book ( const edm::ParameterSet iConfig,
const edm::EventSetup iSetup,
DQMStore::IBooker iBooker,
int  type = 0,
bool  twoD = true,
bool  hiRes = false,
bool  reducedSet = false,
bool  additInfo = false,
bool  isUpgrade = false 
)

Book histograms.

Definition at line 53 of file SiPixelDigiModule.cc.

References Reference_intrackfit_cff::barrel, PixelEndcapName::bladeName(), DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), PixelEndcapName::diskName(), Reference_intrackfit_cff::endcap, edm::EventSetup::get(), edm::ParameterSet::getParameter(), id_, PixelBarrelName::isHalfModule(), edm::InputTag::label(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), meADC_, meADCBlade_, meADCDisk_, meADCLad_, meADCLay_, meADCPhi_, meADCRing_, meNDigis_, meNDigisBlade_, meNDigisDisk_, meNDigisLad_, meNDigisLay_, meNDigisPhi_, meNDigisRing_, mePixDigis_, mePixDigis_px_, mePixDigis_py_, mePixDigisDisk_, mePixDigisLad_, mePixDigisLad_px_, mePixDigisLad_py_, mePixDigisLay_, mePixDigisLay_px_, mePixDigisLay_py_, mePixDigisPhi_, mePixDigisPhi_px_, mePixDigisPhi_py_, mePixDigisRing_, mePixDigisRing_px_, mePixDigisRing_py_, mePixRocsDisk_, mePixRocsLay_, meZeroOccRocsDisk_, meZeroOccRocsLay_, python.rootplot.argparse::module, PixelBarrelName::moduleName(), ncols_, nrows_, PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::plaquetteName(), edm::ESHandle< class >::product(), MonitorElement::setAxisTitle(), SiPixelHistogramId::setHistoId(), alcazmumu_cfi::src, AlCaHLTBitMon_QueryRunRegistry::string, and DetId::subdetId().

53  {
54 
55  //isUpgrade = iConfig.getUntrackedParameter<bool>("isUpgrade");
57  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
58  const TrackerTopology *pTT = tTopoHandle.product();
59 
60  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
61  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
62  bool isHalfModule = false;
63  if(barrel){
64  isHalfModule = PixelBarrelName(DetId(id_),pTT,isUpgrade).isHalfModule();
65  }
66 
67  std::string hid;
68  // Get collection name and instantiate Histo Id builder
69  edm::InputTag src = iConfig.getParameter<edm::InputTag>( "src" );
70 
71  int nbinx=ncols_/2, nbiny=nrows_/2;
72  std::string twodtitle = "Number of Digis (1bin=four pixels)";
73  std::string pxtitle = "Number of Digis (1bin=two columns)";
74  std::string pytitle = "Number of Digis (1bin=two rows)";
75  std::string twodroctitle = "ROC Occupancy (1bin=one ROC)";
76  std::string twodzeroOccroctitle = "Zero Occupancy ROC Map (1bin=one ROC) for ";
77  if(hiRes){
78  nbinx = ncols_;
79  nbiny = nrows_;
80  twodtitle = "Number of Digis (1bin=one pixel)";
81  pxtitle = "Number of Digis (1bin=one column)";
82  pytitle = "Number of Digis (1bin=one row)";
83  }
84  if(type==0){
85  SiPixelHistogramId* theHistogramId = new SiPixelHistogramId( src.label() );
86  // Number of digis
87  hid = theHistogramId->setHistoId("ndigis",id_);
88  meNDigis_ = iBooker.book1D(hid,"Number of Digis",25,0.,25.);
89  meNDigis_->setAxisTitle("Number of digis",1);
90  // Charge in ADC counts
91  hid = theHistogramId->setHistoId("adc",id_);
92  meADC_ = iBooker.book1D(hid,"Digi charge",128,0.,256.);
93  meADC_->setAxisTitle("ADC counts",1);
94  if(!reducedSet)
95  {
96  if(twoD){
97  if(additInfo){
98  // 2D hit map
99  hid = theHistogramId->setHistoId("hitmap",id_);
100  mePixDigis_ = iBooker.book2D(hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
101  mePixDigis_->setAxisTitle("Columns",1);
102  mePixDigis_->setAxisTitle("Rows",2);
103  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
104  }
105  }
106  else{
107  // projections of 2D hit map
108  hid = theHistogramId->setHistoId("hitmap",id_);
109  mePixDigis_px_ = iBooker.book1D(hid+"_px",pxtitle,nbinx,0.,float(ncols_));
110  mePixDigis_py_ = iBooker.book1D(hid+"_py",pytitle,nbiny,0.,float(nrows_));
111  mePixDigis_px_->setAxisTitle("Columns",1);
112  mePixDigis_py_->setAxisTitle("Rows",1);
113  }
114  }
115  delete theHistogramId;
116 
117  }
118 
119  if(type==1 && barrel){
120  uint32_t DBladder;
121  DBladder = PixelBarrelName(DetId(id_),pTT,isUpgrade).ladderName();
122  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
123  hid = src.label() + "_" + sladder;
124  if(isHalfModule) hid += "H";
125  else hid += "F";
126  // Number of digis
127  meNDigisLad_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
128  meNDigisLad_->setAxisTitle("Number of digis",1);
129  // Charge in ADC counts
130  meADCLad_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
131  meADCLad_->setAxisTitle("ADC counts",1);
132  if(!reducedSet)
133  {
134  if(twoD){
135  // 2D hit map
136  mePixDigisLad_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
137  mePixDigisLad_->setAxisTitle("Columns",1);
138  mePixDigisLad_->setAxisTitle("Rows",2);
139  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
140  }
141  else{
142  // projections of 2D hit map
143  mePixDigisLad_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
144  mePixDigisLad_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
145  mePixDigisLad_px_->setAxisTitle("Columns",1);
146  mePixDigisLad_py_->setAxisTitle("Rows",1);
147  }
148  }
149  }
150  if(type==2 && barrel){
151  uint32_t DBlayer;
152  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
153  char slayer[80]; sprintf(slayer,"Layer_%i",DBlayer);
154  hid = src.label() + "_" + slayer;
155  if(!additInfo){
156  // Number of digis
157  meNDigisLay_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
158  meNDigisLay_->setAxisTitle("Number of digis",1);
159  // Charge in ADC counts
160  meADCLay_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
161  meADCLay_->setAxisTitle("ADC counts",1);
162  }
163  if(!reducedSet){
164  if(twoD || additInfo){
165  // 2D hit map
166  if(isHalfModule){
167  mePixDigisLay_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
168  }
169  else{
170  mePixDigisLay_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
171 
172  }
173  mePixDigisLay_->setAxisTitle("Columns",1);
174  mePixDigisLay_->setAxisTitle("Rows",2);
175 
176  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
177  int yROCbins[3] = {18,30,42};
178  mePixRocsLay_ = iBooker.book2D("rocmap_"+hid,twodroctitle,32,0.,32.,yROCbins[DBlayer-1],1.5,1.5+float(yROCbins[DBlayer-1]/2));
179  mePixRocsLay_->setAxisTitle("ROCs per Module",1);
180  mePixRocsLay_->setAxisTitle("ROCs per 1/2 Ladder",2);
181  meZeroOccRocsLay_ = iBooker.book2D("zeroOccROC_map",twodzeroOccroctitle+hid,32,0.,32.,yROCbins[DBlayer-1],1.5,1.5+float(yROCbins[DBlayer-1]/2));
182  meZeroOccRocsLay_->setAxisTitle("ROCs per Module",1);
183  meZeroOccRocsLay_->setAxisTitle("ROCs per 1/2 Ladder",2);
184  }
185  if(!twoD && !additInfo){
186  // projections of 2D hit map
187  mePixDigisLay_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
188  if(isHalfModule){
189  mePixDigisLay_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_));
190  }
191  else{
192  mePixDigisLay_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
193  }
194  mePixDigisLay_px_->setAxisTitle("Columns",1);
195  mePixDigisLay_py_->setAxisTitle("Rows",1);
196  }
197  }
198  }
199  if(type==3 && barrel){
200  uint32_t DBmodule;
201  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
202  char smodule[80]; sprintf(smodule,"Ring_%i",DBmodule);
203  hid = src.label() + "_" + smodule;
204  // Number of digis
205  meNDigisPhi_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
206  meNDigisPhi_->setAxisTitle("Number of digis",1);
207  // Charge in ADC counts
208  meADCPhi_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
209  meADCPhi_->setAxisTitle("ADC counts",1);
210  if(!reducedSet)
211  {
212  if(twoD){
213 
214  // 2D hit map
215  if(isHalfModule){
216  mePixDigisPhi_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
217  }
218  else {
219  mePixDigisPhi_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
220  }
221  mePixDigisPhi_->setAxisTitle("Columns",1);
222  mePixDigisPhi_->setAxisTitle("Rows",2);
223  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
224  }
225  else{
226  // projections of 2D hit map
227  mePixDigisPhi_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
228  if(isHalfModule){
229  mePixDigisPhi_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_));
230  }
231  else{
232  mePixDigisPhi_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
233  }
234  mePixDigisPhi_px_->setAxisTitle("Columns",1);
235  mePixDigisPhi_py_->setAxisTitle("Rows",1);
236  }
237  }
238  }
239  if(type==4 && endcap){
240  uint32_t blade;
241  blade= PixelEndcapName(DetId(id_),pTT,isUpgrade).bladeName();
242 
243  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
244  hid = src.label() + "_" + sblade;
245  // Number of digis
246  meNDigisBlade_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
247  meNDigisBlade_->setAxisTitle("Number of digis",1);
248  // Charge in ADC counts
249  meADCBlade_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
250  meADCBlade_->setAxisTitle("ADC counts",1);
251  }
252  if(type==5 && endcap){
253  uint32_t disk;
254  disk = PixelEndcapName(DetId(id_),pTT,isUpgrade).diskName();
255 
256  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
257  hid = src.label() + "_" + sdisk;
258  if(!additInfo){
259  // Number of digis
260  meNDigisDisk_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
261  meNDigisDisk_->setAxisTitle("Number of digis",1);
262  // Charge in ADC counts
263  meADCDisk_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
264  meADCDisk_->setAxisTitle("ADC counts",1);
265  }
266  if(additInfo){
267  mePixDigisDisk_ = iBooker.book2D("hitmap_"+hid,twodtitle,260,0.,260.,160,0.,160.);
268  mePixDigisDisk_->setAxisTitle("Columns",1);
269  mePixDigisDisk_->setAxisTitle("Rows",2);
270  //ROC information in disks
271  mePixRocsDisk_ = iBooker.book2D("rocmap_"+hid,twodroctitle,26,0.,26.,24,1.,13.);
272  mePixRocsDisk_ ->setAxisTitle("ROCs per Module (2 Panels)",1);
273  mePixRocsDisk_ ->setAxisTitle("Blade Number",2);
274  meZeroOccRocsDisk_ = iBooker.book2D("zeroOccROC_map",twodzeroOccroctitle+hid,26,0.,26.,24,1.,13.);
275  meZeroOccRocsDisk_ ->setAxisTitle("Zero-Occupancy ROCs per Module (2 Panels)",1);
276  meZeroOccRocsDisk_ ->setAxisTitle("Blade Number",2);
277  }
278  }
279  if(type==6 && endcap){
280  uint32_t panel;
281  uint32_t module;
282  panel= PixelEndcapName(DetId(id_),pTT,isUpgrade).pannelName();
283  module= PixelEndcapName(DetId(id_),pTT,isUpgrade).plaquetteName();
284 
285  char slab[80]; sprintf(slab, "Panel_%i_Ring_%i",panel, module);
286  hid = src.label() + "_" + slab;
287  // Number of digis
288  meNDigisRing_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
289  meNDigisRing_->setAxisTitle("Number of digis",1);
290  // Charge in ADC counts
291  meADCRing_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
292  meADCRing_->setAxisTitle("ADC counts",1);
293  if(!reducedSet)
294  {
295  if(twoD){
296  // 2D hit map
297  mePixDigisRing_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
298  mePixDigisRing_->setAxisTitle("Columns",1);
299  mePixDigisRing_->setAxisTitle("Rows",2);
300  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
301  }
302  else{
303  // projections of 2D hit map
304  mePixDigisRing_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
305  mePixDigisRing_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
306  mePixDigisRing_px_->setAxisTitle("Columns",1);
307  mePixDigisRing_py_->setAxisTitle("Rows",1);
308  }
309  }
310  }
311 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
MonitorElement * meNDigisRing_
MonitorElement * mePixDigisLad_py_
MonitorElement * mePixDigis_
MonitorElement * mePixDigisPhi_py_
int moduleName() const
module id (index in z)
MonitorElement * meADCRing_
MonitorElement * meNDigis_
MonitorElement * mePixDigisRing_px_
MonitorElement * mePixDigis_py_
MonitorElement * meADC_
MonitorElement * mePixDigisDisk_
MonitorElement * meNDigisBlade_
int bladeName() const
blade id
MonitorElement * meADCDisk_
MonitorElement * mePixDigisPhi_px_
bool isHalfModule() const
full or half module
MonitorElement * mePixDigisRing_py_
MonitorElement * mePixRocsDisk_
MonitorElement * mePixRocsLay_
MonitorElement * meZeroOccRocsLay_
MonitorElement * mePixDigisLay_py_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * meADCLad_
MonitorElement * meADCBlade_
MonitorElement * meNDigisLay_
MonitorElement * mePixDigisLad_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
MonitorElement * meADCLay_
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * mePixDigis_px_
const T & get() const
Definition: EventSetup.h:55
int layerName() const
layer id
T const * product() const
Definition: ESHandle.h:86
MonitorElement * mePixDigisLad_px_
MonitorElement * mePixDigisLay_
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * meNDigisPhi_
int pannelName() const
pannel id
MonitorElement * meZeroOccRocsDisk_
MonitorElement * mePixDigisRing_
MonitorElement * meADCPhi_
int diskName() const
disk id
MonitorElement * mePixDigisPhi_
MonitorElement * meNDigisDisk_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meNDigisLad_
MonitorElement * mePixDigisLay_px_
int SiPixelDigiModule::fill ( const edm::DetSetVector< PixelDigi > &  input,
const edm::EventSetup iSetup,
MonitorElement combBarrel,
MonitorElement chanBarrel,
std::vector< MonitorElement * > &  chanBarrelL,
MonitorElement combEndcap,
const bool  modon,
const bool  ladon,
const bool  layon,
const bool  phion,
const bool  bladeon,
const bool  diskon,
const bool  ringon,
const bool  twoD,
const bool  reducedSet,
const bool  twoDimModOn,
const bool  twoDimOnlyLayDisk,
int &  nDigisA,
int &  nDigisB,
bool  isUpgrade 
)

Fill histograms.

Definition at line 317 of file SiPixelDigiModule.cc.

References ecalMGPA::adc(), Reference_intrackfit_cff::barrel, edm::DetSetVector< T >::begin(), PixelEndcapName::bladeName(), cuy::col, edm::DetSetVector< T >::end(), Reference_intrackfit_cff::endcap, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::DetSetVector< T >::find(), edm::EventSetup::get(), i, id_, PixelBarrelName::isHalfModule(), j, PixelBarrelName::ladderName(), PixelBarrelName::layerName(), meADC_, meADCBlade_, meADCDisk_, meADCLad_, meADCLay_, meADCPhi_, meADCRing_, meNDigis_, meNDigisBlade_, meNDigisDisk_, meNDigisLad_, meNDigisLay_, meNDigisPhi_, meNDigisRing_, mePixDigis_, mePixDigis_px_, mePixDigis_py_, mePixDigisDisk_, mePixDigisLad_, mePixDigisLad_px_, mePixDigisLad_py_, mePixDigisLay_, mePixDigisLay_px_, mePixDigisLay_py_, mePixDigisPhi_, mePixDigisPhi_px_, mePixDigisPhi_py_, mePixDigisRing_, mePixDigisRing_px_, mePixDigisRing_py_, mePixRocsDisk_, mePixRocsLay_, PixelBarrelName::mI, PixelBarrelName::mO, PixelBarrelName::moduleName(), PixelEndcapName::pannelName(), PixelBarrelName::pI, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelBarrelName::pO, edm::ESHandle< class >::product(), PixelBarrelName::shell(), and DetId::subdetId().

322  {
323  edm::ESHandle<TrackerTopology> tTopoHandle;
324  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
325  const TrackerTopology *pTT = tTopoHandle.product();
326 
327  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
328  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
329  bool isHalfModule = false;
330  uint32_t DBladder = 0;
331  if(barrel){
332  isHalfModule = PixelBarrelName(DetId(id_),pTT,isUpgrade).isHalfModule();
333  DBladder = PixelBarrelName(DetId(id_),pTT,isUpgrade).ladderName();
334  }
335 
336  edm::DetSetVector<PixelDigi>::const_iterator isearch = input.find(id_); // search digis of detid
337 
338  unsigned int numberOfDigisMod = 0;
339  int msize;
340  if (isUpgrade) {msize=10;} else {msize=8;}
341  int numberOfDigis[msize]; for(int i=0; i!=msize; i++) numberOfDigis[i]=0;
342  nDigisA=0; nDigisB=0;
343  if( isearch != input.end() ) { // Not an empty iterator
344 
345  // Look at digis now
347  for(di = isearch->data.begin(); di != isearch->data.end(); di++) {
348  int adc = di->adc(); // charge
349  int col = di->column(); // column
350  int row = di->row(); // row
351  numberOfDigisMod++;
352 
353  int DBlayer = 0;
354  int DBmodule =0;
355 
356  if (!isUpgrade) {
357  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(id_),pTT,isUpgrade).shell();
358  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
359  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
360  if(barrel){
361  if(isHalfModule){
362  if(DBshell==PixelBarrelName::pI||DBshell==PixelBarrelName::pO){
363  numberOfDigis[0]++; nDigisA++;
364  if(DBlayer==1) numberOfDigis[2]++;
365  if(DBlayer==2) numberOfDigis[3]++;
366  if(DBlayer==3) numberOfDigis[4]++;
367  }
368  if(DBshell==PixelBarrelName::mI||DBshell==PixelBarrelName::mO){
369  numberOfDigis[1]++; nDigisB++;
370  if(DBlayer==1) numberOfDigis[5]++;
371  if(DBlayer==2) numberOfDigis[6]++;
372  if(DBlayer==3) numberOfDigis[7]++;
373  }
374  }else{
375  if(row<80){
376  numberOfDigis[0]++; nDigisA++;
377  if(DBlayer==1) numberOfDigis[2]++;
378  if(DBlayer==2) numberOfDigis[3]++;
379  if(DBlayer==3) numberOfDigis[4]++;
380  }else{
381  numberOfDigis[1]++; nDigisB++;
382  if(DBlayer==1) numberOfDigis[5]++;
383  if(DBlayer==2) numberOfDigis[6]++;
384  if(DBlayer==3) numberOfDigis[7]++;
385  }
386  }
387  }
388  } else if (isUpgrade) {
389  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
390  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
391  if(barrel){
392  if(row<80){
393  numberOfDigis[0]++; nDigisA++;
394  if(DBlayer==1) numberOfDigis[2]++;
395  if(DBlayer==2) numberOfDigis[3]++;
396  if(DBlayer==3) numberOfDigis[4]++;
397  if(DBlayer==4) numberOfDigis[5]++;
398  }else{
399  numberOfDigis[1]++; nDigisB++;
400  if(DBlayer==1) numberOfDigis[6]++;
401  if(DBlayer==2) numberOfDigis[7]++;
402  if(DBlayer==3) numberOfDigis[8]++;
403  if(DBlayer==4) numberOfDigis[9]++;
404  }
405  }
406  }
407 
408  if(modon){
409  if(!reducedSet){
410  if(twoD) {
411  if(twoDimModOn) (mePixDigis_)->Fill((float)col,(float)row);
412  }
413  else {
414  (mePixDigis_px_)->Fill((float)col);
415  (mePixDigis_py_)->Fill((float)row);
416  }
417  }
418  (meADC_)->Fill((float)adc);
419  }
420  if(ladon && barrel){
421  (meADCLad_)->Fill((float)adc);
422  if(!reducedSet){
423  if(twoD) (mePixDigisLad_)->Fill((float)col,(float)row);
424  else {
425  (mePixDigisLad_px_)->Fill((float)col);
426  (mePixDigisLad_py_)->Fill((float)row);
427  }
428  }
429  }
430  if((layon || twoDimOnlyLayDisk) && barrel){
431  if(!twoDimOnlyLayDisk) (meADCLay_)->Fill((float)adc);
432  if(!reducedSet){
433  if((layon && twoD) || twoDimOnlyLayDisk){
434  //ROC histos...
435  float rocx = (float)col/52. + 8.0*float(DBmodule-1);
436  float rocy = (float)row/160.+float(DBladder);
437  //Shift 1st ladder (half modules) up by 1 bin
438  if(DBladder==1) rocy = rocy + 0.5;
439  mePixRocsLay_->Fill(rocx,rocy);
440 
441  if(isHalfModule && DBladder==1){
442  (mePixDigisLay_)->Fill((float)col,(float)row+80);
443  }
444  else (mePixDigisLay_)->Fill((float)col,(float)row);
445  }
446  if((layon && !twoD) && !twoDimOnlyLayDisk){
447  (mePixDigisLay_px_)->Fill((float)col);
448  if(isHalfModule && DBladder==1) {
449  (mePixDigisLay_py_)->Fill((float)row+80);
450  }
451  else (mePixDigisLay_py_)->Fill((float)row);
452  }
453  }
454  }
455  if(phion && barrel){
456  (meADCPhi_)->Fill((float)adc);
457  if(!reducedSet)
458  {
459  if(twoD){
460  if(isHalfModule && DBladder==1){
461  (mePixDigisPhi_)->Fill((float)col,(float)row+80);
462  }
463  else (mePixDigisPhi_)->Fill((float)col,(float)row);
464  }
465  else {
466  (mePixDigisPhi_px_)->Fill((float)col);
467  if(isHalfModule && DBladder==1) {
468  (mePixDigisPhi_py_)->Fill((float)row+80);
469  }
470  else (mePixDigisPhi_py_)->Fill((float)row);
471  }
472  }
473  }
474  if(bladeon && endcap){
475  (meADCBlade_)->Fill((float)adc);
476  }
477 
478  if((diskon || twoDimOnlyLayDisk) && endcap){
479  if(!twoDimOnlyLayDisk) (meADCDisk_)->Fill((float)adc);
480  if(twoDimOnlyLayDisk){
481  (mePixDigisDisk_)->Fill((float)col,(float)row);
482  //ROC monitoring
483  int DBpanel;
484  int DBblade;
485  DBpanel= PixelEndcapName(DetId(id_),pTT,isUpgrade).pannelName();
486  DBblade= PixelEndcapName(DetId(id_),pTT,isUpgrade).bladeName();
487  float offx = 0.;
488  //This crazy offset takes into account the roc and module fpix configuration
489  for (int i = DBpanel; i < DBmodule; ++i) {offx = offx + float(5+DBpanel-i);}
490  float rocx = (float)col/52. + offx + 14.0*float(DBpanel-1);
491  float rocy = (float)row/160.+float(DBblade);
492  mePixRocsDisk_->Fill(rocx,rocy);
493  }
494  }
495  if(ringon && endcap){
496  (meADCRing_)->Fill((float)adc);
497  if(!reducedSet)
498  {
499  if(twoD) (mePixDigisRing_)->Fill((float)col,(float)row);
500  else {
501  (mePixDigisRing_px_)->Fill((float)col);
502  (mePixDigisRing_py_)->Fill((float)row);
503  }
504  }
505  }
506  }
507  if(modon) (meNDigis_)->Fill((float)numberOfDigisMod);
508  if(ladon && barrel) (meNDigisLad_)->Fill((float)numberOfDigisMod);
509  if(layon && barrel && !twoDimOnlyLayDisk) (meNDigisLay_)->Fill((float)numberOfDigisMod);
510  if(phion && barrel) (meNDigisPhi_)->Fill((float)numberOfDigisMod);
511  if(bladeon && endcap) (meNDigisBlade_)->Fill((float)numberOfDigisMod);
512  if(diskon && endcap && !twoDimOnlyLayDisk) (meNDigisDisk_)->Fill((float)numberOfDigisMod);
513  if(ringon && endcap) (meNDigisRing_)->Fill((float)numberOfDigisMod);
514  if(barrel){
515  if(combBarrel) combBarrel->Fill((float)numberOfDigisMod);
516  if(chanBarrel){ if(numberOfDigis[0]>0) chanBarrel->Fill((float)numberOfDigis[0]); if(numberOfDigis[1]>0) chanBarrel->Fill((float)numberOfDigis[1]); }
517  int j = 2;
518  for (std::vector<MonitorElement*>::iterator i = chanBarrelL.begin(); i != chanBarrelL.end(); i++)
519  {
520  if(numberOfDigis[j]>0) (*i)->Fill((float)numberOfDigis[j]);
521  j++;
522  }
523  }else if(endcap){
524  if(combEndcap) combEndcap->Fill((float)numberOfDigisMod);
525  }
526  }
527 
528  //std::cout<<"numberOfDigis for this module: "<<numberOfDigis<<std::endl;
529  return numberOfDigisMod;
530 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
MonitorElement * meNDigisRing_
MonitorElement * mePixDigisLad_py_
MonitorElement * mePixDigis_
MonitorElement * mePixDigisPhi_py_
iterator find(det_id_type id)
Definition: DetSetVector.h:294
int moduleName() const
module id (index in z)
MonitorElement * meADCRing_
MonitorElement * meNDigis_
MonitorElement * mePixDigisRing_px_
MonitorElement * mePixDigis_py_
MonitorElement * meADC_
MonitorElement * mePixDigisDisk_
void Fill(long long x)
MonitorElement * meNDigisBlade_
int bladeName() const
blade id
MonitorElement * meADCDisk_
MonitorElement * mePixDigisPhi_px_
bool isHalfModule() const
full or half module
MonitorElement * mePixDigisRing_py_
MonitorElement * mePixRocsDisk_
MonitorElement * mePixRocsLay_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * mePixDigisLay_py_
MonitorElement * meADCLad_
int j
Definition: DBlmapReader.cc:9
MonitorElement * meADCBlade_
MonitorElement * meNDigisLay_
MonitorElement * mePixDigisLad_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
MonitorElement * meADCLay_
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
MonitorElement * mePixDigis_px_
const T & get() const
Definition: EventSetup.h:55
int layerName() const
layer id
T const * product() const
Definition: ESHandle.h:86
MonitorElement * mePixDigisLad_px_
Shell shell() const
MonitorElement * mePixDigisLay_
MonitorElement * meNDigisPhi_
int pannelName() const
pannel id
MonitorElement * mePixDigisRing_
MonitorElement * meADCPhi_
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:350
MonitorElement * mePixDigisPhi_
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
int col
Definition: cuy.py:1008
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108
MonitorElement * meNDigisDisk_
MonitorElement * meNDigisLad_
MonitorElement * mePixDigisLay_px_
std::pair< int, int > SiPixelDigiModule::getZeroLoEffROCs ( )

Definition at line 539 of file SiPixelDigiModule.cc.

References MonitorElement::Fill(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), i, j, mePixRocsDisk_, mePixRocsLay_, meZeroOccRocsDisk_, and meZeroOccRocsLay_.

539  {
540  int nZeroROC = 0;
541  int nLoEffROC = 0;
542  float SF = 1.0;
545  for (int i = 1; i < mePixRocsDisk_->getNbinsX(); ++i){
546  for (int j = 1; j < mePixRocsDisk_->getNbinsY(); ++j){
547  float localX = float(i) - 0.5;
548  float localY = float(j)/2.0 + 0.75;
549  if (mePixRocsDisk_->getBinContent(i,j) < 1 ) {nZeroROC++; meZeroOccRocsDisk_->Fill(localX,localY);}
550  if (mePixRocsDisk_->getBinContent(i,j)*SF < 0.25){nLoEffROC++;}
551  }
552  }
553  return std::pair<int,int>(nZeroROC,nLoEffROC);
554  }
557  for (int i = 1; i < mePixRocsLay_->getNbinsX(); ++i){
558  for (int j = 1; j < mePixRocsLay_->getNbinsY(); ++j){
559  float localX = float(i) - 0.5;
560  float localY = float(j)/2.0 + 1.25;
561  if (mePixRocsLay_->getBinContent(i,j) < 1 ) {nZeroROC++; meZeroOccRocsLay_->Fill(localX,localY);}
562  if (mePixRocsLay_->getBinContent(i,j)*SF < 0.25){nLoEffROC++;}
563  }
564  }
565  return std::pair<int,int>(nZeroROC,nLoEffROC);
566  }
567  return std::pair<int,int>(0,0);
568 }
int i
Definition: DBlmapReader.cc:9
double getEntries(void) const
get # of entries
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
MonitorElement * mePixRocsDisk_
MonitorElement * mePixRocsLay_
MonitorElement * meZeroOccRocsLay_
int j
Definition: DBlmapReader.cc:9
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * meZeroOccRocsDisk_
int getNbinsX(void) const
get # of bins in X-axis
void SiPixelDigiModule::resetRocMap ( )

Definition at line 533 of file SiPixelDigiModule.cc.

References mePixRocsDisk_, mePixRocsLay_, and MonitorElement::Reset().

533  {
536 }
MonitorElement * mePixRocsDisk_
MonitorElement * mePixRocsLay_
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

uint32_t SiPixelDigiModule::id_
private

Definition at line 78 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADC_
private

Definition at line 82 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCBlade_
private

Definition at line 110 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCDisk_
private

Definition at line 113 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCLad_
private

Definition at line 89 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCLay_
private

Definition at line 95 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCPhi_
private

Definition at line 103 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meADCRing_
private

Definition at line 119 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigis_
private

Definition at line 81 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisBlade_
private

Definition at line 109 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisDisk_
private

Definition at line 112 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisLad_
private

Definition at line 88 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisLay_
private

Definition at line 94 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisPhi_
private

Definition at line 102 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::meNDigisRing_
private

Definition at line 118 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigis_
private

Definition at line 83 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigis_px_
private

Definition at line 84 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigis_py_
private

Definition at line 85 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisDisk_
private

Definition at line 114 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLad_
private

Definition at line 90 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLad_px_
private

Definition at line 91 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLad_py_
private

Definition at line 92 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLay_
private

Definition at line 96 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLay_px_
private

Definition at line 99 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisLay_py_
private

Definition at line 100 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisPhi_
private

Definition at line 104 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisPhi_px_
private

Definition at line 105 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisPhi_py_
private

Definition at line 106 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisRing_
private

Definition at line 120 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisRing_px_
private

Definition at line 121 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixDigisRing_py_
private

Definition at line 122 of file SiPixelDigiModule.h.

Referenced by book(), and fill().

MonitorElement* SiPixelDigiModule::mePixRocsDisk_ = NULL
private

Definition at line 115 of file SiPixelDigiModule.h.

Referenced by book(), fill(), getZeroLoEffROCs(), and resetRocMap().

MonitorElement* SiPixelDigiModule::mePixRocsLay_ = NULL
private

Definition at line 97 of file SiPixelDigiModule.h.

Referenced by book(), fill(), getZeroLoEffROCs(), and resetRocMap().

MonitorElement* SiPixelDigiModule::meZeroOccRocsDisk_ = NULL
private

Definition at line 116 of file SiPixelDigiModule.h.

Referenced by book(), and getZeroLoEffROCs().

MonitorElement* SiPixelDigiModule::meZeroOccRocsLay_ = NULL
private

Definition at line 98 of file SiPixelDigiModule.h.

Referenced by book(), and getZeroLoEffROCs().

int SiPixelDigiModule::ncols_
private

Definition at line 79 of file SiPixelDigiModule.h.

Referenced by book().

int SiPixelDigiModule::nrows_
private

Definition at line 80 of file SiPixelDigiModule.h.

Referenced by book().