added a rough definition of centrality also for pp using TPC tracks
authorfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2013 15:03:39 +0000 (15:03 +0000)
committerfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2013 15:03:39 +0000 (15:03 +0000)
PWGPP/pid/AliAnalysisTaskK0sBayes.cxx
PWGPP/pid/AliAnalysisTaskLambdaBayes.cxx
PWGPP/pid/AliAnalysisTaskPhiBayes.cxx

index 4beba7c..898b917 100644 (file)
@@ -420,6 +420,11 @@ void AliAnalysisTaskK0sBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
+      if(!fTypeCol){
+       v0Centr=100./(fOutputAOD->GetNumberOfTracks()/12.+1);
+       trkCentr=v0Centr;
+      }
+
       if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
@@ -501,11 +506,6 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
   AliPIDResponse *PIDResponse=inputHandler->GetPIDResponse();
 
-  PIDResponse->GetTOFResponse().SetTrackParameter(0,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(1,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(2,0.018);
-  PIDResponse->GetTOFResponse().SetTrackParameter(3,50.0);
-
   fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
 
   Double_t probP[10] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
@@ -606,15 +606,7 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
     Double_t oldpP[10];
     fPIDCombined->GetPriors(KpTrack, oldpP, PIDResponse, detUsedP);
 
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon);
-    fKaTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton);
-    fPrTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron);
-    fElTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-
     nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion);
-    fPiTPC[icentr]->Fill(fPtKp,nSigmaTPC);
 
     if(! (TMath::Abs(nSigmaTPC) < 5)) continue;
 
@@ -643,15 +635,17 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
        if(probP[2] > probP[3] && probP[2] > probP[4] && probP[2] > probP[0]) fPidKp += 128; // max prob
        
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kProton);
-       fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton))<1) fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fPrTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kElectron);
-       fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
-       
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron))<1) fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fElTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kKaon);
-       fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
-       
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon))<1) fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fKaTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kPion);
-       fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion))<1) fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fPiTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion));
                        
        if(fIsMC){
          Float_t mismAdd = addMismatchForMC;
index 4cb7f0c..2366c3c 100644 (file)
@@ -422,6 +422,11 @@ void AliAnalysisTaskLambdaBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
+      if(!fTypeCol){
+        v0Centr=100./(fOutputAOD->GetNumberOfTracks()/12.+1);
+        trkCentr=v0Centr;
+      }
+
       if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
@@ -503,10 +508,10 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
   AliPIDResponse *PIDResponse=inputHandler->GetPIDResponse();
 
-  PIDResponse->GetTOFResponse().SetTrackParameter(0,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(1,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(2,0.018);
-  PIDResponse->GetTOFResponse().SetTrackParameter(3,50.0);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(0,0.);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(1,0.);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(2,0.018);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(3,50.0);
 
   fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
 
@@ -612,14 +617,7 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
     fPIDCombined->GetPriors(KpTrack, oldpP, PIDResponse, detUsedP);
 
     
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon);
-    if(isLambda)fKaTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron);
-    if(isLambda) fElTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion);
-    if(isLambda)fPiTPC[icentr]->Fill(fPtKp,nSigmaTPC);
     nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton);
-    if(isLambda) fPrTPC[icentr]->Fill(fPtKp,nSigmaTPC);
 
     if(! (TMath::Abs(nSigmaTPC) < 5)) continue;
 
@@ -646,14 +644,22 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
       else{
        if(probP[4] > probP[3] && probP[4] > probP[2] && probP[4] > probP[0]) fPidKp += 128; // max prob
        
-       nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kElectron);
-       if(isLambda) fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
-       nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kKaon);
-       if(isLambda) fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
-       nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kPion);
-       if(isLambda) fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(isLambda){
+         nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kElectron);
+         if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron))<1) fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+         if(TMath::Abs(nSigmaTOF)<1) fElTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron));
+         nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kPion);
+         if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion))<1) fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+         if(TMath::Abs(nSigmaTOF)<1) fPiTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion));
+         nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kKaon);
+         if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon))<1) fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+         if(TMath::Abs(nSigmaTOF)<1) fKaTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon));
+       }
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kProton);
-       if(isLambda) fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(isLambda){
+         if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton))<1) fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+         if(TMath::Abs(nSigmaTOF)<1) fPrTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton));
+       }
        
        if(fIsMC){
          Float_t mismAdd = addMismatchForMC;
index 1d39192..6224755 100644 (file)
@@ -394,6 +394,11 @@ void AliAnalysisTaskPhiBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
+      if(!fTypeCol){
+       v0Centr=100./(fOutputAOD->GetNumberOfTracks()/12.+1);
+       trkCentr=v0Centr;
+      }
+
       if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
@@ -474,10 +479,10 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
   AliPIDResponse *PIDResponse=inputHandler->GetPIDResponse();
 
-  PIDResponse->GetTOFResponse().SetTrackParameter(0,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(1,0.);
-  PIDResponse->GetTOFResponse().SetTrackParameter(2,0.018);
-  PIDResponse->GetTOFResponse().SetTrackParameter(3,50.0);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(0,0.);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(1,0.);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(2,0.018);
+//   PIDResponse->GetTOFResponse().SetTrackParameter(3,50.0);
 
   fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
 
@@ -579,14 +584,7 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
     Double_t oldpP[10];
     fPIDCombined->GetPriors(KpTrack, oldpP, PIDResponse, detUsedP);
 
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton);
-    fPrTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron);
-    fElTPC[icentr]->Fill(fPtKp,nSigmaTPC);
-    nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion);
-    fPiTPC[icentr]->Fill(fPtKp,nSigmaTPC);
     nSigmaTPC = PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon);
-    fKaTPC[icentr]->Fill(fPtKp,nSigmaTPC);
 
     if(! (TMath::Abs(nSigmaTPC) < 5)) continue;
 
@@ -614,14 +612,18 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
        if(probP[3] > probP[2] && probP[3] > probP[4] && probP[3] > probP[0]) fPidKp += 128; // max prob
        
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kProton);
-       fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton))<1) fPrTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fPrTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kProton));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kElectron);
-       fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron))<1) fElTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fElTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kElectron));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kPion);
-       fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion))<1) fPiTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fPiTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kPion));
        nSigmaTOF = PIDResponse->NumberOfSigmasTOF(KpTrack,AliPID::kKaon);
-       fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
-               
+       if(TMath::Abs(PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon))<1) fKaTOF[icentr]->Fill(fPtKp,nSigmaTOF);
+       if(TMath::Abs(nSigmaTOF)<1) fKaTPC[icentr]->Fill(fPtKp,PIDResponse->NumberOfSigmasTPC(KpTrack,AliPID::kKaon));
+       
        if(fIsMC){
          Float_t mismAdd = addMismatchForMC;
          if(KpTrack->Pt() < 1) mismAdd = addMismatchForMC/KpTrack->Pt();