3 // Original: AliHLTTransform.cxx,v 1.53 2005/06/14 10:55:21 cvetan
5 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, Uli Frankenfeld <mailto:franken@fi.uib.no>, Constantin Loizides <mailto:loizides@ikf.uni-frankfurt.de>
6 //*-- Copyright © ALICE HLT Group
13 #include <AliTPCParamSR.h>
14 #include <AliTPCPRF2D.h>
15 #include <AliTPCRF1D.h>
20 #include <TTimeStamp.h>
21 #include <TUnixSystem.h>
24 #include "AliHLTTPCLogging.h"
25 #include "AliHLTTPCTransform.h"
27 #if defined(__GNUC__) && __GNUC__ >= 3
31 /** \class AliHLTTPCTransform
33 //_____________________________________________________________
36 // Transformation class for ALICE TPC.
38 // Class which contains all detector specific parameters for the TPC,
39 // and different useful functions for coordinate transforms.
41 // The class is completely static, which means that no object needs
42 // to be instantiated. Function calls should then be done like, e.g.:
44 // Double_t eta = AliHLTTPCTransform::GetEta(xyz);
46 // IMPORTANT: If used as is, default detector parameters will be used,
47 // and you really have to make sure that these correspond to
48 // the AliROOT version you are currently working on!!
49 // You should therefore always initialize the parameters by
51 // AliHLTTPCTransform::Init(path);
53 // where path is a char*, giving the path to where file containing
54 // the detector parameter is located. This file should be called
55 // "l3transform.config", and can be created with the function MakeInitFile.
57 // You can also force reading the parameters from a AliTPCParam object
58 // by setting the flag;
60 // AliHLTTPCTransform::Init(path,kTRUE);
62 // where path is a char*
63 // either providing the rootfile name containing the geometry or
64 // the path to the rootfile which should then be called alirunfile.root.
65 // Note that for both of these cases you have to
66 // compile with USEPACKAGE=ALIROOT set (see level3code/Makefile.conf).
68 // Currently, there are 4 versions of the Transformer:
69 // fVersion==kValiroot: ALIROOT-head compatible
70 // fVersion==kVcosmics: Cosmics data run (2003) compatible
71 // fVersion==kVdefault: means no config file has been loaded
72 // fVersion==kVdeprecated: dont use old (before July 2003) style of transformer
78 ClassImp(AliHLTTPCTransform)
80 AliHLTTPCTransform::AliHLTTPCTransform()
84 const Double_t AliHLTTPCTransform::fgkAnodeWireSpacing = 0.25; //Taken from the TDR
85 const Double_t AliHLTTPCTransform::fgkBFACT = 0.0029980; //Conversion Factor
86 const Double_t AliHLTTPCTransform::fgkPi = 3.141592653589793;
87 const Double_t AliHLTTPCTransform::fgk2Pi = 2*3.141592653589793;
88 const Double_t AliHLTTPCTransform::fgkPi2 = 0.5*3.141592653589793;
89 const Double_t AliHLTTPCTransform::fgkToDeg = 180/3.141592653589793;
91 //Defined by HLT and GSI
92 Int_t AliHLTTPCTransform::fgNPatches = 6;
94 // Old format, corresponding to IntegrTest-5 code and data
95 Int_t AliHLTTPCTransform::fgRows[6][2] = {{0,29},{30,62},{63,90},{91,116},{117,139},{140,158}};
96 Int_t AliHLTTPCTransform::fgNRows[6] = {30,33,28,26,23,19};
98 // New data corresponding to simulated raw data 2004-08-20, provided by Thomas Kuhr
99 Int_t AliHLTTPCTransform::fgRows[6][2] = {{0,30},{30,62},{63,90},{90,116},{117,139},{139,158}};
100 Int_t AliHLTTPCTransform::fgNRows[6] = {31,33,28,27,23,20};
103 // The following definition is generated by MakeInitFile function
104 Double_t AliHLTTPCTransform::fgBField = 0.5;
105 Double_t AliHLTTPCTransform::fgSolenoidBField = 5;
106 Double_t AliHLTTPCTransform::fgBFieldFactor = 1;
107 Int_t AliHLTTPCTransform::fgVersion = kVdefault;
108 Int_t AliHLTTPCTransform::fgNTimeBins = 1024; // = 1024; //446
109 Int_t AliHLTTPCTransform::fgNRowLow = 63;
110 Int_t AliHLTTPCTransform::fgNRowUp = 96;
111 Int_t AliHLTTPCTransform::fgNRowUp1 = 64;
112 Int_t AliHLTTPCTransform::fgNRowUp2 = 32;
113 Int_t AliHLTTPCTransform::fgNSectorLow = 36;
114 Int_t AliHLTTPCTransform::fgNSectorUp = 36;
115 Int_t AliHLTTPCTransform::fgNSector = 72;
116 Double_t AliHLTTPCTransform::fgPadPitchWidthLow = 0.4;
117 Double_t AliHLTTPCTransform::fgPadPitchWidthUp = 0.6;
118 Double_t AliHLTTPCTransform::fgZSigma = 0.2288;
119 Double_t AliHLTTPCTransform::fgZLength = 250.0000;
120 Double_t AliHLTTPCTransform::fgZWidth = AliHLTTPCTransform::fgZLength / (Double_t)AliHLTTPCTransform::fgNTimeBins ;//0.5660; // 0.2435; // 0.5660 // Width of time bins
121 Double_t AliHLTTPCTransform::fgZOffset = 0.6864;
122 Double_t AliHLTTPCTransform::fgDiffT = 0.0220;
123 Double_t AliHLTTPCTransform::fgDiffL = 0.0220;
124 Double_t AliHLTTPCTransform::fgOmegaTau = 0.1450;
125 Double_t AliHLTTPCTransform::fgInnerPadLength = 0.75;
126 Double_t AliHLTTPCTransform::fgOuter1PadLength = 1.00;
127 Double_t AliHLTTPCTransform::fgOuter2PadLength = 1.50;
128 Double_t AliHLTTPCTransform::fgInnerPRFSigma = 0.203811;
129 Double_t AliHLTTPCTransform::fgOuter1PRFSigma = 0.299325;
130 Double_t AliHLTTPCTransform::fgOuter2PRFSigma = 0.299323;
131 Double_t AliHLTTPCTransform::fgTimeSigma = 0.228809;
132 Int_t AliHLTTPCTransform::fgADCSat = 1024;
133 Int_t AliHLTTPCTransform::fgZeroSup = 0;
134 Int_t AliHLTTPCTransform::fgNSlice = 36;
135 Int_t AliHLTTPCTransform::fgNRow = 159;
136 Double_t AliHLTTPCTransform::fgNRotShift = 0.5;
137 Int_t AliHLTTPCTransform::fgSlice2Sector[36][2] = { { 0, 36},
175 Int_t AliHLTTPCTransform::fgSector2Slice[72] = { 0,
249 Int_t AliHLTTPCTransform::fgSectorLow[72] = { 1,
323 Double_t AliHLTTPCTransform::fgX[159] = { 85.195,
485 // New number of pads changed 2006-04-15 Jochen Thaeder
486 // changed according to formula in AliTPCROC.cxx
487 // according to real Pad Distribution on build TPC
488 Int_t AliHLTTPCTransform::fgNPads[159] = {68,
650 // OLD number of pads changed 2006-04-15 Jochen Thaeder
651 Int_t AliHLTTPCTransform::fgNPads[159] = {67,
813 Double_t AliHLTTPCTransform::fgCos[36] = { 0.9848077297,
851 Double_t AliHLTTPCTransform::fgSin[36] = { 0.1736481786,
889 Int_t AliHLTTPCTransform::GetNPads(Int_t row)
891 //get number of pads per row
892 if(row < 0 || row >= fgNRow)
894 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetNPads","Row")
895 <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG;
902 Int_t AliHLTTPCTransform::GetNumberOfPatches() {
906 Int_t AliHLTTPCTransform::GetFirstRow(Int_t patch)
908 //get first row per patch
912 else if(patch < -1 || patch >= 6)
914 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetFirstRow","Patch")
915 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
919 return fgRows[patch][0];
922 Int_t AliHLTTPCTransform::GetLastRow(Int_t patch)
924 //get last row per patch
927 else if(patch < -1 || patch >= 6)
929 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetLastRow","Patch")
930 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
934 return fgRows[patch][1];
937 Int_t AliHLTTPCTransform::GetFirstRowOnDDL(Int_t patch)
939 //get first row per patch
943 else if(patch < -1 || patch >= 6)
945 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetFirstRow","Patch")
946 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
951 if(patch==1) return fgRows[patch][0]+1;
952 return fgRows[patch][0];
956 Int_t AliHLTTPCTransform::GetLastRowOnDDL(Int_t patch)
958 //get last row per patch
961 else if(patch < -1 || patch >= 6)
963 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetLastRow","Patch")
964 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
969 if(patch==2 || patch==4) return fgRows[patch][1]-1;
970 return fgRows[patch][1];
974 Int_t AliHLTTPCTransform::GetNRows(Int_t patch)
976 //get number of rows per patch
979 else if(patch < -1 || patch >= 6)
981 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetNRows","Patch")
982 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
986 return fgNRows[patch];
989 Int_t AliHLTTPCTransform::GetPadRow(Float_t xvalue)
991 //Find the padrow number corresponding to cartesian _local_ x value
992 if(xvalue < 0 || xvalue > 250)
994 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadRow","X-value")
995 <<AliHLTTPCLog::kDec<<"Suspicious x-value, make sure it is in local coordinate! "
1000 Int_t x = (Int_t)rint(xvalue*10);
1001 if(x < (Int_t)rint(fgX[1]*10))
1003 else if(x > (Int_t)rint(fgX[fgNRow-2]*10))
1007 Int_t padrow=1; //Of course, a more clever algorithm could help here
1008 while(padrow < fgNRow-2)
1010 if(x > (Int_t)rint(fgX[padrow-1]*10) && x < (Int_t)rint(fgX[padrow+1]*10))
1018 Int_t AliHLTTPCTransform::GetPatch(Int_t padrow)
1020 //get patch for padrow
1021 if(padrow < 0 || padrow >= fgNRow)
1023 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPatch","Padrow")
1024 <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
1028 while(patch < fgNPatches)
1030 if(padrow >= fgRows[patch][0] && padrow <= fgRows[patch][1])
1037 Double_t AliHLTTPCTransform::GetPadLength(Int_t padrow)
1039 //get pad length for padrow
1040 if(padrow >= fgNRow){
1041 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadLength","Padrow")
1042 <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
1046 if(padrow < fgNRowLow)
1047 return fgInnerPadLength;
1048 if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1)
1049 return fgOuter1PadLength;
1050 if(padrow >= fgNRowLow + fgNRowUp1 - 1)
1051 return fgOuter2PadLength;
1053 //should never happen
1054 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadLength","Padrow")
1055 <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
1059 Double_t AliHLTTPCTransform::GetPadPitchWidth(Int_t patch)
1061 //get pad patch width for patch
1062 if(patch < 0 || patch > fgNPatches)
1064 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadPitchWidth","patct")
1065 <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG;
1068 return patch < 2 ? fgPadPitchWidthLow : fgPadPitchWidthUp;
1071 Double_t AliHLTTPCTransform::GetParSigmaY2(Int_t padrow,Float_t z,Float_t angle)
1073 //Calculate the expected transverse cluster width as a function of
1074 //drift distance and crossing angle.
1075 //z = local z-coordinate of cluster
1076 //angle = track crossing angle with normal to padrow plane
1077 //return value = sigma^2 (cartesian coordinates)
1081 drift = fgZLength - z;
1083 drift = fgZLength + z;
1085 Double_t t1 = GetPRFSigma(padrow)*GetPRFSigma(padrow);
1086 Double_t t2 = fgDiffT*fgDiffT*drift;
1087 Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tan(angle)*tan(angle)/12;
1088 Double_t t4 = fgkAnodeWireSpacing*fgkAnodeWireSpacing*(tan(angle) - fgOmegaTau)*(tan(angle) - fgOmegaTau)/12;
1090 return (t1 + t2 + t3 + t4);
1093 Double_t AliHLTTPCTransform::GetParSigmaZ2(Int_t padrow,Float_t z,Float_t tgl)
1095 //Calculate the expected longitudinal cluster width as a function of
1096 //drift distance and track crossing angle.
1097 //z = local z-coordinate of cluster
1098 //tgl = tan(dipangle)
1099 //return value = sigma^2 (cartesian coordinates)
1103 drift = AliHLTTPCTransform::GetZLength()-0.275 - z;
1105 drift = AliHLTTPCTransform::GetZLength()-0.302 + z;
1107 Double_t t1 = fgZSigma*fgZSigma;
1108 Double_t t2 = fgDiffL*fgDiffL*drift;
1109 Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tgl*tgl/12;
1111 return (t1 + t2 + t3);
1114 Double_t AliHLTTPCTransform::GetPRFSigma(Int_t padrow)
1116 //get sigma of pad response function for padrow
1118 if(padrow >= fgNRow){
1119 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPRFSigma","Padrow")
1120 <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
1123 if(padrow < fgNRowLow)
1124 return fgInnerPRFSigma;
1125 if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1)
1126 return fgOuter1PRFSigma;
1127 if(padrow >= fgNRowLow + fgNRowUp1 - 1)
1128 return fgOuter2PRFSigma;
1130 //should never happen
1131 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPRFSigma","Padrow")
1132 <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
1136 Double_t AliHLTTPCTransform::GetEta(Float_t *xyz)
1139 Double_t r3 = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
1140 Double_t eta = 0.5 * log((r3+xyz[2])/(r3-xyz[2]));
1144 void AliHLTTPCTransform::XYZtoRPhiEta(Float_t *rpe, Float_t *xyz)
1146 //transform xyz into rpe
1147 rpe[0] = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
1148 rpe[1] = atan2(xyz[1],xyz[0]);
1149 rpe[2] = 0.5 * log((rpe[0]+xyz[2])/(rpe[0]-xyz[2]));
1152 Double_t AliHLTTPCTransform::GetEta(Int_t slice,Int_t padrow,Int_t pad,Int_t time)
1157 Slice2Sector(slice,padrow,sector,row);
1158 Raw2Local(xyz,sector,row,pad,time);
1163 Double_t AliHLTTPCTransform::GetPhi(Float_t *xyz)
1166 Double_t phi = atan2(xyz[1],xyz[0]);
1170 Bool_t AliHLTTPCTransform::Slice2Sector(Int_t slice, Int_t slicerow, Int_t & sector, Int_t &row)
1172 //slice no to sector number
1173 //row no to local sector row no
1174 if(slicerow<0&&slicerow>=fgNRow){
1175 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Slice2Sector","Slicerow")
1176 <<AliHLTTPCLog::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG;
1179 if(slice<0||slice>=fgNSlice){
1180 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Slice2Sector","Slice")
1181 <<AliHLTTPCLog::kDec<<"Wrong slice "<<slice<<ENDLOG;
1185 if(slicerow<fgNRowLow){
1186 sector = fgSlice2Sector[slice][0];
1190 sector = fgSlice2Sector[slice][1];
1191 row = slicerow-fgNRowLow;
1197 Bool_t AliHLTTPCTransform::Sector2Slice(Int_t & slice, Int_t sector)
1200 if(sector<0||sector>=fgNSector){
1201 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Sector")
1202 <<AliHLTTPCLog::kDec<<"Wrong sector "<<sector<<ENDLOG;
1206 slice=fgSector2Slice[sector];
1211 Bool_t AliHLTTPCTransform::Sector2Slice(Int_t & slice, Int_t & slicerow, Int_t sector, Int_t row)
1214 if(sector<0 || sector>=fgNSector){
1215 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Sector")
1216 <<AliHLTTPCLog::kDec<<"Wrong sector "<<sector<<ENDLOG;
1220 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row")
1221 <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG;
1225 if(fgSectorLow[sector]){
1227 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row")
1228 <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG;
1231 slice = fgSector2Slice[sector];
1236 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row")
1237 <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG;
1240 slice = fgSector2Slice[sector];
1241 slicerow = row + fgNRowLow;
1247 Double_t AliHLTTPCTransform::GetMaxY(Int_t slicerow)
1249 //get maximum y value (for slice 0)
1250 if (slicerow>=fgNRow) {
1251 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetMaxY","Slicerow")
1252 <<AliHLTTPCLog::kDec<<"slicerow out of range"<<slicerow<<ENDLOG;
1254 if(slicerow < fgNRowLow)
1255 return fgPadPitchWidthLow*fgNPads[slicerow]/2;
1258 return fgPadPitchWidthUp*fgNPads[slicerow]/2;
1262 Double_t AliHLTTPCTransform::Row2X(Int_t slicerow)
1264 //slicerow to X value (slice 0)
1265 if(slicerow<0||slicerow>=fgNRow){
1266 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Row2X","Slicerow")
1267 <<AliHLTTPCLog::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG;
1270 return fgX[slicerow];
1273 Double_t AliHLTTPCTransform::GetZFast(Int_t slice, Int_t time, Float_t vertex)
1276 Double_t z=fgZWidth*time-fgZOffset;
1278 z=fgZLength-z-vertex;
1280 z=z-fgZLength-vertex;
1284 void AliHLTTPCTransform::Local2Global(Float_t *xyz,Int_t slice)
1286 //Transformation to global coordinate system
1287 Float_t x0 = xyz[0];
1288 Float_t y0 = xyz[1];
1290 xyz[0]=x0*fgCos[slice]-y0*fgSin[slice];
1291 xyz[1]=x0*fgSin[slice]+y0*fgCos[slice];
1292 //xyz[2]=xyz[2];//global z=local z
1295 void AliHLTTPCTransform::Local2GlobalAngle(Float_t *angle,Int_t slice)
1298 angle[0] = fmod(angle[0]+(slice+fgNRotShift)*(2*fgkPi/18),2*fgkPi);
1301 void AliHLTTPCTransform::Global2LocalAngle(Float_t *angle,Int_t slice)
1304 angle[0] = angle[0]-(slice+fgNRotShift)*(2*fgkPi/18);
1305 if(angle[0]<0) angle[0]+=2*fgkPi;
1308 void AliHLTTPCTransform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time)
1310 //Transformation from rawdata to local coordinate system
1312 Int_t slice,slicerow;
1313 if (Sector2Slice(slice, slicerow, sector, row)==kFALSE) return;
1316 xyz[0]=Row2X(slicerow);
1319 if (slicerow>=fgNRow) {
1320 LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetMaxY","Slicerow")
1321 <<AliHLTTPCLog::kDec<<"slicerow out of range"<<slicerow<<ENDLOG;
1324 Int_t npads= fgNPads[slicerow];
1326 if(fgSectorLow[sector])
1327 xyz[1]=(pad-0.5*(npads))*fgPadPitchWidthLow;
1329 xyz[1]=(pad-0.5*(npads))*fgPadPitchWidthUp;
1331 //Z-Value (remember PULSA Delay)
1333 xyz[2]=GetZLength()-GetZWidth()*time+GetZOffset();
1335 xyz[2]=GetZWidth()*time-GetZOffset()-GetZLength();
1338 void AliHLTTPCTransform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Int_t pad,Int_t time)
1340 //Transformation from rawdata to local coordinate system
1342 Int_t slice,slicerow;
1343 Sector2Slice(slice, slicerow, sector, row);
1346 xyz[0]=Row2X(slicerow);
1349 Int_t npads= fgNPads[slicerow];
1351 if(fgSectorLow[sector])
1352 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
1354 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
1356 //Z-Value (remember PULSA Delay)
1358 xyz[2]=GetZLength()-GetZWidth()*time+GetZOffset();
1360 xyz[2]=GetZWidth()*time-GetZOffset()-GetZLength();
1363 void AliHLTTPCTransform::RawHLT2Local(Float_t *xyz,Int_t slice,
1364 Int_t slicerow,Float_t pad,Float_t time)
1366 //Transformation from HLT rawdata to local coordinate system
1369 xyz[0]=Row2X(slicerow);
1372 Int_t npads= fgNPads[slicerow];
1373 if(slicerow<fgNRowLow)
1374 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
1376 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
1380 xyz[2]=GetZLength()-GetZWidth()*time+GetZOffset();
1382 xyz[2]=GetZWidth()*time-GetZOffset()-GetZLength();
1385 void AliHLTTPCTransform::RawHLT2Local(Float_t *xyz,Int_t slice,
1386 Int_t slicerow,Int_t pad,Int_t time)
1388 //Transformation from HLT rawdata to local coordinate system
1391 xyz[0]=Row2X(slicerow);
1394 Int_t npads= fgNPads[slicerow];
1395 if(slicerow<fgNRowLow)
1396 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
1398 xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
1402 xyz[2]=GetZLength()-GetZWidth()*time+GetZOffset();
1404 xyz[2]=GetZWidth()*time-GetZOffset()-GetZLength();
1407 void AliHLTTPCTransform::Local2Global(Float_t *xyz,Int_t sector,Int_t row)
1409 //Transformation to global coordinate system
1410 Int_t slice,slicerow;
1411 Sector2Slice(slice, slicerow, sector, row);
1412 Float_t r=Row2X(slicerow); //have to get x value first
1414 xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice];
1415 xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice];
1416 //xyz[2]=xyz[2];//global z=local z
1419 void AliHLTTPCTransform::LocHLT2Global(Float_t *xyz,Int_t slice,Int_t slicerow)
1421 //Transformation from HLT to global coordinate system
1422 Float_t r=Row2X(slicerow); //have to get x value first
1424 xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice];
1425 xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice];
1426 //xyz[2]=xyz[2];//global z=local z
1429 void AliHLTTPCTransform::Global2Local(Float_t *xyz,Int_t sector)
1432 Sector2Slice(slice, sector);
1434 Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice];
1435 Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice];
1440 void AliHLTTPCTransform::Global2LocHLT(Float_t *xyz,Int_t slice)
1442 Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice];
1443 Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice];
1448 void AliHLTTPCTransform::Raw2Global(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time)
1450 //Transformation from raw to global coordinates
1452 Raw2Local(xyz,sector,row,pad,time);
1453 Local2Global(xyz,sector,row);
1456 void AliHLTTPCTransform::Raw2Global(Float_t *xyz,Int_t sector,Int_t row,Int_t pad,Int_t time)
1458 //Transformation from raw to global coordinates
1460 Raw2Local(xyz,sector,row,pad,time);
1461 Local2Global(xyz,sector,row);
1464 void AliHLTTPCTransform::RawHLT2Global(Float_t *xyz,Int_t slice,
1465 Int_t slicerow,Float_t pad,Float_t time)
1467 //Transformation from raw to global coordinates
1469 RawHLT2Local(xyz,slice,slicerow,pad,time);
1470 LocHLT2Global(xyz,slice,slicerow);
1473 void AliHLTTPCTransform::RawHLT2Global(Float_t *xyz,Int_t slice,
1474 Int_t slicerow,Int_t pad,Int_t time)
1476 //Transformation from raw to global coordinates
1478 RawHLT2Local(xyz,slice,slicerow,pad,time);
1479 LocHLT2Global(xyz,slice,slicerow);
1482 void AliHLTTPCTransform::Local2Raw(Float_t *xyz,Int_t sector,Int_t row)
1484 //Transformation from local coordinates to raw
1486 Int_t slice,slicerow;
1487 Sector2Slice(slice, slicerow, sector, row);
1491 if(fgSectorLow[sector])
1492 xyz[1]=xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]-1);
1494 xyz[1]=xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]-1);
1497 xyz[2]=(GetZLength()-xyz[2]+GetZOffset())/GetZWidth();
1499 xyz[2]=(GetZLength()+xyz[2]+GetZOffset())/GetZWidth();
1502 void AliHLTTPCTransform::LocHLT2Raw(Float_t *xyz,Int_t slice,Int_t slicerow)
1504 //Transformation from local coordinates to raw
1508 int sign=slice<18?1:-1;
1509 if(slicerow<fgNRowLow)
1510 xyz[1]=sign*xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]);
1512 xyz[1]=sign*xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]);
1515 xyz[2]=(GetZLength()-xyz[2]+GetZOffset())/GetZWidth();
1517 xyz[2]=(GetZLength()+xyz[2]+GetZOffset())/GetZWidth();
1520 void AliHLTTPCTransform::Global2Raw(Float_t *xyz,Int_t sector,Int_t row)
1522 //Transformation from global coordinates to raw.
1524 Global2Local(xyz,sector);
1525 Local2Raw(xyz,sector,row);
1528 void AliHLTTPCTransform::Global2HLT(Float_t *xyz,Int_t slice,Int_t slicerow)
1530 //Transformation from global coordinates to raw.
1532 Global2LocHLT(xyz,slice);
1533 LocHLT2Raw(xyz,slice,slicerow);
1536 void AliHLTTPCTransform::PrintCompileOptions()
1538 //print compile options
1539 #if defined(__GNUC__)
1540 cout << "Compiler (g++) version used: " << __GNUC__ << endl;
1544 cout << "STANDALONE version: -Dno_root was given." << endl;
1546 const Char_t *roottest="$ROOTSYS/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d\" \" -f1";
1549 const Char_t *aliroottest="if test -n \"`cd $ALICE_ROOT/STEER/ && cvs stat AliRun.cxx | grep \"Sticky Tag\" | grep none`\"; then echo HEAD; else cd $ALICE_ROOT/STEER/ && cvs stat AliRun.cxx | grep \"Sticky Tag\" | cut -b 18- | cut -d\" \" -f1; fi";
1551 const Char_t *aliroottest="Unknown";
1553 cout << "ALIROOT version: -Duse_aliroot and -Duse_root was given." << endl;
1554 cout << "Root Version: " << ROOTVERSION << " found " << flush;
1555 gSystem->Exec(roottest);
1557 cout << "AliRoot Version: " << ALIROOTVERSION << " found " << flush;
1558 gSystem->Exec(aliroottest);
1560 cout << "ROOT version: -Duse_root was given." << endl;
1561 cout << "Root Version: " << ROOTVERSION << " found " << flush;
1562 gSystem->Exec(roottest);
1567 cout << "Using Monte Carlo Info: -Ddo_mc was given." << endl;
1569 cout << "NOT using Monte Carlo Info: -Ddo_mc was not given." << endl;
1572 #ifdef INCLUDE_TPC_HOUGH
1573 cout << "Including support for TPC Hough transformations." << endl;
1574 #ifdef ROWHOUGHPARAMS
1575 cout << "Using extended AliHLTTPCTrackSegmentData: -DROWHOUGHPARAMS was given." << endl;
1577 cout << "NOT using extended AliHLTTPCTrackSegmentData: -DROWHOUGHPARAMS was not given." << endl;
1580 cout << "NOT including any support for TPC Hough transformations." << endl;
1581 #endif // INCLUDE_TPC_HOUGH