CMS 3D CMS Logo

PFBlockAlgo Class Reference

Particle Flow Algorithm. More...

#include <RecoParticleFlow/PFBlockAlgo/interface/PFBlockAlgo.h>

List of all members.

Public Types

typedef
reco::PFBlockCollection::const_iterator 
IBC
typedef std::list
< reco::PFBlockElement * >
::iterator 
IE
 define these in *Fwd files in DataFormats/ParticleFlowReco?
typedef std::list
< reco::PFBlockElement * >
::const_iterator 
IEC
typedef std::vector< boolMask

Public Member Functions

const std::auto_ptr
< reco::PFBlockCollection > & 
blocks () const
 
Returns:
collection of blocks

void findBlocks ()
 build blocks
 PFBlockAlgo ()
void setDebug (bool debug)
 sets debug printout flag
template<template< typename > class T>
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 > &psh, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &psMask=dummyMask_)
template<template< typename > class T>
void setInput (const T< reco::PFRecTrackCollection > &trackh, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &psh, const Mask &trackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &psMask=dummyMask_)
template<template< typename > class T>
void setInput (const T< reco::PFRecTrackCollection > &trackh, const T< reco::GsfPFRecTrackCollection > &gsftrackh, const T< reco::MuonCollection > &muonh, const T< reco::PFNuclearInteractionCollection > &nuclh, const T< reco::PFConversionCollection > &conv, const T< reco::PFV0Collection > &v0, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &psh, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &psMask=dummyMask_)
 set input collections of tracks and clusters
void setParameters (const char *resMapEtaECAL, const char *resMapPhiECAL, const char *resMapEtaHCAL, const char *resMapPhiHCAL, double DPtovPtCut, double chi2TrackECAL, double chi2GSFECAL, double chi2TrackHCAL, double chi2ECALHCAL, double chi2PSECAL, double chi2PSTrack, double chi2PSHV, bool multiLink)
std::auto_ptr
< reco::PFBlockCollection
transferBlocks ()
 
Returns:
auto_ptr to collection of blocks

 ~PFBlockAlgo ()

Private Member Functions

IE associate (IE next, IE last, std::vector< PFBlockLink > &links)
 recursive procedure which adds elements from elements_ to the current block, ie blocks_->back().
void buildGraph ()
void checkMaskSize (const reco::PFRecTrackCollection &tracks, const reco::GsfPFRecTrackCollection &gsftracks, const reco::PFClusterCollection &ecals, const reco::PFClusterCollection &hcals, const reco::PFClusterCollection &pss, const Mask &trackMask, const Mask &gsftrackMask, const Mask &ecalMask, const Mask &hcalMask, const Mask &psMask) const
 checks size of the masks with respect to the vectors they refer to.
void checkNuclearLinks (reco::PFBlock &block) const
 remove extra links between primary track and clusters
std::pair< double, double > computeChi2 (double eta1, double reta1, double phi1, double rphi1, double eta2, double reta2, double phi2, double rphi2) const
 computes a chisquare
void fillSecondaries (const reco::PFNuclearInteractionRef &nuclref)
bool goodPtResolution (const reco::TrackRef &trackref)
 open a resolution map
void link (const reco::PFBlockElement *el1, const reco::PFBlockElement *el2, PFBlockLink::Type &linktype, reco::PFBlock::LinkTest &linktest, double &chi2, double &dist) const
 check whether 2 elements are linked. Returns chi2 and linktype
