CMS 3D CMS Logo

PFAlgo Class Reference

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

Inheritance diagram for PFAlgo:

PFAlgoTestBenchConversions PFAlgoTestBenchElectrons

List of all members.

Public Types

enum  EnergyTest { COMPATIBLE = 0, NOT_ENOUGH_ENERGY, TOO_MUCH_ENERGY }
 Comparing Calo and total momentum. More...
enum  RecoveryStatus { DONE = 0, KEEP_SEARCHING }
 Cluster Recovery Status. More...

Public Member Functions

 PFAlgo ()
 constructor
const std::auto_ptr
< reco::PFCandidateCollection > & 
pfCandidates () const
 
Returns:
collection of candidates

virtual void reconstructParticles (const reco::PFBlockCollection &blocks)
 reconstruct particles
void reconstructParticles (const reco::PFBlockHandle &blockHandle)
 reconstruct particles (full framework case) will keep track of the block handle to build persistent references, and call reconstructParticles( const reco::PFBlockCollection& blocks )
void setAlgo (int algo)
void setDebug (bool debug)
void setParameters (double nSigmaECAL, double nSigmaHCAL, const boost::shared_ptr< PFEnergyCalibration > &calibration, const boost::shared_ptr< pftools::PFClusterCalibration > &clusterCalibration, bool newCalib, bool clusterRecovery, double PSCut=0.0001, double mvaCut=PFAlgo::maxMvaCut_, const char *mvaWeightFile="")
void setPFConversionParameters (bool usePFConversions)
void setPFEleParameters (double chi2EcalGSF, double chi2EcalBrem, double chi2HcalGSF, double chi2HcalBrem, double chi2PsGSF, double chi2PsBrem, double mvaEleCut, std::string mvaWeightFileEleID, bool usePFElectrons)
std::auto_ptr
< reco::PFCandidateCollection
transferCandidates ()
 
Returns:
auto_ptr to the collection of candidates (transfers ownership)

virtual ~PFAlgo ()
 destructor

Protected Member Functions

PFAlgo::EnergyTest energyTest (double energyTrk, double energyHcal, double energyEcal, double etaH, double phiH, double &neutralHadron)
 fonction comapring energy Calo and total momentum
bool isSatelliteCluster (const reco::PFRecTrack &track, const reco::PFCluster &cluster)
 Checking if a given cluster is a satellite cluster of a given charged hadron (track).
double neutralHadronEnergyResolution (double clusterEnergy) const
 
Returns:
calibrated energy of a photon

virtual void processBlock (const reco::PFBlockRef &blockref, std::list< reco::PFBlockRef > &hcalBlockRefs, std::list< reco::PFBlockRef > &ecalBlockRefs)
 process one block.
unsigned reconstructCluster (const reco::PFCluster &cluster, double particleEnergy)
 Reconstruct a neutral particle from a cluster.
unsigned reconstructTrack (const reco::PFBlockElement &elt)
 Reconstruct a charged hadron from a track Returns the index of the newly created candidate in pfCandidates_.
PFAlgo::RecoveryStatus recoveringClusters (double totalChargedMomentum, double totalEcal, double &totalHcal, const std::vector< reco::PFRecTrackRef > &associatedTracks, const reco::PFBlockRef &blockref, std::vector< bool > &active)
 Recovering satellite clusters that belong to a charged hadron.

Protected Attributes

std::auto_ptr
< reco::PFCandidateCollection
pfCandidates_

Private Member Functions

reco::PFBlockRef createBlockRef (const reco::PFBlockCollection &blocks, unsigned bi)
 create a reference to a block, transient or persistent depending on the needs

Private Attributes

int algo_
reco::PFBlockHandle blockHandle_
 input block handle (full framework case)
boost::shared_ptr
< PFEnergyCalibration
calibration_
float chi2ECAL_
boost::shared_ptr
< pftools::PFClusterCalibration
clusterCalibration_
bool clusterRecovery_
 algorithm to recover satellite clusters in HCAL coming from nuclear interactions
bool debug_
float eECALOverpTrack_
std::vector< unsigned > hcalBlockUsed_
TMVA::Reader * mergedPhotonsMVA_
 should not be a pointer, but we need to be able to reset this, and there seems to be not reset function in this class.
