CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockAlgo.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFProducer_PFBlockAlgo_h
2 #define RecoParticleFlow_PFProducer_PFBlockAlgo_h
3 
4 #include <set>
5 #include <vector>
6 #include <iostream>
7 
8 // #include "FWCore/Framework/interface/Handle.h"
10 // #include "FWCore/Framework/interface/OrphanHandle.h"
12 
13 
27 
31 
32 // Glowinski & Gouzevitch
37 // !Glowinski & Gouzevitch
38 
39 // #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
40 
45 
57 
59 
61 
62 #include <map>
63 
64 
66 
71 class PFBlockAlgo {
72 
73  public:
74 
75  PFBlockAlgo();
76 
77  ~PFBlockAlgo();
78 
79 
80  void setParameters( std::vector<double>& DPtovPtCut,
81  std::vector<unsigned>& NHitCut,
82  bool useConvBremPFRecTracks,
83  bool useIterTracking,
84  int nuclearInteractionsPurity,
85  bool useEGPhotons,
86  std::vector<double> & photonSelectionCuts,
87  bool useSuperClusters,
88  bool superClusterMatchByRef
89  );
90 
91  // Glowinski & Gouzevitch
92  void setUseOptimization(bool useKDTreeTrackEcalLinker);
93  // ! Glowinski & Gouzevitch
94 
95  typedef std::vector<bool> Mask;
96 
98  template< template<typename> class T>
99  void setInput(const T<reco::PFRecTrackCollection>& trackh,
100  const T<reco::GsfPFRecTrackCollection>& gsftrackh,
101  const T<reco::GsfPFRecTrackCollection>& convbremgsftrackh,
102  const T<reco::MuonCollection>& muonh,
104  const T<reco::PFRecTrackCollection>& nucleartrackh,
106  const T<reco::PFV0Collection>& v0,
107  const T<reco::PFClusterCollection>& ecalh,
108  const T<reco::PFClusterCollection>& hcalh,
109  const T<reco::PFClusterCollection>& hoh,
110  const T<reco::PFClusterCollection>& hfemh,
111  const T<reco::PFClusterCollection>& hfhadh,
112  const T<reco::PFClusterCollection>& psh,
113  const T<reco::PhotonCollection>& egphh,
116  const T<edm::ValueMap<reco::CaloClusterPtr> >& pfclusterassoc,
117  const Mask& trackMask = dummyMask_,
118  const Mask& gsftrackMask = dummyMask_,
119  const Mask& ecalMask = dummyMask_,
120  const Mask& hcalMask = dummyMask_,
121  const Mask& hoMask = dummyMask_,
122  const Mask& hfemMask = dummyMask_,
123  const Mask& hfhadMask = dummyMask_,
124  const Mask& psMask = dummyMask_,
125  const Mask& phMask = dummyMask_,
126  const Mask& scMask = dummyMask_);
127 
129  template< template<typename> class T >
131  const T<reco::MuonCollection>& muonh,
132  const T<reco::PFClusterCollection>& ecalh,
133  const T<reco::PFClusterCollection>& hcalh,
134  const T<reco::PFClusterCollection>& hoh,
135  const T<reco::PFClusterCollection>& hfemh,
136  const T<reco::PFClusterCollection>& hfhadh,
137  const T<reco::PFClusterCollection>& psh,
138  const Mask& trackMask = dummyMask_,
139  const Mask& ecalMask = dummyMask_,
140  const Mask& hcalMask = dummyMask_,
141  const Mask& hoMask = dummyMask_,
142  const Mask& psMask = dummyMask_) {
144  T<reco::GsfPFRecTrackCollection> convbremgsftrackh;
145  //T<reco::MuonCollection> muonh;
147  T<reco::PFRecTrackCollection> nucleartrackh;
153  T<edm::ValueMap<reco::CaloClusterPtr> > pfclusterassoc;
154  setInput<T>( trackh, gsftrackh, convbremgsftrackh, muonh, nuclearh, nucleartrackh, convh, v0,
155  ecalh, hcalh, hoh, hfemh, hfhadh, psh, phh, scebh, sceeh, pfclusterassoc,
156  trackMask, ecalMask, hcalMask, hoMask, psMask);
157  }
158 
160  template< template<typename> class T >
162  const T<reco::GsfPFRecTrackCollection>& gsftrackh,
163  const T<reco::PFClusterCollection>& ecalh,
164  const T<reco::PFClusterCollection>& hcalh,
165  const T<reco::PFClusterCollection>& hoh,
166  const T<reco::PFClusterCollection>& psh,
167  const Mask& trackMask = dummyMask_,
168  const Mask& gsftrackMask = dummyMask_,
169  const Mask& ecalMask = dummyMask_,
170  const Mask& hcalMask = dummyMask_,
171  const Mask& hoMask = dummyMask_,
172  const Mask& psMask = dummyMask_) {
173  T<reco::GsfPFRecTrackCollection> convbremgsftrackh;
176  T<reco::PFRecTrackCollection> nucleartrackh;
180  setInput<T>( trackh, gsftrackh, convbremgsftrackh, muonh, nuclearh, nucleartrackh, convh, v0, ecalh, hcalh, hoh, psh, egphh,
181  trackMask, gsftrackMask,ecalMask, hcalMask, hoMask, psMask);
182  }
183 
184 
186  void setDebug( bool debug ) {debug_ = debug;}
187 
189  void findBlocks();
190 
191 
193  /* const reco::PFBlockCollection& blocks() const {return *blocks_;} */
194  const std::auto_ptr< reco::PFBlockCollection >& blocks() const
195  {return blocks_;}
196 
198  std::auto_ptr< reco::PFBlockCollection > transferBlocks() {return blocks_;}
199 
201  typedef std::list< reco::PFBlockElement* >::iterator IE;
202  typedef std::list< reco::PFBlockElement* >::const_iterator IEC;
203  typedef reco::PFBlockCollection::const_iterator IBC;
204 
205  void setHOTag(bool ho) { useHO_ = ho;}
206 
207  private:
208 
215  IE associate(IE next, IE last, std::vector<PFBlockLink>& links);
216 
220  const std::vector<PFBlockLink>& links) const;
221 
224 
228  void buildGraph();
229 
231  inline bool linkPrefilter(const reco::PFBlockElement* last, const reco::PFBlockElement* next) const;
232 
234  void link( const reco::PFBlockElement* el1,
235  const reco::PFBlockElement* el2,
236  PFBlockLink::Type& linktype,
237  reco::PFBlock::LinkTest& linktest,
238  double& dist) const;
239 
242  double testTrackAndPS(const reco::PFRecTrack& track,
243  const reco::PFCluster& ps) const;
244 
247  double testECALAndHCAL(const reco::PFCluster& ecal,
248  const reco::PFCluster& hcal) const;
249 
252  double testHCALAndHO(const reco::PFCluster& hcal,
253  const reco::PFCluster& ho) const;
254 
255 
258  double testPS1AndPS2(const reco::PFCluster& ps1,
259  const reco::PFCluster& ps2) const;
260 
262  double testLinkBySuperCluster(const reco::PFClusterRef & elt1,
263  const reco::PFClusterRef & elt2) const;
264 
267  const reco::PFClusterRef & elt2) const;
268 
273  const reco::GsfPFRecTrackCollection& gsftracks,
274  const reco::PFClusterCollection& ecals,
275  const reco::PFClusterCollection& hcals,
276  const reco::PFClusterCollection& hos,
277  const reco::PFClusterCollection& hfems,
278  const reco::PFClusterCollection& hfhads,
280  const reco::PhotonCollection& egphh,
281  const reco::SuperClusterCollection& sceb,
282  const reco::SuperClusterCollection& scee,
283  const Mask& trackMask,
284  const Mask& gsftrackMask,
285  const Mask& ecalMask,
286  const Mask& hcalMask,
287  const Mask& hoMask,
288  const Mask& hfemMask,
289  const Mask& hfhadMask,
290  const Mask& psMask,
291  const Mask& phMask,
292  const Mask& scMask) const;
293 
295  // PFResolutionMap* openResolutionMap(const char* resMapName);
296 
298  bool goodPtResolution( const reco::TrackRef& trackref);
299 
300  double testLinkByVertex(const reco::PFBlockElement* elt1,
301  const reco::PFBlockElement* elt2) const;
302 
303  int muAssocToTrack( const reco::TrackRef& trackref,
304  const edm::Handle<reco::MuonCollection>& muonh) const;
305  int muAssocToTrack( const reco::TrackRef& trackref,
306  const edm::OrphanHandle<reco::MuonCollection>& muonh) const;
307 
308  template< template<typename> class T>
310 
311  std::auto_ptr< reco::PFBlockCollection > blocks_;
312 
314  // std::vector< reco::PFCandidate > particles_;
315 
316  // the test elements will be transferred to the blocks
317  std::list< reco::PFBlockElement* > elements_;
318 
319  // Glowinski & Gouzevitch
324  // !Glowinski & Gouzevitch
325 
326  static const Mask dummyMask_;
327 
329  std::vector<double> DPtovPtCut_;
330 
332  std::vector<unsigned> NHitCut_;
333 
336 
339 
342 
343  //flag to control whether superclusters are matched to ecal pfclusters by reference instead of det id overlap
344  //(more robust, but requires that the SuperClusters were produced from PFClusters together with the
345  //appropriate ValueMap
347 
349 
350  // This parameters defines the level of purity of
351  // nuclear interactions choosen.
352  // Level 1 is only high Purity sample labeled as isNucl.
353  // Level 2 isNucl + isNucl_Loose (2 secondary tracks vertices)
354  // Level 3 isNucl + isNucl_Loose + isNucl_Kink
355  // (low purity sample made of 1 primary and 1 secondary track)
356  // By default the level 1 is teh safest one.
358 
361 
365  std::vector<reco::SuperClusterRef > superClusters_;
366 
368  // std::map<reco::PFClusterRef,int> pfcRefSCMap_;
369  std::vector<int> pfcSCVec_;
370 
371  // A boolean to avoid to compare ECAL and ECAl if there i no superclusters in the event
373 
375  std::vector<std::vector<reco::PFClusterRef> > scpfcRefs_;
377  bool debug_;
378 
379  friend std::ostream& operator<<(std::ostream&, const PFBlockAlgo&);
380 
381  // Create links between tracks or HCAL clusters, and HO clusters
382  bool useHO_;
383 
384 };
385 
391 
392 template< template<typename> class T >
393 void
395  const T<reco::GsfPFRecTrackCollection>& gsftrackh,
396  const T<reco::GsfPFRecTrackCollection>& convbremgsftrackh,
397  const T<reco::MuonCollection>& muonh,
399  const T<reco::PFRecTrackCollection>& nucleartrackh,
400  const T<reco::PFConversionCollection>& convh,
401  const T<reco::PFV0Collection>& v0,
402  const T<reco::PFClusterCollection>& ecalh,
403  const T<reco::PFClusterCollection>& hcalh,
404  const T<reco::PFClusterCollection>& hoh,
405  const T<reco::PFClusterCollection>& hfemh,
406  const T<reco::PFClusterCollection>& hfhadh,
407  const T<reco::PFClusterCollection>& psh,
408  const T<reco::PhotonCollection>& egphh,
410  const T<reco::SuperClusterCollection>& scee,
411  const T<edm::ValueMap<reco::CaloClusterPtr> >& pfclusterassoc,
412  const Mask& trackMask,
413  const Mask& gsftrackMask,
414  const Mask& ecalMask,
415  const Mask& hcalMask,
416  const Mask& hoMask,
417  const Mask& hfemMask,
418  const Mask& hfhadMask,
419  const Mask& psMask,
420  const Mask& phMask,
421  const Mask& scMask) {
422 
423 
424  checkMaskSize( *trackh,
425  *gsftrackh,
426  *ecalh,
427  *hcalh,
428  *hoh,
429  *hfemh,
430  *hfhadh,
431  *psh,
432  *egphh,
433  *sceb,
434  *scee,
435  trackMask,
436  gsftrackMask,
437  ecalMask,
438  hcalMask,
439  hoMask,
440  hfemMask,
441  hfhadMask,
442  psMask,
443  phMask,
444  scMask);
445 
446  /*
447  if (nucleartrackh.isValid()){
448  for(unsigned i=0;i<nucleartrackh->size(); i++) {
449  reco::PFRecTrackRef trackRef(nucleartrackh,i);
450  std::cout << *trackRef << std::endl;
451  }
452  }
453  */
454 
456  pfclusterassoc_ = pfclusterassoc.product();
457  }
458 
460  std::vector<reco::PFRecTrackRef> convBremPFRecTracks;
461  convBremPFRecTracks.clear();
462  // Super cluster mapping
463  superClusters_.clear();
464  scpfcRefs_.clear();
465  pfcSCVec_.clear();
466 
467  if(gsftrackh.isValid() ) {
468  const reco::GsfPFRecTrackCollection PFGsfProd = *(gsftrackh.product());
469  for(unsigned i=0;i<gsftrackh->size(); ++i) {
470  if( !gsftrackMask.empty() &&
471  !gsftrackMask[i] ) continue;
472  reco::GsfPFRecTrackRef refgsf(gsftrackh,i );
473 
474  if((refgsf).isNull()) continue;
475  reco::GsfTrackRef gsf=refgsf->gsfTrackRef();
476 
477  // retrieve and save the SC if ECAL-driven - Florian
478  if(gsf->extra().isAvailable() && gsf->extra()->seedRef().isAvailable()) {
479  reco::ElectronSeedRef seedRef= gsf->extra()->seedRef().castTo<reco::ElectronSeedRef>();
480  // check that the seed is valid
481  if(seedRef.isAvailable() && seedRef->isEcalDriven()) {
482  reco::SuperClusterRef scRef = seedRef->caloCluster().castTo<reco::SuperClusterRef>();
483  if(scRef.isNonnull()) {
484  std::vector<reco::SuperClusterRef>::iterator itcheck=find(superClusters_.begin(),superClusters_.end(),scRef);
485  // not present, add it
486  if(itcheck==superClusters_.end())
487  {
488  superClusters_.push_back(scRef);
491  sce->setFromGsfElectron(true);
493  elements_.push_back(sce);
494  }
495  else // it is already present, update the PFBE
496  {
497  PFBlockElementSCEqual myEqual(scRef);
498  std::list<reco::PFBlockElement*>::iterator itcheck=find_if(elements_.begin(),elements_.end(),myEqual);
499  if(itcheck!=elements_.end())
500  {
501  reco::PFBlockElementSuperCluster* thePFBE=dynamic_cast<reco::PFBlockElementSuperCluster*>(*itcheck);
502  thePFBE->setFromGsfElectron(true);
503  // std::cout << " Updating element to add electron information" << std::endl;
504  }
505 // else
506 // {
507 // std::cout << " Missing element " << std::endl;
508 // }
509  }
510  }
511  }
512  }
513 
514  reco::PFBlockElement* gsfEl;
515 
516  const std::vector<reco::PFTrajectoryPoint>
517  PfGsfPoint = PFGsfProd[i].trajectoryPoints();
518 
519  unsigned int c_gsf=0;
520  bool PassTracker = false;
521  bool GetPout = false;
522  unsigned int IndexPout = 0;
523 
524  typedef std::vector<reco::PFTrajectoryPoint>::const_iterator IP;
525  for(IP itPfGsfPoint = PfGsfPoint.begin();
526  itPfGsfPoint!= PfGsfPoint.end();++itPfGsfPoint) {
527 
528  if (itPfGsfPoint->isValid()){
529  int layGsfP = itPfGsfPoint->layer();
530  if (layGsfP == -1) PassTracker = true;
531  if (PassTracker && layGsfP > 0 && GetPout == false) {
532  IndexPout = c_gsf-1;
533  GetPout = true;
534  }
535  //const math::XYZTLorentzVector GsfMoment = itPfGsfPoint->momentum();
536  ++c_gsf;
537  }
538  }
539  math::XYZTLorentzVector pin = PfGsfPoint[0].momentum();
540  math::XYZTLorentzVector pout = PfGsfPoint[IndexPout].momentum();
541 
544  const std::vector<reco::PFRecTrackRef>& temp_convBremPFRecTracks(refgsf->convBremPFRecTrackRef());
545  if(temp_convBremPFRecTracks.size() > 0) {
546  for(unsigned int iconv = 0; iconv <temp_convBremPFRecTracks.size(); ++iconv) {
547  convBremPFRecTracks.push_back(temp_convBremPFRecTracks[iconv]);
548  }
549  }
550  }
551 
552  gsfEl = new reco::PFBlockElementGsfTrack(refgsf, pin, pout);
553 
554  elements_.push_back( gsfEl);
555 
556  std::vector<reco::PFBrem> pfbrem = refgsf->PFRecBrem();
557 
558  for (unsigned i2=0;i2<pfbrem.size(); ++i2) {
559  const double DP = pfbrem[i2].DeltaP();
560  const double SigmaDP = pfbrem[i2].SigmaDeltaP();
561  const unsigned int TrajP = pfbrem[i2].indTrajPoint();
562  if(TrajP == 99) continue;
563 
564  reco::PFBlockElement* bremEl;
565  bremEl = new reco::PFBlockElementBrem(refgsf,DP,SigmaDP,TrajP);
566  elements_.push_back(bremEl);
567 
568  }
569  }
570 
571  }
572 
574  if(useEGPhotons_ && egphh.isValid()) {
575  unsigned size=egphh->size();
576  for(unsigned isc=0; isc<size; ++isc) {
577  if(!phMask.empty() && !(phMask)[isc] ) continue;
578  if(!photonSelector_->passPhotonSelection((*egphh)[isc])) continue;
579  // std::cout << " Selected a supercluster" << std::endl;
580  // Add only the super clusters not already included
581  reco::SuperClusterRef scRef((*egphh)[isc].superCluster());
582  std::vector<reco::SuperClusterRef>::iterator itcheck=find(superClusters_.begin(),superClusters_.end(),(*egphh)[isc].superCluster());
583  if(itcheck==superClusters_.end())
584  {
585  superClusters_.push_back(scRef);
587  new reco::PFBlockElementSuperCluster((*egphh)[isc].superCluster());
588  fillFromPhoton(egphh,isc,sce);
590  elements_.push_back(sce);
591  }
592  else
593  {
594  PFBlockElementSCEqual myEqual(scRef);
595  std::list<reco::PFBlockElement*>::iterator itcheck=find_if(elements_.begin(),elements_.end(),myEqual);
596  if(itcheck!=elements_.end())
597  {
598  reco::PFBlockElementSuperCluster* thePFBE=dynamic_cast<reco::PFBlockElementSuperCluster*>(*itcheck);
599  fillFromPhoton(egphh,isc,thePFBE);
600  thePFBE->setFromPhoton(true);
601  // std::cout << " Updating element to add Photon information " << photonSelector_->passPhotonSelection((*egphh)[isc]) << std::endl;
602 
603  }
604 // else
605 // {
606 // std::cout << " Missing element " << std::endl;
607 // }
608  }
609  }
610  }
611 
613  if(useSuperClusters_ && sceb.isValid() && scee.isValid()) {
614  std::vector<reco::SuperClusterRef> screfs;
615  screfs.reserve(sceb->size()+scee->size());
616 
617  for (unsigned int isc=0; isc<sceb->size(); ++isc) {
618  reco::SuperClusterRef scRef(sceb,isc);
619  screfs.push_back(scRef);
620  }
621 
622  for (unsigned int isc=0; isc<scee->size(); ++isc) {
623  reco::SuperClusterRef scRef(scee,isc);
624  screfs.push_back(scRef);
625  }
626 
627  unsigned size=screfs.size();
628  for(unsigned isc=0; isc<size; ++isc) {
629  if(!scMask.empty() && !(scMask)[isc] ) continue;
630  //if(!photonSelector_->passPhotonSelection((*egphh)[isc])) continue;
631 
632  // std::cout << " Selected a supercluster" << std::endl;
633  // Add only the super clusters not already included
634  reco::SuperClusterRef &scRef = screfs[isc];
635  std::vector<reco::SuperClusterRef>::iterator itcheck=find(superClusters_.begin(),superClusters_.end(),scRef);
636  if(itcheck==superClusters_.end())
637  {
638  superClusters_.push_back(scRef);
642  //fillFromPhoton(egphh,isc,sce);
643  //sce->setFromPhoton(true);
644  elements_.push_back(sce);
645  }
646 // else
647 // {
648 // PFBlockElementSCEqual myEqual(scRef);
649 // std::list<reco::PFBlockElement*>::iterator itcheck=find_if(elements_.begin(),elements_.end(),myEqual);
650 // if(itcheck!=elements_.end())
651 // {
652 // reco::PFBlockElementSuperCluster* thePFBE=dynamic_cast<reco::PFBlockElementSuperCluster*>(*itcheck);
653 // //fillFromPhoton(egphh,isc,thePFBE);
654 // //thePFBE->setFromPhoton(true);
655 // // std::cout << " Updating element to add Photon information " << photonSelector_->passPhotonSelection((*egphh)[isc]) << std::endl;
656 //
657 // }
658 // // else
659 // // {
660 // // std::cout << " Missing element " << std::endl;
661 // // }
662 // }
663  }
664  }
665 
666  // set the vector to the right size so to allow random access
667  scpfcRefs_.resize(superClusters_.size());
668 
670 
672 
673  if(convh.isValid() ) {
674  reco::PFBlockElement* trkFromConversionElement;
675  for(unsigned i=0;i<convh->size(); ++i) {
676  reco::PFConversionRef convRef(convh,i);
677 
678  unsigned int trackSize=(convRef->pfTracks()).size();
679  if ( convRef->pfTracks().size() < 2) continue;
680  for(unsigned iTk=0;iTk<trackSize; ++iTk) {
681 
682  reco::PFRecTrackRef compPFTkRef = convRef->pfTracks()[iTk];
683  trkFromConversionElement = new reco::PFBlockElementTrack(convRef->pfTracks()[iTk]);
684  trkFromConversionElement->setConversionRef( convRef->originalConversion(), reco::PFBlockElement::T_FROM_GAMMACONV);
685 
686  elements_.push_back( trkFromConversionElement );
687 
688 
689  if (debug_){
690  std::cout << "PF Block Element from Conversion electron " <<
691  (*trkFromConversionElement).trackRef().key() << std::endl;
692  std::cout << *trkFromConversionElement << std::endl;
693  }
694 
695  }
696  }
697  }
698 
699 
701 
703 
704  if(v0.isValid() ) {
705  reco::PFBlockElement* trkFromV0Element = 0;
706  for(unsigned i=0;i<v0->size(); ++i) {
707  reco::PFV0Ref v0Ref( v0, i );
708  unsigned int trackSize=(v0Ref->pfTracks()).size();
709  for(unsigned iTk=0;iTk<trackSize; ++iTk) {
710 
711  reco::PFRecTrackRef newPFRecTrackRef = (v0Ref->pfTracks())[iTk];
712  reco::TrackBaseRef newTrackBaseRef(newPFRecTrackRef->trackRef());
713  bool bNew = true;
714 
717  for(IE iel = elements_.begin(); iel != elements_.end(); ++iel){
718  reco::TrackBaseRef elemTrackBaseRef((*iel)->trackRef());
719  if (newTrackBaseRef == elemTrackBaseRef){
720  trkFromV0Element = *iel;
721  bNew = false;
722  continue;
723  }
724  }
725 
727  if (bNew) {
728  trkFromV0Element = new reco::PFBlockElementTrack(v0Ref->pfTracks()[iTk]);
729  elements_.push_back( trkFromV0Element );
730  }
731 
732  trkFromV0Element->setV0Ref( v0Ref->originalV0(),
734 
735  if (debug_){
736  std::cout << "PF Block Element from V0 track New = " << bNew
737  << (*trkFromV0Element).trackRef().key() << std::endl;
738  std::cout << *trkFromV0Element << std::endl;
739  }
740 
741 
742  }
743  }
744  }
745 
747 
749 
750  if(nuclearh.isValid()) {
751  reco::PFBlockElement* trkFromDisplacedVertexElement = 0;
752  for(unsigned i=0;i<nuclearh->size(); ++i) {
753 
754  const reco::PFDisplacedTrackerVertexRef dispacedVertexRef( nuclearh, i );
755 
756  // std::cout << "Nuclear Interactions Purity " << nuclearInteractionsPurity_ << std::endl;
757  // dispacedVertexRef->displacedVertexRef()->Dump();
758  //bool bIncludeVertices = true;
759  // We add a cut at rho > 2.7 since this corresponds to the lower edge of the beam pipe
760  // This cut have to be changer when a new beam pipe would be installed
761 
762  bool bIncludeVertices = false;
763  bool bNucl = dispacedVertexRef->displacedVertexRef()->isNucl()
764  && dispacedVertexRef->displacedVertexRef()->position().rho()> 2.7;
765  bool bNucl_Loose = dispacedVertexRef->displacedVertexRef()->isNucl_Loose();
766  bool bNucl_Kink = dispacedVertexRef->displacedVertexRef()->isNucl_Kink();
767 
768  if (nuclearInteractionsPurity_ >= 1) bIncludeVertices = bNucl;
769  if (nuclearInteractionsPurity_ >= 2) bIncludeVertices = bIncludeVertices || bNucl_Loose;
770  if (nuclearInteractionsPurity_ >= 3) bIncludeVertices = bIncludeVertices || bNucl_Kink;
771 
772  if (bIncludeVertices){
773 
774  unsigned int trackSize= dispacedVertexRef->pfRecTracks().size();
775  if (debug_){
776  std::cout << "" << std::endl;
777  std::cout << "Displaced Vertex " << i << std::endl;
778  dispacedVertexRef->displacedVertexRef()->Dump();
779  }
780  for(unsigned iTk=0;iTk < trackSize; ++iTk) {
781 
782 
783  // This peace of code looks weired at first but it seems to be necessary to let
784  // PFRooTEvent work properly. Since the track position called REPPoint is transient
785  // it has to be calculated and the PFRecTrack collection associted to Displaced Vertex is not
786  // anymore the original collection. So here we match both collections if possible
787  reco::PFRecTrackRef newPFRecTrackRef = dispacedVertexRef->pfRecTracks()[iTk];
788  reco::TrackBaseRef constTrackBaseRef(newPFRecTrackRef->trackRef());
789 
790 
791  if (nucleartrackh.isValid()){
792  for(unsigned i=0;i<nucleartrackh->size(); ++i) {
793  reco::PFRecTrackRef transientPFRecTrackRef(nucleartrackh,i);
794  reco::TrackBaseRef transientTrackBaseRef(transientPFRecTrackRef->trackRef());
795  if (constTrackBaseRef==transientTrackBaseRef){
796  newPFRecTrackRef = transientPFRecTrackRef;
797  break;
798  }
799  }
800  }
801  reco::TrackBaseRef newTrackBaseRef(newPFRecTrackRef->trackRef());
802 
803 
804 
805  bool bNew = true;
807 
810  for(IE iel = elements_.begin(); iel != elements_.end(); ++iel){
811  reco::TrackBaseRef elemTrackBaseRef((*iel)->trackRef());
812  if (newTrackBaseRef == elemTrackBaseRef){
813  trkFromDisplacedVertexElement = *iel;
814  bNew = false;
815  continue;
816  }
817  }
818 
819 
821  if (bNew) {
822 
823 
824 
825  trkFromDisplacedVertexElement = new reco::PFBlockElementTrack(newPFRecTrackRef);
826  elements_.push_back( trkFromDisplacedVertexElement );
827  }
828 
829  if (dispacedVertexRef->isIncomingTrack(newPFRecTrackRef))
831  else if (dispacedVertexRef->isOutgoingTrack(newPFRecTrackRef))
833  else
834  blockType = reco::PFBlockElement::DEFAULT;
835 
837  trkFromDisplacedVertexElement->setDisplacedVertexRef( dispacedVertexRef, blockType );
838 
839 
840  if (debug_){
841  std::cout << "PF Block Element from DisplacedTrackingVertex track New = " << bNew
842  << (*trkFromDisplacedVertexElement).trackRef().key() << std::endl;
843  std::cout << *trkFromDisplacedVertexElement << std::endl;
844  }
845 
846 
847  }
848  }
849  }
850 
851  if (debug_) std::cout << "" << std::endl;
852 
853  }
854 
856 
860 
861  if(trackh.isValid() ) {
862 
863  if (debug_) std::cout << "Tracks already in from Displaced Vertices " << std::endl;
864 
865  Mask trackMaskVertex;
866 
867  for(unsigned i=0;i<trackh->size(); ++i) {
868  reco::PFRecTrackRef pfRefTrack( trackh,i );
869  reco::TrackRef trackRef = pfRefTrack->trackRef();
870 
871  bool bMask = true;
872  for(IE iel = elements_.begin(); iel != elements_.end(); ++iel){
873  reco::TrackRef elemTrackRef = (*iel)->trackRef();
874  if( trackRef == elemTrackRef ) {
875  if (debug_) std::cout << " " << trackRef.key();
876  bMask = false; continue;
877  }
878  }
879 
880  trackMaskVertex.push_back(bMask);
881  }
882 
883  if (debug_) std::cout << "" << std::endl;
884 
885  if (debug_) std::cout << "Additionnal tracks from main collection " << std::endl;
886 
887  for(unsigned i=0;i<trackh->size(); ++i) {
888 
889 
890  // this track has been disabled
891  if( !trackMask.empty() && !trackMask[i] ) continue;
892 
893  reco::PFRecTrackRef ref( trackh,i );
894 
895  if (debug_) std::cout << " " << ref->trackRef().key();
896 
897  // Get the eventual muon associated to this track
898  int muId_ = muAssocToTrack( ref->trackRef(), muonh );
899  bool thisIsAPotentialMuon = false;
900  if( muId_ != -1 ) {
901  reco::MuonRef muonref( muonh, muId_ );
902  thisIsAPotentialMuon =
903  PFMuonAlgo::isLooseMuon(muonref) ||
904  PFMuonAlgo::isMuon(muonref);
905  }
906  // Reject bad tracks (except if identified as muon
907  if( !thisIsAPotentialMuon && !goodPtResolution( ref->trackRef() ) ) continue;
908 
909  if (thisIsAPotentialMuon && debug_) std::cout << "Potential Muon P " << ref->trackRef()->p()
910  << " pt " << ref->trackRef()->p() << std::endl;
911 
912 
913 
914  reco::PFBlockElement* primaryElement = new reco::PFBlockElementTrack( ref );
915 
916  if( muId_ != -1 ) {
917  // if a muon has been found
918  reco::MuonRef muonref( muonh, muId_ );
919 
920  // If this track was already added to the collection, we just need to find the associated element and
921  // attach to it the reference
922  if (!trackMaskVertex.empty() && !trackMaskVertex[i]){
923  reco::TrackRef primaryTrackRef = ref->trackRef();
924  for(IE iel = elements_.begin(); iel != elements_.end(); ++iel){
925  reco::TrackRef elemTrackRef = (*iel)->trackRef();
926  if( primaryTrackRef == elemTrackRef ) {
927  (*iel)->setMuonRef( muonref );
928  if (debug_) std::cout << "One of the tracks identified in displaced vertices collections was spotted as muon" <<std:: endl;
929  }
930  }
931  } else primaryElement->setMuonRef( muonref );
932 
933  }
934 
935  if (!trackMaskVertex.empty() && !trackMaskVertex[i]) continue;
936 
937 
938  // set track type T_FROM_GAMMA for pfrectracks associated to conv brems
940  if(convBremPFRecTracks.size() > 0.) {
941  for(unsigned int iconv = 0; iconv < convBremPFRecTracks.size(); ++iconv) {
942  if((*ref).trackRef() == (*convBremPFRecTracks[iconv]).trackRef()) {
943  bool value = true;
945  }
946  }
947  }
948  }
949  elements_.push_back( primaryElement );
950  }
951 
952  if (debug_) std::cout << " " << std::endl;
953 
954  }
955 
956 
957  // -------------- GSF tracks and brems for Conversion Recovery ----------
958 
959  if(convbremgsftrackh.isValid() ) {
960 
961 
962  const reco::GsfPFRecTrackCollection ConvPFGsfProd = *(convbremgsftrackh.product());
963  for(unsigned i=0;i<convbremgsftrackh->size(); ++i) {
964 
965  reco::GsfPFRecTrackRef refgsf(convbremgsftrackh,i );
966 
967  if((refgsf).isNull()) continue;
968 
969  reco::PFBlockElement* gsfEl;
970 
971  const std::vector<reco::PFTrajectoryPoint>
972  PfGsfPoint = ConvPFGsfProd[i].trajectoryPoints();
973 
974  unsigned int c_gsf=0;
975  bool PassTracker = false;
976  bool GetPout = false;
977  unsigned int IndexPout = -1;
978 
979  typedef std::vector<reco::PFTrajectoryPoint>::const_iterator IP;
980  for(IP itPfGsfPoint = PfGsfPoint.begin();
981  itPfGsfPoint!= PfGsfPoint.end();++itPfGsfPoint) {
982 
983  if (itPfGsfPoint->isValid()){
984  int layGsfP = itPfGsfPoint->layer();
985  if (layGsfP == -1) PassTracker = true;
986  if (PassTracker && layGsfP > 0 && GetPout == false) {
987  IndexPout = c_gsf-1;
988  GetPout = true;
989  }
990  //const math::XYZTLorentzVector GsfMoment = itPfGsfPoint->momentum();
991  ++c_gsf;
992  }
993  }
994  math::XYZTLorentzVector pin = PfGsfPoint[0].momentum();
995  math::XYZTLorentzVector pout = PfGsfPoint[IndexPout].momentum();
996 
997 
998 
999  gsfEl = new reco::PFBlockElementGsfTrack(refgsf, pin, pout);
1000 
1001  bool valuegsf = true;
1002  // IMPORTANT SET T_FROM_GAMMACONV trackType() FOR CONVERSIONS
1004 
1005 
1006 
1007  elements_.push_back( gsfEl);
1008  std::vector<reco::PFBrem> pfbrem = refgsf->PFRecBrem();
1009 
1010  for (unsigned i2=0;i2<pfbrem.size(); ++i2) {
1011  const double DP = pfbrem[i2].DeltaP();
1012  const double SigmaDP = pfbrem[i2].SigmaDeltaP();
1013  const unsigned int TrajP = pfbrem[i2].indTrajPoint();
1014  if(TrajP == 99) continue;
1015 
1016  reco::PFBlockElement* bremEl;
1017  bremEl = new reco::PFBlockElementBrem(refgsf,DP,SigmaDP,TrajP);
1018  elements_.push_back(bremEl);
1019 
1020  }
1021  }
1022  }
1023 
1024 
1025  // -------------- ECAL clusters ---------------------
1026 
1027 
1028  if(ecalh.isValid() ) {
1029  // pfcSCVec_.resize(ecalh->size(),-1);
1030 
1031  bNoSuperclus_ = (superClusters_.size() == 0);
1032  if (!bNoSuperclus_) pfcSCVec_.resize(ecalh->size(),-1);
1033 
1034 
1035  for(unsigned i=0;i<ecalh->size(); ++i) {
1036 
1037  // this ecal cluster has been disabled
1038  if( !ecalMask.empty() &&
1039  !ecalMask[i] ) continue;
1040 
1041  reco::PFClusterRef ref( ecalh,i );
1043  = new reco::PFBlockElementCluster( ref,
1045  elements_.push_back( te );
1046 
1047  if (!bNoSuperclus_) {
1048 
1049  // Now mapping with Superclusters
1050  int scindex = -1;
1053  }
1054  else {
1056  }
1057 
1058  if(scindex>=0) {
1059  pfcSCVec_[ref.key()]=scindex;
1060  scpfcRefs_[scindex].push_back(ref);
1061  }
1062  }
1063 
1064  }
1065 
1066  bNoSuperclus_ = (scpfcRefs_.size() == 0);
1067 
1068  }
1069 
1070  // -------------- HCAL clusters ---------------------
1071 
1072  if(hcalh.isValid() ) {
1073 
1074  for(unsigned i=0;i<hcalh->size(); ++i) {
1075 
1076  // this hcal cluster has been disabled
1077  if( !hcalMask.empty() &&
1078  !hcalMask[i] ) continue;
1079 
1080  reco::PFClusterRef ref( hcalh,i );
1082  = new reco::PFBlockElementCluster( ref,
1084  elements_.push_back( th );
1085  }
1086  }
1087 
1088  // -------------- HO clusters ---------------------
1089 
1090  if(useHO_ && hoh.isValid() ) {
1091 
1092  for(unsigned i=0;i<hoh->size(); ++i) {
1093 
1094  // this hcal cluster has been disabled
1095  if( !hoMask.empty() &&
1096  !hoMask[i] ) continue;
1097 
1098  reco::PFClusterRef ref( hoh,i );
1100  = new reco::PFBlockElementCluster( ref,
1102  elements_.push_back( th );
1103  }
1104  }
1105 
1106  // -------------- HFEM clusters ---------------------
1107 
1108  if(hfemh.isValid() ) {
1109 
1110  for(unsigned i=0;i<hfemh->size(); ++i) {
1111 
1112  // this hfem cluster has been disabled
1113  if( !hfemMask.empty() &&
1114  !hfemMask[i] ) continue;
1115 
1116  reco::PFClusterRef ref( hfemh,i );
1118  = new reco::PFBlockElementCluster( ref,
1120  elements_.push_back( th );
1121  }
1122  }
1123 
1124 
1125  // -------------- HFHAD clusters ---------------------
1126 
1127  if(hfhadh.isValid() ) {
1128 
1129  for(unsigned i=0;i<hfhadh->size(); ++i) {
1130 
1131  // this hfhad cluster has been disabled
1132  if( !hfhadMask.empty() &&
1133  !hfhadMask[i] ) continue;
1134 
1135  reco::PFClusterRef ref( hfhadh,i );
1137  = new reco::PFBlockElementCluster( ref,
1139  elements_.push_back( th );
1140  }
1141  }
1142 
1143 
1144 
1145 
1146  // -------------- PS clusters ---------------------
1147 
1148  if(psh.isValid() ) {
1149  for(unsigned i=0;i<psh->size(); ++i) {
1150 
1151  // this ps cluster has been disabled
1152  if( !psMask.empty() &&
1153  !psMask[i] ) continue;
1155  reco::PFClusterRef ref( psh,i );
1156  // two types of elements: PS1 (V) and PS2 (H)
1157  // depending on layer: PS1 or PS2
1158  switch(ref->layer()){
1159  case PFLayer::PS1:
1161  break;
1162  case PFLayer::PS2:
1164  break;
1165  default:
1166  break;
1167  }
1169  = new reco::PFBlockElementCluster( ref,
1170  type );
1171  elements_.push_back( tp );
1172  }
1173  }
1174 
1175 
1176  // -------------- Loop over block elements ---------------------
1177 
1178  // Here we provide to all KDTree linkers the collections to link.
1179  // Glowinski & Gouzevitch
1180 
1181  for (std::list< reco::PFBlockElement* >::iterator it = elements_.begin();
1182  it != elements_.end(); ++it) {
1183  switch ((*it)->type()){
1184 
1187  if ( (*it)->trackRefPF()->extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() )
1189  if ( (*it)->trackRefPF()->extrapolatedPoint( reco::PFTrajectoryPoint::HCALEntrance ).isValid() )
1191  }
1192 
1193  break;
1194 
1199  break;
1200 
1204  break;
1205 
1208  // THLinker_.insertFieldClusterElt(*it);
1209  }
1210  break;
1211 
1212 
1217  }
1218  break;
1219 
1220  default:
1221  break;
1222  }
1223  }
1224 }
1225 
1226 
1227 template< template<typename> class T>
1229  reco::PhotonRef photonRef(egh,isc);
1230  pfbe->setTrackIso(photonRef->trkSumPtHollowConeDR04());
1231  pfbe->setEcalIso(photonRef->ecalRecHitSumEtConeDR04());
1232  pfbe->setHcalIso(photonRef->hcalTowerSumEtConeDR04());
1233  pfbe->setHoE(photonRef->hadronicOverEm());
1234  pfbe->setPhotonRef(photonRef);
1235  pfbe->setFromPhoton(true);
1236  }
1237 
1238 #endif
1239 
1240 
const std::auto_ptr< reco::PFBlockCollection > & blocks() const
Definition: PFBlockAlgo.h:194
void insertFieldClusterElt(reco::PFBlockElement *hcalCluster)
type
Definition: HCALResponse.h:21
Abstract base class for a PFBlock element (track, cluster...)
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
int i
Definition: DBlmapReader.cc:9
std::vector< reco::SuperClusterRef > superClusters_
list of superclusters
Definition: PFBlockAlgo.h:365
bool passPhotonSelection(const reco::Photon &) const
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27
void clear()
Definition: ValueMap.h:154
double testECALAndHCAL(const reco::PFCluster &ecal, const reco::PFCluster &hcal) const
Definition: PFBlockAlgo.cc:936
bool useIterTracking_
Flag to turn off quality cuts which require iterative tracking (for heavy-ions)
Definition: PFBlockAlgo.h:335
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:43
static bool isMuon(const reco::PFBlockElement &elt)
Definition: PFMuonAlgo.cc:153
static HepMC::IO_HEPEVT conv
void setHOTag(bool ho)
Definition: PFBlockAlgo.h:205
double testSuperClusterPFCluster(const reco::SuperClusterRef &sct1, const reco::PFClusterRef &elt2) const
test association between SuperClusters and ECAL
KDTreeLinkerTrackEcal TELinker_
Definition: PFBlockAlgo.h:321
double testHCALAndHO(const reco::PFCluster &hcal, const reco::PFCluster &ho) const
Definition: PFBlockAlgo.cc:966
KDTreeLinkerPSEcal PSELinker_
Definition: PFBlockAlgo.h:323
friend std::ostream & operator<<(std::ostream &, const PFBlockAlgo &)
int nuclearInteractionsPurity_
Definition: PFBlockAlgo.h:357
const edm::ValueMap< reco::CaloClusterPtr > * pfclusterassoc_
Definition: PFBlockAlgo.h:348
void checkDisplacedVertexLinks(reco::PFBlock &block) const
remove extra links between primary track and clusters
void setInput(const T< reco::PFRecTrackCollection > &trackh, const T< reco::GsfPFRecTrackCollection > &gsftrackh, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &hoh, const T< reco::PFClusterCollection > &psh, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hoMask=dummyMask_, const Mask &psMask=dummyMask_)
COLIN: what is this setinput function for? can it be removed?
Definition: PFBlockAlgo.h:161
void setFromGsfElectron(bool val)
set provenance
std::auto_ptr< reco::PFBlockCollection > blocks_
Definition: PFBlockAlgo.h:311
std::vector< double > DPtovPtCut_
DPt/Pt cut for creating atrack element.
Definition: PFBlockAlgo.h:329
bool isAvailable() const
Definition: Ref.h:276
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
bool superClusterMatchByRef_
Definition: PFBlockAlgo.h:346
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
double testTrackAndPS(const reco::PFRecTrack &track, const reco::PFCluster &ps) const
Definition: PFBlockAlgo.cc:872
std::list< reco::PFBlockElement * >::const_iterator IEC
Definition: PFBlockAlgo.h:202
virtual void setTrackType(TrackType trType, bool value)
the trackType
Particle Flow Algorithm.
Definition: PFBlockAlgo.h:71
void fillFromPhoton(const T< reco::PhotonCollection > &, unsigned isc, reco::PFBlockElementSuperCluster *pfbe)
Definition: PFBlockAlgo.h:1228
void setFromPhoton(bool val)
set provenance
void setHcalIso(float val)
set the had Iso
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double testLinkBySuperCluster(const reco::PFClusterRef &elt1, const reco::PFClusterRef &elt2) const
test association by Supercluster between two ECAL
Definition: PFBlockAlgo.cc:997
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
KDTreeLinkerTrackHcal THLinker_
Definition: PFBlockAlgo.h:322
double testPS1AndPS2(const reco::PFCluster &ps1, const reco::PFCluster &ps2) const
bool useSuperClusters_
Flag to turn off the import of SuperCluster collections.
Definition: PFBlockAlgo.h:341
void setInput(const T< reco::PFRecTrackCollection > &trackh, const T< reco::MuonCollection > &muonh, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &hoh, const T< reco::PFClusterCollection > &hfemh, const T< reco::PFClusterCollection > &hfhadh, const T< reco::PFClusterCollection > &psh, const Mask &trackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hoMask=dummyMask_, const Mask &psMask=dummyMask_)
COLIN: I think this is for particle flow at HLT...
Definition: PFBlockAlgo.h:130
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void setTrackIso(float val)
set the track Iso
bool useConvBremPFRecTracks_
switch on/off Conversions Brem Recovery with KF Tracks
Definition: PFBlockAlgo.h:360
void setPhotonRef(const PhotonRef &ref)
set photonRef
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:186
virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType)
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:323
tuple IP
Definition: listHistos.py:76
virtual void setV0Ref(const VertexCompositeCandidateRef &v0ref, TrackType trType)
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
std::list< reco::PFBlockElement * >::iterator IE
define these in *Fwd files in DataFormats/ParticleFlowReco?
Definition: PFBlockAlgo.h:201
void buildGraph()
Definition: PFBlockAlgo.cc:316
std::list< reco::PFBlockElement * > elements_
actually, particles will be created by a separate producer
Definition: PFBlockAlgo.h:317
void insertTargetElt(reco::PFBlockElement *track)
std::vector< std::vector< reco::PFClusterRef > > scpfcRefs_
PF clusters corresponding to a given SC.
Definition: PFBlockAlgo.h:375
bool goodPtResolution(const reco::TrackRef &trackref)
open a resolution map
void packLinks(reco::PFBlock &block, const std::vector< PFBlockLink > &links) const
Definition: PFBlockAlgo.cc:242
static const Mask dummyMask_
Definition: PFBlockAlgo.h:326
reco::PFBlockCollection::const_iterator IBC
Definition: PFBlockAlgo.h:203
IE associate(IE next, IE last, std::vector< PFBlockLink > &links)
Definition: PFBlockAlgo.cc:128
const PhotonSelectorAlgo * photonSelector_
PhotonSelector.
Definition: PFBlockAlgo.h:363
void setInput(const T< reco::PFRecTrackCollection > &trackh, const T< reco::GsfPFRecTrackCollection > &gsftrackh, const T< reco::GsfPFRecTrackCollection > &convbremgsftrackh, const T< reco::MuonCollection > &muonh, const T< reco::PFDisplacedTrackerVertexCollection > &nuclearh, const T< reco::PFRecTrackCollection > &nucleartrackh, const T< reco::PFConversionCollection > &conv, const T< reco::PFV0Collection > &v0, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &hoh, const T< reco::PFClusterCollection > &hfemh, const T< reco::PFClusterCollection > &hfhadh, const T< reco::PFClusterCollection > &psh, const T< reco::PhotonCollection > &egphh, const T< reco::SuperClusterCollection > &sceb, const T< reco::SuperClusterCollection > &scee, const T< edm::ValueMap< reco::CaloClusterPtr > > &pfclusterassoc, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hoMask=dummyMask_, const Mask &hfemMask=dummyMask_, const Mask &hfhadMask=dummyMask_, const Mask &psMask=dummyMask_, const Mask &phMask=dummyMask_, const Mask &scMask=dummyMask_)
set input collections of tracks and clusters
Definition: PFBlockAlgo.h:394
void checkMaskSize(const reco::PFRecTrackCollection &tracks, const reco::GsfPFRecTrackCollection &gsftracks, const reco::PFClusterCollection &ecals, const reco::PFClusterCollection &hcals, const reco::PFClusterCollection &hos, const reco::PFClusterCollection &hfems, const reco::PFClusterCollection &hfhads, const reco::PFClusterCollection &pss, const reco::PhotonCollection &egphh, const reco::SuperClusterCollection &sceb, const reco::SuperClusterCollection &scee, const Mask &trackMask, const Mask &gsftrackMask, const Mask &ecalMask, const Mask &hcalMask, const Mask &hoMask, const Mask &hfemMask, const Mask &hfhadMask, const Mask &psMask, const Mask &phMask, const Mask &scMask) const
#define debug
Definition: HDRShower.cc:19
virtual void setConversionRef(const ConversionRef &convRef, TrackType trType)
double testLinkByVertex(const reco::PFBlockElement *elt1, const reco::PFBlockElement *elt2) const
tuple tracks
Definition: testEve_cfg.py:39
static bool isLooseMuon(const reco::PFBlockElement &elt)
Definition: PFMuonAlgo.cc:166
std::auto_ptr< reco::PFBlockCollection > transferBlocks()
Definition: PFBlockAlgo.h:198
void insertTargetElt(reco::PFBlockElement *track)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
bool linkPrefilter(const reco::PFBlockElement *last, const reco::PFBlockElement *next) const
Avoid to check links when not useful.
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
void findBlocks()
build blocks
Definition: PFBlockAlgo.cc:86
std::vector< int > pfcSCVec_
SC corresponding to the PF cluster.
Definition: PFBlockAlgo.h:369
void insertTargetElt(reco::PFBlockElement *psCluster)
virtual void setMuonRef(const MuonRef &muref)
static int checkOverlap(const reco::PFCluster &pfc, const std::vector< const reco::SuperCluster * > &sc, float minfrac=0.01, bool debug=false)
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
tuple cout
Definition: gather_cfg.py:121
std::vector< bool > Mask
Definition: PFBlockAlgo.h:95
void setUseOptimization(bool useKDTreeTrackEcalLinker)
Definition: PFBlockAlgo.cc:66
bool bNoSuperclus_
Definition: PFBlockAlgo.h:372
bool debug_
if true, debug printouts activated
Definition: PFBlockAlgo.h:377
long double T
void setParameters(std::vector< double > &DPtovPtCut, std::vector< unsigned > &NHitCut, bool useConvBremPFRecTracks, bool useIterTracking, int nuclearInteractionsPurity, bool useEGPhotons, std::vector< double > &photonSelectionCuts, bool useSuperClusters, bool superClusterMatchByRef)
Definition: PFBlockAlgo.cc:31
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
tuple size
Write out results.
bool useEGPhotons_
Flag to turn off the import of EG Photons.
Definition: PFBlockAlgo.h:338
bool useKDTreeTrackEcalLinker_
Definition: PFBlockAlgo.h:320
void setEcalIso(float val)
set the ecal Iso
std::vector< unsigned > NHitCut_
Number of layers crossed cut for creating atrack element.
Definition: PFBlockAlgo.h:332
Block of elements.
Definition: PFBlock.h:30