CMS 3D CMS Logo

ExtraFromSeeds.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ExtraFromSeeds
4 // Class: ExtraFromSeeds
5 //
13 //
14 // Original Author: Jean-Roch Vlimant,40 3-A28,+41227671209,
15 // Created: Fri Feb 17 12:03:11 CET 2012
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
23 
24 //
25 // constructors and destructor
26 //
28  : tracks_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"))) {
29  produces<ExtremeLight>();
30  produces<TrackingRecHitCollection>();
31 }
32 
34  // do anything here that needs to be done at desctruction time
35  // (e.g. close files, deallocate resources etc.)
36 }
37 
38 //
39 // member functions
40 //
41 
42 // ------------ method called to produce the data ------------
44  // in
46  iEvent.getByToken(tracks_, tracks);
47 
48  // out
49  std::unique_ptr<ExtremeLight> exxtralOut(new ExtremeLight());
50  exxtralOut->resize(tracks->size());
51 
52  std::unique_ptr<TrackingRecHitCollection> hitOut(new TrackingRecHitCollection());
53  TrackingRecHitRefProd rHits = iEvent.getRefBeforePut<TrackingRecHitCollection>();
54  hitOut->reserve(3 * tracks->size());
55 
56  for (unsigned int ie = 0; ie != tracks->size(); ++ie) {
57  const reco::Track& track = (*tracks)[ie];
58  const reco::TrackExtra& extra = *track.extra();
59  //only for high purity tracks
60  if (!track.quality(reco::TrackBase::highPurity))
61  continue;
62 
63  (*exxtralOut)[ie] = extra.seedRef()->nHits();
64  for (auto const& seedHit : extra.seedRef()->recHits()) {
65  hitOut->push_back(seedHit.clone());
66  }
67  }
68 
69  iEvent.put(std::move(exxtralOut));
70  iEvent.put(std::move(hitOut));
71 }
72 
73 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
75  //The following says we do not know what parameters are allowed so do no validation
76  // Please change this to state exactly what you do use, even if it is no parameters
78  desc.setUnknown();
79  descriptions.addDefault(desc);
80 }
edm::RefProd< TrackingRecHitCollection >
edm::StreamID
Definition: StreamID.h:30
ExtraFromSeeds.h
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ExtraFromSeeds::ExtremeLight
std::vector< unsigned int > ExtremeLight
Definition: ExtraFromSeeds.h:54
ExtraFromSeeds::~ExtraFromSeeds
~ExtraFromSeeds() override
Definition: ExtraFromSeeds.cc:33
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::Handle< reco::TrackCollection >
reco::TrackExtra
Definition: TrackExtra.h:26
reco::Track
Definition: Track.h:27
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::OwnVector::reserve
void reserve(size_t)
Definition: OwnVector.h:320
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
ExtraFromSeeds::tracks_
edm::EDGetTokenT< reco::TrackCollection > tracks_
Definition: ExtraFromSeeds.h:53
ExtraFromSeeds::ExtraFromSeeds
ExtraFromSeeds(const edm::ParameterSet &)
Definition: ExtraFromSeeds.cc:27
ExtraFromSeeds::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: ExtraFromSeeds.cc:43
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
TrajectorySeed::recHits
RecHitRange recHits() const
Definition: TrajectorySeed.h:52
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
TrackingRecHitCollection
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
Definition: TrackingRecHitFwd.h:10
ExtraFromSeeds::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: ExtraFromSeeds.cc:74
reco::TrackExtra::seedRef
const edm::RefToBase< TrajectorySeed > & seedRef() const
Definition: TrackExtra.h:129
edm::Event
Definition: Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::OwnVector< TrackingRecHit >
reco::TrackBase::highPurity
Definition: TrackBase.h:154