CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockAlgo.cc
Go to the documentation of this file.
7 
9 
10 #include <stdexcept>
11 #include "TMath.h"
12 
13 using namespace std;
14 using namespace reco;
15 
16 //for debug only
17 //#define PFLOW_DEBUG
18 
20 
22  blocks_( new reco::PFBlockCollection ),
23  DPtovPtCut_(std::vector<double>(4,static_cast<double>(999.))),
24  NHitCut_(std::vector<unsigned int>(4,static_cast<unsigned>(0))),
25  useIterTracking_(true),
26  photonSelector_(0),
27  debug_(false) {}
28 
29 
30 
31 void PFBlockAlgo::setParameters( std::vector<double>& DPtovPtCut,
32  std::vector<unsigned int>& NHitCut,
33  bool useConvBremPFRecTracks,
34  bool useIterTracking,
35  int nuclearInteractionsPurity,
36  bool useEGPhotons,
37  std::vector<double>& photonSelectionCuts) {
38 
39  DPtovPtCut_ = DPtovPtCut;
40  NHitCut_ = NHitCut;
41  useIterTracking_ = useIterTracking;
42  useConvBremPFRecTracks_ = useConvBremPFRecTracks;
43  nuclearInteractionsPurity_ = nuclearInteractionsPurity;
44  useEGPhotons_ = useEGPhotons;
45  // Pt cut; Track iso (constant + slope), Ecal iso (constant + slope), HCAL iso (constant+slope), H/E
46  if(useEGPhotons_)
47  photonSelector_ = new PhotonSelectorAlgo(photonSelectionCuts[0],
48  photonSelectionCuts[1], photonSelectionCuts[2],
49  photonSelectionCuts[3], photonSelectionCuts[4],
50  photonSelectionCuts[5], photonSelectionCuts[6],
51  photonSelectionCuts[7]);
52 }
53 
55 
56 #ifdef PFLOW_DEBUG
57  if(debug_)
58  cout<<"~PFBlockAlgo - number of remaining elements: "
59  <<elements_.size()<<endl;
60 #endif
61 
63 }
64 
65 void
67 
68  // cout<<"findBlocks : "<<blocks_.get()<<endl;
69 
70  // the blocks have not been passed to the event, and need to be cleared
71  if(blocks_.get() )blocks_->clear();
72  else
73  blocks_.reset( new reco::PFBlockCollection );
74 
75  blocks_->reserve(elements_.size());
76  for(IE ie = elements_.begin();
77  ie != elements_.end();) {
78 
79 #ifdef PFLOW_DEBUG
80  if(debug_) {
81  cout<<" PFBlockAlgo::findBlocks() ----------------------"<<endl;
82  cout<<" element "<<**ie<<endl;
83  cout<<" creating new block"<<endl;
84  }
85 #endif
86 
87  blocks_->push_back( PFBlock() );
88 
89  vector< PFBlockLink > links;
90 
91  // list< IE > used;
92  ie = associate( elements_.end() , ie, links );
93 
94  // build remaining links in current block
95  packLinks( blocks_->back(), links );
96  }
97 }
98 
99 
100 
101 
104  IE next,
105  vector<PFBlockLink>& links ) {
106 
107 
108 #ifdef PFLOW_DEBUG
109  if(debug_ ) cout<<"PFBlockAlgo::associate start ----"<<endl;
110 #endif
111 
112  if( last!= elements_.end() ) {
114  double dist = -1;
115  PFBlock::LinkTest linktest = PFBlock::LINKTEST_RECHIT;
116  link( *last, *next, linktype, linktest, dist );
117 
118 
119  if(dist<-0.5) {
120 #ifdef PFLOW_DEBUG
121  if(debug_ ) cout<<"link failed"<<endl;
122 #endif
123  return ++next; // association failed
124  }
125  else {
126  // add next element to the current pflowblock
127  blocks_->back().addElement( *next );
128 
129  // (*next)->setIndex( blocks_->back()->indexToLastElement() );
130 
131  // this is not necessary?
132  // next->setPFBlock(this);
133 
134  // create a link between next and last
135  links.push_back( PFBlockLink(linktype,
136  linktest,
137  dist,
138  (*last)->index(),
139  (*next)->index() ) );
140  // not necessary ?
141  // next->connect( links_.size()-1 );
142  // last->connect( links_.size()-1 );
143  }
144  }
145  else {
146  // add next element to this eflowblock
147 #ifdef PFLOW_DEBUG
148  if(debug_ ) cout<<"adding to block element "<<(**next)<<endl;
149 #endif
150  blocks_->back().addElement( *next );
151  // (*next)->setIndex( blocks_->back()->indexToLastElement() );
152  // next->setPFBlock(this);
153  }
154 
155  // recursive call: associate next and other unused elements
156 
157  // IE afterNext = next;
158  // ++afterNext;
159  // cout<<"last "<<**last<<" next "<<**next<<endl;
160 
161  for(IE ie = elements_.begin();
162  ie != elements_.end();) {
163 
164  if( ie == last || ie == next ) {
165  ++ie;
166  continue;
167  }
168 
169  // *ie already included to a block
170  if( (*ie)->locked() ) {
171 #ifdef PFLOW_DEBUG
172  if(debug_ ) cout<<"element "<<(**ie)<<"already used"<<endl;
173 #endif
174  ++ie;
175  continue;
176  }
177 
178 
179 #ifdef PFLOW_DEBUG
180  if(debug_ ) cout<<"calling associate "<<(**next)<<" & "<<(**ie)<<endl;
181 #endif
182  ie = associate(next, ie, links);
183  }
184 
185 #ifdef PFLOW_DEBUG
186  if(debug_ ) {
187  cout<<"**** deleting element "<<endl;
188  cout<<**next<<endl;
189  }
190 #endif
191  delete *next;
192 
193 #ifdef PFLOW_DEBUG
194  if(debug_ ) {
195  cout<<"**** removing element "<<endl;
196  }
197 #endif
198 
199  IE iteratorToNextFreeElement = elements_.erase( next );
200 
201 #ifdef PFLOW_DEBUG
202  if(debug_ ) cout<<"PFBlockAlgo::associate stop ----"<<endl;
203 #endif
204 
205  return iteratorToNextFreeElement;
206 }
207 
208 
209 
210 void
212  const vector<PFBlockLink>& links ) const {
213 
214 
216 
217  block.bookLinkData();
218 
219  //First Loop: update all link data
220  for( unsigned i1=0; i1<els.size(); i1++ ) {
221  for( unsigned i2=0; i2<els.size(); i2++ ) {
222 
223  // no reflexive link
224  if( i1==i2 ) continue;
225 
226  double dist = -1;
227 
228  bool linked = false;
229  PFBlock::LinkTest linktest
230  = PFBlock::LINKTEST_RECHIT;
231 
232  // are these elements already linked ?
233  // this can be optimized
234 
235  for( unsigned il=0; il<links.size(); il++ ) {
236  if( (links[il].element1() == i1 &&
237  links[il].element2() == i2) ||
238  (links[il].element1() == i2 &&
239  links[il].element2() == i1) ) { // yes
240 
241  dist = links[il].dist();
242  linked = true;
243 
244  //modif-beg
245  //retrieve type of test used to get distance
246  linktest = links[il].test();
247 #ifdef PFLOW_DEBUG
248  if( debug_ )
249  cout << "Reading link vector: linktest used="
250  << linktest
251  << " distance = " << dist
252  << endl;
253 #endif
254  //modif-end
255 
256  break;
257  }
258  }
259 
260  if(!linked) {
262  link( & els[i1], & els[i2], linktype, linktest, dist);
263  }
264 
265  //loading link data according to link test used: RECHIT
266  //block.setLink( i1, i2, chi2, block.linkData() );
267 #ifdef PFLOW_DEBUG
268  if( debug_ )
269  cout << "Setting link between elements " << i1 << " and " << i2
270  << " of dist =" << dist << " computed from link test "
271  << linktest << endl;
272 #endif
273  block.setLink( i1, i2, dist, block.linkData(), linktest );
274  }
275  }
276 
277  // Do not cut the link between the primary track and the clusters. It would be analysed in the PFCandConnector.cc
278  // checkDisplacedVertexLinks( block );
279 }
280 
281 
282 
283 void
285  // loop on all blocks and create a big graph
286 }
287 
288 
289 
290 void
292  const reco::PFBlockElement* el2,
293  PFBlockLink::Type& linktype,
294  reco::PFBlock::LinkTest& linktest,
295  double& dist) const {
296 
297 
298 
299  dist=-1.;
300  linktest = PFBlock::LINKTEST_RECHIT; //rechit by default
301 
302  PFBlockElement::Type type1 = el1->type();
303  PFBlockElement::Type type2 = el2->type();
304 
305  if( type1==type2 ) {
306  // cannot link 2 elements of the same type.
307  // except if the elements are 2 tracks or 2 ECAL
308  if( type1!=PFBlockElement::TRACK && type1!=PFBlockElement::GSF &&
309  type1!=PFBlockElement::ECAL) {
310  return;
311  }
312 
313  // cannot link two primary tracks (except if they come from a V0)
314  if( type1 ==PFBlockElement::TRACK) {
315  if ( !el1->isLinkedToDisplacedVertex() || !el2->isLinkedToDisplacedVertex())
316  return;
317  }
318  }
319 
320  linktype = static_cast<PFBlockLink::Type>
321  ((1<< (type1-1) ) | (1<< (type2-1) ));
322 
323  if(debug_ ) std::cout << " PFBlockAlgo links type1 " << type1 << " type2 " << type2 << std::endl;
324 
325  PFBlockElement::Type lowType = type1;
326  PFBlockElement::Type highType = type2;
327  const PFBlockElement* lowEl = el1;
328  const PFBlockElement* highEl = el2;
329 
330  if(type1>type2) {
331  lowType = type2;
332  highType = type1;
333  lowEl = el2;
334  highEl = el1;
335  }
336 
337  switch(linktype) {
340  {
341  // cout<<"TRACKandPS"<<endl;
342  PFRecTrackRef trackref = lowEl->trackRefPF();
343  PFClusterRef clusterref = highEl->clusterRef();
344  assert( !trackref.isNull() );
345  assert( !clusterref.isNull() );
346  // PJ - 14-May-09 : A link by rechit is needed here !
347  dist = testTrackAndPS( *trackref, *clusterref );
348  linktest = PFBlock::LINKTEST_RECHIT;
349  break;
350  }
351 
353  {
354  if(debug_ ) cout<<"TRACKandECAL"<<endl;
355  PFRecTrackRef trackref = lowEl->trackRefPF();
356 
357  if(debug_ ) std::cout << " Track pt " << trackref->trackRef()->pt() << std::endl;
358 
359  PFClusterRef clusterref = highEl->clusterRef();
360  assert( !trackref.isNull() );
361  assert( !clusterref.isNull() );
362  dist = LinkByRecHit::testTrackAndClusterByRecHit( *trackref, *clusterref, false, debug_ );
363  linktest = PFBlock::LINKTEST_RECHIT;
364 
365  if ( debug_ ) {
366  if( dist > 0. ) {
367  std::cout << " Here a link has been established"
368  << " between a track an Ecal with dist "
369  << dist << std::endl;
370  } else {
371  std::cout << " No link found " << std::endl;
372  }
373  }
374 
375  break;
376  }
378  {
379  // cout<<"TRACKandHCAL"<<endl;
380  PFRecTrackRef trackref = lowEl->trackRefPF();
381  PFClusterRef clusterref = highEl->clusterRef();
382  assert( !trackref.isNull() );
383  assert( !clusterref.isNull() );
384  dist = LinkByRecHit::testTrackAndClusterByRecHit( *trackref, *clusterref, false, debug_ );
385  linktest = PFBlock::LINKTEST_RECHIT;
386  break;
387  }
389  {
390  // cout<<"ECALandHCAL"<<endl;
391  PFClusterRef ecalref = lowEl->clusterRef();
392  PFClusterRef hcalref = highEl->clusterRef();
393  assert( !ecalref.isNull() );
394  assert( !hcalref.isNull() );
395  // PJ - 14-May-09 : A link by rechit is needed here !
396  // dist = testECALAndHCAL( *ecalref, *hcalref );
397  dist = -1.;
398  linktest = PFBlock::LINKTEST_RECHIT;
399  break;
400  }
403  {
404  // cout<<"PSandECAL"<<endl;
405  PFClusterRef psref = lowEl->clusterRef();
406  PFClusterRef ecalref = highEl->clusterRef();
407  assert( !psref.isNull() );
408  assert( !ecalref.isNull() );
409  dist = LinkByRecHit::testECALAndPSByRecHit( *ecalref, *psref ,debug_);
410  linktest = PFBlock::LINKTEST_RECHIT;
411  break;
412  }
414  {
415  PFClusterRef ps1ref = lowEl->clusterRef();
416  PFClusterRef ps2ref = highEl->clusterRef();
417  assert( !ps1ref.isNull() );
418  assert( !ps2ref.isNull() );
419  // PJ - 14-May-09 : A link by rechit is needed here !
420  // dist = testPS1AndPS2( *ps1ref, *ps2ref );
421  dist = -1.;
422  linktest = PFBlock::LINKTEST_RECHIT;
423  break;
424  }
426  {
427  if(debug_ )
428  cout<<"TRACKandTRACK"<<endl;
429  dist = testLinkByVertex(lowEl, highEl);
430  if(debug_ )
431  std::cout << " PFBlockLink::TRACKandTRACK dist " << dist << std::endl;
432  linktest = PFBlock::LINKTEST_RECHIT;
433  break;
434  }
435 
437  {
438 
439  PFClusterRef ecal1ref = lowEl->clusterRef();
440  PFClusterRef ecal2ref = highEl->clusterRef();
441  assert( !ecal1ref.isNull() );
442  assert( !ecal2ref.isNull() );
443  if(debug_)
444  cout << " PFBlockLink::ECALandECAL" << endl;
445  dist = testLinkBySuperCluster(ecal1ref,ecal2ref);
446  break;
447  }
448 
450  {
451  PFClusterRef clusterref = lowEl->clusterRef();
452  assert( !clusterref.isNull() );
453  const reco::PFBlockElementGsfTrack * GsfEl = dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
454  const PFRecTrack * myTrack = &(GsfEl->GsftrackPF());
455  dist = LinkByRecHit::testTrackAndClusterByRecHit( *myTrack, *clusterref, false, debug_ );
456  linktest = PFBlock::LINKTEST_RECHIT;
457 
458  if ( debug_ ) {
459  if ( dist > 0. ) {
460  std::cout << " Here a link has been established"
461  << " between a GSF track an Ecal with dist "
462  << dist << std::endl;
463  } else {
464  if(debug_ ) std::cout << " No link found " << std::endl;
465  }
466  }
467  break;
468  }
470  {
471  PFRecTrackRef trackref = lowEl->trackRefPF();
472  assert( !trackref.isNull() );
473  const reco::PFBlockElementGsfTrack * GsfEl =
474  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
475  GsfPFRecTrackRef gsfref = GsfEl->GsftrackRefPF();
476  reco::TrackRef kftrackref= (*trackref).trackRef();
477  assert( !gsfref.isNull() );
478  PFRecTrackRef refkf = (*gsfref).kfPFRecTrackRef();
479  if(refkf.isNonnull()) {
480  reco::TrackRef gsftrackref = (*refkf).trackRef();
481  if (gsftrackref.isNonnull()&&kftrackref.isNonnull()) {
482  if (kftrackref == gsftrackref) {
483  dist = 0.001;
484  } else {
485  dist = -1.;
486  }
487  } else {
488  dist = -1.;
489  }
490  } else {
491  dist = -1.;
492  }
493 
494 
496  if(lowEl->isLinkedToDisplacedVertex()){
497  vector<PFRecTrackRef> pfrectrack_vec = GsfEl->GsftrackRefPF()->convBremPFRecTrackRef();
498  if(pfrectrack_vec.size() > 0){
499  for(unsigned int iconv = 0; iconv < pfrectrack_vec.size(); iconv++) {
501  // use track ref
502  if(kftrackref == (*pfrectrack_vec[iconv]).trackRef()) {
503  dist = 0.001;
504  }
505  }
506  else{
507  // use the track base ref
508  reco::TrackBaseRef newTrackBaseRef((*pfrectrack_vec[iconv]).trackRef());
509  reco::TrackBaseRef elemTrackBaseRef(kftrackref);
510  if(newTrackBaseRef == elemTrackBaseRef){
511  dist = 0.001;
512  }
513  }
514  }
515  }
516  }
517  }
518 
519 
520  break;
521  }
522 
524  {
525  const reco::PFBlockElementGsfTrack * GsfEl = dynamic_cast<const reco::PFBlockElementGsfTrack*>(lowEl);
526  const reco::PFBlockElementBrem * BremEl = dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
527  GsfPFRecTrackRef gsfref = GsfEl->GsftrackRefPF();
528  GsfPFRecTrackRef bremref = BremEl->GsftrackRefPF();
529  assert( !gsfref.isNull() );
530  assert( !bremref.isNull() );
531  if (gsfref == bremref) {
532  dist = 0.001;
533  } else {
534  dist = -1.;
535  }
536  break;
537  }
539  {
540  const reco::PFBlockElementGsfTrack * lowGsfEl =
541  dynamic_cast<const reco::PFBlockElementGsfTrack*>(lowEl);
542  const reco::PFBlockElementGsfTrack * highGsfEl =
543  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
544 
545  GsfPFRecTrackRef lowgsfref = lowGsfEl->GsftrackRefPF();
546  GsfPFRecTrackRef highgsfref = highGsfEl->GsftrackRefPF();
547  assert( !lowgsfref.isNull() );
548  assert( !highgsfref.isNull() );
549 
550  if( (lowGsfEl->trackType(reco::PFBlockElement::T_FROM_GAMMACONV) == false &&
552  (highGsfEl->trackType(reco::PFBlockElement::T_FROM_GAMMACONV) == false &&
554  if(lowgsfref->trackId() == highgsfref->trackId()) {
555  dist = 0.001;
556  }
557  else {
558  dist = -1.;
559  }
560  }
561  break;
562  }
564  {
565  PFClusterRef clusterref = lowEl->clusterRef();
566  assert( !clusterref.isNull() );
567  const reco::PFBlockElementBrem * BremEl =
568  dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
569  const PFRecTrack * myTrack = &(BremEl->trackPF());
570  /*
571  double DP = (BremEl->DeltaP())*(-1.);
572  double SigmaDP = BremEl->SigmaDeltaP();
573  double SignBremDp = DP/SigmaDP;
574  */
575  bool isBrem = true;
576  dist = LinkByRecHit::testTrackAndClusterByRecHit( *myTrack, *clusterref, isBrem, debug_);
577  if( debug_ && dist > 0. )
578  std::cout << "ECALandBREM: dist testTrackAndClusterByRecHit "
579  << dist << std::endl;
580  linktest = PFBlock::LINKTEST_RECHIT;
581  break;
582  }
585  {
586  PFClusterRef psref = lowEl->clusterRef();
587  assert( !psref.isNull() );
588  const reco::PFBlockElementGsfTrack * GsfEl = dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
589  const PFRecTrack * myTrack = &(GsfEl->GsftrackPF());
590  // PJ - 14-May-09 : A link by rechit is needed here !
591  dist = testTrackAndPS( *myTrack, *psref );
592  linktest = PFBlock::LINKTEST_RECHIT;
593  break;
594  }
597  {
598  PFClusterRef psref = lowEl->clusterRef();
599  assert( !psref.isNull() );
600  const reco::PFBlockElementBrem * BremEl = dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
601  const PFRecTrack * myTrack = &(BremEl->trackPF());
602  // PJ - 14-May-09 : A link by rechit is needed here !
603  dist = testTrackAndPS( *myTrack, *psref );
604  linktest = PFBlock::LINKTEST_RECHIT;
605  break;
606  }
608  {
609  PFClusterRef clusterref = lowEl->clusterRef();
610  assert( !clusterref.isNull() );
611  const reco::PFBlockElementGsfTrack * GsfEl = dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
612  const PFRecTrack * myTrack = &(GsfEl->GsftrackPF());
613  dist = LinkByRecHit::testTrackAndClusterByRecHit( *myTrack, *clusterref, false, debug_ );
614  linktest = PFBlock::LINKTEST_RECHIT;
615  break;
616  }
618  {
619  PFClusterRef clusterref = lowEl->clusterRef();
620  assert( !clusterref.isNull() );
621  const reco::PFBlockElementBrem * BremEl = dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
622  const PFRecTrack * myTrack = &(BremEl->trackPF());
623  bool isBrem = true;
624  dist = LinkByRecHit::testTrackAndClusterByRecHit( *myTrack, *clusterref, isBrem, debug_);
625  break;
626  }
628  {
629  // cout<<"HFEMandHFHAD"<<endl;
630  PFClusterRef eref = lowEl->clusterRef();
631  PFClusterRef href = highEl->clusterRef();
632  assert( !eref.isNull() );
633  assert( !href.isNull() );
634  dist = LinkByRecHit::testHFEMAndHFHADByRecHit( *eref, *href, debug_ );
635  linktest = PFBlock::LINKTEST_RECHIT;
636  break;
637 
638  }
640  {
641  PFClusterRef clusterref = lowEl->clusterRef();
642 
643  assert( !clusterref.isNull() );
644 
645  const reco::PFBlockElementSuperCluster * scEl =
646  dynamic_cast<const reco::PFBlockElementSuperCluster*>(highEl);
647  assert (!scEl->superClusterRef().isNull());
648  dist = testSuperClusterPFCluster(scEl->superClusterRef(),
649  clusterref);
650  break;
651  }
652  default:
653  dist = -1.;
654  linktest = PFBlock::LINKTEST_RECHIT;
655  // cerr<<"link type not implemented yet: 0x"<<hex<<linktype<<dec<<endl;
656  // assert(0);
657  return;
658  }
659 }
660 
661 double
663  const PFCluster& ps) const {
664 
665 #ifdef PFLOW_DEBUG
666  // cout<<"entering testTrackAndPS"<<endl;
667  // resolution of PS cluster dxdx and dydy from strip pitch and length
668  double dx=0.;
669  double dy=0.;
670 
671  unsigned layerid =0;
672  // PS1: vertical strips PS2: horizontal strips
673  switch (ps.layer()) {
674  case PFLayer::PS1:
676 
677  // vertical strips in PS1, measure x with pitch precision
678  dx = resPSpitch_;
679  dy = resPSlength_;
680  break;
681  case PFLayer::PS2:
683  // horizontal strips in PS2, measure y with pitch precision
684  dy = resPSpitch_;
685  dx = resPSlength_;
686  break;
687  default:
688  break;
689  }
690  const reco::PFTrajectoryPoint& atPS
691  = track.extrapolatedPoint( layerid );
692  // did not reach PS, cannot be associated with a cluster.
693  if( ! atPS.isValid() ) return -1.;
694 
695  double trackx = atPS.position().X();
696  double tracky = atPS.position().Y();
697  double trackz = atPS.position().Z(); // MDN jan 09
698 
699  // ps position x, y
700  double psx = ps.position().X();
701  double psy = ps.position().Y();
702  // MDN Jan 09: check that trackz and psz have the same sign
703  double psz = ps.position().Z();
704  if( trackz*psz < 0.) return -1.;
705 
706  // double chi2 = (psx-trackx)*(psx-trackx)/(dx*dx + trackresolx*trackresolx)
707  // + (psy-tracky)*(psy-tracky)/(dy*dy + trackresoly*trackresoly);
708 
709  double dist = std::sqrt( (psx-trackx)*(psx-trackx)
710  + (psy-tracky)*(psy-tracky));
711  if(debug_) cout<<"testTrackAndPS "<< dist <<" "<<endl;
712  if(debug_){
713  cout<<" trackx " << trackx
714  <<" tracky " << tracky
715  <<" psx " << psx
716  <<" psy " << psy
717  << endl;
718  }
719 #endif
720 
721  // Return -1. as long as no link by rechit is available
722  return -1.;
723 }
724 
725 double
727  const PFCluster& hcal) const {
728 
729  // cout<<"entering testECALAndHCAL"<<endl;
730 
731  /*
732  double dist =
733  computeDist( ecal.positionREP().Eta(),
734  ecal.positionREP().Phi(),
735  hcal.positionREP().Eta(),
736  hcal.positionREP().Phi() );
737  */
738 
739 #ifdef PFLOW_DEBUG
740  if(debug_) cout<<"testECALAndHCAL "<< dist <<" "<<endl;
741  if(debug_){
742  cout<<" ecaleta " << ecal.positionREP().Eta()
743  <<" ecalphi " << ecal.positionREP().Phi()
744  <<" hcaleta " << hcal.positionREP().Eta()
745  <<" hcalphi " << hcal.positionREP().Phi()
746  }
747 #endif
748 
749  // Need to implement a link by RecHit
750  return -1.;
751 }
752 
753 double
755  const PFClusterRef& ecal2) const {
756 
757  // cout<<"entering testECALAndECAL "<< pfcRefSCMap_.size() << endl;
758 
759  double dist = -1;
760 
761  // the first one is not in any super cluster
762  int testindex=pfcSCVec_[ecal1.key()];
763  if(testindex == -1.) return dist;
764  // if(itcheck==pfcRefSCMap_.end()) return dist;
765  // now retrieve the of PFclusters in this super cluster
766 
767  const std::vector<reco::PFClusterRef> & thePFClusters(scpfcRefs_[testindex]);
768 
769  unsigned npf=thePFClusters.size();
770  for(unsigned i=0;i<npf;++i)
771  {
772  if(thePFClusters[i]==ecal2) // yes they are in the same SC
773  {
774  dist=LinkByRecHit::computeDist( ecal1->positionREP().Eta(),
775  ecal1->positionREP().Phi(),
776  ecal2->positionREP().Eta(),
777  ecal2->positionREP().Phi() );
778 // std::cout << " DETA " << fabs(ecal1->positionREP().Eta()-ecal2->positionREP().Eta()) << std::endl;
779 // if(fabs(ecal1->positionREP().Eta()-ecal2->positionREP().Eta())>0.2)
780 // {
781 // std::cout << " Super Cluster " << *(superClusters_[testindex]) << std::endl;
782 // std::cout << " Cluster1 " << *ecal1 << std::endl;
783 // std::cout << " Cluster2 " << *ecal2 << std::endl;
784 // ClusterClusterMapping::checkOverlap(*ecal1,superClusters_,0.01,true);
785 // ClusterClusterMapping::checkOverlap(*ecal2,superClusters_,0.01,true);
786 // }
787  return dist;
788  }
789  }
790  return dist;
791 }
792 
793 
794 double
796  const PFClusterRef& ecal2) const {
797 
798  // cout<<"entering testECALAndECAL "<< pfcRefSCMap_.size() << endl;
799 
800  double dist = -1;
801 
802  bool overlap=ClusterClusterMapping::overlap(*ecal1,*ecal2);
803 
804  if(overlap) {
805  dist=LinkByRecHit::computeDist( ecal1->position().eta(),
806  ecal1->position().phi(),
807  ecal2->positionREP().Eta(),
808  ecal2->positionREP().Phi() );
809  return dist;
810  }
811  return dist;
812 }
813 
814 
815 
816 double
818  const PFCluster& ps2) const {
819 
820 #ifdef PFLOW_DEBUG
821  // cout<<"entering testPS1AndPS2"<<endl;
822 
823  // compute chi2 in y, z using swimming formulae
824  // y2 = y1 * z2/z1 and x2 = x1 *z2/z1
825 
826  // ps position1 x, y, z
827  double x1 = ps1.position().X();
828  double y1 = ps1.position().Y();
829  double z1 = ps1.position().Z();
830  double x2 = ps2.position().X();
831  double y2 = ps2.position().Y();
832  double z2 = ps2.position().Z();
833  // MDN Bug correction Jan 09: check that z1 and z2 have the same sign!
834  if (z1*z2<0.) -1.;
835  // swim to PS2
836  double scale = z2/z1;
837  double x1atPS2 = x1*scale;
838  double y1atPS2 = y1*scale;
839  // resolution of PS cluster dxdx and dydy from strip pitch and length
840  // vertical strips in PS1, measure x with pitch precision
841  double dx1dx1 = resPSpitch_*resPSpitch_*scale*scale;
842  double dy1dy1 = resPSlength_*resPSlength_*scale*scale;
843  // horizontal strips in PS2 , measure y with pitch precision
844  double dy2dy2 = resPSpitch_*resPSpitch_;
845  double dx2dx2 = resPSlength_*resPSlength_;
846 
847  // double chi2 = (x2-x1atPS2)*(x2-x1atPS2)/(dx1dx1 + dx2dx2)
848  // + (y2-y1atPS2)*(y2-y1atPS2)/(dy1dy1 + dy2dy2);
849 
850  double dist = std::sqrt( (x2-x1atPS2)*(x2-x1atPS2)
851  + (y2-y1atPS2)*(y2-y1atPS2));
852 
853  if(debug_) cout<<"testPS1AndPS2 "<<dist<<" "<<endl;
854  if(debug_){
855  cout<<" x1atPS2 "<< x1atPS2 << " dx1 "<<resPSpitch_*scale
856  <<" y1atPS2 "<< y1atPS2 << " dy1 "<<resPSlength_*scale<< endl
857  <<" x2 " <<x2 << " dx2 "<<resPSlength_
858  <<" y2 " << y2 << " dy2 "<<resPSpitch_<< endl;
859  }
860 #endif
861 
862  // Need a link by rechit here
863  return -1.;
864 }
865 
866 
867 
868 double
870  const reco::PFBlockElement* elt2) const {
871 
872  // cout << "Test link by vertex between" << endl << *elt1 << endl << " and " << endl << *elt2 << endl;
873 
874  double result=-1.;
875 
878  PFDisplacedTrackerVertexRef ni1_TO_DISP = elt1->displacedVertexRef(T_TO_DISP);
879  PFDisplacedTrackerVertexRef ni2_TO_DISP = elt2->displacedVertexRef(T_TO_DISP);
880  PFDisplacedTrackerVertexRef ni1_FROM_DISP = elt1->displacedVertexRef(T_FROM_DISP);
881  PFDisplacedTrackerVertexRef ni2_FROM_DISP = elt2->displacedVertexRef(T_FROM_DISP);
882 
883  if( ni1_TO_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
884  if( ni1_TO_DISP == ni2_FROM_DISP ) { result = 1.0; return result; }
885 
886  if( ni1_FROM_DISP.isNonnull() && ni2_TO_DISP.isNonnull())
887  if( ni1_FROM_DISP == ni2_TO_DISP ) { result = 1.0; return result; }
888 
889  if( ni1_FROM_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
890  if( ni1_FROM_DISP == ni2_FROM_DISP ) { result = 1.0; return result; }
891 
892 
895 
896  if(debug_ ) std::cout << " testLinkByVertex On Conversions " << std::endl;
897 
898  if ( elt1->convRef().isNonnull() && elt2->convRef().isNonnull() ) {
899  if(debug_ ) std::cout << " PFBlockAlgo.cc testLinkByVertex Cconversion Refs are non null " << std::endl;
900  if ( elt1->convRef() == elt2->convRef() ) {
901  result=1.0;
902  if(debug_ ) std::cout << " testLinkByVertex Cconversion Refs are equal " << std::endl;
903  return result;
904  }
905  }
906 
907  }
908 
911  if(debug_ ) std::cout << " testLinkByVertex On V0 " << std::endl;
912  if ( elt1->V0Ref().isNonnull() && elt2->V0Ref().isNonnull() ) {
913  if(debug_ ) std::cout << " PFBlockAlgo.cc testLinkByVertex V0 Refs are non null " << std::endl;
914  if ( elt1->V0Ref() == elt2->V0Ref() ) {
915  result=1.0;
916  if(debug_ ) std::cout << " testLinkByVertex V0 Refs are equal " << std::endl;
917  return result;
918  }
919  }
920  }
921 
922  return result;
923 }
924 
925 
926 
927 void
929  const reco::GsfPFRecTrackCollection& gsftracks,
930  const reco::PFClusterCollection& ecals,
931  const reco::PFClusterCollection& hcals,
932  const reco::PFClusterCollection& hfems,
933  const reco::PFClusterCollection& hfhads,
935  const reco::PhotonCollection& egphh,
936  const Mask& trackMask,
937  const Mask& gsftrackMask,
938  const Mask& ecalMask,
939  const Mask& hcalMask,
940  const Mask& hfemMask,
941  const Mask& hfhadMask,
942  const Mask& psMask,
943  const Mask& phMask) const {
944 
945  if( !trackMask.empty() &&
946  trackMask.size() != tracks.size() ) {
947  string err = "PFBlockAlgo::setInput: ";
948  err += "The size of the track mask is different ";
949  err += "from the size of the track vector.";
950  throw std::length_error( err.c_str() );
951  }
952 
953  if( !gsftrackMask.empty() &&
954  gsftrackMask.size() != gsftracks.size() ) {
955  string err = "PFBlockAlgo::setInput: ";
956  err += "The size of the gsf track mask is different ";
957  err += "from the size of the gsftrack vector.";
958  throw std::length_error( err.c_str() );
959  }
960 
961  if( !ecalMask.empty() &&
962  ecalMask.size() != ecals.size() ) {
963  string err = "PFBlockAlgo::setInput: ";
964  err += "The size of the ecal mask is different ";
965  err += "from the size of the ecal clusters vector.";
966  throw std::length_error( err.c_str() );
967  }
968 
969  if( !hcalMask.empty() &&
970  hcalMask.size() != hcals.size() ) {
971  string err = "PFBlockAlgo::setInput: ";
972  err += "The size of the hcal mask is different ";
973  err += "from the size of the hcal clusters vector.";
974  throw std::length_error( err.c_str() );
975  }
976 
977  if( !hfemMask.empty() &&
978  hfemMask.size() != hfems.size() ) {
979  string err = "PFBlockAlgo::setInput: ";
980  err += "The size of the hfem mask is different ";
981  err += "from the size of the hfem clusters vector.";
982  throw std::length_error( err.c_str() );
983  }
984 
985  if( !hfhadMask.empty() &&
986  hfhadMask.size() != hfhads.size() ) {
987  string err = "PFBlockAlgo::setInput: ";
988  err += "The size of the hfhad mask is different ";
989  err += "from the size of the hfhad clusters vector.";
990  throw std::length_error( err.c_str() );
991  }
992 
993  if( !psMask.empty() &&
994  psMask.size() != pss.size() ) {
995  string err = "PFBlockAlgo::setInput: ";
996  err += "The size of the ps mask is different ";
997  err += "from the size of the ps clusters vector.";
998  throw std::length_error( err.c_str() );
999  }
1000 
1001  if( !phMask.empty() &&
1002  phMask.size() != egphh.size() ) {
1003  string err = "PFBlockAlgo::setInput: ";
1004  err += "The size of the photon mask is different ";
1005  err += "from the size of the photon vector.";
1006  throw std::length_error( err.c_str() );
1007  }
1008 
1009 }
1010 
1011 
1012 std::ostream& operator<<(std::ostream& out, const PFBlockAlgo& a) {
1013  if(! out) return out;
1014 
1015  out<<"====== Particle Flow Block Algorithm ======= ";
1016  out<<endl;
1017  out<<"number of unassociated elements : "<<a.elements_.size()<<endl;
1018  out<<endl;
1019 
1020  for(PFBlockAlgo::IEC ie = a.elements_.begin();
1021  ie != a.elements_.end(); ie++) {
1022  out<<"\t"<<**ie <<endl;
1023  }
1024 
1025 
1026  // const PFBlockCollection& blocks = a.blocks();
1027 
1028  const std::auto_ptr< reco::PFBlockCollection >& blocks
1029  = a.blocks();
1030 
1031  if(!blocks.get() ) {
1032  out<<"blocks already transfered"<<endl;
1033  }
1034  else {
1035  out<<"number of blocks : "<<blocks->size()<<endl;
1036  out<<endl;
1037 
1038  for(PFBlockAlgo::IBC ib=blocks->begin();
1039  ib != blocks->end(); ib++) {
1040  out<<(*ib)<<endl;
1041  }
1042  }
1043 
1044  return out;
1045 }
1046 
1047 bool
1049 
1050  double P = trackref->p();
1051  double Pt = trackref->pt();
1052  double DPt = trackref->ptError();
1053  unsigned int NHit = trackref->hitPattern().trackerLayersWithMeasurement();
1054  unsigned int NLostHit = trackref->hitPattern().trackerLayersWithoutMeasurement();
1055  unsigned int LostHits = trackref->numberOfLostHits();
1056  double sigmaHad = sqrt(1.20*1.20/P+0.06*0.06) / (1.+LostHits);
1057 
1058  // iteration 1,2,3,4,5 correspond to algo = 1/4,5,6,7,8,9
1059  unsigned int Algo = 0;
1060  switch (trackref->algo()) {
1061  case TrackBase::ctf:
1062  case TrackBase::iter0:
1063  case TrackBase::iter1:
1064  Algo = 0;
1065  break;
1066  case TrackBase::iter2:
1067  Algo = 1;
1068  break;
1069  case TrackBase::iter3:
1070  Algo = 2;
1071  break;
1072  case TrackBase::iter4:
1073  Algo = 3;
1074  break;
1075  case TrackBase::iter5:
1076  Algo = 4;
1077  break;
1078  default:
1079  Algo = useIterTracking_ ? 5 : 0;
1080  break;
1081  }
1082 
1083  // Protection against 0 momentum tracks
1084  if ( P < 0.05 ) return false;
1085 
1086  // Temporary : Reject all tracking iteration beyond 5th step.
1087  if ( Algo > 4 ) return false;
1088 
1089  if (debug_) cout << " PFBlockAlgo: PFrecTrack->Track Pt= "
1090  << Pt << " DPt = " << DPt << endl;
1091  if ( ( DPtovPtCut_[Algo] > 0. &&
1092  DPt/Pt > DPtovPtCut_[Algo]*sigmaHad ) ||
1093  NHit < NHitCut_[Algo] ) {
1094  // (Algo >= 3 && LostHits != 0) ) {
1095  if (debug_) cout << " PFBlockAlgo: skip badly measured track"
1096  << ", P = " << P
1097  << ", Pt = " << Pt
1098  << " DPt = " << DPt
1099  << ", N(hits) = " << NHit << " (Lost : " << LostHits << "/" << NLostHit << ")"
1100  << ", Algo = " << Algo
1101  << endl;
1102  if (debug_) cout << " cut is DPt/Pt < " << DPtovPtCut_[Algo] * sigmaHad << endl;
1103  if (debug_) cout << " cut is NHit >= " << NHitCut_[Algo] << endl;
1104  /*
1105  std::cout << "Track REJECTED : ";
1106  std::cout << ", P = " << P
1107  << ", Pt = " << Pt
1108  << " DPt = " << DPt
1109  << ", N(hits) = " << NHit << " (Lost : " << LostHits << "/" << NLostHit << ")"
1110  << ", Algo = " << Algo
1111  << std::endl;
1112  */
1113  return false;
1114  }
1115 
1116  /*
1117  std::cout << "Track Accepted : ";
1118  std::cout << ", P = " << P
1119  << ", Pt = " << Pt
1120  << " DPt = " << DPt
1121  << ", N(hits) = " << NHit << " (Lost : " << LostHits << "/" << NLostHit << ")"
1122  << ", Algo = " << Algo
1123  << std::endl;
1124  */
1125  return true;
1126 }
1127 
1128 int
1130  const edm::Handle<reco::MuonCollection>& muonh) const {
1131  if(muonh.isValid() ) {
1132  for(unsigned j=0;j<muonh->size(); j++) {
1133  reco::MuonRef muonref( muonh, j );
1134  if (muonref->track().isNonnull())
1135  if( muonref->track() == trackref ) return j;
1136  }
1137  }
1138  return -1; // not found
1139 }
1140 
1141 int
1143  const edm::OrphanHandle<reco::MuonCollection>& muonh) const {
1144  if(muonh.isValid() ) {
1145  for(unsigned j=0;j<muonh->size(); j++) {
1146  reco::MuonRef muonref( muonh, j );
1147  if (muonref->track().isNonnull())
1148  if( muonref->track() == trackref ) return j;
1149  }
1150  }
1151  return -1; // not found
1152 }
1153 
1154 
1155 void
1157  // method which removes link between primary tracks and the clusters
1158 
1159  typedef std::multimap<double, unsigned>::iterator IE;
1160 
1162  // loop on all elements != TRACK
1163  for( unsigned i1=0; i1 != els.size(); ++i1 ) {
1164  if( els[i1].type() == PFBlockElement::TRACK ) continue;
1165  std::multimap<double, unsigned> assocTracks;
1166  // get associated tracks
1167  block.associatedElements( i1, block.linkData(),
1168  assocTracks,
1171  for( IE ie = assocTracks.begin(); ie != assocTracks.end(); ++ie) {
1172  //double distprim = ie->first;
1173  unsigned iprim = ie->second;
1174  // if this track a primary track (T_TO_DISP)
1175  // the new strategy gouzevitch: remove all the links from primary track
1176  if( els[iprim].isPrimary()) {
1177 
1178  block.setLink( i1, iprim, -1, block.linkData(),
1179  PFBlock::LINKTEST_RECHIT );
1180  }
1181  } // loop on all associated tracks
1182  } // loop on all elements
1183 
1184 }
1185 
1187  pfbe->setTrackIso(photon.trkSumPtHollowConeDR04());
1188  pfbe->setEcalIso(photon.ecalRecHitSumEtConeDR04());
1189  pfbe->setHcalIso(photon.hcalTowerSumEtConeDR04());
1190  pfbe->setHoE(photon.hadronicOverEm());
1191  pfbe->setFromPhoton(true);
1192 }
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:81
const std::auto_ptr< reco::PFBlockCollection > & blocks() const
Definition: PFBlockAlgo.h:168
type
Definition: HCALResponse.h:22
void checkMaskSize(const reco::PFRecTrackCollection &tracks, const reco::GsfPFRecTrackCollection &gsftracks, const reco::PFClusterCollection &ecals, const reco::PFClusterCollection &hcals, const reco::PFClusterCollection &hfems, const reco::PFClusterCollection &hfhads, const reco::PFClusterCollection &pss, const reco::PhotonCollection &egphh, const Mask &trackMask, const Mask &gsftrackMask, const Mask &ecalMask, const Mask &hcalMask, const Mask &hfemMask, const Mask &hfhadMask, const Mask &psMask, const Mask &phMask) const
Definition: PFBlockAlgo.cc:928
Abstract base class for a PFBlock element (track, cluster...)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
int i
Definition: DBlmapReader.cc:9
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:246
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27
double testECALAndHCAL(const reco::PFCluster &ecal, const reco::PFCluster &hcal) const
Definition: PFBlockAlgo.cc:726
bool useIterTracking_
Flag to turn off quality cuts which require iterative tracking (for heavy-ions)
Definition: PFBlockAlgo.h:285
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
GsfPFRecTrackRef GsftrackRefPF() const
double testSuperClusterPFCluster(const reco::SuperClusterRef &sct1, const reco::PFClusterRef &elt2) const
test association between SuperClusters and ECAL
Definition: PFBlockAlgo.cc:795
static double testECALAndPSByRecHit(const reco::PFCluster &clusterECAL, const reco::PFCluster &clusterPS, bool debug=false)
const math::XYZPoint & position() const
cartesian position (x, y, z)
Type type() const
int nuclearInteractionsPurity_
Definition: PFBlockAlgo.h:297
size_type size() const
Definition: OwnVector.h:262
void checkDisplacedVertexLinks(reco::PFBlock &block) const
remove extra links between primary track and clusters
#define P
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:244
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:107
std::auto_ptr< reco::PFBlockCollection > blocks_
Definition: PFBlockAlgo.h:268
const LinkData & linkData() const
Definition: PFBlock.h:112
tuple els
Definition: asciidump.py:420
std::vector< double > DPtovPtCut_
DPt/Pt cut for creating atrack element.
Definition: PFBlockAlgo.h:279
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual PFDisplacedTrackerVertexRef displacedVertexRef(TrackType trType) const
double testTrackAndPS(const reco::PFRecTrack &track, const reco::PFCluster &ps) const
Definition: PFBlockAlgo.cc:662
std::list< reco::PFBlockElement * >::const_iterator IEC
Definition: PFBlockAlgo.h:176
void setLink(unsigned i1, unsigned i2, double dist, LinkData &linkData, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:26
static double computeDist(double eta1, double phi1, double eta2, double phi2)
computes a chisquare
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
Particle Flow Algorithm.
Definition: PFBlockAlgo.h:64
void setFromPhoton(bool val)
set provenance
void setHcalIso(float val)
set the had Iso
virtual VertexCompositeCandidateRef V0Ref() const
double testLinkBySuperCluster(const reco::PFClusterRef &elt1, const reco::PFClusterRef &elt2) const
test association by Supercluster between two ECAL
Definition: PFBlockAlgo.cc:754
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:249
bool isNull() const
Checks for null.
Definition: Ref.h:246
double testPS1AndPS2(const reco::PFCluster &ps1, const reco::PFCluster &ps2) const
Definition: PFBlockAlgo.cc:817
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
T sqrt(T t)
Definition: SSEVec.h:28
void setTrackIso(float val)
set the track Iso
bool useConvBremPFRecTracks_
switch on/off Conversions Brem Recovery with KF Tracks
Definition: PFBlockAlgo.h:300
tuple result
Definition: query.py:137
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Definition: PFCluster.h:76
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
void link(const reco::PFBlockElement *el1, const reco::PFBlockElement *el2, PFBlockLink::Type &linktype, reco::PFBlock::LinkTest &linktest, double &dist) const
check whether 2 elements are linked. Returns distance and linktype
Definition: PFBlockAlgo.cc:291
virtual PFClusterRef clusterRef() const
int j
Definition: DBlmapReader.cc:9
virtual PFRecTrackRef trackRefPF() const
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
std::list< reco::PFBlockElement * >::iterator IE
define these in *Fwd files in DataFormats/ParticleFlowReco?
Definition: PFBlockAlgo.h:175
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:155
void buildGraph()
Definition: PFBlockAlgo.cc:284
std::list< reco::PFBlockElement * > elements_
actually, particles will be created by a separate producer
Definition: PFBlockAlgo.h:274
bool isValid() const
Definition: HandleBase.h:76
virtual bool trackType(TrackType trType) const
std::vector< PFBlock > PFBlockCollection
collection of PFBlock objects
Definition: PFBlockFwd.h:11
void bookLinkData()
Definition: PFBlock.cc:20
std::vector< std::vector< reco::PFClusterRef > > scpfcRefs_
PF clusters corresponding to a given SC.
Definition: PFBlockAlgo.h:312
bool goodPtResolution(const reco::TrackRef &trackref)
open a resolution map
void fillFromPhoton(const reco::Photon &photon, reco::PFBlockElementSuperCluster *pfbe)
void packLinks(reco::PFBlock &block, const std::vector< PFBlockLink > &links) const
Definition: PFBlockAlgo.cc:211
tuple out
Definition: dbtoconf.py:99
static const Mask dummyMask_
Definition: PFBlockAlgo.h:276
reco::PFBlockCollection::const_iterator IBC
Definition: PFBlockAlgo.h:177
IE associate(IE next, IE last, std::vector< PFBlockLink > &links)
Definition: PFBlockAlgo.cc:103
const PhotonSelectorAlgo * photonSelector_
PhotonSelector.
Definition: PFBlockAlgo.h:303
double testLinkByVertex(const reco::PFBlockElement *elt1, const reco::PFBlockElement *elt2) const
Definition: PFBlockAlgo.cc:869
bool isValid() const
is this point valid ?
tuple tracks
Definition: testEve_cfg.py:39
void associatedElements(unsigned i, const LinkData &linkData, std::multimap< double, unsigned > &sortedAssociates, reco::PFBlockElement::Type type=PFBlockElement::NONE, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:75
static double testHFEMAndHFHADByRecHit(const reco::PFCluster &clusterHFEM, const reco::PFCluster &clusterHFHAD, bool debug=false)
test association between HFEM and HFHAD, by rechit
key_type key() const
Accessor for product key.
Definition: Ref.h:265
virtual bool trackType(TrackType trType) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
void findBlocks()
build blocks
Definition: PFBlockAlgo.cc:66
std::vector< int > pfcSCVec_
SC corresponding to the PF cluster.
Definition: PFBlockAlgo.h:309
float trkSumPtHollowConeDR04() const
Definition: Photon.h:254
void setParameters(std::vector< double > &DPtovPtCut, std::vector< unsigned > &NHitCut, bool useConvBremPFRecTracks, bool useIterTracking, int nuclearInteractionsPurity, bool useEGPhotons, std::vector< double > &photonSelectionCuts)
Definition: PFBlockAlgo.cc:31
virtual ConversionRef convRef() const
double a
Definition: hdecay.h:121
GsfPFRecTrackRef GsftrackRefPF() const
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
tuple cout
Definition: gather_cfg.py:41
virtual bool isLinkedToDisplacedVertex() const
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
std::vector< bool > Mask
Definition: PFBlockAlgo.h:82
bool debug_
if true, debug printouts activated
Definition: PFBlockAlgo.h:314
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:10
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
bool useEGPhotons_
Flag to turn off the import of EG Photons.
Definition: PFBlockAlgo.h:288
Definition: fakeMenu.h:4
void setEcalIso(float val)
set the ecal Iso
std::vector< unsigned > NHitCut_
Number of layers crossed cut for creating atrack element.
Definition: PFBlockAlgo.h:282
Block of elements.
Definition: PFBlock.h:30