float mvaCut_
double mvaEleCut_
std::string mvaWeightFileEleID_
bool newCalib_
double nSigmaECAL_
 number of sigma to judge energy excess in ECAL
double nSigmaHCAL_
 number of sigma to judge energy excess in HCAL
PFConversionAlgopfConversion_
PFElectronAlgopfele_
double PSCut_
 Energy Threshold for PS validation.
float ptTrack_
std::vector< double > setchi2Values_
bool usePFConversions_
bool usePFElectrons_

Static Private Attributes

static float maxMvaCut_ = PFCandidate::bigMva_

Friends

std::ostream & operator<< (std::ostream &out, const PFAlgo &algo)


Detailed Description

Definition at line 42 of file PFAlgo.h.


Member Enumeration Documentation

enum PFAlgo::EnergyTest

Comparing Calo and total momentum.

Enumerator:
COMPATIBLE 
NOT_ENOUGH_ENERGY 
TOO_MUCH_ENERGY 

Definition at line 105 of file PFAlgo.h.

00105                   {
00106     COMPATIBLE=0,
00107     NOT_ENOUGH_ENERGY,
00108     TOO_MUCH_ENERGY
00109   };

enum PFAlgo::RecoveryStatus

Cluster Recovery Status.

Enumerator:
DONE 
KEEP_SEARCHING 

Definition at line 99 of file PFAlgo.h.

00099                       {
00100     DONE=0,
00101     KEEP_SEARCHING
00102   };


Constructor & Destructor Documentation

PFAlgo::PFAlgo (  ) 

constructor

Definition at line 47 of file PFAlgo.cc.

00048   : pfCandidates_( new PFCandidateCollection),
00049     nSigmaECAL_(3), 
00050     nSigmaHCAL_(3),
00051     clusterRecovery_(false), 
00052     PSCut_(999.),
00053     mergedPhotonsMVA_( 0 ),
00054     mvaCut_(PFAlgo::maxMvaCut_),
00055     algo_(1),
00056     debug_(false),
00057     pfele_(0)
00058 {}

PFAlgo::~PFAlgo (  )  [virtual]

destructor

Definition at line 60 of file PFAlgo.cc.

References pfConversion_, pfele_, usePFConversions_, and usePFElectrons_.

00060                 {
00061   if (usePFElectrons_) delete pfele_;
00062   if (usePFConversions_) delete pfConversion_;
00063 }


Member Function Documentation

reco::PFBlockRef PFAlgo::createBlockRef ( const reco::PFBlockCollection blocks,
unsigned  bi 
) [private]

create a reference to a block, transient or persistent depending on the needs

Definition at line 2040 of file PFAlgo.cc.

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

Referenced by reconstructParticles().

02041                                       {
02042 
02043   if( blockHandle_.isValid() ) {
02044     return reco::PFBlockRef(  blockHandle_, bi );
02045   } 
02046   else {
02047     return reco::PFBlockRef(  &blocks, bi );
02048   }
02049 }

PFAlgo::EnergyTest PFAlgo::energyTest ( double  energyTrk,
double  energyHcal,
double  energyEcal,
double  etaH,
double  phiH,
double &  neutralHadron 
) [protected]

fonction comapring energy Calo and total momentum

TRACKER AND CALO COMPATIBLE //////////////// if( abs(totalChargedMomentum-caloEnergy)<nsigma*TotalError ) { add an argument to

Definition at line 1766 of file PFAlgo.cc.

References calibration_, clusterCalibration_, COMPATIBLE, GenMuonPlsPt100GeV_cfg::cout, debug_, max, neutralHadronEnergyResolution(), newCalib_, NOT_ENOUGH_ENERGY, nSigmaHCAL_, and TOO_MUCH_ENERGY.

