- Int_t primaryCode = -1;
- const TParticle * primary = gime->Primary(closestPrimary) ;
- Int_t primaryType = primary->GetPdgCode() ;
- if(primaryType == 22) // photon ?
- primaryCode = 0 ;
- else
- if(primaryType == 2112) // neutron
- primaryCode = 1 ;
- else
- if(primaryType == -2112) // Anti neutron
- primaryCode = 2 ;
- else
- if(primaryType == -2122) //Anti proton
- primaryCode = 4 ;
- else {
- TParticle tempo(*primary) ;
- if(tempo.GetPDG()->Charge())
- primaryCode = 3 ;
- }
-
- //==========Now look at the type of RecParticle
- Float_t energy = CorrectedEnergy(recParticle->Energy()) ;
- if(recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST){
- hPhot->Fill(energy ) ;
- switch(primaryCode){
- case 0:
- hPhotReg->Fill(energy ) ;
- break ;
- case 1:
- hNReg->Fill(energy ) ;
- break ;
- case 2:
- hNBarReg->Fill(energy ) ;
- break ;
- case 3:
- hChargedReg->Fill(energy ) ;
- break ;
- case 4:
- hPbarReg->Fill(energy ) ;
- break ;
- default:
- break ;
- }
- }
- if((recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST)||
- (recParticle->GetType() == AliPHOSFastRecParticle::kCHARGEDEMFAST)||
- (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMSLOW)||
- (recParticle->GetType() == AliPHOSFastRecParticle::kCHARGEDEMSLOW) ){ //with EM shower
- hShape->Fill(energy ) ;
- switch(primaryCode){
- case 0:
- hPhotEM->Fill(energy ) ;
- break ;
- case 1:
- hNEM->Fill(energy ) ;
- break ;
- case 2:
- hNBarEM->Fill(energy ) ;
- break ;
- case 3:
- hChargedEM->Fill(energy ) ;
- break ;
- case 4:
- hPbarEM->Fill(energy ) ;
- break ;
- default:
- break ;
- }
- }
-
- if((recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST)||
- (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALHAFAST) ||
- (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMSLOW) ||
- (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALHASLOW) ) //nuetral
- hVeto->Fill(energy ) ;
-
- //fill number of primaries identified as ...
- if(primaryCode >= 0) // Primary code defined
- counter[recParticle->GetType()][primaryCode]++ ;
-
+ Int_t primaryCode = -1;
+ const TParticle * primary = fRunLoader->Stack()->Particle(closestPrimary) ;
+ Int_t primaryType = primary->GetPdgCode() ;
+ if(primaryType == 22) // photon ?
+ primaryCode = 0 ;
+ else
+ if(primaryType == 2112) // neutron
+ primaryCode = 1 ;
+ else
+ if(primaryType == -2112) // Anti neutron
+ primaryCode = 2 ;
+ else
+ if(primaryType == -2122) //Anti proton
+ primaryCode = 4 ;
+ else {
+ TParticle tempo(*primary) ;
+ if(tempo.GetPDG()->Charge())
+ primaryCode = 3 ;
+ }
+
+ //==========Now look at the type of RecParticle
+ Float_t energy = CorrectedEnergy(recParticle->Energy()) ;
+ if(recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST){
+ hPhot->Fill(energy ) ;
+ switch(primaryCode){
+ case 0:
+ hPhotReg->Fill(energy ) ;
+ break ;
+ case 1:
+ hNReg->Fill(energy ) ;
+ break ;
+ case 2:
+ hNBarReg->Fill(energy ) ;
+ break ;
+ case 3:
+ hChargedReg->Fill(energy ) ;
+ break ;
+ case 4:
+ hPbarReg->Fill(energy ) ;
+ break ;
+ default:
+ break ;
+ }
+ }
+ if((recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST)||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kCHARGEDEMFAST)||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMSLOW)||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kCHARGEDEMSLOW) ){ //with EM shower
+ hShape->Fill(energy ) ;
+ switch(primaryCode){
+ case 0:
+ hPhotEM->Fill(energy ) ;
+ break ;
+ case 1:
+ hNEM->Fill(energy ) ;
+ break ;
+ case 2:
+ hNBarEM->Fill(energy ) ;
+ break ;
+ case 3:
+ hChargedEM->Fill(energy ) ;
+ break ;
+ case 4:
+ hPbarEM->Fill(energy ) ;
+ break ;
+ default:
+ break ;
+ }
+ }
+
+ if((recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMFAST)||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALHAFAST) ||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALEMSLOW) ||
+ (recParticle->GetType() == AliPHOSFastRecParticle::kNEUTRALHASLOW) ) //nuetral
+ hVeto->Fill(energy ) ;
+
+ //fill number of primaries identified as ...
+ if(primaryCode >= 0) // Primary code defined
+ counter[recParticle->GetType()][primaryCode]++ ;
+