Added PID task, some fixes for coding conventions
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnaESDSpectraQA.cxx
index 11813a2e3360905a4732f488671acdb6f74e9f0f..ffafff5c6e5f799064f50cc5a318c4da6004a2ae 100644 (file)
@@ -53,6 +53,7 @@ AliAnaESDSpectraQA::AliAnaESDSpectraQA(): AliAnalysisTask("AliAnaESDSpectraQA",
 AliAnaESDSpectraQA::AliAnaESDSpectraQA(const char *name): 
   AliAnalysisTask(name, ""), 
   fESD(0),
 AliAnaESDSpectraQA::AliAnaESDSpectraQA(const char *name): 
   AliAnalysisTask(name, ""), 
   fESD(0),
+  fTrackCuts(new AliESDtrackCuts),
   fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
   fPtAll(0),  //
   fPtSel(0),  // 
   fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
   fPtAll(0),  //
   fPtSel(0),  // 
@@ -62,7 +63,7 @@ AliAnaESDSpectraQA::AliAnaESDSpectraQA(const char *name):
   // Output slot #0 writes into a TList
   DefineOutput(0, TList::Class());
   InitHistPointers();
   // Output slot #0 writes into a TList
   DefineOutput(0, TList::Class());
   InitHistPointers();
-  fTrackCuts = new AliESDtrackCuts;
+  //fTrackCuts = new AliESDtrackCuts;
   fTrackCuts->SetAcceptKingDaughters(kFALSE);
   fTrackCuts->SetRequireTPCRefit(kTRUE);
   fTrackCuts->SetEtaRange(-1,1);
   fTrackCuts->SetAcceptKingDaughters(kFALSE);
   fTrackCuts->SetRequireTPCRefit(kTRUE);
   fTrackCuts->SetEtaRange(-1,1);
@@ -175,14 +176,14 @@ void AliAnaESDSpectraQA::Exec(Option_t *) {
   Int_t nTracks = fESD->GetNumberOfTracks();
   AliDebug(2,Form("nTracks %d", nTracks));
   printf("nTracks %d\n", nTracks);
   Int_t nTracks = fESD->GetNumberOfTracks();
   AliDebug(2,Form("nTracks %d", nTracks));
   printf("nTracks %d\n", nTracks);
-  static Int_t Mult = 0;
-  Mult = 0;   // Need extra init bc of static
+  static Int_t fMult = 0;
+  fMult = 0;   // Need extra init bc of static
   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
     AliESDtrack *track = fESD->GetTrack(iTrack);
     hists *curTypeHists = 0;
 
     if (fTrackCuts->AcceptTrack(track)) {
   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
     AliESDtrack *track = fESD->GetTrack(iTrack);
     hists *curTypeHists = 0;
 
     if (fTrackCuts->AcceptTrack(track)) {
-      Mult++;
+      fMult++;
 
       Float_t dca2D, dcaZ;
       track->GetImpactParameters(dca2D,dcaZ);
 
       Float_t dca2D, dcaZ;
       track->GetImpactParameters(dca2D,dcaZ);
@@ -219,7 +220,9 @@ void AliAnaESDSpectraQA::Exec(Option_t *) {
       curTypeHists->PhiPtNPointTPC->Fill(phi,pt,track->GetTPCNcls());
       curTypeHists->PhiPtNPointITS->Fill(phi,pt,nPointITS);
       curTypeHists->PhiPtChisqC->Fill(phi,pt,chisqC);
       curTypeHists->PhiPtNPointTPC->Fill(phi,pt,track->GetTPCNcls());
       curTypeHists->PhiPtNPointITS->Fill(phi,pt,nPointITS);
       curTypeHists->PhiPtChisqC->Fill(phi,pt,chisqC);
-      curTypeHists->PhiPtChisqTPC->Fill(phi,pt,track->GetTPCchi2()/(track->GetTPCNclsF()-5));
+      if(track->GetTPCNclsF()>5){
+       curTypeHists->PhiPtChisqTPC->Fill(phi,pt,track->GetTPCchi2()/(track->GetTPCNclsF()-5));
+      }      
       curTypeHists->PhiPtDCAR->Fill(phi,pt,dca2D);
       curTypeHists->PhiPtDCAZ->Fill(phi,pt,dcaZ);
       curTypeHists->PhiPtSigmaToVertex->Fill(phi,pt,sigToVertex);
       curTypeHists->PhiPtDCAR->Fill(phi,pt,dca2D);
       curTypeHists->PhiPtDCAZ->Fill(phi,pt,dcaZ);
       curTypeHists->PhiPtSigmaToVertex->Fill(phi,pt,sigToVertex);