]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/offline/AliHLTTPCOfflineCluster.cxx
using constructor for initialization
[u/mrichter/AliRoot.git] / HLT / TPCLib / offline / AliHLTTPCOfflineCluster.cxx
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   AliHLTTPCOfflineCluster.cxx
20     @author Kalliopi Kanaki
21     @date   
22     @brief  Cluster converter from offline to HLT format and back
23 */
24
25 #include "AliHLTTPCOfflineCluster.h"
26 #include "AliHLTTPCTransform.h"
27 #include "TObjArray.h"
28 #include <sys/time.h>
29
30 #if __GNUC__ >= 3
31 using namespace std;
32 #endif
33
34 ClassImp(AliHLTTPCOfflineCluster)
35
36 AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster()
37 {
38 //constructor  
39 }
40
41 AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster(const AliHLTTPCSpacePointData& /*hltCluster*/){
42   
43 }
44
45 AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster(const AliTPCclusterMI& /*offCluster*/){
46  
47 }
48
49 AliHLTTPCOfflineCluster& AliHLTTPCOfflineCluster::operator=(const AliTPCclusterMI& /*offCluster*/){
50   return *this;
51 }
52
53 AliHLTTPCOfflineCluster::~AliHLTTPCOfflineCluster(){
54
55
56   //destructor  
57 }
58
59 AliTPCclusterMI* AliHLTTPCOfflineCluster::ConvertHLTToOffline(AliHLTTPCSpacePointData spacePoint){
60    
61    AliTPCclusterMI *offCluster = new AliTPCclusterMI();
62    
63    offCluster->SetRow((Int_t)spacePoint.fPadRow); // padrow
64    offCluster->SetX(spacePoint.fX);               // X coordinate in slice system
65    offCluster->SetY(spacePoint.fY);               // Y coordinate in slice system
66    offCluster->SetZ(spacePoint.fZ);               // Z coordinate in slice system
67    offCluster->SetQ(spacePoint.fCharge);          // charge
68    offCluster->SetMax(spacePoint.fQMax);          // max Q (amplitude)
69    offCluster->SetSigmaY2(spacePoint.fSigmaY2);   // error in Y direction
70    offCluster->SetSigmaZ2(spacePoint.fSigmaZ2);   // error in Z direction
71    //offCluster->SetDetector(0);                  // detector/slice
72    //offCluster->SetType(0);                      // default from constructor
73    //offCluster->IsUsed(0);                       // default from constructor
74    //offCluster->SetInfo(NULL);                   // default from constructor
75         
76    return offCluster;
77 }
78
79
80 AliHLTTPCSpacePointData AliHLTTPCOfflineCluster::ConvertOfflineToHLT(AliTPCclusterMI *offCluster){
81
82      
83    AliHLTTPCSpacePointData spacePoint;
84        
85    spacePoint.fPadRow  = offCluster->GetRow();
86    spacePoint.fX       = offCluster->GetX(); // these are in the detector system
87    spacePoint.fY       = offCluster->GetY(); // the HLT clusters have to be transformed to the slice system
88    spacePoint.fZ       = offCluster->GetZ(); // for the X, Y, Z to be consistent with our definitions
89    spacePoint.fCharge  = (UInt_t)offCluster->GetQ();
90    spacePoint.fQMax    = (UInt_t)offCluster->GetMax();
91    spacePoint.fSigmaY2 = offCluster->GetSigmaY2();
92    spacePoint.fSigmaZ2 = offCluster->GetSigmaZ2();
93    
94    return spacePoint;
95    
96 }