5 #define AliJetShape_CXX
6 #include "AliJetShape.h"
9 Double32_t AliJetShapeGRNum::result(const fastjet::PseudoJet &jet) const {
11 #ifdef FASTJET_VERSION
12 if (!jet.has_constituents())
13 throw Error("Angular structure can only be applied on jets for which the constituents are known.");
16 vector<PseudoJet> constits = jet.constituents();
17 for (vector<PseudoJet>::iterator ci = constits.begin(); ci!=constits.end(); ci++){
18 for (vector<PseudoJet>::iterator cj = ci+1; cj!=constits.end(); cj++){
19 Double_t dphi = ci.phi()-cj.phi();
20 if(dphi<0.) dphi+=TMath::TwoPi();
21 if(dphi>TMath::TwoPi()) dphi-=TMath::TwoPi();
22 Double_t dr2 = (ci.eta()-cj.eta())*(ci.eta()-cj.eta()) + dphi*dphi;
24 Double_t dr = TMath::Sqrt(dr2);
27 Double_t noise = TMath::Exp(-x*x/(2*fDRStep*fDRStep))/(TMath::Sqrt(2.*TMath::Pi())*fDRStep);
29 // Double_t erf = 0.5*(1.+TMath::Erf(x/(TMath::Sqrt(2.)*fDRStep)));
30 A += ci.perp()*cj.perp()*dr2*noise;
40 Double32_t AliJetShapeGRDen::result(const fastjet::PseudoJet &jet) const {
42 #ifdef FASTJET_VERSION
43 if (!jet.has_constituents())
44 throw Error("Angular structure can only be applied on jets for which the constituents are known.");
47 vector<PseudoJet> constits = jet.constituents();
48 for (vector<PseudoJet>::iterator ci = constits.begin(); ci!=constits.end(); ci++){
49 for (vector<PseudoJet>::iterator cj = ci+1; cj!=constits.end(); cj++){
50 Double_t dphi = ci.phi()-cj.phi();
51 if(dphi<0.) dphi+=TMath::TwoPi();
52 if(dphi>TMath::TwoPi()) dphi-=TMath::TwoPi();
53 Double_t dr2 = (ci.eta()-cj.eta())*(ci.eta()-cj.eta()) + dphi*dphi;
55 Double_t dr = TMath::Sqrt(dr2);
58 Double_t erf = 0.5*(1.+TMath::Erf(x/(TMath::Sqrt(2.)*fDRStep)));
59 A += ci.perp()*cj.perp()*dr2*erf;