new TPC QA, DCA vs pT, DeltaPhi vs pT (Weilin Yu)
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 Nov 2011 14:58:57 +0000 (14:58 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 Nov 2011 14:58:57 +0000 (14:58 +0000)
PWG1/TPC/AliPerformanceMatch.cxx
PWG1/TPC/AliPerformanceMatch.h
PWG1/TPC/AliPerformanceTPC.cxx
PWG1/TPC/AliPerformanceTask.cxx
PWG1/TPC/AliTPCPerformanceSummary.cxx
PWG1/TPC/AliTPCPerformanceSummary.h
PWG1/TPC/macros/AddTaskPerformanceTPCdEdxQA.C

index 656a39e..7bfb64b 100644 (file)
@@ -74,6 +74,7 @@ AliPerformanceMatch::AliPerformanceMatch():
   fResolHisto(0),
   fPullHisto(0),
   fTrackingEffHisto(0),
+  fTPCConstrain(0),
   fFolderObj(0),
   // Cuts 
   fCutsRC(0),  
@@ -93,6 +94,7 @@ AliPerformanceMatch::AliPerformanceMatch(Char_t* name="AliPerformanceMatch", Cha
   fResolHisto(0),
   fPullHisto(0),
   fTrackingEffHisto(0),
+  fTPCConstrain(0),
   fFolderObj(0),
   // Cuts 
   fCutsRC(0),  
@@ -118,6 +120,7 @@ AliPerformanceMatch::~AliPerformanceMatch()
   if(fResolHisto) delete fResolHisto; fResolHisto=0;     
   if(fPullHisto)  delete fPullHisto;  fPullHisto=0;
   if(fTrackingEffHisto) delete fTrackingEffHisto; fTrackingEffHisto = 0x0;
+  if(fTPCConstrain) delete fTPCConstrain; fTPCConstrain = 0x0;
   
   if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;
   if(fFolderObj) delete fFolderObj; fFolderObj=0;
@@ -133,7 +136,7 @@ void AliPerformanceMatch::Init(){
   // set pt bins
   Int_t nPtBins = 50;
   Double_t ptMin = 1.e-2, ptMax = 20.;
-
   Double_t *binsPt = 0;
 
   if (IsHptGenerator())  { 
@@ -149,54 +152,83 @@ void AliPerformanceMatch::Init(){
     zMin = -100.; zMax = 100.; 
   }
 
-  // res_y:res_z:res_phi,res_lambda:res_pt:y:z:eta:phi:pt:isRec
-  Int_t binsResolHisto[9]={100,100,100,100,100,90,30,nPtBins,2};
-  Double_t minResolHisto[9]={-1.,-1.,-0.03,-0.03,-0.2, 0., -1.5, ptMin,0};
-  Double_t maxResolHisto[9]={ 1., 1., 0.03, 0.03, 0.2, 2.*TMath::Pi(), 1.5, ptMax,2};
-
-  fResolHisto = new THnSparseF("fResolHisto","res_y:res_z:res_phi:res_lambda:res_pt:phi:eta:pt:isRec",9,binsResolHisto,minResolHisto,maxResolHisto);
-  fResolHisto->SetBinEdges(7,binsPt);
-
-  fResolHisto->GetAxis(0)->SetTitle("y-y_{ref} (cm)");
-  fResolHisto->GetAxis(1)->SetTitle("z-z_{ref} (cm)");
-  fResolHisto->GetAxis(2)->SetTitle("#phi-#phi_{ref} (rad)");
-  fResolHisto->GetAxis(3)->SetTitle("#lambda-#lambda_{ref} (rad)");
-  fResolHisto->GetAxis(4)->SetTitle("(p_{T}/p_{Tref}-1)");
-  fResolHisto->GetAxis(5)->SetTitle("#phi_{ref} (rad)");
-  fResolHisto->GetAxis(6)->SetTitle("#eta_{ref}");
-  fResolHisto->GetAxis(7)->SetTitle("p_{Tref} (GeV/c)");
-  fResolHisto->GetAxis(8)->SetTitle("isReconstructed");
-  fResolHisto->Sumw2();
-
-  //pull_y:pull_z:pull_snp:pull_tgl:pull_1pt:y:z:snp:tgl:1pt:isRec
-  Int_t binsPullHisto[9]={100,100,100,100,100,90,30,nPtBins,2};
-  Double_t minPullHisto[9]={-5.,-5.,-5.,-5.,-5., 0.,-1.5, ptMin,0};
-  Double_t maxPullHisto[9]={ 5., 5., 5., 5., 5., 2.*TMath::Pi(), 1.5, ptMax,2};
-  fPullHisto = new THnSparseF("fPullHisto","pull_y:pull_z:pull_snp:pull_tgl:pull_1pt:phi:eta:1pt:isRec",9,binsPullHisto,minPullHisto,maxPullHisto);
-
-  fPullHisto->GetAxis(0)->SetTitle("(y-y_{ref})/#sigma");
-  fPullHisto->GetAxis(1)->SetTitle("(z-z_{ref})/#sigma");
-  fPullHisto->GetAxis(2)->SetTitle("(sin#phi-sin#phi_{ref})/#sigma");
-  fPullHisto->GetAxis(3)->SetTitle("(tan#lambda-tan#lambda_{ref})/#sigma");
-  fPullHisto->GetAxis(4)->SetTitle("(p_{Tref}/p_{T}-1)/#sigma");
-  fPullHisto->GetAxis(5)->SetTitle("#phi_{ref} (rad)");
-  fPullHisto->GetAxis(6)->SetTitle("#eta_{ref}");
-  fPullHisto->GetAxis(7)->SetTitle("1/p_{Tref} (GeV/c)^{-1}");
-  fPullHisto->GetAxis(8)->SetTitle("isReconstructed");
-  fPullHisto->Sumw2();
-
-  // -> has match:y:z:snp:tgl:phi:pt:ITSclusters
-  Int_t binsTrackingEffHisto[5]    = { 2,   90,           100, 30,    7   };
-  Double_t minTrackingEffHisto[5]  = {-0.5, 0.,            0, -1.5, -0.5 };
-  Double_t maxTrackingEffHisto[5]  = { 1.5, 2*TMath::Pi(), 20, 1.5,  6.5 };
+  //
+  //init ITS TPC Mactching
+  //
+  if(GetAnalysisMode()==1){
+    // res_y:res_z:res_phi,res_lambda:res_pt:y:z:eta:phi:pt:isRec
+    Int_t binsResolHisto[9]={100,100,100,100,100,90,30,nPtBins,2};
+    Double_t minResolHisto[9]={-1.,-1.,-0.03,-0.03,-0.2, 0., -1.5, ptMin,0};
+    Double_t maxResolHisto[9]={ 1., 1., 0.03, 0.03, 0.2, 2.*TMath::Pi(), 1.5, ptMax,2};
+    
+    fResolHisto = new THnSparseF("fResolHisto","res_y:res_z:res_phi:res_lambda:res_pt:phi:eta:pt:isRec",9,binsResolHisto,minResolHisto,maxResolHisto);
+    fResolHisto->SetBinEdges(7,binsPt);
+    
+    fResolHisto->GetAxis(0)->SetTitle("y-y_{ref} (cm)");
+    fResolHisto->GetAxis(1)->SetTitle("z-z_{ref} (cm)");
+    fResolHisto->GetAxis(2)->SetTitle("#phi-#phi_{ref} (rad)");
+    fResolHisto->GetAxis(3)->SetTitle("#lambda-#lambda_{ref} (rad)");
+    fResolHisto->GetAxis(4)->SetTitle("(p_{T}/p_{Tref}-1)");
+    fResolHisto->GetAxis(5)->SetTitle("#phi_{ref} (rad)");
+    fResolHisto->GetAxis(6)->SetTitle("#eta_{ref}");
+    fResolHisto->GetAxis(7)->SetTitle("p_{Tref} (GeV/c)");
+    fResolHisto->GetAxis(8)->SetTitle("isReconstructed");
+    fResolHisto->Sumw2();
+    
+    //pull_y:pull_z:pull_snp:pull_tgl:pull_1pt:y:z:snp:tgl:1pt:isRec
+    Int_t binsPullHisto[9]={100,100,100,100,100,90,30,nPtBins,2};
+    Double_t minPullHisto[9]={-5.,-5.,-5.,-5.,-5., 0.,-1.5, ptMin,0};
+    Double_t maxPullHisto[9]={ 5., 5., 5., 5., 5., 2.*TMath::Pi(), 1.5, ptMax,2};
+    fPullHisto = new THnSparseF("fPullHisto","pull_y:pull_z:pull_snp:pull_tgl:pull_1pt:phi:eta:1pt:isRec",9,binsPullHisto,minPullHisto,maxPullHisto);
+    
+    fPullHisto->GetAxis(0)->SetTitle("(y-y_{ref})/#sigma");
+    fPullHisto->GetAxis(1)->SetTitle("(z-z_{ref})/#sigma");
+    fPullHisto->GetAxis(2)->SetTitle("(sin#phi-sin#phi_{ref})/#sigma");
+    fPullHisto->GetAxis(3)->SetTitle("(tan#lambda-tan#lambda_{ref})/#sigma");
+    fPullHisto->GetAxis(4)->SetTitle("(p_{Tref}/p_{T}-1)/#sigma");
+    fPullHisto->GetAxis(5)->SetTitle("#phi_{ref} (rad)");
+    fPullHisto->GetAxis(6)->SetTitle("#eta_{ref}");
+    fPullHisto->GetAxis(7)->SetTitle("1/p_{Tref} (GeV/c)^{-1}");
+    fPullHisto->GetAxis(8)->SetTitle("isReconstructed");
+    fPullHisto->Sumw2();
+  }
   
-  fTrackingEffHisto = new THnSparseF("fTrackingEffHisto","has match:phi:pt:eta:ITSclusters",5,binsTrackingEffHisto,minTrackingEffHisto,maxTrackingEffHisto);
-  fTrackingEffHisto->GetAxis(0)->SetTitle("IsMatching");
-  fTrackingEffHisto->GetAxis(1)->SetTitle("phi (rad)");
-  fTrackingEffHisto->GetAxis(2)->SetTitle("p_{T}");
-  fTrackingEffHisto->GetAxis(3)->SetTitle("eta");
-  fTrackingEffHisto->GetAxis(4)->SetTitle("number of ITS clusters");
-  fTrackingEffHisto->Sumw2();
+  //
+  //TPC  ITS  Mactching
+  // 
+  if(GetAnalysisMode()==0){
+    // -> has match:y:z:snp:tgl:phi:pt:ITSclusters
+    Int_t binsTrackingEffHisto[5]    = { 2,   90,       nPtBins, 30,    7   };
+    Double_t minTrackingEffHisto[5]  = {-0.5, 0.,          ptMin, -1.5, -0.5 };
+    Double_t maxTrackingEffHisto[5]  = { 1.5, 2*TMath::Pi(), ptMax, 1.5,  6.5 };
+    
+    fTrackingEffHisto = new THnSparseF("fTrackingEffHisto","has match:phi:pt:eta:ITSclusters",5,binsTrackingEffHisto,minTrackingEffHisto,maxTrackingEffHisto);
+    fTrackingEffHisto->SetBinEdges(2,binsPt);
+    fTrackingEffHisto->GetAxis(0)->SetTitle("IsMatching");
+    fTrackingEffHisto->GetAxis(1)->SetTitle("phi (rad)");
+    fTrackingEffHisto->GetAxis(2)->SetTitle("p_{T}");
+    fTrackingEffHisto->GetAxis(3)->SetTitle("eta");
+    fTrackingEffHisto->GetAxis(4)->SetTitle("number of ITS clusters");
+    fTrackingEffHisto->Sumw2();
+  }
+
+  //
+  //TPC constraining to vertex
+  //
+  if(GetAnalysisMode()==2){
+    //initilization of fTPCConstrain
+    Int_t  binsTPCConstrain[4] = {100, 90,            nPtBins, 30};
+    Double_t minTPCConstrain[4] = {-5, 0,             ptMin,   -1.5};
+    Double_t maxTPCConstrain[4] = {5,  2*TMath::Pi(), ptMax,  1.5};
+    
+    fTPCConstrain = new THnSparseF("fTPCConstrain","pull_phi:phi:pt:eta",4, binsTPCConstrain,minTPCConstrain,maxTPCConstrain);
+    fTPCConstrain->SetBinEdges(2,binsPt);
+    fTPCConstrain->GetAxis(0)->SetTitle("(#phi-#phi_{ref})/#sigma");
+    fTPCConstrain->GetAxis(1)->SetTitle("phi (rad)");
+    fTPCConstrain->GetAxis(2)->SetTitle("p_{T}");
+    fTPCConstrain->GetAxis(3)->SetTitle("eta");
+    fTPCConstrain->Sumw2();
+  }
 
   // Init cuts 
   if(!fCutsMC) 
@@ -301,6 +333,52 @@ void AliPerformanceMatch::ProcessTPCITS(AliStack* /*const stack*/, AliESDtrack *
   return;
 }*/
 
+void AliPerformanceMatch::ProcessTPCConstrain(AliStack* /*const stack*/, AliESDEvent *const esdEvent, AliESDtrack *const esdTrack){
+  //
+  // Contrain TPC inner track to the vertex
+  // then compare to the global tracks
+  //
+  if(!esdTrack) return;
+  if(esdTrack->Charge()==0) return;
+
+  if(!esdTrack->GetTPCInnerParam()) return;
+  if(!(esdTrack->GetStatus()&AliESDtrack::kITSrefit)) return;
+  if(!(esdTrack->GetStatus()&AliESDtrack::kTPCrefit)) return;
+  if(!fCutsRC->AcceptTrack(esdTrack)) return;
+
+  Double_t x[3]; esdTrack->GetXYZ(x);
+  Double_t b[3]; AliTracker::GetBxByBz(x,b);
+  Bool_t isOK = kFALSE;
+  const AliESDVertex* vtxESD = esdEvent->GetPrimaryVertexTracks();
+  
+  AliExternalTrackParam * TPCinner = (AliExternalTrackParam *)esdTrack->GetTPCInnerParam();
+  if(!TPCinner) return;
+  
+  //  isOK = TPCinner->Rotate(esdTrack->GetAlpha());
+  //isOK = TPCinner->PropagateTo(esdTrack->GetX(),esdEvent->GetMagneticField());
+
+  AliExternalTrackParam * TPCinnerC = new AliExternalTrackParam(*TPCinner);
+  isOK = TPCinnerC->ConstrainToVertex(vtxESD, b);
+
+  // transform to the track reference frame 
+  isOK = TPCinnerC->Rotate(esdTrack->GetAlpha());
+  isOK = TPCinnerC->PropagateTo(esdTrack->GetX(),esdEvent->GetMagneticField());
+  if(!isOK) return;
+
+  Double_t sigmaPhi=0,deltaPhi=0,pullPhi=0;
+  deltaPhi = TPCinnerC->GetSnp() - esdTrack->GetSnp();
+  sigmaPhi = TMath::Sqrt(esdTrack->GetSigmaSnp2()+TPCinnerC->GetSigmaSnp2());
+  if(sigmaPhi!=0)
+    pullPhi = deltaPhi/sigmaPhi;
+
+  Double_t vTPCConstrain[4] = {pullPhi,esdTrack->Phi(),esdTrack->Pt(),esdTrack->Eta()};
+  fTPCConstrain->Fill(vTPCConstrain);  
+  
+  if(TPCinnerC)
+    delete TPCinnerC;
+
+  return;
+}
 //_____________________________________________________________________________
 void AliPerformanceMatch::FillHistograms(AliESDtrack *const refParam, AliESDtrack *const param, Bool_t isRec) 
 {
@@ -425,14 +503,24 @@ void AliPerformanceMatch::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esd
       }*/
 
     if(GetAnalysisMode() == 0){
-      if(!IsUseTOFBunchCrossing())
+      if(!IsUseTOFBunchCrossing()){
        ProcessTPCITS(stack,track);
+      }
       else
-       if( track->GetTOFBunchCrossing(esdEvent->GetMagneticField())==0) 
+       if( track->GetTOFBunchCrossing(esdEvent->GetMagneticField())==0) {
          ProcessTPCITS(stack,track);
+       }
     }
     /* else if(GetAnalysisMode() == 2) ProcessTPCTRD(stack,track,friendTrack);*/
-    else if(GetAnalysisMode() == 1) {ProcessITSTPC(iTrack,esdEvent,stack,track);
+    else if(GetAnalysisMode() == 1) {ProcessITSTPC(iTrack,esdEvent,stack,track);}
+    else if(GetAnalysisMode() == 2){
+      if(!IsUseTOFBunchCrossing()){
+       ProcessTPCConstrain(stack,esdEvent,track);
+      }
+      else
+       if( track->GetTOFBunchCrossing(esdEvent->GetMagneticField())==0) {
+         ProcessTPCConstrain(stack,esdEvent,track);
+       }
     }
     else {
       printf("ERROR: AnalysisMode %d \n",fAnalysisMode);
@@ -475,7 +563,7 @@ void AliPerformanceMatch::Analyse() {
   // char name[256];
   // char title[256];
 
-  if(GetAnalysisMode()==1 || GetAnalysisMode()==2) { 
+  if(GetAnalysisMode()==1) { 
 
   fResolHisto->GetAxis(8)->SetRangeUser(1.0,2.0); // only reconstructed
   fPullHisto->GetAxis(8)->SetRangeUser(1.0,2.0);  // only reconstructed
@@ -522,6 +610,17 @@ void AliPerformanceMatch::Analyse() {
       }
   }
 
+  //
+  //TPC constrained to vertex
+  //
+  if(GetAnalysisMode()==2) { 
+    selString = "tpc";
+    //    for(Int_t i=1; i<4; i++)
+    AddProjection(aFolderObj, "constrain", fTPCConstrain, 0, 1, 2, &selString);
+    AddProjection(aFolderObj, "constrain", fTPCConstrain, 0, 1, 3, &selString);
+    AddProjection(aFolderObj, "constrain", fTPCConstrain, 0, 2, 3, &selString);
+  }
+  
   printf("exportToFolder\n");
   fAnalysisFolder = ExportToFolder(aFolderObj);
   
@@ -606,6 +705,8 @@ Long64_t AliPerformanceMatch::Merge(TCollection* const list)
         if ((fResolHisto) && (entry->fResolHisto)) { fResolHisto->Add(entry->fResolHisto); }
         if ((fPullHisto) && (entry->fPullHisto)) { fPullHisto->Add(entry->fPullHisto); }
         if ((fTrackingEffHisto) && (entry->fTrackingEffHisto)) { fTrackingEffHisto->Add(entry->fTrackingEffHisto); }
+
+        if ((fTPCConstrain) && (entry->fTPCConstrain)) { fTPCConstrain->Add(entry->fTPCConstrain); }
     }
     // the analysisfolder is only merged if present
     if (entry->fFolderObj) { objArrayList->Add(entry->fFolderObj); }
@@ -614,7 +715,7 @@ Long64_t AliPerformanceMatch::Merge(TCollection* const list)
   }
   if (fFolderObj) { fFolderObj->Merge(objArrayList); } 
   // to signal that track histos were not merged: reset
-  if (!merge) { fResolHisto->Reset(); fPullHisto->Reset(); fTrackingEffHisto->Reset(); }
+  if (!merge) { fResolHisto->Reset(); fPullHisto->Reset(); fTrackingEffHisto->Reset(); fTPCConstrain->Reset(); }
   // delete
   if (objArrayList)  delete objArrayList;  objArrayList=0;
 return count;
index 8ef04ec..9dcf2e5 100644 (file)
@@ -60,6 +60,7 @@ public :
   void ProcessTPCITS(AliStack* const stack, AliESDtrack *const esdTrack);
   void ProcessTPCTRD(AliStack* const stack, AliESDtrack *const esdTrack, AliESDfriendTrack *const friendTrack);
   void ProcessITSTPC(Int_t trackIdx, AliESDEvent* const esdEvent, AliStack* const stack, AliESDtrack *const esdTrack);
+  void ProcessTPCConstrain(AliStack* const stack, AliESDEvent *const esdEvent, AliESDtrack *const esdTrack); // - 01.11.2011
 
   // Fill histogrrams
   void FillHistograms(AliESDtrack *const refParam, AliESDtrack *const param, Bool_t isRec);
@@ -84,7 +85,8 @@ public :
   THnSparse *GetResolHisto() const  { return fResolHisto; }
   THnSparse *GetPullHisto()  const  { return fPullHisto; }
   THnSparse *GetTrackEffHisto() const  { return fTrackingEffHisto; }
-  
+  THnSparse *GetTPCConstrain() const { return fTPCConstrain; }
+
   TObjArray* GetHistos() const { return fFolderObj; }
   
   static Bool_t GetMergeTHnSparse() { return fgMergeTHnSparse; }
@@ -112,6 +114,10 @@ private:
 
   // tracking efficiency using ITS stand-alone tracks histogram
   THnSparseF *fTrackingEffHisto;  //-> has match:y:z:snp:tgl:phi:pt:ITSclusters
+
+  // TPC Inner constrained to global tracks - 01.11.2011
+  THnSparseF *fTPCConstrain;  //-> pull_phi:phi,pt,eta
+
   
   TObjArray* fFolderObj; // array of analysed histograms  
 
index da4bc23..15f3212 100644 (file)
@@ -576,7 +576,6 @@ void AliPerformanceTPC::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEv
       if(GetAnalysisMode() == 0) {
         AliESDtrack *tpcTrack = AliESDtrackCuts::GetTPCOnlyTrack(esdEvent,iTrack);
         if(!tpcTrack) continue;
-      
         // track selection
         if( fCutsRC->AcceptTrack(tpcTrack) ) { 
          mult++;
@@ -603,7 +602,7 @@ void AliPerformanceTPC::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEv
       }
     }
   }
-  
+
   Double_t vTPCEvent[7] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv(),mult,multP,multN,vtxESD->GetStatus()};
   fTPCEventHisto->Fill(vTPCEvent);
 }
index 91f5d98..af1f3be 100644 (file)
@@ -267,6 +267,7 @@ void AliPerformanceTask::Terminate(Option_t *)
     AliPerformanceDEdx* pDEdx = 0;\r
     AliPerformanceMatch* pMatch = 0;\r
     AliPerformanceMatch* pPull = 0;\r
+    AliPerformanceMatch* pConstrain = 0;\r
     TIterator* itOut = fOutput->MakeIterator();\r
     itOut->Reset();\r
     while(( pObj = dynamic_cast<AliPerformanceObject*>(itOut->Next())) != NULL) { \r
@@ -279,9 +280,10 @@ void AliPerformanceTask::Terminate(Option_t *)
        if (!strcmp(pObj->GetName(),"AliPerformanceTPC"))  {    pTPC = dynamic_cast<AliPerformanceTPC*>(pObj); }\r
         if (!strcmp(pObj->GetName(),"AliPerformanceDEdxTPCInner"))  {   pDEdx = dynamic_cast<AliPerformanceDEdx*>(pObj); }\r
         if (!strcmp(pObj->GetName(),"AliPerformanceMatchTPCITS")) {  pMatch = dynamic_cast<AliPerformanceMatch*>(pObj); }\r
-        if (!strcmp(pObj->GetName(),"AliPerformanceMatchITSTPC")) {  pPull = dynamic_cast<AliPerformanceMatch*>(pObj);\r
-       }\r
+        if (!strcmp(pObj->GetName(),"AliPerformanceMatchITSTPC")) {  pPull = dynamic_cast<AliPerformanceMatch*>(pObj);}\r
+        if (!strcmp(pObj->GetName(),"AliPerformanceMatchTPCConstrain")) {  pConstrain = dynamic_cast<AliPerformanceMatch*>(pObj);}\r
     }\r
+  \r
    \r
     if(!fUseOCDB)  { \r
       printf("DO NOT USE OCDB \n");\r
@@ -291,7 +293,7 @@ void AliPerformanceTask::Terminate(Option_t *)
     if (! AliCDBManager::Instance()->GetDefaultStorage()) { AliCDBManager::Instance()->SetDefaultStorage("raw://"); }\r
     TUUID uuid;\r
     TString tmpFile = gSystem->TempDirectory() + TString("/TPCQASummary.") + uuid.AsString() + TString(".root");\r
-    AliTPCPerformanceSummary::WriteToFile(pTPC, pDEdx, pMatch, pPull, tmpFile.Data());\r
+    AliTPCPerformanceSummary::WriteToFile(pTPC, pDEdx, pMatch, pPull, pConstrain, tmpFile.Data());\r
     TChain* chain = new TChain("tpcQA");\r
     if(!chain) return;\r
     chain->Add(tmpFile.Data());\r
index 0b9b518..b98c621 100644 (file)
@@ -48,7 +48,7 @@ Bool_t AliTPCPerformanceSummary::fgForceTHnSparse = kFALSE;
 
 
 //_____________________________________________________________________________
-void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch,const AliPerformanceMatch* pTPCPull, TTreeSRedirector* const pcstream, Int_t run)
+void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch,const AliPerformanceMatch* pTPCPull, const AliPerformanceMatch* pConstrain, TTreeSRedirector* const pcstream, Int_t run)
 {
    // 
     // Extracts performance parameters from pTPC and pTPCgain.
@@ -132,11 +132,13 @@ void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC*
     AnalyzeGain(pTPCgain, pcstream);
     AnalyzeMatch(pTPCMatch, pcstream);
     AnalyzePull(pTPCPull, pcstream);
+    AnalyzeConstrain(pConstrain, pcstream);
+   
     (*pcstream)<<"tpcQA"<<"\n";
 }
 
 //_____________________________________________________________________________
-void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch,  const AliPerformanceMatch* pPull, const Char_t* outfile, Int_t run)
+void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch,  const AliPerformanceMatch* pPull, const AliPerformanceMatch* pConstrain, const Char_t* outfile, Int_t run)
 {
     //
     // Extracts performance parameters from pTPC and pTPCgain.
@@ -152,7 +154,7 @@ void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const
     TTreeSRedirector* pcstream = 0;
     pcstream = new TTreeSRedirector(outfile);
     if (!pcstream) return;
-    WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pPull, pcstream, run);
+    WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pPull, pConstrain, pcstream, run);
     if (pcstream) { delete pcstream; pcstream = 0; }    
     
 }
