fMinLeadHadPt(0), fMaxLeadHadPt(0),
fFillEtaGapsHisto(1), fFillMomImbalancePtAssocBinsHisto(0),
fMCGenTypeMin(0), fMCGenTypeMax(0),
+ fTrackVector(), fMomentum(),
+ fDecayMom1(), fDecayMom2(),
//Histograms
fhPtTriggerInput(0), fhPtTriggerSSCut(0),
fhPtTriggerIsoCut(0), fhPtTriggerFidCut(0),
}
}
-//______________________________________________________________________________________________________________________________
-void AliAnaParticleHadronCorrelation::FillDecayPhotonCorrelationHistograms(Float_t ptAssoc, Float_t phiAssoc,
- TLorentzVector mom1, TLorentzVector mom2,
- Bool_t bChargedOrNeutral)
+//_____________________________________________________________________________________________________________________________________
+void AliAnaParticleHadronCorrelation::FillDecayPhotonCorrelationHistograms(Float_t ptAssoc, Float_t phiAssoc, Bool_t bChargedOrNeutral)
{
// Do correlation with decay photons of triggered pi0 or eta
// Calculate the correlation parameters
- Float_t ptDecay1 = mom1.Pt();
- Float_t ptDecay2 = mom2.Pt();
+ Float_t ptDecay1 = fDecayMom1.Pt();
+ Float_t ptDecay2 = fDecayMom2.Pt();
Float_t zTDecay1 = -100, zTDecay2 = -100;
if(ptDecay1 > 0) zTDecay1 = ptAssoc/ptDecay1 ;
if(ptDecay2 > 0) zTDecay2 = ptAssoc/ptDecay2 ;
- Float_t deltaPhiDecay1 = mom1.Phi()-phiAssoc;
+ Float_t deltaPhiDecay1 = fDecayMom1.Phi()-phiAssoc;
if(deltaPhiDecay1< -TMath::PiOver2()) deltaPhiDecay1+=TMath::TwoPi();
if(deltaPhiDecay1>3*TMath::PiOver2()) deltaPhiDecay1-=TMath::TwoPi();
- Float_t deltaPhiDecay2 = mom2.Phi()-phiAssoc;
+ Float_t deltaPhiDecay2 = fDecayMom2.Phi()-phiAssoc;
if(deltaPhiDecay2< -TMath::PiOver2()) deltaPhiDecay2+=TMath::TwoPi();
if(deltaPhiDecay2>3*TMath::PiOver2()) deltaPhiDecay2-=TMath::TwoPi();
TList * pool = fListMixTrackEvents[eventBin];
- TVector3 p3;
for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
{
AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
- Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
- p3.SetXYZ(mom[0],mom[1],mom[2]);
- Float_t pt = p3.Pt();
+ fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
+ Float_t pt = fTrackVector.Pt();
//Select only hadrons in pt range
if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
- AliAODPWG4Particle * mixedTrack = new AliAODPWG4Particle(mom[0],mom[1],mom[2],0);
+ AliAODPWG4Particle * mixedTrack = new AliAODPWG4Particle(track->Px(),track->Py(),track->Pz(),0);
mixedTrack->SetDetectorTag(kCTS);
mixedTrack->SetChargedBit(track->Charge()>0);
mixEventTracks->Add(mixedTrack);
TList * poolCalo = fListMixCaloEvents[eventBin];
- TLorentzVector mom;
-
for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ )
{
AliVCluster * calo = (AliVCluster *) (pl->At(ipr)) ;
//Cluster momentum calculation
if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
{
- calo->GetMomentum(mom,GetVertex(0)) ;
+ calo->GetMomentum(fMomentum,GetVertex(0)) ;
}//Assume that come from vertex in straight line
else
{
Double_t vertex[]={0,0,0};
- calo->GetMomentum(mom,vertex) ;
+ calo->GetMomentum(fMomentum,vertex) ;
}
- Float_t pt = mom.Pt();
+ Float_t pt = fMomentum.Pt();
//Select only clusters in pt range
if(pt < fMinAssocPt || pt > fMaxAssocPt) continue ;
- AliAODPWG4Particle * mixedCalo = new AliAODPWG4Particle(mom);
+ AliAODPWG4Particle * mixedCalo = new AliAODPWG4Particle(fMomentum);
mixedCalo->SetDetectorTag(kEMCAL);
mixEventCalo->Add(mixedCalo);
}
Float_t phiLeadHad = -100 ;
Float_t etaLeadHad = -100 ;
Int_t nTrack = 0;
- TVector3 p3;
for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
{
AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
- Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
- p3.SetXYZ(mom[0],mom[1],mom[2]);
+ fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
- Float_t pt = p3.Pt();
- Float_t phi = p3.Phi() ;
+ Float_t pt = fTrackVector.Pt();
+ Float_t phi = fTrackVector.Phi() ;
if(phi < 0 ) phi+= TMath::TwoPi();
Float_t deltaPhi = phiTrig-phi;
ptLeadHad = pt ;
phiLeadHad = phi;
dphiLeadHad= deltaPhi;
- etaLeadHad = p3.Eta();
+ etaLeadHad = fTrackVector.Eta();
nTrack++;
}
}// track loop
fhMCUePart[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
fhMCPtXEUeCharged[i] =
- new TH2F(Form("hMCPtXEUeCharged%s",right.Data()),
- Form("MC %s: #it{x}_{#it{E}} with charged hadrons, Underlying Event",nameMC[i].Data()),
+ new TH2F(Form("hMCPtXEUeCharged%s_%s",right.Data(),nameMC[i].Data()),
+ Form("MC %s: #it{x}_{#it{E}} with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
fhMCPtXEUeCharged[i]->SetYTitle("#it{x}_{#it{E}}");
fhMCPtXEUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
fhMCPtHbpXEUeCharged[i] =
- new TH2F(Form("hMCPtHbpXEUeCharged%s",right.Data()),
- Form("MC %s: #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons, Underlying Event",nameMC[i].Data()),
+ new TH2F(Form("hMCPtHbpXEUeCharged%s_%s",right.Data(),nameMC[i].Data()),
+ Form("MC %s: #xi = ln(1/#it{x}_{#it{E}}) with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
fhMCPtHbpXEUeCharged[i]->SetYTitle("ln(1/#it{x}_{#it{E}})");
fhMCPtHbpXEUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
fhMCPtZTUeCharged[i] =
- new TH2F(Form("hMCPtZTUeCharged%s",right.Data()),
- Form("MC %s: #it{z}_{T} with charged hadrons, Underlying Event",nameMC[i].Data()),
+ new TH2F(Form("hMCPtZTUeCharged%s_%s",right.Data(),nameMC[i].Data()),
+ Form("MC %s: #it{z}_{T} with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
nptbins,ptmin,ptmax,nxeztbins,xeztmin,xeztmax);
fhMCPtZTUeCharged[i]->SetYTitle("#it{z}_{T}");
fhMCPtZTUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
fhMCPtHbpZTUeCharged[i] =
- new TH2F(Form("hMCPtHbpZTUeCharged%s",right.Data()),
- Form("MC %s: #xi = ln(1/#it{z}_{T}) with charged hadrons, Underlying Event",nameMC[i].Data()),
+ new TH2F(Form("hMCPtHbpZTUeCharged%s_%s",right.Data(),nameMC[i].Data()),
+ Form("MC %s: #xi = ln(1/#it{z}_{T}) with charged hadrons, Underlying Event %s",nameMC[i].Data(),right.Data()),
nptbins,ptmin,ptmax,nhbpbins,hbpmin,hbpmax);
fhMCPtHbpZTUeCharged[i]->SetYTitle("ln(1/#it{z}_{T})");
fhMCPtHbpZTUeCharged[i]->SetXTitle("#it{p}_{T trigger} (GeV/#it{c})");
}
-//_________________________________________________________________________________________________
-Bool_t AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum(AliAODPWG4Particle* trigger,
- TLorentzVector & mom1,
- TLorentzVector & mom2)
+//____________________________________________________________________________________________________________________
+Bool_t AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum(Int_t indexPhoton1, Int_t indexPhoton2, Int_t detector)
{
// Get the momentum of the pi0/eta assigned decay photons
// In case of pi0/eta trigger, we may want to check their decay correlation,
// get their decay children
- Int_t indexPhoton1 = trigger->GetCaloLabel(0);
- Int_t indexPhoton2 = trigger->GetCaloLabel(1);
-
if(indexPhoton1!=-1 || indexPhoton2!=-1) return kFALSE;
if(GetDebug() > 1)
printf("AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum() - indexPhoton1 = %d, indexPhoton2 = %d \n", indexPhoton1, indexPhoton2);
TObjArray * clusters = 0x0 ;
- if(trigger->GetDetectorTag()==kEMCAL) clusters = GetEMCALClusters() ;
- else clusters = GetPHOSClusters() ;
+ if(detector==kEMCAL) clusters = GetEMCALClusters() ;
+ else clusters = GetPHOSClusters() ;
for(Int_t iclus = 0; iclus < clusters->GetEntriesFast(); iclus++)
{
AliVCluster * photon = (AliVCluster*) (clusters->At(iclus));
- if(photon->GetID()==indexPhoton1) photon->GetMomentum(mom1,GetVertex(0)) ;
- if(photon->GetID()==indexPhoton2) photon->GetMomentum(mom1,GetVertex(0)) ;
+ if(photon->GetID()==indexPhoton1) photon->GetMomentum(fDecayMom1,GetVertex(0)) ;
+ if(photon->GetID()==indexPhoton2) photon->GetMomentum(fDecayMom2,GetVertex(0)) ;
- if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum() - Photon1 = %f, Photon2 = %f \n", mom1.Pt(), mom2.Pt());
+ if(GetDebug() > 1)printf("AliAnaParticleHadronCorrelation::GetDecayPhotonMomentum() - Photon1 = %f, Photon2 = %f \n", fDecayMom1.Pt(), fDecayMom2.Pt());
} //cluster loop
// Compare if it is the leading of all tracks
- TVector3 p3;
for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
{
AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
if(track->GetID() == pLeading->GetTrackLabel(0) || track->GetID() == pLeading->GetTrackLabel(1) ||
track->GetID() == pLeading->GetTrackLabel(2) || track->GetID() == pLeading->GetTrackLabel(3) ) continue ;
- Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
- p3.SetXYZ(mom[0],mom[1],mom[2]);
- Float_t pt = p3.Pt();
- Float_t phi = p3.Phi() ;
+ fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
+ Float_t pt = fTrackVector.Pt();
+ Float_t phi = fTrackVector.Phi() ;
if(phi < 0) phi+=TMath::TwoPi();
//jump out this event if near side associated particle pt larger than trigger
if(!nePl) return kTRUE; // Do the selection just with the tracks if no calorimeter is available.
- TLorentzVector lv;
for(Int_t ipr = 0;ipr < nePl->GetEntriesFast() ; ipr ++ )
{
AliVCluster * cluster = (AliVCluster *) (nePl->At(ipr)) ;
if(cluster->GetID() == pLeading->GetCaloLabel(0) || cluster->GetID() == pLeading->GetCaloLabel(1) ) continue ;
- cluster->GetMomentum(lv,GetVertex(0));
+ cluster->GetMomentum(fMomentum,GetVertex(0));
- Float_t pt = lv.Pt();
- Float_t phi = lv.Phi() ;
+ Float_t pt = fMomentum.Pt();
+ Float_t phi = fMomentum.Phi() ;
if(phi < 0) phi+=TMath::TwoPi();
if(IsTrackMatched(cluster,GetReader()->GetInputEvent())) continue ; // avoid charged clusters, already covered by tracks, or cluster merging with track.
Float_t eta = -100. ;
Float_t deltaPhi = -100. ;
- TVector3 p3;
- TLorentzVector photonMom ;
TObjArray * reftracks = 0x0;
Int_t nrefs = 0;
// In case of pi0/eta trigger, we may want to check their decay correlation,
// get their decay children
//
- TLorentzVector decayMom1;
- TLorentzVector decayMom2;
+
Bool_t decayFound = kFALSE;
if( fPi0Trigger )
{
- decayFound = GetDecayPhotonMomentum(aodParticle,decayMom1, decayMom2);
+ decayFound = GetDecayPhotonMomentum(aodParticle->GetCaloLabel(0),aodParticle->GetCaloLabel(1),aodParticle->GetDetectorTag());
if(decayFound)
{
- fhPtPi0DecayRatio->Fill(ptTrig, decayMom1.Pt()/ptTrig);
- fhPtPi0DecayRatio->Fill(ptTrig, decayMom2.Pt()/ptTrig);
+ fhPtPi0DecayRatio->Fill(ptTrig, fDecayMom1.Pt()/ptTrig);
+ fhPtPi0DecayRatio->Fill(ptTrig, fDecayMom2.Pt()/ptTrig);
}
}
{
AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
- Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
- p3.SetXYZ(mom[0],mom[1],mom[2]);
- pt = p3.Pt();
- eta = p3.Eta();
- phi = p3.Phi() ;
+ fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
+ pt = fTrackVector.Pt();
+ eta = fTrackVector.Eta();
+ phi = fTrackVector.Phi() ;
if(phi < 0) phi+=TMath::TwoPi();
//Select only hadrons in pt range
//
if(fPi0Trigger && decayFound)
- FillDecayPhotonCorrelationHistograms(pt, phi, decayMom1,decayMom2, kTRUE) ;
+ FillDecayPhotonCorrelationHistograms(pt, phi, kTRUE) ;
//
// Add track reference to array
if(neutralMix && fCheckLeadingWithNeutralClusters && bgCalo)
{
Int_t nClusters=bgCalo->GetEntriesFast();
- TLorentzVector mom ;
for(Int_t jlead = 0;jlead <nClusters; jlead++ )
{
AliAODPWG4Particle *cluster= (AliAODPWG4Particle*) bgCalo->At(jlead) ;
Float_t etaTrig = aodParticle->Eta();
Float_t deltaPhi= -100. ;
Float_t deltaEta= -100. ;
-
- TLorentzVector photonMom ;
// In case of pi0/eta trigger, we may want to check their decay correlation,
// get their decay children
- TLorentzVector decayMom1;
- TLorentzVector decayMom2;
+
Bool_t decayFound = kFALSE;
- if(fPi0Trigger) decayFound = GetDecayPhotonMomentum(aodParticle,decayMom1, decayMom2);
+ if(fPi0Trigger) decayFound = GetDecayPhotonMomentum(aodParticle->GetCaloLabel(0),aodParticle->GetCaloLabel(1),aodParticle->GetDetectorTag());
TObjArray * refpi0 = 0x0;
Int_t nrefs = 0;
// Decay photon correlations
//
if(fPi0Trigger && decayFound)
- FillDecayPhotonCorrelationHistograms(pt, phi, decayMom1,decayMom2,kFALSE) ;
+ FillDecayPhotonCorrelationHistograms(pt, phi, kFALSE) ;
if(fFillAODWithReferences)
{
for (iParticle = 0 ; iParticle < nTracks ; iParticle++)
{
TParticle * particle = stack->Particle(iParticle);
- TLorentzVector momentum;
//keep only final state particles
if( particle->GetStatusCode() != 1 ) continue ;
Int_t charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
if(charge == 0) continue;
- particle->Momentum(momentum);
+ particle->Momentum(fMomentum);
//Particles in CTS acceptance, make sure to use the same selection as in the reader
- Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(momentum.Eta(),momentum.Phi(),kCTS);
- //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,momentum.Pt(),momentum.Eta(),momentum.Phi()*TMath::RadToDeg());
+ Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),kCTS);
+ //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,fMomentum.Pt(),fMomentum.Eta(),fMomentum.Phi()*TMath::RadToDeg());
if( !inCTS ) continue;
// Remove conversions
if ( part->Charge() == 0 ) continue;
- TLorentzVector momentum(part->Px(),part->Py(),part->Pz(),part->E());
+ fMomentum.SetPxPyPzE(part->Px(),part->Py(),part->Pz(),part->E());
//Particles in CTS acceptance, make sure to use the same selection as in the reader
- Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(momentum.Eta(),momentum.Phi(),kCTS);
- //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,momentum.Pt(),momentum.Eta(),momentum.Phi()*TMath::RadToDeg());
+ Bool_t inCTS = GetReader()->GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),kCTS);
+ //printf("Accepted? %d; pt %2.2f, eta %2.2f, phi %2.2f\n",inCTS,fMomentum.Pt(),fMomentum.Eta(),fMomentum.Phi()*TMath::RadToDeg());
if( !inCTS ) continue;
// Remove conversions