Update task for ITS tracking check and new macro for plots
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Dec 2009 17:09:44 +0000 (17:09 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Dec 2009 17:09:44 +0000 (17:09 +0000)
PWG1/ITS/AliAnalysisTaskITSTrackingCheck.cxx
PWG1/ITS/AliAnalysisTaskITSTrackingCheck.h
PWG1/macros/AddTaskPerformanceITS.C
PWG1/macros/PlotITSTrackingHists.C [new file with mode: 0644]

index a6f5e29..f125ca4 100644 (file)
@@ -45,7 +45,7 @@
 #include "AliESDInputHandler.h"
 #include "AliESDInputHandlerRP.h"
 #include "AliTrackPointArray.h"
-#include "AliITSRecPoint.h"
+#include "../ITS/AliITSRecPoint.h"
 
 #include "AliMCEventHandler.h"
 #include "AliMCEvent.h"
@@ -61,14 +61,16 @@ ClassImp(AliAnalysisTaskITSTrackingCheck)
 //________________________________________________________________________
 AliAnalysisTaskITSTrackingCheck::AliAnalysisTaskITSTrackingCheck(const char *name) : 
 AliAnalysisTask(name, "ITSTrackingCheckTask"), 
-fReadMC(kTRUE),
+fReadMC(kFALSE),
 fReadRPLabels(kFALSE),
+fFillNtuples(kFALSE),
 fESD(0), 
 fESDfriend(0),
 fOutput(0), 
 fHistNtracks(0),
 fHistNclsITSMI(0),
 fHistNclsITSSA(0),
+fHistNclsITSSAInAcc(0),
 fHistClusterMapITSMI(0),
 fHistClusterMapITSMIok(0),
 fHistClusterMapITSMIbad(0),
@@ -76,6 +78,7 @@ fHistClusterMapITSMIskipped(0),
 fHistClusterMapITSMIoutinz(0),
 fHistClusterMapITSMInorefit(0),
 fHistClusterMapITSMInocls(0),
+fHistClusterMapITSMIokoutinzbad(0),
 fHistClusterMapITSSA(0),
 fHistClusterMapITSSAok(0),
 fHistClusterMapITSSAbad(0),
@@ -83,6 +86,18 @@ fHistClusterMapITSSAskipped(0),
 fHistClusterMapITSSAoutinz(0),
 fHistClusterMapITSSAnorefit(0),
 fHistClusterMapITSSAnocls(0),
+fHistClusterMapITSSAokoutinzbad(0),
+fHistClusterMapITSSAInAcc(0),
+fHistClusterMapITSSAokInAcc(0),
+fHistClusterMapITSSAbadInAcc(0),
+fHistClusterMapITSSAskippedInAcc(0),
+fHistClusterMapITSSAoutinzInAcc(0),
+fHistClusterMapITSSAnorefitInAcc(0),
+fHistClusterMapITSSAnoclsInAcc(0),
+fHistClusterMapITSSAokoutinzbadInAcc(0),
+fHistClusterMapModuleITSSAokInAcc(0),
+fHistClusterMapModuleITSSAbadInAcc(0),
+fHistClusterMapModuleITSSAnoclsInAcc(0),
 fHistPhiTPC(0),
 fHistPtTPC(0),
 fHistPtITSMI2(0),
@@ -171,6 +186,11 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistNclsITSMI->SetMinimum(0);
   fOutput->Add(fHistNclsITSMI);
 
+  fHistNclsITSSAInAcc = new TH1F("fHistNclsITSSAInAcc", "N ITS clusters per track (SA); N clusters; Counts",7, -0.5, 6.5);
+  fHistNclsITSSAInAcc->Sumw2();
+  fHistNclsITSSAInAcc->SetMinimum(0);
+  fOutput->Add(fHistNclsITSSAInAcc);  
+
   fHistNclsITSSA = new TH1F("fHistNclsITSSA", "N ITS clusters per track (SA); N clusters; Counts",7, -0.5, 6.5);
   fHistNclsITSSA->Sumw2();
   fHistNclsITSSA->SetMinimum(0);
@@ -186,11 +206,25 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistClusterMapITSSA->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSSA);
 