int muAssocToTrack (const reco::TrackRef &trackref, const edm::OrphanHandle< reco::MuonCollection > &muonh) const
int muAssocToTrack (const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
 find index of the muon associated to trackref.
int niAssocToTrack (const reco::TrackRef &primTkRef, const edm::OrphanHandle< reco::PFNuclearInteractionCollection > &good_ni) const
int niAssocToTrack (const reco::TrackRef &primTkRef, const edm::Handle< reco::PFNuclearInteractionCollection > &good_ni) const
 find index of the nuclear interaction associated to primTkRef.
void packLinks (reco::PFBlock &block, const std::vector< PFBlockLink > &links) const
 compute missing links in the blocks (the recursive procedure does not build all links)
std::pair< double, double > testECALAndHCAL (const reco::PFCluster &ecal, const reco::PFCluster &hcal) const
 tests association between an ECAL and an HCAL cluster
std::pair< double, double > testLinkByRecHit (const reco::PFRecTrack &track, const reco::PFCluster &cluster) const
std::pair< double, double > testLinkByVertex (const reco::PFBlockElement *elt1, const reco::PFBlockElement *elt2) const
std::pair< double, double > testPS1AndPS2 (const reco::PFCluster &ps1, const reco::PFCluster &ps2) const
 tests association between a PS1 v cluster and a PS2 h cluster returns chi2
std::pair< double, double > testPSAndECAL (const reco::PFCluster &ps, const reco::PFCluster &ecal) const
 tests association between an PS and an ECAL cluster returns chi2
std::pair< double, double > testTrackAndECAL (const reco::PFRecTrack &track, const reco::PFCluster &ecal, double SignBremDp=10.) const
 tests association between a track and an ECAL cluster
std::pair< double, double > testTrackAndHCAL (const reco::PFRecTrack &track, const reco::PFCluster &hcal) const
 tests association between a track and an HCAL cluster
std::pair< double, double > testTrackAndPS (const reco::PFRecTrack &track, const reco::PFCluster &ps) const
 tests association between a track and a PS cluster returns chi2
int v0AssocToTrack (const reco::TrackRef &trackref, const edm::OrphanHandle< reco::PFV0Collection > &v0) const
int v0AssocToTrack (const reco::TrackRef &trackref, const edm::Handle< reco::PFV0Collection > &v0) const
 find index of the V0 track associated to trackref.

Private Attributes

std::auto_ptr
< reco::PFBlockCollection
blocks_
double chi2ECALHCAL_
 max chi2 for ECAL/HCAL association
double chi2GSFECAL_
 max chi2 for GSF/ECAL association
double chi2PSECAL_
 max chi2 for PS/ECAL association
double chi2PSHV_
 max chi2 for PSH/PSV association
double chi2PSTrack_
 max chi2 for PS/Track association
double chi2TrackECAL_
 max chi2 for track/ECAL association
double chi2TrackHCAL_
 max chi2 for track/HCAL association
bool debug_
 if true, debug printouts activated
double DPtovPtCut_
 DPt/Pt cut for creating atrack element.
std::list< reco::PFBlockElement * > elements_
 actually, particles will be created by a separate producer
bool multipleLink_
 if true, using special algorithm to process multiple track associations to the same hcal cluster
PFResolutionMapresMapEtaECAL_
 resolution map Eta ECAL
PFResolutionMapresMapEtaHCAL_
 resolution map Eta HCAL
PFResolutionMapresMapPhiECAL_
 resolution map Phi ECAL
PFResolutionMapresMapPhiHCAL_
 resolution map Phi HCAL
double resPSlength_
 PS resolution along strip.
double resPSpitch_
 PS strip resolution.

Static Private Attributes

static const Mask dummyMask_

Friends

std::ostream & operator<< (std::ostream &, const PFBlockAlgo &)


Detailed Description

Particle Flow Algorithm.

Author:
Colin Bernet
Date:
January 2006

Definition at line 49 of file PFBlockAlgo.h.


Member Typedef Documentation

typedef reco::PFBlockCollection::const_iterator PFBlockAlgo::IBC

Definition at line 147 of file PFBlockAlgo.h.

typedef std::list< reco::PFBlockElement* >::iterator PFBlockAlgo::IE

define these in *Fwd files in DataFormats/ParticleFlowReco?

Definition at line 145 of file PFBlockAlgo.h.

typedef std::list< reco::PFBlockElement* >::const_iterator PFBlockAlgo::IEC

Definition at line 146 of file PFBlockAlgo.h.

typedef std::vector<bool> PFBlockAlgo::Mask

Definition at line 72 of file PFBlockAlgo.h.


Constructor & Destructor Documentation

PFBlockAlgo::PFBlockAlgo (  ) 

Definition at line 20 of file PFBlockAlgo.cc.

00020                          : 
00021   blocks_( new reco::PFBlockCollection ),
00022   //   tracks_(tracks),
00023   //   clustersECAL_(clustersECAL),
00024   //   clustersHCAL_(clustersHCAL),
00025   resMapEtaECAL_(0),
00026   resMapPhiECAL_(0),
00027   resMapEtaHCAL_(0),
00028   resMapPhiHCAL_(0), 
00029   DPtovPtCut_(999),
00030   chi2TrackECAL_(-1),
00031   chi2GSFECAL_(-1),
00032   chi2TrackHCAL_(-1), 
00033   chi2ECALHCAL_ (-1),
00034   chi2PSECAL_ (-1), 
00035   chi2PSTrack_ (-1), 
00036   chi2PSHV_ (-1), 
00037   resPSpitch_ (0),
00038   resPSlength_ (0),
00039   debug_(false) {}

PFBlockAlgo::~PFBlockAlgo (  ) 

Definition at line 84 of file PFBlockAlgo.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, elements_, lat::endl(), resMapEtaECAL_, resMapEtaHCAL_, resMapPhiECAL_, and resMapPhiHCAL_.

00084                           {
00085 
00086 #ifdef PFLOW_DEBUG
00087   if(debug_)
00088     cout<<"~PFBlockAlgo - number of remaining elements: "
00089         <<elements_.size()<<endl;
00090 #endif
00091   
00092   if(resMapEtaECAL_) delete resMapEtaECAL_;
00093   
00094   if(resMapPhiECAL_) delete resMapPhiECAL_;
00095   
00096   if(resMapEtaHCAL_) delete resMapEtaHCAL_;
00097 
00098   if(resMapPhiHCAL_) delete resMapPhiHCAL_;
00099 
00100 }


Member Function Documentation

IE PFBlockAlgo::associate ( IE  next,
IE  last,
std::vector< PFBlockLink > &  links 
) [private]

recursive procedure which adds elements from elements_ to the current block, ie blocks_->back().

the resulting links between elements are stored in links, not in the block. afterwards, packLinks( reco::PFBlock& block, const vector<PFBlockLink>& links) has to be called in order to pack the link information in the block.

Referenced by findBlocks().

const std::auto_ptr< reco::PFBlockCollection >& PFBlockAlgo::blocks (  )  const [inline]

Returns:
collection of blocks

Definition at line 138 of file PFBlockAlgo.h.

References blocks_.

Referenced by operator<<().

00139     {return blocks_;}

void PFBlockAlgo::buildGraph (  )  [private]

Definition at line 439 of file PFBlockAlgo.cc.

00439                              {
00440   // loop on all blocks and create a big graph
00441 }

void PFBlockAlgo::checkMaskSize ( const reco::PFRecTrackCollection tracks,
const reco::GsfPFRecTrackCollection gsftracks,
const reco::PFClusterCollection ecals,
const reco::PFClusterCollection hcals,
const reco::PFClusterCollection pss,
const Mask trackMask,
const Mask gsftrackMask,
const Mask ecalMask,
const Mask hcalMask,
const Mask psMask 
) const [private]

checks size of the masks with respect to the vectors they refer to.

throws std::length_error if one of the masks has the wrong size

Definition at line 1496 of file PFBlockAlgo.cc.

References err.

Referenced by setInput().

01505                                                             {
01506 
01507   if( !trackMask.empty() && 
01508       trackMask.size() != tracks.size() ) {
01509     string err = "PFBlockAlgo::setInput: ";
01510     err += "The size of the track mask is different ";
01511     err += "from the size of the track vector.";
01512     throw std::length_error( err.c_str() );
01513   }
01514 
01515   if( !gsftrackMask.empty() && 
01516       gsftrackMask.size() != gsftracks.size() ) {
01517     string err = "PFBlockAlgo::setInput: ";
01518     err += "The size of the gsf track mask is different ";
01519     err += "from the size of the gsftrack vector.";
01520     throw std::length_error( err.c_str() );
01521   }
01522 
01523   if( !ecalMask.empty() && 
01524       ecalMask.size() != ecals.size() ) {
01525     string err = "PFBlockAlgo::setInput: ";
01526     err += "The size of the ecal mask is different ";
01527     err += "from the size of the ecal clusters vector.";
01528     throw std::length_error( err.c_str() );
01529   }
01530   
01531   if( !hcalMask.empty() && 
01532       hcalMask.size() != hcals.size() ) {
01533     string err = "PFBlockAlgo::setInput: ";
01534     err += "The size of the hcal mask is different ";
01535     err += "from the size of the hcal clusters vector.";
01536     throw std::length_error( err.c_str() );
01537   }
01538   if( !psMask.empty() && 
01539       psMask.size() != pss.size() ) {
01540     string err = "PFBlockAlgo::setInput: ";
01541     err += "The size of the ps mask is different ";
01542     err += "from the size of the ps clusters vector.";
01543     throw std::length_error( err.c_str() );
01544   }
01545   
01546 }

void PFBlockAlgo::checkNuclearLinks ( reco::PFBlock block  )  const [private]

remove extra links between primary track and clusters

Definition at line 1707 of file PFBlockAlgo.cc.

References reco::PFBlock::associatedElements(), reco::PFBlock::chi2(), reco::PFBlock::elements(), i1, reco::PFBlock::linkData(), reco::PFBlock::LINKTEST_ALL, reco::PFBlock::setLink(), edm::OwnVector< T, P >::size(), and reco::PFBlockElement::TRACK.

01707                                                               {
01708   // method which removes link between primary tracks and clusters
01709   // if at least one of the associated secondary tracks is closer 
01710   // to these same clusters
01711 
01712   typedef std::multimap<double, unsigned>::iterator IE;
01713 
01714   const edm::OwnVector< reco::PFBlockElement >& els = block.elements();
01715   // loop on all elements != TRACK
01716   for( unsigned i1=0; i1 != els.size(); ++i1 ) {
01717     if( els[i1].type() == PFBlockElement::TRACK ) continue;
01718     std::multimap<double, unsigned> assocTracks;
01719     // get associated tracks
01720     block.associatedElements( i1,  block.linkData(),
01721                               assocTracks,
01722                               reco::PFBlockElement::TRACK,
01723                               reco::PFBlock::LINKTEST_ALL );
01724     for( IE ie = assocTracks.begin(); ie != assocTracks.end(); ++ie) {
01725       double   chi2prim  = ie->first;
01726       unsigned iprim     = ie->second;
01727       // if this track a primary track (T_To_NUCL)
01728       if( els[iprim].trackType(PFBlockElement::T_TO_NUCL) )  {
01729         std::multimap<double, unsigned> secTracks; 
01730         // get associated secondary tracks
01731         block.associatedElements( iprim,  block.linkData(),
01732                                   secTracks,
01733                                   reco::PFBlockElement::TRACK,
01734                                   reco::PFBlock::LINKTEST_ALL );
01735         for( IE ie2 = secTracks.begin(); ie2 != secTracks.end(); ++ie2) { 
01736           unsigned isec = ie2->second;
01737           double chi2sec_rechit = block.chi2( i1, isec, block.linkData(),
01738                                               PFBlock::LINKTEST_RECHIT );
01739           double chi2sec_chi2 = block.chi2( i1, isec, block.linkData(),
01740                                             PFBlock::LINKTEST_CHI2 );
01741           double chi2sec;
01742 
01743           // at present associatedElement return first the chi2 by chi2
01744           // maybe in the futur return the min between chi2 and rechit! 
01745           if( chi2sec_chi2 > 0) chi2sec = chi2sec_chi2;
01746           else chi2sec=chi2sec_rechit;
01747 
01748           // if one secondary tracks has a chi2 < chi2prim 
01749           // remove the link between the element and the primary
01750           if( chi2sec < 0 ) continue;
01751           else if( chi2sec < chi2prim ) { 
01752             block.setLink( i1, iprim, -1, -1, block.linkData(),
01753                            PFBlock::LINKTEST_CHI2 );
01754             block.setLink( i1, iprim, -1, -1, block.linkData(),
01755                            PFBlock::LINKTEST_RECHIT );
01756             continue;
01757           }
01758         } // loop on all associated secondary tracks
01759       } // test if track is T_TO_NUCL
01760                              
01761     } // loop on all associated tracks
01762   } // loop on all elements
01763 }

std::pair< double, double > PFBlockAlgo::computeChi2 ( double  eta1,
double  reta1,
double  phi1,
double  rphi1,
double  eta2,
double  reta2,
double  phi2,
double  rphi2 
) const [private]

computes a chisquare

Definition at line 1478 of file PFBlockAlgo.cc.

References Utils::mpi_pi(), and funct::sqrt().

Referenced by testECALAndHCAL(), testLinkByRecHit(), testTrackAndECAL(), and testTrackAndHCAL().

01481                                                             {
01482   
01483   double phicor = Utils::mpi_pi(phi1 - phi2);
01484   
01485   double chi2 =  
01486     (eta1 - eta2)*(eta1 - eta2) / ( reta1*reta1+ reta2*reta2 ) +
01487     phicor*phicor / ( rphi1*rphi1+ rphi2*rphi2 );
01488 
01489   double dist = std::sqrt( (eta1 - eta2)*(eta1 - eta2) 
01490                           + phicor*phicor);
01491 
01492   return std::pair<double,double>(chi2,dist);
01493 
01494 }

void PFBlockAlgo::fillSecondaries ( const reco::PFNuclearInteractionRef nuclref  )  [private]

Definition at line 1609 of file PFBlockAlgo.cc.

References elements_, goodPtResolution(), reco::PFBlockElement::setNuclearRef(), and reco::PFBlockElement::T_FROM_NUCL.

Referenced by setInput().

01609                                                                               {
01610   // loop on secondaries
01611   for( reco::PFNuclearInteraction::pfTrackref_iterator
01612          pftkref = nuclref->secPFRecTracks_begin();
01613        pftkref != nuclref->secPFRecTracks_end(); ++pftkref) {
01614     if( !goodPtResolution( (*pftkref)->trackRef() ) ) continue;
01615     reco::PFBlockElement *secondaryTrack 
01616       = new reco::PFBlockElementTrack( *pftkref );
01617     secondaryTrack->setNuclearRef( nuclref->nuclInterRef(), 
01618                                    reco::PFBlockElement::T_FROM_NUCL );
01619             
01620     elements_.push_back( secondaryTrack ); 
01621   }
01622 }

void PFBlockAlgo::findBlocks (  ) 

build blocks

Definition at line 102 of file PFBlockAlgo.cc.

References associate(), blocks_, GenMuonPlsPt100GeV_cfg::cout, debug_, elements_, lat::endl(), and packLinks().

Referenced by PFRootEventManager::particleFlow(), and PFBlockProducer::produce().

00102                              {
00103 
00104   //  cout<<"findBlocks : "<<blocks_.get()<<endl;
00105   
00106   // the blocks have not been passed to the event, and need to be cleared
00107   if(blocks_.get() )blocks_->clear();
00108   else 
00109     blocks_.reset( new reco::PFBlockCollection );
00110 
00111   blocks_->reserve(elements_.size());
00112   for(IE ie = elements_.begin(); 
00113       ie != elements_.end();) {
00114     
00115 #ifdef PFLOW_DEBUG
00116     if(debug_) {
00117       cout<<" PFBlockAlgo::findBlocks() ----------------------"<<endl;
00118       cout<<" element "<<**ie<<endl;
00119       cout<<" creating new block"<<endl;
00120     }
00121 #endif
00122     
00123     blocks_->push_back( PFBlock() );
00124     
00125     vector< PFBlockLink > links;
00126 
00127     //    list< IE > used;
00128     ie = associate( elements_.end() , ie, links );
00129 
00130     // build remaining links in current block
00131     packLinks( blocks_->back(), links );
00132   }       
00133 }

bool PFBlockAlgo::goodPtResolution ( const reco::TrackRef trackref  )  [private]

open a resolution map

check the Pt resolution

Definition at line 1595 of file PFBlockAlgo.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, and DPtovPtCut_.

Referenced by fillSecondaries(), and setInput().

01595                                                                 {
01596   double Pt = trackref->pt();
01597   double DPt = trackref->ptError();
01598   if (debug_) cout << " PFBlockAlgo: PFrecTrack->Track Pt= "
01599                    << Pt << " DPt = " << DPt << endl;
01600   if (DPt/Pt > DPtovPtCut_ ) {
01601     if (debug_) cout << " PFBlockAlgo: skip badly measured track Pt= "
01602                      << Pt << " DPt = " << DPt << endl;
01603     if (debug_) cout << " cut is DPt/Pt < " << DPtovPtCut_<< endl;
01604     return false;
01605   }
01606   return true;
01607 }

void PFBlockAlgo::link ( const reco::PFBlockElement el1,
const reco::PFBlockElement el2,
PFBlockLink::Type linktype,
reco::PFBlock::LinkTest linktest,
double &  chi2,
double &  dist 
) const [private]

check whether 2 elements are linked. Returns chi2 and linktype

Definition at line 445 of file PFBlockAlgo.cc.

References chi2TrackECAL_, chi2TrackHCAL_, reco::PFBlockElement::clusterRef(), GenMuonPlsPt100GeV_cfg::cout, debug_, PFBlockLink::ECALandBREM, PFBlockLink::ECALandGSF, PFBlockLink::ECALandHCAL, lat::endl(), PFBlockLink::GSFandBREM, reco::PFBlockElementBrem::GsftrackRefPF(), reco::PFBlockElementGsfTrack::GsftrackRefPF(), PFBlockLink::HCALandBREM, PFBlockLink::HCALandGSF, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), reco::PFBlockElement::isSecondary(), multipleLink_, PFBlockLink::PS1andBREM, PFBlockLink::PS1andECAL, PFBlockLink::PS1andGSF, PFBlockLink::PS1andPS2, PFBlockLink::PS2andBREM, PFBlockLink::PS2andECAL, PFBlockLink::PS2andGSF, reco::PFBlockElement::T_FROM_V0, testECALAndHCAL(), testLinkByRecHit(), testLinkByVertex(), testPS1AndPS2(), testPSAndECAL(), testTrackAndECAL(), testTrackAndHCAL(), testTrackAndPS(), PFBlockLink::TRACKandECAL, PFBlockLink::TRACKandGSF, PFBlockLink::TRACKandHCAL, PFBlockLink::TRACKandPS1, PFBlockLink::TRACKandPS2, PFBlockLink::TRACKandTRACK, reco::PFBlockElement::trackRefPF(), reco::PFBlockElement::trackType(), and reco::PFBlockElement::type().

