CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

egammaisolation::EgammaTowerExtractor Class Reference

#include <EgammaTowerExtractor.h>

Inheritance diagram for egammaisolation::EgammaTowerExtractor:
reco::isodeposit::IsoDepositExtractor

List of all members.

Public Types

enum  HcalDepth { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 }

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 EgammaTowerExtractor (const edm::ParameterSet &par)
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
virtual ~EgammaTowerExtractor ()

Private Attributes

edm::InputTag caloTowerTag_
int depth_
double etLow_
double extRadius2_
double intRadius_

Detailed Description

Definition at line 34 of file EgammaTowerExtractor.h.


Member Enumeration Documentation

Enumerator:
AllDepths 
Undefined 
Depth1 
Depth2 

Definition at line 37 of file EgammaTowerExtractor.h.


Constructor & Destructor Documentation

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

Definition at line 41 of file EgammaTowerExtractor.h.

References AllDepths, Depth1, Depth2, depth_, Exception, and extRadius2_.

                                                             :
            extRadius2_(par.getParameter<double>("extRadius")),
            intRadius_(par.getParameter<double>("intRadius")),
            etLow_(par.getParameter<double>("etMin")),
            caloTowerTag_(par.getParameter<edm::InputTag>("caloTowers")),
            depth_(par.getParameter<int>("hcalDepth"))
         { 
            extRadius2_ *= extRadius2_;
            //lets just check we have a valid depth
            //should we throw an exception or just warn and then fail gracefully later?
            if(depth_!=AllDepths && depth_!=Depth1 && depth_!=Depth2){
              throw cms::Exception("Configuration Error") << "hcalDepth passed to EgammaTowerExtractor is invalid "<<std::endl;
            }
         }
EgammaTowerExtractor::~EgammaTowerExtractor ( ) [virtual]

Definition at line 31 of file EgammaTowerExtractor.cc.

{}

Member Function Documentation

virtual reco::IsoDeposit egammaisolation::EgammaTowerExtractor::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 60 of file EgammaTowerExtractor.h.

References Exception, and mergeVDriftHistosByStation::name.

                                                                            {
            throw cms::Exception("Configuration Error") << 
                     "This extractor " << (typeid(this).name()) << " is not made for tracks";
         }
reco::IsoDeposit EgammaTowerExtractor::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 33 of file EgammaTowerExtractor.cc.

References reco::isodeposit::Direction::deltaR2(), funct::exp(), reco::Candidate::get(), edm::Event::getByLabel(), and funct::sin().

                                                                            {

    edm::Handle<CaloTowerCollection> towercollectionH;
    iEvent.getByLabel(caloTowerTag_, towercollectionH);
 
    //Take the SC position
    reco::SuperClusterRef sc = emObject.get<reco::SuperClusterRef>();
    math::XYZPoint caloPosition = sc->position();

    Direction candDir(caloPosition.eta(), caloPosition.phi());
    reco::IsoDeposit deposit( candDir );
    deposit.setVeto( reco::IsoDeposit::Veto(candDir, intRadius_) ); 
    deposit.addCandEnergy(sc->energy()*sin(2*atan(exp(-sc->eta()))));

    //loop over tracks
    for(CaloTowerCollection::const_iterator trItr = towercollectionH->begin(), trEnd = towercollectionH->end(); trItr != trEnd; ++trItr){
      double depEt  = 0;
      //the hcal can be seperated into different depths
      //currently it is setup to check that the depth is valid in constructor
      //if the depth is not valid it fails gracefully
      //small bug fix, hadEnergyHeInnerLater returns zero for towers which are only depth 1
      //but we want Depth1 isolation to include these so we have to manually check for this
      if(depth_==AllDepths) depEt = trItr->hadEt();
      else if(depth_==Depth1) depEt = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEt() : trItr->hadEnergyHeInnerLayer()*sin(trItr->p4().theta());
      else if(depth_==Depth2) depEt = trItr->hadEnergyHeOuterLayer()*sin(trItr->p4().theta());
      
      if ( depEt < etLow_ )  continue ;  
      

        Direction towerDir( trItr->eta(), trItr->phi() );
        double dR2 = candDir.deltaR2(towerDir);

        if (dR2 < extRadius2_) {
            deposit.addDeposit( towerDir, depEt);
        }

    }//end loop over tracks

    return deposit;
}
virtual void egammaisolation::EgammaTowerExtractor::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 58 of file EgammaTowerExtractor.h.

                                                                     { }

Member Data Documentation

Definition at line 74 of file EgammaTowerExtractor.h.

Definition at line 75 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

Definition at line 71 of file EgammaTowerExtractor.h.

Definition at line 69 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

Definition at line 70 of file EgammaTowerExtractor.h.