+ Int_t srow = startRowBus[ibus];
+ Int_t erow = endRowBus[ibus];
+ Int_t scol = startColBus[ibus];
+ Int_t ecol = endColBus[ibus];
+ Int_t tmcm = mcmperBus[ibus];
+
+ if ((row >= srow && row <= erow) && (col >= scol && col <= ecol))
+ {
+ busno = ibus;
+
+ // Find out the MCM Number
+ //
+
+ if (imodule < 6) mcmno = (col-scol)/4 + 1;
+ if (imodule >= 6 && imodule < 12) mcmno = (col-scol)/4 + 1;
+
+ if (imodule >= 12 && imodule < 18)
+ {
+ icolnew = (col - scol)/4;
+ mcmno = tmcm - icolnew;
+ }
+ if (imodule >= 18 && imodule < 24)
+ {
+ icolnew = (col - scol)/4;
+ mcmno = tmcm - icolnew;
+ }
+
+ // DDL = 4
+ if (imodule >= 24 && imodule < 30)
+ {
+
+ //if (tmcm == 24)
+ Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
+ if(rowdiff > 16)
+ {
+ Int_t midrow = srow + 16;
+ if(row >= srow && row < midrow)
+ {
+ mcmno = 12 + (col-scol)/4 + 1;
+ }
+ else if(row >= midrow && row <= erow)
+
+ {
+ mcmno = (col-scol)/4 + 1;
+ }
+ }
+ else if (rowdiff < 16)
+ {
+ mcmno = (col-scol)/4 + 1;
+ }
+
+ }
+ if (imodule >= 42 && imodule < 48)
+ {
+ Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
+ if(rowdiff > 16)
+ {
+ Int_t midrow = srow + 16;
+ if (row >= midrow && row <= erow)
+ {
+ mcmno = 12 + (ecol -col)/4 + 1;
+ }
+ else if (row >= srow && row < midrow)
+ {
+ mcmno = (ecol - col)/4 + 1;
+ }
+ }
+ else if (rowdiff < 16)
+ {
+ mcmno = (ecol - col)/4 + 1;
+ }
+ }
+
+ // DDL = 5
+ if (imodule >= 30 && imodule < 36)
+ {
+ // CPV plane, SU Mod = 1, 2 : ddl = 5
+
+ //if(tmcm == 24)
+ Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
+ if(rowdiff > 16)
+ {
+ Int_t midrow = srow + 16;
+ if(row >= srow && row < midrow)
+ {
+ mcmno = 12 + (col-scol)/4 + 1;
+ }
+ else if(row >= midrow && row <= erow)
+ {
+ mcmno = (col-scol)/4 + 1;
+ }
+ }
+ else if(rowdiff < 16)
+ {
+ mcmno = (col-scol)/4 + 1;
+ }
+
+ }
+ if (imodule >= 36 && imodule < 42)
+ {
+ Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
+ if(rowdiff > 16)
+ {
+ Int_t midrow = srow + 16;
+ if (row >= midrow && row <= erow)
+ {
+ mcmno = 12 + (ecol - col)/4 + 1;
+ }
+ else if (row >= srow && row < midrow)
+ {
+ mcmno = (ecol - col)/4 + 1;
+ }
+ }
+ else if (rowdiff < 16)
+ {
+ mcmno = (ecol - col)/4 + 1;
+ }
+ }
+
+ }