CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Validation/CSCRecHits/src/CSCRecHitValidation.cc

Go to the documentation of this file.
00001 #include "Validation/CSCRecHits/src/CSCRecHitValidation.h"
00002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00003 #include "FWCore/ServiceRegistry/interface/Service.h"
00004 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
00005 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00006 #include <DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h>
00007 #include "DQMServices/Core/interface/DQMStore.h"
00008 
00009 
00010 
00011 CSCRecHitValidation::CSCRecHitValidation(const edm::ParameterSet & ps)
00012 : dbe_( edm::Service<DQMStore>().operator->() ),
00013   theOutputFile( ps.getParameter<std::string>("outputFile") ),
00014   theSimHitMap(ps.getParameter<edm::InputTag>("simHitsTag")),
00015   theCSCGeometry(0),
00016   the2DValidation(dbe_, ps.getParameter<edm::InputTag>("recHitLabel") ),
00017   theSegmentValidation(dbe_, ps.getParameter<edm::InputTag>("segmentLabel") )
00018 {
00019 }
00020 
00021 
00022 CSCRecHitValidation::~CSCRecHitValidation()
00023 {
00024   if ( theOutputFile.size() != 0 && dbe_ ) dbe_->save(theOutputFile);
00025 }
00026 
00027 
00028 void CSCRecHitValidation::endJob() {
00029   if ( theOutputFile.size() != 0 && dbe_ ) dbe_->save(theOutputFile);
00030 }
00031 
00032 
00033 void CSCRecHitValidation::analyze(const edm::Event&e, const edm::EventSetup& eventSetup)
00034 {
00035   theSimHitMap.fill(e);
00036 
00037   // find the geometry & conditions for this event
00038   edm::ESHandle<CSCGeometry> hGeom;
00039   eventSetup.get<MuonGeometryRecord>().get( hGeom );
00040   theCSCGeometry = &*hGeom;
00041 
00042   the2DValidation.setGeometry(theCSCGeometry);
00043   the2DValidation.setSimHitMap(&theSimHitMap);
00044   theSegmentValidation.setGeometry(theCSCGeometry);
00045   theSegmentValidation.setSimHitMap(&theSimHitMap);
00046 
00047   the2DValidation.analyze(e, eventSetup);
00048   theSegmentValidation.analyze(e, eventSetup);
00049 
00050 }