test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DuplicateListMerger.cc
Go to the documentation of this file.
7 
10 
12 
13 DuplicateListMerger::DuplicateListMerger(const edm::ParameterSet& iPara)
14 {
15  diffHitsCut_ = 9999;
16  minTrkProbCut_ = 0.0;
17  if(iPara.exists("diffHitsCut"))diffHitsCut_ = iPara.getParameter<int>("diffHitsCut");
18  if(iPara.exists("minTrkProbCut"))minTrkProbCut_ = iPara.getParameter<double>("minTrkProbCut");
19  if(iPara.exists("mergedSource")) mergedTrackSource_ = threeTokens(iPara.getParameter<edm::InputTag>("mergedSource"));
20  if(iPara.exists("originalSource"))originalTrackSource_ = threeTokens(iPara.getParameter<edm::InputTag>("originalSource"));
21  if(iPara.exists("candidateSource"))candidateSource_ = consumes<edm::View<DuplicateRecord> >(iPara.getParameter<edm::InputTag>("candidateSource"));
22 
23 
24  if(iPara.exists("mergedMVAVals")){
25  mergedMVAVals_ = iPara.getParameter<edm::InputTag>("mergedMVAVals");
26  }else{
28  }
29  mergedMVAValsToken_ = consumes<edm::ValueMap<float> >(mergedMVAVals_);
30  if(iPara.exists("originalMVAVals")){
31  originalMVAVals_ = iPara.getParameter<edm::InputTag>("originalMVAVals");
32  }else{
34  }
35  originalMVAValsToken_ = consumes<edm::ValueMap<float> >(originalMVAVals_);
36 
37  copyExtras_ = iPara.getUntrackedParameter<bool>("copyExtras",true);
39  if (iPara.exists("newQuality")) {
40  std::string qualityStr = iPara.getParameter<std::string>("newQuality");
41  if (qualityStr != "") {
42  qualityToSet_ = reco::TrackBase::qualityByName(qualityStr);
43  }
44  }
45 
46  produces<std::vector<reco::Track> >();
47  produces< std::vector<Trajectory> >();
48  produces< TrajTrackAssociationCollection >();
49 
50  produces<edm::ValueMap<float> >("MVAVals");
51 
52  makeReKeyedSeeds_ = iPara.getUntrackedParameter<bool>("makeReKeyedSeeds",false);
53  if (makeReKeyedSeeds_){
54  copyExtras_=true;
55  produces<TrajectorySeedCollection>();
56  }
57  if(copyExtras_){
58  produces<reco::TrackExtraCollection>();
59  produces<TrackingRecHitCollection>();
60  }
61 
62 }
63 
65 {
66 
67  /* no op */
68 
69 }
70 
72 {
74  iEvent.getByToken(originalTrackSource_.tk,originalHandle);
76  iEvent.getByToken(mergedTrackSource_.tk,mergedHandle);
77 
78  const reco::TrackCollection& mergedTracks(*mergedHandle);
79  reco::TrackRefProd originalTrackRefs(originalHandle);
80  reco::TrackRefProd mergedTrackRefs(mergedHandle);
81 
82  edm::Handle< std::vector<Trajectory> > mergedTrajHandle;
83  iEvent.getByToken(mergedTrackSource_.traj,mergedTrajHandle);
85  iEvent.getByToken(mergedTrackSource_.tass,mergedTrajTrackHandle);
86 
87  edm::Handle< std::vector<Trajectory> > originalTrajHandle;
88  iEvent.getByToken(originalTrackSource_.traj,originalTrajHandle);
89  edm::Handle< TrajTrackAssociationCollection > originalTrajTrackHandle;
90  iEvent.getByToken(originalTrackSource_.tass,originalTrajTrackHandle);
91 
93  iEvent.getByToken(candidateSource_,candidateHandle);
94 
95  std::auto_ptr<std::vector<reco::Track> > out_generalTracks(new std::vector<reco::Track>());
96  out_generalTracks->reserve(originalHandle->size());
98  std::auto_ptr< std::vector<Trajectory> > outputTrajs = std::auto_ptr< std::vector<Trajectory> >(new std::vector<Trajectory>());
99  outputTrajs->reserve(originalTrajHandle->size()+mergedTrajHandle->size());
101  std::auto_ptr< TrajTrackAssociationCollection > outputTTAss = std::auto_ptr< TrajTrackAssociationCollection >(new TrajTrackAssociationCollection());
102  //std::auto_ptr< TrajectorySeedCollection > outputSeeds
103 
104  std::auto_ptr<reco::TrackExtraCollection> outputTrkExtras;
105  reco::TrackExtraRefProd refTrkExtras;
106  std::auto_ptr<TrackingRecHitCollection> outputTrkHits;
107  TrackingRecHitRefProd refTrkHits;
108  std::auto_ptr<TrajectorySeedCollection> outputSeeds;
110 
111  const int rSize = (int)originalHandle->size();
112  edm::RefToBase<TrajectorySeed> seedsRefs[rSize];
113 
114  edm::Handle<edm::ValueMap<float> > originalMVAStore;
115  edm::Handle<edm::ValueMap<float> > mergedMVAStore;
116 
117  iEvent.getByToken(originalMVAValsToken_,originalMVAStore);
118  iEvent.getByToken(mergedMVAValsToken_,mergedMVAStore);
119 
120  std::auto_ptr<edm::ValueMap<float> > vmMVA = std::auto_ptr<edm::ValueMap<float> >(new edm::ValueMap<float>);
121  edm::ValueMap<float>::Filler fillerMVA(*vmMVA);
122  std::vector<float> mvaVec;
123 
124 
125  if(copyExtras_){
126  outputTrkExtras = std::auto_ptr<reco::TrackExtraCollection>(new reco::TrackExtraCollection);
127  outputTrkExtras->reserve(originalHandle->size());
128  refTrkExtras = iEvent.getRefBeforePut<reco::TrackExtraCollection>();
129  outputTrkHits = std::auto_ptr<TrackingRecHitCollection>(new TrackingRecHitCollection);
130  outputTrkHits->reserve(originalHandle->size()*25);
131  refTrkHits = iEvent.getRefBeforePut<TrackingRecHitCollection>();
132  if (makeReKeyedSeeds_){
133  outputSeeds = std::auto_ptr<TrajectorySeedCollection>(new TrajectorySeedCollection);
134  outputSeeds->reserve(originalHandle->size());
135  refTrajSeeds = iEvent.getRefBeforePut<TrajectorySeedCollection>();
136  }
137  }
138 
139  //match new tracks to their candidates
140  std::vector<std::pair<int,const DuplicateRecord*> > matches;
141  for(int i = 0; i < (int)candidateHandle->size(); i++){
142  const DuplicateRecord& duplicateRecord = candidateHandle->at(i);
143  int matchTrack = matchCandidateToTrack(duplicateRecord.first,mergedHandle);
144  if(matchTrack < 0)continue;
145  const reco::Track& matchedTrack(mergedTracks[matchTrack]);
146  if( ChiSquaredProbability(matchedTrack.chi2(),matchedTrack.ndof()) < minTrkProbCut_)continue;
147  unsigned int dHits = (duplicateRecord.first.recHits().second - duplicateRecord.first.recHits().first) - matchedTrack.recHitsSize();
148  if(dHits > diffHitsCut_)continue;
149  matches.push_back(std::pair<int,const DuplicateRecord*>(matchTrack,&duplicateRecord));
150  }
151 
152  //check for candidates/tracks that share merged tracks, select minimum chi2, remove the rest
153  std::vector<std::pair<int,const DuplicateRecord*> >::iterator matchIter0 = matches.begin();
154  std::vector<std::pair<int,const DuplicateRecord*> >::iterator matchIter1;
155  while(matchIter0 != matches.end()){
156  double nchi2 = mergedTracks[matchIter0->first].normalizedChi2();
157  bool advance = true;
158  for(matchIter1 = matchIter0+1; matchIter1 != matches.end(); matchIter1++){
159  const reco::Track& match0first = *(matchIter0->second->second.first.get());
160  const reco::Track& match0second = *(matchIter0->second->second.second.get());
161  const reco::Track& match1first = *(matchIter1->second->second.first.get());
162  const reco::Track& match1second = *(matchIter1->second->second.second.get());
163  if(match1first.seedRef() == match0first.seedRef() ||
164  match1first.seedRef() == match0second.seedRef() ||
165  match1second.seedRef() == match0first.seedRef() ||
166  match1second.seedRef() == match0second.seedRef()){
167  double nchi2_1 = mergedTracks[matchIter1->first].normalizedChi2();
168  advance = false;
169  if(nchi2_1 < nchi2){
170  matches.erase(matchIter0);
171  }else{
172  matches.erase(matchIter1);
173  }
174  break;
175  }
176  }
177  if(advance)matchIter0++;
178  }
179 
180  //add the good merged tracks to the output list, remove input tracks
181  std::vector<reco::Track> inputTracks;
182 
183  refTrajs = iEvent.getRefBeforePut< std::vector<Trajectory> >();
184 
185  for(matchIter0 = matches.begin(); matchIter0 != matches.end(); matchIter0++){
186  reco::TrackRef inTrkRef1 = matchIter0->second->second.first;
187  reco::TrackRef inTrkRef2 = matchIter0->second->second.second;
188  const reco::Track& inTrk1 = *(inTrkRef1.get());
189  const reco::Track& inTrk2 = *(inTrkRef2.get());
190  reco::TrackBase::TrackAlgorithm newTrkAlgo = std::min(inTrk1.algo(),inTrk2.algo());
191  int combinedQualityMask = (inTrk1.qualityMask() | inTrk2.qualityMask());
192  inputTracks.push_back(inTrk1);
193  inputTracks.push_back(inTrk2);
194  out_generalTracks->push_back(mergedTracks[matchIter0->first]);
195  reco::TrackRef curTrackRef = reco::TrackRef(refTrks, out_generalTracks->size() - 1);
196  float mergedMVA = (*mergedMVAStore)[reco::TrackRef(mergedTrackRefs,matchIter0->first)];
197  mvaVec.push_back(mergedMVA);
198  out_generalTracks->back().setAlgorithm(newTrkAlgo);
199  out_generalTracks->back().setQualityMask(combinedQualityMask);
200  out_generalTracks->back().setQuality(qualityToSet_);
201  edm::RefToBase<TrajectorySeed> origSeedRef;
202  if(copyExtras_){
203  const reco::Track& track = mergedTracks[matchIter0->first];
204  origSeedRef = track.seedRef();
205  //creating a seed with rekeyed clusters if required
206  if (makeReKeyedSeeds_){
207  bool doRekeyOnThisSeed=false;
208 
209  edm::InputTag clusterRemovalInfos("");
210  //grab on of the hits of the seed
211  if (origSeedRef->nHits()!=0){
212  TrajectorySeed::const_iterator firstHit=origSeedRef->recHits().first;
213  const TrackingRecHit *hit = &*firstHit;
214  if (firstHit->isValid()){
216  // the cluster collection either produced a removalInfo or mot
217  //get the clusterremoval info from the provenance: will rekey if this is found
219  edm::Provenance prov=iEvent.getProvenance(pID);
220  clusterRemovalInfos=edm::InputTag(prov.moduleLabel(),
221  prov.productInstanceName(),
222  prov.processName());
223  doRekeyOnThisSeed=iEvent.getByLabel(clusterRemovalInfos,CRIh);
224  }//valid hit
225  }//nhit!=0
226 
227  if (doRekeyOnThisSeed && !(clusterRemovalInfos==edm::InputTag(""))) {
228  ClusterRemovalRefSetter refSetter(iEvent,clusterRemovalInfos);
229  TrajectorySeed::recHitContainer newRecHitContainer;
230  newRecHitContainer.reserve(origSeedRef->nHits());
231  TrajectorySeed::const_iterator iH=origSeedRef->recHits().first;
232  TrajectorySeed::const_iterator iH_end=origSeedRef->recHits().second;
233  for (;iH!=iH_end;++iH){
234  newRecHitContainer.push_back(*iH);
235  refSetter.reKey(&newRecHitContainer.back());
236  }
237  outputSeeds->push_back( TrajectorySeed( origSeedRef->startingState(),
238  newRecHitContainer,
239  origSeedRef->direction()));
240  }
241  //doRekeyOnThisSeed=true
242  else{
243  //just copy the one we had before
244  outputSeeds->push_back( TrajectorySeed(*origSeedRef));
245  }
246  edm::Ref<TrajectorySeedCollection> pureRef(refTrajSeeds, outputSeeds->size()-1);
247  origSeedRef=edm::RefToBase<TrajectorySeed>( pureRef);
248  }//creating a new seed and rekeying it rechit clusters.
249  // Fill TrackExtra collection
250  outputTrkExtras->push_back( reco::TrackExtra(
251  track.outerPosition(), track.outerMomentum(), track.outerOk(),
252  track.innerPosition(), track.innerMomentum(), track.innerOk(),
253  track.outerStateCovariance(), track.outerDetId(),
254  track.innerStateCovariance(), track.innerDetId(),
255  track.seedDirection(), origSeedRef ) );
256  seedsRefs[(*matchIter0).first]=origSeedRef;
257  out_generalTracks->back().setExtra( reco::TrackExtraRef( refTrkExtras, outputTrkExtras->size() - 1) );
258  reco::TrackExtra & tx = outputTrkExtras->back();
259  tx.setResiduals(track.residuals());
260  // fill TrackingRecHits
261  unsigned nh1=track.recHitsSize();
262  for ( unsigned ih=0; ih<nh1; ++ih ) {
263  //const TrackingRecHit*hit=&((*(track->recHit(ih))));
264  outputTrkHits->push_back( track.recHit(ih)->clone() );
265  tx.add( TrackingRecHitRef( refTrkHits, outputTrkHits->size() - 1) );
266  }
267  }
268  edm::Ref< std::vector<Trajectory> > trajRef(mergedTrajHandle, (*matchIter0).first);
269  TrajTrackAssociationCollection::const_iterator match = mergedTrajTrackHandle->find(trajRef);
270  if (match != mergedTrajTrackHandle->end()) {
271  if(curTrackRef.isNonnull()){
272  outputTrajs->push_back( *trajRef );
274  outputTrajs->back().setSeedRef( origSeedRef );
275  outputTTAss->insert(edm::Ref< std::vector<Trajectory> >(refTrajs, outputTrajs->size() - 1),curTrackRef );
276  }
277  }
278  }
279 
280  for(int i = 0; i < (int)originalHandle->size(); i++){
281  bool good = true;
282  const reco::Track& origTrack = originalHandle->at(i);
283  for(int j = 0; j < (int)inputTracks.size() && good; j++){
284  const reco::Track& inputTrack = inputTracks[j];
285  if(origTrack.seedRef() != inputTrack.seedRef())continue;
286  if(origTrack.charge() != inputTrack.charge())continue;
287  if(origTrack.momentum() != inputTrack.momentum())continue;
288  if(origTrack.referencePoint() != inputTrack.referencePoint())continue;
289  good = false;
290  }
291 
292  if(good){
293  out_generalTracks->push_back(origTrack);
294  reco::TrackRef curTrackRef = reco::TrackRef(refTrks, out_generalTracks->size() - 1);
295  edm::RefToBase<TrajectorySeed> origSeedRef;
296  reco::TrackRef origTrackRef = reco::TrackRef(originalHandle,i);
297  mvaVec.push_back((*originalMVAStore)[origTrackRef]);
298  //mvaVec.push_back((*originalMVAStore)[reco::TrackRef(originalTrackRefs,i)]);
299  if(copyExtras_){
300  const reco::Track& track = origTrack;
301  origSeedRef = track.seedRef();
302  //creating a seed with rekeyed clusters if required
303  if (makeReKeyedSeeds_){
304  bool doRekeyOnThisSeed=false;
305 
306  edm::InputTag clusterRemovalInfos("");
307  //grab on of the hits of the seed
308  if (origSeedRef->nHits()!=0){
309  TrajectorySeed::const_iterator firstHit=origSeedRef->recHits().first;
310  const TrackingRecHit *hit = &*firstHit;
311  if (firstHit->isValid()){
313  // the cluster collection either produced a removalInfo or mot
314  //get the clusterremoval info from the provenance: will rekey if this is found
316  edm::Provenance prov=iEvent.getProvenance(pID);
317  clusterRemovalInfos=edm::InputTag(prov.moduleLabel(),
318  prov.productInstanceName(),
319  prov.processName());
320  doRekeyOnThisSeed=iEvent.getByLabel(clusterRemovalInfos,CRIh);
321  }//valid hit
322  }//nhit!=0
323 
324  if (doRekeyOnThisSeed && !(clusterRemovalInfos==edm::InputTag(""))) {
325  ClusterRemovalRefSetter refSetter(iEvent,clusterRemovalInfos);
326  TrajectorySeed::recHitContainer newRecHitContainer;
327  newRecHitContainer.reserve(origSeedRef->nHits());
328  TrajectorySeed::const_iterator iH=origSeedRef->recHits().first;
329  TrajectorySeed::const_iterator iH_end=origSeedRef->recHits().second;
330  for (;iH!=iH_end;++iH){
331  newRecHitContainer.push_back(*iH);
332  refSetter.reKey(&newRecHitContainer.back());
333  }
334  outputSeeds->push_back( TrajectorySeed( origSeedRef->startingState(),
335  newRecHitContainer,
336  origSeedRef->direction()));
337  }
338  //doRekeyOnThisSeed=true
339  else{
340  //just copy the one we had before
341  outputSeeds->push_back( TrajectorySeed(*origSeedRef));
342  }
343  edm::Ref<TrajectorySeedCollection> pureRef(refTrajSeeds, outputSeeds->size()-1);
344  origSeedRef=edm::RefToBase<TrajectorySeed>( pureRef);
345  }//creating a new seed and rekeying it rechit clusters.
346 
347  // Fill TrackExtra collection
348  outputTrkExtras->push_back( reco::TrackExtra(
349  track.outerPosition(), track.outerMomentum(), track.outerOk(),
350  track.innerPosition(), track.innerMomentum(), track.innerOk(),
351  track.outerStateCovariance(), track.outerDetId(),
352  track.innerStateCovariance(), track.innerDetId(),
353  track.seedDirection(), origSeedRef ) );
354  seedsRefs[i]=origSeedRef;
355  out_generalTracks->back().setExtra( reco::TrackExtraRef( refTrkExtras, outputTrkExtras->size() - 1) );
356  reco::TrackExtra & tx = outputTrkExtras->back();
357  tx.setResiduals(track.residuals());
358 
359  // fill TrackingRecHits
360  unsigned nh1=track.recHitsSize();
361  for ( unsigned ih=0; ih<nh1; ++ih ) {
362  //const TrackingRecHit*hit=&((*(track->recHit(ih))));
363  outputTrkHits->push_back( track.recHit(ih)->clone() );
364  tx.add( TrackingRecHitRef( refTrkHits, outputTrkHits->size() - 1) );
365  }
366 
367  }
368 
369  edm::Ref< std::vector<Trajectory> > trajRef(originalTrajHandle, i);
370  TrajTrackAssociationCollection::const_iterator match = originalTrajTrackHandle->find(trajRef);
371  if (match != originalTrajTrackHandle->end()) {
372  if(curTrackRef.isNonnull()){
373  outputTrajs->push_back( *trajRef );
375  outputTrajs->back().setSeedRef( origSeedRef );
376  outputTTAss->insert(edm::Ref< std::vector<Trajectory> >(refTrajs, outputTrajs->size() - 1),curTrackRef );
377  }
378  }
379  }
380  }
381 
382  edm::ProductID nPID = refTrks.id();
383  edm::TestHandle<TrackCollection> out_gtHandle(out_generalTracks.get(),nPID);
384 
385  fillerMVA.insert(out_gtHandle,mvaVec.begin(),mvaVec.end());
386  fillerMVA.fill();
387 
388  iEvent.put(vmMVA,"MVAVals");
389  iEvent.put(out_generalTracks);
390  if (copyExtras_) {
391  iEvent.put(outputTrkExtras);
392  iEvent.put(outputTrkHits);
393  if (makeReKeyedSeeds_)
394  iEvent.put(outputSeeds);
395  }
396  iEvent.put(outputTrajs);
397  iEvent.put(outputTTAss);
398 }
399 
400 //------------------------------------------------------------
401 //------------------------------------------------------------
402 //------------------------------------------------------------
403 //------------------------------------------------------------
405  int track = -1;
406  std::vector<int> rawIds;
407  RecHitContainer::const_iterator candBegin = candidate.recHits().first;
408  RecHitContainer::const_iterator candEnd = candidate.recHits().second;
409  for(; candBegin != candEnd; candBegin++){
410  rawIds.push_back((*(candBegin)).rawId());
411  }
412 
413 
414  for(int i = 0; i < (int)tracks->size() && track < 0;i++){
415  if((tracks->at(i)).seedRef() != candidate.seedRef())continue;
416  int match = 0;
417  trackingRecHit_iterator trackRecBegin = tracks->at(i).recHitsBegin();
418  trackingRecHit_iterator trackRecEnd = tracks->at(i).recHitsEnd();
419  for(;trackRecBegin != trackRecEnd; trackRecBegin++){
420  if(std::find(rawIds.begin(),rawIds.end(),(*(trackRecBegin)).get()->rawId()) != rawIds.end())match++;
421  }
422  if(match != (int)tracks->at(i).recHitsSize())continue;
423  track = i;
424  }
425 
426  return track;
427 }
428 //------------------------------------------------------------
429 //------------------------------------------------------------
430 //------------------------------------------------------------
431 //------------------------------------------------------------
PropagationDirection direction() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
reference back()
Definition: OwnVector.h:321
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:148
edm::EDGetTokenT< edm::View< DuplicateRecord > > candidateSource_
range recHits() const
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:109
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:69
edm::EDGetTokenT< edm::ValueMap< float > > originalMVAValsToken_
void reKey(TrackingRecHit *hit) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
bool exists(std::string const &parameterName) const
checks if a parameter exists
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:40
ThreeTokens threeTokens(const edm::InputTag &tag)
std::string const & processName() const
Definition: Provenance.h:61
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:47
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:151
TrackAlgorithm
track algorithm
Definition: TrackBase.h:80
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
TrackAlgorithm algo() const
Definition: TrackBase.h:330
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
void push_back(D *&d)
Definition: OwnVector.h:274
int iEvent
Definition: GenABIO.cc:230
std::vector< TrajectorySeed > TrajectorySeedCollection
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:105
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
int matchCandidateToTrack(TrackCandidate, edm::Handle< reco::TrackCollection >)
recHitContainer::const_iterator const_iterator
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:107
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
edm::EDGetTokenT< std::vector< Trajectory > > traj
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:51
int qualityMask() const
Definition: TrackBase.h:284
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:59
int j
Definition: DBlmapReader.cc:9
float ChiSquaredProbability(double chiSquared, double nrDOF)
T min(T a, T b)
Definition: MathUtil.h:58
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
void produce(edm::Event &, const edm::EventSetup &) override
produce one event
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
RefProd< PROD > getRefBeforePut()
Definition: Event.h:128
edm::ProductID clusterProductB(const TrackingRecHit *hit)
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
edm::RefToBase< TrajectorySeed > seedRef() const
Definition: Track.h:112
PTrajectoryStateOnDet const & startingState() const
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
edm::EDGetTokenT< edm::ValueMap< float > > mergedMVAValsToken_
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:49
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:38
tuple tracks
Definition: testEve_cfg.py:39
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:53
edm::EDGetTokenT< TrajTrackAssociationCollection > tass
range recHits() const
void add(const TrackingRecHitRef &r)
add a reference to a RecHit
std::string const & moduleLabel() const
Definition: Provenance.h:60
edm::EDGetTokenT< reco::TrackCollection > tk
std::string const & label() const
Definition: InputTag.h:42
unsigned int nHits() const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:67
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:140
const TrackResiduals & residuals() const
Definition: Track.h:117
PropagationDirection seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:105
int charge() const
track electric charge
Definition: TrackBase.h:111
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
std::string const & productInstanceName() const
Definition: Provenance.h:62
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
Provenance getProvenance(BranchID const &theID) const
Definition: Event.cc:76
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:61
std::pair< TrackCandidate, std::pair< reco::TrackRef, reco::TrackRef > > DuplicateRecord
typedef container of candidate and input tracks
edm::RefToBase< TrajectorySeed > seedRef() const
void reserve(size_t)
Definition: OwnVector.h:268
reco::TrackBase::TrackQuality qualityToSet_
void setResiduals(const TrackResiduals &r)
set the residuals
Definition: TrackExtra.h:131