CMS 3D CMS Logo

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 18 of file Mustache.h.

Member Function Documentation

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

Definition at line 231 of file Mustache.cc.

References HCALHighEnergyHPDFilter_cfi::energy, mps_fire::i, position, funct::sin(), and theta().

231  {
235  excluded_ = 0;
236  included_ = 0;
237  std::multimap<float, unsigned int> OrderedClust;
238  std::vector<unsigned int> insideMust;
239  std::vector<unsigned int> outsideMust;
240  MustacheClust(clusters, insideMust, outsideMust);
241  included_ = insideMust.size();
242  excluded_ = outsideMust.size();
243  for (unsigned int i = 0; i < insideMust.size(); ++i) {
244  unsigned int index = insideMust[i];
246  OrderedClust.insert(make_pair(clusters[index].energy(), index));
247  }
248  for (unsigned int i = 0; i < outsideMust.size(); ++i) {
249  unsigned int index = outsideMust[i];
252  }
253  std::multimap<float, unsigned int>::iterator it;
254  it = OrderedClust.begin();
255  unsigned int lowEindex = (*it).second;
256  LowestClusterEInMustache_ = clusters[lowEindex].energy();
257  }
void MustacheClust(const std::vector< CaloCluster > &clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:196
float Energy_In_Mustache_
Definition: Mustache.h:44
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
float LowestClusterEInMustache_
Definition: Mustache.h:47
float Et_Outside_Mustache_
Definition: Mustache.h:46
static int position[264][3]
Definition: ReadPGInfo.cc:289
float Energy_Outside_Mustache_
Definition: Mustache.h:45
int reco::Mustache::InsideMust ( )
inline

Definition at line 34 of file Mustache.h.

34 { return included_; }
float reco::Mustache::LowestMustClust ( )
inline

Definition at line 33 of file Mustache.h.

33 { return LowestClusterEInMustache_; }
float LowestClusterEInMustache_
Definition: Mustache.h:47
void reco::Mustache::MustacheClust ( const std::vector< CaloCluster > &  clusters,
std::vector< unsigned int > &  insideMust,
std::vector< unsigned int > &  outsideMust 
)

Definition at line 196 of file Mustache.cc.

References MillePedeFileConverter_cfg::e, HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, mps_fire::i, reco::MustacheKernel::inMustache(), and dqmdumpme::k.

198  {
199  unsigned int ncl = clusters.size();
200  if (!ncl)
201  return;
202 
203  //loop over all clusters to find the one with highest energy
204  float emax = 0;
205  int imax = -1;
206  for (unsigned int i = 0; i < ncl; ++i) {
207  float e = (clusters[i]).energy();
208  if (e > emax) {
209  emax = e;
210  imax = i;
211  }
212  }
213 
214  if (imax < 0)
215  return;
216  float eta0 = (clusters[imax]).eta();
217  float phi0 = (clusters[imax]).phi();
218 
219  for (unsigned int k = 0; k < ncl; k++) {
220  bool inMust =
221  MustacheKernel::inMustache(eta0, phi0, (clusters[k]).energy(), (clusters[k]).eta(), (clusters[k]).phi());
222  //return indices of Clusters outside the Mustache
223  if (!(inMust)) {
224  outsideMust.push_back(k);
225  } else { //return indices of Clusters inside the Mustache
226  insideMust.push_back(k);
227  }
228  }
229  }
bool inMustache(const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:9
float reco::Mustache::MustacheE ( )
inline

Definition at line 30 of file Mustache.h.

30 { return Energy_In_Mustache_; }
float Energy_In_Mustache_
Definition: Mustache.h:44
float reco::Mustache::MustacheEOut ( )
inline

Definition at line 31 of file Mustache.h.

31 { return Energy_Outside_Mustache_; }
float Energy_Outside_Mustache_
Definition: Mustache.h:45
float reco::Mustache::MustacheEtOut ( )
inline

Definition at line 32 of file Mustache.h.

32 { return Et_Outside_Mustache_; }
float Et_Outside_Mustache_
Definition: Mustache.h:46
void reco::Mustache::MustacheID ( const CaloClusterPtrVector clusters,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 148 of file Mustache.cc.

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

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

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

Definition at line 152 of file Mustache.cc.

152  {
153  MustacheID(clusters.cbegin(), clusters.cend(), nclusters, EoutsideMustache);
154  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:148
void reco::Mustache::MustacheID ( const reco::SuperCluster sc,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 144 of file Mustache.cc.

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

144  {
145  MustacheID(sc.clustersBegin(), sc.clustersEnd(), nclusters, EoutsideMustache);
146  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:148
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:86
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:89
template<class RandomAccessPtrIterator >
void reco::Mustache::MustacheID ( const RandomAccessPtrIterator &  begin,
const RandomAccessPtrIterator &  end,
int &  nclusters,
float &  EoutsideMustache 
)
private

Definition at line 157 of file Mustache.cc.

References begin, MillePedeFileConverter_cfg::e, end, reco::MustacheKernel::inMustache(), and createfilelist::int.

160  {
161  nclusters = 0;
162  EoutsideMustache = 0;
163 
164  unsigned int ncl = end - begin;
165  if (!ncl)
166  return;
167 
168  //loop over all clusters to find the one with highest energy
169  RandomAccessPtrIterator icl = begin;
170  RandomAccessPtrIterator clmax = end;
171  float emax = 0;
172  for (; icl != end; ++icl) {
173  const float e = (*icl)->energy();
174  if (e > emax) {
175  emax = e;
176  clmax = icl;
177  }
178  }
179 
180  if (end == clmax)
181  return;
182 
183  float eta0 = (*clmax)->eta();
184  float phi0 = (*clmax)->phi();
185 
186  bool inMust = false;
187  icl = begin;
188  for (; icl != end; ++icl) {
189  inMust = MustacheKernel::inMustache(eta0, phi0, (*icl)->energy(), (*icl)->eta(), (*icl)->phi());
190 
191  nclusters += (int)!inMust;
192  EoutsideMustache += (!inMust) * ((*icl)->energy());
193  }
194  }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
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 35 of file Mustache.h.

35 { return excluded_; }

Member Data Documentation

float reco::Mustache::Energy_In_Mustache_
private

Definition at line 44 of file Mustache.h.

float reco::Mustache::Energy_Outside_Mustache_
private

Definition at line 45 of file Mustache.h.

float reco::Mustache::Et_Outside_Mustache_
private

Definition at line 46 of file Mustache.h.

int reco::Mustache::excluded_
private

Definition at line 48 of file Mustache.h.

int reco::Mustache::included_
private

Definition at line 49 of file Mustache.h.

float reco::Mustache::LowestClusterEInMustache_
private

Definition at line 47 of file Mustache.h.