@@ -195,13 +197,16 @@ Int_t AliTPCPerformanceSummary::MakeReport(const Char_t* infile, const Char_t* o
     AliPerformanceDEdx* pTPCgain = 0; 
     AliPerformanceMatch* pTPCmatch = 0; 
     AliPerformanceMatch* pTPCPull = 0; 
+    AliPerformanceMatch* pConstrain = 0;
+    
     if (list) {  pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
     if (list) {  pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
     if (list) {  pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
     if (list) {  pTPCPull = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchITSTPC")); }
+    if (list) {  pConstrain = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCConstrain")); }
     
     Int_t returncode = 0;
-    WriteToFile(pTPC, pTPCgain, pTPCmatch , pTPCPull, outfile, run);
+    WriteToFile(pTPC, pTPCgain, pTPCmatch , pTPCPull, pConstrain, outfile, run);
     if (f) { delete f; f=0; }
     return returncode;
 }
@@ -377,6 +382,11 @@ Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Ch
     SaveGraph(tree,"qOverPtA","run",condition);
     SaveGraph(tree,"qOverPtC","run",condition);
 
+    SaveGraph(tree,"dcarAP0","run",condition);
+    SaveGraph(tree,"dcarAP1","run",condition);
+    SaveGraph(tree,"dcarCP0","run",condition);
+    SaveGraph(tree,"dcarCP1","run",condition);
+
     condition = "";
     SaveGraph(tree,"tpcItsMatchA","run",condition);
     SaveGraph(tree,"tpcItsMatchHighPtA","run",condition);
@@ -394,7 +404,9 @@ Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Ch
     SaveGraph(tree,"lambdaPull","run",condition);
     SaveGraph(tree,"lambdaPullHighPt","run",condition);
     
-    
+    SaveGraph(tree,"tpcConstrainPhiA","run",condition);
+    SaveGraph(tree,"tpcConstrainPhiC","run",condition);
+     
     tree->Write();
     
     out->Close();   
@@ -457,6 +469,10 @@ Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TT
     static Double_t slopedRAchi2=0;
     static Double_t offsetdRCchi2=0;
     static Double_t slopedRCchi2=0;
+    static Double_t dcarAP0 = 0;
+    static Double_t dcarAP1 = 0;
+    static Double_t dcarCP0 = 0;
+    static Double_t dcarCP1 = 0;
 
     //AliPerformanceTPC* pTPC =  dynamic_cast<AliPerformanceTPC*>(pTPCObject);    
     
@@ -503,6 +519,80 @@ Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TT
     printf("slopedRA\t%f\n",slopedRA);
     printf("offsetdRC\t%f\n",offsetdRC);
     printf("slopedRC\t%f\n",slopedRC);
+
+    //
+    //extraction of DCAr versus pt
+    //
+    TLinearFitter linearFit;
+    linearFit.SetFormula("pol1");
+    TObjArray arrayWidth;  
+    TH1 *width;
+    Int_t nXbins;
+    Double_t x,y;
+    Int_t pn = 1;
+
+    if(!his3D)
+      return 8;
+    his3D->GetYaxis()->SetRangeUser(-1,1);
+
+    //get his2D in A Side
+    his3D->GetYaxis()->SetRangeUser(0,1);
+    his3D->GetZaxis()->SetRangeUser(0.35,8);
+    his2D  = dynamic_cast<TH2*>(his3D->Project3D("xz"));
+    his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
+    width =  dynamic_cast<TH1*>(arrayWidth.At(2));
+    nXbins = width->GetNbinsX();
+    for(Int_t i=2; i<nXbins; i++){
+      x = width->GetBinCenter(i);
+      if(x!=0)
+       x = 1.0/(x*x);
+      y = width->GetBinContent(i);
+      y = y*y;
+      linearFit.AddPoint(&x,y,1);
+    }
+    if(!linearFit.Eval()){
+      
+      dcarAP0 = linearFit.GetParameter(0);
+      if(dcarAP0!=0)
+       pn = Int_t(TMath::Abs(dcarAP0)/dcarAP0);
+      dcarAP0 = pn*TMath::Sqrt(TMath::Abs(dcarAP0));
+
+      dcarAP1 = linearFit.GetParameter(1);
+      if(dcarAP1!=0)
+       pn = Int_t(TMath::Abs(dcarAP1)/dcarAP1);
+      dcarAP1 = pn*TMath::Sqrt(TMath::Abs(dcarAP1));
+    }
+
+    linearFit.ClearPoints();
+    
+    //get his2D in C Side
+    his3D->GetYaxis()->SetRangeUser(-1,-0.001);
+    his2D  = dynamic_cast<TH2*>(his3D->Project3D("xz"));
+    his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
+    width =  dynamic_cast<TH1*>(arrayWidth.At(2));
+    nXbins = width->GetNbinsX();
+    for(Int_t i=2; i<nXbins; i++){
+      x = width->GetBinCenter(i);
+      if(x!=0)
+       x = 1.0/(x*x);
+      y = width->GetBinContent(i);
+      y = y*y;
+      linearFit.AddPoint(&x,y);
+    }
+    if(!linearFit.Eval()){
+      dcarCP0 = linearFit.GetParameter(0);
+      if(dcarCP0!=0)
+       pn = Int_t(TMath::Abs(dcarCP0)/dcarCP0);
+      dcarCP0 = pn*TMath::Sqrt(TMath::Abs(dcarCP0));
+
+      dcarCP1 = linearFit.GetParameter(1);
+      if(dcarCP1!=0)
+       pn = Int_t(TMath::Abs(dcarCP1)/dcarCP1);
+      dcarCP1 = pn*TMath::Sqrt(TMath::Abs(dcarCP1));
+    }
+    his3D->GetYaxis()->SetRangeUser(-1,1);
+    his3D->GetZaxis()->SetRangeUser(0,20);
+
     //
     // dump values
     //
@@ -520,7 +610,12 @@ Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TT
         "offsetdRAchi2="<< offsetdRAchi2<<
         "slopedRAchi2="<< slopedRAchi2<<
         "offsetdRCchi2="<< offsetdRCchi2<<
-        "slopedRCchi2="<<slopedRCchi2;
+        "slopedRCchi2="<<slopedRCchi2<<
+        //
+        "dcarAP0="<<dcarAP0<<
+        "dcarAP1="<<dcarAP1<<
+        "dcarCP0="<<dcarCP0<<
+        "dcarCP1="<<dcarCP1;
         
     return 0;
 }
@@ -1638,16 +1733,16 @@ Int_t AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch,
     if(entries > 0)
       tpcItsMatchA = entries1/entries;
 
-    h2D->GetYaxis()->SetRangeUser(4.0,20.);
-    h2D1->GetYaxis()->SetRangeUser(4.0,20.);
+    h2D->GetYaxis()->SetRangeUser(4.01,20.);
+    h2D1->GetYaxis()->SetRangeUser(4.01,20.);
     entries = h2D->GetEffectiveEntries();
     entries1 = h2D1->GetEffectiveEntries();
     if(entries > 0)
-      tpcItsMatchHighPtA = entries1/entries;
+    tpcItsMatchHighPtA = entries1/entries;
 
 
-    h2D->GetXaxis()->SetRangeUser(-1.5,0);
-    h2D1->GetXaxis()->SetRangeUser(-1.5,0);
+    h2D->GetXaxis()->SetRangeUser(-1.5,-0.01);
+    h2D1->GetXaxis()->SetRangeUser(-1.5,-0.01);
     h2D->GetYaxis()->SetRangeUser(0.0,20.);
     h2D1->GetYaxis()->SetRangeUser(0.0,20.);
 
@@ -1656,8 +1751,8 @@ Int_t AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch,
     if(entries > 0)
       tpcItsMatchC = entries1/entries;
 
-    h2D->GetXaxis()->SetRangeUser(4.0,20.);
-    h2D1->GetXaxis()->SetRangeUser(4.0,20.);
+    h2D->GetYaxis()->SetRangeUser(4.01,20.);
+    h2D1->GetYaxis()->SetRangeUser(4.01,20.);
     entries = h2D->GetEffectiveEntries();
     entries1 = h2D1->GetEffectiveEntries();
     if(entries > 0)
@@ -1771,3 +1866,29 @@ Int_t AliTPCPerformanceSummary::AnalyzePull(const AliPerformanceMatch* pPull, TT
     
   return 0;
 }
+Int_t AliTPCPerformanceSummary::AnalyzeConstrain(const AliPerformanceMatch* pConstrain, TTreeSRedirector* pcstream)
+{
+  if (!pcstream) return 5126;
+  if (!pConstrain) return 5126;
+
+    TH3* his3D=0;
+    static Double_t tpcConstrainPhiA = 0;
+    static Double_t tpcConstrainPhiC = 0;
+    
+    if (pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3")) {    
+      
+      his3D = dynamic_cast<TH3*>(pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3"));//phi pull:pt:eta
+      if(!his3D) return 5126;
+      
+      his3D->GetZaxis()->SetRangeUser(0.0,1.0);
+      tpcConstrainPhiA = his3D->GetMean(1);
+      his3D->GetZaxis()->SetRangeUser(-1.0,-0.001);
+      tpcConstrainPhiC = his3D->GetMean(1);
+    }
+
+  (*pcstream)<<"tpcQA"<<
+    "tpcConstrainPhiA="<<tpcConstrainPhiA <<
+    "tpcConstrainPhiC="<< tpcConstrainPhiC;
+  
+  return 0;
+}
index 2b7cd25..7e1e90b 100644 (file)
@@ -22,9 +22,9 @@ class AliTPCPerformanceSummary
     AliTPCPerformanceSummary() {} // default contructor 
     virtual ~AliTPCPerformanceSummary() {} // destructor
     
-    static void WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch, const AliPerformanceMatch* pTPCPull, TTreeSRedirector* const pcstream, Int_t run = -1); // called by WriteToFile
+    static void WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch, const AliPerformanceMatch* pTPCPull, const AliPerformanceMatch* pConstrain, TTreeSRedirector* const pcstream, Int_t run = -1); // called by WriteToFile
     
-    static void WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch,const AliPerformanceMatch* pPull, const Char_t* outfile, Int_t run = -1); // calles by MakeReport
+    static void WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch,const AliPerformanceMatch* pPull, const AliPerformanceMatch* pConstrain, const Char_t* outfile, Int_t run = -1); // calles by MakeReport
     
     // the two key functions
     static Int_t MakeReport(const Char_t* infile, const Char_t* outfile, Int_t run);
@@ -58,6 +58,8 @@ class AliTPCPerformanceSummary
 
     static Int_t AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream);
 