00449                                                           {
00450   
00451 
00452 
00453   chi2=-1;
00454   dist=-1.;
00455   std::pair<double,double> lnk(chi2,dist);
00456   linktest = PFBlock::LINKTEST_CHI2; //chi2 by default 
00457 
00458   PFBlockElement::Type type1 = el1->type();
00459   PFBlockElement::Type type2 = el2->type();
00460 
00461   if( type1==type2 ) {
00462     // cannot link 2 elements of the same type. 
00463     // except if the elements are 2 tracks
00464     if( type1!=PFBlockElement::TRACK ) return;
00465     // cannot link two primary tracks  (except if they come from a V0)
00466     else if ( 
00467              ((!el1->isSecondary()) && (!el2->isSecondary())) && 
00468              ((!el1->trackType(reco::PFBlockElement::T_FROM_V0)) || 
00469               (!el2->trackType(reco::PFBlockElement::T_FROM_V0)))
00470              ) return;
00471   }
00472 
00473   linktype = static_cast<PFBlockLink::Type>
00474     ((1<< (type1-1) ) | (1<< (type2-1) ));
00475 
00476   if(debug_ ) std::cout << " PFBlockAlgo links type1 " << type1 << " type2 " << type2 << std::endl;
00477 
00478   PFBlockElement::Type lowType = type1;
00479   PFBlockElement::Type highType = type2;
00480   const PFBlockElement* lowEl = el1;
00481   const PFBlockElement* highEl = el2;
00482   
00483   if(type1>type2) {
00484     lowType = type2;
00485     highType = type1;
00486     lowEl = el2;
00487     highEl = el1;
00488   }
00489   
00490   switch(linktype) {
00491   case PFBlockLink::TRACKandPS1:
00492   case PFBlockLink::TRACKandPS2:
00493     {
00494       //       cout<<"TRACKandPS"<<endl;
00495       PFRecTrackRef trackref = lowEl->trackRefPF();
00496       PFClusterRef  clusterref = highEl->clusterRef();
00497       assert( !trackref.isNull() );
00498       assert( !clusterref.isNull() );
00499       lnk = testTrackAndPS( *trackref, *clusterref );
00500       chi2 = lnk.first;
00501       dist = lnk.second;
00502       break;
00503     }
00504 
00505   case PFBlockLink::TRACKandECAL:
00506     {
00507       if(debug_ ) cout<<"TRACKandECAL"<<endl;
00508       PFRecTrackRef trackref = lowEl->trackRefPF();
00509 
00510       if(debug_ ) std::cout << " Track pt " << trackref->trackRef()->pt() << std::endl;
00511 
00512       PFClusterRef  clusterref = highEl->clusterRef();
00513       assert( !trackref.isNull() );
00514       assert( !clusterref.isNull() );
00515       lnk = testTrackAndECAL( *trackref, *clusterref );
00516       chi2 = lnk.first;
00517       dist = lnk.second;
00518       if(debug_ )  std::cout << " chi2 from testTrackAndECAL " << chi2 << std::endl;
00519       //Link by rechit for ECAL
00520       if( ( chi2 > chi2TrackECAL_ || chi2 < 0 )
00521           && multipleLink_ ){   
00522         //If Chi2 failed checking if Track can be linked by rechit
00523         //to a ECAL cluster. Definition:
00524         // A cluster can be linked to a track by rechit if the 
00525         // extrapolated position of the track to the ECALShowerMax 
00526         // falls within the boundaries of any cell that belongs 
00527         // to this cluster.
00528         if(debug_ ) std::cout << " try  testLinkByRecHit " << std::endl;
00529         lnk = testLinkByRecHit( *trackref, *clusterref );
00530         chi2 = lnk.first;
00531         dist = lnk.second;
00532         if(debug_ ) std::cout << " chi2 testLinkByRecHit " << chi2 << std::endl;
00533         linktest = PFBlock::LINKTEST_RECHIT;
00534       }//link by rechit  
00535 
00536       if ( chi2>0) {
00537         if(debug_ ) std::cout << " Here a link has been established between a track an Ecal with chi2  " << chi2 <<  std::endl;
00538       } else {
00539         if(debug_ ) std::cout << " No link found " << std::endl;
00540       }
00541 
00542 
00543 
00544       break;
00545     }
00546   case PFBlockLink::TRACKandHCAL:
00547     {
00548       //       cout<<"TRACKandHCAL"<<endl;
00549       PFRecTrackRef trackref = lowEl->trackRefPF();
00550       PFClusterRef  clusterref = highEl->clusterRef();
00551       assert( !trackref.isNull() );
00552       assert( !clusterref.isNull() );
00553       lnk = testTrackAndHCAL( *trackref, *clusterref );
00554       chi2 = lnk.first;
00555       dist = lnk.second;
00556   
00557       if( ( chi2 > chi2TrackHCAL_ || chi2 < 0 )
00558           && multipleLink_ ){   
00559         //If Chi2 failed checking if Track can be linked by rechit
00560         //to a HCAL cluster. Definition:
00561         // A cluster can be linked to a track by rechit if the 
00562         // extrapolated position of the track to the HCAL entrance 
00563         // falls within the boundaries of any cell that belongs 
00564         // to this cluster.
00565         
00566         lnk = testLinkByRecHit( *trackref, *clusterref );
00567         chi2 = lnk.first;
00568         dist = lnk.second;
00569         linktest = PFBlock::LINKTEST_RECHIT;
00570       }//link by rechit  
00571       
00572       break;
00573     }
00574   case PFBlockLink::ECALandHCAL:
00575     {
00576       //       cout<<"ECALandHCAL"<<endl;
00577       PFClusterRef  ecalref = lowEl->clusterRef();
00578       PFClusterRef  hcalref = highEl->clusterRef();
00579       assert( !ecalref.isNull() );
00580       assert( !hcalref.isNull() );
00581       lnk = testECALAndHCAL( *ecalref, *hcalref );
00582       chi2 = lnk.first;
00583       dist = lnk.second;
00584       break;
00585     }
00586   case PFBlockLink::PS1andECAL:
00587   case PFBlockLink::PS2andECAL:
00588     {
00589       //       cout<<"PSandECAL"<<endl;
00590       PFClusterRef  psref = lowEl->clusterRef();
00591       PFClusterRef  ecalref = highEl->clusterRef();
00592       assert( !psref.isNull() );
00593       assert( !ecalref.isNull() );
00594       lnk = testPSAndECAL( *psref, *ecalref );
00595       chi2 = lnk.first;
00596       dist = lnk.second;
00597       break;
00598     }
00599   case PFBlockLink::PS1andPS2:
00600     {
00601       PFClusterRef  ps1ref = lowEl->clusterRef();
00602       PFClusterRef  ps2ref = highEl->clusterRef();
00603       assert( !ps1ref.isNull() );
00604       assert( !ps2ref.isNull() );
00605       lnk = testPS1AndPS2( *ps1ref, *ps2ref );
00606       chi2 = lnk.first;
00607       dist = lnk.second;
00608       break;
00609     }
00610   case PFBlockLink::TRACKandTRACK:
00611     {
00612       if(debug_ ) cout<<"TRACKandTRACK"<<endl;
00613       lnk = testLinkByVertex(lowEl, highEl);
00614       chi2 = lnk.first;
00615       dist = lnk.second;
00616       if(debug_ ) std::cout << " PFBlockLink::TRACKandTRACK chi2 " << chi2 << std::endl;
00617       break;
00618     }
00619   case PFBlockLink::ECALandGSF:
00620     {
00621       PFClusterRef  clusterref = lowEl->clusterRef();
00622       assert( !clusterref.isNull() );
00623       const reco::PFBlockElementGsfTrack *  GsfEl =  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
00624       const PFRecTrack * myTrack =  &(GsfEl->GsftrackPF());
00625       lnk = testTrackAndECAL( *myTrack, *clusterref);
00626       chi2 = lnk.first;
00627       dist = lnk.second;
00628       break;
00629     }
00630   case PFBlockLink::TRACKandGSF:
00631     {
00632       PFRecTrackRef trackref = lowEl->trackRefPF();
00633       assert( !trackref.isNull() );
00634       const reco::PFBlockElementGsfTrack *  GsfEl =  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
00635       GsfPFRecTrackRef gsfref = GsfEl->GsftrackRefPF();
00636       reco::TrackRef kftrackref= (*trackref).trackRef();
00637       assert( !gsfref.isNull() );
00638       PFRecTrackRef refkf = (*gsfref).kfPFRecTrackRef();
00639       if(refkf.isNonnull())
00640         {
00641           reco::TrackRef gsftrackref = (*refkf).trackRef();
00642           if (gsftrackref.isNonnull()&&kftrackref.isNonnull()) {
00643             if (kftrackref == gsftrackref) { 
00644               chi2 = 1;
00645               dist = 0.001;
00646               //              std::cout <<  " Linked " << std::endl;
00647             } else { 
00648               chi2 = -1;
00649               dist = -1.;
00650               //              std::cout <<  " Not Linked " << std::endl;
00651             }
00652           }
00653           else { 
00654             chi2 = -1;
00655             dist = -1.;
00656             //      std::cout <<  " Not Linked " << std::endl;
00657           }
00658         }
00659       else
00660         {
00661           chi2 = -1;
00662           dist = -1.;
00663           //      std::cout <<  " Not Linked " << std::endl;
00664         }
00665       break;      
00666     }
00667          
00668   case PFBlockLink::GSFandBREM:
00669     {
00670       const reco::PFBlockElementGsfTrack * GsfEl  =  dynamic_cast<const reco::PFBlockElementGsfTrack*>(lowEl);
00671       const reco::PFBlockElementBrem * BremEl =  dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
00672       GsfPFRecTrackRef gsfref = GsfEl->GsftrackRefPF();
00673       GsfPFRecTrackRef bremref = BremEl->GsftrackRefPF();
00674       assert( !gsfref.isNull() );
00675       assert( !bremref.isNull() );
00676       if (gsfref == bremref)  { 
00677         chi2 = 1;
00678         dist = 0.001;
00679       } else { 
00680         chi2 = -1;
00681         dist = -1.;
00682       }
00683       break;
00684     }
00685   case PFBlockLink::ECALandBREM:
00686     {
00687       PFClusterRef  clusterref = lowEl->clusterRef();
00688       assert( !clusterref.isNull() );
00689       const reco::PFBlockElementBrem * BremEl =  dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
00690       const PFRecTrack * myTrack = &(BremEl->trackPF());
00691       double DP = (BremEl->DeltaP())*(-1.);
00692       double SigmaDP = BremEl->SigmaDeltaP();
00693       double SignBremDp = DP/SigmaDP;
00694       lnk = testTrackAndECAL( *myTrack, *clusterref, SignBremDp);
00695       chi2 = lnk.first;
00696       dist = lnk.second;
00697       break;
00698     }
00699   case PFBlockLink::PS1andGSF:
00700   case PFBlockLink::PS2andGSF:
00701     {
00702       PFClusterRef  psref = lowEl->clusterRef();
00703       assert( !psref.isNull() );
00704       const reco::PFBlockElementGsfTrack *  GsfEl =  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
00705       const PFRecTrack * myTrack =  &(GsfEl->GsftrackPF());
00706       lnk = testTrackAndPS( *myTrack, *psref );
00707       chi2 = lnk.first;
00708       dist = lnk.second;
00709       break;
00710     }
00711   case PFBlockLink::PS1andBREM:
00712   case PFBlockLink::PS2andBREM:
00713     {
00714       PFClusterRef  psref = lowEl->clusterRef();
00715       assert( !psref.isNull() );
00716       const reco::PFBlockElementBrem * BremEl =  dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
00717       const PFRecTrack * myTrack = &(BremEl->trackPF());
00718       lnk = testTrackAndPS( *myTrack, *psref );
00719       chi2 = lnk.first;
00720       dist = lnk.second;
00721       break;
00722     }
00723   case PFBlockLink::HCALandGSF:
00724     {
00725       PFClusterRef  clusterref = lowEl->clusterRef();
00726       assert( !clusterref.isNull() );
00727       const reco::PFBlockElementGsfTrack *  GsfEl =  dynamic_cast<const reco::PFBlockElementGsfTrack*>(highEl);
00728       const PFRecTrack * myTrack =  &(GsfEl->GsftrackPF());
00729       lnk = testTrackAndHCAL( *myTrack, *clusterref);
00730       chi2 = lnk.first;
00731       dist = lnk.second;
00732       break;
00733     }
00734   case PFBlockLink::HCALandBREM:
00735     {
00736       PFClusterRef  clusterref = lowEl->clusterRef();
00737       assert( !clusterref.isNull() );
00738       const reco::PFBlockElementBrem * BremEl =  dynamic_cast<const reco::PFBlockElementBrem*>(highEl);
00739       const PFRecTrack * myTrack = &(BremEl->trackPF());
00740       lnk = testTrackAndHCAL( *myTrack, *clusterref);
00741       chi2 = lnk.first;
00742       dist = lnk.second;
00743       break;
00744     }
00745 
00746     
00747   default:
00748     chi2 = -1.;
00749     dist = -1.;
00750     //   cout<<"link type not implemented yet"<< linktype << endl;
00751     //   assert(0);
00752     return;
00753   }
00754 }

int PFBlockAlgo::muAssocToTrack ( const reco::TrackRef trackref,
const edm::OrphanHandle< reco::MuonCollection > &  muonh 
) const [private]

Definition at line 1694 of file PFBlockAlgo.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::OrphanHandle< T >::isValid(), and j.

01695                                                                                          {
01696   if(muonh.isValid() ) {
01697     for(unsigned j=0;j<muonh->size(); j++) {
01698       reco::MuonRef muonref( muonh, j );
01699       if (muonref->track().isNonnull())
01700         if( muonref->track() == trackref ) return j;
01701     }
01702   }
01703   return -1; // not found
01704 }

int PFBlockAlgo::muAssocToTrack ( const reco::TrackRef trackref,
const edm::Handle< reco::MuonCollection > &  muonh 
) const [private]

find index of the muon associated to trackref.

if no muon have been found then return -1.

Definition at line 1651 of file PFBlockAlgo.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Handle< T >::isValid(), and j.

Referenced by setInput().

01652                                                                                    {
01653   if(muonh.isValid() ) {
01654     for(unsigned j=0;j<muonh->size(); j++) {
01655       reco::MuonRef muonref( muonh, j );
01656       if (muonref->track().isNonnull()) 
01657         if( muonref->track() == trackref ) return j;
01658     }
01659   }
01660   return -1; // not found
01661 }

int PFBlockAlgo::niAssocToTrack ( const reco::TrackRef primTkRef,
const edm::OrphanHandle< reco::PFNuclearInteractionCollection > &  good_ni 
) const [private]

Definition at line 1638 of file PFBlockAlgo.cc.

References edm::RefToBase< T >::castTo(), edm::OrphanHandle< T >::isValid(), and k.

01639                                                                                                          {
01640   if( nuclh.isValid() ) {
01641     // look for nuclear interaction associated to primTkRef
01642     for( unsigned int k=0; k<nuclh->size(); ++k) {
01643       const edm::RefToBase< reco::Track >& trk = nuclh->at(k).primaryTrack();
01644       if( trk.castTo<reco::TrackRef>() == primTkRef) return k;
01645     }
01646     return -1; // not found
01647   }
01648   else return -1;
01649 }

