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