X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCDisplayClusters.C;h=df91baf2330820f9bc5591ac34676da72d11ec11;hb=69347e0d0fa40186638dc8124b7b110e57a83d43;hp=3e6681735b555d955171990fbbfc0df875bb6141;hpb=106ea0fcfe6b3cef050de9c2e03f7479dd9e5e1c;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCDisplayClusters.C b/TPC/AliTPCDisplayClusters.C index 3e6681735b5..df91baf2330 100644 --- a/TPC/AliTPCDisplayClusters.C +++ b/TPC/AliTPCDisplayClusters.C @@ -1,13 +1,32 @@ -Int_t AliTPCDisplayClusters() { +/**************************************************************************** + * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch * + ****************************************************************************/ + +#ifndef __CINT__ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AliTPCParam.h" +#include "AliClusters.h" +#include "AliTPCcluster.h" +#endif + +Int_t AliTPCDisplayClusters(Int_t eventn=0, Int_t noiseth=15) { cerr<<"Displaying clusters...\n"; - TFile *file=TFile::Open("rfio:galice.root"); + TFile *file=TFile::Open("galice.root"); if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;} TFile *cf=TFile::Open("AliTPCclusters.root"); if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;} - AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60"); + AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60_150x60"); if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 2;} TCanvas *c1=new TCanvas("cdisplay", "Cluster display",0,0,700,730); @@ -18,37 +37,63 @@ Int_t AliTPCDisplayClusters() { c1->SetTheta(90.); c1->SetPhi(0.); - AliTPCClustersArray *ca=new AliTPCClustersArray; - ca->Setup(dig); - ca->SetClusterType("AliTPCcluster"); - ca->ConnectTree("Segment Tree"); - Int_t nrows=Int_t(ca->GetTree()->GetEntries()); + char cname[100]; + sprintf(cname,"TreeC_TPC_%d",eventn); + TTree *cTree=(TTree *)cf->Get(cname); + if (!cTree) { + cerr<<"Can't find tree : "<SetClass("AliTPCcluster"); + + cTree->SetBranchAddress("Segment",&clusters); + + Int_t nrows=Int_t(cTree->GetEntries()); for (Int_t n=0; nLoadEntry(n); + cTree->GetEvent(n); Int_t sec,row; - dig->AdjustSectorRow(s->GetID(),sec,row); - AliTPCClustersRow &clrow = *ca->GetRow(sec,row); - Int_t ncl=clrow.GetArray()->GetEntriesFast(); + dig->AdjustSectorRow(clusters->GetID(),sec,row); + TClonesArray &clrow=*clusters->GetArray(); + Int_t ncl=clrow.GetEntriesFast(); TPolyMarker3D *pm=new TPolyMarker3D(ncl); while (ncl--) { AliTPCcluster *cl=(AliTPCcluster*)clrow[ncl]; Double_t x=dig->GetPadRowRadii(sec,row), y=cl->GetY(), z=cl->GetZ(); + if (cl->GetQ()AdjustCosSin(sec,cs,sn); tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp; pm->SetPoint(ncl,x,y,z); } - ca->ClearRow(sec,row); + clrow.Clear(); pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1); pm->Draw(); } - delete ca; + delete cTree; + delete dig; cf->Close(); TGeometry *geom=(TGeometry*)file->Get("AliceGeom"); + TNode * main = (TNode*)((geom->GetListOfNodes())->First()); + TIter next(main->GetListOfNodes()); + TNode *module=0; + while((module = (TNode*)next())) { + char ch[100]; + sprintf(ch,"%s\n",module->GetTitle()); + //printf("%s\n",module->GetTitle()); + if (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C') //if TPC draw + module->SetVisibility(3); + else + module->SetVisibility(-1); + } + + geom->Draw("same"); c1->Modified(); c1->Update(); file->Close(); return 0; } +