]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/test/testAliHLTTPCOfflineCluster.C
added converter for offline cluster format; added histogram handler (Kelly)
[u/mrichter/AliRoot.git] / HLT / TPCLib / test / testAliHLTTPCOfflineCluster.C
1 // $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
5  * ALICE Experiment at CERN, All rights reserved.                         *
6  *                                                                        *
7  * Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no>        *
8  *                  for The ALICE HLT Project.                            *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 /** @file   testAliHLTTPCOfflineCluster.C
20     @author Kalliopi Kanaki
21     @date   
22     @brief  Test macro/program for the AliHLTTPCOfflineCluster class
23  */
24
25 #ifndef __CINT__
26 #include "TSystem.h"
27
28 #include "AliHLTTPCTransform.h"
29 #include "AliHLTTPCClusterData.h"
30 #include "AliHLTTPCSpacePointData.h"
31 #include "AliHLTTPCOfflineCluster.h"
32 #include "TObjArray.h"
33
34 #include <ostream>
35 #include <istream>
36 #endif //__CINT__
37
38 using namespace std;
39
40 /////////////////////////////////////////////////////////////////
41 /////////////////////////////////////////////////////////////////
42 /////////////////////////////////////////////////////////////////
43 //
44 // configuration of the test program
45 //
46 /////////////////////////////////////////////////////////////////
47 /////////////////////////////////////////////////////////////////
48 /////////////////////////////////////////////////////////////////
49  
50
51
52 #include "/scratch/prog/HLT/TPCLib/AliHLTTPCSpacePointData.h";
53
54 int testAliHLTTPCOfflineCluster(){
55 //#ifdef __CINT__
56   //gSystem->Load("libAliHLTUtil.so");
57   gSystem->Load("libAliHLTTPC.so");
58 //#endif
59
60   int iResult=0;
61   
62   
63
64
65
66  AliHLTTPCSpacePointData spacePoint1 = { 5.,3.,2.,7,8,11.2,5.4.,1,0,kFALSE,0 };
67
68 //   AliHLTTPCSpacePointData *spacePoint = new AliHLTTPCSpacePointData(); //[1];
69 //   spacePoint->fX = 3.;
70 //   spacePoint->fY = 2.;
71 //   spacePoint->fZ = 5.;
72    
73   cout << "hlt X: "      <<        spacePoint1.fX      << endl;
74   cout << "hlt padrow: " << (Int_t)spacePoint1.fPadRow << endl;
75   cout << "hlt Z: "      <<        spacePoint1.fZ      << endl;
76   
77   
78   //Float_t xyz[3] = {spacePoint1.fX , spacePoint1.fPadRow, spacePoint1.fZ };
79   //AliHLTTPCTransform::Local2Global(xyz,36);  
80   //cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << endl;
81
82   AliTPCclusterMI *offCl1 = new AliTPCclusterMI();  
83   AliHLTTPCOfflineCluster *p1 = new AliHLTTPCOfflineCluster();
84    
85   offCl1 = p1->ConvertHLTToOffline(spacePoint1);
86   //offCl1 = new AliHLTTPCOfflineCluster(spacePoint1); // ??? to be tested
87
88   cout << "off pad: "      << offCl1->GetPad() << endl;
89   cout << "off row: "      << offCl1->GetRow() << endl;
90   cout << "off time bin: " << offCl1->GetTimeBin() << endl;
91   
92   cout << "================================" << endl;  
93   
94   AliTPCclusterMI *offCl2 = new AliTPCclusterMI();
95   offCl2->SetPad(2.5);
96   offCl2->SetRow(4);
97
98   cout << "off pad: " << offCl2->GetPad() << endl;
99   cout << "off row: " << offCl2->GetRow() << endl;
100   
101   AliHLTTPCOfflineCluster *p2 = new AliHLTTPCOfflineCluster();
102   AliHLTTPCSpacePointData spacePoint2 = p2->ConvertOfflineToHLT(offCl2);
103   
104   cout << "hlt X: "      << spacePoint2.fX             << endl;
105   cout << "hlt padrow: " << (Int_t)spacePoint2.fPadRow << endl;
106
107   return iResult;
108   //delete [] spacePoint;
109  
110 }
111
112 int main(int /*argc*/, const char** /*argv*/){
113
114   return testAliHLTTPCOfflineCluster();
115 }