25 #include "AliAnalysisManager.h" 26 #include "TParticle.h" 28 #include "AliPIDResponse.h" 30 #include "AliESDtrackCuts.h" 31 #include "AliAODMCParticle.h" 32 #include "AliAODMCHeader.h" 33 #include "AliAODEvent.h" 34 #include "AliMultSelection.h" 45 fV0ReaderName("V0ReaderV1"),
47 fConversionCuts(NULL),
49 fClusterCutsEMC(NULL),
50 fClusterCutsDMC(NULL),
61 ffillHistograms(kFALSE),
64 fCorrectForNonlinearity(kFALSE),
65 fSaveEventProperties(0),
67 fSaveSurroundingCells(0),
72 fSaveMCInformation(0),
73 fSaveAdditionalHistos(0),
74 fExtractionPercentages(),
75 fExtractionPercentagePtBins(),
78 fBuffer_ClusterPhi(0),
79 fBuffer_ClusterEta(0),
80 fBuffer_ClusterIsEMCAL(kFALSE),
81 fBuffer_MC_Cluster_Flag(0),
82 fBuffer_ClusterNumCells(0),
83 fBuffer_LeadingCell_ID(0),
84 fBuffer_LeadingCell_E(0),
85 fBuffer_LeadingCell_Eta(0),
86 fBuffer_LeadingCell_Phi(0),
87 fBuffer_ClusterM02(0),
88 fBuffer_ClusterM20(0),
89 fBuffer_Event_Vertex_X(0),
90 fBuffer_Event_Vertex_Y(0),
91 fBuffer_Event_Vertex_Z(0),
92 fBuffer_Event_Multiplicity(0),
93 fBuffer_Event_NumActiveCells(0),
96 fBuffer_Cells_RelativeEta(0),
97 fBuffer_Cells_RelativePhi(0),
98 fBuffer_Surrounding_NCells(0),
99 fBuffer_Surrounding_Cells_ID(0),
100 fBuffer_Surrounding_Cells_R(0),
101 fBuffer_Surrounding_Cells_E(0),
102 fBuffer_Surrounding_Cells_RelativeEta(0),
103 fBuffer_Surrounding_Cells_RelativePhi(0),
104 fBuffer_Surrounding_NTracks(10),
105 fBuffer_Surrounding_Tracks_R(0),
106 fBuffer_Surrounding_Tracks_Pt(0),
107 fBuffer_Surrounding_Tracks_RelativeEta(0),
108 fBuffer_Surrounding_Tracks_RelativePhi(0),
109 fBuffer_Cluster_MC_Label(-10),
110 fBuffer_Mother_MC_Label(-10),
111 hNCellsInClustersVsCentrality(NULL),
112 hNActiveCellsVsCentrality(NULL),
113 hNActiveCellsAbove50MeVVsCentrality(NULL),
114 hNActiveCellsAbove80MeVVsCentrality(NULL),
115 hNActiveCellsAbove100MeVVsCentrality(NULL),
116 hNActiveCellsAbove150MeVVsCentrality(NULL),
117 hECellsInClustersVsCentrality(NULL),
118 hEActiveCellsVsCentrality(NULL),
119 hEActiveCells50MeVVsCentrality(NULL),
120 hEActiveCells80MeVVsCentrality(NULL),
121 hEActiveCells100MeVVsCentrality(NULL),
122 hEActiveCells150MeVVsCentrality(NULL)
141 fV0ReaderName(
"V0ReaderV1"),
142 fCorrTaskSetting(
""),
143 fConversionCuts(NULL),
145 fClusterCutsEMC(NULL),
146 fClusterCutsDMC(NULL),
157 ffillHistograms(kFALSE),
160 fCorrectForNonlinearity(kFALSE),
161 fSaveEventProperties(0),
163 fSaveSurroundingCells(0),
167 fMinClusterEnergy(0),
168 fSaveMCInformation(0),
169 fSaveAdditionalHistos(0),
170 fExtractionPercentages(),
171 fExtractionPercentagePtBins(),
174 fBuffer_ClusterPhi(0),
175 fBuffer_ClusterEta(0),
176 fBuffer_ClusterIsEMCAL(kFALSE),
177 fBuffer_MC_Cluster_Flag(0),
178 fBuffer_ClusterNumCells(0),
179 fBuffer_LeadingCell_ID(0),
180 fBuffer_LeadingCell_E(0),
181 fBuffer_LeadingCell_Eta(0),
182 fBuffer_LeadingCell_Phi(0),
183 fBuffer_ClusterM02(0),
184 fBuffer_ClusterM20(0),
185 fBuffer_Event_Vertex_X(0),
186 fBuffer_Event_Vertex_Y(0),
187 fBuffer_Event_Vertex_Z(0),
188 fBuffer_Event_Multiplicity(0),
189 fBuffer_Event_NumActiveCells(0),
192 fBuffer_Cells_RelativeEta(0),
193 fBuffer_Cells_RelativePhi(0),
194 fBuffer_Surrounding_NCells(0),
195 fBuffer_Surrounding_Cells_ID(0),
196 fBuffer_Surrounding_Cells_R(0),
197 fBuffer_Surrounding_Cells_E(0),
198 fBuffer_Surrounding_Cells_RelativeEta(0),
199 fBuffer_Surrounding_Cells_RelativePhi(0),
200 fBuffer_Surrounding_NTracks(10),
201 fBuffer_Surrounding_Tracks_R(0),
202 fBuffer_Surrounding_Tracks_Pt(0),
203 fBuffer_Surrounding_Tracks_RelativeEta(0),
204 fBuffer_Surrounding_Tracks_RelativePhi(0),
205 fBuffer_Cluster_MC_Label(-10),
206 fBuffer_Mother_MC_Label(-10),
207 hNCellsInClustersVsCentrality(NULL),
208 hNActiveCellsVsCentrality(NULL),
209 hNActiveCellsAbove50MeVVsCentrality(NULL),
210 hNActiveCellsAbove80MeVVsCentrality(NULL),
211 hNActiveCellsAbove100MeVVsCentrality(NULL),
212 hNActiveCellsAbove150MeVVsCentrality(NULL),
213 hECellsInClustersVsCentrality(NULL),
214 hEActiveCellsVsCentrality(NULL),
215 hEActiveCells50MeVVsCentrality(NULL),
216 hEActiveCells80MeVVsCentrality(NULL),
217 hEActiveCells100MeVVsCentrality(NULL),
218 hEActiveCells150MeVVsCentrality(NULL)
235 DefineInput(0, TChain::Class());
236 DefineOutput(1, TList::Class());
237 DefineOutput(2, TTree::Class());
379 if(eventQuality != 0){
386 if(eventNotAccepted)
return;
389 if(!
fGeomEMCAL){ AliFatal(
"EMCal geometry not initialized!");}
392 TClonesArray * arrClustersProcess = NULL;
398 if(!arrClustersProcess)
399 AliFatal(Form(
"%sClustersBranch was not found in AliAnalysisTaskGammaCalo! Check the correction framework settings!",
fCorrTaskSetting.Data()));
400 nclus = arrClustersProcess->GetEntries();
403 if(nclus == 0)
return;
412 AliVCaloCells* cells =
fInputEvent->GetEMCALCells();
417 Int_t numberOfActiveCells50MeV =0;
418 Int_t numberOfActiveCells80MeV =0;
419 Int_t numberOfActiveCells100MeV =0;
420 Int_t numberOfActiveCells150MeV =0;
421 for(
Int_t aCell=0;aCell<cells->GetNumberOfCells();aCell++){
424 Double_t cellAmplitude = 0, cellTime = 0, cellEFrac = 0;
425 Int_t cellMCLabel = 0;
427 cells->GetCell(aCell,cellNumber,cellAmplitude,cellTime,cellMCLabel,cellEFrac);
428 Double_t cellEnergy = cells->GetCellAmplitude(cellNumber);
430 if(cellEnergy >0.050 ){
431 numberOfActiveCells50MeV++;
434 if(cellEnergy >0.080 ){
435 numberOfActiveCells80MeV++;
438 if(cellEnergy >0.100 ){
439 numberOfActiveCells100MeV++;
442 if(cellEnergy >0.150 ){
443 numberOfActiveCells150MeV++;
456 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
458 map<Long_t,Int_t> mapIsClusterAccepted;
459 map<Long_t,Int_t> mapIsClusterAcceptedWithoutTrackMatch;
460 Int_t nCellInCluster = 0;
462 for(Long_t i = 0; i < nclus; i++){
464 AliVCluster* clus = NULL;
466 if(arrClustersProcess)
467 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
469 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)
fInputEvent->GetCaloCluster(i));
470 }
else if(
fInputEvent->IsA()==AliAODEvent::Class()){
471 if(arrClustersProcess)
472 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
474 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)
fInputEvent->GetCaloCluster(i));
479 if ( !clus->IsEMCAL()){
484 nCellInCluster+=clus->GetNCells();
485 for(
Int_t iCell=0;iCell<clus->GetNCells();iCell++){
495 if(!((
AliCaloPhotonCuts*)
fClusterCutsEMC)->ClusterIsSelected(clus,
fInputEvent,fMCEvent,
fIsMC, tempClusterWeight,i) && !((
AliCaloPhotonCuts*)
fClusterCutsDMC)->ClusterIsSelected(clus,
fInputEvent,fMCEvent,
fIsMC, tempClusterWeight,i)){
510 Float_t clusPos[3] = { 0,0,0 };
511 cluster->GetPosition(clusPos);
512 TVector3 clusterVector(clusPos[0],clusPos[1],clusPos[2]);
513 Double_t etaCluster = clusterVector.Eta();
514 Double_t phiCluster = clusterVector.Phi();
515 if (phiCluster < 0) phiCluster += 2*TMath::Pi();
538 if(etaCluster < 0.67 && etaCluster > -0.67){
539 if(phiCluster < 3.2 && phiCluster > 1.4){
543 if(etaCluster < 0.67 && etaCluster > -0.67){
544 if(etaCluster > 0.23 || etaCluster < -0.23){
545 if(phiCluster < 5.6 && phiCluster > 4.6){
557 AliVCaloCells* cells = NULL;
558 if(cluster->IsEMCAL())
559 cells = event->GetEMCALCells();
568 Int_t nCellCluster = cluster->GetNCells();
577 if ( leadcellphi < 0 ) leadcellphi+=TMath::TwoPi();
582 for(
Int_t iCell=0;iCell<nCellCluster;iCell++){
585 fBuffer_Cells_E[iCell] = cells->GetCellAmplitude(cluster->GetCellAbsId(iCell));
589 if ( cellphi < 0 ) cellphi+=TMath::TwoPi();
596 Int_t nActiveCellsSurroundingInR = 0;
598 for(
Int_t aCell=0;aCell<cells->GetNumberOfCells();aCell++){
601 Double_t cellAmplitude = 0, cellTime = 0, cellEFrac = 0;
602 Int_t cellMCLabel = 0;
606 cells->GetCell(aCell,cellNumber,cellAmplitude,cellTime,cellMCLabel,cellEFrac);
609 fGeomEMCAL->EtaPhiFromIndex(cellNumber, surrcelleta, surrcellphi);
610 if ( surrcellphi < 0 ) surrcellphi+=TMath::TwoPi();
611 Double_t dR2 = pow(leadcelleta-surrcelleta,2) + pow(leadcellphi-surrcellphi,2);
619 nActiveCellsSurroundingInR+=1;
627 if (cluster->GetNLabels()>0){
628 if((cluster->GetLabelAt(0)!=-1)){
631 }
else if(
fInputEvent->IsA()==AliAODEvent::Class()){
632 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
633 if (AODMCTrackArray == NULL)
return;
635 AliAODMCParticle* particle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(cluster->GetLabelAt(0)));
662 const Int_t nCells = cluster->GetNCells();
663 AliVCaloCells* cells = NULL;
665 if(cluster->IsEMCAL())
666 cells = event->GetEMCALCells();
667 else if(cluster->IsPHOS())
668 cells = event->GetPHOSCells();
673 if (nCells < 1)
return idMax;
674 for (
Int_t iCell = 0;iCell < nCells;iCell++){
675 Int_t cellAbsID = cluster->GetCellsAbsId()[iCell];
676 if (cells->GetCellAmplitude(cellAbsID)> eMax){
677 eMax = cells->GetCellAmplitude(cellAbsID);
686 Int_t nSupMod=0, nModule=0, nIphi=0, nIeta=0;
690 fGeomEMCAL->GetCellIndex(cellIndex, nSupMod,nModule,nIphi,nIeta);
691 fGeomEMCAL->GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, row,column);
692 row += nSupMod/2 * 24;
693 column += nSupMod%2 * 48;
700 InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
702 TLorentzVector clusterVector;
703 clus->GetMomentum(clusterVector,vertex);
705 TLorentzVector* tmpvec =
new TLorentzVector();
706 tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
710 if(!PhotonCandidate){
713 if (PhotonCandidate)
delete PhotonCandidate;
722 Int_t* mclabelsCluster = clus->GetLabels();
723 Int_t nValidClusters = 0;
724 if (clus->GetNLabels()>0){
725 for (
Int_t k =0; k< (
Int_t)clus->GetNLabels(); k++){
726 if (mclabelsCluster[k]>0){
727 if (nValidClusters< 50)PhotonCandidate->
SetCaloPhotonMCLabel(nValidClusters,mclabelsCluster[k]);
735 AliAODCaloCluster* clusSub1 =
new AliAODCaloCluster();
736 AliAODCaloCluster* clusSub2 =
new AliAODCaloCluster();
746 const Int_t nc = clus->GetNCells();
747 Int_t absCellIdList[nc];
753 TLorentzVector clusterVector1;
754 clusSub1->GetMomentum(clusterVector1,vertex);
755 TLorentzVector* tmpvec1 =
new TLorentzVector();
756 tmpvec1->SetPxPyPzE(clusterVector1.Px(),clusterVector1.Py(),clusterVector1.Pz(),clusterVector1.E());
759 if(!PhotonCandidate1){
767 TLorentzVector clusterVector2;
768 clusSub2->GetMomentum(clusterVector2,vertex);
769 TLorentzVector* tmpvec2 =
new TLorentzVector();
770 tmpvec2->SetPxPyPzE(clusterVector2.Px(),clusterVector2.Py(),clusterVector2.Pz(),clusterVector2.E());
773 if(!PhotonCandidate2){
800 Int_t nTracksInR = 0;
808 AliError(
"Task needs AOD or ESD event, returning");
812 AliESDtrackCuts *EsdTrackCuts = 0x0;
814 static int prevRun = -1;
818 if (prevRun!=runNumber) {
824 if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
825 EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
827 }
else if (runNumber>=209122){
829 EsdTrackCuts =
new AliESDtrackCuts();
830 EsdTrackCuts->AliESDtrackCuts::SetMinNCrossedRowsTPC(70);
831 EsdTrackCuts->AliESDtrackCuts::SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
832 EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterTPC(4);
833 EsdTrackCuts->AliESDtrackCuts::SetAcceptKinkDaughters(kFALSE);
834 EsdTrackCuts->AliESDtrackCuts::SetRequireTPCRefit(kTRUE);
836 EsdTrackCuts->AliESDtrackCuts::SetRequireITSRefit(kTRUE);
837 EsdTrackCuts->AliESDtrackCuts::SetClusterRequirementITS(AliESDtrackCuts::kSPD,
838 AliESDtrackCuts::kAny);
839 EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexXYPtDep(
"0.0105+0.0350/pt^1.1");
840 EsdTrackCuts->AliESDtrackCuts::SetMaxChi2TPCConstrainedGlobal(36);
841 EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexZ(2);
842 EsdTrackCuts->AliESDtrackCuts::SetDCAToVertex2D(kFALSE);
843 EsdTrackCuts->AliESDtrackCuts::SetRequireSigmaToVertex(kFALSE);
844 EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterITS(36);
847 EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
849 EsdTrackCuts->SetMaxDCAToVertexZ(2);
850 EsdTrackCuts->SetEtaRange(-0.8, 0.8);
851 EsdTrackCuts->SetPtRange(0.15);
855 AliExternalTrackParam *trackParam = 0;
856 AliVTrack *inTrack = 0x0;
858 inTrack = esdev->GetTrack(itr);
859 if(!inTrack)
continue;
861 AliESDtrack *esdt =
dynamic_cast<AliESDtrack*
>(inTrack);
863 if(!EsdTrackCuts->AcceptTrack(esdt))
continue;
864 const AliExternalTrackParam *in = esdt->GetInnerParam();
865 if (!in){AliError(
"Could not get InnerParam of Track, continue");
continue;}
866 trackParam =
new AliExternalTrackParam(*in);
868 inTrack =
dynamic_cast<AliVTrack*
>(aodev->GetTrack(itr));
869 if(!inTrack)
continue;
871 AliAODTrack *aodt =
dynamic_cast<AliAODTrack*
>(inTrack);
873 if(!aodt->IsHybridGlobalConstrainedGlobal())
continue;
875 Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0};
876 aodt->GetPxPyPz(pxpypz);
878 aodt->GetCovarianceXYZPxPyPz(cv);
880 trackParam =
new AliExternalTrackParam(xyz,pxpypz,cv,aodt->Charge());
882 AliExternalTrackParam emcParam(*trackParam);
886 if (!AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&emcParam, 440., 0.139, 20., eta, phi, pt)) {
890 if( TMath::Abs(eta) > 0.75 ) {
895 if( nModules < 13 && ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad())){
901 if (( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()) && ( phi < 250*TMath::DegToRad() || phi > 340*TMath::DegToRad())){
908 if (!emcParam.GetXYZ(trkPos)){
913 AliExternalTrackParam trackParamTmp(emcParam);
916 Float_t dR2 = dPhi*dPhi + dEta*dEta;
945 Int_t mcLabelCluster = -5;
946 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
947 Double_t mcProdVtxX = primVtxMC->GetX();
948 Double_t mcProdVtxY = primVtxMC->GetY();
949 Double_t mcProdVtxZ = primVtxMC->GetZ();
951 TParticle *Photon = NULL;
952 if (!TrueClusterCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
954 mcLabelCluster = -10;
955 return mcLabelCluster;
960 mcLabelCluster = -11;
961 return mcLabelCluster;
964 mcLabelCluster = -12;
965 return mcLabelCluster;
983 Int_t clusterClass = 0;
987 Long_t motherLab = -1;
1017 TParticle *mother = NULL;
1018 Int_t motherPDG = -1;
1020 mother =
fMCEvent->Particle(motherLab);
1022 motherPDG = TMath::Abs(mother->GetPdgCode());
1025 if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
1027 if (clusterClass == 1 && TrueClusterCandidate->
IsMerged()){
1028 if (motherPDG == 111){
1029 mcLabelCluster = 10;
1030 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1031 mcLabelCluster = 11;
1033 if (motherPDG == 221)
1034 mcLabelCluster = 12;
1036 if (motherPDG == 111){
1037 mcLabelCluster = 13;
1038 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1039 mcLabelCluster = 14;
1041 if (motherPDG == 221)
1042 mcLabelCluster = 15;
1043 }
else if (clusterClass == 2){
1044 if (motherPDG == 111){
1045 mcLabelCluster = 20;
1046 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1047 mcLabelCluster = 21;
1049 if (motherPDG == 221)
1050 mcLabelCluster = 22;
1051 }
else if (clusterClass == 3){
1052 if (motherPDG == 111) {
1053 mcLabelCluster = 30;
1054 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1055 mcLabelCluster = 31;
1057 if (motherPDG == 221)
1058 mcLabelCluster = 32;
1068 if (motherLab == -1) mcLabelCluster = 40;
1069 else if ((motherLab >0) && (motherLab<9)) mcLabelCluster = 41;
1070 else if (motherLab == 11) mcLabelCluster = 42;
1071 else if (motherLab == 22){
1073 TParticle *dummyMother =
fMCEvent->Particle(motherLab);
1074 Bool_t originReached = kFALSE;
1075 Bool_t isFragPhoton = kFALSE;
1077 while (dummyMother->GetPdgCode() == 22 && !originReached){
1078 if (dummyMother->GetMother(0) > -1){
1079 dummyMother =
fMCEvent->Particle(dummyMother->GetMother(0));
1080 if (TMath::Abs(dummyMother->GetPdgCode()) == 22){
1081 if (dummyMother->GetMother(0) > -1){
1082 dummyMother =
fMCEvent->Particle(dummyMother->GetMother(0));
1084 originReached = kTRUE;
1087 originReached = kTRUE;
1089 isFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);
1091 originReached = kTRUE;
1095 if(isFragPhoton) mcLabelCluster = 43;
1097 mcLabelCluster = 47;
1098 AliInfo(Form(
"Mother of photon is photon etc. but origin is not quark. ID: %li", motherLab));
1102 mcLabelCluster = 44;
1103 AliInfo(Form(
"Single cluster is mainly produced by a photon and mother is %li", motherLab));
1107 mcLabelCluster = 45;
1109 mcLabelCluster = 46;
1114 mcLabelCluster = 50;
1117 mcLabelCluster = 60;
1118 AliInfo(Form(
"Single cluster is mainly produced by hadron with id: %li", motherLab));
1122 return mcLabelCluster;
1130 Int_t mcLabelCluster = -5;
1131 const AliVVertex* primVtxMC =
fMCEvent->GetPrimaryVertex();
1132 Double_t mcProdVtxX = primVtxMC->GetX();
1133 Double_t mcProdVtxY = primVtxMC->GetY();
1134 Double_t mcProdVtxZ = primVtxMC->GetZ();
1136 AliAODMCParticle *Photon = NULL;
1137 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1139 if (AODMCTrackArray){
1140 if (!TrueClusterCandidate->
GetIsCaloPhoton()) AliFatal(
"CaloPhotonFlag has not been set task will abort");
1142 mcLabelCluster = -10;
1143 return mcLabelCluster;
1147 mcLabelCluster = -11;
1148 return mcLabelCluster;
1151 AliInfo(
"AODMCTrackArray could not be loaded");
1152 mcLabelCluster = -90;
1153 return mcLabelCluster;
1156 mcLabelCluster = -12;
1157 return mcLabelCluster;
1163 Int_t clusterClass = 0;
1166 Long_t motherLab = -1;
1184 if (TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->
GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 111 || TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->
GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 221 ){
1196 AliAODMCParticle *mother = NULL;
1197 Int_t motherPDG = -1;
1199 mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(motherLab));
1201 motherPDG = TMath::Abs(mother->GetPdgCode());
1203 if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
1205 if (clusterClass == 1 && TrueClusterCandidate->
IsMerged()){
1206 if (motherPDG == 111){
1207 mcLabelCluster = 10;
1208 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1209 mcLabelCluster = 11;
1211 if (motherPDG == 221)
1212 mcLabelCluster = 12;
1214 if (motherPDG == 111){
1215 mcLabelCluster = 13;
1216 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1217 mcLabelCluster = 14;
1219 if (motherPDG == 221)
1220 mcLabelCluster = 15;
1221 }
else if (clusterClass == 2){
1222 if (motherPDG == 111){
1223 mcLabelCluster = 20;
1224 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1225 mcLabelCluster = 21;
1227 if (motherPDG == 221)
1228 mcLabelCluster = 22;
1229 }
else if (clusterClass == 3){
1230 if (motherPDG == 111) {
1231 mcLabelCluster = 30;
1232 if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1233 mcLabelCluster = 31;
1235 if (motherPDG == 221)
1236 mcLabelCluster = 32;
1245 if (motherLab == -1) mcLabelCluster = 40;
1246 else if ((motherLab >0) && (motherLab<9)) mcLabelCluster = 41;
1247 else if (motherLab == 11) mcLabelCluster = 42;
1248 else if (motherLab == 22){
1250 AliAODMCParticle *dummyMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(motherLab));
1251 Bool_t originReached = kFALSE;
1252 Bool_t isFragPhoton = kFALSE;
1254 while (dummyMother->GetPdgCode() == 22 && !originReached){
1255 if (dummyMother->GetMother() > -1){
1256 dummyMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(dummyMother->GetMother()));
1258 if (TMath::Abs(dummyMother->GetPdgCode()) == 22){
1259 if (dummyMother->GetMother() > -1){
1260 dummyMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(dummyMother->GetMother()));
1262 originReached = kTRUE;
1265 originReached = kTRUE;
1267 isFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);
1269 originReached = kTRUE;
1273 if(isFragPhoton) mcLabelCluster = 43;
1275 mcLabelCluster = 47;
1276 AliInfo(Form(
"Mother of photon is photon etc. but origin is not quark. ID: %li", motherLab));
1280 mcLabelCluster = 44;
1281 AliInfo(Form(
"Single cluster is mainly produced by a photon and mother is %li", motherLab));
1285 mcLabelCluster = 45;
1287 mcLabelCluster = 46;
1292 mcLabelCluster = 50;
1295 mcLabelCluster = 60;
1296 AliInfo(Form(
"Single cluster is mainly produced by hadron with id: %li", motherLab));
1300 return mcLabelCluster;
1307 return ((ULong64_t)header->GetBunchCrossNumber()+
1308 (ULong64_t)header->GetOrbitNumber()*3564+
1309 (ULong64_t)header->GetPeriodNumber()*16777215*3564);
1318 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
1320 AliWarning (
"AliMultSelection object not found !");
1323 return MultSelection->GetMultiplicityPercentile(
"V0M");
void SetPeriodEnum(TString periodName)
TH2F * hNActiveCellsAbove50MeVVsCentrality
Int_t fBuffer_Surrounding_NTracks
! array buffer
void SetCaloClusterRef(Long_t ref)
Float_t fBuffer_ClusterPhi
! array buffer
virtual void UserExec(Option_t *option)
void SetCaloPhotonMCFlags(AliMCEvent *mcEvent, Bool_t enableSort)
ULong64_t GetUniqueEventID(AliVHeader *header)
TH2F * hEActiveCells150MeVVsCentrality
Float_t fBuffer_Event_Vertex_Y
! array buffer
Int_t MakePhotonCandidates(AliVCluster *clus, AliVCaloCells *cells, Long_t indexCluster)
PeriodVar GetPeriodEnum()
Bool_t fSaveMCInformation
save MC information
AliConvEventCuts * fEventCuts
void SetPeriodEnumExplicit(PeriodVar periodEnum)
Float_t fBuffer_ClusterE
! array buffer
Float_t * fBuffer_Cells_RelativeEta
! array buffer
Bool_t fSaveEventProperties
save general event properties (centrality etc.)
virtual ~AliAnalysisTaskClusterQA()
Float_t fConeRadius
save arrays of all cells in event
virtual void UserCreateOutputObjects()
TH2F * hEActiveCells80MeVVsCentrality
void SetCaloPhotonMCLabel(Int_t i, Int_t labelCaloPhoton)
Int_t fBuffer_Mother_MC_Label
! array buffer
Float_t * fBuffer_Surrounding_Tracks_R
! array buffer
Float_t fBuffer_Event_Vertex_Z
! array buffer
Int_t GetCaloPhotonMotherMCLabel(Int_t i)
Bool_t fBuffer_ClusterIsEMCAL
! array buffer
Float_t fBuffer_Event_Vertex_X
! array buffer
Int_t fBuffer_LeadingCell_ID
! array buffer
void GetRowAndColumnFromAbsCellID(Int_t cellIndex, Int_t &row, Int_t &column)
void ProcessTracksAndMatching(AliVCluster *clus, Long_t indexCluster)
Float_t fBuffer_Event_Multiplicity
! array buffer
Int_t * fBuffer_Surrounding_Cells_ID
! array buffer
Int_t FindLargestCellInCluster(AliVCluster *cluster, AliVEvent *event)
Float_t * fBuffer_Surrounding_Cells_E
! array buffer
AliAnalysisTaskClusterQA()
Float_t fBuffer_LeadingCell_Phi
! array buffer
Int_t IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *event, AliMCEvent *mcEvent, Int_t isHeavyIon, Bool_t isEMCALAnalysis)
Float_t * fBuffer_Surrounding_Cells_R
! array buffer
Class handling all kinds of selection cuts for Gamma Calo analysis.
void ProcessQATreeCluster(AliVEvent *event, AliVCluster *cluster, Long_t indexCluster)
Float_t * fBuffer_Cells_RelativePhi
! array buffer
Float_t * fBuffer_Surrounding_Tracks_RelativeEta
! array buffer
Float_t * fBuffer_Surrounding_Tracks_Pt
! array buffer
Bool_t IsConversionPrimaryESD(AliMCEvent *mcEvent, Long_t eventpos, Double_t prodVtxX, Double_t prodVtxY, Double_t prodVtxZ)
Int_t fBuffer_Cluster_MC_Label
! array buffer
AliCaloPhotonCuts * fClusterCutsEMC
Bool_t fSaveSurroundingCells
save arrays of all cells in event
TH2F * hECellsInClustersVsCentrality
TH2F * hNCellsInClustersVsCentrality
Float_t fBuffer_ClusterM20
! array buffer
Bool_t fSaveAdditionalHistos
save MC information
Float_t fMinClusterEnergy
save arrays of all cells in event
Bool_t IsLargestComponentElectron()
Int_t * fBuffer_Cells_ID
! array buffer
Int_t fMaxNLMCut
save MC information
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t GetCaloPhotonMCLabel(Int_t i)
TH2F * hEActiveCellsVsCentrality
Float_t fBuffer_ClusterM02
! array buffer
virtual void Terminate(Option_t *)
Int_t fBuffer_Event_NumActiveCells
! array buffer
Float_t fBuffer_ClusterEta
! array buffer
Int_t GetNCaloPhotonMCLabels()
Float_t GetCentrality(AliVEvent *event)
TH2F * hEActiveCells100MeVVsCentrality
Bool_t fSaveCells
save arrays of cluster cells
static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, const AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi)
AliEMCALGeometry * fGeomEMCAL
ULong64_t fBuffer_EventID
! array buffer
Float_t * fBuffer_Surrounding_Cells_RelativePhi
! array buffer
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Int_t fBuffer_ClusterNumCells
! array buffer
void SetNCaloPhotonMCLabels(Int_t nLabels)
Bool_t IsConversionFullyContained()
TH2F * hEActiveCells50MeVVsCentrality
Float_t fBuffer_LeadingCell_Eta
! array buffer
const Int_t kMaxActiveCells
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Int_t fBuffer_MC_Cluster_Flag
! array buffer
Float_t * fBuffer_Surrounding_Cells_RelativeEta
! array buffer
Int_t ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TrueClusterCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
AliConversionMesonCuts * fMesonCuts
Int_t GetNCaloPhotonMotherMCLabels()
Float_t fBuffer_LeadingCell_E
! array buffer
TH2F * hNActiveCellsAbove150MeVVsCentrality
AliConvEventCuts * GetEventCuts()
Bool_t IsElectronFromFragPhoton()
AliV0ReaderV1 * fV0Reader
Float_t * fBuffer_Surrounding_Tracks_RelativePhi
! array buffer
void SetCaloPhotonMCFlagsAOD(AliVEvent *event, Bool_t enableSort)
Float_t * fBuffer_Cells_E
! array buffer
Int_t fMinNLMCut
save MC information
TH2F * hNActiveCellsAbove100MeVVsCentrality
Int_t fBuffer_Surrounding_NCells
! array buffer
TH2F * hNActiveCellsAbove80MeVVsCentrality
Bool_t fSaveTracks
save arrays of all cells in event
TH2F * hNActiveCellsVsCentrality
AliCaloPhotonCuts * fClusterCutsDMC
Bool_t IsLargestComponentPhoton()
Int_t ProcessTrueClusterCandidates(AliAODConversionPhoton *TrueClusterCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
TList * OpenFile(const char *fname)
Bool_t IsMergedPartConv()
Float_t fMinTrackPt
save arrays of all cells in event