CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CSCOfflineMonitor Class Reference

#include <CSCOfflineMonitor.h>

Inheritance diagram for CSCOfflineMonitor:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 Perform the real analysis.
void beginJob (void)
 CSCOfflineMonitor (const edm::ParameterSet &pset)
 Constructor.
virtual void endJob ()
virtual void endRun (edm::Run const &, edm::EventSetup const &)
void finalize ()
virtual ~CSCOfflineMonitor ()
 Destructor.

Private Member Functions

int chamberSerial (CSCDetId id)
void doBXMonitor (edm::Handle< CSCALCTDigiCollection > alcts, edm::Handle< CSCCLCTDigiCollection > clcts, const edm::Event &event, const edm::EventSetup &eventSetup)
void doEfficiencies (edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
void doOccupancies (edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::Handle< CSCCLCTDigiCollection > clcts)
void doPedestalNoise (edm::Handle< CSCStripDigiCollection > strips)
void doRecHits (edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCStripDigiCollection > strips, edm::ESHandle< CSCGeometry > cscGeom)
void doResolution (edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
void doSegments (edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
void doStripDigis (edm::Handle< CSCStripDigiCollection > strips)
void doWireDigis (edm::Handle< CSCWireDigiCollection > wires)
double extrapolate1D (double initPosition, double initDirection, double parameterOfTheLine)
void fillEfficiencyHistos (int bin, int flag)
float fitX (CLHEP::HepMatrix sp, CLHEP::HepMatrix ep)
void getEfficiency (float bin, float Norm, std::vector< float > &eff)
float getSignal (const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip)
void harvestChamberMeans (MonitorElement *meMean1D, MonitorElement *meMean2D, TH2F *hNum, MonitorElement *meDenom)
void histoEfficiency (TH1F *readHisto, MonitorElement *writeHisto)
double lineParametrization (double z1Position, double z2Position, double z1Direction)
void normalize (MonitorElement *me)
int typeIndex (CSCDetId id, int flag=1)
bool withinSensitiveRegion (LocalPoint localPos, const std::vector< float > layerBounds, int station, int ring, float shiftFromEdge, float shiftFromDeadZone)

Private Attributes

edm::InputTag alctDigiTag_
edm::InputTag clctDigiTag_
edm::InputTag cscRecHitTag_
edm::InputTag cscSegTag_
DQMStoredbe
edm::InputTag FEDRawDataCollectionTag_
bool finalizedHistograms_
MonitorElementhALCTgetBX
MonitorElementhALCTgetBX2Denominator
MonitorElementhALCTgetBX2DMeans
TH2F * hALCTgetBX2DNumerator
MonitorElementhALCTgetBXChamberMeans
MonitorElementhALCTgetBXSerial
MonitorElementhALCTMatch
MonitorElementhALCTMatch2Denominator
MonitorElementhALCTMatch2DMeans
TH2F * hALCTMatch2DNumerator
MonitorElementhALCTMatchChamberMeans
MonitorElementhALCTMatchSerial
MonitorElementhCLCTL1A
MonitorElementhCLCTL1A2Denominator
MonitorElementhCLCTL1A2DMeans
TH2F * hCLCTL1A2DNumerator
MonitorElementhCLCTL1AChamberMeans
MonitorElementhCLCTL1ASerial
MonitorElementhCSCOccupancy
TH2F * hEffDenominator
MonitorElementhORecHits
MonitorElementhORecHitsSerial
MonitorElementhOSegments
MonitorElementhOSegmentsSerial
MonitorElementhOStrips
MonitorElementhOStripsAndWiresAndCLCT
MonitorElementhOStripSerial
MonitorElementhOWires
MonitorElementhOWiresAndCLCT
MonitorElementhOWireSerial
MonitorElementhRHEff
MonitorElementhRHEff2
std::vector< MonitorElement * > hRHGlobal
MonitorElementhRHnrechits
std::vector< MonitorElement * > hRHRatioQ
TH1F * hRHSTE
TH2F * hRHSTE2
std::vector< MonitorElement * > hRHsterr
std::vector< MonitorElement * > hRHstpos
std::vector< MonitorElement * > hRHSumQ
std::vector< MonitorElement * > hRHTiming
std::vector< MonitorElement * > hRHTimingAnode
std::vector< MonitorElement * > hSChiSq
MonitorElementhSChiSqAll
std::vector< MonitorElement * > hSChiSqProb
MonitorElementhSChiSqProbAll
MonitorElementhSEff
MonitorElementhSEff2
MonitorElementhSensitiveAreaEvt
MonitorElementhSGlobalPhi
MonitorElementhSGlobalTheta
std::vector< MonitorElement * > hSnhits
MonitorElementhSnhitsAll
MonitorElementhSnSegments
std::vector< MonitorElement * > hSResid
TH1F * hSSTE
TH2F * hSSTE2
MonitorElementhSTimeCathode
MonitorElementhSTimeCombined
MonitorElementhSTimeVsTOF
MonitorElementhSTimeVsZ
MonitorElementhStripEff2
MonitorElementhStripNFired
std::vector< MonitorElement * > hStripNumber
std::vector< MonitorElement * > hStripPed
MonitorElementhStripReadoutEff2
TH2F * hStripSTE2
MonitorElementhWireEff2
MonitorElementhWirenGroupsTotal
std::vector< MonitorElement * > hWireNumber
TH2F * hWireSTE2
std::vector< MonitorElement * > hWireTBin
edm::ParameterSet param
edm::InputTag stripDigiTag_
edm::InputTag wireDigiTag_

Detailed Description

Simple package for offline CSC DQM based on RecoLocalMuon/CSCValidation: DIGIS recHits segments

Andrew Kubik, Northwestern University, Oct 2008

Definition at line 74 of file CSCOfflineMonitor.h.


Constructor & Destructor Documentation

CSCOfflineMonitor::CSCOfflineMonitor ( const edm::ParameterSet pset)

Constructor.

Definition at line 17 of file CSCOfflineMonitor.cc.

References edm::ParameterSet::getParameter(), and MultipleCompare::pset.

                                                            {

  param = pset;

  stripDigiTag_  = pset.getParameter<edm::InputTag>("stripDigiTag");
  wireDigiTag_   = pset.getParameter<edm::InputTag>("wireDigiTag"); 
  alctDigiTag_   = pset.getParameter<edm::InputTag>("alctDigiTag");
  clctDigiTag_   = pset.getParameter<edm::InputTag>("clctDigiTag"); 
  cscRecHitTag_  = pset.getParameter<edm::InputTag>("cscRecHitTag");
  cscSegTag_     = pset.getParameter<edm::InputTag>("cscSegTag");
  FEDRawDataCollectionTag_  = pset.getParameter<edm::InputTag>("FEDRawDataCollectionTag");

  finalizedHistograms_=false;

}
CSCOfflineMonitor::~CSCOfflineMonitor ( ) [virtual]

Destructor.

Definition at line 770 of file CSCOfflineMonitor.cc.

                                     {

}

Member Function Documentation

void CSCOfflineMonitor::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

Perform the real analysis.

Implements edm::EDAnalyzer.

Definition at line 891 of file CSCOfflineMonitor.cc.

References cscSegments_cfi::cscSegments, edm::EventSetup::get(), and RecoTauPiZeroBuilderPlugins_cfi::strips.

                                                                                {

  edm::Handle<CSCWireDigiCollection> wires;
  edm::Handle<CSCStripDigiCollection> strips;
  edm::Handle<CSCALCTDigiCollection> alcts;
  edm::Handle<CSCCLCTDigiCollection> clcts;
  event.getByLabel(stripDigiTag_, strips);
  event.getByLabel(wireDigiTag_, wires);
  event.getByLabel(alctDigiTag_, alcts);
  event.getByLabel(clctDigiTag_, clcts);

  // Get the CSC Geometry :
  ESHandle<CSCGeometry> cscGeom;
  eventSetup.get<MuonGeometryRecord>().get(cscGeom);

  // Get the RecHits collection :
  Handle<CSCRecHit2DCollection> recHits;
  event.getByLabel(cscRecHitTag_,recHits);

  // get CSC segment collection
  Handle<CSCSegmentCollection> cscSegments;
  event.getByLabel(cscSegTag_, cscSegments);


  doOccupancies(strips,wires,recHits,cscSegments,clcts);
  doStripDigis(strips);
  doWireDigis(wires);
  doRecHits(recHits,strips,cscGeom);
  doSegments(cscSegments,cscGeom);
  doResolution(cscSegments,cscGeom);
  doPedestalNoise(strips);
  doEfficiencies(wires,strips, recHits, cscSegments,cscGeom);
  doBXMonitor(alcts, clcts, event, eventSetup);
}
void CSCOfflineMonitor::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 33 of file CSCOfflineMonitor.cc.

References cmsCodeRules::cppFunctionSkipper::operator.

                                    {
      dbe = Service<DQMStore>().operator->();
  
      // Occupancies
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Occupancy");
      hCSCOccupancy = dbe->book1D("hCSCOccupancy","overall CSC occupancy",13,-0.5,12.5);
      hCSCOccupancy->setBinLabel(2,"Total Events");
      hCSCOccupancy->setBinLabel(4,"# Events with Wires");
      hCSCOccupancy->setBinLabel(6,"# Events with Strips");
      hCSCOccupancy->setBinLabel(8,"# Events with Wires&Strips");
      hCSCOccupancy->setBinLabel(10,"# Events with Rechits");
      hCSCOccupancy->setBinLabel(12,"# Events with Segments");
      hOWiresAndCLCT = dbe->book2D("hOWiresAndCLCT","Wire and CLCT Digi Occupancy ",36,0.5,36.5,20,0.5,20.5);
      hOWiresAndCLCT->setAxisTitle("Chamber #");
      hOWiresAndCLCT->setBinLabel(1,"ME -4/2",2);
      hOWiresAndCLCT->setBinLabel(2,"ME -4/1",2);
      hOWiresAndCLCT->setBinLabel(3,"ME -3/2",2);
      hOWiresAndCLCT->setBinLabel(4,"ME -2/1",2);
      hOWiresAndCLCT->setBinLabel(5,"ME -2/2",2);
      hOWiresAndCLCT->setBinLabel(6,"ME -2/1",2);
      hOWiresAndCLCT->setBinLabel(7,"ME -1/3",2);
      hOWiresAndCLCT->setBinLabel(8,"ME -1/2",2);
      hOWiresAndCLCT->setBinLabel(9,"ME -1/1b",2);
      hOWiresAndCLCT->setBinLabel(10,"ME -1/1a",2);
      hOWiresAndCLCT->setBinLabel(11,"ME +1/1a",2);
      hOWiresAndCLCT->setBinLabel(12,"ME +1/1b",2);
      hOWiresAndCLCT->setBinLabel(13,"ME +1/2",2);
      hOWiresAndCLCT->setBinLabel(14,"ME +1/3",2);
      hOWiresAndCLCT->setBinLabel(15,"ME +2/1",2);
      hOWiresAndCLCT->setBinLabel(16,"ME +2/2",2);
      hOWiresAndCLCT->setBinLabel(17,"ME +3/1",2);
      hOWiresAndCLCT->setBinLabel(18,"ME +3/2",2);
      hOWiresAndCLCT->setBinLabel(19,"ME +4/1",2);
      hOWiresAndCLCT->setBinLabel(20,"ME +4/2",2);
      hOWires = dbe->book2D("hOWires","Wire Digi Occupancy",36,0.5,36.5,20,0.5,20.5);
      hOWires->setAxisTitle("Chamber #");
      hOWires->setBinLabel(1,"ME -4/2",2);
      hOWires->setBinLabel(2,"ME -4/1",2);
      hOWires->setBinLabel(3,"ME -3/2",2);
      hOWires->setBinLabel(4,"ME -2/1",2);
      hOWires->setBinLabel(5,"ME -2/2",2);
      hOWires->setBinLabel(6,"ME -2/1",2);
      hOWires->setBinLabel(7,"ME -1/3",2);
      hOWires->setBinLabel(8,"ME -1/2",2);
      hOWires->setBinLabel(9,"ME -1/1b",2);
      hOWires->setBinLabel(10,"ME -1/1a",2);
      hOWires->setBinLabel(11,"ME +1/1a",2);
      hOWires->setBinLabel(12,"ME +1/1b",2);
      hOWires->setBinLabel(13,"ME +1/2",2);
      hOWires->setBinLabel(14,"ME +1/3",2);
      hOWires->setBinLabel(15,"ME +2/1",2);
      hOWires->setBinLabel(16,"ME +2/2",2);
      hOWires->setBinLabel(17,"ME +3/1",2);
      hOWires->setBinLabel(18,"ME +3/2",2);
      hOWires->setBinLabel(19,"ME +4/1",2);
      hOWires->setBinLabel(20,"ME +4/2",2);
      hOWireSerial = dbe->book1D("hOWireSerial","Wire Occupancy by Chamber Serial",601,-0.5,600.5);
      hOWireSerial->setAxisTitle("Chamber Serial Number");
      hOStrips = dbe->book2D("hOStrips","Strip Digi Occupancy",36,0.5,36.5,20,0.5,20.5);
      hOStrips->setAxisTitle("Chamber #");
      hOStrips->setBinLabel(1,"ME -4/2",2);
      hOStrips->setBinLabel(2,"ME -4/1",2);
      hOStrips->setBinLabel(3,"ME -3/2",2);
      hOStrips->setBinLabel(4,"ME -2/1",2);
      hOStrips->setBinLabel(5,"ME -2/2",2);
      hOStrips->setBinLabel(6,"ME -2/1",2);
      hOStrips->setBinLabel(7,"ME -1/3",2);
      hOStrips->setBinLabel(8,"ME -1/2",2);
      hOStrips->setBinLabel(9,"ME -1/1b",2);
      hOStrips->setBinLabel(10,"ME -1/1a",2);
      hOStrips->setBinLabel(11,"ME +1/1a",2);
      hOStrips->setBinLabel(12,"ME +1/1b",2);
      hOStrips->setBinLabel(13,"ME +1/2",2);
      hOStrips->setBinLabel(14,"ME +1/3",2);
      hOStrips->setBinLabel(15,"ME +2/1",2);
      hOStrips->setBinLabel(16,"ME +2/2",2);
      hOStrips->setBinLabel(17,"ME +3/1",2);
      hOStrips->setBinLabel(18,"ME +3/2",2);
      hOStrips->setBinLabel(19,"ME +4/1",2);
      hOStrips->setBinLabel(20,"ME +4/2",2);
      hOStripSerial = dbe->book1D("hOStripSerial","Strip Occupancy by Chamber Serial",601,-0.5,600.5);
      hOStripSerial->setAxisTitle("Chamber Serial Number");
      hOStripsAndWiresAndCLCT = dbe->book2D("hOStripsAndWiresAndCLCT","Strip And Wire And CLCT Digi Occupancy",36,0.5,36.5,20,0.5,20.5);
      hOStripsAndWiresAndCLCT->setAxisTitle("Chamber #");
      hOStripsAndWiresAndCLCT->setBinLabel(1,"ME -4/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(2,"ME -4/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(3,"ME -3/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(4,"ME -2/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(5,"ME -2/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(6,"ME -2/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(7,"ME -1/3",2);
      hOStripsAndWiresAndCLCT->setBinLabel(8,"ME -1/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(9,"ME -1/1b",2);
      hOStripsAndWiresAndCLCT->setBinLabel(10,"ME -1/1a",2);
      hOStripsAndWiresAndCLCT->setBinLabel(11,"ME +1/1a",2);
      hOStripsAndWiresAndCLCT->setBinLabel(12,"ME +1/1b",2);
      hOStripsAndWiresAndCLCT->setBinLabel(13,"ME +1/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(14,"ME +1/3",2);
      hOStripsAndWiresAndCLCT->setBinLabel(15,"ME +2/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(16,"ME +2/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(17,"ME +3/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(18,"ME +3/2",2);
      hOStripsAndWiresAndCLCT->setBinLabel(19,"ME +4/1",2);
      hOStripsAndWiresAndCLCT->setBinLabel(20,"ME +4/2",2);
      hORecHits = dbe->book2D("hORecHits","RecHit Occupancy",36,0.5,36.5,20,0.5,20.5);
      hORecHits->setAxisTitle("Chamber #");
      hORecHits->setBinLabel(1,"ME -4/2",2);
      hORecHits->setBinLabel(2,"ME -4/1",2);
      hORecHits->setBinLabel(3,"ME -3/2",2);
      hORecHits->setBinLabel(4,"ME -2/1",2);
      hORecHits->setBinLabel(5,"ME -2/2",2);
      hORecHits->setBinLabel(6,"ME -2/1",2);
      hORecHits->setBinLabel(7,"ME -1/3",2);
      hORecHits->setBinLabel(8,"ME -1/2",2);
      hORecHits->setBinLabel(9,"ME -1/1b",2);
      hORecHits->setBinLabel(10,"ME -1/1a",2);
      hORecHits->setBinLabel(11,"ME +1/1a",2);
      hORecHits->setBinLabel(12,"ME +1/1b",2);
      hORecHits->setBinLabel(13,"ME +1/2",2);
      hORecHits->setBinLabel(14,"ME +1/3",2);
      hORecHits->setBinLabel(15,"ME +2/1",2);
      hORecHits->setBinLabel(16,"ME +2/2",2);
      hORecHits->setBinLabel(17,"ME +3/1",2);
      hORecHits->setBinLabel(18,"ME +3/2",2);
      hORecHits->setBinLabel(19,"ME +4/1",2);
      hORecHits->setBinLabel(20,"ME +4/2",2);
      hORecHitsSerial = dbe->book1D("hORecHitSerial","RecHit Occupancy by Chamber Serial",601,-0.5,600.5);
      hORecHitsSerial->setAxisTitle("Chamber Serial Number");
      hOSegments = dbe->book2D("hOSegments","Segment Occupancy",36,0.5,36.5,20,0.5,20.5);
      hOSegments->setAxisTitle("Chamber #");
      hOSegments->setBinLabel(1,"ME -4/2",2);
      hOSegments->setBinLabel(2,"ME -4/1",2);
      hOSegments->setBinLabel(3,"ME -3/2",2);
      hOSegments->setBinLabel(4,"ME -2/1",2);
      hOSegments->setBinLabel(5,"ME -2/2",2);
      hOSegments->setBinLabel(6,"ME -2/1",2);
      hOSegments->setBinLabel(7,"ME -1/3",2);
      hOSegments->setBinLabel(8,"ME -1/2",2);
      hOSegments->setBinLabel(9,"ME -1/1b",2);
      hOSegments->setBinLabel(10,"ME -1/1a",2);
      hOSegments->setBinLabel(11,"ME +1/1a",2);
      hOSegments->setBinLabel(12,"ME +1/1b",2);
      hOSegments->setBinLabel(13,"ME +1/2",2);
      hOSegments->setBinLabel(14,"ME +1/3",2);
      hOSegments->setBinLabel(15,"ME +2/1",2);
      hOSegments->setBinLabel(16,"ME +2/2",2);
      hOSegments->setBinLabel(17,"ME +3/1",2);
      hOSegments->setBinLabel(18,"ME +3/2",2);
      hOSegments->setBinLabel(19,"ME +4/1",2);
      hOSegments->setBinLabel(20,"ME +4/2",2);
      hOSegmentsSerial = dbe->book1D("hOSegmentSerial","Segment Occupancy by Chamber Serial",601,-0.5,600.5);
      hOSegmentsSerial->setAxisTitle("Chamber Serial Number");

      // wire digis
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Digis");
      hWirenGroupsTotal = dbe->book1D("hWirenGroupsTotal","Fired Wires per Event; # Wiregroups Fired",61,-0.5,60.5);
      hWireTBin.push_back(dbe->book1D("hWireTBin_m42","Wire TBin Fired (ME -4/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m41","Wire TBin Fired (ME -4/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m32","Wire TBin Fired (ME -3/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m31","Wire TBin Fired (ME -3/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m22","Wire TBin Fired (ME -2/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m21","Wire TBin Fired (ME -2/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m11a","Wire TBin Fired (ME -1/1a); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m13","Wire TBin Fired (ME -1/3); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m12","Wire TBin Fired (ME -1/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_m11b","Wire TBin Fired (ME -1/1b); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p11b","Wire TBin Fired (ME +1/1b); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p12","Wire TBin Fired (ME +1/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p13","Wire TBin Fired (ME +1/3); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p11a","Wire TBin Fired (ME +1/1a); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p21","Wire TBin Fired (ME +2/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p22","Wire TBin Fired (ME +2/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p31","Wire TBin Fired (ME +3/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p32","Wire TBin Fired (ME +3/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p41","Wire TBin Fired (ME +4/1); Time Bin (25ns)",17,-0.5,16.5));
      hWireTBin.push_back(dbe->book1D("hWireTBin_p42","Wire TBin Fired (ME +4/2); Time Bin (25ns)",17,-0.5,16.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m42","Wiregroup Number Fired (ME -4/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m41","Wiregroup Number Fired (ME -4/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m32","Wiregroup Number Fired (ME -3/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m31","Wiregroup Number Fired (ME -3/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m22","Wiregroup Number Fired (ME -2/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m21","Wiregroup Number Fired (ME -2/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m11a","Wiregroup Number Fired (ME -1/1a); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m13","Wiregroup Number Fired (ME -1/3); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m12","Wiregroup Number Fired (ME -1/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_m11b","Wiregroup Number Fired (ME -1/1b); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p11b","Wiregroup Number Fired (ME +1/1b); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p12","Wiregroup Number Fired (ME +1/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p13","Wiregroup Number Fired (ME +1/3); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p11a","Wiregroup Number Fired (ME +1/1a); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p21","Wiregroup Number Fired (ME +2/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p22","Wiregroup Number Fired (ME +2/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p31","Wiregroup Number Fired (ME +3/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p32","Wiregroup Number Fired (ME +3/2); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p41","Wiregroup Number Fired (ME +4/1); Wiregroup #",113,-0.5,112.5));
      hWireNumber.push_back(dbe->book1D("hWireNumber_p42","Wiregroup Number Fired (ME +4/2); Wiregroup #",113,-0.5,112.5));

      // strip digis
      hStripNFired = dbe->book1D("hStripNFired","Fired Strips per Event; # Strips Fired (above 13 ADC)",101,-0.5,100.5);
      hStripNumber.push_back(dbe->book1D("hStripNumber_m42","Strip Number Fired (ME -4/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m41","Strip Number Fired (ME -4/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m32","Strip Number Fired (ME -3/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m31","Strip Number Fired (ME -3/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m22","Strip Number Fired (ME -2/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m21","Strip Number Fired (ME -2/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m11a","Strip Number Fired (ME -1/1a); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m13","Strip Number Fired (ME -1/3); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m12","Strip Number Fired (ME -1/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_m11b","Strip Number Fired (ME -1/1b); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p11b","Strip Number Fired (ME +1/1b); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p12","Strip Number Fired (ME +1/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p13","Strip Number Fired (ME +1/3); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p11a","Strip Number Fired (ME +1/1a); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p21","Strip Number Fired (ME +2/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p22","Strip Number Fired (ME +2/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p31","Strip Number Fired (ME +3/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p32","Strip Number Fired (ME +3/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p41","Strip Number Fired (ME +4/1); Strip # Fired (above 13 ADC)",81,-0.5,80.5));
      hStripNumber.push_back(dbe->book1D("hStripNumber_p42","Stripgroup Number Fired (ME +4/2); Strip # Fired (above 13 ADC)",81,-0.5,80.5));

      //Pedestal Noise Plots
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/PedestalNoise");
      hStripPed.push_back(dbe->book1D("hStripPedMEm42","Pedestal Noise Distribution Chamber ME -4/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm41","Pedestal Noise Distribution Chamber ME -4/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm32","Pedestal Noise Distribution Chamber ME -3/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm31","Pedestal Noise Distribution Chamber ME -3/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm22","Pedestal Noise Distribution Chamber ME -2/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm21","Pedestal Noise Distribution Chamber ME -2/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm11a","Pedestal Noise Distribution Chamber ME -1/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm13","Pedestal Noise Distribution Chamber ME -1/3; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm12","Pedestal Noise Distribution Chamber ME -1/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEm11b","Pedestal Noise Distribution Chamber ME -1/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp11b","Pedestal Noise Distribution Chamber ME +1/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp12","Pedestal Noise Distribution Chamber ME +1/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp13","Pedestal Noise Distribution Chamber ME +1/3; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp11a","Pedestal Noise Distribution Chamber ME +1/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp21","Pedestal Noise Distribution Chamber ME +2/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp22","Pedestal Noise Distribution Chamber ME +2/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp31","Pedestal Noise Distribution Chamber ME +3/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp32","Pedestal Noise Distribution Chamber ME +3/2; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp41","Pedestal Noise Distribution Chamber ME +4/1; ADC Counts",50,-25.,25.));
      hStripPed.push_back(dbe->book1D("hStripPedMEp42","Pedestal Noise Distribution Chamber ME +4/2; ADC Counts",50,-25.,25.));

      // recHits
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/recHits");
      hRHnrechits = dbe->book1D("hRHnrechits","recHits per Event (all chambers); # of RecHits",50,0,50);
      hRHGlobal.push_back(dbe->book2D("hRHGlobalp1","recHit global X,Y station +1; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalp2","recHit global X,Y station +2; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalp3","recHit global X,Y station +3; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalp4","recHit global X,Y station +4; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalm1","recHit global X,Y station -1; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalm2","recHit global X,Y station -2; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalm3","recHit global X,Y station -3; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHGlobal.push_back(dbe->book2D("hRHGlobalm4","recHit global X,Y station -4; Global X (cm); Global Y (cm)",100,-800.,800.,100,-800.,800.));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm42","Sum 3x3 recHit Charge (ME -4/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm41","Sum 3x3 recHit Charge (ME -4/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm32","Sum 3x3 recHit Charge (ME -3/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm31","Sum 3x3 recHit Charge (ME -3/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm22","Sum 3x3 recHit Charge (ME -2/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm21","Sum 3x3 recHit Charge (ME -2/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm11a","Sum 3x3 recHit Charge (ME -1/1a); ADC counts",100,0,4000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm13","Sum 3x3 recHit Charge (ME -1/3); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm12","Sum 3x3 recHit Charge (ME -1/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQm11b","Sum 3x3 recHit Charge (ME -1/1b); ADC counts",100,0,4000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp11b","Sum 3x3 recHit Charge (ME +1/1b); ADC counts",100,0,4000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp12","Sum 3x3 recHit Charge (ME +1/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp13","Sum 3x3 recHit Charge (ME +1/3); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp11a","Sum 3x3 recHit Charge (ME +1/1a); ADC counts",100,0,4000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp21","Sum 3x3 recHit Charge (ME +2/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp22","Sum 3x3 recHit Charge (ME +2/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp31","Sum 3x3 recHit Charge (ME +3/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp32","Sum 3x3 recHit Charge (ME +3/2); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp41","Sum 3x3 recHit Charge (ME +4/1); ADC counts",100,0,2000));
      hRHSumQ.push_back(dbe->book1D("hRHSumQp42","Sum 3x3 recHit Charge (ME +4/2); ADC counts",100,0,2000));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm42","Charge Ratio (Ql+Qr)/Qt (ME -4/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm41","Charge Ratio (Ql+Qr)/Qt (ME -4/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm32","Charge Ratio (Ql+Qr)/Qt (ME -3/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm31","Charge Ratio (Ql+Qr)/Qt (ME -3/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm22","Charge Ratio (Ql+Qr)/Qt (ME -2/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm21","Charge Ratio (Ql+Qr)/Qt (ME -2/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm11a","Charge Ratio (Ql+Qr)/Qt (ME -1/1a); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm13","Charge Ratio (Ql+Qr)/Qt (ME -1/3); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm12","Charge Ratio (Ql+Qr)/Qt (ME -1/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQm11b","Charge Ratio (Ql+Qr)/Qt (ME -1/1b); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp11b","Charge Ratio (Ql+Qr)/Qt (ME +1/1b); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp12","Charge Ratio (Ql+Qr)/Qt (ME +1/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp13","Charge Ratio (Ql+Qr)/Qt (ME +1/3); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp11a","Charge Ratio (Ql+Qr)/Qt (ME +1/1a); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp21","Charge Ratio (Ql+Qr)/Qt (ME +2/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp22","Charge Ratio (Ql+Qr)/Qt (ME +2/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp31","Charge Ratio (Ql+Qr)/Qt (ME +3/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp32","Charge Ratio (Ql+Qr)/Qt (ME +3/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp41","Charge Ratio (Ql+Qr)/Qt (ME +4/1); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHRatioQ.push_back(dbe->book1D("hRHRatioQp42","Charge Ratio (Ql+Qr)/Qt (ME +4/2); (Ql+Qr)/Qt",100,-0.1,1.1));
      hRHTiming.push_back(dbe->book1D("hRHTimingm42","recHit Time (ME -4/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm41","recHit Time (ME -4/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm32","recHit Time (ME -3/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm31","recHit Time (ME -3/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm22","recHit Time (ME -2/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm21","recHit Time (ME -2/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm11a","recHit Time (ME -1/1a); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm13","recHit Time (ME -1/3); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm12","recHit Time (ME -1/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingm11b","recHit Time (ME -1/1b); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp11b","recHit Time (ME +1/1b); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp12","recHit Time (ME +1/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp13","recHit Time (ME +1/3); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp11a","recHit Time (ME +1/1a); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp21","recHit Time (ME +2/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp22","recHit Time (ME +2/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp31","recHit Time (ME +3/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp32","recHit Time (ME +3/2); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp41","recHit Time (ME +4/1); ns",200,-500.,500.));
      hRHTiming.push_back(dbe->book1D("hRHTimingp42","recHit Time (ME +4/2); ns",200,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem42","Anode recHit Time (ME -4/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem41","Anode recHit Time (ME -4/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem32","Anode recHit Time (ME -3/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem31","Anode recHit Time (ME -3/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem22","Anode recHit Time (ME -2/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem21","Anode recHit Time (ME -2/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem11a","Anode recHit Time (ME -1/1a); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem13","Anode recHit Time (ME -1/3); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem12","Anode recHit Time (ME -1/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodem11b","Anode recHit Time (ME -1/1b); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep11b","Anode recHit Time (ME +1/1b); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep12","Anode recHit Time (ME +1/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep13","Anode recHit Time (ME +1/3); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep11a","Anode recHit Time (ME +1/1a); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep21","Anode recHit Time (ME +2/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep22","Anode recHit Time (ME +2/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep31","Anode recHit Time (ME +3/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep32","Anode recHit Time (ME +3/2); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep41","Anode recHit Time (ME +4/1); ns",80,-500.,500.));
      hRHTimingAnode.push_back(dbe->book1D("hRHTimingAnodep42","Anode recHit Time (ME +4/2); ns",80,-500.,500.));
      hRHstpos.push_back(dbe->book1D("hRHstposm42","Reconstructed Position on Strip (ME -4/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm41","Reconstructed Position on Strip (ME -4/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm32","Reconstructed Position on Strip (ME -3/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm31","Reconstructed Position on Strip (ME -3/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm22","Reconstructed Position on Strip (ME -2/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm21","Reconstructed Position on Strip (ME -2/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm11a","Reconstructed Position on Strip (ME -1/1a); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm13","Reconstructed Position on Strip (ME -1/3); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm12","Reconstructed Position on Strip (ME -1/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposm11b","Reconstructed Position on Strip (ME -1/1b); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp11b","Reconstructed Position on Strip (ME +1/1b); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp12","Reconstructed Position on Strip (ME +1/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp13","Reconstructed Position on Strip (ME +1/3); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp11a","Reconstructed Position on Strip (ME +1/1a); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp21","Reconstructed Position on Strip (ME +2/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp22","Reconstructed Position on Strip (ME +2/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp31","Reconstructed Position on Strip (ME +3/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp32","Reconstructed Position on Strip (ME +3/2); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp41","Reconstructed Position on Strip (ME +4/1); Strip Widths",120,-0.6,0.6));
      hRHstpos.push_back(dbe->book1D("hRHstposp42","Reconstructed Position on Strip (ME +4/2); Strip Widths",120,-0.6,0.6));
      hRHsterr.push_back(dbe->book1D("hRHsterrm42","Estimated Error on Strip Measurement (ME -4/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm41","Estimated Error on Strip Measurement (ME -4/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm32","Estimated Error on Strip Measurement (ME -3/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm31","Estimated Error on Strip Measurement (ME -3/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm22","Estimated Error on Strip Measurement (ME -2/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm21","Estimated Error on Strip Measurement (ME -2/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm11a","Estimated Error on Strip Measurement (ME -1/1a); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm13","Estimated Error on Strip Measurement (ME -1/3); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm12","Estimated Error on Strip Measurement (ME -1/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrm11b","Estimated Error on Strip Measurement (ME -1/1b); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp11b","Estimated Error on Strip Measurement (ME +1/1b); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp12","Estimated Error on Strip Measurement (ME +1/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp13","Estimated Error on Strip Measurement (ME +1/3); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp11a","Estimated Error on Strip Measurement (ME +1/1a); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp21","Estimated Error on Strip Measurement (ME +2/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp22","Estimated Error on Strip Measurement (ME +2/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp31","Estimated Error on Strip Measurement (ME +3/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp32","Estimated Error on Strip Measurement (ME +3/2); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp41","Estimated Error on Strip Measurement (ME +4/1); Strip Widths",75,-0.01,0.24));
      hRHsterr.push_back(dbe->book1D("hRHsterrp42","Estimated Error on Strip Measurement (ME +4/2); Strip Widths",75,-0.01,0.24));


      // segments
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Segments");
      hSnSegments   = dbe->book1D("hSnSegments","Number of Segments per Event; # of Segments",11,-0.5,10.5);
      hSnhitsAll = dbe->book1D("hSnhits","N hits on Segments; # of hits",8,-0.5,7.5);
      hSnhits.push_back(dbe->book1D("hSnhitsm42","# of hits on Segments (ME -4/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm41","# of hits on Segments (ME -4/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm32","# of hits on Segments (ME -3/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm31","# of hits on Segments (ME -3/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm22","# of hits on Segments (ME -2/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm21","# of hits on Segments (ME -2/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm11a","# of hits on Segments (ME -1/1a); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm13","# of hits on Segments (ME -1/3); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm12","# of hits on Segments (ME -1/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsm11b","# of hits on Segments (ME -1/1b); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp11b","# of hits on Segments (ME +1/1b); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp12","# of hits on Segments (ME +1/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp13","# of hits on Segments (ME +1/3); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp11a","# of hits on Segments (ME +1/1a); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp21","# of hits on Segments (ME +2/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp22","# of hits on Segments (ME +2/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp31","# of hits on Segments (ME +3/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp32","# of hits on Segments (ME +3/2); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp41","# of hits on Segments (ME +4/1); # of hits",8,-0.5,7.5));
      hSnhits.push_back(dbe->book1D("hSnhitsp42","# of hits on Segments (ME +4/2); # of hits",8,-0.5,7.5));
      hSChiSqAll = dbe->book1D("hSChiSq","Segment Normalized Chi2; Chi2/ndof",110,-0.05,10.5);
      hSChiSq.push_back(dbe->book1D("hSChiSqm42","Segment Normalized Chi2 (ME -4/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm41","Segment Normalized Chi2 (ME -4/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm32","Segment Normalized Chi2 (ME -3/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm31","Segment Normalized Chi2 (ME -3/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm22","Segment Normalized Chi2 (ME -2/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm21","Segment Normalized Chi2 (ME -2/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm11a","Segment Normalized Chi2 (ME -1/1a); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm13","Segment Normalized Chi2 (ME -1/3); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm12","Segment Normalized Chi2 (ME -1/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqm11b","Segment Normalized Chi2 (ME -1/1b); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp11b","Segment Normalized Chi2 (ME +1/1b); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp12","Segment Normalized Chi2 (ME +1/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp13","Segment Normalized Chi2 (ME +1/3); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp11a","Segment Normalized Chi2 (ME +1/1a); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp21","Segment Normalized Chi2 (ME +2/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp22","Segment Normalized Chi2 (ME +2/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp31","Segment Normalized Chi2 (ME +3/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp32","Segment Normalized Chi2 (ME +3/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp41","Segment Normalized Chi2 (ME +4/1); Chi2/ndof",110,-0.05,10.5));
      hSChiSq.push_back(dbe->book1D("hSChiSqp42","Segment Normalized Chi2 (ME +4/2); Chi2/ndof",110,-0.05,10.5));
      hSChiSqProbAll = dbe->book1D("hSChiSqProb","Segment chi2 Probability; Probability",110,-0.05,1.05);
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm42","Segment chi2 Probability (ME -4/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm41","Segment chi2 Probability (ME -4/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm32","Segment chi2 Probability (ME -3/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm31","Segment chi2 Probability (ME -3/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm22","Segment chi2 Probability (ME -2/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm21","Segment chi2 Probability (ME -2/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm11a","Segment chi2 Probability (ME -1/1a); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm13","Segment chi2 Probability (ME -1/3); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm12","Segment chi2 Probability (ME -1/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbm11b","Segment chi2 Probability (ME -1/1b); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp11b","Segment chi2 Probability (ME +1/1b); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp12","Segment chi2 Probability (ME +1/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp13","Segment chi2 Probability (ME +1/3); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp11a","Segment chi2 Probability (ME +1/1a); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp21","Segment chi2 Probability (ME +2/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp22","Segment chi2 Probability (ME +2/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp31","Segment chi2 Probability (ME +3/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp32","Segment chi2 Probability (ME +3/2); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp41","Segment chi2 Probability (ME +4/1); Probability",110,-0.05,1.05));
      hSChiSqProb.push_back(dbe->book1D("hSChiSqProbp42","Segment chi2 Probability (ME +4/2); Probability",110,-0.05,1.05));
      hSGlobalTheta = dbe->book1D("hSGlobalTheta","Segment Direction (Global Theta); Global Theta (radians)",136,-0.1,3.3);
      hSGlobalPhi   = dbe->book1D("hSGlobalPhi","Segment Direction (Global Phi); Global Phi (radians)",  128,-3.2,3.2);
      hSTimeCathode  = dbe->book1D("hSTimeCathode", "Cathode Only Segment Time  [ns]",200,-200,200);
      hSTimeCombined = dbe->book1D("hSTimeCombined", "Segment Time (anode+cathode times) [ns]",200,-200,200);
      hSTimeVsZ   = dbe->book2D("hSTimeVsZ","Segment Time vs. Z; [ns] vs. [cm]",200,-1200,1200,200,-200,200);
      hSTimeVsTOF = dbe->book2D("hSTimeVsTOF","Segment Time vs. Distance from IP; [ns] vs. [cm]",180,500,1400, 200,-200,200);
      // Resolution
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Resolution");
      hSResid.push_back(dbe->book1D("hSResidm42","Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm41","Fitted Position on Strip - Reconstructed for Layer 3 (ME -4/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm32","Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm31","Fitted Position on Strip - Reconstructed for Layer 3 (ME -3/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm22","Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm21","Fitted Position on Strip - Reconstructed for Layer 3 (ME -2/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm11a","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1a); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm13","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/3); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm12","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidm11b","Fitted Position on Strip - Reconstructed for Layer 3 (ME -1/1b); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp11b","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1b); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp12","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp13","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/3); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp11a","Fitted Position on Strip - Reconstructed for Layer 3 (ME +1/1a); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp21","Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp22","Fitted Position on Strip - Reconstructed for Layer 3 (ME +2/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp31","Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp32","Fitted Position on Strip - Reconstructed for Layer 3 (ME +3/2); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp41","Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/1); Strip Widths",100,-0.5,0.5));
      hSResid.push_back(dbe->book1D("hSResidp42","Fitted Position on Strip - Reconstructed for Layer 3 (ME +4/2); Strip Widths",100,-0.5,0.5));

      // Efficiency
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/Efficiency");
      hSSTE = new TH1F("hSSTE","hSSTE",40,0.5,40.5);
      hRHSTE = new TH1F("hRHSTE","hRHSTE",40,0.5,40.5);
      hSEff = dbe->book1D("hSEff","Segment Efficiency",20,0.5,20.5);
      hSEff->setBinLabel(1,"ME +1/1b");
      hSEff->setBinLabel(2,"ME +1/2");
      hSEff->setBinLabel(3,"ME +1/3");
      hSEff->setBinLabel(4,"ME +1/1a");
      hSEff->setBinLabel(5,"ME +2/1");
      hSEff->setBinLabel(6,"ME +2/2");
      hSEff->setBinLabel(7,"ME +3/1");
      hSEff->setBinLabel(8,"ME +3/2");
      hSEff->setBinLabel(9,"ME +4/1");
      hSEff->setBinLabel(10,"ME +4/2");
      hSEff->setBinLabel(11,"ME -1/1b");
      hSEff->setBinLabel(12,"ME -1/2");
      hSEff->setBinLabel(13,"ME -1/3");
      hSEff->setBinLabel(14,"ME -1/1a");
      hSEff->setBinLabel(15,"ME -2/1");
      hSEff->setBinLabel(16,"ME -2/2");
      hSEff->setBinLabel(17,"ME -3/1");
      hSEff->setBinLabel(18,"ME -3/2");
      hSEff->setBinLabel(19,"ME -4/1");
      hSEff->setBinLabel(20,"ME -4/2");
      hRHEff = dbe->book1D("hRHEff","recHit Efficiency",20,0.5,20.5);
      hRHEff->setBinLabel(1,"ME +1/1b");
      hRHEff->setBinLabel(2,"ME +1/2");
      hRHEff->setBinLabel(3,"ME +1/3");
      hRHEff->setBinLabel(4,"ME +1/1a");
      hRHEff->setBinLabel(5,"ME +2/1");
      hRHEff->setBinLabel(6,"ME +2/2");
      hRHEff->setBinLabel(7,"ME +3/1");
      hRHEff->setBinLabel(8,"ME +3/2");
      hRHEff->setBinLabel(9,"ME +4/1");
      hRHEff->setBinLabel(10,"ME +4/2");
      hRHEff->setBinLabel(11,"ME -1/1b");
      hRHEff->setBinLabel(12,"ME -1/2");
      hRHEff->setBinLabel(13,"ME -1/3");
      hRHEff->setBinLabel(14,"ME -1/1a");
      hRHEff->setBinLabel(15,"ME -2/1");
      hRHEff->setBinLabel(16,"ME -2/2");
      hRHEff->setBinLabel(17,"ME -3/1");
      hRHEff->setBinLabel(18,"ME -3/2");
      hRHEff->setBinLabel(19,"ME -4/1");
      hRHEff->setBinLabel(20,"ME -4/2");
      hSSTE2 = new TH2F("hSSTE2","hSSTE2",36,0.5,36.5, 18, 0.5, 18.5);
      hRHSTE2 = new TH2F("hRHSTE2","hRHSTE2",36,0.5,36.5, 18, 0.5, 18.5);
      hStripSTE2 = new TH2F("hStripSTE2","hStripSTE2",36,0.5,36.5, 18, 0.5, 18.5);
      hWireSTE2 = new TH2F("hWireSTE2","hWireSTE2",36,0.5,36.5, 18, 0.5, 18.5);
      hEffDenominator = new TH2F("hEffDenominator","hEffDenominator",36,0.5,36.5, 18, 0.5, 18.5);
      hSEff2 = dbe->book2D("hSEff2","Segment Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
      hSEff2->setAxisTitle("Chamber #");
      hSEff2->setBinLabel(1,"ME -4/1",2);
      hSEff2->setBinLabel(2,"ME -3/2",2);
      hSEff2->setBinLabel(3,"ME -2/1",2);
      hSEff2->setBinLabel(4,"ME -2/2",2);
      hSEff2->setBinLabel(5,"ME -2/1",2);
      hSEff2->setBinLabel(6,"ME -1/3",2);
      hSEff2->setBinLabel(7,"ME -1/2",2);
      hSEff2->setBinLabel(8,"ME -1/1b",2);
      hSEff2->setBinLabel(9,"ME -1/1a",2);
      hSEff2->setBinLabel(10,"ME +1/1a",2);
      hSEff2->setBinLabel(11,"ME +1/1b",2);
      hSEff2->setBinLabel(12,"ME +1/2",2);
      hSEff2->setBinLabel(13,"ME +1/3",2);
      hSEff2->setBinLabel(14,"ME +2/1",2);
      hSEff2->setBinLabel(15,"ME +2/2",2);
      hSEff2->setBinLabel(16,"ME +3/1",2);
      hSEff2->setBinLabel(17,"ME +3/2",2);
      hSEff2->setBinLabel(18,"ME +4/1",2);
      hRHEff2 = dbe->book2D("hRHEff2","recHit Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
      hRHEff2->setAxisTitle("Chamber #");
      hRHEff2->setBinLabel(1,"ME -4/1",2);
      hRHEff2->setBinLabel(2,"ME -3/2",2);
      hRHEff2->setBinLabel(3,"ME -2/1",2);
      hRHEff2->setBinLabel(4,"ME -2/2",2);
      hRHEff2->setBinLabel(5,"ME -2/1",2);
      hRHEff2->setBinLabel(6,"ME -1/3",2);
      hRHEff2->setBinLabel(7,"ME -1/2",2);
      hRHEff2->setBinLabel(8,"ME -1/1b",2);
      hRHEff2->setBinLabel(9,"ME -1/1a",2);
      hRHEff2->setBinLabel(10,"ME +1/1a",2);
      hRHEff2->setBinLabel(11,"ME +1/1b",2);
      hRHEff2->setBinLabel(12,"ME +1/2",2);
      hRHEff2->setBinLabel(13,"ME +1/3",2);
      hRHEff2->setBinLabel(14,"ME +2/1",2);
      hRHEff2->setBinLabel(15,"ME +2/2",2);
      hRHEff2->setBinLabel(16,"ME +3/1",2);
      hRHEff2->setBinLabel(17,"ME +3/2",2);
      hRHEff2->setBinLabel(18,"ME +4/1",2);
      hStripReadoutEff2 = dbe->book2D("hStripReadoutEff2","strip readout ratio [(strip+clct+wires)/(clct+wires)] 2D",36,0.5,36.5, 20, 0.5, 20.5);
      hStripReadoutEff2->setAxisTitle("Chamber #");
      hStripReadoutEff2->setBinLabel(1,"ME -4/2",2);
      hStripReadoutEff2->setBinLabel(2,"ME -4/1",2);
      hStripReadoutEff2->setBinLabel(3,"ME -3/2",2);
      hStripReadoutEff2->setBinLabel(4,"ME -2/1",2);
      hStripReadoutEff2->setBinLabel(5,"ME -2/2",2);
      hStripReadoutEff2->setBinLabel(6,"ME -2/1",2);
      hStripReadoutEff2->setBinLabel(7,"ME -1/3",2);
      hStripReadoutEff2->setBinLabel(8,"ME -1/2",2);
      hStripReadoutEff2->setBinLabel(9,"ME -1/1b",2);
      hStripReadoutEff2->setBinLabel(10,"ME -1/1a",2);
      hStripReadoutEff2->setBinLabel(11,"ME +1/1a",2);
      hStripReadoutEff2->setBinLabel(12,"ME +1/1b",2);
      hStripReadoutEff2->setBinLabel(13,"ME +1/2",2);
      hStripReadoutEff2->setBinLabel(14,"ME +1/3",2);
      hStripReadoutEff2->setBinLabel(15,"ME +2/1",2);
      hStripReadoutEff2->setBinLabel(16,"ME +2/2",2);
      hStripReadoutEff2->setBinLabel(17,"ME +3/1",2);
      hStripReadoutEff2->setBinLabel(18,"ME +3/2",2);
      hStripReadoutEff2->setBinLabel(19,"ME +4/1",2);
      hStripReadoutEff2->setBinLabel(20,"ME +4/2",2);
      hStripEff2 = dbe->book2D("hStripEff2","strip Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
      hStripEff2->setAxisTitle("Chamber #");
      hStripEff2->setBinLabel(1,"ME -4/1",2);
      hStripEff2->setBinLabel(2,"ME -3/2",2);
      hStripEff2->setBinLabel(3,"ME -2/1",2);
      hStripEff2->setBinLabel(4,"ME -2/2",2);
      hStripEff2->setBinLabel(5,"ME -2/1",2);
      hStripEff2->setBinLabel(6,"ME -1/3",2);
      hStripEff2->setBinLabel(7,"ME -1/2",2);
      hStripEff2->setBinLabel(8,"ME -1/1b",2);
      hStripEff2->setBinLabel(9,"ME -1/1a",2);
      hStripEff2->setBinLabel(10,"ME +1/1a",2);
      hStripEff2->setBinLabel(11,"ME +1/1b",2);
      hStripEff2->setBinLabel(12,"ME +1/2",2);
      hStripEff2->setBinLabel(13,"ME +1/3",2);
      hStripEff2->setBinLabel(14,"ME +2/1",2);
      hStripEff2->setBinLabel(15,"ME +2/2",2);
      hStripEff2->setBinLabel(16,"ME +3/1",2);
      hStripEff2->setBinLabel(17,"ME +3/2",2);
      hStripEff2->setBinLabel(18,"ME +4/1",2);
      hWireEff2 = dbe->book2D("hWireEff2","wire Efficiency 2D",36,0.5,36.5, 18, 0.5, 18.5);
      hWireEff2->setAxisTitle("Chamber #");
      hWireEff2->setBinLabel(1,"ME -4/1",2);
      hWireEff2->setBinLabel(2,"ME -3/2",2);
      hWireEff2->setBinLabel(3,"ME -2/1",2);
      hWireEff2->setBinLabel(4,"ME -2/2",2);
      hWireEff2->setBinLabel(5,"ME -2/1",2);
      hWireEff2->setBinLabel(6,"ME -1/3",2);
      hWireEff2->setBinLabel(7,"ME -1/2",2);
      hWireEff2->setBinLabel(8,"ME -1/1b",2);
      hWireEff2->setBinLabel(9,"ME -1/1a",2);
      hWireEff2->setBinLabel(10,"ME +1/1a",2);
      hWireEff2->setBinLabel(11,"ME +1/1b",2);
      hWireEff2->setBinLabel(12,"ME +1/2",2);
      hWireEff2->setBinLabel(13,"ME +1/3",2);
      hWireEff2->setBinLabel(14,"ME +2/1",2);
      hWireEff2->setBinLabel(15,"ME +2/2",2);
      hWireEff2->setBinLabel(16,"ME +3/1",2);
      hWireEff2->setBinLabel(17,"ME +3/2",2);
      hWireEff2->setBinLabel(18,"ME +4/1",2);
      hSensitiveAreaEvt = dbe->book2D("hSensitiveAreaEvt","Events Passing Selection for Efficiency",36,0.5,36.5, 18, 0.5, 18.5);
      hSensitiveAreaEvt->setAxisTitle("Chamber #");
      hSensitiveAreaEvt->setBinLabel(1,"ME -4/1",2);
      hSensitiveAreaEvt->setBinLabel(2,"ME -3/2",2);
      hSensitiveAreaEvt->setBinLabel(3,"ME -2/1",2);
      hSensitiveAreaEvt->setBinLabel(4,"ME -2/2",2);
      hSensitiveAreaEvt->setBinLabel(5,"ME -2/1",2);
      hSensitiveAreaEvt->setBinLabel(6,"ME -1/3",2);
      hSensitiveAreaEvt->setBinLabel(7,"ME -1/2",2);
      hSensitiveAreaEvt->setBinLabel(8,"ME -1/1b",2);
      hSensitiveAreaEvt->setBinLabel(9,"ME -1/1a",2);
      hSensitiveAreaEvt->setBinLabel(10,"ME +1/1a",2);
      hSensitiveAreaEvt->setBinLabel(11,"ME +1/1b",2);
      hSensitiveAreaEvt->setBinLabel(12,"ME +1/2",2);
      hSensitiveAreaEvt->setBinLabel(13,"ME +1/3",2);
      hSensitiveAreaEvt->setBinLabel(14,"ME +2/1",2);
      hSensitiveAreaEvt->setBinLabel(15,"ME +2/2",2);
      hSensitiveAreaEvt->setBinLabel(16,"ME +3/1",2);
      hSensitiveAreaEvt->setBinLabel(17,"ME +3/2",2);
      hSensitiveAreaEvt->setBinLabel(18,"ME +4/1",2);

      // BX Monitor for trigger synchronization
      dbe->setCurrentFolder("CSC/CSCOfflineMonitor/BXMonitor");
      hALCTgetBX = dbe->book1D("hALCTgetBX","ALCT position in ALCT-L1A match window [BX]",7,-0.5,6.5);
      hALCTgetBXChamberMeans = dbe->book1D("hALCTgetBXChamberMeans","Chamber Mean ALCT position in ALCT-L1A match window [BX]",60,0,6);
      hALCTgetBXSerial = dbe->book2D("hALCTgetBXSerial","ALCT position in ALCT-L1A match window [BX]",601,-0.5,600.5,7,-0.5,6.5);
      hALCTgetBXSerial->setAxisTitle("Chamber Serial Number");
      hALCTgetBX2DNumerator = new TH2F("hALCTgetBX2DNumerator","ALCT position in ALCT-L1A match window [BX] (sum)",36,0.5,36.5,20,0.5,20.5);
      hALCTgetBX2DMeans = dbe->book2D("hALCTgetBX2DMeans","ALCT position in ALCT-L1A match window [BX]",36,0.5,36.5,20,0.5,20.5);
      hALCTgetBX2Denominator = dbe->book2D("hALCTgetBX2Denominator","Number of ALCT Digis checked",36,0.5,36.5,20,0.5,20.5);
      hALCTgetBX2DMeans->setAxisTitle("Chamber #");
      hALCTgetBX2DMeans->setBinLabel(1,"ME -4/2",2);
      hALCTgetBX2DMeans->setBinLabel(2,"ME -4/1",2);
      hALCTgetBX2DMeans->setBinLabel(3,"ME -3/2",2);
      hALCTgetBX2DMeans->setBinLabel(4,"ME -2/1",2);
      hALCTgetBX2DMeans->setBinLabel(5,"ME -2/2",2);
      hALCTgetBX2DMeans->setBinLabel(6,"ME -2/1",2);
      hALCTgetBX2DMeans->setBinLabel(7,"ME -1/3",2);
      hALCTgetBX2DMeans->setBinLabel(8,"ME -1/2",2);
      hALCTgetBX2DMeans->setBinLabel(9,"ME -1/1b",2);
      hALCTgetBX2DMeans->setBinLabel(10,"ME -1/1a",2);
      hALCTgetBX2DMeans->setBinLabel(11,"ME +1/1a",2);
      hALCTgetBX2DMeans->setBinLabel(12,"ME +1/1b",2);
      hALCTgetBX2DMeans->setBinLabel(13,"ME +1/2",2);
      hALCTgetBX2DMeans->setBinLabel(14,"ME +1/3",2);
      hALCTgetBX2DMeans->setBinLabel(15,"ME +2/1",2);
      hALCTgetBX2DMeans->setBinLabel(16,"ME +2/2",2);
      hALCTgetBX2DMeans->setBinLabel(17,"ME +3/1",2);
      hALCTgetBX2DMeans->setBinLabel(18,"ME +3/2",2);
      hALCTgetBX2DMeans->setBinLabel(19,"ME +4/1",2);
      hALCTgetBX2DMeans->setBinLabel(20,"ME +4/2",2);
      hALCTMatch = dbe->book1D("hALCTMatch","ALCT position in ALCT-CLCT match window [BX]",7,-0.5,6.5);
      hALCTMatchChamberMeans = dbe->book1D("hALCTMatchChamberMeans","Chamber Mean ALCT position in ALCT-CLCT match window [BX]",60,0,6);
      hALCTMatchSerial = dbe->book2D("hALCTMatchSerial","ALCT position in ALCT-CLCT match window [BX]",601,-0.5,600.5,7,-0.5,6.5);
      hALCTMatchSerial->setAxisTitle("Chamber Serial Number");
      hALCTMatch2DNumerator = new TH2F("hALCTMatch2DNumerator","ALCT position in ALCT-CLCT match window [BX] (sum)",36,0.5,36.5,20,0.5,20.5);
      hALCTMatch2DMeans = dbe->book2D("hALCTMatch2DMeans","ALCT position in ALCT-CLCT match window [BX]",36,0.5,36.5,20,0.5,20.5);
      hALCTMatch2Denominator = dbe->book2D("hALCTMatch2Denominator","Number of ALCT-CLCT matches checked",36,0.5,36.5,20,0.5,20.5);
      hALCTMatch2DMeans->setAxisTitle("Chamber #");
      hALCTMatch2DMeans->setBinLabel(1,"ME -4/2",2);
      hALCTMatch2DMeans->setBinLabel(2,"ME -4/1",2);
      hALCTMatch2DMeans->setBinLabel(3,"ME -3/2",2);
      hALCTMatch2DMeans->setBinLabel(4,"ME -2/1",2);
      hALCTMatch2DMeans->setBinLabel(5,"ME -2/2",2);
      hALCTMatch2DMeans->setBinLabel(6,"ME -2/1",2);
      hALCTMatch2DMeans->setBinLabel(7,"ME -1/3",2);
      hALCTMatch2DMeans->setBinLabel(8,"ME -1/2",2);
      hALCTMatch2DMeans->setBinLabel(9,"ME -1/1b",2);
      hALCTMatch2DMeans->setBinLabel(10,"ME -1/1a",2);
      hALCTMatch2DMeans->setBinLabel(11,"ME +1/1a",2);
      hALCTMatch2DMeans->setBinLabel(12,"ME +1/1b",2);
      hALCTMatch2DMeans->setBinLabel(13,"ME +1/2",2);
      hALCTMatch2DMeans->setBinLabel(14,"ME +1/3",2);
      hALCTMatch2DMeans->setBinLabel(15,"ME +2/1",2);
      hALCTMatch2DMeans->setBinLabel(16,"ME +2/2",2);
      hALCTMatch2DMeans->setBinLabel(17,"ME +3/1",2);
      hALCTMatch2DMeans->setBinLabel(18,"ME +3/2",2);
      hALCTMatch2DMeans->setBinLabel(19,"ME +4/1",2);
      hALCTMatch2DMeans->setBinLabel(20,"ME +4/2",2);
      hCLCTL1A = dbe->book1D("hCLCTL1A","L1A - CLCTpreTrigger at TMB [BX]",10,149.5,159.5);
      hCLCTL1AChamberMeans = dbe->book1D("hCLCTL1AChamberMeans","Chamber Mean L1A - CLCTpreTrigger at TMB [BX]",90,150,159);
      hCLCTL1ASerial = dbe->book2D("hCLCTL1ASerial","L1A - CLCTpreTrigger at TMB [BX]",601,-0.5,600.5,10,149.5,159.5);
      hCLCTL1ASerial->setAxisTitle("Chamber Serial Number");
      hCLCTL1A2DNumerator = new TH2F("hCLCTL1A2DNumerator","L1A - CLCTpreTrigger at TMB [BX] (sum)",36,0.5,36.5,20,0.5,20.5);
      hCLCTL1A2DMeans = dbe->book2D("hCLCTL1A2DMeans","L1A - CLCTpreTrigger at TMB [BX]",36,0.5,36.5,20,0.5,20.5);
      hCLCTL1A2Denominator = dbe->book2D("hCLCTL1A2Denominator","Number of TMB CLCTs checked",36,0.5,36.5,20,0.5,20.5);
      hCLCTL1A2DMeans->setAxisTitle("Chamber #");
      hCLCTL1A2DMeans->setBinLabel(1,"ME -4/2",2);
      hCLCTL1A2DMeans->setBinLabel(2,"ME -4/1",2);
      hCLCTL1A2DMeans->setBinLabel(3,"ME -3/2",2);
      hCLCTL1A2DMeans->setBinLabel(4,"ME -2/1",2);
      hCLCTL1A2DMeans->setBinLabel(5,"ME -2/2",2);
      hCLCTL1A2DMeans->setBinLabel(6,"ME -2/1",2);
      hCLCTL1A2DMeans->setBinLabel(7,"ME -1/3",2);
      hCLCTL1A2DMeans->setBinLabel(8,"ME -1/2",2);
      hCLCTL1A2DMeans->setBinLabel(9,"ME -1/1b",2);
      hCLCTL1A2DMeans->setBinLabel(10,"ME -1/1a",2);
      hCLCTL1A2DMeans->setBinLabel(11,"ME +1/1a",2);
      hCLCTL1A2DMeans->setBinLabel(12,"ME +1/1b",2);
      hCLCTL1A2DMeans->setBinLabel(13,"ME +1/2",2);
      hCLCTL1A2DMeans->setBinLabel(14,"ME +1/3",2);
      hCLCTL1A2DMeans->setBinLabel(15,"ME +2/1",2);
      hCLCTL1A2DMeans->setBinLabel(16,"ME +2/2",2);
      hCLCTL1A2DMeans->setBinLabel(17,"ME +3/1",2);
      hCLCTL1A2DMeans->setBinLabel(18,"ME +3/2",2);
      hCLCTL1A2DMeans->setBinLabel(19,"ME +4/1",2);
      hCLCTL1A2DMeans->setBinLabel(20,"ME +4/2",2);

}
int CSCOfflineMonitor::chamberSerial ( CSCDetId  id) [private]

Definition at line 2193 of file CSCOfflineMonitor.cc.

                                                  {
  int st = id.station();
  int ri = id.ring();
  int ch = id.chamber();
  int ec = id.endcap();
  int kSerial = ch;
  if (st == 1 && ri == 1) kSerial = ch;
  if (st == 1 && ri == 2) kSerial = ch + 36;
  if (st == 1 && ri == 3) kSerial = ch + 72;
  if (st == 1 && ri == 4) kSerial = ch;
  if (st == 2 && ri == 1) kSerial = ch + 108;
  if (st == 2 && ri == 2) kSerial = ch + 126;
  if (st == 3 && ri == 1) kSerial = ch + 162;
  if (st == 3 && ri == 2) kSerial = ch + 180;
  if (st == 4 && ri == 1) kSerial = ch + 216;
  if (st == 4 && ri == 2) kSerial = ch + 234;  // one day...
  if (ec == 2) kSerial = kSerial + 300;
  return kSerial;
}
void CSCOfflineMonitor::doBXMonitor ( edm::Handle< CSCALCTDigiCollection alcts,
edm::Handle< CSCCLCTDigiCollection clcts,
const edm::Event event,
const edm::EventSetup eventSetup 
) [private]

uncomment this for regional unpacking if (id!=SOME_ID) continue;

Take a reference to this FED's data

if fed has data then unpack it

get a pointer to data and pass it to constructor for unpacking

get a reference to dduData

set default detid to that for E=+z, S=1, R=1, C=1, L=1

skip the DDU if its data has serious errors define a mask for serious errors

get a reference to chamber data

first process chamber-wide digis such as LCT

default value for all digis not related to cfebs

layer=0 flags entire chamber

check alct data integrity

check tmb data integrity

Definition at line 1855 of file CSCOfflineMonitor.cc.

References CSCTMBHeader::ALCTMatchTime(), CSCTMBHeader::BXNCount(), CSCDetId::chamber(), CastorDataFrameFilter_impl::check(), CSCDCCExaminer::check(), CSCDCCExaminer::crcALCT(), CSCDCCExaminer::crcCFEB(), CSCDCCExaminer::crcTMB(), CSCDetId, FEDRawData::data(), runTheMatrix::data, CSCDCCEventData::dduData(), CSCCrateMap::detId(), CSCDetId::endcap(), CSCDCCExaminer::errors(), edm::EventSetup::get(), edm::Event::getByLabel(), j, LogTrace, FEDNumbering::MAXCSCFEDID, FEDNumbering::MINCSCFEDID, NULL, CSCDCCExaminer::output1(), CSCDCCExaminer::output2(), edm::ESHandle< T >::product(), DetId::rawId(), CSCDetId::ring(), CSCDCCExaminer::setMask(), FEDRawData::size(), and CSCDetId::station().

                                                                                                                                                                       {

  // Loop over ALCTDigis

  for (CSCALCTDigiCollection::DigiRangeIterator j=alcts->begin(); j!=alcts->end(); j++) {
    const CSCDetId& idALCT = (*j).first;
    const CSCALCTDigiCollection::Range& range =(*j).second;
    for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt!=range.second; ++digiIt){
      // Valid digi in the chamber (or in neighbouring chamber)  
      if((*digiIt).isValid()){
        hALCTgetBX->Fill((*digiIt).getBX());
        hALCTgetBXSerial->Fill(chamberSerial(idALCT),(*digiIt).getBX());
        hALCTgetBX2DNumerator->Fill(idALCT.chamber(),typeIndex(idALCT,2),(*digiIt).getBX());
        hALCTgetBX2Denominator->Fill(idALCT.chamber(),typeIndex(idALCT,2));
      }
    }
  }// end ALCT Digi loop


  // Loop over raw data to get TMBHeader information
  // Taking code from EventFilter/CSCRawToDigis/CSCDCCUnpacker.cc
  edm::ESHandle<CSCCrateMap> hcrate;
  eventSetup.get<CSCCrateMapRcd>().get(hcrate); 
  const CSCCrateMap* pcrate = hcrate.product();


  // Try to get raw data
  edm::Handle<FEDRawDataCollection> rawdata;
  if (!(event.getByLabel(FEDRawDataCollectionTag_,rawdata)) ){
    edm::LogWarning("CSCOfflineMonitor")<<" raw data with label "<<FEDRawDataCollectionTag_ <<" not available";
    return;
  }



  bool goodEvent = false;
  unsigned long dccBinCheckMask = 0x06080016;
  unsigned int examinerMask = 0x1FEBF3F6;
  unsigned int errorMask = 0x0;

  for (int id=FEDNumbering::MINCSCFEDID;
       id<=FEDNumbering::MAXCSCFEDID; ++id) { // loop over DCCs
     
    const FEDRawData& fedData = rawdata->FEDData(id);
    unsigned long length =  fedData.size();
   
    if (length>=32){ 
      CSCDCCExaminer* examiner = NULL;
      std::stringstream examiner_out, examiner_err;
      goodEvent = true;
      examiner = new CSCDCCExaminer();
      examiner->output1().redirect(examiner_out);
      examiner->output2().redirect(examiner_err);
      if( examinerMask&0x40000 ) examiner->crcCFEB(1);
      if( examinerMask&0x8000  ) examiner->crcTMB (1);
      if( examinerMask&0x0400  ) examiner->crcALCT(1);
      examiner->output1().show();
      examiner->output2().show();
      examiner->setMask(examinerMask);
      const short unsigned int *data = (short unsigned int *)fedData.data();
 
      int res = examiner->check(data,long(fedData.size()/2));
      if( res < 0 )   {
        goodEvent=false;
      } 
      else {    
        goodEvent=!(examiner->errors()&dccBinCheckMask);
      }
 
                 
      if (goodEvent) {
 
        CSCDCCExaminer * ptrExaminer = examiner;
        CSCDCCEventData dccData((short unsigned int *) fedData.data(), ptrExaminer);
        const std::vector<CSCDDUEventData> & dduData = dccData.dduData();
        
        CSCDetId layer(1, 1, 1, 1, 1);
        for (unsigned int iDDU=0; iDDU<dduData.size(); ++iDDU) {  // loop over DDUs
          if (dduData[iDDU].trailer().errorstat()&errorMask) {
            LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "DDU# " << iDDU << " has serious error - no digis unpacked! " <<
              std::hex << dduData[iDDU].trailer().errorstat();
            continue; // to next iteration of DDU loop
          }
          
          const std::vector<CSCEventData> & cscData = dduData[iDDU].cscData();
          
          
          for (unsigned int iCSC=0; iCSC<cscData.size(); ++iCSC) { // loop over CSCs
            
            int vmecrate = cscData[iCSC].dmbHeader()->crateID();
            int dmb = cscData[iCSC].dmbHeader()->dmbID();
            
            int icfeb = 0;  
            int ilayer = 0; 
            
             if ((vmecrate>=1)&&(vmecrate<=60) && (dmb>=1)&&(dmb<=10)&&(dmb!=6)) {
               layer = pcrate->detId(vmecrate, dmb,icfeb,ilayer );
             } 
             else{
               LogTrace ("CSCOfflineMonitor") << " detID input out of range!!! ";
               LogTrace ("CSCOfflineMonitor")
                 << " skipping chamber vme= " << vmecrate << " dmb= " << dmb;
               continue; // to next iteration of iCSC loop
             }


            int nalct = cscData[iCSC].dmbHeader()->nalct();
            bool goodALCT=false;
            //if (nalct&&(cscData[iCSC].dataPresent>>6&0x1)==1) {
            if (nalct&&cscData[iCSC].alctHeader()) {  
              if (cscData[iCSC].alctHeader()->check()){
                goodALCT=true;
              }
            }
            
            int nclct = cscData[iCSC].dmbHeader()->nclct();
            bool goodTMB=false;
            if (nclct&&cscData[iCSC].tmbData()) {
              if (cscData[iCSC].tmbHeader()->check()){
                if (cscData[iCSC].clctData()->check()) goodTMB=true; 
              }
            }
            
            if (goodTMB && goodALCT) { 
              const CSCTMBHeader *tmbHead = cscData[iCSC].tmbHeader();
              std::vector<CSCCLCTDigi> clcts = cscData[iCSC].tmbHeader()->CLCTDigis(layer.rawId());
              if (clcts.size()==0 || !(clcts[0].isValid()))
                continue;
              // Check if the CLCT was in ME11a (ring 4)
              if(layer.station()==1 && layer.ring() ==1 && clcts[0].getKeyStrip()>128){
                layer = CSCDetId(layer.endcap(),layer.station(),4, layer.chamber()); 
              }
              hALCTMatch->Fill(tmbHead->ALCTMatchTime());
              hALCTMatchSerial->Fill(chamberSerial(layer),tmbHead->ALCTMatchTime());
              // Only fill big 2D display if ALCTMatchTime !=6, since this bin is polluted by the CLCT only triggers
              // One will have to look at the serial plots to see if the are a lot of entries here
              if(tmbHead->ALCTMatchTime()!=6){
                hALCTMatch2DNumerator->Fill(layer.chamber(),typeIndex(layer,2),tmbHead->ALCTMatchTime());
                hALCTMatch2Denominator->Fill(layer.chamber(),typeIndex(layer,2));             
              }

              int TMB_CLCTpre_rel_L1A = tmbHead->BXNCount()-clcts[0].getFullBX();
              if (TMB_CLCTpre_rel_L1A > 3563)
                TMB_CLCTpre_rel_L1A = TMB_CLCTpre_rel_L1A - 3564;
              if (TMB_CLCTpre_rel_L1A < 0)
                TMB_CLCTpre_rel_L1A = TMB_CLCTpre_rel_L1A + 3564;

              hCLCTL1A->Fill(TMB_CLCTpre_rel_L1A);
              hCLCTL1ASerial->Fill(chamberSerial(layer),TMB_CLCTpre_rel_L1A);
              hCLCTL1A2DNumerator->Fill(layer.chamber(),typeIndex(layer,2),TMB_CLCTpre_rel_L1A);
              hCLCTL1A2Denominator->Fill(layer.chamber(),typeIndex(layer,2));         
              
            }// end if goodTMB and goodALCT
          }// end loop CSCData
        }// end loop DDU
      }// end if good event
      if (examiner!=NULL) delete examiner;
    }// end if non-zero fed data
  }// end DCC loop for NON-REFERENCE

  return;

}
void CSCOfflineMonitor::doEfficiencies ( edm::Handle< CSCWireDigiCollection wires,
edm::Handle< CSCStripDigiCollection strips,
edm::Handle< CSCRecHit2DCollection recHits,
edm::Handle< CSCSegmentCollection cscSegments,
edm::ESHandle< CSCGeometry cscGeom 
) [private]

Definition at line 1555 of file CSCOfflineMonitor.cc.

References newFWLiteAna::bin, CSCDetId::chamber(), CSCChamberSpecs::chamberTypeName(), CSCDetId, diffTreeTool::diff, CSCDetId::endcap(), first, CSCLayer::geometry(), CSCChamber::id(), CSCDetId::layer(), CSCChamber::layer(), CSCSegment::localDirection(), CSCSegment::localPosition(), TrapezoidalPlaneBounds::parameters(), CSCDetId::ring(), CSCChamber::specs(), CSCDetId::station(), dtT0WireCalibration_cfg::threshold, GeomDet::toGlobal(), GeomDet::toLocal(), CommonMethods::weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                                        {

  bool allWires[2][4][4][36][6];
  bool allStrips[2][4][4][36][6];
  bool AllRecHits[2][4][4][36][6];
  bool AllSegments[2][4][4][36];
  
  //bool MultiSegments[2][4][4][36];
  for(int iE = 0;iE<2;iE++){
    for(int iS = 0;iS<4;iS++){
      for(int iR = 0; iR<4;iR++){
        for(int iC =0;iC<36;iC++){
          AllSegments[iE][iS][iR][iC] = false;
          //MultiSegments[iE][iS][iR][iC] = false;
          for(int iL=0;iL<6;iL++){
            allWires[iE][iS][iR][iC][iL] = false;
            allStrips[iE][iS][iR][iC][iL] = false;
            AllRecHits[iE][iS][iR][iC][iL] = false;
          }
        }
      }
    }
  }
  
  
  // Wires
  for (CSCWireDigiCollection::DigiRangeIterator dWDiter=wires->begin(); dWDiter!=wires->end(); dWDiter++) {
    CSCDetId idrec = (CSCDetId)(*dWDiter).first;
    std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
    std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
    for( ; wireIter != lWire; ++wireIter) {
      allWires[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber() -1][idrec.layer() -1] = true;
      break;
    }
  }

  //---- STRIPS
  for (CSCStripDigiCollection::DigiRangeIterator dSDiter=strips->begin(); dSDiter!=strips->end(); dSDiter++) {
    CSCDetId idrec = (CSCDetId)(*dSDiter).first;
    std::vector<CSCStripDigi>::const_iterator stripIter = (*dSDiter).second.first;
    std::vector<CSCStripDigi>::const_iterator lStrip = (*dSDiter).second.second;
    for( ; stripIter != lStrip; ++stripIter) {
      std::vector<int> myADCVals = stripIter->getADCCounts();
      bool thisStripFired = false;
      float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
      float threshold = 13.3 ;
      float diff = 0.;
      for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
        diff = (float)myADCVals[iCount]-thisPedestal;
        if (diff > threshold) {
          thisStripFired = true;
          break;
        }
      }
      if(thisStripFired){
        allStrips[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber() -1][idrec.layer() -1] = true;
        break;
      }
    }
  }

  // Rechits
  for (CSCRecHit2DCollection::const_iterator recEffIt = recHits->begin(); recEffIt != recHits->end(); recEffIt++) {
    //CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
    CSCDetId  idrec = (CSCDetId)(*recEffIt).cscDetId();
    AllRecHits[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber() -1][idrec.layer() -1] = true;

  }

  std::vector <uint> seg_ME2(2,0) ;
  std::vector <uint> seg_ME3(2,0) ;
  std::vector < pair <CSCDetId, CSCSegment> > theSegments(4);
  // Segments
  for(CSCSegmentCollection::const_iterator segEffIt=cscSegments->begin(); segEffIt != cscSegments->end(); segEffIt++) {
    CSCDetId idseg  = (CSCDetId)(*segEffIt).cscDetId();
    //if(AllSegments[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber()]){
    //MultiSegments[idrec.endcap() -1][idrec.station() -1][idrec.ring() -1][idrec.chamber()] = true;
    //}
    AllSegments[idseg.endcap() -1][idseg.station() -1][idseg.ring() -1][idseg.chamber() -1] = true;
    // "Intrinsic" efficiency measurement relies on "good" segment extrapolation - we need the pre-selection below
    // station 2 "good" segment will be used for testing efficiencies in ME1 and ME3
    // station 3 "good" segment will be used for testing efficiencies in ME2 and ME4
    if(2==idseg.station() || 3==idseg.station()){
      uint seg_tmp ; 
      if(2==idseg.station()){
        ++seg_ME2[idseg.endcap() -1];
        seg_tmp = seg_ME2[idseg.endcap() -1];
      }
      else{
        ++seg_ME3[idseg.endcap() -1];
        seg_tmp = seg_ME3[idseg.endcap() -1];
      }
      // is the segment good
      if(1== seg_tmp&& 6==(*segEffIt).nRecHits() && (*segEffIt).chi2()/(*segEffIt).degreesOfFreedom()<3.){
        pair <CSCDetId, CSCSegment> specSeg = make_pair( (CSCDetId)(*segEffIt).cscDetId(),*segEffIt);
        theSegments[2*(idseg.endcap()-1)+(idseg.station() -2)] = specSeg;
      }
    }
    /*
    if(2==idseg.station()){
        ++seg_ME2[idseg.endcap() -1];
       if(1==seg_ME2[idseg.endcap() -1] && 6==(*segEffIt).nRecHits() && (*segEffIt).chi2()/(*segEffIt).degreesOfFreedom()<3.){
           pair <CSCDetId, CSCSegment> specSeg = make_pair( (CSCDetId)(*segEffIt).cscDetId(),*segEffIt);
           theSegments[2*(idseg.endcap()-1)+(idseg.station() -2)] = specSeg;
       }
    }
    else if(3==idseg.station()){
        ++seg_ME3[idseg.endcap() -1];
        if(1==seg_ME3[idseg.endcap() -1] && 6==(*segEffIt).nRecHits() && (*segEffIt).chi2()/(*segEffIt).degreesOfFreedom()<3.){
         pair <CSCDetId, CSCSegment> specSeg = make_pair( (CSCDetId)(*segEffIt).cscDetId(),*segEffIt);
         theSegments[2*(idseg.endcap()-1)+(idseg.station() -2)] = specSeg;
       }
    }
    */
    
  }
  // Simple efficiency calculations
  for(int iE = 0;iE<2;iE++){
    for(int iS = 0;iS<4;iS++){
      for(int iR = 0; iR<4;iR++){
        for(int iC =0;iC<36;iC++){
          int NumberOfLayers = 0;
          for(int iL=0;iL<6;iL++){
            if(AllRecHits[iE][iS][iR][iC][iL]){
              NumberOfLayers++;
            }
          }
          int bin = 0;
          if (iS==0) bin = iR+1+(iE*10);
          else bin = (iS+1)*2 + (iR+1) + (iE*10);
          if(NumberOfLayers>1){
            //if(!(MultiSegments[iE][iS][iR][iC])){
            if(AllSegments[iE][iS][iR][iC]){
              //---- Efficient segment evenents
              hSSTE->Fill(bin);
            }
            //---- All segment events (normalization)
            hSSTE->Fill(20+bin);
            //}
          }
          if(AllSegments[iE][iS][iR][iC]){
            if(NumberOfLayers==6){
              //---- Efficient rechit events
              hRHSTE->Fill(bin);;
            }
            //---- All rechit events (normalization)
            hRHSTE->Fill(20+bin);;
          }
        }
      }
    }
  }

  // pick a segment only if there are no others in the station
  std::vector < pair <CSCDetId, CSCSegment> * > theSeg;
  if(1==seg_ME2[0]) theSeg.push_back(&theSegments[0]);
  if(1==seg_ME3[0]) theSeg.push_back(&theSegments[1]);
  if(1==seg_ME2[1]) theSeg.push_back(&theSegments[2]);
  if(1==seg_ME3[1]) theSeg.push_back(&theSegments[3]);

  // Needed for plots
  // at the end the chamber types will be numbered as 1 to 18 
  // (ME-4/1, -ME3/2, -ME3/1, ..., +ME3/1, +ME3/2, ME+4/1 ) 
  std::map <std::string, float> chamberTypes;
  chamberTypes["ME1/a"] = 0.5;
  chamberTypes["ME1/b"] = 1.5;
  chamberTypes["ME1/2"] = 2.5;
  chamberTypes["ME1/3"] = 3.5;
  chamberTypes["ME2/1"] = 4.5;
  chamberTypes["ME2/2"] = 5.5;
  chamberTypes["ME3/1"] = 6.5;
  chamberTypes["ME3/2"] = 7.5;
  chamberTypes["ME4/1"] = 8.5;

  if(theSeg.size()){
    std::map <int , GlobalPoint> extrapolatedPoint;
    std::map <int , GlobalPoint>::iterator it;
    const std::vector<CSCChamber*> ChamberContainer = cscGeom->chambers();
    // Pick which chamber with which segment to test
    for(unsigned int nCh=0;nCh<ChamberContainer.size();nCh++){
      const CSCChamber *cscchamber = ChamberContainer[nCh];
      pair <CSCDetId, CSCSegment> * thisSegment = 0;
      for(uint iSeg =0;iSeg<theSeg.size();++iSeg ){
        if(cscchamber->id().endcap() == theSeg[iSeg]->first.endcap()){ 
          if(1==cscchamber->id().station() || 3==cscchamber->id().station() ){
            if(2==theSeg[iSeg]->first.station()){
              thisSegment = theSeg[iSeg];
            }
          }
          else if (2==cscchamber->id().station() || 4==cscchamber->id().station()){
            if(3==theSeg[iSeg]->first.station()){
              thisSegment = theSeg[iSeg];
            }
          }
        }
      }
      // this chamber is to be tested with thisSegment
      if(thisSegment){
        CSCSegment * seg = &(thisSegment->second);
        const CSCChamber *segChamber = cscGeom->chamber(thisSegment->first);
        LocalPoint localCenter(0.,0.,0);
        GlobalPoint cscchamberCenter =  cscchamber->toGlobal(localCenter);
        // try to save some time (extrapolate a segment to a certain position only once)
        it = extrapolatedPoint.find(int(cscchamberCenter.z()));
        if(it==extrapolatedPoint.end()){
          GlobalPoint segPos = segChamber->toGlobal(seg->localPosition());
          GlobalVector segDir = segChamber->toGlobal(seg->localDirection());
          double paramaterLine = lineParametrization(segPos.z(),cscchamberCenter.z() , segDir.z());
          double xExtrapolated = extrapolate1D(segPos.x(),segDir.x(), paramaterLine);
          double yExtrapolated = extrapolate1D(segPos.y(),segDir.y(), paramaterLine);
          GlobalPoint globP (xExtrapolated, yExtrapolated, cscchamberCenter.z());
          extrapolatedPoint[int(cscchamberCenter.z())] = globP;
        }
        // Where does the extrapolated point lie in the (tested) chamber local frame? Here: 
        LocalPoint extrapolatedPointLocal = cscchamber->toLocal(extrapolatedPoint[int(cscchamberCenter.z())]);
        const CSCLayer *layer_p = cscchamber->layer(1);//layer 1
        const CSCLayerGeometry *layerGeom = layer_p->geometry ();
        const std::vector<float> layerBounds = layerGeom->parameters ();
        float shiftFromEdge = 15.;//cm
        float shiftFromDeadZone = 10.;
        // is the extrapolated point within a sensitive region
        bool pass = withinSensitiveRegion(extrapolatedPointLocal, layerBounds, 
                                          cscchamber->id().station(), cscchamber->id().ring(), 
                                          shiftFromEdge, shiftFromDeadZone);
        if(pass){// the extrapolation point of the segment lies within sensitive region of that chamber
          // how many rechit layers are there in the chamber?
          // 0 - maybe the muon died or is deflected at large angle? do not use that case
          // 1 - could be noise...
          // 2 or more - this is promissing; this is our definition of a reliable signal; use it below
          // is other definition better? 
          int nRHLayers = 0;
          for(int iL =0;iL<6;++iL){
            if(AllRecHits[cscchamber->id().endcap()-1]
               [cscchamber->id().station()-1]
               [cscchamber->id().ring()-1][cscchamber->id().chamber()-1][iL]){
              ++nRHLayers;
            }
          }
          //std::cout<<" nRHLayers = "<<nRHLayers<<std::endl;
          float verticalScale = chamberTypes[cscchamber->specs()->chamberTypeName()];
          if(cscchamberCenter.z()<0){
            verticalScale = - verticalScale;
          } 
          verticalScale +=9.5;
          hSensitiveAreaEvt->Fill(float(cscchamber->id().chamber()),verticalScale);
          if(nRHLayers>1){// this chamber contains a reliable signal
            //chamberTypes[cscchamber->specs()->chamberTypeName()];
            // "intrinsic" efficiencies
            //std::cout<<" verticalScale = "<<verticalScale<<" chType = "<<cscchamber->specs()->chamberTypeName()<<std::endl;
            // this is the denominator forr all efficiencies
            hEffDenominator->Fill(float(cscchamber->id().chamber()),verticalScale);
            // Segment efficiency
            if(AllSegments[cscchamber->id().endcap()-1]
               [cscchamber->id().station()-1]
               [cscchamber->id().ring()-1][cscchamber->id().chamber()-1]){
              hSSTE2->Fill(float(cscchamber->id().chamber()),float(verticalScale));
            }
          
            for(int iL =0;iL<6;++iL){
              float weight = 1./6.;
              // one shold account for the weight in the efficiency...
              // Rechit efficiency
              if(AllRecHits[cscchamber->id().endcap()-1]
                 [cscchamber->id().station()-1]
                 [cscchamber->id().ring()-1][cscchamber->id().chamber()-1][iL]){
                hRHSTE2->Fill(float(cscchamber->id().chamber()),float(verticalScale),weight);
              }
              // Wire efficiency
              if(allWires[cscchamber->id().endcap()-1]
                 [cscchamber->id().station()-1]
                 [cscchamber->id().ring()-1][cscchamber->id().chamber()-1][iL]){
                // one shold account for the weight in the efficiency...
                hWireSTE2->Fill(float(cscchamber->id().chamber()),float(verticalScale),weight);
              }
              // Strip efficiency
              if(allStrips[cscchamber->id().endcap()-1]
                 [cscchamber->id().station()-1]
                 [cscchamber->id().ring()-1][cscchamber->id().chamber()-1][iL]){
                // one shold account for the weight in the efficiency...
                hStripSTE2->Fill(float(cscchamber->id().chamber()),float(verticalScale),weight);
              }
            }
          }
        }
      }
    }
  }
  //


}
void CSCOfflineMonitor::doOccupancies ( edm::Handle< CSCStripDigiCollection strips,
edm::Handle< CSCWireDigiCollection wires,
edm::Handle< CSCRecHit2DCollection recHits,
edm::Handle< CSCSegmentCollection cscSegments,
edm::Handle< CSCCLCTDigiCollection clcts 
) [private]

Definition at line 932 of file CSCOfflineMonitor.cc.

References trackerHits::c, CSCDetId::chamber(), CSCDetId, diffTreeTool::diff, CSCDetId::endcap(), j, csvReporter::r, CSCDetId::ring(), asciidump::s, CSCDetId::station(), and dtT0WireCalibration_cfg::threshold.

                                                                             {

  bool clcto[2][4][4][36];
  bool wireo[2][4][4][36];
  bool stripo[2][4][4][36];
  bool rechito[2][4][4][36];
  bool segmento[2][4][4][36];

  bool hasWires = false;
  bool hasStrips = false;
  bool hasRecHits = false;
  bool hasSegments = false;

  for (int e = 0; e < 2; e++){
    for (int s = 0; s < 4; s++){
      for (int r = 0; r < 4; r++){
        for (int c = 0; c < 36; c++){
          clcto[e][s][r][c] = false;
          wireo[e][s][r][c] = false;
          stripo[e][s][r][c] = false;
          rechito[e][s][r][c] = false;
          segmento[e][s][r][c] = false;
        }
      }
    }
  }

  //clcts
  for (CSCCLCTDigiCollection::DigiRangeIterator j=clcts->begin(); j!=clcts->end(); j++) {
    CSCDetId id = (CSCDetId)(*j).first;
    int kEndcap  = id.endcap();
    int kRing    = id.ring();
    int kStation = id.station();
    int kChamber = id.chamber();
    const CSCCLCTDigiCollection::Range& range =(*j).second;
    for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt!=range.second; ++digiIt){
      // Valid digi in the chamber (or in neighbouring chamber) 
      if((*digiIt).isValid()){
      //Check whether this CLCT came from ME11a
        if( kStation ==1 && kRing==1 && (*digiIt).getKeyStrip()>128)
          kRing = 4;
        clcto[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
      }
    }
  }

  //wires
  for (CSCWireDigiCollection::DigiRangeIterator wi=wires->begin(); wi!=wires->end(); wi++) {
    CSCDetId id = (CSCDetId)(*wi).first;
    int kEndcap  = id.endcap();
    int kRing    = id.ring();
    int kStation = id.station();
    int kChamber = id.chamber();
    std::vector<CSCWireDigi>::const_iterator wireIt = (*wi).second.first;
    std::vector<CSCWireDigi>::const_iterator lastWire = (*wi).second.second;
    for( ; wireIt != lastWire; ++wireIt){
      if (!wireo[kEndcap-1][kStation-1][kRing-1][kChamber-1]){
        wireo[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
        hOWires->Fill(kChamber,typeIndex(id,2));
        hOWireSerial->Fill(chamberSerial(id));
        hasWires = true;
        if( clcto[kEndcap-1][kStation-1][kRing-1][kChamber-1])
          hOWiresAndCLCT->Fill(kChamber,typeIndex(id,2));
        //Also check for a CLCT in ME11a if you're in ME11 already
        if (kStation==1 && kRing==1 && clcto[kEndcap-1][kStation-1][3][kChamber-1]){
          CSCDetId idME11a = CSCDetId(kEndcap, kStation, 4, kChamber);
          hOWiresAndCLCT->Fill(kChamber,typeIndex(idME11a,2));
        } 
      }
    }//end for loop
  }
  
  //strips
  for (CSCStripDigiCollection::DigiRangeIterator si=strips->begin(); si!=strips->end(); si++) {
    CSCDetId id = (CSCDetId)(*si).first;
    int kEndcap  = id.endcap();
    int kRing    = id.ring();
    int kStation = id.station();
    int kChamber = id.chamber();
    std::vector<CSCStripDigi>::const_iterator stripIt = (*si).second.first;
    std::vector<CSCStripDigi>::const_iterator lastStrip = (*si).second.second;
    for( ; stripIt != lastStrip; ++stripIt) {
      std::vector<int> myADCVals = stripIt->getADCCounts();
      bool thisStripFired = false;
      float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
      float threshold = 13.3 ;
      float diff = 0.;
      for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
        diff = (float)myADCVals[iCount]-thisPedestal;
        if (diff > threshold) { thisStripFired = true; }
      }
      if (thisStripFired) {
        if (!stripo[kEndcap-1][kStation-1][kRing-1][kChamber-1]){
          stripo[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
          hOStrips->Fill(kChamber,typeIndex(id,2));
          hOStripSerial->Fill(chamberSerial(id));
          hasStrips = true;
          if (clcto[kEndcap-1][kStation-1][kRing-1][kChamber-1]){
            // check if there is a wire digi in this chamber too
            // for ME 1/4 check for a wire in ME 1/1
            if(wireo[kEndcap-1][kStation-1][kRing-1][kChamber-1] || (kRing==4 && wireo[kEndcap-1][kStation-1][0][kChamber-1]) ){
              hOStripsAndWiresAndCLCT->Fill(kChamber,typeIndex(id,2));
            }
          }//end clct and wire digi check
        }
      }//end if (thisStripFired)
    }
  }

  //rechits
  CSCRecHit2DCollection::const_iterator recIt;
  for (recIt = recHits->begin(); recIt != recHits->end(); recIt++) {
    CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
    int kEndcap  = idrec.endcap();
    int kRing    = idrec.ring();
    int kStation = idrec.station();
    int kChamber = idrec.chamber();
    if (!rechito[kEndcap-1][kStation-1][kRing-1][kChamber-1]){
      rechito[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
      hORecHitsSerial->Fill(chamberSerial(idrec));
      hORecHits->Fill(kChamber,typeIndex(idrec,2));
      hasRecHits = true;
    }
  }

  //segments
  for(CSCSegmentCollection::const_iterator segIt=cscSegments->begin(); segIt != cscSegments->end(); segIt++) {
    CSCDetId id  = (CSCDetId)(*segIt).cscDetId();
    int kEndcap  = id.endcap();
    int kRing    = id.ring();
    int kStation = id.station();
    int kChamber = id.chamber();
    if (!segmento[kEndcap-1][kStation-1][kRing-1][kChamber-1]){
      segmento[kEndcap-1][kStation-1][kRing-1][kChamber-1] = true;
      hOSegmentsSerial->Fill(chamberSerial(id));
      hOSegments->Fill(kChamber,typeIndex(id,2));
      hasSegments = true;
    }
  }

  //Overall CSC Occupancy
  hCSCOccupancy->Fill(1);
  if (hasWires) hCSCOccupancy->Fill(3);
  if (hasStrips) hCSCOccupancy->Fill(5);
  if (hasWires && hasStrips) hCSCOccupancy->Fill(7);
  if (hasRecHits) hCSCOccupancy->Fill(9);
  if (hasSegments) hCSCOccupancy->Fill(11);


  }
void CSCOfflineMonitor::doPedestalNoise ( edm::Handle< CSCStripDigiCollection strips) [private]

Definition at line 1160 of file CSCOfflineMonitor.cc.

References CSCDetId, CSCDetId::station(), and dtT0WireCalibration_cfg::threshold.

                                                                               {

  for (CSCStripDigiCollection::DigiRangeIterator dPNiter=strips->begin(); dPNiter!=strips->end(); dPNiter++) {
    CSCDetId id = (CSCDetId)(*dPNiter).first;
    int kStation = id.station();
    int kRing = id.ring();
    std::vector<CSCStripDigi>::const_iterator pedIt = (*dPNiter).second.first;
    std::vector<CSCStripDigi>::const_iterator lStrip = (*dPNiter).second.second;
    for( ; pedIt != lStrip; ++pedIt) {
      int myStrip = pedIt->getStrip();
      std::vector<int> myADCVals = pedIt->getADCCounts();
      float TotalADC = getSignal(*strips, id, myStrip);
      bool thisStripFired = false;
      float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
      float thisSignal = (1./6)*(myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
      float threshold = 13.3;
      if(kStation == 1 && kRing == 4)
        {
          kRing = 1;
          if(myStrip <= 16) myStrip += 64; // no trapping for any bizarreness
        }
      if (TotalADC > threshold) { thisStripFired = true;}
      if (!thisStripFired){
        float ADC = thisSignal - thisPedestal;
        hStripPed[typeIndex(id)-1]->Fill(ADC);
      }
    }
  }

}
void CSCOfflineMonitor::doRecHits ( edm::Handle< CSCRecHit2DCollection recHits,
edm::Handle< CSCStripDigiCollection strips,
edm::ESHandle< CSCGeometry cscGeom 
) [private]

Definition at line 1198 of file CSCOfflineMonitor.cc.

References CSCDetId, CSCDetId::endcap(), i, edm::RangeMap< ID, C, P >::size(), CSCDetId::station(), GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

                                                                   {

  // Get the RecHits collection :
  int nRecHits = recHits->size();
  
  // ---------------------
  // Loop over rechits 
  // ---------------------
  // Build iterator for rechits and loop :
  CSCRecHit2DCollection::const_iterator dRHIter;
  for (dRHIter = recHits->begin(); dRHIter != recHits->end(); dRHIter++) {

    // Find chamber with rechits in CSC 
    CSCDetId idrec = (CSCDetId)(*dRHIter).cscDetId();

    // Store rechit as a Local Point:
    LocalPoint rhitlocal = (*dRHIter).localPosition();  
    //float xreco = rhitlocal.x();
    //float yreco = rhitlocal.y();

    // Get the reconstucted strip position and error
    float stpos = (*dRHIter).positionWithinStrip();
    float sterr = (*dRHIter).errorWithinStrip();

    // Find the charge associated with this hit
    CSCRecHit2D::ADCContainer adcs = (*dRHIter).adcs();
    int adcsize = adcs.size();
    float rHSumQ = 0;
    float sumsides = 0;
    for (int i = 0; i < adcsize; i++){
      if (i != 3 && i != 7 && i != 11){
        rHSumQ = rHSumQ + adcs[i]; 
      }
      if (adcsize == 12 && (i < 3 || i > 7) && i < 12){
        sumsides = sumsides + adcs[i];
      }
    }
    float rHratioQ = sumsides/rHSumQ;
    if (adcsize != 12) rHratioQ = -99;

    // Get the signal timing of this hit
    float rHtime = (*dRHIter).tpeak(); //calculated from cathode SCA bins
    float rHtimeAnode = (*dRHIter).wireTime(); // calculated from anode wire bx

    // Get pointer to the layer:
    const CSCLayer* csclayer = cscGeom->layer( idrec );

    // Transform hit position from local chamber geometry to global CMS geom
    GlobalPoint rhitglobal= csclayer->toGlobal(rhitlocal);
    float grecx   =  rhitglobal.x();
    float grecy   =  rhitglobal.y();

    // Fill some histograms
    int sIndex = idrec.station() + ((idrec.endcap()-1) * 4);
    int tIndex = typeIndex(idrec);
    hRHSumQ[tIndex-1]->Fill(rHSumQ);
    hRHRatioQ[tIndex-1]->Fill(rHratioQ);
    hRHstpos[tIndex-1]->Fill(stpos);
    hRHsterr[tIndex-1]->Fill(sterr);
    hRHTiming[tIndex-1]->Fill(rHtime);
    hRHTimingAnode[tIndex-1]->Fill(rHtimeAnode);
    hRHGlobal[sIndex-1]->Fill(grecx,grecy);

  } //end rechit loop

  if (nRecHits == 0) nRecHits = -1;
  hRHnrechits->Fill(nRecHits);

}
void CSCOfflineMonitor::doResolution ( edm::Handle< CSCSegmentCollection cscSegments,
edm::ESHandle< CSCGeometry cscGeom 
) [private]

Definition at line 1389 of file CSCOfflineMonitor.cc.

References CSCDetId, kLayer(), CSCDetId::layer(), CSCDetId::ring(), and CSCDetId::station().

                                                                      {

  for(CSCSegmentCollection::const_iterator dSiter=cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
    CSCDetId id  = (CSCDetId)(*dSiter).cscDetId();
    //
    // try to get the CSC recHits that contribute to this segment.
    std::vector<CSCRecHit2D> theseRecHits = (*dSiter).specificRecHits();
    int nRH = (*dSiter).nRecHits();
    int jRH = 0;
    CLHEP::HepMatrix sp(6,1);
    CLHEP::HepMatrix se(6,1);
    for ( vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
      jRH++;
      CSCDetId idRH = (CSCDetId)(*iRH).cscDetId();
      //int kEndcap  = idRH.endcap();
      int kRing    = idRH.ring();
      int kStation = idRH.station();
      //int kChamber = idRH.chamber();
      int kLayer   = idRH.layer();

      // Find the strip containing this hit
      CSCRecHit2D::ChannelContainer hitstrips = (*iRH).channels();
      int nStrips     =  hitstrips.size();
      int centerid    =  nStrips/2 + 1;
      int centerStrip =  hitstrips[centerid - 1];

      // If this segment has 6 hits, find the position of each hit on the strip in units of stripwidth and store values
      if (nRH == 6){
        float stpos = (*iRH).positionWithinStrip();
        se(kLayer,1) = (*iRH).errorWithinStrip();
        // Take into account half-strip staggering of layers (ME1/1 has no staggering)
        if (kStation == 1 && (kRing == 1 || kRing == 4)) sp(kLayer,1) = stpos + centerStrip;
        else{
          if (kLayer == 1 || kLayer == 3 || kLayer == 5) sp(kLayer,1) = stpos + centerStrip;
          if (kLayer == 2 || kLayer == 4 || kLayer == 6) sp(kLayer,1) = stpos - 0.5 + centerStrip;
        }
      }

    }

    float residual = -99;
    // Fit all points except layer 3, then compare expected value for layer 3 to reconstructed value
    if (nRH == 6){
      float expected = fitX(sp,se);
      residual = expected - sp(3,1);
    }

    hSResid[typeIndex(id)-1]->Fill(residual);

  } // end segment loop



}
void CSCOfflineMonitor::doSegments ( edm::Handle< CSCSegmentCollection cscSegments,
edm::ESHandle< CSCGeometry cscGeom 
) [private]

Definition at line 1277 of file CSCOfflineMonitor.cc.

References ChiSquaredProbability(), CSCDetId, i, j, PV3DBase< T, PVType, FrameType >::phi(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                                    {

  // get CSC segment collection
  int nSegments = cscSegments->size();

  for(CSCSegmentCollection::const_iterator dSiter=cscSegments->begin(); dSiter != cscSegments->end(); dSiter++) {
    CSCDetId id  = (CSCDetId)(*dSiter).cscDetId();
    float chisq    = (*dSiter).chi2();
    int nhits      = (*dSiter).nRecHits();
    int nDOF       = 2*nhits-4;
    float nChi2    = chisq/nDOF;
    double chisqProb = ChiSquaredProbability( (double)chisq, nDOF );
    LocalPoint localPos = (*dSiter).localPosition();
    LocalVector segDir = (*dSiter).localDirection();

    // prepare to calculate segment times 
    float timeCathode = 0;  //average from cathode information alone
    float timeAnode = 0;  //average from pruned anode information alone
    float timeCombined = 0; //average from cathode hits and pruned anode list
    std::vector<float> cathodeTimes;
    std::vector<float> anodeTimes;
    // Get the CSC recHits that contribute to this segment.
    std::vector<CSCRecHit2D> theseRecHits = (*dSiter).specificRecHits();
    for ( vector<CSCRecHit2D>::const_iterator iRH = theseRecHits.begin(); iRH != theseRecHits.end(); iRH++) {
      if ( !((*iRH).isValid()) ) continue;  // only interested in valid hits
      cathodeTimes.push_back((*iRH).tpeak());
      anodeTimes.push_back((*iRH).wireTime());
    }//end rechit loop
    
    // Calculate cathode average
    for (unsigned int i=0; i<cathodeTimes.size(); i++) 
        timeCathode+=cathodeTimes[i]/cathodeTimes.size();
    
    // Prune the anode list to deal with the late tail 
    float anodeMaxDiff;
    bool modified;
    std::vector<float>::iterator anodeMaxHit;
    do {
      if (anodeTimes.size()==0) continue;
      timeAnode=0;
      anodeMaxDiff=0;
      modified=false;

      // Find the average
      for (unsigned int j=0; j<anodeTimes.size(); j++) timeAnode+=anodeTimes[j]/anodeTimes.size();

      // Find the maximum outlier hit
      for (unsigned int j=0; j<anodeTimes.size(); j++) {
        if (fabs(anodeTimes[j]-timeAnode)>anodeMaxDiff) {
          anodeMaxHit=anodeTimes.begin()+j;
          anodeMaxDiff=fabs(anodeTimes[j]-timeAnode);
        }
      }
      
      // Cut hit if its greater than some time away
      if (anodeMaxDiff>26) {
        modified=true;
        anodeTimes.erase(anodeMaxHit);
      }
    } while (modified);

    // Calculate combined anode and cathode time average
    if(cathodeTimes.size()+anodeTimes.size() >0 )
      timeCombined = (timeCathode*cathodeTimes.size() + timeAnode*anodeTimes.size())/(cathodeTimes.size()+anodeTimes.size());

    // global transformation
    float globX = 0.;
    float globY = 0.;
    float globZ = 0.;
    float globTOF = 0.;
    float globTheta = 0.;
    float globPhi   = 0.;
    const CSCChamber* cscchamber = cscGeom->chamber(id);
    if (cscchamber) {
      GlobalPoint globalPosition = cscchamber->toGlobal(localPos);
      globX = globalPosition.x();
      globY = globalPosition.y();
      globZ = globalPosition.z();
      globTOF = sqrt(globX*globX+globY*globY+globZ*globZ);
      GlobalVector globalDirection = cscchamber->toGlobal(segDir);
      globTheta = globalDirection.theta();
      globPhi   = globalDirection.phi();
    }

    // Fill histos
    int tIndex = typeIndex(id);
    hSnhitsAll->Fill(nhits);
    hSnhits[tIndex-1]->Fill(nhits);
    hSChiSqAll->Fill(nChi2);
    hSChiSq[tIndex-1]->Fill(nChi2);
    hSChiSqProbAll->Fill(chisqProb);
    hSChiSqProb[tIndex-1]->Fill(chisqProb);
    hSGlobalTheta->Fill(globTheta);
    hSGlobalPhi->Fill(globPhi);
    hSTimeCathode->Fill(timeCathode);
    hSTimeCombined->Fill(timeCombined);
    hSTimeVsZ->Fill(globZ, timeCombined);
    hSTimeVsTOF->Fill(globTOF, timeCombined);

  } // end segment loop

  if (nSegments == 0) nSegments = -1;
  hSnSegments->Fill(nSegments);

}
void CSCOfflineMonitor::doStripDigis ( edm::Handle< CSCStripDigiCollection strips) [private]

Definition at line 1121 of file CSCOfflineMonitor.cc.

References CSCDetId, diffTreeTool::diff, and dtT0WireCalibration_cfg::threshold.

                                                                            {

  int nStripsFired = 0;
  for (CSCStripDigiCollection::DigiRangeIterator dSDiter=strips->begin(); dSDiter!=strips->end(); dSDiter++) {
    CSCDetId id = (CSCDetId)(*dSDiter).first;
    std::vector<CSCStripDigi>::const_iterator stripIter = (*dSDiter).second.first;
    std::vector<CSCStripDigi>::const_iterator lStrip = (*dSDiter).second.second;
    for( ; stripIter != lStrip; ++stripIter) {
      int myStrip = stripIter->getStrip();
      std::vector<int> myADCVals = stripIter->getADCCounts();
      bool thisStripFired = false;
      float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
      float threshold = 13.3 ;
      float diff = 0.;
      for (unsigned int iCount = 0; iCount < myADCVals.size(); iCount++) {
        diff = (float)myADCVals[iCount]-thisPedestal;
        if (diff > threshold) { thisStripFired = true; }
      } 
      if (thisStripFired) {
        nStripsFired++;
        hStripNumber[typeIndex(id)-1]->Fill(myStrip);
      }
    }
  } // end strip loop

  // this way you can zero suppress but still store info on # events with no digis
  if (nStripsFired == 0) nStripsFired = -1;
  hStripNFired->Fill(nStripsFired);
  // fill n per event

}
void CSCOfflineMonitor::doWireDigis ( edm::Handle< CSCWireDigiCollection wires) [private]

Definition at line 1092 of file CSCOfflineMonitor.cc.

References CSCDetId.

                                                                         {

  int nWireGroupsTotal = 0;
  for (CSCWireDigiCollection::DigiRangeIterator dWDiter=wires->begin(); dWDiter!=wires->end(); dWDiter++) {
    CSCDetId id = (CSCDetId)(*dWDiter).first;
    std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
    std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
    for( ; wireIter != lWire; ++wireIter) {
      int myWire = wireIter->getWireGroup();
      int myTBin = wireIter->getTimeBin();
      nWireGroupsTotal++;
      hWireTBin[typeIndex(id)-1]->Fill(myTBin);
      hWireNumber[typeIndex(id)-1]->Fill(myWire);
    }
  } // end wire loop

  // this way you can zero suppress but still store info on # events with no digis
  if (nWireGroupsTotal == 0) nWireGroupsTotal = -1;
  hWirenGroupsTotal->Fill(nWireGroupsTotal);
  
}
void CSCOfflineMonitor::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 783 of file CSCOfflineMonitor.cc.

References dumpDBToFile_GT_ttrig_cfg::outputFileName, and funct::true.

                              {
  
  finalize() ;
  finalizedHistograms_ = true ;
  
  bool saveHistos = param.getParameter<bool>("saveHistos");
  string outputFileName = param.getParameter<string>("outputFileName");
  if(saveHistos){
    dbe->save(outputFileName);
  }

}
void CSCOfflineMonitor::endRun ( edm::Run const &  ,
edm::EventSetup const &   
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 774 of file CSCOfflineMonitor.cc.

References funct::true.

double CSCOfflineMonitor::extrapolate1D ( double  initPosition,
double  initDirection,
double  parameterOfTheLine 
) [inline, private]

Definition at line 142 of file CSCOfflineMonitor.h.

                                                                                            {
    double extrapolatedPosition = initPosition + initDirection*parameterOfTheLine;
    return extrapolatedPosition; 
  }
void CSCOfflineMonitor::fillEfficiencyHistos ( int  bin,
int  flag 
) [private]
void CSCOfflineMonitor::finalize ( void  )

Definition at line 797 of file CSCOfflineMonitor.cc.

                                 {

  hRHEff = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hRHEff");
  hSEff = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hSEff");
  hSEff2 = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hSEff2");
  hRHEff2 = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hRHEff2");
  hStripEff2 = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hStripEff2");
  hWireEff2 = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hWireEff2");

  hOStripsAndWiresAndCLCT= dbe->get("CSC/CSCOfflineMonitor/Occupancy/hOStripsAndWiresAndCLCT");
  hOWiresAndCLCT= dbe->get("CSC/CSCOfflineMonitor/Occupancy/hOWiresAndCLCT");
  hStripReadoutEff2 = dbe->get("CSC/CSCOfflineMonitor/Efficiency/hStripReadoutEff2");

  hALCTgetBX2DMeans = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTgetBX2DMeans");
  hALCTMatch2DMeans = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTMatch2DMeans");
  hCLCTL1A2DMeans   = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hCLCTL1A2DMeans");

  hALCTgetBXSerial = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTgetBXSerial");
  hALCTMatchSerial = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTMatchSerial");
  hCLCTL1ASerial   = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hCLCTL1ASerial");

  hALCTgetBXChamberMeans = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTgetBXChamberMeans");
  hALCTMatchChamberMeans = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hALCTMatchChamberMeans");
  hCLCTL1AChamberMeans   = dbe->get("CSC/CSCOfflineMonitor/BXMonitor/hCLCTL1AChamberMeans");

  if (hRHEff) histoEfficiency(hRHSTE,hRHEff);
  if (hSEff) histoEfficiency(hSSTE,hSEff);
  if (hSEff2) hSEff2->getTH2F()->Divide(hSSTE2,hEffDenominator,1.,1.,"B");
  if (hRHEff2) hRHEff2->getTH2F()->Divide(hRHSTE2,hEffDenominator,1.,1.,"B");
  if (hStripEff2) hStripEff2->getTH2F()->Divide(hStripSTE2,hEffDenominator,1.,1.,"B");
  if (hWireEff2) hWireEff2->getTH2F()->Divide(hWireSTE2,hEffDenominator,1.,1.,"B");
  if (hStripReadoutEff2) hStripReadoutEff2->getTH2F()->Divide(hOStripsAndWiresAndCLCT->getTH2F(),hOWiresAndCLCT->getTH2F(),1.,1.,"B");
  if (hALCTMatch2DMeans){ 
    harvestChamberMeans(hALCTMatchChamberMeans, hALCTMatch2DMeans, hALCTMatch2DNumerator,hALCTMatch2Denominator );
  }
  if (hALCTgetBX2DMeans) {
    harvestChamberMeans(hALCTgetBXChamberMeans, hALCTgetBX2DMeans, hALCTgetBX2DNumerator, hALCTgetBX2Denominator );
  }
  if (hCLCTL1A2DMeans) {
    harvestChamberMeans(hCLCTL1AChamberMeans, hCLCTL1A2DMeans, hCLCTL1A2DNumerator, hCLCTL1A2Denominator );
  }

  if(hALCTgetBXSerial)  normalize(hALCTgetBXSerial);
  if(hALCTMatchSerial)  normalize(hALCTMatchSerial);
  if(hCLCTL1ASerial)    normalize(hCLCTL1ASerial);


}
float CSCOfflineMonitor::fitX ( CLHEP::HepMatrix  sp,
CLHEP::HepMatrix  ep 
) [private]

Definition at line 1451 of file CSCOfflineMonitor.cc.

References delta, benchmark_cfg::errors, i, and slope.

                                                                         {

  float S   = 0;
  float Sx  = 0;
  float Sy  = 0;
  float Sxx = 0;
  float Sxy = 0;
  float sigma2 = 0;

  for (int i=1;i<7;i++){
    if (i != 3){
      sigma2 = errors(i,1)*errors(i,1);
      S = S + (1/sigma2);
      Sy = Sy + (points(i,1)/sigma2);
      Sx = Sx + ((i)/sigma2);
      Sxx = Sxx + (i*i)/sigma2;
      Sxy = Sxy + (((i)*points(i,1))/sigma2);
    }
  }

  float delta = S*Sxx - Sx*Sx;
  float intercept = (Sxx*Sy - Sx*Sxy)/delta;
  float slope = (S*Sxy - Sx*Sy)/delta;

  return (intercept + slope*3);

}
void CSCOfflineMonitor::getEfficiency ( float  bin,
float  Norm,
std::vector< float > &  eff 
) [private]

Definition at line 2033 of file CSCOfflineMonitor.cc.

References mathSSE::sqrt().

                                                                                 {
  //---- Efficiency with binomial error
  float Efficiency = 0.;
  float EffError = 0.;
  if(fabs(Norm)>0.000000001){
    Efficiency = bin/Norm;
    if(bin<Norm){
      EffError = sqrt( (1.-Efficiency)*Efficiency/Norm );
    }
  }
  eff[0] = Efficiency;
  eff[1] = EffError;
}
float CSCOfflineMonitor::getSignal ( const CSCStripDigiCollection stripdigis,
CSCDetId  idRH,
int  centerStrip 
) [private]

Definition at line 1486 of file CSCOfflineMonitor.cc.

References CSCDetId, if(), and prof2calltree::last.

                                                                  {

  float SigADC[5];
  float TotalADC = 0;
  SigADC[0] = 0;
  SigADC[1] = 0;
  SigADC[2] = 0;
  SigADC[3] = 0;
  SigADC[4] = 0;

 
  // Loop over strip digis 
  CSCStripDigiCollection::DigiRangeIterator sIt;
  
  for (sIt = stripdigis.begin(); sIt != stripdigis.end(); sIt++){
    CSCDetId id = (CSCDetId)(*sIt).first;
    if (id == idCS){

      // First, find the Signal-Pedestal for center strip
      vector<CSCStripDigi>::const_iterator digiItr = (*sIt).second.first;
      vector<CSCStripDigi>::const_iterator last = (*sIt).second.second;
      for ( ; digiItr != last; ++digiItr ) {
        int thisStrip = digiItr->getStrip();
        if (thisStrip == (centerStrip)){
          std::vector<int> myADCVals = digiItr->getADCCounts();
          float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
          float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
          SigADC[0] = thisSignal - 6*thisPedestal;
        }
     // Now,find the Signal-Pedestal for neighbouring 4 strips
        if (thisStrip == (centerStrip+1)){
          std::vector<int> myADCVals = digiItr->getADCCounts();
          float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
          float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
          SigADC[1] = thisSignal - 6*thisPedestal;
        }
        if (thisStrip == (centerStrip+2)){
          std::vector<int> myADCVals = digiItr->getADCCounts();
          float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
          float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
          SigADC[2] = thisSignal - 6*thisPedestal;
        }
        if (thisStrip == (centerStrip-1)){
          std::vector<int> myADCVals = digiItr->getADCCounts();
          float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
          float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
          SigADC[3] = thisSignal - 6*thisPedestal;
        }
        if (thisStrip == (centerStrip-2)){
          std::vector<int> myADCVals = digiItr->getADCCounts();
          float thisPedestal = 0.5*(float)(myADCVals[0]+myADCVals[1]);
          float thisSignal = (myADCVals[2]+myADCVals[3]+myADCVals[4]+myADCVals[5]+myADCVals[6]+myADCVals[7]);
          SigADC[4] = thisSignal - 6*thisPedestal;
        }
      }
      TotalADC = 0.2*(SigADC[0]+SigADC[1]+SigADC[2]+SigADC[3]+SigADC[4]);
    }
  }
  return TotalADC;
}
void CSCOfflineMonitor::harvestChamberMeans ( MonitorElement meMean1D,
MonitorElement meMean2D,
TH2F *  hNum,
MonitorElement meDenom 
) [private]

Definition at line 846 of file CSCOfflineMonitor.cc.

References MonitorElement::Fill(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), plotscripts::mean(), and MonitorElement::setBinContent().

                                                                                                                                  {


  if (hNum->GetNbinsY()!= meDenom->getNbinsY() || hNum->GetNbinsX()!= meDenom->getNbinsX())
    return;
  if (meMean2D->getNbinsY()!= meDenom->getNbinsY() || meMean2D->getNbinsX()!= meDenom->getNbinsX())
    return;

  float mean;
  for (int biny = 0; biny < hNum->GetNbinsY()+1 ; biny++){
    for (int binx = 0; binx < hNum->GetNbinsX()+1 ; binx++){
      if ( meDenom->getBinContent(binx,biny) > 0){
        mean = hNum->GetBinContent(binx,biny)/meDenom->getBinContent(binx,biny);
        meMean1D->Fill(mean);
        meMean2D->setBinContent(binx,biny,mean);
      }
    }
  }

  return;
}
void CSCOfflineMonitor::histoEfficiency ( TH1F *  readHisto,
MonitorElement writeHisto 
) [private]

Definition at line 2047 of file CSCOfflineMonitor.cc.

References i, MonitorElement::setBinContent(), and MonitorElement::setBinError().

                                                                                  {
  std::vector<float> eff(2);
  int Nbins =  readHisto->GetSize()-2;//without underflows and overflows
  std::vector<float> bins(Nbins);
  std::vector<float> Efficiency(Nbins);
  std::vector<float> EffError(Nbins);
  float Num = 1;
  float Den = 1;
  for (int i=0;i<20;i++){
    Num = readHisto->GetBinContent(i+1);
    Den = readHisto->GetBinContent(i+21);
    getEfficiency(Num, Den, eff);
    Efficiency[i] = eff[0];
    EffError[i] = eff[1];
    writeHisto->setBinContent(i+1, Efficiency[i]);
    writeHisto->setBinError(i+1, EffError[i]);
  }
}
double CSCOfflineMonitor::lineParametrization ( double  z1Position,
double  z2Position,
double  z1Direction 
) [inline, private]

Definition at line 138 of file CSCOfflineMonitor.h.

                                                                                      {
    double parameterLine = (z2Position-z1Position)/z1Direction;
    return parameterLine;
  }
void CSCOfflineMonitor::normalize ( MonitorElement me) [private]

Definition at line 868 of file CSCOfflineMonitor.cc.

References python::tagInventory::entries, MonitorElement::getTH2F(), and h.

                                                   {
    
  TH2F* h = me->getTH2F();
  TH1D* hproj = h->ProjectionX("hproj");

  for (int binx = 0; binx < h->GetNbinsX()+1 ; binx++){
    Double_t entries = hproj->GetBinContent(binx);
    for (Int_t biny=1;biny <= h->GetNbinsY();biny++) {
      Double_t cxy = h->GetBinContent(binx,biny);
      if (cxy > 0 && entries>0) h->SetBinContent(binx,biny,cxy/entries);
    }
  }


    return;

}
int CSCOfflineMonitor::typeIndex ( CSCDetId  id,
int  flag = 1 
) [private]

Definition at line 2167 of file CSCOfflineMonitor.cc.

References Reference_intrackfit_cff::endcap, getHLTprescales::index, relativeConstraints::ring, and relativeConstraints::station.

                                                     {
  
  if (flag == 1){
    // linearlized index bases on endcap, station, and ring
    int index = 0;
    if (id.station() == 1) index = id.ring();
    else index = id.station()*2 + id.ring();
    if (id.endcap() == 1) index = index + 10;
    if (id.endcap() == 2) index = 11 - index;
    return index;
  }

  else if (flag == 2){
    int index = 0;
    if (id.station() == 1 && id.ring() != 4) index = id.ring()+1;
    if (id.station() == 1 && id.ring() == 4) index = 1; 
    if (id.station() != 1) index = id.station()*2 + id.ring();
    if (id.endcap() == 1) index = index + 10;
    if (id.endcap() == 2) index = 11 - index;
    return index;
  }

  else return 0;

}
bool CSCOfflineMonitor::withinSensitiveRegion ( LocalPoint  localPos,
const std::vector< float >  layerBounds,
int  station,
int  ring,
float  shiftFromEdge,
float  shiftFromDeadZone 
) [private]

Definition at line 2066 of file CSCOfflineMonitor.cc.

References abs, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

                                                                                                                  {
//---- check if it is in a good local region (sensitive area - geometrical and HV boundaries excluded) 
  bool pass = false;

  float y_center = 0.;
  double yUp = layerBounds[3] + y_center;
  double yDown = - layerBounds[3] + y_center;
  double xBound1Shifted = layerBounds[0] - shiftFromEdge;//
  double xBound2Shifted = layerBounds[1] - shiftFromEdge;//
  double lineSlope = (yUp - yDown)/(xBound2Shifted-xBound1Shifted);
  double lineConst = yUp - lineSlope*xBound2Shifted;
  double yBorder =  lineSlope*abs(localPos.x()) + lineConst;
      
  //bool withinChamberOnly = false;// false = "good region"; true - boundaries only
  std::vector <float> deadZoneCenter(6);
  float cutZone = shiftFromDeadZone;//cm
  //---- hardcoded... not good
  if(station>1 && station<5){
    if(2==ring){
      deadZoneCenter[0]= -162.48 ;
      deadZoneCenter[1] = -81.8744;
      deadZoneCenter[2] = -21.18165;
      deadZoneCenter[3] = 39.51105;
      deadZoneCenter[4] = 100.2939;
      deadZoneCenter[5] = 160.58;
      
      if(localPos.y() >yBorder &&
         ((localPos.y()> deadZoneCenter[0] + cutZone && localPos.y()< deadZoneCenter[1] - cutZone) ||
          (localPos.y()> deadZoneCenter[1] + cutZone && localPos.y()< deadZoneCenter[2] - cutZone) ||
          (localPos.y()> deadZoneCenter[2] + cutZone && localPos.y()< deadZoneCenter[3] - cutZone) ||
          (localPos.y()> deadZoneCenter[3] + cutZone && localPos.y()< deadZoneCenter[4] - cutZone) ||
          (localPos.y()> deadZoneCenter[4] + cutZone && localPos.y()< deadZoneCenter[5] - cutZone))){
        pass = true;
      }
    }
    else if(1==ring){
      if(2==station){
        deadZoneCenter[0]= -95.80 ;
        deadZoneCenter[1] = -27.47;
        deadZoneCenter[2] = 33.67;
        deadZoneCenter[3] = 90.85;
        }
      else if(3==station){
        deadZoneCenter[0]= -89.305 ;
        deadZoneCenter[1] = -39.705;
        deadZoneCenter[2] = 20.195;
        deadZoneCenter[3] = 77.395;
      }
      else if(4==station){
        deadZoneCenter[0]= -75.645;
        deadZoneCenter[1] = -26.055;
        deadZoneCenter[2] = 23.855;
        deadZoneCenter[3] = 70.575;
      }
      if(localPos.y() >yBorder &&
         ((localPos.y()> deadZoneCenter[0] + cutZone && localPos.y()< deadZoneCenter[1] - cutZone) ||
          (localPos.y()> deadZoneCenter[1] + cutZone && localPos.y()< deadZoneCenter[2] - cutZone) ||
          (localPos.y()> deadZoneCenter[2] + cutZone && localPos.y()< deadZoneCenter[3] - cutZone))){
        pass = true;
      }
    }
  }
  else if(1==station){
    if(3==ring){
      deadZoneCenter[0]= -83.155 ;
      deadZoneCenter[1] = -22.7401;
      deadZoneCenter[2] = 27.86665;
      deadZoneCenter[3] = 81.005;
      if(localPos.y() > yBorder &&
         ((localPos.y()> deadZoneCenter[0] + cutZone && localPos.y()< deadZoneCenter[1] - cutZone) ||
          (localPos.y()> deadZoneCenter[1] + cutZone && localPos.y()< deadZoneCenter[2] - cutZone) ||
          (localPos.y()> deadZoneCenter[2] + cutZone && localPos.y()< deadZoneCenter[3] - cutZone))){
        pass = true;
      }
    }
    else if(2==ring){
      deadZoneCenter[0]= -86.285 ;
      deadZoneCenter[1] = -32.88305;
      deadZoneCenter[2] = 32.867423;
      deadZoneCenter[3] = 88.205;
      if(localPos.y() > (yBorder) &&
         ((localPos.y()> deadZoneCenter[0] + cutZone && localPos.y()< deadZoneCenter[1] - cutZone) ||
          (localPos.y()> deadZoneCenter[1] + cutZone && localPos.y()< deadZoneCenter[2] - cutZone) ||
          (localPos.y()> deadZoneCenter[2] + cutZone && localPos.y()< deadZoneCenter[3] - cutZone))){
        pass = true;
      }
    }
    else{
      deadZoneCenter[0]= -81.0;
      deadZoneCenter[1] = 81.0;
      if(localPos.y() > (yBorder) &&
         (localPos.y()> deadZoneCenter[0] + cutZone && localPos.y()< deadZoneCenter[1] - cutZone )){
        pass = true;
      }
    }
  }
  return pass;
}

Member Data Documentation

Definition at line 102 of file CSCOfflineMonitor.h.

Definition at line 103 of file CSCOfflineMonitor.h.

Definition at line 104 of file CSCOfflineMonitor.h.

Definition at line 105 of file CSCOfflineMonitor.h.

Definition at line 154 of file CSCOfflineMonitor.h.

Definition at line 106 of file CSCOfflineMonitor.h.

Definition at line 97 of file CSCOfflineMonitor.h.

Definition at line 225 of file CSCOfflineMonitor.h.

Definition at line 229 of file CSCOfflineMonitor.h.

Definition at line 228 of file CSCOfflineMonitor.h.

Definition at line 230 of file CSCOfflineMonitor.h.

Definition at line 227 of file CSCOfflineMonitor.h.

Definition at line 226 of file CSCOfflineMonitor.h.

Definition at line 232 of file CSCOfflineMonitor.h.

Definition at line 236 of file CSCOfflineMonitor.h.

Definition at line 235 of file CSCOfflineMonitor.h.

Definition at line 237 of file CSCOfflineMonitor.h.

Definition at line 234 of file CSCOfflineMonitor.h.

Definition at line 233 of file CSCOfflineMonitor.h.

Definition at line 239 of file CSCOfflineMonitor.h.

Definition at line 243 of file CSCOfflineMonitor.h.

Definition at line 242 of file CSCOfflineMonitor.h.

Definition at line 244 of file CSCOfflineMonitor.h.

Definition at line 241 of file CSCOfflineMonitor.h.

Definition at line 240 of file CSCOfflineMonitor.h.

Definition at line 205 of file CSCOfflineMonitor.h.

Definition at line 221 of file CSCOfflineMonitor.h.

Definition at line 199 of file CSCOfflineMonitor.h.

Definition at line 203 of file CSCOfflineMonitor.h.

Definition at line 200 of file CSCOfflineMonitor.h.

Definition at line 204 of file CSCOfflineMonitor.h.

Definition at line 197 of file CSCOfflineMonitor.h.

Definition at line 198 of file CSCOfflineMonitor.h.

Definition at line 202 of file CSCOfflineMonitor.h.

Definition at line 195 of file CSCOfflineMonitor.h.

Definition at line 196 of file CSCOfflineMonitor.h.

Definition at line 201 of file CSCOfflineMonitor.h.

Definition at line 211 of file CSCOfflineMonitor.h.

Definition at line 217 of file CSCOfflineMonitor.h.

Definition at line 168 of file CSCOfflineMonitor.h.

Definition at line 167 of file CSCOfflineMonitor.h.

Definition at line 172 of file CSCOfflineMonitor.h.

TH1F* CSCOfflineMonitor::hRHSTE [private]

Definition at line 209 of file CSCOfflineMonitor.h.

TH2F* CSCOfflineMonitor::hRHSTE2 [private]

Definition at line 213 of file CSCOfflineMonitor.h.

Definition at line 174 of file CSCOfflineMonitor.h.

Definition at line 173 of file CSCOfflineMonitor.h.

std::vector<MonitorElement*> CSCOfflineMonitor::hRHSumQ [private]

Definition at line 169 of file CSCOfflineMonitor.h.

Definition at line 170 of file CSCOfflineMonitor.h.

Definition at line 171 of file CSCOfflineMonitor.h.

std::vector<MonitorElement*> CSCOfflineMonitor::hSChiSq [private]

Definition at line 181 of file CSCOfflineMonitor.h.

Definition at line 180 of file CSCOfflineMonitor.h.

Definition at line 183 of file CSCOfflineMonitor.h.

Definition at line 182 of file CSCOfflineMonitor.h.

Definition at line 210 of file CSCOfflineMonitor.h.

Definition at line 216 of file CSCOfflineMonitor.h.

Definition at line 222 of file CSCOfflineMonitor.h.

Definition at line 185 of file CSCOfflineMonitor.h.

Definition at line 184 of file CSCOfflineMonitor.h.

std::vector<MonitorElement*> CSCOfflineMonitor::hSnhits [private]

Definition at line 179 of file CSCOfflineMonitor.h.

Definition at line 178 of file CSCOfflineMonitor.h.

Definition at line 177 of file CSCOfflineMonitor.h.

std::vector<MonitorElement*> CSCOfflineMonitor::hSResid [private]

Definition at line 192 of file CSCOfflineMonitor.h.

TH1F* CSCOfflineMonitor::hSSTE [private]

Definition at line 208 of file CSCOfflineMonitor.h.

TH2F* CSCOfflineMonitor::hSSTE2 [private]

Definition at line 212 of file CSCOfflineMonitor.h.

Definition at line 186 of file CSCOfflineMonitor.h.

Definition at line 187 of file CSCOfflineMonitor.h.

Definition at line 189 of file CSCOfflineMonitor.h.

Definition at line 188 of file CSCOfflineMonitor.h.

Definition at line 218 of file CSCOfflineMonitor.h.

Definition at line 162 of file CSCOfflineMonitor.h.

Definition at line 163 of file CSCOfflineMonitor.h.

Definition at line 164 of file CSCOfflineMonitor.h.

Definition at line 220 of file CSCOfflineMonitor.h.

Definition at line 214 of file CSCOfflineMonitor.h.

Definition at line 219 of file CSCOfflineMonitor.h.

Definition at line 157 of file CSCOfflineMonitor.h.

Definition at line 159 of file CSCOfflineMonitor.h.

Definition at line 215 of file CSCOfflineMonitor.h.

Definition at line 158 of file CSCOfflineMonitor.h.

Definition at line 99 of file CSCOfflineMonitor.h.

Definition at line 100 of file CSCOfflineMonitor.h.

Definition at line 101 of file CSCOfflineMonitor.h.