]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCTestMerge.C
Added missing #include (messed up with dicts)
[u/mrichter/AliRoot.git] / TPC / AliTPCTestMerge.C
index 25c5559101bb617b9df50fd62681127cb2f08cf7..1a26192ac920d61204bdc939d8a03bebf7d9adc6 100644 (file)
@@ -8,45 +8,46 @@
 
 #endif
 
-// Marian Ivanov
-// test of the tpc merging using AliRunDigitizer and 
-// TPC  Hits2Digits, Hits2SDigits and SDigits2Digits macros
-
-// preparation  
-// 0. make 2 directorys - ev1 and ev2
-
-// 1.make hits, digits,sdigits and sdigits-digits in both directories 
-//  1.a  galice -b -q grun.C and produce hits
-//  1.b. cp galice.root galice.root.hits
-//  1.c  run AliTPCHits2Digits.C
-//  1.d  cp galice.root galice.root.digits
-//  1.e  copy back cp galice.root.hits galice.root
-//  1.f  run AliTPCSDigits2Digits.C
-//  1.g  cp galice.root  galice.root.sdigits
-//  1.h  run AliTPCSDigits2Digit.C 
-//  1.i  cp galice.root galice.root.dig2
-
-// 2. cp ev1/galice.root/galice.root.sdigit galice.root
-// 3. load this macro and run testmerge()
-
-// 4. run test function bellow to compare merged digits with original one
-// 5. to be  noticed output ftom testx() function - should be bigger than
-//    noise because in proces of digitisation we use different seed
-//    of random numbers for diffusion and gas gain
-//    -anyway in place where we have the signal should occur the signal in both casses
-//    - only the amplitude should be different - by factor of sqrt
-
+/// \file AliTPCTestMerge.C
+///
+/// test of the tpc merging using AliRunDigitizer and
+/// TPC  Hits2Digits, Hits2SDigits and SDigits2Digits macros
+/// preparation
+/// 0. make 2 directorys - ev1 and ev2
+/// 1.make hits, digits,sdigits and sdigits-digits in both directories
+///  1.a  galice -b -q grun.C and produce hits
+///  1.b. cp galice.root galice.root.hits
+///  1.c  run AliTPCHits2Digits.C
+///  1.d  cp galice.root galice.root.digits
+///  1.e  copy back cp galice.root.hits galice.root
+///  1.f  run AliTPCSDigits2Digits.C
+///  1.g  cp galice.root  galice.root.sdigits
+///  1.h  run AliTPCSDigits2Digit.C
+///  1.i  cp galice.root galice.root.dig2
+/// 2. cp ev1/galice.root/galice.root.sdigit galice.root
+/// 3. load this macro and run testmerge()
+/// 4. run test function bellow to compare merged digits with original one
+/// 5. to be  noticed output ftom testx() function - should be bigger than
+///    noise because in proces of digitisation we use different seed
+///    of random numbers for diffusion and gas gain
+///    -anyway in place where we have the signal should occur the signal in both casses
+///    - only the amplitude should be different - by factor of sqrt
+///
+/// \author Marian Ivanov
       
 void testmerge()
 {
-  // merge two example events
-  //
-  //it merge two events -one from current directory -second from directory ev2
-  
+  /// merge two example events
+  /// 
+  /// it merge two events -one from current directory -second from directory ev2
+
+  if(gAlice) delete gAlice;
   AliRunDigitizer * manager = new AliRunDigitizer(2,1);
+  manager->SetTreeDTPCBaseName("TreeD_75x40_100x60_150x60_");
+  manager->SetInputTreeTPCSBaseName("TreeS_75x40_100x60_150x60_");
   manager->SetInputStream(0,"galice.root");
   manager->SetInputStream(1,"ev2/galice.root.sdigits");
-  AliTPCDigitizer dTPC(manager);
+  AliTPCDigitizer *dTPC = new AliTPCDigitizer(manager);
   manager->SetNrOfEventsToWrite(1); 
   TStopwatch timer;
   timer.Start();
@@ -59,15 +60,16 @@ void testmerge()
 
 void drawmerged(Int_t sec, Int_t row, Int_t x1=-1, Int_t x2=-1, Int_t y1=-1, Int_t y2=-1)
 {
-  //if you think that there is memory leak -
-  //you are tru but othervise graphic doesn't work
-  // sec=0; row =0;
+  /// if you think that there is memory leak -
+  /// you are tru but othervise graphic doesn't work
+  /// sec=0; row =0;
+
   TFile * f = new TFile("galice.root");
   TFile * f1= new TFile("ev1/galice.root.digits");
   TFile * f2= new TFile("ev2/galice.root.digits");
-  TTree * tree = (TTree*)f->Get("TreeD_75x40_100x60_0");
-  TTree * tree1 = (TTree*)f1->Get("TreeD_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2->Get("TreeD_75x40_100x60_0");
+  TTree * tree = (TTree*)f->Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree1 = (TTree*)f1->Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2->Get("TreeD_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig=0;
   AliSimDigits *dig1=0;
@@ -77,6 +79,11 @@ void drawmerged(Int_t sec, Int_t row, Int_t x1=-1, Int_t x2=-1, Int_t y1=-1, Int
   tree1->GetBranch("Segment")->SetAddress(&dig1);
   tree2->GetBranch("Segment")->SetAddress(&dig2);
   AliTPCParam * param =(AliTPCParam*) f->Get("75x40_100x60");
+  if(param){
+    delete param;
+    param=new AliTPCParamSR();
+  }
+  else param=(AliTPCParam*) f->Get("75x40_100x60_150x60");
   Int_t index = param->GetIndex(sec,row);
   tree->GetEvent(index);
   tree1->GetEvent(index);
@@ -113,7 +120,7 @@ void drawmerged(Int_t sec, Int_t row, Int_t x1=-1, Int_t x2=-1, Int_t y1=-1, Int
 
 void drawd(TFile * f, Int_t amp1, Int_t amp2)
 {
-  TTree * tree = (TTree*)f->Get("TreeD_75x40_100x60_0");
+  TTree * tree = (TTree*)f->Get("TreeD_75x40_100x60_150x60_0");
   AliSimDigits *dig=0;
   tree->GetBranch("Segment")->SetAddress(&dig); 
   TH1F * his = new TH1F("his","his",amp2-amp1,amp1,amp2);
@@ -132,14 +139,15 @@ void drawd(TFile * f, Int_t amp1, Int_t amp2)
 }
 
 void test1(){
-  //test of the merged digits
-  //compare merged digits with standard digits
+  /// test of the merged digits
+  /// compare merged digits with standard digits
+
   TFile f("galice.root");
   TFile f1("ev1/galice.root.digits");
   TFile f2("ev2/galice.root.digits");
-  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_0");
-  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_0");
+  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig=0;
   AliSimDigits *dig1=0;
@@ -172,14 +180,14 @@ void test1(){
 }
 
 void test5(){
-  //
-  //compare merged digits with digits obtained hits2sdig->sdigtodig
+  /// compare merged digits with digits obtained hits2sdig->sdigtodig
+
   TFile f("galice.root");
   TFile f1("ev1/galice.root.dig2");
   TFile f2("ev2/galice.root.dig2");
-  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_0");
-  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_0");
+  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_150x60_0");
 
   AliSimDigits *dig=0;
   AliSimDigits *dig1=0;
@@ -217,13 +225,14 @@ void test5(){
 }
 
 void test3(){
-  //test of the merged digits
+  /// test of the merged digits
+
   TFile f("galice.root");
   TFile f1("ev1/galice.root.sdigits");
   TFile f2("ev2/galice.root.sdigits");
-  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_0");
-  TTree * tree1 = (TTree*)f1.Get("TreeS_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeS_75x40_100x60_0");
+  TTree * tree = (TTree*)f.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeS_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeS_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig=0;
   AliSimDigits *dig1=0;
@@ -262,13 +271,14 @@ void test3(){
 
 
 void TestSDigitsDig2(){
-  //test of the digits produced by the Hits2Digits 
-  //and Hits2SDigits - SDigits2Digits chain
+  /// test of the digits produced by the Hits2Digits
+  /// and Hits2SDigits - SDigits2Digits chain
+
   TFile f1("galice.root.digits");
   TFile f2("galice.root.dig2");
   //
-  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig1=0;
   AliSimDigits *dig2=0;
@@ -315,13 +325,14 @@ void TestSDigitsDig2(){
 }
 
 void TestSDigitsDig1(){
-  //test of the digits produced by the Hits2Digits 
-  //and Hits2SDigits - SDigits2Digits chain
+  /// test of the digits produced by the Hits2Digits
+  /// and Hits2SDigits - SDigits2Digits chain
+
   TFile f1("galice.root.digits");
   TFile f2("galice.root.dig2");
   //
-  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeD_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig1=0;
   AliSimDigits *dig2=0;
@@ -362,11 +373,12 @@ void TestSDigitsDig1(){
 
 
 void test4(){
-  //TPC internal test
+  /// TPC internal test
+
   TFile f1("galice.root.sdigits");
   TFile f2("galice.root.digits");
-  TTree * tree1 = (TTree*)f1.Get("TreeS_75x40_100x60_0");
-  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_0");
+  TTree * tree1 = (TTree*)f1.Get("TreeS_75x40_100x60_150x60_0");
+  TTree * tree2 = (TTree*)f2.Get("TreeD_75x40_100x60_150x60_0");
   //
   AliSimDigits *dig1=0;
   AliSimDigits *dig2=0;