CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCPointProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RPCPointProducer
4 // Class: RPCPointProducer
5 //
13 //
14 // Original Author: Camilo Andres Carrillo Montoya
15 // Created: Wed Sep 16 14:56:18 CEST 2009
16 // $Id: RPCPointProducer.cc,v 1.9 2010/10/19 19:18:22 wmtan Exp $
17 //
18 //
19 
21 
22 // system include files
23 
24 #include <memory>
25 #include <ctime>
26 
27 // user include files
28 
30 {
31  cscSegments=iConfig.getParameter<edm::InputTag>("cscSegments");
32  dt4DSegments=iConfig.getParameter<edm::InputTag>("dt4DSegments");
33  tracks=iConfig.getParameter<edm::InputTag>("tracks");
34 
35  debug=iConfig.getUntrackedParameter<bool>("debug",false);
36  incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
37  inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
38  incltrack=iConfig.getUntrackedParameter<bool>("incltrack",true);
39  MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.95);
40  MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.);
41  MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",150.);
42  ExtrapolatedRegion=iConfig.getUntrackedParameter<double>("ExtrapolatedRegion",0.5);
43 
44  produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints");
45  produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints");
46  produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints");
47  trackTransformerParam = iConfig.getParameter<edm::ParameterSet>("TrackTransformer");
48 }
49 
50 
52 
53 }
54 
56  /*
57  struct timespec start_time, stop_time;
58  time_t fs;
59  time_t fn;
60  time_t ls;
61  time_t ln;
62  clock_gettime(CLOCK_REALTIME, &start_time);
63  */
64 
65  if(incldt){
67  iEvent.getByLabel(dt4DSegments, all4DSegments);
68  if(all4DSegments.isValid()){
69  DTSegtoRPC DTClass(all4DSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
70  std::auto_ptr<RPCRecHitCollection> TheDTPoints(DTClass.thePoints());
71  iEvent.put(TheDTPoints,"RPCDTExtrapolatedPoints");
72  }else{
73  if(debug) std::cout<<"RPCHLT Invalid DTSegments collection"<<std::endl;
74  }
75  }
76 
77  if(inclcsc){
78  edm::Handle<CSCSegmentCollection> allCSCSegments;
79  iEvent.getByLabel(cscSegments, allCSCSegments);
80  if(allCSCSegments.isValid()){
81  CSCSegtoRPC CSCClass(allCSCSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
82  std::auto_ptr<RPCRecHitCollection> TheCSCPoints(CSCClass.thePoints());
83  iEvent.put(TheCSCPoints,"RPCCSCExtrapolatedPoints");
84  }else{
85  if(debug) std::cout<<"RPCHLT Invalid CSCSegments collection"<<std::endl;
86  }
87  }
88  if(incltrack){
90  iEvent.getByLabel(tracks,alltracks);
91  if(!(alltracks->empty())){
92  TracktoRPC TrackClass(alltracks,iSetup,iEvent,debug,trackTransformerParam,tracks);
93  std::auto_ptr<RPCRecHitCollection> TheTrackPoints(TrackClass.thePoints());
94  iEvent.put(TheTrackPoints,"RPCTrackExtrapolatedPoints");
95  }else{
96  std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
97  }
98  }
99 
100 }
101 
102 // ------------ method called once each job just before starting event loop ------------
103 void
105 {
106 }
107 
108 // ------------ method called once each job just after ending the event loop ------------
109 void
111 }
112 
113 
virtual void beginJob()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag dt4DSegments
virtual void produce(edm::Event &, const edm::EventSetup &)
RPCRecHitCollection * thePoints()
Definition: TracktoRPC.h:68
edm::InputTag cscSegments
int iEvent
Definition: GenABIO.cc:243
RPCRecHitCollection * thePoints()
Definition: DTSegtoRPC.h:14
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
RPCRecHitCollection * thePoints()
Definition: CSCSegtoRPC.h:14
RPCPointProducer(const edm::ParameterSet &)
edm::ParameterSet trackTransformerParam
virtual void endJob()
tuple cout
Definition: gather_cfg.py:121
edm::InputTag tracks