+//________________________________________________________________
+
+Int_t
+AliT0Parameters::GetChannel(Int_t trm, Int_t tdc, Int_t chain, Int_t channel)
+{
+
+ if (fgLookUp) {
+ AliT0LookUpValue key(trm,tdc,chain,channel);
+ AliT0LookUpKey *val = (AliT0LookUpKey*) fgLookUp->GetMapLookup()->GetValue((TObject*)&key);
+ // AliT0LookUpKey *val = (AliT0LookUpKey*) fLookUp.GetValue((TObject*)&key);
+ if (val )
+ return val->GetKey();
+ else {
+ AliWarning(Form("No such address (%d %d %d %d)!",trm,tdc,chain,channel));
+ return -1;
+ }
+ }
+ else {
+ AliError("No look up table has been loader!");
+ return -1;
+ }
+
+}
+//__________________________________________________________________
+TMap *AliT0Parameters::GetMapLookup()
+{
+ if (!fgLookUp){
+ cout<<" No look up table in OCDB";
+ return 0;
+ }
+ return fgLookUp->GetMapLookup();
+}
+//__________________________________________________________________
+
+Int_t
+AliT0Parameters::GetNumberOfTRMs()
+{
+ // return number of trms
+ //
+ if (!fgLookUp) {
+ // fNumberOfTRMs = 2;
+ return fNumberOfTRMs;
+ }
+ return fgLookUp ->GetNumberOfTRMs();
+}
+/*
+//________________________________________________________________________________
+Double_t AliT0Parameters::GetZPosition(const char* symname){
+// Get the global z coordinate of the given T0 alignable volume
+//
+ Double_t *tr = AliGeomManager::GetMatrix(symname)->GetTranslation();
+
+ return tr[2];
+}
+*/
+//________________________________________________________________________________
+Double_t AliT0Parameters::GetZPosition(const char* symname){
+// Get the global z coordinate of the given T0 alignable volume
+//
+ Double_t *tr;
+ TGeoPNEntry *pne = gGeoManager->GetAlignableEntry(symname);
+ if (!pne) return 0;
+
+
+ TGeoPhysicalNode *pnode = pne->GetPhysicalNode();
+ if(pnode){
+ TGeoHMatrix* hm = pnode->GetMatrix();
+ tr = hm->GetTranslation();
+ }else{
+ const char* path = pne->GetTitle();
+ if(!gGeoManager->cd(path)){
+ AliErrorClass(Form("Volume path %s not valid!",path));
+ return 0;
+ }
+ tr = gGeoManager->GetCurrentMatrix()->GetTranslation();
+ }
+ return tr[2];
+
+}
+//________________________________________________________________________________
+
+Double_t AliT0Parameters::GetZPositionShift(const char* symname)
+{
+// Get the global z coordinate of the given T0 alignable volume
+//
+ Double_t *tr = AliGeomManager::GetMatrix(symname)->GetTranslation();
+
+ TGeoHMatrix origmat;
+ AliGeomManager::GetOrigGlobalMatrix(symname,origmat);
+ Double_t *otr = origmat.GetTranslation();
+
+ return (tr[2]-otr[2]);
+}
+