CMS 3D CMS Logo

HLTScoutingTrackProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTrigger/Muon
4 // Class: HLTScoutingTrackProducer
5 //
9 //
10 
11 #include <memory>
32 
34 public:
36  ~HLTScoutingTrackProducer() override;
37 
38  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
39 
40 private:
41  void produce(edm::StreamID sid, edm::Event& iEvent, edm::EventSetup const& setup) const final;
42 
44 };
45 
46 //
47 // constructors and destructor
48 //
50  : otherTrackCollection_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("OtherTracks"))) {
51  //register products
52  produces<ScoutingTrackCollection>();
53 }
54 
56 
57 // ------------ method called to produce the data ------------
59  using namespace edm;
60 
61  std::unique_ptr<ScoutingTrackCollection> outTrack(new ScoutingTrackCollection());
62 
63  Handle<reco::TrackCollection> otherTrackCollection;
64 
65  if (iEvent.getByToken(otherTrackCollection_, otherTrackCollection)) {
66  // Produce tracks in event
67  for (auto& trk : *otherTrackCollection) {
68  outTrack->emplace_back(trk.pt(),
69  trk.eta(),
70  trk.phi(),
71  trk.chi2(),
72  trk.ndof(),
73  trk.charge(),
74  trk.dxy(),
75  trk.dz(),
76  trk.hitPattern().numberOfValidPixelHits(),
77  trk.hitPattern().trackerLayersWithMeasurement(),
78  trk.hitPattern().numberOfValidStripHits(),
79  trk.qoverp(),
80  trk.lambda(),
81  trk.dxyError(),
82  trk.dzError(),
83  trk.qoverpError(),
84  trk.lambdaError(),
85  trk.phiError(),
86  trk.dsz(),
87  trk.dszError());
88  }
89  }
90 
91  iEvent.put(std::move(outTrack));
92 }
93 
94 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
97  desc.add<edm::InputTag>("OtherTracks", edm::InputTag("hltPixelTracksL3MuonNoVtx"));
98  descriptions.add("hltScoutingTrackProducer", desc);
99 }
100 
101 // declare this class as a framework plugin
edm::StreamID
Definition: StreamID.h:30
HLTScoutingTrackProducer::otherTrackCollection_
const edm::EDGetTokenT< reco::TrackCollection > otherTrackCollection_
Definition: HLTScoutingTrackProducer.cc:43
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::EDGetTokenT< reco::TrackCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
AssociationMap.h
ScoutingTrackCollection
std::vector< ScoutingTrack > ScoutingTrackCollection
Definition: ScoutingTrack.h:118
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTScoutingTrackProducer::HLTScoutingTrackProducer
HLTScoutingTrackProducer(const edm::ParameterSet &)
Definition: HLTScoutingTrackProducer.cc:49
getRef.h
HLTScoutingTrackProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTScoutingTrackProducer.cc:95
HLTScoutingTrackProducer::produce
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
Definition: HLTScoutingTrackProducer.cc:58
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle< reco::TrackCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
MakerMacros.h
ScoutingMuon.h
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ScoutingVertex.h
MuonFwd.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
Vertex.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
HLTScoutingTrackProducer
Definition: HLTScoutingTrackProducer.cc:33
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
HitPattern.h
ValueMap.h
VertexFwd.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
RecoChargedCandidate.h
Frameworkfwd.h
ScoutingTrack.h
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
RecoChargedCandidateFwd.h
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
HLTScoutingTrackProducer::~HLTScoutingTrackProducer
~HLTScoutingTrackProducer() override