Line data Source code
1 : //**************************************************************************
2 : //* This file is property of and copyright by the ALICE HLT Project *
3 : //* ALICE Experiment at CERN, All rights reserved. *
4 : //* *
5 : //* Primary Authors: Sergey Gorbunov <sergey.gorbunov@cern.ch> *
6 : //* for The ALICE HLT Project. *
7 : //* *
8 : //* Permission to use, copy, modify and distribute this software and its *
9 : //* documentation strictly for non-commercial purposes is hereby granted *
10 : //* without fee, provided that the above copyright notice appears in all *
11 : //* copies and that both the copyright notice and this permission notice *
12 : //* appear in the supporting documentation. The authors make no claims *
13 : //* about the suitability of this software for any purpose. It is *
14 : //* provided "as is" without express or implied warranty. *
15 : //**************************************************************************
16 :
17 : /** @file AliHLTTPCFastTransformObject.cxx
18 : @author Sergey Gorbubnov
19 : @date
20 : @brief
21 : */
22 :
23 :
24 : #include "AliHLTTPCFastTransformObject.h"
25 : #include "TCollection.h"
26 : #include "TIterator.h"
27 :
28 6 : ClassImp(AliHLTTPCFastTransformObject); //ROOT macro for the implementation of ROOT specific class methods
29 :
30 :
31 0 : AliHLTTPCFastTransformObject::AliHLTTPCFastTransformObject()
32 : :
33 0 : TObject(),
34 0 : fVersion(0),
35 0 : fLastTimeBin(0),
36 0 : fTimeSplit1(0),
37 0 : fTimeSplit2(0),
38 0 : fAlignment(0)
39 0 : {
40 : // constructor
41 0 : for (int i = 0;i < fkNSec;i++) fSectorInit[i] = false;
42 :
43 0 : Reset();
44 0 : }
45 :
46 :
47 :
48 : void AliHLTTPCFastTransformObject::Reset()
49 : {
50 : // Deinitialisation
51 0 : fLastTimeBin = 0.;
52 0 : fTimeSplit1 = 0.;
53 0 : fTimeSplit2 = 0.;
54 0 : for( Int_t i=0; i<fkNSplinesIn + fkNSplinesOut; i++) fSplines[i].Reset();
55 0 : fAlignment.Set(0);
56 0 : }
57 :
58 0 : AliHLTTPCFastTransformObject::AliHLTTPCFastTransformObject( const AliHLTTPCFastTransformObject &o )
59 : :
60 0 : TObject( o ),
61 0 : fVersion(0),
62 0 : fLastTimeBin(o.fLastTimeBin),
63 0 : fTimeSplit1(o.fTimeSplit1),
64 0 : fTimeSplit2(o.fTimeSplit2),
65 0 : fAlignment(o.fAlignment)
66 0 : {
67 : // constructor
68 0 : for( Int_t i=0; i<fkNSplinesIn + fkNSplinesOut; i++){
69 0 : fSplines[i] = o.fSplines[i];
70 : }
71 0 : }
72 :
73 : AliHLTTPCFastTransformObject& AliHLTTPCFastTransformObject::operator=( const AliHLTTPCFastTransformObject &o)
74 : {
75 : // assignment operator
76 0 : new (this) AliHLTTPCFastTransformObject( o );
77 0 : return *this;
78 0 : }
79 :
80 : void AliHLTTPCFastTransformObject::Merge(const AliHLTTPCFastTransformObject& obj)
81 : {
82 0 : for (int i = 0;i < fkNSecIn;i++)
83 : {
84 0 : if (!obj.IsSectorInit(i)) continue;
85 0 : for(int iRow=0;iRow<fkNRowsIn;iRow++)
86 : {
87 0 : for(int iSpline=0;iSpline<3;iSpline++)
88 : {
89 0 : GetSplineInNonConst(i, iRow, iSpline) = obj.GetSplineIn(i, iRow, iSpline);
90 : }
91 : }
92 0 : fSectorInit[i] = true;
93 0 : }
94 :
95 0 : for (int i = 0;i < fkNSecOut;i++)
96 : {
97 0 : if (!obj.IsSectorInit(fkNSecIn+i)) continue;
98 0 : for(int iRow=0;iRow<fkNRowsOut;iRow++)
99 : {
100 0 : for(int iSpline=0;iSpline<3;iSpline++)
101 : {
102 0 : GetSplineOutNonConst(i, iRow, iSpline) = obj.GetSplineOut(i, iRow, iSpline);
103 : }
104 : }
105 0 : fSectorInit[fkNSecIn+i] = true;
106 0 : }
107 0 : }
108 :
109 : Long64_t AliHLTTPCFastTransformObject::Merge(TCollection* list)
110 : {
111 0 : if (list == NULL || list->GetSize() == 0) return(0); //Nothing to do!
112 0 : TIterator* iter = list->MakeIterator();
113 : TObject* obj;
114 : int nMerged = 0;
115 0 : while (obj = iter->Next())
116 : {
117 0 : AliHLTTPCFastTransformObject* mergeObj = dynamic_cast<AliHLTTPCFastTransformObject*>(obj);
118 0 : if (mergeObj && mergeObj != this)
119 : {
120 0 : Merge(*mergeObj);
121 0 : nMerged++;
122 0 : }
123 : }
124 0 : return(nMerged);
125 0 : }
|