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 
35 public:
37  ~HLTScoutingTrackProducer() override;
38 
39  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
40 
41 private:
43  const final;
44 
46 
47 
48 };
49 
50 //
51 // constructors and destructor
52 //
55  (iConfig.getParameter<edm::InputTag>("OtherTracks")))
56 {
57  //register products
58  produces<ScoutingTrackCollection>();
59 }
60 
62 
63 // ------------ method called to produce the data ------------
65  edm::EventSetup const & setup) const
66 {
67  using namespace edm;
68 
69  std::unique_ptr<ScoutingTrackCollection> outTrack(new ScoutingTrackCollection());
70 
71  Handle<reco::TrackCollection> otherTrackCollection;
72 
73  if(iEvent.getByToken(otherTrackCollection_, otherTrackCollection)){
74  // Produce tracks in event
75  for (auto &trk : *otherTrackCollection) {
76  outTrack->emplace_back(trk.pt(), trk.eta(), trk.phi(),trk.chi2(), trk.ndof(),
77  trk.charge(), trk.dxy(), trk.dz(), trk.hitPattern().numberOfValidPixelHits(),
78  trk.hitPattern().trackerLayersWithMeasurement(), trk.hitPattern().numberOfValidStripHits(),
79  trk.qoverp(), trk.lambda(), trk.dxyError(), trk.dzError(),
80  trk.qoverpError(),
81  trk.lambdaError(),
82  trk.phiError(),
83  trk.dsz(),
84  trk.dszError()
85  );
86 
87  }
88  }
89 
90  iEvent.put(std::move(outTrack));
91 }
92 
93 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
96  desc.add<edm::InputTag>("OtherTracks", edm::InputTag("hltPixelTracksL3MuonNoVtx"));
97  descriptions.add("hltScoutingTrackProducer", desc);
98 }
99 
100 // declare this class as a framework plugin
const edm::EDGetTokenT< reco::TrackCollection > otherTrackCollection_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
std::vector< ScoutingTrack > ScoutingTrackCollection
Definition: ScoutingTrack.h:61
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:230
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
~HLTScoutingTrackProducer() override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTScoutingTrackProducer(const edm::ParameterSet &)
def move(src, dest)
Definition: eostools.py:510