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 Attributes
reco::Mustache Class Reference

#include <Mustache.h>

Public Member Functions

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

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

Member Function Documentation

void Mustache::FillMustacheVar ( std::vector< CaloCluster clusters)

Definition at line 218 of file Mustache.cc.

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

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

218  {
222  excluded_=0;
223  included_=0;
224  std::multimap<float, unsigned int>OrderedClust;
225  std::vector<unsigned int> insideMust;
226  std::vector<unsigned int> outsideMust;
227  MustacheClust(clusters, insideMust, outsideMust);
228  included_=insideMust.size(); excluded_=outsideMust.size();
229  for(unsigned int i=0; i<insideMust.size(); ++i){
230  unsigned int index=insideMust[i];
231  Energy_In_Mustache_=clusters[index].energy()+Energy_In_Mustache_;
232  OrderedClust.insert(make_pair(clusters[index].energy(), index));
233  }
234  for(unsigned int i=0; i<outsideMust.size(); ++i){
235  unsigned int index=outsideMust[i];
237  Et_Outside_Mustache_=clusters[index].energy()*sin(clusters[index].position().theta())
239  }
240  std::multimap<float, unsigned int>::iterator it;
241  it=OrderedClust.begin();
242  unsigned int lowEindex=(*it).second;
243  LowestClusterEInMustache_=clusters[lowEindex].energy();
244 
245 }
int i
Definition: DBlmapReader.cc:9
float Energy_In_Mustache_
Definition: Mustache.h:26
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:29
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:124
float Et_Outside_Mustache_
Definition: Mustache.h:28
float Energy_Outside_Mustache_
Definition: Mustache.h:27
int reco::Mustache::InsideMust ( )
inline

Definition at line 23 of file Mustache.h.

References included_.

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

Definition at line 22 of file Mustache.h.

References LowestClusterEInMustache_.

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

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

Definition at line 124 of file Mustache.cc.

References alignCSCRings::e, relval_parameters_module::energy, eta(), i, gen::k, phi, Pi, funct::pow(), funct::sin(), mathSSE::sqrt(), w10, and w11.

Referenced by PFPhotonAlgo::EvaluateGCorrMVA(), PFPhotonAlgo::EvaluateResMVA(), ggPFPhotons::fillPFClusters(), ggPFPhotons::getPFPhoECorr(), and ggPFPhotons::recoPhotonClusterLink().

124  {
125  unsigned int ncl = clusters.size();
126  if(!ncl) return;
127 
128  //loop over all clusters to find the one with highest energy
129  float emax = 0;
130  int imax = -1;
131  for(unsigned int i=0; i<ncl; ++i){
132  float e = (clusters[i]).energy();
133  if(e > emax){
134  emax = e;
135  imax = i;
136  }
137  }
138 
139  if(imax<0) return;
140  float eta0 = (clusters[imax]).eta();
141  float phi0 = (clusters[imax]).phi();
142 
143  //==== Parameters for Mustache ID =====================
144  float p00 = -0.107537;
145  float p01 = 0.590969;
146  float p02 = -0.076494;
147  float p10 = -0.0268843;
148  float p11 = 0.147742;
149  float p12 = -0.0191235;
150 
151  float w00 = -0.00571429;
152  float w01 = -0.002;
153  float w10 = 0.0135714;
154  float w11 = 0.001;
155 
156  float deta, dphi;
157  float upper_cut, lower_cut;
158  float b_upper, b_lower;
159  float a_upper, a_lower;
160  float curv_low, curv_up;
161  float midpoint;
162 
163  for(unsigned int k=0; k<ncl; k++){
164  deta = 0.0;
165  dphi = 0.0;
166  upper_cut = 0.0;
167  lower_cut = 0.0;
168  b_upper = 0.0;
169  b_lower = 0.0;
170  a_upper = 0.0;
171  a_lower = 0.0;
172  curv_low = 0.0;
173  curv_up = 0.0;
174  midpoint = 0.0;
175 
176  deta = sin(phi0)*((clusters[k]).eta()-eta0);
177  dphi = (clusters[k]).phi()-phi0;
178  //if(dphi> 3.1415927) dphi -= 6.2832;
179  if(dphi> TMath::Pi()) dphi -= 2* TMath::Pi();
180  if(dphi<-1* TMath::Pi()) dphi +=2* TMath::Pi();
181 
182  //2 parabolas (upper and lower)
183  //of the form: y = a*x*x + b
184 
185  //b comes from a fit to the width
186  //and has a slight dependence on Et on the upper edge
187  b_lower = w00*sin(eta0)*eta0 + w01 / sqrt(log10((clusters[k]).energy())+1.1);
188  b_upper = w10*sin(eta0)*eta0 + w11 / sqrt(log10((clusters[k]).energy())+1.1);
189 
190  //here make an adjustment to the width for the offset from 0.
191  midpoint = b_upper - (b_upper-b_lower)/2.;
192  b_lower = b_lower - midpoint;
193  b_upper = b_upper - midpoint;
194 
195  //the curvature comes from a parabolic
196  //fit for many slices in eta given a
197  //slice -0.1 < log10(Et) < 0.1
198  curv_up = p00*pow(eta0*sin(eta0),2)+p01*eta0*sin(eta0)+p02;
199  curv_low = p10*pow(eta0*sin(eta0),2)+p11*eta0*sin(eta0)+p12;
200 
201  //solving for the curviness given the width of this particular point
202  a_lower = (1/(4*curv_low))-fabs(b_lower);
203  a_upper = (1/(4*curv_up))-fabs(b_upper);
204 
205  upper_cut =(1./(4.*a_upper))*pow(dphi,2)+b_upper;
206  lower_cut =(1./(4.*a_lower))*pow(dphi,2)+b_lower;
207 
208  //return indices of Clusters outside the Mustache
209  if (!(deta < upper_cut && deta > lower_cut)){
210  outsideMust.push_back(k);
211  }
212  else{//return indices of Clusters inside the Mustache
213  insideMust.push_back(k);
214  }
215  }
216 }
const double Pi
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
common ppss p3p6s2 common epss epspn46 common const1 w10
Definition: inclppp.h:1
T eta() const
common ppss p3p6s2 common epss epspn46 common const1 w11
Definition: inclppp.h:1
T sqrt(T t)
Definition: SSEVec.h:46
int k[5][pyjets_maxn]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: DDAxes.h:10
float reco::Mustache::MustacheE ( )
inline

