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  TrajectorySeed::range seedRange = extra.seedRef()->recHits();
65  (*exxtralOut)[ie] = extra.seedRef()->nHits();
66  for (seedHit = seedRange.first; seedHit != seedRange.second; ++seedHit) {
67  TrackingRecHit* hit = seedHit->clone();
68  hitOut->push_back(hit);
69  }
70  }
71 
72  iEvent.put(std::move(exxtralOut));
73  iEvent.put(std::move(hitOut));
74 }
75 
76 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
78  //The following says we do not know what parameters are allowed so do no validation
79  // Please change this to state exactly what you do use, even if it is no parameters
81  desc.setUnknown();
82  descriptions.addDefault(desc);
83 }
edm::RefProd< TrackingRecHitCollection >
edm::StreamID
Definition: StreamID.h:30
ExtraFromSeeds.h
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
TrajectorySeed::range
std::pair< const_iterator, const_iterator > range
Definition: TrajectorySeed.h:21
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ExtraFromSeeds::ExtremeLight
std::vector< unsigned int > ExtremeLight
Definition: ExtraFromSeeds.h:54
TrajectorySeed::const_iterator
recHitContainer::const_iterator const_iterator
Definition: TrajectorySeed.h:20
ExtraFromSeeds::~ExtraFromSeeds
~ExtraFromSeeds() override
Definition: ExtraFromSeeds.cc:33
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
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
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
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::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::EventSetup
Definition: EventSetup.h:57
TrackingRecHit
Definition: TrackingRecHit.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
TrackingRecHitCollection
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
Definition: TrackingRecHitFwd.h:10
TrajectorySeed::recHits
range recHits() const
Definition: TrajectorySeed.h:52
ExtraFromSeeds::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: ExtraFromSeeds.cc:77
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
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
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
reco::TrackBase::highPurity
Definition: TrackBase.h:154