CMS 3D CMS Logo

Public Member Functions | Public Attributes

MultipleAlgoIterator Class Reference

#include <MultipleAlgoIterator.h>

Inheritance diagram for MultipleAlgoIterator:
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
 MultipleAlgoIterator (const edm::ParameterSet &iConfig)
virtual void offsetCorrectJets ()
void rescaleRMS (double s)
virtual void subtractPedestal (std::vector< fastjet::PseudoJet > &coll)
 ~MultipleAlgoIterator ()

Public Attributes

bool dropZeroTowers_
bool sumRecHits_

Detailed Description

Definition at line 6 of file MultipleAlgoIterator.h.


Constructor & Destructor Documentation

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

Definition at line 8 of file MultipleAlgoIterator.h.

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

Definition at line 21 of file MultipleAlgoIterator.h.

{;}

Member Function Documentation

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

Reimplemented from PileUpSubtractor.

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

Definition at line 186 of file MultipleAlgoIterator.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 MultipleAlgoIterator::getEta ( const reco::CandidatePtr in) const

Definition at line 194 of file MultipleAlgoIterator.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 MultipleAlgoIterator::offsetCorrectJets ( ) [virtual]

Reimplemented from PileUpSubtractor.

Definition at line 16 of file MultipleAlgoIterator.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 = *fjJetDefinition_;
  if ( !doAreaFastjet_ && !doRhoFastjet_) {
    fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequence( *fjInputs_, def ) );
  } else {
    fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequenceArea( *fjInputs_, def, *fjActiveArea_ ) );
  }
  
  (*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(pseudojetTMP->constituents());
    
    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 MultipleAlgoIterator::rescaleRMS ( double  s)

Definition at line 8 of file MultipleAlgoIterator.cc.

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

Reimplemented from PileUpSubtractor.


Member Data Documentation

Definition at line 20 of file MultipleAlgoIterator.h.

Definition at line 19 of file MultipleAlgoIterator.h.