CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoParticleFlow/PFProducer/interface/PFPhotonAlgo.h

Go to the documentation of this file.
00001 #ifndef PFProducer_PFPhotonAlgo_H
00002 #define PFProducer_PFPhotonAlgo_H
00003 
00004 #include "DataFormats/ParticleFlowReco/interface/PFBlockFwd.h"
00005 #include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
00006 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00007 
00008 #include "DataFormats/Common/interface/Handle.h"
00009 #include "DataFormats/Common/interface/OrphanHandle.h"
00010 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementGsfTrack.h"
00011 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h"
00012 #include "DataFormats/VertexReco/interface/Vertex.h"
00013 #include "TMVA/Reader.h"
00014 #include <iostream>
00015 
00016 
00017 class PFEnergyCalibration;
00018 
00019 namespace reco {
00020   class PFCandidate;
00021   class PFCandidateCollectioon;
00022 }
00023 
00024 class PFPhotonAlgo {
00025  public:
00026   
00027   //constructor
00028   PFPhotonAlgo(std::string mvaweightfile,  
00029                double mvaConvCut, 
00030                const reco::Vertex& primary,
00031                const boost::shared_ptr<PFEnergyCalibration>& thePFEnergyCalibration); 
00032 
00033   //destructor
00034   ~PFPhotonAlgo(){delete tmvaReader_;};
00035   
00036   //check candidate validity
00037   bool isPhotonValidCandidate(const reco::PFBlockRef&  blockRef,
00038                               std::vector< bool >&  active,
00039                               std::auto_ptr< reco::PFCandidateCollection > &pfPhotonCandidates,
00040                               std::auto_ptr< reco::PFCandidateCollection > & // this is dummy for noe, can later be used to pass electrons if needed
00041                               )
00042   {
00043     isvalid_=false;
00044 
00045     // RunPFPhoton has to set isvalid_ to TRUE in case it finds a valid candidate
00046     // ... TODO: maybe can be replaced by checking for the size of the CandCollection.....
00047     RunPFPhoton(blockRef,
00048                 active,
00049                 pfPhotonCandidates);
00050 
00051     return isvalid_;
00052   };
00053   
00054 private: 
00055 
00056   enum verbosityLevel {
00057     Silent,
00058     Summary,
00059     Chatty
00060   };
00061   
00062   
00063   bool isvalid_;                               // is set to TRUE when a valid PhotonCandidate is found in a PFBlock
00064   verbosityLevel  verbosityLevel_;            /* Verbosity Level: 
00065                                                   ...............  0: Say nothing at all
00066                                                   ...............  1: Print summary about found PhotonCadidates only
00067                                                   ...............  2: Chatty mode
00068                                               */ 
00069   //FOR SINGLE LEG MVA:                                       
00070   double MVACUT;
00071   reco::Vertex       primaryVertex_;
00072   TMVA::Reader *tmvaReader_;
00073   boost::shared_ptr<PFEnergyCalibration> thePFEnergyCalibration_; 
00074 
00075   float nlost, nlayers;
00076   float chi2, STIP, del_phi,HoverPt, EoverPt, track_pt;
00077   double mvaValue;
00078 
00079   void RunPFPhoton(const reco::PFBlockRef&  blockRef,
00080                    std::vector< bool >& active,
00081                    std::auto_ptr< reco::PFCandidateCollection > &pfPhotonCandidates);
00082 
00083   bool EvaluateSingleLegMVA(const reco::PFBlockRef& blockref, 
00084                             const reco::Vertex& primaryvtx, 
00085                             unsigned int track_index);
00086   
00087 };
00088 
00089 
00090 
00091 #endif