21 #include <TObjArray.h> 22 #include <TObjString.h> 27 #include <TFileCollection.h> 28 #include <TCollection.h> 29 #include <THashList.h> 31 #include <TFileInfo.h> 33 #include <TClonesArray.h> 40 #include <AliVCluster.h> 41 #include <AliVParticle.h> 50 #include "AliAnalysisManager.h" 51 #include "AliVEventHandler.h" 52 #include "AliAnalysisDataContainer.h" 104 TH1::SetDefaultSumw2(kTRUE);
105 TH2::SetDefaultSumw2(kTRUE);
108 TString histname =
"", groupname =
"", fullgroupname =
"";
112 while ( (jetCont = static_cast<AliJetContainer*>(next())) ) {
116 if (!fTracksCont) { std::cout <<
"********* JET CONTAINER WITHOUT TRACKS CONTAINER *********" << std::endl;
continue; }
117 TClonesArray* fTracksContArray = fTracksCont->
GetArray();
126 if ( ( fNJets_accepted < 1 ) || ( fNaccPart < 1 ) ) {
127 if ( fDebug > 1 ) { std::cout <<
"accepted (fNJets || fNPart) == 0" << std::endl; }
130 if ( fDebug > 1 ) { std::cout <<
"fNJets = " << fNJets_accepted <<
" ; fNPart = " << fNaccPart << std::endl; }
140 groupname = jetCont->
GetName();
145 TString jetstrmin = TString::Itoa((
Int_t)jet_pt_min,10);
146 TString jetstrmax = TString::Itoa((
Int_t)jet_pt_max,10);
149 groupname = groupname +
"_" +
"ptbin" +
"_" + jetstrmin +
"_" + jetstrmax;
153 histname = TString::Format(
"%s/histo1_%d", groupname.Data(),
fCentBin);
156 histname = TString::Format(
"%s/histo2_%d", groupname.Data(),
fCentBin);
159 histname = TString::Format(
"%s/histo3_%d", groupname.Data(),
fCentBin);
162 histname = TString::Format(
"%s/histo4_%d", groupname.Data(),
fCentBin);
165 histname = TString::Format(
"%s/histo4c_%d", groupname.Data(),
fCentBin);
168 histname = TString::Format(
"%s/histo5_%d", groupname.Data(),
fCentBin);
171 histname = TString::Format(
"%s/histo7all_%d", groupname.Data(),
fCentBin);
174 histname = TString::Format(
"%s/histo8_all_pt_%d", groupname.Data(),
fCentBin);
177 histname = TString::Format(
"%s/histo8xi_all_pt_%d", groupname.Data(),
fCentBin);
181 histname = TString::Format(
"%s/histo15all_%d", groupname.Data(),
fCentBin);
184 histname = TString::Format(
"%s/histo15all_n80_%d", groupname.Data(),
fCentBin);
187 histname = TString::Format(
"%s/histo15all_n90_%d", groupname.Data(),
fCentBin);
190 histname = TString::Format(
"%s/histo15all_pt80_%d", groupname.Data(),
fCentBin);
193 histname = TString::Format(
"%s/histo15all_pt90_%d", groupname.Data(),
fCentBin);
197 histname = TString::Format(
"%s/histo20all_%d", groupname.Data(),
fCentBin);
200 histname = TString::Format(
"%s/histo20all_n80_%d", groupname.Data(),
fCentBin);
203 histname = TString::Format(
"%s/histo20all_n90_%d", groupname.Data(),
fCentBin);
206 histname = TString::Format(
"%s/histo20all_pt80_%d", groupname.Data(),
fCentBin);
209 histname = TString::Format(
"%s/histo20all_pt90_%d", groupname.Data(),
fCentBin);
213 histname = TString::Format(
"%s/histo_g_%d", groupname.Data(),
fCentBin);
216 histname = TString::Format(
"%s/histo_g_n80_%d", groupname.Data(),
fCentBin);
219 histname = TString::Format(
"%s/histo_g_n90_%d", groupname.Data(),
fCentBin);
222 histname = TString::Format(
"%s/histo_g_pt80_%d", groupname.Data(),
fCentBin);
225 histname = TString::Format(
"%s/histo_g_pt90_%d", groupname.Data(),
fCentBin);
229 histname = TString::Format(
"%s/histo_ptd_%d", groupname.Data(),
fCentBin);
232 histname = TString::Format(
"%s/histo_ptd_n80_%d", groupname.Data(),
fCentBin);
235 histname = TString::Format(
"%s/histo_ptd_n90_%d", groupname.Data(),
fCentBin);
238 histname = TString::Format(
"%s/histo_ptd_pt80_%d", groupname.Data(),
fCentBin);
241 histname = TString::Format(
"%s/histo_ptd_pt90_%d", groupname.Data(),
fCentBin);
245 histname = TString::Format(
"%s/histo_Rjt_%d", groupname.Data(),
fCentBin);
248 histname = TString::Format(
"%s/histo_Rjt_n80_%d", groupname.Data(),
fCentBin);
251 histname = TString::Format(
"%s/histo_Rjt_n90_%d", groupname.Data(),
fCentBin);
254 histname = TString::Format(
"%s/histo_Rjt_pt80_%d", groupname.Data(),
fCentBin);
257 histname = TString::Format(
"%s/histo_Rjt_pt90_%d", groupname.Data(),
fCentBin);
261 histname = TString::Format(
"%s/histo_jt_%d", groupname.Data(),
fCentBin);
264 histname = TString::Format(
"%s/histo_jt_n80_%d", groupname.Data(),
fCentBin);
267 histname = TString::Format(
"%s/histo_jt_n90_%d", groupname.Data(),
fCentBin);
270 histname = TString::Format(
"%s/histo_jt_pt80_%d", groupname.Data(),
fCentBin);
273 histname = TString::Format(
"%s/histo_jt_pt90_%d", groupname.Data(),
fCentBin);
281 Int_t fNaccClus = -1;
284 fH5->Fill ( fNJets_accepted );
304 for(
auto jet : jetCont->
accepted()) {
305 if (!jet) {
continue; }
308 std::vector< int > jet_sorted_idxvec ;
310 Int_t track_idx = -999;
311 jet_pt = 0. ; jet_npart = 0; jet_nconst = 0;
312 counter_part = 0; counter_pt = 0.;
315 jet_sorted_idxvec.clear();
316 jet_sorted_idxvec = jet->GetPtSortedTrackConstituentIndexes ( fTracksContArray );
319 jet_npart = jet->GetNumberOfTracks();
320 jet_nconst = jet->GetNumberOfConstituents();
323 g_tot = 0.; sum_part_pt_tot = 0.; sum_part_pt2_tot = 0.;
324 g_n90 = 0.; sum_part_pt_n90 = 0.; sum_part_pt2_n90 = 0.;
325 g_n80 = 0.; sum_part_pt_n80 = 0.; sum_part_pt2_n80 = 0.;
326 g_pt90 = 0.; sum_part_pt_pt90 = 0.; sum_part_pt2_pt90 = 0.;
327 g_pt80 = 0.; sum_part_pt_pt80 = 0.; sum_part_pt2_pt80 = 0.;
330 jet_n90 = (
UShort_t ) ( 0.9 * jet_npart );
331 jet_pt90 = 0.9 * jet_pt;
333 jet_n80 = (
UShort_t ) ( 0.8 * jet_npart );
334 jet_pt80 = 0.8 * jet_pt;
336 fH1->Fill ( jet_pt );
337 fH2->Fill ( jet->Eta() );
338 fH3->Fill ( jet->Phi() );
339 fH4->Fill ( jet_npart );
340 fH4c->Fill ( jet_nconst );
341 fH7all->Fill ( jet_pt, jet_nconst );
344 for (std::size_t i = 0; i < jet_npart; i++ ) {
345 track_idx = jet_sorted_idxvec.at (i);
346 AliVParticle* track = jet->TrackAt ( track_idx, fTracksContArray );
347 if (!track) { std::cout <<
"Parsing tracks of jets :: track not defined but it should!!!" << std::endl;
continue; }
349 Double_t dpart = jet->DeltaR ( track );
355 fH8_all_pt->Fill ( z_pt );
356 fH8xi_all_pt->Fill (
CDF::Xi (z_pt) );
358 fH15all->Fill ( dpart, track_pt, track_pt );
359 fH20all->Fill ( dpart );
361 fH_Rjt->Fill ( dpart, jt, jt );
365 g_tot += (track_pt * dpart)/jet_pt;
366 sum_part_pt_tot += TMath::Abs(track_pt);
367 sum_part_pt2_tot += TMath::Power( track_pt, 2 );
370 if ( counter_part <= jet_n90 ) {
371 fH15all_n90->Fill ( dpart, track_pt );
372 fH20all_n90->Fill ( dpart );
373 fH_Rjt_n90->Fill ( dpart, jt, jt );
374 fH_jt_n90->Fill ( jt );
377 g_n90 += (track_pt * dpart)/jet_pt;
378 sum_part_pt_n90 += track_pt;
379 sum_part_pt2_n90 += TMath::Power( track_pt, 2 );
382 if ( counter_pt <= jet_pt90 ) {
383 fH15all_pt90->Fill ( dpart, track_pt );
384 fH20all_pt90->Fill ( dpart );
385 fH_Rjt_pt90->Fill ( dpart, jt, jt );
386 fH_jt_pt90->Fill ( jt );
389 g_pt90 += (track_pt * dpart)/jet_pt;
390 sum_part_pt_pt90 += track_pt;
391 sum_part_pt2_pt90 += TMath::Power( track_pt, 2 );
395 if ( counter_part <= jet_n80 ) {
396 fH15all_n80->Fill ( dpart, track_pt );
397 fH20all_n80->Fill ( dpart );
398 fH_Rjt_n80->Fill ( dpart, jt, jt );
399 fH_jt_n80->Fill ( jt );
402 g_n80 += (track_pt * dpart)/jet_pt;
403 sum_part_pt_n80 += track_pt;
404 sum_part_pt2_n80 += TMath::Power( track_pt, 2 );
407 if ( counter_pt <= jet_pt80 ) {
408 fH15all_pt80->Fill ( dpart, track_pt );
409 fH20all_pt80->Fill ( dpart );
410 fH_Rjt_pt80->Fill ( dpart, jt, jt );
411 fH_jt_pt80->Fill ( jt );
414 g_pt80 += (track_pt * dpart)/jet_pt;
415 sum_part_pt_pt80 += track_pt;
416 sum_part_pt2_pt80 += TMath::Power( track_pt, 2 );
419 ++counter_part; counter_pt += track_pt;
423 fHg_n80->Fill ( g_n80 ); fHg_pt80->Fill ( g_pt80 );
424 fHg_n90->Fill ( g_n90 ); fHg_pt90->Fill ( g_pt90 );
426 if ( sum_part_pt_tot > 1e-8 )
427 { fHptd->Fill( TMath::Sqrt(sum_part_pt2_tot)/sum_part_pt_tot ); }
429 {
if ( fDebug > 2 ) cout <<
"sum_part_pt_tot aprox 0!!!!" << endl; }
431 if ( sum_part_pt_n80 > 1e-8 )
432 { fHptd_n80->Fill( TMath::Sqrt(sum_part_pt2_n80)/sum_part_pt_n80 ); }
434 {
if ( fDebug > 2 ) cout <<
"sum_part_pt_n80 aprox 0!!!!" << endl; }
436 if ( sum_part_pt_n90 > 1e-8 )
437 { fHptd_n90->Fill( TMath::Sqrt(sum_part_pt2_n90)/sum_part_pt_n90 ); }
439 {
if ( fDebug > 2 ) cout <<
"sum_part_pt_n90 aprox 0!!!!" << endl; }
441 if ( sum_part_pt_pt80 > 1e-8 )
442 { fHptd_pt80->Fill( TMath::Sqrt(sum_part_pt2_pt80)/sum_part_pt_pt80 ); }
444 {
if ( fDebug > 2 ) cout <<
"sum_part_pt_pt80 aprox 0!!!!" << endl; }
446 if ( sum_part_pt_pt90 > 1e-8 )
447 { fHptd_pt90->Fill( TMath::Sqrt(sum_part_pt2_pt90)/sum_part_pt_pt90 ); }
449 {
if ( fDebug > 2 ) cout <<
"sum_part_pt_pt90 aprox 0!!!!" << endl; }
465 TString histname =
"", histtitle =
"", groupname =
"", fullgroupname =
"";
468 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
469 groupname = jetCont->
GetName();
474 TString jetstrmin = TString::Itoa((
Int_t)jet_pt_min,10);
475 TString jetstrmax = TString::Itoa((
Int_t)jet_pt_max,10);
478 groupname = groupname +
"_" +
"ptbin" +
"_" + jetstrmin +
"_" + jetstrmax;
484 Double_t h1_high = h1_low + h1_binwidth * h1_nbin;
485 histname = TString::Format(
"%s/histo1_%d", groupname.Data(), cent);
486 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c}) (accepted);Jets", histname.Data());
491 Double_t h2_high = h2_low + h2_binwidth * h2_nbin;
492 histname = TString::Format(
"%s/histo2_%d", groupname.Data(), cent);
493 histtitle = TString::Format(
"%s;#it{#eta}_{jet};Jets", histname.Data());
498 Double_t h3_high = h3_low + h3_binwidth * h3_nbin;
499 histname = TString::Format(
"%s/histo3_%d", groupname.Data(), cent);
500 histtitle = TString::Format(
"%s;#it{#phi}_{jet};Jets", histname.Data());
505 Double_t h4_high = h4_low + h4_binwidth * h4_nbin;
506 histname = TString::Format(
"%s/histo4_%d", groupname.Data(), cent);
507 histtitle = TString::Format(
"%s;N_{tracks}(jet);Jets", histname.Data());
510 histname = TString::Format(
"%s/histo4c_%d", groupname.Data(), cent);
511 histtitle = TString::Format(
"%s;N_{tracks}(jet);Jets", histname.Data());
518 Double_t h5_high = h5_low + h5_binwidth * h5_nbin;
519 histname = TString::Format(
"%s/histo5_%d", groupname.Data(), cent);
520 histtitle = TString::Format(
"%s;N_{jets};Events", histname.Data());
525 Double_t h7_xhigh = h7_xlow + h7_xbinwidth * h7_xnbin;
527 Double_t h7_yhigh = h7_ylow + h7_ybinwidth * h7_ynbin;
529 histname = TString::Format(
"%s/histo7all_%d", groupname.Data(), cent);
530 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/c);N_{tracks}(jets)", histname.Data());
531 fHistManager.
CreateTH2(histname, histtitle, h7_xnbin, h7_xlow, h7_xhigh, h7_ynbin, h7_ylow, h7_yhigh);
535 Double_t h8_high = h8_low + h8_binwidth * h8_nbin;
538 histname = TString::Format(
"%s/histo8_all_pt_%d", groupname.Data(), cent);
539 histtitle = TString::Format(
"%s - all jets Pt;z = p_{T,track}/p_{T,jet1};F(Z) = 1/N_{jets} dN/dz", histname.Data());
544 Double_t h8xi_high = h8xi_low + h8xi_binwidth * h8xi_nbin;
546 histname = TString::Format(
"%s/histo8xi_all_pt_%d", groupname.Data(), cent);
547 histtitle = TString::Format(
"%s - all jets Pt;#xi = ln(1/z);D(#xi) = 1/N_{jets} dN/d#xi", histname.Data());
552 Double_t h15_xhigh = h15_xlow + h15_xbinwidth * h15_xnbin;
554 Double_t h15_yhigh = h15_ylow + h15_ybinwidth * h15_ynbin;
556 histname = TString::Format(
"%s/histo15all_%d", groupname.Data(), cent);
557 histtitle = TString::Format(
"%s - all jets;dR;#it{p}_{T,track} (GeV/c)", histname.Data());
558 fHistManager.
CreateTH2(histname, histtitle, h15_xnbin, h15_xlow, h15_xhigh, h15_ynbin, h15_ylow, h15_yhigh);
561 histname = TString::Format(
"%s/histo15all_n80_%d", groupname.Data(), cent);
562 histtitle = TString::Format(
"%s - all jets;dR;#it{p}_{T,track} (GeV/c)", histname.Data());
563 fHistManager.
CreateTH2(histname, histtitle, h15_xnbin, h15_xlow, h15_xhigh, h15_ynbin, h15_ylow, h15_yhigh);
565 histname = TString::Format(
"%s/histo15all_n90_%d", groupname.Data(), cent);
566 histtitle = TString::Format(
"%s - all jets;dR;#it{p}_{T,track} (GeV/c)", histname.Data());
567 fHistManager.
CreateTH2(histname, histtitle, h15_xnbin, h15_xlow, h15_xhigh, h15_ynbin, h15_ylow, h15_yhigh);
570 histname = TString::Format(
"%s/histo15all_pt80_%d", groupname.Data(), cent);
571 histtitle = TString::Format(
"%s - all jets;dR;#it{p}_{T,track} (GeV/c)", histname.Data());
572 fHistManager.
CreateTH2(histname, histtitle, h15_xnbin, h15_xlow, h15_xhigh, h15_ynbin, h15_ylow, h15_yhigh);
574 histname = TString::Format(
"%s/histo15all_pt90_%d", groupname.Data(), cent);
575 histtitle = TString::Format(
"%s - all jets;dR;#it{p}_{T,track} (GeV/c)", histname.Data());
576 fHistManager.
CreateTH2(histname, histtitle, h15_xnbin, h15_xlow, h15_xhigh, h15_ynbin, h15_ylow, h15_yhigh);
580 Double_t h20_high = h20_low + h20_binwidth * h20_nbin;
583 histname = TString::Format(
"%s/histo20all_%d", groupname.Data(), cent);
584 histtitle = TString::Format(
"%s - all jets;R_{tracks};dN/dR", histname.Data());
588 histname = TString::Format(
"%s/histo20all_n80_%d", groupname.Data(), cent);
589 histtitle = TString::Format(
"%s - all jets;R_{tracks};dN/dR", histname.Data());
592 histname = TString::Format(
"%s/histo20all_n90_%d", groupname.Data(), cent);
593 histtitle = TString::Format(
"%s - all jets;R_{tracks};dN/dR", histname.Data());
597 histname = TString::Format(
"%s/histo20all_pt80_%d", groupname.Data(), cent);
598 histtitle = TString::Format(
"%s - all jets;R_{tracks};dN/dR", histname.Data());
601 histname = TString::Format(
"%s/histo20all_pt90_%d", groupname.Data(), cent);
602 histtitle = TString::Format(
"%s - all jets;R_{tracks};dN/dR", histname.Data());
608 Double_t hg_high = hg_low + hg_binwidth * hg_nbin;
611 histname = TString::Format(
"%s/histo_g_%d", groupname.Data(), cent);
612 histtitle = TString::Format(
"%s - all jets;g;1/N_{jets} dN/dg", histname.Data());
616 histname = TString::Format(
"%s/histo_g_n80_%d", groupname.Data(), cent);
617 histtitle = TString::Format(
"%s - all jets;g;1/N_{jets} dN/dg", histname.Data());
620 histname = TString::Format(
"%s/histo_g_n90_%d", groupname.Data(), cent);
621 histtitle = TString::Format(
"%s - all jets;g;1/N_{jets} dN/dg", histname.Data());
625 histname = TString::Format(
"%s/histo_g_pt80_%d", groupname.Data(), cent);
626 histtitle = TString::Format(
"%s - all jets;g;1/N_{jets} dN/dg", histname.Data());
629 histname = TString::Format(
"%s/histo_g_pt90_%d", groupname.Data(), cent);
630 histtitle = TString::Format(
"%s - all jets;g;1/N_{jets} dN/dg", histname.Data());
636 Double_t hptd_high = hptd_low + hptd_binwidth * hptd_nbin;
639 histname = TString::Format(
"%s/histo_ptd_%d", groupname.Data(), cent);
640 histtitle = TString::Format(
"%s - all jets;ptd;1/N_{jets} dN/dp_{T}D", histname.Data());
644 histname = TString::Format(
"%s/histo_ptd_n80_%d", groupname.Data(), cent);
645 histtitle = TString::Format(
"%s - all jets;ptd;1/N_{jets} dN/dp_{T}D", histname.Data());
648 histname = TString::Format(
"%s/histo_ptd_n90_%d", groupname.Data(), cent);
649 histtitle = TString::Format(
"%s - all jets;ptd;1/N_{jets} dN/dp_{T}D", histname.Data());
653 histname = TString::Format(
"%s/histo_ptd_pt80_%d", groupname.Data(), cent);
654 histtitle = TString::Format(
"%s - all jets;ptd;1/N_{jets} dN/dp_{T}D", histname.Data());
657 histname = TString::Format(
"%s/histo_ptd_pt90_%d", groupname.Data(), cent);
658 histtitle = TString::Format(
"%s - all jets;ptd;1/N_{jets} dN/dp_{T}D", histname.Data());
663 Double_t h_Rjt_xhigh = h_Rjt_xlow + h_Rjt_xbinwidth * h_Rjt_xnbin;
665 Double_t h_Rjt_yhigh = h_Rjt_ylow + h_Rjt_ybinwidth * h_Rjt_ynbin;
668 histname = TString::Format(
"%s/histo_Rjt_%d", groupname.Data(), cent);
669 histtitle = TString::Format(
"%s ;dR;j_{T} (GeV/c);", histname.Data());
670 fHistManager.
CreateTH2(histname, histtitle, h_Rjt_xnbin, h_Rjt_xlow, h_Rjt_xhigh, h_Rjt_ynbin, h_Rjt_ylow, h_Rjt_yhigh);
673 histname = TString::Format(
"%s/histo_Rjt_n80_%d", groupname.Data(), cent);
674 histtitle = TString::Format(
"%s ;dR;j_{T} (GeV/c);", histname.Data());
675 fHistManager.
CreateTH2(histname, histtitle, h_Rjt_xnbin, h_Rjt_xlow, h_Rjt_xhigh, h_Rjt_ynbin, h_Rjt_ylow, h_Rjt_yhigh);
677 histname = TString::Format(
"%s/histo_Rjt_n90_%d", groupname.Data(), cent);
678 histtitle = TString::Format(
"%s ;dR;j_{T} (GeV/c);", histname.Data());
679 fHistManager.
CreateTH2(histname, histtitle, h_Rjt_xnbin, h_Rjt_xlow, h_Rjt_xhigh, h_Rjt_ynbin, h_Rjt_ylow, h_Rjt_yhigh);
682 histname = TString::Format(
"%s/histo_Rjt_pt80_%d", groupname.Data(), cent);
683 histtitle = TString::Format(
"%s ;dR;j_{T} (GeV/c);", histname.Data());
684 fHistManager.
CreateTH2(histname, histtitle, h_Rjt_xnbin, h_Rjt_xlow, h_Rjt_xhigh, h_Rjt_ynbin, h_Rjt_ylow, h_Rjt_yhigh);
686 histname = TString::Format(
"%s/histo_Rjt_pt90_%d", groupname.Data(), cent);
687 histtitle = TString::Format(
"%s ;dR;j_{T} (GeV/c);", histname.Data());
688 fHistManager.
CreateTH2(histname, histtitle, h_Rjt_xnbin, h_Rjt_xlow, h_Rjt_xhigh, h_Rjt_ynbin, h_Rjt_ylow, h_Rjt_yhigh);
693 Double_t h_jt_xhigh = h_jt_xlow + h_jt_xbinwidth * h_jt_xnbin;
696 histname = TString::Format(
"%s/histo_jt_%d", groupname.Data(), cent);
697 histtitle = TString::Format(
"%s ;j_{T} (GeV/c);1/N_{jets} dN/dj_{T};", histname.Data());
701 histname = TString::Format(
"%s/histo_jt_n80_%d", groupname.Data(), cent);
702 histtitle = TString::Format(
"%s ;j_{T} (GeV/c);1/N_{jets} dN/dj_{T};", histname.Data());
705 histname = TString::Format(
"%s/histo_jt_n90_%d", groupname.Data(), cent);
706 histtitle = TString::Format(
"%s ;j_{T} (GeV/c);1/N_{jets} dN/dj_{T};", histname.Data());
710 histname = TString::Format(
"%s/histo_jt_pt80_%d", groupname.Data(), cent);
711 histtitle = TString::Format(
"%s ;j_{T} (GeV/c);1/N_{jets} dN/dj_{T};", histname.Data());
714 histname = TString::Format(
"%s/histo_jt_pt90_%d", groupname.Data(), cent);
715 histtitle = TString::Format(
"%s ;j_{T} (GeV/c);1/N_{jets} dN/dj_{T};", histname.Data());
724 TH1::SetDefaultSumw2(kTRUE);
725 TH2::SetDefaultSumw2(kTRUE);
730 while ((obj = nexthist())) {
fOutput->Add(obj); }
779 Int_t entries =
event->GetNumberOfTracks();
782 std::vector<ptidx_pair> pair_list;
783 pair_list.reserve ( entries );
785 for (
Int_t i_entry = 0; i_entry < entries; i_entry++ )
787 AliVParticle* track =
event->GetTrack ( i_entry );
788 if ( !track ) { std::cout << Form (
"Unable to find track %d in collection %s", i_entry, event->GetName()) << std::endl ;
continue; }
790 pair_list.push_back ( std::make_pair ( track->Pt(), i_entry ) );
793 std::stable_sort ( pair_list.begin(), pair_list.end(),
sort_descend() );
796 std::vector<Int_t> index_sorted_list;
797 index_sorted_list.reserve ( entries );
800 for (
auto it : pair_list) { index_sorted_list.push_back(it.second); }
802 return index_sorted_list;
812 std::vector<ptidx_pair> pair_list;
813 pair_list.reserve ( entries );
817 for(
auto part : partCont->
all()) {
818 if (!part) {
continue;}
819 pair_list.push_back ( std::make_pair ( part->Pt(), i_entry++ ) );
822 std::stable_sort ( pair_list.begin(), pair_list.end(),
sort_descend() );
825 std::vector<Int_t> index_sorted_list;
826 index_sorted_list.reserve ( i_entry );
829 for (
auto it : pair_list) { index_sorted_list.push_back(it.second); }
831 return index_sorted_list;
840 if ( !mgr ) { ::Error (
"AddTaskEmcalJetCDF",
"No analysis manager to connect to." );
return NULL; }
844 AliVEventHandler* handler = mgr->GetInputEventHandler();
845 if (!handler) { ::Error (
"AddTaskEmcalJetCDF",
"This task requires an input event handler" );
return NULL; }
849 if (handler->InheritsFrom(
"AliESDInputHandler")) { dataType =
kESD; }
851 if (handler->InheritsFrom(
"AliAODInputHandler")) { dataType =
kAOD; }
859 TString tracks_mc (ntracks_mc);
862 if ( tracks.EqualTo(
"usedefault") ) {
863 if ( dataType ==
kESD ) { tracks =
"Tracks"; }
865 if ( dataType == kAOD ) { tracks =
"tracks"; }
870 if ( clusters.EqualTo(
"usedefault") ) {
871 if ( dataType ==
kESD ) { clusters =
"CaloClusters"; }
873 if ( dataType == kAOD ) { clusters =
"caloClusters"; }
878 if ( cells.EqualTo(
"usedefault") ) {
879 if (dataType ==
kESD) { cells =
"EMCALCells"; }
881 if (dataType == kAOD) { cells =
"emcalCells"; }
887 if (!tracks.IsNull()) { name +=
"_" + tracks; }
888 if (!clusters.IsNull()) { name +=
"_" + clusters; }
889 if (!cells.IsNull()) { name +=
"_" + cells; }
890 if (!suffix.IsNull()) { name +=
"_" +
suffix; }
896 if ( tracks.EqualTo(
"mcparticles") ) {
898 else if ( tracks.EqualTo(
"tracks") || tracks.EqualTo(
"Tracks") ) {
900 else if ( !tracks.IsNull()) {
904 if ( !tracks_mc.IsNull() ) {
914 mgr->AddTask ( cdfTask );
917 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
919 TString contname = name +
"_histos";
920 TString outfile (Form(
"%s", AliAnalysisManager::GetCommonFileName()));
921 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer ( contname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, outfile.Data() );
923 mgr->ConnectInput ( cdfTask, 0, cinput1 );
924 mgr->ConnectOutput ( cdfTask, 1, coutput1 );
932 if (!jetCont) {
return NULL; }
945 TString sTreeNameArg (cTreeNameArg), treeName;
947 TFileCollection filecoll (
"anachain",
"File collection for analysis");
948 Int_t iAddedFiles = filecoll.AddFromFile(filelist,iNumFiles,iStartWithFile);
949 if ( iAddedFiles < 1 ) { std::cout <<
"NO Files added to collection !!!" << std::endl;
return NULL; }
953 THashList* list = filecoll.GetList();
954 if ( sTreeNameArg.EqualTo(
"auto") ) {
955 TRegexp tree_regex (
"[aod,esd]Tree");
956 TFileInfo* fileinfo =
dynamic_cast<TFileInfo*
>(list->At(0));
957 TFile
file (fileinfo->GetFirstUrl()->GetFile());
958 if (
file.IsZombie()) { cout <<
"Should not reach this message!! Error opening file" << endl;
return NULL; }
961 TIter next(
file.GetListOfKeys());
963 while (( key = dynamic_cast<TKey*>(next()) )) {
964 TString class_name = key->GetClassName();
965 if ( ! class_name.EqualTo(
"TTree") ) {
continue; }
967 TString key_name = key->GetName();
968 if ( key_name.Contains(tree_regex) ) { treeName = key_name;
break;}
973 { treeName = sTreeNameArg ; }
976 if ( chain->AddFileInfoList(list) == 0 ) {
return NULL; }
979 TChain* chainFriend = NULL;
981 if (!sFriends.IsNull()) {
982 TString friends_treename, friends_filename;
984 TObjString* strobj_file =
dynamic_cast<TObjString*
>(arr->At(0));
985 if (strobj_file) { friends_filename = strobj_file->GetString(); }
986 TObjString* strobj_tree =
dynamic_cast<TObjString*
>(arr->At(1));
987 if (strobj_tree) { friends_treename = strobj_tree->GetString(); }
990 if (friends_treename.IsNull()) {
991 if (treeName.EqualTo(
"esdTree")) {
992 friends_treename =
"esdFriendTree"; }
993 else if (treeName.EqualTo(
"aodTree")) {
994 friends_treename =
"aodTree"; }
996 cout <<
"friends argument specified but tree name neither specified nor auto-detected (unknown tree name to associate with known friend tree name)";
1001 chainFriend =
new TChain(friends_treename.Data());
1002 TString friendinfo_for_chain =
"/" + friends_filename +
"/" + friends_treename;
1005 TFileInfo* fileinfo = NULL;
1006 while (( fileinfo = dynamic_cast<TFileInfo*>(next()) )) {
1007 TString dirname =
gSystem->DirName(fileinfo->GetFirstUrl()->GetFile());
1008 TString friend_for_chain = dirname + friendinfo_for_chain;
1009 if (chainFriend) { chainFriend->Add(friend_for_chain.Data()); }
1012 if (chainFriend) { chain->AddFriend(chainFriend); }
AliAnalysisTaskEmcalJetCDF()
THistManager fHistManager
Histogram manager.
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
std::vector< Int_t > SortTracksPt(AliVEvent *event)
Bool_t IsEventSelected()
Performing event selection.
const AliParticleIterableContainer all() const
void SetLeadingHadronType(Int_t t)
Declaration of class AliTLorentzVector.
void ExecOnce()
Perform steps needed to initialize the analysis.
AliClusterContainer * GetClusterContainer() const
Int_t fCentBin
!event centrality bin
void SetPercAreaCut(Float_t p)
void SetVzRange(Double_t min, Double_t max)
Set pre-configured event cut object.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
Container for particles within the EMCAL framework.
void Terminate(Option_t *option)
void UserCreateOutputObjects()
AliParticleContainer * GetParticleContainer() const
void SetMinTrackPt(Float_t b)
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
void SetJetPtCut(Float_t cut)
THashList * GetListOfHistograms() const
Get the list of histograms.
void SetNLeadingJets(Int_t t)
Double_t GetMinPt() const
TObject * GetHistogram(const char *histName)
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Int_t fNcentBins
how many centrality bins
Int_t GetNAcceptedClusters() const
TClonesArray * GetArray() const
Double_t Z_pt(const AliEmcalJet *jet, const AliVParticle *trk)
AliEventCuts fEventCuts
event selection utility
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
TObjArray fJetCollArray
jet collection array
functional for sorting pair by first element - descending
Double_t Perp(const AliVParticle &trk1, const AliVParticle &trk2)
AliJetContainer * jetContSetParams(AliJetContainer *jetCont, Float_t jetptmin=1., Float_t jetptmax=500., Float_t jetareacutperc=0., Int_t leadhadtype=2, Int_t nLeadJets=1, Float_t mintrackpt=0.15, Float_t maxtrackpt=1000.)
const char * GetName() const
virtual Bool_t IsEventSelected()
Performing event selection.
AliEmcalList * fOutput
!output list
virtual ~AliAnalysisTaskEmcalJetCDF()
Destructor.
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
AliAnalysisTaskEmcalJetCDF * AddTaskEmcalJetCDF(const char *ntracks="usedefault", const char *nclusters="usedefault", const char *ncells="usedefault", const char *ntracks_mc="", const char *tag="CDF")
void SelectPhysicalPrimaries(Bool_t s)
TFile * file
TList with histograms for a given trigger.
void SetMakeGeneralHistograms(Bool_t g)
Enable general histograms.
Base task in the EMCAL jet framework.
TChain * CreateChain(const char *filelist="filelist.txt", const char *cTreeNameArg="auto", const char *friends="", UInt_t iNumFiles=-1, UInt_t iStartWithFile=1)
void UserCreateOutputObjects()
Main initialization function on the worker.
Int_t GetNEntries() const
const AliJetIterableContainer accepted() const
Declaration of class AliAnalysisTaskEmcalJetCDF.
EDataType_t
Switch for the data type.
void SetCaloCellsName(const char *n)
Int_t GetNAcceptedParticles() const
void SetMaxTrackPt(Float_t b)
Container structure for EMCAL clusters.
Double_t GetMaxPt() const
Container for MC-true particles within the EMCAL framework.
Container for jet within the EMCAL jet framework.
void SetJetPtCutMax(Float_t cut)
Analysis of jet shapes and FF of all jets and leading jets.