int PFBlockAlgo::niAssocToTrack ( const reco::TrackRef primTkRef,
const edm::Handle< reco::PFNuclearInteractionCollection > &  good_ni 
) const [private]

find index of the nuclear interaction associated to primTkRef.

if no nuclear interaction have been found then return -1.

Definition at line 1624 of file PFBlockAlgo.cc.

References edm::RefToBase< T >::castTo(), edm::Handle< T >::isValid(), and k.

Referenced by setInput().

01625                                                                                                    {
01626   if( nuclh.isValid() ) {
01627     // look for nuclear interaction associated to primTkRef
01628     for( unsigned int k=0; k<nuclh->size(); ++k) {
01629       const edm::RefToBase< reco::Track >& trk = nuclh->at(k).primaryTrack();
01630       if( trk.castTo<reco::TrackRef>() == primTkRef) return k;
01631     }
01632     return -1; // not found
01633   }
01634   else return -1;
01635 }

void PFBlockAlgo::packLinks ( reco::PFBlock block,
const std::vector< PFBlockLink > &  links 
) const [private]

compute missing links in the blocks (the recursive procedure does not build all links)

Referenced by findBlocks().

void PFBlockAlgo::setDebug ( bool  debug  )  [inline]

sets debug printout flag

Definition at line 130 of file PFBlockAlgo.h.

References debug_.

Referenced by PFBlockProducer::PFBlockProducer(), and PFRootEventManager::readOptions().

00130 {debug_ = debug;}

template<template< typename > class T>
void PFBlockAlgo::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 > &  psh,
const Mask trackMask = dummyMask_,
const Mask gsftrackMask = dummyMask_,
const Mask ecalMask = dummyMask_,
const Mask hcalMask = dummyMask_,
const Mask psMask = dummyMask_ 
) [inline]

Definition at line 110 of file PFBlockAlgo.h.

00119                                                     {
00120     T<reco::MuonCollection> muonh;
00121     T<reco::PFNuclearInteractionCollection> nuclh;
00122     T<reco::PFConversionCollection> convh;
00123     T<reco::PFV0Collection> v0;
00124     setInput<T>( trackh, gsftrackh, muonh, nuclh, convh, v0, ecalh, hcalh, psh, 
00125                  trackMask, gsftrackMask,ecalMask, hcalMask, psMask); 
00126   }

template<template< typename > class T>
void PFBlockAlgo::setInput ( const T< reco::PFRecTrackCollection > &  trackh,
const T< reco::PFClusterCollection > &  ecalh,
const T< reco::PFClusterCollection > &  hcalh,
const T< reco::PFClusterCollection > &  psh,
const Mask trackMask = dummyMask_,
const Mask ecalMask = dummyMask_,
const Mask hcalMask = dummyMask_,
const Mask psMask = dummyMask_ 
) [inline]

Definition at line 92 of file PFBlockAlgo.h.

00099                                                     {
00100     T<reco::GsfPFRecTrackCollection> gsftrackh;
00101     T<reco::MuonCollection> muonh;
00102     T<reco::PFNuclearInteractionCollection> nuclh;
00103     T<reco::PFConversionCollection> convh;
00104     T<reco::PFV0Collection> v0;
00105     setInput<T>( trackh, gsftrackh, muonh, nuclh, convh,v0, ecalh, hcalh, psh, 
00106                  trackMask, ecalMask, hcalMask, psMask); 
00107   }

template<template< typename > class T>
void PFBlockAlgo::setInput ( const T< reco::PFRecTrackCollection > &  trackh,
const T< reco::GsfPFRecTrackCollection > &  gsftrackh,
const T< reco::MuonCollection > &  muonh,
const T< reco::PFNuclearInteractionCollection > &  nuclh,
const T< reco::PFConversionCollection > &  conv,
const T< reco::PFV0Collection > &  v0,
const T< reco::PFClusterCollection > &  ecalh,
const T< reco::PFClusterCollection > &  hcalh,
const T< reco::PFClusterCollection > &  psh,
const Mask trackMask = dummyMask_,
const Mask gsftrackMask = dummyMask_,
const Mask ecalMask = dummyMask_,
const Mask hcalMask = dummyMask_,
const Mask psMask = dummyMask_ 
) [inline]

set input collections of tracks and clusters

Definition at line 351 of file PFBlockAlgo.h.

References checkMaskSize(), GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFBlockElement::ECAL, elements_, lat::endl(), fillSecondaries(), goodPtResolution(), reco::PFBlockElement::HCAL, i, i2, muAssocToTrack(), niAssocToTrack(), reco::PFBlockElement::NONE, PFLayer::PS1, reco::PFBlockElement::PS1, PFLayer::PS2, reco::PFBlockElement::PS2, reco::PFBlockElement::setConversionRef(), size, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::T_FROM_V0, reco::PFBlockElement::T_TO_NUCL, te, tp, and v0AssocToTrack().

Referenced by PFRootEventManager::particleFlow(), and PFBlockProducer::produce().

00364                                             {
00365 
00366 
00367   checkMaskSize( *trackh,
00368                  *gsftrackh,
00369                  *ecalh,
00370                  *hcalh,
00371                  *psh,
00372                  trackMask,
00373                  gsftrackMask,
00374                  ecalMask,
00375                  hcalMask,
00376                  psMask  );
00377 
00378 
00379   // conversions 
00380   if(convh.isValid() ) {
00381     reco::PFBlockElement* trkFromConversionElement;
00382     for(unsigned i=0;i<convh->size(); i++) {
00383       reco::PFConversionRef convRef(convh,i);
00384       //  std::cout << " PFBlockAlgo setInput conversion track size " << convRef->pfTracks().size() 
00385       //<< " " << (convRef->originalConversion())->tracks().size() << std::endl;
00386       unsigned int trackSize=(convRef->pfTracks()).size();
00387       if ( convRef->pfTracks().size() < 2) continue;
00388       for(unsigned iTk=0;iTk<trackSize; iTk++) {
00389        if (debug_) std::cout << " PFBlockAlgo setInput  building element for track charge " << convRef->pfTracks()[iTk]->charge() 
00390             << " pt " <<  convRef->pfTracks()[iTk]->trackRef()->pt() << std::endl;
00391         if (debug_) std::cout << " # of traj points " << convRef->pfTracks()[iTk]->nTrajectoryPoints() 
00392             <<  " # of traj measurements " << convRef->pfTracks()[iTk]->nTrajectoryMeasurements() << std::endl;
00393         
00394         for ( unsigned int iP=0; iP<convRef->pfTracks()[iTk]->nTrajectoryPoints(); iP++) {
00395           if (debug_) std::cout << " Trajectory point " << iP << " x,y,z " << convRef->pfTracks()[iTk]->trajectoryPoint(iP).position() 
00396              << " r, eta, phi " <<convRef->pfTracks()[iTk]->trajectoryPoint(iP).positionREP() <<  std::endl;
00397           
00398         }
00399 
00400         trkFromConversionElement = new reco::PFBlockElementTrack(convRef->pfTracks()[iTk]);
00401         trkFromConversionElement->setConversionRef( convRef->originalConversion(), reco::PFBlockElement::T_FROM_GAMMACONV);
00402         elements_.push_back( trkFromConversionElement );
00403 
00404       }    
00405 
00406     }
00407 
00408   }
00409 
00410 
00411 
00412 
00413 
00414   // tracks
00415   if(trackh.isValid() ) {
00416     for(unsigned i=0;i<trackh->size(); i++) {
00417 
00418       // this track has been disabled
00419       if( !trackMask.empty() &&
00420           !trackMask[i] ) continue;
00421       reco::PFRecTrackRef ref( trackh,i );
00422       if( !goodPtResolution( ref->trackRef() ) ) continue;
00423 
00424       // get the eventual nuclear interaction associated to this track 
00425       int niId_ = niAssocToTrack( ref->trackRef(), nuclh );
00426 
00427       // get the eventual muon associated to this track
00428       int muId_ = muAssocToTrack( ref->trackRef(), muonh );
00429 
00430       // get the eventual v0Track associated to this track
00431       int v0Id_ = v0AssocToTrack( ref->trackRef(), v0 );
00432 
00433       reco::PFBlockElement* primaryElement = new reco::PFBlockElementTrack( ref );
00434 
00435       if( niId_ != -1 ) {
00436           // if a nuclear interaction has been found 
00437           reco::PFNuclearInteractionRef ni_(nuclh, niId_);
00438           primaryElement->setNuclearRef( ni_->nuclInterRef(), reco::PFBlockElement::T_TO_NUCL );
00439           fillSecondaries( ni_ );
00440       }
00441       if( muId_ != -1 ) {
00442           // if a muon has been found
00443           reco::MuonRef muonref( muonh, muId_ );
00444           primaryElement->setMuonRef( muonref );
00445       }
00446       if( v0Id_ != -1 ) {
00447         // if a V0 has been found
00448         reco::PFV0Ref v0ref( v0, v0Id_ );
00449         primaryElement->setV0Ref( v0ref->originalV0(),reco::PFBlockElement::T_FROM_V0 );
00450       }
00451 
00452       elements_.push_back( primaryElement );
00453     }
00454   }
00455 
00456   // GSF Tracks And Brems
00457   if(gsftrackh.isValid() ) {
00458     const  reco::GsfPFRecTrackCollection PFGsfProd = *(gsftrackh.product());
00459     for(unsigned i=0;i<gsftrackh->size(); i++) {
00460       if( !gsftrackMask.empty() &&
00461           !gsftrackMask[i] ) continue;
00462       reco::GsfPFRecTrackRef refgsf(gsftrackh,i );   
00463    
00464       if((refgsf).isNull()) continue;
00465 
00466       reco::PFBlockElement* gsfEl;
00467         
00468       const  std::vector<reco::PFTrajectoryPoint> PfGsfPoint =  PFGsfProd[i].trajectoryPoints();
00469   
00470       uint c_gsf=0;
00471       bool PassTracker = false;
00472       bool GetPout = false;
00473       uint IndexPout = -1;
00474       for(std::vector<reco::PFTrajectoryPoint>::const_iterator itPfGsfPoint =  PfGsfPoint.begin();  itPfGsfPoint!= PfGsfPoint.end();itPfGsfPoint++) {
00475         if (itPfGsfPoint->isValid()){
00476           int layGsfP = itPfGsfPoint->layer();
00477           if (layGsfP == -1) PassTracker = true;
00478           if (PassTracker && layGsfP > 0 && GetPout == false) {
00479             IndexPout = c_gsf-1;
00480             GetPout = true;
00481           }
00482           //      const math::XYZTLorentzVector GsfMoment = itPfGsfPoint->momentum();
00483           c_gsf++;
00484         }
00485       }
00486       math::XYZTLorentzVector pin = PfGsfPoint[0].momentum();      
00487       math::XYZTLorentzVector pout = PfGsfPoint[IndexPout].momentum();
00488       
00489  
00490       gsfEl = new reco::PFBlockElementGsfTrack(refgsf, pin, pout);
00491 
00492       elements_.push_back( gsfEl);
00493 
00494 
00495       std::vector<reco::PFBrem> pfbrem = refgsf->PFRecBrem();
00496 
00497       for (unsigned i2=0;i2<pfbrem.size(); i2++) {
00498 
00499         const double DP = pfbrem[i2].DeltaP();
00500         const double SigmaDP =  pfbrem[i2].SigmaDeltaP(); 
00501         const uint TrajP = pfbrem[i2].indTrajPoint();
00502 
00503         reco::PFBlockElement* bremEl;
00504         bremEl = new reco::PFBlockElementBrem(refgsf,DP,SigmaDP,TrajP);     
00505         elements_.push_back(bremEl);
00506 
00507       }
00508     }
00509   }
00510 
00511 
00512 
00513   if(ecalh.isValid() ) {
00514     for(unsigned i=0;i<ecalh->size(); i++)  {
00515 
00516       // this ecal cluster has been disabled
00517       if( !ecalMask.empty() &&
00518           !ecalMask[i] ) continue;
00519 
00520       reco::PFClusterRef ref( ecalh,i );
00521       reco::PFBlockElement* te
00522         = new reco::PFBlockElementCluster( ref,
00523                                            reco::PFBlockElement::ECAL);
00524       elements_.push_back( te );
00525     }
00526   }
00527 
00528   if(hcalh.isValid() ) {
00529     
00530     for(unsigned i=0;i<hcalh->size(); i++)  {
00531       
00532       // this hcal cluster has been disabled
00533       if( !hcalMask.empty() &&
00534           !hcalMask[i] ) continue;
00535       
00536       reco::PFClusterRef ref( hcalh,i );
00537       reco::PFBlockElement* th
00538         = new reco::PFBlockElementCluster( ref,
00539                                            reco::PFBlockElement::HCAL );
00540       elements_.push_back( th );
00541     }
00542   }
00543   if(psh.isValid() ) {
00544     for(unsigned i=0;i<psh->size(); i++)  {
00545 
00546       // this ps cluster has been disabled
00547       if( !psMask.empty() &&
00548           !psMask[i] ) continue;
00549       reco::PFBlockElement::Type type = reco::PFBlockElement::NONE;
00550       reco::PFClusterRef ref( psh,i );
00551       // two types of elements:  PS1 (V) and PS2 (H) 
00552       // depending on layer:  PS1 or PS2
00553       switch(ref->layer()){
00554       case PFLayer::PS1:
00555         type = reco::PFBlockElement::PS1;
00556         break;
00557       case PFLayer::PS2:
00558         type = reco::PFBlockElement::PS2;
00559         break;
00560       default:
00561         break;
00562       }
00563       reco::PFBlockElement* tp
00564         = new reco::PFBlockElementCluster( ref,
00565                                      type );
00566       elements_.push_back( tp );
00567       
00568     }
00569   }
00570 }

