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 **************************************************************************/
16 // Class for heavy-flavour electron with EMCal triggered events
17 // Author: Shingo Sakai
26 #include "THnSparse.h"
27 #include "TLorentzVector.h"
30 #include "TGraphErrors.h"
32 #include "AliAnalysisTask.h"
33 #include "AliAnalysisManager.h"
35 #include "AliESDEvent.h"
36 #include "AliESDHandler.h"
37 #include "AliAODEvent.h"
38 #include "AliAODHandler.h"
40 #include "AliMCEventHandler.h"
41 #include "AliMCEvent.h"
42 #include "AliMCParticle.h"
44 #include "AliAnalysisTaskHFECal.h"
45 #include "TGeoGlobalMagField.h"
47 #include "AliAnalysisTaskSE.h"
48 #include "TRefArray.h"
50 #include "AliESDInputHandler.h"
51 #include "AliESDpid.h"
52 #include "AliESDtrackCuts.h"
53 #include "AliPhysicsSelection.h"
54 #include "AliESDCaloCluster.h"
55 #include "AliAODCaloCluster.h"
56 #include "AliEMCALRecoUtils.h"
57 #include "AliEMCALGeometry.h"
58 #include "AliGeomManager.h"
60 #include "TGeoManager.h"
64 #include "AliEMCALTrack.h"
67 #include "AliKFParticle.h"
68 #include "AliKFVertex.h"
71 #include "AliPIDResponse.h"
72 #include "AliHFEcontainer.h"
73 #include "AliHFEcuts.h"
74 #include "AliHFEpid.h"
75 #include "AliHFEpidBase.h"
76 #include "AliHFEpidQAmanager.h"
77 #include "AliHFEtools.h"
78 #include "AliCFContainer.h"
79 #include "AliCFManager.h"
83 #include "AliCentrality.h"
85 ClassImp(AliAnalysisTaskHFECal)
86 //________________________________________________________________________
87 AliAnalysisTaskHFECal::AliAnalysisTaskHFECal(const char *name)
88 : AliAnalysisTaskSE(name)
97 ,fIdentifiedAsOutInz(kFALSE)
98 ,fPassTheEventCut(kFALSE)
99 ,fRejectKinkMother(kFALSE)
105 ,fOpeningAngleCut(0.1)
107 //,fInvmassCut(0.1) // no mass
137 ,fTrackPtBefTrkCuts(0)
138 ,fTrackPtAftTrkCuts(0)
160 ,fIncpTMCM20hfeAll(0)
161 ,fIncpTMCM20hfeCheck(0)
162 ,fInputHFEMC_weight(0)
163 ,fIncpTMCM20hfeCheck_weight(0)
170 ,fIncpTMCM20pho_pi0e(0)
171 ,fPhoElecPtMCM20_pi0e(0)
172 ,fSameElecPtMCM20_pi0e(0)
173 ,fIncpTMCM20pho_eta(0)
174 ,fPhoElecPtMCM20_eta(0)
175 ,fSameElecPtMCM20_eta(0)
176 ,fIncpTMCpho_pi0e_TPC(0)
177 ,fPhoElecPtMC_pi0e_TPC(0)
178 ,fSameElecPtMC_pi0e_TPC(0)
193 //,fnSigEtaCorr(NULL)
197 fPID = new AliHFEpid("hfePid");
198 fTrackCuts = new AliESDtrackCuts();
200 for(int i=0; i<7; i++)fnSigEtaCorr[i] = 0;
202 // Define input and output slots here
203 // Input slot #0 works with a TChain
204 DefineInput(0, TChain::Class());
205 // Output slot #0 id reserved by the base class for AOD
206 // Output slot #1 writes into a TH1 container
207 // DefineOutput(1, TH1I::Class());
208 DefineOutput(1, TList::Class());
209 // DefineOutput(3, TTree::Class());
212 //________________________________________________________________________
213 AliAnalysisTaskHFECal::AliAnalysisTaskHFECal()
214 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskHFECal")
223 ,fIdentifiedAsOutInz(kFALSE)
224 ,fPassTheEventCut(kFALSE)
225 ,fRejectKinkMother(kFALSE)
231 ,fOpeningAngleCut(0.1)
263 ,fTrackPtBefTrkCuts(0)
264 ,fTrackPtAftTrkCuts(0)
286 ,fIncpTMCM20hfeAll(0)
287 ,fIncpTMCM20hfeCheck(0)
288 ,fInputHFEMC_weight(0)
289 ,fIncpTMCM20hfeCheck_weight(0)
296 ,fIncpTMCM20pho_pi0e(0)
297 ,fPhoElecPtMCM20_pi0e(0)
298 ,fSameElecPtMCM20_pi0e(0)
299 ,fIncpTMCM20pho_eta(0)
300 ,fPhoElecPtMCM20_eta(0)
301 ,fSameElecPtMCM20_eta(0)
302 ,fIncpTMCpho_pi0e_TPC(0)
303 ,fPhoElecPtMC_pi0e_TPC(0)
304 ,fSameElecPtMC_pi0e_TPC(0)
319 //,fnSigEtaCorr(NULL)
321 //Default constructor
322 fPID = new AliHFEpid("hfePid");
324 fTrackCuts = new AliESDtrackCuts();
326 for(int i=0; i<7; i++)fnSigEtaCorr[i] = 0;
329 // Define input and output slots here
330 // Input slot #0 works with a TChain
331 DefineInput(0, TChain::Class());
332 // Output slot #0 id reserved by the base class for AOD
333 // Output slot #1 writes into a TH1 container
334 // DefineOutput(1, TH1I::Class());
335 DefineOutput(1, TList::Class());
336 //DefineOutput(3, TTree::Class());
338 //_________________________________________
340 AliAnalysisTaskHFECal::~AliAnalysisTaskHFECal()
352 //_________________________________________
354 void AliAnalysisTaskHFECal::UserExec(Option_t*)
357 //Called for each event
359 // create pointer to event
360 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
362 printf("ERROR: fESD not available\n");
367 AliError("HFE cuts not available");
371 if(!fPID->IsInitialized()){
372 // Initialize PID with the given run number
373 AliWarning("PID not initialised, get from Run no");
374 fPID->InitializePID(fESD->GetRunNumber());
377 if(fmcData)fMC = MCEvent();
378 //AliStack* stack = NULL;
379 if(fmcData && fMC)stack = fMC->Stack();
382 AliCentrality *centrality = fESD->GetCentrality();
383 cent = centrality->GetCentralityPercentile("V0M");
385 //---- fill MC track info
388 Int_t nParticles = stack->GetNtrack();
389 for (Int_t iParticle = 0; iParticle < nParticles; iParticle++) {
390 TParticle* particle = stack->Particle(iParticle);
391 int fPDG = particle->GetPdgCode();
392 double mcZvertex = fMC->GetPrimaryVertex()->GetZ();
393 double pTMC = particle->Pt();
394 double proR = particle->R();
395 double etaMC = particle->Eta();
396 if(fabs(etaMC)>0.6)continue;
397 Bool_t mcInDtoE= kFALSE;
398 Bool_t mcInBtoE= kFALSE;
400 Bool_t MChijing = fMC->IsFromBGEvent(iParticle);
401 //if(!MChijing)printf("not MC hijing");
403 if(!MChijing)iHijing = 0;
407 mcphoinfo[2] = iHijing;
408 //if(fPDG==111)Hpi0pTcheck->Fill(pTMC,iHijing);
409 //if(fPDG==221)HETApTcheck->Fill(pTMC,iHijing);
410 if(fPDG==111)Hpi0pTcheck->Fill(mcphoinfo);
411 if(fPDG==221)HETApTcheck->Fill(mcphoinfo);
412 if(fabs(fPDG)==411 || fabs(fPDG)==413 || fabs(fPDG)==421 || fabs(fPDG)==423 || fabs(fPDG)==431)HDpTcheck->Fill(pTMC,iHijing);
413 if(fabs(fPDG)==511 || fabs(fPDG)==513 || fabs(fPDG)==521 || fabs(fPDG)==523 || fabs(fPDG)==531)HBpTcheck->Fill(pTMC,iHijing);
415 if(particle->GetFirstMother()>-1 && fPDG==22)
417 int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
418 if(parentPID==111 || parentPID==221)HphopTcheck->Fill(pTMC,iHijing); // pi0->g & eta->g
421 if(particle->GetFirstMother()>-1 && fabs(fPDG)==11)
423 int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
424 double pTMCparent = stack->Particle(particle->GetFirstMother())->Pt();
425 if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(fPDG)==11)mcInDtoE = kTRUE;
426 if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(fPDG)==11)mcInBtoE = kTRUE;
427 if((mcInBtoE || mcInDtoE) && fabs(mcZvertex)<10.0)
429 fInputHFEMC->Fill(cent,pTMC);
435 mcinfo[4] = pTMCparent;
436 fInputHFEMC_weight->Fill(mcinfo);
441 if(proR<7.0 && fabs(fPDG)==11)fInputAlle->Fill(cent,pTMC);
448 Int_t fNOtrks = fESD->GetNumberOfTracks();
449 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
451 Double_t pVtxZ = -999;
452 pVtxZ = pVtx->GetZ();
454 if(TMath::Abs(pVtxZ)>10) return;
457 if(fNOtrks<1) return;
460 AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();
462 AliDebug(1, "Using default PID Response");
463 pidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
466 fPID->SetPIDResponse(pidResponse);
468 fCFM->SetRecEventInfo(fESD);
470 //Float_t cent = -1.;
471 //AliCentrality *centrality = fESD->GetCentrality();
472 //cent = centrality->GetCentralityPercentile("V0M");
475 //if(cent>90.) return;
479 FindTriggerClusters();
482 for(Int_t iCluster=0; iCluster<fESD->GetNumberOfCaloClusters(); iCluster++)
484 AliESDCaloCluster *clust = fESD->GetCaloCluster(iCluster);
485 if(clust && clust->IsEMCAL())
487 double clustE = clust->E();
488 float emcx[3]; // cluster pos
489 clust->GetPosition(emcx);
490 TVector3 clustpos(emcx[0],emcx[1],emcx[2]);
491 double emcphi = clustpos.Phi();
492 double emceta = clustpos.Eta();
494 calInfo[0] = emcphi; calInfo[1] = emceta; calInfo[2] = clustE; calInfo[3] = cent; calInfo[4] = clust->Chi2();
495 //fEMCAccE->Fill(calInfo);
496 //if(clustE>3.0)fEMCAccE->Fill(calInfo);
497 //if(fqahist==1 && clustE>1.5)fEMCAccE->Fill(calInfo);
498 hEMCAccE->Fill(cent,clustE);
503 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
504 AliESDtrack* track = fESD->GetTrack(iTracks);
506 printf("ERROR: Could not receive track %d\n", iTracks);
510 int parentlabel = 99999;
511 int parentPID = 99999;
512 int grand_parentlabel = 99999;
513 int grand_parentPID = 99999;
514 Bool_t mcPho = kFALSE;
515 Bool_t mcDtoE= kFALSE;
516 Bool_t mcBtoE= kFALSE;
517 Bool_t mcOrgPi0 = kFALSE;
518 Bool_t mcOrgEta = kFALSE;
521 double mcMompT = 0.0;
522 //double mcGrandMompT = 0.0;
523 double mcWeight = -10.0;
528 if(fmcData && fMC && stack)
530 Int_t label = TMath::Abs(track->GetLabel());
531 mcLabel = track->GetLabel();
536 Bool_t MChijing = fMC->IsFromBGEvent(label);
537 if(!MChijing)iHijing = 0;
539 TParticle* particle = stack->Particle(label);
540 int mcpid = particle->GetPdgCode();
541 mcpT = particle->Pt();
542 //printf("MCpid = %d",mcpid);
543 if(particle->GetFirstMother()>-1)
545 //int parentlabel = particle->GetFirstMother();
546 //int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
547 //mcMompT = stack->Particle(particle->GetFirstMother())->Pt();
548 FindMother(particle, parentlabel, parentPID);
549 mcMompT = stack->Particle(parentlabel)->Pt();
550 if((parentPID==22 || parentPID==111 || parentPID==221)&& fabs(mcpid)==11)mcPho = kTRUE;
551 if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(mcpid)==11)mcDtoE = kTRUE;
552 if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(mcpid)==11)mcBtoE = kTRUE;
554 // make D->e pT correlation
555 if(mcDtoE)fMomDtoE->Fill(mcpT,mcMompT);
557 //cout << "check PID = " << parentPID << endl;
558 //cout << "check pho = " << mcPho << endl;
559 //cout << "check D or B = " << mcDtoE << endl;
561 if(parentPID==111 && fabs(mcpid)==11 && mcMompT>0.0)
563 //cout << "find pi0->e " << endl;
565 mcWeight = GetMCweight(mcMompT);
568 if(parentPID==221 && fabs(mcpid)==11 && mcMompT>0.0)
570 //cout << "find Eta->e " << endl;
572 mcWeight = GetMCweightEta(mcMompT);
575 // access grand parent
576 TParticle* particle_parent = stack->Particle(parentlabel); // get parent pointer
577 //if(particle_parent->GetFirstMother()>-1 && parentPID==22 && fabs(mcpid)==11) // get grand parent g->e
578 if(particle_parent->GetFirstMother()>-1 && (parentPID==22 || parentPID==111) && fabs(mcpid)==11) // get grand parent g->e
580 //int grand_parentPID = stack->Particle(particle_parent->GetFirstMother())->GetPdgCode();
581 //double pTtmp = stack->Particle(particle_parent->GetFirstMother())->Pt();
582 FindMother(particle_parent, grand_parentlabel, grand_parentPID);
583 double mcGrandpT = stack->Particle(grand_parentlabel)->Pt();
584 if(grand_parentPID==111 && mcGrandpT>0.0)
586 // check eta->pi0 decay !
587 int grand2_parentlabel = 99999; int grand2_parentPID = 99999;
588 TParticle* particle_grand = stack->Particle(grand_parentlabel); // get parent pointer
589 FindMother(particle_grand, grand2_parentlabel, grand2_parentPID);
590 if(grand2_parentPID==221)
592 //cout << "find Eta->e " << endl;
593 double mcGrandpT2 = stack->Particle(grand2_parentlabel)->Pt();
595 mcWeight = GetMCweight(mcGrandpT2);
596 mcMompT = mcGrandpT2;
600 //cout << "find pi0->e " << endl;
602 mcWeight = GetMCweight(mcGrandpT);
607 if(grand_parentPID==221 && mcGrandpT>0.0)
609 //cout << "find Eta->e " << endl;
612 mcWeight = GetMCweightEta(mcGrandpT);
618 //cout << "===================="<<endl;
619 //cout << "mcDtoE : " << mcDtoE << endl;
620 //cout << "mcBtoE : " << mcBtoE << endl;
621 //cout << "mcPho : " << mcPho << endl;
623 if(fabs(mcpid)==11)mcele= 0.;
624 //cout << "check e: " << mcele << endl;
625 if(fabs(mcpid)==11 && mcDtoE)mcele= 1.;
626 //cout << "check D->e: " << mcele << endl;
627 if(fabs(mcpid)==11 && mcBtoE)mcele= 2.;
628 //cout << "check B->e: " << mcele << endl;
629 if(fabs(mcpid)==11 && mcPho)mcele= 3.;
630 //cout << "check Pho->e: " << mcele << endl;
632 //cout << "check PID " << endl;
635 //cout << "!= 11" << endl;
636 //cout << mcpid << endl;
640 //cout << "mcele==-1" << endl;
641 //cout << mcele << endl;
642 //cout << mcpid << endl;
645 } // end of mcLabel>-1
649 //cout << "Pi0 = " << mcOrgPi0 << " ; Eta = " << mcOrgEta << endl;
650 //printf("weight = %f\n",mcWeight);
652 if(TMath::Abs(track->Eta())>0.6) continue;
653 if(TMath::Abs(track->Pt()<2.0)) continue;
655 fTrackPtBefTrkCuts->Fill(track->Pt());
656 // RecKine: ITSTPC cuts
657 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
660 if(fRejectKinkMother) { // Quick and dirty fix to reject both kink mothers and daughters
661 if(track->GetKinkIndex(0) != 0) continue;
665 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
667 // HFEcuts: ITS layers cuts
668 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
670 // HFE cuts: TPC PID cleanup
671 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
673 int nTPCcl = track->GetTPCNcls();
674 //int nTPCclF = track->GetTPCNclsF(); // warnings
675 int nITS = track->GetNcls(0);
677 fTrackPtAftTrkCuts->Fill(track->Pt());
679 Double_t mom = -999., eop=-999., pt = -999., dEdx=-999., fTPCnSigma=-10, phi=-999., eta=-999.;
683 // Track extrapolation
685 Int_t charge = track->Charge();
690 dEdx = track->GetTPCsignal();
691 fTPCnSigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(track, AliPID::kElectron) : 1000;
693 //cout << "nSigma correctoon-----" << endl;
694 //cout << "org = " << fTPCnSigma << endl;
695 if(!fmcData) // nsigma eta correction
697 double nSigexpCorr = NsigmaCorrection(eta,cent);
698 fTPCnSigma -= nSigexpCorr;
701 //cout << "correction = " << fTPCnSigma << endl;
703 double ncells = -1.0;
707 double rmatch = -1.0;
708 double nmatch = -1.0;
709 double oppstatus = 0.0;
712 Bool_t fFlagPhotonicElec = kFALSE;
713 Bool_t fFlagConvinatElec = kFALSE;
715 Int_t clsId = track->GetEMCALcluster();
717 AliESDCaloCluster *clust = fESD->GetCaloCluster(clsId);
718 if(clust && clust->IsEMCAL()){
720 double clustE = clust->E();
721 eop = clustE/fabs(mom);
722 //cout << "eop org = "<< eop << endl;
725 double mceopcorr = MCEopMeanCorrection(pt,cent);
728 //cout << "eop corr = " << eop << endl;
730 //double clustT = clust->GetTOF();
731 ncells = clust->GetNCells();
732 m02 = clust->GetM02();
733 m20 = clust->GetM20();
734 disp = clust->GetDispersion();
735 double delphi = clust->GetTrackDx();
736 double deleta = clust->GetTrackDz();
737 rmatch = sqrt(pow(delphi,2)+pow(deleta,2));
738 nmatch = clust->GetNTracksMatched();
739 emctof = clust->GetTOF();
740 //cout << "emctof = " << emctof << endl;
742 if(fTPCnSigma>-1.5 && fTPCnSigma<3.0)
744 SelectPhotonicElectron(iTracks,cent,track,fFlagPhotonicElec,fFlagConvinatElec,fTPCnSigma,m20,eop,mcele,mcWeight,iHijing,mcOrgPi0,mcOrgEta);
746 if(fFlagPhotonicElec)oppstatus = 1.0;
747 if(fFlagConvinatElec)oppstatus = 2.0;
748 if(fFlagPhotonicElec && fFlagConvinatElec)oppstatus = 3.0;
751 valdedx[0] = pt; valdedx[1] = nITS; valdedx[2] = phi; valdedx[3] = eta; valdedx[4] = fTPCnSigma;
752 //valdedx[5] = eop; valdedx[6] = rmatch; valdedx[7] = ncells, valdedx[8] = nTPCclF; valdedx[9] = m20; valdedx[10] = mcpT;
753 valdedx[5] = eop; valdedx[6] = rmatch; valdedx[7] = ncells, valdedx[8] = nmatch; valdedx[9] = m20; valdedx[10] = mcpT;
754 valdedx[11] = cent; valdedx[12] = dEdx; valdedx[13] = oppstatus; valdedx[14] = nTPCcl;
756 if(fqahist==1)fEleInfo->Fill(valdedx);
762 //Get Cal info PID response
765 Double_t nSigmaEop = fPID->GetPIDResponse()->NumberOfSigmasEMCAL(track,AliPID::kElectron,eop2,ss);
766 if(fTPCnSigma>-1.5 && fTPCnSigma<3.0 && nITS>2.5 && nTPCcl>100)
771 valEop[2] = nSigmaEop;
772 fElenSigma->Fill(valEop);
777 if(nITS<2.5)continue;
778 if(nTPCcl<100)continue;
780 CheckNclust->Fill(nTPCcl);
781 CheckNits->Fill(nITS);
783 fdEdxBef->Fill(mom,fTPCnSigma);
784 fTPCnsigma->Fill(mom,fTPCnSigma);
785 if(fTPCnSigma >= -1.0 && fTPCnSigma <= 3)fTrkEovPBef->Fill(pt,eop);
789 // check reco eff. with TPC
794 phoval[2] = fTPCnSigma;
798 if((fTPCnSigma >= -1.0 && fTPCnSigma <= 3) && mcele>-1 && mcPho && mcOrgPi0)
800 if(iHijing==1)mcWeight = 1.0;
801 fIncpTMCpho_pi0e_TPC->Fill(phoval,mcWeight);
802 if(fFlagPhotonicElec) fPhoElecPtMC_pi0e_TPC->Fill(phoval,mcWeight);
803 if(fFlagConvinatElec) fSameElecPtMC_pi0e_TPC->Fill(phoval,mcWeight);
807 AliHFEpidObject hfetrack;
808 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
809 hfetrack.SetRecTrack(track);
811 if((0.0< cent) && (cent<5.0)) binct = 0.5;
812 if((5.0< cent) && (cent<10.0)) binct = 1.5;
813 if((10.0< cent) && (cent<20.0)) binct = 2.5;
814 if((20.0< cent) && (cent<30.0)) binct = 3.5;
815 if((30.0< cent) && (cent<40.0)) binct = 4.5;
816 if((40.0< cent) && (cent<50.0)) binct = 5.5;
817 if((50.0< cent) && (cent<60.0)) binct = 6.5;
818 if((60.0< cent) && (cent<70.0)) binct = 7.5;
819 if((70.0< cent) && (cent<80.0)) binct = 8.5;
820 if((80.0< cent) && (cent<90.0)) binct = 9.5;
821 if((90.0< cent) && (cent<100.0)) binct = 10.5;
823 hfetrack.SetCentrality((int)binct); //added
825 if(!fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 0;
827 if(pidpassed==0) continue;
829 fTrkEovPAft->Fill(pt,eop);
830 fdEdxAft->Fill(mom,fTPCnSigma);
833 fIncpT->Fill(cent,pt);
834 if(fFlagPhotonicElec) fPhoElecPt->Fill(cent,pt);
835 if(fFlagConvinatElec) fSameElecPt->Fill(cent,pt);
837 if(m20>0.0 && m20<0.3)
839 fIncpTM20->Fill(cent,pt);
840 ftimingEle->Fill(pt,emctof);
841 if(fFlagPhotonicElec) fPhoElecPtM20->Fill(cent,pt);
842 if(fFlagConvinatElec) fSameElecPtM20->Fill(cent,pt);
846 // check label for electron candidiates
849 if(mcLabel==0)idlabel = 0;
850 fLabelCheck->Fill(pt,idlabel);
851 if(mcLabel==0)fgeoFake->Fill(phi,eta);
853 if(mcLabel<0 && m20>0.0 && m20<0.3 && fTPCnSigma>-1 && fTPCnSigma<3)
855 fFakeTrk0->Fill(cent,pt);
858 if(mcele>-1) // select MC electrons
861 fIncpTMChfeAll->Fill(cent,pt);
862 if(m20>0.0 && m20<0.3)fIncpTMCM20hfeAll->Fill(cent,pt);
863 if(m20>0.0 && m20<0.3 && fTPCnSigma>-1 && fTPCnSigma<3)fFakeTrk1->Fill(cent,pt);
865 if(mcBtoE || mcDtoE) // select B->e & D->e
867 fIncpTMChfe->Fill(cent,pt);
868 //if(m20>0.0 && m20<0.3)fIncpTMCM20hfe->Fill(cent,pt);
869 //if(m20>0.0 && m20<0.3)fIncpTMCM20hfeCheck->Fill(cent,mcpT);
870 if(m20>0.0 && m20<0.3)
872 //cout << "MC label = " << mcLabel << endl;
873 fIncpTMCM20hfe->Fill(cent,pt);
874 fIncpTMCM20hfeCheck->Fill(cent,mcpT);
875 fIncpTMCM20hfeCheck_weight->Fill(phoval);
879 if(mcPho) // select photonic electrons
882 fIncpTMCpho->Fill(phoval);
883 if(fFlagPhotonicElec) fPhoElecPtMC->Fill(phoval);
884 if(fFlagConvinatElec) fSameElecPtMC->Fill(phoval);
886 if(m20>0.0 && m20<0.3)
888 fIncpTMCM20pho->Fill(phoval);
889 if(fFlagPhotonicElec) fPhoElecPtMCM20->Fill(phoval);
890 if(fFlagConvinatElec) fSameElecPtMCM20->Fill(phoval);
894 if(iHijing==1)mcWeight = 1.0;
897 fIncpTMCM20pho_pi0e->Fill(phoval,mcWeight);
898 if(fFlagPhotonicElec) fPhoElecPtMCM20_pi0e->Fill(phoval,mcWeight);
899 if(fFlagConvinatElec) fSameElecPtMCM20_pi0e->Fill(phoval,mcWeight);
900 //fIncpTMCM20pho_pi0e->Fill(phoval); // v5-04-02-AN & v5-04-06-AN
901 //if(fFlagPhotonicElec) fPhoElecPtMCM20_pi0e->Fill(phoval);
902 //if(fFlagConvinatElec) fSameElecPtMCM20_pi0e->Fill(phoval);
906 fIncpTMCM20pho_eta->Fill(phoval,mcWeight);
907 if(fFlagPhotonicElec) fPhoElecPtMCM20_eta->Fill(phoval,mcWeight);
908 if(fFlagConvinatElec) fSameElecPtMCM20_eta->Fill(phoval,mcWeight);
909 //fIncpTMCM20pho_eta->Fill(phoval);
910 //if(fFlagPhotonicElec) fPhoElecPtMCM20_eta->Fill(phoval);
911 //if(fFlagConvinatElec) fSameElecPtMCM20_eta->Fill(phoval);
919 PostData(1, fOutputList);
921 //_________________________________________
922 void AliAnalysisTaskHFECal::UserCreateOutputObjects()
926 //Bool_t mcData = kFALSE;
927 if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())
930 printf("+++++ MC Data available");
934 printf("++++++++= MC analysis \n");
938 printf("++++++++ real data analysis \n");
941 printf("+++++++ QA hist %d",fqahist);
944 fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
946 //--------Initialize PID
947 //fPID->SetHasMCData(kFALSE);
948 fPID->SetHasMCData(fmcData);
949 if(!fPID->GetNumberOfPIDdetectors())
951 fPID->AddDetector("TPC", 0);
952 fPID->AddDetector("EMCAL", 1);
956 const char *cutmodel;
958 params[0] = -1.0; //sigma min
959 double maxnSig = 3.0;
962 params[0] = -5.0; //sigma min
966 for(Int_t a=0;a<11;a++)fPID->ConfigureTPCcentralityCut(a,cutmodel,params,maxnSig);
968 fPID->SortDetectors();
969 fPIDqa = new AliHFEpidQAmanager();
970 fPIDqa->Initialize(fPID);
972 //------- fcut --------------
973 fCuts = new AliHFEcuts();
974 fCuts->CreateStandardCuts();
975 //fCuts->SetMinNClustersTPC(100);
976 fCuts->SetMinNClustersTPC(90);
977 fCuts->SetMinRatioTPCclusters(0.6);
978 fCuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
979 //fCuts->SetMinNClustersITS(3);
980 fCuts->SetMinNClustersITS(2);
981 fCuts->SetCutITSpixel(AliHFEextraCuts::kAny);
982 fCuts->SetCheckITSLayerStatus(kFALSE);
983 fCuts->SetVertexRange(10.);
984 fCuts->SetTOFPIDStep(kFALSE);
985 fCuts->SetPtRange(2, 50);
986 fCuts->SetMaxImpactParam(3.,3.);
988 //--------Initialize correction Framework and Cuts
989 fCFM = new AliCFManager;
990 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
991 fCFM->SetNStepParticle(kNcutSteps);
992 for(Int_t istep = 0; istep < kNcutSteps; istep++)
993 fCFM->SetParticleCutsList(istep, NULL);
996 AliWarning("Cuts not available. Default cuts will be used");
997 fCuts = new AliHFEcuts;
998 fCuts->CreateStandardCuts();
1000 fCuts->Initialize(fCFM);
1002 //---------Output Tlist
1003 fOutputList = new TList();
1004 fOutputList->SetOwner();
1005 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
1007 fNoEvents = new TH1F("fNoEvents","",4,-0.5,3.5) ;
1008 fOutputList->Add(fNoEvents);
1010 Int_t binsE[5] = {250, 100, 1000, 200, 10};
1011 Double_t xminE[5] = {1.0, -1, 0.0, 0, -0.5};
1012 Double_t xmaxE[5] = {3.5, 1, 100.0, 100, 9.5};
1013 fEMCAccE = new THnSparseD("fEMCAccE","EMC acceptance & E;#eta;#phi;Energy;Centrality;trugCondition;",5,binsE,xminE,xmaxE);
1014 if(fqahist==1)fOutputList->Add(fEMCAccE);
1016 hEMCAccE = new TH2F("hEMCAccE","Cluster Energy",200,0,100,100,0,20);
1017 fOutputList->Add(hEMCAccE);
1019 fTrkpt = new TH1F("fTrkpt","track pt",100,0,50);
1020 fOutputList->Add(fTrkpt);
1022 fTrackPtBefTrkCuts = new TH1F("fTrackPtBefTrkCuts","track pt before track cuts",100,0,50);
1023 fOutputList->Add(fTrackPtBefTrkCuts);
1025 fTrackPtAftTrkCuts = new TH1F("fTrackPtAftTrkCuts","track pt after track cuts",100,0,50);
1026 fOutputList->Add(fTrackPtAftTrkCuts);
1028 fTPCnsigma = new TH2F("fTPCnsigma", "TPC - n sigma",100,0,50,200,-10,10);
1029 fOutputList->Add(fTPCnsigma);
1031 fTrkEovPBef = new TH2F("fTrkEovPBef","track E/p before HFE pid",100,0,50,100,0,2);
1032 fOutputList->Add(fTrkEovPBef);
1034 fTrkEovPAft = new TH2F("fTrkEovPAft","track E/p after HFE pid",100,0,50,100,0,2);
1035 fOutputList->Add(fTrkEovPAft);
1037 fdEdxBef = new TH2F("fdEdxBef","track dEdx vs p before HFE pid",100,0,50,200,-10,10);
1038 fOutputList->Add(fdEdxBef);
1040 fdEdxAft = new TH2F("fdEdxAft","track dEdx vs p after HFE pid",100,0,50,200,-10,10);
1041 fOutputList->Add(fdEdxAft);
1043 fIncpT = new TH2F("fIncpT","HFE pid electro vs. centrality",200,0,100,100,0,50);
1044 fOutputList->Add(fIncpT);
1046 fIncpTM20 = new TH2F("fIncpTM20","HFE pid electro vs. centrality with M20",200,0,100,100,0,50);
1047 fOutputList->Add(fIncpTM20);
1049 Int_t nBinspho[9] = { 200, 100, 500, 12, 50, 4, 200, 8, 100};
1050 Double_t minpho[9] = { 0., 0., 0., -2.5, 0, -0.5, 0,-1.5, 0};
1051 Double_t maxpho[9] = {100., 50., 0.5, 3.5, 1, 3.5, 2, 6.5, 50};
1053 fInvmassLS = new THnSparseD("fInvmassLS", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2); nSigma; angle; m20cut; eop; Mcele;", 9, nBinspho,minpho, maxpho);
1054 if(fqahist==1)fOutputList->Add(fInvmassLS);
1056 fInvmassULS = new THnSparseD("fInvmassULS", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2); nSigma; angle; m20cut; eop; MCele", 9, nBinspho,minpho, maxpho);
1057 if(fqahist==1)fOutputList->Add(fInvmassULS);
1059 fInvmassLSmc = new THnSparseD("fInvmassLSmc", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2); nSigma; angle; m20cut; eop; Mcele;", 9, nBinspho,minpho, maxpho);
1060 if(fqahist==1)fOutputList->Add(fInvmassLSmc);
1062 fInvmassULSmc = new THnSparseD("fInvmassULSmc", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2); nSigma; angle; m20cut; eop; MCele", 9, nBinspho,minpho, maxpho);
1063 if(fqahist==1)fOutputList->Add(fInvmassULSmc);
1065 fInvmassLSmc0 = new TH2D("fInvmassLSmc0", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1066 fInvmassLSmc0->Sumw2();
1067 fOutputList->Add(fInvmassLSmc0);
1069 fInvmassLSmc1 = new TH2D("fInvmassLSmc1", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1070 fInvmassLSmc1->Sumw2();
1071 fOutputList->Add(fInvmassLSmc1);
1073 fInvmassLSmc2 = new TH2D("fInvmassLSmc2", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1074 fInvmassLSmc2->Sumw2();
1075 fOutputList->Add(fInvmassLSmc2);
1077 fInvmassLSmc3 = new TH2D("fInvmassLSmc3", "Inv mass of LS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1078 fInvmassLSmc3->Sumw2();
1079 fOutputList->Add(fInvmassLSmc3);
1081 fInvmassULSmc0 = new TH2D("fInvmassULSmc0", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1082 fInvmassULSmc0->Sumw2();
1083 fOutputList->Add(fInvmassULSmc0);
1085 fInvmassULSmc1 = new TH2D("fInvmassULSmc1", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1086 fInvmassULSmc1->Sumw2();
1087 fOutputList->Add(fInvmassULSmc1);
1089 fInvmassULSmc2 = new TH2D("fInvmassULSmc2", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1090 fInvmassULSmc2->Sumw2();
1091 fOutputList->Add(fInvmassULSmc2);
1093 fInvmassULSmc3 = new TH2D("fInvmassULSmc3", "Inv mass of ULS (e,e); cent; p_{T} (GeV/c); mass(GeV/c^2)",20,0,20,500,0,0.5 );
1094 fInvmassULSmc3->Sumw2();
1095 fOutputList->Add(fInvmassULSmc3);
1097 fOpeningAngleLS = new TH1F("fOpeningAngleLS","Opening angle for LS pairs",100,0,1);
1098 fOutputList->Add(fOpeningAngleLS);
1100 fOpeningAngleULS = new TH1F("fOpeningAngleULS","Opening angle for ULS pairs",100,0,1);
1101 fOutputList->Add(fOpeningAngleULS);
1103 fPhotoElecPt = new TH1F("fPhotoElecPt", "photonic electron pt",100,0,50);
1104 fOutputList->Add(fPhotoElecPt);
1106 fPhoElecPt = new TH2F("fPhoElecPt", "Pho-inclusive electron pt",200,0,100,100,0,50);
1107 fOutputList->Add(fPhoElecPt);
1109 fPhoElecPtM20 = new TH2F("fPhoElecPtM20", "Pho-inclusive electron pt with M20",200,0,100,100,0,50);
1110 fOutputList->Add(fPhoElecPtM20);
1112 fSameElecPt = new TH2F("fSameElecPt", "Same-inclusive electron pt",200,0,100,100,0,50);
1113 fOutputList->Add(fSameElecPt);
1115 fSameElecPtM20 = new TH2F("fSameElecPtM20", "Same-inclusive electron pt with M20",200,0,100,100,0,50);
1116 fOutputList->Add(fSameElecPtM20);
1118 fCent = new TH1F("fCent","Centrality",200,0,100) ;
1119 fOutputList->Add(fCent);
1121 // Make common binning
1122 const Double_t kMinP = 0.;
1123 const Double_t kMaxP = 20.;
1125 // 1st histogram: TPC dEdx with/without EMCAL (p, pT, TPC Signal, phi, eta, Sig, e/p, ,match, cell, M02, M20, Disp, Centrality, select)
1126 Int_t nBins[16] = { 100, 7, 60, 20, 90, 250, 25, 40, 10, 200, 100, 100, 500, 5, 100, 8};
1127 Double_t min[16] = {kMinP, -0.5, 1.0, -1.0, -5.0, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, -0.5, 80, -1.5};
1128 Double_t max[16] = {kMaxP, 6.5, 4.0, 1.0, 4.0, 2.5, 0.05, 40, 10, 2.0, 20.0, 100, 100, 4.5, 180, 6.5};
1129 fEleInfo = new THnSparseD("fEleInfo", "Electron Info; pT [GeV/c]; TPC signal;phi;eta;nSig; E/p;Rmatch;Ncell;clsF;M20;mcpT;Centrality;charge;opp;same;trigCond;MCele", 16, nBins, min, max);
1130 if(fqahist==1)fOutputList->Add(fEleInfo);
1132 // Make common binning
1133 Int_t nBinsEop[3] = { 10, 50, 100};
1134 Double_t minEop[3] = { 0, 0, -5};
1135 Double_t maxEop[3] = {100, 50, 5};
1136 fElenSigma= new THnSparseD("fElenSigma", "Electron nSigma; cent; pT [GeV/c]; nSigma", 3, nBinsEop, minEop, maxEop);
1137 fOutputList->Add(fElenSigma);
1142 fClsEBftTrigCut = new TH1F("fClsEBftTrigCut","cluster E before trigger selection",1000,0,100);
1143 fOutputList->Add(fClsEBftTrigCut);
1145 fClsEAftTrigCut = new TH1F("fClsEAftTrigCut","cluster E if cls has 0 trigcut channel",1000,0,100);
1146 fOutputList->Add(fClsEAftTrigCut);
1148 fClsEAftTrigCut1 = new TH1F("fClsEAftTrigCut1","cluster E if cls with trig channel",1000,0,100);
1149 fOutputList->Add(fClsEAftTrigCut1);
1151 fClsEAftTrigCut2 = new TH1F("fClsEAftTrigCut2","cluster E if cls with trigcut channel",1000,0,100);
1152 fOutputList->Add(fClsEAftTrigCut2);
1154 fClsEAftTrigCut3 = new TH1F("fClsEAftTrigCut3","cluster E if cls with trigcut channel + nCell>Ecorrect",1000,0,100);
1155 fOutputList->Add(fClsEAftTrigCut3);
1157 fClsEAftTrigCut4 = new TH1F("fClsEAftTrigCut4","cluster E if cls with trigcut channel + nCell>Ecorrect + cls time cut",1000,0,100);
1158 fOutputList->Add(fClsEAftTrigCut4);
1160 fClsETime = new TH2F("fClsETime", "Cls time vs E; E; time;",1000,0,100,1000,-0.0000002,0.0000009);
1161 fOutputList->Add(fClsETime);
1163 fClsETime1 = new TH2F("fClsETime1", "Cls time vs E if cls contains trigger channel; E; time;",1000,0,100,1000,-0.0000002,0.0000009);
1164 fOutputList->Add(fClsETime1);
1166 fTrigTimes = new TH1F("fTrigTimes", "Trigger time; time; N;",25,0,25);
1167 fOutputList->Add(fTrigTimes);
1169 fCellCheck = new TH2F("fCellCheck", "Cell vs E; E GeV; Cell ID",10,6,26,12000,0,12000);
1170 fOutputList->Add(fCellCheck);
1174 fInputHFEMC = new TH2F("fInputHFEMC","Input MC HFE pid electro vs. centrality",200,0,100,100,0,50);
1175 fOutputList->Add(fInputHFEMC);
1177 fInputAlle = new TH2F("fInputAlle","Input MC electro vs. centrality",200,0,100,100,0,50);
1178 fOutputList->Add(fInputAlle);
1180 fIncpTMChfe = new TH2F("fIncpTMChfe","MC HFE pid electro vs. centrality",200,0,100,100,0,50);
1181 fOutputList->Add(fIncpTMChfe);
1183 fIncpTMChfeAll = new TH2F("fIncpTMChfeAll","MC Alle pid electro vs. centrality",200,0,100,100,0,50);
1184 fOutputList->Add(fIncpTMChfeAll);
1186 fIncpTMCM20hfe = new TH2F("fIncpTMCM20hfe","MC HFE pid electro vs. centrality with M20",200,0,100,100,0,50);
1187 fOutputList->Add(fIncpTMCM20hfe);
1189 fIncpTMCM20hfeAll = new TH2F("fIncpTMCM20hfeAll","MC Alle pid electro vs. centrality with M20",200,0,100,100,0,50);
1190 fOutputList->Add(fIncpTMCM20hfeAll);
1192 fIncpTMCM20hfeCheck = new TH2F("fIncpTMCM20hfeCheck","MC HFE pid electro vs. centrality with M20 Check",200,0,100,100,0,50);
1193 fOutputList->Add(fIncpTMCM20hfeCheck);
1195 Int_t nBinspho2[5] = { 200, 100, 7, 3, 700};
1196 Double_t minpho2[5] = { 0., 0., -2.5, -0.5, 0.};
1197 Double_t maxpho2[5] = {100., 50., 4.5, 2.5, 70.};
1199 fInputHFEMC_weight = new THnSparseD("fInputHFEMC_weight", "MC HFE electron pt",5,nBinspho2,minpho2,maxpho2);
1200 fOutputList->Add(fInputHFEMC_weight);
1202 fIncpTMCM20hfeCheck_weight = new THnSparseD("fIncpTMCM20hfeCheck_weight", "HFE electron pt with M20",5,nBinspho2,minpho2,maxpho2);
1203 fOutputList->Add(fIncpTMCM20hfeCheck_weight);
1205 fIncpTMCpho = new THnSparseD("fIncpTMCpho","MC Pho pid electro vs. centrality",5,nBinspho2,minpho2,maxpho2);
1206 fOutputList->Add(fIncpTMCpho);
1208 fIncpTMCM20pho = new THnSparseD("fIncpTMCM20pho","MC Pho pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
1209 fOutputList->Add(fIncpTMCM20pho);
1211 fPhoElecPtMC = new THnSparseD("fPhoElecPtMC", "MC Pho-inclusive electron pt",5,nBinspho2,minpho2,maxpho2);
1212 fOutputList->Add(fPhoElecPtMC);
1214 fPhoElecPtMCM20 = new THnSparseD("fPhoElecPtMCM20", "MC Pho-inclusive electron pt with M20",5,nBinspho2,minpho2,maxpho2);
1215 fOutputList->Add(fPhoElecPtMCM20);
1217 fSameElecPtMC = new THnSparseD("fSameElecPtMC", "MC Same-inclusive electron pt",5,nBinspho2,minpho2,maxpho2);
1218 fOutputList->Add(fSameElecPtMC);
1220 fSameElecPtMCM20 = new THnSparseD("fSameElecPtMCM20", "MC Same-inclusive electron pt with M20",5,nBinspho2,minpho2,maxpho2);
1221 fOutputList->Add(fSameElecPtMCM20);
1223 fIncpTMCM20pho_pi0e = new THnSparseD("fIncpTMCM20pho_pi0e","MC Pho pi0->e pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
1224 fIncpTMCM20pho_pi0e->Sumw2();
1225 fOutputList->Add(fIncpTMCM20pho_pi0e);
1227 fPhoElecPtMCM20_pi0e = new THnSparseD("fPhoElecPtMCM20_pi0e", "MC Pho-inclusive electron pt with M20 pi0->e",5,nBinspho2,minpho2,maxpho2);
1228 fPhoElecPtMCM20_pi0e->Sumw2();
1229 fOutputList->Add(fPhoElecPtMCM20_pi0e);
1231 fSameElecPtMCM20_pi0e = new THnSparseD("fSameElecPtMCM20_pi0e", "MC Same-inclusive electron pt pi0->e",5,nBinspho2,minpho2,maxpho2);
1232 fSameElecPtMCM20_pi0e->Sumw2();
1233 fOutputList->Add(fSameElecPtMCM20_pi0e);
1235 fIncpTMCM20pho_eta = new THnSparseD("fIncpTMCM20pho_eta","MC Pho pi0->e pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
1236 fIncpTMCM20pho_eta->Sumw2();
1237 fOutputList->Add(fIncpTMCM20pho_eta);
1239 fPhoElecPtMCM20_eta = new THnSparseD("fPhoElecPtMCM20_eta", "MC Pho-inclusive electron pt with M20 pi0->e",5,nBinspho2,minpho2,maxpho2);
1240 fPhoElecPtMCM20_eta->Sumw2();
1241 fOutputList->Add(fPhoElecPtMCM20_eta);
1243 fSameElecPtMCM20_eta = new THnSparseD("fSameElecPtMCM20_eta", "MC Same-inclusive electron pt pi0->e",5,nBinspho2,minpho2,maxpho2);
1244 fSameElecPtMCM20_eta->Sumw2();
1245 fOutputList->Add(fSameElecPtMCM20_eta);
1247 fIncpTMCpho_pi0e_TPC = new THnSparseD("fIncpTMCpho_pi0e_TPC","MC Pho pi0->e pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
1248 fIncpTMCpho_pi0e_TPC->Sumw2();
1249 fOutputList->Add(fIncpTMCpho_pi0e_TPC);
1251 fPhoElecPtMC_pi0e_TPC = new THnSparseD("fPhoElecPtMC_pi0e_TPC", "MC Pho-inclusive electron pt with pi0->e",5,nBinspho2,minpho2,maxpho2);
1252 fPhoElecPtMC_pi0e_TPC->Sumw2();
1253 fOutputList->Add(fPhoElecPtMC_pi0e_TPC);
1255 fSameElecPtMC_pi0e_TPC = new THnSparseD("fSameElecPtMC_pi0e_TPC", "MC Same-inclusive electron pt pi0->e",5,nBinspho2,minpho2,maxpho2);
1256 fSameElecPtMC_pi0e_TPC->Sumw2();
1257 fOutputList->Add(fSameElecPtMC_pi0e_TPC);
1260 CheckNclust = new TH1D("CheckNclust","cluster check",200,0,200);
1261 fOutputList->Add(CheckNclust);
1263 CheckNits = new TH1D("CheckNits","ITS cluster check",8,-0.5,7.5);
1264 fOutputList->Add(CheckNits);
1266 Hpi0pTcheck = new TH2D("Hpi0pTcheck","Pi0 pT from Hijing",100,0,50,3,-0.5,2.5);
1267 fOutputList->Add(Hpi0pTcheck);
1269 HETApTcheck = new TH2D("HETApTcheck","Eta pT from Hijing",100,0,50,3,-0.5,2.5);
1270 fOutputList->Add(HETApTcheck);
1273 Int_t nBinspho3[3] = { 200, 100, 3};
1274 Double_t minpho3[3] = { 0., 0., -0.5};
1275 Double_t maxpho3[3] = {100., 50., 2.5};
1277 Hpi0pTcheck = new THnSparseD("Hpi0pTcheck","Pi0 pT from Hijing",3,nBinspho3,minpho3,maxpho3);
1278 fOutputList->Add(Hpi0pTcheck);
1280 HETApTcheck = new THnSparseD("HETApTcheck","Eta pT from Hijing",3,nBinspho3,minpho3,maxpho3);
1281 fOutputList->Add(HETApTcheck);
1283 HphopTcheck = new TH2D("HphopTcheck","Pho pT from Hijing",100,0,50,3,-0.5,2.5);
1284 fOutputList->Add(HphopTcheck);
1286 HDpTcheck = new TH2D("HDpTcheck","D pT from Hijing",100,0,50,3,-0.5,2.5);
1287 fOutputList->Add(HDpTcheck);
1289 HBpTcheck = new TH2D("HBpTcheck","B pT from Hijing",100,0,50,3,-0.5,2.5);
1290 fOutputList->Add(HBpTcheck);
1293 fpTCheck = new TH1D("fpTCheck","pT check",500,0,50);
1294 fOutputList->Add(fpTCheck);
1296 fMomDtoE = new TH2D("fMomDtoE","D->E pT correlations;e p_{T} GeV/c;D p_{T} GeV/c",400,0,40,400,0,40);
1297 fOutputList->Add(fMomDtoE);
1299 fLabelCheck = new TH2D("fLabelCheck","MC label",50,0,50,5,-1.5,3.5);
1300 fOutputList->Add(fLabelCheck);
1302 fgeoFake = new TH2D("fgeoFake","Label==0 eta and phi",628,0,6.28,200,-1,1);
1303 fOutputList->Add(fgeoFake);
1305 fFakeTrk0 = new TH2D("fFakeTrk0","fake trakcs",10,0,100,20,0,20);
1306 fOutputList->Add(fFakeTrk0);
1308 fFakeTrk1 = new TH2D("fFakeTrk1","true all e a.f. eID",10,0,100,20,0,20);
1309 fOutputList->Add(fFakeTrk1);
1311 ftimingEle = new TH2D("ftimingEle","electron TOF",100,0,20,100,1e-7,1e-6);
1312 fOutputList->Add(ftimingEle);
1315 // note: parameters 01/31new.TPCnSigmaEtaDep
1316 // 70-90 delta_eta = 0.2
1318 double etaval[12] = {-0.55,-0.45,-0.35,-0.25,-0.15,-0.05,0.05,0.15,0.25,0.35,0.45,0.55};
1319 double corr0[12]= {-0.569177,-0.528844,-0.391979,-0.165494,0.0283495,0.156171,0.266353,0.13103,-0.0250842,-0.274089,-0.45481,-0.536291}; // 0-10 (done)
1320 double corr1[12]= {-0.404742,-0.278953,-0.218069,0.00139927,0.191412,0.354403,0.524594,0.341778,0.244199,-0.112146,-0.160692,-0.352832}; // 10-20 (done)
1321 double corr2[12] = {-0.306007,-0.16821,-0.0248635,0.202233,0.447051,0.497197,0.712251,0.433482,0.337907,0.168426,-0.0693229,-0.0728351}; // 20-30 (done)
1322 double corr3[12] = {-0.13884,-0.0503553,0.104403,0.389773,0.50697,0.539048,0.751642,0.655636,0.518563,0.308156,0.0361159,-0.0491439}; // 30-40 (done)
1323 double corr4[12] = {-0.0319431,0.0808711,0.208774,0.443217,0.557762,0.61453,0.889519,0.808282,0.620394,0.267092,0.15241,-0.0458664}; // 40-50 (done)
1324 double corr5[12] = {-0.130625,0.0189124,0.190344,0.467431,0.546353,0.672251,0.731541,0.802101,0.437108,0.294081,0.193682,0.159074}; // 50-70(done)
1325 double corr6[12] = {0.0600197,0.0600197,0.358366,0.358366,0.973734,0.973734,0.759812,0.759812,0.667861,0.667861,0.415635,0.415635}; // 70-90(done)
1327 fnSigEtaCorr[0] = new TGraphErrors(12,etaval,corr0); // 0-10
1328 fnSigEtaCorr[1] = new TGraphErrors(12,etaval,corr1); // 10-20
1329 fnSigEtaCorr[2] = new TGraphErrors(12,etaval,corr2); // 20-30
1330 fnSigEtaCorr[3] = new TGraphErrors(12,etaval,corr3); // 30-40
1331 fnSigEtaCorr[4] = new TGraphErrors(12,etaval,corr4); // 40-50
1332 fnSigEtaCorr[5] = new TGraphErrors(12,etaval,corr5); // 50-70
1333 fnSigEtaCorr[6] = new TGraphErrors(12,etaval,corr6); // 70-90
1336 PostData(1,fOutputList);
1339 //________________________________________________________________________
1340 void AliAnalysisTaskHFECal::Terminate(Option_t *)
1342 // Info("Terminate");
1343 AliAnalysisTaskSE::Terminate();
1346 //________________________________________________________________________
1347 Bool_t AliAnalysisTaskHFECal::ProcessCutStep(Int_t cutStep, AliVParticle *track)
1349 // Check single track cuts for a given cut step
1350 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
1351 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
1354 //_________________________________________
1355 //void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, Bool_t &fFlagPhotonicElec)
1356 //void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, Bool_t &fFlagPhotonicElec, Bool_t &fFlagConvinatElec, Double_t nSig)
1357 void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, Bool_t &fFlagPhotonicElec, Bool_t &fFlagConvinatElec, Double_t nSig, Double_t shower, Double_t ep, Double_t mce, Double_t w, Int_t ibgevent, Bool_t tagpi0, Bool_t tageta)
1359 //Identify non-heavy flavour electrons using Invariant mass method
1361 fTrackCuts->SetAcceptKinkDaughters(kFALSE);
1362 fTrackCuts->SetRequireTPCRefit(kTRUE);
1363 fTrackCuts->SetRequireITSRefit(kTRUE);
1364 fTrackCuts->SetEtaRange(-0.9,0.9);
1365 //fTrackCuts->SetRequireSigmaToVertex(kTRUE);
1366 fTrackCuts->SetMaxChi2PerClusterTPC(3.5);
1367 fTrackCuts->SetMinNClustersTPC(90);
1369 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
1371 double ptEle = track->Pt(); //add
1372 if(ibgevent==0 && w > 0.0)
1374 fpTCheck->Fill(ptEle,w);
1377 Bool_t flagPhotonicElec = kFALSE;
1378 Bool_t flagConvinatElec = kFALSE;
1383 Int_t label = TMath::Abs(track->GetLabel());
1384 TParticle* particle = stack->Particle(label);
1385 p1 = particle->GetFirstMother();
1388 //for(Int_t jTracks = itrack+1; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1389 for(Int_t jTracks = 0; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1390 AliESDtrack* trackAsso = fESD->GetTrack(jTracks);
1392 printf("ERROR: Could not receive track %d\n", jTracks);
1395 if(itrack==jTracks)continue;
1401 Int_t label2 = TMath::Abs(trackAsso->GetLabel());
1402 TParticle* particle2 = stack->Particle(label2);
1403 Bool_t MChijing_ass = fMC->IsFromBGEvent(label2);
1404 if(MChijing_ass)jbgevent =1;
1405 if(particle2->GetFirstMother()>-1)
1406 p2 = particle2->GetFirstMother();
1409 Double_t dEdxAsso = -999., ptPrim=-999., ptAsso=-999., openingAngle = -999.;
1410 Double_t mass=999., width = -999;
1411 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1413 //ptPrim = track->Pt();
1416 dEdxAsso = trackAsso->GetTPCsignal();
1417 ptAsso = trackAsso->Pt();
1418 Int_t chargeAsso = trackAsso->Charge();
1419 Int_t charge = track->Charge();
1422 if(ptAsso <0.5) continue;
1423 if(!fTrackCuts->AcceptTrack(trackAsso)) continue;
1424 if(dEdxAsso <65 || dEdxAsso>100) continue; //11a pass1
1426 Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1427 if(charge>0) fPDGe1 = -11;
1428 if(chargeAsso>0) fPDGe2 = -11;
1430 //printf("chargeAsso = %d\n",chargeAsso);
1431 //printf("charge = %d\n",charge);
1432 if(charge == chargeAsso) fFlagLS = kTRUE;
1433 if(charge != chargeAsso) fFlagULS = kTRUE;
1435 //printf("fFlagLS = %d\n",fFlagLS);
1436 //printf("fFlagULS = %d\n",fFlagULS);
1439 AliKFParticle ge1(*track, fPDGe1);
1440 AliKFParticle ge2(*trackAsso, fPDGe2);
1441 AliKFParticle recg(ge1, ge2);
1444 AliKFVertex primV(*pVtx);
1446 recg.SetProductionVertex(primV);
1449 if(recg.GetNDF()<1) continue;
1452 recg.SetMassConstraint(0,0.0001);
1453 // v5-04-50-AN no constrain
1454 recg.GetMass(mass,width);
1456 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1457 if(TMath::Sqrt(TMath::Abs(chi2recg))>30.) continue;
1460 openingAngle = ge1.GetAngle(ge2);
1461 if(fFlagLS) fOpeningAngleLS->Fill(openingAngle);
1462 if(fFlagULS) fOpeningAngleULS->Fill(openingAngle);
1465 if(shower>0.0 && shower<0.3)ishower = 1;
1469 phoinfo[1] = ptPrim;
1472 phoinfo[4] = openingAngle;
1473 phoinfo[5] = ishower;
1476 phoinfo[8] = ptAsso;
1478 if(fFlagLS) fInvmassLS->Fill(phoinfo);
1479 if(fFlagULS) fInvmassULS->Fill(phoinfo);
1480 if(fFlagLS && ibgevent==0 && jbgevent==0) fInvmassLSmc->Fill(phoinfo,w);
1481 if(fFlagULS && ibgevent==0 && jbgevent==0)
1483 fInvmassULSmc->Fill(phoinfo,w);
1485 //printf("fInvmassCut %f\n",fInvmassCut);
1486 //printf("openingAngle %f\n",fOpeningAngleCut);
1489 if(openingAngle > fOpeningAngleCut) continue;
1492 //printf("mce =%f\n",mce);
1493 if(mce<-0.5) // mce==-1. is real
1495 //printf("Real data\n");
1496 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec){
1497 //if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec && (p1==p2)){ <--- only MC train (55,56) v5-03-68-AN & 69 for check
1498 flagPhotonicElec = kTRUE;
1500 if(mass<fInvmassCut && fFlagLS && !flagConvinatElec){
1501 flagConvinatElec = kTRUE;
1507 //printf("MC data\n");
1511 //cout << "tagpi0 = " << tagpi0 << " ; tageta = " << tageta << endl;
1512 if(fFlagLS && ibgevent==0 && jbgevent==0 && tagpi0) fInvmassLSmc0->Fill(ptPrim,mass,w);
1513 if(fFlagULS && ibgevent==0 && jbgevent==0 && tagpi0) fInvmassULSmc0->Fill(ptPrim,mass,w);
1514 if(fFlagLS && ibgevent==0 && jbgevent==0 && tageta) fInvmassLSmc1->Fill(ptPrim,mass,w);
1515 if(fFlagULS && ibgevent==0 && jbgevent==0 && tageta) fInvmassULSmc1->Fill(ptPrim,mass,w);
1516 if(fFlagLS && ibgevent==0 && jbgevent==0 && (p1==p2) && tagpi0) fInvmassLSmc2->Fill(ptPrim,mass,w);
1517 if(fFlagULS && ibgevent==0 && jbgevent==0 && (p1==p2) && tagpi0) fInvmassULSmc2->Fill(ptPrim,mass,w);
1518 if(fFlagLS && ibgevent==0 && jbgevent==0 && (p1==p2) && tageta) fInvmassLSmc3->Fill(ptPrim,mass,w);
1519 if(fFlagULS && ibgevent==0 && jbgevent==0 && (p1==p2) && tageta) fInvmassULSmc3->Fill(ptPrim,mass,w);
1521 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec && (ibgevent==jbgevent)){
1522 //if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec && (p1==p2)){ <--- only MC train (55,56) v5-03-68-AN & 69 for check
1523 flagPhotonicElec = kTRUE;
1525 if(mass<fInvmassCut && fFlagLS && !flagConvinatElec && (ibgevent==jbgevent)){
1526 flagConvinatElec = kTRUE;
1531 fFlagPhotonicElec = flagPhotonicElec;
1532 fFlagConvinatElec = flagConvinatElec;
1535 //-------------------------------------------
1537 void AliAnalysisTaskHFECal::FindMother(TParticle* part, int &label, int &pid)
1539 //int label = 99999;
1542 if(part->GetFirstMother()>-1)
1544 label = part->GetFirstMother();
1545 pid = stack->Particle(label)->GetPdgCode();
1547 //cout << "Find Mother : label = " << label << " ; pid" << pid << endl;
1550 double AliAnalysisTaskHFECal::GetMCweight(double mcPi0pT)
1552 double weight = 1.0;
1554 if(mcPi0pT>0.0 && mcPi0pT<5.0)
1556 weight = 0.323*mcPi0pT/(TMath::Exp(-1.6+0.767*mcPi0pT+0.0285*mcPi0pT*mcPi0pT));
1560 weight = 115.0/(0.718*mcPi0pT*TMath::Power(mcPi0pT,3.65));
1565 double AliAnalysisTaskHFECal::GetMCweightEta(double mcEtapT)
1567 double weight = 1.0;
1569 weight = 223.3/TMath::Power((TMath::Exp(-0.17*mcEtapT-0.0322*mcEtapT*mcEtapT)+mcEtapT/1.69),5.65);
1574 //_________________________________________
1575 void AliAnalysisTaskHFECal::FindTriggerClusters()
1577 //cout << "finding trigger patch" << endl;
1579 const int nModuleCols = 2;
1580 const int nModuleRows = 5;
1581 const int nColsFeeModule = 48;
1582 const int nRowsFeeModule = 24;
1583 const int nColsFaltroModule = 24;
1584 const int nRowsFaltroModule = 12;
1585 //const int faltroWidthMax = 20;
1587 // part 1, trigger extraction -------------------------------------
1588 Int_t globCol, globRow;
1589 //Int_t ntimes=0, nTrigChannel=0, nTrigChannelCut=0, trigInCut=0;
1590 Int_t ntimes=0, nTrigChannel=0, nTrigChannelCut=0;
1592 //Int_t trigtimes[faltroWidthMax];
1593 Double_t cellTime[nColsFeeModule*nModuleCols][nRowsFeeModule*nModuleRows];
1594 Double_t cellEnergy[nColsFeeModule*nModuleCols][nRowsFeeModule*nModuleRows];
1595 //Double_t fTrigCutLow = 6;
1596 //Double_t fTrigCutHigh = 10;
1597 Double_t fTimeCutLow = 469e-09;
1598 Double_t fTimeCutHigh = 715e-09;
1600 AliESDCaloTrigger * fCaloTrigger = fESD->GetCaloTrigger( "EMCAL" );
1602 // erase trigger maps
1603 for(Int_t i = 0; i < nColsFaltroModule*nModuleCols; i++ )
1605 for(Int_t j = 0; j < nRowsFaltroModule*nModuleRows; j++ )
1607 ftriggersCut[i][j] = 0;
1608 ftriggers[i][j] = 0;
1609 ftriggersTime[i][j] = 0;
1613 Int_t iglobCol=0, iglobRow=0;
1614 // go through triggers
1615 if( fCaloTrigger->GetEntries() > 0 )
1618 fCaloTrigger->Reset();
1619 while( fCaloTrigger->Next() )
1621 fCaloTrigger->GetPosition( globCol, globRow );
1622 fCaloTrigger->GetNL0Times( ntimes );
1625 if( ntimes < 1 ) continue;
1626 // get precise timings
1627 fCaloTrigger->GetL0Times( trigtimes );
1629 for(Int_t i = 0; i < ntimes; i++ )
1631 // save the first trigger time in channel
1632 if( i == 0 || triggersTime[globCol][globRow] > trigtimes[i] )
1633 triggersTime[globCol][globRow] = trigtimes[i];
1634 //printf("trigger times: %d\n",trigtimes[i]);
1636 if(trigtimes[i] > fTrigCutLow && trigtimes[i] < fTrigCutHigh )
1639 fTrigTimes->Fill(trigtimes[i]);
1643 //L1 analysis from AliAnalysisTaskEMCALTriggerQA
1645 fCaloTrigger->GetTriggerBits(bit);
1646 //cout << "bit = " << bit << endl;
1649 fCaloTrigger->GetL1TimeSum(ts);
1650 //cout << "ts = " << ts << endl;
1651 if (ts > 0)ftriggers[globCol][globRow] = 1;
1652 // number of triggered channels in event
1655 if(ts>0 && (bit >> 6 & 0x1))
1660 //cout << "ts cut = " << ts << endl;
1661 //cout << "globCol = " << globCol << endl;
1662 //cout << "globRow = " << globRow << endl;
1663 ftriggersCut[globCol][globRow] = 1;
1666 } // calo trigger entries
1667 } // has calo trigger entries
1669 // part 2 go through the clusters here -----------------------------------
1670 //cout << " part 2 go through the clusters here ----------------------------------- " << endl;
1671 Int_t nCluster=0, nCell=0, iCell=0, gCell=0;
1672 Short_t cellAddr, nSACell;
1674 //Int_t nSACell, iSACell, mclabel;
1676 Double_t cellAmp=0, cellTimeT=0, clusterTime=0, efrac=0;
1677 Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta, gphi, geta, feta, fphi;
1679 TRefArray *fCaloClusters = new TRefArray();
1680 fESD->GetEMCALClusters( fCaloClusters );
1681 nCluster = fCaloClusters->GetEntries();
1684 // save all cells times if there are clusters
1687 for(Int_t i = 0; i < nColsFeeModule*nModuleCols; i++ ){
1688 for(Int_t j = 0; j < nRowsFeeModule*nModuleRows; j++ ){
1689 cellTime[i][j] = 0.;
1690 cellEnergy[i][j] = 0.;
1695 AliESDCaloCells *fCaloCells = fESD->GetEMCALCells();
1696 //AliVCaloCells fCaloCells = fESD->GetEMCALCells();
1697 nSACell = fCaloCells->GetNumberOfCells();
1698 for(iSACell = 0; iSACell < nSACell; iSACell++ ){
1699 // get the cell info *fCal
1700 fCaloCells->GetCell( iSACell, cellAddr, cellAmp, cellTimeT , mclabel, efrac);
1702 // get cell position
1703 fGeom->GetCellIndex( cellAddr, nSupMod, nModule, nIphi, nIeta );
1704 fGeom->GetCellPhiEtaIndexInSModule( nSupMod,nModule, nIphi, nIeta, iphi, ieta);
1706 // convert co global phi eta
1707 gphi = iphi + nRowsFeeModule*(nSupMod/2);
1708 geta = ieta + nColsFeeModule*(nSupMod%2);
1710 // save cell time and energy
1711 cellTime[geta][gphi] = cellTimeT;
1712 cellEnergy[geta][gphi] = cellAmp;
1717 Int_t nClusterTrig, nClusterTrigCut;
1718 UShort_t *cellAddrs;
1719 Double_t clsE=-999, clsEta=-999, clsPhi=-999;
1720 Float_t clsPos[3] = {0.,0.,0.};
1722 for(Int_t icl=0; icl<fESD->GetNumberOfCaloClusters(); icl++)
1724 AliESDCaloCluster *cluster = fESD->GetCaloCluster(icl);
1725 if(!cluster || !cluster->IsEMCAL()) continue;
1727 // get cluster cells
1728 nCell = cluster->GetNCells();
1730 // get cluster energy
1731 clsE = cluster->E();
1733 // get cluster position
1734 cluster->GetPosition(clsPos);
1735 TVector3 clsPosVec(clsPos[0],clsPos[1],clsPos[2]);
1736 clsEta = clsPosVec.Eta();
1737 clsPhi = clsPosVec.Phi();
1739 // get the cell addresses
1740 cellAddrs = cluster->GetCellsAbsId();
1742 // check if the cluster contains cell, that was marked as triggered
1744 nClusterTrigCut = 0;
1746 // loop the cells to check, if cluser in acceptance
1747 // any cluster with a cell outside acceptance is not considered
1748 for( iCell = 0; iCell < nCell; iCell++ )
1751 //if(clsE>6.0)fCellCheck->Fill(clsE,cellAddrs[iCell]);
1753 // get cell position
1754 fGeom->GetCellIndex( cellAddrs[iCell], nSupMod, nModule, nIphi, nIeta );
1755 fGeom->GetCellPhiEtaIndexInSModule( nSupMod,nModule, nIphi, nIeta, iphi, ieta);
1757 // convert co global phi eta
1758 gphi = iphi + nRowsFeeModule*(nSupMod/2);
1759 geta = ieta + nColsFeeModule*(nSupMod%2);
1761 if( cellTime[geta][gphi] > 0. ){
1762 clusterTime += cellTime[geta][gphi];
1766 // get corresponding FALTRO
1770 //cout << "fphi = " << fphi << endl;
1771 //cout << "feta = " << feta << endl;
1773 // try to match with a triggered
1774 if( ftriggers[feta][fphi]==1)
1777 if( ftriggersCut[feta][fphi]==1)
1778 { nClusterTrigCut++;
1781 //cout << "nClusterTrigCut : " << nClusterTrigCut << endl;
1787 clusterTime = clusterTime / (Double_t)gCell;
1788 // fix the reconstriction code time 100ns jumps
1789 if( fESD->GetBunchCrossNumber() % 4 < 2 )
1790 clusterTime -= 0.0000001;
1792 //fClsETime->Fill(clsE,clusterTime);
1793 //fClsEBftTrigCut->Fill(clsE);
1796 //fClsETime1->Fill(clsE,clusterTime);
1800 cluster->SetChi2(1);
1801 //fClsEAftTrigCut1->Fill(clsE);
1804 if(nClusterTrigCut>0){
1805 cluster->SetChi2(2);
1806 //fClsEAftTrigCut2->Fill(clsE);
1809 if(nClusterTrigCut>0 && ( nCell > (1 + clsE / 3)))
1811 cluster->SetChi2(3);
1812 //fClsEAftTrigCut3->Fill(clsE);
1815 if(nClusterTrigCut>0 && (nCell > (1 + clsE / 3) )&&( clusterTime > fTimeCutLow && clusterTime < fTimeCutHigh ))
1817 // cluster->SetChi2(4);
1818 //fClsEAftTrigCut4->Fill(clsE);
1820 if(nClusterTrigCut<1)
1822 cluster->SetChi2(0);
1824 //fClsEAftTrigCut->Fill(clsE);
1830 // <-------- only MC correction
1831 double AliAnalysisTaskHFECal::MCEopMeanCorrection(double pTmc, float central)
1833 TF1 *fcorr0 = new TF1("fcorr0","[0]*tanh([1]+[2]*x)");
1834 TF1 *fcorr1 = new TF1("fcorr1","[0]*tanh([1]+[2]*x)");
1838 if(central>0 && central<=10)
1840 fcorr0->SetParameters(1.045,1.288,3.18e-01); //
1841 fcorr1->SetParameters(9.91e-01,3.466,2.344);
1843 else if(central>10 && central<=20)
1845 fcorr0->SetParameters(1.029,8.254e-01,4.07e-01);
1846 fcorr1->SetParameters(0.975,2.276,1.501e-01);
1848 else if(central>20 && central<=30)
1850 fcorr0->SetParameters(1.01,8.795e-01,3.904e-01);
1851 fcorr1->SetParameters(9.675e-01,1.654,2.583e-01);
1853 else if(central>30 && central<=40)
1855 fcorr0->SetParameters(1.00,1.466,2.305e-1);
1856 fcorr1->SetParameters(9.637e-01,1.473,2.754e-01);
1858 else if(central>40 && central<=50)
1860 fcorr0->SetParameters(1.00,1.422,1.518e-01);
1861 fcorr1->SetParameters(9.59e-01,1.421,2.931e-01);
1864 else if(central>50 && central<=70)
1866 fcorr0->SetParameters(0.989,2.495,2.167);
1867 fcorr1->SetParameters(0.961,1.734,1.438e-01);
1869 else if(central>70 && central<=100)
1871 fcorr0->SetParameters(0.981,-3.373,3.93327);
1872 fcorr1->SetParameters(9.574e-01,1.698,1.58e-01);
1876 shift = fcorr0->Eval(pTmc)-fcorr1->Eval(pTmc);
1881 // <-------- only Data correction
1882 double AliAnalysisTaskHFECal::NsigmaCorrection(double tmpeta, float central)
1886 if(central>=0 && central<10)
1890 else if(central>=10 && central<20)
1894 else if(central>=20 && central<30)
1898 else if(central>=30 && central<40)
1902 else if(central>=40 && central<50)
1906 else if(central>=50 && central<70)
1915 double shift = fnSigEtaCorr[icent]->Eval(tmpeta);
1917 //cout << "eta correction"<< endl;
1918 //cout << "cent = "<< central<< endl;
1919 //cout << "icent = "<< icent << endl;
1920 //cout << "shift = "<< shift << endl;