// few checks
if ((stack->IsPhysicalPrimary(iPart)) || (!fGeoUt->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())))
{//Marcelo - ...isn't this redundant?
- if (pdgMom)
- fHistElectronFirstMother->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistElectronFirstMother->Fill(pdgMom->PdgCode());
+ }
fHistElectronFirstMotherXY->Fill(part->Vx(),part->Vy());
fHistElectronNDaughters->Fill(nPartDaughters);
//if (IsInAcceptance(part,pdg,extParam))
if (IsInAcceptance(aliPart))
{//Marcelo - should all three of the lines below be in the if statement?
- if (pdgMom) fHistElectronFirstMotherAcc->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistElectronFirstMotherAcc->Fill(pdgMom->PdgCode());
+ }
fHistElectronFirstMotherXYAcc->Fill(part->Vx(),part->Vy());
fHistElectronNDaughtersAcc->Fill(nPartDaughters);
// few checks
if ((stack->IsPhysicalPrimary(iPart)) || (!fGeoUt->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())))
{
- if (pdgMom)
- fHistGammaFirstMother->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistGammaFirstMother->Fill(pdgMom->PdgCode());
+ }
fHistGammaFirstMotherXY->Fill(part->Vx(),part->Vy());
fHistGammaNDaughters->Fill(nPartDaughters);
//if (IsInAcceptance(part,pdg))
if (IsInAcceptance(aliPart))
{
- if (pdgMom)//Marcelo - again, should this be all three?
- fHistGammaFirstMotherAcc->Fill(pdgMom->PdgCode());
+ if (pdgMom) {//Marcelo - again, should this be all three?
+ fHistGammaFirstMotherAcc->Fill(pdgMom->PdgCode());
+ }
fHistGammaFirstMotherXYAcc->Fill(part->Vx(),part->Vy());
fHistGammaNDaughtersAcc->Fill(nPartDaughters);
}
// few checks
- if(pdgMom) fHistNPPElectronFirstMother->Fill(pdgMom->PdgCode());
+ if(pdgMom) { fHistNPPElectronFirstMother->Fill(pdgMom->PdgCode()); }
fHistNPPElectronFirstMotherXY->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughters->Fill(nPartDaughters);
//if (IsInAcceptance(part,pdg,extParam))
if (IsInAcceptance(aliPart))
{
- if(pdgMom) fHistNPPElectronFirstMotherAcc->Fill(pdgMom->PdgCode());
+ if(pdgMom) { fHistNPPElectronFirstMotherAcc->Fill(pdgMom->PdgCode()); }
fHistNPPElectronFirstMotherXYAcc->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughtersAcc->Fill(nPartDaughters);
}
// few checks
- if (pdgMom)
- fHistNPPGammaFirstMother->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistNPPGammaFirstMother->Fill(pdgMom->PdgCode());
+ }
fHistNPPGammaFirstMotherXY->Fill(part->Vx(),part->Vy());
fHistNPPGammaNDaughters->Fill(nPartDaughters);
//if (IsInAcceptance(part,pdg))
if (IsInAcceptance(aliPart))
{
- fHistNPPGammaFirstMotherAcc->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistNPPGammaFirstMotherAcc->Fill(pdgMom->PdgCode());
+ }
fHistNPPGammaFirstMotherXYAcc->Fill(part->Vx(),part->Vy());
fHistNPPGammaNDaughtersAcc->Fill(nPartDaughters);
}
// few checks
- if (pdgMom)
- fHistGammaFirstMotherRec->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistGammaFirstMotherRec->Fill(pdgMom->PdgCode());
+ }
fHistGammaFirstMotherXYRec->Fill(part->Vx(),part->Vy());
fHistGammaNDaughtersRec->Fill(nPartDaughters);
}
// few checks
- if (pdgMom)
- fHistElectronFirstMotherRec->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistElectronFirstMotherRec->Fill(pdgMom->PdgCode());
+ }
fHistElectronFirstMotherXYRec->Fill(part->Vx(),part->Vy());
fHistElectronNDaughtersRec->Fill(nPartDaughters);
fNPPElectronRectotET += et;
// few checks
- if(pdgMom) fHistNPPElectronFirstMotherRec->Fill(pdgMom->PdgCode());
+ if(pdgMom) { fHistNPPElectronFirstMotherRec->Fill(pdgMom->PdgCode()); }
fHistNPPElectronFirstMotherXYRec->Fill(part->Vx(),part->Vy());
fHistNPPElectronNDaughtersRec->Fill(nPartDaughters);
}
// few checks
- if (pdgMom)
- fHistNPPGammaFirstMotherRec->Fill(pdgMom->PdgCode());
+ if (pdgMom) {
+ fHistNPPGammaFirstMotherRec->Fill(pdgMom->PdgCode());
+ }
fHistNPPGammaFirstMotherXYRec->Fill(part->Vx(),part->Vy());
fHistNPPGammaNDaughtersRec->Fill(nPartDaughters);
UInt_t AliAnalysisEtSelectorPhos::GetLabel(const AliESDCaloCluster *cluster, AliStack *stack){
//Finds primary and estimates if it unique one?
Int_t n=cluster->GetNLabels() ;
- Double_t* Ekin= new Double_t[n] ;
- for(Int_t i=0; i<n; i++){
- TParticle* p= stack->Particle(cluster->GetLabelAt(i)) ;
- Ekin[i]=p->P() ; // estimate of kinetic energy
- if(p->GetPdgCode()==-2212 || p->GetPdgCode()==-2112){
- Ekin[i]+=1.8 ; //due to annihilation
- }
- }
Int_t iMax=0;
- Double_t eMax=0.;//eSubMax=0. ;
- for(Int_t i=0; i<n; i++){
- if(Ekin[i]>eMax){
- // eSubMax=eMax;
- eMax=Ekin[i];
- iMax=i;
+
+ if (n > 0) {
+ Double_t* Ekin= new Double_t[n] ;
+ for(Int_t i=0; i<n; i++){
+ TParticle* p= stack->Particle(cluster->GetLabelAt(i)) ;
+ Ekin[i]=p->P() ; // estimate of kinetic energy
+ if(p->GetPdgCode()==-2212 || p->GetPdgCode()==-2112){
+ Ekin[i]+=1.8 ; //due to annihilation
+ }
+ }
+ Double_t eMax=0.;//eSubMax=0. ;
+ for(Int_t i=0; i<n; i++){
+ if(Ekin[i]>eMax){
+ // eSubMax=eMax;
+ eMax=Ekin[i];
+ iMax=i;
+ }
}
- }
// if(eSubMax>0.8*eMax)//not obvious primary
// sure=kFALSE;
// else
// sure=kTRUE;
- delete Ekin;
- return cluster->GetLabelAt(iMax) ;
+ delete Ekin;
+
+ } // n>0
+ return cluster->GetLabelAt(iMax) ; // DS: should this line be inside n>0 check, and return another value if n<=0 ?
}