+  fHistClusterMapITSSAInAcc = new TH1F("fHistClusterMapITSSAInAcc", "N tracks with point on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAInAcc->Sumw2();
+  fHistClusterMapITSSAInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAInAcc);
+
   fHistClusterMapITSMIok = new TH1F("fHistClusterMapITSMIok", "N tracks with ok on Layer (MI); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSMIok->Sumw2();
   fHistClusterMapITSMIok->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMIok);
   
+  fHistClusterMapITSSAokInAcc = new TH1F("fHistClusterMapITSSAokInAcc", "N tracks with ok on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAokInAcc->Sumw2();
+  fHistClusterMapITSSAokInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAokInAcc);
+
+  fHistClusterMapModuleITSSAokInAcc = new TH1F("fHistClusterMapModuleITSSAokInAcc", "N tracks with ok on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
+  fHistClusterMapModuleITSSAokInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapModuleITSSAokInAcc);
+
   fHistClusterMapITSSAok = new TH1F("fHistClusterMapITSSAok", "N tracks with ok on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAok->Sumw2();
   fHistClusterMapITSSAok->SetMinimum(0);
@@ -201,6 +235,15 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistClusterMapITSMIbad->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMIbad);
   
+  fHistClusterMapITSSAbadInAcc = new TH1F("fHistClusterMapITSSAbadInAcc", "N tracks with bad on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAbadInAcc->Sumw2();
+  fHistClusterMapITSSAbadInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAbadInAcc);
+
+  fHistClusterMapModuleITSSAbadInAcc = new TH1F("fHistClusterMapModuleITSSAbadInAcc", "N tracks with bad on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
+  fHistClusterMapModuleITSSAbadInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapModuleITSSAbadInAcc);
+
   fHistClusterMapITSSAbad = new TH1F("fHistClusterMapITSSAbad", "N tracks with bad on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAbad->Sumw2();
   fHistClusterMapITSSAbad->SetMinimum(0);
@@ -211,6 +254,11 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistClusterMapITSMIskipped->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMIskipped);
   
+  fHistClusterMapITSSAskippedInAcc = new TH1F("fHistClusterMapITSSAskippedInAcc", "N tracks with skip on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAskippedInAcc->Sumw2();
+  fHistClusterMapITSSAskippedInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAskippedInAcc);
+
   fHistClusterMapITSSAskipped = new TH1F("fHistClusterMapITSSAskipped", "N tracks with skip on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAskipped->Sumw2();
   fHistClusterMapITSSAskipped->SetMinimum(0);
@@ -221,16 +269,41 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistClusterMapITSMIoutinz->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMIoutinz);
   
+  fHistClusterMapITSSAoutinzInAcc = new TH1F("fHistClusterMapITSSAoutinzInAcc", "N tracks with out in z on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAoutinzInAcc->Sumw2();
+  fHistClusterMapITSSAoutinzInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAoutinzInAcc);
+
   fHistClusterMapITSSAoutinz = new TH1F("fHistClusterMapITSSAoutinz", "N tracks with out in z on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAoutinz->Sumw2();
   fHistClusterMapITSSAoutinz->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSSAoutinz);
 
+  fHistClusterMapITSSAokoutinzbad = new TH1F("fHistClusterMapITSSAokoutinzbad", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAokoutinzbad->Sumw2();
+  fHistClusterMapITSSAokoutinzbad->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAokoutinzbad);
+
+  fHistClusterMapITSMIokoutinzbad = new TH1F("fHistClusterMapITSMIokoutinzbad", "N tracks with cluster or bad zone or out in z (MI); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSMIokoutinzbad->Sumw2();
+  fHistClusterMapITSMIokoutinzbad->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSMIokoutinzbad);
+
+  fHistClusterMapITSSAokoutinzbadInAcc = new TH1F("fHistClusterMapITSSAokoutinzbadInAcc", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAokoutinzbadInAcc->Sumw2();
+  fHistClusterMapITSSAokoutinzbadInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAokoutinzbadInAcc);
+
   fHistClusterMapITSMInorefit = new TH1F("fHistClusterMapITSMInorefit", "N tracks with norefit on Layer (MI); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSMInorefit->Sumw2();
   fHistClusterMapITSMInorefit->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMInorefit);
   