01771                                             {
01772   
01773   //This function can be used to Test whether the calorimetric
01774   //energy deposition (after calibration) is compatible with 
01775   //the track(s) momemtum. 
01776   //Compatibility is defined as having the calorimetric energy
01777   //within +/- 3*sigma(HCAL) around the track momentum 
01778 
01779   double slopeEcal = 1.0;
01780   double calibEcal = std::max(0.,energyEcal);
01781   double calibHcal = std::max(0.,energyHcal);
01782   double eCalib = -1;
01783   if ( newCalib_ ) {
01784     clusterCalibration_->
01785       getCalibratedEnergyEmbedAInHcal(calibEcal, calibHcal, eta, phi);
01786     eCalib = calibEcal+calibHcal;
01787     if ( energyEcal > 0. ) slopeEcal = calibEcal/energyEcal;
01788   } else { 
01789     if( energyEcal>0) { 
01790       eCalib = calibration_->energyEmHad( energyEcal, energyHcal );
01791       slopeEcal = calibration_->paramECALplusHCAL_slopeECAL();
01792       calibEcal = energyEcal * slopeEcal;
01793       calibHcal = eCalib - calibEcal;
01794     } else { 
01795       eCalib = calibration_->energyHad( energyHcal );
01796       calibEcal = energyEcal;
01797       calibHcal = eCalib - calibEcal;
01798     }
01799   }
01800 
01801   /*
01802   double eCalib = -1;
01803   if( energyEcal>0)
01804     eCalib = calibration_->energyEmHad( energyEcal, energyHcal );
01805   else 
01806     eCalib = calibration_->energyHad( energyHcal );
01807   */
01808   
01809   assert(eCalib>=0);
01810 
01811   // PJ The resolution is on the expected charged energy
01812   // double reso   = neutralHadronEnergyResolution( eCalib );
01813   // reso *= eCalib;
01814   double reso   = neutralHadronEnergyResolution( energyTrk );
01815   reso *= energyTrk;
01816   
01817   // Alex: one should add TK errors as in main PFAlgo
01818   // double TotalError = sqrt(sumpError2 + Caloresolution*Caloresolution);
01822   //PFAlgo::recoveringClusters( double  totalChargedMomentum, double sumpError2,
01823   //PFAlgo::energyTest( double energyTrk, double sumpError2,  
01824 
01825   
01826   double lowerlimit = energyTrk  - nSigmaHCAL_*reso;
01827   double upperlimit = energyTrk  + nSigmaHCAL_*reso;
01828 
01829   if( debug_ ) {
01830     cout<<"\t\t\tEnergy test: " 
01831         <<"Ecal ="<<energyEcal<<" Hcal="<<energyHcal
01832         <<" ChargedEnergy= "<<energyTrk 
01833         <<" Ecalib="<<eCalib 
01834         <<" Resolution="<<reso 
01835         <<" Interval=" 
01836         <<lowerlimit<<" " 
01837         <<upperlimit<<endl;
01838   }
01839 
01840   if( (eCalib >= lowerlimit) && 
01841       (eCalib <= upperlimit) )
01842     return COMPATIBLE; //compatible
01843   
01844   if( eCalib < lowerlimit )
01845     return NOT_ENOUGH_ENERGY; //more energy needed
01846 
01847   if( eCalib > upperlimit ) {
01848     neutralHadron = eCalib - energyTrk - calibEcal + energyEcal;
01849     return TOO_MUCH_ENERGY; // too much calo energy already!
01850   }
01851 
01852   return COMPATIBLE;
01853 }// energy Test

bool PFAlgo::isSatelliteCluster ( const reco::PFRecTrack track,
const reco::PFCluster cluster 
) [protected]

Checking if a given cluster is a satellite cluster of a given charged hadron (track).

Definition at line 1856 of file PFAlgo.cc.

References funct::cos(), GenMuonPlsPt100GeV_cfg::cout, debug_, reco::PFTrack::extrapolatedPoint(), PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, reco::PFTrajectoryPoint::HCALEntrance, reco::PFTrajectoryPoint::isValid(), reco::PFCluster::layer(), link(), reco::PFTrajectoryPoint::position(), reco::PFCluster::positionREP(), and funct::sqrt().

