CMS 3D CMS Logo

CSCOfflineMonitor.cc

Go to the documentation of this file.
00001 /*
00002  *  simple validation package for CSC DIGIs, RECHITs and SEGMENTs.
00003  *
00004  *  Michael Schmitt
00005  *  Andy Kubik
00006  *  Northwestern University
00007  */
00008 #include "DQMOffline/Muon/src/CSCOfflineMonitor.h"
00009 
00010 using namespace std;
00011 using namespace edm;
00012 
00013 
00015 //  CONSTRUCTOR  //
00017 CSCOfflineMonitor::CSCOfflineMonitor(const ParameterSet& pset){
00018 
00019   param = pset;
00020 
00021   stripDigiTag_  = pset.getParameter<edm::InputTag>("stripDigiTag");
00022   wireDigiTag_   = pset.getParameter<edm::InputTag>("wireDigiTag"); 
00023   cscRecHitTag_  = pset.getParameter<edm::InputTag>("cscRecHitTag");
00024   cscSegTag_     = pset.getParameter<edm::InputTag>("cscSegTag");
00025 
00026 }
00027 
00028 void CSCOfflineMonitor::beginJob(edm::EventSetup const& iSetup){
00029       dbe = Service<DQMStore>().operator->();
00030 
00031       // wire digis
00032       dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Digis");
00033       hWireAll  = dbe->book1D("hWireAll","all wire group numbers",121,-0.5,120.5);
00034       hWireTBinAll  = dbe->book1D("hWireTBinAll","time bins all wires",21,-0.5,20.5);
00035       hWirenGroupsTotal = dbe->book1D("hWirenGroupsTotal","total number of wire groups",101,-0.5,100.5);
00036       hWireCodeBroad = dbe->book1D("hWireCodeBroad","broad scope code for wires",33,-16.5,16.5);
00037       hWireCodeNarrow.push_back(dbe->book1D("hWireCodeNarrow1","narrow scope wire code station 1",801,-400.5,400.5));
00038       hWireCodeNarrow.push_back(dbe->book1D("hWireCodeNarrow2","narrow scope wire code station 2",801,-400.5,400.5));
00039       hWireCodeNarrow.push_back(dbe->book1D("hWireCodeNarrow3","narrow scope wire code station 3",801,-400.5,400.5));
00040       hWireCodeNarrow.push_back(dbe->book1D("hWireCodeNarrow4","narrow scope wire code station 4",801,-400.5,400.5));
00041       hWireWire.push_back(dbe->book1D("hWireWire_m42","wire number ME -4/2",113,-0.5,112.5));
00042       hWireWire.push_back(dbe->book1D("hWireWire_m41","wire number ME -4/1",113,-0.5,112.5));
00043       hWireWire.push_back(dbe->book1D("hWireWire_m32","wire number ME -3/2",113,-0.5,112.5));
00044       hWireWire.push_back(dbe->book1D("hWireWire_m31","wire number ME -3/1",113,-0.5,112.5));
00045       hWireWire.push_back(dbe->book1D("hWireWire_m22","wire number ME -2/2",113,-0.5,112.5));
00046       hWireWire.push_back(dbe->book1D("hWireWire_m21","wire number ME -2/1",113,-0.5,112.5));
00047       hWireWire.push_back(dbe->book1D("hWireWire_m11a","wire number ME -1/1a",113,-0.5,112.5));
00048       hWireWire.push_back(dbe->book1D("hWireWire_m13","wire number ME -1/3",113,-0.5,112.5));
00049       hWireWire.push_back(dbe->book1D("hWireWire_m12","wire number ME -1/2",113,-0.5,112.5));
00050       hWireWire.push_back(dbe->book1D("hWireWire_m11b","wire number ME -1/1b",113,-0.5,112.5));
00051       hWireWire.push_back(dbe->book1D("hWireWire_p11b","wire number ME +1/1b",113,-0.5,112.5));
00052       hWireWire.push_back(dbe->book1D("hWireWire_p12","wire number ME +1/2",113,-0.5,112.5));
00053       hWireWire.push_back(dbe->book1D("hWireWire_p13","wire number ME +1/3",113,-0.5,112.5));
00054       hWireWire.push_back(dbe->book1D("hWireWire_p11a","wire number ME +1/1a",113,-0.5,112.5));
00055       hWireWire.push_back(dbe->book1D("hWireWire_p21","wire number ME +2/1",113,-0.5,112.5));
00056       hWireWire.push_back(dbe->book1D("hWireWire_p22","wire number ME +2/2",113,-0.5,112.5));
00057       hWireWire.push_back(dbe->book1D("hWireWire_p31","wire number ME +3/1",113,-0.5,112.5));
00058       hWireWire.push_back(dbe->book1D("hWireWire_p32","wire number ME +3/2",113,-0.5,112.5));
00059       hWireWire.push_back(dbe->book1D("hWireWire_p41","wire number ME +4/1",113,-0.5,112.5));
00060       hWireWire.push_back(dbe->book1D("hWireWire_p42","wire number ME +4/2",113,-0.5,112.5));
00061       hWireLayer.push_back(dbe->book1D("hWireLayer_m42","layer wire ME -4/2",7,-0.5,6.5));
00062       hWireLayer.push_back(dbe->book1D("hWireLayer_m41","layer wire ME -4/1",7,-0.5,6.5));
00063       hWireLayer.push_back(dbe->book1D("hWireLayer_m32","layer wire ME -3/2",7,-0.5,6.5));
00064       hWireLayer.push_back(dbe->book1D("hWireLayer_m31","layer wire ME -3/1",7,-0.5,6.5));
00065       hWireLayer.push_back(dbe->book1D("hWireLayer_m22","layer wire ME -2/2",7,-0.5,6.5));
00066       hWireLayer.push_back(dbe->book1D("hWireLayer_m21","layer wire ME -2/1",7,-0.5,6.5));
00067       hWireLayer.push_back(dbe->book1D("hWireLayer_m11a","layer wire ME -1/1a",7,-0.5,6.5));
00068       hWireLayer.push_back(dbe->book1D("hWireLayer_m13","layer wire ME -1/3",7,-0.5,6.5));
00069       hWireLayer.push_back(dbe->book1D("hWireLayer_m12","layer wire ME -1/2",7,-0.5,6.5));
00070       hWireLayer.push_back(dbe->book1D("hWireLayer_m11b","layer wire ME -1/1b",7,-0.5,6.5));
00071       hWireLayer.push_back(dbe->book1D("hWireLayer_p11b","layer wire ME +1/1b",7,-0.5,6.5));
00072       hWireLayer.push_back(dbe->book1D("hWireLayer_p12","layer wire ME +1/2",7,-0.5,6.5));
00073       hWireLayer.push_back(dbe->book1D("hWireLayer_p13","layer wire ME +1/3",7,-0.5,6.5));
00074       hWireLayer.push_back(dbe->book1D("hWireLayer_p11a","layer wire ME +1/1a",7,-0.5,6.5));
00075       hWireLayer.push_back(dbe->book1D("hWireLayer_p21","layer wire ME +2/1",7,-0.5,6.5));
00076       hWireLayer.push_back(dbe->book1D("hWireLayer_p22","layer wire ME +2/2",7,-0.5,6.5));
00077       hWireLayer.push_back(dbe->book1D("hWireLayer_p31","layer wire ME +3/1",7,-0.5,6.5));
00078       hWireLayer.push_back(dbe->book1D("hWireLayer_p32","layer wire ME +3/2",7,-0.5,6.5));
00079       hWireLayer.push_back(dbe->book1D("hWireLayer_p41","layer wire ME +4/1",7,-0.5,6.5));
00080       hWireLayer.push_back(dbe->book1D("hWireLayer_p42","layer wire ME +4/2",7,-0.5,6.5));
00081 
00082       // strip digis
00083       hStripAll = dbe->book1D("hStripAll","all strip numbers",81,-0.5,80.5);
00084       hStripNFired = dbe->book1D("hStripNFired","total number of fired strips",601,-0.5,600.5);
00085       hStripCodeBroad = dbe->book1D("hStripCodeBroad","broad scope code for strips",33,-16.5,16.5);
00086       hStripCodeNarrow.push_back(dbe->book1D("hStripCodeNarrow1","narrow scope strip code station 1",801,-400.5,400.5));
00087       hStripCodeNarrow.push_back(dbe->book1D("hStripCodeNarrow2","narrow scope strip code station 2",801,-400.5,400.5));
00088       hStripCodeNarrow.push_back(dbe->book1D("hStripCodeNarrow3","narrow scope strip code station 3",801,-400.5,400.5));
00089       hStripCodeNarrow.push_back(dbe->book1D("hStripCodeNarrow4","narrow scope strip code station 4",801,-400.5,400.5));
00090       hStripLayer.push_back(dbe->book1D("hStripLayer_m42","layer strip ME -4/2",7,-0.5,6.5));
00091       hStripLayer.push_back(dbe->book1D("hStripLayer_m41","layer strip ME -4/1",7,-0.5,6.5));
00092       hStripLayer.push_back(dbe->book1D("hStripLayer_m32","layer strip ME -3/2",7,-0.5,6.5));
00093       hStripLayer.push_back(dbe->book1D("hStripLayer_m31","layer strip ME -3/1",7,-0.5,6.5));
00094       hStripLayer.push_back(dbe->book1D("hStripLayer_m22","layer strip ME -2/2",7,-0.5,6.5));
00095       hStripLayer.push_back(dbe->book1D("hStripLayer_m21","layer strip ME -2/1",7,-0.5,6.5));
00096       hStripLayer.push_back(dbe->book1D("hStripLayer_m11a","layer strip ME -1/1a",7,-0.5,6.5));
00097       hStripLayer.push_back(dbe->book1D("hStripLayer_m13","layer strip ME -1/3",7,-0.5,6.5));
00098       hStripLayer.push_back(dbe->book1D("hStripLayer_m12","layer strip ME -1/2",7,-0.5,6.5));
00099       hStripLayer.push_back(dbe->book1D("hStripLayer_m11b","layer strip ME -1/1b",7,-0.5,6.5));
00100       hStripLayer.push_back(dbe->book1D("hStripLayer_p11b","layer strip ME +1/1b",7,-0.5,6.5));
00101       hStripLayer.push_back(dbe->book1D("hStripLayer_p12","layer strip ME +1/2",7,-0.5,6.5));
00102       hStripLayer.push_back(dbe->book1D("hStripLayer_p13","layer strip ME +1/3",7,-0.5,6.5));
00103       hStripLayer.push_back(dbe->book1D("hStripLayer_p11a","layer strip ME +1/1a",7,-0.5,6.5));
00104       hStripLayer.push_back(dbe->book1D("hStripLayer_p21","layer strip ME +2/1",7,-0.5,6.5));
00105       hStripLayer.push_back(dbe->book1D("hStripLayer_p22","layer strip ME +2/2",7,-0.5,6.5));
00106       hStripLayer.push_back(dbe->book1D("hStripLayer_p31","layer strip ME +3/1",7,-0.5,6.5));
00107       hStripLayer.push_back(dbe->book1D("hStripLayer_p32","layer strip ME +3/2",7,-0.5,6.5));
00108       hStripLayer.push_back(dbe->book1D("hStripLayer_p41","layer strip ME +4/1",7,-0.5,6.5));
00109       hStripLayer.push_back(dbe->book1D("hStripLayer_p42","layer strip ME +4/2",7,-0.5,6.5));
00110       hStripStrip.push_back(dbe->book1D("hStripStrip_m42","strip number ME -4/2",81,-0.5,80.5));
00111       hStripStrip.push_back(dbe->book1D("hStripStrip_m41","strip number ME -4/1",81,-0.5,80.5));
00112       hStripStrip.push_back(dbe->book1D("hStripStrip_m32","strip number ME -3/2",81,-0.5,80.5));
00113       hStripStrip.push_back(dbe->book1D("hStripStrip_m31","strip number ME -3/1",81,-0.5,80.5));
00114       hStripStrip.push_back(dbe->book1D("hStripStrip_m22","strip number ME -2/2",81,-0.5,80.5));
00115       hStripStrip.push_back(dbe->book1D("hStripStrip_m21","strip number ME -2/1",81,-0.5,80.5));
00116       hStripStrip.push_back(dbe->book1D("hStripStrip_m11a","strip number ME -1/1a",81,-0.5,80.5));
00117       hStripStrip.push_back(dbe->book1D("hStripStrip_m13","strip number ME -1/3",81,-0.5,80.5));
00118       hStripStrip.push_back(dbe->book1D("hStripStrip_m12","strip number ME -1/2",81,-0.5,80.5));
00119       hStripStrip.push_back(dbe->book1D("hStripStrip_m11b","strip number ME -1/1b",81,-0.5,80.5));
00120       hStripStrip.push_back(dbe->book1D("hStripStrip_p11b","strip number ME +1/1b",81,-0.5,80.5));
00121       hStripStrip.push_back(dbe->book1D("hStripStrip_p12","strip number ME +1/2",81,-0.5,80.5));
00122       hStripStrip.push_back(dbe->book1D("hStripStrip_p13","strip number ME +1/3",81,-0.5,80.5));
00123       hStripStrip.push_back(dbe->book1D("hStripStrip_p11a","strip number ME +1/1a",81,-0.5,80.5));
00124       hStripStrip.push_back(dbe->book1D("hStripStrip_p21","strip number ME +2/1",81,-0.5,80.5));
00125       hStripStrip.push_back(dbe->book1D("hStripStrip_p22","strip number ME +2/2",81,-0.5,80.5));
00126       hStripStrip.push_back(dbe->book1D("hStripStrip_p31","strip number ME +3/1",81,-0.5,80.5));
00127       hStripStrip.push_back(dbe->book1D("hStripStrip_p32","strip number ME +3/2",81,-0.5,80.5));
00128       hStripStrip.push_back(dbe->book1D("hStripStrip_p41","strip number ME +4/1",81,-0.5,80.5));
00129       hStripStrip.push_back(dbe->book1D("hStripStrip_p42","strip number ME +4/2",81,-0.5,80.5));
00130 
00131 
00132       //Pedestal Noise Plots
00133       dbe->setCurrentFolder("CSC/CSCOfflineMonitor/PedestalNoise");
00134 
00135       hStripPedAll = dbe->book1D("hStripPed","Pedestal Noise Distribution",50,-25.,25.);
00136 
00137       hStripPed.push_back(dbe->book1D("hStripPedMEm42","Pedestal Noise Distribution Chamber ME -4/2 ",50,-25.,25.));
00138       hStripPed.push_back(dbe->book1D("hStripPedMEm41","Pedestal Noise Distribution Chamber ME -4/1 ",50,-25.,25.));
00139       hStripPed.push_back(dbe->book1D("hStripPedMEm32","Pedestal Noise Distribution Chamber ME -3/2 ",50,-25.,25.));
00140       hStripPed.push_back(dbe->book1D("hStripPedMEm31","Pedestal Noise Distribution Chamber ME -3/1 ",50,-25.,25.));
00141       hStripPed.push_back(dbe->book1D("hStripPedMEm22","Pedestal Noise Distribution Chamber ME -2/2 ",50,-25.,25.));
00142       hStripPed.push_back(dbe->book1D("hStripPedMEm21","Pedestal Noise Distribution Chamber ME -2/1 ",50,-25.,25.));
00143       hStripPed.push_back(dbe->book1D("hStripPedMEm11a","Pedestal Noise Distribution Chamber ME -1/1 ",50,-25.,25.));
00144       hStripPed.push_back(dbe->book1D("hStripPedMEm13","Pedestal Noise Distribution Chamber ME -1/3 ",50,-25.,25.));
00145       hStripPed.push_back(dbe->book1D("hStripPedMEm12","Pedestal Noise Distribution Chamber ME -1/2 ",50,-25.,25.));
00146       hStripPed.push_back(dbe->book1D("hStripPedMEm11b","Pedestal Noise Distribution Chamber ME -1/1 ",50,-25.,25.));
00147       hStripPed.push_back(dbe->book1D("hStripPedMEp11b","Pedestal Noise Distribution Chamber ME +1/1 ",50,-25.,25.));
00148       hStripPed.push_back(dbe->book1D("hStripPedMEp12","Pedestal Noise Distribution Chamber ME +1/2 ",50,-25.,25.));
00149       hStripPed.push_back(dbe->book1D("hStripPedMEp13","Pedestal Noise Distribution Chamber ME +1/3 ",50,-25.,25.));
00150       hStripPed.push_back(dbe->book1D("hStripPedMEp11a","Pedestal Noise Distribution Chamber ME +1/1 ",50,-25.,25.));
00151       hStripPed.push_back(dbe->book1D("hStripPedMEp21","Pedestal Noise Distribution Chamber ME +2/1 ",50,-25.,25.));
00152       hStripPed.push_back(dbe->book1D("hStripPedMEp22","Pedestal Noise Distribution Chamber ME +2/2 ",50,-25.,25.));
00153       hStripPed.push_back(dbe->book1D("hStripPedMEp31","Pedestal Noise Distribution Chamber ME +3/1 ",50,-25.,25.));
00154       hStripPed.push_back(dbe->book1D("hStripPedMEp32","Pedestal Noise Distribution Chamber ME +3/2 ",50,-25.,25.));
00155       hStripPed.push_back(dbe->book1D("hStripPedMEp41","Pedestal Noise Distribution Chamber ME +4/1 ",50,-25.,25.));
00156       hStripPed.push_back(dbe->book1D("hStripPedMEp42","Pedestal Noise Distribution Chamber ME +4/2 ",50,-25.,25.));
00157 
00158       //hPedvsStrip = dbe->book2D("hPedvsStrip","Pedestal Noise Distribution",4000000,1000000.,5000000.,50,-25.,25.);
00159 
00160       // recHits
00161       dbe->setCurrentFolder("CSC/CSCOfflineMonitor/recHits");
00162       hRHCodeBroad = dbe->book1D("hRHCodeBroad","broad scope code for recHits",33,-16.5,16.5);
00163       hRHCodeNarrow.push_back(dbe->book1D("hRHCodeNarrow1","narrow scope recHit code station 1",801,-400.5,400.5));
00164       hRHCodeNarrow.push_back(dbe->book1D("hRHCodeNarrow2","narrow scope recHit code station 2",801,-400.5,400.5));
00165       hRHCodeNarrow.push_back(dbe->book1D("hRHCodeNarrow3","narrow scope recHit code station 3",801,-400.5,400.5));
00166       hRHCodeNarrow.push_back(dbe->book1D("hRHCodeNarrow4","narrow scope recHit code station 4",801,-400.5,400.5));
00167 
00168       hRHLayer.push_back(dbe->book1D("hRHLayerm42","layer recHit ME -4/2",7,-0.5,6.5));
00169       hRHLayer.push_back(dbe->book1D("hRHLayerm41","layer recHit ME -4/1",7,-0.5,6.5));
00170       hRHLayer.push_back(dbe->book1D("hRHLayerm32","layer recHit ME -3/2",7,-0.5,6.5));
00171       hRHLayer.push_back(dbe->book1D("hRHLayerm31","layer recHit ME -3/1",7,-0.5,6.5));
00172       hRHLayer.push_back(dbe->book1D("hRHLayerm22","layer recHit ME -2/2",7,-0.5,6.5));
00173       hRHLayer.push_back(dbe->book1D("hRHLayerm21","layer recHit ME -2/1",7,-0.5,6.5));
00174       hRHLayer.push_back(dbe->book1D("hRHLayerm11a","layer recHit ME -1/1a",7,-0.5,6.5));
00175       hRHLayer.push_back(dbe->book1D("hRHLayerm13","layer recHit ME -1/3",7,-0.5,6.5));
00176       hRHLayer.push_back(dbe->book1D("hRHLayerm12","layer recHit ME -1/2",7,-0.5,6.5));
00177       hRHLayer.push_back(dbe->book1D("hRHLayerm11b","layer recHit ME -1/1b",7,-0.5,6.5));
00178       hRHLayer.push_back(dbe->book1D("hRHLayerp11b","layer recHit ME +1/1b",7,-0.5,6.5));
00179       hRHLayer.push_back(dbe->book1D("hRHLayerp12","layer recHit ME +1/2",7,-0.5,6.5));
00180       hRHLayer.push_back(dbe->book1D("hRHLayerp13","layer recHit ME +1/3",7,-0.5,6.5));
00181       hRHLayer.push_back(dbe->book1D("hRHLayerp11a","layer recHit ME +1/1a",7,-0.5,6.5));
00182       hRHLayer.push_back(dbe->book1D("hRHLayerp21","layer recHit ME +2/1",7,-0.5,6.5));
00183       hRHLayer.push_back(dbe->book1D("hRHLayerp22","layer recHit ME +2/2",7,-0.5,6.5));
00184       hRHLayer.push_back(dbe->book1D("hRHLayerp31","layer recHit ME +3/1",7,-0.5,6.5));
00185       hRHLayer.push_back(dbe->book1D("hRHLayerp32","layer recHit ME +3/2",7,-0.5,6.5));
00186       hRHLayer.push_back(dbe->book1D("hRHLayerp41","layer recHit ME +4/1",7,-0.5,6.5));
00187       hRHLayer.push_back(dbe->book1D("hRHLayerp42","layer recHit ME +4/2",7,-0.5,6.5));
00188 
00189 
00190       hRHX.push_back(dbe->book1D("hRHXm42","local X recHit ME -4/2",160,-80.,80.));
00191       hRHX.push_back(dbe->book1D("hRHXm41","local X recHit ME -4/1",160,-80.,80.));
00192       hRHX.push_back(dbe->book1D("hRHXm32","local X recHit ME -3/2",160,-80.,80.));
00193       hRHX.push_back(dbe->book1D("hRHXm31","local X recHit ME -3/1",160,-80.,80.));
00194       hRHX.push_back(dbe->book1D("hRHXm22","local X recHit ME -2/2",160,-80.,80.));
00195       hRHX.push_back(dbe->book1D("hRHXm21","local X recHit ME -2/1",160,-80.,80.));
00196       hRHX.push_back(dbe->book1D("hRHXm11a","local X recHit ME -1/1a",120,-60.,60.));
00197       hRHX.push_back(dbe->book1D("hRHXm13","local X recHit ME -1/3",120,-60.,60.));
00198       hRHX.push_back(dbe->book1D("hRHXm12","local X recHit ME -1/2",120,-60.,60.));
00199       hRHX.push_back(dbe->book1D("hRHXm11b","local X recHit ME -1/1b",120,-60.,60.));
00200       hRHX.push_back(dbe->book1D("hRHXp11b","local X recHit ME +1/1b",120,-60.,60.));
00201       hRHX.push_back(dbe->book1D("hRHXp12","local X recHit ME +1/2",120,-60.,60.));
00202       hRHX.push_back(dbe->book1D("hRHXp13","local X recHit ME +1/3",120,-60.,60.));
00203       hRHX.push_back(dbe->book1D("hRHXp11a","local X recHit ME +1/1a",120,-60.,60.));
00204       hRHX.push_back(dbe->book1D("hRHXp21","local X recHit ME +2/1",160,-80.,80.));
00205       hRHX.push_back(dbe->book1D("hRHXp22","local X recHit ME +2/2",160,-80.,80.));
00206       hRHX.push_back(dbe->book1D("hRHXp31","local X recHit ME +3/1",160,-80.,80.));
00207       hRHX.push_back(dbe->book1D("hRHXp32","local X recHit ME +3/2",160,-80.,80.));
00208       hRHX.push_back(dbe->book1D("hRHXp41","local X recHit ME +4/1",160,-80.,80.));
00209       hRHX.push_back(dbe->book1D("hRHXp42","local X recHit ME +4/2",160,-80.,80.));
00210 
00211 
00212       hRHY.push_back(dbe->book1D("hRHYm42","local Y recHit ME -4/2",60,-180.,180.));
00213       hRHY.push_back(dbe->book1D("hRHYm41","local Y recHit ME -4/1",60,-180.,180.));
00214       hRHY.push_back(dbe->book1D("hRHYm32","local Y recHit ME -3/2",60,-180.,180.));
00215       hRHY.push_back(dbe->book1D("hRHYm31","local Y recHit ME -3/1",60,-180.,180.));
00216       hRHY.push_back(dbe->book1D("hRHYm22","local Y recHit ME -2/2",60,-180.,180.));
00217       hRHY.push_back(dbe->book1D("hRHYm21","local Y recHit ME -2/1",60,-180.,180.));
00218       hRHY.push_back(dbe->book1D("hRHYm11a","local Y recHit ME -1/1a",50,-100.,100.));
00219       hRHY.push_back(dbe->book1D("hRHYm13","local Y recHit ME -1/3",50,-100.,100.));
00220       hRHY.push_back(dbe->book1D("hRHYm12","local Y recHit ME -1/2",50,-100.,100.));
00221       hRHY.push_back(dbe->book1D("hRHYm11b","local Y recHit ME -1/1b",50,-100.,100.));
00222       hRHY.push_back(dbe->book1D("hRHYp11b","local Y recHit ME +1/1b",50,-100.,100.));
00223       hRHY.push_back(dbe->book1D("hRHYp12","local Y recHit ME +1/2",50,-100.,100.));
00224       hRHY.push_back(dbe->book1D("hRHYp13","local Y recHit ME +1/3",50,-100.,100.));
00225       hRHY.push_back(dbe->book1D("hRHYp11a","local Y recHit ME +1/1a",50,-100.,100.));
00226       hRHY.push_back(dbe->book1D("hRHYp21","local Y recHit ME +2/1",60,-180.,180.));
00227       hRHY.push_back(dbe->book1D("hRHYp22","local Y recHit ME +2/2",60,-180.,180.));
00228       hRHY.push_back(dbe->book1D("hRHYp31","local Y recHit ME +3/1",60,-180.,180.));
00229       hRHY.push_back(dbe->book1D("hRHYp32","local Y recHit ME +3/2",60,-180.,180.));
00230       hRHY.push_back(dbe->book1D("hRHYp41","local Y recHit ME +4/1",60,-180.,180.));
00231       hRHY.push_back(dbe->book1D("hRHYp42","local Y recHit ME +4/2",60,-180.,180.));
00232 
00233 
00234       //hRHGlobal.push_back(dbe->book2D("hRHGlobalp1","recHit global X,Y station +1",400,-800.,800.,400,-800.,800.));
00235       //hRHGlobal.push_back(dbe->book2D("hRHGlobalp2","recHit global X,Y station +2",400,-800.,800.,400,-800.,800.));
00236       //hRHGlobal.push_back(dbe->book2D("hRHGlobalp3","recHit global X,Y station +3",400,-800.,800.,400,-800.,800.));
00237       //hRHGlobal.push_back(dbe->book2D("hRHGlobalp4","recHit global X,Y station +4",400,-800.,800.,400,-800.,800.));
00238       //hRHGlobal.push_back(dbe->book2D("hRHGlobalm1","recHit global X,Y station -1",400,-800.,800.,400,-800.,800.));
00239       //hRHGlobal.push_back(dbe->book2D("hRHGlobalm2","recHit global X,Y station -2",400,-800.,800.,400,-800.,800.));
00240       //hRHGlobal.push_back(dbe->book2D("hRHGlobalm3","recHit global X,Y station -3",400,-800.,800.,400,-800.,800.));
00241       //hRHGlobal.push_back(dbe->book2D("hRHGlobalm4","recHit global X,Y station -4",400,-800.,800.,400,-800.,800.));
00242 
00243 
00244       hRHSumQ.push_back(dbe->book1D("hRHSumQm42","Sum 3x3 recHit Charge (ME -4/2)",250,0,2000));
00245       hRHSumQ.push_back(dbe->book1D("hRHSumQm41","Sum 3x3 recHit Charge (ME -4/1)",250,0,2000));
00246       hRHSumQ.push_back(dbe->book1D("hRHSumQm32","Sum 3x3 recHit Charge (ME -3/2)",250,0,2000));
00247       hRHSumQ.push_back(dbe->book1D("hRHSumQm31","Sum 3x3 recHit Charge (ME -3/1)",250,0,2000));
00248       hRHSumQ.push_back(dbe->book1D("hRHSumQm22","Sum 3x3 recHit Charge (ME -2/2)",250,0,2000));
00249       hRHSumQ.push_back(dbe->book1D("hRHSumQm21","Sum 3x3 recHit Charge (ME -2/1)",250,0,2000));
00250       hRHSumQ.push_back(dbe->book1D("hRHSumQm11a","Sum 3x3 recHit Charge (ME -1/1a)",250,0,2000));
00251       hRHSumQ.push_back(dbe->book1D("hRHSumQm13","Sum 3x3 recHit Charge (ME -1/3)",250,0,2000));
00252       hRHSumQ.push_back(dbe->book1D("hRHSumQm12","Sum 3x3 recHit Charge (ME -1/2)",250,0,2000));
00253       hRHSumQ.push_back(dbe->book1D("hRHSumQm11b","Sum 3x3 recHit Charge (ME -1/1b)",250,0,2000));
00254       hRHSumQ.push_back(dbe->book1D("hRHSumQp11b","Sum 3x3 recHit Charge (ME +1/1b)",250,0,2000));
00255       hRHSumQ.push_back(dbe->book1D("hRHSumQp12","Sum 3x3 recHit Charge (ME +1/2)",250,0,2000));
00256       hRHSumQ.push_back(dbe->book1D("hRHSumQp13","Sum 3x3 recHit Charge (ME +1/3)",250,0,2000));
00257       hRHSumQ.push_back(dbe->book1D("hRHSumQp11a","Sum 3x3 recHit Charge (ME +1/1a)",250,0,2000));
00258       hRHSumQ.push_back(dbe->book1D("hRHSumQp21","Sum 3x3 recHit Charge (ME +2/1)",250,0,2000));
00259       hRHSumQ.push_back(dbe->book1D("hRHSumQp22","Sum 3x3 recHit Charge (ME +2/2)",250,0,2000));
00260       hRHSumQ.push_back(dbe->book1D("hRHSumQp31","Sum 3x3 recHit Charge (ME +3/1)",250,0,2000));
00261       hRHSumQ.push_back(dbe->book1D("hRHSumQp32","Sum 3x3 recHit Charge (ME +3/2)",250,0,2000));
00262       hRHSumQ.push_back(dbe->book1D("hRHSumQp41","Sum 3x3 recHit Charge (ME +4/1)",250,0,2000));
00263       hRHSumQ.push_back(dbe->book1D("hRHSumQp42","Sum 3x3 recHit Charge (ME +4/2)",250,0,2000));
00264 
00265 
00266       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm42","Ratio (Ql+Qr)/Qt (ME -4/2)",120,-0.1,1.1));
00267       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm41","Ratio (Ql+Qr)/Qt (ME -4/1)",120,-0.1,1.1));
00268       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm32","Ratio (Ql+Qr)/Qt (ME -3/2)",120,-0.1,1.1));
00269       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm31","Ratio (Ql+Qr)/Qt (ME -3/1)",120,-0.1,1.1));
00270       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm22","Ratio (Ql+Qr)/Qt (ME -2/2)",120,-0.1,1.1));
00271       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm21","Ratio (Ql+Qr)/Qt (ME -2/1)",120,-0.1,1.1));
00272       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm11a","Ratio (Ql+Qr)/Qt (ME -1/1a)",120,-0.1,1.1));
00273       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm13","Ratio (Ql+Qr)/Qt (ME -1/3)",120,-0.1,1.1));
00274       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm12","Ratio (Ql+Qr)/Qt (ME -1/2)",120,-0.1,1.1));
00275       hRHRatioQ.push_back(dbe->book1D("hRHRatioQm11b","Ratio (Ql+Qr)/Qt (ME -1/1b)",120,-0.1,1.1));
00276       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp11b","Ratio (Ql+Qr)/Qt (ME +1/1b)",120,-0.1,1.1));
00277       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp12","Ratio (Ql+Qr)/Qt (ME +1/2)",120,-0.1,1.1));
00278       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp13","Ratio (Ql+Qr)/Qt (ME +1/3)",120,-0.1,1.1));
00279       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp11a","Ratio (Ql+Qr)/Qt (ME +1/1a)",120,-0.1,1.1));
00280       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp21","Ratio (Ql+Qr)/Qt (ME +2/1)",120,-0.1,1.1));
00281       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp22","Ratio (Ql+Qr)/Qt (ME +2/2)",120,-0.1,1.1));
00282       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp31","Ratio (Ql+Qr)/Qt (ME +3/1)",120,-0.1,1.1));
00283       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp32","Ratio (Ql+Qr)/Qt (ME +3/2)",120,-0.1,1.1));
00284       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp41","Ratio (Ql+Qr)/Qt (ME +4/1)",120,-0.1,1.1));
00285       hRHRatioQ.push_back(dbe->book1D("hRHRatioQp42","Ratio (Ql+Qr)/Qt (ME +4/2)",120,-0.1,1.1));
00286  
00287 
00288       hRHTiming.push_back(dbe->book1D("hRHTimingm42","recHit Timing (ME -4/2)",100,0,10));
00289       hRHTiming.push_back(dbe->book1D("hRHTimingm41","recHit Timing (ME -4/1)",100,0,10));
00290       hRHTiming.push_back(dbe->book1D("hRHTimingm32","recHit Timing (ME -3/2)",100,0,10));
00291       hRHTiming.push_back(dbe->book1D("hRHTimingm31","recHit Timing (ME -3/1)",100,0,10));
00292       hRHTiming.push_back(dbe->book1D("hRHTimingm22","recHit Timing (ME -2/2)",100,0,10));
00293       hRHTiming.push_back(dbe->book1D("hRHTimingm21","recHit Timing (ME -2/1)",100,0,10));
00294       hRHTiming.push_back(dbe->book1D("hRHTimingm11a","recHit Timing (ME -1/1a)",100,0,10));
00295       hRHTiming.push_back(dbe->book1D("hRHTimingm13","recHit Timing (ME -1/3)",100,0,10));
00296       hRHTiming.push_back(dbe->book1D("hRHTimingm12","recHit Timing (ME -1/2)",100,0,10));
00297       hRHTiming.push_back(dbe->book1D("hRHTimingm11b","recHit Timing (ME -1/1b)",100,0,10));
00298       hRHTiming.push_back(dbe->book1D("hRHTimingp11b","recHit Timing (ME +1/1b)",100,0,10));
00299       hRHTiming.push_back(dbe->book1D("hRHTimingp12","recHit Timing (ME +1/2)",100,0,10));
00300       hRHTiming.push_back(dbe->book1D("hRHTimingp13","recHit Timing (ME +1/3)",100,0,10));
00301       hRHTiming.push_back(dbe->book1D("hRHTimingp11a","recHit Timing (ME +1/1a)",100,0,10));
00302       hRHTiming.push_back(dbe->book1D("hRHTimingp21","recHit Timing (ME +2/1)",100,0,10));
00303       hRHTiming.push_back(dbe->book1D("hRHTimingp22","recHit Timing (ME +2/2)",100,0,10));
00304       hRHTiming.push_back(dbe->book1D("hRHTimingp31","recHit Timing (ME +3/1)",100,0,10));
00305       hRHTiming.push_back(dbe->book1D("hRHTimingp32","recHit Timing (ME +3/2)",100,0,10));
00306       hRHTiming.push_back(dbe->book1D("hRHTimingp41","recHit Timing (ME +4/1)",100,0,10));
00307       hRHTiming.push_back(dbe->book1D("hRHTimingp42","recHit Timing (ME +4/2)",100,0,10));
00308 
00309       hRHnrechits = dbe->book1D("hRHnrechits","recHits per Event (all chambers)",50,0,50);
00310 
00311       // segments
00312       dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Segments");
00313       hSCodeBroad = dbe->book1D("hSCodeBroad","broad scope code for recHits",33,-16.5,16.5);
00314       hSCodeNarrow.push_back(dbe->book1D("hSCodeNarrow1","narrow scope Segment code station 1",801,-400.5,400.5));
00315       hSCodeNarrow.push_back(dbe->book1D("hSCodeNarrow2","narrow scope Segment code station 2",801,-400.5,400.5));
00316       hSCodeNarrow.push_back(dbe->book1D("hSCodeNarrow3","narrow scope Segment code station 3",801,-400.5,400.5));
00317       hSCodeNarrow.push_back(dbe->book1D("hSCodeNarrow4","narrow scope Segment code station 4",801,-400.5,400.5));
00318 
00319       hSnHits.push_back(dbe->book1D("hSnHitsm42","N hits on Segments ME -4/2",7,-0.5,6.5));
00320       hSnHits.push_back(dbe->book1D("hSnHitsm41","N hits on Segments ME -4/1",7,-0.5,6.5));
00321       hSnHits.push_back(dbe->book1D("hSnHitsm32","N hits on Segments ME -3/2",7,-0.5,6.5));
00322       hSnHits.push_back(dbe->book1D("hSnHitsm31","N hits on Segments ME -3/1",7,-0.5,6.5));
00323       hSnHits.push_back(dbe->book1D("hSnHitsm22","N hits on Segments ME -2/2",7,-0.5,6.5));
00324       hSnHits.push_back(dbe->book1D("hSnHitsm21","N hits on Segments ME -2/1",7,-0.5,6.5));
00325       hSnHits.push_back(dbe->book1D("hSnHitsm11a","N hits on Segments ME -1/1a",7,-0.5,6.5));
00326       hSnHits.push_back(dbe->book1D("hSnHitsm13","N hits on Segments ME -1/3",7,-0.5,6.5));
00327       hSnHits.push_back(dbe->book1D("hSnHitsm12","N hits on Segments ME -1/2",7,-0.5,6.5));
00328       hSnHits.push_back(dbe->book1D("hSnHitsm11b","N hits on Segments ME -1/1b",7,-0.5,6.5));
00329       hSnHits.push_back(dbe->book1D("hSnHitsp11b","N hits on Segments ME +1/1b",7,-0.5,6.5));
00330       hSnHits.push_back(dbe->book1D("hSnHitsp12","N hits on Segments ME +1/2",7,-0.5,6.5));
00331       hSnHits.push_back(dbe->book1D("hSnHitsp13","N hits on Segments ME +1/3",7,-0.5,6.5));
00332       hSnHits.push_back(dbe->book1D("hSnHitsp11a","N hits on Segments ME +1/1a",7,-0.5,6.5));
00333       hSnHits.push_back(dbe->book1D("hSnHitsp21","N hits on Segments ME +2/1",7,-0.5,6.5));
00334       hSnHits.push_back(dbe->book1D("hSnHitsp22","N hits on Segments ME +2/2",7,-0.5,6.5));
00335       hSnHits.push_back(dbe->book1D("hSnHitsp31","N hits on Segments ME +3/1",7,-0.5,6.5));
00336       hSnHits.push_back(dbe->book1D("hSnHitsp32","N hits on Segments ME +3/2",7,-0.5,6.5));
00337       hSnHits.push_back(dbe->book1D("hSnHitsp41","N hits on Segments ME +4/1",7,-0.5,6.5));
00338       hSnHits.push_back(dbe->book1D("hSnHitsp42","N hits on Segments ME +4/2",7,-0.5,6.5));
00339 
00340       hSTheta.push_back(dbe->book1D("hSThetam42","local theta segments in ME -4/2",128,-3.2,3.2));
00341       hSTheta.push_back(dbe->book1D("hSThetam41","local theta segments in ME -4/1",128,-3.2,3.2));
00342       hSTheta.push_back(dbe->book1D("hSThetam32","local theta segments in ME -3/2",128,-3.2,3.2));
00343       hSTheta.push_back(dbe->book1D("hSThetam31","local theta segments in ME -3/1",128,-3.2,3.2));
00344       hSTheta.push_back(dbe->book1D("hSThetam22","local theta segments in ME -2/2",128,-3.2,3.2));
00345       hSTheta.push_back(dbe->book1D("hSThetam21","local theta segments in ME -2/1",128,-3.2,3.2));
00346       hSTheta.push_back(dbe->book1D("hSThetam11a","local theta segments ME -1/1a",128,-3.2,3.2));
00347       hSTheta.push_back(dbe->book1D("hSThetam13","local theta segments ME -1/3",128,-3.2,3.2));
00348       hSTheta.push_back(dbe->book1D("hSThetam12","local theta segments ME -1/2",128,-3.2,3.2));
00349       hSTheta.push_back(dbe->book1D("hSThetam11b","local theta segments ME -1/1b",128,-3.2,3.2));
00350       hSTheta.push_back(dbe->book1D("hSThetap11b","local theta segments ME +1/1b",128,-3.2,3.2));
00351       hSTheta.push_back(dbe->book1D("hSThetap12","local theta segments ME +1/2",128,-3.2,3.2));
00352       hSTheta.push_back(dbe->book1D("hSThetap13","local theta segments ME +1/3",128,-3.2,3.2));
00353       hSTheta.push_back(dbe->book1D("hSThetap11a","local theta segments ME +1/1a",128,-3.2,3.2));
00354       hSTheta.push_back(dbe->book1D("hSThetap21","local theta segments in ME +2/1",128,-3.2,3.2));
00355       hSTheta.push_back(dbe->book1D("hSThetap22","local theta segments in ME +2/2",128,-3.2,3.2));
00356       hSTheta.push_back(dbe->book1D("hSThetap31","local theta segments in ME +3/1",128,-3.2,3.2));
00357       hSTheta.push_back(dbe->book1D("hSThetap32","local theta segments in ME +3/2",128,-3.2,3.2));
00358       hSTheta.push_back(dbe->book1D("hSThetap41","local theta segments in ME +4/1",128,-3.2,3.2));
00359       hSTheta.push_back(dbe->book1D("hSThetap42","local theta segments in ME +4/2",128,-3.2,3.2));
00360 
00361       //hSGlobal.push_back(dbe->book2D("hSGlobalp1","segment global X,Y station +1",400,-800.,800.,400,-800.,800.));
00362       //hSGlobal.push_back(dbe->book2D("hSGlobalp2","segment global X,Y station +2",400,-800.,800.,400,-800.,800.));
00363       //hSGlobal.push_back(dbe->book2D("hSGlobalp3","segment global X,Y station +3",400,-800.,800.,400,-800.,800.));
00364       //hSGlobal.push_back(dbe->book2D("hSGlobalp4","segment global X,Y station +4",400,-800.,800.,400,-800.,800.));
00365       //hSGlobal.push_back(dbe->book2D("hSGlobalm1","segment global X,Y station -1",400,-800.,800.,400,-800.,800.));
00366       //hSGlobal.push_back(dbe->book2D("hSGlobalm2","segment global X,Y station -2",400,-800.,800.,400,-800.,800.));
00367       //hSGlobal.push_back(dbe->book2D("hSGlobalm3","segment global X,Y station -3",400,-800.,800.,400,-800.,800.));
00368       //hSGlobal.push_back(dbe->book2D("hSGlobalm4","segment global X,Y station -4",400,-800.,800.,400,-800.,800.));
00369 
00370       hSnhitsAll = dbe->book1D("hSnhits","N hits on Segments",7,-0.5,6.5);
00371       hSChiSqProb = dbe->book1D("hSChiSqProb","segments chi-squared probability",100,0.,1.);
00372       hSGlobalTheta = dbe->book1D("hSGlobalTheta","segment global theta",64,0,1.6);
00373       hSGlobalPhi   = dbe->book1D("hSGlobalPhi",  "segment global phi",  128,-3.2,3.2);
00374       hSnSegments   = dbe->book1D("hSnSegments","number of segments per event",11,-0.5,10.5);
00375 
00376       hSResid.push_back(dbe->book1D("hSResidm42","Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/2)",100,-0.5,0.5));
00377       hSResid.push_back(dbe->book1D("hSResidm41","Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/1)",100,-0.5,0.5));
00378       hSResid.push_back(dbe->book1D("hSResidm32","Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/2)",100,-0.5,0.5));
00379       hSResid.push_back(dbe->book1D("hSResidm31","Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/1)",100,-0.5,0.5));
00380       hSResid.push_back(dbe->book1D("hSResidm22","Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/2)",100,-0.5,0.5));
00381       hSResid.push_back(dbe->book1D("hSResidm21","Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/1)",100,-0.5,0.5));
00382       hSResid.push_back(dbe->book1D("hSResidm11a","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1a)",100,-0.5,0.5));
00383       hSResid.push_back(dbe->book1D("hSResidm13","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/3)",100,-0.5,0.5));
00384       hSResid.push_back(dbe->book1D("hSResidm12","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/2)",100,-0.5,0.5));
00385       hSResid.push_back(dbe->book1D("hSResidm11b","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1b)",100,-0.5,0.5));
00386       hSResid.push_back(dbe->book1D("hSResidp11b","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1b)",100,-0.5,0.5));
00387       hSResid.push_back(dbe->book1D("hSResidp12","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/2)",100,-0.5,0.5));
00388       hSResid.push_back(dbe->book1D("hSResidp13","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/3)",100,-0.5,0.5));
00389       hSResid.push_back(dbe->book1D("hSResidp11a","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1a)",100,-0.5,0.5));
00390       hSResid.push_back(dbe->book1D("hSResidp21","Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/1)",100,-0.5,0.5));
00391       hSResid.push_back(dbe->book1D("hSResidp22","Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/2)",100,-0.5,0.5));
00392       hSResid.push_back(dbe->book1D("hSResidp31","Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/1)",100,-0.5,0.5));
00393       hSResid.push_back(dbe->book1D("hSResidp32","Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/2)",100,-0.5,0.5));
00394       hSResid.push_back(dbe->book1D("hSResidp41","Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/1)",100,-0.5,0.5));
00395       hSResid.push_back(dbe->book1D("hSResidp42","Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/2)",100,-0.5,0.5));
00396 
00397       //occupancy plots
00398       dbe->setCurrentFolder("CSC/CSCOfflineMonitor/LocalRecoOccupancy");
00399       hOWires = dbe->book2D("hOWires","Wire Digi Occupancy",36,0.5,36.5,20,0.5,20.5);
00400       hOStrips = dbe->book2D("hOStrips","Strip Digi Occupancy",36,0.5,36.5,20,0.5,20.5);
00401       hORecHits = dbe->book2D("hORecHits","RecHit Occupancy",36,0.5,36.5,20,0.5,20.5);
00402       hOSegments = dbe->book2D("hOSegments","Segment Occupancy",36,0.5,36.5,20,0.5,20.5);
00403 
00404 
00405 
00406 }
00407 
00409 //  DESTRUCTOR  //
00411 CSCOfflineMonitor::~CSCOfflineMonitor(){
00412 
00413 }
00414 
00415 void CSCOfflineMonitor::endJob(void) {
00416   bool saveHistos = param.getParameter<bool>("saveHistos");
00417   string outputFileName = param.getParameter<string>("outputFileName");
00418   if(saveHistos){
00419     dbe->save(outputFileName);
00420   }
00421 }
00422 
00424 //  Analysis  //
00426 void CSCOfflineMonitor::analyze(const Event & event, const EventSetup& eventSetup){
00427   
00428   // Variables for occupancy plots
00429   bool wireo[2][4][4][36];
00430   bool stripo[2][4][4][36];
00431   bool rechito[2][4][4][36];
00432   bool segmento[2][4][4][36];
00433 
00434   for (int e = 0; e < 2; e++){
00435     for (int s = 0; s < 4; s++){
00436       for (int r = 0; r < 4; r++){
00437         for (int c = 0; c < 36; c++){
00438           wireo[e][s][r][c] = false;
00439           stripo[e][s][r][c] = false;
00440           rechito[e][s][r][c] = false;
00441           segmento[e][s][r][c] = false;
00442         }
00443       }
00444     }
00445   }
00446 
00447   // ==============================================
00448   //
00449   // look at DIGIs
00450   //
00451   // ==============================================
00452 
00453 
00454   edm::Handle<CSCStripDigiCollection> strips;
00455   edm::Handle<CSCWireDigiCollection> wires;
00456   event.getByLabel( stripDigiTag_, strips);
00457   event.getByLabel( wireDigiTag_,  wires);
00458 
00459   //
00460   // WIRE GROUPS
00461   int nWireGroupsTotal = 0;
00462   for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) {
00463     CSCDetId id = (CSCDetId)(*j).first;
00464     int index    = typeIndex(id);
00465     int kEndcap  = id.endcap();
00466     int cEndcap  = id.endcap();
00467     if (kEndcap == 2) cEndcap = -1;
00468     int kRing    = id.ring();
00469     int kStation = id.station();
00470     int kChamber = id.chamber();
00471     int kLayer   = id.layer();
00472     std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
00473     std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
00474     for( ; digiItr != last; ++digiItr) {
00475       int myWire = digiItr->getWireGroup();
00476       int myTBin = digiItr->getTimeBin();
00477       nWireGroupsTotal++;
00478       int kCodeBroad  = cEndcap * ( 4*(kStation-1) + kRing) ;
00479       int kCodeNarrow = cEndcap * ( 100*(kRing-1) + kChamber) ;
00480 
00481       // fill wire histos
00482       hWireTBinAll->Fill(myTBin);
00483       hWireAll->Fill(myWire);
00484       hWireCodeBroad->Fill(kCodeBroad);
00485       hWireCodeNarrow[kStation-1]->Fill(kCodeNarrow);
00486       hWireLayer[index]->Fill(kLayer);
00487       hWireWire[index]->Fill(myWire);
00488 
00489       wireo[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;      
00490     }
00491   } // end wire loop
00492   
00493 
00494   //
00495   // STRIPS
00496   //
00497   int nStripsFired = 0;
00498   for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) {
00499     CSCDetId id = (CSCDetId)(*j).first;
00500     int index    = typeIndex(id);
00501     int kEndcap  = id.endcap();
00502     int cEndcap  = id.endcap();
00503     if (kEndcap == 2) cEndcap = -1;
00504     int kRing    = id.ring();
00505     int kStation = id.station();
00506     int kChamber = id.chamber();
00507     int kLayer   = id.layer();
00508     std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
00509     std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
00510     for( ; digiItr != last; ++digiItr) {
00511       int myStrip = digiItr->getStrip();
00512       std::vector<int> myADCVals = digiItr->getADCCounts();
00513       bool thisStripFired = false;
00514       float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00515       float threshold = 13.3 ;
00516       float diff = 0.;
00517       for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
00518         diff = (float)myADCVals[iCount]-thisPedestal;
00519         if (diff > threshold) { thisStripFired = true; }
00520       } 
00521       if (thisStripFired) {
00522         nStripsFired++;
00523         int kCodeBroad  = cEndcap * ( 4*(kStation-1) + kRing) ;
00524         int kCodeNarrow = cEndcap * ( 100*(kRing-1) + kChamber) ;
00525         // fill strip histos
00526         hStripAll->Fill(myStrip);
00527         hStripCodeBroad->Fill(kCodeBroad);
00528         hStripCodeNarrow[kStation-1]->Fill(kCodeNarrow);
00529         hStripLayer[index]->Fill(kLayer);
00530         hStripStrip[index]->Fill(myStrip);
00531 
00532         stripo[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
00533       }
00534     }
00535   } // end strip loop
00536 
00537   //=======================================================
00538   //
00539   // Look at the Pedestal Noise Distributions
00540   //
00541   //=======================================================
00542 
00543   for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) {
00544     CSCDetId id = (CSCDetId)(*j).first;
00545     int index    = typeIndex(id);
00546     int kEndcap  = id.endcap();
00547     int cEndcap  = id.endcap();
00548     if (kEndcap == 2) cEndcap = -1;
00549     int kRing    = id.ring();
00550     int kStation = id.station();
00551     //int kChamber = id.chamber();
00552     //int kLayer   = id.layer();
00553     std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
00554     std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
00555     for( ; digiItr != last; ++digiItr) {
00556       int myStrip = digiItr->getStrip();
00557       std::vector<int> myADCVals = digiItr->getADCCounts();
00558       float TotalADC = getSignal(*strips, id, myStrip);
00559       bool thisStripFired = false;
00560       float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00561       float thisSignal = (1./6)*(myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00562       float threshold = 13.3;
00563       if(kStation == 1 && kRing == 4)
00564         {
00565           kRing = 1;
00566           if(myStrip <= 16) myStrip += 64; // no trapping for any bizarreness
00567         }
00568       //int globalStrip = cEndcap*( kStation*1000000 + kRing*100000 + kChamber*1000 + kLayer*100 + myStrip);
00569       if (TotalADC > threshold) { thisStripFired = true;}
00570       if (!thisStripFired){
00571         float ADC = thisSignal - thisPedestal;
00572         hStripPedAll->Fill(ADC);
00573         //hPedvsStrip->Fill(globalStrip,ADC);
00574         hStripPed[index]->Fill(ADC);
00575       }
00576     }
00577   }
00578 
00579 
00580 
00581 
00582   // ==============================================
00583   //
00584   // look at RECHITs
00585   //
00586   // ==============================================
00587 
00588   // Get the CSC Geometry :
00589   ESHandle<CSCGeometry> cscGeom;
00590   eventSetup.get<MuonGeometryRecord>().get(cscGeom);
00591   
00592   // Get the RecHits collection :
00593   Handle<CSCRecHit2DCollection> recHits; 
00594   event.getByLabel(cscRecHitTag_,recHits);  
00595   int nRecHits = recHits->size();
00596 
00597  
00598   // ---------------------
00599   // Loop over rechits 
00600   // ---------------------
00601   int iHit = 0;
00602 
00603   // Build iterator for rechits and loop :
00604   CSCRecHit2DCollection::const_iterator recIt;
00605   for (recIt = recHits->begin(); recIt != recHits->end(); recIt++) {
00606     iHit++;
00607 
00608     // Find chamber with rechits in CSC 
00609     CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
00610     int index    = typeIndex(idrec);
00611     int kEndcap  = idrec.endcap();
00612     int cEndcap  = idrec.endcap();
00613     if (kEndcap == 2) cEndcap = -1;
00614     int kRing    = idrec.ring();
00615     int kStation = idrec.station();
00616     int kChamber = idrec.chamber();
00617     int kLayer   = idrec.layer();
00618 
00619     rechito[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
00620 
00621     // Store rechit as a Local Point:
00622     LocalPoint rhitlocal = (*recIt).localPosition();  
00623     float xreco = rhitlocal.x();
00624     float yreco = rhitlocal.y();
00625 
00626     // Find the strip containing this hit
00627     //CSCRecHit2D::ChannelContainer hitstrips = (*recIt).channels();
00628     //int nStrips     =  hitstrips.size();
00629     //int centerid    =  nStrips/2 + 1;
00630     //int centerStrip =  hitstrips[centerid - 1];
00631 
00632     // Find the charge associated with this hit
00633 
00634     CSCRecHit2D::ADCContainer adcs = (*recIt).adcs();
00635     int adcsize = adcs.size();
00636     float rHSumQ = 0;
00637     float sumsides = 0;
00638     for (int i = 0; i < adcsize; i++){
00639       if (i != 3 && i != 7 && i != 11){
00640         rHSumQ = rHSumQ + adcs[i]; 
00641       }
00642       if (adcsize == 12 && (i < 3 || i > 7) && i < 12){
00643         sumsides = sumsides + adcs[i];
00644       }
00645     }
00646     float rHratioQ = sumsides/rHSumQ;
00647     if (adcsize != 12) rHratioQ = -99;
00648 
00649     // Get the signal timing of this hit
00650     float rHtime = (*recIt).tpeak()/50;
00651     //float rHtime = getTiming(*strips, idrec, centerStrip);
00652 
00653     // Get pointer to the layer:
00654     //const CSCLayer* csclayer = cscGeom->layer( idrec );
00655 
00656     // Transform hit position from local chamber geometry to global CMS geom
00657     //GlobalPoint rhitglobal= csclayer->toGlobal(rhitlocal);
00658     //float grecx   =  rhitglobal.x();
00659     //float grecy   =  rhitglobal.y();
00660 
00661     
00662     // Simple occupancy variables
00663     int kCodeBroad  = cEndcap * ( 4*(kStation-1) + kRing) ;
00664     int kCodeNarrow = cEndcap * ( 100*(kRing-1) + kChamber) ;
00665 
00666     // Fill some histograms
00667     hRHCodeBroad->Fill(kCodeBroad);
00668     hRHCodeNarrow[kStation-1]->Fill(kCodeNarrow);
00669     //hRHGlobal[(kStation-1) + ((kEndcap - 1)*4)]->Fill(grecx,grecy);
00670     hRHLayer[index]->Fill(kLayer);
00671     hRHX[index]->Fill(xreco);
00672     hRHY[index]->Fill(yreco);
00673     hRHSumQ[index]->Fill(rHSumQ);
00674     hRHRatioQ[index]->Fill(rHratioQ);
00675     hRHTiming[index]->Fill(rHtime);
00676 
00677   } //end rechit loop
00678 
00679   // ==============================================
00680   //
00681   // look at SEGMENTs
00682   //
00683   // ===============================================
00684 
00685   // get CSC segment collection
00686   Handle<CSCSegmentCollection> cscSegments;
00687   event.getByLabel(cscSegTag_, cscSegments);
00688   int nSegments = cscSegments->size();
00689 
00690   // -----------------------
00691   // loop over segments
00692   // -----------------------
00693   int iSegment = 0;
00694   for(CSCSegmentCollection::const_iterator it=cscSegments->begin(); it != cscSegments->end(); it++) {
00695     iSegment++;
00696     //
00697     CSCDetId id  = (CSCDetId)(*it).cscDetId();
00698     int index    = typeIndex(id);
00699     int kEndcap  = id.endcap();
00700     int cEndcap  = id.endcap();
00701     if (kEndcap == 2) cEndcap = -1;
00702     int kRing    = id.ring();
00703     int kStation = id.station();
00704     int kChamber = id.chamber();
00705     segmento[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
00706 
00707 
00708     //
00709     float chisq    = (*it).chi2();
00710     int nhits      = (*it).nRecHits();
00711     int nDOF       = 2*nhits-4;
00712     double chisqProb = ChiSquaredProbability( (double)chisq, nDOF );
00713     LocalPoint localPos = (*it).localPosition();
00714     LocalVector segDir = (*it).localDirection();
00715     double theta   = segDir.theta();
00716 
00717     //
00718     // try to get the CSC recHits that contribute to this segment.
00719     std::vector<CSCRecHit2D> theseRecHits = (*it).specificRecHits();
00720     int nRH = (*it).nRecHits();
00721     int jRH = 0;
00722     HepMatrix sp(6,1);
00723     HepMatrix se(6,1);
00724     for ( vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
00725       jRH++;
00726       CSCDetId idRH = (CSCDetId)(*iRH).cscDetId();
00727       int kRing    = idRH.ring();
00728       int kStation = idRH.station();
00729       int kLayer   = idRH.layer();
00730 
00731       // Find the strip containing this hit
00732       CSCRecHit2D::ChannelContainer hitstrips = (*iRH).channels();
00733       int nStrips     =  hitstrips.size();
00734       int centerid    =  nStrips/2 + 1;
00735       int centerStrip =  hitstrips[centerid - 1];
00736 
00737       // If this segment has 6 hits, find the position of each hit on the strip in units of stripwidth and store values
00738       if (nRH == 6){
00739         float stpos = (*iRH).positionWithinStrip();
00740         se(kLayer,1) = (*iRH).errorWithinStrip();
00741         // Take into account half-strip staggering of layers (ME1/1 has no staggering)
00742         if (kStation == 1 && (kRing == 1 || kRing == 4)) sp(kLayer,1) = stpos + centerStrip;
00743         else{
00744           if (kLayer == 1 || kLayer == 3 || kLayer == 5) sp(kLayer,1) = stpos + centerStrip;
00745           if (kLayer == 2 || kLayer == 4 || kLayer == 6) sp(kLayer,1) = stpos - 0.5 + centerStrip;
00746         }
00747       }
00748 
00749     }
00750 
00751     float residual = -99;
00752     // Fit all points except layer 3, then compare expected value for layer 3 to reconstructed value
00753     if (nRH == 6){
00754       float expected = fitX(sp,se);
00755       residual = expected - sp(3,1);
00756     }
00757 
00758     // global transformation
00759     float globX = 0.;
00760     float globY = 0.;
00761     float globZ = 0.;
00762     float globpPhi = 0.;
00763     float globR = 0.;
00764     float globTheta = 0.;
00765     float globPhi   = 0.;
00766     const CSCChamber* cscchamber = cscGeom->chamber(id);
00767     if (cscchamber) {
00768       GlobalPoint globalPosition = cscchamber->toGlobal(localPos);
00769       globX = globalPosition.x();
00770       globY = globalPosition.y();
00771       globZ = globalPosition.z();
00772       globpPhi =  globalPosition.phi();
00773       globR   =  sqrt(globX*globX + globY*globY);
00774       GlobalVector globalDirection = cscchamber->toGlobal(segDir);
00775       globTheta = globalDirection.theta();
00776       globPhi   = globalDirection.phi();
00777     }
00778 
00779     // Simple occupancy variables
00780     int kCodeBroad  = cEndcap * ( 4*(kStation-1) + kRing) ;
00781     int kCodeNarrow = cEndcap * ( 100*(kRing-1) + kChamber) ;
00782 
00783 
00784     // Fill histos
00785     hSCodeBroad->Fill(kCodeBroad);
00786     hSChiSqProb->Fill(chisqProb);
00787     hSGlobalTheta->Fill(globTheta);
00788     hSGlobalPhi->Fill(globPhi);
00789     hSnhitsAll->Fill(nhits);
00790     hSCodeNarrow[kStation-1]->Fill(kCodeNarrow);
00791     //hSGlobal[(kStation-1) + ((kEndcap - 1)*4)]->Fill(globX,globY);
00792     hSnHits[index]->Fill(nhits);
00793     hSTheta[index]->Fill(theta);
00794     hSResid[index]->Fill(residual);
00795 
00796   } // end segment loop
00797 
00798   // Fill # per even histos (how many stips/wires/rechits/segments per event)
00799   hWirenGroupsTotal->Fill(nWireGroupsTotal);
00800   hStripNFired->Fill(nStripsFired);
00801   hSnSegments->Fill(nSegments);
00802   hRHnrechits->Fill(nRecHits);
00803 
00804   // Fill occupancy plots
00805   for (int e = 0; e < 2; e++){
00806     for (int s = 0; s < 4; s++){
00807       for (int r = 0; r < 4; r++){
00808         for (int c = 0; c < 36; c++){
00809           int type = 0;
00810           if ((s+1) == 1) type = (r+1);
00811           else type = (s+1)*2 + (r+1);
00812           if ((e+1) == 1) type = type + 10;
00813           if ((e+1) == 2) type = 11 - type;
00814           //int bin = hOWires->GetBin(chamber,type);
00815           //hOWires->AddBinContent(bin);
00816           if (wireo[e][s][r][c]) hOWires->Fill((c+1),type);
00817           if (stripo[e][s][r][c]) hOStrips->Fill((c+1),type);
00818           if (rechito[e][s][r][c]) hORecHits->Fill((c+1),type);
00819           if (segmento[e][s][r][c]) hOSegments->Fill((c+1),type);
00820         }
00821       }
00822     }
00823   }
00824 
00825 
00826 }
00827 
00828 //-------------------------------------------------------------------------------------
00829 // Fits a straight line to a set of 5 points with errors.  Functions assumes 6 points
00830 // and removes hit in layer 3.  It then returns the expected position value in layer 3
00831 // based on the fit.
00832 //-------------------------------------------------------------------------------------
00833 float CSCOfflineMonitor::fitX(HepMatrix points, HepMatrix errors){
00834 
00835   float S   = 0;
00836   float Sx  = 0;
00837   float Sy  = 0;
00838   float Sxx = 0;
00839   float Sxy = 0;
00840   float sigma2 = 0;
00841 
00842   for (int i=1;i<7;i++){
00843     if (i != 3){
00844       sigma2 = errors(i,1)*errors(i,1);
00845       S = S + (1/sigma2);
00846       Sy = Sy + (points(i,1)/sigma2);
00847       Sx = Sx + ((i)/sigma2);
00848       Sxx = Sxx + (i*i)/sigma2;
00849       Sxy = Sxy + (((i)*points(i,1))/sigma2);
00850     }
00851   }
00852 
00853   float delta = S*Sxx - Sx*Sx;
00854   float intercept = (Sxx*Sy - Sx*Sxy)/delta;
00855   float slope = (S*Sxy - Sx*Sy)/delta;
00856 
00857   float chi = 0;
00858   float chi2 = 0;
00859 
00860   // calculate chi2 (not currently used)
00861   for (int i=1;i<7;i++){
00862     chi = (points(i,1) - intercept - slope*i)/(errors(i,1));
00863     chi2 = chi2 + chi*chi;
00864   }
00865 
00866   return (intercept + slope*3);
00867 
00868 }
00869 
00870 //---------------------------------------------------------------------------------------
00871 // Find the signal timing based on a weighted mean of the pulse.
00872 // Function is meant to take the DetId and center strip number of a recHit and return
00873 // the timing in units of time buckets (50ns)
00874 //---------------------------------------------------------------------------------------
00875 
00876 float CSCOfflineMonitor::getTiming(const CSCStripDigiCollection& stripdigis, CSCDetId idRH, int centerStrip){
00877 
00878   float ADC[8];
00879   for (int i = 0; i < 8; i++){
00880     ADC[i] = 0;
00881   }
00882   float timing = -1;
00883 
00884   if (idRH.station() == 1 && idRH.ring() == 4){
00885     while(centerStrip> 16) centerStrip -= 16;
00886   }
00887 
00888   // Loop over strip digis responsible for this recHit and sum charge
00889   CSCStripDigiCollection::DigiRangeIterator gTstripIter;
00890   for (gTstripIter = stripdigis.begin(); gTstripIter != stripdigis.end(); gTstripIter++){
00891     CSCDetId id = (CSCDetId)(*gTstripIter).first;
00892     if (id == idRH){
00893       vector<CSCStripDigi>::const_iterator STiter = (*gTstripIter).second.first;
00894       vector<CSCStripDigi>::const_iterator lastS = (*gTstripIter).second.second;
00895       for ( ; STiter != lastS; ++STiter ) {
00896         int thisStrip = STiter->getStrip();
00897         if (thisStrip == (centerStrip)){
00898           float diff = 0;
00899           vector<int> myADCVals = STiter->getADCCounts();
00900           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00901           for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
00902             diff = (float)myADCVals[iCount]-thisPedestal;
00903             ADC[iCount] = diff;
00904           }
00905         }
00906       }
00907     }
00908   }
00909 
00910   timing = (ADC[2]*2 + ADC[3]*3 + ADC[4]*4 + ADC[5]*5 + ADC[6]*6)/(ADC[2] + ADC[3] + ADC[4] + ADC[5] + ADC[6]);
00911 
00912   return timing;
00913 
00914 }
00915 
00916 
00917 //---------------------------------------------------------------------------------------
00918 // Given a set of digis, the CSCDetId, and the central strip of your choosing, returns
00919 // the avg. Signal-Pedestal for 6 time bin x 5 strip .
00920 //
00921 // Author: P. Jindal
00922 //---------------------------------------------------------------------------------------
00923 
00924 float CSCOfflineMonitor::getSignal(const CSCStripDigiCollection&
00925  stripdigis, CSCDetId idCS, int centerStrip){
00926 
00927   float SigADC[5];
00928   float TotalADC = 0;
00929   SigADC[0] = 0;
00930   SigADC[1] = 0;
00931   SigADC[2] = 0;
00932   SigADC[3] = 0;
00933   SigADC[4] = 0;
00934 
00935  
00936   // Loop over strip digis 
00937   CSCStripDigiCollection::DigiRangeIterator sIt;
00938   
00939   for (sIt = stripdigis.begin(); sIt != stripdigis.end(); sIt++){
00940     CSCDetId id = (CSCDetId)(*sIt).first;
00941     if (id == idCS){
00942 
00943       // First, find the Signal-Pedestal for center strip
00944       vector<CSCStripDigi>::const_iterator digiItr = (*sIt).second.first;
00945       vector<CSCStripDigi>::const_iterator last = (*sIt).second.second;
00946       for ( ; digiItr != last; ++digiItr ) {
00947         int thisStrip = digiItr->getStrip();
00948         if (thisStrip == (centerStrip)){
00949           std::vector<int> myADCVals = digiItr->getADCCounts();
00950           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00951           float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00952           SigADC[0] = thisSignal - 6*thisPedestal;
00953         }
00954      // Now,find the Signal-Pedestal for neighbouring 4 strips
00955         if (thisStrip == (centerStrip+1)){
00956           std::vector<int> myADCVals = digiItr->getADCCounts();
00957           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00958           float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00959           SigADC[1] = thisSignal - 6*thisPedestal;
00960         }
00961         if (thisStrip == (centerStrip+2)){
00962           std::vector<int> myADCVals = digiItr->getADCCounts();
00963           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00964           float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00965           SigADC[2] = thisSignal - 6*thisPedestal;
00966         }
00967         if (thisStrip == (centerStrip-1)){
00968           std::vector<int> myADCVals = digiItr->getADCCounts();
00969           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00970           float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00971           SigADC[3] = thisSignal - 6*thisPedestal;
00972         }
00973         if (thisStrip == (centerStrip-2)){
00974           std::vector<int> myADCVals = digiItr->getADCCounts();
00975           float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
00976           float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
00977           SigADC[4] = thisSignal - 6*thisPedestal;
00978         }
00979       }
00980       TotalADC = 0.2*(SigADC[0]+SigADC[1]+SigADC[2]+SigADC[3]+SigADC[4]);
00981     }
00982   }
00983   return TotalADC;
00984 }
00985 
00986 int CSCOfflineMonitor::typeIndex(CSCDetId id){
00987 
00988   // linearlized index bases on endcap, station, and ring
00989   int index = 0;
00990   if (id.station() == 1) index = id.ring();
00991   else index = id.station()*2 + id.ring();
00992   if (id.endcap() == 1) index = index + 9;
00993   if (id.endcap() == 2) index = 10 - index;
00994   return index;
00995 
00996 }
00997 
00998 
00999 DEFINE_FWK_MODULE(CSCOfflineMonitor);
01000 

Generated on Tue Jun 9 17:33:49 2009 for CMSSW by  doxygen 1.5.4