+  fHistClusterMapITSSAnorefitInAcc = new TH1F("fHistClusterMapITSSAnorefitInAcc", "N tracks with norefit on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAnorefitInAcc->Sumw2();
+  fHistClusterMapITSSAnorefitInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAnorefitInAcc);
+
   fHistClusterMapITSSAnorefit = new TH1F("fHistClusterMapITSSAnorefit", "N tracks with norefit on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAnorefit->Sumw2();
   fHistClusterMapITSSAnorefit->SetMinimum(0);
@@ -241,6 +314,15 @@ void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects()
   fHistClusterMapITSMInocls->SetMinimum(0);
   fOutput->Add(fHistClusterMapITSMInocls);
   
+  fHistClusterMapITSSAnoclsInAcc = new TH1F("fHistClusterMapITSSAnoclsInAcc", "N tracks with nocls on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
+  fHistClusterMapITSSAnoclsInAcc->Sumw2();
+  fHistClusterMapITSSAnoclsInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapITSSAnoclsInAcc);
+  
+  fHistClusterMapModuleITSSAnoclsInAcc = new TH1F("fHistClusterMapModuleITSSAnoclsInAcc", "N tracks with nocls on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
+  fHistClusterMapModuleITSSAnoclsInAcc->SetMinimum(0);
+  fOutput->Add(fHistClusterMapModuleITSSAnoclsInAcc);
+
   fHistClusterMapITSSAnocls = new TH1F("fHistClusterMapITSSAnocls", "N tracks with nocls on Layer (SA); Layer; N tracks",6, -0.5, 5.5);
   fHistClusterMapITSSAnocls->Sumw2();
   fHistClusterMapITSSAnocls->SetMinimum(0);
@@ -312,11 +394,9 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
     Printf("ERROR: fESD not available");
     return;
   }
-
+  //if(fESD->GetEventType()!=7) return;
 
   const AliESDVertex *vertexESD = fESD->GetPrimaryVertexTracks();
-  if(!vertexESD) return;
-  if(!(vertexESD->GetStatus())) return;
 
   // ***********  MC info ***************
   TArrayF mcVertex(3);
@@ -383,7 +463,8 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
   if(!fESDfriend) printf("no ESD friend\n");
 
   //
-    
+  
+  /*  
   // **********  Trigger *****************
   ULong64_t triggerMask;
   ULong64_t spdFO = (1 << 14);
@@ -397,6 +478,7 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
   //triggerMask & spdFO && ((triggerMask&v0left) || (triggerMask&v0right))
   // ************ Trigger ******************
   if(!eventTriggered) return;
+  */
 
   // SPD vertex
   const AliESDVertex *spdv=fESD->GetPrimaryVertexSPD();
@@ -415,39 +497,27 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
   for(Int_t itr=0; itr<ntracks; itr++) {
     AliESDtrack *track = fESD->GetTrack(itr);
 
+    // remove kink daughters
     if(track->GetKinkIndex(0)>0) continue;
 
-    Int_t trkLabel = TMath::Abs(track->GetLabel());
-    Int_t nclsITS = track->GetNcls(0);
 
-    
     Bool_t itsrefit=kFALSE,tpcin=kFALSE,itsfindableAcc=kFALSE;
     if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE;
     if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE;
 
-    if(tpcin) {
-      fHistNclsITSMI->Fill(nclsITS);
-    } else {
-      fHistNclsITSSA->Fill(nclsITS);
-    }
 
-    // TPC track in ITS acceptance
-    if(tpcin && TMath::Abs(track->Eta())<0.9 && track->GetNcls(1)>50) {
-      itsfindableAcc=kTRUE;
-      fHistPtTPC->Fill(track->Pt());  
-      fHistPhiTPC->Fill(track->Phi());  
-    }
-  
+    //if(TMath::Abs(track->GetD(0,0,0))>1) continue;
+
+    Int_t trkLabel = TMath::Abs(track->GetLabel());
+    Int_t nclsITS = track->GetNcls(0);
+
+    Bool_t outInZ=kFALSE;
 
     for(Int_t layer=0; layer<6; layer++) {
-      if(TESTBIT(track->GetITSClusterMap(),layer)) {
-       if(tpcin) {
-         fHistClusterMapITSMI->Fill(layer);
-       } else {
-         fHistClusterMapITSSA->Fill(layer);
-       }
-      }
       track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc);
+      if(layer>=2) idet+=240; // add n SPD modules
+      if(layer>=4) idet+=260; // add n SPD modules
+      if(status==4) outInZ=kTRUE;
       if(tpcin) {
        if(status==1) fHistClusterMapITSMIok->Fill(layer);
        if(status==2) fHistClusterMapITSMIbad->Fill(layer);
@@ -455,6 +525,7 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
        if(status==4) fHistClusterMapITSMIoutinz->Fill(layer);
        if(status==5) fHistClusterMapITSMInocls->Fill(layer);
        if(status==6) fHistClusterMapITSMInorefit->Fill(layer);
+       if(status==1 || status==2 || status==4) fHistClusterMapITSMIokoutinzbad->Fill(layer);
       } else {
        if(status==1) fHistClusterMapITSSAok->Fill(layer);
        if(status==2) fHistClusterMapITSSAbad->Fill(layer);
@@ -462,9 +533,32 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
        if(status==4) fHistClusterMapITSSAoutinz->Fill(layer);
        if(status==5) fHistClusterMapITSSAnocls->Fill(layer);
        if(status==6) fHistClusterMapITSSAnorefit->Fill(layer);
+       if(status==1 || status==2 || status==4) fHistClusterMapITSSAokoutinzbad->Fill(layer);
+       if(status==1 && !outInZ) {fHistClusterMapITSSAokInAcc->Fill(layer);fHistClusterMapModuleITSSAokInAcc->Fill(idet);}
+       if(status==2 && !outInZ) {fHistClusterMapITSSAbadInAcc->Fill(layer);fHistClusterMapModuleITSSAbadInAcc->Fill(idet);}
+       if(status==3 && !outInZ) fHistClusterMapITSSAskippedInAcc->Fill(layer);
+       if(status==4 && !outInZ) fHistClusterMapITSSAoutinzInAcc->Fill(layer);
+       if(status==5 && !outInZ) {fHistClusterMapITSSAnoclsInAcc->Fill(layer);fHistClusterMapModuleITSSAnoclsInAcc->Fill(idet);}
+       if(status==6 && !outInZ) fHistClusterMapITSSAnorefitInAcc->Fill(layer);
+       if((status==1 || status==2 || status==4) && !outInZ) fHistClusterMapITSSAokoutinzbadInAcc->Fill(layer);
+      }
+      if(TESTBIT(track->GetITSClusterMap(),layer)) {
+       if(tpcin) {
+         fHistClusterMapITSMI->Fill(layer);
+       } else {
+         fHistClusterMapITSSA->Fill(layer);
+         if(!outInZ) fHistClusterMapITSSAInAcc->Fill(layer);
+       }
       }
     }  
 
+    // TPC track in ITS acceptance
+    if(tpcin && TMath::Abs(track->Eta())<0.9 && track->GetNcls(1)>50) {
+      itsfindableAcc=kTRUE;
+      fHistPtTPC->Fill(track->Pt());  
+      fHistPhiTPC->Fill(track->Phi());  
+    }
+  
     if(itsfindableAcc) {
       if(nclsITS==6) fHistPtITSMI6->Fill(track->Pt());
       if(nclsITS==5) fHistPtITSMI5->Fill(track->Pt());
@@ -476,6 +570,14 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
     }
 
 
+    if(tpcin) {
+      fHistNclsITSMI->Fill(nclsITS);
+    } else {
+      fHistNclsITSSA->Fill(nclsITS);
+      if(!outInZ) fHistNclsITSSAInAcc->Fill(nclsITS);
+    }
+
+
     Int_t iITSflag=0; //ITSflag takes the value 0 if the track has no cluster assigned in the SPDs, 1 (2) if one cluster is assigned in SPD1(2), 3 if two clusters are present. Then the same adding 10,20 or 30 for SDD and 100,200 or 300 for SSD
 
     if(track->HasPointOnITSLayer(0)) iITSflag+=1;
@@ -502,6 +604,9 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
       if(nITSclsMC>=0) iITSflag += 10000*nITSclsMC;    
     }
 
