-struct GoodTrack {
- Int_t lab;
- Int_t code;
- Float_t px,py,pz;
- Float_t x,y,z;
-};
-Int_t good_tracks(GoodTrack *gt, Int_t max);
-
-Int_t AliTPCComparison() {
- cerr<<"Doing comparison...\n";
-
- TFile *cf=TFile::Open("AliTPCclusters.root");
- if (!cf->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 1;}
- AliTPCParam *digp= (AliTPCParam*)cf->Get("75x40_100x60");
- if (!digp) { cerr<<"TPC parameters have not been found !\n"; return 2; }
-
-// Load clusters
- AliTPCClustersArray *ca=new AliTPCClustersArray;
- ca->Setup(digp);
- ca->SetClusterType("AliTPCcluster");
- ca->ConnectTree("Segment Tree");
- Int_t nentr=Int_t(ca->GetTree()->GetEntries());
- for (Int_t i=0; i<nentr; i++) {
- AliSegmentID *s=ca->LoadEntry(i);
- }
-
-// Load tracks
- TFile *tf=TFile::Open("AliTPCtracks.root");
- if (!tf->IsOpen()) {cerr<<"Can't open AliTPCtracks.root !\n"; return 3;}
- TObjArray tarray(2000);
- TTree *tracktree=(TTree*)tf->Get("TreeT");
- TBranch *tbranch=tracktree->GetBranch("tracks");
- Int_t nentr=tracktree->GetEntries();
- for (i=0; i<nentr; i++) {
- AliTPCtrack *iotrack=new AliTPCtrack;
- tbranch->SetAddress(&iotrack);
- tracktree->GetEvent(i);
- iotrack->CookLabel(ca);
- tarray.AddLast(iotrack);
- }
- tf->Close();
-
- delete ca;
- cf->Close();
-
-/////////////////////////////////////////////////////////////////////////
- GoodTrack gt[7000];
- Int_t ngood=0;
- ifstream in("good_tracks");
- if (in) {
- cerr<<"Reading good tracks...\n";
- while (in>>gt[ngood].lab>>gt[ngood].code
- >>gt[ngood].px >>gt[ngood].py>>gt[ngood].pz
- >>gt[ngood].x >>gt[ngood].y >>gt[ngood].z) {
- ngood++;
- cerr<<ngood<<'\r';
- if (ngood==7000) {
- cerr<<"Too many good tracks !\n";
- break;
- }
- }
- if (!in.eof()) cerr<<"Read error (good_tracks) !\n";
- } else {
- cerr<<"Marking good tracks (this will take a while)...\n";
- ngood=good_tracks(gt,7000);
- ofstream out("good_tracks");
- if (out) {
- for (Int_t ngd=0; ngd<ngood; ngd++)
- out<<gt[ngd].lab<<' '<<gt[ngd].code<<' '
- <<gt[ngd].px <<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '
- <<gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl;
- } else cerr<<"Can not open file (good_tracks) !\n";
- out.close();
- }
- cerr<<"Number of good tracks : "<<ngood<<endl;
-
- cerr<<"Doing comparison...\n";
- TH1F *hp=new TH1F("hp","PHI resolution",50,-20.,20.); hp->SetFillColor(4);
- TH1F *hl=new TH1F("hl","LAMBDA resolution",50,-20,20);hl->SetFillColor(4);
- TH1F *hpt=new TH1F("hpt","Relative Pt resolution",30,-10.,10.);
- hpt->SetFillColor(2);
- TH1F *hmpt=new TH1F("hmpt","Relative Pt resolution (pt>4GeV/c)",30,-60,60);
+/****************************************************************************
+ * Very important, delicate and rather obscure macro. *
+ * *
+ * Creates list of "trackable" tracks, *
+ * calculates efficiency, resolutions etc. *
+ * There is a possibility to run this macro over several events. *
+ * *
+ * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
+ * with several nice improvements by: M.Ivanov, GSI, m.ivanov@gsi.de *
+ ****************************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+ #include <TMath.h>
+ #include <TError.h>
+ #include <Riostream.h>
+ #include <TH1F.h>
+ #include <TH2F.h>
+ #include <TTree.h>
+ #include <TParticle.h>
+ #include <TCanvas.h>
+ #include <TLine.h>
+ #include <TText.h>
+ #include <TBenchmark.h>
+ #include <TStyle.h>
+ #include <TFile.h>
+ #include <TROOT.h>
+
+ #include "AliStack.h"
+ #include "AliHeader.h"
+ #include "AliTrackReference.h"
+ #include "AliRunLoader.h"
+ #include "AliRun.h"
+ #include "AliESDEvent.h"
+ #include "AliESDtrack.h"
+
+ #include "AliSimDigits.h"
+ #include "AliTPC.h"
+ #include "AliTPCParamSR.h"
+ #include "AliTPCClustersArray.h"
+ #include "AliTPCClustersRow.h"
+ #include "AliTPCcluster.h"
+ #include "AliTPCLoader.h"
+
+ #include "AliCDBManager.h"
+ #include "AliTPCcalibDB.h"
+#endif
+
+Int_t GoodTracksTPC(const Char_t *dir=".");
+
+extern TBenchmark *gBenchmark;
+extern TROOT *gROOT;
+
+static Int_t allgood=0;
+static Int_t allselected=0;
+static Int_t allfound=0;
+
+Int_t AliTPCComparison
+(Float_t ptcutl=0.2, Float_t ptcuth=10., const Char_t *dir=".") {
+ gBenchmark->Start("AliTPCComparison");
+
+ ::Info("AliTPCComparison.C","Doing comparison...");
+
+
+
+ TH1F *hp=(TH1F*)gROOT->FindObject("hp");
+ if (!hp) hp=new TH1F("hp","PHI resolution",50,-20.,20.);
+ hp->SetFillColor(4);
+
+ TH1F *hl=(TH1F*)gROOT->FindObject("hl");
+ if (!hl) hl=new TH1F("hl","LAMBDA resolution",50,-20,20);
+ hl->SetFillColor(4);
+
+ TH1F *hpt=(TH1F*)gROOT->FindObject("hpt");
+ if (!hpt) hpt=new TH1F("hpt","Relative Pt resolution",30,-10.,10.);
+ hpt->SetFillColor(2);
+
+ TH1F *hmpt=(TH1F*)gROOT->FindObject("hmpt");
+ if (!hmpt)
+ hmpt=new TH1F("hmpt","Relative Pt resolution (pt>4GeV/c)",30,-60,60);