]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/FindKrClustersRaw.C
Update of the cluster finder (Marian, Adam Matyja)
[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   //set cluster finder parameters (from data)
62   clusters->SetZeroSup(param->GetZeroSup());//zero suppression parameter
63   clusters->SetFirstBin(60);//first bin
64   clusters->SetLastBin(950);//last bin
65   clusters->SetMaxNoiseAbs(2);//maximal noise
66   clusters->SetMaxNoiseSigma(3);//maximal amount of sigma of noise
67
68   //set cluster finder parameters (from MC)
69   clusters->SetMinAdc(3);//signal threshold (everything below is treated as 0)
70   clusters->SetMinTimeBins(2);//number of neighbouring timebins
71   clusters->SetMaxPadRangeCm(2.5);//distance of the cluster center to the center of a pad (in cm)
72   clusters->SetMaxRowRangeCm(3.5);//distance of the cluster center to the center of a padrow (in cm)
73   clusters->SetMaxTimeRange(7);//distance of the cluster center to the max time bin on a pad (in tackts)
74   //ie. fabs(centerT - time)<7
75   clusters->SetValueToSize(3.5);//cut reduce peak at 0
76
77
78
79
80   Int_t evtnr=0;
81   while (reader->NextEvent()) {
82     //output for each event
83   //  AliTPCclustererKr *clusters = new AliTPCclustererKr();
84   //  clusters->SetOutput(mytree);
85   //  clusters->SetRecoParam(0);
86   //  clusters->SetParam(param);
87
88     // if(evtnr++>5) break;
89     cout<<"Evt = "<<evtnr<<endl;
90     clusters->FinderIO(reader);
91     evtnr++;
92
93   }
94
95   mytree->Print();//print rootuple summary 
96   // Save all objects in this file
97   hfile->Write();
98   // Close the file
99   hfile->Close();
100
101   timer.Stop();
102   timer.Print();
103
104   delete stream;
105
106   return 0;
107 }