3 Int_t FindKrClusterCheck(const char *fileName="data.root");
6 Int_t FindKrClustersRaw(const char *fileName="data.root"){
11 // remove Altro warnings
13 AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
14 AliLog::SetClassDebugLevel("AliTPCAltroMapping",-5);
15 AliLog::SetModuleDebugLevel("RAW",-5);
19 char *ocdbpath = gSystem->Getenv("OCDB_PATH");
20 //char *ocdbpath ="local:///afs/cern.ch/alice/tpctest/OCDB";
22 ocdbpath="alien://folder=/alice/data/2007/LHC07w/OCDB/";
24 printf("OCDB PATH = %s\n",ocdbpath);
25 AliCDBManager * man = AliCDBManager::Instance();
26 man->SetDefaultStorage(ocdbpath);
27 man->SetRun(100000000);
29 AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance()->GetPadNoise();
30 AliTPCAltroMapping** mapping =AliTPCcalibDB::Instance()->GetMapping();
36 TFile *hfile=new TFile("adc.root","RECREATE","ADC file");
38 TTree *mytree = new TTree("Kr","Krypton cluster tree");
43 TH1F *histoRow =new TH1F("histoRow","rows",100,0.,100.);
44 TH1F *histoPad =new TH1F("histoPad","pads",150,0.,150.);
45 TH1F *histoTime =new TH1F("histoTime","timebins",100,0.,1000.);
46 TH2F *histoRowPad=new TH2F("histoRowPad","pads-vs-rows" ,150,0.,150.,100,0.,100.);
51 AliTPCclustererKr *clusters = new AliTPCclustererKr();
52 clusters->SetOutput(mytree);
53 clusters->SetRecoParam(0);
56 clusters->SetDebugLevel(debugLevel);
57 clusters->SetHistoRow(histoRow );
58 clusters->SetHistoPad(histoPad );
59 clusters->SetHistoTime(histoTime );
60 clusters->SetHistoRowPad(histoRowPad);
64 AliTPCParamSR *param=new AliTPCParamSR();
65 //only for geometry parameters loading - temporarly
66 // AliRunLoader* rl = AliRunLoader::Open("galice.root");
67 // AliTPCParam *param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
68 //if (!param) {cerr<<"TPC parameters have not been found !\n"; return 4;}
70 clusters->SetParam(param);
72 //set cluster finder parameters (from data)
73 clusters->SetZeroSup(param->GetZeroSup());//zero suppression parameter
74 clusters->SetFirstBin(60);//first bin
75 clusters->SetLastBin(950);//last bin
76 clusters->SetMaxNoiseAbs(2);//maximal noise
77 clusters->SetMaxNoiseSigma(3);//maximal amount of sigma of noise
79 //set cluster finder parameters (from MC)
80 clusters->SetMinAdc(3);//signal threshold (everything below is treated as 0)
81 clusters->SetMinTimeBins(2);//number of neighbouring timebins
82 clusters->SetMaxPadRangeCm(5.);//distance of the cluster center to the center of a pad (in cm)
83 clusters->SetMaxRowRangeCm(5.);//distance of the cluster center to the center of a padrow (in cm)
84 clusters->SetMaxTimeRange(5.);//distance of the cluster center to the max time bin on a pad (in tackts)
85 //ie. fabs(centerT - time)<7
86 clusters->SetValueToSize(7.);//cut reduce peak at 0
87 clusters->SetIsolCut(3);//set isolation cut threshold
89 AliRawReader *reader = new AliRawReaderRoot(fileName);
95 AliAltroRawStreamFast* stream = new AliAltroRawStreamFast(reader);
96 stream->SelectRawData("TPC");
99 while (reader->NextEvent()) {
100 //output for each event
103 cout<<"Evt = "<<evtnr<<endl;
104 clusters->FinderIO(reader);
106 AliSysInfo::AddStamp(Form("Event%d",evtnr),evtnr);
110 mytree->Print();//print rootuple summary
111 // Save all objects in this file
118 printf("Deleting clusterer\n");
120 printf("Deleting stream\n");
122 printf("Deleting raw reader\n");
125 // TCanvas *c2=new TCanvas("c2","title",800,800);
126 // c2->SetHighLightColor(2);
127 // c2->Range(-458.9552,-2948.238,3296.642,26856.6);
128 // c2->SetBorderSize(2);
129 // c2->SetLeftMargin(0.15);
130 // c2->SetRightMargin(0.06);
131 // c2->SetFrameFillColor(0);
133 // gStyle->SetOptStat(111111);
135 // c2->Print("rows.ps");
137 // c2->Print("pads.ps");
138 // histoTime->Draw();
139 // c2->Print("timebins.ps");
140 // histoRowPad->Draw();
141 // c2->Print("row-pad.ps");
147 Int_t FindKrClusterCheck(const char *fileName){
150 gSystem->Load("$ROOTSYS/lib/libGui.so");
151 gSystem->Load("$ROOTSYS/lib/libTree.so");
152 gSystem->Load("$MEMSTAT/libMemStat.so");
154 TMemStat memstat(1000000,100000,kTRUE);
155 AliSysInfo::AddCallBack(TMemStatManager::GetInstance()->fStampCallBack);
156 FindKrClustersRaw(fileName);
158 // the output memstat.root file
159 TMemStat draw("memstat.root");
160 // Print some information
162 draw.MakeReport(0,0);