01857                                                            {
01858   //This is to check whether a HCAL cluster could be 
01859   //a satellite cluster of a given track (charged hadron)
01860   //Definitions:
01861   //Track-Hcal: An Hcal cluster can be associated to a 
01862   //            track if it is found in a region around (dr<0.17 ~ 3x3 matrix)
01863   //            the position of the track extrapolated to the Hcal.
01864 
01865   bool link = false;
01866 
01867   if( cluster.layer() == PFLayer::HCAL_BARREL1 ||
01868       cluster.layer() == PFLayer::HCAL_ENDCAP ) { //Hcal case
01869     
01870     const reco::PFTrajectoryPoint& atHCAL 
01871       = track.extrapolatedPoint( reco::PFTrajectoryPoint::HCALEntrance );
01872               
01873     if( atHCAL.isValid() ){ //valid extrapolation?
01874       double tracketa = atHCAL.position().Eta();
01875       double trackphi = atHCAL.position().Phi();
01876       double hcaleta  = cluster.positionREP().Eta();
01877       double hcalphi  = cluster.positionREP().Phi();
01878                   
01879       //distance track-cluster
01880       double deta = hcaleta - tracketa;
01881       double dphi = acos(cos(hcalphi - trackphi));
01882       double dr   = sqrt(deta*deta + dphi*dphi);
01883 
01884       if( debug_ ){
01885         cout<<"\t\t\tSatellite Test " 
01886             <<tracketa<<" "<<trackphi<<" "
01887             <<hcaleta<<" "<<hcalphi<<" dr="<<dr 
01888             <<endl;
01889       }
01890       
01891       //looking if cluster is in the  
01892       //region around the track. 
01893       //Alex: Will have to adjust this cut?
01894       if( dr < 0.17 ) link = true;
01895     }//extrapolation
01896     
01897   }//HCAL
01898   
01899   return link; 
01900 }

double PFAlgo::neutralHadronEnergyResolution ( double  clusterEnergy  )  const [protected]

Returns:
calibrated energy of a photon

Returns:
calibrated energy of a neutral hadron, which can leave some energy in the ECAL ( energyECAL>0 )

Definition at line 1714 of file PFAlgo.cc.

References newCalib_, and funct::sqrt().

Referenced by energyTest().

01715         {
01716 
01717 
01718   return  newCalib_ ? 
01719     1.40/sqrt(clusterEnergyHCAL) +5.00/clusterEnergyHCAL:
01720     1.50/sqrt(clusterEnergyHCAL) +3.00/clusterEnergyHCAL;
01721   // 1.50/sqrt(clusterEnergyHCAL) +0.00/clusterEnergyHCAL;
01722     // 5 GeV
01723     // + 2.34/clusterEnergyHCAL;
01724     // 9 GeV
01725     //+ 3.15/clusterEnergyHCAL;
01726     // 16 GeV
01727     // + 4.20/clusterEnergyHCAL;
01728   // PJ Portnainwak!
01729   //  + 6.62527e-03*sqrt(clusterEnergyHCAL) -6.33966e-02; 
01730   // return  1.2/sqrt(clusterEnergyHCAL) + 0.05;
01731 }

const std::auto_ptr< reco::PFCandidateCollection >& PFAlgo::pfCandidates (  )  const [inline]

Returns:
collection of candidates

Definition at line 88 of file PFAlgo.h.

References pfCandidates_.

Referenced by operator<<().

00088                                                                        {
00089     return pfCandidates_;
00090   }

virtual void PFAlgo::processBlock ( const reco::PFBlockRef blockref,
std::list< reco::PFBlockRef > &  hcalBlockRefs,
std::list< reco::PFBlockRef > &  ecalBlockRefs 
) [protected, virtual]

process one block.

can be reimplemented in more sophisticated algorithms

Reimplemented in PFAlgoTestBenchConversions, and PFAlgoTestBenchElectrons.

Referenced by reconstructParticles().

unsigned PFAlgo::reconstructCluster ( const reco::PFCluster cluster,
double  particleEnergy 
) [protected]

Reconstruct a neutral particle from a cluster.

If chargedEnergy is specified, the neutral particle is created only if the cluster energy is significantly larger than the chargedEnergy. In this case, the energy of the neutral particle is cluster energy - chargedEnergy

Definition at line 1654 of file PFAlgo.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug_, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, PFLayer::HCAL_HF, reco::PFCluster::layer(), pfCandidates_, reco::CaloCluster::position(), tmp, and reco::PFCandidate::X.

