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 ()
 
 Mustache (const EcalMustacheSCParameters *mustache_params)
 
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_
 
const EcalMustacheSCParametersmustache_params_
 

Detailed Description

Definition at line 28 of file Mustache.h.

Constructor & Destructor Documentation

◆ Mustache()

reco::Mustache::Mustache ( const EcalMustacheSCParameters mustache_params)

Definition at line 89 of file Mustache.cc.

89 : mustache_params_(mustache_params) {}
const EcalMustacheSCParameters * mustache_params_
Definition: Mustache.h:62

Member Function Documentation

◆ FillMustacheVar()

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

Definition at line 178 of file Mustache.cc.

References bsc_activity_cfg::clusters, HCALHighEnergyHPDFilter_cfi::energy, Energy_In_Mustache_, Energy_Outside_Mustache_, Et_Outside_Mustache_, excluded_, mps_fire::i, included_, LowestClusterEInMustache_, MustacheClust(), position, funct::sin(), and theta().

178  {
182  excluded_ = 0;
183  included_ = 0;
184  std::multimap<float, unsigned int> OrderedClust;
185  std::vector<unsigned int> insideMust;
186  std::vector<unsigned int> outsideMust;
187  MustacheClust(clusters, insideMust, outsideMust);
188  included_ = insideMust.size();
189  excluded_ = outsideMust.size();
190  for (unsigned int i = 0; i < insideMust.size(); ++i) {
191  unsigned int index = insideMust[i];
193  OrderedClust.insert(make_pair(clusters[index].energy(), index));
194  }
195  for (unsigned int i = 0; i < outsideMust.size(); ++i) {
196  unsigned int index = outsideMust[i];
199  }
200  std::multimap<float, unsigned int>::iterator it;
201  it = OrderedClust.begin();
202  unsigned int lowEindex = (*it).second;
203  LowestClusterEInMustache_ = clusters[lowEindex].energy();
204  }
void MustacheClust(const std::vector< CaloCluster > &clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:143
float Energy_In_Mustache_
Definition: Mustache.h:56
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float LowestClusterEInMustache_
Definition: Mustache.h:59
float Et_Outside_Mustache_
Definition: Mustache.h:58
static int position[264][3]
Definition: ReadPGInfo.cc:289
float Energy_Outside_Mustache_
Definition: Mustache.h:57
Geom::Theta< T > theta() const

◆ InsideMust()

int reco::Mustache::InsideMust ( )
inline

Definition at line 46 of file Mustache.h.

References included_.

46 { return included_; }

◆ LowestMustClust()

float reco::Mustache::LowestMustClust ( )
inline

Definition at line 45 of file Mustache.h.

References LowestClusterEInMustache_.

45 { return LowestClusterEInMustache_; }
float LowestClusterEInMustache_
Definition: Mustache.h:59

◆ MustacheClust()

void reco::Mustache::MustacheClust ( const std::vector< CaloCluster > &  clusters,
std::vector< unsigned int > &  insideMust,
std::vector< unsigned int > &  outsideMust 
)

Definition at line 143 of file Mustache.cc.

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

Referenced by FillMustacheVar().

145  {
146  unsigned int ncl = clusters.size();
147  if (!ncl)
148  return;
149 
150  //loop over all clusters to find the one with highest energy
151  float emax = 0;
152  int imax = -1;
153  for (unsigned int i = 0; i < ncl; ++i) {
154  float e = (clusters[i]).energy();
155  if (e > emax) {
156  emax = e;
157  imax = i;
158  }
159  }
160 
161  if (imax < 0)
162  return;
163  float eta0 = (clusters[imax]).eta();
164  float phi0 = (clusters[imax]).phi();
165 
166  for (unsigned int k = 0; k < ncl; k++) {
167  bool inMust = MustacheKernel::inMustache(
168  mustache_params_, eta0, phi0, (clusters[k]).energy(), (clusters[k]).eta(), (clusters[k]).phi());
169  //return indices of Clusters outside the Mustache
170  if (!(inMust)) {
171  outsideMust.push_back(k);
172  } else { //return indices of Clusters inside the Mustache
173  insideMust.push_back(k);
174  }
175  }
176  }
bool inMustache(const EcalMustacheSCParameters *params, const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:8
const EcalMustacheSCParameters * mustache_params_
Definition: Mustache.h:62

◆ MustacheE()

float reco::Mustache::MustacheE ( )
inline

Definition at line 42 of file Mustache.h.

References Energy_In_Mustache_.

42 { return Energy_In_Mustache_; }
float Energy_In_Mustache_
Definition: Mustache.h:56

◆ MustacheEOut()

float reco::Mustache::MustacheEOut ( )
inline

Definition at line 43 of file Mustache.h.

References Energy_Outside_Mustache_.

43 { return Energy_Outside_Mustache_; }
float Energy_Outside_Mustache_
Definition: Mustache.h:57

◆ MustacheEtOut()

float reco::Mustache::MustacheEtOut ( )
inline

Definition at line 44 of file Mustache.h.

References Et_Outside_Mustache_.

44 { return Et_Outside_Mustache_; }
float Et_Outside_Mustache_
Definition: Mustache.h:58

◆ MustacheID() [1/4]

void reco::Mustache::MustacheID ( const CaloClusterPtrVector clusters,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 95 of file Mustache.cc.

References bsc_activity_cfg::clusters.

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

95  {
96  MustacheID(clusters.begin(), clusters.end(), nclusters, EoutsideMustache);
97  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:95

◆ MustacheID() [2/4]

void reco::Mustache::MustacheID ( const std::vector< const CaloCluster *> &  clusters,
int &  nclusers,
float &  EoutsideMustache 
)

Definition at line 99 of file Mustache.cc.

References bsc_activity_cfg::clusters, and MustacheID().

99  {
100  MustacheID(clusters.cbegin(), clusters.cend(), nclusters, EoutsideMustache);
101  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:95

◆ MustacheID() [3/4]

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

Definition at line 91 of file Mustache.cc.

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

91  {
92  MustacheID(sc.clustersBegin(), sc.clustersEnd(), nclusters, EoutsideMustache);
93  }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:95
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:88
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:91

◆ MustacheID() [4/4]

template<class RandomAccessPtrIterator >
void reco::Mustache::MustacheID ( const RandomAccessPtrIterator &  begin,
const RandomAccessPtrIterator &  end,
int &  nclusters,
float &  EoutsideMustache 
)
private

Definition at line 104 of file Mustache.cc.

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

107  {
108  nclusters = 0;
109  EoutsideMustache = 0;
110 
111  unsigned int ncl = end - begin;
112  if (!ncl)
113  return;
114 
115  //loop over all clusters to find the one with highest energy
116  RandomAccessPtrIterator icl = begin;
117  RandomAccessPtrIterator clmax = end;
118  float emax = 0;
119  for (; icl != end; ++icl) {
120  const float e = (*icl)->energy();
121  if (e > emax) {
122  emax = e;
123  clmax = icl;
124  }
125  }
126 
127  if (end == clmax)
128  return;
129 
130  float eta0 = (*clmax)->eta();
131  float phi0 = (*clmax)->phi();
132 
133  bool inMust = false;
134  icl = begin;
135  for (; icl != end; ++icl) {
136  inMust = MustacheKernel::inMustache(mustache_params_, eta0, phi0, (*icl)->energy(), (*icl)->eta(), (*icl)->phi());
137 
138  nclusters += (int)!inMust;
139  EoutsideMustache += (!inMust) * ((*icl)->energy());
140  }
141  }
bool inMustache(const EcalMustacheSCParameters *params, const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
Definition: Mustache.cc:8
const EcalMustacheSCParameters * mustache_params_
Definition: Mustache.h:62

◆ OutsideMust()

int reco::Mustache::OutsideMust ( )
inline

Definition at line 47 of file Mustache.h.

References excluded_.

47 { return excluded_; }

Member Data Documentation

◆ Energy_In_Mustache_

float reco::Mustache::Energy_In_Mustache_
private

Definition at line 56 of file Mustache.h.

Referenced by FillMustacheVar(), and MustacheE().

◆ Energy_Outside_Mustache_

float reco::Mustache::Energy_Outside_Mustache_
private

Definition at line 57 of file Mustache.h.

Referenced by FillMustacheVar(), and MustacheEOut().

◆ Et_Outside_Mustache_

float reco::Mustache::Et_Outside_Mustache_
private

Definition at line 58 of file Mustache.h.

Referenced by FillMustacheVar(), and MustacheEtOut().

◆ excluded_

int reco::Mustache::excluded_
private

Definition at line 60 of file Mustache.h.

Referenced by FillMustacheVar(), and OutsideMust().

◆ included_

int reco::Mustache::included_
private

Definition at line 61 of file Mustache.h.

Referenced by FillMustacheVar(), and InsideMust().

◆ LowestClusterEInMustache_

float reco::Mustache::LowestClusterEInMustache_
private

Definition at line 59 of file Mustache.h.

Referenced by FillMustacheVar(), and LowestMustClust().

◆ mustache_params_

const EcalMustacheSCParameters* reco::Mustache::mustache_params_
private

Definition at line 62 of file Mustache.h.

Referenced by MustacheClust(), and MustacheID().