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 
19 #include "RPCPointProducer.h"
23 
24 // system include files
25 
26 #include <memory>
27 #include <ctime>
28 
29 // user include files
30 
33  desc.add<bool>("incldt", true);
34  desc.add<bool>("inclcsc", true);
35  desc.add<bool>("incltrack", false);
36  desc.addUntracked<bool>("debug", false);
37  desc.add<double>("rangestrips", 4.);
38  desc.add<double>("rangestripsRB4", 4.);
39  desc.add<double>("MinCosAng", 0.85);
40  desc.add<double>("MaxD", 80.0);
41  desc.add<double>("MaxDrb4", 150.0);
42  desc.add<double>("ExtrapolatedRegion", 0.5);
43  desc.add<edm::InputTag>("cscSegments", edm::InputTag("hltCscSegments"));
44  desc.add<edm::InputTag>("dt4DSegments", edm::InputTag("hltDt4DSegments"));
45  desc.add<edm::InputTag>("tracks", edm::InputTag("standAloneMuons"));
46  desc.add<int>("minBX", -2);
47  desc.add<int>("maxBX", 2);
49  descNested.add<bool>("DoPredictionsOnly", false);
50  descNested.add<std::string>("Fitter", "KFFitterForRefitInsideOut");
51  descNested.add<std::string>("TrackerRecHitBuilder", "WithTrackAngle");
52  descNested.add<std::string>("Smoother", "KFSmootherForRefitInsideOut");
53  descNested.add<std::string>("MuonRecHitBuilder", "MuonRecHitBuilder");
54  descNested.add<std::string>("RefitDirection", "alongMomentum");
55  descNested.add<bool>("RefitRPCHits", false);
56  descNested.add<std::string>("Propagator", "SmartPropagatorAnyRKOpposite");
57  desc.add<edm::ParameterSetDescription>("TrackTransformer", descNested);
58 
59  descriptions.add("rpcPointProducer", desc);
60 }
61 
63  : incldt(iConfig.getParameter<bool>("incldt")),
64  inclcsc(iConfig.getParameter<bool>("inclcsc")),
65  incltrack(iConfig.getParameter<bool>("incltrack")),
66  debug(iConfig.getUntrackedParameter<bool>("debug")),
67  MinCosAng(iConfig.getParameter<double>("MinCosAng")),
68  MaxD(iConfig.getParameter<double>("MaxD")),
69  MaxDrb4(iConfig.getParameter<double>("MaxDrb4")),
70  ExtrapolatedRegion(iConfig.getParameter<double>("ExtrapolatedRegion")) {
71  if (incldt) {
72  dt4DSegments = consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("dt4DSegments"));
73  dtSegtoRPC = std::make_unique<DTSegtoRPC>(consumesCollector(), iConfig);
74  }
75  if (inclcsc) {
76  cscSegments = consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("cscSegments"));
77  cscSegtoRPC = std::make_unique<CSCSegtoRPC>(consumesCollector(), iConfig);
78  }
79  if (incltrack) {
80  tracks = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
81  tracktoRPC = std::make_unique<TracktoRPC>(iConfig.getParameter<edm::ParameterSet>("TrackTransformer"),
82  iConfig.getParameter<edm::InputTag>("tracks"),
83  consumesCollector());
84  }
85 
86  produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints");
87  produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints");
88  produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints");
89 }
90 
92  if (incldt) {
94  iEvent.getByToken(dt4DSegments, all4DSegments);
95  if (all4DSegments.isValid()) {
96  iEvent.put(dtSegtoRPC->thePoints(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion),
97  "RPCDTExtrapolatedPoints");
98  } else {
99  if (debug)
100  LogDebug("RPCPointProducer") << "RPCHLT Invalid DTSegments collection" << std::endl;
101  }
102  }
103 
104  if (inclcsc) {
105  edm::Handle<CSCSegmentCollection> allCSCSegments;
106  iEvent.getByToken(cscSegments, allCSCSegments);
107  if (allCSCSegments.isValid()) {
108  iEvent.put(cscSegtoRPC->thePoints(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion),
109  "RPCCSCExtrapolatedPoints");
110  } else {
111  if (debug)
112  LogDebug("RPCPointProducer") << "RPCHLT Invalid CSCSegments collection" << std::endl;
113  }
114  }
115  if (incltrack) {
117  iEvent.getByToken(tracks, alltracks);
118  if (!(alltracks->empty())) {
119  iEvent.put(tracktoRPC->thePoints(alltracks.product(), iSetup, debug), "RPCTrackExtrapolatedPoints");
120  } else {
121  if (debug)
122  LogDebug("RPCPointProducer") << "RPCHLT Invalid Tracks collection" << std::endl;
123  }
124  }
125 }
const double ExtrapolatedRegion
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< TracktoRPC > tracktoRPC
const bool incltrack
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< CSCSegmentCollection > cscSegments
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< DTRecSegment4DCollection > dt4DSegments
T const * product() const
Definition: Handle.h:70
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< CSCSegtoRPC > cscSegtoRPC
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define debug
Definition: HDRShower.cc:19
RPCPointProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > tracks
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool isValid() const
Definition: HandleBase.h:70
#define LogDebug(id)
std::unique_ptr< DTSegtoRPC > dtSegtoRPC