void PFBlockAlgo::setParameters ( const char *  resMapEtaECAL,
const char *  resMapPhiECAL,
const char *  resMapEtaHCAL,
const char *  resMapPhiHCAL,
double  DPtovPtCut,
double  chi2TrackECAL,
double  chi2GSFECAL,
double  chi2TrackHCAL,
double  chi2ECALHCAL,
double  chi2PSECAL,
double  chi2PSTrack,
double  chi2PSHV,
bool  multiLink 
)

Definition at line 43 of file PFBlockAlgo.cc.

References chi2ECALHCAL_, chi2GSFECAL_, chi2PSECAL_, chi2PSHV_, chi2PSTrack_, chi2TrackECAL_, chi2TrackHCAL_, DPtovPtCut_, err, exception, multipleLink_, resMapEtaECAL_, resMapEtaHCAL_, resMapPhiECAL_, resMapPhiHCAL_, resPSlength_, resPSpitch_, and funct::sqrt().

Referenced by PFBlockProducer::PFBlockProducer(), and PFRootEventManager::readOptions().

00055                                                     {
00056   
00057   try {
00058     resMapEtaECAL_ = new PFResolutionMap("resmapEtaECAL",resMapEtaECAL);
00059     resMapPhiECAL_ = new PFResolutionMap("resmapPhiECAL",resMapPhiECAL);
00060     resMapEtaHCAL_ = new PFResolutionMap("resmapEtaHCAL",resMapEtaHCAL);
00061     resMapPhiHCAL_ = new PFResolutionMap("resmapPhiHCAL",resMapPhiHCAL);
00062   }
00063   catch(std::exception& err ) {
00064     // cout<<err.what()<<endl;
00065     throw;
00066   }
00067 
00068   DPtovPtCut_    = DPtovPtCut;
00069   chi2TrackECAL_ = chi2TrackECAL;
00070   chi2GSFECAL_   = chi2GSFECAL;
00071   chi2TrackHCAL_ = chi2TrackHCAL; 
00072   chi2ECALHCAL_  = chi2ECALHCAL;
00073   chi2PSECAL_    = chi2PSECAL;
00074   chi2PSTrack_   = chi2PSTrack;
00075   chi2PSHV_      = chi2PSHV;
00076   double strip_pitch = 0.19;
00077   double strip_length = 6.1;
00078   resPSpitch_    = strip_pitch/sqrt(12.);
00079   resPSlength_   = strip_length/sqrt(12.);
00080 
00081   multipleLink_  = multiLink;
00082 }

std::pair< double, double > PFBlockAlgo::testECALAndHCAL ( const reco::PFCluster ecal,
const reco::PFCluster hcal 
) const [private]

tests association between an ECAL and an HCAL cluster

Returns:
chi2
this function is non const because it uses PFResolutionMap, which reimplements TH1::FindBin, which is non const.

Definition at line 989 of file PFBlockAlgo.cc.

References chi2ECALHCAL_, computeChi2(), GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFCluster::energy(), PFResolutionMap::FindBin(), reco::PFCluster::positionREP(), resMapEtaECAL_, resMapEtaHCAL_, resMapPhiECAL_, and resMapPhiHCAL_.

Referenced by link().

00990                                                            {
00991   
00992   //   cout<<"entering testECALAndHCAL"<<endl;
00993   
00994   
00995   PFResolutionMap* mapetaECAL = const_cast<PFResolutionMap*>(resMapEtaECAL_);
00996   PFResolutionMap* mapphiECAL = const_cast<PFResolutionMap*>(resMapPhiECAL_);
00997   
00998   PFResolutionMap* mapetaHCAL = const_cast<PFResolutionMap*>(resMapEtaHCAL_);
00999   PFResolutionMap* mapphiHCAL = const_cast<PFResolutionMap*>(resMapPhiHCAL_);
01000   
01001   // retrieve resolutions from resolution maps
01002   double ecaletares 
01003     = mapetaECAL->GetBinContent(mapetaECAL->FindBin(ecal.positionREP().Eta(), 
01004                                                     ecal.energy() ) );
01005   double ecalphires 
01006     = mapphiECAL->GetBinContent(mapphiECAL->FindBin(ecal.positionREP().Eta(), 
01007                                                     ecal.energy() ) );
01008                       
01009   double hcaletares 
01010     = mapetaHCAL->GetBinContent(mapetaHCAL->FindBin(hcal.positionREP().Eta(), 
01011                                                     hcal.energy() ) );
01012   double hcalphires 
01013     = mapphiHCAL->GetBinContent(mapphiHCAL->FindBin(hcal.positionREP().Eta(), 
01014                                                     hcal.energy() ) );
01015                       
01016   // compute chi2
01017   std::pair<double,double> lnk = 
01018     computeChi2( ecal.positionREP().Eta(), ecaletares, 
01019                  ecal.positionREP().Phi(), ecalphires, 
01020                  hcal.positionREP().Eta(), hcaletares, 
01021                  hcal.positionREP().Phi(), hcalphires );
01022   double chi2 = lnk.first;
01023   
01024 #ifdef PFLOW_DEBUG
01025   if(debug_) cout<<"testECALAndHCAL "<<chi2<<" "<<endl;
01026   if(debug_){
01027     cout<<" ecaleta " << ecal.positionREP().Eta()<< "  ecaletares "<<ecaletares
01028         <<" ecalphi " << ecal.positionREP().Phi()<< "  ecalphires "<<ecalphires
01029         <<" hcaleta " << hcal.positionREP().Eta()<< "  hcaletares "<<hcaletares
01030         <<" hcalphi " << hcal.positionREP().Phi()<< "  hcalphires "<<hcalphires<< endl;
01031   }
01032 #endif
01033 
01034 
01035   if(chi2<chi2ECALHCAL_ || chi2ECALHCAL_<0 )
01036     return lnk;
01037   else 
01038     return std::pair<double,double>(-1,-1);
01039 }

std::pair< double, double > PFBlockAlgo::testLinkByRecHit ( const reco::PFRecTrack track,
const reco::PFCluster cluster 
) const [private]

Definition at line 1225 of file PFBlockAlgo.cc.

References GeomDetEnumerators::barrel, computeChi2(), GenMuonPlsPt100GeV_cfg::cout, debug_, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, reco::PFTrajectoryPoint::ECALShowerMax, reco::PFCluster::energy(), reco::PFRecHit::energy(), reco::PFTrack::extrapolatedPoint(), PFResolutionMap::FindBin(), reco::PFRecHit::getCornersREP(), reco::PFRecHit::getCornersXYZ(), PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, reco::PFTrajectoryPoint::HCALEntrance, edm::Ref< C, T, F >::isNull(), reco::PFTrajectoryPoint::isValid(), reco::PFCluster::layer(), reco::PFTrajectoryPoint::position(), reco::PFRecHit::position(), reco::PFCluster::positionREP(), reco::PFRecHit::positionREP(), reco::PFTrajectoryPoint::positionREP(), PFLayer::PS1, PFLayer::PS2, reco::PFCluster::recHitFractions(), resMapEtaECAL_, resMapEtaHCAL_, resMapPhiECAL_, resMapPhiHCAL_, x, and y.

Referenced by link().

