CMS 3D CMS Logo

egammaisolation::EgammaEcalExtractor Class Reference

#include <RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalExtractor.h>

Inheritance diagram for egammaisolation::EgammaEcalExtractor:

reco::isodeposit::IsoDepositExtractor

List of all members.

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations
 EgammaEcalExtractor (const edm::ParameterSet &par)
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
 fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !
virtual ~EgammaEcalExtractor ()

Private Attributes

edm::InputTag basicClusterTag_
double conesize_
double etMin_
bool scmatch_
edm::InputTag superClusterTag_


Detailed Description

Definition at line 38 of file EgammaEcalExtractor.h.


Constructor & Destructor Documentation

egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor ( const edm::ParameterSet par  )  [inline]

Definition at line 40 of file EgammaEcalExtractor.h.

00040                                                             : 
00041                     etMin_(par.getParameter<double>("etMin")),
00042                     conesize_(par.getParameter<double>("extRadius")),
00043                     scmatch_(par.getParameter<bool>("superClusterMatch")),
00044                     basicClusterTag_(par.getParameter<edm::InputTag>("basicClusters")),
00045                     superClusterTag_(par.getParameter<edm::InputTag>("superClusters")) { }

EgammaEcalExtractor::~EgammaEcalExtractor (  )  [virtual]

Definition at line 23 of file EgammaEcalExtractor.cc.

00023 {}


Member Function Documentation

reco::IsoDeposit EgammaEcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const [virtual]

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 25 of file EgammaEcalExtractor.cc.

References reco::BasicCluster::algo(), basicClusterTag_, reco::BasicCluster::chi2(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), conesize_, deposit(), reco::CaloCluster::energy(), reco::CaloCluster::eta(), etMin_, funct::exp(), reco::Candidate::get(), edm::Event::getByLabel(), reco::CaloCluster::phi(), reco::CaloCluster::position(), scmatch_, reco::SuperCluster::seed(), funct::sin(), and superClusterTag_.

00025                                                                                                                                      {
00026   edm::Handle<reco::SuperClusterCollection> superClusterCollectionH;
00027   edm::Handle<reco::BasicClusterCollection> basicClusterCollectionH;
00028   ev.getByLabel(superClusterTag_, superClusterCollectionH);
00029   ev.getByLabel(basicClusterTag_, basicClusterCollectionH);
00030 
00031   reco::SuperClusterRef sc = candidate.get<reco::SuperClusterRef>();
00032   math::XYZPoint position = sc->position();  
00033   // match the photon hybrid supercluster with those with Algo==0 (island)
00034   double delta1=1000.;
00035   double deltacur=1000.;
00036   const reco::SuperCluster *matchedsupercluster=0;
00037   bool MATCHEDSC = false;
00038 
00039   Direction candDir(position.eta(), position.phi());
00040   reco::IsoDeposit deposit(candDir );
00041   deposit.setVeto( reco::IsoDeposit::Veto(candDir, 0) ); // no veto is needed for this deposit
00042   deposit.addCandEnergy(sc->energy()*sin(2*atan(exp(-sc->eta()))));
00043 
00044   for(reco::SuperClusterCollection::const_iterator scItr = superClusterCollectionH->begin(); scItr != superClusterCollectionH->end(); ++scItr){
00045   
00046     const reco::SuperCluster *supercluster = &(*scItr);
00047    
00048     if(supercluster->seed()->algo() == 0){
00049       deltacur = ROOT::Math::VectorUtil::DeltaR(supercluster->position(), position); 
00050       if (deltacur < delta1) {
00051         delta1=deltacur;
00052         matchedsupercluster = supercluster;
00053         MATCHEDSC = true;
00054       }
00055     }
00056   }
00057 
00058   const reco::BasicCluster *cluster= 0;
00059   
00060   //loop over basic clusters
00061   for(reco::BasicClusterCollection::const_iterator cItr = basicClusterCollectionH->begin(); cItr != basicClusterCollectionH->end(); ++cItr){
00062  
00063     cluster = &(*cItr);
00064     double ebc_bcchi2 = cluster->chi2();
00065     int    ebc_bcalgo = cluster->algo();
00066     double ebc_bce    = cluster->energy();
00067     double ebc_bceta  = cluster->eta();
00068     double ebc_bcet   = ebc_bce*sin(2*atan(exp(ebc_bceta)));
00069     double newDelta = 0.;
00070 
00071     if (ebc_bcet > etMin_ && ebc_bcalgo == 0) {
00072       if (ebc_bcchi2 < 30.) {
00073         
00074         if(MATCHEDSC || !scmatch_ ){  //skip selection if user wants to fill all superclusters
00075           bool inSuperCluster = false;
00076 
00077           if( scmatch_ ){ // only try the matching if needed
00078             reco::basicCluster_iterator theEclust = matchedsupercluster->clustersBegin();
00079             // loop over the basic clusters of the matched supercluster
00080             for(;theEclust != matchedsupercluster->clustersEnd(); ++theEclust) {
00081             if ((**theEclust) ==  (*cluster) ) inSuperCluster = true;
00082             }
00083           }
00084           if (!inSuperCluster || !scmatch_ ) {  //skip selection if user wants to fill all superclusters
00085             newDelta=ROOT::Math::VectorUtil::DeltaR(cluster->position(),position);
00086             if(newDelta < conesize_) {
00087               deposit.addDeposit( Direction(cluster->eta(), cluster->phi()), ebc_bcet);
00088             }
00089           }
00090         }
00091       } // matches ebc_bcchi2
00092     } // matches ebc_bcet && ebc_bcalgo
00093 
00094   }
00095   
00096   //  std::cout << "Will return ecalIsol = " << ecalIsol << std::endl; 
00097   return deposit;
00098   
00099 }

virtual reco::IsoDeposit egammaisolation::EgammaEcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const [inline, virtual]

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 51 of file EgammaEcalExtractor.h.

References Exception, and name.

Referenced by deposit().

00051                                                                                                                               {
00052                 throw cms::Exception("Configuration Error") << "This extractor " << (typeid(this).name()) << " is not made for tracks";
00053             }

virtual void egammaisolation::EgammaEcalExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
) [inline, virtual]

fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 50 of file EgammaEcalExtractor.h.

00050 { }


Member Data Documentation

edm::InputTag egammaisolation::EgammaEcalExtractor::basicClusterTag_ [private]

Definition at line 66 of file EgammaEcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaEcalExtractor::conesize_ [private]

Definition at line 63 of file EgammaEcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaEcalExtractor::etMin_ [private]

Definition at line 62 of file EgammaEcalExtractor.h.

Referenced by deposit().

bool egammaisolation::EgammaEcalExtractor::scmatch_ [private]

Definition at line 64 of file EgammaEcalExtractor.h.

Referenced by deposit().

edm::InputTag egammaisolation::EgammaEcalExtractor::superClusterTag_ [private]

Definition at line 67 of file EgammaEcalExtractor.h.

Referenced by deposit().


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