Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-23 04:29:25

0001 #include "DQMServices/Core/interface/DQMStore.h"
0002 #include "DataFormats/Common/interface/DetSetVector.h"
0003 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0004 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0005 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "FWCore/Framework/interface/MakerMacros.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/ServiceRegistry/interface/Service.h"
0013 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0014 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0015 #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h"
0016 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0017 #include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
0018 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0019 #include "SiPixelDigiValid.h"
0020 
0021 // using namespace std;
0022 // using namespace edm;
0023 
0024 SiPixelDigiValid::SiPixelDigiValid(const edm::ParameterSet &ps)
0025     : m_geomToken(esConsumes<edm::Transition::BeginRun>()),
0026       m_topoToken(esConsumes()),
0027       outputFile_(ps.getUntrackedParameter<std::string>("outputFile", "pixeldigihisto.root")),
0028       runStandalone(ps.getParameter<bool>("runStandalone")),
0029       dbe_(nullptr),
0030       edmDetSetVector_PixelDigi_Token_(consumes<edm::DetSetVector<PixelDigi>>(ps.getParameter<edm::InputTag>("src"))) {}
0031 
0032 SiPixelDigiValid::~SiPixelDigiValid() {}
0033 
0034 void SiPixelDigiValid::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) {
0035   dbe_ = edm::Service<DQMStore>().operator->();
0036   tracker = &es.getData(m_geomToken);
0037 
0038   if (dbe_) {
0039     ibooker.setCurrentFolder("TrackerDigisV/TrackerDigis/Pixel");
0040 
0041     meDigiMultiLayer1Ring1_ = ibooker.book1D("digimulti_layer1ring1", "Digi Multiplicity ", 30, 0., 30.);
0042     meDigiMultiLayer1Ring2_ = ibooker.book1D("digimulti_layer1ring2", "Digi Multiplicity ", 30, 0., 30.);
0043     meDigiMultiLayer1Ring3_ = ibooker.book1D("digimulti_layer1ring3", "Digi Multiplicity ", 30, 0., 30.);
0044     meDigiMultiLayer1Ring4_ = ibooker.book1D("digimulti_layer1ring4", "Digi Multiplicity ", 30, 0., 30.);
0045     meDigiMultiLayer1Ring5_ = ibooker.book1D("digimulti_layer1ring5", "Digi Multiplicity ", 30, 0., 30.);
0046     meDigiMultiLayer1Ring6_ = ibooker.book1D("digimulti_layer1ring6", "Digi Multiplicity ", 30, 0., 30.);
0047     meDigiMultiLayer1Ring7_ = ibooker.book1D("digimulti_layer1ring7", "Digi Multiplicity ", 30, 0., 30.);
0048     meDigiMultiLayer1Ring8_ = ibooker.book1D("digimulti_layer1ring8", "Digi Multiplicity ", 30, 0., 30.);
0049 
0050     meDigiMultiLayer2Ring1_ = ibooker.book1D("digimulti_layer2ring1", "Digi Multiplicity ", 30, 0., 30.);
0051     meDigiMultiLayer2Ring2_ = ibooker.book1D("digimulti_layer2ring2", "Digi Multiplicity ", 30, 0., 30.);
0052     meDigiMultiLayer2Ring3_ = ibooker.book1D("digimulti_layer2ring3", "Digi Multiplicity ", 30, 0., 30.);
0053     meDigiMultiLayer2Ring4_ = ibooker.book1D("digimulti_layer2ring4", "Digi Multiplicity ", 30, 0., 30.);
0054     meDigiMultiLayer2Ring5_ = ibooker.book1D("digimulti_layer2ring5", "Digi Multiplicity ", 30, 0., 30.);
0055     meDigiMultiLayer2Ring6_ = ibooker.book1D("digimulti_layer2ring6", "Digi Multiplicity ", 30, 0., 30.);
0056     meDigiMultiLayer2Ring7_ = ibooker.book1D("digimulti_layer2ring7", "Digi Multiplicity ", 30, 0., 30.);
0057     meDigiMultiLayer2Ring8_ = ibooker.book1D("digimulti_layer2ring8", "Digi Multiplicity ", 30, 0., 30.);
0058 
0059     meDigiMultiLayer3Ring1_ = ibooker.book1D("digimulti_layer3ring1", "Digi Multiplicity ", 30, 0., 30.);
0060     meDigiMultiLayer3Ring2_ = ibooker.book1D("digimulti_layer3ring2", "Digi Multiplicity ", 30, 0., 30.);
0061     meDigiMultiLayer3Ring3_ = ibooker.book1D("digimulti_layer3ring3", "Digi Multiplicity ", 30, 0., 30.);
0062     meDigiMultiLayer3Ring4_ = ibooker.book1D("digimulti_layer3ring4", "Digi Multiplicity ", 30, 0., 30.);
0063     meDigiMultiLayer3Ring5_ = ibooker.book1D("digimulti_layer3ring5", "Digi Multiplicity ", 30, 0., 30.);
0064     meDigiMultiLayer3Ring6_ = ibooker.book1D("digimulti_layer3ring6", "Digi Multiplicity ", 30, 0., 30.);
0065     meDigiMultiLayer3Ring7_ = ibooker.book1D("digimulti_layer3ring7", "Digi Multiplicity ", 30, 0., 30.);
0066     meDigiMultiLayer3Ring8_ = ibooker.book1D("digimulti_layer3ring8", "Digi Multiplicity ", 30, 0., 30.);
0067 
0068     /////Barrel
0069     meAdcLayer1Ring1_ = ibooker.book1D("adc_layer1ring1", "Digi charge", 50, 0., 300.);
0070     meAdcLayer1Ring2_ = ibooker.book1D("adc_layer1ring2", "Digi charge", 50, 0., 300.);
0071     meAdcLayer1Ring3_ = ibooker.book1D("adc_layer1ring3", "Digi charge", 50, 0., 300.);
0072     meAdcLayer1Ring4_ = ibooker.book1D("adc_layer1ring4", "Digi charge", 50, 0., 300.);
0073     meAdcLayer1Ring5_ = ibooker.book1D("adc_layer1ring5", "Digi charge", 50, 0., 300.);
0074     meAdcLayer1Ring6_ = ibooker.book1D("adc_layer1ring6", "Digi charge", 50, 0., 300.);
0075     meAdcLayer1Ring7_ = ibooker.book1D("adc_layer1ring7", "Digi charge", 50, 0., 300.);
0076     meAdcLayer1Ring8_ = ibooker.book1D("adc_layer1ring8", "Digi charge", 50, 0., 300.);
0077 
0078     meRowLayer1Ring1_ = ibooker.book1D("row_layer1ring1", "Digi row", 50, 0., 200.);
0079     meRowLayer1Ring2_ = ibooker.book1D("row_layer1ring2", "Digi row", 50, 0., 200.);
0080     meRowLayer1Ring3_ = ibooker.book1D("row_layer1ring3", "Digi row", 50, 0., 200.);
0081     meRowLayer1Ring4_ = ibooker.book1D("row_layer1ring4", "Digi row", 50, 0., 200.);
0082     meRowLayer1Ring5_ = ibooker.book1D("row_layer1ring5", "Digi row", 50, 0., 200.);
0083     meRowLayer1Ring6_ = ibooker.book1D("row_layer1ring6", "Digi row", 50, 0., 200.);
0084     meRowLayer1Ring7_ = ibooker.book1D("row_layer1ring7", "Digi row", 50, 0., 200.);
0085     meRowLayer1Ring8_ = ibooker.book1D("row_layer1ring8", "Digi row", 50, 0., 200.);
0086 
0087     meColLayer1Ring1_ = ibooker.book1D("col_layer1ring1", "Digi column", 50, 0., 500.);
0088     meColLayer1Ring2_ = ibooker.book1D("col_layer1ring2", "Digi column", 50, 0., 500.);
0089     meColLayer1Ring3_ = ibooker.book1D("col_layer1ring3", "Digi column", 50, 0., 500.);
0090     meColLayer1Ring4_ = ibooker.book1D("col_layer1ring4", "Digi column", 50, 0., 500.);
0091     meColLayer1Ring5_ = ibooker.book1D("col_layer1ring5", "Digi column", 50, 0., 500.);
0092     meColLayer1Ring6_ = ibooker.book1D("col_layer1ring6", "Digi column", 50, 0., 500.);
0093     meColLayer1Ring7_ = ibooker.book1D("col_layer1ring7", "Digi column", 50, 0., 500.);
0094     meColLayer1Ring8_ = ibooker.book1D("col_layer1ring8", "Digi column", 50, 0., 500.);
0095 
0096     meAdcLayer2Ring1_ = ibooker.book1D("adc_layer2ring1", "Digi charge", 50, 0., 300.);
0097     meAdcLayer2Ring2_ = ibooker.book1D("adc_layer2ring2", "Digi charge", 50, 0., 300.);
0098     meAdcLayer2Ring3_ = ibooker.book1D("adc_layer2ring3", "Digi charge", 50, 0., 300.);
0099     meAdcLayer2Ring4_ = ibooker.book1D("adc_layer2ring4", "Digi charge", 50, 0., 300.);
0100     meAdcLayer2Ring5_ = ibooker.book1D("adc_layer2ring5", "Digi charge", 50, 0., 300.);
0101     meAdcLayer2Ring6_ = ibooker.book1D("adc_layer2ring6", "Digi charge", 50, 0., 300.);
0102     meAdcLayer2Ring7_ = ibooker.book1D("adc_layer2ring7", "Digi charge", 50, 0., 300.);
0103     meAdcLayer2Ring8_ = ibooker.book1D("adc_layer2ring8", "Digi charge", 50, 0., 300.);
0104 
0105     meRowLayer2Ring1_ = ibooker.book1D("row_layer2ring1", "Digi row", 50, 0., 200.);
0106     meRowLayer2Ring2_ = ibooker.book1D("row_layer2ring2", "Digi row", 50, 0., 200.);
0107     meRowLayer2Ring3_ = ibooker.book1D("row_layer2ring3", "Digi row", 50, 0., 200.);
0108     meRowLayer2Ring4_ = ibooker.book1D("row_layer2ring4", "Digi row", 50, 0., 200.);
0109     meRowLayer2Ring5_ = ibooker.book1D("row_layer2ring5", "Digi row", 50, 0., 200.);
0110     meRowLayer2Ring6_ = ibooker.book1D("row_layer2ring6", "Digi row", 50, 0., 200.);
0111     meRowLayer2Ring7_ = ibooker.book1D("row_layer2ring7", "Digi row", 50, 0., 200.);
0112     meRowLayer2Ring8_ = ibooker.book1D("row_layer2ring8", "Digi row", 50, 0., 200.);
0113 
0114     meColLayer2Ring1_ = ibooker.book1D("col_layer2ring1", "Digi column", 50, 0., 500.);
0115     meColLayer2Ring2_ = ibooker.book1D("col_layer2ring2", "Digi column", 50, 0., 500.);
0116     meColLayer2Ring3_ = ibooker.book1D("col_layer2ring3", "Digi column", 50, 0., 500.);
0117     meColLayer2Ring4_ = ibooker.book1D("col_layer2ring4", "Digi column", 50, 0., 500.);
0118     meColLayer2Ring5_ = ibooker.book1D("col_layer2ring5", "Digi column", 50, 0., 500.);
0119     meColLayer2Ring6_ = ibooker.book1D("col_layer2ring6", "Digi column", 50, 0., 500.);
0120     meColLayer2Ring7_ = ibooker.book1D("col_layer2ring7", "Digi column", 50, 0., 500.);
0121     meColLayer2Ring8_ = ibooker.book1D("col_layer2ring8", "Digi column", 50, 0., 500.);
0122 
0123     meAdcLayer3Ring1_ = ibooker.book1D("adc_layer3ring1", "Digi charge", 50, 0., 300.);
0124     meAdcLayer3Ring2_ = ibooker.book1D("adc_layer3ring2", "Digi charge", 50, 0., 300.);
0125     meAdcLayer3Ring3_ = ibooker.book1D("adc_layer3ring3", "Digi charge", 50, 0., 300.);
0126     meAdcLayer3Ring4_ = ibooker.book1D("adc_layer3ring4", "Digi charge", 50, 0., 300.);
0127     meAdcLayer3Ring5_ = ibooker.book1D("adc_layer3ring5", "Digi charge", 50, 0., 300.);
0128     meAdcLayer3Ring6_ = ibooker.book1D("adc_layer3ring6", "Digi charge", 50, 0., 300.);
0129     meAdcLayer3Ring7_ = ibooker.book1D("adc_layer3ring7", "Digi charge", 50, 0., 300.);
0130     meAdcLayer3Ring8_ = ibooker.book1D("adc_layer3ring8", "Digi charge", 50, 0., 300.);
0131 
0132     meRowLayer3Ring1_ = ibooker.book1D("row_layer3ring1", "Digi row", 50, 0., 200.);
0133     meRowLayer3Ring2_ = ibooker.book1D("row_layer3ring2", "Digi row", 50, 0., 200.);
0134     meRowLayer3Ring3_ = ibooker.book1D("row_layer3ring3", "Digi row", 50, 0., 200.);
0135     meRowLayer3Ring4_ = ibooker.book1D("row_layer3ring4", "Digi row", 50, 0., 200.);
0136     meRowLayer3Ring5_ = ibooker.book1D("row_layer3ring5", "Digi row", 50, 0., 200.);
0137     meRowLayer3Ring6_ = ibooker.book1D("row_layer3ring6", "Digi row", 50, 0., 200.);
0138     meRowLayer3Ring7_ = ibooker.book1D("row_layer3ring7", "Digi row", 50, 0., 200.);
0139     meRowLayer3Ring8_ = ibooker.book1D("row_layer3ring8", "Digi row", 50, 0., 200.);
0140 
0141     meColLayer3Ring1_ = ibooker.book1D("col_layer3ring1", "Digi column", 50, 0., 500.);
0142     meColLayer3Ring2_ = ibooker.book1D("col_layer3ring2", "Digi column", 50, 0., 500.);
0143     meColLayer3Ring3_ = ibooker.book1D("col_layer3ring3", "Digi column", 50, 0., 500.);
0144     meColLayer3Ring4_ = ibooker.book1D("col_layer3ring4", "Digi column", 50, 0., 500.);
0145     meColLayer3Ring5_ = ibooker.book1D("col_layer3ring5", "Digi column", 50, 0., 500.);
0146     meColLayer3Ring6_ = ibooker.book1D("col_layer3ring6", "Digi column", 50, 0., 500.);
0147     meColLayer3Ring7_ = ibooker.book1D("col_layer3ring7", "Digi column", 50, 0., 500.);
0148     meColLayer3Ring8_ = ibooker.book1D("col_layer3ring8", "Digi column", 50, 0., 500.);
0149 
0150     meDigiMultiLayer1Ladders_ =
0151         ibooker.bookProfile("digi_layer1_ladders", "Digi Num. per ladder", 22, 0.0, 21.0, 100, 0.0, 100);
0152     meDigiMultiLayer2Ladders_ =
0153         ibooker.bookProfile("digi_layer2_ladders", "Digi Num. per ladder", 34, 0.0, 32.0, 100, 0.0, 100);
0154     meDigiMultiLayer3Ladders_ =
0155         ibooker.bookProfile("digi_layer3_ladders", "Digi Num. per ladder", 46, 0.0, 45.0, 100, 0.0, 100);
0156 
0157     // Forward Pixel
0158     /* ZMinus Side 1st Disk */
0159     meAdcZmDisk1Panel1Plaq1_ = ibooker.book1D("adc_zm_disk1_panel1_plaq1", "Digi charge", 50, 0., 300.);
0160     meAdcZmDisk1Panel1Plaq2_ = ibooker.book1D("adc_zm_disk1_panel1_plaq2", "Digi charge", 50, 0., 300.);
0161     meAdcZmDisk1Panel1Plaq3_ = ibooker.book1D("adc_zm_disk1_panel1_plaq3", "Digi charge", 50, 0., 300.);
0162     meAdcZmDisk1Panel1Plaq4_ = ibooker.book1D("adc_zm_disk1_panel1_plaq4", "Digi charge", 50, 0., 300.);
0163     meAdcZmDisk1Panel2Plaq1_ = ibooker.book1D("adc_zm_disk1_panel2_plaq1", "Digi charge", 50, 0., 300.);
0164     meAdcZmDisk1Panel2Plaq2_ = ibooker.book1D("adc_zm_disk1_panel2_plaq2", "Digi charge", 50, 0., 300.);
0165     meAdcZmDisk1Panel2Plaq3_ = ibooker.book1D("adc_zm_disk1_panel2_plaq3", "Digi charge", 50, 0., 300.);
0166 
0167     meRowZmDisk1Panel1Plaq1_ = ibooker.book1D("row_zm_disk1_panel1_plaq1", "Digi row", 50, 0., 100.);
0168     meRowZmDisk1Panel1Plaq2_ = ibooker.book1D("row_zm_disk1_panel1_plaq2", "Digi row", 50, 0., 200.);
0169     meRowZmDisk1Panel1Plaq3_ = ibooker.book1D("row_zm_disk1_panel1_plaq3", "Digi row", 50, 0., 200.);
0170     meRowZmDisk1Panel1Plaq4_ = ibooker.book1D("row_zm_disk1_panel1_plaq4", "Digi row", 50, 0., 100.);
0171     meRowZmDisk1Panel2Plaq1_ = ibooker.book1D("row_zm_disk1_panel2_plaq1", "Digi row", 50, 0., 200.);
0172     meRowZmDisk1Panel2Plaq2_ = ibooker.book1D("row_zm_disk1_panel2_plaq2", "Digi row", 50, 0., 200.);
0173     meRowZmDisk1Panel2Plaq3_ = ibooker.book1D("row_zm_disk1_panel2_plaq3", "Digi row", 50, 0., 200.);
0174 
0175     meColZmDisk1Panel1Plaq1_ = ibooker.book1D("col_zm_disk1_panel1_plaq1", "Digi column", 50, 0., 150.);
0176     meColZmDisk1Panel1Plaq2_ = ibooker.book1D("col_zm_disk1_panel1_plaq2", "Digi column", 50, 0., 200.);
0177     meColZmDisk1Panel1Plaq3_ = ibooker.book1D("col_zm_disk1_panel1_plaq3", "Digi column", 50, 0., 250.);
0178     meColZmDisk1Panel1Plaq4_ = ibooker.book1D("col_zm_disk1_panel1_plaq4", "Digi column", 50, 0., 300.);
0179     meColZmDisk1Panel2Plaq1_ = ibooker.book1D("col_zm_disk1_panel2_plaq1", "Digi column", 50, 0., 200.);
0180     meColZmDisk1Panel2Plaq2_ = ibooker.book1D("col_zm_disk1_panel2_plaq2", "Digi column", 50, 0., 250.);
0181     meColZmDisk1Panel2Plaq3_ = ibooker.book1D("col_zm_disk1_panel2_plaq3", "Digi column", 50, 0., 300.);
0182     meNdigiZmDisk1PerPanel1_ =
0183         ibooker.book1D("digi_zm_disk1_panel1", "Digi Num. Panel1 Of 1st Disk In ZMinus Side ", 30, 0., 30.);
0184     meNdigiZmDisk1PerPanel2_ =
0185         ibooker.book1D("digi_zm_disk1_panel2", "Digi Num. Panel2 Of 1st Disk In ZMinus Side ", 30, 0., 30.);
0186 
0187     /* ZMius Side 2nd disk */
0188     meAdcZmDisk2Panel1Plaq1_ = ibooker.book1D("adc_zm_disk2_panel1_plaq1", "Digi charge", 50, 0., 300.);
0189     meAdcZmDisk2Panel1Plaq2_ = ibooker.book1D("adc_zm_disk2_panel1_plaq2", "Digi charge", 50, 0., 300.);
0190     meAdcZmDisk2Panel1Plaq3_ = ibooker.book1D("adc_zm_disk2_panel1_plaq3", "Digi charge", 50, 0., 300.);
0191     meAdcZmDisk2Panel1Plaq4_ = ibooker.book1D("adc_zm_disk2_panel1_plaq4", "Digi charge", 50, 0., 300.);
0192     meAdcZmDisk2Panel2Plaq1_ = ibooker.book1D("adc_zm_disk2_panel2_plaq1", "Digi charge", 50, 0., 300.);
0193     meAdcZmDisk2Panel2Plaq2_ = ibooker.book1D("adc_zm_disk2_panel2_plaq2", "Digi charge", 50, 0., 300.);
0194     meAdcZmDisk2Panel2Plaq3_ = ibooker.book1D("adc_zm_disk2_panel2_plaq3", "Digi charge", 50, 0., 300.);
0195 
0196     meRowZmDisk2Panel1Plaq1_ = ibooker.book1D("row_zm_disk2_panel1_plaq1", "Digi row", 50, 0., 100.);
0197     meRowZmDisk2Panel1Plaq2_ = ibooker.book1D("row_zm_disk2_panel1_plaq2", "Digi row", 50, 0., 200.);
0198     meRowZmDisk2Panel1Plaq3_ = ibooker.book1D("row_zm_disk2_panel1_plaq3", "Digi row", 50, 0., 200.);
0199     meRowZmDisk2Panel1Plaq4_ = ibooker.book1D("row_zm_disk2_panel1_plaq4", "Digi row", 50, 0., 100.);
0200     meRowZmDisk2Panel2Plaq1_ = ibooker.book1D("row_zm_disk2_panel2_plaq1", "Digi row", 50, 0., 200.);
0201     meRowZmDisk2Panel2Plaq2_ = ibooker.book1D("row_zm_disk2_panel2_plaq2", "Digi row", 50, 0., 200.);
0202     meRowZmDisk2Panel2Plaq3_ = ibooker.book1D("row_zm_disk2_panel2_plaq3", "Digi row", 50, 0., 200.);
0203 
0204     meColZmDisk2Panel1Plaq1_ = ibooker.book1D("col_zm_disk2_panel1_plaq1", "Digi Column", 50, 0., 150.);
0205     meColZmDisk2Panel1Plaq2_ = ibooker.book1D("col_zm_disk2_panel1_plaq2", "Digi Column", 50, 0., 200.);
0206     meColZmDisk2Panel1Plaq3_ = ibooker.book1D("col_zm_disk2_panel1_plaq3", "Digi Column", 50, 0., 250.);
0207     meColZmDisk2Panel1Plaq4_ = ibooker.book1D("col_zm_disk2_panel1_plaq4", "Digi Column", 50, 0., 300.);
0208     meColZmDisk2Panel2Plaq1_ = ibooker.book1D("col_zm_disk2_panel2_plaq1", "Digi Column", 50, 0., 200.);
0209     meColZmDisk2Panel2Plaq2_ = ibooker.book1D("col_zm_disk2_panel2_plaq2", "Digi Column", 50, 0., 250.);
0210     meColZmDisk2Panel2Plaq3_ = ibooker.book1D("col_zm_disk2_panel2_plaq3", "Digi Column", 50, 0., 300.);
0211     meNdigiZmDisk2PerPanel1_ =
0212         ibooker.book1D("digi_zm_disk2_panel1", "Digi Num. Panel1 Of 2nd Disk In ZMinus Side ", 30, 0., 30.);
0213     meNdigiZmDisk2PerPanel2_ =
0214         ibooker.book1D("digi_zm_disk2_panel2", "Digi Num. Panel2 Of 2nd Disk In ZMinus Side ", 30, 0., 30.);
0215 
0216     /* ZPlus Side 1st Disk */
0217     meAdcZpDisk1Panel1Plaq1_ = ibooker.book1D("adc_zp_disk1_panel1_plaq1", "Digi charge", 50, 0., 300.);
0218     meAdcZpDisk1Panel1Plaq2_ = ibooker.book1D("adc_zp_disk1_panel1_plaq2", "Digi charge", 50, 0., 300.);
0219     meAdcZpDisk1Panel1Plaq3_ = ibooker.book1D("adc_zp_disk1_panel1_plaq3", "Digi charge", 50, 0., 300.);
0220     meAdcZpDisk1Panel1Plaq4_ = ibooker.book1D("adc_zp_disk1_panel1_plaq4", "Digi charge", 50, 0., 300.);
0221     meAdcZpDisk1Panel2Plaq1_ = ibooker.book1D("adc_zp_disk1_panel2_plaq1", "Digi charge", 50, 0., 300.);
0222     meAdcZpDisk1Panel2Plaq2_ = ibooker.book1D("adc_zp_disk1_panel2_plaq2", "Digi charge", 50, 0., 300.);
0223     meAdcZpDisk1Panel2Plaq3_ = ibooker.book1D("adc_zp_disk1_panel2_plaq3", "Digi charge", 50, 0., 300.);
0224 
0225     meRowZpDisk1Panel1Plaq1_ = ibooker.book1D("row_zp_disk1_panel1_plaq1", "Digi row", 50, 0., 100.);
0226     meRowZpDisk1Panel1Plaq2_ = ibooker.book1D("row_zp_disk1_panel1_plaq2", "Digi row", 50, 0., 200.);
0227     meRowZpDisk1Panel1Plaq3_ = ibooker.book1D("row_zp_disk1_panel1_plaq3", "Digi row", 50, 0., 200.);
0228     meRowZpDisk1Panel1Plaq4_ = ibooker.book1D("row_zp_disk1_panel1_plaq4", "Digi row", 50, 0., 100.);
0229     meRowZpDisk1Panel2Plaq1_ = ibooker.book1D("row_zp_disk1_panel2_plaq1", "Digi row", 50, 0., 200.);
0230     meRowZpDisk1Panel2Plaq2_ = ibooker.book1D("row_zp_disk1_panel2_plaq2", "Digi row", 50, 0., 200.);
0231     meRowZpDisk1Panel2Plaq3_ = ibooker.book1D("row_zp_disk1_panel2_plaq3", "Digi row", 50, 0., 200.);
0232 
0233     meColZpDisk1Panel1Plaq1_ = ibooker.book1D("col_zp_disk1_panel1_plaq1", "Digi Column", 50, 0., 150.);
0234     meColZpDisk1Panel1Plaq2_ = ibooker.book1D("col_zp_disk1_panel1_plaq2", "Digi column", 50, 0., 200.);
0235     meColZpDisk1Panel1Plaq3_ = ibooker.book1D("col_zp_disk1_panel1_plaq3", "Digi column", 50, 0., 250.);
0236     meColZpDisk1Panel1Plaq4_ = ibooker.book1D("col_zp_disk1_panel1_plaq4", "Digi column", 50, 0., 300.);
0237     meColZpDisk1Panel2Plaq1_ = ibooker.book1D("col_zp_disk1_panel2_plaq1", "Digi column", 50, 0., 200.);
0238     meColZpDisk1Panel2Plaq2_ = ibooker.book1D("col_zp_disk1_panel2_plaq2", "Digi column", 50, 0., 250.);
0239     meColZpDisk1Panel2Plaq3_ = ibooker.book1D("col_zp_disk1_panel2_plaq3", "Digi column", 50, 0., 300.);
0240     meNdigiZpDisk1PerPanel1_ =
0241         ibooker.book1D("digi_zp_disk1_panel1", "Digi Num. Panel1 Of 1st Disk In ZPlus Side ", 30, 0., 30.);
0242     meNdigiZpDisk1PerPanel2_ =
0243         ibooker.book1D("digi_zp_disk1_panel2", "Digi Num. Panel2 Of 1st Disk In ZPlus Side ", 30, 0., 30.);
0244 
0245     /* ZPlus Side 2nd disk */
0246     meAdcZpDisk2Panel1Plaq1_ = ibooker.book1D("adc_zp_disk2_panel1_plaq1", "Digi charge", 50, 0., 300.);
0247     meAdcZpDisk2Panel1Plaq2_ = ibooker.book1D("adc_zp_disk2_panel1_plaq2", "Digi charge", 50, 0., 300.);
0248     meAdcZpDisk2Panel1Plaq3_ = ibooker.book1D("adc_zp_disk2_panel1_plaq3", "Digi charge", 50, 0., 300.);
0249     meAdcZpDisk2Panel1Plaq4_ = ibooker.book1D("adc_zp_disk2_panel1_plaq4", "Digi charge", 50, 0., 300.);
0250     meAdcZpDisk2Panel2Plaq1_ = ibooker.book1D("adc_zp_disk2_panel2_plaq1", "Digi charge", 50, 0., 300.);
0251     meAdcZpDisk2Panel2Plaq2_ = ibooker.book1D("adc_zp_disk2_panel2_plaq2", "Digi charge", 50, 0., 300.);
0252     meAdcZpDisk2Panel2Plaq3_ = ibooker.book1D("adc_zp_disk2_panel2_plaq3", "Digi charge", 50, 0., 300.);
0253 
0254     meRowZpDisk2Panel1Plaq1_ = ibooker.book1D("row_zp_disk2_panel1_plaq1", "Digi row", 10, 0., 100.);
0255     meRowZpDisk2Panel1Plaq2_ = ibooker.book1D("row_zp_disk2_panel1_plaq2", "Digi row", 10, 0., 200.);
0256     meRowZpDisk2Panel1Plaq3_ = ibooker.book1D("row_zp_disk2_panel1_plaq3", "Digi row", 10, 0., 200.);
0257     meRowZpDisk2Panel1Plaq4_ = ibooker.book1D("row_zp_disk2_panel1_plaq4", "Digi row", 10, 0., 100.);
0258     meRowZpDisk2Panel2Plaq1_ = ibooker.book1D("row_zp_disk2_panel2_plaq1", "Digi row", 10, 0., 200.);
0259     meRowZpDisk2Panel2Plaq2_ = ibooker.book1D("row_zp_disk2_panel2_plaq2", "Digi row", 10, 0., 200.);
0260     meRowZpDisk2Panel2Plaq3_ = ibooker.book1D("row_zp_disk2_panel2_plaq3", "Digi row", 10, 0., 200.);
0261 
0262     meColZpDisk2Panel1Plaq1_ = ibooker.book1D("col_zp_disk2_panel1_plaq1", "Digi column", 50, 0., 150.);
0263     meColZpDisk2Panel1Plaq2_ = ibooker.book1D("col_zp_disk2_panel1_plaq2", "Digi column", 50, 0., 200.);
0264     meColZpDisk2Panel1Plaq3_ = ibooker.book1D("col_zp_disk2_panel1_plaq3", "Digi column", 50, 0., 250.);
0265     meColZpDisk2Panel1Plaq4_ = ibooker.book1D("col_zp_disk2_panel1_plaq4", "Digi column", 50, 0., 300.);
0266     meColZpDisk2Panel2Plaq1_ = ibooker.book1D("col_zp_disk2_panel2_plaq1", "Digi column", 50, 0., 200.);
0267     meColZpDisk2Panel2Plaq2_ = ibooker.book1D("col_zp_disk2_panel2_plaq2", "Digi column", 50, 0., 250.);
0268     meColZpDisk2Panel2Plaq3_ = ibooker.book1D("col_zp_disk2_panel2_plaq3", "Digi column", 50, 0., 300.);
0269     meNdigiZpDisk2PerPanel1_ =
0270         ibooker.book1D("digi_zp_disk2_panel1", "Digi Num. Panel1 Of 2nd Disk In ZPlus Side ", 30, 0., 30.);
0271     meNdigiZpDisk2PerPanel2_ =
0272         ibooker.book1D("digi_zp_disk2_panel2", "Digi Num. Panel2 Of 2nd Disk In ZPlus Side ", 30, 0., 30.);
0273   }
0274 }
0275 
0276 void SiPixelDigiValid::analyze(const edm::Event &e, const edm::EventSetup &c) {
0277   // Retrieve tracker topology from geometry
0278   const TrackerTopology *const tTopo = &c.getData(m_topoToken);
0279   // Number of blades and ladders.
0280   // TODO: other Geometry-Dependent quantities, e.g. num layers.
0281   int nblades = tracker->posPixelForwardLayers()[0]->components().size();
0282   int nladders1 = tracker->pixelBarrelLayers()[0]->components().size();
0283   int nladders2 = tracker->pixelBarrelLayers()[1]->components().size();
0284   int nladders3 = tracker->pixelBarrelLayers()[2]->components().size();
0285 
0286   int ndigiperRingLayer1[8];
0287   int ndigiperRingLayer2[8];
0288   int ndigiperRingLayer3[8];
0289   for (int i = 0; i < 8; i++) {
0290     ndigiperRingLayer1[i] = 0;
0291     ndigiperRingLayer2[i] = 0;
0292     ndigiperRingLayer3[i] = 0;
0293   }
0294 
0295   int ndigiZpDisk1PerPanel1[nblades];
0296   int ndigiZpDisk1PerPanel2[nblades];
0297   int ndigiZpDisk2PerPanel1[nblades];
0298   int ndigiZpDisk2PerPanel2[nblades];
0299   int ndigiZmDisk1PerPanel1[nblades];
0300   int ndigiZmDisk1PerPanel2[nblades];
0301   int ndigiZmDisk2PerPanel1[nblades];
0302   int ndigiZmDisk2PerPanel2[nblades];
0303 
0304   for (int i = 0; i < nblades; i++) {
0305     ndigiZpDisk1PerPanel1[i] = 0;
0306     ndigiZpDisk1PerPanel2[i] = 0;
0307     ndigiZpDisk2PerPanel1[i] = 0;
0308     ndigiZpDisk2PerPanel2[i] = 0;
0309     ndigiZmDisk1PerPanel1[i] = 0;
0310     ndigiZmDisk1PerPanel2[i] = 0;
0311     ndigiZmDisk2PerPanel1[i] = 0;
0312     ndigiZmDisk2PerPanel2[i] = 0;
0313   }
0314 
0315   int ndigilayer1ladders[nladders1];
0316   int ndigilayer2ladders[nladders2];
0317   int ndigilayer3ladders[nladders3];
0318 
0319   for (int i = 0; i < nladders1; i++) {
0320     ndigilayer1ladders[i] = 0;
0321   }
0322 
0323   for (int i = 0; i < nladders2; i++) {
0324     ndigilayer2ladders[i] = 0;
0325   }
0326 
0327   for (int i = 0; i < nladders3; i++) {
0328     ndigilayer3ladders[i] = 0;
0329   }
0330 
0331   // LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " <<
0332   // e.id().event();
0333 
0334   // string digiProducer = "siPixelDigis";
0335   edm::Handle<edm::DetSetVector<PixelDigi>> pixelDigis;
0336   e.getByToken(edmDetSetVector_PixelDigi_Token_, pixelDigis);
0337 
0338   edm::DetSetVector<PixelDigi>::const_iterator DSViter = pixelDigis->begin();
0339   for (; DSViter != pixelDigis->end(); DSViter++) {
0340     unsigned int id = DSViter->id;
0341     DetId detId(id);
0342     edm::DetSet<PixelDigi>::const_iterator begin = DSViter->data.begin();
0343     edm::DetSet<PixelDigi>::const_iterator end = DSViter->data.end();
0344     edm::DetSet<PixelDigi>::const_iterator iter;
0345 
0346     if (detId.subdetId() == PixelSubdetector::PixelBarrel) {
0347       unsigned int layer = tTopo->pxbLayer(id);    // Layer:1,2,3.
0348       unsigned int ladder = tTopo->pxbLadder(id);  // Ladeer: 1-20, 32, 44.
0349       unsigned int zindex = tTopo->pxbModule(id);  // Z-index: 1-8.
0350       // LogInfo("SiPixelDigiValid")<<"Barrel:: Layer="<<layer<<"
0351       // Ladder="<<ladder<<" zindex="<<zindex;
0352       for (iter = begin; iter != end; iter++) {
0353         if (layer == 1) {
0354           ++ndigilayer1ladders[ladder - 1];
0355           ++ndigiperRingLayer1[zindex - 1];
0356           if (zindex == 1) {
0357             meAdcLayer1Ring1_->Fill((*iter).adc());
0358             meRowLayer1Ring1_->Fill((*iter).row());
0359             meColLayer1Ring1_->Fill((*iter).column());
0360           }
0361           if (zindex == 2) {
0362             meAdcLayer1Ring2_->Fill((*iter).adc());
0363             meRowLayer1Ring2_->Fill((*iter).row());
0364             meColLayer1Ring2_->Fill((*iter).column());
0365           }
0366 
0367           if (zindex == 3) {
0368             meAdcLayer1Ring3_->Fill((*iter).adc());
0369             meRowLayer1Ring3_->Fill((*iter).row());
0370             meColLayer1Ring3_->Fill((*iter).column());
0371           }
0372 
0373           if (zindex == 4) {
0374             meAdcLayer1Ring4_->Fill((*iter).adc());
0375             meRowLayer1Ring4_->Fill((*iter).row());
0376             meColLayer1Ring4_->Fill((*iter).column());
0377           }
0378 
0379           if (zindex == 5) {
0380             meAdcLayer1Ring5_->Fill((*iter).adc());
0381             meRowLayer1Ring5_->Fill((*iter).row());
0382             meColLayer1Ring5_->Fill((*iter).column());
0383           }
0384 
0385           if (zindex == 6) {
0386             meAdcLayer1Ring6_->Fill((*iter).adc());
0387             meRowLayer1Ring6_->Fill((*iter).row());
0388             meColLayer1Ring6_->Fill((*iter).column());
0389           }
0390 
0391           if (zindex == 7) {
0392             meAdcLayer1Ring7_->Fill((*iter).adc());
0393             meRowLayer1Ring7_->Fill((*iter).row());
0394             meColLayer1Ring7_->Fill((*iter).column());
0395           }
0396           if (zindex == 8) {
0397             meAdcLayer1Ring8_->Fill((*iter).adc());
0398             meRowLayer1Ring8_->Fill((*iter).row());
0399             meColLayer1Ring8_->Fill((*iter).column());
0400           }
0401         }
0402         if (layer == 2) {
0403           ++ndigilayer2ladders[ladder - 1];
0404           ++ndigiperRingLayer2[zindex - 1];
0405           if (zindex == 1) {
0406             meAdcLayer2Ring1_->Fill((*iter).adc());
0407             meRowLayer2Ring1_->Fill((*iter).row());
0408             meColLayer2Ring1_->Fill((*iter).column());
0409           }
0410           if (zindex == 2) {
0411             meAdcLayer2Ring2_->Fill((*iter).adc());
0412             meRowLayer2Ring2_->Fill((*iter).row());
0413             meColLayer2Ring2_->Fill((*iter).column());
0414           }
0415 
0416           if (zindex == 3) {
0417             meAdcLayer2Ring3_->Fill((*iter).adc());
0418             meRowLayer2Ring3_->Fill((*iter).row());
0419             meColLayer2Ring3_->Fill((*iter).column());
0420           }
0421 
0422           if (zindex == 4) {
0423             meAdcLayer2Ring4_->Fill((*iter).adc());
0424             meRowLayer2Ring4_->Fill((*iter).row());
0425             meColLayer2Ring4_->Fill((*iter).column());
0426           }
0427 
0428           if (zindex == 5) {
0429             meAdcLayer2Ring5_->Fill((*iter).adc());
0430             meRowLayer2Ring5_->Fill((*iter).row());
0431             meColLayer2Ring5_->Fill((*iter).column());
0432           }
0433 
0434           if (zindex == 6) {
0435             meAdcLayer2Ring6_->Fill((*iter).adc());
0436             meRowLayer2Ring6_->Fill((*iter).row());
0437             meColLayer2Ring6_->Fill((*iter).column());
0438           }
0439 
0440           if (zindex == 7) {
0441             meAdcLayer2Ring7_->Fill((*iter).adc());
0442             meRowLayer2Ring7_->Fill((*iter).row());
0443             meColLayer2Ring7_->Fill((*iter).column());
0444           }
0445           if (zindex == 8) {
0446             meAdcLayer2Ring8_->Fill((*iter).adc());
0447             meRowLayer2Ring8_->Fill((*iter).row());
0448             meColLayer2Ring8_->Fill((*iter).column());
0449           }
0450         }
0451         if (layer == 3) {
0452           ++ndigilayer3ladders[ladder - 1];
0453           ++ndigiperRingLayer3[zindex - 1];
0454           if (zindex == 1) {
0455             meAdcLayer3Ring1_->Fill((*iter).adc());
0456             meRowLayer3Ring1_->Fill((*iter).row());
0457             meColLayer3Ring1_->Fill((*iter).column());
0458           }
0459           if (zindex == 2) {
0460             meAdcLayer3Ring2_->Fill((*iter).adc());
0461             meRowLayer3Ring2_->Fill((*iter).row());
0462             meColLayer3Ring2_->Fill((*iter).column());
0463           }
0464 
0465           if (zindex == 3) {
0466             meAdcLayer3Ring3_->Fill((*iter).adc());
0467             meRowLayer3Ring3_->Fill((*iter).row());
0468             meColLayer3Ring3_->Fill((*iter).column());
0469           }
0470 
0471           if (zindex == 4) {
0472             meAdcLayer3Ring4_->Fill((*iter).adc());
0473             meRowLayer3Ring4_->Fill((*iter).row());
0474             meColLayer3Ring4_->Fill((*iter).column());
0475           }
0476 
0477           if (zindex == 5) {
0478             meAdcLayer3Ring5_->Fill((*iter).adc());
0479             meRowLayer3Ring5_->Fill((*iter).row());
0480             meColLayer3Ring5_->Fill((*iter).column());
0481           }
0482 
0483           if (zindex == 6) {
0484             meAdcLayer3Ring6_->Fill((*iter).adc());
0485             meRowLayer3Ring6_->Fill((*iter).row());
0486             meColLayer3Ring6_->Fill((*iter).column());
0487           }
0488 
0489           if (zindex == 7) {
0490             meAdcLayer3Ring7_->Fill((*iter).adc());
0491             meRowLayer3Ring7_->Fill((*iter).row());
0492             meColLayer3Ring7_->Fill((*iter).column());
0493           }
0494           if (zindex == 8) {
0495             meAdcLayer3Ring8_->Fill((*iter).adc());
0496             meRowLayer3Ring8_->Fill((*iter).row());
0497             meColLayer3Ring8_->Fill((*iter).column());
0498           }
0499         }
0500       }
0501     }
0502 
0503     if (detId.subdetId() == PixelSubdetector::PixelEndcap) {  // Endcap
0504 
0505       unsigned int side = tTopo->pxfSide(id);
0506       unsigned int disk = tTopo->pxfDisk(id);
0507       unsigned int blade = tTopo->pxfBlade(id);
0508       unsigned int panel = tTopo->pxfPanel(id);
0509       unsigned int mod = tTopo->pxfModule(id);
0510       // LogInfo("SiPixelDigiValid")<<"EndcaP="<<side<<" Disk="<<disk<<"
0511       // Blade="<<blade<<" Panel="<<panel<<" Module="<<mod;
0512       for (iter = begin; iter != end; iter++) {
0513         if (side == 1 && disk == 1 && panel == 1) {
0514           if (mod == 1) {
0515             meAdcZmDisk1Panel1Plaq1_->Fill((*iter).adc());
0516             meRowZmDisk1Panel1Plaq1_->Fill((*iter).row());
0517             meColZmDisk1Panel1Plaq1_->Fill((*iter).column());
0518           } else if (mod == 2) {
0519             meAdcZmDisk1Panel1Plaq2_->Fill((*iter).adc());
0520             meRowZmDisk1Panel1Plaq2_->Fill((*iter).row());
0521             meColZmDisk1Panel1Plaq2_->Fill((*iter).column());
0522           } else if (mod == 3) {
0523             meAdcZmDisk1Panel1Plaq3_->Fill((*iter).adc());
0524             meRowZmDisk1Panel1Plaq3_->Fill((*iter).row());
0525             meColZmDisk1Panel1Plaq3_->Fill((*iter).column());
0526           } else if (mod == 4) {
0527             meAdcZmDisk1Panel1Plaq4_->Fill((*iter).adc());
0528             meRowZmDisk1Panel1Plaq4_->Fill((*iter).row());
0529             meColZmDisk1Panel1Plaq4_->Fill((*iter).column());
0530           } else {
0531             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0532           }
0533           ++ndigiZmDisk1PerPanel1[blade - 1];
0534         }
0535 
0536         if (side == 1 && disk == 1 && panel == 2) {
0537           if (mod == 1) {
0538             meAdcZmDisk1Panel2Plaq1_->Fill((*iter).adc());
0539             meRowZmDisk1Panel2Plaq1_->Fill((*iter).row());
0540             meColZmDisk1Panel2Plaq1_->Fill((*iter).column());
0541           } else if (mod == 2) {
0542             meAdcZmDisk1Panel2Plaq2_->Fill((*iter).adc());
0543             meRowZmDisk1Panel2Plaq2_->Fill((*iter).row());
0544             meColZmDisk1Panel2Plaq2_->Fill((*iter).column());
0545           } else if (mod == 3) {
0546             meAdcZmDisk1Panel2Plaq3_->Fill((*iter).adc());
0547             meRowZmDisk1Panel2Plaq3_->Fill((*iter).row());
0548             meColZmDisk1Panel2Plaq3_->Fill((*iter).column());
0549           } else {
0550             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0551           }
0552           ++ndigiZmDisk1PerPanel2[blade - 1];
0553         }
0554 
0555         if (side == 1 && disk == 2 && panel == 1) {
0556           if (mod == 1) {
0557             meAdcZmDisk2Panel1Plaq1_->Fill((*iter).adc());
0558             meRowZmDisk2Panel1Plaq1_->Fill((*iter).row());
0559             meColZmDisk2Panel1Plaq1_->Fill((*iter).column());
0560           } else if (mod == 2) {
0561             meAdcZmDisk2Panel1Plaq2_->Fill((*iter).adc());
0562             meRowZmDisk2Panel1Plaq2_->Fill((*iter).row());
0563             meColZmDisk2Panel1Plaq2_->Fill((*iter).column());
0564           } else if (mod == 3) {
0565             meAdcZmDisk2Panel1Plaq3_->Fill((*iter).adc());
0566             meRowZmDisk2Panel1Plaq3_->Fill((*iter).row());
0567             meColZmDisk2Panel1Plaq3_->Fill((*iter).column());
0568           } else if (mod == 4) {
0569             meAdcZmDisk2Panel1Plaq4_->Fill((*iter).adc());
0570             meRowZmDisk2Panel1Plaq4_->Fill((*iter).row());
0571             meColZmDisk2Panel1Plaq4_->Fill((*iter).column());
0572           } else {
0573             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0574           }
0575           ++ndigiZmDisk2PerPanel1[blade - 1];
0576         }
0577 
0578         if (side == 1 && disk == 2 && panel == 2) {
0579           if (mod == 1) {
0580             meAdcZmDisk2Panel2Plaq1_->Fill((*iter).adc());
0581             meRowZmDisk2Panel2Plaq1_->Fill((*iter).row());
0582             meColZmDisk2Panel2Plaq1_->Fill((*iter).column());
0583           } else if (mod == 2) {
0584             meAdcZmDisk2Panel2Plaq2_->Fill((*iter).adc());
0585             meRowZmDisk2Panel2Plaq2_->Fill((*iter).row());
0586             meColZmDisk2Panel2Plaq2_->Fill((*iter).column());
0587           } else if (mod == 3) {
0588             meAdcZmDisk2Panel2Plaq3_->Fill((*iter).adc());
0589             meRowZmDisk2Panel2Plaq3_->Fill((*iter).row());
0590             meColZmDisk2Panel2Plaq3_->Fill((*iter).column());
0591           } else {
0592             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0593           }
0594           ++ndigiZmDisk2PerPanel2[blade - 1];
0595         }
0596 
0597         if (side == 2 && disk == 1 && panel == 1) {
0598           if (mod == 1) {
0599             meAdcZpDisk1Panel1Plaq1_->Fill((*iter).adc());
0600             meRowZpDisk1Panel1Plaq1_->Fill((*iter).row());
0601             meColZpDisk1Panel1Plaq1_->Fill((*iter).column());
0602           } else if (mod == 2) {
0603             meAdcZpDisk1Panel1Plaq2_->Fill((*iter).adc());
0604             meRowZpDisk1Panel1Plaq2_->Fill((*iter).row());
0605             meColZpDisk1Panel1Plaq2_->Fill((*iter).column());
0606           } else if (mod == 3) {
0607             meAdcZpDisk1Panel1Plaq3_->Fill((*iter).adc());
0608             meRowZpDisk1Panel1Plaq3_->Fill((*iter).row());
0609             meColZpDisk1Panel1Plaq3_->Fill((*iter).column());
0610           } else if (mod == 4) {
0611             meAdcZpDisk1Panel1Plaq4_->Fill((*iter).adc());
0612             meRowZpDisk1Panel1Plaq4_->Fill((*iter).row());
0613             meColZpDisk1Panel1Plaq4_->Fill((*iter).column());
0614           } else {
0615             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0616           }
0617           ++ndigiZpDisk1PerPanel1[blade - 1];
0618         }
0619 
0620         if (side == 2 && disk == 1 && panel == 2) {
0621           if (mod == 1) {
0622             meAdcZpDisk1Panel2Plaq1_->Fill((*iter).adc());
0623             meRowZpDisk1Panel2Plaq1_->Fill((*iter).row());
0624             meColZpDisk1Panel2Plaq1_->Fill((*iter).column());
0625           } else if (mod == 2) {
0626             meAdcZpDisk1Panel2Plaq2_->Fill((*iter).adc());
0627             meRowZpDisk1Panel2Plaq2_->Fill((*iter).row());
0628             meColZpDisk1Panel2Plaq2_->Fill((*iter).column());
0629           } else if (mod == 3) {
0630             meAdcZpDisk1Panel2Plaq3_->Fill((*iter).adc());
0631             meRowZpDisk1Panel2Plaq3_->Fill((*iter).row());
0632             meColZpDisk1Panel2Plaq3_->Fill((*iter).column());
0633           } else {
0634             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0635           }
0636           ++ndigiZpDisk1PerPanel2[blade - 1];
0637         }
0638 
0639         if (side == 2 && disk == 2 && panel == 1) {
0640           if (mod == 1) {
0641             meAdcZpDisk2Panel1Plaq1_->Fill((*iter).adc());
0642             meRowZpDisk2Panel1Plaq1_->Fill((*iter).row());
0643             meColZpDisk2Panel1Plaq1_->Fill((*iter).column());
0644           } else if (mod == 2) {
0645             meAdcZpDisk2Panel1Plaq2_->Fill((*iter).adc());
0646             meRowZpDisk2Panel1Plaq2_->Fill((*iter).row());
0647             meColZpDisk2Panel1Plaq2_->Fill((*iter).column());
0648           } else if (mod == 3) {
0649             meAdcZpDisk2Panel1Plaq3_->Fill((*iter).adc());
0650             meRowZpDisk2Panel1Plaq3_->Fill((*iter).row());
0651             meColZpDisk2Panel1Plaq3_->Fill((*iter).column());
0652           } else if (mod == 4) {
0653             meAdcZpDisk2Panel1Plaq4_->Fill((*iter).adc());
0654             meRowZpDisk2Panel1Plaq4_->Fill((*iter).row());
0655             meColZpDisk2Panel1Plaq4_->Fill((*iter).column());
0656           } else {
0657             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0658           }
0659           ++ndigiZpDisk2PerPanel1[blade - 1];
0660         }
0661 
0662         if (side == 2 && disk == 2 && panel == 2) {
0663           if (mod == 1) {
0664             meAdcZpDisk2Panel2Plaq1_->Fill((*iter).adc());
0665             meRowZpDisk2Panel2Plaq1_->Fill((*iter).row());
0666             meColZpDisk2Panel2Plaq1_->Fill((*iter).column());
0667           } else if (mod == 2) {
0668             meAdcZpDisk2Panel2Plaq2_->Fill((*iter).adc());
0669             meRowZpDisk2Panel2Plaq2_->Fill((*iter).row());
0670             meColZpDisk2Panel2Plaq2_->Fill((*iter).column());
0671           } else if (mod == 3) {
0672             meAdcZpDisk2Panel2Plaq3_->Fill((*iter).adc());
0673             meRowZpDisk2Panel2Plaq3_->Fill((*iter).row());
0674             meColZpDisk2Panel2Plaq3_->Fill((*iter).column());
0675           } else {
0676             // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
0677           }
0678           ++ndigiZpDisk2PerPanel2[blade - 1];
0679         }
0680       }  // iterating the digi
0681 
0682     }  // Endcap
0683 
0684   }  // end for loop
0685 
0686   meDigiMultiLayer1Ring1_->Fill(ndigiperRingLayer1[0]);
0687   meDigiMultiLayer1Ring2_->Fill(ndigiperRingLayer1[1]);
0688   meDigiMultiLayer1Ring3_->Fill(ndigiperRingLayer1[2]);
0689   meDigiMultiLayer1Ring4_->Fill(ndigiperRingLayer1[3]);
0690   meDigiMultiLayer1Ring5_->Fill(ndigiperRingLayer1[4]);
0691   meDigiMultiLayer1Ring6_->Fill(ndigiperRingLayer1[5]);
0692   meDigiMultiLayer1Ring7_->Fill(ndigiperRingLayer1[6]);
0693   meDigiMultiLayer1Ring8_->Fill(ndigiperRingLayer1[7]);
0694 
0695   meDigiMultiLayer2Ring1_->Fill(ndigiperRingLayer2[0]);
0696   meDigiMultiLayer2Ring2_->Fill(ndigiperRingLayer2[1]);
0697   meDigiMultiLayer2Ring3_->Fill(ndigiperRingLayer2[2]);
0698   meDigiMultiLayer2Ring4_->Fill(ndigiperRingLayer2[3]);
0699   meDigiMultiLayer2Ring5_->Fill(ndigiperRingLayer2[4]);
0700   meDigiMultiLayer2Ring6_->Fill(ndigiperRingLayer2[5]);
0701   meDigiMultiLayer2Ring7_->Fill(ndigiperRingLayer2[6]);
0702   meDigiMultiLayer2Ring8_->Fill(ndigiperRingLayer2[7]);
0703 
0704   meDigiMultiLayer3Ring1_->Fill(ndigiperRingLayer3[0]);
0705   meDigiMultiLayer3Ring2_->Fill(ndigiperRingLayer3[1]);
0706   meDigiMultiLayer3Ring3_->Fill(ndigiperRingLayer3[2]);
0707   meDigiMultiLayer3Ring4_->Fill(ndigiperRingLayer3[3]);
0708   meDigiMultiLayer3Ring5_->Fill(ndigiperRingLayer3[4]);
0709   meDigiMultiLayer3Ring6_->Fill(ndigiperRingLayer3[5]);
0710   meDigiMultiLayer3Ring7_->Fill(ndigiperRingLayer3[6]);
0711   meDigiMultiLayer3Ring8_->Fill(ndigiperRingLayer3[7]);
0712 
0713   for (int i = 0; i < nblades; i++) {
0714     meNdigiZmDisk1PerPanel1_->Fill(ndigiZmDisk1PerPanel1[i]);
0715     meNdigiZmDisk1PerPanel2_->Fill(ndigiZmDisk1PerPanel2[i]);
0716     meNdigiZmDisk2PerPanel1_->Fill(ndigiZmDisk2PerPanel1[i]);
0717     meNdigiZmDisk2PerPanel2_->Fill(ndigiZmDisk2PerPanel2[i]);
0718     meNdigiZpDisk1PerPanel1_->Fill(ndigiZpDisk1PerPanel1[i]);
0719     meNdigiZpDisk1PerPanel2_->Fill(ndigiZpDisk1PerPanel2[i]);
0720     meNdigiZpDisk2PerPanel1_->Fill(ndigiZpDisk2PerPanel1[i]);
0721     meNdigiZpDisk2PerPanel2_->Fill(ndigiZpDisk2PerPanel2[i]);
0722   }
0723 
0724   for (int i = 0; i < nladders1; i++) {
0725     meDigiMultiLayer1Ladders_->Fill(i + 1, ndigilayer1ladders[i]);
0726   }
0727 
0728   for (int i = 0; i < nladders2; i++) {
0729     meDigiMultiLayer2Ladders_->Fill(i + 1, ndigilayer2ladders[i]);
0730   }
0731 
0732   for (int i = 0; i < nladders3; i++) {
0733     meDigiMultiLayer3Ladders_->Fill(i + 1, ndigilayer3ladders[i]);
0734   }
0735 }