]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/AliPWG4HighPtTrackQA.cxx
New start time: Fri, 20 Jun 2014 12:03:00 (GMT)
[u/mrichter/AliRoot.git] / PWGJE / AliPWG4HighPtTrackQA.cxx
index 230999837e5ab1707ea2c22b2ba593bb4c7a3784..2a99def4b6e558487d8dfc660ff146ba9802adec 100644 (file)
@@ -63,6 +63,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fEvent(0x0),
   fESD(0x0),
   fVtx(0x0),
+  fVtxAOD(0x0),
   fTrackCuts(0x0), 
   fTrackCutsITSLoose(0x0), 
   fTrackCutsTPConly(0x0), 
@@ -96,6 +97,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fPtDCA2D(0x0),
   fPtDCAZ(0x0),
   fPtNClustersTPC(0x0),
+  fPtNClustersTPCPhi(0x0),
   fPtNClustersTPCIter1(0x0),
   fPtNClustersTPCIter1Phi(0x0),
   fPtNClustersTPCShared(0x0),
@@ -167,6 +169,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fEvent(0x0),
   fESD(0x0),
   fVtx(0x0),
+  fVtxAOD(0x0),
   fTrackCuts(0x0),
   fTrackCutsITSLoose(0x0), 
   fTrackCutsTPConly(0x0), 
@@ -200,6 +203,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fPtDCA2D(0x0),
   fPtDCAZ(0x0),
   fPtNClustersTPC(0x0),
+  fPtNClustersTPCPhi(0x0),
   fPtNClustersTPCIter1(0x0),
   fPtNClustersTPCIter1Phi(0x0),
   fPtNClustersTPCShared(0x0),
