- AliPHOSRecParticle * RecParticle ;
- Int_t iRecParticle ;
- for(iRecParticle = 0; iRecParticle < (*RecParticleList)->GetEntries() ;iRecParticle++ )
- {
- RecParticle = (AliPHOSRecParticle *) (*RecParticleList)->At(iRecParticle) ;
- fhAllRP->Fill(CorrectEnergy(RecParticle->Energy())) ;
-
- Int_t ModuleNumberRec ;
- Double_t RecX, RecZ ;
- fGeom->ImpactOnEmc(RecParticle->Theta(), RecParticle->Phi(), ModuleNumberRec, RecX, RecZ) ;
-
- Double_t MinDistance = 2. ;
- Int_t ClosestPrimary = -1 ;
-
- Int_t numberofprimaries ;
- Int_t * listofprimaries = RecParticle->GetPrimaries(numberofprimaries) ;
- Int_t index ;
- TParticle * Primary ;
- Double_t Distance = MinDistance ;
- for ( index = 0 ; index < numberofprimaries ; index++){
- Primary = (TParticle*)PrimaryList->UncheckedAt(listofprimaries[index]) ;
- Int_t ModuleNumber ;
- Double_t PrimX, PrimZ ;
- fGeom->ImpactOnEmc(Primary->Theta(), Primary->Phi(), ModuleNumber, PrimX, PrimZ) ;
- if(ModuleNumberRec == ModuleNumber)
- Distance = TMath::Sqrt((RecX-PrimX)*(RecX-PrimX)+(RecZ-PrimZ)*(RecZ-PrimZ) ) ;
- if(MinDistance > Distance)
- {
- MinDistance = Distance ;
- ClosestPrimary = listofprimaries[index] ;
- }
- }
- TotalRecPart++ ;
-
- if(ClosestPrimary >=0 ){
- TotalRPwithPrim++;
-
- Int_t PrimaryType = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPdgCode() ;
-// TParticlePDG* PDGparticle = ((TParticle *)PrimaryList->At(ClosestPrimary))->GetPDG();
-// Double_t charge = PDGparticle->Charge() ;
-// if(charge)
-// cout <<"Primary " <<PrimaryType << " E " << ((TParticle *)PrimaryList->At(ClosestPrimary))->Energy() << endl ;
- Int_t PrimaryCode ;
- switch(PrimaryType)
- {
- case 22:
- PrimaryCode = 0; //Photon
- fhAllEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy()) ;
- fhAllPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
- break;
- case 11 :
- PrimaryCode = 1; //Electron
- break;
- case -11 :
- PrimaryCode = 1; //positron
- break;
- case 321 :
- PrimaryCode = 4; //K+
- break;
- case -321 :
- PrimaryCode = 4; //K-
- break;
- case 310 :
- PrimaryCode = 4; //K0s
- break;
- case 130 :
- PrimaryCode = 4; //K0l
- break;
- case 211 :
- PrimaryCode = 2; //K0l
- break;
- case -211 :
- PrimaryCode = 2; //K0l
- break;
- case 2212 :
- PrimaryCode = 2; //K0l
- break;
- case -2212 :
- PrimaryCode = 2; //K0l
- break;
- default:
- PrimaryCode = 3; //ELSE
- break;
- }
-
- switch(RecParticle->GetType())
- {
- case AliPHOSFastRecParticle::kGAMMA:
- if(PrimaryType == 22){
- fhPhotEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
- fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
- fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
-
- fhPhotPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
- fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
- fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
-
- fhPhotReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- fhPhotPhot->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
- if(PrimaryType == 2112){ //neutron
- fhNReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- if(PrimaryType == -2112){ //neutron ~
- fhNBarReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- }
- if(PrimaryCode == 2){
- fhChargedReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- fhAllReg->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- Counter[0][PrimaryCode]++;
- break;
- case AliPHOSFastRecParticle::kELECTRON:
- if(PrimaryType == 22){
- fhPhotElec->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhEMEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
- fhEMPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
- fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
- if(PrimaryType == 2112){ //neutron
- fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- if(PrimaryType == -2112){ //neutron ~
- fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- }
- if(PrimaryCode == 2){
- fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- Counter[1][PrimaryCode]++;
- break;
- case AliPHOSFastRecParticle::kNEUTRALHA:
- if(PrimaryType == 22)
- fhPhotNeuH->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- Counter[2][PrimaryCode]++;
- break ;
- case AliPHOSFastRecParticle::kNEUTRALEM:
- if(PrimaryType == 22){
- fhEMEnergy->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),RecParticle->Energy() ) ;
- fhEMPosition->Fill(((TParticle *)PrimaryList->At(ClosestPrimary))->Energy(),MinDistance ) ;
-
- fhPhotNuEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPhotEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
- if(PrimaryType == 2112) //neutron
- fhNEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- if(PrimaryType == -2112) //neutron ~
- fhNBarEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- if(PrimaryCode == 2)
- fhChargedEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- fhAllEM->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- Counter[3][PrimaryCode]++;
- break ;
- case AliPHOSFastRecParticle::kCHARGEDHA:
- if(PrimaryType == 22) //photon
- fhPhotChHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
-
- Counter[4][PrimaryCode]++ ;
- break ;
- case AliPHOSFastRecParticle::kGAMMAHA:
- if(PrimaryType == 22){ //photon
- fhPhotGaHa->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPPSDEnergy->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(), RecParticle->Energy() ) ;
- fhPPSDPosition->Fill(((TParticle *) PrimaryList->At(ClosestPrimary))->Energy(),MinDistance) ;
- fhPhotPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
- if(PrimaryType == 2112){ //neutron
- fhNPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- if(PrimaryType == -2112){ //neutron ~
- fhNBarPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
- if(PrimaryCode == 2){
- fhChargedPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- }
-
- fhAllPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhVeto->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- fhPPSD->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- Counter[5][PrimaryCode]++ ;
- break ;
- case AliPHOSFastRecParticle::kABSURDEM:
- Counter[6][PrimaryCode]++ ;
- fhShape->Fill(CorrectEnergy(RecParticle->Energy()) ) ;
- break;
- case AliPHOSFastRecParticle::kABSURDHA:
- Counter[7][PrimaryCode]++ ;
- break;
- default:
- Counter[8][PrimaryCode]++ ;
- break;
- }
- }
- }
- } // endfor
- SaveHistograms();
- cout << "Resolutions: Analyzed " << Nevents << " event(s)" << endl ;
- cout << "Resolutions: Total primary " << TotalPrimary << endl ;
- cout << "Resoluitons: Total reconstracted " << TotalRecPart << endl ;
- cout << "TotalReconstructed with Primarie " << TotalRPwithPrim << endl ;
- cout << " Primary: Photon Electron Ch. Hadr. Neutr. Hadr Kaons" << endl ;
- cout << " Detected as photon " << Counter[0][0] << " " << Counter[0][1] << " " << Counter[0][2] << " " <<Counter[0][3] << " " << Counter[0][4] << endl ;
- cout << " Detected as electron " << Counter[1][0] << " " << Counter[1][1] << " " << Counter[1][2] << " " <<Counter[1][3] << " " << Counter[1][4] << endl ;
- cout << " Detected as neutral hadron " << Counter[2][0] << " " << Counter[2][1] << " " << Counter[2][2] << " " <<Counter[2][3] << " " << Counter[2][4] << endl ;
- cout << " Detected as neutral EM " << Counter[3][0] << " " << Counter[3][1] << " " << Counter[3][2] << " " <<Counter[3][3] << " " << Counter[3][4] << endl ;
- cout << " Detected as charged hadron " << Counter[4][0] << " " << Counter[4][1] << " " << Counter[4][2] << " " <<Counter[4][3] << " " << Counter[4][4] << endl ;
- cout << " Detected as gamma-hadron " << Counter[5][0] << " " << Counter[5][1] << " " << Counter[5][2] << " " <<Counter[5][3] << " " << Counter[5][4] << endl ;
- cout << " Detected as Absurd EM " << Counter[6][0] << " " << Counter[6][1] << " " << Counter[6][2] << " " <<Counter[6][3] << " " << Counter[6][4] << endl ;
- cout << " Detected as absurd hadron " << Counter[7][0] << " " << Counter[7][1] << " " << Counter[7][2] << " " <<Counter[7][3] << " " << Counter[7][4] << endl ;
- cout << " Detected as undefined " << Counter[8][0] << " " << Counter[8][1] << " " << Counter[8][2] << " " <<Counter[8][3] << " " << Counter[8][4] << endl ;