AliPhysics  d9e9949 (d9e9949)
AliAnalysisTaskRecursiveSoftDrop.cxx
Go to the documentation of this file.
1 //
2 // Basic analysis task.
3 //
4 // Basic analysis task template for analysis jets storing information in both tree
5 // branches and histograms
6 
7 #include <TClonesArray.h>
8 #include <TH1F.h>
9 #include <TH2F.h>
10 #include <TH3F.h>
11 #include <TCanvas.h>
12 #include <THnSparse.h>
13 #include <TTree.h>
14 #include <TList.h>
15 #include <TLorentzVector.h>
16 #include <TProfile.h>
17 #include <TChain.h>
18 #include <TSystem.h>
19 #include <TFile.h>
20 #include <TKey.h>
21 #include <AliAnalysisDataSlot.h>
22 #include <AliAnalysisDataContainer.h>
23 #include <vector>
24 #include "TMatrixD.h"
25 #include "TMatrixDSym.h"
26 #include "TMatrixDSymEigen.h"
27 #include "TVector3.h"
28 #include "TVector2.h"
29 #include "AliVCluster.h"
30 #include "AliVTrack.h"
31 #include "AliEmcalJet.h"
32 #include "AliRhoParameter.h"
33 #include "AliLog.h"
34 #include "AliEmcalParticle.h"
35 #include "AliMCEvent.h"
36 #include "AliGenPythiaEventHeader.h"
37 #include "AliAODMCHeader.h"
38 #include "AliMCEvent.h"
39 #include "AliAnalysisManager.h"
40 #include "AliJetContainer.h"
41 #include "AliParticleContainer.h"
42 //#include "AliPythiaInfo.h"
43 #include "TRandom3.h"
44 #include "AliPicoTrack.h"
45 #include "AliEmcalJetFinder.h"
46 #include "AliAODEvent.h"
48 
49 #include "FJ_includes.h"
50 
51 //Globals
52 using std::cout;
53 using std::endl;
54 
56 
57 //________________________________________________________________________
60  fContainer(0),
61  fJetShapeSub(kNoSub),
62  fPtThreshold(-9999.),
63  fCentSelectOn(kTRUE),
64  fCentMin(0),
65  fCentMax(10),
66  fJetRadius(0.4),
67  fSharedFractionPtMin(0.5),
68  fReclusteringAlgo(0),
69  fhJetPt(0x0),
70  fhJetPhi(0x0),
71  fhJetEta(0x0),
72  fhDetJetPt_Matched(0x0),
73  fTreeRecursive_Det(0),
74  fTreeRecursive_True(0),
75  fAddMedScat(kFALSE),
76  fAddMedScatPtFrac(1),
77  fAddMedScatN(100),
78  fDoSubJetAreaSub(kFALSE)
79 
80 {
81  for(Int_t i=0;i<5;i++){
82  fShapesVar_Det[i]=0;
83  fShapesVar_True[i]=0;
84  }
85  SetMakeGeneralHistograms(kTRUE);
86  DefineOutput(1, TList::Class());
87  DefineOutput(2, TTree::Class());
88  DefineOutput(3, TTree::Class());
89 }
90 
91 //________________________________________________________________________
93  AliAnalysisTaskEmcalJet(name, kTRUE),
94  fContainer(0),
95  fJetShapeSub(kNoSub),
96  fPtThreshold(-9999.),
97  fCentSelectOn(kTRUE),
98  fCentMin(0),
99  fCentMax(10),
100  fJetRadius(0.4),
101  fSharedFractionPtMin(0.5),
102  fReclusteringAlgo(0),
103  fhJetPt(0x0),
104  fhJetPhi(0x0),
105  fhJetEta(0x0),
106  fhDetJetPt_Matched(0x0),
107  fTreeRecursive_Det(0),
108  fTreeRecursive_True(0),
109  fAddMedScat(kFALSE),
110  fAddMedScatPtFrac(1),
111  fAddMedScatN(100),
112  fDoSubJetAreaSub(kFALSE)
113 
114 {
115  // Standard constructor.
116  for(Int_t i=0;i<5;i++){
117  fShapesVar_Det[i]=0;
118  fShapesVar_True[i]=0;
119  }
121  DefineOutput(1, TList::Class());
122  DefineOutput(2, TTree::Class());
123  DefineOutput(3, TTree::Class());
124 }
125 
126 //________________________________________________________________________
128 {
129  // Destructor.
130 }
131 
132 //________________________________________________________________________
134 {
135  // Create user output.
136 
138 
139  Bool_t oldStatus = TH1::AddDirectoryStatus();
140  TH1::AddDirectory(kFALSE);
141  TH1::AddDirectory(oldStatus);
142  //create a tree used for the MC data and making a 4D response matrix
143  const char* nameoutput = GetOutputSlot(2)->GetContainer()->GetName();
144  fTreeRecursive_Det = new TTree(nameoutput, nameoutput);
145  const char* nameoutput2 = GetOutputSlot(3)->GetContainer()->GetName();
146  fTreeRecursive_True = new TTree(nameoutput2, nameoutput2);
147 
148  const Int_t intBranches = 5;
149 
150  std::vector<TString> fShapesVarNames_Det(intBranches), fShapesVarNames_True(intBranches);
151 
152 
153  fShapesVarNames_Det[0] = "Pt";
154  fShapesVarNames_Det[1] = "Z";
155  fShapesVarNames_Det[2] = "Theta";
156  fShapesVarNames_Det[3] = "N";
157  fShapesVarNames_Det[4] = "ParentPt";
158  fShapesVarNames_True[0] = "Pt_Truth";
159  fShapesVarNames_True[1] = "Z_Truth";
160  fShapesVarNames_True[2] = "Theta_Truth";
161  fShapesVarNames_True[3] = "N_Truth";
162  fShapesVarNames_True[4] = "ParentPt_Truth";
163 
164  for(Int_t ivar=0; ivar < intBranches; ivar++){
165  cout<<"looping over variables"<<endl;
166  fTreeRecursive_Det->Branch(fShapesVarNames_Det[ivar].Data(), &fShapesVar_Det[ivar], Form("%s/D", fShapesVarNames_Det[ivar].Data()));
167  fTreeRecursive_True->Branch(fShapesVarNames_True[ivar].Data(), &fShapesVar_True[ivar], Form("%s/D", fShapesVarNames_True[ivar].Data()));
168  }
169 
170  fhJetPt= new TH1F("fhJetPt", "Jet Pt",1500,-0.5,149.5 );
171  fOutput->Add(fhJetPt);
172  fhJetPhi= new TH1F("fhJetPhi", "Jet Phi",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
173  fOutput->Add(fhJetPhi);
174  fhJetEta= new TH1F("fhJetEta", "Jet Eta",100,-2,2);
175  fOutput->Add(fhJetEta);
176  fhDetJetPt_Matched= new TH1F("fhDetJetPt_Matched", "Jet Pt",200,-0.5,199.5 );
178 
179  PostData(1,fOutput);
180  PostData(2,fTreeRecursive_Det);
181  PostData(3,fTreeRecursive_True);
182  // delete [] fShapesVarNames;
183 }
184 
185 //________________________________________________________________________
187 {
188  // Run analysis code here, if needed. It will be executed before FillHistograms().
189 
190 
191  return kTRUE;
192 }
193 
194 //________________________________________________________________________
196 {
197  if (fCentSelectOn){
198  if ((fCent>fCentMax) || (fCent<fCentMin)) return 0;
199  }
200 
201  if(fJetType == kData){
202  AliEmcalJet *Jet1 = NULL; //Original Jet in the event
203  AliJetContainer *JetCont= GetJetContainer(0); //Jet Container for event
204  Double_t JetPhi=0;
205  Double_t JetPt_ForThreshold=0;
206  if(JetCont) {
207  JetCont->ResetCurrentID();
208  while((Jet1=JetCont->GetNextAcceptJet())) {
209  if(!Jet1) continue;
210  if (fJetShapeSub==kNoSub) JetPt_ForThreshold = Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
211  else JetPt_ForThreshold = Jet1->Pt();
212  if(JetPt_ForThreshold<fPtThreshold) {
213  continue;
214  }
215  else {
216  fhJetPt->Fill(Jet1->Pt());
217  JetPhi=Jet1->Phi();
218  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
219  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
220  fhJetPhi->Fill(JetPhi);
221  fhJetEta->Fill(Jet1->Eta());
222  RecursiveParents(Jet1,JetCont,kFALSE);
223  }
224  }
225  }
226  }
227 
228  if(fJetType == kEmb){
229  AliEmcalJet *JetHybridS = NULL; //Subtracted hybrid Jet
230  AliEmcalJet *JetHybridUS = NULL; //Unsubtracted Hybrid Jet //For matching SubtractedHybrid->DetPythia this jet container is also Subtracted Hybrid
231  AliEmcalJet *JetPythDet = NULL; //Detector Level Pythia Jet
232  AliEmcalJet *JetPythTrue = NULL; //Particle Level Pyhtia Jet
233  AliJetContainer *JetContHybridS= GetJetContainer(0); //Jet Container for Subtracted Hybrid Jets
234  AliJetContainer *JetContHybridUS= GetJetContainer(1); //Jet Container for Unsubtracted Hybrid Jets
235  AliJetContainer *JetContPythDet= GetJetContainer(2); //Jet Container for Detector Level Pyhtia Jets
236  AliJetContainer *JetContPythTrue= GetJetContainer(3); //Jet Container for Particle Level Pythia Jets
237 
238 
239 
240  Bool_t JetsMatched = kFALSE;
241  Double_t JetPtThreshold;
242  JetContHybridS->ResetCurrentID();
243  JetContHybridUS->ResetCurrentID();
244  JetContPythDet->ResetCurrentID();
245  JetContPythTrue->ResetCurrentID();
246 
247  while((JetHybridS = JetContHybridS->GetNextAcceptJet())){ //Get next Subtracted hybrid jet
248  if (fJetShapeSub==kConstSub) JetPtThreshold=JetHybridS->Pt();
249  else JetPtThreshold=JetHybridS->Pt()-(GetRhoVal(0)*JetHybridS->Area());
250  if ( (!JetHybridS) || (JetPtThreshold<fPtThreshold)) continue; //check pT is above threshold
251  Int_t JetNumber=-1;
252  for(Int_t i = 0; i<JetContHybridUS->GetNJets(); i++) {
253  JetHybridUS = JetContHybridUS->GetJet(i); //Get unsubtracted jets in order
254  if (!JetHybridUS) continue;
255 
256  if(JetHybridUS->GetLabel()==JetHybridS->GetLabel()) { //check if it mataches with current subtracted hybrid jet
257  JetNumber=i;
258  }
259  }
260  if(JetNumber==-1) continue;
261  JetHybridUS=JetContHybridUS->GetJet(JetNumber); //Get the matched Unsubtracted jet
262  if (JetContHybridUS->AliJetContainer::GetFractionSharedPt(JetHybridUS)<fSharedFractionPtMin) { //Check that the US closest jet shares a minimum
263  continue; // pT with Detector level pythia jet
264  }
265  JetPythDet=JetHybridUS->ClosestJet(); //get the closest jet that has passed the shared pT cut
266  if (!JetHybridUS) {
267  Printf("Unsubtracted embedded jet does not exist, returning");
268  continue;
269  }
270  if (!JetPythDet) continue;
271  UInt_t rejectionReason = 0;
272  if (!(JetContPythDet->AcceptJet(JetPythDet,rejectionReason))) continue; //Check the detector level just is accepted
273  fhDetJetPt_Matched->Fill(JetPythDet->Pt()); //Fill only matched detector level jets for tagging efficiency comparison
274  JetPythTrue=JetPythDet->ClosestJet(); //Get the corresponding pythia true jet
275  if(!JetPythTrue) continue;
276  JetsMatched=kTRUE; //jets have been matched
277 
278 
279  fhJetPt->Fill(JetHybridS->Pt());
280  Double_t JetPhi=JetHybridS->Phi();
281  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
282  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
283  fhJetPhi->Fill(JetPhi);
284  fhJetEta->Fill(JetHybridS->Eta());
285  RecursiveParents(JetHybridS,JetContHybridS,kFALSE);
286  RecursiveParents(JetPythTrue,JetContPythTrue,kTRUE);
287 
288 
289 
290  }
291  }
292 
293 
294  if(fJetType == kTrueDet){
295  AliEmcalJet *JetPythDet = NULL; //Detector Level Pythia Jet
296  AliEmcalJet *JetPythTrue = NULL; //Particle Level Pyhtia Jet
297  AliJetContainer *JetContPythDet= GetJetContainer(0); //Jet Container for Detector Level Pyhtia Jets
298  AliJetContainer *JetContPythTrue= GetJetContainer(1); //Jet Container for Particle Level Pythia Jets
299 
300 
301 
302  Bool_t JetsMatched = kFALSE;
303  Double_t JetPtThreshold;
304  JetContPythDet->ResetCurrentID();
305  JetContPythTrue->ResetCurrentID();
306 
307  while((JetPythDet = JetContPythDet->GetNextAcceptJet())){ //Get next detector level jet
308  if (fJetShapeSub==kConstSub) JetPtThreshold=JetPythDet->Pt();
309  else JetPtThreshold=JetPythDet->Pt()-(GetRhoVal(0)*JetPythDet->Area());
310  if ( (!JetPythDet) || (JetPtThreshold<fPtThreshold)) continue; //check pT is above threshold
311  Int_t JetNumber=-1;
312  if((JetPythTrue = JetPythDet->ClosestJet())){
313  JetsMatched=kTRUE;
314  }
315  else continue;
316 
317 
318  fhJetPt->Fill(JetPythDet->Pt());
319  Double_t JetPhi=JetPythDet->Phi();
320  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
321  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
322  fhJetPhi->Fill(JetPhi);
323  fhJetEta->Fill(JetPythDet->Eta());
324  RecursiveParents(JetPythDet,JetContPythDet,kFALSE);
325  RecursiveParents(JetPythTrue,JetContPythTrue,kTRUE);
326 
327 
328 
329  }
330  }
331 
332 
333  return kTRUE;
334 }
335 
336 //_________________________________________________________________________
338  std::vector<fastjet::PseudoJet> fInputVectors;
339  fInputVectors.clear();
340  fastjet::PseudoJet PseudoTracks;
341  double xflagalgo=0;
342  AliParticleContainer *fTrackCont = fJetCont->GetParticleContainer();
343 
344  if (fTrackCont) for (Int_t i=0; i<fJet->GetNumberOfTracks(); i++) {
345  AliVParticle *fTrk = fJet->TrackAt(i, fTrackCont->GetArray());
346  if (!fTrk) continue;
347  PseudoTracks.reset(fTrk->Px(), fTrk->Py(), fTrk->Pz(),fTrk->E());
348  PseudoTracks.set_user_index(fJet->TrackAt(i)+100);
349  fInputVectors.push_back(PseudoTracks);
350 
351  }
352  if(fAddMedScat){
353  for(int i = 0; i < fAddMedScatN; i++){
354  TRandom3 rand1(0),rand2(0),rand3(0); //set range +- jet R
355  Double_t randN1 = 0.4*0.4*rand1.Rndm();
356  Double_t randN2 = 2*TMath::Pi()*rand2.Rndm();
357  Double_t phi_rand = (fJet->Phi())+TMath::Sqrt(randN1)*TMath::Sin(randN2);
358  Double_t eta_rand = (fJet->Eta())+TMath::Sqrt(randN1)*TMath::Cos(randN2);
359  Double_t fAddMedScatPt = (fAddMedScatPtFrac*fJet->Pt())/fAddMedScatN;
360  PseudoTracks.reset(fAddMedScatPt*TMath::Cos(phi_rand),fAddMedScatPt*TMath::Sin(phi_rand),fAddMedScatPt/TMath::Tan(eta_rand),fAddMedScatPt);
361  PseudoTracks.set_user_index(i+fJet->GetNumberOfTracks()+100);
362  fInputVectors.push_back(PseudoTracks);
363  }
364  }
365 
366 
367 
368 
369  fastjet::JetAlgorithm jetalgo(fastjet::antikt_algorithm);
370  if(fReclusteringAlgo==0){ xflagalgo=0.5;
371  jetalgo=fastjet::kt_algorithm ;}
372 
373  if(fReclusteringAlgo==1){ xflagalgo=1.5;
374  jetalgo=fastjet::cambridge_algorithm;
375  }
376  if(fReclusteringAlgo==2){ xflagalgo=2.5;
377  jetalgo=fastjet::antikt_algorithm;
378  }
379 
380  fastjet::JetDefinition fJetDef(jetalgo, 1., static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
381 
382  try {
383  fastjet::ClusterSequence fClustSeqSA(fInputVectors, fJetDef);
384  std::vector<fastjet::PseudoJet> fOutputJets;
385  fOutputJets.clear();
386  fOutputJets=fClustSeqSA.inclusive_jets(0);
387 
388  fastjet::PseudoJet jj;
389  fastjet::PseudoJet j1;
390  fastjet::PseudoJet j2;
391  jj=fOutputJets[0];
392  Int_t n = 0;
393  Double_t jet_pT=jj.perp();
394  while(jj.has_parents(j1,j2)){
395  n++;
396  double area1 = j1.area();
397  double area2 = j2.area();
398  if((j1.perp()-area1*GetRhoVal(0)) < (j2.perp()-area2*GetRhoVal(0))) swap(j1,j2);
399  area1 = j1.area();
400  area2 = j2.area();
401  double delta_R=j1.delta_R(j2);
402  double z = 0;
403  if(fJetShapeSub==kNoSub && fDoSubJetAreaSub == kTRUE) z = (j2.perp()-area2*GetRhoVal(0))/((j1.perp()-area1*GetRhoVal(0))+(j2.perp()-area2*GetRhoVal(0)));
404  else z=j2.perp()/(j1.perp()+j2.perp());
405  if(bTruth) {
406  fShapesVar_True[0]=jet_pT;
407  fShapesVar_True[1]=z;
408  fShapesVar_True[2]=delta_R;
409  fShapesVar_True[3]=n;
410  fShapesVar_True[4]=jj.perp();
411  fTreeRecursive_True->Fill();
412  }
413  else {
414  fShapesVar_Det[0]=jet_pT;
415  fShapesVar_Det[1]=z;
416  fShapesVar_Det[2]=delta_R;
417  fShapesVar_Det[3]=n;
418  fShapesVar_Det[4]=jj.perp();
419  fTreeRecursive_Det->Fill();
420  }
421  jj=j1;
422  }
423 
424  } catch (fastjet::Error) {
425  AliError(" [w] FJ Exception caught.");
426  //return -1;
427  }
428  return;
429 }
430 
431 
432 //________________________________________________________________________
434  //
435  // retrieve event objects
436  //
438  return kFALSE;
439 
440  return kTRUE;
441 }
442 
443 
444 //_______________________________________________________________________
446 {
447  // Called once at the end of the analysis.
448 
449 }
450 
451 
453  const char * njetsData, //data jets
454  const char * njetsTrue, //Pyhthia Particle Level
455  const char * njetsDet,
456  const char * njetsHybridUs,
457  const char * njetsHybridS,
458  const Double_t R,
459  const char * nrhoBase,
460  const char * ntracksData,
461  const char * ntracksTrue,
462  const char * ntracksDet,
463  const char * ntracksHybridUs,
464  const char * ntracksHybridS,
465  const char *type,
466  const char *CentEst,
467  Int_t pSel,
468  TString trigClass,
469  TString kEmcalTriggers,
470  TString tag,
473  ) {
474 
475 
476 
477  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
478  if (!mgr)
479  {
480  ::Error("AddTaskRecursiveSoftDrop","No analysis manager found.");
481  return 0;
482  }
483  Bool_t ismc=kFALSE;
484  ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
485 
486  // Check the analysis type using the event handlers connected to the analysis manager.
487  //==============================================================================
488  if (!mgr->GetInputEventHandler())
489  {
490  ::Error("AliAnalysisTaskRecursiveSoftDrop", "This task requires an input event handler");
491  return NULL;
492  }
493  TString wagonName1;
494  TString wagonName2;
495  TString wagonName3;
496 
498  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsData,trigClass.Data(),tag.Data());
499  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsData,trigClass.Data(),tag.Data());
500  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsData,trigClass.Data(),tag.Data());
501  }
503  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsHybridS,trigClass.Data(),tag.Data());
504  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsHybridS,trigClass.Data(),tag.Data());
505  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsHybridS,trigClass.Data(),tag.Data());
506  }
508  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsDet,trigClass.Data(),tag.Data());
509  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsDet,trigClass.Data(),tag.Data());
510  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsDet,trigClass.Data(),tag.Data());
511  }
512  //Configure jet tagger task
514 
515  task->SetJetShapeSub(jetShapeSub);
516  task->SetJetType(fjetType);
517  task->SetJetRadius(R);
518 
519  AliParticleContainer *trackContData=0x0;
520  AliParticleContainer *trackContDet=0x0;
521  AliParticleContainer *trackContTrue=0x0;
522  AliParticleContainer *trackContHybridS=0x0;
523  AliParticleContainer *trackContHybridUs=0x0;
524 
525  if(fjetType!=AliAnalysisTaskRecursiveSoftDrop::kTrueDet) trackContData = task->AddParticleContainer(ntracksData);
527  trackContDet = task->AddParticleContainer(ntracksDet);
528  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
529  trackContHybridS = task->AddParticleContainer(ntracksHybridS);
530  trackContHybridUs = task->AddParticleContainer(ntracksHybridUs);
531  }
533  trackContDet = task->AddParticleContainer(ntracksDet);
534  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
535  }
536  AliJetContainer *JetContData=0x0;
537  AliJetContainer *JetContTrue=0x0;
538  AliJetContainer *JetContDet=0x0;
539  AliJetContainer *JetContHybridUs=0x0;
540  AliJetContainer *JetContHybridS=0x0;
541  TString strType(type);
542 
544  JetContData = task->AddJetContainer(njetsData,strType,R); //Data
545  if(JetContData) {
546  JetContData->SetRhoName(nrhoBase);
547  JetContData->ConnectParticleContainer(trackContData);
548  JetContData->SetPercAreaCut(0.6);
549  JetContData->SetJetRadius(R);
551  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContData->SetAreaEmcCut(-2);
552  }
553  }
555  JetContHybridS = task->AddJetContainer(njetsHybridS,strType,R); //HybridS
556  if(JetContHybridS) {
557  JetContHybridS->SetRhoName(nrhoBase);
558  JetContHybridS->ConnectParticleContainer(trackContHybridS);
559  JetContHybridS->SetPercAreaCut(0.6);
560  JetContHybridS->SetJetRadius(R);
562  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridS->SetAreaEmcCut(-2);
563  }
564  JetContHybridUs = task->AddJetContainer(njetsHybridUs,strType,R); //HybridUs
565  if(JetContHybridUs) {
566  JetContHybridUs->SetRhoName(nrhoBase);
567  JetContHybridUs->ConnectParticleContainer(trackContHybridUs);
568  JetContHybridUs->SetPercAreaCut(0.6);
569  JetContHybridUs->SetJetRadius(R);
570  JetContHybridUs->SetJetAcceptanceType(AliEmcalJet::kTPCfid);
571  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridUs->SetAreaEmcCut(-2);
572  }
573  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
574  if(JetContDet) {
575  JetContDet->SetRhoName(nrhoBase);
576  JetContDet->ConnectParticleContainer(trackContDet);
577  JetContDet->SetPercAreaCut(0.6);
578  JetContDet->SetJetRadius(R);
580  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
581  }
582  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
583  if(JetContTrue) {
584  JetContTrue->SetRhoName(nrhoBase);
585  JetContTrue->ConnectParticleContainer(trackContTrue);
586  JetContTrue->SetPercAreaCut(0.6);
587  JetContTrue->SetJetRadius(R);
589  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
590  }
591  }
592 
594  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
595  if(JetContDet) {
596  JetContDet->SetRhoName(nrhoBase);
597  JetContDet->ConnectParticleContainer(trackContDet);
598  JetContDet->SetPercAreaCut(0.6);
599  JetContDet->SetJetRadius(R);
601  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
602  }
603  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
604  if(JetContTrue) {
605  JetContTrue->SetRhoName(nrhoBase);
606  JetContTrue->ConnectParticleContainer(trackContTrue);
607  JetContTrue->SetPercAreaCut(0.6);
608  JetContTrue->SetJetRadius(R);
610  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
611  }
612  }
613 
614  task->SetCaloTriggerPatchInfoName(kEmcalTriggers.Data());
615  task->SetCentralityEstimator(CentEst);
616  task->SelectCollisionCandidates(pSel);
617  task->SetUseAliAnaUtils(kFALSE);
618 
619  mgr->AddTask(task);
620 
621  //Connnect input
622  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() );
623 
624  //Connect output
625  TString contName1(wagonName1);
626  TString contName2(wagonName2);
627  TString contName3(wagonName3);
628 
630  contName1 += "_Embedded";
631  contName2 += "_Embedded";
632  contName2 += "_Embedded";
633 
634  }
635 
636 
637  TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
638  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
639  mgr->ConnectOutput(task,1,coutput1);
640  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
641  mgr->ConnectOutput(task,2,coutput2);
642  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
643  mgr->ConnectOutput(task,3,coutput3);
644 
645  return task;
646 
647 }
void SetAreaEmcCut(Double_t a=0.99)
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
Double_t Area() const
Definition: AliEmcalJet.h:130
double Double_t
Definition: External.C:58
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:327
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t Eta() const
Definition: AliEmcalJet.h:121
void RecursiveParents(AliEmcalJet *fJet, AliJetContainer *fJetCont, Bool_t bTruth)
Double_t Phi() const
Definition: AliEmcalJet.h:117
Int_t GetLabel() const
Definition: AliEmcalJet.h:124
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void SetPercAreaCut(Float_t p)
Bool_t FillHistograms()
Function filling histograms.
Container for particles within the EMCAL framework.
Int_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:160
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:139
void SetRhoName(const char *n)
TPC fiducial acceptance (each eta edge narrowed by jet R)
Definition: AliEmcalJet.h:68
AliParticleContainer * GetParticleContainer() const
int Int_t
Definition: External.C:63
void SetJetRadius(Float_t r)
unsigned int UInt_t
Definition: External.C:33
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Int_t GetNJets() const
static AliAnalysisTaskRecursiveSoftDrop * AddTaskRecursiveSoftDrop(const char *njetsData, const char *njetsTrue, const char *njetsDet, const char *njetsHybridUs, const char *njetsHybridS, const Double_t R, const char *nrhoBase, const char *ntracksData, const char *ntracksTrue, const char *ntracksDet, const char *ntracksHybridUs, const char *ntracksHybridS, const char *type, const char *CentEst, Int_t pSel, TString trigClass="", TString kEmcalTriggers="", TString tag="", AliAnalysisTaskRecursiveSoftDrop::JetShapeSub jetShapeSub=JetShapeSub::kConstSub, AliAnalysisTaskRecursiveSoftDrop::JetType fjetType=JetType::kData)
Double_t fCent
!event centrality
AliEmcalJet * GetNextAcceptJet()
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)
void ConnectParticleContainer(AliParticleContainer *c)
Double_t Pt() const
Definition: AliEmcalJet.h:109
Double_t GetRhoVal(Int_t i=0) const
AliEmcalList * fOutput
!output list
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
void SetJetAcceptanceType(UInt_t type)
bool Bool_t
Definition: External.C:53
void swap(PWGJE::EMCALJetTasks::AliAnalysisTaskEmcalJetHPerformance &first, PWGJE::EMCALJetTasks::AliAnalysisTaskEmcalJetHPerformance &second)
Container for jet within the EMCAL jet framework.
AliEmcalJet * GetJet(Int_t i) const