CMS 3D CMS Logo

Public Member Functions | Public Attributes

ReflectedIterator Class Reference

#include <ReflectedIterator.h>

Inheritance diagram for ReflectedIterator:
PileUpSubtractor

List of all members.

Public Member Functions

virtual void calculatePedestal (std::vector< fastjet::PseudoJet > const &coll)
double getEt (const reco::CandidatePtr &in) const
double getEta (const reco::CandidatePtr &in) const
virtual void offsetCorrectJets ()
 ReflectedIterator (const edm::ParameterSet &iConfig)
void rescaleRMS (double s)
virtual void subtractPedestal (std::vector< fastjet::PseudoJet > &coll)
 ~ReflectedIterator ()

Public Attributes

bool dropZeroTowers_
bool sumRecHits_

Detailed Description

Definition at line 6 of file ReflectedIterator.h.


Constructor & Destructor Documentation

ReflectedIterator::ReflectedIterator ( const edm::ParameterSet iConfig) [inline]

Definition at line 8 of file ReflectedIterator.h.

                                                     : PileUpSubtractor(iConfig),
     sumRecHits_(iConfig.getParameter<bool>("sumRecHits")),
     dropZeroTowers_(iConfig.getUntrackedParameter<bool>("dropZeroTowers",true))
       {;}
ReflectedIterator::~ReflectedIterator ( ) [inline]

Definition at line 21 of file ReflectedIterator.h.

{;}

Member Function Documentation

virtual void ReflectedIterator::calculatePedestal ( std::vector< fastjet::PseudoJet > const &  coll) [virtual]

Reimplemented from PileUpSubtractor.

double ReflectedIterator::getEt ( const reco::CandidatePtr in) const

Definition at line 184 of file ReflectedIterator.cc.

References CaloTower::emEnergy(), relval_parameters_module::energy, edm::Ptr< T >::get(), CaloTower::hadEnergy(), CaloTower::id(), pos, funct::sin(), and PV3DBase< T, PVType, FrameType >::theta().

                                                                 {
   const CaloTower* ctc = dynamic_cast<const CaloTower*>(in.get());
   const GlobalPoint& pos=geo_->getPosition(ctc->id());
   double energy = ctc->emEnergy() + ctc->hadEnergy();
   double et = energy*sin(pos.theta());
   return et;
}
double ReflectedIterator::getEta ( const reco::CandidatePtr in) const

Definition at line 192 of file ReflectedIterator.cc.

References eta(), PV3DBase< T, PVType, FrameType >::eta(), edm::Ptr< T >::get(), CaloTower::id(), and pos.

                                                                  {
   const CaloTower* ctc = dynamic_cast<const CaloTower*>(in.get());
   const GlobalPoint& pos=geo_->getPosition(ctc->id());
   double eta = pos.eta();
   return eta;
}
void ReflectedIterator::offsetCorrectJets ( ) [virtual]

Reimplemented from PileUpSubtractor.

Definition at line 16 of file ReflectedIterator.cc.

References def, LogDebug, dt_dqm_sourceclient_common_cff::reco, and edm::second().

{

  LogDebug("PileUpSubtractor")<<"The subtractor correcting jets...\n";
  jetOffset_.clear();

  using namespace reco;
  
  (*fjInputs_) = fjOriginalInputs_;
  rescaleRMS(nSigmaPU_);
  subtractPedestal(*fjInputs_);
  const fastjet::JetDefinition& def = fjClusterSeq_->jet_def();
  if ( !doAreaFastjet_ && !doRhoFastjet_) {
    fastjet::ClusterSequence newseq( *fjInputs_, def );
    (*fjClusterSeq_) = newseq;
  } else {
    fastjet::ClusterSequenceArea newseq( *fjInputs_, def , *fjActiveArea_ );
    (*fjClusterSeq_) = newseq;
  }
  
  (*fjJets_) = fastjet::sorted_by_pt(fjClusterSeq_->inclusive_jets(jetPtMin_));
  
  jetOffset_.reserve(fjJets_->size());
  
  vector<fastjet::PseudoJet>::iterator pseudojetTMP = fjJets_->begin (),
    jetsEnd = fjJets_->end();
  for (; pseudojetTMP != jetsEnd; ++pseudojetTMP) {
    
    int ijet = pseudojetTMP - fjJets_->begin();
    jetOffset_[ijet] = 0;
    
    std::vector<fastjet::PseudoJet> towers =
      sorted_by_pt(fjClusterSeq_->constituents(*pseudojetTMP));
    
    double newjetet = 0.;
    for(vector<fastjet::PseudoJet>::const_iterator ito = towers.begin(),
          towEnd = towers.end();
        ito != towEnd;
        ++ito)
      {
        const reco::CandidatePtr& originalTower = (*inputs_)[ito->user_index()];
        int it = ieta( originalTower );
        double Original_Et = originalTower->et();
        double etnew = Original_Et - (*emean_.find(-it)).second - (*esigma_.find(-it)).second;
        if(etnew < 0.) etnew = 0;
        newjetet = newjetet + etnew;
        jetOffset_[ijet] += Original_Et - etnew;
      }
  }
}
void ReflectedIterator::rescaleRMS ( double  s)

Definition at line 8 of file ReflectedIterator.cc.

                                          {
   for ( std::map<int, double>::iterator iter = esigma_.begin();
         iter != esigma_.end(); ++iter ){
      iter->second = s*(iter->second);
   }
}
virtual void ReflectedIterator::subtractPedestal ( std::vector< fastjet::PseudoJet > &  coll) [virtual]

Reimplemented from PileUpSubtractor.


Member Data Documentation

Definition at line 20 of file ReflectedIterator.h.

Definition at line 19 of file ReflectedIterator.h.