#include <TArrayF.h>
#include <TStopwatch.h>
#include <TGeoManager.h>
+#include <TGeoMatrix.h>
#include <TGeoVolume.h>
#include <TGeoShape.h>
#include <TGeoBBox.h>
#include "AliITSsegmentationSPD.h"
#include "AliITSsegmentationSDD.h"
#include "AliITSsegmentationSSD.h"
-#include "AliITSgeom.h"
#include "AliITSInitGeometry.h"
#include <TDatime.h>
ClassImp(AliITSInitGeometry)
-const Bool_t AliITSInitGeometry::fgkOldSPDbarrel = kTRUE;
+const Bool_t AliITSInitGeometry::fgkOldSPDbarrel = kFALSE;
const Bool_t AliITSInitGeometry::fgkOldSDDbarrel = kFALSE;
-const Bool_t AliITSInitGeometry::fgkOldSSDbarrel = kTRUE;
-const Bool_t AliITSInitGeometry::fgkOldSDDcone = kTRUE;
-const Bool_t AliITSInitGeometry::fgkOldSSDcone = kTRUE;
-const Bool_t AliITSInitGeometry::fgkOldSPDshield = kTRUE;
+const Bool_t AliITSInitGeometry::fgkOldSSDbarrel = kFALSE;
+const Bool_t AliITSInitGeometry::fgkOldSDDcone = kFALSE;
+const Bool_t AliITSInitGeometry::fgkOldSSDcone = kFALSE;
+const Bool_t AliITSInitGeometry::fgkOldSPDshield = kFALSE;
const Bool_t AliITSInitGeometry::fgkOldSDDshield = kTRUE;
const Bool_t AliITSInitGeometry::fgkOldSSDshield = kTRUE;
-const Bool_t AliITSInitGeometry::fgkOldServices = kTRUE;
+const Bool_t AliITSInitGeometry::fgkOldServices = kFALSE;
const Bool_t AliITSInitGeometry::fgkOldSupports = kTRUE;
//______________________________________________________________________
AliITSInitGeometry::AliITSInitGeometry():
return kTRUE;
}
//______________________________________________________________________
-Bool_t AliITSInitGeometry::InitAliITSgeomITS04(AliITSgeom *geom){
+Bool_t AliITSInitGeometry::InitAliITSgeomITS04(AliITSgeom *geom) const{
// Initilizes the geometry transformation class AliITSgeom
// to values appropreate to this specific geometry. Now that
// the segmentation is part of AliITSgeom, the detector
"%sIT34_1/I005_%d/I402_%d/ITS4_%d/", // lay=4
"%sIT56_1/I565_%d/I562_%d/ITS5_%d/", // lay=5
"%sIT56_1/I569_%d/I566_%d/ITS6_%d/"},// lay=6
- {"%sIT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
- "%sIT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
+// {"%sIT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
+// "%sIT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
+ {"%sIT12_1/I12B_%d/I10B_%d/L1H-STAVE%d_1/I107_%d/I101_1/ITS1_1",//lay=1
+ "%sIT12_1/I12B_%d/I20B_%d/L2H-STAVE%d_1/I1D7_%d/I1D1_1/ITS2_1",//lay=2
"%sIT34_1/I004_%d/I302_%d/ITS3_%d", // lay=3
"%sIT34_1/I005_%d/I402_%d/ITS4_%d", // lay=4
"%sIT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
{34,22, 1},// lay=5
{38,25, 1}};//lay=6
*/
- Int_t mod,nmods=0,lay,lad,det,cpn0,cpn1,cpn2;
+ Int_t mod,nmods=0,lay,lad,det,cpn0,cpn1,cpn2, cpnHS;
Double_t tran[3]={0.0,0.0,0.0},rot[10]={9*0.0,1.0};
TArrayD shapePar;
TString path,shapeName;
DecodeDetectorLayers(mod,lay,lad,det); // Write
geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.
- path.Form(kNames[fMinorVersion-1][lay-1].Data(),
- kPathbase.Data(),cpn0,cpn1,cpn2);
+
+ if (kIdet[lay-1]==kSPD) { // we need 1 more copy number because
+ // of the half-stave
+ if (det<3) cpnHS = 0; else cpnHS = 1;
+ path.Form(kNames[fMinorVersion-1][lay-1].Data(),kPathbase.Data(),
+ cpn0,cpn1,cpnHS,cpn2);
+ } else {
+ path.Form(kNames[fMinorVersion-1][lay-1].Data(),kPathbase.Data(),
+ cpn0,cpn1,cpn2);
+ };
+// path.Form(kNames[fMinorVersion-1][lay-1].Data(),
+// kPathbase.Data(),cpn0,cpn1,cpn2);
+
geom->GetGeomMatrix(mod)->SetPath(path);
GetTransformation(path.Data(),matrix);
geom->SetTrans(mod,matrix.GetTranslation());
const Int_t kdetectors[klayers] = {4,4,6,8,22,25};// number of detector/lad
const AliITSDetector kIdet[6] = {kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
const TString kPathbase = "/ALIC_1/ITSV_1/";
-
+
+ char *pathSPDsens1, *pathSPDsens2;
+ if (SPDIsTGeoNative()) {
+ pathSPDsens1="%sITSSPD_1/ITSSPDCarbonFiberSectorV_%d/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay1-Stave_%d/ITSSPDhalf-Stave%d_1/ITSSPDlay1-Ladder_%d/ITSSPDlay1-sensor_1";
+ pathSPDsens2="%sITSSPD_1/ITSSPDCarbonFiberSectorV_%d/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay2-Stave_%d/ITSSPDhalf-Stave%d_1/ITSSPDlay2-Ladder_%d/ITSSPDlay2-sensor_1";
+ } else{
+ pathSPDsens1 = "%sITSD_1/IT12_1/I12B_%d/I10B_%d/L1H-STAVE%d_1/I107_%d/I101_1/ITS1_1";
+ pathSPDsens2 = "%sITSD_1/IT12_1/I12B_%d/I20B_%d/L2H-STAVE%d_1/I1D7_%d/I1D1_1/ITS2_1";
+ }
+
char *pathSDDsens1, *pathSDDsens2;
if (SDDIsTGeoNative()) {
pathSDDsens1 = "%sITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor3_%d/ITSsddWafer3_%d/ITSsddSensitivL3_1";
pathSDDsens1 = "%sITSD_1/IT34_1/I004_%d/I302_%d/ITS3_%d";
pathSDDsens2 = "%sITSD_1/IT34_1/I005_%d/I402_%d/ITS4_%d";
}
-
+
+ char *pathSSDsens1, *pathSSDsens2;
+ if (SSDIsTGeoNative()) {
+ pathSSDsens1 = "%sITSssdLayer5_1/ITSssdLay5Ladd_%d/ITSssdSensor5_%d/ITSssdSensitivL5_1";
+ pathSSDsens2 = "%sITSssdLayer6_1/ITSssdLay6Ladd_%d/ITSssdSensor6_%d/ITSssdSensitivL6_1";
+ } else{
+ pathSSDsens1 = "%sITSD_1/IT56_1/I565_%d/I562_%d/ITS5_%d";
+ pathSSDsens2 = "%sITSD_1/IT56_1/I569_%d/I566_%d/ITS6_%d";
+ }
+
const TString kNames[klayers] = {
- "%sITSD_1/IT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
- "%sITSD_1/IT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
+ pathSPDsens1, // lay=1
+ pathSPDsens2, // lay=2
pathSDDsens1, // lay=3
pathSDDsens2, // lay=4
- "%sITSD_1/IT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
- "%sITSD_1/IT56_1/I569_%d/I566_%d/ITS6_%d"};// Lay=6
+ pathSSDsens1, // lay=5
+ pathSSDsens2};// Lay=6
- Int_t mod,nmods=0, lay, lad, det, cpn0, cpn1, cpn2;
+ Int_t mod,nmods=0, lay, lad, det, cpn0, cpn1, cpn2, cpnHS=1;
Double_t tran[3]={0.,0.,0.}, rot[10]={9*0.0,1.0};
TArrayD shapePar;
TString path, shapeName;
for(mod=0;mod<klayers;mod++) nmods += kladders[mod]*kdetectors[mod];
geom->Init(kItype,klayers,kladders,kdetectors,nmods);
- for(mod=0;mod<nmods;mod++) {
+ for(mod=0; mod<nmods; mod++) {
-// DecodeDetectorLayers(mod,lay,lad,det); // Write
-// geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
-// RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.
- DecodeDetectorLayers(mod,lay,lad,det); // Write
+ DecodeDetectorLayers(mod,lay,lad,det);
geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
- RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.
-
-
-
- if (SDDIsTGeoNative())
- if (kIdet[lay-1]==kSDD) {
- cpn0 = lad-1;
- cpn1 = det-1;
- cpn2 = 1;
- }
+ RecodeDetectorv11Hybrid(mod,cpn0,cpn1,cpn2);
+
+// if (SPDIsTGeoNative())
+// if (kIdet[lay-1]==kSPD) {
+// cpn0 = lad-1;
+// cpn1 = det-1;
+// cpn2 = 1;
+// }
+// if (SDDIsTGeoNative())
+// if (kIdet[lay-1]==kSDD) {
+// cpn0 = lad-1;
+// cpn1 = det-1;
+// cpn2 = 1;
+// }
+// if (SSDIsTGeoNative())
+// if (kIdet[lay-1]==kSSD) {
+// cpn0 = lad-1;
+// cpn1 = det-1;
+// cpn2 = 1;
+// }
+
+ if (kIdet[lay-1]==kSPD) { // we need 1 more copy number because of the half-stave
+ if (det<3) cpnHS = 0; else cpnHS = 1;
+ path.Form(kNames[lay-1].Data(),kPathbase.Data(),cpn0,cpn1,cpnHS,cpn2);
+ } else {
+ path.Form(kNames[lay-1].Data(),kPathbase.Data(),cpn0,cpn1,cpn2);
+ };
- path.Form(kNames[lay-1].Data(),
- kPathbase.Data(),cpn0,cpn1,cpn2);
geom->GetGeomMatrix(mod)->SetPath(path);
GetTransformation(path.Data(),matrix);
geom->SetTrans(mod,matrix.GetTranslation());
initSeg[idet] = kTRUE;
AliITSgeomSPD *geomSPD = new AliITSgeomSPD425Short();
Float_t bx[256],bz[280];
- for(i=000;i<256;i++) bx[i] = 50.0*kmicron2cm; // in x all are 50 microns.
- for(i=000;i<160;i++) bz[i] = 425.0*kmicron2cm; // most are 425 microns
+ for(i=000;i<256;i++) bx[i] = 50.0*kmicron2cm;//in x all are 50 microns.
+ for(i=000;i<160;i++) bz[i] =425.0*kmicron2cm; // most are 425 microns
// except below
for(i=160;i<280;i++) bz[i] = 0.0*kmicron2cm; // Outside of detector.
bz[ 31] = bz[ 32] = 625.0*kmicron2cm; // first chip boundry
bz[ 63] = bz[ 64] = 625.0*kmicron2cm; // first chip boundry
bz[ 95] = bz[ 96] = 625.0*kmicron2cm; // first chip boundry
bz[127] = bz[128] = 625.0*kmicron2cm; // first chip boundry
- bz[160] = 425.0*kmicron2cm;// Set so that there is no zero pixel size for fNz.
+ bz[160] = 425.0*kmicron2cm;// Set so that there is no zero
+ // pixel size for fNz.
geomSPD->ReSetBins(shapeParF[1],256,bx,160,bz);
geom->ReSetShape(idet,geomSPD);
}break;
segSSD->SetPadSize(95.,0.); // strip x pitch in microns
segSSD->SetNPads(768,2); // number of strips on each side, sides.
segSSD->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
- segSSD->SetAnglesLay5(0.0075,0.0275);//strip angels rad P and N
- segSSD->SetAnglesLay6(0.0275,0.0075);//strip angels rad P and N
geom->ReSetShape(idet,segSSD);
}break;
default:{// Others, Note no kSDDp or kSSDp in this geometry.
// This is a FIXED switch yard function. I (Bjorn Nilsen) Don't
// like them but I see not better way for the moment.
- switch (fMajorVersion){
+ switch (fMajorVersion) {
case kvtest:{
if(GetMinorVersion()==1)
return DecodeDetectorLayersvPPRasymmFMD(mod,layer,lad,det);
"Geometry is kvtest minor version=%d is not defined",
GetMinorVersion());
return;
- }break;
+ } break;
case kvDefault:{
Error("DecodeDetectorLayers",
"Major version = kvDefault, not supported");
}
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorvSPD02(Int_t mod,Int_t &cpn0,
- Int_t &cpn1,Int_t &cpn2){
+ Int_t &cpn1,Int_t &cpn2) const {
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose.
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayersvSPD02(Int_t mod,Int_t &lay,
- Int_t &lad,Int_t &det){
+ Int_t &lad,Int_t &det) const{
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose. Note, this use of layer ladder
}
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorvSDD03(Int_t mod,Int_t &cpn0,
- Int_t &cpn1,Int_t &cpn2){
+ Int_t &cpn1,Int_t &cpn2) const{
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose.
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayersvSDD03(Int_t mod,Int_t &lay,
- Int_t &lad,Int_t &det){
+ Int_t &lad,Int_t &det) const{
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose. Note, this use of layer ladder
}
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorvSSD03(Int_t mod,Int_t &cpn0,
- Int_t &cpn1,Int_t &cpn2){
+ Int_t &cpn1,Int_t &cpn2) const {
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose.
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayersvSSD03(Int_t mod,Int_t &lay,
- Int_t &lad,Int_t &det){
+ Int_t &lad,Int_t &det) const {
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose. Note, this use of layer ladder
}
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorvITS04(Int_t mod,Int_t &cpn0,
- Int_t &cpn1,Int_t &cpn2){
+ Int_t &cpn1,Int_t &cpn2) const {
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose.
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayersvITS04(Int_t mod,Int_t &lay,
- Int_t &lad,Int_t &det){
+ Int_t &lad,Int_t &det) const{
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose. Note, this use of layer ladder
return;
}
//______________________________________________________________________
-void AliITSInitGeometry::DecodeDetectorvPPRasymmFMD(Int_t &mod,Int_t layer,Int_t cpn0,
- Int_t cpn1,Int_t cpn2) const {
+void AliITSInitGeometry::DecodeDetectorvPPRasymmFMD(Int_t &mod,Int_t layer,
+ Int_t cpn0,Int_t cpn1,Int_t cpn2) const {
// decode geometry into detector module number. There are two decoding
// Scheams. Old which does not follow the ALICE coordinate system
// requirements, and New which dose.
return;
}
//______________________________________________________________________
-void AliITSInitGeometry::DecodeDetectorv11Hybrid(Int_t &mod,Int_t layer,Int_t cpn0,
- Int_t cpn1,Int_t cpn2) const {
+void AliITSInitGeometry::DecodeDetectorv11Hybrid(Int_t &mod,Int_t layer,
+ Int_t cpn0,Int_t cpn1,Int_t cpn2) const {
// decode geometry into detector module number
// Inputs:
// Int_t layer The ITS layer
// of copy numbers.
// Return:
// none.
- const Int_t kDetPerLadderSPD[2]={2,4};
- const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
- const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
- Int_t lay=-1,lad=-1,det=-1,i;
-
- switch(layer){
- case 1: case 2:{
- lay = layer;
- lad = cpn1+kDetPerLadderSPD[layer-1]*(cpn0-1);
- det = cpn2;
- }break;
- case 3: case 4:{
- lay = layer;
- lad = cpn0;
- det = cpn1;
- }break;
- case 5: case 6:{
- lay = layer;
- lad = cpn0;
- det = cpn1;
- }break;
- default:{
- }break;
- } // end switch
- mod = 0;
- for(i=0;i<layer-1;i++) mod += kLadPerLayer[i]*kDetPerLadder[i];
- mod += kDetPerLadder[layer-1]*(lad-1)+det-1;// module start at zero.
- return;
+ const Int_t kDetPerLadderSPD[2]={2,4};
+ const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
+ const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
+ Int_t lad=-1,det=-1;
+
+ switch(layer) {
+ case 1: case 2:{
+ if (SPDIsTGeoNative()) {
+ lad = cpn1+kDetPerLadderSPD[layer-1]*(cpn0-1);
+ det = cpn2;
+ } else {
+ lad = cpn1+kDetPerLadderSPD[layer-1]*(cpn0-1);
+ det = cpn2;
+ }
+ } break;
+ case 3: case 4:{
+ if (SDDIsTGeoNative()) {
+ lad = cpn0+1;
+ det = cpn1+1;
+ } else {
+ lad = cpn0;
+ det = cpn1;
+ }
+ } break;
+ case 5: case 6:{
+ if (SSDIsTGeoNative()) {
+ lad = cpn0+1;
+ det = cpn1+1;
+ } else {
+ lad = cpn0;
+ det = cpn1;
+ }
+ } break;
+ default:{
+ } break;
+ } // end switch
+ mod = 0;
+ for(Int_t i=0;i<layer-1;i++) mod += kLadPerLayer[i]*kDetPerLadder[i];
+ mod += kDetPerLadder[layer-1]*(lad-1)+det-1;// module start at zero.
+ return;
}
+
+/*
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorv11Hybrid(Int_t mod,Int_t &cpn0,
Int_t &cpn1,Int_t &cpn2) {
{34,22, 1},// lay=5
{38,25, 1}};//lay=6
const Int_t kDetPerLadderSPD[2]={2,4};
- // const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
- // const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
Int_t lay,lad,det;
cpn0 = cpn1 = cpn2 = 0;
- DecodeDetectorLayers(mod,lay,lad,det);
+ DecodeDetectorLayersv11Hybrid(mod,lay,lad,det);
// Old encoding
switch (lay){
case 1: case 2:{
cpn0,cpn1,cpn2,mod,lay,lad,det);
return;
}
-//______________________________________________________________________
-void AliITSInitGeometry::DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,
- Int_t &lad,Int_t &det) {
+*/
+
- // decode geometry into detector module number for v11Hybrid
+//______________________________________________________________________
+void AliITSInitGeometry::RecodeDetectorv11Hybrid(Int_t mod,Int_t &cpn0,
+ Int_t &cpn1,Int_t &cpn2) {
+ // decode geometry into detector module number. There are two decoding
+ // Scheams. Old which does not follow the ALICE coordinate system
+ // requirements, and New which does.
// Inputs:
// Int_t mod The module number assoicated with this set
// of copy numbers.
// Output:
- // Int_t lay The layer number
- // Int_t lad The ladder number
- // Int_t det the dettector number
+ // Int_t cpn0 The lowest copy number (SPD sector or SDD/SSD ladder)
+ // Int_t cpn1 The middle copy number (SPD stave or SDD/SSD module)
+ // Int_t cpn2 the highest copy number (SPD ladder or 1 for SDD/SSD)
// Return:
// none.
+ const Int_t kDetPerLadderSPD[2]={2,4};
+ Int_t lay,lad,det;
- const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
- const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
- Int_t mod2;
+ DecodeDetectorLayersv11Hybrid(mod,lay,lad,det);
+ if (lay<3) { // SPD
+ cpn2 = det; // Detector 1-4
+ cpn0 = (lad+kDetPerLadderSPD[lay-1]-1)/kDetPerLadderSPD[lay-1];
+ cpn1 = (lad+kDetPerLadderSPD[lay-1]-1)%kDetPerLadderSPD[lay-1] + 1;
+ //if (SPDIsTGeoNative()) {
+ // cpn2--;
+ // cpn1--;
+ //}
+ } else { // SDD and SSD
+ cpn2 = 1;
+ cpn1 = det;
+ cpn0 = lad;
+ if (lay<5) { // SDD
+ if (SDDIsTGeoNative()) {
+ cpn1--;
+ cpn0--;
+ } // end if SDDIsTGeoNative()
+ } else { //SSD
+ if (SSDIsTGeoNative()) {
+ cpn1--;
+ cpn0--;
+ }// end if SSDIsTGeoNative()
+ } // end if Lay<5/else
+ } // end if lay<3/else
+ /*printf("AliITSInitGeometry::RecodeDetectorv11Hybrid:"
+ "mod=%d lay=%d lad=%d det=%d cpn0=%d cpn1=%d cpn2=%d\n",
+ mod,lay,lad,det,cpn0,cpn1,cpn2);*/
+}
+// //______________________________________________________________________
+// void AliITSInitGeometry::DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,
+// Int_t &lad,Int_t &det) {
+
+// // decode module number into detector indices for v11Hybrid
+// // Inputs:
+// // Int_t mod The module number associated with this set
+// // of copy numbers.
+// // Output:
+// // Int_t lay The layer number
+// // Int_t lad The ladder number
+// // Int_t det the dettector number
+// // Return:
+// // none.
+
+// const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
+// const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
+// Int_t mod2 = 0;
+// det = 0;
+// lad = 0;
+// lay = 0;
+
+// do{
+// mod2 += kLadPerLayer[lay]*kDetPerLadder[lay];
+// lay++;
+// } while(mod2<=mod); // end while
+// if(lay>6||lay<1) Error("DecodeDetectorLayers","0<lay=%d>6",lay);
+// mod2 -= kLadPerLayer[lay-1]*kDetPerLadder[lay-1];
+// do{
+// lad++;
+// mod2 += kDetPerLadder[lay-1];
+// } while(mod2<=mod); // end while
+// if(lad>kLadPerLayer[lay-1]||lad<1) Error("DecodeDetectorLayers",
+// "lad=%d>kLadPerLayer[lay-1=%d]=%d mod=%d mod2=%d",lad,lay-1,
+// kLadPerLayer[lay-1],mod,mod2);
+// mod2 -= kDetPerLadder[lay-1];
+// det = mod-mod2+1;
+// if(det>kDetPerLadder[lay-1]||det<1) Error("DecodeDetectorLayers",
+// "det=%d>detPerLayer[lay-1=%d]=%d mod=%d mod2=%d lad=%d",det,
+// lay-1,kDetPerLadder[lay-1],mod,mod2,lad);
+// return;
+// }
- det = 0;
- lad = 0;
- lay = 0;
- mod2 = 0;
- do{
- mod2 += kLadPerLayer[lay]*kDetPerLadder[lay];
- lay++;
- } while(mod2<=mod); // end while
- if(lay>6||lay<1) Error("DecodeDetectorLayers","0<lay=%d>6",lay);
- mod2 -= kLadPerLayer[lay-1]*kDetPerLadder[lay-1];
- do{
- lad++;
- mod2 += kDetPerLadder[lay-1];
- } while(mod2<=mod); // end while
- if(lad>kLadPerLayer[lay-1]||lad<1) Error("DecodeDetectorLayers",
- "lad=%d>kLadPerLayer[lay-1=%d]=%d mod=%d mod2=%d",lad,lay-1,
- kLadPerLayer[lay-1],mod,mod2);
- mod2 -= kDetPerLadder[lay-1];
- det = mod-mod2+1;
- if(det>kDetPerLadder[lay-1]||det<1) Error("DecodeDetectorLayers",
- "det=%d>detPerLayer[lay-1=%d]=%d mod=%d mod2=%d lad=%d",det,
- lay-1,kDetPerLadder[lay-1],mod,mod2,lad);
- return;
+//______________________________________________________________________
+void AliITSInitGeometry::DecodeDetectorLayersv11Hybrid(Int_t mod,Int_t &lay,
+ Int_t &lad,Int_t &det) {
+
+ // decode module number into detector indices for v11Hybrid
+ // mod starts from 0
+ // lay, lad, det start from 1
+
+ // Inputs:
+ // Int_t mod The module number associated with this set
+ // of copy numbers.
+ // Output:
+ // Int_t lay The layer number
+ // Int_t lad The ladder number
+ // Int_t det the dettector number
+
+ const Int_t kDetPerLadder[6] = {4,4,6,8,22,25};
+ const Int_t kLadPerLayer[6] = {20,40,14,22,34,38};
+
+ Int_t mod2 = 0;
+ lay = 0;
+
+ do {
+ mod2 += kLadPerLayer[lay]*kDetPerLadder[lay];
+ lay++;
+ } while(mod2<=mod); // end while
+ if(lay>6) Error("DecodeDetectorLayers","lay=%d>6",lay);
+
+ mod2 = kLadPerLayer[lay-1]*kDetPerLadder[lay-1] - mod2+mod;
+ lad = mod2/kDetPerLadder[lay-1];
+
+ if(lad>=kLadPerLayer[lay-1]||lad<0) Error("DecodeDetectorLayers",
+ "lad=%d not in the correct range",lad);
+ det = (mod2 - lad*kDetPerLadder[lay-1])+1;
+ if(det>kDetPerLadder[lay-1]||det<1) Error("DecodeDetectorLayers",
+ "det=%d not in the correct range",det);
+ lad++;
}
//______________________________________________________________________
// and will be set to zero
// Return:
// kTRUE if no errors
+ Char_t cvslikedate[30];
Int_t i,n,cvsDateLength,cvsRevisionLength;
cvsDateLength = (Int_t)strlen(cvsDate);
+ if(cvsDateLength>30){ // svn string, make a cvs like string
+ i=0;n=0;
+ do{
+ cvslikedate[i] = cvsDate[i];
+ if(cvsDate[i]=='+' || cvsDate[i++]=='-'){
+ n++; // count number of -
+ cvslikedate[i-1] = '/'; // replace -'s by /'s.
+ } // end if
+ } while(n<3&&i<30); // once additonal - of time zone reach exit
+ cvslikedate[i-1] = '$'; // put $ at end then zero.
+ for(;i<30;i++) cvslikedate[i]=0;// i starts wher do loop left off.
+ }else{
+ for(i=0;i<cvsDateLength&&i<30;i++) cvslikedate[i]=cvsDate[i];
+ }// end if
+ cvsDateLength = (Int_t)strlen(cvslikedate);
cvsRevisionLength = (Int_t)strlen(cvsRevision);
i = (Int_t)maj;
n = 50+(Int_t)(TMath::Log10(TMath::Abs((Double_t)i)))+1+
+cvsDateLength-6+cvsRevisionLength-10;
if(GetDebug()>1) printf("AliITSInitGeometry::WriteVersionString:"
"length=%d major=%d minor=%d cvsDate=%s[%d] "
- "cvsRevision=%s[%d] n=%d\n",length,i,min,cvsDate,
+ "cvsRevision=%s[%d] n=%d\n",length,i,min,cvslikedate,
cvsDateLength,cvsRevision,cvsRevisionLength,n);
if(i<0) n++;
if(min<0) n++;
if(10+i<cvsRevisionLength-1)
cvsrevision[i] = cvsRevision[10+i]; else cvsrevision[i] = 0;
for(i=0;i<cvsDateLength-6;i++) if(6+i<cvsDateLength-1)
- cvsdate[i] = cvsDate[6+i]; else cvsdate[i] = 0;
+ cvsdate[i] = cvslikedate[6+i]; else cvsdate[i] = 0;
for(i=0;i<length;i++) str[i] = 0; // zero it out for now.
i = (Int_t)maj;
sprintf(str,"Major Version= %d Minor Version= %d Revision: %s Date: %s",
i,min,cvsrevision,cvsdate);
+ /* this gives compilation warnings on some compilers: descriptor zu
if(GetDebug()>1)printf("AliITSInitGeometry::WriteVersionString: "
"n=%d str=%s revision[%zu] date[%zu]\n",
n,str,strlen(cvsrevision),strlen(cvsdate));
+ */
delete[] cvsrevision;
delete[] cvsdate;
return kTRUE;
ok = m==3;
if(!ok) return !ok;
dt.Set(year,month,day,hours,minuits,seconds);
- if(GetDebug()>1)printf("AliITSInitGeometry::ReadVersionString: i=%d min=%d "
- "cvsRevision=%s cvsDate=%s cvsTime=%s m=%d\n",
+ if(GetDebug()>1)printf("AliITSInitGeometry::ReadVersionString: i=%d "
+ "min=%d cvsRevision=%s cvsDate=%s cvsTime=%s m=%d\n",
i,min,cvsRevision,cvsDate,cvsTime,m);
if(GetDebug()>1)printf("AliITSInitGeometry::ReadVersionString: year=%d"
" month=%d day=%d hours=%d minuits=%d seconds=%d\n",