CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc

Go to the documentation of this file.
00001 #include "Validation/TrackerDigis/interface/SiPixelDigiValid.h"
00002 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00003 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00004 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00005 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetType.h"
00006 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00007 #include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
00008 #include "DataFormats/Common/interface/DetSetVector.h"
00009 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00010 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00011 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00012 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00013 #include "DQMServices/Core/interface/DQMStore.h"
00014 
00015 using namespace std;
00016 using namespace edm;
00017 
00018 SiPixelDigiValid::SiPixelDigiValid(const ParameterSet& ps):dbe_(0){
00019   
00020    
00021  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "pixeldigihisto.root");
00022  src_ =  ps.getParameter<edm::InputTag>( "src" );
00023 
00024 
00025    dbe_ = Service<DQMStore>().operator->();
00026   
00027  if ( dbe_ ) {
00028     dbe_->setCurrentFolder("TrackerDigisV/TrackerDigis/Pixel");
00029 
00030    meDigiMultiLayer1Ring1_ =  dbe_->book1D("digimulti_layer1ring1","Digi Multiplicity ",30, 0., 30.);
00031    meDigiMultiLayer1Ring2_ =  dbe_->book1D("digimulti_layer1ring2","Digi Multiplicity ",30, 0., 30.);
00032    meDigiMultiLayer1Ring3_ =  dbe_->book1D("digimulti_layer1ring3","Digi Multiplicity ",30, 0., 30.);
00033    meDigiMultiLayer1Ring4_ =  dbe_->book1D("digimulti_layer1ring4","Digi Multiplicity ",30, 0., 30.);
00034    meDigiMultiLayer1Ring5_ =  dbe_->book1D("digimulti_layer1ring5","Digi Multiplicity ",30, 0., 30.);
00035    meDigiMultiLayer1Ring6_ =  dbe_->book1D("digimulti_layer1ring6","Digi Multiplicity ",30, 0., 30.);
00036    meDigiMultiLayer1Ring7_ =  dbe_->book1D("digimulti_layer1ring7","Digi Multiplicity ",30, 0., 30.);
00037    meDigiMultiLayer1Ring8_ =  dbe_->book1D("digimulti_layer1ring8","Digi Multiplicity ",30, 0., 30.);
00038 
00039    meDigiMultiLayer2Ring1_ =  dbe_->book1D("digimulti_layer2ring1","Digi Multiplicity ",30, 0., 30.);
00040    meDigiMultiLayer2Ring2_ =  dbe_->book1D("digimulti_layer2ring2","Digi Multiplicity ",30, 0., 30.);
00041    meDigiMultiLayer2Ring3_ =  dbe_->book1D("digimulti_layer2ring3","Digi Multiplicity ",30, 0., 30.);
00042    meDigiMultiLayer2Ring4_ =  dbe_->book1D("digimulti_layer2ring4","Digi Multiplicity ",30, 0., 30.);
00043    meDigiMultiLayer2Ring5_ =  dbe_->book1D("digimulti_layer2ring5","Digi Multiplicity ",30, 0., 30.);
00044    meDigiMultiLayer2Ring6_ =  dbe_->book1D("digimulti_layer2ring6","Digi Multiplicity ",30, 0., 30.);
00045    meDigiMultiLayer2Ring7_ =  dbe_->book1D("digimulti_layer2ring7","Digi Multiplicity ",30, 0., 30.);
00046    meDigiMultiLayer2Ring8_ =  dbe_->book1D("digimulti_layer2ring8","Digi Multiplicity ",30, 0., 30.);
00047 
00048    meDigiMultiLayer3Ring1_ =  dbe_->book1D("digimulti_layer3ring1","Digi Multiplicity ",30, 0., 30.);
00049    meDigiMultiLayer3Ring2_ =  dbe_->book1D("digimulti_layer3ring2","Digi Multiplicity ",30, 0., 30.);
00050    meDigiMultiLayer3Ring3_ =  dbe_->book1D("digimulti_layer3ring3","Digi Multiplicity ",30, 0., 30.);
00051    meDigiMultiLayer3Ring4_ =  dbe_->book1D("digimulti_layer3ring4","Digi Multiplicity ",30, 0., 30.);
00052    meDigiMultiLayer3Ring5_ =  dbe_->book1D("digimulti_layer3ring5","Digi Multiplicity ",30, 0., 30.);
00053    meDigiMultiLayer3Ring6_ =  dbe_->book1D("digimulti_layer3ring6","Digi Multiplicity ",30, 0., 30.);
00054    meDigiMultiLayer3Ring7_ =  dbe_->book1D("digimulti_layer3ring7","Digi Multiplicity ",30, 0., 30.);
00055    meDigiMultiLayer3Ring8_ =  dbe_->book1D("digimulti_layer3ring8","Digi Multiplicity ",30, 0., 30.);
00056   
00058    meAdcLayer1Ring1_ = dbe_->book1D("adc_layer1ring1","Digi charge",50, 0., 300.);
00059    meAdcLayer1Ring2_ = dbe_->book1D("adc_layer1ring2","Digi charge",50, 0., 300.);
00060    meAdcLayer1Ring3_ = dbe_->book1D("adc_layer1ring3","Digi charge",50, 0., 300.);
00061    meAdcLayer1Ring4_ = dbe_->book1D("adc_layer1ring4","Digi charge",50, 0., 300.);
00062    meAdcLayer1Ring5_ = dbe_->book1D("adc_layer1ring5","Digi charge",50, 0., 300.);
00063    meAdcLayer1Ring6_ = dbe_->book1D("adc_layer1ring6","Digi charge",50, 0., 300.);
00064    meAdcLayer1Ring7_ = dbe_->book1D("adc_layer1ring7","Digi charge",50, 0., 300.);
00065    meAdcLayer1Ring8_ = dbe_->book1D("adc_layer1ring8","Digi charge",50, 0., 300.);
00066 
00067    meRowLayer1Ring1_ = dbe_->book1D("row_layer1ring1","Digi row",50, 0., 200.);
00068    meRowLayer1Ring2_ = dbe_->book1D("row_layer1ring2","Digi row",50, 0., 200.);
00069    meRowLayer1Ring3_ = dbe_->book1D("row_layer1ring3","Digi row",50, 0., 200.);
00070    meRowLayer1Ring4_ = dbe_->book1D("row_layer1ring4","Digi row",50, 0., 200.);
00071    meRowLayer1Ring5_ = dbe_->book1D("row_layer1ring5","Digi row",50, 0., 200.);
00072    meRowLayer1Ring6_ = dbe_->book1D("row_layer1ring6","Digi row",50, 0., 200.);
00073    meRowLayer1Ring7_ = dbe_->book1D("row_layer1ring7","Digi row",50, 0., 200.);
00074    meRowLayer1Ring8_ = dbe_->book1D("row_layer1ring8","Digi row",50, 0., 200.);
00075 
00076    meColLayer1Ring1_ = dbe_->book1D("col_layer1ring1","Digi column",50, 0., 500.);
00077    meColLayer1Ring2_ = dbe_->book1D("col_layer1ring2","Digi column",50, 0., 500.);
00078    meColLayer1Ring3_ = dbe_->book1D("col_layer1ring3","Digi column",50, 0., 500.);
00079    meColLayer1Ring4_ = dbe_->book1D("col_layer1ring4","Digi column",50, 0., 500.);
00080    meColLayer1Ring5_ = dbe_->book1D("col_layer1ring5","Digi column",50, 0., 500.);
00081    meColLayer1Ring6_ = dbe_->book1D("col_layer1ring6","Digi column",50, 0., 500.);
00082    meColLayer1Ring7_ = dbe_->book1D("col_layer1ring7","Digi column",50, 0., 500.);
00083    meColLayer1Ring8_ = dbe_->book1D("col_layer1ring8","Digi column",50, 0., 500.);
00084    
00085 
00086    meAdcLayer2Ring1_ = dbe_->book1D("adc_layer2ring1","Digi charge",50, 0., 300.);
00087    meAdcLayer2Ring2_ = dbe_->book1D("adc_layer2ring2","Digi charge",50, 0., 300.);
00088    meAdcLayer2Ring3_ = dbe_->book1D("adc_layer2ring3","Digi charge",50, 0., 300.);
00089    meAdcLayer2Ring4_ = dbe_->book1D("adc_layer2ring4","Digi charge",50, 0., 300.);
00090    meAdcLayer2Ring5_ = dbe_->book1D("adc_layer2ring5","Digi charge",50, 0., 300.);
00091    meAdcLayer2Ring6_ = dbe_->book1D("adc_layer2ring6","Digi charge",50, 0., 300.);
00092    meAdcLayer2Ring7_ = dbe_->book1D("adc_layer2ring7","Digi charge",50, 0., 300.);
00093    meAdcLayer2Ring8_ = dbe_->book1D("adc_layer2ring8","Digi charge",50, 0., 300.);
00094 
00095    meRowLayer2Ring1_ = dbe_->book1D("row_layer2ring1","Digi row",50, 0., 200.);
00096    meRowLayer2Ring2_ = dbe_->book1D("row_layer2ring2","Digi row",50, 0., 200.);
00097    meRowLayer2Ring3_ = dbe_->book1D("row_layer2ring3","Digi row",50, 0., 200.);
00098    meRowLayer2Ring4_ = dbe_->book1D("row_layer2ring4","Digi row",50, 0., 200.);
00099    meRowLayer2Ring5_ = dbe_->book1D("row_layer2ring5","Digi row",50, 0., 200.);
00100    meRowLayer2Ring6_ = dbe_->book1D("row_layer2ring6","Digi row",50, 0., 200.);
00101    meRowLayer2Ring7_ = dbe_->book1D("row_layer2ring7","Digi row",50, 0., 200.);
00102    meRowLayer2Ring8_ = dbe_->book1D("row_layer2ring8","Digi row",50, 0., 200.);
00103 
00104    meColLayer2Ring1_ = dbe_->book1D("col_layer2ring1","Digi column",50, 0., 500.);
00105    meColLayer2Ring2_ = dbe_->book1D("col_layer2ring2","Digi column",50, 0., 500.);
00106    meColLayer2Ring3_ = dbe_->book1D("col_layer2ring3","Digi column",50, 0., 500.);
00107    meColLayer2Ring4_ = dbe_->book1D("col_layer2ring4","Digi column",50, 0., 500.);
00108    meColLayer2Ring5_ = dbe_->book1D("col_layer2ring5","Digi column",50, 0., 500.);
00109    meColLayer2Ring6_ = dbe_->book1D("col_layer2ring6","Digi column",50, 0., 500.);
00110    meColLayer2Ring7_ = dbe_->book1D("col_layer2ring7","Digi column",50, 0., 500.);
00111    meColLayer2Ring8_ = dbe_->book1D("col_layer2ring8","Digi column",50, 0., 500.);
00112 
00113 
00114    meAdcLayer3Ring1_ = dbe_->book1D("adc_layer3ring1","Digi charge",50, 0., 300.);
00115    meAdcLayer3Ring2_ = dbe_->book1D("adc_layer3ring2","Digi charge",50, 0., 300.);
00116    meAdcLayer3Ring3_ = dbe_->book1D("adc_layer3ring3","Digi charge",50, 0., 300.);
00117    meAdcLayer3Ring4_ = dbe_->book1D("adc_layer3ring4","Digi charge",50, 0., 300.);
00118    meAdcLayer3Ring5_ = dbe_->book1D("adc_layer3ring5","Digi charge",50, 0., 300.);
00119    meAdcLayer3Ring6_ = dbe_->book1D("adc_layer3ring6","Digi charge",50, 0., 300.);
00120    meAdcLayer3Ring7_ = dbe_->book1D("adc_layer3ring7","Digi charge",50, 0., 300.);
00121    meAdcLayer3Ring8_ = dbe_->book1D("adc_layer3ring8","Digi charge",50, 0., 300.);
00122 
00123    meRowLayer3Ring1_ = dbe_->book1D("row_layer3ring1","Digi row",50, 0., 200.);
00124    meRowLayer3Ring2_ = dbe_->book1D("row_layer3ring2","Digi row",50, 0., 200.);
00125    meRowLayer3Ring3_ = dbe_->book1D("row_layer3ring3","Digi row",50, 0., 200.);
00126    meRowLayer3Ring4_ = dbe_->book1D("row_layer3ring4","Digi row",50, 0., 200.);
00127    meRowLayer3Ring5_ = dbe_->book1D("row_layer3ring5","Digi row",50, 0., 200.);
00128    meRowLayer3Ring6_ = dbe_->book1D("row_layer3ring6","Digi row",50, 0., 200.);
00129    meRowLayer3Ring7_ = dbe_->book1D("row_layer3ring7","Digi row",50, 0., 200.);
00130    meRowLayer3Ring8_ = dbe_->book1D("row_layer3ring8","Digi row",50, 0., 200.);
00131 
00132    meColLayer3Ring1_ = dbe_->book1D("col_layer3ring1","Digi column",50, 0., 500.);
00133    meColLayer3Ring2_ = dbe_->book1D("col_layer3ring2","Digi column",50, 0., 500.);
00134    meColLayer3Ring3_ = dbe_->book1D("col_layer3ring3","Digi column",50, 0., 500.);
00135    meColLayer3Ring4_ = dbe_->book1D("col_layer3ring4","Digi column",50, 0., 500.);
00136    meColLayer3Ring5_ = dbe_->book1D("col_layer3ring5","Digi column",50, 0., 500.);
00137    meColLayer3Ring6_ = dbe_->book1D("col_layer3ring6","Digi column",50, 0., 500.);
00138    meColLayer3Ring7_ = dbe_->book1D("col_layer3ring7","Digi column",50, 0., 500.);
00139    meColLayer3Ring8_ = dbe_->book1D("col_layer3ring8","Digi column",50, 0., 500.);
00140 
00141    meDigiMultiLayer1Ladders_  =dbe_->bookProfile("digi_layer1_ladders","Digi Num. per ladder",22,0.0,21.0, 100, 0.0, 100);
00142    meDigiMultiLayer2Ladders_  =dbe_->bookProfile("digi_layer2_ladders","Digi Num. per ladder",34,0.0,32.0, 100, 0.0, 100);
00143    meDigiMultiLayer3Ladders_  =dbe_->bookProfile("digi_layer3_ladders","Digi Num. per ladder",46,0.0,45.0, 100, 0.0, 100);
00144  
00145   //Forward Pixel
00146    /* ZMinus Side 1st Disk */
00147    meAdcZmDisk1Panel1Plaq1_ = dbe_->book1D("adc_zm_disk1_panel1_plaq1","Digi charge",50,0.,300.);
00148    meAdcZmDisk1Panel1Plaq2_ = dbe_->book1D("adc_zm_disk1_panel1_plaq2","Digi charge",50,0.,300.);
00149    meAdcZmDisk1Panel1Plaq3_ = dbe_->book1D("adc_zm_disk1_panel1_plaq3","Digi charge",50,0.,300.);
00150    meAdcZmDisk1Panel1Plaq4_ = dbe_->book1D("adc_zm_disk1_panel1_plaq4","Digi charge",50,0.,300.);
00151    meAdcZmDisk1Panel2Plaq1_ = dbe_->book1D("adc_zm_disk1_panel2_plaq1","Digi charge",50,0.,300.);
00152    meAdcZmDisk1Panel2Plaq2_ = dbe_->book1D("adc_zm_disk1_panel2_plaq2","Digi charge",50,0.,300.);
00153    meAdcZmDisk1Panel2Plaq3_ = dbe_->book1D("adc_zm_disk1_panel2_plaq3","Digi charge",50,0.,300.);
00154 
00155    meRowZmDisk1Panel1Plaq1_ = dbe_->book1D("row_zm_disk1_panel1_plaq1","Digi row",50,0.,100.);
00156    meRowZmDisk1Panel1Plaq2_ = dbe_->book1D("row_zm_disk1_panel1_plaq2","Digi row",50,0.,200.);
00157    meRowZmDisk1Panel1Plaq3_ = dbe_->book1D("row_zm_disk1_panel1_plaq3","Digi row",50,0.,200.);
00158    meRowZmDisk1Panel1Plaq4_ = dbe_->book1D("row_zm_disk1_panel1_plaq4","Digi row",50,0.,100.);
00159    meRowZmDisk1Panel2Plaq1_ = dbe_->book1D("row_zm_disk1_panel2_plaq1","Digi row",50,0.,200.);
00160    meRowZmDisk1Panel2Plaq2_ = dbe_->book1D("row_zm_disk1_panel2_plaq2","Digi row",50,0.,200.);
00161    meRowZmDisk1Panel2Plaq3_ = dbe_->book1D("row_zm_disk1_panel2_plaq3","Digi row",50,0.,200.);
00162 
00163    meColZmDisk1Panel1Plaq1_ = dbe_->book1D("col_zm_disk1_panel1_plaq1","Digi column",50,0.,150.);
00164    meColZmDisk1Panel1Plaq2_ = dbe_->book1D("col_zm_disk1_panel1_plaq2","Digi column",50,0.,200.);
00165    meColZmDisk1Panel1Plaq3_ = dbe_->book1D("col_zm_disk1_panel1_plaq3","Digi column",50,0.,250.);
00166    meColZmDisk1Panel1Plaq4_ = dbe_->book1D("col_zm_disk1_panel1_plaq4","Digi column",50,0.,300.);
00167    meColZmDisk1Panel2Plaq1_ = dbe_->book1D("col_zm_disk1_panel2_plaq1","Digi column",50,0.,200.);
00168    meColZmDisk1Panel2Plaq2_ = dbe_->book1D("col_zm_disk1_panel2_plaq2","Digi column",50,0.,250.);
00169    meColZmDisk1Panel2Plaq3_ = dbe_->book1D("col_zm_disk1_panel2_plaq3","Digi column",50,0.,300.);
00170    meNdigiZmDisk1PerPanel1_ = dbe_->book1D("digi_zm_disk1_panel1","Digi Num. Panel1 Of 1st Disk In ZMinus Side ",30,0.,30.);
00171    meNdigiZmDisk1PerPanel2_ = dbe_->book1D("digi_zm_disk1_panel2","Digi Num. Panel2 Of 1st Disk In ZMinus Side ",30,0.,30.);
00172 
00173    /* ZMius Side 2nd disk */
00174    meAdcZmDisk2Panel1Plaq1_ = dbe_->book1D("adc_zm_disk2_panel1_plaq1","Digi charge",50,0.,300.);
00175    meAdcZmDisk2Panel1Plaq2_ = dbe_->book1D("adc_zm_disk2_panel1_plaq2","Digi charge",50,0.,300.);
00176    meAdcZmDisk2Panel1Plaq3_ = dbe_->book1D("adc_zm_disk2_panel1_plaq3","Digi charge",50,0.,300.);
00177    meAdcZmDisk2Panel1Plaq4_ = dbe_->book1D("adc_zm_disk2_panel1_plaq4","Digi charge",50,0.,300.);
00178    meAdcZmDisk2Panel2Plaq1_ = dbe_->book1D("adc_zm_disk2_panel2_plaq1","Digi charge",50,0.,300.);
00179    meAdcZmDisk2Panel2Plaq2_ = dbe_->book1D("adc_zm_disk2_panel2_plaq2","Digi charge",50,0.,300.);
00180    meAdcZmDisk2Panel2Plaq3_ = dbe_->book1D("adc_zm_disk2_panel2_plaq3","Digi charge",50,0.,300.);
00181 
00182    meRowZmDisk2Panel1Plaq1_ = dbe_->book1D("row_zm_disk2_panel1_plaq1","Digi row",50,0.,100.);
00183    meRowZmDisk2Panel1Plaq2_ = dbe_->book1D("row_zm_disk2_panel1_plaq2","Digi row",50,0.,200.);
00184    meRowZmDisk2Panel1Plaq3_ = dbe_->book1D("row_zm_disk2_panel1_plaq3","Digi row",50,0.,200.);
00185    meRowZmDisk2Panel1Plaq4_ = dbe_->book1D("row_zm_disk2_panel1_plaq4","Digi row",50,0.,100.);
00186    meRowZmDisk2Panel2Plaq1_ = dbe_->book1D("row_zm_disk2_panel2_plaq1","Digi row",50,0.,200.);
00187    meRowZmDisk2Panel2Plaq2_ = dbe_->book1D("row_zm_disk2_panel2_plaq2","Digi row",50,0.,200.);
00188    meRowZmDisk2Panel2Plaq3_ = dbe_->book1D("row_zm_disk2_panel2_plaq3","Digi row",50,0.,200.);
00189 
00190    meColZmDisk2Panel1Plaq1_ = dbe_->book1D("col_zm_disk2_panel1_plaq1","Digi Column",50,0.,150.);
00191    meColZmDisk2Panel1Plaq2_ = dbe_->book1D("col_zm_disk2_panel1_plaq2","Digi Column",50,0.,200.);
00192    meColZmDisk2Panel1Plaq3_ = dbe_->book1D("col_zm_disk2_panel1_plaq3","Digi Column",50,0.,250.);
00193    meColZmDisk2Panel1Plaq4_ = dbe_->book1D("col_zm_disk2_panel1_plaq4","Digi Column",50,0.,300.);
00194    meColZmDisk2Panel2Plaq1_ = dbe_->book1D("col_zm_disk2_panel2_plaq1","Digi Column",50,0.,200.);
00195    meColZmDisk2Panel2Plaq2_ = dbe_->book1D("col_zm_disk2_panel2_plaq2","Digi Column",50,0.,250.);
00196    meColZmDisk2Panel2Plaq3_ = dbe_->book1D("col_zm_disk2_panel2_plaq3","Digi Column",50,0.,300.);
00197    meNdigiZmDisk2PerPanel1_ = dbe_->book1D("digi_zm_disk2_panel1","Digi Num. Panel1 Of 2nd Disk In ZMinus Side ",30,0.,30.);
00198    meNdigiZmDisk2PerPanel2_ = dbe_->book1D("digi_zm_disk2_panel2","Digi Num. Panel2 Of 2nd Disk In ZMinus Side ",30,0.,30.);
00199 
00200 
00201    /* ZPlus Side 1st Disk */
00202    meAdcZpDisk1Panel1Plaq1_ = dbe_->book1D("adc_zp_disk1_panel1_plaq1","Digi charge",50,0.,300.);
00203    meAdcZpDisk1Panel1Plaq2_ = dbe_->book1D("adc_zp_disk1_panel1_plaq2","Digi charge",50,0.,300.);
00204    meAdcZpDisk1Panel1Plaq3_ = dbe_->book1D("adc_zp_disk1_panel1_plaq3","Digi charge",50,0.,300.);
00205    meAdcZpDisk1Panel1Plaq4_ = dbe_->book1D("adc_zp_disk1_panel1_plaq4","Digi charge",50,0.,300.);
00206    meAdcZpDisk1Panel2Plaq1_ = dbe_->book1D("adc_zp_disk1_panel2_plaq1","Digi charge",50,0.,300.);
00207    meAdcZpDisk1Panel2Plaq2_ = dbe_->book1D("adc_zp_disk1_panel2_plaq2","Digi charge",50,0.,300.);
00208    meAdcZpDisk1Panel2Plaq3_ = dbe_->book1D("adc_zp_disk1_panel2_plaq3","Digi charge",50,0.,300.);
00209 
00210    meRowZpDisk1Panel1Plaq1_ = dbe_->book1D("row_zp_disk1_panel1_plaq1","Digi row",50,0.,100.);
00211    meRowZpDisk1Panel1Plaq2_ = dbe_->book1D("row_zp_disk1_panel1_plaq2","Digi row",50,0.,200.);
00212    meRowZpDisk1Panel1Plaq3_ = dbe_->book1D("row_zp_disk1_panel1_plaq3","Digi row",50,0.,200.);
00213    meRowZpDisk1Panel1Plaq4_ = dbe_->book1D("row_zp_disk1_panel1_plaq4","Digi row",50,0.,100.);
00214    meRowZpDisk1Panel2Plaq1_ = dbe_->book1D("row_zp_disk1_panel2_plaq1","Digi row",50,0.,200.);
00215    meRowZpDisk1Panel2Plaq2_ = dbe_->book1D("row_zp_disk1_panel2_plaq2","Digi row",50,0.,200.);
00216    meRowZpDisk1Panel2Plaq3_ = dbe_->book1D("row_zp_disk1_panel2_plaq3","Digi row",50,0.,200.);
00217 
00218    meColZpDisk1Panel1Plaq1_ = dbe_->book1D("col_zp_disk1_panel1_plaq1","Digi Column",50,0.,150.);
00219    meColZpDisk1Panel1Plaq2_ = dbe_->book1D("col_zp_disk1_panel1_plaq2","Digi column",50,0.,200.);
00220    meColZpDisk1Panel1Plaq3_ = dbe_->book1D("col_zp_disk1_panel1_plaq3","Digi column",50,0.,250.);
00221    meColZpDisk1Panel1Plaq4_ = dbe_->book1D("col_zp_disk1_panel1_plaq4","Digi column",50,0.,300.);
00222    meColZpDisk1Panel2Plaq1_ = dbe_->book1D("col_zp_disk1_panel2_plaq1","Digi column",50,0.,200.);
00223    meColZpDisk1Panel2Plaq2_ = dbe_->book1D("col_zp_disk1_panel2_plaq2","Digi column",50,0.,250.);
00224    meColZpDisk1Panel2Plaq3_ = dbe_->book1D("col_zp_disk1_panel2_plaq3","Digi column",50,0.,300.);
00225    meNdigiZpDisk1PerPanel1_ = dbe_->book1D("digi_zp_disk1_panel1","Digi Num. Panel1 Of 1st Disk In ZPlus Side ",30,0.,30.);
00226    meNdigiZpDisk1PerPanel2_ = dbe_->book1D("digi_zp_disk1_panel2","Digi Num. Panel2 Of 1st Disk In ZPlus Side ",30,0.,30.);
00227 
00228 
00229    /* ZPlus Side 2nd disk */
00230    meAdcZpDisk2Panel1Plaq1_ = dbe_->book1D("adc_zp_disk2_panel1_plaq1","Digi charge",50,0.,300.);
00231    meAdcZpDisk2Panel1Plaq2_ = dbe_->book1D("adc_zp_disk2_panel1_plaq2","Digi charge",50,0.,300.);
00232    meAdcZpDisk2Panel1Plaq3_ = dbe_->book1D("adc_zp_disk2_panel1_plaq3","Digi charge",50,0.,300.);
00233    meAdcZpDisk2Panel1Plaq4_ = dbe_->book1D("adc_zp_disk2_panel1_plaq4","Digi charge",50,0.,300.);
00234    meAdcZpDisk2Panel2Plaq1_ = dbe_->book1D("adc_zp_disk2_panel2_plaq1","Digi charge",50,0.,300.);
00235    meAdcZpDisk2Panel2Plaq2_ = dbe_->book1D("adc_zp_disk2_panel2_plaq2","Digi charge",50,0.,300.);
00236    meAdcZpDisk2Panel2Plaq3_ = dbe_->book1D("adc_zp_disk2_panel2_plaq3","Digi charge",50,0.,300.);
00237 
00238    meRowZpDisk2Panel1Plaq1_ = dbe_->book1D("row_zp_disk2_panel1_plaq1","Digi row",10,0.,100.);
00239    meRowZpDisk2Panel1Plaq2_ = dbe_->book1D("row_zp_disk2_panel1_plaq2","Digi row",10,0.,200.);
00240    meRowZpDisk2Panel1Plaq3_ = dbe_->book1D("row_zp_disk2_panel1_plaq3","Digi row",10,0.,200.);
00241    meRowZpDisk2Panel1Plaq4_ = dbe_->book1D("row_zp_disk2_panel1_plaq4","Digi row",10,0.,100.);
00242    meRowZpDisk2Panel2Plaq1_ = dbe_->book1D("row_zp_disk2_panel2_plaq1","Digi row",10,0.,200.);
00243    meRowZpDisk2Panel2Plaq2_ = dbe_->book1D("row_zp_disk2_panel2_plaq2","Digi row",10,0.,200.);
00244    meRowZpDisk2Panel2Plaq3_ = dbe_->book1D("row_zp_disk2_panel2_plaq3","Digi row",10,0.,200.);
00245 
00246    meColZpDisk2Panel1Plaq1_ = dbe_->book1D("col_zp_disk2_panel1_plaq1","Digi column",50,0.,150.);
00247    meColZpDisk2Panel1Plaq2_ = dbe_->book1D("col_zp_disk2_panel1_plaq2","Digi column",50,0.,200.);
00248    meColZpDisk2Panel1Plaq3_ = dbe_->book1D("col_zp_disk2_panel1_plaq3","Digi column",50,0.,250.);
00249    meColZpDisk2Panel1Plaq4_ = dbe_->book1D("col_zp_disk2_panel1_plaq4","Digi column",50,0.,300.);
00250    meColZpDisk2Panel2Plaq1_ = dbe_->book1D("col_zp_disk2_panel2_plaq1","Digi column",50,0.,200.);
00251    meColZpDisk2Panel2Plaq2_ = dbe_->book1D("col_zp_disk2_panel2_plaq2","Digi column",50,0.,250.);
00252    meColZpDisk2Panel2Plaq3_ = dbe_->book1D("col_zp_disk2_panel2_plaq3","Digi column",50,0.,300.);
00253    meNdigiZpDisk2PerPanel1_ = dbe_->book1D("digi_zp_disk2_panel1","Digi Num. Panel1 Of 2nd Disk In ZPlus Side ",30,0.,30.);
00254    meNdigiZpDisk2PerPanel2_ = dbe_->book1D("digi_zp_disk2_panel2","Digi Num. Panel2 Of 2nd Disk In ZPlus Side ",30,0.,30.);
00255 
00256  }
00257  
00258 }
00259 
00260 SiPixelDigiValid::~SiPixelDigiValid(){
00261  
00262  // if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
00263 }
00264 
00265 
00266 void SiPixelDigiValid::beginJob(){
00267 
00268 }
00269 
00270 void SiPixelDigiValid::endJob() {
00271  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
00272 }
00273 
00274 
00275 void SiPixelDigiValid::analyze(const Event& e, const EventSetup& c){
00276 
00277  int ndigiperRingLayer1[8];
00278  int ndigiperRingLayer2[8];
00279  int ndigiperRingLayer3[8];
00280  for(int i = 0; i< 8; i++ ) {
00281     ndigiperRingLayer1[i] = 0;
00282     ndigiperRingLayer2[i] = 0;
00283     ndigiperRingLayer3[i] = 0;
00284  }
00285 
00286 int ndigiZpDisk1PerPanel1[24];
00287 int ndigiZpDisk1PerPanel2[24];
00288 int ndigiZpDisk2PerPanel1[24];
00289 int ndigiZpDisk2PerPanel2[24];
00290 int ndigiZmDisk1PerPanel1[24];
00291 int ndigiZmDisk1PerPanel2[24];
00292 int ndigiZmDisk2PerPanel1[24];
00293 int ndigiZmDisk2PerPanel2[24];
00294 
00295 for ( int i =0 ; i< 24; i++) {
00296    ndigiZpDisk1PerPanel1[i] = 0;
00297    ndigiZpDisk1PerPanel2[i] = 0;
00298    ndigiZpDisk2PerPanel1[i] = 0;
00299    ndigiZpDisk2PerPanel2[i] = 0;
00300    ndigiZmDisk1PerPanel1[i] = 0;
00301    ndigiZmDisk1PerPanel2[i] = 0;
00302    ndigiZmDisk2PerPanel1[i] = 0;
00303    ndigiZmDisk2PerPanel2[i] = 0;
00304 }
00305 
00306 int ndigilayer1ladders[20];
00307 int ndigilayer2ladders[32];
00308 int ndigilayer3ladders[44];
00309 
00310 for ( int i =0 ; i< 20; i++) {
00311    ndigilayer1ladders[i]= 0;
00312 }
00313 
00314 for ( int i =0 ; i< 32; i++) {
00315    ndigilayer2ladders[i] = 0;
00316 }
00317 
00318 for ( int i =0 ; i< 44; i++) {
00319    ndigilayer3ladders[i] = 0;
00320 }
00321 
00322  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
00323 
00324  edm::ESHandle<TrackerGeometry> tracker;
00325  c.get<TrackerDigiGeometryRecord>().get( tracker );     
00326 
00327  //string digiProducer = "siPixelDigis";
00328  edm::Handle<edm::DetSetVector<PixelDigi> > pixelDigis;
00329  e.getByLabel(src_, pixelDigis);
00330 
00331  edm::DetSetVector<PixelDigi>::const_iterator DSViter = pixelDigis->begin();
00332  for( ; DSViter != pixelDigis->end(); DSViter++) {
00333           unsigned int id = DSViter->id;
00334           DetId  detId(id);
00335           edm::DetSet<PixelDigi>::const_iterator  begin = DSViter->data.begin();
00336           edm::DetSet<PixelDigi>::const_iterator  end   = DSViter->data.end();
00337           edm::DetSet<PixelDigi>::const_iterator  iter;          
00338 
00339           if(detId.subdetId()==PixelSubdetector::PixelBarrel ) {
00340              PXBDetId  bdetid(id);
00341              unsigned int layer  = bdetid.layer();   // Layer:1,2,3.
00342              unsigned int ladder = bdetid.ladder();  // Ladeer: 1-20, 32, 44. 
00343              unsigned int zindex = bdetid.module();  // Z-index: 1-8.
00344              //LogInfo("SiPixelDigiValid")<<"Barrel:: Layer="<<layer<<" Ladder="<<ladder<<" zindex="<<zindex;
00345              for ( iter = begin ; iter != end; iter++ ) {
00346                 if( layer == 1 ) {
00347                      ++ndigilayer1ladders[ladder-1];
00348                      ++ndigiperRingLayer1[zindex-1];
00349                      if (zindex == 1) { 
00350                           meAdcLayer1Ring1_->Fill((*iter).adc());
00351                           meRowLayer1Ring1_->Fill((*iter).row());
00352                           meColLayer1Ring1_->Fill((*iter).column());
00353                      }
00354                      if (zindex == 2) {
00355                           meAdcLayer1Ring2_->Fill((*iter).adc());
00356                           meRowLayer1Ring2_->Fill((*iter).row());
00357                           meColLayer1Ring2_->Fill((*iter).column());
00358                      }
00359 
00360                      if (zindex == 3) {
00361                           meAdcLayer1Ring3_->Fill((*iter).adc());
00362                           meRowLayer1Ring3_->Fill((*iter).row());
00363                           meColLayer1Ring3_->Fill((*iter).column());
00364                      }
00365 
00366                      if (zindex == 4)  {
00367                          meAdcLayer1Ring4_->Fill((*iter).adc());
00368                          meRowLayer1Ring4_->Fill((*iter).row());
00369                          meColLayer1Ring4_->Fill((*iter).column());
00370                      }
00371 
00372                      if (zindex == 5)  {
00373                          meAdcLayer1Ring5_->Fill((*iter).adc());
00374                          meRowLayer1Ring5_->Fill((*iter).row());
00375                          meColLayer1Ring5_->Fill((*iter).column());
00376                      }
00377 
00378                      if (zindex == 6)  {
00379                          meAdcLayer1Ring6_->Fill((*iter).adc());
00380                          meRowLayer1Ring6_->Fill((*iter).row());
00381                          meColLayer1Ring6_->Fill((*iter).column());
00382                      }
00383 
00384                      if (zindex == 7)  {
00385                          meAdcLayer1Ring7_->Fill((*iter).adc());
00386                          meRowLayer1Ring7_->Fill((*iter).row());
00387                          meColLayer1Ring7_->Fill((*iter).column());
00388                      }
00389                      if (zindex == 8)  {
00390                          meAdcLayer1Ring8_->Fill((*iter).adc());
00391                          meRowLayer1Ring8_->Fill((*iter).row());
00392                          meColLayer1Ring8_->Fill((*iter).column());
00393                      }
00394 
00395                 } 
00396                 if( layer == 2 ) {
00397                     ++ndigilayer2ladders[ladder-1];
00398                     ++ndigiperRingLayer2[zindex-1];
00399                     if (zindex == 1) {
00400                           meAdcLayer2Ring1_->Fill((*iter).adc());
00401                           meRowLayer2Ring1_->Fill((*iter).row());
00402                           meColLayer2Ring1_->Fill((*iter).column());
00403                      }
00404                      if (zindex == 2) {
00405                           meAdcLayer2Ring2_->Fill((*iter).adc());
00406                           meRowLayer2Ring2_->Fill((*iter).row());
00407                           meColLayer2Ring2_->Fill((*iter).column());
00408                      }
00409 
00410                      if (zindex == 3) {
00411                           meAdcLayer2Ring3_->Fill((*iter).adc());
00412                           meRowLayer2Ring3_->Fill((*iter).row());
00413                           meColLayer2Ring3_->Fill((*iter).column());
00414                      }
00415 
00416                      if (zindex == 4)  {
00417                          meAdcLayer2Ring4_->Fill((*iter).adc());
00418                          meRowLayer2Ring4_->Fill((*iter).row());
00419                          meColLayer2Ring4_->Fill((*iter).column());
00420                      }
00421 
00422                      if (zindex == 5)  {
00423                          meAdcLayer2Ring5_->Fill((*iter).adc());
00424                          meRowLayer2Ring5_->Fill((*iter).row());
00425                          meColLayer2Ring5_->Fill((*iter).column());
00426                      }
00427 
00428                      if (zindex == 6)  {
00429                          meAdcLayer2Ring6_->Fill((*iter).adc());
00430                          meRowLayer2Ring6_->Fill((*iter).row());
00431                          meColLayer2Ring6_->Fill((*iter).column());
00432                      }
00433 
00434                      if (zindex == 7)  {
00435                          meAdcLayer2Ring7_->Fill((*iter).adc());
00436                          meRowLayer2Ring7_->Fill((*iter).row());
00437                          meColLayer2Ring7_->Fill((*iter).column());
00438                      }
00439                      if (zindex == 8)  {
00440                          meAdcLayer2Ring8_->Fill((*iter).adc());
00441                          meRowLayer2Ring8_->Fill((*iter).row());
00442                          meColLayer2Ring8_->Fill((*iter).column());
00443                      }
00444 
00445                 }
00446                 if( layer == 3 ) {
00447                     ++ndigilayer3ladders[ladder-1];
00448                     ++ndigiperRingLayer3[zindex-1];
00449                     if (zindex == 1) {
00450                           meAdcLayer3Ring1_->Fill((*iter).adc());
00451                           meRowLayer3Ring1_->Fill((*iter).row());
00452                           meColLayer3Ring1_->Fill((*iter).column());
00453                      }
00454                      if (zindex == 2) {
00455                           meAdcLayer3Ring2_->Fill((*iter).adc());
00456                           meRowLayer3Ring2_->Fill((*iter).row());
00457                           meColLayer3Ring2_->Fill((*iter).column());
00458                      }
00459 
00460                      if (zindex == 3) {
00461                           meAdcLayer3Ring3_->Fill((*iter).adc());
00462                           meRowLayer3Ring3_->Fill((*iter).row());
00463                           meColLayer3Ring3_->Fill((*iter).column());
00464                      }
00465 
00466                      if (zindex == 4)  {
00467                          meAdcLayer3Ring4_->Fill((*iter).adc());
00468                          meRowLayer3Ring4_->Fill((*iter).row());
00469                          meColLayer3Ring4_->Fill((*iter).column());
00470                      }
00471 
00472                      if (zindex == 5)  {
00473                          meAdcLayer3Ring5_->Fill((*iter).adc());
00474                          meRowLayer3Ring5_->Fill((*iter).row());
00475                          meColLayer3Ring5_->Fill((*iter).column());
00476                      }
00477 
00478                      if (zindex == 6)  {
00479                          meAdcLayer3Ring6_->Fill((*iter).adc());
00480                          meRowLayer3Ring6_->Fill((*iter).row());
00481                          meColLayer3Ring6_->Fill((*iter).column());
00482                      }
00483 
00484                      if (zindex == 7)  {
00485                          meAdcLayer3Ring7_->Fill((*iter).adc());
00486                          meRowLayer3Ring7_->Fill((*iter).row());
00487                          meColLayer3Ring7_->Fill((*iter).column());
00488                      }
00489                      if (zindex == 8)  {
00490                          meAdcLayer3Ring8_->Fill((*iter).adc());
00491                          meRowLayer3Ring8_->Fill((*iter).row());
00492                          meColLayer3Ring8_->Fill((*iter).column());
00493                      }
00494                 }
00495  
00496              }   
00497            
00498           }
00499  
00500          if(detId.subdetId()==PixelSubdetector::PixelEndcap ){ //Endcap
00501            PXFDetId  fdetid(id);
00502            unsigned int side  = fdetid.side();
00503            unsigned int disk  = fdetid.disk();
00504            unsigned int blade = fdetid.blade();
00505            unsigned int panel = fdetid.panel();
00506            unsigned int mod   = fdetid.module();
00507            //LogInfo("SiPixelDigiValid")<<"EndcaP="<<side<<" Disk="<<disk<<" Blade="<<blade<<" Panel="<<panel<<" Module="<<mod;
00508            for ( iter = begin ; iter != end; iter++ ) {
00509              if(side == 1 && disk == 1 && panel ==1 ){
00510                      if ( mod == 1 ) {
00511                          meAdcZmDisk1Panel1Plaq1_->Fill((*iter).adc());
00512                          meRowZmDisk1Panel1Plaq1_->Fill((*iter).row());
00513                          meColZmDisk1Panel1Plaq1_->Fill((*iter).column());
00514                      }else if( mod == 2 ) {
00515                          meAdcZmDisk1Panel1Plaq2_->Fill((*iter).adc());
00516                          meRowZmDisk1Panel1Plaq2_->Fill((*iter).row());
00517                          meColZmDisk1Panel1Plaq2_->Fill((*iter).column());
00518                      }else if( mod == 3 ) {
00519                          meAdcZmDisk1Panel1Plaq3_->Fill((*iter).adc());
00520                          meRowZmDisk1Panel1Plaq3_->Fill((*iter).row());
00521                          meColZmDisk1Panel1Plaq3_->Fill((*iter).column());
00522                      }else if( mod == 4 ) {
00523                          meAdcZmDisk1Panel1Plaq4_->Fill((*iter).adc());
00524                          meRowZmDisk1Panel1Plaq4_->Fill((*iter).row());
00525                          meColZmDisk1Panel1Plaq4_->Fill((*iter).column());
00526                      }else {
00527                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00528                      } 
00529                      ++ndigiZmDisk1PerPanel1[blade-1];                
00530              }
00531 
00532              if(side == 1 && disk == 1 && panel ==2 ){
00533                      if ( mod == 1 ) {
00534                          meAdcZmDisk1Panel2Plaq1_->Fill((*iter).adc());
00535                          meRowZmDisk1Panel2Plaq1_->Fill((*iter).row());
00536                          meColZmDisk1Panel2Plaq1_->Fill((*iter).column());
00537                      }else if( mod == 2 ) {
00538                          meAdcZmDisk1Panel2Plaq2_->Fill((*iter).adc());
00539                          meRowZmDisk1Panel2Plaq2_->Fill((*iter).row());
00540                          meColZmDisk1Panel2Plaq2_->Fill((*iter).column());
00541                      }else if( mod == 3 ) {
00542                          meAdcZmDisk1Panel2Plaq3_->Fill((*iter).adc());
00543                          meRowZmDisk1Panel2Plaq3_->Fill((*iter).row());
00544                          meColZmDisk1Panel2Plaq3_->Fill((*iter).column());
00545                      }else {
00546                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00547                      }
00548                      ++ndigiZmDisk1PerPanel2[blade-1];
00549              }
00550 
00551             if(side == 1 && disk == 2 && panel ==1 ){
00552                      if ( mod == 1 ) {
00553                          meAdcZmDisk2Panel1Plaq1_->Fill((*iter).adc());
00554                          meRowZmDisk2Panel1Plaq1_->Fill((*iter).row());
00555                          meColZmDisk2Panel1Plaq1_->Fill((*iter).column());
00556                      }else if( mod == 2 ) {
00557                          meAdcZmDisk2Panel1Plaq2_->Fill((*iter).adc());
00558                          meRowZmDisk2Panel1Plaq2_->Fill((*iter).row());
00559                          meColZmDisk2Panel1Plaq2_->Fill((*iter).column());
00560                      }else if( mod == 3 ) {
00561                          meAdcZmDisk2Panel1Plaq3_->Fill((*iter).adc());
00562                          meRowZmDisk2Panel1Plaq3_->Fill((*iter).row());
00563                          meColZmDisk2Panel1Plaq3_->Fill((*iter).column());
00564                      }else if( mod == 4 ) {
00565                          meAdcZmDisk2Panel1Plaq4_->Fill((*iter).adc());
00566                          meRowZmDisk2Panel1Plaq4_->Fill((*iter).row());
00567                          meColZmDisk2Panel1Plaq4_->Fill((*iter).column());
00568                      }else {
00569                         // LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00570                      }
00571                      ++ndigiZmDisk2PerPanel1[blade-1];
00572              }
00573 
00574              if(side == 1 && disk == 2 && panel ==2 ){
00575                      if ( mod == 1 ) {
00576                          meAdcZmDisk2Panel2Plaq1_->Fill((*iter).adc());
00577                          meRowZmDisk2Panel2Plaq1_->Fill((*iter).row());
00578                          meColZmDisk2Panel2Plaq1_->Fill((*iter).column());
00579                      }else if( mod == 2 ) {
00580                          meAdcZmDisk2Panel2Plaq2_->Fill((*iter).adc());
00581                          meRowZmDisk2Panel2Plaq2_->Fill((*iter).row());
00582                          meColZmDisk2Panel2Plaq2_->Fill((*iter).column());
00583                      }else if( mod == 3 ) {
00584                          meAdcZmDisk2Panel2Plaq3_->Fill((*iter).adc());
00585                          meRowZmDisk2Panel2Plaq3_->Fill((*iter).row());
00586                          meColZmDisk2Panel2Plaq3_->Fill((*iter).column());
00587                      }else {
00588                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00589                      }
00590                      ++ndigiZmDisk2PerPanel2[blade-1];
00591              }
00592 
00593 
00594             if(side == 2 && disk == 1 && panel ==1 ){
00595                      if ( mod == 1 ) {
00596                          meAdcZpDisk1Panel1Plaq1_->Fill((*iter).adc());
00597                          meRowZpDisk1Panel1Plaq1_->Fill((*iter).row());
00598                          meColZpDisk1Panel1Plaq1_->Fill((*iter).column());
00599                      }else if( mod == 2 ) {
00600                          meAdcZpDisk1Panel1Plaq2_->Fill((*iter).adc());
00601                          meRowZpDisk1Panel1Plaq2_->Fill((*iter).row());
00602                          meColZpDisk1Panel1Plaq2_->Fill((*iter).column());
00603                      }else if( mod == 3 ) {
00604                          meAdcZpDisk1Panel1Plaq3_->Fill((*iter).adc());
00605                          meRowZpDisk1Panel1Plaq3_->Fill((*iter).row());
00606                          meColZpDisk1Panel1Plaq3_->Fill((*iter).column());
00607                      }else if( mod == 4 ) {
00608                          meAdcZpDisk1Panel1Plaq4_->Fill((*iter).adc());
00609                          meRowZpDisk1Panel1Plaq4_->Fill((*iter).row());
00610                          meColZpDisk1Panel1Plaq4_->Fill((*iter).column());
00611                      }else {
00612                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00613                      }
00614                      ++ndigiZpDisk1PerPanel1[blade-1];
00615              }
00616 
00617              if(side == 2 && disk == 1 && panel ==2 ){
00618                      if ( mod == 1 ) {
00619                          meAdcZpDisk1Panel2Plaq1_->Fill((*iter).adc());
00620                          meRowZpDisk1Panel2Plaq1_->Fill((*iter).row());
00621                          meColZpDisk1Panel2Plaq1_->Fill((*iter).column());
00622                      }else if( mod == 2 ) {
00623                          meAdcZpDisk1Panel2Plaq2_->Fill((*iter).adc());
00624                          meRowZpDisk1Panel2Plaq2_->Fill((*iter).row());
00625                          meColZpDisk1Panel2Plaq2_->Fill((*iter).column());
00626                      }else if( mod == 3 ) {
00627                          meAdcZpDisk1Panel2Plaq3_->Fill((*iter).adc());
00628                          meRowZpDisk1Panel2Plaq3_->Fill((*iter).row());
00629                          meColZpDisk1Panel2Plaq3_->Fill((*iter).column());
00630                      }else {
00631                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00632                      }
00633                      ++ndigiZpDisk1PerPanel2[blade-1];
00634              }
00635 
00636             if(side == 2 && disk == 2 && panel ==1 ){
00637                      if ( mod == 1 ) {
00638                          meAdcZpDisk2Panel1Plaq1_->Fill((*iter).adc());
00639                          meRowZpDisk2Panel1Plaq1_->Fill((*iter).row());
00640                          meColZpDisk2Panel1Plaq1_->Fill((*iter).column());
00641                      }else if( mod == 2 ) {
00642                          meAdcZpDisk2Panel1Plaq2_->Fill((*iter).adc());
00643                          meRowZpDisk2Panel1Plaq2_->Fill((*iter).row());
00644                          meColZpDisk2Panel1Plaq2_->Fill((*iter).column());
00645                      }else if( mod == 3 ) {
00646                          meAdcZpDisk2Panel1Plaq3_->Fill((*iter).adc());
00647                          meRowZpDisk2Panel1Plaq3_->Fill((*iter).row());
00648                          meColZpDisk2Panel1Plaq3_->Fill((*iter).column());
00649                      }else if( mod == 4 ) {
00650                          meAdcZpDisk2Panel1Plaq4_->Fill((*iter).adc());
00651                          meRowZpDisk2Panel1Plaq4_->Fill((*iter).row());
00652                          meColZpDisk2Panel1Plaq4_->Fill((*iter).column());
00653                      }else {
00654                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00655                      }
00656                      ++ndigiZpDisk2PerPanel1[blade-1];
00657 
00658               }
00659 
00660              if(side == 2 && disk == 2 && panel ==2 ){
00661                      if ( mod == 1 ) {
00662                          meAdcZpDisk2Panel2Plaq1_->Fill((*iter).adc());
00663                          meRowZpDisk2Panel2Plaq1_->Fill((*iter).row());
00664                          meColZpDisk2Panel2Plaq1_->Fill((*iter).column());
00665                      }else if( mod == 2 ) {
00666                          meAdcZpDisk2Panel2Plaq2_->Fill((*iter).adc());
00667                          meRowZpDisk2Panel2Plaq2_->Fill((*iter).row());
00668                          meColZpDisk2Panel2Plaq2_->Fill((*iter).column());
00669                      }else if( mod == 3 ) {
00670                          meAdcZpDisk2Panel2Plaq3_->Fill((*iter).adc());
00671                          meRowZpDisk2Panel2Plaq3_->Fill((*iter).row());
00672                          meColZpDisk2Panel2Plaq3_->Fill((*iter).column());
00673                      }else {
00674                          //LogError("SiPixelDigiValid")<<" The number of module is Wrong";
00675                      }
00676                      ++ndigiZpDisk2PerPanel2[blade-1];
00677               }
00678            } //iterating the digi 
00679 
00680           }//Endcap 
00681 
00682     } // end for loop
00683     
00684     meDigiMultiLayer1Ring1_->Fill(ndigiperRingLayer1[0]);
00685     meDigiMultiLayer1Ring2_->Fill(ndigiperRingLayer1[1]);
00686     meDigiMultiLayer1Ring3_->Fill(ndigiperRingLayer1[2]);
00687     meDigiMultiLayer1Ring4_->Fill(ndigiperRingLayer1[3]);
00688     meDigiMultiLayer1Ring5_->Fill(ndigiperRingLayer1[4]);
00689     meDigiMultiLayer1Ring6_->Fill(ndigiperRingLayer1[5]);
00690     meDigiMultiLayer1Ring7_->Fill(ndigiperRingLayer1[6]);
00691     meDigiMultiLayer1Ring8_->Fill(ndigiperRingLayer1[7]);
00692 
00693     meDigiMultiLayer2Ring1_->Fill(ndigiperRingLayer2[0]);
00694     meDigiMultiLayer2Ring2_->Fill(ndigiperRingLayer2[1]);
00695     meDigiMultiLayer2Ring3_->Fill(ndigiperRingLayer2[2]);
00696     meDigiMultiLayer2Ring4_->Fill(ndigiperRingLayer2[3]);
00697     meDigiMultiLayer2Ring5_->Fill(ndigiperRingLayer2[4]);
00698     meDigiMultiLayer2Ring6_->Fill(ndigiperRingLayer2[5]);
00699     meDigiMultiLayer2Ring7_->Fill(ndigiperRingLayer2[6]);
00700     meDigiMultiLayer2Ring8_->Fill(ndigiperRingLayer2[7]);
00701 
00702     meDigiMultiLayer3Ring1_->Fill(ndigiperRingLayer3[0]);
00703     meDigiMultiLayer3Ring2_->Fill(ndigiperRingLayer3[1]);
00704     meDigiMultiLayer3Ring3_->Fill(ndigiperRingLayer3[2]);
00705     meDigiMultiLayer3Ring4_->Fill(ndigiperRingLayer3[3]);
00706     meDigiMultiLayer3Ring5_->Fill(ndigiperRingLayer3[4]);
00707     meDigiMultiLayer3Ring6_->Fill(ndigiperRingLayer3[5]);
00708     meDigiMultiLayer3Ring7_->Fill(ndigiperRingLayer3[6]);
00709     meDigiMultiLayer3Ring8_->Fill(ndigiperRingLayer3[7]);
00710 
00711     for(int i =0; i< 24; i++) {
00712          meNdigiZmDisk1PerPanel1_->Fill(ndigiZmDisk1PerPanel1[i]);
00713          meNdigiZmDisk1PerPanel2_->Fill(ndigiZmDisk1PerPanel2[i]);
00714          meNdigiZmDisk2PerPanel1_->Fill(ndigiZmDisk2PerPanel1[i]);
00715          meNdigiZmDisk2PerPanel2_->Fill(ndigiZmDisk2PerPanel2[i]);
00716          meNdigiZpDisk1PerPanel1_->Fill(ndigiZpDisk1PerPanel1[i]);
00717          meNdigiZpDisk1PerPanel2_->Fill(ndigiZpDisk1PerPanel2[i]);
00718          meNdigiZpDisk2PerPanel1_->Fill(ndigiZpDisk2PerPanel1[i]);
00719          meNdigiZpDisk2PerPanel2_->Fill(ndigiZpDisk2PerPanel2[i]);
00720     } 
00721     
00722    for (int i =0; i< 20; i++) {
00723        meDigiMultiLayer1Ladders_->Fill(i+1,ndigilayer1ladders[i]);
00724    }
00725 
00726    for (int i =0; i< 32; i++) {
00727        meDigiMultiLayer2Ladders_->Fill(i+1,ndigilayer2ladders[i]);
00728    }
00729 
00730    for (int i =0; i< 44; i++) {
00731        meDigiMultiLayer3Ladders_->Fill(i+1,ndigilayer3ladders[i]);
00732    }
00733 
00734 }