01655                                                            {
01656   
01657   reco::PFCandidate::ParticleType particleType = reco::PFCandidate::X;
01658 
01659   // need to convert the math::XYZPoint data member of the PFCluster class=
01660   // to a displacement vector: 
01661   ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D<double> , ROOT::Math::DefaultCoordinateSystemTag > clusterPos( cluster.position().X(), cluster.position().Y(),cluster.position().Z() );
01662   
01663 
01664   clusterPos = clusterPos.Unit();
01665   clusterPos *= particleEnergy;
01666 
01667   // clusterPos is now a vector along the cluster direction, 
01668   // with a magnitude equal to the cluster energy.
01669   
01670   double mass = 0;
01671   switch( cluster.layer() ) {
01672   case PFLayer::ECAL_BARREL:
01673   case PFLayer::ECAL_ENDCAP:
01674     particleType = PFCandidate::gamma;
01675     break;
01676   case PFLayer::HCAL_BARREL1:
01677   case PFLayer::HCAL_ENDCAP:
01678     particleType = PFCandidate::h0;
01679     break;
01680   case PFLayer::HCAL_HF:
01681     particleType = PFCandidate::h_HF;
01682     break;
01683   default:
01684     assert(0);
01685   }
01686 
01687 
01688   ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > 
01689     momentum( clusterPos.X(), clusterPos.Y(), clusterPos.Z(), mass); 
01690 
01691   int charge = 0;
01692 
01693   // mathcore is a piece of #$%
01694   math::XYZTLorentzVector  tmp;
01695 
01696   // implicit constructor not allowed
01697   tmp = momentum;
01698 
01699   pfCandidates_->push_back( PFCandidate( charge, 
01700                                          tmp, 
01701                                          particleType ) );
01702 
01703   if(debug_) 
01704     cout<<"** candidate: "<<pfCandidates_->back()<<endl; 
01705 
01706   // returns index to the newly created PFCandidate
01707   return pfCandidates_->size()-1;
01708 
01709 }

void PFAlgo::reconstructParticles ( const reco::PFBlockCollection blocks  )  [virtual]

reconstruct particles

Definition at line 167 of file PFAlgo.cc.

References parseConfig::block, GenMuonPlsPt100GeV_cfg::cout, createBlockRef(), debug_, reco::PFBlockElement::ECAL, bookConverter::elements, reco::PFBlock::elements(), empty, lat::endl(), reco::PFBlockElement::HCAL, i, pfCandidates_, processBlock(), edm::OwnVector< T, P >::push_back(), and edm::OwnVector< T, P >::size().

00167                                                                        {
00168 
00169   // reset output collection
00170   if(pfCandidates_.get() )
00171     pfCandidates_->clear();
00172   else 
00173     pfCandidates_.reset( new reco::PFCandidateCollection );
00174 
00175 
00176 
00177   if( debug_ ) {
00178     cout<<"*********************************************************"<<endl;
00179     cout<<"*****           Particle flow algorithm             *****"<<endl;
00180     cout<<"*********************************************************"<<endl;
00181   }
00182 
00183   // sort elements in three lists:
00184   std::list< reco::PFBlockRef > hcalBlockRefs;
00185   std::list< reco::PFBlockRef > ecalBlockRefs;
00186   std::list< reco::PFBlockRef > otherBlockRefs;
00187   
00188   for( unsigned i=0; i<blocks.size(); ++i ) {
00189     // reco::PFBlockRef blockref( blockh,i );
00190     reco::PFBlockRef blockref = createBlockRef( blocks, i);
00191     
00192     const reco::PFBlock& block = *blockref;
00193    const edm::OwnVector< reco::PFBlockElement >& 
00194       elements = block.elements();
00195         
00196     bool singleEcalOrHcal = false;
00197     if( elements.size() == 1 ){
00198       if( elements[0].type() == reco::PFBlockElement::ECAL ){
00199         ecalBlockRefs.push_back( blockref );
00200         singleEcalOrHcal = true;
00201       }
00202       if( elements[0].type() == reco::PFBlockElement::HCAL ){
00203         hcalBlockRefs.push_back( blockref );
00204         singleEcalOrHcal = true;
00205       }
00206     }      
00207     
00208     if(!singleEcalOrHcal) {
00209       otherBlockRefs.push_back( blockref );
00210     }
00211   }//loop blocks
00212   
00213   if( debug_ ){
00214     cout<<"# Ecal blocks: "<<ecalBlockRefs.size()
00215         <<", # Hcal blocks: "<<hcalBlockRefs.size()
00216         <<", # Other blocks: "<<otherBlockRefs.size()<<endl;
00217   }
00218 
00219 
00220   // loop on blocks that are not single ecal, 
00221   // and not single hcal.
00222   // single ecal and single hcal will be used in cluster recovery
00223 
00224   for( IBR io = otherBlockRefs.begin(); io!=otherBlockRefs.end(); ++io) {
00225     processBlock( *io, hcalBlockRefs, ecalBlockRefs );
00226   }
00227 
00228   // cluster recovery has been done. 
00229   // process remaining ecal and hcal clusters. 
00230   
00231   std::list< reco::PFBlockRef > empty;
00232 
00233   // process remaining single hcal blocks
00234   for( IBR ih = hcalBlockRefs.begin(); ih!=hcalBlockRefs.end(); ++ih) {
00235     processBlock( *ih, empty, empty );
00236   }
00237 
00238   // process remaining single ecal blocks
00239   for( IBR ie = ecalBlockRefs.begin(); ie!=ecalBlockRefs.end(); ++ie) {
00240     processBlock( *ie, empty, empty );
00241   }
00242 }

