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
25 #include "THnSparse.h"
26 #include "TLorentzVector.h"
30 #include "AliAnalysisTask.h"
31 #include "AliAnalysisManager.h"
33 #include "AliESDEvent.h"
34 #include "AliESDHandler.h"
35 #include "AliAODEvent.h"
36 #include "AliAODHandler.h"
38 #include "AliMCEventHandler.h"
39 #include "AliMCEvent.h"
40 #include "AliMCParticle.h"
42 #include "AliAnalysisTaskHFECal.h"
43 #include "TGeoGlobalMagField.h"
45 #include "AliAnalysisTaskSE.h"
46 #include "TRefArray.h"
48 #include "AliESDInputHandler.h"
49 #include "AliESDpid.h"
50 #include "AliESDtrackCuts.h"
51 #include "AliPhysicsSelection.h"
52 #include "AliESDCaloCluster.h"
53 #include "AliAODCaloCluster.h"
54 #include "AliEMCALRecoUtils.h"
55 #include "AliEMCALGeometry.h"
56 #include "AliGeomManager.h"
58 #include "TGeoManager.h"
62 #include "AliEMCALTrack.h"
65 #include "AliKFParticle.h"
66 #include "AliKFVertex.h"
69 #include "AliPIDResponse.h"
70 #include "AliHFEcontainer.h"
71 #include "AliHFEcuts.h"
72 #include "AliHFEpid.h"
73 #include "AliHFEpidBase.h"
74 #include "AliHFEpidQAmanager.h"
75 #include "AliHFEtools.h"
76 #include "AliCFContainer.h"
77 #include "AliCFManager.h"
81 #include "AliCentrality.h"
83 ClassImp(AliAnalysisTaskHFECal)
84 //________________________________________________________________________
85 AliAnalysisTaskHFECal::AliAnalysisTaskHFECal(const char *name)
86 : AliAnalysisTaskSE(name)
94 ,fIdentifiedAsOutInz(kFALSE)
95 ,fPassTheEventCut(kFALSE)
96 ,fRejectKinkMother(kFALSE)
102 ,fOpeningAngleCut(0.1)
124 ,fTrackPtBefTrkCuts(0)
125 ,fTrackPtAftTrkCuts(0)
146 ,fIncpTMCM20hfeAll(0)
153 ,fIncpTMCM20pho_pi0e(0)
154 ,fPhoElecPtMCM20_pi0e(0)
155 ,fSameElecPtMCM20_pi0e(0)
164 fPID = new AliHFEpid("hfePid");
165 fTrackCuts = new AliESDtrackCuts();
167 // Define input and output slots here
168 // Input slot #0 works with a TChain
169 DefineInput(0, TChain::Class());
170 // Output slot #0 id reserved by the base class for AOD
171 // Output slot #1 writes into a TH1 container
172 // DefineOutput(1, TH1I::Class());
173 DefineOutput(1, TList::Class());
174 // DefineOutput(3, TTree::Class());
177 //________________________________________________________________________
178 AliAnalysisTaskHFECal::AliAnalysisTaskHFECal()
179 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskHFECal")
187 ,fIdentifiedAsOutInz(kFALSE)
188 ,fPassTheEventCut(kFALSE)
189 ,fRejectKinkMother(kFALSE)
195 ,fOpeningAngleCut(0.1)
217 ,fTrackPtBefTrkCuts(0)
218 ,fTrackPtAftTrkCuts(0)
239 ,fIncpTMCM20hfeAll(0)
246 ,fIncpTMCM20pho_pi0e(0)
247 ,fPhoElecPtMCM20_pi0e(0)
248 ,fSameElecPtMCM20_pi0e(0)
255 //Default constructor
256 fPID = new AliHFEpid("hfePid");
258 fTrackCuts = new AliESDtrackCuts();
261 // Define input and output slots here
262 // Input slot #0 works with a TChain
263 DefineInput(0, TChain::Class());
264 // Output slot #0 id reserved by the base class for AOD
265 // Output slot #1 writes into a TH1 container
266 // DefineOutput(1, TH1I::Class());
267 DefineOutput(1, TList::Class());
268 //DefineOutput(3, TTree::Class());
270 //_________________________________________
272 AliAnalysisTaskHFECal::~AliAnalysisTaskHFECal()
284 //_________________________________________
286 void AliAnalysisTaskHFECal::UserExec(Option_t*)
289 //Called for each event
291 // create pointer to event
292 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
294 printf("ERROR: fESD not available\n");
299 AliError("HFE cuts not available");
303 if(!fPID->IsInitialized()){
304 // Initialize PID with the given run number
305 AliWarning("PID not initialised, get from Run no");
306 fPID->InitializePID(fESD->GetRunNumber());
309 if(fmcData)fMC = MCEvent();
310 AliStack* stack = NULL;
311 if(fmcData && fMC)stack = fMC->Stack();
314 AliCentrality *centrality = fESD->GetCentrality();
315 cent = centrality->GetCentralityPercentile("V0M");
317 //---- fill MC track info
320 Int_t nParticles = stack->GetNtrack();
321 for (Int_t iParticle = 0; iParticle < nParticles; iParticle++) {
322 TParticle* particle = stack->Particle(iParticle);
323 int fPDG = particle->GetPdgCode();
324 double mcZvertex = fMC->GetPrimaryVertex()->GetZ();
325 double pTMC = particle->Pt();
326 double proR = particle->R();
327 double etaMC = particle->Eta();
328 if(fabs(etaMC)>0.6)continue;
329 Bool_t mcInDtoE= kFALSE;
330 Bool_t mcInBtoE= kFALSE;
332 Bool_t MChijing = fMC->IsFromBGEvent(iParticle);
333 //if(!MChijing)printf("not MC hijing");
335 if(!MChijing)iHijing = 0;
336 if(fPDG==111)Hpi0pTcheck->Fill(pTMC,iHijing);
338 if(particle->GetFirstMother()>-1 && fPDG==22)
340 int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
341 if(parentPID==111 || parentPID==221)HphopTcheck->Fill(pTMC,iHijing); // pi0->g & eta->g
344 if(particle->GetFirstMother()>-1 && fabs(fPDG)==11)
346 int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
347 if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(fPDG)==11)mcInDtoE = kTRUE;
348 if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(fPDG)==11)mcInBtoE = kTRUE;
349 if((mcInBtoE || mcInDtoE) && fabs(mcZvertex)<10.0)fInputHFEMC->Fill(cent,pTMC);
352 if(proR<7.0 && fabs(fPDG)==11)fInputAlle->Fill(cent,pTMC);
359 Int_t fNOtrks = fESD->GetNumberOfTracks();
360 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
362 Double_t pVtxZ = -999;
363 pVtxZ = pVtx->GetZ();
365 if(TMath::Abs(pVtxZ)>10) return;
368 if(fNOtrks<2) return;
371 AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();
373 AliDebug(1, "Using default PID Response");
374 pidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
377 fPID->SetPIDResponse(pidResponse);
379 fCFM->SetRecEventInfo(fESD);
381 //Float_t cent = -1.;
382 //AliCentrality *centrality = fESD->GetCentrality();
383 //cent = centrality->GetCentralityPercentile("V0M");
386 //if(cent>90.) return;
390 FindTriggerClusters();
393 for(Int_t iCluster=0; iCluster<fESD->GetNumberOfCaloClusters(); iCluster++)
395 AliESDCaloCluster *clust = fESD->GetCaloCluster(iCluster);
398 double clustE = clust->E();
399 float emcx[3]; // cluster pos
400 clust->GetPosition(emcx);
401 TVector3 clustpos(emcx[0],emcx[1],emcx[2]);
402 double emcphi = clustpos.Phi();
403 double emceta = clustpos.Eta();
405 calInfo[0] = emcphi; calInfo[1] = emceta; calInfo[2] = clustE; calInfo[3] = cent; calInfo[4] = clust->Chi2();
406 //if(clustE>1.5)fEMCAccE->Fill(calInfo);
407 //if(fqahist==1 && clustE>1.5)fEMCAccE->Fill(calInfo);
412 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
413 AliESDtrack* track = fESD->GetTrack(iTracks);
415 printf("ERROR: Could not receive track %d\n", iTracks);
419 Bool_t mcPho = kFALSE;
420 Bool_t mcDtoE= kFALSE;
421 Bool_t mcBtoE= kFALSE;
424 double mcMompT = 0.0;
425 //double mcGrandMompT = 0.0;
426 double mcWeight = -10.0;
430 if(fmcData && fMC && stack)
432 Int_t label = TMath::Abs(track->GetLabel());
434 Bool_t MChijing = fMC->IsFromBGEvent(label);
435 if(!MChijing)iHijing = 0;
437 TParticle* particle = stack->Particle(label);
438 int mcpid = particle->GetPdgCode();
439 mcpT = particle->Pt();
440 //printf("MCpid = %d",mcpid);
441 if(particle->GetFirstMother()>-1)
443 int parentlabel = particle->GetFirstMother();
444 int parentPID = stack->Particle(particle->GetFirstMother())->GetPdgCode();
445 mcMompT = stack->Particle(particle->GetFirstMother())->Pt();
446 if((parentPID==22 || parentPID==111 || parentPID==221)&& fabs(mcpid)==11)mcPho = kTRUE;
447 if((fabs(parentPID)==411 || fabs(parentPID)==413 || fabs(parentPID)==421 || fabs(parentPID)==423 || fabs(parentPID)==431)&& fabs(mcpid)==11)mcDtoE = kTRUE;
448 if((fabs(parentPID)==511 || fabs(parentPID)==513 || fabs(parentPID)==521 || fabs(parentPID)==523 || fabs(parentPID)==531)&& fabs(mcpid)==11)mcBtoE = kTRUE;
450 // make D->e pT correlation
451 if(mcDtoE)fMomDtoE->Fill(mcpT,mcMompT);
454 if(parentPID==111 && fabs(mcpid)==11 && mcMompT>0.0)
457 if(mcMompT>0.0 && mcMompT<5.0)
459 mcWeight = 0.323*mcMompT/(TMath::Exp(-1.6+0.767*mcMompT+0.0285*mcMompT*mcMompT));
463 mcWeight = 115.0/(0.718*mcMompT*TMath::Power(mcMompT,3.65));
466 mcWeight = GetMCweight(mcMompT);
469 // access grand parent pi0->g->e
470 TParticle* particle_parent = stack->Particle(parentlabel); // get parent pointer
471 if(particle_parent->GetFirstMother()>-1 && parentPID==22 && fabs(mcpid)==11) // get grand parent g->e
473 int grand_parentPID = stack->Particle(particle_parent->GetFirstMother())->GetPdgCode();
474 if(grand_parentPID==111)
476 //mcGrandMompT = stack->Particle(particle_parent->GetFirstMother())->Pt();
477 double pTtmp = stack->Particle(particle_parent->GetFirstMother())->Pt();
478 //if(mcGrandMompT>0.0 && mcGrandMompT<5.0)
484 mcWeight = 0.323*pTtmp/(TMath::Exp(-1.6+0.767*pTtmp+0.0285*pTtmp*pTtmp));
488 mcWeight = 115.0/(0.718*pTtmp*TMath::Power(pTtmp,3.65));
491 mcWeight = GetMCweight(pTtmp);
496 if(fabs(mcpid)==11 && mcDtoE)mcele= 1.;
497 if(fabs(mcpid)==11 && mcBtoE)mcele= 2.;
498 if(fabs(mcpid)==11 && mcPho)mcele= 3.;
501 //printf("weight = %f\n",mcWeight);
503 if(TMath::Abs(track->Eta())>0.6) continue;
504 if(TMath::Abs(track->Pt()<2.0)) continue;
506 fTrackPtBefTrkCuts->Fill(track->Pt());
507 // RecKine: ITSTPC cuts
508 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
511 if(fRejectKinkMother) { // Quick and dirty fix to reject both kink mothers and daughters
512 if(track->GetKinkIndex(0) != 0) continue;
516 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
518 // HFEcuts: ITS layers cuts
519 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
521 // HFE cuts: TPC PID cleanup
522 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
524 int nTPCcl = track->GetTPCNcls();
525 int nTPCclF = track->GetTPCNclsF();
526 int nITS = track->GetNcls(0);
528 fTrackPtAftTrkCuts->Fill(track->Pt());
530 Double_t mom = -999., eop=-999., pt = -999., dEdx=-999., fTPCnSigma=-10, phi=-999., eta=-999.;
534 // Track extrapolation
536 Int_t charge = track->Charge();
541 dEdx = track->GetTPCsignal();
542 fTPCnSigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(track, AliPID::kElectron) : 1000;
544 double ncells = -1.0;
548 double rmatch = -1.0;
549 double nmatch = -1.0;
550 double oppstatus = 0.0;
552 Bool_t fFlagPhotonicElec = kFALSE;
553 Bool_t fFlagConvinatElec = kFALSE;
555 Int_t clsId = track->GetEMCALcluster();
557 AliESDCaloCluster *clust = fESD->GetCaloCluster(clsId);
558 if(clust && clust->IsEMCAL()){
560 double clustE = clust->E();
561 eop = clustE/fabs(mom);
562 //double clustT = clust->GetTOF();
563 ncells = clust->GetNCells();
564 m02 = clust->GetM02();
565 m20 = clust->GetM20();
566 disp = clust->GetDispersion();
567 double delphi = clust->GetTrackDx();
568 double deleta = clust->GetTrackDz();
569 rmatch = sqrt(pow(delphi,2)+pow(deleta,2));
570 nmatch = clust->GetNTracksMatched();
572 if(fTPCnSigma>-1.5 && fTPCnSigma<3.0)
574 SelectPhotonicElectron(iTracks,cent,track,stack,fFlagPhotonicElec,fFlagConvinatElec,fTPCnSigma,m20,eop,mcele,mcWeight,iHijing);
576 if(fFlagPhotonicElec)oppstatus = 1.0;
577 if(fFlagConvinatElec)oppstatus = 2.0;
578 if(fFlagPhotonicElec && fFlagConvinatElec)oppstatus = 3.0;
581 valdedx[0] = pt; valdedx[1] = nITS; valdedx[2] = phi; valdedx[3] = eta; valdedx[4] = fTPCnSigma;
582 valdedx[5] = eop; valdedx[6] = rmatch; valdedx[7] = ncells, valdedx[8] = nTPCclF; valdedx[9] = m20; valdedx[10] = mcpT;
583 valdedx[11] = cent; valdedx[12] = charge; valdedx[13] = oppstatus; valdedx[14] = nTPCcl;
585 if(fqahist==1)fEleInfo->Fill(valdedx);
591 if(nITS<2.5)continue;
592 if(nTPCcl<100)continue;
594 CheckNclust->Fill(nTPCcl);
595 CheckNits->Fill(nITS);
597 fdEdxBef->Fill(mom,fTPCnSigma);
598 fTPCnsigma->Fill(mom,fTPCnSigma);
599 if(fTPCnSigma >= -1.0 && fTPCnSigma <= 3)fTrkEovPBef->Fill(pt,eop);
605 AliHFEpidObject hfetrack;
606 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
607 hfetrack.SetRecTrack(track);
609 if((0.0< cent) && (cent<5.0)) binct = 0.5;
610 if((5.0< cent) && (cent<10.0)) binct = 1.5;
611 if((10.0< cent) && (cent<20.0)) binct = 2.5;
612 if((20.0< cent) && (cent<30.0)) binct = 3.5;
613 if((30.0< cent) && (cent<40.0)) binct = 4.5;
614 if((40.0< cent) && (cent<50.0)) binct = 5.5;
615 if((50.0< cent) && (cent<60.0)) binct = 6.5;
616 if((60.0< cent) && (cent<70.0)) binct = 7.5;
617 if((70.0< cent) && (cent<80.0)) binct = 8.5;
618 if((80.0< cent) && (cent<90.0)) binct = 9.5;
619 if((90.0< cent) && (cent<100.0)) binct = 10.5;
621 hfetrack.SetCentrality((int)binct); //added
623 if(!fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 0;
625 if(pidpassed==0) continue;
627 fTrkEovPAft->Fill(pt,eop);
628 fdEdxAft->Fill(mom,fTPCnSigma);
631 fIncpT->Fill(cent,pt);
632 if(fFlagPhotonicElec) fPhoElecPt->Fill(cent,pt);
633 if(fFlagConvinatElec) fSameElecPt->Fill(cent,pt);
635 if(m20>0.0 && m20<0.3)
637 fIncpTM20->Fill(cent,pt);
638 if(fFlagPhotonicElec) fPhoElecPtM20->Fill(cent,pt);
639 if(fFlagConvinatElec) fSameElecPtM20->Fill(cent,pt);
643 if(mcele>0) // select MC electrons
646 fIncpTMChfeAll->Fill(cent,pt);
647 if(m20>0.0 && m20<0.3)fIncpTMCM20hfeAll->Fill(cent,pt);
649 if(mcBtoE || mcDtoE) // select B->e & D->e
651 fIncpTMChfe->Fill(cent,pt);
652 if(m20>0.0 && m20<0.3)fIncpTMCM20hfe->Fill(cent,pt);
655 if(mcPho) // select photonic electrons
660 phoval[2] = fTPCnSigma;
664 fIncpTMCpho->Fill(phoval);
665 if(fFlagPhotonicElec) fPhoElecPtMC->Fill(phoval);
666 if(fFlagConvinatElec) fSameElecPtMC->Fill(phoval);
668 if(m20>0.0 && m20<0.3)
670 fIncpTMCM20pho->Fill(phoval);
671 if(fFlagPhotonicElec) fPhoElecPtMCM20->Fill(phoval);
672 if(fFlagConvinatElec) fSameElecPtMCM20->Fill(phoval);
676 if(iHijing==1)mcWeight = 1.0;
677 fIncpTMCM20pho_pi0e->Fill(phoval,mcWeight);
678 if(fFlagPhotonicElec) fPhoElecPtMCM20_pi0e->Fill(phoval,mcWeight);
679 if(fFlagConvinatElec) fSameElecPtMCM20_pi0e->Fill(phoval,mcWeight);
685 PostData(1, fOutputList);
687 //_________________________________________
688 void AliAnalysisTaskHFECal::UserCreateOutputObjects()
692 //Bool_t mcData = kFALSE;
693 if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())
696 printf("+++++ MC Data available");
700 printf("++++++++= MC analysis \n");
704 printf("++++++++ real data analysis \n");
707 printf("+++++++ QA hist %d",fqahist);
710 fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
712 //--------Initialize PID
713 //fPID->SetHasMCData(kFALSE);
714 fPID->SetHasMCData(fmcData);
715 if(!fPID->GetNumberOfPIDdetectors())
717 fPID->AddDetector("TPC", 0);
718 fPID->AddDetector("EMCAL", 1);
722 const char *cutmodel;
724 params[0] = -1.0; //sigma min
725 double maxnSig = 3.0;
728 params[0] = -5.0; //sigma min
732 for(Int_t a=0;a<11;a++)fPID->ConfigureTPCcentralityCut(a,cutmodel,params,maxnSig);
734 fPID->SortDetectors();
735 fPIDqa = new AliHFEpidQAmanager();
736 fPIDqa->Initialize(fPID);
738 //------- fcut --------------
739 fCuts = new AliHFEcuts();
740 fCuts->CreateStandardCuts();
741 //fCuts->SetMinNClustersTPC(100);
742 fCuts->SetMinNClustersTPC(90);
743 fCuts->SetMinRatioTPCclusters(0.6);
744 fCuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
745 //fCuts->SetMinNClustersITS(3);
746 fCuts->SetMinNClustersITS(2);
747 fCuts->SetCutITSpixel(AliHFEextraCuts::kAny);
748 fCuts->SetCheckITSLayerStatus(kFALSE);
749 fCuts->SetVertexRange(10.);
750 fCuts->SetTOFPIDStep(kFALSE);
751 fCuts->SetPtRange(2, 50);
752 fCuts->SetMaxImpactParam(3.,3.);
754 //--------Initialize correction Framework and Cuts
755 fCFM = new AliCFManager;
756 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
757 fCFM->SetNStepParticle(kNcutSteps);
758 for(Int_t istep = 0; istep < kNcutSteps; istep++)
759 fCFM->SetParticleCutsList(istep, NULL);
762 AliWarning("Cuts not available. Default cuts will be used");
763 fCuts = new AliHFEcuts;
764 fCuts->CreateStandardCuts();
766 fCuts->Initialize(fCFM);
768 //---------Output Tlist
769 fOutputList = new TList();
770 fOutputList->SetOwner();
771 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
773 fNoEvents = new TH1F("fNoEvents","",4,-0.5,3.5) ;
774 fOutputList->Add(fNoEvents);
776 Int_t binsE[5] = {250, 100, 1000, 200, 10};
777 Double_t xminE[5] = {1.0, -1, 0.0, 0, -0.5};
778 Double_t xmaxE[5] = {3.5, 1, 100.0, 100, 9.5};
779 fEMCAccE = new THnSparseD("fEMCAccE","EMC acceptance & E;#eta;#phi;Energy;Centrality;trugCondition;",5,binsE,xminE,xmaxE);
780 if(fqahist==1)fOutputList->Add(fEMCAccE);
782 fTrkpt = new TH1F("fTrkpt","track pt",100,0,50);
783 fOutputList->Add(fTrkpt);
785 fTrackPtBefTrkCuts = new TH1F("fTrackPtBefTrkCuts","track pt before track cuts",100,0,50);
786 fOutputList->Add(fTrackPtBefTrkCuts);
788 fTrackPtAftTrkCuts = new TH1F("fTrackPtAftTrkCuts","track pt after track cuts",100,0,50);
789 fOutputList->Add(fTrackPtAftTrkCuts);
791 fTPCnsigma = new TH2F("fTPCnsigma", "TPC - n sigma",100,0,50,200,-10,10);
792 fOutputList->Add(fTPCnsigma);
794 fTrkEovPBef = new TH2F("fTrkEovPBef","track E/p before HFE pid",100,0,50,100,0,2);
795 fOutputList->Add(fTrkEovPBef);
797 fTrkEovPAft = new TH2F("fTrkEovPAft","track E/p after HFE pid",100,0,50,100,0,2);
798 fOutputList->Add(fTrkEovPAft);
800 fdEdxBef = new TH2F("fdEdxBef","track dEdx vs p before HFE pid",100,0,50,200,-10,10);
801 fOutputList->Add(fdEdxBef);
803 fdEdxAft = new TH2F("fdEdxAft","track dEdx vs p after HFE pid",100,0,50,200,-10,10);
804 fOutputList->Add(fdEdxAft);
806 fIncpT = new TH2F("fIncpT","HFE pid electro vs. centrality",200,0,100,100,0,50);
807 fOutputList->Add(fIncpT);
809 fIncpTM20 = new TH2F("fIncpTM20","HFE pid electro vs. centrality with M20",200,0,100,100,0,50);
810 fOutputList->Add(fIncpTM20);
812 Int_t nBinspho[9] = { 200, 100, 500, 12, 50, 4, 200, 8, 100};
813 Double_t minpho[9] = { 0., 0., 0., -2.5, 0, -0.5, 0,-1.5, 0};
814 Double_t maxpho[9] = {100., 50., 0.5, 3.5, 1, 3.5, 2, 6.5, 50};
816 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);
817 fOutputList->Add(fInvmassLS);
819 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);
820 fOutputList->Add(fInvmassULS);
822 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);
823 fOutputList->Add(fInvmassLSmc);
825 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);
826 fOutputList->Add(fInvmassULSmc);
828 fOpeningAngleLS = new TH1F("fOpeningAngleLS","Opening angle for LS pairs",100,0,1);
829 fOutputList->Add(fOpeningAngleLS);
831 fOpeningAngleULS = new TH1F("fOpeningAngleULS","Opening angle for ULS pairs",100,0,1);
832 fOutputList->Add(fOpeningAngleULS);
834 fPhotoElecPt = new TH1F("fPhotoElecPt", "photonic electron pt",100,0,50);
835 fOutputList->Add(fPhotoElecPt);
837 fPhoElecPt = new TH2F("fPhoElecPt", "Pho-inclusive electron pt",200,0,100,100,0,50);
838 fOutputList->Add(fPhoElecPt);
840 fPhoElecPtM20 = new TH2F("fPhoElecPtM20", "Pho-inclusive electron pt with M20",200,0,100,100,0,50);
841 fOutputList->Add(fPhoElecPtM20);
843 fSameElecPt = new TH2F("fSameElecPt", "Same-inclusive electron pt",200,0,100,100,0,50);
844 fOutputList->Add(fSameElecPt);
846 fSameElecPtM20 = new TH2F("fSameElecPtM20", "Same-inclusive electron pt with M20",200,0,100,100,0,50);
847 fOutputList->Add(fSameElecPtM20);
849 fCent = new TH1F("fCent","Centrality",200,0,100) ;
850 fOutputList->Add(fCent);
852 // Make common binning
853 const Double_t kMinP = 0.;
854 const Double_t kMaxP = 50.;
855 //const Double_t kTPCSigMim = 40.;
856 //const Double_t kTPCSigMax = 140.;
858 // 1st histogram: TPC dEdx with/without EMCAL (p, pT, TPC Signal, phi, eta, Sig, e/p, ,match, cell, M02, M20, Disp, Centrality, select)
859 Int_t nBins[16] = { 250, 10, 60, 20, 100, 300, 50, 40, 200, 200, 250, 200, 3, 5, 100, 8};
860 Double_t min[16] = {kMinP, -0.5, 1.0, -1.0, -6.0, 0, 0, 0, 0.0, 0.0, 0.0, 0, -1.5, -0.5, 80, -1.5};
861 Double_t max[16] = {kMaxP, 9.5, 4.0, 1.0, 4.0, 3.0, 0.1, 40, 200, 2.0, 50.0, 100, 1.5, 4.5, 180, 6.5};
862 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);
863 if(fqahist==1)fOutputList->Add(fEleInfo);
867 fClsEBftTrigCut = new TH1F("fClsEBftTrigCut","cluster E before trigger selection",1000,0,100);
868 fOutputList->Add(fClsEBftTrigCut);
870 fClsEAftTrigCut = new TH1F("fClsEAftTrigCut","cluster E if cls has 0 trigcut channel",1000,0,100);
871 fOutputList->Add(fClsEAftTrigCut);
873 fClsEAftTrigCut1 = new TH1F("fClsEAftTrigCut1","cluster E if cls with trig channel",1000,0,100);
874 fOutputList->Add(fClsEAftTrigCut1);
876 fClsEAftTrigCut2 = new TH1F("fClsEAftTrigCut2","cluster E if cls with trigcut channel",1000,0,100);
877 fOutputList->Add(fClsEAftTrigCut2);
879 fClsEAftTrigCut3 = new TH1F("fClsEAftTrigCut3","cluster E if cls with trigcut channel + nCell>Ecorrect",1000,0,100);
880 fOutputList->Add(fClsEAftTrigCut3);
882 fClsEAftTrigCut4 = new TH1F("fClsEAftTrigCut4","cluster E if cls with trigcut channel + nCell>Ecorrect + cls time cut",1000,0,100);
883 fOutputList->Add(fClsEAftTrigCut4);
885 fClsETime = new TH2F("fClsETime", "Cls time vs E; E; time;",1000,0,100,1000,-0.0000002,0.0000009);
886 fOutputList->Add(fClsETime);
888 fClsETime1 = new TH2F("fClsETime1", "Cls time vs E if cls contains trigger channel; E; time;",1000,0,100,1000,-0.0000002,0.0000009);
889 fOutputList->Add(fClsETime1);
891 fTrigTimes = new TH1F("fTrigTimes", "Trigger time; time; N;",25,0,25);
892 fOutputList->Add(fTrigTimes);
894 fCellCheck = new TH2F("fCellCheck", "Cell vs E; E GeV; Cell ID",10,6,26,12000,0,12000);
895 fOutputList->Add(fCellCheck);
899 fInputHFEMC = new TH2F("fInputHFEMC","Input MC HFE pid electro vs. centrality",200,0,100,100,0,50);
900 fOutputList->Add(fInputHFEMC);
902 fInputAlle = new TH2F("fInputAlle","Input MC electro vs. centrality",200,0,100,100,0,50);
903 fOutputList->Add(fInputAlle);
905 fIncpTMChfe = new TH2F("fIncpTMChfe","MC HFE pid electro vs. centrality",200,0,100,100,0,50);
906 fOutputList->Add(fIncpTMChfe);
908 fIncpTMChfeAll = new TH2F("fIncpTMChfeAll","MC Alle pid electro vs. centrality",200,0,100,100,0,50);
909 fOutputList->Add(fIncpTMChfeAll);
911 fIncpTMCM20hfe = new TH2F("fIncpTMCM20hfe","MC HFE pid electro vs. centrality with M20",200,0,100,100,0,50);
912 fOutputList->Add(fIncpTMCM20hfe);
914 fIncpTMCM20hfeAll = new TH2F("fIncpTMCM20hfeAll","MC Alle pid electro vs. centrality with M20",200,0,100,100,0,50);
915 fOutputList->Add(fIncpTMCM20hfeAll);
918 Int_t nBinspho2[5] = { 200, 100, 7, 3, 100};
919 Double_t minpho2[5] = { 0., 0., -2.5, -0.5, 0.};
920 Double_t maxpho2[5] = {100., 50., 4.5, 2.5, 50.};
922 fIncpTMCpho = new THnSparseD("fIncpTMCpho","MC Pho pid electro vs. centrality",5,nBinspho2,minpho2,maxpho2);
923 fOutputList->Add(fIncpTMCpho);
925 fIncpTMCM20pho = new THnSparseD("fIncpTMCM20pho","MC Pho pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
926 fOutputList->Add(fIncpTMCM20pho);
928 fPhoElecPtMC = new THnSparseD("fPhoElecPtMC", "MC Pho-inclusive electron pt",5,nBinspho2,minpho2,maxpho2);
929 fOutputList->Add(fPhoElecPtMC);
931 fPhoElecPtMCM20 = new THnSparseD("fPhoElecPtMCM20", "MC Pho-inclusive electron pt with M20",5,nBinspho2,minpho2,maxpho2);
932 fOutputList->Add(fPhoElecPtMCM20);
934 fSameElecPtMC = new THnSparseD("fSameElecPtMC", "MC Same-inclusive electron pt",5,nBinspho2,minpho2,maxpho2);
935 fOutputList->Add(fSameElecPtMC);
937 fSameElecPtMCM20 = new THnSparseD("fSameElecPtMCM20", "MC Same-inclusive electron pt with M20",5,nBinspho2,minpho2,maxpho2);
938 fOutputList->Add(fSameElecPtMCM20);
940 fIncpTMCM20pho_pi0e = new THnSparseD("fIncpTMCM20pho_pi0e","MC Pho pi0->e pid electro vs. centrality with M20",5,nBinspho2,minpho2,maxpho2);
941 fIncpTMCM20pho_pi0e->Sumw2();
942 fOutputList->Add(fIncpTMCM20pho_pi0e);
944 fPhoElecPtMCM20_pi0e = new THnSparseD("fPhoElecPtMCM20_pi0e", "MC Pho-inclusive electron pt with M20 pi0->e",5,nBinspho2,minpho2,maxpho2);
945 fPhoElecPtMCM20_pi0e->Sumw2();
946 fOutputList->Add(fPhoElecPtMCM20_pi0e);
948 fSameElecPtMCM20_pi0e = new THnSparseD("fSameElecPtMCM20_pi0e", "MC Same-inclusive electron pt pi0->e",5,nBinspho2,minpho2,maxpho2);
949 fSameElecPtMCM20_pi0e->Sumw2();
950 fOutputList->Add(fSameElecPtMCM20_pi0e);
952 CheckNclust = new TH1D("CheckNclust","cluster check",200,0,200);
953 fOutputList->Add(CheckNclust);
955 CheckNits = new TH1D("CheckNits","ITS cluster check",8,-0.5,7.5);
956 fOutputList->Add(CheckNits);
958 Hpi0pTcheck = new TH2D("Hpi0pTcheck","Pi0 pT from Hijing",100,0,50,3,-0.5,2.5);
959 fOutputList->Add(Hpi0pTcheck);
961 HphopTcheck = new TH2D("HphopTcheck","Pho pT from Hijing",100,0,50,3,-0.5,2.5);
962 fOutputList->Add(HphopTcheck);
964 fMomDtoE = new TH2D("fMomDtoE","D->E pT correlations;e p_{T} GeV/c;D p_{T} GeV/c",400,0,40,400,0,40);
965 fOutputList->Add(fMomDtoE);
967 PostData(1,fOutputList);
970 //________________________________________________________________________
971 void AliAnalysisTaskHFECal::Terminate(Option_t *)
973 // Info("Terminate");
974 AliAnalysisTaskSE::Terminate();
977 //________________________________________________________________________
978 Bool_t AliAnalysisTaskHFECal::ProcessCutStep(Int_t cutStep, AliVParticle *track)
980 // Check single track cuts for a given cut step
981 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
982 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
985 //_________________________________________
986 //void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, Bool_t &fFlagPhotonicElec)
987 //void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, Bool_t &fFlagPhotonicElec, Bool_t &fFlagConvinatElec, Double_t nSig)
988 void AliAnalysisTaskHFECal::SelectPhotonicElectron(Int_t itrack, Double_t cent, AliESDtrack *track, AliStack *stack ,Bool_t &fFlagPhotonicElec, Bool_t &fFlagConvinatElec, Double_t nSig, Double_t shower, Double_t ep, Double_t mce, Double_t w, Int_t ibgevent)
990 //Identify non-heavy flavour electrons using Invariant mass method
992 fTrackCuts->SetAcceptKinkDaughters(kFALSE);
993 fTrackCuts->SetRequireTPCRefit(kTRUE);
994 fTrackCuts->SetRequireITSRefit(kTRUE);
995 fTrackCuts->SetEtaRange(-0.9,0.9);
996 //fTrackCuts->SetRequireSigmaToVertex(kTRUE);
997 fTrackCuts->SetMaxChi2PerClusterTPC(3.5);
998 fTrackCuts->SetMinNClustersTPC(90);
1000 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
1002 Bool_t flagPhotonicElec = kFALSE;
1003 Bool_t flagConvinatElec = kFALSE;
1008 Int_t label = TMath::Abs(track->GetLabel());
1009 TParticle* particle = stack->Particle(label);
1010 p1 = particle->GetFirstMother();
1013 //for(Int_t jTracks = itrack+1; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1014 for(Int_t jTracks = 0; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1015 AliESDtrack* trackAsso = fESD->GetTrack(jTracks);
1017 printf("ERROR: Could not receive track %d\n", jTracks);
1020 if(itrack==jTracks)continue;
1025 Int_t label2 = TMath::Abs(trackAsso->GetLabel());
1026 TParticle* particle2 = stack->Particle(label2);
1027 if(particle2->GetFirstMother()>-1)
1028 p2 = particle2->GetFirstMother();
1031 Double_t dEdxAsso = -999., ptPrim=-999., ptAsso=-999., openingAngle = -999.;
1032 Double_t mass=999., width = -999;
1033 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1035 ptPrim = track->Pt();
1037 dEdxAsso = trackAsso->GetTPCsignal();
1038 ptAsso = trackAsso->Pt();
1039 Int_t chargeAsso = trackAsso->Charge();
1040 Int_t charge = track->Charge();
1043 if(ptAsso <0.5) continue;
1044 if(!fTrackCuts->AcceptTrack(trackAsso)) continue;
1045 if(dEdxAsso <65 || dEdxAsso>100) continue; //11a pass1
1047 Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1048 if(charge>0) fPDGe1 = -11;
1049 if(chargeAsso>0) fPDGe2 = -11;
1051 //printf("chargeAsso = %d\n",chargeAsso);
1052 //printf("charge = %d\n",charge);
1053 if(charge == chargeAsso) fFlagLS = kTRUE;
1054 if(charge != chargeAsso) fFlagULS = kTRUE;
1056 //printf("fFlagLS = %d\n",fFlagLS);
1057 //printf("fFlagULS = %d\n",fFlagULS);
1060 AliKFParticle ge1(*track, fPDGe1);
1061 AliKFParticle ge2(*trackAsso, fPDGe2);
1062 AliKFParticle recg(ge1, ge2);
1064 if(recg.GetNDF()<1) continue;
1065 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1066 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.) continue;
1068 AliKFVertex primV(*pVtx);
1070 recg.SetProductionVertex(primV);
1072 recg.SetMassConstraint(0,0.0001);
1074 openingAngle = ge1.GetAngle(ge2);
1075 if(fFlagLS) fOpeningAngleLS->Fill(openingAngle);
1076 if(fFlagULS) fOpeningAngleULS->Fill(openingAngle);
1079 recg.GetMass(mass,width);
1082 if(shower>0.0 && shower<0.3)ishower = 1;
1086 phoinfo[1] = ptPrim;
1089 phoinfo[4] = openingAngle;
1090 phoinfo[5] = ishower;
1093 phoinfo[8] = ptAsso;
1095 if(fFlagLS) fInvmassLS->Fill(phoinfo);
1096 if(fFlagULS) fInvmassULS->Fill(phoinfo);
1097 if(fFlagLS && ibgevent==0) fInvmassLSmc->Fill(phoinfo,w);
1098 if(fFlagULS && ibgevent==0) fInvmassULSmc->Fill(phoinfo,w);
1100 //printf("fInvmassCut %f\n",fInvmassCut);
1101 //printf("openingAngle %f\n",fOpeningAngleCut);
1103 if(openingAngle > fOpeningAngleCut) continue;
1105 //if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec){
1106 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec && (p1==p2)){
1107 flagPhotonicElec = kTRUE;
1109 if(mass<fInvmassCut && fFlagLS && !flagConvinatElec){
1110 flagConvinatElec = kTRUE;
1114 fFlagPhotonicElec = flagPhotonicElec;
1115 fFlagConvinatElec = flagConvinatElec;
1118 //-------------------------------------------
1119 //void AliAnalysisTaskHFECal::GetMCweight(double mcPi0pT)
1120 double AliAnalysisTaskHFECal::GetMCweight(double mcPi0pT)
1122 double weight = 1.0;
1124 if(mcPi0pT>0.0 && mcPi0pT<5.0)
1126 weight = 0.323*mcPi0pT/(TMath::Exp(-1.6+0.767*mcPi0pT+0.0285*mcPi0pT*mcPi0pT));
1130 weight = 115.0/(0.718*mcPi0pT*TMath::Power(mcPi0pT,3.65));
1135 //_________________________________________
1136 void AliAnalysisTaskHFECal::FindTriggerClusters()
1139 const int nModuleCols = 2;
1140 const int nModuleRows = 5;
1141 const int nColsFeeModule = 48;
1142 const int nRowsFeeModule = 24;
1143 const int nColsFaltroModule = 24;
1144 const int nRowsFaltroModule = 12;
1145 //const int faltroWidthMax = 20;
1147 // part 1, trigger extraction -------------------------------------
1148 Int_t globCol, globRow;
1149 //Int_t ntimes=0, nTrigChannel=0, nTrigChannelCut=0, trigInCut=0;
1150 Int_t ntimes=0, nTrigChannel=0, nTrigChannelCut=0;
1152 //Int_t trigtimes[faltroWidthMax];
1153 Double_t cellTime[nColsFeeModule*nModuleCols][nRowsFeeModule*nModuleRows];
1154 Double_t cellEnergy[nColsFeeModule*nModuleCols][nRowsFeeModule*nModuleRows];
1155 //Double_t fTrigCutLow = 6;
1156 //Double_t fTrigCutHigh = 10;
1157 Double_t fTimeCutLow = 469e-09;
1158 Double_t fTimeCutHigh = 715e-09;
1160 AliESDCaloTrigger * fCaloTrigger = fESD->GetCaloTrigger( "EMCAL" );
1162 // erase trigger maps
1163 for(Int_t i = 0; i < nColsFaltroModule*nModuleCols; i++ )
1165 for(Int_t j = 0; j < nRowsFaltroModule*nModuleRows; j++ )
1167 ftriggersCut[i][j] = 0;
1168 ftriggers[i][j] = 0;
1169 ftriggersTime[i][j] = 0;
1173 Int_t iglobCol=0, iglobRow=0;
1174 // go through triggers
1175 if( fCaloTrigger->GetEntries() > 0 )
1178 fCaloTrigger->Reset();
1179 while( fCaloTrigger->Next() )
1181 fCaloTrigger->GetPosition( globCol, globRow );
1182 fCaloTrigger->GetNL0Times( ntimes );
1185 if( ntimes < 1 ) continue;
1186 // get precise timings
1187 fCaloTrigger->GetL0Times( trigtimes );
1189 for(Int_t i = 0; i < ntimes; i++ )
1191 // save the first trigger time in channel
1192 if( i == 0 || triggersTime[globCol][globRow] > trigtimes[i] )
1193 triggersTime[globCol][globRow] = trigtimes[i];
1194 //printf("trigger times: %d\n",trigtimes[i]);
1196 if(trigtimes[i] > fTrigCutLow && trigtimes[i] < fTrigCutHigh )
1199 fTrigTimes->Fill(trigtimes[i]);
1203 //L1 analysis from AliAnalysisTaskEMCALTriggerQA
1205 fCaloTrigger->GetTriggerBits(bit);
1208 fCaloTrigger->GetL1TimeSum(ts);
1209 if (ts > 0)ftriggers[globCol][globRow] = 1;
1210 // number of triggered channels in event
1213 if(ts>0 && (bit >> 6 & 0x1))
1218 ftriggersCut[globCol][globRow] = 1;
1221 } // calo trigger entries
1222 } // has calo trigger entries
1224 // part 2 go through the clusters here -----------------------------------
1225 Int_t nCluster=0, nCell=0, iCell=0, gCell=0;
1226 Short_t cellAddr, nSACell, mclabel;
1227 //Int_t nSACell, iSACell, mclabel;
1229 Double_t cellAmp=0, cellTimeT=0, clusterTime=0, efrac=0;
1230 Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta, gphi, geta, feta, fphi;
1232 TRefArray *fCaloClusters = new TRefArray();
1233 fESD->GetEMCALClusters( fCaloClusters );
1234 nCluster = fCaloClusters->GetEntries();
1237 // save all cells times if there are clusters
1240 for(Int_t i = 0; i < nColsFeeModule*nModuleCols; i++ ){
1241 for(Int_t j = 0; j < nRowsFeeModule*nModuleRows; j++ ){
1242 cellTime[i][j] = 0.;
1243 cellEnergy[i][j] = 0.;
1248 AliESDCaloCells *fCaloCells = fESD->GetEMCALCells();
1249 //AliVCaloCells fCaloCells = fESD->GetEMCALCells();
1250 nSACell = fCaloCells->GetNumberOfCells();
1251 for(iSACell = 0; iSACell < nSACell; iSACell++ ){
1252 // get the cell info *fCal
1253 fCaloCells->GetCell( iSACell, cellAddr, cellAmp, cellTimeT , mclabel, efrac);
1255 // get cell position
1256 fGeom->GetCellIndex( cellAddr, nSupMod, nModule, nIphi, nIeta );
1257 fGeom->GetCellPhiEtaIndexInSModule( nSupMod,nModule, nIphi, nIeta, iphi, ieta);
1259 // convert co global phi eta
1260 gphi = iphi + nRowsFeeModule*(nSupMod/2);
1261 geta = ieta + nColsFeeModule*(nSupMod%2);
1263 // save cell time and energy
1264 cellTime[geta][gphi] = cellTimeT;
1265 cellEnergy[geta][gphi] = cellAmp;
1270 Int_t nClusterTrig, nClusterTrigCut;
1271 UShort_t *cellAddrs;
1272 Double_t clsE=-999, clsEta=-999, clsPhi=-999;
1273 Float_t clsPos[3] = {0.,0.,0.};
1275 for(Int_t icl=0; icl<fESD->GetNumberOfCaloClusters(); icl++)
1277 AliESDCaloCluster *cluster = fESD->GetCaloCluster(icl);
1278 if(!cluster || !cluster->IsEMCAL()) continue;
1280 // get cluster cells
1281 nCell = cluster->GetNCells();
1283 // get cluster energy
1284 clsE = cluster->E();
1286 // get cluster position
1287 cluster->GetPosition(clsPos);
1288 TVector3 clsPosVec(clsPos[0],clsPos[1],clsPos[2]);
1289 clsEta = clsPosVec.Eta();
1290 clsPhi = clsPosVec.Phi();
1292 // get the cell addresses
1293 cellAddrs = cluster->GetCellsAbsId();
1295 // check if the cluster contains cell, that was marked as triggered
1297 nClusterTrigCut = 0;
1299 // loop the cells to check, if cluser in acceptance
1300 // any cluster with a cell outside acceptance is not considered
1301 for( iCell = 0; iCell < nCell; iCell++ )
1304 //if(clsE>6.0)fCellCheck->Fill(clsE,cellAddrs[iCell]);
1306 // get cell position
1307 fGeom->GetCellIndex( cellAddrs[iCell], nSupMod, nModule, nIphi, nIeta );
1308 fGeom->GetCellPhiEtaIndexInSModule( nSupMod,nModule, nIphi, nIeta, iphi, ieta);
1310 // convert co global phi eta
1311 gphi = iphi + nRowsFeeModule*(nSupMod/2);
1312 geta = ieta + nColsFeeModule*(nSupMod%2);
1314 if( cellTime[geta][gphi] > 0. ){
1315 clusterTime += cellTime[geta][gphi];
1319 // get corresponding FALTRO
1323 // try to match with a triggered
1324 if( ftriggers[feta][fphi]==1)
1327 if( ftriggersCut[feta][fphi]==1)
1328 { nClusterTrigCut++;
1335 clusterTime = clusterTime / (Double_t)gCell;
1336 // fix the reconstriction code time 100ns jumps
1337 if( fESD->GetBunchCrossNumber() % 4 < 2 )
1338 clusterTime -= 0.0000001;
1340 //fClsETime->Fill(clsE,clusterTime);
1341 //fClsEBftTrigCut->Fill(clsE);
1344 //fClsETime1->Fill(clsE,clusterTime);
1348 cluster->SetChi2(1);
1349 //fClsEAftTrigCut1->Fill(clsE);
1352 if(nClusterTrigCut>0){
1353 cluster->SetChi2(2);
1354 //fClsEAftTrigCut2->Fill(clsE);
1357 if(nClusterTrigCut>0 && ( nCell > (1 + clsE / 3)))
1359 cluster->SetChi2(3);
1360 //fClsEAftTrigCut3->Fill(clsE);
1363 if(nClusterTrigCut>0 && (nCell > (1 + clsE / 3) )&&( clusterTime > fTimeCutLow && clusterTime < fTimeCutHigh ))
1365 // cluster->SetChi2(4);
1366 //fClsEAftTrigCut4->Fill(clsE);
1368 if(nClusterTrigCut<1)
1370 cluster->SetChi2(0);
1372 //fClsEAftTrigCut->Fill(clsE);