CMS 3D CMS Logo

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  : 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 }
rpcPointProducer_cfi.ExtrapolatedRegion
ExtrapolatedRegion
Definition: rpcPointProducer_cfi.py:15
RPCResidualsHLT_cfi.inclcsc
inclcsc
Definition: RPCResidualsHLT_cfi.py:8
electrons_cff.bool
bool
Definition: electrons_cff.py:366
funct::false
false
Definition: Factorize.h:29
RPCPointProducer::tracks
edm::EDGetTokenT< reco::TrackCollection > tracks
Definition: RPCPointProducer.h:31
edm::Handle::product
T const * product() const
Definition: Handle.h:70
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPCPointProducer::RPCPointProducer
RPCPointProducer(const edm::ParameterSet &)
Definition: RPCPointProducer.cc:28
edm::Handle< DTRecSegment4DCollection >
rpcPointProducer_cfi.incltrack
incltrack
Definition: rpcPointProducer_cfi.py:6
debug
#define debug
Definition: HDRShower.cc:19
RPCResidualsHLT_cfi.MaxD
MaxD
Definition: RPCResidualsHLT_cfi.py:18
funct::true
true
Definition: Factorize.h:173
RPCPointProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: RPCPointProducer.cc:57
edm::ParameterSet
Definition: ParameterSet.h:47
RPCPointProducer::incltrack
const bool incltrack
Definition: RPCPointProducer.h:39
RPCPointProducer::dtSegtoRPC
std::unique_ptr< DTSegtoRPC > dtSegtoRPC
Definition: RPCPointProducer.h:33
RPCPointProducer.h
RPCPointProducer::tracktoRPC
std::unique_ptr< TracktoRPC > tracktoRPC
Definition: RPCPointProducer.h:35
iEvent
int iEvent
Definition: GenABIO.cc:224
RPCPointProducer::ExtrapolatedRegion
const double ExtrapolatedRegion
Definition: RPCPointProducer.h:44
edm::EventSetup
Definition: EventSetup.h:58
RPCPointProducer::dt4DSegments
edm::EDGetTokenT< DTRecSegment4DCollection > dt4DSegments
Definition: RPCPointProducer.h:30
RPCPointProducer::cscSegments
edm::EDGetTokenT< CSCSegmentCollection > cscSegments
Definition: RPCPointProducer.h:29
RPCPointProducer::inclcsc
const bool inclcsc
Definition: RPCPointProducer.h:38
RPCResidualsHLT_cfi.MaxDrb4
MaxDrb4
Definition: RPCResidualsHLT_cfi.py:19
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RPCPointProducer::debug
const bool debug
Definition: RPCPointProducer.h:40
RPCPointProducer::incldt
const bool incldt
Definition: RPCPointProducer.h:37
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
RPCPointProducer::cscSegtoRPC
std::unique_ptr< CSCSegtoRPC > cscSegtoRPC
Definition: RPCPointProducer.h:34
RPCResidualsHLT_cfi.incldt
incldt
Definition: RPCResidualsHLT_cfi.py:6
edm::InputTag
Definition: InputTag.h:15
RPCResidualsHLT_cfi.MinCosAng
MinCosAng
Definition: RPCResidualsHLT_cfi.py:17