+    if(!vertexESD) return;
+    if(!(vertexESD->GetStatus())) return;
+
     // impact parameter to VertexTracks
     Double_t d0z0[2],covd0z0[3];
     track->PropagateToDCA(vertexESD,fESD->GetMagneticField(),100.,d0z0,covd0z0);
@@ -525,7 +630,7 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
     if(!itsrefit) sigmad0MCv *= -1.;
 
     // fill ntuple with track properties
-    if(SelectPt(track->Pt())) {
+    if(fFillNtuples && SelectPt(track->Pt())) {
       Float_t fillArray[19]={track->Pt(),track->Eta(),track->Phi(),d0z0[0],d0z0[1],TMath::Sqrt(covd0z0[0]),TMath::Sqrt(covd0z0[2]),ptMC,pdgMC,d0MC,d0z0MCv[0],d0z0MCv[1],sigmad0MCv,TMath::Sqrt(covd0z0MCv[2]),(Float_t)iITSflag};
       fNtupleESDTracks->Fill(fillArray);
     }
@@ -533,10 +638,12 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
     //---------------------------------------------    
     // AliTrackPoints: alignment checks
     // 
+    if(!fFillNtuples) continue;
     if(!fESDfriend) continue;
 
 
     const AliTrackPointArray *array = track->GetTrackPointArray();
+    if(!array) continue;
     AliTrackPoint point;
     Int_t pointOnLayer[6]={0,0,0,0,0,0};
     Int_t indexAssociated[6]={-1,-1,-1,-1,-1,-1},indexExtra=-1;
@@ -592,7 +699,8 @@ void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *)
       Float_t dz[2];
       // distance to primary SPD (only if 3D and high multiplicity)
       if(spdv->GetNContributors()>10) { 
-       tracklet.GetDZ(spdv->GetXv(),spdv->GetYv(),spdv->GetZv(),0,dz);
+       //tracklet.GetDZ(spdv->GetXv(),spdv->GetYv(),spdv->GetZv(),0,dz);
+       tracklet.GetDZ(-0.07,0.25,spdv->GetZv(),0,dz);
        fNtupleITSAlignSPDTracklets->Fill(phi,theta,0.5*(pointSPD1.GetZ()+pointSPD2.GetZ()),dz[0],dz[1]);
       }
     }
