1 /// \file FindKrClusters.C
2 /// \brief Macro to create array of clusters from TPC digits
7 /// * digits.root: file with digits - usualy use link to galice.root
8 /// in splitted mode - neccesary to create link to proper file
12 /// * TPC.RecPoints.root
14 /// Warning - if cluster file AliTPCclusters.root already exist - macro exit and don't produce anything
16 /// \author A.Matyja amatyja@cern.ch
22 #include "AliTPCParam.h"
23 #include "AliTPCclusterKr.h"
24 #include "AliTPCclustererKr.h"
26 #include "TStopwatch.h"
30 Int_t FindKrClusters(){
33 //char *ocdbpath ="local:///afs/cern.ch/alice/tpctest/OCDB";
34 //char *ocdbpath ="local:///home/matyja/baza/OCDB";
35 char *ocdbpath ="local:///data/baza/OCDB";
37 ocdbpath="alien://folder=/alice/data/2007/LHC07w/OCDB/";
39 printf("OCDB PATH = %s\n",ocdbpath);
40 AliCDBManager * man = AliCDBManager::Instance();
41 man->SetDefaultStorage(ocdbpath);
44 AliRunLoader* rl = AliRunLoader::Open("galice.root");
46 cerr<<"Can not open session"<<endl;
50 AliTPCLoader *tpcl = (AliTPCLoader*)rl->GetLoader("TPCLoader");
52 cerr<<"Can not get TPC Loader"<<endl;
56 if (tpcl->LoadDigits()) {
57 cerr<<"Error occured while loading digits"<<endl;
61 if (rl->LoadgAlice()) {
62 cerr<<"Error occured while LoadgAlice"<<endl;
66 gAlice=rl->GetAliRun();
68 cerr<<"Can't get gAlice !\n";
72 TDirectory *cwd = gDirectory;
74 AliTPCv4 *tpc = (AliTPCv4*)gAlice->GetDetector("TPC");
75 Int_t ver = tpc->IsVersion();
76 cerr<<"TPC version "<<ver<<" has been found !\n";
80 AliTPCParam *param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
81 if (!param) {cerr<<"TPC parameters have not been found !\n"; return 4;}
83 AliTPCDigitsArray *digarr=new AliTPCDigitsArray;
86 cerr<<"It has begun"<<endl;
93 AliTPCclustererKr *clusters = new AliTPCclustererKr();
94 clusters->SetParam(param);
95 clusters->SetOutput(output_tree);
97 clusters->SetMinAdc(3);//signal threshold (everything below is treated as 0)
98 clusters->SetMinTimeBins(2);//number of neighbouring timebins
99 clusters->SetMaxPadRangeCm(5.);//distance of the cluster center to the center of a pad (in cm)
100 clusters->SetMaxRowRangeCm(5.);//distance of the cluster center to the center of a padrow (in cm)
101 clusters->SetMaxTimeRange(7.);//distance of the cluster center to the max time bin on a pad (in tackts)
102 //ie. fabs(centerT - time)<7
104 clusters->SetIsolCut(3);//set isolation cut threshold
105 clusters->SetValueToSize(3.1);//cut reduce peak at 0
107 Int_t nevmax=rl->GetNumberOfEvents();//number of events in run
108 for(Int_t nev=0;nev<nevmax /*&& nev<1*/ ;nev++){
111 TTree* input_tree= tpcl->TreeD();//tree with digits
112 if (input_tree == 0x0){
113 cerr << "Can not get TreeD for event " <<nev<<endl;
116 digarr->ConnectTree(input_tree);
117 clusters->SetInput(input_tree);
118 clusters->SetDigArr(digarr);
119 cout<<"Processing event "<<nev<<endl;
120 clusters->FinderIO();
124 timer.Stop(); timer.Print();
126 delete rl;//cleans everything