// 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)
+ // (Nov. 05, added DDL)
+ // (June 06, correction for St123)
TString dirPath2 = gSystem->Getenv("ALICE_ROOT");
dirPath2 += "/MUON/mapping/data/";
300, 301, 302, 303,
400, 401, 402, 403};
- Int_t idSt3swp = 9; // half chamber for DDL on horizontal
+ Int_t idSt3swp1 = 5; // 1/4 chamber for DDL on horizontal
+ Int_t idSt3swp2 = 9; // 1/4 chamber for DDL on horizontal
+ Int_t idSt3swp3 = 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;
+ const Int_t kFactor = 50;
// station 1 & 2
nbBusPatch = 24;
cout << "#DE BusPatch DDL SlatName" << endl;
idDE = idSt12[j];
if (idDE % 100 == 0) {
- begin[cursor] = idDE;
+ iDDL++;
+ begin[cursor] = iDDL * kFactor;
cout << "# Chamber " << idDE/100 << endl;
out << "# Chamber " << idDE/100 << endl;
}
- if (idDE % 2 == 0) iDDL++;
+ if (idDE % 100 == 1) {
+ iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ }
+ if (idDE % 100 == 3) {
+ iDDL--;
+ begin[cursor] = iDDL * kFactor + nbBusPatch;
+ }
end[cursor] = begin[cursor] + nbBusPatch - 1;
begin[++cursor] = end[cursor] + 1;
- cout << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL << endl;
- out << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL <<endl;
+ cout << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL-1 << endl;
+ out << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL-1 <<endl;
+ if (idDE % 100 == 3) iDDL++;
+
}
// station 345
nbBusPatch = 0;
+ Int_t nbBusSt3Tot1 = 0;
+ Int_t nbBusSt3Tot2 = 0;
+ Int_t nbBusSt3Tot3 = 0;
+ Int_t nbBusSt3Tot4 = 0;
+
+ Int_t nbBusSt3Swap1 = 0;
+ Int_t nbBusSt3Swap2 = 0;
+ Int_t nbBusSt3Swap3 = 0;
+ Int_t nbBusSt3Swap4 = 0;
+
+ Int_t iDDLSt3Swap1 = 0;
+ Int_t iDDLSt3Swap2 = 0;
+ Int_t iDDLSt3Swap3 = 0;
+ Int_t iDDLSt3Swap4 = 0;
+
+ Int_t nbBusSt45Tot = 0;
+ Int_t nbBusSt45Swap = 0;
+
+ // reads from file
while ( in.getline(line,80) ) {
if ( line[0] == '#' || line[0] == '\0' ) continue;
nbTB += nbBusPatch;
if (nameSlat[len-1] == '1') {
- nbTB += 2;
- nbBusPatch+=2;
+ nbTB += 2;
+ nbBusPatch+=2;
}
if (nameSlat[len-1] == '2' || nameSlat[len-1] == '3') {
nbTB += 1;
nbBusPatch++;
}
- listDE[cursor] = idDE;
+
+ // station 3
+ // for buspatch length reasons, one ddl connects one 1/4 of two chambers
+ // really messy isn't it ?
+
+ if (idDE < 700 ) {
+
+ if (idDE == 500) {
+ iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ nbBusSt3Tot1 = 0;
+
+ }
+ if (idDE % 100 == 0) {
+ cout << "# Chamber " << idDE/100 << endl;
+ out << "# Chamber " << idDE/100 << endl;
+ }
+
+ nbBusSt3Tot1 += nbBusPatch;
+
+ // second 1/4 for chamber 5
+ if (idDE == 500+idSt3swp1) {
+ iDDLSt3Swap1 = iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ nbBusSt3Swap1 = nbBusSt3Tot1 - nbBusPatch;
+ nbBusSt3Tot1 = 0;
+ nbBusSt3Tot2 = 0;
+ }
+
+ // first 1/4 chamber 6
+ if (idDE == 600) {
+ iDDL = iDDLSt3Swap1;
+ begin[cursor] = iDDL * kFactor + nbBusSt3Swap1;
+ }
+ // third 1/4 for chamber 5
+ if (idDE == 500+idSt3swp2) {
+ iDDL = iDDLSt3Swap1+1;
+ iDDLSt3Swap2 = iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ nbBusSt3Swap2 = nbBusSt3Tot2;
+ nbBusSt3Tot2 = 0;
+ nbBusSt3Tot3 = 0;
+ }
+ nbBusSt3Tot2 += nbBusPatch;
+
+ // second 1/4 chamber 6
+ if (idDE == 600 +idSt3swp1) {
+ iDDL = iDDLSt3Swap2;
+ begin[cursor] = iDDL * kFactor + nbBusSt3Swap2;
+ }
+
+ // fourth 1/4 chamber 5
+ if (idDE == 500+idSt3swp3) {
+ iDDL = iDDLSt3Swap2+1;
+ iDDLSt3Swap3 = iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ nbBusSt3Swap3 = nbBusSt3Tot3;
+ nbBusSt3Tot2 = 0;
+ nbBusSt3Tot3 = 0;
+ nbBusSt3Tot4 = 0;
+ }
+ nbBusSt3Tot3 += nbBusPatch;
+
+ //third 1/4 chamber 6
+ if (idDE == 600)
+ nbBusSt3Swap4 = nbBusSt3Tot4;
+
+ if (idDE == 600 +idSt3swp2) {
+ iDDL = iDDLSt3Swap3;
+ begin[cursor] = iDDL * kFactor + nbBusSt3Swap3;
+ nbBusSt3Tot4 += nbBusPatch;
+ }
+ nbBusSt3Tot4 += nbBusPatch;
+
+ // fourth 1/4 chamber 6
+ if (idDE == 600 +idSt3swp3) {
+ iDDL = iDDLSt3Swap3+1;
+ begin[cursor] = iDDL * kFactor + nbBusSt3Swap4;
+ }
+
+ end[cursor] = begin[cursor] + nbBusPatch - 1;
+ begin[++cursor] = end[cursor] + 1;
+
+ cout << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] << " " << iDDL-1 << " " <<nameSlat <<endl;
+ out << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL-1 <<endl;
+ }
+
+ // station 4 & 5
+ // back to normal one ddl connects one 1/2 chamber
+ // finally !
+ if (idDE == 700) {
+ iDDL = ((idDE-1)/100)*2;
+ }
+ if (idDE >= 700) {
+
if (idDE % 100 == 0) {
+ nbBusSt45Tot = 0;
iDDL++;
if (idDE >=800)
iDDL++;
- begin[cursor] = idDE;
+ begin[cursor] = iDDL * kFactor;
cout << "# Chamber " << idDE/100 << endl;
out << "# Chamber " << idDE/100 << endl;
}
- if (idDE == 500+idSt3swp || idDE == 600+idSt3swp )
- iDDL++;
- if (idDE == 700+idSt45swp1 || idDE == 800+idSt45swp1 || idDE == 900+idSt45swp1 || idDE == 1000+idSt45swp1 )
- iDDL++;
+ nbBusSt45Tot += nbBusPatch;
- if (idDE == 700+idSt45swp2 || idDE == 800+idSt45swp2 || idDE == 900+idSt45swp2 || idDE == 1000+idSt45swp2 )
+ if (idDE == 700+idSt45swp1 || idDE == 800+idSt45swp1 || idDE == 900+idSt45swp1 || idDE == 1000+idSt45swp1 ) {
+ iDDL++;
+ begin[cursor] = iDDL * kFactor;
+ nbBusSt45Swap = nbBusSt45Tot - nbBusPatch;
+ nbBusSt45Tot = 0;
+ }
+ if (idDE == 700+idSt45swp2 || idDE == 800+idSt45swp2 || idDE == 900+idSt45swp2 || idDE == 1000+idSt45swp2 ) {
iDDL--;
+ begin[cursor] = iDDL * kFactor + nbBusSt45Swap;
+ }
+ end[cursor] = begin[cursor] + nbBusPatch - 1;
+ begin[++cursor] = end[cursor] + 1;
- end[cursor] = begin[cursor] + nbBusPatch - 1;
- begin[++cursor] = end[cursor] + 1;
+ cout << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] << " " << iDDL-1 << " " <<nameSlat <<endl;
+ out << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL-1 <<endl;
+ }
- cout << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] << " " << iDDL << " " <<nameSlat <<endl;
- out << idDE << " " << begin[cursor-1]<<"-"<<end[cursor-1] <<" " << iDDL <<endl;
}
printf(" Slat: number of TB %d and BB %d\n", nbTB, nbBB);
in.close();