1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
26 //#include <TVector3.h>
28 #include "AliAnalysisTaskLeadingTrackUE.h"
29 #include "AliAnalyseLeadingTrackUE.h"
30 #include "AliUEHistograms.h"
31 #include "AliUEHist.h"
33 #include "AliAnalysisHelperJetTasks.h"
34 #include "AliAnalysisManager.h"
35 #include "AliAODHandler.h"
36 #include "AliAODInputHandler.h"
37 #include "AliAODMCParticle.h"
38 #include "AliGenPythiaEventHeader.h"
39 #include "AliInputEventHandler.h"
41 #include "AliMCEventHandler.h"
42 #include "AliVParticle.h"
45 ////////////////////////////////////////////////////////////////////////
47 // Analysis class for Underlying Event studies w.r.t. leading track
49 // Look for correlations on the tranverse regions w.r.t
50 // the leading track in the event
52 // This class needs input AODs.
53 // The output is a list of analysis-specific containers.
55 // The AOD can be either connected to the InputEventHandler
56 // for a chain of AOD files
58 // to the OutputEventHandler
59 // for a chain of ESD files,
60 // in this case the class should be in the train after the jet-finder
63 // Arian Abrahantes Quintana
64 // Jan Fiete Grosse-Oetringhaus
65 // Ernesto Lopez Torres
68 ////////////////////////////////////////////////////////////////////////
71 ClassImp( AliAnalysisTaskLeadingTrackUE )
73 // Define global pointer
74 AliAnalysisTaskLeadingTrackUE* AliAnalysisTaskLeadingTrackUE::fgTaskLeadingTrackUE=NULL;
76 //____________________________________________________________________
77 AliAnalysisTaskLeadingTrackUE:: AliAnalysisTaskLeadingTrackUE(const char* name):
78 AliAnalysisTask(name,""),
79 // general configuration
82 fReduceMemoryFootprint(kFALSE),
83 // pointers to UE classes
86 fkTrackingEfficiency(0x0),
87 // handlers and events
97 fMaxJetPtInHist(300.),
99 fnTracksVertex(1), // QA tracks pointing to principal vertex (= 3 default)
103 fLeadingTrackEtaCut(0.8),
106 fUseChargeHadrons(kFALSE),
110 // Default constructor
111 // Define input and output slots here
112 // Input slot #0 works with a TChain
113 DefineInput(0, TChain::Class());
114 // Output slot #0 writes into a TList container
115 DefineOutput(0, TList::Class());
119 AliAnalysisTaskLeadingTrackUE::~AliAnalysisTaskLeadingTrackUE()
123 if (fListOfHistos && !AliAnalysisManager::GetAnalysisManager()->IsProofMode())
124 delete fListOfHistos;
127 /************** INTERFACE METHODS *****************************/
129 //______________________________________________________________
130 Bool_t AliAnalysisTaskLeadingTrackUE::Notify()
133 // Implemented Notify() to read the cross sections
134 // and number of trials from pyxsec.root.
135 // This will be used when merging different MC samples.
136 // (Copied from AliAnalysisTaskJFSystematics)
139 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
140 Float_t xsection = 0;
143 TFile *curfile = tree->GetCurrentFile();
145 Error("Notify","No current file");
149 AliAnalysisHelperJetTasks::PythiaInfoFromFile(curfile->GetName(),xsection,trials);
152 //fHistosUE->GetXsec()->Fill("<#sigma>",xsection);
154 // construct average trials
155 Float_t nEntries = (Float_t)tree->GetTree()->GetEntries();
156 if(trials>=nEntries && nEntries>0.)fAvgTrials = trials/nEntries;
162 //____________________________________________________________________
163 void AliAnalysisTaskLeadingTrackUE::ConnectInputData(Option_t* /*option*/)
166 // Connect the input data
167 if (fDebug > 1) AliInfo("ConnectInputData() ");
169 // Since AODs can either be connected to the InputEventHandler
170 // or to the OutputEventHandler ( the AOD is created by a previus task in the train )
171 // we need to get the pointer to the AODEvent correctly.
173 // Delta AODs are also accepted.
175 TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
177 if( handler && handler->InheritsFrom("AliAODInputHandler") ) { // input AOD
178 fAOD = ((AliAODInputHandler*)handler)->GetEvent();
179 if (fDebug > 1) AliInfo(" ==== Tracks and Jets from AliAODInputHandler");
180 } else { //output AOD
181 handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
182 if( handler && handler->InheritsFrom("AliAODHandler") ) {
183 fAOD = ((AliAODHandler*)handler)->GetAOD();
184 if (fDebug > 1) AliInfo(" ==== Tracks and Jets from AliAODHandler");
186 AliFatal("I can't get any AOD Event Handler");
191 // Initialize common pointers
196 //____________________________________________________________________
197 void AliAnalysisTaskLeadingTrackUE::CreateOutputObjects()
199 // Create the output container
201 if (fDebug > 1) AliInfo("CreateOutputObjects()");
203 // Initialize class with main algorithms, event and track selection.
204 fAnalyseUE = new AliAnalyseLeadingTrackUE();
205 fAnalyseUE->SetParticleSelectionCriteria(fFilterBit, fUseChargeHadrons, fLeadingTrackEtaCut);
206 fAnalyseUE->SetDebug(fDebug);
208 // Initialize output list of containers
209 if (fListOfHistos != NULL){
210 delete fListOfHistos;
211 fListOfHistos = NULL;
214 fListOfHistos = new TList();
215 fListOfHistos->SetOwner(kTRUE);
218 // Initialize class to handle histograms
219 fHistosUE = new AliUEHistograms;
221 // add histograms to list
222 fListOfHistos->Add(fHistosUE);
224 //fListOfHistos->Add(new TH2F("multVsLeadStep5", ";multiplicity;leading pT", 100, -0.5, 99.5, 20, 0, 10));
226 // Add task configuration to output list
230 PostData(0,fListOfHistos);
233 //____________________________________________________________________
234 void AliAnalysisTaskLeadingTrackUE::Exec(Option_t */*option*/)
236 // array of MC particles
238 fArrayMC = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
239 if (!fArrayMC)AliFatal("No array of MC particles found !!!");
242 // Get number of trials from MC header
245 fMcEvent = fMcHandler->MCEvent();
247 // TO-DO: extend to PHOJET
248 AliGenPythiaEventHeader* pythiaGenHeader = AliAnalysisHelperJetTasks::GetPythiaEventHeader(fMcEvent);
250 nTrials = pythiaGenHeader->Trials();
256 //fHistosUE->GetTrials()->Fill("#sum{ntrials}",fAvgTrials);
259 if (fMode) AnalyseCorrectionMode();
260 else AnalyseDataMode();
262 PostData(0,fListOfHistos);
265 //____________________________________________________________________
266 void AliAnalysisTaskLeadingTrackUE::Terminate(Option_t */*option*/)
269 // Terminate analysis
270 if( fDebug > 1 ) AliInfo("End analysis");
272 if (!gROOT->IsBatch()){
273 fListOfHistos = dynamic_cast<TList*> (GetOutputData(0));
275 AliError("Histogram List is not available");
281 AliInfo(" Batch mode, not histograms will be shown...");
287 /******************** ANALYSIS METHODS *****************************/
289 //____________________________________________________________________
290 void AliAnalysisTaskLeadingTrackUE::AddSettingsTree()
292 //Write settings to output list
293 TTree *settingsTree = new TTree("UEAnalysisSettings","Analysis Settings in UE estimation");
294 settingsTree->Branch("fFilterBit", &fFilterBit,"FilterBit/I");
295 settingsTree->Branch("fSelectBit", &fSelectBit,"EventSelectionBit/I");
296 settingsTree->Branch("fLeadingTrackEtaCut", &fLeadingTrackEtaCut, "LeadingTrackEtaCut/D");
297 settingsTree->Branch("fUseChargeHadrons", &fUseChargeHadrons,"UseChHadrons/O");
298 settingsTree->Branch("fkTrackingEfficiency", "TH1D", &fkTrackingEfficiency);
299 settingsTree->Fill();
300 fListOfHistos->Add(settingsTree);
303 //____________________________________________________________________
304 void AliAnalysisTaskLeadingTrackUE::AnalyseCorrectionMode()
306 // Run the analysis on MC to get the correction maps
308 // if fReduceMemoryFootprint step 3,4,5,7,9 are not filled
310 PostData(0,fListOfHistos);
312 if ( fDebug > 3 ) AliInfo( " Processing event in Corrections mode ..." );
314 //PROCESS TYPE (ND,SD,DD)
315 AliAnalysisHelperJetTasks::MCProcessType eventId = AliAnalysisHelperJetTasks::kInvalidProcess;
316 AliGenEventHeader* genHeader = fMcEvent->GenEventHeader();
317 eventId = AliAnalysisHelperJetTasks::GetPythiaEventProcessType(genHeader,kFALSE);
319 eventId = AliAnalysisHelperJetTasks::GetDPMjetEventProcessType(genHeader,kFALSE);
320 if (eventId<0 && fDebug>1)
321 AliInfo("No Pythia or Phojet Header retrived!");
324 if (eventId == AliAnalysisHelperJetTasks::kND)fillId = 0;
325 if (eventId == AliAnalysisHelperJetTasks::kSD)fillId = 1;
326 if (eventId == AliAnalysisHelperJetTasks::kDD)fillId = 2;
329 fHistosUE->FillEvent(fillId, -1);
331 // Only consider MC events within the vtx-z region used also as cut on the reconstructed vertex
332 if (!fAnalyseUE->VertexSelection(fMcEvent, 0, fZVertex))
335 // Get MC-true leading particle (but do not cut out events!)
336 TObjArray *ltMC = (TObjArray*)fAnalyseUE->FindLeadingObjects(fArrayMC);
337 AliVParticle* leadingMC = 0;
339 leadingMC = (AliVParticle*) ltMC->At(0);
341 // it can happen that there is no MC leading particle in the acceptance required (|eta|<0.8)
342 // and we do not want to base the event slection on MC information
344 // Sort MC-true charged particles
345 // as output you get an array of 3 lists of particles belonging to different regions:
348 // - at 2: transverse MIN
349 // - at 3: transverse MAX
350 TObjArray *regionSortedParticlesMC = (TObjArray*)fAnalyseUE->SortRegions(leadingMC, fArrayMC, 0x0);
351 TObjArray *regionsMinMaxMC = (TObjArray*)fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesMC->At(2),(TList*)regionSortedParticlesMC->At(3));
352 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
353 // (MC-true leading particle and MC-true all particles)
355 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepAll,leadingMC,(TList*)regionSortedParticlesMC->At(0),(TList*)regionSortedParticlesMC->At(1),(TList*)regionsMinMaxMC->At(0),(TList*)regionsMinMaxMC->At(1));
357 // Trigger selection ************************************************
358 if (fAnalyseUE->TriggerSelection(fInputHandler))
361 Bool_t select = kFALSE;
362 if (fSelectBit) select = AliAnalysisHelperJetTasks::TestSelectInfo(fSelectBit);
364 fHistosUE->FillEvent(fillId, -2);
368 // Count events that pass AliPhysicsSelection
370 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
371 // (MC-true leading particle and MC-true all particles)
373 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepTriggered,leadingMC,(TList*)regionSortedParticlesMC->At(0),(TList*)regionSortedParticlesMC->At(1),(TList*)regionsMinMaxMC->At(0),(TList*)regionsMinMaxMC->At(1));
375 // count number of MC tracks above 150 MeV/c
377 if (leadingMC && leadingMC->Pt() > 0.15)
379 for (Int_t i=0; i<4; i++)
380 for (Int_t j=0; j<((TList*)regionSortedParticlesMC->At(i))->GetEntries(); j++)
381 if (((AliVParticle*) ((TList*)regionSortedParticlesMC->At(i))->At(j))->Pt() > 0.15)
384 //((TH2F*)fListOfHistos->FindObject("multVsLeadStep5"))->Fill(nMCTracks, leadingMC->Pt());
386 // Vertex selection *************************************************
387 if (fAnalyseUE->VertexSelection(fAOD, fnTracksVertex, fZVertex))
389 // Count events that pass Vertex selection
391 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
392 // (MC-true leading particle and MC-true all particles)
394 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepVertex,leadingMC,(TList*)regionSortedParticlesMC->At(0),(TList*)regionSortedParticlesMC->At(1),(TList*)regionsMinMaxMC->At(0),(TList*)regionsMinMaxMC->At(1));
396 // fill here for tracking efficiency
397 // loop over particle species
398 for (Int_t particleSpecies = 0; particleSpecies < 4; particleSpecies++)
400 TObjArray* primMCParticles = fAnalyseUE->GetAcceptedParticles(fArrayMC, 0x0, kTRUE, particleSpecies);
401 TObjArray* primRecoTracksMatched = fAnalyseUE->GetAcceptedParticles(fAOD, fArrayMC, kTRUE, particleSpecies);
402 TObjArray* allRecoTracksMatched = fAnalyseUE->GetAcceptedParticles(fAOD, fArrayMC, kFALSE, particleSpecies);
404 fHistosUE->FillTrackingEfficiency(primMCParticles, primRecoTracksMatched, allRecoTracksMatched, particleSpecies);
406 delete primMCParticles;
407 delete primRecoTracksMatched;
408 delete allRecoTracksMatched;
411 // Get Reconstructed leading particle *******************************
412 TObjArray *ltRECO = fAnalyseUE->FindLeadingObjects(fAOD);
415 // Count events where a reconstructed track was found in |eta|<0.8
416 // the pT cut will be set when projecting output containers
417 // for leading particle correlation plots
419 fHistosUE->Fill(leadingMC, (AliVParticle*)ltRECO->At(0));
422 // If there is no MC leading track the container is not filled, so the number of entries in the container might be different
423 // from the number of events after the selection, since the selection is based on RECO tracks
424 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
425 // (MC-true leading particle and MC-true all particles)
427 if (!fReduceMemoryFootprint)
428 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepAnaTopology,leadingMC,(TList*)regionSortedParticlesMC->At(0),(TList*)regionSortedParticlesMC->At(1),(TList*)regionsMinMaxMC->At(0),(TList*)regionsMinMaxMC->At(1));
430 //Sort RECO particles w.r.t. MC-leading and return matched (primary) MC particle
431 // (you cannot sort tracks w.r.t. RECO-leading and plot it vs. MC-leading ...)
432 TObjArray *regionSortedParticlesRECOLTMC = (TObjArray*)fAnalyseUE->SortRegions(leadingMC, fAOD, fArrayMC, kTRUE);
433 TObjArray *regionsMinMaxRECOLTMC = (TObjArray*)fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesRECOLTMC->At(2),(TList*)regionSortedParticlesRECOLTMC->At(3));
434 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
435 // (MC leading particle and RECO-matched (quantities from MC particle) all particles)
437 //if (!fReduceMemoryFootprint)
438 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepTrackedOnlyPrim,leadingMC,(TList*)regionSortedParticlesRECOLTMC->At(0),(TList*)regionSortedParticlesRECOLTMC->At(1),(TList*)regionsMinMaxRECOLTMC->At(0),(TList*)regionsMinMaxRECOLTMC->At(1));
439 // comparing this step with step 3 (for all-tracks observables) you get the tracking efficiency
441 //Sort RECO particles w.r.t. MC-leading and return matched (primary+secondary) MC particle
442 // (you cannot sort tracks w.r.t. RECO-leading and plot it vs. MC-leading ...)
443 TObjArray *regionSortedParticlesRECOLTMC2 = (TObjArray*)fAnalyseUE->SortRegions(leadingMC, fAOD, fArrayMC,kFALSE);
444 TObjArray *regionsMinMaxRECOLTMC2 = (TObjArray*)fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesRECOLTMC2->At(2),(TList*)regionSortedParticlesRECOLTMC2->At(3));
446 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
447 // (MC leading particle and RECO-matched (quantities from MC particle) all particles)
449 //if (!fReduceMemoryFootprint)
450 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepTracked,leadingMC,(TList*)regionSortedParticlesRECOLTMC2->At(0),(TList*)regionSortedParticlesRECOLTMC2->At(1),(TList*)regionsMinMaxRECOLTMC2->At(0),(TList*)regionsMinMaxRECOLTMC2->At(1));
451 // comparing this step with step 3 (for all-tracks observables) you get the tracking efficiency
453 // SWITCH TO RECONSTRUCTED TRACKS ************************************
454 // The next steps correspond to track selections
455 // Sort RECO particles w.r.t. RECO-leading and return RECO particle
456 TObjArray *regionSortedParticlesRECO = (TObjArray*)fAnalyseUE->SortRegions((AliVParticle*)ltRECO->At(0), fAOD,0);
457 TObjArray *regionsMinMaxRECO = (TObjArray*)fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesRECO->At(2),(TList*)regionSortedParticlesRECO->At(3));
458 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
459 // (RECO leading particle and RECO all particles)
461 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepReconstructed,(AliVParticle*)ltRECO->At(0),(TList*)regionSortedParticlesRECO->At(0),(TList*)regionSortedParticlesRECO->At(1),(TList*)regionsMinMaxRECO->At(0),(TList*)regionsMinMaxRECO->At(1));
463 // STEP 8 for reduced efficiency study
464 FillReducedEfficiency(fillId, AliUEHist::kCFStepBiasStudy, ltRECO, kFALSE);
465 if (!fReduceMemoryFootprint)
466 FillReducedEfficiency(fillId, AliUEHist::kCFStepBiasStudy2, ltRECO, kTRUE);
468 // count number of reco tracks above 150 MeV/c
469 Int_t nRecoTracks = 0;
470 if (((AliVParticle*) ltRECO->At(0))->Pt() > 0.15)
472 for (Int_t i=0; i<4; i++)
473 for (Int_t j=0; j<((TList*)regionSortedParticlesRECO->At(i))->GetEntries(); j++)
474 if (((AliVParticle*) ((TList*)regionSortedParticlesRECO->At(i))->At(j))->Pt() > 0.15)
477 if (leadingMC && leadingMC->Pt() > 0.5)
478 fHistosUE->GetCorrelationMultiplicity()->Fill(nMCTracks, nRecoTracks);
482 // Match reco leading track with true *********************************
483 Int_t recoLabel = ((AliAODTrack*)ltRECO->At(0))->GetLabel();
484 Int_t mcLabel = ((AliAODMCParticle*)leadingMC)->GetLabel();
485 if (recoLabel != mcLabel)
488 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
489 // (RECO-MATCHED leading particle and RECO all particles)
491 fHistosUE->Fill(fillId,0,AliUEHist::kCFStepRealLeading,(AliVParticle*)ltRECO->At(0),(TList*)regionSortedParticlesRECO->At(0),(TList*)regionSortedParticlesRECO->At(1),(TList*)regionsMinMaxRECO->At(0),(TList*)regionsMinMaxRECO->At(1));
492 // comparing this step with step 6 (for leading-track observables) you get the efficiency to reconstruct the leading track
493 // comparing this step with step 6 (for all-tracks observables) you see how leading-track misidentification affects the final distributions
496 delete regionSortedParticlesRECOLTMC;
497 delete regionsMinMaxRECOLTMC;
498 delete regionSortedParticlesRECOLTMC2;
499 delete regionsMinMaxRECOLTMC2;
500 delete regionSortedParticlesRECO;
501 delete regionsMinMaxRECO;
506 } //phyiscs selection
510 delete regionSortedParticlesMC;
511 delete regionsMinMaxMC;
514 //____________________________________________________________________
515 void AliAnalysisTaskLeadingTrackUE::AnalyseDataMode()
518 // Run the analysis on DATA or MC to get raw distributions
520 PostData(0,fListOfHistos);
522 if ( fDebug > 3 ) AliInfo( " Processing event in Data mode ..." );
525 // Fill the "event-counting-container", it is needed to get the number of events remaining after each event-selection cut
526 fHistosUE->FillEvent(eventId, AliUEHist::kCFStepAll);
528 // Trigger selection ************************************************
529 if (!fAnalyseUE->TriggerSelection(fInputHandler)) return;
531 Bool_t select = kFALSE;
532 if (fSelectBit) select = AliAnalysisHelperJetTasks::TestSelectInfo(fSelectBit);
535 fHistosUE->FillEvent(eventId, -2);
538 // Fill the "event-counting-container", it is needed to get the number of events remaining after each event-selection cut
539 fHistosUE->FillEvent(eventId, AliUEHist::kCFStepTriggered);
541 // Vertex selection *************************************************
542 if(!fAnalyseUE->VertexSelection(fAOD, fnTracksVertex, fZVertex)) return;
543 // Fill the "event-counting-container", it is needed to get the number of events remaining after each event-selection cut
544 fHistosUE->FillEvent(eventId, AliUEHist::kCFStepVertex);
545 // comparing this step with previous one you get the vertex selection efficiency from data (?)
548 // Get Reconstructed leading particle *******************************
549 TObjArray *ltRECO = fAnalyseUE->FindLeadingObjects(fAOD);
552 // fill control distributions
553 fHistosUE->Fill(0, (AliVParticle*)ltRECO->At(0));
555 // Fill the "event-counting-container", it is needed to get the number of events remaining after each event-selection cut
556 fHistosUE->FillEvent(eventId, AliUEHist::kCFStepAnaTopology);
558 // Switch to reconstructed tracks ************************************
559 // Sort RECO particles w.r.t. RECO-leading and return RECO particle
560 TObjArray *regionSortedParticlesRECO = (TObjArray*)fAnalyseUE->SortRegions((AliVParticle*)ltRECO->At(0), fAOD,0);
561 TObjArray *regionsMinMaxRECO = (TObjArray*)fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesRECO->At(2),(TList*)regionSortedParticlesRECO->At(3));
562 // Fill UE containers (step, leading track, towards particles, away particles, transverse MIN and MAX particles)
563 // (RECO leading particle and RECO all particles)
565 fHistosUE->Fill(eventId,0,AliUEHist::kCFStepReconstructed,(AliVParticle*)ltRECO->At(0),(TList*)regionSortedParticlesRECO->At(0),(TList*)regionSortedParticlesRECO->At(1),(TList*)regionsMinMaxRECO->At(0),(TList*)regionsMinMaxRECO->At(1));
567 // STEP 8 and 9 for reduced efficiency study
568 FillReducedEfficiency(eventId, AliUEHist::kCFStepBiasStudy, ltRECO, kFALSE);
569 FillReducedEfficiency(eventId, AliUEHist::kCFStepBiasStudy2, ltRECO, kTRUE);
572 delete regionSortedParticlesRECO;
573 delete regionsMinMaxRECO;
576 //____________________________________________________________________
577 void AliAnalysisTaskLeadingTrackUE::FillReducedEfficiency(Int_t eventId, AliUEHist::CFStep step, const TObjArray* ltRECO, Bool_t twoStep)
579 // remove leading particle using fkTrackingEfficiency and use subleading particle to fill the histograms
581 // if twoStep is kTRUE, do a two step procedure where in each step only 50% of the loss due to the tracking efficiency is applied
583 if (!fkTrackingEfficiency)
586 TObjArray* particleList = new TObjArray(*ltRECO);
587 AliVParticle* leading = (AliVParticle*) particleList->At(0);
594 // remove particles depending on tracking efficiency
595 Int_t count = (twoStep) ? 2 : 1;
597 for (Int_t i=0; i<count; i++)
599 Float_t trackingEff = fkTrackingEfficiency->GetBinContent(fkTrackingEfficiency->GetXaxis()->FindBin(leading->Pt()));
601 trackingEff = 0.5 * (trackingEff + 1);
603 if (gRandom->Uniform() > trackingEff)
605 //Printf("LOWEFF: Removing leading particle");
606 particleList->RemoveAt(0);
607 particleList->Compress();
610 if (particleList->GetEntries() == 0)
616 leading = (AliVParticle*) particleList->At(0);
619 TObjArray *regionSortedParticlesRECOLowEff = fAnalyseUE->SortRegions(leading, particleList, 0);
620 TObjArray *regionsMinMaxRECOLowEff = fAnalyseUE->GetMinMaxRegion((TList*)regionSortedParticlesRECOLowEff->At(2), (TList*)regionSortedParticlesRECOLowEff->At(3));
622 fHistosUE->Fill(eventId,0,step,leading,(TList*)regionSortedParticlesRECOLowEff->At(0), (TList*)regionSortedParticlesRECOLowEff->At(1), (TList*)regionsMinMaxRECOLowEff->At(0), (TList*)regionsMinMaxRECOLowEff->At(1));
624 delete regionSortedParticlesRECOLowEff;
625 delete regionsMinMaxRECOLowEff;
629 //____________________________________________________________________
630 void AliAnalysisTaskLeadingTrackUE::Initialize()
633 fInputHandler = (AliInputEventHandler*)
634 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
636 fMcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());