CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/Validation/MuonCSCDigis/src/CSCDigiValidation.cc

Go to the documentation of this file.
00001 #include "Validation/MuonCSCDigis/src/CSCDigiValidation.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 "Validation/MuonCSCDigis/src/CSCStripDigiValidation.h"
00007 #include "Validation/MuonCSCDigis/src/CSCWireDigiValidation.h"
00008 #include "Validation/MuonCSCDigis/src/CSCComparatorDigiValidation.h"
00009 #include "Validation/MuonCSCDigis/src/CSCALCTDigiValidation.h"
00010 #include "Validation/MuonCSCDigis/src/CSCCLCTDigiValidation.h"
00011 #include <iostream>
00012 #include "DQMServices/Core/interface/DQMStore.h"
00013 
00014 CSCDigiValidation::CSCDigiValidation(const edm::ParameterSet & ps)
00015 : dbe_( edm::Service<DQMStore>().operator->() ),
00016   outputFile_( ps.getParameter<std::string>("outputFile") ),
00017   theSimHitMap(ps.getParameter<edm::InputTag>("simHitsTag")),
00018   theCSCGeometry(0),
00019   theStripDigiValidation(0),
00020   theWireDigiValidation(0),
00021   theComparatorDigiValidation(0),
00022   theALCTDigiValidation(0),
00023   theCLCTDigiValidation(0)
00024 {
00025   dbe_->setCurrentFolder("MuonCSCDigisV/CSCDigiTask");
00026   bool doSim = ps.getParameter<bool>("doSim");
00027 
00028   theStripDigiValidation = new CSCStripDigiValidation(dbe_, ps.getParameter<edm::InputTag>("stripDigiTag"), doSim);
00029   theWireDigiValidation  = new CSCWireDigiValidation(dbe_, ps.getParameter<edm::InputTag>("wireDigiTag"), doSim);
00030   theComparatorDigiValidation  = new CSCComparatorDigiValidation(dbe_, 
00031               ps.getParameter<edm::InputTag>("comparatorDigiTag"),
00032               ps.getParameter<edm::InputTag>("stripDigiTag"));
00033   theALCTDigiValidation = new CSCALCTDigiValidation(dbe_, ps.getParameter<edm::InputTag>("alctDigiTag"));
00034   theCLCTDigiValidation = new CSCCLCTDigiValidation(dbe_, ps.getParameter<edm::InputTag>("clctDigiTag"));
00035 
00036   if(doSim)
00037   {
00038     theStripDigiValidation->setSimHitMap(&theSimHitMap);
00039     theWireDigiValidation->setSimHitMap(&theSimHitMap);
00040     theComparatorDigiValidation->setSimHitMap(&theSimHitMap);
00041   }
00042 
00043 }
00044 
00045 
00046 CSCDigiValidation::~CSCDigiValidation()
00047 {
00048   if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
00049   delete theStripDigiValidation;
00050   delete theWireDigiValidation;
00051   delete theComparatorDigiValidation;
00052   delete theALCTDigiValidation;
00053   delete theCLCTDigiValidation;
00054 }
00055 
00056 
00057 void CSCDigiValidation::endJob() {
00058   if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
00059 }
00060 
00061 
00062 void CSCDigiValidation::analyze(const edm::Event&e, const edm::EventSetup& eventSetup)
00063 {
00064   theSimHitMap.fill(e);
00065 
00066   // find the geometry & conditions for this event
00067   edm::ESHandle<CSCGeometry> hGeom;
00068   eventSetup.get<MuonGeometryRecord>().get( hGeom );
00069   const CSCGeometry *pGeom = &*hGeom;
00070 
00071   theStripDigiValidation->setGeometry( pGeom );
00072   theWireDigiValidation->setGeometry( pGeom );
00073   theComparatorDigiValidation->setGeometry( pGeom );
00074   theALCTDigiValidation->setGeometry( pGeom );
00075   theCLCTDigiValidation->setGeometry( pGeom );
00076 
00077 
00078   theStripDigiValidation->analyze(e,eventSetup);
00079   theWireDigiValidation->analyze(e,eventSetup);
00080   theComparatorDigiValidation->analyze(e,eventSetup);
00081   theALCTDigiValidation->analyze(e,eventSetup);
00082   theCLCTDigiValidation->analyze(e,eventSetup);
00083 
00084 }
00085 
00086 
00087