in .h file. Fixed the usual problem with HP comilers and the "for(Int_t i..."
business. Replaced casting (Double_t [3][3]) to (Double_t (*)[3]) for HP.
Lastly removed all "const" before function parameters which were 2 dim. arrays,
because on HP root generates some strange code (?). Thanks Peter for the
changes.
+Revision 1.9 2000/08/29 20:19:03 nilsen
+Removed dependancy on structure AliITSeomS and replaced it with class
+AliITSgeomMatrix. Added many new functions with many new arguments. Most
+in the form of in line functions for speed.
+
Revision 1.4.4.6 2000/06/04 16:33:32 Nilsen
A restructured AliITSgeom class. Now used AliITSgeomMatrix.
Revision 1.4.4.6 2000/06/04 16:33:32 Nilsen
A restructured AliITSgeom class. Now used AliITSgeomMatrix.
return;
}
//______________________________________________________________________
return;
}
//______________________________________________________________________
-Int_t AliITSgeom::GetNearest(const Double_t g[3],const Int_t lay=0){
+Int_t AliITSgeom::GetNearest(const Double_t g[3],const Int_t lay){
////////////////////////////////////////////////////////////////////////
// Finds the Detector (Module) that is nearest the point g [cm] in
// ALICE Global coordinates. If layer !=0 then the search is restricted
////////////////////////////////////////////////////////////////////////
// Finds the Detector (Module) that is nearest the point g [cm] in
// ALICE Global coordinates. If layer !=0 then the search is restricted
return in;
}
//______________________________________________________________________
return in;
}
//______________________________________________________________________
-void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],const Int_t lay=0){
+void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],const Int_t lay){
////////////////////////////////////////////////////////////////////////
// Finds 27 Detectors (Modules) that are nearest the point g [cm] in
// ALICE Global coordinates. If layer !=0 then the search is restricted
////////////////////////////////////////////////////////////////////////
// Finds 27 Detectors (Modules) that are nearest the point g [cm] in
// ALICE Global coordinates. If layer !=0 then the search is restricted
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void GtoL(const Int_t index,const Float_t *g,Float_t *l){
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void GtoL(const Int_t index,const Float_t *g,Float_t *l){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
fGm[index]->GtoLPosition(dg,dl);
fGm[index]->GtoLPosition(dg,dl);
- for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+ for(i=0;i<3;i++) l[i] =dl[i];}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void GtoL(const Int_t index,const Double_t *g,Double_t *l){
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void GtoL(const Int_t index,const Double_t *g,Double_t *l){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
fGm[index]->GtoLPosition(dg,dl);
fGm[index]->GtoLPosition(dg,dl);
- for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+ for(i=0;i<3;i++) l[i] =dl[i];}
//
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system (used for ITS tracking)
//
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system (used for ITS tracking)
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void GtoLMomentum(const Int_t index,const Float_t *g,Float_t *l){
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void GtoLMomentum(const Int_t index,const Float_t *g,Float_t *l){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
fGm[index]->GtoLMomentum(dg,dl);
fGm[index]->GtoLMomentum(dg,dl);
- for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+ for(i=0;i<3;i++) l[i] =dl[i];}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector layer ladder and detector numbers. The global
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector layer ladder and detector numbers. The global
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void GtoLMomentum(const Int_t index,const Double_t *g,Double_t *l){
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void GtoLMomentum(const Int_t index,const Double_t *g,Double_t *l){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
fGm[index]->GtoLMomentum(dg,dl);
fGm[index]->GtoLMomentum(dg,dl);
- for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+ for(i=0;i<3;i++) l[i] =dl[i];}
//
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
//
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void LtoG(const Int_t index,const Float_t *l,Float_t *g){
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void LtoG(const Int_t index,const Float_t *l,Float_t *g){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
fGm[index]->LtoGPosition(dl,dg);
fGm[index]->LtoGPosition(dl,dg);
- for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+ for(i=0;i<3;i++) g[i] =dg[i];}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void LtoG(const Int_t index,const Double_t *l,Double_t *g){
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void LtoG(const Int_t index,const Double_t *l,Double_t *g){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
fGm[index]->LtoGPosition(dl,dg);
fGm[index]->LtoGPosition(dl,dg);
- for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+ for(i=0;i<3;i++) g[i] =dg[i];}
//
// Transforms from the detector local coordinate system (used
// for ITS tracking) to the ALICE Global coordinate system
//
// Transforms from the detector local coordinate system (used
// for ITS tracking) to the ALICE Global coordinate system
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void LtoGMomentum(const Int_t index,const Float_t *l,Float_t *g){
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void LtoGMomentum(const Int_t index,const Float_t *l,Float_t *g){
- Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
fGm[index]->LtoGMomentum(dl,dg);
fGm[index]->LtoGMomentum(dl,dg);
- for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+ for(i=0;i<3;i++) g[i] =dg[i];}
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector layer ladder and detector numbers. The global
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector layer ladder and detector numbers. The global
// system. The specific detector is determined by the module index
// number.
void GtoLErrorMatrix(const Int_t index,const Double_t **g,Double_t **l){
// system. The specific detector is determined by the module index
// number.
void GtoLErrorMatrix(const Int_t index,const Double_t **g,Double_t **l){
- fGm[index]->GtoLPositionError((Double_t[3][3])g,(Double_t[3][3])l);}
+ fGm[index]->GtoLPositionError((Double_t (*)[3])g,(Double_t (*)[3])l);}
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the ALICE Global coordinate system to a detector local coordinate
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the ALICE Global coordinate system to a detector local coordinate
void GtoLErrorMatrixTracking(const Int_t index,const Double_t **g,
Double_t **l){
if(IsGeantToTracking()) fGm[index]->GtoLPositionError((
void GtoLErrorMatrixTracking(const Int_t index,const Double_t **g,
Double_t **l){
if(IsGeantToTracking()) fGm[index]->GtoLPositionError((
- Double_t[3][3])g,(Double_t[3][3])l);
+ Double_t (*)[3])g,(Double_t (*)[3])l);
else fGm[index]->GtoLPositionErrorTracking(
else fGm[index]->GtoLPositionErrorTracking(
- (Double_t[3][3])g,(Double_t[3][3])l);}
+ (Double_t (*)[3])g,(Double_t (*)[3])l);}
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system to a ALICE Global coordinate
// system. The specific detector is determined by the module index
// number.
void LtoGErrorMatrix(const Int_t index,const Double_t **l,Double_t **g){
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system to a ALICE Global coordinate
// system. The specific detector is determined by the module index
// number.
void LtoGErrorMatrix(const Int_t index,const Double_t **l,Double_t **g){
- fGm[index]->LtoGPositionError((Double_t[3][3])l,(Double_t[3][3])g);}
+ fGm[index]->LtoGPositionError((Double_t (*)[3])l,(Double_t (*)[3])g);}
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system (used by ITS tracking) to a
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system (used by ITS tracking) to a
void LtoGErrorMatrixTracking(const Int_t index,const Double_t **l,
Double_t **g){
if(IsGeantToTracking()) fGm[index]->LtoGPositionError((
void LtoGErrorMatrixTracking(const Int_t index,const Double_t **l,
Double_t **g){
if(IsGeantToTracking()) fGm[index]->LtoGPositionError((
- Double_t[3][3])g,(Double_t[3][3])l);
- else fGm[index]->LtoGPositionErrorTracking((Double_t[3][3])l,
- (Double_t[3][3])g);}
+ Double_t (*)[3])g,(Double_t (*)[3])l);
+ else fGm[index]->LtoGPositionErrorTracking((Double_t (*)[3])l,
+ (Double_t (*)[3])g);}
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// one detector local coordinate system to another detector local
//
// Transforms a matrix, like an Uncertainty or Error matrix from
// one detector local coordinate system to another detector local
+Revision 1.2 2000/08/29 20:16:50 nilsen
+New class for ITS coordiante transformations used by AliITSgeom nearly
+exclusively.
+
Revision 1.1.2.1 2000/06/04 16:32:31 Nilsen
A new class to hold the matrix information needed by AliITSgeom.
Revision 1.1.2.1 2000/06/04 16:32:31 Nilsen
A new class to hold the matrix information needed by AliITSgeom.
}
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
}
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
- const Double_t matrix[3][3],
const Double_t tran[3]){
////////////////////////////////////////////////////////////////////////
// This is a constructor for the AliITSgeomMatrix class. The rotation matrix
const Double_t tran[3]){
////////////////////////////////////////////////////////////////////////
// This is a constructor for the AliITSgeomMatrix class. The rotation matrix
return;
}
//----------------------------------------------------------------------
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionError(const Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
Double_t l[3][3]){
////////////////////////////////////////////////////////////////////////
// Given an Uncertainty matrix in Global coordinates it is rotated so that
Double_t l[3][3]){
////////////////////////////////////////////////////////////////////////
// Given an Uncertainty matrix in Global coordinates it is rotated so that
return;
}
//----------------------------------------------------------------------
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionError(const Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionError(Double_t l[3][3],
Double_t g[3][3]){
////////////////////////////////////////////////////////////////////////
// Given an Uncertainty matrix in Local coordinates it is rotated so that
Double_t g[3][3]){
////////////////////////////////////////////////////////////////////////
// Given an Uncertainty matrix in Local coordinates it is rotated so that
return;
}
//----------------------------------------------------------------------
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionErrorTracking(const Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
Double_t l[3][3]){
////////////////////////////////////////////////////////////////////////
// A slightly different coordinate system is used when tracking.
Double_t l[3][3]){
////////////////////////////////////////////////////////////////////////
// A slightly different coordinate system is used when tracking.
return;
}
//----------------------------------------------------------------------
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionErrorTracking(const Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
Double_t g[3][3]){
////////////////////////////////////////////////////////////////////////
// A slightly different coordinate system is used when tracking.
Double_t g[3][3]){
////////////////////////////////////////////////////////////////////////
// A slightly different coordinate system is used when tracking.
AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
const Double_t rot[3],const Double_t tran[3]);
AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
const Double_t rot[3],const Double_t tran[3]);
AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
- const Double_t matrix[3][3],const Double_t tran[3]);
+ Double_t matrix[3][3],const Double_t tran[3]);
AliITSgeomMatrix(const Double_t rotd[6]/*degrees Geant angles*/,
const Int_t idt,const Int_t id[3],
const Double_t tran[3]);
AliITSgeomMatrix(const Double_t rotd[6]/*degrees Geant angles*/,
const Int_t idt,const Int_t id[3],
const Double_t tran[3]);
for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
void SetTranslation(const Double_t tran[3]){
for(Int_t i=0;i<3;i++) ftran[i] = tran[i];}
for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
void SetTranslation(const Double_t tran[3]){
for(Int_t i=0;i<3;i++) ftran[i] = tran[i];}
- void SetMatrix(const Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
+ void SetMatrix(Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
void SetIndex(const Int_t id[3]){
for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
void SetIndex(const Int_t id[3]){
void LtoGPosition(const Double_t l[3],Double_t g[3]);
void GtoLMomentum(const Double_t g[3],Double_t l[3]);
void LtoGMomentum(const Double_t l[3],Double_t g[3]);
void LtoGPosition(const Double_t l[3],Double_t g[3]);
void GtoLMomentum(const Double_t g[3],Double_t l[3]);
void LtoGMomentum(const Double_t l[3],Double_t g[3]);
- void GtoLPositionError(const Double_t g[3][3],Double_t l[3][3]);
- void LtoGPositionError(const Double_t l[3][3],Double_t g[3][3]);
+ void GtoLPositionError(Double_t g[3][3],Double_t l[3][3]);
+ void LtoGPositionError(Double_t l[3][3],Double_t g[3][3]);
// Tracking Related Routines
void GtoLPositionTracking(const Double_t g[3],Double_t l[3]);
void LtoGPositionTracking(const Double_t l[3],Double_t g[3]);
void GtoLMomentumTracking(const Double_t g[3],Double_t l[3]);
void LtoGMomentumTracking(const Double_t l[3],Double_t g[3]);
// Tracking Related Routines
void GtoLPositionTracking(const Double_t g[3],Double_t l[3]);
void LtoGPositionTracking(const Double_t l[3],Double_t g[3]);
void GtoLMomentumTracking(const Double_t g[3],Double_t l[3]);
void LtoGMomentumTracking(const Double_t l[3],Double_t g[3]);
- void GtoLPositionErrorTracking(const Double_t g[3][3],
+ void GtoLPositionErrorTracking(Double_t g[3][3],
- void LtoGPositionErrorTracking(const Double_t l[3][3],
+ void LtoGPositionErrorTracking(Double_t l[3][3],
Double_t g[3][3]);
Double_t Distance2(const Double_t t[3]){Double_t d=0.0,q;
for(Int_t i=0;i<3;i++){q = t[i]-ftran[i]; d += q*q;}
Double_t g[3][3]);
Double_t Distance2(const Double_t t[3]){Double_t d=0.0,q;
for(Int_t i=0;i<3;i++){q = t[i]-ftran[i]; d += q*q;}