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 //
17 //
18 
20 
21 // system include files
22 
23 #include <memory>
24 #include <ctime>
25 
26 // user include files
27 
29 {
30  cscSegments = consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("cscSegments"));
31 
32  dt4DSegments = consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("dt4DSegments"));
33  tracks = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
34  tracks_ = iConfig.getParameter<edm::InputTag>("tracks");
35 
36  debug=iConfig.getUntrackedParameter<bool>("debug",false);
37  incldt=iConfig.getUntrackedParameter<bool>("incldt",true);
38  inclcsc=iConfig.getUntrackedParameter<bool>("inclcsc",true);
39  incltrack=iConfig.getUntrackedParameter<bool>("incltrack",true);
40  MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.95);
41  MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.);
42  MaxDrb4=iConfig.getUntrackedParameter<double>("MaxDrb4",150.);
43  ExtrapolatedRegion=iConfig.getUntrackedParameter<double>("ExtrapolatedRegion",0.5);
44 
45  produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints");
46  produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints");
47  produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints");
48  trackTransformerParam = iConfig.getParameter<edm::ParameterSet>("TrackTransformer");
49 }
50 
51 
53 
54 }
55 
57  /*
58  struct timespec start_time, stop_time;
59  time_t fs;
60  time_t fn;
61  time_t ls;
62  time_t ln;
63  clock_gettime(CLOCK_REALTIME, &start_time);
64  */
65 
66  if(incldt){
68  iEvent.getByToken(dt4DSegments, all4DSegments);
69  if(all4DSegments.isValid()){
70  DTSegtoRPC DTClass(all4DSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
71  std::auto_ptr<RPCRecHitCollection> TheDTPoints(DTClass.thePoints());
72  iEvent.put(TheDTPoints,"RPCDTExtrapolatedPoints");
73  }else{
74  if(debug) std::cout<<"RPCHLT Invalid DTSegments collection"<<std::endl;
75  }
76  }
77 
78  if(inclcsc){
79  edm::Handle<CSCSegmentCollection> allCSCSegments;
80  iEvent.getByToken(cscSegments, allCSCSegments);
81  if(allCSCSegments.isValid()){
82  CSCSegtoRPC CSCClass(allCSCSegments,iSetup,iEvent,debug,ExtrapolatedRegion);
83  std::auto_ptr<RPCRecHitCollection> TheCSCPoints(CSCClass.thePoints());
84  iEvent.put(TheCSCPoints,"RPCCSCExtrapolatedPoints");
85  }else{
86  if(debug) std::cout<<"RPCHLT Invalid CSCSegments collection"<<std::endl;
87  }
88  }
89  if(incltrack){
91  iEvent.getByToken(tracks,alltracks);
92  if(!(alltracks->empty())){
93  TracktoRPC TrackClass(alltracks,iSetup,iEvent,debug,trackTransformerParam,tracks_);
94  std::auto_ptr<RPCRecHitCollection> TheTrackPoints(TrackClass.thePoints());
95  iEvent.put(TheTrackPoints,"RPCTrackExtrapolatedPoints");
96  }else{
97  std::cout<<"RPCHLT Invalid Tracks collection"<<std::endl;
98  }
99  }
100 
101 }
102 
103 // ------------ method called once each job just before starting event loop ------------
104 void
106 {
107 }
108 
109 // ------------ method called once each job just after ending the event loop ------------
110 void
112 }
113 
114 
virtual void beginJob()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< CSCSegmentCollection > cscSegments
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< DTRecSegment4DCollection > dt4DSegments
virtual void produce(edm::Event &, const edm::EventSetup &)
RPCRecHitCollection * thePoints()
Definition: TracktoRPC.h:68
int iEvent
Definition: GenABIO.cc:230
RPCRecHitCollection * thePoints()
Definition: DTSegtoRPC.h:14
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
bool isValid() const
Definition: HandleBase.h:75
RPCRecHitCollection * thePoints()
Definition: CSCSegtoRPC.h:14
RPCPointProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > tracks
edm::ParameterSet trackTransformerParam
virtual void endJob()
tuple cout
Definition: gather_cfg.py:121
edm::InputTag tracks_