void PFAlgo::reconstructParticles ( const reco::PFBlockHandle blockHandle  ) 

reconstruct particles (full framework case) will keep track of the block handle to build persistent references, and call reconstructParticles( const reco::PFBlockCollection& blocks )

Definition at line 159 of file PFAlgo.cc.

References blockHandle_.

Referenced by PFRootEventManager::particleFlow().

00159                                                                         {
00160 
00161   blockHandle_ = blockHandle;
00162   reconstructParticles( *blockHandle_ ); 
00163 }

unsigned PFAlgo::reconstructTrack ( const reco::PFBlockElement elt  )  [protected]

Reconstruct a charged hadron from a track Returns the index of the newly created candidate in pfCandidates_.

Definition at line 1578 of file PFAlgo.cc.

References reco::TrackBase::charge(), GenMuonPlsPt100GeV_cfg::cout, debug_, relval_parameters_module::energy, reco::PFCandidate::h, edm::Ref< C, T, F >::isNonnull(), reco::PFCandidate::mu, reco::PFBlockElementTrack::muonRef(), reco::PFBlockElementTrack::nuclearRef(), reco::TrackBase::p(), pfCandidates_, reco::PFBlockElementTrack::positionAtECALEntrance(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::PFBlockElement::T_FROM_NUCL, reco::PFCandidate::T_FROM_NUCLINT, reco::PFBlockElement::T_TO_NUCL, reco::PFCandidate::T_TO_NUCLINT, track, reco::PFBlockElementTrack::trackRef(), reco::PFBlockElementTrack::trackType(), and reco::TrackBase::vertex().

01578                                                                  {
01579 
01580   const reco::PFBlockElementTrack* eltTrack 
01581     = dynamic_cast<const reco::PFBlockElementTrack*>(&elt);
01582 
01583   reco::TrackRef trackRef = eltTrack->trackRef();
01584   const reco::Track& track = *trackRef;
01585 
01586   reco::MuonRef muonRef = eltTrack->muonRef();
01587 
01588   int charge = track.charge()>0 ? 1 : -1;
01589 
01590   double px = track.px();
01591   double py = track.py();
01592   double pz = track.pz();
01593   double energy = track.p();
01594 
01595   if( muonRef.isNonnull() ) {
01596     
01597     px = muonRef->px();
01598     py = muonRef->py();
01599     pz = muonRef->pz();
01600     energy = muonRef->energy();  
01601 
01602   }
01603 
01604   math::XYZTLorentzVector momentum(px,py,pz,energy);
01605 
01606   reco::PFCandidate::ParticleType particleType 
01607     = reco::PFCandidate::h;
01608 
01609   pfCandidates_->push_back( PFCandidate( charge, 
01610                                          momentum,
01611                                          particleType ) );
01612   
01613   pfCandidates_->back().setVertex( track.vertex() );
01614   pfCandidates_->back().setTrackRef( trackRef );
01615   pfCandidates_->back().setPositionAtECALEntrance( eltTrack->positionAtECALEntrance());
01616 
01617 
01618   // setting the muon ref if there is
01619   if (muonRef.isNonnull()) {
01620     pfCandidates_->back().setMuonRef( muonRef );
01621 
01622     // setting the muon particle type if it is a global muon
01623     if (muonRef->isGlobalMuon() ) {
01624       particleType = reco::PFCandidate::mu;
01625       pfCandidates_->back().setParticleType( particleType );
01626       if (debug_) cout << "PFAlgo: particle type set to muon" << endl; 
01627     }
01628   }
01629 
01630   // nuclear
01631   if( particleType != reco::PFCandidate::mu )
01632     if( eltTrack->trackType(reco::PFBlockElement::T_FROM_NUCL)) {
01633       pfCandidates_->back().setFlag( reco::PFCandidate::T_FROM_NUCLINT, true);
01634       pfCandidates_->back().setNuclearRef( eltTrack->nuclearRef() );
01635     }
01636     else if( eltTrack->trackType(reco::PFBlockElement::T_TO_NUCL)) {
01637       pfCandidates_->back().setFlag( reco::PFCandidate::T_TO_NUCLINT, true);
01638       pfCandidates_->back().setNuclearRef( eltTrack->nuclearRef() );
01639     }
01640 
01641   // conversion...
01642   
01643   if(debug_) 
01644     cout<<"** candidate: "<<pfCandidates_->back()<<endl; 
01645   
01646   // returns index to the newly created PFCandidate
01647   return pfCandidates_->size()-1;
01648 }

PFAlgo::RecoveryStatus PFAlgo::recoveringClusters ( double  totalChargedMomentum,
double  totalEcal,
double &  totalHcal,
const std::vector< reco::PFRecTrackRef > &  associatedTracks,
const reco::PFBlockRef blockref,
std::vector< bool > &  active 
) [protected]

Recovering satellite clusters that belong to a charged hadron.

void PFAlgo::setAlgo ( int  algo  )  [inline]

Definition at line 52 of file PFAlgo.h.

References algo_.

Referenced by PFRootEventManager::readOptions().

00052 {algo_ = algo;}

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

Definition at line 54 of file PFAlgo.h.

References debug_.

Referenced by PFRootEventManager::readOptions().

00054 {debug_ = debug;}

void PFAlgo::setParameters ( double  nSigmaECAL,
double  nSigmaHCAL,
const boost::shared_ptr< PFEnergyCalibration > &  calibration,
const boost::shared_ptr< pftools::PFClusterCalibration > &  clusterCalibration,
bool  newCalib,
bool  clusterRecovery,
double  PSCut = 0.0001,
double  mvaCut = PFAlgo::maxMvaCut_,
const char *  mvaWeightFile = "" 
)

Referenced by PFRootEventManager::readOptions().

void PFAlgo::setPFConversionParameters ( bool  usePFConversions  ) 

Definition at line 149 of file PFAlgo.cc.

References pfConversion_, and usePFConversions_.

Referenced by PFRootEventManager::readOptions().

00149                                                              {
00150 
00151   usePFConversions_ = usePFConversions;
00152   pfConversion_ = new PFConversionAlgo();
00153 
00154 
00155 }

void PFAlgo::setPFEleParameters ( double  chi2EcalGSF,
double  chi2EcalBrem,
double  chi2HcalGSF,
double  chi2HcalBrem,
double  chi2PsGSF,
double  chi2PsBrem,
double  mvaEleCut,
std::string  mvaWeightFileEleID,
bool  usePFElectrons 
)

Referenced by PFRootEventManager::readOptions().

std::auto_ptr< reco::PFCandidateCollection > PFAlgo::transferCandidates (  )  [inline]

Returns:
auto_ptr to the collection of candidates (transfers ownership)

Definition at line 93 of file PFAlgo.h.

References PFCandConnector::connect(), and pfCandidates_.

Referenced by PFRootEventManager::particleFlow().

00093                                                                  {
00094     PFCandConnector connector;
00095     return connector.connect(pfCandidates_);
00096   }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFAlgo algo 
) [friend]