@@ -659,7 +767,7 @@ Int_t AliAnalysisTaskITSTrackingCheck::NumberOfITSClustersMC(Int_t label) const
   //
   // Return number of ITS clusters produced by MC particle with given label
   //
-
+  
   AliESDInputHandlerRP *esdHRP = dynamic_cast<AliESDInputHandlerRP*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
   if(!esdHRP) return -1;
   TTree *cTree = (TTree*)esdHRP->GetTreeR("ITS");
@@ -687,6 +795,7 @@ Int_t AliAnalysisTaskITSTrackingCheck::NumberOfITSClustersMC(Int_t label) const
   for(i=0;i<6;i++) { if(ncls[i]) nclstot++; }
 
   return nclstot;
+    //return label*0;
 }
 //---------------------------------------------------------------------------
 Double_t AliAnalysisTaskITSTrackingCheck::ParticleImpParMC(TParticle *part,
@@ -732,6 +841,7 @@ Bool_t AliAnalysisTaskITSTrackingCheck::SelectPt(Double_t pt)
     }
   }
   return kFALSE;
+  //return kTRUE;
 }
 
 
index 81ab883..41dde1e 100644 (file)
@@ -35,17 +35,20 @@ class AliAnalysisTaskITSTrackingCheck : public AliAnalysisTask
   Bool_t         GetReadMC() const { return fReadMC; }
   void           SetReadMC(Bool_t flag=kTRUE) { fReadMC=flag; }
   void           SetReadRPLabels(Bool_t flag=kTRUE) { fReadRPLabels=flag; }
+  void           SetFillNtuples(Bool_t flag=kTRUE) { fFillNtuples=flag; }
 
   
  protected:
   Bool_t       fReadMC; // read Monte Carlo
   Bool_t       fReadRPLabels; // read MC labels from ITS.RecPoints
+  Bool_t       fFillNtuples; // fill expert ntuples
   AliESDEvent  *fESD;    // ESD object
   AliESDfriend *fESDfriend; // ESD friend object
   TList        *fOutput; //! list send on output slot 0
   TH1F         *fHistNtracks; //! output hist
   TH1F         *fHistNclsITSMI; //! output hist
   TH1F         *fHistNclsITSSA; //! output hist
