AliPhysics  695988a (695988a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskBackFlucRandomCone.cxx
Go to the documentation of this file.
1 #include <TH1F.h>
2 #include <TH2F.h>
3 #include <TRandom3.h>
4 #include <TMath.h>
5 
6 #include "AliParticleContainer.h"
8 #include "AliRhoParameter.h"
9 
11 
12 //________________________________________________________________________________________________
14 fEtaMin(-0.5),
15 fEtaMax(0.5),
16 fEta(0),
17 fPhi(0),
18 fRCone(0.3),
19 fRnd(0),
20 fRhoName(""),
21 fhEtaPhiConeCentre(0),
22 fNInOut(0),
23 fhMasspTInCone(0),
24 fhNConstituents(0),
25 fhDeltapT(0)
26 {
28  SetMakeGeneralHistograms(kTRUE);
29 }
30 
31 //________________________________________________________________________________________________
33 fEtaMin(-0.5),
34 fEtaMax(0.5),
35 fEta(0),
36 fPhi(0),
37 fRCone(0.3),
38 fRnd(0),
39 fRhoName(""),
40 fhEtaPhiConeCentre(0),
41 fNInOut(0),
42 fhMasspTInCone(0),
43 fhNConstituents(0),
44 fhDeltapT(0)
45 
46 {
49 }
50 //________________________________________________________________________________________________
51 
55 
56  //init TRandom
57  fRnd = TRandom3();
58 
59  Int_t nBinsM = 100;
60  Double_t minM = 0, maxM = 20;
61  Int_t nBinspT = 120;
62  Double_t minpT = 0, maxpT = 119;
63 
64  fhEtaPhiConeCentre = new TH2F("fhEtaPhiConeCentre", "Cone centre; #eta ; #varphi", 50, fEtaMin, fEtaMax, 50, 0., TMath::TwoPi());
66 
67  fNInOut = new TH1F("fNInOut", "In = 1 out = 2 of cone", 2, 0.5, 2.5);
68  fOutput->Add(fNInOut);
69 
70  fhMasspTInCone = new TH2F("fhMasspTInCone", "In Cone mass and pT distribution; M ; #it{p}_{T};", nBinsM, minM, maxM, nBinspT, minpT, maxpT);
71  fOutput->Add(fhMasspTInCone);
72 
73  fhNConstituents = new TH1F("fhNConstituents", "Constituents of the random cone jet; #it{N}_{constituents}", 21, 0., 20.);
75 
76  fhDeltapT = new TH1F("fhDeltapT", "#Delta #it{p}_{T}; #it{p}_{T} - A#rho", nBinspT, minpT-20, maxpT-20);
77  fOutput->Add(fhDeltapT);
78 
79 }
80 //________________________________________________________________________________________________
83 
84  fPhi = fRnd.Uniform(0, TMath::TwoPi());
85  fEta = fRnd.Uniform(fEtaMin,fEtaMax);
86 
87  return kTRUE;
88 }
89 //________________________________________________________________________________________________
92 
94 
95  //loop on tracks in the event
97  Double_t pTinCone = 0, massinCone = 0, mass = 139.57;
98  Int_t Nconst = 0;
99  for(Int_t itr=0; itr < trackCont->GetNAcceptedParticles(); itr++){
100  AliVParticle *part = trackCont->GetParticle(itr);
101  if ((TMath::Abs(part->Eta() - fEta) > fRCone) || (TMath::Abs(part->Phi() - fPhi) > fRCone)) {
102  fNInOut->Fill(2);
103  continue;
104  }
105  Nconst++;
106  fNInOut->Fill(1);
107  Double_t ptpart = part->Pt();
108  pTinCone += ptpart;
109  //massinCone += (mass*mass + ptpart*ptpart );
110 
111  }
112 
113  fhMasspTInCone->Fill(0.,pTinCone);
114  fhNConstituents->Fill(Nconst);
115  Double_t rhovalue = 0;
117  if(rhopar) rhovalue = rhopar->GetVal();
118  fhDeltapT->Fill(pTinCone - TMath::Pi()*fRCone*fRCone*rhovalue);
119 
120  return kTRUE;
121 }
122 
123 
124 //________________________________________________________________________________________________
125 
128 }
129 
130 //________________________________________________________________________________________________
131 
133 {
135 }
TH2F * fhMasspTInCone
!<! Count track in and out of cone per event
TH1F * fhNConstituents
!<! Mass and pT of particles in the cone
Double_t mass
TH1F * fhDeltapT
!<! Number of constituents in random cone
ClassImp(AliAnalysisTaskBackFlucRandomCone) AliAnalysisTaskBackFlucRandomCone
Container for particles within the EMCAL framework.
TString fRhoName
Name of rho run previously in the event.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
AliRhoParameter * GetRhoFromEvent(const char *name)
Double_t fPhi
!<! Eta coordinate of the cone centre
virtual AliVParticle * GetParticle(Int_t i=-1) const
Study background fluctuations with random cones.
Double_t fRCone
!<! Phi coordinate of the cone centre
Double_t fEtaMax
Maximum eta limit (consider the R!), default 0.5.
AliEmcalList * fOutput
!output list
Double_t fEtaMin
Minimum eta limit (consider the R!), default -0.5.
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Int_t GetNAcceptedParticles() const