Member Data Documentation

int PFAlgo::algo_ [private]

Definition at line 211 of file PFAlgo.h.

Referenced by setAlgo().

reco::PFBlockHandle PFAlgo::blockHandle_ [private]

input block handle (full framework case)

Definition at line 180 of file PFAlgo.h.

Referenced by createBlockRef(), and reconstructParticles().

boost::shared_ptr<PFEnergyCalibration> PFAlgo::calibration_ [private]

Definition at line 188 of file PFAlgo.h.

Referenced by energyTest(), and operator<<().

float PFAlgo::chi2ECAL_ [private]

Definition at line 205 of file PFAlgo.h.

boost::shared_ptr<pftools::PFClusterCalibration> PFAlgo::clusterCalibration_ [private]

Definition at line 189 of file PFAlgo.h.

Referenced by energyTest().

bool PFAlgo::clusterRecovery_ [private]

algorithm to recover satellite clusters in HCAL coming from nuclear interactions

Definition at line 194 of file PFAlgo.h.

bool PFAlgo::debug_ [private]

Definition at line 212 of file PFAlgo.h.

Referenced by energyTest(), isSatelliteCluster(), reconstructCluster(), reconstructParticles(), reconstructTrack(), and setDebug().

float PFAlgo::eECALOverpTrack_ [private]

