X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSInitGeometry.cxx;h=fa04684c61599cd91c32f0921c4b1178a3b3813c;hb=421f5e67ecc0b8538b3bd2b319a3f92d3c54fe36;hp=1ccedf7d13cd5bf57a0da45113237ee93205013f;hpb=75473741b57b91972030d6ddfc28325b36c4374a;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSInitGeometry.cxx b/ITS/AliITSInitGeometry.cxx index 1ccedf7d13c..fa04684c615 100644 --- a/ITS/AliITSInitGeometry.cxx +++ b/ITS/AliITSInitGeometry.cxx @@ -27,6 +27,7 @@ $Id$ #include #include #include +#include #include #include #include @@ -50,21 +51,20 @@ $Id$ #include "AliITSsegmentationSPD.h" #include "AliITSsegmentationSDD.h" #include "AliITSsegmentationSSD.h" -#include "AliITSgeom.h" #include "AliITSInitGeometry.h" #include 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(): @@ -561,7 +561,7 @@ Bool_t AliITSInitGeometry::InitAliITSgeomSSD03(AliITSgeom *geom){ 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 @@ -712,8 +712,10 @@ Bool_t AliITSInitGeometry::InitAliITSgeomPPRasymmFMD(AliITSgeom *geom){ "%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 @@ -726,7 +728,7 @@ Bool_t AliITSInitGeometry::InitAliITSgeomPPRasymmFMD(AliITSgeom *geom){ {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; @@ -741,8 +743,19 @@ Bool_t AliITSInitGeometry::InitAliITSgeomPPRasymmFMD(AliITSgeom *geom){ 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()); @@ -785,8 +798,17 @@ Bool_t AliITSInitGeometry::InitAliITSgeomV11Hybrid(AliITSgeom *geom){ 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 *pathSDDsens1, *pathSDDsens2; + + const 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"; + } + + const char *pathSDDsens1, *pathSDDsens2; if (SDDIsTGeoNative()) { pathSDDsens1 = "%sITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor3_%d/ITSsddWafer3_%d/ITSsddSensitivL3_1"; pathSDDsens2 = "%sITSsddLayer4_1/ITSsddLadd_%d/ITSsddSensor4_%d/ITSsddWafer4_%d/ITSsddSensitivL4_1"; @@ -794,16 +816,25 @@ Bool_t AliITSInitGeometry::InitAliITSgeomV11Hybrid(AliITSgeom *geom){ pathSDDsens1 = "%sITSD_1/IT34_1/I004_%d/I302_%d/ITS3_%d"; pathSDDsens2 = "%sITSD_1/IT34_1/I005_%d/I402_%d/ITS4_%d"; } - + + const 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; @@ -816,26 +847,38 @@ Bool_t AliITSInitGeometry::InitAliITSgeomV11Hybrid(AliITSgeom *geom){ for(mod=0;modInit(kItype,klayers,kladders,kdetectors,nmods); - for(mod=0;modCreateMatrix(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()); @@ -960,15 +1003,16 @@ Bool_t AliITSInitGeometry::InitGeomShapePPRasymmFMD(AliITSDetector idet, 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; @@ -1052,8 +1096,6 @@ Bool_t AliITSInitGeometry::InitSegmentationPPRasymmFMD(AliITSDetector idet, 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. @@ -1510,7 +1552,7 @@ void AliITSInitGeometry::DecodeDetectorLayers(Int_t mod,Int_t &layer, // 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); @@ -1520,7 +1562,7 @@ void AliITSInitGeometry::DecodeDetectorLayers(Int_t mod,Int_t &layer, "Geometry is kvtest minor version=%d is not defined", GetMinorVersion()); return; - }break; + } break; case kvDefault:{ Error("DecodeDetectorLayers", "Major version = kvDefault, not supported"); @@ -1582,7 +1624,7 @@ void AliITSInitGeometry::DecodeDetectorvSPD02( } //______________________________________________________________________ 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. @@ -1612,7 +1654,7 @@ void AliITSInitGeometry::RecodeDetectorvSPD02(Int_t mod,Int_t &cpn0, } //______________________________________________________________________ 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 @@ -1662,7 +1704,7 @@ void AliITSInitGeometry::DecodeDetectorvSDD03( } //______________________________________________________________________ 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. @@ -1685,7 +1727,7 @@ void AliITSInitGeometry::RecodeDetectorvSDD03(Int_t mod,Int_t &cpn0, } //______________________________________________________________________ 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 @@ -1732,7 +1774,7 @@ void AliITSInitGeometry::DecodeDetectorvSSD03( } //______________________________________________________________________ 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. @@ -1755,7 +1797,7 @@ void AliITSInitGeometry::RecodeDetectorvSSD03(Int_t mod,Int_t &cpn0, } //______________________________________________________________________ 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 @@ -1799,7 +1841,7 @@ void AliITSInitGeometry::DecodeDetectorvITS04( } //______________________________________________________________________ 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. @@ -1832,7 +1874,7 @@ void AliITSInitGeometry::RecodeDetectorvITS04(Int_t mod,Int_t &cpn0, } //______________________________________________________________________ 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 @@ -1870,8 +1912,8 @@ void AliITSInitGeometry::DecodeDetectorLayersvITS04(Int_t mod,Int_t &lay, 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. @@ -2123,8 +2165,8 @@ void AliITSInitGeometry::DecodeDetectorLayersvPPRasymmFMD(Int_t mod,Int_t &lay, 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 @@ -2139,12 +2181,17 @@ void AliITSInitGeometry::DecodeDetectorv11Hybrid(Int_t &mod,Int_t layer,Int_t cp 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,i; + Int_t lad=-1,det=-1; switch(layer) { case 1: case 2:{ - lad = cpn1+kDetPerLadderSPD[layer-1]*(cpn0-1); - det = cpn2; + 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()) { @@ -2156,17 +2203,24 @@ void AliITSInitGeometry::DecodeDetectorv11Hybrid(Int_t &mod,Int_t layer,Int_t cp } } break; case 5: case 6:{ - lad = cpn0; - det = cpn1; + if (SSDIsTGeoNative()) { + lad = cpn0+1; + det = cpn1+1; + } else { + lad = cpn0; + det = cpn1; + } } break; default:{ } break; } // end switch mod = 0; - for(i=0;i6||lay<1) Error("DecodeDetectorLayers","06",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","06",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++; } //______________________________________________________________________ @@ -2286,9 +2426,25 @@ Bool_t AliITSInitGeometry::WriteVersionString(Char_t *str,Int_t length, // 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;i1) 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++; @@ -2311,14 +2467,16 @@ Bool_t AliITSInitGeometry::WriteVersionString(Char_t *str,Int_t length, if(10+i1)printf("AliITSInitGeometry::WriteVersionString: " "n=%d str=%s revision[%zu] date[%zu]\n", n,str,strlen(cvsrevision),strlen(cvsdate)); + */ delete[] cvsrevision; delete[] cvsdate; return kTRUE; @@ -2360,8 +2518,8 @@ Bool_t AliITSInitGeometry::ReadVersionString(const Char_t *str,Int_t length, 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",