CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::Mustache Class Reference

#include <Mustache.h>

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(), PFEGammaAlgo::EvaluateResMVA(), and PFPhotonAlgo::RunPFPhoton().

206  {
210  excluded_=0;
211  included_=0;
212  std::multimap<float, unsigned int>OrderedClust;
213  std::vector<unsigned int> insideMust;
214  std::vector<unsigned int> outsideMust;
215  MustacheClust(clusters, insideMust, outsideMust);
216  included_=insideMust.size(); excluded_=outsideMust.size();
217  for(unsigned int i=0; i<insideMust.size(); ++i){
218  unsigned int index=insideMust[i];
219  Energy_In_Mustache_=clusters[index].energy()+Energy_In_Mustache_;
220  OrderedClust.insert(make_pair(clusters[index].energy(), index));
221  }
222  for(unsigned int i=0; i<outsideMust.size(); ++i){
223  unsigned int index=outsideMust[i];
225  Et_Outside_Mustache_=clusters[index].energy()*sin(clusters[index].position().theta())
227  }
228  std::multimap<float, unsigned int>::iterator it;
229  it=OrderedClust.begin();
230  unsigned int lowEindex=(*it).second;
231  LowestClusterEInMustache_=clusters[lowEindex].energy();
232 
233  }
int i
Definition: DBlmapReader.cc:9
void MustacheClust(const std::vector< CaloCluster > &clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:168
float Energy_In_Mustache_
Definition: Mustache.h:54
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
float LowestClusterEInMustache_
Definition: Mustache.h:57
float Et_Outside_Mustache_
Definition: Mustache.h:56
float Energy_Outside_Mustache_
Definition: Mustache.h:55
int reco::Mustache::InsideMust ( )
inline

Definition at line 45 of file Mustache.h.

References included_.

45 {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(), PFPhotonAlgo::EvaluateResMVA(), and PFEGammaAlgo::EvaluateResMVA().

170  {
171  unsigned int ncl = clusters.size();
172  if(!ncl) return;
173 
174  //loop over all clusters to find the one with highest energy
175  float emax = 0;
176  int imax = -1;
177  for(unsigned int i=0; i<ncl; ++i){
178  float e = (clusters[i]).energy();
179  if(e > emax){
180  emax = e;
181  imax = i;
182  }
183  }
184 
185  if(imax<0) return;
186  float eta0 = (clusters[imax]).eta();
187  float phi0 = (clusters[imax]).phi();
188 
189 
190  for(unsigned int k=0; k<ncl; k++){
191 
192  bool inMust=MustacheKernel::inMustache(eta0, phi0,
193  (clusters[k]).energy(),
194  (clusters[k]).eta(),
195  (clusters[k]).phi());
196  //return indices of Clusters outside the Mustache
197  if (!(inMust)){
198  outsideMust.push_back(k);
199  }
200  else{//return indices of Clusters inside the Mustache
201  insideMust.push_back(k);
202  }
203  }
204  }
int i
Definition: DBlmapReader.cc:9
T eta() const
int k[5][pyjets_maxn]
bool inMustache(const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:9
Definition: DDAxes.h:10
float reco::Mustache::MustacheE ( )
inline
float reco::Mustache::MustacheEOut ( )
inline

Definition at line 42 of file Mustache.h.

References Energy_Outside_Mustache_.

float Energy_Outside_Mustache_
Definition: Mustache.h:55
float reco::Mustache::MustacheEtOut ( )
inline

Definition at line 43 of file Mustache.h.

References Et_Outside_Mustache_.

Referenced by PFPhotonAlgo::RunPFPhoton().

43 {return Et_Outside_Mustache_;}
float Et_Outside_Mustache_
Definition: Mustache.h:56
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().

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

Definition at line 120 of file Mustache.cc.

122  {
123  MustacheID(clusters.cbegin(),clusters.cend(),nclusters,EoutsideMustache);
124  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:114
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().

109  {
111  nclusters, EoutsideMustache);
112  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:114
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:71
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:74
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().

130  {
131  nclusters = 0;
132  EoutsideMustache = 0;
133 
134  unsigned int ncl = end-begin;
135  if(!ncl) return;
136 
137  //loop over all clusters to find the one with highest energy
138  RandomAccessPtrIterator icl = begin;
139  RandomAccessPtrIterator clmax = end;
140  float emax = 0;
141  for( ; icl != end; ++icl){
142  const float e = (*icl)->energy();
143  if(e > emax){
144  emax = e;
145  clmax = icl;
146  }
147  }
148 
149  if(end == clmax) return;
150 
151  float eta0 = (*clmax)->eta();
152  float phi0 = (*clmax)->phi();
153 
154 
155  bool inMust = false;
156  icl = begin;
157  for( ; icl != end; ++icl ){
158  inMust=MustacheKernel::inMustache(eta0, phi0,
159  (*icl)->energy(),
160  (*icl)->eta(),
161  (*icl)->phi());
162 
163  nclusters += (int)!inMust;
164  EoutsideMustache += (!inMust)*((*icl)->energy());
165  }
166  }
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
bool inMustache(const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:9
int reco::Mustache::OutsideMust ( )
inline

Definition at line 46 of file Mustache.h.

References excluded_.

Referenced by PFPhotonAlgo::RunPFPhoton().

46 {return excluded_;}

Member Data Documentation

float reco::Mustache::Energy_In_Mustache_
private

Definition at line 54 of file Mustache.h.

Referenced by MustacheE().

float reco::Mustache::Energy_Outside_Mustache_
private

Definition at line 55 of file Mustache.h.

Referenced by MustacheEOut().

float reco::Mustache::Et_Outside_Mustache_
private

Definition at line 56 of file Mustache.h.

Referenced by MustacheEtOut().

int reco::Mustache::excluded_
private

Definition at line 58 of file Mustache.h.

Referenced by OutsideMust().

int reco::Mustache::included_
private

Definition at line 59 of file Mustache.h.

Referenced by InsideMust().

float reco::Mustache::LowestClusterEInMustache_
private

Definition at line 57 of file Mustache.h.

Referenced by LowestMustClust().