Definition at line 204 of file PFAlgo.h.

std::vector<unsigned> PFAlgo::hcalBlockUsed_ [private]

Definition at line 195 of file PFAlgo.h.

float PFAlgo::maxMvaCut_ = PFCandidate::bigMva_ [static, private]

Definition at line 209 of file PFAlgo.h.

TMVA::Reader* PFAlgo::mergedPhotonsMVA_ [private]

should not be a pointer, but we need to be able to reset this, and there seems to be not reset function in this class.

Definition at line 202 of file PFAlgo.h.

float PFAlgo::mvaCut_ [private]

Definition at line 207 of file PFAlgo.h.

Referenced by operator<<().

double PFAlgo::mvaEleCut_ [private]

Definition at line 218 of file PFAlgo.h.

std::string PFAlgo::mvaWeightFileEleID_ [private]

Definition at line 216 of file PFAlgo.h.

bool PFAlgo::newCalib_ [private]

Definition at line 190 of file PFAlgo.h.

Referenced by energyTest(), and neutralHadronEnergyResolution().

double PFAlgo::nSigmaECAL_ [private]

number of sigma to judge energy excess in ECAL

Definition at line 183 of file PFAlgo.h.

Referenced by operator<<().

double PFAlgo::nSigmaHCAL_ [private]

number of sigma to judge energy excess in HCAL

Definition at line 186 of file PFAlgo.h.

Referenced by energyTest(), and operator<<().

std::auto_ptr< reco::PFCandidateCollection > PFAlgo::pfCandidates_ [protected]

Definition at line 147 of file PFAlgo.h.

Referenced by operator<<(), pfCandidates(), reconstructCluster(), reconstructParticles(), reconstructTrack(), and transferCandidates().

PFConversionAlgo* PFAlgo::pfConversion_ [private]

Definition at line 222 of file PFAlgo.h.

Referenced by setPFConversionParameters(), and ~PFAlgo().

PFElectronAlgo* PFAlgo::pfele_ [private]

Definition at line 220 of file PFAlgo.h.

Referenced by ~PFAlgo().

double PFAlgo::PSCut_ [private]

Energy Threshold for PS validation.

Definition at line 198 of file PFAlgo.h.

Referenced by operator<<().

float PFAlgo::ptTrack_ [private]

Definition at line 206 of file PFAlgo.h.

std::vector<double> PFAlgo::setchi2Values_ [private]

Definition at line 217 of file PFAlgo.h.

bool PFAlgo::usePFConversions_ [private]

Definition at line 221 of file PFAlgo.h.

Referenced by setPFConversionParameters(), and ~PFAlgo().

bool PFAlgo::usePFElectrons_ [private]

Definition at line 219 of file PFAlgo.h.

Referenced by ~PFAlgo().


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