]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/FindKrClustersRaw.C
Visulaization macro for ExB effect (Marian)
[u/mrichter/AliRoot.git] / TPC / FindKrClustersRaw.C
1 Int_t FindKrClustersRaw(const char *fileName="data.root"){
2
3
4
5   //
6   // remove Altro warnings
7   //
8   AliLog::SetClassDebugLevel("AliTPCRawStream",-5);
9   AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
10   AliLog::SetClassDebugLevel("AliTPCAltroMapping",-5);
11   AliLog::SetModuleDebugLevel("RAW",-5);
12   //
13   // Get calibration
14   //
15   //  char *ocdbpath = gSystem->Getenv("OCDB_PATH");
16   char *ocdbpath ="local:///afs/cern.ch/alice/tpctest/OCDB";
17   if (ocdbpath==0){
18     ocdbpath="alien://folder=/alice/data/2007/LHC07w/OCDB/";
19   }
20   printf("OCDB PATH = %s\n",ocdbpath); 
21   AliCDBManager * man = AliCDBManager::Instance();
22   man->SetDefaultStorage(ocdbpath);
23   man->SetRun(0);
24
25   AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance()->GetPadNoise();
26   AliTPCAltroMapping** mapping =AliTPCcalibDB::Instance()->GetMapping();
27   //
28   //
29
30
31   //define tree
32   TFile *hfile=new TFile("adc.root","RECREATE","ADC file");
33   // Create a ROOT Tree
34   TTree *mytree = new TTree("Kr","Krypton cluster tree");
35
36
37   AliRawReader *reader = new AliRawReaderRoot(fileName);
38   //AliRawReader *reader = new AliRawReaderDate(fileName);
39   reader->Reset();
40
41   TStopwatch timer;
42   timer.Start();
43
44   AliAltroRawStreamFast* stream = new AliAltroRawStreamFast(reader);
45   stream->SelectRawData("TPC");
46
47   //one general output
48   AliTPCclustererKr *clusters = new AliTPCclustererKr();
49   clusters->SetOutput(mytree);
50   clusters->SetRecoParam(0);
51
52
53   AliTPCParamSR *param=new AliTPCParamSR();
54   //only for geometry parameters loading - temporarly
55 //  AliRunLoader* rl = AliRunLoader::Open("galice.root");
56 //  AliTPCParam *param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
57   //if (!param) {cerr<<"TPC parameters have not been found !\n"; return 4;}
58
59   clusters->SetParam(param);
60
61
62   Int_t evtnr=0;
63   while (reader->NextEvent()) {
64     //output for each event
65   //  AliTPCclustererKr *clusters = new AliTPCclustererKr();
66   //  clusters->SetOutput(mytree);
67   //  clusters->SetRecoParam(0);
68   //  clusters->SetParam(param);
69
70     // if(evtnr++>5) break;
71     cout<<"Evt = "<<evtnr<<endl;
72     clusters->finderIO(reader);
73     evtnr++;
74
75   }
76
77   mytree->Print();//print rootuple summary 
78   // Save all objects in this file
79   hfile->Write();
80   // Close the file
81   hfile->Close();
82
83   timer.Stop();
84   timer.Print();
85
86   delete stream;
87
88   return 0;
89 }