X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FMUONGenerateBusPatch.C;h=cff8fbc9ac8b8f7730163295348e11139ba8f36a;hb=421fc2acb7a709022820115f411bf00a0ef04e9c;hp=230ca98a9810c6770ef61c25df49e86382260126;hpb=f2bc136f66da68acf8f537709b4cc779b4f6ce53;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/MUONGenerateBusPatch.C b/MUON/MUONGenerateBusPatch.C index 230ca98a981..cff8fbc9ac8 100644 --- a/MUON/MUONGenerateBusPatch.C +++ b/MUON/MUONGenerateBusPatch.C @@ -13,19 +13,41 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +// $Id$ + +#if !defined(__CINT__) || defined(__MAKECINT__) +// ROOT includes +#include +#include +#include +#include + +// MUON includes +#include "AliMpBusPatch.h" + +#endif + +/// \ingroup macros +/// \file MUONGenerateBusPatch.C +/// \brief Generates buspatch id and DDL id for given detection element id +/// +/// - station 1 & 2 assuming 24 buspatches per quadrant +/// - station345, reading from DetElemIdToSlatType.dat file and calculates +/// the number of bus patches per slat (and also number of Translator and Bridge Boards). +/// Generates an output file DetElemIdToBusPatch.dat.out, preserve from overwriting +/// +/// List of changes: +/// - July 05, first version +/// - Nov. 05, added DDL +/// - June 06, correction for St123 +/// - Feb. 07, add 1st manu list for St12 (starting on NB !) and new ddl sharing for station 3) +/// - June. 07, new numbering of station 345, and buspatch starts at 1) +/// +/// \author Ch. Finck, July 05 + void MUONGenerateBusPatch() { - // Generates buspatch id and DDL id for given detection element id - // station 1 & 2 assuming 24 buspatches per quadrant - // station345, reading from DetElemIdToSlatType.dat file and calculates - // the number of bus patches per slat (and also number of Translator and Bridge Boards). - // Generates an output file DetElemIdToBusPatch.dat.out, preserve from overwriting - // (Ch. Finck, July 05) - // (Nov. 05, added DDL) - // (June 06, correction for St123) - // (Feb. 07, add 1st manu list for St12 (starting on NB !) and new ddl sharing for station 3) - TString dirPath2 = gSystem->Getenv("ALICE_ROOT"); dirPath2 += "/MUON/mapping/data/"; @@ -42,10 +64,9 @@ void MUONGenerateBusPatch() Int_t idDE; Int_t i; Int_t cursor = 0; - Int_t begin[800]; - Int_t end[800]; + Int_t begin[900]; + Int_t end[900]; Int_t nbBusPatch; - Int_t listDE[800]; Int_t nbTB = 0; Int_t nbBB = 0; Int_t idSt12[] = {100, 101, 102, 103, @@ -59,16 +80,7 @@ void MUONGenerateBusPatch() Char_t manuListSt2[] = " 1,27,53,79,105,131,157,183,201,214,226,246,1025,1051,1077,1103,1129,1155,1181,1207,1225,1238,1251,1269"; - Int_t idCh5swp1 = 5; // 1/4 chamber for DDL on horizontal - Int_t idCh5swp2 = 10; // 1/4 chamber for DDL on horizontal - Int_t idCh5swp3 = 14; // 1/4 chamber for DDL on horizontal - - Int_t idCh6swp1 = 5; // 1/4 chamber for DDL on horizontal - Int_t idCh6swp2 = 9; // 1/4 chamber for DDL on horizontal - Int_t idCh6swp3 = 14; // 1/4 chamber for DDL on horizontal - Int_t idSt45swp1 = 7; // half chamber for DDL in vertical cutting twice the official numbering - Int_t idSt45swp2 = 20; Int_t iDDL = 0; // station 1 & 2 @@ -82,22 +94,23 @@ void MUONGenerateBusPatch() idDE = idSt12[j]; if (idDE % 100 == 0) { iDDL++; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(0, iDDL-1); + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1); cout << "# Chamber " << idDE/100 << endl; out << "# Chamber " << idDE/100 << endl; } if (idDE % 100 == 1) { iDDL++; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(0, iDDL-1); + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1); } if (idDE % 100 == 3) { iDDL--; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(0, iDDL-1) + nbBusPatch; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1) + nbBusPatch; } end[cursor] = begin[cursor] + nbBusPatch - 1; - begin[++cursor] = end[cursor] + 1; + ++cursor; // it seems that vec[++i] does not work in Cint + begin[cursor] = end[cursor-1] + 1; cout << idDE << " " << begin[cursor-1] + nbHalfBusPatch << "-" <= idCh5swp1 && idDE < idCh5swp2) { + + if ( idDE == idCh5swp1) { + iDDL = (idDE/100)*2 ; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp1, iDDL-1); + } + + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<= idCh5swp2 && idDE < idCh5swp3) { + + if (idDE == idCh5swp2) { + iDDL = (idDE/100)*2-1; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1); + } + + end[cursor] = begin[cursor] + nbBusPatch - 1; + ++cursor; + begin[cursor] = end[cursor-1] + 1; + + cout << idDE << " " << begin[cursor-1]<<"-"<= idCh5swp3 && idDE < idCh5swp4) { + + if (idDE == idCh5swp3) { + iDDL = (idDE/100)*2+1; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1); + } + + end[cursor] = begin[cursor] + nbBusPatch - 1; + ++cursor; + begin[cursor] = end[cursor-1] + 1; + + cout << idDE << " " << begin[cursor-1]<<"-"<= idCh5swp4 && idDE < 600) { + + if ( idDE == idCh5swp4) { + iDDL = (idDE/100)*2+2 ; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp2, iDDL-1); + } + + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<= idCh6swp1 && idDE < idCh6swp2) { + + if ( idDE == idCh6swp1) { + iDDL = (idDE/100)*2-2 ; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp1+offsetBusCh6swp1, iDDL-1); + } + + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<= idCh6swp2 && idDE < idCh6swp3) { + + if (idDE == idCh6swp2) { + iDDL = (idDE/100)*2-3; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp2+1, iDDL-1); + } - if (idDE == 600 +idCh6swp2) { - iDDL = iDDLSt3Swap3; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(nbBusSt3Swap3, iDDL-1); - nbBusSt3Tot4 += nbBusPatch; + end[cursor] = begin[cursor] + nbBusPatch - 1; + ++cursor; + begin[cursor] = end[cursor-1] + 1; + + cout << idDE << " " << begin[cursor-1]<<"-"<= idCh6swp3 && idDE < idCh6swp4) { + + if (idDE == idCh6swp3) { + iDDL = (idDE/100)*2-1; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp1+1, iDDL-1); + } + + end[cursor] = begin[cursor] + nbBusPatch - 1; + ++cursor; + begin[cursor] = end[cursor-1] + 1; + + cout << idDE << " " << begin[cursor-1]<<"-"<= idCh6swp4 && idDE < 700) { + + if ( idDE == idCh6swp4) { + iDDL = (idDE/100)*2 ; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusCh5swp2+offsetBusCh6swp2, iDDL-1); + } + + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<= 700) { - if (idDE % 100 == 0) { - nbBusSt45Tot = 0; - iDDL++; - if (idDE >=800) - iDDL++; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(0, iDDL-1); - cout << "# Chamber " << idDE/100 << endl; - out << "# Chamber " << idDE/100 << endl; - } - - nbBusSt45Tot += nbBusPatch; + if (idDE % 100 == 0) { + cout << "# Chamber " << idDE/100 << endl; + out << "# Chamber " << idDE/100 << endl; + } - if (idDE == 700+idSt45swp1 || idDE == 800+idSt45swp1 || idDE == 900+idSt45swp1 || idDE == 1000+idSt45swp1 ) { - iDDL++; - begin[cursor] = AliMpBusPatch::GetGlobalBusID(0, iDDL-1); - nbBusSt45Swap = nbBusSt45Tot - nbBusPatch; - nbBusSt45Tot = 0; + if ((idDE % 100) >= idSt45swp1 && (idDE % 100) < idSt45swp2) { + if ((idDE % 100) == idSt45swp1) { + iDDL = (idDE/100)*2-1; + begin[cursor] = AliMpBusPatch::GetGlobalBusID(1, iDDL-1); + } + end[cursor] = begin[cursor] + nbBusPatch - 1; + ++cursor; + begin[cursor] = end[cursor-1] + 1; + + cout << idDE << " " << begin[cursor-1]<<"-"<= idSt45swp2) { + + if ((idDE % 100) == idSt45swp2 ) { + iDDL = (idDE/100)*2 ; + if (idDE/100 == 7 || idDE/100 == 8) + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusSt4swp, iDDL-1); + else + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusSt5swp, iDDL-1); + + } + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<= 0 && (idDE % 100) < idSt45swp1) { + + if ((idDE % 100) == 0 ) { + iDDL = (idDE/100)*2; + if (idDE/100 == 7 || idDE/100 == 8) + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusSt4, iDDL-1); + else + begin[cursor] = AliMpBusPatch::GetGlobalBusID(offsetBusSt5, iDDL-1); + + } + end[cursor] = begin[cursor] - nbBusPatch + 1; + ++cursor; + begin[cursor] = end[cursor-1] - 1; + + cout << idDE << " " << end[cursor-1]<<"-"<