AliPhysics  e6c8d43 (e6c8d43)
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),rand3(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  PseudoTracks.set_user_index(i+fJet->GetNumberOfTracks()+100);
359  fInputVectors.push_back(PseudoTracks);
360  }
361  }
362 
363 
364 
365 
366  fastjet::JetAlgorithm jetalgo(fastjet::antikt_algorithm);
367  if(fReclusteringAlgo==0){ xflagalgo=0.5;
368  jetalgo=fastjet::kt_algorithm ;}
369 
370  if(fReclusteringAlgo==1){ xflagalgo=1.5;
371  jetalgo=fastjet::cambridge_algorithm;
372  }
373  if(fReclusteringAlgo==2){ xflagalgo=2.5;
374  jetalgo=fastjet::antikt_algorithm;
375  }
376 
377  fastjet::JetDefinition fJetDef(jetalgo, 1., static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
378 
379  try {
380  fastjet::ClusterSequence fClustSeqSA(fInputVectors, fJetDef);
381  std::vector<fastjet::PseudoJet> fOutputJets;
382  fOutputJets.clear();
383  fOutputJets=fClustSeqSA.inclusive_jets(0);
384 
385  fastjet::PseudoJet jj;
386  fastjet::PseudoJet j1;
387  fastjet::PseudoJet j2;
388  jj=fOutputJets[0];
389  Int_t n = 0;
390  Double_t jet_pT=jj.perp();
391  while(jj.has_parents(j1,j2)){
392  n++;
393  if(j1.perp() < j2.perp()) swap(j1,j2);
394  double delta_R=j1.delta_R(j2);
395  double z=j2.perp()/(j1.perp()+j2.perp());
396  if(bTruth) {
397  fShapesVar_True[0]=jet_pT;
398  fShapesVar_True[1]=z;
399  fShapesVar_True[2]=delta_R;
400  fShapesVar_True[3]=n;
401  fShapesVar_True[4]=jj.perp();
402  fTreeRecursive_True->Fill();
403  }
404  else {
405  fShapesVar_Det[0]=jet_pT;
406  fShapesVar_Det[1]=z;
407  fShapesVar_Det[2]=delta_R;
408  fShapesVar_Det[3]=n;
409  fShapesVar_Det[4]=jj.perp();
410  fTreeRecursive_Det->Fill();
411  }
412  jj=j1;
413  }
414 
415  } catch (fastjet::Error) {
416  AliError(" [w] FJ Exception caught.");
417  //return -1;
418  }
419  return;
420 }
421 
422 
423 //________________________________________________________________________
425  //
426  // retrieve event objects
427  //
429  return kFALSE;
430 
431  return kTRUE;
432 }
433 
434 
435 //_______________________________________________________________________
437 {
438  // Called once at the end of the analysis.
439 
440 }
441 
442 
444  const char * njetsData, //data jets
445  const char * njetsTrue, //Pyhthia Particle Level
446  const char * njetsDet,
447  const char * njetsHybridUs,
448  const char * njetsHybridS,
449  const Double_t R,
450  const char * nrhoBase,
451  const char * ntracksData,
452  const char * ntracksTrue,
453  const char * ntracksDet,
454  const char * ntracksHybridUs,
455  const char * ntracksHybridS,
456  const char *type,
457  const char *CentEst,
458  Int_t pSel,
459  TString trigClass,
460  TString kEmcalTriggers,
461  TString tag,
464  ) {
465 
466 
467 
468  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
469  if (!mgr)
470  {
471  ::Error("AddTaskRecursiveSoftDrop","No analysis manager found.");
472  return 0;
473  }
474  Bool_t ismc=kFALSE;
475  ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
476 
477  // Check the analysis type using the event handlers connected to the analysis manager.
478  //==============================================================================
479  if (!mgr->GetInputEventHandler())
480  {
481  ::Error("AliAnalysisTaskRecursiveSoftDrop", "This task requires an input event handler");
482  return NULL;
483  }
484  TString wagonName1;
485  TString wagonName2;
486  TString wagonName3;
487 
489  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsData,trigClass.Data(),tag.Data());
490  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsData,trigClass.Data(),tag.Data());
491  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsData,trigClass.Data(),tag.Data());
492  }
494  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsHybridS,trigClass.Data(),tag.Data());
495  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsHybridS,trigClass.Data(),tag.Data());
496  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsHybridS,trigClass.Data(),tag.Data());
497  }
499  wagonName1 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%s",njetsDet,trigClass.Data(),tag.Data());
500  wagonName2 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_Det",njetsDet,trigClass.Data(),tag.Data());
501  wagonName3 = Form("AliAnalysisTaskRecursiveSoftDrop_%s_TC%s%sTree_True",njetsDet,trigClass.Data(),tag.Data());
502  }
503  //Configure jet tagger task
505 
506  task->SetJetShapeSub(jetShapeSub);
507  task->SetJetType(fjetType);
508  task->SetJetRadius(R);
509 
510  AliParticleContainer *trackContData=0x0;
511  AliParticleContainer *trackContDet=0x0;
512  AliParticleContainer *trackContTrue=0x0;
513  AliParticleContainer *trackContHybridS=0x0;
514  AliParticleContainer *trackContHybridUs=0x0;
515 
516  if(fjetType!=AliAnalysisTaskRecursiveSoftDrop::kTrueDet) trackContData = task->AddParticleContainer(ntracksData);
518  trackContDet = task->AddParticleContainer(ntracksDet);
519  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
520  trackContHybridS = task->AddParticleContainer(ntracksHybridS);
521  trackContHybridUs = task->AddParticleContainer(ntracksHybridUs);
522  }
524  trackContDet = task->AddParticleContainer(ntracksDet);
525  trackContTrue = task->AddMCParticleContainer(ntracksTrue);
526  }
527  AliJetContainer *JetContData=0x0;
528  AliJetContainer *JetContTrue=0x0;
529  AliJetContainer *JetContDet=0x0;
530  AliJetContainer *JetContHybridUs=0x0;
531  AliJetContainer *JetContHybridS=0x0;
532  TString strType(type);
533 
535  JetContData = task->AddJetContainer(njetsData,strType,R); //Data
536  if(JetContData) {
537  JetContData->SetRhoName(nrhoBase);
538  JetContData->ConnectParticleContainer(trackContData);
539  JetContData->SetPercAreaCut(0.6);
540  JetContData->SetJetRadius(R);
542  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContData->SetAreaEmcCut(-2);
543  }
544  }
546  JetContHybridS = task->AddJetContainer(njetsHybridS,strType,R); //HybridS
547  if(JetContHybridS) {
548  JetContHybridS->SetRhoName(nrhoBase);
549  JetContHybridS->ConnectParticleContainer(trackContHybridS);
550  JetContHybridS->SetPercAreaCut(0.6);
551  JetContHybridS->SetJetRadius(R);
553  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridS->SetAreaEmcCut(-2);
554  }
555  JetContHybridUs = task->AddJetContainer(njetsHybridUs,strType,R); //HybridUs
556  if(JetContHybridUs) {
557  JetContHybridUs->SetRhoName(nrhoBase);
558  JetContHybridUs->ConnectParticleContainer(trackContHybridUs);
559  JetContHybridUs->SetPercAreaCut(0.6);
560  JetContHybridUs->SetJetRadius(R);
561  JetContHybridUs->SetJetAcceptanceType(AliEmcalJet::kTPCfid);
562  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContHybridUs->SetAreaEmcCut(-2);
563  }
564  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
565  if(JetContDet) {
566  JetContDet->SetRhoName(nrhoBase);
567  JetContDet->ConnectParticleContainer(trackContDet);
568  JetContDet->SetPercAreaCut(0.6);
569  JetContDet->SetJetRadius(R);
571  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
572  }
573  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
574  if(JetContTrue) {
575  JetContTrue->SetRhoName(nrhoBase);
576  JetContTrue->ConnectParticleContainer(trackContTrue);
577  JetContTrue->SetPercAreaCut(0.6);
578  JetContTrue->SetJetRadius(R);
580  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
581  }
582  }
583 
585  JetContDet = task->AddJetContainer(njetsDet,strType,R); //Det
586  if(JetContDet) {
587  JetContDet->SetRhoName(nrhoBase);
588  JetContDet->ConnectParticleContainer(trackContDet);
589  JetContDet->SetPercAreaCut(0.6);
590  JetContDet->SetJetRadius(R);
592  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContDet->SetAreaEmcCut(-2);
593  }
594  JetContTrue = task->AddJetContainer(njetsTrue,strType,R); //True
595  if(JetContTrue) {
596  JetContTrue->SetRhoName(nrhoBase);
597  JetContTrue->ConnectParticleContainer(trackContTrue);
598  JetContTrue->SetPercAreaCut(0.6);
599  JetContTrue->SetJetRadius(R);
601  if(jetShapeSub==AliAnalysisTaskRecursiveSoftDrop::kConstSub) JetContTrue->SetAreaEmcCut(-2);
602  }
603  }
604 
605  task->SetCaloTriggerPatchInfoName(kEmcalTriggers.Data());
606  task->SetCentralityEstimator(CentEst);
607  task->SelectCollisionCandidates(pSel);
608  task->SetUseAliAnaUtils(kFALSE);
609 
610  mgr->AddTask(task);
611 
612  //Connnect input
613  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() );
614 
615  //Connect output
616  TString contName1(wagonName1);
617  TString contName2(wagonName2);
618  TString contName3(wagonName3);
619 
621  contName1 += "_Embedded";
622  contName2 += "_Embedded";
623  contName2 += "_Embedded";
624 
625  }
626 
627 
628  TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
629  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
630  mgr->ConnectOutput(task,1,coutput1);
631  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
632  mgr->ConnectOutput(task,2,coutput2);
633  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile);
634  mgr->ConnectOutput(task,3,coutput3);
635 
636  return task;
637 
638 }
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