+  TH1F         *fHistNclsITSSAInAcc; //! output hist
   TH1F         *fHistClusterMapITSMI; //! output hist
   TH1F         *fHistClusterMapITSMIok; //! output hist
   TH1F         *fHistClusterMapITSMIbad; //! output hist
@@ -53,6 +56,7 @@ class AliAnalysisTaskITSTrackingCheck : public AliAnalysisTask
   TH1F         *fHistClusterMapITSMIoutinz; //! output hist
   TH1F         *fHistClusterMapITSMInorefit; //! output hist
   TH1F         *fHistClusterMapITSMInocls; //! output hist
+  TH1F         *fHistClusterMapITSMIokoutinzbad; //! output hist
   TH1F         *fHistClusterMapITSSA; //! output hist
   TH1F         *fHistClusterMapITSSAok; //! output hist
   TH1F         *fHistClusterMapITSSAbad; //! output hist
@@ -60,6 +64,18 @@ class AliAnalysisTaskITSTrackingCheck : public AliAnalysisTask
   TH1F         *fHistClusterMapITSSAoutinz; //! output hist
   TH1F         *fHistClusterMapITSSAnorefit; //! output hist
   TH1F         *fHistClusterMapITSSAnocls; //! output hist
+  TH1F         *fHistClusterMapITSSAokoutinzbad; //! output hist
+  TH1F         *fHistClusterMapITSSAInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAokInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAbadInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAskippedInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAoutinzInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAnorefitInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAnoclsInAcc; //! output hist
+  TH1F         *fHistClusterMapITSSAokoutinzbadInAcc; //! output hist
+  TH1F         *fHistClusterMapModuleITSSAokInAcc; //! output hist
+  TH1F         *fHistClusterMapModuleITSSAbadInAcc; //! output hist
+  TH1F         *fHistClusterMapModuleITSSAnoclsInAcc; //! output hist
   TH1F         *fHistPhiTPC; //! output hist
   TH1F         *fHistPtTPC; //! output hist
   TH1F         *fHistPtITSMI2; //! output hist
