AliPhysics  8195daa (8195daa)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskRecoilJetYield.cxx
Go to the documentation of this file.
1 //
2 // My analysis task
3 //
4 // Author: Harry Andrews
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <TCanvas.h>
11 #include <THnSparse.h>
12 #include <TTree.h>
13 #include <TList.h>
14 #include <TLorentzVector.h>
15 #include <TProfile.h>
16 #include <TChain.h>
17 #include <TSystem.h>
18 #include <TFile.h>
19 #include <TKey.h>
20 #include <AliAnalysisDataSlot.h>
21 #include <AliAnalysisDataContainer.h>
22 #include "TMatrixD.h"
23 #include "TMatrixDSym.h"
24 #include "TMatrixDSymEigen.h"
25 #include "TVector3.h"
26 #include "TVector2.h"
27 #include "AliVCluster.h"
28 #include "AliVTrack.h"
29 #include "AliEmcalJet.h"
30 #include "AliRhoParameter.h"
31 #include "AliLog.h"
32 #include "AliEmcalParticle.h"
33 #include "AliMCEvent.h"
34 #include "AliGenPythiaEventHeader.h"
35 #include "AliAODMCHeader.h"
36 #include "AliMCEvent.h"
37 #include "AliAnalysisManager.h"
38 #include "AliJetContainer.h"
39 #include "AliParticleContainer.h"
40 //#include "AliPythiaInfo.h"
41 #include "TRandom3.h"
42 #include "AliPicoTrack.h"
43 #include "AliEmcalJetFinder.h"
44 #include "AliAODEvent.h"
46 #include "AliMultSelection.h"
47 
48 //Globals
49 
50 
51 
55 Double_t Phi_Upper=2*(TMath::Pi());
56 Double_t Phi_Lower=(-1*(TMath::Pi()));
59 
60 
61 
62 
63 using std::cout;
64 using std::endl;
65 
67 
68 //________________________________________________________________________
71  fContainer(0),
72  fMinFractionShared(0),
73  fJetShapeType(kData),
74  fJetShapeSub(kNoSub),
75  fJetSelection(kInclusive),
76  fPtThreshold(-9999.),
77  fRMatching(0.2),
78  fPtMinTriggerHadron(20.),
79  fPtMaxTriggerHadron(50.),
80  fRecoilAngularWindow(0.6),
81  fSemigoodCorrect(0),
82  fHolePos(0),
83  fHoleWidth(0),
84  fCentSelectOn(kTRUE),
85  fCentMin(0),
86  fCentMax(10),
87  fSubJetAlgorithm(0),
88  fSubJetRadius(0.1),
89  fSubJetMinPt(1),
90  fJetRadius(0.4),
91  fRMatched(0.2),
92  fSharedFractionPtMin(0.5),
93  fDerivSubtrOrder(0),
94  fFullTree(kFALSE),
95  fBeta_SD(0),
96  fZCut(0.1),
97  fNsubMeasure(kFALSE),
98  fDoSoftDrop(kFALSE),
99  fhJetPt(0x0),
100  fhJetPhi(0x0),
101  fhJetEta(0x0),
102  fhJetMass(0x0),
103  fhJetRadius(0x0),
104  fhJetCounter(0x0),
105  fhNumberOfJetTracks(0x0),
106  fTreeJetInfo(0),
107  fhJetArea(0x0),
108  fhTrackPt(0x0),
109  fhPtTriggerHadron(0x0),
110  fh2PtTriggerHadronJet(0x0),
111  fhPhiTriggerHadronJet(0x0),
112  fhPhiTriggerHadronEventPlane(0x0),
113  fhPhiTriggerHadronEventPlaneTPC(0x0)
114 
115 {
116  for(Int_t i=0;i<nBranch;i++){
117  fJetInfoVar[i]=0;
118  }
119  SetMakeGeneralHistograms(kTRUE);
120  DefineOutput(1, TList::Class());
121  DefineOutput(2, TTree::Class());
122 }
123 
124 //________________________________________________________________________
126  AliAnalysisTaskEmcalJet(name, kTRUE),
127  fContainer(0),
128  fMinFractionShared(0),
129  fJetShapeType(kData),
130  fJetShapeSub(kNoSub),
131  fJetSelection(kInclusive),
132  fPtThreshold(-9999.),
133  fRMatching(0.2),
134  fPtMinTriggerHadron(20.),
135  fPtMaxTriggerHadron(50.),
136  fRecoilAngularWindow(0.6),
137  fSemigoodCorrect(0),
138  fHolePos(0),
139  fHoleWidth(0),
140  fCentSelectOn(kTRUE),
141  fCentMin(0),
142  fCentMax(10),
143  fSubJetAlgorithm(0),
144  fSubJetRadius(0.1),
145  fSubJetMinPt(1),
146  fJetRadius(0.4),
147  fRMatched(0.2),
148  fSharedFractionPtMin(0.5),
149  fDerivSubtrOrder(0),
150  fFullTree(kFALSE),
151  fBeta_SD(0),
152  fZCut(0.1),
153  fNsubMeasure(kFALSE),
154  fDoSoftDrop(kFALSE),
155  fhJetPt(0x0),
156  fhJetPhi(0x0),
157  fhJetEta(0x0),
158  fhJetMass(0x0),
159  fhJetRadius(0x0),
160  fhJetCounter(0x0),
161  fhNumberOfJetTracks(0x0),
162  fTreeJetInfo(0),
163  fhJetArea(0x0),
164  fhTrackPt(0x0),
165  fhPtTriggerHadron(0x0),
166  fh2PtTriggerHadronJet(0x0),
167  fhPhiTriggerHadronJet(0x0),
168  fhPhiTriggerHadronEventPlane(0x0),
169  fhPhiTriggerHadronEventPlaneTPC(0x0)
170 
171 {
172  // Standard constructor.
173  for(Int_t i=0;i<nBranch;i++){
174  fJetInfoVar[i]=0;
175  }
177  DefineOutput(1, TList::Class());
178  DefineOutput(2, TTree::Class());
179 }
180 
181 //________________________________________________________________________
183 {
184  // Destructor.
185 }
186 
187 //________________________________________________________________________
189 {
190  // Create user output.
191 
193 
194  Bool_t oldStatus = TH1::AddDirectoryStatus();
195  TH1::AddDirectory(kFALSE);
196  TH1::AddDirectory(oldStatus);
197  const char* nameoutput = GetOutputSlot(2)->GetContainer()->GetName();
198  fTreeJetInfo = new TTree(nameoutput, nameoutput);
199 
200  if (!fFullTree){
201  const Int_t nVarMin = 11;
202  TString *fJetInfoVarNames = new TString [nVarMin];
203 
204  fJetInfoVarNames[0] = "Pt";
205  fJetInfoVarNames[1] = "Phi";
206  fJetInfoVarNames[2] = "Eta";
207  fJetInfoVarNames[3] = "SymParam";
208  fJetInfoVarNames[4] = "Tau1";
209  fJetInfoVarNames[5] = "Tau2";
210  fJetInfoVarNames[6] = "Mass";
211  fJetInfoVarNames[7] = "NTracks";
212  fJetInfoVarNames[8] = "JetPtNoCut";
213  fJetInfoVarNames[9] = "PTD";
214  fJetInfoVarNames[10] = "Angularity";
215 
216 
217  for(Int_t ivar=0; ivar < nVarMin; ivar++){
218  cout<<"looping over variables"<<endl;
219  fTreeJetInfo->Branch(fJetInfoVarNames[ivar].Data(), &fJetInfoVar[ivar], Form("%s/D", fJetInfoVarNames[ivar].Data()));
220  }
221  }
222 
223 
225 
226  fhJetPt= new TH1F("fhJetPt", "Jet Pt",1500,-0.5,149.5 );
227  fOutput->Add(fhJetPt);
228  fhJetPhi= new TH1F("fhJetPhi", "Jet Phi",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
229  fOutput->Add(fhJetPhi);
230  fhJetEta= new TH1F("fhJetEta", "Jet Eta", Eta_Bins_1, Eta_Lower, Eta_Upper);
231  fOutput->Add(fhJetEta);
232  fhJetMass= new TH1F("fhJetMass", "Jet Mass", 4000,-0.5, 39.5);
233  fOutput->Add(fhJetMass);
234  fhJetRadius= new TH1F("fhJetRadius", "Jet Radius", 100, -0.05,0.995);
235  fOutput->Add(fhJetRadius);
236  fhNumberOfJetTracks= new TH1F("fhNumberOfJetTracks", "Number of Tracks within a Jet", 300, -0.5,299.5);
238  fhJetCounter= new TH1F("fhJetCounter", "Jet Counter", 150, -0.5, 149.5);
239  fOutput->Add(fhJetCounter);
240  fhJetArea= new TH1F("fhJetArea", "Jet Area", 400,-0.5, 1.95);
241  fOutput->Add(fhJetArea);
242  fhTrackPt= new TH1F("fhTrackPt", "Track Pt",600,-0.5,59.5);
243  fOutput->Add(fhTrackPt);
244 
245  if(fJetSelection == kRecoil){
246  fhPtTriggerHadron= new TH1F("fhPtTriggerHadron", "fhPtTriggerHadron",1500,-0.5,149.5);
248  fh2PtTriggerHadronJet= new TH2F("fh2PtTriggerHadronJet", "fh2PtTriggerHadronJet",1500,-0.5,149.5,1500,-0.5,149.5);
250  fhPhiTriggerHadronJet= new TH1F("fhPhiTriggerHadronJet", "fhPhiTriggerHadronJet",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
252  fhPhiTriggerHadronEventPlane= new TH1F("fhPhiTriggerHadronEventPlane", "fhPhiTriggerHadronEventPlane",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
254  fhPhiTriggerHadronEventPlaneTPC= new TH1F("fhPhiTriggerHadronEventPlaneTPC", "fhPhiTriggerHadronEventPlaneTPC",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
256 
257 
258  }
259  }
260  PostData(1,fOutput);
261  PostData(2,fTreeJetInfo);
262  // delete [] fShapesVarNames;
263 }
264 
265 //________________________________________________________________________
267 {
268  // Run analysis code here, if needed. It will be executed before FillHistograms().
269 
270  return kTRUE;
271 }
272 
273 //________________________________________________________________________
275 {
276  AliMultSelection *MultSelection = 0x0;
277  AliAODEvent *fEvent = dynamic_cast<AliAODEvent*>(InputEvent());
278  if (!fEvent) {
279  Error("UserExec","AOD not available");
280  return 0;
281  }
282  MultSelection = (AliMultSelection * ) fEvent->FindListObject("MultSelection");
283  if(!MultSelection) {
284  AliWarning("AliMultSelection object not found!");
285  }
286  else{
287  Percentile_1 = MultSelection->GetMultiplicityPercentile("V0M");
288  }
289  if (fCentSelectOn){
290  if ((fCent>fCentMax) || (fCent<fCentMin)) return 0;
291  }
292 
293  AliAODTrack *TriggerHadron = 0x0;
294  if (fJetSelection == kRecoil) {
295  //you have to set a flag and the limits of the pT interval for your trigger
297  if (TriggerHadronLabel==-99999) return 0; //Trigger Hadron Not Found
298  AliTrackContainer *PartCont =NULL;
299  if (fJetShapeSub==kConstSub) PartCont = GetTrackContainer(1);
300  else PartCont = GetTrackContainer(0);
301  TClonesArray *TrackArray = PartCont->GetArray();
302  TriggerHadron = static_cast<AliAODTrack*>(TrackArray->At(TriggerHadronLabel));
303  if (!TriggerHadron) return 0;//No trigger hadron with label found
304  if(fSemigoodCorrect){
305  Double_t HoleDistance=RelativePhi(TriggerHadron->Phi(),fHolePos);
306  if(TMath::Abs(HoleDistance)+fHoleWidth+fJetRadius>TMath::Pi()-fRecoilAngularWindow) return 0;
307  }
308  fhPtTriggerHadron->Fill(TriggerHadron->Pt()); //Needed for per trigger Normalisation
309  fhPhiTriggerHadronEventPlane->Fill(TMath::Abs(RelativePhiEventPlane(fEPV0,TriggerHadron->Phi()))); //fEPV0 is the event plane from AliAnalysisTaskEmcal
310  fhPhiTriggerHadronEventPlaneTPC->Fill(TMath::Abs(RelativePhiEventPlane(((AliVAODHeader*)(InputEvent()->GetHeader()))->GetEventplane(),TriggerHadron->Phi()))); //TPC event plane
311  }
312 
314  AliEmcalJet *Jet1 = NULL; //Original Jet in the event
315  AliJetContainer *JetCont= GetJetContainer(0); //Jet Container for event
316  Int_t JetCounter=0; //Counts number of jets in event
317  Double_t JetPhi=0;
318  Bool_t EventCounter=kFALSE;
319  Double_t JetPt_ForThreshold=0;
320  AliEmcalJet *Jet2= NULL;
321  if(JetCont) {
322  JetCont->ResetCurrentID();
323  while((Jet1=JetCont->GetNextAcceptJet())) {
324  if(!Jet1) continue;
325  fJetInfoVar[8]=Jet1->Pt();
326  if (fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) JetPt_ForThreshold = Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
327  else JetPt_ForThreshold = Jet1->Pt();
328  if(JetPt_ForThreshold<fPtThreshold) {
329  continue;
330  }
331  else {
332  Float_t RecoilDeltaPhi = 0.;
333  if (fJetSelection == kRecoil){
334  RecoilDeltaPhi = RelativePhi(TriggerHadron->Phi(), Jet1->Phi());
335  if (TMath::Abs(RecoilDeltaPhi) < (TMath::Pi() - fRecoilAngularWindow)) continue; //accept the jet only if it overlaps with the recoil phi area of the trigger
336  fh2PtTriggerHadronJet->Fill(TriggerHadron->Pt(), Jet1->Pt());
337  fhPhiTriggerHadronJet->Fill(RelativePhi(TriggerHadron->Phi(), Jet1->Phi()));
338  }
339  if (!EventCounter){
340  EventCounter=kTRUE;
341  }
342  JetCounter++;
343  fhJetPt->Fill(Jet1->Pt());
344  fhJetArea->Fill(Jet1->Area());
345  JetPhi=Jet1->Phi();
346  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
347  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
348  fhJetPhi->Fill(JetPhi);
349  fhJetEta->Fill(Jet1->Eta());
350  fhJetMass->Fill(Jet1->M());
351  fhJetRadius->Fill(TMath::Sqrt((Jet1->Area()/TMath::Pi()))); //Radius of Jets per event
352  fhNumberOfJetTracks->Fill(Jet1->GetNumberOfTracks());
353  if(fJetShapeSub==kNoSub || fJetShapeSub==kDerivSub) fJetInfoVar[0]= Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
354  else fJetInfoVar[0]=Jet1->Pt();
355  fJetInfoVar[1]=JetPhi;
356  fJetInfoVar[2]=Jet1->Eta();
357  if(fDoSoftDrop) SoftDrop(Jet1,JetCont,fZCut,fBeta_SD);
358  else{
359  fJetInfoVar[3]=0;
360  fJetInfoVar[4]=0;
361  fJetInfoVar[5]=0;
362  }
363  fJetInfoVar[6]=Jet1->M();
364  fJetInfoVar[7]=0;
365  fJetInfoVar[9]=PTD(Jet1,0);
366  fJetInfoVar[10]=Angularity(Jet1,0);
367  fTreeJetInfo->Fill();
368  }
369  }
370  fhJetCounter->Fill(JetCounter); //Number of Jets in Each Event
371  }
372  }
373 
374  return kTRUE;
375 }
376 
377 //________________________________________________________________________
379 
380  if(Phi < -1*TMath::Pi()) Phi += (2*TMath::Pi());
381  else if (Phi > TMath::Pi()) Phi -= (2*TMath::Pi());
382  Double_t DeltaPhi=Phi-EventPlane;
383  if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi());
384  else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi());
385  return DeltaPhi;
386 }
387 //________________________________________________________________________
389 
390  if(Phi1 < -1*TMath::Pi()) Phi1 += (2*TMath::Pi());
391  else if (Phi1 > TMath::Pi()) Phi1 -= (2*TMath::Pi());
392  if(Phi2 < -1*TMath::Pi()) Phi2 += (2*TMath::Pi());
393  else if (Phi2 > TMath::Pi()) Phi2 -= (2*TMath::Pi());
394  Double_t DeltaPhi=Phi2-Phi1;
395  if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi());
396  else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi());
397  return DeltaPhi;
398 }
399 
400 
401 
402 
403 //--------------------------------------------------------------------------
405 
406  AliJetContainer *JetCont = GetJetContainer(JetContNb);
407  Double_t Angularity_Numerator=0;
408  Double_t Angularity_Denominator=0;
409  AliVParticle *Particle=0x0;
410  Double_t DeltaPhi=0;
411 
412 
413  for (Int_t i=0; i< Jet->GetNumberOfTracks(); i++){ //loops through all tracks
414  Particle = static_cast<AliVParticle*>(Jet->TrackAt(i, JetCont->GetParticleContainer()->GetArray()));
415  if(!Particle) continue;
416  DeltaPhi=RelativePhi(Jet->Phi(),Particle->Phi());
417  Angularity_Numerator=Angularity_Numerator+(Particle->Pt()*TMath::Sqrt(((Particle->Eta()-Jet->Eta())*(Particle->Eta()-Jet->Eta()))+(DeltaPhi*DeltaPhi)));
418  Angularity_Denominator= Angularity_Denominator+Particle->Pt();
419  }
420  if(Angularity_Denominator!=0) return Angularity_Numerator/Angularity_Denominator;
421  else return -1;
422 
423 }
424 
425 
426 
427 //--------------------------------------------------------------------------
429 
430  AliJetContainer *JetCont = GetJetContainer(JetContNb);
431  Double_t PTD_Numerator=0; //Reset these values
432  Double_t PTD_Denominator=0;
433  AliVParticle *Particle=0x0;
434  Double_t DeltaPhi=0;
435  for (Int_t i=0; i< Jet->GetNumberOfTracks(); i++){ //loops through all tracks
436  Particle = static_cast<AliVParticle*>(Jet->TrackAt(i, JetCont->GetParticleContainer()->GetArray()));
437  if(!Particle) continue;
438  PTD_Numerator=PTD_Numerator+(Particle->Pt()*Particle->Pt());
439  PTD_Denominator=PTD_Denominator+Particle->Pt();
440  }
441  if(PTD_Denominator!=0) return TMath::Sqrt(PTD_Numerator)/PTD_Denominator;
442  else return -1;
443 
444 }
445 
446 //_________________________________________________________________________
448  std::vector<fastjet::PseudoJet> fInputVectors;
449  Double_t JetInvMass=0, PseudJetInvMass=0, TrackMom = 0, TrackEnergy = 0;
450  AliParticleContainer *fTrackCont = fJetCont->GetParticleContainer();
451  Double_t JetEta=fJet->Eta(),JetPhi=fJet->Phi();
452  Double_t FJTrackEta[9999],FJTrackPhi[9999],FJTrackPt[9999],EmcalJetTrackEta[9999],EmcalJetTrackPhi[9999],EmcalJetTrackPt[9999];
453  UShort_t FJNTracks=0,EmcalJetNTracks=0;
454  if (fTrackCont) for (Int_t i=0; i<fJet->GetNumberOfTracks(); i++) {
455  AliVParticle *fTrk = fJet->TrackAt(i, fTrackCont->GetArray());
456  JetInvMass += fTrk->M();
457  if (!fTrk) continue;
458  fastjet::PseudoJet PseudoTracks(fTrk->Px(), fTrk->Py(), fTrk->Pz(),fTrk->E());
459  TrackMom += TMath::Sqrt(TMath::Power(fTrk->Px(),2)+TMath::Power(fTrk->Py(),2)+TMath::Power(fTrk->Pz(),2));
460  TrackEnergy += fTrk->E();
461  PseudoTracks.set_user_index(fJet->TrackAt(i)+100);
462  PseudJetInvMass += PseudoTracks.m();
463  fInputVectors.push_back(PseudoTracks);
464  EmcalJetTrackEta[i]=fTrk->Eta();
465  EmcalJetTrackPhi[i]=fTrk->Phi();
466  EmcalJetTrackPt[i]=fTrk->Pt();
467  EmcalJetNTracks++;
468  }
469  fastjet::JetDefinition *fJetDef;
470  fastjet::ClusterSequence *fClustSeqSA;
471 
472 
473 
474  fJetDef = new fastjet::JetDefinition(fastjet::antikt_algorithm, fJetRadius*2, static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
475 
476  try {
477  fClustSeqSA = new fastjet::ClusterSequence(fInputVectors, *fJetDef);
478  } catch (fastjet::Error) {
479  AliError(" [w] FJ Exception caught.");
480  //return -1;
481  }
482 
483  std::vector<fastjet::PseudoJet> fOutputJets;
484  fOutputJets.clear();
485  fOutputJets=fClustSeqSA->inclusive_jets(fJet->Pt()-0.1);
486  //Float_t tau1NoSD = FJNSubjettiness(fOutputJets[0],1,1,0.4,0.4);
487  //Float_t tau2NoSD = FJNSubjettiness(fOutputJets[0],2,1,0.4,0.4);
488  fastjet::contrib::SoftDrop softdrop(beta, zcut);
489  fastjet::PseudoJet finaljet = softdrop(fOutputJets[0]);
490  //Float_t tau1SD = FJNSubjettiness(finaljet,1,1,0.4,0.4);
491  //Float_t tau2SD = FJNSubjettiness(finaljet,2,1,0.4,0.4);
492  fJetInfoVar[4]=0;//tau1NoSD;
493  fJetInfoVar[5]=0;//tau2NoSD;
494  AliEmcalJet* jet = new AliEmcalJet(finaljet.perp(), finaljet.eta(), finaljet.phi(), finaljet.m());
495 
496  std::vector<fastjet::PseudoJet> fSDTracks=finaljet.constituents();
497  Double_t FastjetTrackDelR,EmcalTrackDelR;
498  for(Int_t i=0;i<fJet->GetNumberOfConstituents();i++){
499  if(i<=finaljet.constituents().size()){
500  FastjetTrackDelR = TMath::Sqrt(TMath::Power(fSDTracks[i].eta()-JetEta,2)+TMath::Power(fSDTracks[i].phi()-JetPhi,2));
501  FJTrackEta[i]=fSDTracks[i].eta();
502  FJTrackPhi[i]=fSDTracks[i].phi();
503  FJTrackPt[i]=fSDTracks[i].perp();
504  FJNTracks++;
505  }
506  AliVParticle *fTrk = fJet->TrackAt(i, fTrackCont->GetArray());
507  EmcalTrackDelR = TMath::Sqrt(TMath::Power(fTrk->Eta()-JetEta,2)+TMath::Power(fTrk->Phi()-JetPhi,2));
508  }
509  Int_t NDroppedTracks = fJet->GetNumberOfTracks()-finaljet.constituents().size();
510  Int_t nConstituents(fClustSeqSA->constituents(finaljet).size());
511  jet->SetNumberOfTracks(nConstituents);
512  Double_t SymParam, Mu, DeltaR;
513  SymParam=(finaljet.structure_of<fastjet::contrib::SoftDrop>().symmetry());
514  Mu=(finaljet.structure_of<fastjet::contrib::SoftDrop>().mu());
515  DeltaR=(finaljet.structure_of<fastjet::contrib::SoftDrop>().delta_R());
516  fJetInfoVar[3]=SymParam;
517 
518  return jet;
519 
520 
521 }
522 
523 //________________________________________________________________________
524 /*Float_t AliAnalysisTaskRecoilJetYield::FJNSubjettiness(fastjet::PseudoJet Jet, Int_t N, Double_t beta, Double_t R0, Double_t Rcut){
525 
526 
527  vector<fastjet::PseudoJet> jet_constituents = Jet.constituents();
528  Float_t Result;
529  if(jet_constituents.size()>=N){
530  fastjet::contrib::Nsubjettiness nSub(N,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedMeasure(beta,R0));
531  Result = nSub.result(Jet);
532  }
533  else Result = -1;
534 
535 
536  return Result;
537 
538 }
539 */
540 
541 //________________________________________________________________________
543 
544  AliTrackContainer *PartCont = NULL;
545  if (fJetShapeSub==kConstSub) PartCont = GetTrackContainer(1);
546  else PartCont = GetTrackContainer(0);
547  TClonesArray *TracksArray = PartCont->GetArray();
548  if(!PartCont || !TracksArray) return -99999;
549  AliAODTrack *Track = 0x0;
550  Int_t Trigger_Index[100];
551  for (Int_t i=0; i<100; i++) Trigger_Index[i] = 0;
552  Int_t Trigger_Counter = 0;
553  for(Int_t i=0; i < TracksArray->GetEntriesFast(); i++){
554  if((Track = static_cast<AliAODTrack*>(PartCont->GetAcceptTrack(i)))){
555  if (!Track) continue;
556  fhTrackPt->Fill(Track->Pt());
557  if(TMath::Abs(Track->Eta())>0.9) continue;
558  if (Track->Pt()<0.15) continue;
559  if ((Track->Pt() >= PtMin) && (Track->Pt()< PtMax)) {
560  Trigger_Index[Trigger_Counter] = i;
561  Trigger_Counter++;
562  }
563  }
564  }
565  if (Trigger_Counter == 0) return -99999;
566  Int_t RandomNumber = 0, Index = 0 ;
567  TRandom3* Random = new TRandom3(0);
568  RandomNumber = Random->Integer(Trigger_Counter);
569  Index = Trigger_Index[RandomNumber];
570  return Index;
571 }
572 
573 //________________________________________________________________________
575  //
576  // retrieve event objects
577  //
579  return kFALSE;
580 
581  return kTRUE;
582 }
583 
584 
585 //_______________________________________________________________________
587 {
588  // Called once at the end of the analysis.
589 
590 
591 }
Double_t Area() const
Definition: AliEmcalJet.h:123
double Double_t
Definition: External.C:58
Double_t PTD(AliEmcalJet *Jet, Int_t JetContNb)
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
Definition: External.C:236
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t Eta() const
Definition: AliEmcalJet.h:114
Double_t Phi_Upper
Double_t Phi() const
Definition: AliEmcalJet.h:110
ClassImp(AliAnalysisTaskRecoilJetYield) AliAnalysisTaskRecoilJetYield
Container with name, TClonesArray and cuts for particles.
Double_t fEPV0
!event plane V0
Double_t Eta_Lower
Float_t Percentile_1
Double_t Eta_Upper
Double_t Phi_Lower
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:133
Container for particles within the EMCAL framework.
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:132
TString kData
Declare data MC or deltaAOD.
AliParticleContainer * GetParticleContainer() const
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Int_t SelectTriggerHadron(Float_t PtMin, Float_t PtMax)
Double_t fCent
!event centrality
const Int_t nBranch
Double_t Angularity(AliEmcalJet *Jet, Int_t JetContNb)
AliEmcalJet * GetNextAcceptJet()
AliEmcalJet * SoftDrop(AliEmcalJet *fJet, AliJetContainer *fJetCont, double zcut, double beta)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Double_t RelativePhi(Double_t Phi1, Double_t Phi2)
Double_t Pt() const
Definition: AliEmcalJet.h:102
Double_t GetRhoVal(Int_t i=0) const
AliEmcalList * fOutput
!output list
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:153
AliTrackContainer * GetTrackContainer(Int_t i=0) const
Double_t DeltaR(const AliVParticle *part1, const AliVParticle *part2)
void SetMakeGeneralHistograms(Bool_t g)
virtual AliVTrack * GetAcceptTrack(Int_t i=-1) const
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
void SetNumberOfTracks(Int_t n)
Definition: AliEmcalJet.h:192
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
Double_t RelativePhiEventPlane(Double_t EventPlane, Double_t Phi)
Double_t M() const
Definition: AliEmcalJet.h:113
Container for jet within the EMCAL jet framework.