@@ -272,7 +276,8 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::SetPtBinEdges(Int_t region, Double_t ptmax, Double_t ptBinWidth) {
+void AliPWG4HighPtTrackQA::SetPtBinEdges(Int_t region, Double_t ptmax, Double_t ptBinWidth)
+{
   //
   // Set variable bin sizes for pT axis in histos
   //
@@ -289,7 +294,8 @@ void AliPWG4HighPtTrackQA::SetPtBinEdges(Int_t region, Double_t ptmax, Double_t
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
+void AliPWG4HighPtTrackQA::UserCreateOutputObjects()
+{
   //Create output objects
   AliDebug(2,Form(">> AliPWG4HighPtTrackQA::UserCreateOutputObjects \n"));
 
@@ -551,6 +557,9 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   fPtNClustersTPC = new TH2F("fPtNClustersTPC","fPtNClustersTPC",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
   fHistList->Add(fPtNClustersTPC);
 
+  fPtNClustersTPCPhi = new TH2F("fPtNClustersTPCPhi","fPtNClustersTPCPhi",fgkNPhiBins,binsPhi,fgkNNClustersTPCBins,binsNClustersTPC);
+  fHistList->Add(fPtNClustersTPCPhi);
+
   fPtNClustersTPCIter1 = new TH2F("fPtNClustersTPCIter1","fPtNClustersTPCIter1",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC);
   fHistList->Add(fPtNClustersTPCIter1);
 
@@ -725,7 +734,8 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
 }
 
 //________________________________________________________________________
-Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
+Bool_t AliPWG4HighPtTrackQA::SelectEvent()
+{
   //
   // Decide if event should be selected for analysis
   //
@@ -792,15 +802,15 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
     }
   }
   else if(fDataType==kAOD&&dynamic_cast<AliAODEvent*>(fEvent)) {
-    const AliAODVertex *vtx = ((AliAODEvent*)fEvent)->GetPrimaryVertexSPD();
-    if(!vtx) {
+    fVtxAOD = ((AliAODEvent*)fEvent)->GetPrimaryVertex();
+    if(!fVtxAOD) {
       fNEventReject->Fill("noVTX",1);
       selectEvent = kFALSE;
       return selectEvent;
     }
     
     // Need vertex cut
-    if(vtx->GetNContributors()<2) {
+    if(fVtxAOD->GetNContributors()<2) {
       fNEventReject->Fill("NCont<2",1);
       selectEvent = kFALSE;
       return selectEvent;
@@ -808,7 +818,7 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
     
     //Check if z-vertex < 10 cm
     double primVtx[3];
-    vtx->GetXYZ(primVtx);
+    fVtxAOD->GetXYZ(primVtx);
     if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
       fNEventReject->Fill("ZVTX>10",1);
       selectEvent = kFALSE;
@@ -849,7 +859,8 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliVEvent *ev){
+Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliVEvent *ev)
+{
   //
   // Get centrality from ESD or AOD
   //
@@ -863,7 +874,8 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliVEvent *ev){
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliESDEvent *esd){
+Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliESDEvent *esd)
+{
   //
   // Get centrality from ESD
   //
@@ -882,7 +894,8 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliESDEvent *esd){
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::CalculateCentrality(const AliAODEvent *aod){
+Int_t AliPWG4HighPtTrackQA::CalculateCentrality(const AliAODEvent *aod)
+{
   //
   // Get centrality from AOD
   //
@@ -896,7 +909,8 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(const AliAODEvent *aod){
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) const {
+Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) const
+{
   //
   // Get centrality class
   //
@@ -911,7 +925,8 @@ Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) const {
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::UserExec(Option_t *) {  
+void AliPWG4HighPtTrackQA::UserExec(Option_t *)
+{  
   // Main loop
   // Called for each event
   AliDebug(2,Form(">> AliPWG4HighPtTrackQA::UserExec \n"));
@@ -946,7 +961,8 @@ void AliPWG4HighPtTrackQA::UserExec(Option_t *) {
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::DoAnalysisESD() {
+void AliPWG4HighPtTrackQA::DoAnalysisESD()
+{
   //
   // Run analysis on ESD
   //
@@ -1227,7 +1243,8 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
+void AliPWG4HighPtTrackQA::DoAnalysisAOD()
+{
   //
   // Do QA on AOD input
   //
@@ -1254,14 +1271,29 @@ void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
     fVariables->SetAt(aodtrack->Pt(),0);
     fVariables->SetAt(aodtrack->Phi(),1);
     fVariables->SetAt(aodtrack->Eta(),2);
-    fVariables->SetAt(aodtrack->DCA(),3);
-    fVariables->SetAt(aodtrack->ZAtDCA(),4);
+
+    Double_t dca[2] = {0.,0.};
+    if(aodtrack->IsGlobalConstrained()) {
+      dca[0] = aodtrack->DCA();
+      dca[1] = aodtrack->ZAtDCA();
+    } else {
+      Double_t v[3]   = {0};
+      Double_t pos[3] = {0};
+      fVtxAOD->GetXYZ(v);
+      aodtrack->GetXYZ(pos);
+      dca[0] = pos[0] - v[0];
+      dca[1] = pos[1] - v[1];
+    }
+    fVariables->SetAt(dca[0],3);
+    fVariables->SetAt(dca[1],4);
     fVariables->SetAt((float)aodtrack->GetTPCNcls(),5);
     fVariables->SetAt((float)aodtrack->GetITSNcls(),6);
-    fVariables->SetAt(aodtrack->Chi2perNDF(),7);
+    fVariables->SetAt(0.,7); //ConstrainedChi2TPC -> not available in AOD
     fVariables->SetAt(0.,8);
     fVariables->SetAt(GetTrackLengthTPC(aodtrack),9);
-    fVariables->SetAt(aodtrack->Chi2perNDF(),10);
+    Float_t chi2pndf = aodtrack->Chi2perNDF();
+    //if(fVariables->At(5)>0.) chi2pndf = aodtrack->GetTPCchi2()/fVariables->At(5);
+    fVariables->SetAt(chi2pndf,10);
     fVariables->SetAt(GetTPCClusterInfo(aodtrack,2,1,0,159,kFALSE),11);
     Float_t crossedRowsTPCNClsF = 0.;
     if(aodtrack->GetTPCNclsF()>0.) crossedRowsTPCNClsF = fVariables->At(11)/aodtrack->GetTPCNclsF();
@@ -1306,7 +1338,8 @@ void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtTrackQA::FillHistograms() {
+void AliPWG4HighPtTrackQA::FillHistograms()
+{
   //
   // Fill all QA histograms
   //
@@ -1318,6 +1351,7 @@ void AliPWG4HighPtTrackQA::FillHistograms() {
   fPtDCA2D->Fill(fVariables->At(0),fVariables->At(3));
   fPtDCAZ->Fill(fVariables->At(0),fVariables->At(4));
   fPtNClustersTPC->Fill(fVariables->At(0),fVariables->At(5));
+  fPtNClustersTPCPhi->Fill(fVariables->At(1),fVariables->At(5));
   fPtNPointITS->Fill(fVariables->At(0),fVariables->At(6));
   fPtNPointITSPhi->Fill(fVariables->At(0),fVariables->At(6),fVariables->At(1));
   
@@ -1389,7 +1423,8 @@ void AliPWG4HighPtTrackQA::FillHistograms() {
 }
 
 //________________________________________________________________________
-Bool_t AliPWG4HighPtTrackQA::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials){
+Bool_t AliPWG4HighPtTrackQA::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials)
+{
   //
   // get the cross section and the trails either from pyxsec.root or from pysec_hists.root
   // This is to called in Notify and should provide the path to the AOD/ESD file
@@ -1452,6 +1487,7 @@ Bool_t AliPWG4HighPtTrackQA::PythiaInfoFromFile(const char* currFile,Float_t &fX
   }
   return kTRUE;
 }
+
 //________________________________________________________________________
 Bool_t AliPWG4HighPtTrackQA::Notify()
 {
@@ -1486,7 +1522,8 @@ Bool_t AliPWG4HighPtTrackQA::Notify()
 }
 
 //________________________________________________________________________
-AliGenPythiaEventHeader*  AliPWG4HighPtTrackQA::GetPythiaEventHeader(const AliMCEvent *mcEvent){
+AliGenPythiaEventHeader*  AliPWG4HighPtTrackQA::GetPythiaEventHeader(const AliMCEvent *mcEvent)
+{
   
   if(!mcEvent)return 0;
   AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
@@ -1635,7 +1672,8 @@ Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfoFitMap(const AliESDtrack *tr,Int_
 }
 
 //_______________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliESDtrack *track) const {
+Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliESDtrack *track) const 
+{
   //
   // returns distance between 1st and last hit in TPC
   // distance given in number of padrows
@@ -1658,7 +1696,8 @@ Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliESDtrack *track) const {
 }
 
 //_______________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliAODTrack *track) const {
+Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliAODTrack *track) const 
+{
   //
   // returns distance between 1st and last hit in TPC
   // distance given in number of padrows
@@ -1681,7 +1720,8 @@ Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliAODTrack *track) const {
 }
 
 //_______________________________________________________________________
-Float_t AliPWG4HighPtTrackQA::GetGoldenChi2(AliESDtrack *origtrack) {
+Float_t AliPWG4HighPtTrackQA::GetGoldenChi2(AliESDtrack *origtrack)
+{
   //
   // Return chi2 between global and TPC constrained track
   // track should be the global unconstrained track
@@ -1710,7 +1750,8 @@ Float_t AliPWG4HighPtTrackQA::GetGoldenChi2(AliESDtrack *origtrack) {
 }
 
 //_______________________________________________________________________
-Float_t AliPWG4HighPtTrackQA::GetGGCChi2(AliESDtrack *origtrack) {
+Float_t AliPWG4HighPtTrackQA::GetGGCChi2(AliESDtrack *origtrack)
+{
   //
   // Return chi2 between global and global constrained track
   // track should be the global unconstrained track