+    static Int_t AnalyzeConstrain(const AliPerformanceMatch* pConstrain, TTreeSRedirector* pcstream);
+
     AliTPCPerformanceSummary(const AliTPCPerformanceSummary&); // copy contructor (not implemented)
     AliTPCPerformanceSummary& operator=(const AliTPCPerformanceSummary&); // assignment operator (not implemented)
       
index 0d129cb..858ce1d 100644 (file)
@@ -14,6 +14,7 @@
 // 3. AliPerformancedEdx (TPC dEdx information)
 // 4. AliPerformanceRes (TPC track resolution w.r.t MC at DCA)
 // 5. AliPerformanceEff (TPC track reconstruction efficiency, MC primaries)
+// 6. AliPerformanceMatch (Comparison of TPC constrain and global tracking)
 //
 // Usage on the analysis train (default configuration):
 // gSystem->Load("libANALYSIS");
@@ -39,7 +40,7 @@
 //____________________________________________
 AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, 
                                                Bool_t highMult = kFALSE, const char *triggerClass=0, 
-                                               Bool_t bUseHLT = kFALSE)
+                                               Bool_t bUseHLT = kFALSE, Bool_t bUseTOF = kFALSE)
 {
   Char_t *taskName[] = {"TPC", "HLT"};
   Int_t idx = 0;
@@ -143,7 +144,7 @@ AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t
   //  pCompTPC0->SetUseTrackVertex(kFALSE);
   pCompTPC0->SetUseTrackVertex(kTRUE);
   pCompTPC0->SetUseHLT(bUseHLT);
-  pCompTPC0->SetUseTOFBunchCrossing(kTRUE);
+  pCompTPC0->SetUseTOFBunchCrossing(bUseTOF);
   
   //
   // TPC ITS match
@@ -154,7 +155,7 @@ AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t
   }
   pCompMatch1->SetAliRecInfoCuts(pRecInfoCutsTPC);
   pCompMatch1->SetAliMCInfoCuts(pMCInfoCuts);