index b86e78b..104e9a9 100644 (file)
@@ -1,5 +1,6 @@
-AliAnalysisTaskITSTrackingCheck *AddTaskPerformanceITS(Bool_t readMC=kTRUE,
-                                                      Bool_t readRP=kFALSE) 
+AliAnalysisTaskITSTrackingCheck *AddTaskPerformanceITS(Bool_t readMC=kFALSE,
+                                                      Bool_t readRP=kFALSE,
+                                                      Bool_t fillNtuples=kFALSE) 
 {
   //
   // Task for check of ITS tracking
@@ -20,6 +21,7 @@ AliAnalysisTaskITSTrackingCheck *AddTaskPerformanceITS(Bool_t readMC=kTRUE,
   AliAnalysisTaskITSTrackingCheck *taskITS = new AliAnalysisTaskITSTrackingCheck("ITStracking");
   taskITS->SetReadMC(readMC);
   taskITS->SetReadRPLabels(readRP);
+  taskITS->SetFillNtuples(fillNtuples);
   AliLog::SetClassDebugLevel("AliAnalysisTaskITSTrackingCheck",10);
   // Add to the manager
   mgr->AddTask(taskITS);
diff --git a/PWG1/macros/PlotITSTrackingHists.C b/PWG1/macros/PlotITSTrackingHists.C
new file mode 100644 (file)
index 0000000..6ab5ea2
--- /dev/null
@@ -0,0 +1,128 @@
+void PlotITSTrackingHists() {
+  //
+  // Macro to plot the histos from the task AliAnalysisTaskITSTrackingCheck
+  // A. Dainese 28.11.09
+  // 
+
+  gStyle->SetOptStat(0);
+
+  TFile *f= new TFile("ITS.Performance.root");
+
+  TList *list=(TList*)f->Get("cOutput");
+  TH1F *fHistNclsITSSA = (TH1F*)list->FindObject("fHistNclsITSSA");
+  TH1F *fHistClusterMapITSSA = (TH1F*)list->FindObject("fHistClusterMapITSSA");
+  TH1F *fHistClusterMapITSSAok = (TH1F*)list->FindObject("fHistClusterMapITSSAok");
+  TH1F *fHistClusterMapITSSAbad = (TH1F*)list->FindObject("fHistClusterMapITSSAbad");
+  TH1F *fHistClusterMapITSSAskipped = (TH1F*)list->FindObject("fHistClusterMapITSSAskipped");
+  TH1F *fHistClusterMapITSSAoutinz = (TH1F*)list->FindObject("fHistClusterMapITSSAoutinz");
+  TH1F *fHistClusterMapITSSAokoutinzbad = (TH1F*)list->FindObject("fHistClusterMapITSSAokoutinzbad");
+  TH1F *fHistClusterMapITSSAnorefit = (TH1F*)list->FindObject("fHistClusterMapITSSAnorefit");
+  TH1F *fHistClusterMapITSSAnocls = (TH1F*)list->FindObject("fHistClusterMapITSSAnocls");
+  TH1F *fHistNclsITSSAInAcc = (TH1F*)list->FindObject("fHistNclsITSSAInAcc");
+  TH1F *fHistClusterMapITSSAInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAInAcc");
+  TH1F *fHistClusterMapITSSAokInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAokInAcc");
+  TH1F *fHistClusterMapITSSAbadInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAbadInAcc");
+  TH1F *fHistClusterMapModuleITSSAokInAcc = (TH1F*)list->FindObject("fHistClusterMapModuleITSSAokInAcc");
+  TH1F *fHistClusterMapModuleITSSAbadInAcc = (TH1F*)list->FindObject("fHistClusterMapModuleITSSAbadInAcc");
+  TH1F *fHistClusterMapITSSAskippedInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAskippedInAcc");
+  TH1F *fHistClusterMapITSSAoutinzInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAoutinzInAcc");
+  TH1F *fHistClusterMapITSSAokoutinzbadInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAokoutinzbadInAcc");
+  TH1F *fHistClusterMapITSSAnorefitInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAnorefitInAcc");
+  TH1F *fHistClusterMapITSSAnoclsInAcc = (TH1F*)list->FindObject("fHistClusterMapITSSAnoclsInAcc");
+  TH1F *fHistClusterMapModuleITSSAnoclsInAcc = (TH1F*)list->FindObject("fHistClusterMapModuleITSSAnoclsInAcc");
+  TH1F *fHistNclsITSMI = (TH1F*)list->FindObject("fHistNclsITSMI");
+  TH1F *fHistClusterMapITSMI = (TH1F*)list->FindObject("fHistClusterMapITSMI");
+  TH1F *fHistClusterMapITSMIok = (TH1F*)list->FindObject("fHistClusterMapITSMIok");
+  TH1F *fHistClusterMapITSMIbad = (TH1F*)list->FindObject("fHistClusterMapITSMIbad");
+  TH1F *fHistClusterMapITSMIskipped = (TH1F*)list->FindObject("fHistClusterMapITSMIskipped");
+  TH1F *fHistClusterMapITSMIoutinz = (TH1F*)list->FindObject("fHistClusterMapITSMIoutinz");
+  TH1F *fHistClusterMapITSMIokoutinzbad = (TH1F*)list->FindObject("fHistClusterMapITSMIokoutinzbad");
+  TH1F *fHistClusterMapITSMInorefit = (TH1F*)list->FindObject("fHistClusterMapITSMInorefit");
+  TH1F *fHistClusterMapITSMInocls = (TH1F*)list->FindObject("fHistClusterMapITSMInocls");
+
+  TLegend *l1=new TLegend(0.5,0.5,0.9,0.9);
+  TLegend *l2=new TLegend(0.5,0.5,0.9,0.9);
+
+  TCanvas *c1= new TCanvas("c1","c1",10,10,600,500);
+  fHistNclsITSSA->SetMinimum(0);
+  fHistNclsITSSA->SetLineColor(1);
+  l1->AddEntry(fHistNclsITSSA,"ITS-SA","l");
+  fHistNclsITSSA->Draw();
+  fHistNclsITSSAInAcc->SetLineColor(4);
+  l1->AddEntry(fHistNclsITSSAInAcc,"ITS-SA in acc.","l");
+  fHistNclsITSSAInAcc->Draw("same");
+  fHistNclsITSMI->SetLineColor(2);
+  l1->AddEntry(fHistNclsITSMI,"ITS from TPC","l");
+  fHistNclsITSMI->Draw("same");
+  l1->Draw();
+
+
+  TCanvas *c2 =new TCanvas("c2","c2",10,10,1200,800);
+  c2->Divide(3,2);
+  c2->cd(1);
+  //
+  fHistClusterMapITSSAokoutinzbad->SetLineColor(1);
+  fHistClusterMapITSSAokoutinzbad->SetMarkerColor(1);
+  fHistClusterMapITSSAokoutinzbad->SetMarkerStyle(20);
+  fHistClusterMapITSSAokoutinzbad->Draw();
+  fHistClusterMapITSMIokoutinzbad->SetLineColor(1);
+  fHistClusterMapITSMIokoutinzbad->SetMarkerColor(1);
+  fHistClusterMapITSMIokoutinzbad->SetMarkerStyle(20);
+  fHistClusterMapITSMIokoutinzbad->Draw("same");
+  l1->Draw();
+  //
+  c2->cd(2);
+  fHistClusterMapITSSAok->SetLineColor(1);
+  fHistClusterMapITSSAok->SetMarkerColor(1);
+  fHistClusterMapITSSAok->SetMarkerStyle(21);
+  fHistClusterMapITSSAok->Draw();
+  fHistClusterMapITSMIok->SetLineColor(2);
+  fHistClusterMapITSMIok->SetMarkerColor(2);
+  fHistClusterMapITSMIok->SetMarkerStyle(21);
+  fHistClusterMapITSMIok->Draw("same");
+  //
+  c2->cd(3);
+  fHistClusterMapITSSAoutinz->SetLineColor(1);
+  fHistClusterMapITSSAoutinz->SetMarkerColor(1);
+  fHistClusterMapITSSAoutinz->SetMarkerStyle(22);
+  fHistClusterMapITSSAoutinz->Draw();
+  fHistClusterMapITSMIoutinz->SetLineColor(2);
+  fHistClusterMapITSMIoutinz->SetMarkerColor(2);
+  fHistClusterMapITSMIoutinz->SetMarkerStyle(22);
+  fHistClusterMapITSMIoutinz->Draw("same");
+  //
+  c2->cd(4);
+  fHistClusterMapITSSAbad->SetLineColor(1);
+  fHistClusterMapITSSAbad->SetMarkerColor(1);
+  fHistClusterMapITSSAbad->SetMarkerStyle(23);
+  fHistClusterMapITSSAbad->Draw();
+  fHistClusterMapITSMIbad->SetLineColor(2);
+  fHistClusterMapITSMIbad->SetMarkerColor(2);
+  fHistClusterMapITSMIbad->SetMarkerStyle(23);
+  fHistClusterMapITSMIbad->Draw("same");
+  //
+  c2->cd(5);
+  fHistClusterMapITSSAnocls->SetLineColor(1);
+  fHistClusterMapITSSAnocls->SetMarkerColor(1);
+  fHistClusterMapITSSAnocls->SetMarkerStyle(24);
+  fHistClusterMapITSSAnocls->Draw();
+  fHistClusterMapITSMInocls->SetLineColor(2);
+  fHistClusterMapITSMInocls->SetMarkerColor(2);
+  fHistClusterMapITSMInocls->SetMarkerStyle(24);
+  fHistClusterMapITSMInocls->Draw("same");
+
+  TCanvas *c3 =new TCanvas("c3","c3",10,10,1200,400);
+  fHistClusterMapModuleITSSAokInAcc->SetLineColor(1);
+  fHistClusterMapModuleITSSAokInAcc->Draw();
+  l2->AddEntry(fHistClusterMapModuleITSSAokInAcc,"ok","l");
+  fHistClusterMapModuleITSSAbadInAcc->SetLineColor(2);
+  fHistClusterMapModuleITSSAbadInAcc->Draw("same");
+  l2->AddEntry(fHistClusterMapModuleITSSAbadInAcc,"bad","l");
+  fHistClusterMapModuleITSSAnoclsInAcc->SetLineColor(3);
+  fHistClusterMapModuleITSSAnoclsInAcc->Draw("same");
+  l2->AddEntry(fHistClusterMapModuleITSSAnoclsInAcc,"no cls","l");
+  l2->Draw();
+
+
+  return;
+}