01226                                                                  {
01227   
01228 #ifdef PFLOW_DEBUG
01229   if( debug_ ) 
01230     cout<<"entering test link by rechit function"<<endl;
01231 #endif
01232 
01233   //cluster position
01234   double clustereta  = cluster.positionREP().Eta();
01235   double clusterphi  = cluster.positionREP().Phi();
01236 
01237   bool barrel = false;
01238 
01239   //track extrapolation
01240   const reco::PFTrajectoryPoint& atECAL 
01241     = track.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax );
01242   const reco::PFTrajectoryPoint& atHCAL 
01243     = track.extrapolatedPoint( reco::PFTrajectoryPoint::HCALEntrance );
01244 
01245   //track
01246   double tracketa = 999999.9;
01247   double trackphi = 999999.9;
01248   double track_X  = 999999.9;
01249   double track_Y  = 999999.9;
01250 
01251   //retrieving resolution maps
01252   PFResolutionMap* mapeta;
01253   PFResolutionMap* mapphi;
01254   switch (cluster.layer()) {
01255   case PFLayer::ECAL_BARREL: barrel = true;
01256   case PFLayer::ECAL_ENDCAP:
01257 #ifdef PFLOW_DEBUG
01258     if( debug_ )
01259       cout << "Fetching Ecal Resolution Maps"
01260            << endl;
01261 #endif
01262     mapeta = const_cast<PFResolutionMap*>(resMapEtaECAL_);
01263     mapphi = const_cast<PFResolutionMap*>(resMapPhiECAL_);
01264 
01265     // did not reach ecal, cannot be associated with a cluster.
01266     if( ! atECAL.isValid() ) return std::pair<double,double>(-1,-1);   
01267     
01268     tracketa = atECAL.positionREP().Eta();
01269     trackphi = atECAL.positionREP().Phi();
01270     track_X  = atECAL.position().X();
01271     track_Y  = atECAL.position().Y();
01272     
01273     break;
01274   case PFLayer::HCAL_BARREL1: barrel = true;
01275   case PFLayer::HCAL_ENDCAP:
01276 #ifdef PFLOW_DEBUG
01277     if( debug_ )
01278       cout << "Fetching Hcal Resolution Maps"
01279            << endl;
01280 #endif
01281     mapeta = const_cast<PFResolutionMap*>(resMapEtaHCAL_);
01282     mapphi = const_cast<PFResolutionMap*>(resMapPhiHCAL_);
01283 
01284     // did not reach hcal, cannot be associated with a cluster.
01285     if( ! atHCAL.isValid() ) return std::pair<double,double>(-1,-1);   
01286     
01287     tracketa = atHCAL.positionREP().Eta();
01288     trackphi = atHCAL.positionREP().Phi();
01289     track_X  = atHCAL.position().X();
01290     track_Y  = atHCAL.position().Y();
01291 
01292     break;
01293   case PFLayer::PS1:
01294   case PFLayer::PS2:
01295     //Note Alex: Nothing implemented for the
01296     //PreShower (No resolution maps yet)
01297 #ifdef PFLOW_DEBUG
01298     if( debug_ )
01299       cout << "No link by rechit possible for pre-shower yet!"
01300            << endl;
01301 #endif
01302     return std::pair<double,double>(-1,-1);
01303   default:
01304     return std::pair<double,double>(-1,-1);
01305   }
01306 
01307   double clusteretares 
01308     = mapeta->GetBinContent(mapeta->FindBin(clustereta, 
01309                                             cluster.energy() ) );
01310   double clusterphires 
01311     = mapphi->GetBinContent(mapphi->FindBin(clustereta, 
01312                                             cluster.energy() ) );
01313   
01314   
01315   // rec track resolution should be negligible compared 
01316   // calo resolution
01317   double trackres = 0;
01318   
01319   std::pair<double,double> lnk = computeChi2( clustereta, clusteretares, 
01320                                               clusterphi, clusterphires, 
01321                                               tracketa, trackres, 
01322                                               trackphi, trackres);
01323   
01324 #ifdef PFLOW_DEBUG
01325   double chi2 = lnk.first;
01326   if(debug_) cout<<"test link by rechit "<<chi2<<" "<<endl;
01327   if(debug_){
01328     cout<<" clustereta "  << clustereta << "  clusteretares "<<clusteretares
01329         <<" clusterphi "  << clusterphi << "  clusterphires "<<clusterphires
01330         <<" tracketa " << tracketa<< "  trackres "  <<trackres
01331         <<" trackphi " << trackphi<< "  trackres "  <<trackres << endl;
01332   }
01333 #endif
01334   
01335   //Testing if Track can be linked by rechit to a cluster.
01336   //A cluster can be linked to a track if the extrapolated position 
01337   //of the track to the ECAL ShowerMax/HCAL entrance falls within 
01338   //the boundaries of any cell that belongs to this cluster.
01339 
01340   const std::vector< reco::PFRecHitFraction >& 
01341     fracs = cluster.recHitFractions();
01342   
01343   bool linkedbyrechit = false;
01344   //loop rechits
01345   for(unsigned int rhit = 0; rhit < fracs.size(); ++rhit){
01346 
01347     const reco::PFRecHitRef& rh = fracs[rhit].recHitRef();
01348     if(rh.isNull()) continue;
01349     
01350     //getting rechit center position
01351     const reco::PFRecHit& rechit_cluster = *rh;
01352     // const math::XYZPoint& posxyz 
01353     //   = rechit_cluster.position();
01354     const reco::PFRecHit::REPPoint& posrep 
01355       = rechit_cluster.positionREP();
01356     
01357     //getting rechit corners
01358     const std::vector< math::XYZPoint >& 
01359       cornersxyz = rechit_cluster.getCornersXYZ();
01360     const std::vector<reco::PFRecHit::REPPoint>& corners = 
01361       rechit_cluster.getCornersREP();
01362     assert(corners.size() == 4);
01363     
01364 
01365     if( barrel ){ //barrel case matching in eta/phi
01366 
01367       //rechit size determination
01368       double rhsizeEta 
01369         = fabs(corners[0].Eta() - corners[2].Eta());
01370       double rhsizePhi 
01371         = fabs(corners[0].Phi() - corners[2].Phi());
01372       if ( rhsizePhi > M_PI ) rhsizePhi = 2.*M_PI - rhsizePhi;
01373       
01374 #ifdef PFLOW_DEBUG
01375       if( debug_ ) {
01376         cout << rhit         << " Hcal RecHit=" 
01377              << posrep.Eta() << " " 
01378              << posrep.Phi() << " "
01379              << rechit_cluster.energy() 
01380              << endl; 
01381         for ( unsigned jc=0; jc<4; ++jc ) 
01382           cout<<"corners "<<jc<<" "<<corners[jc].Eta()
01383               <<" "<<corners[jc].Phi()<<endl;
01384         
01385         cout << "RecHit SizeEta=" << rhsizeEta
01386              << " SizePhi=" << rhsizePhi << endl;
01387       }
01388 #endif
01389     
01390       //distance track-rechit center
01391       // const math::XYZPoint& posxyz 
01392       // = rechit_cluster.position();
01393       double deta = fabs(posrep.Eta() - tracketa);
01394       double dphi = fabs(posrep.Phi() - trackphi);
01395       if ( dphi > M_PI ) dphi = 2.*M_PI - dphi;
01396 
01397 #ifdef PFLOW_DEBUG
01398       if( debug_ ){
01399         cout << "distance=" 
01400              << deta << " " 
01401              << dphi << " ";
01402         if(deta < (rhsizeEta/2.) && dphi < (rhsizePhi/2.))
01403           cout << " link here !" << endl;
01404         else cout << endl;
01405       }
01406 #endif
01407       
01408       if(deta < (rhsizeEta/2.) && dphi < (rhsizePhi/2.)){ 
01409         linkedbyrechit = true;
01410         break;
01411       }
01412     }
01413     else { //endcap case, matching in X,Y
01414 
01415 #ifdef PFLOW_DEBUG
01416       if( debug_ ){
01417         const math::XYZPoint& posxyz 
01418           = rechit_cluster.position();
01419        
01420         cout << "RH " << posxyz.X()
01421              << " "   << posxyz.Y()
01422              << endl;
01423         
01424         cout << "TRACK " << track_X
01425              << " "      << track_Y
01426              << endl;
01427       }
01428 #endif
01429       
01430       double x[5];
01431       double y[5];
01432       for ( unsigned jc=0; jc<4; ++jc ) {
01433         math::XYZPoint cornerposxyz = cornersxyz[jc];
01434         x[jc] = cornerposxyz.X();
01435         y[jc] = cornerposxyz.Y();
01436         
01437 #ifdef PFLOW_DEBUG
01438         if( debug_ ){
01439           cout<<"corners "<<jc
01440               << " " << cornerposxyz.X()
01441               << " " << cornerposxyz.Y()
01442               << endl;
01443         }
01444 #endif
01445       }//loop corners
01446 
01447       //need to close the polygon in order to
01448       //use the TMath::IsInside fonction from root lib
01449       x[4] = x[0];
01450       y[4] = y[0];
01451   
01452       //Check if the extrapolation point of the track falls 
01453       //within the rechit boundaries
01454       bool isinside = TMath::IsInside(track_X,
01455                                       track_Y,
01456                                       5,x,y);
01457       
01458       if( isinside ){
01459         linkedbyrechit = true;
01460         break;
01461       }
01462     }//
01463     
01464   }//loop rechits
01465   
01466   if( linkedbyrechit ) {
01467 #ifdef PFLOW_DEBUG
01468     if( debug_ ) 
01469       cout << "Track and Cluster LINKED BY RECHIT" << endl;
01470 #endif
01471     return lnk;
01472   }
01473   else
01474     return std::pair<double,double>(-1,-1);
01475 }

std::pair< double, double > PFBlockAlgo::testLinkByVertex ( const reco::PFBlockElement elt1,
const reco::PFBlockElement elt2 
) const [private]

Definition at line 1178 of file PFBlockAlgo.cc.

References reco::PFBlockElement::convRef(), GenMuonPlsPt100GeV_cfg::cout, debug_, lat::endl(), edm::Ref< C, T, F >::isNonnull(), reco::PFBlockElement::nuclearRef(), HLT_VtxMuL3::result, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::T_FROM_NUCL, reco::PFBlockElement::T_FROM_V0, reco::PFBlockElement::T_TO_NUCL, reco::PFBlockElement::trackType(), and reco::PFBlockElement::V0Ref().

Referenced by link().

01179                                                                      {
01180 
01181   double result=-1.;
01182   if( (elt1->trackType(reco::PFBlockElement::T_TO_NUCL) &&
01183        elt2->trackType(reco::PFBlockElement::T_FROM_NUCL)) ||
01184       (elt1->trackType(reco::PFBlockElement::T_FROM_NUCL) &&
01185        elt2->trackType(reco::PFBlockElement::T_TO_NUCL)) ||
01186       (elt1->trackType(reco::PFBlockElement::T_FROM_NUCL) &&
01187        elt2->trackType(reco::PFBlockElement::T_FROM_NUCL))) {
01188     
01189     NuclearInteractionRef ni1_ = elt1->nuclearRef(); 
01190     NuclearInteractionRef ni2_ = elt2->nuclearRef(); 
01191     if( ni1_.isNonnull() && ni2_.isNonnull() ) {
01192       if( ni1_ == ni2_ ) result= 1.0;
01193     }
01194   }
01195   else if (  elt1->trackType(reco::PFBlockElement::T_FROM_GAMMACONV)  &&
01196              elt2->trackType(reco::PFBlockElement::T_FROM_GAMMACONV)  ) {
01197     
01198     if(debug_ ) std::cout << " testLinkByVertex On Conversions " << std::endl;
01199     
01200     if ( elt1->convRef().isNonnull() && elt2->convRef().isNonnull() ) {
01201       if(debug_ ) std::cout << " PFBlockAlgo.cc testLinkByVertex  Cconversion Refs are non null  " << std::endl;      
01202       if ( elt1->convRef() ==  elt2->convRef() ) {
01203         result=1.0;
01204         if(debug_ ) std::cout << " testLinkByVertex  Cconversion Refs are equal  " << std::endl;           
01205       }
01206     } 
01207     
01208   }
01209   else if (  elt1->trackType(reco::PFBlockElement::T_FROM_V0)  &&
01210              elt2->trackType(reco::PFBlockElement::T_FROM_V0)  ) {
01211     if(debug_ ) std::cout << " testLinkByVertex On V0 " << std::endl;
01212     if ( elt1->V0Ref().isNonnull() && elt2->V0Ref().isNonnull() ) {
01213       if(debug_ ) std::cout << " PFBlockAlgo.cc testLinkByVertex  V0 Refs are non null  " << std::endl;
01214       if ( elt1->V0Ref() ==  elt2->V0Ref() ) {
01215         result=1.0;
01216         if(debug_ ) std::cout << " testLinkByVertex  V0 Refs are equal  " << std::endl;
01217       }
01218     }
01219   }
01220 
01221   return std::pair<double,double>(result,0.);
01222 }

std::pair< double, double > PFBlockAlgo::testPS1AndPS2 ( const reco::PFCluster ps1,
const reco::PFCluster ps2 
) const [private]

tests association between a PS1 v cluster and a PS2 h cluster returns chi2

Definition at line 1129 of file PFBlockAlgo.cc.

References chi2PSHV_, GenMuonPlsPt100GeV_cfg::cout, debug_, reco::CaloCluster::position(), resPSlength_, resPSpitch_, scale, and funct::sqrt().

Referenced by link().

01130                                                         {
01131   
01132   //   cout<<"entering testPS1AndPS2"<<endl;
01133   
01134   // compute chi2 in y, z using swimming formulae
01135   // y2 = y1 * z2/z1   and x2 = x1 *z2/z1
01136   
01137   // ps position1  x, y, z
01138   double x1 = ps1.position().X();
01139   double y1 = ps1.position().Y();
01140   double z1 = ps1.position().Z();
01141   double x2 = ps2.position().X();
01142   double y2 = ps2.position().Y();
01143   double z2 = ps2.position().Z();
01144   // swim to PS2
01145   double scale = z2/z1;
01146   double x1atPS2 = x1*scale;
01147   double y1atPS2 = y1*scale;
01148   // resolution of PS cluster dxdx and dydy from strip pitch and length
01149   // vertical strips in PS1, measure x with pitch precision
01150   double dx1dx1 = resPSpitch_*resPSpitch_*scale*scale;
01151   double dy1dy1 = resPSlength_*resPSlength_*scale*scale;
01152   // horizontal strips in PS2 , measure y with pitch precision
01153   double dy2dy2 = resPSpitch_*resPSpitch_;
01154   double dx2dx2 = resPSlength_*resPSlength_;
01155   
01156   double chi2 = (x2-x1atPS2)*(x2-x1atPS2)/(dx1dx1 + dx2dx2) 
01157     + (y2-y1atPS2)*(y2-y1atPS2)/(dy1dy1 + dy2dy2);
01158   
01159   double dist = std::sqrt( (x2-x1atPS2)*(x2-x1atPS2)
01160                          + (y2-y1atPS2)*(y2-y1atPS2));
01161     
01162 #ifdef PFLOW_DEBUG
01163   if(debug_) cout<<"testPS1AndPS2 "<<chi2<<" "<<endl;
01164   if(debug_){
01165     cout<<" x1atPS2 "<< x1atPS2 << " dx1 "<<resPSpitch_*scale
01166         <<" y1atPS2 "<< y1atPS2 << " dy1 "<<resPSlength_*scale<< endl
01167         <<" x2 " <<x2  << " dx2 "<<resPSlength_
01168         <<" y2 " << y2 << " dy2 "<<resPSpitch_<< endl;
01169   }
01170 #endif
01171   if(chi2<chi2PSHV_ || chi2PSHV_<0 )
01172     return std::pair<double,double>(chi2,dist);
01173   else 
01174     return std::pair<double,double>(-1,-1);
01175 }

std::pair< double, double > PFBlockAlgo::testPSAndECAL ( const reco::PFCluster ps,
const reco::PFCluster ecal 
) const [private]

tests association between an PS and an ECAL cluster returns chi2

Definition at line 1041 of file PFBlockAlgo.cc.

References chi2PSECAL_, GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFCluster::energy(), PFResolutionMap::FindBin(), reco::PFCluster::layer(), Utils::mpi_pi(), reco::CaloCluster::position(), reco::PFCluster::positionREP(), PFLayer::PS1, PFLayer::PS2, resMapEtaECAL_, resMapPhiECAL_, resPSlength_, resPSpitch_, and funct::sqrt().

Referenced by link().

