ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/PhotonTools.cc
Revision: 1.39
Committed: Fri Oct 26 19:23:04 2012 UTC (12 years, 6 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.38: +26 -15 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 fabstoec 1.39 // $Id: PhotonTools.cc,v 1.38 2012/10/10 23:17:05 bendavid Exp $
2 bendavid 1.1
3     #include "MitPhysics/Utils/interface/PhotonTools.h"
4     #include "MitPhysics/Utils/interface/ElectronTools.h"
5 fabstoec 1.5 #include "MitPhysics/Utils/interface/IsolationTools.h"
6 bendavid 1.1 #include "MitAna/DataTree/interface/StableData.h"
7     #include <TFile.h>
8 fabstoec 1.8 #include <TRandom3.h>
9 bendavid 1.1
10     ClassImp(mithep::PhotonTools)
11    
12     using namespace mithep;
13    
14     //--------------------------------------------------------------------------------------------------
15     PhotonTools::PhotonTools()
16     {
17     // Constructor.
18     }
19    
20 bendavid 1.16 //--------------------------------------------------------------------------------------------------
21     PhotonTools::eScaleCats PhotonTools::EScaleCat(const Photon *p)
22     {
23     if (p->SCluster()->AbsEta()<1.0) {
24 bendavid 1.19 if (p->R9()>0.94) {
25     Int_t ieta = p->SCluster()->Seed()->IEta();
26     Int_t iphi = p->SCluster()->Seed()->IPhi();
27     Bool_t central = ( ((std::abs(ieta)-1)/5+1 >= 2 && (std::abs(ieta)-1)/5+1 < 5) || ((std::abs(ieta)-1)/5+1 >= 7 && (std::abs(ieta)-1)/5+1 < 9 ) || ((std::abs(ieta)-1)/5+1 >= 11 && (std::abs(ieta)-1)/5+1 < 13) || ((std::abs(ieta)-1)/5+1 >= 15 && (std::abs(ieta)-1)/5+1 < 17) ) && (iphi %20) > 5 && (iphi%20) <16;
28    
29     if (central) return kEBlowEtaGoldCenter;
30     else return kEBlowEtaGoldGap;
31     }
32 bendavid 1.16 else return kEBlowEtaBad;
33     }
34     else if (p->SCluster()->AbsEta()<1.5) {
35     if (p->R9()>0.94) return kEBhighEtaGold;
36     else return kEBhighEtaBad;
37     }
38     else if (p->SCluster()->AbsEta()<2.0) {
39     if (p->R9()>0.94) return kEElowEtaGold;
40     else return kEElowEtaBad;
41     }
42     else {
43     if (p->R9()>0.94) return kEEhighEtaGold;
44     else return kEEhighEtaBad;
45     }
46    
47     }
48 fabstoec 1.8
49 mingyang 1.37 PhotonTools::eScaleCats PhotonTools::EScaleCatHCP(const Photon *p)
50     {
51     if (p->SCluster()->AbsEta()<1.0) {
52     Int_t ieta = p->SCluster()->Seed()->IEta();
53     Int_t iphi = p->SCluster()->Seed()->IPhi();
54     Bool_t central = ( ((std::abs(ieta)-1)/5+1 >= 2 && (std::abs(ieta)-1)/5+1 < 5) || ((std::abs(ieta)-1)/5+1 >= 7 && (std::abs(ieta)-1)/5+1 < 9 ) || ((std::abs(ieta)-1)/5+1 >= 11 && (std::abs(ieta)-1)/5+1 < 13) || ((std::abs(ieta)-1)/5+1 >= 15 && (std::abs(ieta)-1)/5+1 < 17) ) && (iphi %20) > 5 && (iphi%20) <16;
55     if(p->R9()>0.94 && central) return kEBlowEtaGoldCenter;
56     else if(p->R9()>0.94 && (!central)) return kEBlowEtaGoldGap;
57     else if(p->R9()<=0.94 && central) return kEBlowEtaBadCenter;
58     else return kEBlowEtaBadGap;
59     }
60     else if (p->SCluster()->AbsEta()<1.5) {
61     if (p->R9()>0.94) return kEBhighEtaGold;
62     else return kEBhighEtaBad;
63     }
64     else if (p->SCluster()->AbsEta()<2.0) {
65     if (p->R9()>0.94) return kEElowEtaGold;
66     else return kEElowEtaBad;
67     }
68     else {
69     if (p->R9()>0.94) return kEEhighEtaGold;
70     else return kEEhighEtaBad;
71     }
72    
73     }
74    
75 fabstoec 1.8 void PhotonTools::ScalePhoton(Photon* p, Double_t scale) {
76     if( !p ) return;
77     FourVectorM mom = p->Mom();
78     p->SetMom(scale*mom.X(), scale*mom.Y(), scale*mom.Z(), scale*mom.E());
79    
80     }
81    
82     void PhotonTools::SmearPhoton(Photon* p, TRandom3* rng, Double_t width, UInt_t iSeed) {
83    
84     if( !p ) return;
85     if( !rng) return;
86     if( width < 0.) return;
87    
88 fabstoec 1.10 rng->SetSeed(iSeed);
89 fabstoec 1.8 FourVectorM mom = p->Mom();
90     Double_t scale = rng->Gaus(1.,width);
91 fabstoec 1.10
92 fabstoec 1.8 if( scale > 0)
93     p->SetMom(scale*mom.X(), scale*mom.Y(), scale*mom.Z(), scale*mom.E());
94 bendavid 1.13
95     return;
96     }
97 fabstoec 1.8
98 bendavid 1.13 void PhotonTools::SmearPhotonError(Photon* p, Double_t width) {
99    
100     if( !p ) return;
101     if( width < 0.) return;
102    
103 bendavid 1.14
104     Double_t smear = p->EnergySmearing();
105     p->SetEnergySmearing(TMath::Sqrt(smear*smear+width*width*p->E()*p->E()));
106    
107 bendavid 1.13 Double_t err = p->EnergyErrSmeared();
108     if (err>=0.0) {
109     p->SetEnergyErrSmeared(TMath::Sqrt(err*err + width*width*p->E()*p->E()));
110     }
111    
112 fabstoec 1.8 }
113    
114 bendavid 1.16 void PhotonTools::ScalePhotonR9(Photon* p, Double_t scale) {
115     p->SetR9(scale*p->R9());
116     }
117    
118 bendavid 1.23
119 bendavid 1.16 void PhotonTools::ScalePhotonError(Photon* p, Double_t scale) {
120     p->SetEnergyErrSmeared(scale*p->EnergyErrSmeared());
121     }
122    
123 bendavid 1.1 //--------------------------------------------------------------------------------------------------
124     Bool_t PhotonTools::PassConversionId(const Photon *p, const DecayParticle *c) {
125    
126     if (!c) return kTRUE;
127    
128     ThreeVector dirconvsc = ThreeVector(p->SCluster()->Point()) - c->Position();
129     Double_t deta = c->Eta()-dirconvsc.Eta();
130     Double_t dphi = MathUtils::DeltaPhi(c->Phi(),dirconvsc.Phi());
131     Double_t eoverp = p->SCluster()->Energy()/c->P();
132    
133     if (p->IsEB() && eoverp>2.0) return kFALSE;
134     if (p->IsEE() && eoverp>3.0) return kFALSE;
135    
136     if (p->IsEE() && TMath::Abs(deta)>0.01) return kFALSE;
137     if (p->IsEE() && TMath::Abs(dphi)>0.01) return kFALSE;
138    
139     return kTRUE;
140    
141     }
142    
143     //--------------------------------------------------------------------------------------------------
144     Bool_t PhotonTools::PassElectronVeto(const Photon *p, const ElectronCol *els) {
145    
146     Bool_t pass = kTRUE;
147     for (UInt_t i=0; i<els->GetEntries(); ++i) {
148     const Electron *e = els->At(i);
149     if (e->SCluster()==p->SCluster() && e->GsfTrk()->NExpectedHitsInner()==0) {
150     pass = kFALSE;
151     }
152     }
153    
154     return pass;
155     }
156    
157     //--------------------------------------------------------------------------------------------------
158 bendavid 1.13 const Electron *PhotonTools::MatchedElectron(const Photon *p, const ElectronCol *els) {
159    
160     for (UInt_t i=0; i<els->GetEntries(); ++i) {
161     const Electron *e = els->At(i);
162     if ( e->SCluster()==p->SCluster() ) {
163     return e;
164     }
165     }
166    
167     return 0;
168     }
169    
170     //--------------------------------------------------------------------------------------------------
171     const Photon *PhotonTools::MatchedPhoton(const Electron *e, const PhotonCol *phs) {
172    
173     for (UInt_t i=0; i<phs->GetEntries(); ++i) {
174     const Photon *p = phs->At(i);
175     if ( p->SCluster()==e->SCluster() ) {
176     return p;
177     }
178     }
179    
180     return 0;
181     }
182    
183     //--------------------------------------------------------------------------------------------------
184     const SuperCluster *PhotonTools::MatchedSC(const SuperCluster *psc, const SuperClusterCol *scs, Double_t drMin) {
185    
186     Double_t drsmallest = 999.;
187     const SuperCluster *match = 0;
188     for (UInt_t i=0; i<scs->GetEntries(); ++i) {
189     const SuperCluster *sc = scs->At(i);
190     Double_t dr = MathUtils::DeltaR(*sc,*psc);
191     if ( dr<drsmallest && dr<drMin ) {
192     drsmallest = dr;
193     match = sc;
194     }
195     }
196    
197     return match;
198     }
199    
200     //--------------------------------------------------------------------------------------------------
201 bendavid 1.25 const SuperCluster *PhotonTools::MatchedPFSC(const SuperCluster *psc, const PhotonCol *pfphos, const ElectronCol *eles, Double_t drMin) {
202    
203    
204     if (pfphos) {
205     for (UInt_t i=0; i<pfphos->GetEntries(); ++i) {
206     const Photon *pfpho = pfphos->At(i);
207     if (psc == pfpho->SCluster() && pfpho->PFSCluster()) return pfpho->PFSCluster();
208     }
209     }
210    
211     for (UInt_t i=0; i<eles->GetEntries(); ++i) {
212     const Electron *ele = eles->At(i);
213     if (psc == ele->SCluster() && ele->PFSCluster()) return ele->PFSCluster();
214     }
215    
216     Double_t drsmallest = 999.;
217     const SuperCluster *match = 0;
218     for (UInt_t i=0; i<eles->GetEntries(); ++i) {
219     const Electron *ele = eles->At(i);
220     //if (psc == ele->SCluster() && ele->HasPFSCluster()) return ele->PFSCluster();
221     if (!ele->PFSCluster()) continue;
222    
223     Double_t dr = MathUtils::DeltaR(*ele->PFSCluster(),*psc);
224     if ( dr<drsmallest && dr<drMin ) {
225     drsmallest = dr;
226     match = ele->PFSCluster();
227     }
228     }
229    
230     return match;
231     }
232    
233     //--------------------------------------------------------------------------------------------------
234 fabstoec 1.4 Double_t PhotonTools::ElectronVetoCiC(const Photon *p, const ElectronCol *els) {
235    
236     for (UInt_t i=0; i<els->GetEntries(); ++i) {
237     const Electron *e = els->At(i);
238 fabstoec 1.5 if (e->SCluster()==p->SCluster() ) {
239     //if( e->GsfTrk()->NExpectedHitsInner()==0 && e->GsfTrk()->Pt() > 2.5 ) {
240     if( e->GsfTrk()->NExpectedHitsInner()==0 ) {
241     double dEta = e->DeltaEtaSuperClusterTrackAtVtx();
242     double dPhi = e->DeltaPhiSuperClusterTrackAtVtx();
243     double dR = TMath::Sqrt(dEta*dEta+dPhi*dPhi);
244     return dR;
245     }
246     }
247     }
248     return 99.;
249 fabstoec 1.4 }
250    
251     //--------------------------------------------------------------------------------------------------
252 bendavid 1.1 Bool_t PhotonTools::PassElectronVetoConvRecovery(const Photon *p, const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *v) {
253    
254     Bool_t pass = kTRUE;
255     for (UInt_t i=0; i<els->GetEntries(); ++i) {
256     const Electron *e = els->At(i);
257 fabstoec 1.34
258     // HACVK to match CMSSW bug...
259 bendavid 1.1 if (e->SCluster()==p->SCluster() && e->GsfTrk()->NExpectedHitsInner()==0 && ElectronTools::PassConversionFilter(e, conversions,
260 fabstoec 1.31 v, 0, 0., 1e-6, kTRUE, kFALSE) ) {
261 fabstoec 1.34 // v, 0, 1e-6, 2.0, kFALSE, kFALSE) ) {
262 bendavid 1.1 pass = kFALSE;
263     }
264     }
265    
266     return pass;
267     }
268    
269     //--------------------------------------------------------------------------------------------------
270     Bool_t PhotonTools::PassTriggerMatching(const Photon *p, const TriggerObjectCol *trigobjs)
271     {
272    
273     for (UInt_t i=0; i<trigobjs->GetEntries(); ++i) {
274     const TriggerObject *trigobj = trigobjs->At(i);
275     if (trigobj->TriggerType()==TriggerObject::TriggerCluster || trigobj->TriggerType()==TriggerObject::TriggerElectron || trigobj->TriggerType()==TriggerObject::TriggerPhoton) {
276     if (MathUtils::DeltaR(p->SCluster(),trigobj)<0.3) {
277     return kTRUE;
278     }
279     }
280     }
281    
282     return kFALSE;
283    
284    
285     }
286    
287     //--------------------------------------------------------------------------------------------------
288     const DecayParticle *PhotonTools::MatchedConversion(const Photon *p, const DecayParticleCol *conversions,
289     const BaseVertex *vtx, Int_t nWrongHitsMax, Double_t probMin,
290     Double_t lxyMin, Double_t dRMin) {
291    
292 bendavid 1.13 return MatchedConversion(p->SCluster(), conversions, vtx, nWrongHitsMax, probMin, lxyMin, dRMin);
293    
294     }
295    
296     //--------------------------------------------------------------------------------------------------
297     const DecayParticle *PhotonTools::MatchedConversion(const SuperCluster *sc, const DecayParticleCol *conversions,
298     const BaseVertex *vtx, Int_t nWrongHitsMax, Double_t probMin,
299     Double_t lxyMin, Double_t dRMin) {
300    
301 bendavid 1.1 const DecayParticle *match = 0;
302 bendavid 1.3 Double_t rhosmallest = 999.;
303 bendavid 1.1 for (UInt_t i=0; i<conversions->GetEntries(); ++i) {
304     const DecayParticle *c = conversions->At(i);
305 bendavid 1.13 ThreeVector dirconvsc = ThreeVector(sc->Point()) - c->Position();
306 bendavid 1.1 Double_t dr = MathUtils::DeltaR(*c,dirconvsc);
307 bendavid 1.3 Double_t rho = c->Position().Rho();
308     if (dr<dRMin && rho<rhosmallest && c->Prob()>probMin && c->LxyCorrected(vtx)>lxyMin) {
309 bendavid 1.1 Int_t nhb1 = dynamic_cast<const StableData*>(c->DaughterDat(0))->NHitsBeforeVtx();
310     Int_t nhb2 = dynamic_cast<const StableData*>(c->DaughterDat(1))->NHitsBeforeVtx();
311     if (TMath::Max(nhb1,nhb2)<=nWrongHitsMax) {
312 bendavid 1.3 rhosmallest = rho;
313 bendavid 1.1 match = c;
314     }
315     }
316    
317     }
318    
319     return match;
320    
321     }
322    
323 bendavid 1.2 //--------------------------------------------------------------------------------------------------
324     const DecayParticle *PhotonTools::MatchedConversion(const Track *t, const DecayParticleCol *conversions,
325     const BaseVertex *vtx, Int_t nWrongHitsMax, Double_t probMin,
326     Double_t lxyMin) {
327    
328     for (UInt_t i=0; i<conversions->GetEntries(); ++i) {
329     const DecayParticle *c = conversions->At(i);
330     if (c->Prob()>probMin && c->LxyCorrected(vtx)>lxyMin) {
331     Int_t nhb1 = dynamic_cast<const StableData*>(c->DaughterDat(0))->NHitsBeforeVtx();
332     Int_t nhb2 = dynamic_cast<const StableData*>(c->DaughterDat(1))->NHitsBeforeVtx();
333     if (TMath::Max(nhb1,nhb2)<=nWrongHitsMax) {
334     const Track *ct1 = dynamic_cast<const ChargedParticle*>(c->Daughter(0))->Trk();
335     const Track *ct2 = dynamic_cast<const ChargedParticle*>(c->Daughter(1))->Trk();
336     if (t==ct1 || t==ct2) return c;
337     }
338     }
339    
340     }
341    
342     return 0;
343    
344     }
345    
346 bendavid 1.1 PhotonTools::DiphotonR9EtaCats PhotonTools::DiphotonR9EtaCat(const Photon *p1, const Photon *p2) {
347    
348     if (p1->IsEB() && p2->IsEB()) {
349     if (p1->R9()>0.93 && p2->R9()>0.93) return kCat1;
350     else return kCat2;
351    
352     }
353     else {
354     if (p1->R9()>0.93 && p2->R9()>0.93) return kCat3;
355     else return kCat4;
356     }
357    
358     }
359    
360     PhotonTools::DiphotonR9EtaConversionCats PhotonTools::DiphotonR9EtaConversionCat(const Photon *p1, const Photon *p2, const DecayParticleCol *conversions, const BaseVertex *v) {
361    
362     const DecayParticle *conv1 = MatchedConversion(p1, conversions, v);
363     const DecayParticle *conv2 = MatchedConversion(p2, conversions, v);
364    
365     if (p1->IsEB() && p2->IsEB()) {
366     if (p1->R9()>0.93 && p2->R9()>0.93) return kNewCat1;
367     else if (conv1||conv2) return kNewCat2;
368     else return kNewCat3;
369    
370     }
371     else {
372     if (p1->R9()>0.93 && p2->R9()>0.93) return kNewCat4;
373     else if (conv1||conv2) return kNewCat5;
374     else return kNewCat6;
375     }
376    
377 fabstoec 1.4 }
378    
379     PhotonTools::CiCBaseLineCats PhotonTools::CiCBaseLineCat(const Photon *p) {
380 bendavid 1.12 if( p->SCluster()->AbsEta()<1.5 ) {
381 fabstoec 1.4 if ( p->R9() > 0.94 ) return kCiCCat1;
382     else return kCiCCat2;
383     } else {
384     if ( p->R9() > 0.94 ) return kCiCCat3;
385     else return kCiCCat4;
386     }
387 fabstoec 1.8
388     // shoud NEVER happen, but you never know...
389     return kCiCNoCat;
390 fabstoec 1.4 }
391 fabstoec 1.5
392     //--------------------------------------------------------------------------------------------------
393     const DecayParticle *PhotonTools::MatchedCiCConversion(const Photon *p, const DecayParticleCol *conversions,
394     Double_t dPhiMin,
395 fabstoec 1.7 Double_t dEtaMin,
396     Double_t dRMin,
397 fabstoec 1.39 bool print,
398     int* numLegs,
399     int* convIdx) {
400 fabstoec 1.5
401 fabstoec 1.8 // if there are no conversons, return
402     if ( !p || !conversions) return NULL;
403    
404 fabstoec 1.6 const DecayParticle *match = NULL;
405 fabstoec 1.39 int matchIdx = -1;
406 fabstoec 1.6
407     double minDeta = 999.;
408     double minDphi = 999.;
409 fabstoec 1.7 double minDR = 999.;
410 fabstoec 1.6
411     double phPhi = p->SCluster()->Phi();
412     double phEta = p->SCluster()->Eta();
413 fabstoec 1.39
414 fabstoec 1.7 if(print)
415     std::cout<<" --- conv match photon eta = "<<phEta<<" phi = "<<phPhi<<std::endl;
416 fabstoec 1.39
417 fabstoec 1.7
418 fabstoec 1.5 for (UInt_t i=0; i<conversions->GetEntries(); ++i) {
419     const DecayParticle *c = conversions->At(i);
420 fabstoec 1.39
421 fabstoec 1.7 if(print)
422 fabstoec 1.39 std::cout<< " c "<<i+1<<" pt = "<<c->Pt()<<" with Nlegs = "<<c->NDaughters()<<" "<<c->Position().X()<<" "<<c->Position().Y()<<" "<<c->Position().Z()<<" "<<std::endl;
423 fabstoec 1.34
424 bendavid 1.38 if (c->Pt() < 10. ) continue; // is this refittedPairMomentum?
425 bendavid 1.29 if (c->NDaughters()==2 && c->Prob() < 1e-6) continue;
426 bendavid 1.24
427 bendavid 1.38 ThreeVector dirconvsc = ThreeVector(p->SCluster()->Point()) - c->Position();
428     Double_t dR = MathUtils::DeltaR(dirconvsc,c->Mom());
429 fabstoec 1.7
430     if(dR < minDR) {
431     minDR = dR;
432 fabstoec 1.39 // minDphi = dphi;
433     // minDeta = TMath::Abs(deta);
434 fabstoec 1.7 match = c;
435 fabstoec 1.39 matchIdx = (int) i;
436 fabstoec 1.7
437 fabstoec 1.39 if(print) {
438     //std::cout<<" conv "<<i+1<<" matches with dPhi = "<<minDphi<<" dEta = "<<minDeta<<std::endl;
439     std::cout<<" conv "<<i+1<<" matches with dR = "<<minDR<<std::endl;
440     }
441 fabstoec 1.6 }
442 fabstoec 1.5 }
443    
444 fabstoec 1.7 //if(minDphi < dPhiMin && minDeta < dEtaMin)
445 fabstoec 1.39 if( minDR < dRMin && match ) {
446     if ( numLegs ) (*numLegs) = match->NDaughters();
447     if ( convIdx ) (*convIdx) = matchIdx;
448     if(print)
449     std::cout<<" best conversion is chosen"<<std::endl;
450 fabstoec 1.7 return match;
451 fabstoec 1.39 } else {
452     if(print)
453     std::cout<<" NO conversion is chosen"<<std::endl;
454 fabstoec 1.7 return NULL;
455 fabstoec 1.39 }
456 fabstoec 1.5 }
457    
458 fabstoec 1.9 bool PhotonTools::PassCiCSelection(const Photon* ph, const Vertex* vtx,
459     const TrackCol* trackCol,
460     const ElectronCol* eleCol,
461     const VertexCol* vtxCol,
462 fabstoec 1.5 double rho, double ptmin,
463 fabstoec 1.9 bool applyEleVeto,
464 fabstoec 1.5 bool print, float* kin) {
465 fabstoec 1.9
466 fabstoec 1.5
467     // these values are taken from the H2GGlobe code... (actually from Marco/s mail)
468     float cic4_allcuts_temp_sublead[] = {
469     3.8, 2.2, 1.77, 1.29,
470     11.7, 3.4, 3.9, 1.84,
471     3.5, 2.2, 2.3, 1.45,
472     0.0106, 0.0097, 0.028, 0.027,
473     0.082, 0.062, 0.065, 0.048,
474     0.94, 0.36, 0.94, 0.32,
475     1., 0.062, 0.97, 0.97,
476     1.5, 1.5, 1.5, 1.5 }; // the last line is PixelmatchVeto and un-used
477    
478     // cut on Et instead of Pt???
479     Bool_t isbarrel = ph->SCluster()->AbsEta()<1.5;
480    
481     // compute all relevant observables first
482     double ecalIso3 = ph->EcalRecHitIsoDr03();
483     double ecalIso4 = ph->EcalRecHitIsoDr04();
484     double hcalIso4 = ph->HcalTowerSumEtDr04();
485    
486     unsigned int wVtxInd = 0;
487    
488     double trackIso1 = IsolationTools::CiCTrackIsolation(ph, vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol);
489    
490     // track iso only
491     double trackIso3 = IsolationTools::CiCTrackIsolation(ph, vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol);
492    
493     // track iso worst vtx
494     double trackIso2 = IsolationTools::CiCTrackIsolation(ph, vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd, vtxCol);
495    
496     double combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*rho;
497     double combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*rho;
498    
499     double tIso1 = (combIso1) *50./ph->Et();
500     double tIso2 = (combIso2) *50./(ph->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
501     //double tIso2 = (combIso2) *50./ph->Et();
502     double tIso3 = (trackIso3)*50./ph->Et();
503    
504     double covIEtaIEta =ph->CoviEtaiEta();
505     double HoE = ph->HadOverEm();
506    
507     double R9 = ph->R9();
508    
509     double dRTrack = PhotonTools::ElectronVetoCiC(ph, eleCol);
510    
511     // check which category it is ...
512     int _tCat = 1;
513     if ( !isbarrel ) _tCat = 3;
514     if ( R9 < 0.94 ) _tCat++;
515    
516     if(print) {
517     std::cout<<" -------------------------- "<<std::endl;
518 fabstoec 1.15
519     std::cout<<" trackIso1 = "<<trackIso1<<std::endl;
520     std::cout<<" trackIso2 = "<<trackIso2<<std::endl;
521     std::cout<<" trackIso3 = "<<trackIso3<<std::endl;
522     std::cout<<" ecalIso3 = "<<ecalIso3<<std::endl;
523     std::cout<<" ecalIso4 = "<<ecalIso4<<std::endl;
524     std::cout<<" hcalIso4 = "<<hcalIso4<<std::endl;
525    
526 fabstoec 1.5 std::cout<<" photon Et = "<<ph->Et()<<std::endl;
527 fabstoec 1.30 std::cout<<" Eta = "<<ph->SCluster()->Eta()<<std::endl;
528 fabstoec 1.15 std::cout<<" HoE = "<<HoE<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+4*4]<<")"<<std::endl;
529     std::cout<<" R9 = "<<R9<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+5*4]<<")"<<std::endl;
530     std::cout<<" dR = "<<dRTrack<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+6*4]<<")"<<std::endl;
531     std::cout<<" iso1 = "<<tIso1<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+0*4]<<")"<<std::endl;
532     std::cout<<" iso2 = "<<tIso2<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+1*4]<<")"<<std::endl;
533     std::cout<<" iso3 = "<<tIso3<<" ("<<cic4_allcuts_temp_sublead[_tCat-1+2*4]<<")"<<std::endl;
534 fabstoec 1.5 }
535    
536     if(kin) {
537     kin[0] = tIso1;
538     kin[1] = tIso2;
539     kin[2] = tIso3;
540     kin[3] = covIEtaIEta;
541     kin[4] = HoE;
542     kin[5] = R9;
543     kin[6] = dRTrack;
544     kin[7] = (float) ph->Pt();
545     kin[8] = (float) ph->Eta();
546     kin[9] = (float) ph->Phi();
547    
548     // iso quantities separate
549     kin[10] = ecalIso3;
550     kin[11] = ecalIso4;
551     kin[12] = hcalIso4;
552     kin[13] = trackIso1;
553     kin[14] = trackIso2;
554     kin[15] = trackIso3;
555    
556     kin[16] = (float) ph->Et();
557     kin[17] = (float) ph->E();
558    
559 bendavid 1.11 kin[18] = (float) ph->SCluster()->Eta();
560     kin[19] = (float) ph->SCluster()->Phi();
561 fabstoec 1.5 }
562    
563     float passCuts = 1.;
564    
565     if ( ph->Pt() <= ptmin ) passCuts = -1.;
566    
567     // not needed anymore, do in pre-selection...
568     //if ( ph->SCluster()->AbsEta()>=2.5 || (ph->SCluster()->AbsEta()>=1.4442 && ph->SCluster()->AbsEta()<=1.566)) passCuts = -1.;
569    
570     if( ! ( tIso1 < cic4_allcuts_temp_sublead[_tCat-1+0*4]
571     && tIso2 < cic4_allcuts_temp_sublead[_tCat-1+1*4]
572     && tIso3 < cic4_allcuts_temp_sublead[_tCat-1+2*4]
573     && covIEtaIEta < cic4_allcuts_temp_sublead[_tCat-1+3*4]
574     && HoE < cic4_allcuts_temp_sublead[_tCat-1+4*4]
575     && R9 > cic4_allcuts_temp_sublead[_tCat-1+5*4]
576 fabstoec 1.9 && ( dRTrack > cic4_allcuts_temp_sublead[_tCat-1+6*4] || !applyEleVeto ) ) ) passCuts = -1.;
577 fabstoec 1.5
578 fabstoec 1.15 if(print) std::cout<<" ---> "<<passCuts<<std::endl;
579    
580 fabstoec 1.5 if(kin) {
581 bendavid 1.11 kin[20] = passCuts;
582     kin[21] = (float) _tCat;
583 fabstoec 1.5 }
584    
585     if(passCuts > 0.) return true;
586     return false;
587     }
588 bendavid 1.11
589 bendavid 1.27 bool PhotonTools::PassCiCPFIsoSelection(const Photon* ph,
590 fabstoec 1.30 const Vertex* vtx,
591     const PFCandidateCol* pfCol,
592     const VertexCol* vtxCol,
593     double rho, double ptmin,
594     std::vector<double>* kin // store variables for debugging...
595     ) {
596 bendavid 1.27
597     // these values are taken from the H2GGlobe code... (actually from Marco/s mail)
598     float cic4_allcuts_temp_sublead[] = {
599     6.0, 4.7, 5.6, 3.6,
600     10.0, 6.5, 5.6, 4.4,
601     3.8, 2.5, 3.1, 2.2,
602     0.0108, 0.0102, 0.028, 0.028,
603     0.124, 0.092, 0.142, 0.063,
604 fabstoec 1.30 0.94, 0.28, 0.94, 0.24 };
605 bendavid 1.27
606     // cut on Et instead of Pt???
607     Bool_t isbarrel = ph->SCluster()->AbsEta()<1.5;
608 fabstoec 1.39
609 bendavid 1.27
610     // compute all relevant observables first
611     double ecalIso3 = IsolationTools::PFGammaIsolation(ph, 0.3, 0.0, pfCol);
612     double ecalIso4 = IsolationTools::PFGammaIsolation(ph, 0.4, 0.0, pfCol);
613    
614     unsigned int wVtxInd = 0;
615    
616     double trackIsoSel03 = IsolationTools::PFChargedIsolation(ph, vtx, 0.3, 0.0, pfCol);
617    
618     // track iso worst vtx
619     double trackIsoWorst04 = IsolationTools::PFChargedIsolation(ph, vtx, 0.4, 0.00, pfCol, &wVtxInd, vtxCol);
620    
621 fabstoec 1.30 double combIso1 = ecalIso3+trackIsoSel03 + 2.5 - 0.09*rho;
622     double combIso2 = ecalIso4+trackIsoWorst04 + 2.5 - 0.23*rho;
623 bendavid 1.27
624     double tIso1 = (combIso1) *50./ph->Et();
625     double tIso2 = (combIso2) *50./(ph->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
626     //double tIso2 = (combIso2) *50./ph->Et();
627     double tIso3 = (trackIsoSel03)*50./ph->Et();
628    
629     double covIEtaIEta =ph->CoviEtaiEta();
630     double HoE = ph->HadOverEm();
631    
632     double R9 = ph->R9();
633    
634     // check which category it is ...
635     int _tCat = 1;
636     if ( !isbarrel ) _tCat = 3;
637     if ( R9 < 0.94 ) _tCat++;
638    
639     float passCuts = 1.;
640    
641 fabstoec 1.30 if( kin ) {
642     kin->resize(0);
643    
644     kin->push_back(tIso1);
645     kin->push_back(tIso2);
646     kin->push_back(tIso3);
647     kin->push_back(covIEtaIEta);
648     kin->push_back(HoE);
649     kin->push_back(R9);
650    
651     kin->push_back( (double) wVtxInd );
652     kin->push_back( ecalIso3 );
653     kin->push_back( ecalIso4 );
654    
655     kin->push_back( trackIsoSel03 );
656     kin->push_back( trackIsoWorst04 );
657    
658     kin->push_back( combIso1 );
659     kin->push_back( combIso2 );
660     }
661    
662    
663 bendavid 1.27 if ( ph->Pt() <= ptmin ) passCuts = -1.;
664    
665     // not needed anymore, do in pre-selection...
666     //if ( ph->SCluster()->AbsEta()>=2.5 || (ph->SCluster()->AbsEta()>=1.4442 && ph->SCluster()->AbsEta()<=1.566)) passCuts = -1.;
667    
668     if( ! ( tIso1 < cic4_allcuts_temp_sublead[_tCat-1+0*4]
669     && tIso2 < cic4_allcuts_temp_sublead[_tCat-1+1*4]
670     && tIso3 < cic4_allcuts_temp_sublead[_tCat-1+2*4]
671     && covIEtaIEta < cic4_allcuts_temp_sublead[_tCat-1+3*4]
672     && HoE < cic4_allcuts_temp_sublead[_tCat-1+4*4]
673     && R9 > cic4_allcuts_temp_sublead[_tCat-1+5*4] ) ) passCuts = -1.;
674    
675    
676     if(passCuts > 0.) return true;
677     return false;
678     }
679    
680    
681    
682    
683    
684 bendavid 1.13 const MCParticle *PhotonTools::MatchMC(const Particle *ph, const MCParticleCol *c, Bool_t matchElectrons) {
685    
686     // printf("Start loop\n");
687 bendavid 1.11 for (UInt_t i=0; i<c->GetEntries(); ++i) {
688     const MCParticle *p = c->At(i);
689 bendavid 1.13 // if (p->IsGenerated() && p->AbsPdgId()==11 && (p->DistinctMother()->AbsPdgId()==23|| p->DistinctMother()->AbsPdgId()==24)) {
690     // printf("pdgid = %i, status = %i, pt = %5f, mother pdgid = %i\n",p->PdgId(),p->Status(),p->Pt(),p->Mother()->PdgId());
691 bendavid 1.12 // }
692     if (matchElectrons && p->AbsPdgId()==11 && p->IsGenerated() && p->Status()==3 && MathUtils::DeltaR(*ph,*p) < 0.3 && p->Mother() && (p->Mother()->AbsPdgId()==23 || p->Mother()->AbsPdgId()==24 || p->Mother()->AbsPdgId()==22)) {
693     return p;
694     }
695 bendavid 1.11 if ( p->AbsPdgId()==22 && p->IsGenerated() && MathUtils::DeltaR(*ph,*p) < 0.3 && p->Mother() && (p->Mother()->AbsPdgId()==25 || p->Mother()->AbsPdgId()<=21) ) {
696     return p;
697     }
698     }
699     return 0;
700 bendavid 1.12 }
701    
702     PhotonTools::DiphotonR9EtaPtCats PhotonTools::DiphotonR9EtaPtCat(const Photon *p1, const Photon *p2) {
703    
704     PhotonTools::CiCBaseLineCats cat1 = CiCBaseLineCat(p1);
705     PhotonTools::CiCBaseLineCats cat2 = CiCBaseLineCat(p2);
706    
707     PhotonTools::DiphotonR9EtaPtCats evtcat = PhotonTools::kOctCat0;
708    
709     bool ph1IsEB = (cat1 == PhotonTools::kCiCCat1 || cat1 == PhotonTools::kCiCCat2);
710     bool ph2IsEB = (cat2 == PhotonTools::kCiCCat1 || cat2 == PhotonTools::kCiCCat2);
711    
712     bool ph1IsHR9 = (cat1 == PhotonTools::kCiCCat1 || cat1 == PhotonTools::kCiCCat3);
713     bool ph2IsHR9 = (cat2 == PhotonTools::kCiCCat1 || cat2 == PhotonTools::kCiCCat3);
714    
715     if( ph1IsEB && ph2IsEB )
716     evtcat = ( ph1IsHR9 && ph2IsHR9 ? PhotonTools::kOctCat0 : PhotonTools::kOctCat1);
717     else
718     evtcat = ( ph1IsHR9 && ph2IsHR9 ? PhotonTools::kOctCat2 : PhotonTools::kOctCat3);
719    
720     float ptgg = (p1->Mom()+p2->Mom()).Pt();
721     if (ptgg<40.0) evtcat = PhotonTools::DiphotonR9EtaPtCats(evtcat + 4);
722    
723    
724     return evtcat;
725 fabstoec 1.15 }
726 mingyang 1.17
727 bendavid 1.22 Bool_t PhotonTools::PassSinglePhotonPresel(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, Bool_t applyElectronVeto, Bool_t invertElectronVeto) {
728 mingyang 1.17 float ScEta=p->SCluster()->Eta();
729     float Et=p->Et();
730     float R9=p->R9();
731     float HoE=p->HadOverEm();
732     float CovIEtaIEta=p->CoviEtaiEta();
733     float EcalIsoDr03=p->EcalRecHitIsoDr03();
734     float HcalIsoDr03=p->HcalTowerSumEtDr03();
735     float TrkIsoHollowDr03=p->HollowConeTrkIsoDr03();
736     float NewEcalIso=EcalIsoDr03-0.012*Et;
737     float NewHcalIso=HcalIsoDr03-0.005*Et;
738     float NewTrkIsoHollowDr03=TrkIsoHollowDr03-0.002*Et;
739     Bool_t IsBarrel=kFALSE;
740     Bool_t IsEndcap=kFALSE;
741 bendavid 1.22 Bool_t PassEleVetoRaw = PhotonTools::PassElectronVetoConvRecovery(p, els, conversions, bs);
742 bendavid 1.20 Bool_t PassEleVeto = (!applyElectronVeto && !invertElectronVeto) || (applyElectronVeto && !invertElectronVeto && PassEleVetoRaw) || (!applyElectronVeto && invertElectronVeto && !PassEleVetoRaw);
743 bendavid 1.22 float AbsTrackIsoCIC=IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0,trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );
744 mingyang 1.18 float HcalEcalPUCorr=EcalIsoDr03+HcalIsoDr03-0.17*rho;
745    
746 mingyang 1.17 if(fabs(ScEta)<1.4442){IsBarrel=kTRUE;}
747     if(fabs(ScEta)>1.566 && fabs(ScEta)<2.5){IsEndcap=kTRUE;}
748     if((!IsBarrel) && (!IsEndcap)){
749     return kFALSE;
750     }
751     if(!PassEleVeto){
752     return kFALSE;
753     }
754     if(R9<=0.9){
755 bendavid 1.21 if(HoE<0.075 && ((IsBarrel && CovIEtaIEta<0.014) || (IsEndcap && CovIEtaIEta<0.034)) && NewEcalIso<4 && NewHcalIso<4 && NewTrkIsoHollowDr03<4 && HcalEcalPUCorr<3 && AbsTrackIsoCIC<2.8 && TrkIsoHollowDr03<4.0) {
756 mingyang 1.17 return kTRUE;
757     }
758     }
759     if(R9>0.9){
760 bendavid 1.21 if(((IsBarrel && HoE<0.082 && CovIEtaIEta<0.014) || (IsEndcap && HoE <0.075 && CovIEtaIEta<0.034)) && NewEcalIso<50 && NewHcalIso<50 && NewTrkIsoHollowDr03<50 && HcalEcalPUCorr<3 && AbsTrackIsoCIC<2.8 && TrkIsoHollowDr03<4.0) {
761 mingyang 1.17 return kTRUE;
762     }
763     }
764     return kFALSE;
765     }
766 mingyang 1.26
767 fabstoec 1.36
768     Bool_t PhotonTools::PassSinglePhotonPreselPFISO_NoTrigger(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto, Bool_t invertElectronVeto) {
769    
770     float ScEta=p->SCluster()->Eta();
771     float Et=p->Et();
772     float R9=p->R9();
773     float HoE=p->HadOverEm();
774     float CovIEtaIEta=p->CoviEtaiEta();
775     float EcalIsoDr03=p->EcalRecHitIsoDr03();
776     float HcalIsoDr03=p->HcalTowerSumEtDr03();
777     float TrkIsoHollowDr03=p->HollowConeTrkIsoDr03();
778    
779     float NewEcalIso=EcalIsoDr03-0.012*Et;
780     float NewHcalIso=HcalIsoDr03-0.005*Et;
781     float NewTrkIsoHollowDr03=TrkIsoHollowDr03-0.002*Et;
782    
783    
784     Bool_t IsBarrel=kFALSE;
785     Bool_t IsEndcap=kFALSE;
786     Bool_t PassEleVetoRaw = PhotonTools::PassElectronVetoConvRecovery(p, els, conversions, bs);
787     Bool_t PassEleVeto = (!applyElectronVeto && !invertElectronVeto) || (applyElectronVeto && !invertElectronVeto && PassEleVetoRaw) || (!applyElectronVeto && invertElectronVeto && !PassEleVetoRaw);
788     float ChargedIso_selvtx_DR002To0p02=IsolationTools::PFChargedIsolation(p,vtx, 0.2, 0.,fPFCands);
789     if(fabs(ScEta)<1.4442){IsBarrel=kTRUE;}
790     if(fabs(ScEta)>1.566 && fabs(ScEta)<2.5){IsEndcap=kTRUE;}
791     if((!IsBarrel) && (!IsEndcap)){
792     return kFALSE;
793     }
794     if(!PassEleVeto){
795     return kFALSE;
796     }
797     if( ((IsBarrel && CovIEtaIEta<0.02) || (IsEndcap && CovIEtaIEta<0.06)) && ChargedIso_selvtx_DR002To0p02<4) {
798     return kTRUE;
799     }
800    
801     return kFALSE;
802     }
803    
804    
805    
806 mingyang 1.26 Bool_t PhotonTools::PassSinglePhotonPreselPFISO(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto, Bool_t invertElectronVeto) {
807 fabstoec 1.34
808    
809 mingyang 1.26 float ScEta=p->SCluster()->Eta();
810     float Et=p->Et();
811     float R9=p->R9();
812     float HoE=p->HadOverEm();
813     float CovIEtaIEta=p->CoviEtaiEta();
814     float EcalIsoDr03=p->EcalRecHitIsoDr03();
815     float HcalIsoDr03=p->HcalTowerSumEtDr03();
816     float TrkIsoHollowDr03=p->HollowConeTrkIsoDr03();
817 fabstoec 1.34
818 mingyang 1.26 float NewEcalIso=EcalIsoDr03-0.012*Et;
819     float NewHcalIso=HcalIsoDr03-0.005*Et;
820     float NewTrkIsoHollowDr03=TrkIsoHollowDr03-0.002*Et;
821 fabstoec 1.34
822    
823 mingyang 1.26 Bool_t IsBarrel=kFALSE;
824     Bool_t IsEndcap=kFALSE;
825     Bool_t PassEleVetoRaw = PhotonTools::PassElectronVetoConvRecovery(p, els, conversions, bs);
826     Bool_t PassEleVeto = (!applyElectronVeto && !invertElectronVeto) || (applyElectronVeto && !invertElectronVeto && PassEleVetoRaw) || (!applyElectronVeto && invertElectronVeto && !PassEleVetoRaw);
827 bendavid 1.27 float ChargedIso_selvtx_DR002To0p02=IsolationTools::PFChargedIsolation(p,vtx, 0.2, 0.,fPFCands);
828 mingyang 1.26 if(fabs(ScEta)<1.4442){IsBarrel=kTRUE;}
829     if(fabs(ScEta)>1.566 && fabs(ScEta)<2.5){IsEndcap=kTRUE;}
830     if((!IsBarrel) && (!IsEndcap)){
831     return kFALSE;
832     }
833     if(!PassEleVeto){
834     return kFALSE;
835     }
836     if(R9<=0.9){
837     if(HoE<0.075 && ((IsBarrel && CovIEtaIEta<0.014) || (IsEndcap && CovIEtaIEta<0.034)) && NewEcalIso<4 && NewHcalIso<4 && NewTrkIsoHollowDr03<4 && ChargedIso_selvtx_DR002To0p02<4) {
838     return kTRUE;
839     }
840     }
841     if(R9>0.9){
842     if(((IsBarrel && HoE<0.082 && CovIEtaIEta<0.014) || (IsEndcap && HoE <0.075 && CovIEtaIEta<0.034)) && NewEcalIso<50 && NewHcalIso<50 && NewTrkIsoHollowDr03<50 && ChargedIso_selvtx_DR002To0p02<4) {
843     return kTRUE;
844     }
845     }
846     return kFALSE;
847     }
848 fabstoec 1.32
849 fabstoec 1.34 bool PhotonTools::PassVgamma2011Selection(const Photon* ph, double rho) {
850    
851     bool isEB = (ph->SCluster()->AbsEta()<1.5);
852    
853     if (ph->HasPixelSeed()) return false; // ? is this what we want ?
854     if (ph->HadOverEm() > 0.05) return false;
855     if (ph->CoviEtaiEta() > (isEB ? 0.011 : 0.03) ) return false;
856     if (ph->HollowConeTrkIsoDr04() > ( 2.0 + 0.001 *ph->Pt() +
857     (isEB ? 0.0167 : 0.032)*rho )) return false;
858     if (ph->EcalRecHitIsoDr04() > ( 4.2 + 0.006 *ph->Pt() +
859     (isEB ? 0.183 : 0.090)*rho )) return false;
860     if (ph->HcalTowerSumEtDr04() > ( 2.2 + 0.0025*ph->Pt() +
861     (isEB ? 0.062 : 0.180)*rho )) return false;
862    
863     // spike cleaning...
864 fabstoec 1.35 if ( ph->CoviEtaiEta() < 0.001 && TMath::Sqrt(TMath::Abs(ph->SCluster()->Seed()->CoviPhiiPhi())) < 0.001)
865     return false;
866 fabstoec 1.34
867     return true;
868     }
869 fabstoec 1.32
870     void PhotonTools::ScalePhotonShowerShapes(Photon* p, PhotonTools::ShowerShapeScales scale) {
871    
872     switch(scale) {
873    
874     case kNoShowerShapeScaling:
875     break;
876    
877     case k2011ShowerShape:
878     //regression sigmaE
879     if (p->SCluster()->AbsEta()<1.5)
880     PhotonTools::ScalePhotonError(p,1.07);
881     else
882     PhotonTools::ScalePhotonError(p,1.045);
883    
884     //R9
885     if (p->SCluster()->AbsEta()<1.5) p->SetR9(1.0035*p->R9());
886     else p->SetR9(1.0035*p->R9());
887     //CoviEtaiEta(SigiEtaiEta)
888     if (p->SCluster()->AbsEta()<1.5) p->SetCoviEtaiEta(0.87*p->CoviEtaiEta()+0.0011);
889     else p->SetCoviEtaiEta(0.99*p->CoviEtaiEta());
890     //EtaWidth
891     if (p->SCluster()->AbsEta()<1.5) p->SetEtaWidth(0.99*p->EtaWidth());
892     else p->SetEtaWidth(0.99*p->EtaWidth());
893     //PhiWidth
894     if (p->SCluster()->AbsEta()<1.5) p->SetPhiWidth(0.99*p->PhiWidth());
895     else p->SetPhiWidth(0.99*p->PhiWidth());
896     break;
897    
898 bendavid 1.33 case k2012ShowerShape:
899 fabstoec 1.32 //R9
900     if (p->SCluster()->AbsEta()<1.5) p->SetR9(1.0045*p->R9()+0.001);
901     else p->SetR9(1.0086*p->R9()-0.0007);
902     //CoviEtaiEta(SigiEtaiEta)
903     if (p->SCluster()->AbsEta()<1.5) p->SetCoviEtaiEta(0.891832*p->CoviEtaiEta()+0.0009133);
904     else p->SetCoviEtaiEta(0.9947*p->CoviEtaiEta()+0.00003);
905     //EtaWidth
906     if (p->SCluster()->AbsEta()<1.5) p->SetEtaWidth(1.04302*p->EtaWidth()- 0.000618);
907     else p->SetEtaWidth(0.903254*p->EtaWidth()+ 0.001346);
908     //PhiWidth
909     if (p->SCluster()->AbsEta()<1.5) p->SetPhiWidth(1.00002*p->PhiWidth()- 0.000371);
910     else p->SetPhiWidth(0.99992*p->PhiWidth()+ 4.8e-07);
911     //s4Ratio
912     if (p->SCluster()->AbsEta()<1.5) p->SetS4Ratio(1.01894*p->S4Ratio()-0.01034);
913     else p->SetS4Ratio(1.04969*p->S4Ratio()-0.03642);
914     break;
915     default:
916     break;
917    
918     }
919     return;
920     }
921