]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/FindKrClustersRaw.C
Updated names of calibration objects (according to naming conventions in calibration...
[u/mrichter/AliRoot.git] / TPC / FindKrClustersRaw.C
CommitLineData
d19e1df9 1Int_t FindKrClustersRaw(const char *fileName="data.root"){
2
88f51054 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
d19e1df9 31 //define tree
88f51054 32 TFile *hfile=new TFile("adc.root","RECREATE","ADC file");
d19e1df9 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
88f51054 52
53 AliTPCParamSR *param=new AliTPCParamSR();
d19e1df9 54 //only for geometry parameters loading - temporarly
88f51054 55// AliRunLoader* rl = AliRunLoader::Open("galice.root");
56// AliTPCParam *param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
d19e1df9 57 //if (!param) {cerr<<"TPC parameters have not been found !\n"; return 4;}
88f51054 58
d19e1df9 59 clusters->SetParam(param);
88f51054 60
d19e1df9 61
62 Int_t evtnr=0;
63 while (reader->NextEvent()) {
64 //output for each event
88f51054 65 // AliTPCclustererKr *clusters = new AliTPCclustererKr();
66 // clusters->SetOutput(mytree);
67 // clusters->SetRecoParam(0);
68 // clusters->SetParam(param);
69
70 // if(evtnr++>5) break;
d19e1df9 71 cout<<"Evt = "<<evtnr<<endl;
72 clusters->finderIO(reader);
73 evtnr++;
88f51054 74
d19e1df9 75 }
76
88f51054 77 mytree->Print();//print rootuple summary
d19e1df9 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}