01042                                                          {
01043   
01044   //   cout<<"entering testPSAndECAL"<<endl;
01045   
01046   PFResolutionMap* mapetaECAL = const_cast<PFResolutionMap*>(resMapEtaECAL_);
01047   PFResolutionMap* mapphiECAL = const_cast<PFResolutionMap*>(resMapPhiECAL_);
01048   
01049   // retrieve resolutions from resolution maps
01050   double ecaletares 
01051     = mapetaECAL->GetBinContent(mapetaECAL->FindBin(ecal.positionREP().Eta(), 
01052                                                     ecal.energy() ) );
01053   double ecalphires 
01054     = mapphiECAL->GetBinContent(mapphiECAL->FindBin(ecal.positionREP().Eta(), 
01055                                                     ecal.energy() ) );
01056   // ecal position in eta and phi
01057   double ecaleta = ecal.positionREP().Eta();
01058   double ecalphi = ecal.positionREP().Phi();
01059   
01060   
01061   // ps position x, y, z, R and  rho, eta, phi
01062   double pseta = ps.positionREP().Eta();
01063   double psphi = ps.positionREP().Phi();
01064   double psrho = ps.positionREP().Rho();
01065   double psrho2 = psrho*psrho;
01066   double psx = ps.position().X();
01067   double psy = ps.position().Y();
01068   double psz = ps.position().Z();
01069   double psR = ps.position().R();
01070   // resolution of PS cluster dxdx and dydy from strip pitch and length
01071   double dxdx =0.;
01072   double dydy =0.;
01073   switch (ps.layer()) {
01074   case PFLayer::PS1:
01075     // vertical strips, measure x with pitch precision
01076     dxdx = resPSpitch_*resPSpitch_;
01077     dydy = resPSlength_*resPSlength_;
01078     break;
01079   case PFLayer::PS2:
01080     // horizontal strips, measure y with pitch precision
01081     dydy = resPSpitch_*resPSpitch_;
01082     dxdx = resPSlength_*resPSlength_;
01083     break;
01084   default:
01085     break;
01086   }
01087   // derivatives deta/dx, deta/dy, dphi/dx, dphi/deta
01088   double detadx = psx*psz/(psrho2*psR);
01089   double detady = psy*psz/(psrho2*psR);
01090   double dphidx = -psy/psrho2;
01091   double dphidy = psx/psrho2;
01092   // propagate error matrix  x. y (diagonal) to eta, phi (non diagonal)
01093   double detadeta = detadx*detadx*dxdx + detady*detady*dydy;
01094   double dphidphi = dphidx*dphidx*dxdx + dphidy*dphidy*dydy;
01095   double detadphi = detadx*dphidx*dxdx + detady*dphidy*dydy;
01096   // add ecal resol in quadrature
01097   double detadetas = detadeta + ecaletares*ecaletares;
01098   double dphidphis = dphidphi + ecalphires*ecalphires;
01099   // compute chi2 in eta, phi with non diagonal error matrix (detadphi non zero)
01100   double deta = pseta - ecaleta;
01101   double dphi = Utils::mpi_pi(psphi - ecalphi);
01102   double det  = detadetas*dphidphis - detadphi*detadphi;
01103   double chi2 
01104     = (dphidphis*deta*deta + detadetas*dphi*dphi - 2.*detadphi*deta*dphi)/det;
01105   double dist = std::sqrt(deta*deta+dphi*dphi);
01106   
01107   
01108 #ifdef PFLOW_DEBUG
01109   if(debug_) cout<<"testPSAndECAL "<<chi2<<" "<<endl;
01110   if(debug_){
01111     double psetares = sqrt(detadeta);
01112     double psphires = sqrt (dphidphi);
01113     cout<< " pseta "  <<pseta   << " psetares "   << psetares
01114         << " psphi "  <<psphi   << " psphires "   << psphires << endl
01115         << " ecaleta "<<ecaleta << " ecaletares " << ecaletares
01116         << " ecalphi "<<ecalphi << " ecalphires " << ecalphires<< endl;
01117   }
01118 #endif
01119   
01120 
01121   if(chi2<chi2PSECAL_ || chi2PSECAL_<0 )
01122     return std::pair<double,double>(chi2,dist);
01123   else 
01124     return std::pair<double,double>(-1,-1);
01125 }

std::pair< double, double > PFBlockAlgo::testTrackAndECAL ( const reco::PFRecTrack track,
const reco::PFCluster ecal,
double  SignBremDp = 10. 
) const [private]

tests association between a track and an ECAL cluster

Returns:
chi2
this function is non const because it uses PFResolutionMap, which reimplements TH1::FindBin, which is non const.

Definition at line 828 of file PFBlockAlgo.cc.

References reco::PFRecTrack::algoType(), chi2GSFECAL_, chi2TrackECAL_, computeChi2(), GenMuonPlsPt100GeV_cfg::cout, debug_, direction, reco::PFTrajectoryPoint::ECALEntrance, reco::PFTrajectoryPoint::ECALShowerMax, reco::PFCluster::energy(), PV3DBase< T, PVType, FrameType >::eta(), reco::PFTrack::extrapolatedPoint(), PFResolutionMap::FindBin(), reco::PFCluster::getDepthCorrection(), reco::PFTrajectoryPoint::isValid(), reco::PFTrajectoryPoint::momentum(), reco::PFTrajectoryPoint::position(), reco::PFCluster::positionREP(), reco::PFTrajectoryPoint::positionREP(), resMapEtaECAL_, resMapPhiECAL_, and Vector3DBase< T, FrameTag >::unit().

Referenced by link().

00830                                                         {
00831   
00832   //   cout<<"entering testTrackAndECAL"<<endl;
00833   
00834   
00835   double tracketa;
00836   double trackphi;
00837 
00838   // special chi2 for GSF-ECAL matching
00839   double chi2cut = (track.algoType()!=PFRecTrack::GSF) ? chi2TrackECAL_ : chi2GSFECAL_;
00840 
00841   //  cout << " SignBremDp " << SignBremDp << endl;
00842   // The SignBremDp cut has to be optimized 
00843   if (SignBremDp > 3) {
00844     const reco::PFTrajectoryPoint& atECAL 
00845       = track.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax );
00846     if( ! atECAL.isValid() ) return std::pair<double,double>(-1,-1);   
00847     tracketa = atECAL.positionREP().Eta();
00848     trackphi = atECAL.positionREP().Phi();
00849     //   cout<<"atECAL "<<atECAL.layer()<<" "
00850     //       <<atECAL.position().Eta()<<" "
00851     //       <<atECAL.position().Phi()<<endl;
00852   }
00853   else {
00854     // needed only for the brem when the momentum is bad estimated. 
00855     // The ECAL cluster energy is taken in these cases
00856 
00857     const reco::PFTrajectoryPoint& atECAL 
00858       = track.extrapolatedPoint( reco::PFTrajectoryPoint::ECALEntrance );
00859     if( ! atECAL.isValid() ) return std::pair<double,double>(-1,-1);   
00860     math::XYZVector posatecal( atECAL.position().x(),
00861                                atECAL.position().y(),
00862                                atECAL.position().z());
00863     
00864     bool isBelowPS=(fabs(ecal.positionREP().Eta())>1.65) ? true :false;
00865     double clusenergy = ecal.energy();
00866     double ecalShowerDepth 
00867       = reco::PFCluster::getDepthCorrection(clusenergy, isBelowPS,false);
00868     
00869     math::XYZVector direction(atECAL.momentum().x(),
00870                               atECAL.momentum().y(),
00871                               atECAL.momentum().z() );
00872 
00873     direction=direction.unit();
00874     posatecal += ecalShowerDepth*direction;
00875     tracketa = posatecal.eta();
00876     trackphi = posatecal.phi();
00877   }
00878 
00879 
00880   double ecaleta  = ecal.positionREP().Eta();
00881   double ecalphi  = ecal.positionREP().Phi();
00882   
00883 
00884   PFResolutionMap* mapeta = const_cast<PFResolutionMap*>(resMapEtaECAL_);
00885   PFResolutionMap* mapphi = const_cast<PFResolutionMap*>(resMapPhiECAL_);
00886 
00887   
00888   double ecaletares 
00889     = mapeta->GetBinContent(mapeta->FindBin(ecaleta, 
00890                                             ecal.energy() ) );
00891   double ecalphires 
00892     = mapphi->GetBinContent(mapphi->FindBin(ecaleta, 
00893                                             ecal.energy() ) );
00894   
00895   
00896   // rec track resolution should be negligible compared to ecal resolution
00897   double trackres = 0;
00898   
00899   std::pair<double,double> lnk = computeChi2( ecaleta, ecaletares, 
00900                                               ecalphi, ecalphires, 
00901                                               tracketa, trackres, 
00902                                               trackphi, trackres);
00903   double chi2 = lnk.first;
00904 
00905 #ifdef PFLOW_DEBUG
00906   if(debug_) cout<<"testTrackAndECAL "<<chi2<<" "<<endl;
00907   if(debug_){
00908     cout<<" ecaleta "  << ecaleta  << "  ecaletares " <<ecaletares
00909         <<" ecalphi "  << ecalphi  << "  ecalphires " <<ecalphires
00910         <<" tracketa " << tracketa << "  trackres "   <<trackres
00911         <<" trackphi " << trackphi << "  trackres "   <<trackres << endl;
00912   }
00913 #endif
00914   
00915 
00916   if(chi2<chi2cut || chi2TrackECAL_<0 )
00917     return lnk;
00918   else 
00919     return std::pair<double,double>(-1,-1);
00920 }

std::pair< double, double > PFBlockAlgo::testTrackAndHCAL ( const reco::PFRecTrack track,
const reco::PFCluster hcal 
) const [private]

tests association between a track and an HCAL cluster

Returns:
chi2
this function is non const because it uses PFResolutionMap, which reimplements TH1::FindBin, which is non const.

Definition at line 925 of file PFBlockAlgo.cc.

References chi2TrackHCAL_, computeChi2(), GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFCluster::energy(), reco::PFTrack::extrapolatedPoint(), PFResolutionMap::FindBin(), reco::PFTrajectoryPoint::HCALEntrance, reco::PFTrajectoryPoint::isValid(), reco::PFCluster::positionREP(), reco::PFTrajectoryPoint::positionREP(), resMapEtaHCAL_, and resMapPhiHCAL_.

Referenced by link().

00926                                                             {
00927   
00928   
00929   //   cout<<"entering testTrackAndHCAL"<<endl;
00930 
00931   // this is the fake cluster for ps cells
00932   //   if( ! hcal.type() ) return -1;
00933   
00934   
00935   const reco::PFTrajectoryPoint& atHCAL 
00936     = track.extrapolatedPoint( reco::PFTrajectoryPoint::HCALEntrance );
00937   
00938   //   cout<<"atHCAL "<<atHCAL.layer()<<" "
00939   //       <<atHCAL.position().Eta()<<" "
00940   //       <<atHCAL.position().Phi()<<endl;
00941   
00942   // did not reach hcal, cannot be associated with a cluster.
00943   if( ! atHCAL.isValid() ) return std::pair<double,double>(-1,-1);   
00944   
00945   double tracketa = atHCAL.positionREP().Eta();
00946   double trackphi = atHCAL.positionREP().Phi();
00947   double hcaleta  = hcal.positionREP().Eta();
00948   double hcalphi  = hcal.positionREP().Phi();
00949   
00950   
00951   PFResolutionMap* mapeta = const_cast<PFResolutionMap*>(resMapEtaHCAL_);
00952   PFResolutionMap* mapphi = const_cast<PFResolutionMap*>(resMapPhiHCAL_);
00953   
00954   double hcaletares 
00955     = mapeta->GetBinContent(mapeta->FindBin(hcaleta, 
00956                                             hcal.energy() ) );
00957   double hcalphires 
00958     = mapphi->GetBinContent(mapphi->FindBin(hcaleta, 
00959                                             hcal.energy() ) );
00960   
00961   
00962   // rec track resolution should be negligible compared to hcal resolution
00963   double trackres = 0;
00964   
00965   std::pair<double,double> lnk = computeChi2( hcaleta, hcaletares, 
00966                                               hcalphi, hcalphires, 
00967                                               tracketa, trackres, 
00968                                               trackphi, trackres);
00969   double chi2 = lnk.first;
00970   
00971 #ifdef PFLOW_DEBUG
00972   if(debug_) cout<<"testTrackAndHCAL "<<chi2<<" "<<endl;
00973   if(debug_){
00974     cout<<" hcaleta "  << hcaleta << "  hcaletares "<<hcaletares
00975         <<" hcalphi "  << hcalphi << "  hcalphires "<<hcalphires
00976         <<" tracketa " << tracketa<< "  trackres "  <<trackres
00977         <<" trackphi " << trackphi<< "  trackres "  <<trackres << endl;
00978   }
00979 #endif
00980   
00981   if(chi2<chi2TrackHCAL_ || chi2TrackHCAL_<0 )
00982     return lnk;
00983   else 
00984     return std::pair<double,double>(-1,-1);
00985 }

