8 #include "TDatabasePDG.h"
11 #include "AliMCEvent.h"
12 #include "AliMCParticle.h"
13 #include "AliESDtrackCuts.h"
14 #include "AliESDInputHandler.h"
15 #include "AliESDpid.h"
16 #include "AliAODInputHandler.h"
17 #include "AliAODEvent.h"
18 #include "AliAODMCParticle.h"
19 #include "AliCentrality.h"
20 #include "AliTracker.h"
22 #include "AliAnalysisNetParticleHelper.h"
26 // Task for NetParticle checks
27 // Author: Jochen Thaeder <jochen@thaeder.de>
29 ClassImp(AliAnalysisNetParticleHelper)
32 * ---------------------------------------------------------------------------------
34 * ---------------------------------------------------------------------------------
37 const Char_t* aPartNames[AliPID::kSPECIES][2] = {
45 const Char_t* aPartTitles[AliPID::kSPECIES][2] = {
46 {"Electron", "Positron"},
47 {"Anti-Muon", "Muon"},
48 {"Anti-Pion", "Proton"},
49 {"Anti-Kaon", "Kaon"},
50 {"Anti-Proton", "Proton"}
53 const Char_t* aPartTitlesLatex[AliPID::kSPECIES][2] = {
55 {"#mu^{-}", "#mu^{+}" },
56 {"#pi^{-}", "#pi^{+}" },
61 const Char_t* aControlPartNames[2] = {"lambdabar", "lambda"};
62 const Char_t* aControlPartTitles[2] = {"Anti-Lambda", "Lambda"};
65 * ---------------------------------------------------------------------------------
66 * Constructor / Destructor
67 * ---------------------------------------------------------------------------------
70 //________________________________________________________________________
71 AliAnalysisNetParticleHelper::AliAnalysisNetParticleHelper() :
81 fCentralityPercentile(-1.),
86 fMinTrackLengthMC(70.),
90 fParticleSpecies(AliPID::kProton),
91 fControlParticleCode(3122),
92 fControlParticleIsNeutral(kTRUE),
93 fControlParticleName("Lambda"),
97 fMinPtForTOFRequired(0.8),
106 fHCentralityStat(NULL),
107 fNCentralityBins(10),
114 AliLog::SetClassDebugLevel("AliAnalysisNetParticleHelper",10);
117 //________________________________________________________________________
118 AliAnalysisNetParticleHelper::~AliAnalysisNetParticleHelper() {
121 for (Int_t jj = 0; jj < 2; ++jj) {
122 if (fCorr0[jj]) delete[] fCorr0[jj];
123 if (fCorr1[jj]) delete[] fCorr1[jj];
125 if (fCorr0) delete[] fCorr0;
126 if (fCorr1) delete[] fCorr1;
132 * ---------------------------------------------------------------------------------
134 * ---------------------------------------------------------------------------------
137 //________________________________________________________________________
138 void AliAnalysisNetParticleHelper::SetParticleSpecies(AliPID::EParticleType pid) {
139 // -- Set particle species (ID, Name, Title, Title LATEX)
141 if( (Int_t)pid < 0 || (Int_t)pid > AliPID::kSPECIES){
142 AliWarning("Particle ID not in AliPID::kSPECIES --> Set to protons");
143 pid = AliPID::kProton;
146 fParticleSpecies = pid;
148 for (Int_t idxPart = 0; idxPart < 2; ++idxPart) {
149 fPartName[idxPart] = aPartNames[fParticleSpecies][idxPart];
150 fPartTitle[idxPart] = aPartTitles[fParticleSpecies][idxPart];
151 fPartTitleLatex[idxPart] = aPartTitlesLatex[fParticleSpecies][idxPart];
157 * ---------------------------------------------------------------------------------
159 * ---------------------------------------------------------------------------------
162 //________________________________________________________________________
163 TString AliAnalysisNetParticleHelper::GetParticleName(Int_t idxPart) {
164 // -- Get particle Name
166 if( idxPart != 0 && idxPart != 1){
167 AliWarning("Particle type not known --> Set to antiparticles");
171 return fPartName[idxPart];
174 //________________________________________________________________________
175 TString AliAnalysisNetParticleHelper::GetParticleTitle(Int_t idxPart) {
176 // -- Get particle Title
178 if( idxPart != 0 && idxPart != 1){
179 AliWarning("Particle type not known --> Set to antiparticles");
183 return fPartTitle[idxPart];
186 //________________________________________________________________________
187 TString AliAnalysisNetParticleHelper::GetParticleTitleLatex(Int_t idxPart) {
188 // -- Get particle Title LATEX
190 if( idxPart != 0 && idxPart != 1){
191 AliWarning("Particle type not known --> Set to antiparticles");
195 return fPartTitleLatex[idxPart];
198 //________________________________________________________________________
199 TString AliAnalysisNetParticleHelper::GetControlParticleName(Int_t idxPart) {
200 // -- Get particle Title LATEX
202 if( idxPart != 0 && idxPart != 1){
203 AliWarning("Particle type not known --> Set to antiparticles");
207 return aControlPartNames[idxPart];
210 //________________________________________________________________________
211 TString AliAnalysisNetParticleHelper::GetControlParticleTitle(Int_t idxPart) {
212 // -- Get particle Title LATEX
214 if( idxPart != 0 && idxPart != 1){
215 AliWarning("Particle type not known --> Set to antiparticles");
219 return aControlPartTitles[idxPart];
223 * ---------------------------------------------------------------------------------
225 * ---------------------------------------------------------------------------------
228 //________________________________________________________________________
229 Int_t AliAnalysisNetParticleHelper::Initialize(Bool_t isMC) {
230 // -- Initialize helper
234 // -- Setup event cut statistics
235 InitializeEventStats();
237 // -- Setup trigger statistics
238 InitializeTriggerStats();
240 // -- Setup centrality statistics
241 InitializeCentralityStats();
243 // -- Load Eta correction function
244 iResult = InitializeEtaCorrection(isMC);
246 // -- Load track by track correction function
247 iResult = InitializeTrackbyTrackCorrection();
252 //________________________________________________________________________
253 Int_t AliAnalysisNetParticleHelper::SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent) {
256 // -- Get ESD objects
258 fESDHandler = esdHandler;
259 fPIDResponse = esdHandler->GetPIDResponse();
260 fESD = fESDHandler->GetEvent();
263 // -- Get AOD objects
265 fAODHandler = aodHandler;
266 fPIDResponse = aodHandler->GetPIDResponse();
267 fAOD = fAODHandler->GetEvent();
273 fStack = fMCEvent->Stack();
275 // -- Get event centrality
276 // > 0-5|5-10|10-20|20-30|30-40|40-50|50-60|60-70|70-80|80-90 --> 10 bins
277 // > 0 1 2 3 4 5 6 7 8 9
279 AliCentrality *centrality = NULL;
282 centrality = fESD->GetCentrality();
284 centrality = fAOD->GetHeader()->GetCentralityP();
286 Int_t centBin = centrality->GetCentralityClass10("V0M");
288 fCentralityBin = centrality->GetCentralityClass5("V0M");
289 else if (centBin == 10 || centBin == -1.)
291 else if (centBin > 0 && centBin < fNCentralityBins)
292 fCentralityBin = centBin + 1;
296 // -- Stay within the max centrality bin
297 if (fCentralityBin >= fCentralityBinMax)
300 fCentralityPercentile = centrality->GetCentralityPercentile("V0M");
303 // -- Update TPC pid with eta correction (only for ESDs?) XXX
304 UpdateEtaCorrectedTPCPid();
311 * ---------------------------------------------------------------------------------
312 * Event / Trigger Statistics
313 * ---------------------------------------------------------------------------------
316 //________________________________________________________________________
317 Bool_t AliAnalysisNetParticleHelper::IsEventTriggered() {
318 // -- Check if Event is triggered and fill Trigger Histogram
320 Bool_t *aTriggerFired = new Bool_t[fNTriggers];
321 for (Int_t ii = 0; ii < fNTriggers; ++ii)
322 aTriggerFired[ii] = kFALSE;
325 if ((fESDHandler->IsEventSelected() & AliVEvent::kMB)) aTriggerFired[0] = kTRUE;
326 if ((fESDHandler->IsEventSelected() & AliVEvent::kCentral)) aTriggerFired[1] = kTRUE;
327 if ((fESDHandler->IsEventSelected() & AliVEvent::kSemiCentral)) aTriggerFired[2] = kTRUE;
328 if ((fESDHandler->IsEventSelected() & AliVEvent::kEMCEJE)) aTriggerFired[3] = kTRUE;
329 if ((fESDHandler->IsEventSelected() & AliVEvent::kEMCEGA)) aTriggerFired[4] = kTRUE;
331 else if(fAODHandler){
332 if ((fAODHandler->IsEventSelected() & AliVEvent::kMB)) aTriggerFired[0] = kTRUE;
333 if ((fAODHandler->IsEventSelected() & AliVEvent::kCentral)) aTriggerFired[1] = kTRUE;
334 if ((fAODHandler->IsEventSelected() & AliVEvent::kSemiCentral)) aTriggerFired[2] = kTRUE;
335 if ((fAODHandler->IsEventSelected() & AliVEvent::kEMCEJE)) aTriggerFired[3] = kTRUE;
336 if ((fAODHandler->IsEventSelected() & AliVEvent::kEMCEGA)) aTriggerFired[4] = kTRUE;
339 Bool_t isTriggered = kFALSE;
341 for (Int_t ii=0; ii<fNTriggers; ++ii) {
342 if(aTriggerFired[ii]) {
344 fHTriggerStat->Fill(ii);
348 delete[] aTriggerFired;
353 //________________________________________________________________________
354 Bool_t AliAnalysisNetParticleHelper::IsEventRejected() {
355 // -- Evaluate event statistics histograms
357 Int_t *aEventCuts = new Int_t[fHEventStatMax];
358 // set aEventCuts[ii] to 1 in case of reject
360 for (Int_t ii=0;ii<fHEventStatMax; ++ii)
365 // -- 0 - Before Physics Selection
366 aEventCuts[iCut] = 0;
368 // -- 1 - No Trigger fired
370 if (!IsEventTriggered())
371 aEventCuts[iCut] = 1;
375 const AliESDVertex* vtxESD = NULL;
376 const AliAODVertex* vtxAOD = NULL;
378 vtxESD = fESD->GetPrimaryVertexTracks();
380 aEventCuts[iCut] = 1;
383 vtxAOD = fAOD->GetPrimaryVertex();
385 aEventCuts[iCut] = 1;
388 // -- 3 - Vertex z outside cut window
391 if(TMath::Abs(vtxESD->GetZv()) > fVertexZMax)
392 aEventCuts[iCut] = 1;
395 if(TMath::Abs(vtxAOD->GetZ()) > fVertexZMax)
396 aEventCuts[iCut] = 1;
399 aEventCuts[iCut] = 1;
401 // -- 4 - Centrality = -1 (no centrality or not hadronic)
403 if(fCentralityBin == -1.)
404 aEventCuts[iCut] = 1;
406 // -- 5 - Centrality < fCentralityMax
408 if(fCentralityBin == -2.)
409 aEventCuts[iCut] = 1;
411 // -- Fill statistics / reject event
412 Bool_t isRejected = FillEventStats(aEventCuts);
421 * ---------------------------------------------------------------------------------
422 * Accept Particle Methods - private
423 * ---------------------------------------------------------------------------------
426 //________________________________________________________________________
427 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicCharged(TParticle *particle, Int_t idxMC) {
428 // -- Check if MC particle is accepted for basic parameters
433 // -- check if PDF code exists
434 if (!particle->GetPDG())
437 // -- check if charged
438 if (particle->GetPDG()->Charge() == 0.0)
441 // -- check if physical primary
442 if(!fStack->IsPhysicalPrimary(idxMC))
447 //________________________________________________________________________
448 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicCharged(AliAODMCParticle *particle) {
449 // -- Check if MC particle is accepted for basic parameters
454 // -- check if PDF code exists
455 if (!(TDatabasePDG::Instance()->GetParticle(particle->PdgCode())))
458 // -- check if charged
459 if ((TDatabasePDG::Instance()->GetParticle(particle->PdgCode()))->Charge() == 0.0)
462 // -- check if physical primary
463 if(!particle->IsPhysicalPrimary())
468 //________________________________________________________________________
469 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicNeutral(TParticle *particle, Int_t idxMC) {
470 // -- Check if MC particle is accepted for basic parameters
475 // -- check if PDF code exists
476 if (!particle->GetPDG())
479 // -- check if neutral
480 if (particle->GetPDG()->Charge() != 0.0)
483 // -- check if physical primary
484 if(!fStack->IsPhysicalPrimary(idxMC))
489 //________________________________________________________________________
490 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicNeutral(AliAODMCParticle *particle) {
491 // -- Check if MC particle is accepted for basic parameters
496 // -- check if PDF code exists
497 if (!(TDatabasePDG::Instance()->GetParticle(particle->PdgCode())))
500 // -- check if charged
501 if ((TDatabasePDG::Instance()->GetParticle(particle->PdgCode()))->Charge() != 0.0)
504 // -- check if physical primary
505 if(!particle->IsPhysicalPrimary())
510 //________________________________________________________________________
511 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedRapidity(TParticle *particle, Double_t &yP) {
512 // -- Check if particle is accepted
514 // > return 0 if not accepted
516 Double_t mP = AliPID::ParticleMass(fParticleSpecies);
518 // -- Calculate rapidities and kinematics
519 Double_t p = particle->P();
520 Double_t pz = particle->Pz();
522 Double_t eP = TMath::Sqrt(p*p + mP*mP);
523 yP = 0.5 * TMath::Log((eP + pz) / (eP - pz));
525 // -- Check Rapidity window
526 if (TMath::Abs(yP) > fRapidityMax)
532 //_____________________________________________________________________________
533 Bool_t AliAnalysisNetParticleHelper::IsParticleFindable(Int_t label) {
534 // -- Check if MC particle is findable tracks
536 AliMCParticle *mcParticle = static_cast<AliMCParticle*>(fMCEvent->GetTrack(label));
541 Float_t tpcTrackLength = mcParticle->GetTPCTrackLength(AliTracker::GetBz(), 0.05, counter, 3.0);
543 return (tpcTrackLength > fMinTrackLengthMC);
547 * ---------------------------------------------------------------------------------
548 * Accept Track Methods - public
549 * ---------------------------------------------------------------------------------
552 //________________________________________________________________________
553 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedBasicCharged(AliESDtrack *track) {
554 // -- Check if track is accepted
555 // > for basic parameters
560 if (track->Charge() == 0)
563 // -- Get momentum for dEdx
564 if (!track->GetInnerParam())
570 //________________________________________________________________________
571 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedBasicCharged(AliAODTrack *track) {
572 // -- Check if track is accepted
573 // > for basic parameters
578 if (track->Charge() == 0)
581 //// -- Get momentum for dEdx --> returns always ZERO XXX
582 //if (!track->GetInnerParam())
588 //________________________________________________________________________
589 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP) {
590 // -- Check if track is accepted
592 // > return 0 if not accepted
594 Double_t mP = AliPID::ParticleMass(fParticleSpecies);
596 // -- Calculate rapidities and kinematics
598 track->GetPxPyPz(pvec);
600 Double_t p = track->P();
601 Double_t eP = TMath::Sqrt(p*p + mP*mP);
602 yP = 0.5 * TMath::Log((eP + pvec[2]) / (eP - pvec[2]));
604 // -- Check Rapidity window
605 if (TMath::Abs(yP) > fRapidityMax)
611 //________________________________________________________________________
612 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedDCA(AliESDtrack *track) { //ONLY FOR ESDs so far XXX
613 // -- Check if track is accepted
614 // > for DCA, if both SPD layers have hits
616 Bool_t isAccepted = kTRUE;
619 if (track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) {
621 // -- Get DCA nSigmas
622 Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
623 track->GetImpactParameters(dca,cov);
625 Float_t nSigmaCdd = (cov[0] != 0.) ? dca[0]/TMath::Sqrt(cov[0]) : -9.99;
626 Float_t nSigmaCzz = (cov[2] != 0.) ? dca[1]/TMath::Sqrt(cov[2]) : -9.99;
628 if (fNSigmaMaxCdd != 0.) {
629 if (TMath::Abs(nSigmaCdd) > fNSigmaMaxCdd)
633 if (fNSigmaMaxCzz != 0.) {
634 if (TMath::Abs(nSigmaCzz) > fNSigmaMaxCzz)
642 //________________________________________________________________________
643 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedPID(AliVTrack *track, Double_t* pid) {
644 // -- Check if track is accepted
645 // > provides TPC and TOF nSigmas to the argument
647 Bool_t isAcceptedTPC = kFALSE;
648 Bool_t isAcceptedTOF = kTRUE;
651 pid[0] = fPIDResponse->NumberOfSigmasTPC(track, fParticleSpecies);
652 pid[1] = fPIDResponse->NumberOfSigmasTOF(track, fParticleSpecies);
654 // -- Check PID with TPC
655 if (TMath::Abs(pid[0]) < fNSigmaMaxTPC)
656 isAcceptedTPC = kTRUE;
658 // -- Check PID with TOF
661 // Has TOF PID availible
662 if (track->GetStatus() & AliVTrack::kTOFpid) {
663 if (TMath::Abs(pid[1]) < fNSigmaMaxTOF)
664 isAcceptedTOF = kTRUE;
666 isAcceptedTOF = kFALSE;
669 // Has no TOF PID availible
671 if (track->Pt() > fMinPtForTOFRequired)
672 isAcceptedTOF = kFALSE;
674 isAcceptedTOF = kTRUE;
676 } // if (isAcceptedTPC) {
678 return (isAcceptedTPC && isAcceptedTOF);
682 * ---------------------------------------------------------------------------------
684 * ---------------------------------------------------------------------------------
687 //________________________________________________________________________
688 void AliAnalysisNetParticleHelper::UpdateEtaCorrectedTPCPid() {
689 // -- Update eta corrected TPC pid
694 for (Int_t idxTrack = 0; idxTrack < fESD->GetNumberOfTracks(); ++idxTrack) {
695 AliESDtrack *track = fESD->GetTrack(idxTrack);
697 // -- Check if charged track is accepted for basic parameters
698 if (!IsTrackAcceptedBasicCharged(track))
701 Double_t newTPCSignal = track->GetTPCsignal() / fEtaCorrFunc->Eval(track->Eta());
702 track->SetTPCsignal(newTPCSignal, track->GetTPCsignalSigma(), track->GetTPCsignalN());
706 //________________________________________________________________________
707 Double_t AliAnalysisNetParticleHelper::GetTrackbyTrackCorrectionFactor(Double_t *aTrack, Int_t flag) {
708 // -- Get efficiency correctionf of particle dependent on (eta, phi, pt, centrality)
710 Int_t idxPart = (aTrack[2] < 0) ? 0 : 1;
711 THnSparseF* corrMatrix = (flag == 0) ? fCorr0[idxPart][fCentralityBin] : fCorr1[idxPart][fCentralityBin];
713 Double_t dimBin[3] = {aTrack[3], aTrack[4], aTrack[1]}; // eta, phi, pt
715 Double_t corr = corrMatrix->GetBinContent(corrMatrix->GetBin(dimBin));
717 AliError(Form("Should not happen : bin content = 0. >> eta: %.2f | phi : %.2f | pt : %.2f | cent %d",
718 aTrack[3], aTrack[4], aTrack[1], fCentralityBin));
725 //________________________________________________________________________
726 void AliAnalysisNetParticleHelper::BinLogAxis(const THnSparseF *h, Int_t axisNumber) {
727 // -- Method for the correct logarithmic binning of histograms
729 TAxis *axis = h->GetAxis(axisNumber);
730 Int_t bins = axis->GetNbins();
732 Double_t from = axis->GetXmin();
733 Double_t to = axis->GetXmax();
734 Double_t *newBins = new Double_t[bins + 1];
737 Double_t factor = pow(to/from, 1./bins);
739 for (int i = 1; i <= bins; i++) {
740 newBins[i] = factor * newBins[i-1];
742 axis->Set(bins, newBins);
746 ///////////////////////////////////////////////////////////////////////////////////
749 * ---------------------------------------------------------------------------------
750 * Initialize - Private
751 * ---------------------------------------------------------------------------------
754 //________________________________________________________________________
755 void AliAnalysisNetParticleHelper::InitializeEventStats() {
756 // -- Initialize event statistics histograms
758 const Char_t* aEventNames[] = {"All", "IsTriggered", "HasVertex", "Vz<Vz_{Max}", "Centrality [0,90]%"};
759 const Char_t* aCentralityMaxNames[] = {"5", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"};
761 fHEventStat0 = new TH1F("fHEventStat0","Event cut statistics 0;Event Cuts;Events", fHEventStatMax,-0.5,fHEventStatMax-0.5);
762 fHEventStat1 = new TH1F("fHEventStat1","Event cut statistics 1;Event Cuts;Events", fHEventStatMax,-0.5,fHEventStatMax-0.5);
764 for ( Int_t ii=0; ii < fHEventStatMax-1; ii++ ) {
765 fHEventStat0->GetXaxis()->SetBinLabel(ii+1, aEventNames[ii]);
766 fHEventStat1->GetXaxis()->SetBinLabel(ii+1, aEventNames[ii]);
768 fHEventStat0->GetXaxis()->SetBinLabel(fHEventStatMax, Form("Centrality [0-%s]%%", aCentralityMaxNames[fCentralityBinMax-1]));
769 fHEventStat1->GetXaxis()->SetBinLabel(fHEventStatMax, Form("Centrality [0-%s]%%", aCentralityMaxNames[fCentralityBinMax-1]));
772 //________________________________________________________________________
773 void AliAnalysisNetParticleHelper::InitializeTriggerStats() {
774 // -- Initialize trigger statistics histograms
776 const Char_t* aTriggerNames[] = { "kMB", "kCentral", "kSemiCentral", "kEMCEJE", "kEMCEGA" };
778 fHTriggerStat = new TH1F("fHTriggerStat","Trigger statistics;Trigger;Events", fNTriggers,-0.5,fNTriggers-0.5);
780 for ( Int_t ii=0; ii < fNTriggers; ii++ )
781 fHTriggerStat->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);
784 //________________________________________________________________________
785 void AliAnalysisNetParticleHelper::InitializeCentralityStats() {
786 // -- Initialize trigger statistics histograms
788 const Char_t* aCentralityNames[] = {"0-5%", "5-10%", "10-20%", "20-30%", "30-40%", "40-50%",
789 "50-60%", "60-70%", "70-80%", "80-90%", "90-100%"};
791 fHCentralityStat = new TH1F("fHCentralityStat","Centrality statistics;Centrality Bins;Events",
792 fNCentralityBins,-0.5,fNCentralityBins-0.5);
794 for ( Int_t ii=0; ii < fNCentralityBins; ii++ )
795 fHCentralityStat->GetXaxis()->SetBinLabel(ii+1, aCentralityNames[ii]);
798 //________________________________________________________________________
799 Int_t AliAnalysisNetParticleHelper::InitializeEtaCorrection(Bool_t isMC) {
800 // -- Initialize eta correction maps for TPC pid
802 TFile fileEtaCorrMaps("${ALICE_ROOT}/PWGDQ/dielectron/files/EtaCorrMaps.root");
803 if (!fileEtaCorrMaps.IsOpen())
806 TList *keyList = fileEtaCorrMaps.GetListOfKeys();
809 sList = (isMC) ? "LHC11a10" : "LHC10h.pass2";
811 for (Int_t idx = 0; idx < keyList->GetEntries(); ++idx) {
812 TString keyName = keyList->At(idx)->GetName();
813 TPRegexp reg(keyName);
814 if (reg.MatchB(sList)){
815 AliInfo(Form("Using Eta Correction Function: %s",keyName.Data()));
816 fEtaCorrFunc = static_cast<TF1*>(fileEtaCorrMaps.Get(keyName.Data()));
824 //________________________________________________________________________
825 Int_t AliAnalysisNetParticleHelper::InitializeTrackbyTrackCorrection() {
826 // -- Initialize track by track correction matrices
828 if( fParticleSpecies != AliPID::kProton){
829 AliWarning("Only proton corrections (preliminary available) --> Will correct with these");
832 // In future --> !!!!!!!!!!!!!!!!!!!!!!!
833 //TFile* corrFile = TFile::Open("${ALICE_ROOT}/PWGCF/EBYE/NetParticle/eff/effectiveCorrection.root");
834 TFile* corrFile = TFile::Open("${ALICE_ROOT}/PWGCF/EBYE/NetParticle/eff/effectiveCorrectionProton.root");
836 AliError("Track-by-track correction file can not be opened!");
840 // -- correction - not cross section corrected
841 fCorr0 = new THnSparseF**[2];
842 fCorr0[0] = new THnSparseF*[fCentralityBinMax];
843 fCorr0[1] = new THnSparseF*[fCentralityBinMax];
845 for (Int_t idxCent = 0; idxCent < fCentralityBinMax; ++idxCent) {
847 // In future --> !!!!!!!!!!!!!!!!!!!!!!!
848 // THnSparseF *sp0 = static_cast<THnSparseF*>(corrFile->Get(Form("%s_Corr0_Cent_%d", fPartName[0].Data(), idxCent)));
849 // THnSparseF *sp1 = static_cast<THnSparseF*>(corrFile->Get(Form("%s_Corr0_Cent_%d", fPartName[1].Data(), idxCent)));
850 THnSparseF *sp0 = static_cast<THnSparseF*>(corrFile->Get(Form("pbar_Corr0_Cent_%d", idxCent)));
851 THnSparseF *sp1 = static_cast<THnSparseF*>(corrFile->Get(Form("p_Corr0_Cent_%d", idxCent)));
854 AliError(Form("Effective correction objects 0 - idxCent %d can not be retrieved!",idxCent));
858 fCorr0[0][idxCent] = static_cast<THnSparseF*>(sp0->Clone());
859 fCorr0[1][idxCent] = static_cast<THnSparseF*>(sp1->Clone());
862 // -- correction - ross section corrected
863 fCorr1 = new THnSparseF**[2];
864 fCorr1[0] = new THnSparseF*[fCentralityBinMax];
865 fCorr1[1] = new THnSparseF*[fCentralityBinMax];
867 for (Int_t idxCent = 0; idxCent < fCentralityBinMax; ++idxCent) {
869 // In future --> !!!!!!!!!!!!!!!!!!!!!!!
870 //THnSparseF *sp0 = static_cast<THnSparseF*>(corrFile->Get(Form("%s_Corr1_Cent_%d", fPartName[0].Data(), idxCent)));
871 //THnSparseF *sp1 = static_cast<THnSparseF*>(corrFile->Get(Form("%s_Corr1_Cent_%d", fPartName[1].Data(), idxCent)));
872 THnSparseF *sp0 = static_cast<THnSparseF*>(corrFile->Get(Form("pbar_Corr1_Cent_%d", idxCent)));
873 THnSparseF *sp1 = static_cast<THnSparseF*>(corrFile->Get(Form("p_Corr1_Cent_%d", idxCent)));
876 AliError(Form("Effective correction objects 1 - idxCent %d can not be retrieved!",idxCent));
880 fCorr1[0][idxCent] = static_cast<THnSparseF*>(sp0->Clone());
881 fCorr1[1][idxCent] = static_cast<THnSparseF*>(sp1->Clone());
888 * ---------------------------------------------------------------------------------
889 * Event / Trigger Statistics - private
890 * ---------------------------------------------------------------------------------
893 //________________________________________________________________________
894 Bool_t AliAnalysisNetParticleHelper::FillEventStats(Int_t *aEventCuts) {
895 // -- Fill event / centrality statistics
897 Bool_t isRejected = kFALSE;
899 // -- Fill event statistics
900 for (Int_t idx = 0; idx < fHEventStatMax ; ++idx) {
905 fHEventStat0->Fill(idx);
908 for (Int_t idx = 0; idx < fHEventStatMax; ++idx) {
911 fHEventStat1->Fill(idx);
914 // -- Fill centrality statistics of accepted events
916 fHCentralityStat->Fill(fCentralityBin);