CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    RPCPointProducer
00004 // Class:      RPCPointProducer
00005 // 
00013 //
00014 // Original Author:  Camilo Andres Carrillo Montoya
00015 //         Created:  Wed Sep 16 14:56:18 CEST 2009
00016 // $Id: RPCPointProducer.cc,v 1.9 2010/10/19 19:18:22 wmtan Exp $
00017 //
00018 //
00019 
00020 #include "RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h"
00021 
00022 // system include files
00023 
00024 #include <memory>
00025 #include <ctime>
00026 
00027 // user include files
00028 
00029 RPCPointProducer::RPCPointProducer(const edm::ParameterSet& iConfig)
00030 {
00031   cscSegments=iConfig.getParameter<edm::InputTag>("cscSegments");
00032   dt4DSegments=iConfig.getParameter<edm::InputTag>("dt4DSegments");
00033   tracks=iConfig.getParameter<edm::InputTag>("tracks");
00034 
00035   debug=iConfig.getUntrackedParameter<bool>("debug",false);
00036   incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
00037   inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
00038   incltrack=iConfig.getUntrackedParameter<bool>("incltrack",true);
00039   MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.95);
00040   MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.);
00041   MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",150.);
00042   ExtrapolatedRegion=iConfig.getUntrackedParameter<double>("ExtrapolatedRegion",0.5);
00043 
00044   produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints");
00045   produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints");
00046   produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints");
00047   trackTransformerParam = iConfig.getParameter<edm::ParameterSet>("TrackTransformer");  
00048 }
00049 
00050 
00051 RPCPointProducer::~RPCPointProducer(){
00052 
00053 }
00054 
00055 void RPCPointProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){
00056   /*
00057   struct timespec start_time, stop_time;
00058   time_t fs;
00059   time_t fn;
00060   time_t ls;
00061   time_t ln;
00062   clock_gettime(CLOCK_REALTIME, &start_time);  
00063   */
00064 
00065   if(incldt){
00066     edm::Handle<DTRecSegment4DCollection> all4DSegments;
00067     iEvent.getByLabel(dt4DSegments, all4DSegments);
00068     if(all4DSegments.isValid()){
00069       DTSegtoRPC DTClass(all4DSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
00070       std::auto_ptr<RPCRecHitCollection> TheDTPoints(DTClass.thePoints());     
00071       iEvent.put(TheDTPoints,"RPCDTExtrapolatedPoints"); 
00072     }else{
00073       if(debug) std::cout<<"RPCHLT Invalid DTSegments collection"<<std::endl;
00074     }
00075   }
00076 
00077   if(inclcsc){
00078     edm::Handle<CSCSegmentCollection> allCSCSegments;
00079     iEvent.getByLabel(cscSegments, allCSCSegments);
00080     if(allCSCSegments.isValid()){
00081       CSCSegtoRPC CSCClass(allCSCSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
00082       std::auto_ptr<RPCRecHitCollection> TheCSCPoints(CSCClass.thePoints());  
00083       iEvent.put(TheCSCPoints,"RPCCSCExtrapolatedPoints"); 
00084     }else{
00085       if(debug) std::cout<<"RPCHLT Invalid CSCSegments collection"<<std::endl;
00086     }
00087   }
00088   if(incltrack){
00089     edm::Handle<reco::TrackCollection> alltracks;
00090     iEvent.getByLabel(tracks,alltracks);
00091     if(!(alltracks->empty())){
00092       TracktoRPC TrackClass(alltracks,iSetup,iEvent,debug,trackTransformerParam,tracks);
00093       std::auto_ptr<RPCRecHitCollection> TheTrackPoints(TrackClass.thePoints());
00094       iEvent.put(TheTrackPoints,"RPCTrackExtrapolatedPoints");
00095     }else{
00096       std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
00097     }
00098   }
00099  
00100 }
00101 
00102 // ------------ method called once each job just before starting event loop  ------------
00103 void 
00104 RPCPointProducer::beginJob()
00105 {
00106 }
00107 
00108 // ------------ method called once each job just after ending the event loop  ------------
00109 void 
00110 RPCPointProducer::endJob() {
00111 }
00112 
00113