+ if (id > 31 || id < 0)
+ {
+ AliError(Form("TRU index out of range: %d",id));
+ }
+ Int_t idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1;
+ return idx;
+}
+
+//________________________________________________________________________________________________
+void AliEMCALGeometry::BuildFastOR2DMap()
+{
+ // Needed by STU
+
+ for (Int_t i = 0; i < 32; i++)
+ {
+ for (Int_t j = 0; j < 24; j++)
+ {
+ for (Int_t k = 0; k < 4; k++)
+ {
+ Int_t id;
+ if (GetAbsFastORIndexFromPositionInTRU(i, j, k, id))
+ {
+ Int_t x = j, y = k + 4 * int(i / 2);
+ if (i % 2) x += 24;
+ fFastOR2DMap[x][y] = id;
+ }
+ }
+ }
+ }
+}
+
+//________________________________________________________________________________________________
+Bool_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const
+{
+ //Trigger mapping method, from STU index get TRU index
+
+ if (id > 31 || id < 0)
+ {
+ AliError(Form("TRU index out of range: %d",id));
+ return kFALSE;
+ }
+ if (id == 31) {
+ idx = 31;
+ return kTRUE;
+ }
+ idx = ((id % 6) < 3) ? 6 * int(id / 6) + 2 * (id % 3) : 6 * int(id / 6) + 2 * (2 - (id % 3)) + 1;
+ return kTRUE;
+}
+
+//________________________________________________________________________________________________
+Int_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id) const
+{
+ //Trigger mapping method, from STU index get TRU index