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 // MW make fgk ... static const
39 const Char_t* aPartNames[AliPID::kSPECIES][2] = {
47 const Char_t* aPartTitles[AliPID::kSPECIES][2] = {
48 {"Electron", "Positron"},
49 {"Anti-Muon", "Muon"},
50 {"Anti-Pion", "Proton"},
51 {"Anti-Kaon", "Kaon"},
52 {"Anti-Proton", "Proton"}
55 const Char_t* aPartTitlesLatex[AliPID::kSPECIES][2] = {
57 {"#mu^{-}", "#mu^{+}" },
58 {"#pi^{-}", "#pi^{+}" },
63 const Char_t* aControlPartNames[2] = {"lambdabar", "lambda"};
64 const Char_t* aControlPartTitles[2] = {"Anti-Lambda", "Lambda"};
67 * ---------------------------------------------------------------------------------
68 * Constructor / Destructor
69 * ---------------------------------------------------------------------------------
72 //________________________________________________________________________
73 AliAnalysisNetParticleHelper::AliAnalysisNetParticleHelper() :
76 fInputEventHandler(NULL),
84 fCentralityPercentile(-1.),
89 fMinTrackLengthMC(70.),
93 fParticleSpecies(AliPID::kProton),
94 fControlParticleCode(3122),
95 fControlParticleIsNeutral(kTRUE),
96 fControlParticleName("Lambda"),
101 fMinPtForTOFRequired(0.8),
110 fHCentralityStat(NULL),
111 fNCentralityBins(10),
119 AliLog::SetClassDebugLevel("AliAnalysisNetParticleHelper",10);
122 //________________________________________________________________________
123 AliAnalysisNetParticleHelper::~AliAnalysisNetParticleHelper() {
126 if (fModeDistCreation == 1) {
127 for (Int_t jj = 0; jj < 2; ++jj) {
128 if (fCorr0[jj]) delete[] fCorr0[jj];
129 if (fParticleSpecies == AliPID::kProton) {
130 if (fCorr1[jj]) delete[] fCorr1[jj];
131 if (fCorr2[jj]) delete[] fCorr2[jj];
134 if (fCorr0) delete[] fCorr0;
135 if (fParticleSpecies == AliPID::kProton) {
136 if (fCorr1) delete[] fCorr1;
137 if (fCorr2) delete[] fCorr2;
145 * ---------------------------------------------------------------------------------
147 * ---------------------------------------------------------------------------------
150 //________________________________________________________________________
151 void AliAnalysisNetParticleHelper::SetParticleSpecies(AliPID::EParticleType pid) {
152 // -- Set particle species (ID, Name, Title, Title LATEX)
154 if ( Int_t(pid) < 0 || Int_t(pid) >= AliPID::kSPECIES) {
155 AliWarning("Particle ID not in AliPID::kSPECIES --> Set to protons");
156 pid = AliPID::kProton;
159 fParticleSpecies = pid;
161 for (Int_t idxPart = 0; idxPart < 2; ++idxPart) {
162 fPartName[idxPart] = aPartNames[fParticleSpecies][idxPart];
163 fPartTitle[idxPart] = aPartTitles[fParticleSpecies][idxPart];
164 fPartTitleLatex[idxPart] = aPartTitlesLatex[fParticleSpecies][idxPart];
167 //________________________________________________________________________
168 void AliAnalysisNetParticleHelper::SetUsePID(Bool_t usePID) {
169 // -- Set usage of PID
170 // > if turn off, set charge types (ID, Name, Title, Title LATEX)
175 fParticleSpecies = AliPID::kUnknown;
177 fPartName[0] = "neg";
178 fPartName[1] = "pos";
179 fPartTitle[0] = "Negative";
180 fPartTitle[1] = "Positive";
181 fPartTitleLatex[0] = "Negative";
182 fPartTitleLatex[1] = "Positive";
187 * ---------------------------------------------------------------------------------
189 * ---------------------------------------------------------------------------------
192 //________________________________________________________________________
193 TString AliAnalysisNetParticleHelper::GetParticleName(Int_t idxPart) {
194 // -- Get particle Name
196 if( idxPart != 0 && idxPart != 1){
197 AliWarning("Particle type not known --> Set to antiparticles");
201 return fPartName[idxPart];
204 //________________________________________________________________________
205 TString AliAnalysisNetParticleHelper::GetParticleTitle(Int_t idxPart) {
206 // -- Get particle Title
208 if( idxPart != 0 && idxPart != 1){
209 AliWarning("Particle type not known --> Set to antiparticles");
213 return fPartTitle[idxPart];
216 //________________________________________________________________________
217 TString AliAnalysisNetParticleHelper::GetParticleTitleLatex(Int_t idxPart) {
218 // -- Get particle Title LATEX
220 if( idxPart != 0 && idxPart != 1){
221 AliWarning("Particle type not known --> Set to antiparticles");
225 return fPartTitleLatex[idxPart];
228 //________________________________________________________________________
229 TString AliAnalysisNetParticleHelper::GetControlParticleName(Int_t idxPart) {
230 // -- Get particle Title LATEX
232 if( idxPart != 0 && idxPart != 1){
233 AliWarning("Particle type not known --> Set to antiparticles");
237 return aControlPartNames[idxPart];
240 //________________________________________________________________________
241 TString AliAnalysisNetParticleHelper::GetControlParticleTitle(Int_t idxPart) {
242 // -- Get particle Title LATEX
244 if( idxPart != 0 && idxPart != 1){
245 AliWarning("Particle type not known --> Set to antiparticles");
249 return aControlPartTitles[idxPart];
253 * ---------------------------------------------------------------------------------
255 * ---------------------------------------------------------------------------------
258 //________________________________________________________________________
259 Int_t AliAnalysisNetParticleHelper::Initialize(Bool_t isMC, Int_t modeDistCreation) {
260 // -- Initialize helper
263 fModeDistCreation = modeDistCreation;
265 // -- Setup event cut statistics
266 InitializeEventStats();
268 // -- Setup trigger statistics
269 InitializeTriggerStats();
271 // -- Setup centrality statistics
272 InitializeCentralityStats();
274 // -- Load Eta correction function
275 iResult = InitializeEtaCorrection(isMC);
277 // -- Load track by track correction function
278 iResult = InitializeTrackbyTrackCorrection();
283 //________________________________________________________________________
284 Int_t AliAnalysisNetParticleHelper::SetupEvent(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent) {
287 // -- Get ESD objects
289 fInputEventHandler = static_cast<AliInputEventHandler*>(esdHandler);
290 fESD = dynamic_cast<AliESDEvent*>(fInputEventHandler->GetEvent());
293 AliError("ESD event handler not available");
299 // -- Get AOD objects
301 fInputEventHandler = static_cast<AliInputEventHandler*>(aodHandler);
302 fAOD = dynamic_cast<AliAODEvent*>(fInputEventHandler->GetEvent());
305 AliError("AOD event handler not available");
311 // -- Get Common objects
312 fPIDResponse = fInputEventHandler->GetPIDResponse();
317 fStack = fMCEvent->Stack();
319 // -- Get event centrality
320 // > 0-5|5-10|10-20|20-30|30-40|40-50|50-60|60-70|70-80|80-90 --> 10 bins
321 // > 0 1 2 3 4 5 6 7 8 9
323 AliCentrality *centrality = NULL;
326 centrality = fESD->GetCentrality();
328 centrality = fAOD->GetHeader()->GetCentralityP();
331 AliError("Centrality not available");
335 Int_t centBin = centrality->GetCentralityClass10("V0M");
337 fCentralityBin = centrality->GetCentralityClass5("V0M");
338 else if (centBin == 10 || centBin == -1.)
340 else if (centBin > 0 && centBin < fNCentralityBins)
341 fCentralityBin = centBin + 1;
345 // -- Stay within the max centrality bin
346 if (fCentralityBin >= fCentralityBinMax)
349 fCentralityPercentile = centrality->GetCentralityPercentile("V0M");
351 // -- Update TPC pid with eta correction (only for ESDs!!)
353 UpdateEtaCorrectedTPCPid();
359 * ---------------------------------------------------------------------------------
360 * Event / Trigger Statistics
361 * ---------------------------------------------------------------------------------
364 //________________________________________________________________________
365 Bool_t AliAnalysisNetParticleHelper::IsEventTriggered() {
366 // -- Check if Event is triggered and fill Trigger Histogram
368 Bool_t *aTriggerFired = new Bool_t[fNTriggers];
369 for (Int_t ii = 0; ii < fNTriggers; ++ii)
370 aTriggerFired[ii] = kFALSE;
372 if ((fInputEventHandler->IsEventSelected() & AliVEvent::kMB)) aTriggerFired[0] = kTRUE;
373 if ((fInputEventHandler->IsEventSelected() & AliVEvent::kCentral)) aTriggerFired[1] = kTRUE;
374 if ((fInputEventHandler->IsEventSelected() & AliVEvent::kSemiCentral)) aTriggerFired[2] = kTRUE;
375 if ((fInputEventHandler->IsEventSelected() & AliVEvent::kEMCEJE)) aTriggerFired[3] = kTRUE;
376 if ((fInputEventHandler->IsEventSelected() & AliVEvent::kEMCEGA)) aTriggerFired[4] = kTRUE;
378 Bool_t isTriggered = kFALSE;
380 for (Int_t ii=0; ii<fNTriggers; ++ii) {
381 if(aTriggerFired[ii]) {
383 fHTriggerStat->Fill(ii);
387 delete[] aTriggerFired;
392 //________________________________________________________________________
393 Bool_t AliAnalysisNetParticleHelper::IsEventRejected() {
394 // -- Evaluate event statistics histograms
396 Int_t *aEventCuts = new Int_t[fHEventStatMax];
397 // set aEventCuts[ii] to 1 in case of reject
399 for (Int_t ii=0;ii<fHEventStatMax; ++ii)
404 // -- 0 - Before Physics Selection
405 aEventCuts[iCut] = 0;
407 // -- 1 - No Trigger fired
409 if (!IsEventTriggered())
410 aEventCuts[iCut] = 1;
414 const AliESDVertex* vtxESD = NULL;
415 const AliAODVertex* vtxAOD = NULL;
417 vtxESD = fESD->GetPrimaryVertexTracks();
419 aEventCuts[iCut] = 1;
422 vtxAOD = fAOD->GetPrimaryVertex();
424 aEventCuts[iCut] = 1;
427 // -- 3 - Vertex z outside cut window
430 if(TMath::Abs(vtxESD->GetZv()) > fVertexZMax)
431 aEventCuts[iCut] = 1;
434 if(TMath::Abs(vtxAOD->GetZ()) > fVertexZMax)
435 aEventCuts[iCut] = 1;
438 aEventCuts[iCut] = 1;
440 // -- 4 - Centrality = -1 (no centrality or not hadronic)
442 if(fCentralityBin == -1.)
443 aEventCuts[iCut] = 1;
445 // -- 5 - Centrality < fCentralityMax
447 if(fCentralityBin == -2.)
448 aEventCuts[iCut] = 1;
450 // -- Fill statistics / reject event
451 Bool_t isRejected = FillEventStats(aEventCuts);
460 * ---------------------------------------------------------------------------------
461 * Accept Particle Methods - private
462 * ---------------------------------------------------------------------------------
465 //________________________________________________________________________
466 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicCharged(TParticle *particle, Int_t idxMC) {
467 // -- Check if MC particle is accepted for basic parameters
472 // -- check if PDF code exists
473 if (!particle->GetPDG())
476 // -- check if charged
477 if (particle->GetPDG()->Charge() == 0.0)
480 // -- check if physical primary
481 if(!fStack->IsPhysicalPrimary(idxMC))
487 //________________________________________________________________________
488 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicCharged(AliAODMCParticle *particle) {
489 // -- Check if MC particle is accepted for basic parameters
494 // -- check if PDF code exists
495 if (!(TDatabasePDG::Instance()->GetParticle(particle->PdgCode())))
498 // -- check if charged
499 if ((TDatabasePDG::Instance()->GetParticle(particle->PdgCode()))->Charge() == 0.0)
502 // -- check if physical primary
503 if(!particle->IsPhysicalPrimary())
509 //________________________________________________________________________
510 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicNeutral(TParticle *particle, Int_t idxMC) {
511 // -- Check if MC particle is accepted for basic parameters
516 // -- check if PDF code exists
517 if (!particle->GetPDG())
520 // -- check if neutral
521 if (particle->GetPDG()->Charge() != 0.0)
524 // -- check if physical primary
525 if(!fStack->IsPhysicalPrimary(idxMC))
530 //________________________________________________________________________
531 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedBasicNeutral(AliAODMCParticle *particle) {
532 // -- Check if MC particle is accepted for basic parameters
537 // -- check if PDF code exists
538 if (!(TDatabasePDG::Instance()->GetParticle(particle->PdgCode())))
541 // -- check if charged
542 if ((TDatabasePDG::Instance()->GetParticle(particle->PdgCode()))->Charge() != 0.0)
545 // -- check if physical primary
546 if(!particle->IsPhysicalPrimary())
551 //________________________________________________________________________
552 Bool_t AliAnalysisNetParticleHelper::IsParticleAcceptedRapidity(TParticle *particle, Double_t &yP) {
553 // -- Check if particle is accepted
556 // > use yP as input for the pseudo-rapdity_MAX to be checked
557 // > return 0 if not accepted
560 Bool_t isAccepted = kFALSE;
561 if (TMath::Abs(particle->Eta()) < yP)
563 yP = particle->Eta();
567 Double_t mP = AliPID::ParticleMass(fParticleSpecies);
569 // -- Calculate rapidities and kinematics
570 Double_t p = particle->P();
571 Double_t pz = particle->Pz();
573 Double_t eP = TMath::Sqrt(p*p + mP*mP);
574 yP = 0.5 * TMath::Log((eP + pz) / (eP - pz));
576 // -- Check Rapidity window
577 if (TMath::Abs(yP) > fRapidityMax)
583 //_____________________________________________________________________________
584 Bool_t AliAnalysisNetParticleHelper::IsParticleFindable(Int_t label) {
585 // -- Check if MC particle is findable tracks
587 AliMCParticle *mcParticle = static_cast<AliMCParticle*>(fMCEvent->GetTrack(label));
592 Float_t tpcTrackLength = mcParticle->GetTPCTrackLength(AliTracker::GetBz(), 0.05, counter, 3.0);
594 return (tpcTrackLength > fMinTrackLengthMC);
598 * ---------------------------------------------------------------------------------
599 * Accept Track Methods - public
600 * ---------------------------------------------------------------------------------
603 //________________________________________________________________________
604 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedBasicCharged(AliVTrack* track) {
605 // -- Check if track is accepted
606 // > for basic parameters
611 if (track->Charge() == 0)
617 //________________________________________________________________________
618 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedRapidity(AliVTrack *track, Double_t &yP) {
619 // -- Check if track is accepted
621 // > return 0 if not accepted
628 Double_t mP = AliPID::ParticleMass(fParticleSpecies);
630 // -- Calculate rapidities and kinematics
632 track->GetPxPyPz(pvec);
634 Double_t p = track->P();
635 Double_t eP = TMath::Sqrt(p*p + mP*mP);
636 yP = 0.5 * TMath::Log((eP + pvec[2]) / (eP - pvec[2]));
638 // -- Check Rapidity window
639 if (TMath::Abs(yP) > fRapidityMax)
645 //________________________________________________________________________
646 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedDCA(AliVTrack *vTrack) {
647 // -- Check if track is accepted - ONLY FOR ESDs so far
648 // > for DCA, if both SPD layers have hits
649 // > For now only Implemented for ESDs
651 Bool_t isAccepted = kTRUE;
656 AliESDtrack* track = dynamic_cast<AliESDtrack*>(vTrack);
661 if (track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) {
663 // -- Get DCA nSigmas
664 Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
665 track->GetImpactParameters(dca,cov);
667 Float_t nSigmaCdd = (cov[0] != 0.) ? dca[0]/TMath::Sqrt(cov[0]) : -9.99;
668 Float_t nSigmaCzz = (cov[2] != 0.) ? dca[1]/TMath::Sqrt(cov[2]) : -9.99;
670 if (fNSigmaMaxCdd != 0.) {
671 if (TMath::Abs(nSigmaCdd) > fNSigmaMaxCdd)
675 if (fNSigmaMaxCzz != 0.) {
676 if (TMath::Abs(nSigmaCzz) > fNSigmaMaxCzz)
684 //________________________________________________________________________
685 Bool_t AliAnalysisNetParticleHelper::IsTrackAcceptedPID(AliVTrack *track, Double_t* pid) {
686 // -- Check if track is accepted
687 // > provides TPC and TOF nSigmas to the argument
689 Bool_t isAcceptedTPC = kFALSE;
690 Bool_t isAcceptedTOF = kTRUE;
692 // -- In case not PID is used
700 pid[0] = fPIDResponse->NumberOfSigmasTPC(track, fParticleSpecies);
701 pid[1] = fPIDResponse->NumberOfSigmasTOF(track, fParticleSpecies);
703 // -- Check PID with TPC
704 if (TMath::Abs(pid[0]) < fNSigmaMaxTPC)
705 isAcceptedTPC = kTRUE;
707 // -- Check PID with TOF
710 // Has TOF PID availible
711 if (track->GetStatus() & AliVTrack::kTOFpid) {
712 if (TMath::Abs(pid[1]) < fNSigmaMaxTOF)
713 isAcceptedTOF = kTRUE;
715 isAcceptedTOF = kFALSE;
718 // Has no TOF PID availible
720 if (track->Pt() > fMinPtForTOFRequired)
721 isAcceptedTOF = kFALSE;
723 isAcceptedTOF = kTRUE;
725 } // if (isAcceptedTPC) {
727 return (isAcceptedTPC && isAcceptedTOF);
731 * ---------------------------------------------------------------------------------
733 * ---------------------------------------------------------------------------------
736 //________________________________________________________________________
737 void AliAnalysisNetParticleHelper::UpdateEtaCorrectedTPCPid() {
738 // -- Update eta corrected TPC pid
743 for (Int_t idxTrack = 0; idxTrack < fESD->GetNumberOfTracks(); ++idxTrack) {
744 AliESDtrack *track = fESD->GetTrack(idxTrack);
746 // -- Check if charged track is accepted for basic parameters
747 if (!IsTrackAcceptedBasicCharged(track))
750 Double_t newTPCSignal = track->GetTPCsignal() / fEtaCorrFunc->Eval(track->Eta());
751 track->SetTPCsignal(newTPCSignal, track->GetTPCsignalSigma(), track->GetTPCsignalN());
755 //________________________________________________________________________
756 Double_t AliAnalysisNetParticleHelper::GetTrackbyTrackCorrectionFactor(Double_t *aTrack, Int_t flag) {
757 // -- Get efficiency correctionf of particle dependent on (eta, phi, pt, centrality)
759 Int_t idxPart = (aTrack[2] < 0) ? 0 : 1;
760 THnF* corrMatrix = NULL;
762 corrMatrix = fCorr0[idxPart][fCentralityBin];
764 corrMatrix = fCorr1[idxPart][fCentralityBin];
766 corrMatrix = fCorr2[idxPart][fCentralityBin];
768 Double_t dimBin[3] = {aTrack[3], aTrack[4], aTrack[1]}; // eta, phi, pt
770 Double_t corr = corrMatrix->GetBinContent(corrMatrix->GetBin(dimBin));
772 AliError(Form("Should not happen : bin content = 0. >> eta: %.2f | phi : %.2f | pt : %.2f | cent %d",
773 aTrack[3], aTrack[4], aTrack[1], fCentralityBin));
780 //________________________________________________________________________
781 void AliAnalysisNetParticleHelper::BinLogAxis(const THnBase *h, Int_t axisNumber) {
782 // -- Method for the correct logarithmic binning of histograms
784 TAxis *axis = h->GetAxis(axisNumber);
785 Int_t bins = axis->GetNbins();
787 Double_t from = axis->GetXmin();
788 Double_t to = axis->GetXmax();
789 Double_t *newBins = new Double_t[bins + 1];
792 Double_t factor = pow(to/from, 1./bins);
794 for (int i = 1; i <= bins; i++)
795 newBins[i] = factor * newBins[i-1];
797 axis->Set(bins, newBins);
802 ///////////////////////////////////////////////////////////////////////////////////
805 * ---------------------------------------------------------------------------------
806 * Initialize - Private
807 * ---------------------------------------------------------------------------------
810 //________________________________________________________________________
811 void AliAnalysisNetParticleHelper::InitializeEventStats() {
812 // -- Initialize event statistics histograms
814 const Char_t* aEventNames[] = {"All", "IsTriggered", "HasVertex", "Vz<Vz_{Max}", "Centrality [0,90]%"};
815 const Char_t* aCentralityMaxNames[] = {"5", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"};
817 fHEventStat0 = new TH1F("fHEventStat0","Event cut statistics 0;Event Cuts;Events", fHEventStatMax,-0.5,fHEventStatMax-0.5);
818 fHEventStat1 = new TH1F("fHEventStat1","Event cut statistics 1;Event Cuts;Events", fHEventStatMax,-0.5,fHEventStatMax-0.5);
820 for ( Int_t ii=0; ii < fHEventStatMax-1; ii++ ) {
821 fHEventStat0->GetXaxis()->SetBinLabel(ii+1, aEventNames[ii]);
822 fHEventStat1->GetXaxis()->SetBinLabel(ii+1, aEventNames[ii]);
824 fHEventStat0->GetXaxis()->SetBinLabel(fHEventStatMax, Form("Centrality [0-%s]%%", aCentralityMaxNames[fCentralityBinMax-1]));
825 fHEventStat1->GetXaxis()->SetBinLabel(fHEventStatMax, Form("Centrality [0-%s]%%", aCentralityMaxNames[fCentralityBinMax-1]));
828 //________________________________________________________________________
829 void AliAnalysisNetParticleHelper::InitializeTriggerStats() {
830 // -- Initialize trigger statistics histograms
832 const Char_t* aTriggerNames[] = { "kMB", "kCentral", "kSemiCentral", "kEMCEJE", "kEMCEGA" };
834 fHTriggerStat = new TH1F("fHTriggerStat","Trigger statistics;Trigger;Events", fNTriggers,-0.5,fNTriggers-0.5);
836 for ( Int_t ii=0; ii < fNTriggers; ii++ )
837 fHTriggerStat->GetXaxis()->SetBinLabel(ii+1, aTriggerNames[ii]);
840 //________________________________________________________________________
841 void AliAnalysisNetParticleHelper::InitializeCentralityStats() {
842 // -- Initialize trigger statistics histograms
844 const Char_t* aCentralityNames[] = {"0-5%", "5-10%", "10-20%", "20-30%", "30-40%", "40-50%",
845 "50-60%", "60-70%", "70-80%", "80-90%", "90-100%"};
847 fHCentralityStat = new TH1F("fHCentralityStat","Centrality statistics;Centrality Bins;Events",
848 fNCentralityBins,-0.5,fNCentralityBins-0.5);
850 for ( Int_t ii=0; ii < fNCentralityBins; ii++ )
851 fHCentralityStat->GetXaxis()->SetBinLabel(ii+1, aCentralityNames[ii]);
854 //________________________________________________________________________
855 Int_t AliAnalysisNetParticleHelper::InitializeEtaCorrection(Bool_t isMC) {
856 // -- Initialize eta correction maps for TPC pid
858 TFile fileEtaCorrMaps("${ALICE_ROOT}/PWGDQ/dielectron/files/EtaCorrMaps.root");
859 if (!fileEtaCorrMaps.IsOpen())
862 TList *keyList = fileEtaCorrMaps.GetListOfKeys();
865 sList = (isMC) ? "LHC11a10" : "LHC10h.pass2";
867 for (Int_t idx = 0; idx < keyList->GetEntries(); ++idx) {
868 TString keyName = keyList->At(idx)->GetName();
869 TPRegexp reg(keyName);
870 if (reg.MatchB(sList)){
871 AliInfo(Form("Using Eta Correction Function: %s",keyName.Data()));
872 fEtaCorrFunc = static_cast<TF1*>(fileEtaCorrMaps.Get(keyName.Data()));
880 //________________________________________________________________________
881 Int_t AliAnalysisNetParticleHelper::InitializeTrackbyTrackCorrection() {
882 // -- Initialize track by track correction matrices
884 if (fModeDistCreation != 1)
887 TFile* corrFile = TFile::Open("/hera/alice/jthaeder/train/trunk/jthaeder_trigger/netParticle/eff/effectiveCorrection.root");
888 // JMT In future --> !!!!!!!!!!!!!!!!!!!!!!!
889 // JMT TFile* corrFile = TFile::Open("${ALICE_ROOT}/PWGCF/EBYE/NetParticle/eff/effectiveCorrection.root");
892 AliError("Track-by-track correction file can not be opened!");
896 // -- Correction - not cross section corrected
897 fCorr0 = new THnF**[2];
898 fCorr0[0] = new THnF*[fCentralityBinMax];
899 fCorr0[1] = new THnF*[fCentralityBinMax];
901 for (Int_t idxCent = 0; idxCent < fCentralityBinMax; ++idxCent) {
902 THnF *sp0 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr0_Cent_%d", fPartName[0].Data(), idxCent)));
903 THnF *sp1 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr0_Cent_%d", fPartName[1].Data(), idxCent)));
906 AliError(Form("Effective correction objects 0 - idxCent %d can not be retrieved!", idxCent));
910 fCorr0[0][idxCent] = static_cast<THnF*>(sp0->Clone());
911 fCorr0[1][idxCent] = static_cast<THnF*>(sp1->Clone());
914 // -- From now only for protons
915 if (fParticleSpecies != AliPID::kProton)
918 // -- Correction - cross section corrected
919 fCorr1 = new THnF**[2];
920 fCorr1[0] = new THnF*[fCentralityBinMax];
921 fCorr1[1] = new THnF*[fCentralityBinMax];
923 for (Int_t idxCent = 0; idxCent < fCentralityBinMax; ++idxCent) {
924 THnF *sp0 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr1_Cent_%d", fPartName[0].Data(), idxCent)));
925 THnF *sp1 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr1_Cent_%d", fPartName[1].Data(), idxCent)));
928 AliError(Form("Effective correction objects 1 - idxCent %d can not be retrieved!", idxCent));
932 fCorr1[0][idxCent] = static_cast<THnF*>(sp0->Clone());
933 fCorr1[1][idxCent] = static_cast<THnF*>(sp1->Clone());
936 // -- Correction - cross section correction only
937 fCorr2 = new THnF**[2];
938 fCorr2[0] = new THnF*[fCentralityBinMax];
939 fCorr2[1] = new THnF*[fCentralityBinMax];
941 for (Int_t idxCent = 0; idxCent < fCentralityBinMax; ++idxCent) {
942 THnF *sp0 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr2_Cent_%d", fPartName[0].Data(), idxCent)));
943 THnF *sp1 = static_cast<THnF*>(corrFile->Get(Form("hn_%s_Corr2_Cent_%d", fPartName[1].Data(), idxCent)));
946 AliError(Form("Effective correction objects 2 - idxCent %d can not be retrieved!", idxCent));
950 fCorr2[0][idxCent] = static_cast<THnF*>(sp0->Clone());
951 fCorr2[1][idxCent] = static_cast<THnF*>(sp1->Clone());
958 * ---------------------------------------------------------------------------------
959 * Event / Trigger Statistics - private
960 * ---------------------------------------------------------------------------------
963 //________________________________________________________________________
964 Bool_t AliAnalysisNetParticleHelper::FillEventStats(Int_t *aEventCuts) {
965 // -- Fill event / centrality statistics
967 Bool_t isRejected = kFALSE;
969 // -- Fill event statistics
970 for (Int_t idx = 0; idx < fHEventStatMax ; ++idx) {
975 fHEventStat0->Fill(idx);
978 for (Int_t idx = 0; idx < fHEventStatMax; ++idx) {
981 fHEventStat1->Fill(idx);
984 // -- Fill centrality statistics of accepted events
986 fHCentralityStat->Fill(fCentralityBin);