6 #include "StTpcDb/StTpcDb.h"
7 #include "St_db_Maker/St_db_Maker.h"
9 #include "tables/St_Survey_Table.h"
10 #include "tables/St_istPedNoise_Table.h"
11 #include "tables/St_istGain_Table.h"
12 #include "tables/St_istMapping_Table.h"
13 #include "tables/St_istControl_Table.h"
14 #include "tables/St_istChipConfig_Table.h"
15 #include "tables/St_istSimPar_Table.h"
17 THashList *StIstDb::mgRotList = 0;
28 mGeoHMatrixTpcOnGlobal = NULL;
33 mIstChipStatus = NULL;
37 Int_t StIstDb::setGeoHMatrices(Survey_st **tables)
39 using namespace StIstConsts;
41 SafeDelete(mgRotList);
43 mgRotList->SetOwner(kFALSE);
47 mGeoHMatrixTpcOnGlobal = (TGeoHMatrix *)&gStTpcDb->Tpc2GlobalMatrix();
50 if (mGeoHMatrixTpcOnGlobal)
delete mGeoHMatrixTpcOnGlobal;
52 mGeoHMatrixTpcOnGlobal =
new TGeoHMatrix(
"tpcOnGlobal");
53 LOG_WARN <<
"No gStTpcDb, use null transformation for tpc on global" << endm;
57 Survey_st *idsOnTpc = tables[0];
58 Survey_st *pstOnIds = tables[1];
59 Survey_st *istOnPst = tables[2];
60 Survey_st *laddersOnIst = tables[3];
61 Survey_st *sensorsOnLadders = tables[4];
63 mGeoHMatrixIdsOnTpc.SetName(
"idsOnTpc");
64 mGeoHMatrixIdsOnTpc.SetRotation(&idsOnTpc->r00);
65 mGeoHMatrixIdsOnTpc.SetTranslation(&idsOnTpc->t0);
67 mGeoHMatrixPstOnIds.SetName(
"pstOnIds");
68 mGeoHMatrixPstOnIds.SetRotation(&pstOnIds->r00);
69 mGeoHMatrixPstOnIds.SetTranslation(&pstOnIds->t0);
71 mGeoHMatrixIstOnPst.SetName(
"istOnPst");
72 mGeoHMatrixIstOnPst.SetRotation(&istOnPst->r00);
73 mGeoHMatrixIstOnPst.SetTranslation(&istOnPst->t0);
76 int id = sensorsOnLadders->Id;
77 TGeoHMatrix *comb = (TGeoHMatrix *) mgRotList->FindObject(Form(
"R%04i",
id));
81 comb =
new TGeoHMatrix(Form(
"R%04i",
id));
86 LOG_WARN <<
"Ladder ID is out of range (1 - 24)!" << endm;
91 LOG_WARN <<
"Sensor ID is out of range (1 - 6)!" << endm;
96 mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1].SetName(Form(
"sensorOnLadder%4i%4i", ladder, sensor));
97 mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1].SetRotation(&sensorsOnLadders->r00);
98 mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1].SetTranslation(&sensorsOnLadders->t0);
100 TGeoHMatrix *sensorLocal = (TGeoHMatrix *) mgRotList->FindObject(Form(
"sensorLocal%04i",
id));
103 sensorLocal =
new TGeoHMatrix(Form(
"sensorLocal%04i",
id));
104 sensorLocal->SetRotation(mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1].GetRotationMatrix());
105 sensorLocal->SetTranslation(mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1].GetTranslation());
106 mgRotList->Add(sensorLocal);
111 if (ladder == laddersOnIst->Id) {
112 mGeoHMatrixLadderOnIst[ladder - 1].SetName(Form(
"ladderOnIst%4i", ladder));
113 mGeoHMatrixLadderOnIst[ladder - 1].SetRotation(&laddersOnIst->r00);
114 mGeoHMatrixLadderOnIst[ladder - 1].SetTranslation(&laddersOnIst->t0);
120 TGeoHMatrix sensorGlobal = (*mGeoHMatrixTpcOnGlobal) * mGeoHMatrixIdsOnTpc * mGeoHMatrixPstOnIds * mGeoHMatrixIstOnPst * mGeoHMatrixLadderOnIst[ladder - 1] * mGeoHMatrixSensorOnLadder[ladder - 1][sensor - 1];
122 comb->SetRotation(sensorGlobal.GetRotationMatrix());
123 comb->SetTranslation(sensorGlobal.GetTranslation());
124 mgRotList->Add(comb);
138 if (ladder < 1 || ladder > kIstNumLadders || sensor < 1 || sensor > kIstNumSensorsPerLadder)
141 int id = 1000 + (ladder - 1) * kIstNumSensorsPerLadder + sensor;
142 return mgRotList ? (
const TGeoHMatrix *) mgRotList->FindObject(Form(
"R%04i",
id)) : 0;
146 void StIstDb::Print(Option_t *opt)
const
148 mGeoHMatrixTpcOnGlobal->Print();
149 mGeoHMatrixIdsOnTpc.Print();
150 mGeoHMatrixPstOnIds.Print();
151 mGeoHMatrixIstOnPst.Print();
154 mGeoHMatrixLadderOnIst[iL].Print();
159 mGeoHMatrixSensorOnLadder[iL][iS].Print();
164 TGeoHMatrix *sensorOnGlobal = (TGeoHMatrix *) mgRotList->FindObject(Form(
"R%04i", iS + 1000));
165 sensorOnGlobal->Print();
const int kIstNumLadders
24 IST Ladders
const int kIstNumSensorsPerLadder
6 sensor per one IST Ladder
static const TGeoHMatrix * getHMatrixSensorOnGlobal(int ladder, int sensor)
const int kIstNumSensors
144 sensors