CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
19 #include "RPCPointProducer.h"
20 
21 // system include files
22 
23 #include <memory>
24 #include <ctime>
25 
26 // user include files
27 
29  : incldt(iConfig.getUntrackedParameter<bool>("incldt", true)),
30  inclcsc(iConfig.getUntrackedParameter<bool>("inclcsc", true)),
31  incltrack(iConfig.getUntrackedParameter<bool>("incltrack", true)),
32  debug(iConfig.getUntrackedParameter<bool>("debug", false)),
33  MinCosAng(iConfig.getUntrackedParameter<double>("MinCosAng", 0.95)),
34  MaxD(iConfig.getUntrackedParameter<double>("MaxD", 80.)),
35  MaxDrb4(iConfig.getUntrackedParameter<double>("MaxDrb4", 150.)),
36  ExtrapolatedRegion(iConfig.getUntrackedParameter<double>("ExtrapolatedRegion", 0.5)) {
37  if (incldt) {
38  dt4DSegments = consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("dt4DSegments"));
39  dtSegtoRPC = std::make_unique<DTSegtoRPC>(consumesCollector());
40  }
41  if (inclcsc) {
42  cscSegments = consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("cscSegments"));
43  cscSegtoRPC = std::make_unique<CSCSegtoRPC>(consumesCollector());
44  }
45  if (incltrack) {
46  tracks = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
47  tracktoRPC = std::make_unique<TracktoRPC>(iConfig.getParameter<edm::ParameterSet>("TrackTransformer"),
48  iConfig.getParameter<edm::InputTag>("tracks"),
49  consumesCollector());
50  }
51 
52  produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints");
53  produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints");
54  produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints");
55 }
56 
58  if (incldt) {
60  iEvent.getByToken(dt4DSegments, all4DSegments);
61  if (all4DSegments.isValid()) {
62  iEvent.put(dtSegtoRPC->thePoints(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion),
63  "RPCDTExtrapolatedPoints");
64  } else {
65  if (debug)
66  std::cout << "RPCHLT Invalid DTSegments collection" << std::endl;
67  }
68  }
69 
70  if (inclcsc) {
71  edm::Handle<CSCSegmentCollection> allCSCSegments;
72  iEvent.getByToken(cscSegments, allCSCSegments);
73  if (allCSCSegments.isValid()) {
74  iEvent.put(cscSegtoRPC->thePoints(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion),
75  "RPCCSCExtrapolatedPoints");
76  } else {
77  if (debug)
78  std::cout << "RPCHLT Invalid CSCSegments collection" << std::endl;
79  }
80  }
81  if (incltrack) {
83  iEvent.getByToken(tracks, alltracks);
84  if (!(alltracks->empty())) {
85  iEvent.put(tracktoRPC->thePoints(alltracks.product(), iSetup, debug), "RPCTrackExtrapolatedPoints");
86  } else {
87  if (debug)
88  std::cout << "RPCHLT Invalid Tracks collection" << std::endl;
89  }
90  }
91 }
const double ExtrapolatedRegion
std::unique_ptr< TracktoRPC > tracktoRPC
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const bool incltrack
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< CSCSegmentCollection > cscSegments
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< DTRecSegment4DCollection > dt4DSegments
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< CSCSegtoRPC > cscSegtoRPC
bool isValid() const
Definition: HandleBase.h:70
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: Handle.h:70
RPCPointProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > tracks
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tuple cout
Definition: gather_cfg.py:144
std::unique_ptr< DTSegtoRPC > dtSegtoRPC