]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/FindKrClusters.C
CMake: Changing DA detector name to DA0 to match DAQ settings
[u/mrichter/AliRoot.git] / TPC / FindKrClusters.C
index 42da96202f967981ca25fa19bf946642e166f16c..5f1c4aad553f86f5b31dd82fbcc7a05f51f9e073 100644 (file)
@@ -1,22 +1,19 @@
-/****************************************************************************
- *           Origin: A.Matyja amatyja@cern.ch                               *
- ****************************************************************************/
-
-/*
-
-  macro to create array of clusters from TPC digits
-  input files - galice.root 
-                digits.root - file with digits - usualy use link to galice.root
-                           - in splitted mode - neccesary to create link to proper file
-                           
-   output file - TPC.RecPoints.root
-
-
-//  Warning - if cluster file AliTPCclusters.root already exist - macro exit and don't produce anything
-              
-*/
-
+/// \file FindKrClusters.C
+/// \brief Macro to create array of clusters from TPC digits
+///
+/// Input files:
+///
+/// * galice.root
+/// * digits.root: file with digits - usualy use link to galice.root
+///   in splitted mode - neccesary to create link to proper file
+///
+/// Output file:
+///
+/// * TPC.RecPoints.root
+///
+/// Warning - if cluster file AliTPCclusters.root already exist - macro exit and don't produce anything
+///
+/// \author A.Matyja amatyja@cern.ch
 
 #ifndef __CINT__
 #include <iostream.h>
 
 Int_t FindKrClusters(){
 
+  // Load DataBase
+  //char *ocdbpath ="local:///afs/cern.ch/alice/tpctest/OCDB";
+  //char *ocdbpath ="local:///home/matyja/baza/OCDB";
+  char *ocdbpath ="local:///data/baza/OCDB";
+  if (ocdbpath==0){
+    ocdbpath="alien://folder=/alice/data/2007/LHC07w/OCDB/";
+  }
+  printf("OCDB PATH = %s\n",ocdbpath); 
+  AliCDBManager * man = AliCDBManager::Instance();
+  man->SetDefaultStorage(ocdbpath);
+  man->SetRun(0);
+
   AliRunLoader* rl = AliRunLoader::Open("galice.root");
   if (rl == 0x0) {
     cerr<<"Can not open session"<<endl;
@@ -78,7 +87,23 @@ Int_t FindKrClusters(){
   TStopwatch timer;
   timer.Start();
   cwd->cd();
+
+  TTree *output_tree;
   
+  AliTPCclustererKr *clusters = new AliTPCclustererKr();
+  clusters->SetParam(param);
+  clusters->SetOutput(output_tree);
+
+  clusters->SetMinAdc(3);//signal threshold (everything below is treated as 0)
+  clusters->SetMinTimeBins(2);//number of neighbouring timebins
+  clusters->SetMaxPadRangeCm(5.);//distance of the cluster center to the center of a pad (in cm)
+  clusters->SetMaxRowRangeCm(5.);//distance of the cluster center to the center of a padrow (in cm)
+  clusters->SetMaxTimeRange(7.);//distance of the cluster center to the max time bin on a pad (in tackts)
+  //ie. fabs(centerT - time)<7
+
+  clusters->SetIsolCut(3);//set isolation cut threshold
+  clusters->SetValueToSize(3.1);//cut reduce peak at 0
+
   Int_t nevmax=rl->GetNumberOfEvents();//number of events in run
   for(Int_t nev=0;nev<nevmax /*&& nev<1*/ ;nev++){
     rl->GetEvent(nev);
@@ -88,35 +113,14 @@ Int_t FindKrClusters(){
       cerr << "Can not get TreeD for event " <<nev<<endl;
       continue;
     }
-    
     digarr->ConnectTree(input_tree);
-    
-    TTree *output_tree =tpcl->TreeR();
-    if(output_tree==0x0){
-      tpcl->MakeTree("R");
-      output_tree = tpcl->TreeR();
-      if (output_tree == 0x0){
-       cerr << "Problems with output tree (TreeR) for event "<<nev<<endl;
-       continue;
-      }
-    }
-    
-    cout<<"Processing event "<<nev<<endl;
-
-    //test
-    //cout<<"nentries"<<input_tree->GetEntries();
-
-    AliTPCclustererKr *clusters = new AliTPCclustererKr();
-    clusters->SetParam(param);
     clusters->SetInput(input_tree);
-    clusters->SetOutput(output_tree);
     clusters->SetDigArr(digarr);
+    cout<<"Processing event "<<nev<<endl;
     clusters->FinderIO();
 
-    tpcl->WriteRecPoints("OVERWRITE");
   }
-  
-
+  delete clusters;
   timer.Stop(); timer.Print();
   
   delete rl;//cleans everything