CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoMET/METProducers/src/CSCHaloDataProducer.cc

Go to the documentation of this file.
00001 #include "RecoMET/METProducers/interface/CSCHaloDataProducer.h"
00002 #include "FWCore/Common/interface/TriggerNames.h"
00003 
00004 /*
00005   [class]:  CSCHaloDataProducer
00006   [authors]: R. Remington, The University of Florida
00007   [description]: See CSCHaloDataProducer.h
00008   [date]: October 15, 2009
00009 */
00010 
00011 using namespace edm;
00012 using namespace std;
00013 using namespace reco;
00014 
00015 CSCHaloDataProducer::CSCHaloDataProducer(const edm::ParameterSet& iConfig)
00016 {
00017   //Digi Level 
00018   IT_L1MuGMTReadout = iConfig.getParameter<edm::InputTag>("L1MuGMTReadoutLabel");
00019 
00020   //HLT Level
00021   IT_HLTResult    = iConfig.getParameter<edm::InputTag>("HLTResultLabel");
00022   CSCAlgo.vIT_HLTBit = iConfig.getParameter< std::vector< edm::InputTag> >("HLTBitLabel");
00023   
00024   //RecHit Level
00025   IT_CSCRecHit   = iConfig.getParameter<edm::InputTag>("CSCRecHitLabel");
00026 
00027   //Higher Level Reco 
00028   IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");  
00029   IT_CosmicMuon = iConfig.getParameter<edm::InputTag>("CosmicMuonLabel"); 
00030   IT_Muon = iConfig.getParameter<edm::InputTag>("MuonLabel");
00031   IT_SA   = iConfig.getParameter<edm::InputTag>("SALabel"); 
00032   IT_ALCT = iConfig.getParameter<edm::InputTag>("ALCTDigiLabel"); 
00033 
00034   // Cosmic track selection parameters
00035   CSCAlgo.SetDetaThreshold( (float) iConfig.getParameter<double>("DetaParam"));
00036   CSCAlgo.SetDphiThreshold( (float) iConfig.getParameter<double>("DphiParam"));
00037   CSCAlgo.SetMinMaxInnerRadius( (float) iConfig.getParameter<double>("InnerRMinParam") ,  (float) iConfig.getParameter<double>("InnerRMaxParam") );
00038   CSCAlgo.SetMinMaxOuterRadius( (float) iConfig.getParameter<double>("OuterRMinParam"), (float) iConfig.getParameter<double>("OuterRMaxParam"));
00039   CSCAlgo.SetNormChi2Threshold( (float) iConfig.getParameter<double>("NormChi2Param") );
00040  
00041   CSCAlgo.SetExpectedBX( (short int) iConfig.getParameter<int>("ExpectedBX") );
00042   CSCAlgo.SetRecHitTime0( (float) iConfig.getParameter<double>("RecHitTime0") );
00043   CSCAlgo.SetRecHitTimeWindow( (float) iConfig.getParameter<double>("RecHitTimeWindow") );
00044   CSCAlgo.SetMinMaxOuterMomentumTheta( (float)iConfig.getParameter<double>("MinOuterMomentumTheta"), (float)iConfig.getParameter<double>("MaxOuterMomentumTheta") );
00045   CSCAlgo.SetMatchingDPhiThreshold( (float)iConfig.getParameter<double>("MatchingDPhiThreshold") );
00046   CSCAlgo.SetMatchingDEtaThreshold( (float)iConfig.getParameter<double>("MatchingDEtaThreshold") );
00047   CSCAlgo.SetMatchingDWireThreshold(iConfig.getParameter<int>("MatchingDWireThreshold") );
00048   produces<CSCHaloData>();
00049 }
00050 
00051 void CSCHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup)
00052 {
00053   //Get CSC Geometry
00054   edm::ESHandle<CSCGeometry> TheCSCGeometry;
00055   iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
00056 
00057   //Get CSC Stand-Alone Muons from Cosmic Reconstruction 
00058   edm::Handle< reco::TrackCollection > TheCosmics;
00059   iEvent.getByLabel(IT_CosmicMuon, TheCosmics);
00060   
00061   //Collision Muon Collection
00062   edm::Handle< reco::MuonCollection> TheMuons;
00063   iEvent.getByLabel(IT_Muon, TheMuons);
00064 
00065   //Get CSC Segments
00066   edm::Handle<CSCSegmentCollection> TheCSCSegments;
00067   iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
00068 
00069   //Get CSC RecHits
00070   Handle<CSCRecHit2DCollection> TheCSCRecHits;
00071   iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
00072 
00073   //Get L1MuGMT 
00074   edm::Handle < L1MuGMTReadoutCollection > TheL1GMTReadout ;
00075   iEvent.getByLabel (IT_L1MuGMTReadout, TheL1GMTReadout);
00076 
00077   //Get Chamber Anode Trigger Information
00078   edm::Handle<CSCALCTDigiCollection> TheALCTs;
00079   iEvent.getByLabel (IT_ALCT, TheALCTs);
00080 
00081   //Get HLT Results                                                                                                                                                       
00082   edm::Handle<edm::TriggerResults> TheHLTResults;
00083   iEvent.getByLabel( IT_HLTResult , TheHLTResults);
00084 
00085   const edm::TriggerNames * triggerNames = 0;
00086   if (TheHLTResults.isValid()) {
00087     triggerNames = &iEvent.triggerNames(*TheHLTResults);
00088   }
00089 
00090   std::auto_ptr<CSCHaloData> TheCSCData(new CSCHaloData( CSCAlgo.Calculate(*TheCSCGeometry, TheCosmics, TheMuons, TheCSCSegments, TheCSCRecHits, TheL1GMTReadout, TheHLTResults, triggerNames, TheALCTs) ) );
00091   // Put it in the event                                                                                                                                                
00092   iEvent.put(TheCSCData);
00093   return;
00094 }
00095 
00096 void CSCHaloDataProducer::beginJob(){return;}
00097 void CSCHaloDataProducer::endJob(){return;}
00098 void CSCHaloDataProducer::beginRun(edm::Run&, const edm::EventSetup&){return;}
00099 void CSCHaloDataProducer::endRun(edm::Run&, const edm::EventSetup&){return;}
00100 CSCHaloDataProducer::~CSCHaloDataProducer(){}