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