\r
\r
/////////////////////////MC stuff////////////////////////////////////////////////\r
+ Int_t pdg = 0;\r
if(IsDataMC()){\r
stack=GetMCStack();\r
- if(!stack) printf("AliAnaBtag::MakeAnalysisFillHistograms() - Crap, no stack: \n");\r
-\r
- //Is it really an electron?\r
- TParticle *partX = stack->Particle(TMath::Abs(track->GetLabel()));\r
- int pdg = 0;\r
- pdg = partX->GetPdgCode();\r
- fhSpecies->Fill(TMath::Abs(pdg));\r
- if(TMath::Abs(pdg)==11){ //Check MC electrons\r
- if(emcEle)\r
- fhEmcalMCE->Fill(track->Pt());\r
- if(trkEle)\r
- fhTRDMCE->Fill(track->Pt());\r
- if(tpcEle)\r
- fhTPCMCE->Fill(track->Pt());\r
- }else{ //Fake histos!\r
- if(emcEle)\r
- fhEmcalMCEFake->Fill(track->Pt());\r
- if(trkEle)\r
- fhTRDMCEFake->Fill(track->Pt());\r
- if(tpcEle)\r
- fhTPCMCEFake->Fill(track->Pt());\r
- }\r
- if(TMath::Abs(pdg)==211){ //Check MC pions\r
- if(emcEle)\r
- fhEmcalMCP->Fill(track->Pt());\r
- if(trkEle)\r
- fhTRDMCP->Fill(track->Pt());\r
- if(tpcEle)\r
- fhTPCMCP->Fill(track->Pt());\r
- }\r
- if(TMath::Abs(pdg)==321){ //Check MC Kaons\r
- if(emcEle)\r
- fhEmcalMCK->Fill(track->Pt());\r
- if(trkEle)\r
- fhTRDMCK->Fill(track->Pt());\r
- if(tpcEle)\r
- fhTPCMCK->Fill(track->Pt());\r
- }\r
+ if(!stack) {printf("AliAnaBtag::MakeAnalysisFillHistograms() - Crap, no stack: \n");\r
+ }\r
+ else{\r
+ //Is it really an electron?\r
+ TParticle *partX = stack->Particle(TMath::Abs(track->GetLabel()));\r
+ pdg = partX->GetPdgCode();\r
+ fhSpecies->Fill(TMath::Abs(pdg));\r
+ if(TMath::Abs(pdg)==11){ //Check MC electrons\r
+ if(emcEle)\r
+ fhEmcalMCE->Fill(track->Pt());\r
+ if(trkEle)\r
+ fhTRDMCE->Fill(track->Pt());\r
+ if(tpcEle)\r
+ fhTPCMCE->Fill(track->Pt());\r
+ }else{ //Fake histos!\r
+ if(emcEle)\r
+ fhEmcalMCEFake->Fill(track->Pt());\r
+ if(trkEle)\r
+ fhTRDMCEFake->Fill(track->Pt());\r
+ if(tpcEle)\r
+ fhTPCMCEFake->Fill(track->Pt());\r
+ }\r
+ if(TMath::Abs(pdg)==211){ //Check MC pions\r
+ if(emcEle)\r
+ fhEmcalMCP->Fill(track->Pt());\r
+ if(trkEle)\r
+ fhTRDMCP->Fill(track->Pt());\r
+ if(tpcEle)\r
+ fhTPCMCP->Fill(track->Pt());\r
+ }\r
+ if(TMath::Abs(pdg)==321){ //Check MC Kaons\r
+ if(emcEle)\r
+ fhEmcalMCK->Fill(track->Pt());\r
+ if(trkEle)\r
+ fhTRDMCK->Fill(track->Pt());\r
+ if(tpcEle)\r
+ fhTPCMCK->Fill(track->Pt());\r
+ }\r
+ }\r
+ \r
//Take care of where it came from (parent bit)\r
tr.SetTag(GetMCAnalysisUtils()->CheckOrigin(tr.GetLabel(),GetReader(),tr.GetInputFileIndex())); //Gets a tag bit which contains info about super grandfather particle. Use (tag&(1<<11)), 11 for direct b, and 9 for B->C\r
\r
AliAODMCParticle* AliAnaBtag::GetMCParticle(Int_t ipart) \r
{\r
//Get the MC particle at position ipart\r
-\r
+ \r
AliAODMCParticle* aodprimary = 0x0;\r
TClonesArray * mcparticles0 = 0x0;\r
- TClonesArray * mcparticles1 = 0x0;\r
-\r
+ \r
if(GetReader()->ReadAODMCParticles()){\r
//Get the list of MC particles \r
mcparticles0 = GetReader()->GetAODMCParticles(0);\r
if(!mcparticles0 && GetDebug() > 0) {\r
printf("AliAnaBtag::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");\r
}\r
-\r
- Int_t npart0 = mcparticles0->GetEntriesFast();\r
- Int_t npart1 = 0;\r
- if(mcparticles1) npart1 = mcparticles1->GetEntriesFast();\r
- if(ipart < npart0) aodprimary = (AliAODMCParticle*)mcparticles0->At(ipart);\r
- else aodprimary = (AliAODMCParticle*)mcparticles1->At(ipart-npart0);\r
- if(!aodprimary) {\r
- printf("AliAnaBtag::GetMCParticle() *** no primary ***: label %d \n", ipart);\r
- return 0x0;\r
+ else{\r
+ Int_t npart0 = mcparticles0->GetEntriesFast();\r
+ if(ipart < npart0) aodprimary = (AliAODMCParticle*)mcparticles0->At(ipart);\r
+ \r
+ if(!aodprimary) {\r
+ printf("AliAnaBtag::GetMCParticle() *** no primary ***: label %d \n", ipart);\r
+ return 0x0;\r
+ }\r
}\r
-\r
} else {\r
printf("AliAnaBtag::GetMCParticle() - Asked for AliAODMCParticle but we have a stack reader.\n");\r
}\r
fhELambdaCluster ->Fill(ecluster,lambdaMainCluster,lambdaSecondCluster);
fhELambdaCellCluster ->Fill(ecluster,lambdaMainCluster,iNumCell);
fhNCellCluster->Fill(ecluster,iNumCell);
-
+
//In the case of an event with several clusters, calculate DeltaEta and DeltaPhi for the cluster pairs.
for (Int_t jaod=iaod+1;jaod<naod;jaod++){
AliAODPWG4Particle* phSecond = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(jaod));
fhDeltaPhiClusters->Fill(phicluster-(phSecond->Phi()));
fhDeltaEtaClusters->Fill(etacluster-(phSecond->Eta()));
}
-
+
//Fill the lambda distribution for identified particles
if(ph->GetPdg() == AliCaloPID::kPhoton){
fhDispersionPhoton->Fill(ptcluster,dispcluster);
//Play with the MC data if available
if(IsDataMC()){
+ if(GetReader()->ReadStack() && !stack) return;
+ if(GetReader()->ReadAODMCParticles() && !mcparticles0) return;
+
//Get the tag from AliMCAnalysisUtils for PID
Int_t tag =ph->GetTag();
if ( ph->GetLabel() < 0){
ePhot = pCurrent->Energy();
fhPhotTrueE->Fill(ePhot,ecluster,lambdaMainCluster);
fhRatioEPhoton->Fill(ecluster/ePhot);
- fhMCPdg->Fill(ecluster,22);
+ fhMCPdg->Fill(ecluster,22);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCPhoton: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",ePhot,ecluster,lambdaMainCluster);
}//kMCPhoton
//Compare the cluster energy and true energy
fhPi0TrueE->Fill(ePi0,ecluster,lambdaMainCluster);
fhRatioEPi0->Fill(ecluster/ePi0);
- fhMCPdg->Fill(ecluster,111);
+ fhMCPdg->Fill(ecluster,111);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCPi0: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",ePi0,ecluster,lambdaMainCluster);
}
fhPionTrueE->Fill(ePion,ecluster,lambdaMainCluster);
fhRatioEPion->Fill(ecluster/ePion);
}
- fhMCPdg->Fill(ecluster,211);
+ fhMCPdg->Fill(ecluster,211);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCPion: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",ePion,ecluster,lambdaMainCluster);
}
fhProtonTrueE->Fill(eProton,ecluster,lambdaMainCluster);
fhRatioEProton->Fill(ecluster/eProton);
}
- fhMCPdg->Fill(ecluster,2212);
+ fhMCPdg->Fill(ecluster,2212);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCProton: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",eProton,ecluster,lambdaMainCluster);
}
fhAntiProtonTrueE->Fill(eAntiProton,ecluster,lambdaMainCluster);
fhRatioEAntiProton->Fill(ecluster/eAntiProton);
}
- fhMCPdg->Fill(ecluster,-2212);
+ fhMCPdg->Fill(ecluster,-2212);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCAntiProton: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",eAntiProton,ecluster,lambdaMainCluster);
}
fhNeutronTrueE->Fill(eNeutron,ecluster,lambdaMainCluster);
fhRatioENeutron->Fill(ecluster/eNeutron);
}
- fhMCPdg->Fill(ecluster,2112);
+ fhMCPdg->Fill(ecluster,2112);
if(GetDebug() > 3)
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() - MC Cluster identified as kMCNeutron: True E: %3.2f, Reco E: %3.2f, Lambda0: %3.2f\n",eNeutron,ecluster,lambdaMainCluster);
}
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
continue;
}
-
+
//Calculate Pi0 decay angles
if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){
- for(Int_t i=0 ; i<stack->GetNprimary(); i++){
- TParticle * prim = stack->Particle(i) ;
- if(prim->GetPdgCode() == 111){
- TLorentzVector mom1 ;
- (stack->Particle((prim->GetFirstDaughter())))->Momentum(mom1);
- TLorentzVector mom2 ;
- (stack->Particle((prim->GetLastDaughter())))->Momentum(mom2);
- Float_t fDecayAngle = mom1.Angle(mom2.Vect());
- fhDecayAngle->Fill(ecluster,fDecayAngle);
- }
- }
+ for(Int_t i=0 ; i<stack->GetNprimary(); i++){
+ TParticle * prim = stack->Particle(i) ;
+ if(prim->GetPdgCode() == 111){
+ TLorentzVector mom1 ;
+ (stack->Particle((prim->GetFirstDaughter())))->Momentum(mom1);
+ TLorentzVector mom2 ;
+ (stack->Particle((prim->GetLastDaughter())))->Momentum(mom2);
+ Float_t fDecayAngle = mom1.Angle(mom2.Vect());
+ fhDecayAngle->Fill(ecluster,fDecayAngle);
+ }
+ }
}
aodprimary = (AliAODMCParticle*) mcparticles0->At(label);
}
-// else {//Second input
-// if(!mcparticles1) continue;
-// if(label >= mcparticles1->GetEntriesFast()) {
-// if(GetDebug() > 2) printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n",label, mcparticles1->GetEntriesFast());
-// continue ;
-// }
-// //Get the particle
-// aodprimary = (AliAODMCParticle*) mcparticles1->At(label);
-// }//second input
+ // else {//Second input
+ // if(!mcparticles1) continue;
+ // if(label >= mcparticles1->GetEntriesFast()) {
+ // if(GetDebug() > 2) printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n",label, mcparticles1->GetEntriesFast());
+ // continue ;
+ // }
+ // //Get the particle
+ // aodprimary = (AliAODMCParticle*) mcparticles1->At(label);
+ // }//second input
if(!aodprimary){
printf("AliAnaShowerParameter::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label);