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 254 of file Mustache.cc.

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

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

254  {
258  excluded_=0;
259  included_=0;
260  std::multimap<float, unsigned int>OrderedClust;
261  std::vector<unsigned int> insideMust;
262  std::vector<unsigned int> outsideMust;
263  MustacheClust(clusters, insideMust, outsideMust);
264  included_=insideMust.size(); excluded_=outsideMust.size();
265  for(unsigned int i=0; i<insideMust.size(); ++i){
266  unsigned int index=insideMust[i];
267  Energy_In_Mustache_=clusters[index].energy()+Energy_In_Mustache_;
268  OrderedClust.insert(make_pair(clusters[index].energy(), index));
269  }
270  for(unsigned int i=0; i<outsideMust.size(); ++i){
271  unsigned int index=outsideMust[i];
273  Et_Outside_Mustache_=clusters[index].energy()*sin(clusters[index].position().theta())
275  }
276  std::multimap<float, unsigned int>::iterator it;
277  it=OrderedClust.begin();
278  unsigned int lowEindex=(*it).second;
279  LowestClusterEInMustache_=clusters[lowEindex].energy();
280 
281  }
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:216
float Energy_In_Mustache_
Definition: Mustache.h:54
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
float LowestClusterEInMustache_
Definition: Mustache.h:57
float Et_Outside_Mustache_
Definition: Mustache.h:56
static int position[264][3]
Definition: ReadPGInfo.cc:509
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

Definition at line 44 of file Mustache.h.

References LowestClusterEInMustache_.

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

float LowestClusterEInMustache_
Definition: Mustache.h:57
void reco::Mustache::MustacheClust ( const std::vector< CaloCluster > &  clusters,
std::vector< unsigned int > &  insideMust,
std::vector< unsigned int > &  outsideMust 
)

Definition at line 216 of file Mustache.cc.

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

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

218  {
219  unsigned int ncl = clusters.size();
220  if(!ncl) return;
221 
222  //loop over all clusters to find the one with highest energy
223  float emax = 0;
224  int imax = -1;
225  for(unsigned int i=0; i<ncl; ++i){
226  float e = (clusters[i]).energy();
227  if(e > emax){
228  emax = e;
229  imax = i;
230  }
231  }
232 
233  if(imax<0) return;
234  float eta0 = (clusters[imax]).eta();
235  float phi0 = (clusters[imax]).phi();
236 
237 
238  for(unsigned int k=0; k<ncl; k++){
239 
240  bool inMust=MustacheKernel::inMustache(eta0, phi0,
241  (clusters[k]).energy(),
242  (clusters[k]).eta(),
243  (clusters[k]).phi());
244  //return indices of Clusters outside the Mustache
245  if (!(inMust)){
246  outsideMust.push_back(k);
247  }
248  else{//return indices of Clusters inside the Mustache
249  insideMust.push_back(k);
250  }
251  }
252  }
int i
Definition: DBlmapReader.cc:9
T eta() const
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

Definition at line 41 of file Mustache.h.

References Energy_In_Mustache_.

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

41 {return Energy_In_Mustache_;}
float Energy_In_Mustache_
Definition: Mustache.h:54
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 162 of file Mustache.cc.

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

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

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

Definition at line 168 of file Mustache.cc.

170  {
171  MustacheID(clusters.cbegin(),clusters.cend(),nclusters,EoutsideMustache);
172  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:162
void reco::Mustache::MustacheID ( const reco::SuperCluster sc,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 155 of file Mustache.cc.

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

157  {
159  nclusters, EoutsideMustache);
160  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:162
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:75
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78
template<class RandomAccessPtrIterator >
void reco::Mustache::MustacheID ( const RandomAccessPtrIterator &  begin,
const RandomAccessPtrIterator &  end,
int &  nclusters,
float &  EoutsideMustache 
)
private

Definition at line 175 of file Mustache.cc.

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

178  {
179  nclusters = 0;
180  EoutsideMustache = 0;
181 
182  unsigned int ncl = end-begin;
183  if(!ncl) return;
184 
185  //loop over all clusters to find the one with highest energy
186  RandomAccessPtrIterator icl = begin;
187  RandomAccessPtrIterator clmax = end;
188  float emax = 0;
189  for( ; icl != end; ++icl){
190  const float e = (*icl)->energy();
191  if(e > emax){
192  emax = e;
193  clmax = icl;
194  }
195  }
196 
197  if(end == clmax) return;
198 
199  float eta0 = (*clmax)->eta();
200  float phi0 = (*clmax)->phi();
201 
202 
203  bool inMust = false;
204  icl = begin;
205  for( ; icl != end; ++icl ){
206  inMust=MustacheKernel::inMustache(eta0, phi0,
207  (*icl)->energy(),
208  (*icl)->eta(),
209  (*icl)->phi());
210 
211  nclusters += (int)!inMust;
212  EoutsideMustache += (!inMust)*((*icl)->energy());
213  }
214  }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
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().