-  pCompMatch1->SetUseTOFBunchCrossing(kTRUE);
+  pCompMatch1->SetUseTOFBunchCrossing(bUseTOF);
 
 
   //
@@ -165,7 +166,7 @@ AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t
     Error("AddTaskPerformanceTPCdEdxQA", "Cannot create AliPerformanceMatchITSTPC");  }
   pCompMatch2->SetAliRecInfoCuts(pRecInfoCutsTPC);
   pCompMatch2->SetAliMCInfoCuts(pMCInfoCuts);
-  pCompMatch2->SetUseTOFBunchCrossing(kTRUE);
+  pCompMatch2->SetUseTOFBunchCrossing(bUseTOF);
 
   //
   // dEdx
@@ -208,6 +209,16 @@ AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t
   pCompEff5->SetAliMCInfoCuts(pMCInfoCuts);
   pCompEff5->SetUseTrackVertex(kTRUE);
 
+  //
+  // TPC Constrain to vertex
+  //
+  AliPerformanceMatch *pCompConstrain6 = new AliPerformanceMatch("AliPerformanceMatchTPCConstrain","AliPerformanceMatchTPCConstrain",2,kFALSE); 
+  if(!pCompConstrain6) {
+    Error("AddTaskPerformanceTPCdEdxQA", "Cannot create AliPerformanceMatchTPCConstrain");  }
+  pCompConstrain6->SetAliRecInfoCuts(pRecInfoCutsTPC);
+  pCompConstrain6->SetAliMCInfoCuts(pMCInfoCuts);
+  pCompConstrain6->SetUseTOFBunchCrossing(bUseTOF);
+
 
 
   //
@@ -218,11 +229,13 @@ AliPerformanceTask* AddTaskPerformanceTPCdEdxQA(Bool_t bUseMCInfo=kFALSE, Bool_t
     pCompMatch1->SetTriggerClass(triggerClass);
     pCompMatch2->SetTriggerClass(triggerClass);
     pCompDEdx3->SetTriggerClass(triggerClass);
+    pCompConstrain6->SetTriggerClass(triggerClass);
   }
   task->AddPerformanceObject( pCompTPC0 );
   task->AddPerformanceObject( pCompMatch1 );
   task->AddPerformanceObject( pCompMatch2 );
   task->AddPerformanceObject( pCompDEdx3 );
+  task->AddPerformanceObject( pCompConstrain6 );
   if(bUseMCInfo)   {
       task->AddPerformanceObject( pCompRes4 );
       task->AddPerformanceObject( pCompEff5 );