Definition at line 19 of file Mustache.h.

References Energy_In_Mustache_.

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

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

Definition at line 20 of file Mustache.h.

References Energy_Outside_Mustache_.

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

Definition at line 21 of file Mustache.h.

References Et_Outside_Mustache_.

Referenced by PFPhotonAlgo::RunPFPhoton().

21 {return Et_Outside_Mustache_;}
float Et_Outside_Mustache_
Definition: Mustache.h:28
void Mustache::MustacheID ( CaloClusterPtrVector clusters,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 17 of file Mustache.cc.

References edm::PtrVectorBase::size().

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

17  {
18  std::vector<const CaloCluster*> myClusters;
19  unsigned myNclusters(clusters.size());
20  for(unsigned icluster=0;icluster<myNclusters;++icluster) {
21  myClusters.push_back(&(*clusters[icluster]));
22  }
23  MustacheID(myClusters,nclusters,EoutsideMustache);
24 }
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:73
void MustacheID(CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:17
void reco::Mustache::MustacheID ( CaloClusterPtrVector clusters,
int &  nclusters,
float &  EoutsideMustache 
)
void reco::Mustache::MustacheID ( std::vector< const CaloCluster * >  ,
int &  nclusers,
float &  EoutsideMustache 
)
void Mustache::MustacheID ( std::vector< const CaloCluster * >  clusters,
int &  nclusers,
float &  EoutsideMustache 
)

Definition at line 26 of file Mustache.cc.

References alignCSCRings::e, relval_parameters_module::energy, eta(), i, gen::k, phi, Pi, funct::pow(), funct::sin(), mathSSE::sqrt(), w10, and w11.

27 {
28 
29  nclusters = 0;
30  EoutsideMustache = 0;
31 
32  unsigned int ncl = clusters.size();
33  if(!ncl) return;
34 
35  //loop over all clusters to find the one with highest energy
36  float emax = 0;
37  int imax = -1;
38  for(unsigned int i=0; i<ncl; ++i){
39  float e = (*clusters[i]).energy();
40  if(e > emax){
41  emax = e;
42  imax = i;
43  }
44  }
45 
46  if(imax<0) return;
47  float eta0 = (*clusters[imax]).eta();
48  float phi0 = (*clusters[imax]).phi();
49 
50  //==== Parameters for Mustache ID =====================
51  float p00 = -0.107537;
52  float p01 = 0.590969;
53  float p02 = -0.076494;
54  float p10 = -0.0268843;
55  float p11 = 0.147742;
56  float p12 = -0.0191235;
57 
58  float w00 = -0.00571429;
59  float w01 = -0.002;
60  float w10 = 0.0135714;
61  float w11 = 0.001;
62 
63  float deta, dphi;
64  float upper_cut, lower_cut;
65  float b_upper, b_lower;
66  float a_upper, a_lower;
67  float curv_low, curv_up;
68  float midpoint;
69 
70  for(unsigned int k=0; k<ncl; k++){
71  deta = 0.0;
72  dphi = 0.0;
73  upper_cut = 0.0;
74  lower_cut = 0.0;
75  b_upper = 0.0;
76  b_lower = 0.0;
77  a_upper = 0.0;
78  a_lower = 0.0;
79  curv_low = 0.0;
80  curv_up = 0.0;
81  midpoint = 0.0;
82 
83  deta = sin(phi0)*((*clusters[k]).eta()-eta0);
84  dphi = (*clusters[k]).phi()-phi0;
85  //if(dphi> 3.1415927) dphi -= 6.2832;
86  if(dphi> TMath::Pi()) dphi -= 2* TMath::Pi();
87  if(dphi<-1* TMath::Pi()) dphi +=2* TMath::Pi();
88 
89  //2 parabolas (upper and lower)
90  //of the form: y = a*x*x + b
91 
92  //b comes from a fit to the width
93  //and has a slight dependence on Et on the upper edge
94  b_lower = w00*sin(eta0)*eta0 + w01 / sqrt(log10((*clusters[k]).energy())+1.1);
95  b_upper = w10*sin(eta0)*eta0 + w11 / sqrt(log10((*clusters[k]).energy())+1.1);
96 
97  //here make an adjustment to the width for the offset from 0.
98  midpoint = b_upper - (b_upper-b_lower)/2.;
99  b_lower = b_lower - midpoint;
100  b_upper = b_upper - midpoint;
101 
102  //the curvature comes from a parabolic
103  //fit for many slices in eta given a
104  //slice -0.1 < log10(Et) < 0.1
105  curv_up = p00*pow(eta0*sin(eta0),2)+p01*eta0*sin(eta0)+p02;
106  curv_low = p10*pow(eta0*sin(eta0),2)+p11*eta0*sin(eta0)+p12;
107 
108  //solving for the curviness given the width of this particular point
109  a_lower = (1/(4*curv_low))-fabs(b_lower);
110  a_upper = (1/(4*curv_up))-fabs(b_upper);
111 
112  upper_cut =(1./(4.*a_upper))*pow(dphi,2)+b_upper;
113  lower_cut =(1./(4.*a_lower))*pow(dphi,2)+b_lower;
114 
115 
116  if (!(deta < upper_cut && deta > lower_cut)){
117  nclusters++;
118  EoutsideMustache += (*clusters[k]).energy();
119  }
120 
121  }
122 }
const double Pi
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
common ppss p3p6s2 common epss epspn46 common const1 w10
Definition: inclppp.h:1
T eta() const
common ppss p3p6s2 common epss epspn46 common const1 w11
Definition: inclppp.h:1
T sqrt(T t)
Definition: SSEVec.h:46
int k[5][pyjets_maxn]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: DDAxes.h:10
void Mustache::MustacheID ( const reco::SuperCluster sc,
int &  nclusters,
float &  EoutsideMustache 
)

Definition at line 6 of file Mustache.cc.

References reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), and edm::PtrVector< T >::push_back().

7 {
8  CaloClusterPtrVector clusters;
9 
10  for(CaloCluster_iterator iter = sc.clustersBegin(); iter != sc.clustersEnd(); ++iter){
11  clusters.push_back(*iter);
12  }
13 
14  MustacheID(clusters, nclusters, EoutsideMustache);
15 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:137
void MustacheID(CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:17
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:65
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:68
void reco::Mustache::MustacheID ( const reco::SuperCluster sc,
int &  nclusters,
float &  EoutsideMustache 
)
void Mustache::MustacheID ( std::vector< CaloCluster clusters,
std::vector< unsigned int > &  insideMust,
std::vector< unsigned int > &  outsideMust 
)

Definition at line 125 of file Mustache.cc.

References alignCSCRings::e, relval_parameters_module::energy, eta(), i, gen::k, phi, Pi, funct::pow(), funct::sin(), and mathSSE::sqrt().

126 {
127 
128 
129  unsigned int ncl = clusters.size();
130  if(!ncl) return;
131 
132  //loop over all clusters to find the one with highest energy
133  float emax = 0;
134  int imax = -1;
135  for(unsigned int i=0; i<ncl; ++i){
136  float e = (clusters[i]).energy();
137  if(e > emax){
138  emax = e;
139  imax = i;
140  }
141  }
142 
143  if(imax<0) return;
144  float eta0 = (clusters[imax]).eta();
145  float phi0 = (clusters[imax]).phi();
146 
147  //==== Parameters for Mustache ID =====================
148  float p00 = -0.107537;
149  float p01 = 0.590969;
150  float p02 = -0.076494;
151  float p10 = -0.0268843;
152  float p11 = 0.147742;
153  float p12 = -0.0191235;
154 
155  float w00 = -0.00571429;
156  float w01 = -0.002;
157  float w10 = 0.0135714;
158  float w11 = 0.001;
159 
160  float deta, dphi;
161  float upper_cut, lower_cut;
162  float b_upper, b_lower;
163  float a_upper, a_lower;
164  float curv_low, curv_up;
165  float midpoint;
166 
167  for(unsigned int k=0; k<ncl; k++){
168  deta = 0.0;
169  dphi = 0.0;
170  upper_cut = 0.0;
171  lower_cut = 0.0;
172  b_upper = 0.0;
173  b_lower = 0.0;
174  a_upper = 0.0;
175  a_lower = 0.0;
176  curv_low = 0.0;
177  curv_up = 0.0;
178  midpoint = 0.0;
179 
180  deta = sin(phi0)*((clusters[k]).eta()-eta0);
181  dphi = (clusters[k]).phi()-phi0;
182  //if(dphi> 3.1415927) dphi -= 6.2832;
183  if(dphi> TMath::Pi()) dphi -= 2* TMath::Pi();
184  if(dphi<-1* TMath::Pi()) dphi +=2* TMath::Pi();
185 
186  //2 parabolas (upper and lower)
187  //of the form: y = a*x*x + b
188 
189  //b comes from a fit to the width
190  //and has a slight dependence on Et on the upper edge
191  b_lower = w00*sin(eta0)*eta0 + w01 / sqrt(log10((clusters[k]).energy())+1.1);
192  b_upper = w10*sin(eta0)*eta0 + w11 / sqrt(log10((clusters[k]).energy())+1.1);
193 
194  //here make an adjustment to the width for the offset from 0.
195  midpoint = b_upper - (b_upper-b_lower)/2.;
196  b_lower = b_lower - midpoint;
197  b_upper = b_upper - midpoint;
198 
199  //the curvature comes from a parabolic
200  //fit for many slices in eta given a
201  //slice -0.1 < log10(Et) < 0.1
202  curv_up = p00*pow(eta0*sin(eta0),2)+p01*eta0*sin(eta0)+p02;
203  curv_low = p10*pow(eta0*sin(eta0),2)+p11*eta0*sin(eta0)+p12;
204 
205  //solving for the curviness given the width of this particular point
206  a_lower = (1/(4*curv_low))-fabs(b_lower);
207  a_upper = (1/(4*curv_up))-fabs(b_upper);
208 
209  upper_cut =(1./(4.*a_upper))*pow(dphi,2)+b_upper;
210  lower_cut =(1./(4.*a_lower))*pow(dphi,2)+b_lower;
211 
212  //return indices of Clusters outside the Mustache
213  if (!(deta < upper_cut && deta > lower_cut)){
214  outsideMust.push_back(k);
215  }
216  else{//return indices of Clusters inside the Mustache
217  insideMust.push_back(k);
218  }
219  }
220 }
const double Pi
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
common ppss p3p6s2 common epss epspn46 common const1 w10
Definition: inclppp.h:1
T eta() const
common ppss p3p6s2 common epss epspn46 common const1 w11
Definition: inclppp.h:1
T sqrt(T t)
Definition: SSEVec.h:46
int k[5][pyjets_maxn]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: DDAxes.h:10
int reco::Mustache::OutsideMust ( )
inline

Definition at line 24 of file Mustache.h.

References excluded_.

Referenced by PFPhotonAlgo::RunPFPhoton().

24 {return excluded_;}

Member Data Documentation

float reco::Mustache::Energy_In_Mustache_
private

Definition at line 26 of file Mustache.h.

Referenced by MustacheE().

float reco::Mustache::Energy_Outside_Mustache_
private

Definition at line 27 of file Mustache.h.

Referenced by MustacheEOut().

float reco::Mustache::Et_Outside_Mustache_
private

Definition at line 28 of file Mustache.h.

Referenced by MustacheEtOut().

int reco::Mustache::excluded_
private

Definition at line 30 of file Mustache.h.

Referenced by OutsideMust().

int reco::Mustache::included_
private

Definition at line 31 of file Mustache.h.

Referenced by InsideMust().

float reco::Mustache::LowestClusterEInMustache_
private

Definition at line 29 of file Mustache.h.

Referenced by LowestMustClust().