AliPhysics  8d00e07 (8d00e07)
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 
76 {
77  for(Int_t i=0;i<5;i++){
78  fShapesVar_Det[i]=0;
79  fShapesVar_True[i]=0;
80  }
81  SetMakeGeneralHistograms(kTRUE);
82  DefineOutput(1, TList::Class());
83  DefineOutput(2, TTree::Class());
84  DefineOutput(3, TTree::Class());
85 }
86 
87 //________________________________________________________________________
89  AliAnalysisTaskEmcalJet(name, kTRUE),
90  fContainer(0),
91  fJetShapeSub(kNoSub),
92  fPtThreshold(-9999.),
93  fCentSelectOn(kTRUE),
94  fCentMin(0),
95  fCentMax(10),
96  fJetRadius(0.4),
97  fSharedFractionPtMin(0.5),
98  fReclusteringAlgo(0),
99  fhJetPt(0x0),
100  fhJetPhi(0x0),
101  fhJetEta(0x0),
102  fhDetJetPt_Matched(0x0),
103  fTreeRecursive_Det(0),
104  fTreeRecursive_True(0)
105 {
106  // Standard constructor.
107  for(Int_t i=0;i<5;i++){
108  fShapesVar_Det[i]=0;
109  fShapesVar_True[i]=0;
110  }
112  DefineOutput(1, TList::Class());
113  DefineOutput(2, TTree::Class());
114  DefineOutput(3, TTree::Class());
115 }
116 
117 //________________________________________________________________________
119 {
120  // Destructor.
121 }
122 
123 //________________________________________________________________________
125 {
126  // Create user output.
127 
129 
130  Bool_t oldStatus = TH1::AddDirectoryStatus();
131  TH1::AddDirectory(kFALSE);
132  TH1::AddDirectory(oldStatus);
133  //create a tree used for the MC data and making a 4D response matrix
134  const char* nameoutput = GetOutputSlot(2)->GetContainer()->GetName();
135  fTreeRecursive_Det = new TTree(nameoutput, nameoutput);
136  const char* nameoutput2 = GetOutputSlot(3)->GetContainer()->GetName();
137  fTreeRecursive_True = new TTree(nameoutput2, nameoutput2);
138 
139  const Int_t intBranches = 5;
140 
141  std::vector<TString> fShapesVarNames_Det(intBranches), fShapesVarNames_True(intBranches);
142 
143 
144  fShapesVarNames_Det[0] = "Pt";
145  fShapesVarNames_Det[1] = "Z";
146  fShapesVarNames_Det[2] = "Theta";
147  fShapesVarNames_Det[3] = "N";
148  fShapesVarNames_Det[4] = "ParentPt";
149  fShapesVarNames_True[0] = "Pt_Truth";
150  fShapesVarNames_True[1] = "Z_Truth";
151  fShapesVarNames_True[2] = "Theta_Truth";
152  fShapesVarNames_True[3] = "N_Truth";
153  fShapesVarNames_True[4] = "ParentPt_Truth";
154 
155  for(Int_t ivar=0; ivar < intBranches; ivar++){
156  cout<<"looping over variables"<<endl;
157  fTreeRecursive_Det->Branch(fShapesVarNames_Det[ivar].Data(), &fShapesVar_Det[ivar], Form("%s/D", fShapesVarNames_Det[ivar].Data()));
158  fTreeRecursive_True->Branch(fShapesVarNames_True[ivar].Data(), &fShapesVar_True[ivar], Form("%s/D", fShapesVarNames_True[ivar].Data()));
159  }
160 
161  fhJetPt= new TH1F("fhJetPt", "Jet Pt",1500,-0.5,149.5 );
162  fOutput->Add(fhJetPt);
163  fhJetPhi= new TH1F("fhJetPhi", "Jet Phi",360 , -1.5*(TMath::Pi()), 1.5*(TMath::Pi()));
164  fOutput->Add(fhJetPhi);
165  fhJetEta= new TH1F("fhJetEta", "Jet Eta",100,-2,2);
166  fOutput->Add(fhJetEta);
167  fhDetJetPt_Matched= new TH1F("fhDetJetPt_Matched", "Jet Pt",200,-0.5,199.5 );
169 
170  PostData(1,fOutput);
171  PostData(2,fTreeRecursive_Det);
172  PostData(3,fTreeRecursive_True);
173  // delete [] fShapesVarNames;
174 }
175 
176 //________________________________________________________________________
178 {
179  // Run analysis code here, if needed. It will be executed before FillHistograms().
180 
181 
182  return kTRUE;
183 }
184 
185 //________________________________________________________________________
187 {
188  if (fCentSelectOn){
189  if ((fCent>fCentMax) || (fCent<fCentMin)) return 0;
190  }
191 
192  if(fJetType == kData){
193  AliEmcalJet *Jet1 = NULL; //Original Jet in the event
194  AliJetContainer *JetCont= GetJetContainer(0); //Jet Container for event
195  Double_t JetPhi=0;
196  Double_t JetPt_ForThreshold=0;
197  if(JetCont) {
198  JetCont->ResetCurrentID();
199  while((Jet1=JetCont->GetNextAcceptJet())) {
200  if(!Jet1) continue;
201  if (fJetShapeSub==kNoSub) JetPt_ForThreshold = Jet1->Pt()-(GetRhoVal(0)*Jet1->Area());
202  else JetPt_ForThreshold = Jet1->Pt();
203  if(JetPt_ForThreshold<fPtThreshold) {
204  continue;
205  }
206  else {
207  fhJetPt->Fill(Jet1->Pt());
208  JetPhi=Jet1->Phi();
209  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
210  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
211  fhJetPhi->Fill(JetPhi);
212  fhJetEta->Fill(Jet1->Eta());
213  RecursiveParents(Jet1,JetCont,kFALSE);
214  }
215  }
216  }
217  }
218 
219  if(fJetType == kEmb){
220  AliEmcalJet *JetHybridS = NULL; //Subtracted hybrid Jet
221  AliEmcalJet *JetHybridUS = NULL; //Unsubtracted Hybrid Jet //For matching SubtractedHybrid->DetPythia this jet container is also Subtracted Hybrid
222  AliEmcalJet *JetPythDet = NULL; //Detector Level Pythia Jet
223  AliEmcalJet *JetPythTrue = NULL; //Particle Level Pyhtia Jet
224  AliJetContainer *JetContHybridS= GetJetContainer(0); //Jet Container for Subtracted Hybrid Jets
225  AliJetContainer *JetContHybridUS= GetJetContainer(1); //Jet Container for Unsubtracted Hybrid Jets
226  AliJetContainer *JetContPythDet= GetJetContainer(2); //Jet Container for Detector Level Pyhtia Jets
227  AliJetContainer *JetContPythTrue= GetJetContainer(3); //Jet Container for Particle Level Pythia Jets
228 
229 
230 
231  Bool_t JetsMatched = kFALSE;
232  Double_t JetPtThreshold;
233  JetContHybridS->ResetCurrentID();
234  JetContHybridUS->ResetCurrentID();
235  JetContPythDet->ResetCurrentID();
236  JetContPythTrue->ResetCurrentID();
237 
238  while((JetHybridS = JetContHybridS->GetNextAcceptJet())){ //Get next Subtracted hybrid jet
239  if (fJetShapeSub==kConstSub) JetPtThreshold=JetHybridS->Pt();
240  else JetPtThreshold=JetHybridS->Pt()-(GetRhoVal(0)*JetHybridS->Area());
241  if ( (!JetHybridS) || (JetPtThreshold<fPtThreshold)) continue; //check pT is above threshold
242  Int_t JetNumber=-1;
243  for(Int_t i = 0; i<JetContHybridUS->GetNJets(); i++) {
244  JetHybridUS = JetContHybridUS->GetJet(i); //Get unsubtracted jets in order
245  if (!JetHybridUS) continue;
246 
247  if(JetHybridUS->GetLabel()==JetHybridS->GetLabel()) { //check if it mataches with current subtracted hybrid jet
248  JetNumber=i;
249  }
250  }
251  if(JetNumber==-1) continue;
252  JetHybridUS=JetContHybridUS->GetJet(JetNumber); //Get the matched Unsubtracted jet
253  if (JetContHybridUS->AliJetContainer::GetFractionSharedPt(JetHybridUS)<fSharedFractionPtMin) { //Check that the US closest jet shares a minimum
254  continue; // pT with Detector level pythia jet
255  }
256  JetPythDet=JetHybridUS->ClosestJet(); //get the closest jet that has passed the shared pT cut
257  if (!JetHybridUS) {
258  Printf("Unsubtracted embedded jet does not exist, returning");
259  continue;
260  }
261  if (!JetPythDet) continue;
262  UInt_t rejectionReason = 0;
263  if (!(JetContPythDet->AcceptJet(JetPythDet,rejectionReason))) continue; //Check the detector level just is accepted
264  fhDetJetPt_Matched->Fill(JetPythDet->Pt()); //Fill only matched detector level jets for tagging efficiency comparison
265  JetPythTrue=JetPythDet->ClosestJet(); //Get the corresponding pythia true jet
266  if(!JetPythTrue) continue;
267  JetsMatched=kTRUE; //jets have been matched
268 
269 
270  fhJetPt->Fill(JetHybridS->Pt());
271  Double_t JetPhi=JetHybridS->Phi();
272  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
273  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
274  fhJetPhi->Fill(JetPhi);
275  fhJetEta->Fill(JetHybridS->Eta());
276  RecursiveParents(JetHybridS,JetContHybridS,kFALSE);
277  RecursiveParents(JetPythTrue,JetContPythTrue,kTRUE);
278 
279 
280 
281  }
282  }
283 
284 
285  if(fJetType == kTrueDet){
286  AliEmcalJet *JetPythDet = NULL; //Detector Level Pythia Jet
287  AliEmcalJet *JetPythTrue = NULL; //Particle Level Pyhtia Jet
288  AliJetContainer *JetContPythDet= GetJetContainer(0); //Jet Container for Detector Level Pyhtia Jets
289  AliJetContainer *JetContPythTrue= GetJetContainer(1); //Jet Container for Particle Level Pythia Jets
290 
291 
292 
293  Bool_t JetsMatched = kFALSE;
294  Double_t JetPtThreshold;
295  JetContPythDet->ResetCurrentID();
296  JetContPythTrue->ResetCurrentID();
297 
298  while((JetPythDet = JetContPythDet->GetNextAcceptJet())){ //Get next detector level jet
299  if (fJetShapeSub==kConstSub) JetPtThreshold=JetPythDet->Pt();
300  else JetPtThreshold=JetPythDet->Pt()-(GetRhoVal(0)*JetPythDet->Area());
301  if ( (!JetPythDet) || (JetPtThreshold<fPtThreshold)) continue; //check pT is above threshold
302  Int_t JetNumber=-1;
303  if((JetPythTrue = JetPythDet->ClosestJet())){
304  JetsMatched=kTRUE;
305  }
306  else continue;
307 
308 
309  fhJetPt->Fill(JetPythDet->Pt());
310  Double_t JetPhi=JetPythDet->Phi();
311  if(JetPhi < -1*TMath::Pi()) JetPhi += (2*TMath::Pi());
312  else if (JetPhi > TMath::Pi()) JetPhi -= (2*TMath::Pi());
313  fhJetPhi->Fill(JetPhi);
314  fhJetEta->Fill(JetPythDet->Eta());
315  RecursiveParents(JetPythDet,JetContPythDet,kFALSE);
316  RecursiveParents(JetPythTrue,JetContPythTrue,kTRUE);
317 
318 
319 
320  }
321  }
322 
323 
324  return kTRUE;
325 }
326 
327 //_________________________________________________________________________
329  std::vector<fastjet::PseudoJet> fInputVectors;
330  fInputVectors.clear();
331  fastjet::PseudoJet PseudoTracks;
332  double xflagalgo=0;
333  AliParticleContainer *fTrackCont = fJetCont->GetParticleContainer();
334 
335  if (fTrackCont) for (Int_t i=0; i<fJet->GetNumberOfTracks(); i++) {
336  AliVParticle *fTrk = fJet->TrackAt(i, fTrackCont->GetArray());
337  if (!fTrk) continue;
338  PseudoTracks.reset(fTrk->Px(), fTrk->Py(), fTrk->Pz(),fTrk->E());
339  PseudoTracks.set_user_index(fJet->TrackAt(i)+100);
340  fInputVectors.push_back(PseudoTracks);
341 
342  }
343 
344 
345 
346  fastjet::JetAlgorithm jetalgo(fastjet::antikt_algorithm);
347  if(fReclusteringAlgo==0){ xflagalgo=0.5;
348  jetalgo=fastjet::kt_algorithm ;}
349 
350  if(fReclusteringAlgo==1){ xflagalgo=1.5;
351  jetalgo=fastjet::cambridge_algorithm;
352  }
353  if(fReclusteringAlgo==2){ xflagalgo=2.5;
354  jetalgo=fastjet::antikt_algorithm;
355  }
356 
357  fastjet::JetDefinition fJetDef(jetalgo, 1., static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
358 
359  try {
360  fastjet::ClusterSequence fClustSeqSA(fInputVectors, fJetDef);
361  std::vector<fastjet::PseudoJet> fOutputJets;
362  fOutputJets.clear();
363  fOutputJets=fClustSeqSA.inclusive_jets(0);
364 
365  fastjet::PseudoJet jj;
366  fastjet::PseudoJet j1;
367  fastjet::PseudoJet j2;
368  jj=fOutputJets[0];
369  Int_t n = 0;
370  Double_t jet_pT=jj.perp();
371  while(jj.has_parents(j1,j2)){
372  n++;
373  if(j1.perp() < j2.perp()) swap(j1,j2);
374  double delta_R=j1.delta_R(j2);
375  double z=j2.perp()/(j1.perp()+j2.perp());
376  if(bTruth) {
377  fShapesVar_True[0]=jet_pT;
378  fShapesVar_True[1]=z;
379  fShapesVar_True[2]=delta_R;
380  fShapesVar_True[3]=n;
381  fShapesVar_True[4]=jj.perp();
382  fTreeRecursive_True->Fill();
383  }
384  else {
385  fShapesVar_Det[0]=jet_pT;
386  fShapesVar_Det[1]=z;
387  fShapesVar_Det[2]=delta_R;
388  fShapesVar_Det[3]=n;
389  fShapesVar_Det[4]=jj.perp();
390  fTreeRecursive_Det->Fill();
391  }
392  jj=j1;
393  }
394 
395  } catch (fastjet::Error) {
396  AliError(" [w] FJ Exception caught.");
397  //return -1;
398  }
399  return;
400 }
401 
402 
403 //________________________________________________________________________
405  //
406  // retrieve event objects
407  //
409  return kFALSE;
410 
411  return kTRUE;
412 }
413 
414 
415 //_______________________________________________________________________
417 {
418  // Called once at the end of the analysis.
419 
420 }
421 
422 
424  const char * njetsData, //data jets
425  const char * njetsTrue, //Pyhthia Particle Level
426  const char * njetsDet,
427  const char * njetsHybridUs,
428  const char * njetsHybridS,
429  const Double_t R,
430  const char * nrhoBase,
431  const char * ntracksData,
432  const char * ntracksTrue,
433  const char * ntracksDet,
434  const char * ntracksHybridUs,
435  const char * ntracksHybridS,
436  const char *type,
437  const char *CentEst,
438  Int_t pSel,
439  TString trigClass,
440  TString kEmcalTriggers,
441  TString tag,
444  ) {
445 
446 
447 
448  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
449  if (!mgr)
450  {
451  ::Error("AddTaskRecursiveSoftDrop","No analysis manager found.");
452  return 0;
453  }
454  Bool_t ismc=kFALSE;
455  ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
456 
457  // Check the analysis type using the event handlers connected to the analysis manager.
458  //==============================================================================
459  if (!mgr->GetInputEventHandler())
460  {
461  ::Error("AliAnalysisTaskRecursiveSoftDrop", "This task requires an input event handler");
462  return NULL;
463  }
464  TString wagonName1;
465  TString wagonName2;
466  TString wagonName3;
467 
469  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsData,trigClass.Data(),tag.Data());
470  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsData,trigClass.Data(),tag.Data());
471  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsData,trigClass.Data(),tag.Data());
472  }
474  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsHybridS,trigClass.Data(),tag.Data());
475  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsHybridS,trigClass.Data(),tag.Data());
476  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsHybridS,trigClass.Data(),tag.Data());
477  }
479  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsDet,trigClass.Data(),tag.Data());
480  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsDet,trigClass.Data(),tag.Data());
481  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsDet,trigClass.Data(),tag.Data());
482  }
483  //Configure jet tagger task
485 
486  task->SetJetShapeSub(jetShapeSub);
487  task->SetJetType(fjetType);
488  task->SetJetRadius(R);
489 
490  AliParticleContainer *trackContData=0x0;
491  AliParticleContainer *trackContDet=0x0;
492  AliParticleContainer *trackContTrue=0x0;
493  AliParticleContainer *trackContHybridS=0x0;
494  AliParticleContainer *trackContHybridUs=0x0;
495 
496  if(fjetType!=AliAnalysisTaskRecursiveSoftDrop::kTrueDet) trackContData = task->AddParticleContainer(ntracksData);
498  trackContDet = task->AddParticleContainer(ntracksDet);
499  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
500  trackContHybridS = task->AddParticleContainer(ntracksHybridS);
501  trackContHybridUs = task->AddParticleContainer(ntracksHybridUs);
502  }
504  trackContDet = task->AddParticleContainer(ntracksDet);
505  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
506  }
507  AliJetContainer *JetContData=0x0;
508  AliJetContainer *JetContTrue=0x0;
509  AliJetContainer *JetContDet=0x0;
510  AliJetContainer *JetContHybridUs=0x0;
511  AliJetContainer *JetContHybridS=0x0;
512  TString strType(type);
513 
515  JetContData = task->AddJetContainer(njetsData,strType,R); //Data
516  if(JetContData) {
517  JetContData->SetRhoName(nrhoBase);
518  JetContData->ConnectParticleContainer(trackContData);
519  JetContData->SetPercAreaCut(0.6);
520  JetContData->SetJetRadius(R);
522  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContData->SetAreaEmcCut(-2);
523  }
524  }
526  JetContHybridS = task->AddJetContainer(njetsHybridS,strType,R); //HybridS
527  if(JetContHybridS) {
528  JetContHybridS->SetRhoName(nrhoBase);
529  JetContHybridS->ConnectParticleContainer(trackContHybridS);
530  JetContHybridS->SetPercAreaCut(0.6);
531  JetContHybridS->SetJetRadius(R);
533  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridS->SetAreaEmcCut(-2);
534  }
535  JetContHybridUs = task->AddJetContainer(njetsHybridUs,strType,R); //HybridUs
536  if(JetContHybridUs) {
537  JetContHybridUs->SetRhoName(nrhoBase);
538  JetContHybridUs->ConnectParticleContainer(trackContHybridUs);
539  JetContHybridUs->SetPercAreaCut(0.6);
540  JetContHybridUs->SetJetRadius(R);
541  JetContHybridUs->SetJetAcceptanceType(AliEmcalJet::kTPCfid);
542  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridUs->SetAreaEmcCut(-2);
543  }
544  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
545  if(JetContDet) {
546  JetContDet->SetRhoName(nrhoBase);
547  JetContDet->ConnectParticleContainer(trackContDet);
548  JetContDet->SetPercAreaCut(0.6);
549  JetContDet->SetJetRadius(R);
551  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
552  }
553  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
554  if(JetContTrue) {
555  JetContTrue->SetRhoName(nrhoBase);
556  JetContTrue->ConnectParticleContainer(trackContTrue);
557  JetContTrue->SetPercAreaCut(0.6);
558  JetContTrue->SetJetRadius(R);
560  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
561  }
562  }
563 
565  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
566  if(JetContDet) {
567  JetContDet->SetRhoName(nrhoBase);
568  JetContDet->ConnectParticleContainer(trackContDet);
569  JetContDet->SetPercAreaCut(0.6);
570  JetContDet->SetJetRadius(R);
572  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
573  }
574  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
575  if(JetContTrue) {
576  JetContTrue->SetRhoName(nrhoBase);
577  JetContTrue->ConnectParticleContainer(trackContTrue);
578  JetContTrue->SetPercAreaCut(0.6);
579  JetContTrue->SetJetRadius(R);
581  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
582  }
583  }
584 
585  task->SetCaloTriggerPatchInfoName(kEmcalTriggers.Data());
586  task->SetCentralityEstimator(CentEst);
587  task->SelectCollisionCandidates(pSel);
588  task->SetUseAliAnaUtils(kFALSE);
589 
590  mgr->AddTask(task);
591 
592  //Connnect input
593  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() );
594 
595  //Connect output
596  TString contName1(wagonName1);
597  TString contName2(wagonName2);
598  TString contName3(wagonName3);
599 
601  contName1 += "_Embedded";
602  contName2 += "_Embedded";
603  contName2 += "_Embedded";
604 
605  }
606 
607 
608  TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
609  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
610  mgr->ConnectOutput(task,1,coutput1);
611  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
612  mgr->ConnectOutput(task,2,coutput2);
613  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
614  mgr->ConnectOutput(task,3,coutput3);
615 
616  return task;
617 
618 }
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