std::pair< double, double > PFBlockAlgo::testTrackAndPS ( const reco::PFRecTrack track,
const reco::PFCluster ps 
) const [private]

tests association between a track and a PS cluster returns chi2

Definition at line 757 of file PFBlockAlgo.cc.

References chi2PSTrack_, GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFTrack::extrapolatedPoint(), reco::PFTrajectoryPoint::isValid(), reco::PFCluster::layer(), reco::PFTrajectoryPoint::position(), reco::CaloCluster::position(), reco::PFTrajectoryPoint::PS1, PFLayer::PS1, reco::PFTrajectoryPoint::PS2, PFLayer::PS2, resPSlength_, resPSpitch_, and funct::sqrt().

Referenced by link().

00758                                                         {
00759 
00760   //   cout<<"entering testTrackAndPS"<<endl;
00761   // resolution of PS cluster dxdx and dydy from strip pitch and length
00762   double dx=0.;
00763   double dy=0.;
00764   
00765   unsigned layerid =0;
00766   // PS1: vertical strips  PS2: horizontal strips
00767   switch (ps.layer()) {
00768   case PFLayer::PS1:
00769     layerid = reco::PFTrajectoryPoint::PS1;
00770     
00771     // vertical strips in PS1, measure x with pitch precision
00772     dx = resPSpitch_;
00773     dy = resPSlength_; 
00774     break;
00775   case PFLayer::PS2:
00776     layerid = reco::PFTrajectoryPoint::PS2;
00777     // horizontal strips in PS2, measure y with pitch precision
00778     dy = resPSpitch_;
00779     dx = resPSlength_;
00780     break;
00781   default:
00782     break;
00783   }
00784   const reco::PFTrajectoryPoint& atPS
00785     = track.extrapolatedPoint( layerid );  
00786   // did not reach PS, cannot be associated with a cluster.
00787   if( ! atPS.isValid() ) return std::pair<double,double>(-1,-1);   
00788   
00789   double trackx = atPS.position().X();
00790   double tracky = atPS.position().Y();
00791   
00792   // ps position  x, y
00793   double psx = ps.position().X();
00794   double psy = ps.position().Y();
00795   
00796   // rec track resolution negligible compared to ps resolution?
00797   // compute chi2 PS_TRACK in x, y
00798   double trackresolx = 0.;
00799   double trackresoly = 0.;
00800   
00801   double chi2 = (psx-trackx)*(psx-trackx)/(dx*dx + trackresolx*trackresolx)
00802     + (psy-tracky)*(psy-tracky)/(dy*dy + trackresoly*trackresoly);
00803 
00804   double dist = std::sqrt( (psx-trackx)*(psx-trackx)
00805                          + (psy-tracky)*(psy-tracky));
00806 
00807   
00808 #ifdef PFLOW_DEBUG
00809   if(debug_) cout<<"testTrackAndPS "<<chi2<<" "<<endl;
00810   if(debug_){
00811     cout<<" trackx " << trackx << " trackresolx " << trackresolx
00812         <<" tracky " << tracky << " trackresoly " << trackresoly << endl
00813         <<" psx "    <<  psx   << "  dx "         << dx
00814         <<" psy "    << psy    << "  dy "         << dy << endl;
00815   }
00816 #endif
00817   
00818   
00819   if(chi2<chi2PSTrack_ || chi2PSTrack_<0 )
00820     return std::pair<double,double>(chi2,dist);
00821   else 
00822     return std::pair<double,double>(-1,-1);
00823 }

std::auto_ptr< reco::PFBlockCollection > PFBlockAlgo::transferBlocks (  )  [inline]

Returns:
auto_ptr to collection of blocks

Definition at line 142 of file PFBlockAlgo.h.

References blocks_.

Referenced by PFRootEventManager::particleFlow(), and PFBlockProducer::produce().

00142 {return blocks_;}

int PFBlockAlgo::v0AssocToTrack ( const reco::TrackRef trackref,
const edm::OrphanHandle< reco::PFV0Collection > &  v0 
) const [private]

Definition at line 1678 of file PFBlockAlgo.cc.

References edm::OrphanHandle< T >::isValid(), and k.

01679                                                                                       {
01680   if( v0.isValid() ) {
01681     // look for v0 associated to primTkRef
01682     for( unsigned int k=0; k<v0->size(); ++k) {
01683       for (uint itk=0;itk<(*v0)[k].Tracks().size();itk++){
01684         if( (*v0)[k].Tracks()[itk] == primTkRef) return k;
01685       }
01686      
01687     }
01688     return -1; // not found
01689   }
01690   else return -1;
01691 }

int PFBlockAlgo::v0AssocToTrack ( const reco::TrackRef trackref,
const edm::Handle< reco::PFV0Collection > &  v0 
) const [private]

find index of the V0 track associated to trackref.

if no V0 tracks have been found then return -1.

Definition at line 1663 of file PFBlockAlgo.cc.

References edm::Handle< T >::isValid(), and k.

Referenced by setInput().

01664                                                                                 {
01665   if( v0.isValid() ) {
01666     // look for v0 associated to primTkRef
01667     for( unsigned int k=0; k<v0->size(); ++k) {
01668       for (uint itk=0;itk<(*v0)[k].Tracks().size();itk++){ 
01669         if( (*v0)[k].Tracks()[itk] == primTkRef) return k;
01670       }
01671     }
01672     return -1; // not found
01673   }
01674   else return -1;
01675 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFBlockAlgo a 
) [friend]

Definition at line 1549 of file PFBlockAlgo.cc.

01549                                                               {
01550   if(! out) return out;
01551   
01552   out<<"====== Particle Flow Block Algorithm ======= ";
01553   out<<endl;
01554   out<<"resMapEtaECAL "<<a.resMapEtaECAL_->GetMapFile()<<endl;
01555   out<<"resMapPhiECAL "<<a.resMapPhiECAL_->GetMapFile()<<endl;
01556   out<<"resMapEtaHCAL "<<a.resMapEtaHCAL_->GetMapFile()<<endl;
01557   out<<"resMapPhiHCAL "<<a.resMapPhiHCAL_->GetMapFile()<<endl;
01558   out<<"chi2TrackECAL "<<a.chi2TrackECAL_<<endl;
01559   out<<"chi2TrackHCAL "<<a.chi2TrackHCAL_<<endl;
01560   out<<"chi2ECALHCAL  "<<a.chi2ECALHCAL_<<endl;
01561   out<<"chi2PSECAL    "<<a.chi2PSECAL_  <<endl;
01562   out<<"chi2PSTRACK   "<<a.chi2PSTrack_ <<endl;
01563   out<<"chi2PSHV      "<<a.chi2PSHV_    <<endl;
01564   out<<endl;
01565   out<<"number of unassociated elements : "<<a.elements_.size()<<endl;
01566   out<<endl;
01567   
01568   for(PFBlockAlgo::IEC ie = a.elements_.begin(); 
01569       ie != a.elements_.end(); ie++) {
01570     out<<"\t"<<**ie <<endl;
01571   }
01572 
01573   
01574   //   const PFBlockCollection& blocks = a.blocks();
01575 
01576   const std::auto_ptr< reco::PFBlockCollection >& blocks
01577     = a.blocks(); 
01578     
01579   if(!blocks.get() ) {
01580     out<<"blocks already transfered"<<endl;
01581   }
01582   else {
01583     out<<"number of blocks : "<<blocks->size()<<endl;
01584     out<<endl;
01585     
01586     for(PFBlockAlgo::IBC ib=blocks->begin(); 
01587         ib != blocks->end(); ib++) {
01588       out<<(*ib)<<endl;
01589     }
01590   }
01591 
01592   return out;
01593 }


Member Data Documentation

std::auto_ptr< reco::PFBlockCollection > PFBlockAlgo::blocks_ [private]

Definition at line 280 of file PFBlockAlgo.h.

Referenced by blocks(), findBlocks(), and transferBlocks().

double PFBlockAlgo::chi2ECALHCAL_ [private]

max chi2 for ECAL/HCAL association

Definition at line 315 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), and testECALAndHCAL().

double PFBlockAlgo::chi2GSFECAL_ [private]

max chi2 for GSF/ECAL association

Definition at line 309 of file PFBlockAlgo.h.

Referenced by setParameters(), and testTrackAndECAL().

double PFBlockAlgo::chi2PSECAL_ [private]

max chi2 for PS/ECAL association

Definition at line 318 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), and testPSAndECAL().

double PFBlockAlgo::chi2PSHV_ [private]

max chi2 for PSH/PSV association

Definition at line 324 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), and testPS1AndPS2().

double PFBlockAlgo::chi2PSTrack_ [private]

max chi2 for PS/Track association

Definition at line 321 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), and testTrackAndPS().

double PFBlockAlgo::chi2TrackECAL_ [private]

max chi2 for track/ECAL association

Definition at line 306 of file PFBlockAlgo.h.

Referenced by link(), operator<<(), setParameters(), and testTrackAndECAL().

double PFBlockAlgo::chi2TrackHCAL_ [private]

max chi2 for track/HCAL association

Definition at line 312 of file PFBlockAlgo.h.

Referenced by link(), operator<<(), setParameters(), and testTrackAndHCAL().

bool PFBlockAlgo::debug_ [private]

if true, debug printouts activated

Definition at line 337 of file PFBlockAlgo.h.

Referenced by findBlocks(), goodPtResolution(), link(), setDebug(), setInput(), testECALAndHCAL(), testLinkByRecHit(), testLinkByVertex(), testPS1AndPS2(), testPSAndECAL(), testTrackAndECAL(), testTrackAndHCAL(), testTrackAndPS(), and ~PFBlockAlgo().

double PFBlockAlgo::DPtovPtCut_ [private]

DPt/Pt cut for creating atrack element.

Definition at line 303 of file PFBlockAlgo.h.

Referenced by goodPtResolution(), and setParameters().

const PFBlockAlgo::Mask PFBlockAlgo::dummyMask_ [static, private]

Definition at line 288 of file PFBlockAlgo.h.

std::list< reco::PFBlockElement* > PFBlockAlgo::elements_ [private]

actually, particles will be created by a separate producer

Definition at line 286 of file PFBlockAlgo.h.

Referenced by fillSecondaries(), findBlocks(), operator<<(), setInput(), and ~PFBlockAlgo().

bool PFBlockAlgo::multipleLink_ [private]

if true, using special algorithm to process multiple track associations to the same hcal cluster

Definition at line 334 of file PFBlockAlgo.h.

Referenced by link(), and setParameters().

PFResolutionMap* PFBlockAlgo::resMapEtaECAL_ [private]

resolution map Eta ECAL

Definition at line 291 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), testECALAndHCAL(), testLinkByRecHit(), testPSAndECAL(), testTrackAndECAL(), and ~PFBlockAlgo().

PFResolutionMap* PFBlockAlgo::resMapEtaHCAL_ [private]

resolution map Eta HCAL

Definition at line 297 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), testECALAndHCAL(), testLinkByRecHit(), testTrackAndHCAL(), and ~PFBlockAlgo().

PFResolutionMap* PFBlockAlgo::resMapPhiECAL_ [private]

resolution map Phi ECAL

Definition at line 294 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), testECALAndHCAL(), testLinkByRecHit(), testPSAndECAL(), testTrackAndECAL(), and ~PFBlockAlgo().

PFResolutionMap* PFBlockAlgo::resMapPhiHCAL_ [private]

resolution map Phi HCAL

Definition at line 300 of file PFBlockAlgo.h.

Referenced by operator<<(), setParameters(), testECALAndHCAL(), testLinkByRecHit(), testTrackAndHCAL(), and ~PFBlockAlgo().

double PFBlockAlgo::resPSlength_ [private]

PS resolution along strip.

Definition at line 330 of file PFBlockAlgo.h.

Referenced by setParameters(), testPS1AndPS2(), testPSAndECAL(), and testTrackAndPS().

double PFBlockAlgo::resPSpitch_ [private]

PS strip resolution.

Definition at line 327 of file PFBlockAlgo.h.

Referenced by setParameters(), testPS1AndPS2(), testPSAndECAL(), and testTrackAndPS().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:40 2009 for CMSSW by  doxygen 1.5.4