]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/offline/AliHLTTPCOfflineCluster.cxx
Added a new component (AliHLTTPCHWCFDataReverterComponent) which reads the data,...
[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->SetPad(spacePoint.fX);             // pad   
64    offCluster->SetRow((Int_t)spacePoint.fPadRow); // row 
65    offCluster->SetTimeBin(spacePoint.fZ);         // time bin
66    offCluster->SetQ(spacePoint.fCharge);          // charge
67    offCluster->SetMax(spacePoint.fQMax);          // max Q (amplitude)
68    //offCluster->SetDetector(0);                  // detector/slice
69    //offCluster->SetType(0);                      // default from constructor
70    //offCluster->IsUsed(0);                       // default from constructor
71    //offCluster->SetInfo(NULL);                   // default from constructor
72      
73    return offCluster;
74 }
75
76
77 AliHLTTPCSpacePointData AliHLTTPCOfflineCluster::ConvertOfflineToHLT(AliTPCclusterMI *offCluster){
78
79      
80    AliHLTTPCSpacePointData spacePoint = { 0.,0.,0.,0,0,0.,0.,0,0,kFALSE,0 };
81        
82    spacePoint.fX      = offCluster->GetPad();
83    spacePoint.fPadRow = offCluster->GetRow();
84    spacePoint.fZ      = offCluster->GetTimeBin();
85    spacePoint.fCharge = (UInt_t)offCluster->GetQ();
86    spacePoint.fQMax   = (UInt_t)offCluster->GetMax();
87
88    return spacePoint;
89    
90 }