CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::Mustache Class Reference

#include <Mustache.h>

List of all members.

Public Member Functions

void FillMustacheVar (const std::vector< CaloCluster > &clusters)
int InsideMust ()
float LowestMustClust ()
void MustacheClust (const std::vector< CaloCluster > &clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
float MustacheE ()
float MustacheEOut ()
float MustacheEtOut ()
void MustacheID (const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
void MustacheID (const std::vector< const CaloCluster * > &, int &nclusers, float &EoutsideMustache)
void MustacheID (const reco::SuperCluster &sc, int &nclusters, float &EoutsideMustache)
int OutsideMust ()

Private Member Functions

template<class RandomAccessPtrIterator >
void MustacheID (const RandomAccessPtrIterator &, const RandomAccessPtrIterator &, int &nclusters, float &EoutsideMustache)

Private Attributes

float Energy_In_Mustache_
float Energy_Outside_Mustache_
float Et_Outside_Mustache_
int excluded_
int included_
float LowestClusterEInMustache_

Detailed Description

Definition at line 22 of file Mustache.h.


Member Function Documentation

void reco::Mustache::FillMustacheVar ( const std::vector< CaloCluster > &  clusters)

Definition at line 206 of file Mustache.cc.

References relval_parameters_module::energy, i, getHLTprescales::index, position, funct::sin(), and theta().

Referenced by PFPhotonAlgo::EvaluateGCorrMVA(), PFEGammaAlgo::EvaluateGCorrMVA(), PFPhotonAlgo::EvaluateResMVA(), and PFPhotonAlgo::RunPFPhoton().

                                                                      {
    Energy_In_Mustache_=0;
    Energy_Outside_Mustache_=0;
    LowestClusterEInMustache_=0;
    excluded_=0;
    included_=0;
    std::multimap<float, unsigned int>OrderedClust;
    std::vector<unsigned int> insideMust;
    std::vector<unsigned int> outsideMust;
    MustacheClust(clusters, insideMust, outsideMust);
    included_=insideMust.size(); excluded_=outsideMust.size();
    for(unsigned int i=0; i<insideMust.size(); ++i){
      unsigned int index=insideMust[i];
      Energy_In_Mustache_=clusters[index].energy()+Energy_In_Mustache_;
      OrderedClust.insert(make_pair(clusters[index].energy(), index));
    }
    for(unsigned int i=0; i<outsideMust.size(); ++i){
      unsigned int index=outsideMust[i];
      Energy_Outside_Mustache_=clusters[index].energy()+Energy_Outside_Mustache_;
      Et_Outside_Mustache_=clusters[index].energy()*sin(clusters[index].position().theta())
        +Et_Outside_Mustache_;
    }
    std::multimap<float, unsigned int>::iterator it;
    it=OrderedClust.begin();
    unsigned int lowEindex=(*it).second; 
    LowestClusterEInMustache_=clusters[lowEindex].energy();
    
  }
int reco::Mustache::InsideMust ( ) [inline]

Definition at line 45 of file Mustache.h.

References included_.

{return included_;}
float reco::Mustache::LowestMustClust ( ) [inline]
void reco::Mustache::MustacheClust ( const std::vector< CaloCluster > &  clusters,
std::vector< unsigned int > &  insideMust,
std::vector< unsigned int > &  outsideMust 
)

Definition at line 168 of file Mustache.cc.

References alignCSCRings::e, relval_parameters_module::energy, eta(), i, reco::MustacheKernel::inMustache(), gen::k, and phi.

Referenced by PFPhotonAlgo::EvaluateGCorrMVA(), PFEGammaAlgo::EvaluateGCorrMVA(), and PFPhotonAlgo::EvaluateResMVA().

                                                                    {  
    unsigned int ncl = clusters.size();
    if(!ncl) return;
    
    //loop over all clusters to find the one with highest energy
    float emax = 0;
    int imax = -1;
    for(unsigned int i=0; i<ncl; ++i){
      float e = (clusters[i]).energy();
      if(e > emax){
        emax = e;
        imax = i;
      }
    }
    
    if(imax<0) return;
    float eta0 = (clusters[imax]).eta();
    float phi0 = (clusters[imax]).phi();
    
    
    for(unsigned int k=0; k<ncl; k++){
      
      bool inMust=MustacheKernel::inMustache(eta0, phi0, 
                                             (clusters[k]).energy(), 
                                             (clusters[k]).eta(), 
                                             (clusters[k]).phi());
      //return indices of Clusters outside the Mustache
      if (!(inMust)){
        outsideMust.push_back(k);
      }
      else{//return indices of Clusters inside the Mustache
        insideMust.push_back(k);
      }
    }
  }
float reco::Mustache::MustacheE ( ) [inline]
float reco::Mustache::MustacheEOut ( ) [inline]

Definition at line 42 of file Mustache.h.

References Energy_Outside_Mustache_.

float reco::Mustache::MustacheEtOut ( ) [inline]

Definition at line 43 of file Mustache.h.

References Et_Outside_Mustache_.

Referenced by PFPhotonAlgo::RunPFPhoton().

void reco::Mustache::MustacheID ( const reco::SuperCluster sc,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 107 of file Mustache.cc.

References reco::SuperCluster::clustersBegin(), and reco::SuperCluster::clustersEnd().

                                                      {
    MustacheID(sc.clustersBegin(),sc.clustersEnd(), 
               nclusters, EoutsideMustache);
  }
template<class RandomAccessPtrIterator >
void reco::Mustache::MustacheID ( const RandomAccessPtrIterator &  begin,
const RandomAccessPtrIterator &  end,
int &  nclusters,
float &  EoutsideMustache 
) [private]

Definition at line 127 of file Mustache.cc.

References begin, alignCSCRings::e, end, and reco::MustacheKernel::inMustache().

                                                      {    
    nclusters = 0;
    EoutsideMustache = 0;
    
    unsigned int ncl = end-begin;
    if(!ncl) return;
    
    //loop over all clusters to find the one with highest energy
    RandomAccessPtrIterator icl = begin;
    RandomAccessPtrIterator clmax = end;
    float emax = 0;
    for( ; icl != end; ++icl){
      const float e = (*icl)->energy();
      if(e > emax){
        emax = e;
        clmax = icl;
      }
    }
    
    if(end == clmax) return;
    
    float eta0 = (*clmax)->eta();
    float phi0 = (*clmax)->phi();
    

    bool inMust = false;
    icl = begin;
    for( ; icl != end; ++icl ){
      inMust=MustacheKernel::inMustache(eta0, phi0, 
                                        (*icl)->energy(), 
                                        (*icl)->eta(), 
                                        (*icl)->phi());
      
      nclusters += (int)!inMust;
      EoutsideMustache += (!inMust)*((*icl)->energy()); 
    }
  }
void reco::Mustache::MustacheID ( const CaloClusterPtrVector clusters,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 114 of file Mustache.cc.

References edm::PtrVector< T >::begin(), and edm::PtrVector< T >::end().

Referenced by PFElectronTranslator::createGsfElectrons(), and PFPhotonTranslator::createPhotons().

                                                      {    
    MustacheID(clusters.begin(),clusters.end(),nclusters,EoutsideMustache);
  }
void reco::Mustache::MustacheID ( const std::vector< const CaloCluster * > &  clusters,
int &  nclusers,
float &  EoutsideMustache 
)

Definition at line 120 of file Mustache.cc.

                                                      {
    MustacheID(clusters.cbegin(),clusters.cend(),nclusters,EoutsideMustache);
  }
int reco::Mustache::OutsideMust ( ) [inline]

Definition at line 46 of file Mustache.h.

References excluded_.

Referenced by PFPhotonAlgo::RunPFPhoton().

{return excluded_;}

Member Data Documentation

Definition at line 54 of file Mustache.h.

Referenced by MustacheE().

Definition at line 55 of file Mustache.h.

Referenced by MustacheEOut().

Definition at line 56 of file Mustache.h.

Referenced by MustacheEtOut().

Definition at line 58 of file Mustache.h.

Referenced by OutsideMust().

Definition at line 59 of file Mustache.h.

Referenced by InsideMust().

Definition at line 57 of file Mustache.h.

Referenced by LowestMustClust().