1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////
18 // MCM configuraton handler //
20 // Author: U. Westerhoff //
22 ////////////////////////////////////////////////////////////////////////////
24 #include "AliTRDtrapConfigHandler.h"
32 #include "AliTRDfeeParam.h"
33 #include "AliTRDtrapConfig.h"
34 #include "AliTRDmcmSim.h"
35 #include "AliTRDgeometry.h"
36 #include "AliTRDcalibDB.h"
39 #include "TGeoMatrix.h"
42 #include "Cal/AliTRDCalOnlineGainTable.h"
43 #include "Cal/AliTRDCalOnlineGainTableROC.h"
44 #include "Cal/AliTRDCalOnlineGainTableMCM.h"
48 AliTRDtrapConfig* AliTRDtrapConfigHandler::fgActiveTrapConfig = 0x0;
50 AliTRDtrapConfigHandler::AliTRDtrapConfigHandler(AliTRDtrapConfig *cfg) :
52 , fRestrictiveMask((0x3ffff << 11) | (0x1f << 6) | 0x3f)
60 AliTRDtrapConfigHandler::~AliTRDtrapConfigHandler()
65 void AliTRDtrapConfigHandler::Init()
68 AliError("No TRAPconfig given");
72 // setup of register allocation
73 // I/O configuration which we don't care about
74 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kSEBDOU, AliTRDtrapConfig::kAllocNone);
75 // position look-up table by layer
76 for (Int_t iBin = 0; iBin < 128; iBin++)
77 fTrapConfig->SetTrapRegAlloc((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + iBin), AliTRDtrapConfig::kAllocByLayer);
79 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kC14CPUA, AliTRDtrapConfig::kAllocByMCM);
80 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kC15CPUA, AliTRDtrapConfig::kAllocByMCM);
82 // setup of DMEM allocation
83 for(Int_t iAddr = AliTRDtrapConfig::fgkDmemStartAddress;
84 iAddr < (AliTRDtrapConfig::fgkDmemWords + AliTRDtrapConfig::fgkDmemStartAddress); iAddr++) {
86 if(iAddr == AliTRDmcmSim::fgkDmemAddrDeflCorr)
87 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
89 else if(iAddr == AliTRDmcmSim::fgkDmemAddrNdrift)
90 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByDetector);
92 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrDeflCutStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrDeflCutEnd))
93 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
95 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrTrackletStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrTrackletEnd))
96 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCM);
98 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrLUTStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrLUTEnd))
99 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
101 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTcor0)
102 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
104 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTcor1)
105 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
107 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTnbins)
108 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
110 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTLength)
111 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
114 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
118 void AliTRDtrapConfigHandler::ResetMCMs()
121 // Reset all MCM registers and DMEM
125 AliError("No TRAPconfig given");
129 fTrapConfig->ResetRegs();
130 fTrapConfig->ResetDmem();
134 Int_t AliTRDtrapConfigHandler::LoadConfig()
136 // load a default configuration which is suitable for simulation
137 // for a detailed description of the registers see the TRAP manual
138 // if you want to resimulate tracklets on real data use the appropriate config instead
141 AliError("No TRAPconfig given");
146 // ndrift (+ 5 binary digits)
147 ltuParam.SetNtimebins(20 << 5);
148 // deflection + tilt correction
149 ltuParam.SetRawOmegaTau(0.16133);
150 // deflection range table
151 ltuParam.SetRawPtMin(0.1);
153 ltuParam.SetRawMagField(0.0);
154 // scaling factors for q0, q1
155 ltuParam.SetRawScaleQ0(0);
156 ltuParam.SetRawScaleQ1(0);
157 // disable length correction and tilting correction
158 ltuParam.SetRawLengthCorrectionEnable(kFALSE);
159 ltuParam.SetRawTiltCorrectionEnable(kFALSE);
161 for (Int_t iDet = 0; iDet < 540; iDet++) {
162 // HC header configuration bits
163 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, 0x2102, iDet); // zs, deh
166 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC13CPUA, 24, iDet);
169 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPNP, 4*10, iDet);
170 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPTC, 0, iDet);
171 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPBY, 0, iDet); // bypassed!
174 for (Int_t adc = 0; adc < 20; adc++) {
175 fTrapConfig->SetTrapReg(AliTRDtrapConfig::TrapReg_t(AliTRDtrapConfig::kFGA0+adc), 40, iDet);
176 fTrapConfig->SetTrapReg(AliTRDtrapConfig::TrapReg_t(AliTRDtrapConfig::kFGF0+adc), 15, iDet);
178 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGTA, 20, iDet);
179 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGTB, 2060, iDet);
180 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGBY, 0, iDet); // bypassed!
183 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTAL, 200, iDet);
184 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTLL, 0, iDet);
185 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTLS, 200, iDet);
186 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTBY, 0, iDet);
188 // tracklet calculation
189 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQS0, 5, iDet);
190 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQE0, 10, iDet);
191 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQS1, 11, iDet);
192 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQE1, 20, iDet);
193 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFS, 5, iDet);
194 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFE, 20, iDet);
195 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPVBY, 0, iDet);
196 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPVT, 10, iDet);
197 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPHT, 150, iDet);
198 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFP, 40, iDet);
199 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPCL, 1, iDet);
200 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPCT, 10, iDet);
203 ConfigureDyCorr(iDet);
204 ConfigureDRange(iDet); // deflection range
205 ConfigureNTimebins(iDet); // timebins in the drift region
206 ConfigurePIDcorr(iDet); // scaling parameters for the PID
209 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBSF, 1, iDet); // 0: store filtered; 1: store unfiltered
211 // zs applied to data stored in event buffer (sel. by EBSF)
212 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIS, 15 << 2, iDet); // single indicator threshold (plus two digits)
213 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIT, 30 << 2, iDet); // sum indicator threshold (plus two digits)
214 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIL, 0xf0, iDet); // lookup table
215 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIN, 0, iDet); // neighbour sensitivity
218 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kNES, (0x0000 << 16) | 0x1000, iDet);
221 // ****** hit position LUT
223 // now calculate it from PRF
224 AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
226 Double_t padResponse[3]; // pad response left, central, right
227 Double_t padResponseR[3]; // pad response left, central, right
228 Double_t padResponseL[3]; // pad response left, central, right
230 for (Int_t iLayer = 0; iLayer < 6; iLayer++) {
232 for (Int_t iBin = 0; iBin < 256*0.5; iBin++) {
233 cal->PadResponse(1., iBin*1./256., iLayer, padResponse);
234 cal->PadResponse(1., iBin*1./256.-1., iLayer, padResponseR);
235 cal->PadResponse(1., iBin*1./256.+1., iLayer, padResponseL);
236 gr.SetPoint(iBin, (0.5 * (padResponseR[1] - padResponseL[1])/padResponse[1] * 256), iBin);
238 for (Int_t iBin = 0; iBin < 128; iBin++) {
239 Int_t corr = (Int_t) (gr.Eval(iBin)) - iBin;
244 for (Int_t iStack = 0; iStack < 540/6; iStack++) {
245 fTrapConfig->SetTrapReg((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + iBin), corr, 6*iStack + iLayer);
249 // ****** hit position LUT configuration end
255 Int_t AliTRDtrapConfigHandler::LoadConfig(TString filename)
258 // load a TRAP configuration from a file
259 // The file format is the format created by the standalone
260 // command coder scc / show_cfdat but without the running number
261 // scc /show_cfdat adds as the first column
262 // which are two tools to inspect/export configurations from wingDB
266 AliError("No TRAPconfig given");
270 Int_t ignoredLines=0;
275 AliDebug(5, Form("Processing file %s", filename.Data()));
276 std::ifstream infile;
277 infile.open(filename.Data(), std::ifstream::in);
278 if (!infile.is_open()) {
279 AliError(Form("Can not open MCM configuration file %s", filename.Data()));
284 Int_t extali, addr, data;
286 // reset restrictive mask
287 fRestrictiveMask = (0x3ffff << 11) | (0x1f << 6) | 0x3f;
288 char linebuffer[512];
291 while(infile.getline(linebuffer, 512) && infile.good()) {
293 line.str(linebuffer);
298 line >> std::skipws >> cmd >> addr >> data >> extali; // the lines read from config file can contain additional columns.
299 // Therefore the detour via istringstream
301 if(cmd!=999 && addr != -1 && data!= -1 && extali!=-1) {
303 if(cmd==fgkScsnCmdWrite) {
304 for(Int_t det=0; det<AliTRDgeometry::Ndet(); det++) {
305 UInt_t rocpos = (1 << (AliTRDgeometry::GetSector(det)+11)) | (1 << (AliTRDgeometry::GetStack(det)+6)) | (1 << AliTRDgeometry::GetLayer(det));
306 AliDebug(1, Form("checking restriction: mask=0x%08x, rocpos=0x%08x", fRestrictiveMask, rocpos));
307 if ((fRestrictiveMask & rocpos) == rocpos) {
308 AliDebug(1, Form("match: %i %i %i %i", cmd, extali, addr, data));
309 AddValues(det, cmd, extali, addr, data);
314 else if(cmd == fgkScsnLTUparam) {
315 ProcessLTUparam(extali, addr, data);
318 else if(cmd == fgkScsnCmdRestr) {
319 fRestrictiveMask = data;
320 AliDebug(1, Form("updated restrictive mask to 0x%08x", fRestrictiveMask));
323 else if((cmd == fgkScsnCmdReset) ||
324 (cmd == fgkScsnCmdRobReset)) {
325 fTrapConfig->ResetRegs();
328 else if (cmd == fgkScsnCmdSetHC) {
329 Int_t fullVersion = ((data & 0x7F00) >> 1) | (data & 0x7f);
331 for (Int_t iDet = 0; iDet < AliTRDgeometry::Ndet(); iDet++) {
332 Int_t smls = (AliTRDgeometry::GetSector(iDet) << 6) | (AliTRDgeometry::GetLayer(iDet) << 3) | AliTRDgeometry::GetStack(iDet);
334 for (Int_t iRob = 0; iRob < 8; iRob++) {
336 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, 0xc << 16, iDet, iRob, 17);
337 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, 17);
340 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, 0, iDet, iRob, 16);
341 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, 16);
343 // and now for the others
344 for (Int_t iMcm = 0; iMcm < 16; iMcm++) {
345 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, iMcm | (iRob << 4) | (3 << 16), iDet, iRob, iMcm);
346 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, iMcm);
352 else if((cmd == fgkScsnCmdRead) ||
353 (cmd == fgkScsnCmdPause) ||
354 (cmd == fgkScsnCmdPtrg) ||
355 (cmd == fgkScsnCmdHwPtrg) ||
356 (cmd == fgkScsnCmdRobPower) ||
357 (cmd == fgkScsnCmdTtcRx) ||
358 (cmd == fgkScsnCmdMcmTemp) ||
359 (cmd == fgkScsnCmdOri) ||
360 (cmd == fgkScsnCmdPM) ) {
361 AliDebug(2, Form("ignored SCSN command: %i %i %i %i", cmd, addr, data, extali));
365 AliWarning(Form("unknown SCSN command: %i %i %i %i", cmd, addr, data, extali));
372 else if(!infile.eof() && !infile.good()) {
374 infile.ignore(256, '\n');
384 AliDebug(5, Form("Ignored lines: %i, ignored cmds: %i", ignoredLines, ignoredCmds));
387 if(ignoredLines>readLines)
388 AliError(Form("More than 50 %% of the input file could not be processed. Perhaps you should check the input file %s", filename.Data()));
396 Int_t AliTRDtrapConfigHandler::SetGaintable(AliTRDCalOnlineGainTable const >bl)
403 void AliTRDtrapConfigHandler::ProcessLTUparam(Int_t dest, Int_t addr, UInt_t data)
406 // Process the LTU parameters and stores them in internal class variables
407 // or transfer the stored values to AliTRDtrapConfig, depending on the dest parameter
412 case 0: // set the parameters in AliTRDtrapConfig
413 for(Int_t det=0; det<AliTRDgeometry::Ndet(); det++) {
414 ConfigureDyCorr(det);
415 ConfigureDRange(det); // deflection range
416 ConfigureNTimebins(det); // timebins in the drift region
417 ConfigurePIDcorr(det); // scaling parameters for the PID
421 case 1: // set variables
424 case 0: ltuParam.SetPtMin(data); break; // pt_min in GeV/c (*1000)
425 case 1: ltuParam.SetMagField(data); break; // B in T (*1000)
426 case 2: ltuParam.SetOmegaTau(data); break; // omega*tau
427 case 3: ltuParam.SetNtimebins(data); break;
428 // ntimbins: drift time (for 3 cm) in timebins (5 add. bin. digits)
429 case 4: ltuParam.SetScaleQ0(data); break;
430 case 5: ltuParam.SetScaleQ1(data); break;
431 case 6: ltuParam.SetLengthCorrectionEnable(data); break;
432 case 7: ltuParam.SetTiltCorrectionEnable(data); break;
437 AliError(Form("dest %i not implemented", dest));
443 void AliTRDtrapConfigHandler::ConfigureNTimebins(Int_t det)
446 // Set timebins in the drift region
450 AliError("No TRAPconfig given");
454 AddValues(det, fgkScsnCmdWrite, 127, AliTRDmcmSim::fgkDmemAddrNdrift, ltuParam.GetNtimebins());
459 void AliTRDtrapConfigHandler::ConfigureDyCorr(Int_t det)
462 // Deflection length correction
463 // due to Lorentz angle and tilted pad correction
464 // This correction is in units of padwidth / (256*32)
468 AliError("No TRAPconfig given");
472 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
474 for (Int_t r = 0; r < nRobs; r++) {
475 for (Int_t m = 0; m < 16; m++) {
476 Int_t dest = 1<<10 | r<<7 | m;
477 Int_t dyCorrInt = ltuParam.GetDyCorrection(det, r, m);
478 AddValues(det, fgkScsnCmdWrite, dest, AliTRDmcmSim::fgkDmemAddrDeflCorr, dyCorrInt);
487 void AliTRDtrapConfigHandler::ConfigureDRange(Int_t det)
490 // deflection range LUT
491 // range calculated according to B-field (in T) and pt_min (in GeV/c)
492 // if pt_min < 0.1 GeV/c the maximal allowed range for the tracklet
493 // deflection (-64..63) is used
497 AliError("No TRAPconfig given");
501 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
506 for (Int_t r = 0; r < nRobs; r++) {
507 for (Int_t m = 0; m < 16; m++) {
508 for (Int_t c = 0; c < 18; c++) {
510 // cout << "maxdefl: " << maxDeflAngle << ", localPhi " << localPhi << endl;
511 // cout << "r " << r << ", m" << m << ", c " << c << ", min angle: " << localPhi-maxDeflAngle << ", max: " << localPhi+maxDeflAngle
512 // << ", min int: " << dyMinInt << ", max int: " << dyMaxInt << endl;
513 Int_t dest = 1<<10 | r<<7 | m;
514 Int_t lutAddr = AliTRDmcmSim::fgkDmemAddrDeflCutStart + 2*c;
515 ltuParam.GetDyRange(det, r, m, c, dyMinInt, dyMaxInt);
516 AddValues(det, fgkScsnCmdWrite, dest, lutAddr+0, dyMinInt);
517 AddValues(det, fgkScsnCmdWrite, dest, lutAddr+1, dyMaxInt);
523 void AliTRDtrapConfigHandler::PrintGeoTest()
526 // Prints some information about the geometry. Only for debugging
530 // for(int sm=0; sm<6; sm++) {
531 for(int stack=0; stack<5; stack++) {
532 for(int layer=0; layer<6; layer++) {
534 Int_t det = sm*30+stack*6+layer;
535 for (Int_t r = 0; r < 6; r++) {
536 for (Int_t m = 0; m < 16; m++) {
537 for (Int_t c = 7; c < 8; c++) {
538 cout << stack << ";" << layer << ";" << r << ";" << m
539 << ";" << ltuParam.GetX(det, r, m)
540 << ";" << ltuParam.GetLocalY(det, r, m, c)
541 << ";" << ltuParam.GetLocalZ(det, r, m) << endl;
551 void AliTRDtrapConfigHandler::ConfigurePIDcorr(Int_t det)
554 // Calculate the MCM individual correction factors for the PID
555 // and transfer them to AliTRDtrapConfig
559 AliError("No TRAPconfig given");
563 static const Int_t addrLUTcor0 = AliTRDmcmSim::fgkDmemAddrLUTcor0;
564 static const Int_t addrLUTcor1 = AliTRDmcmSim::fgkDmemAddrLUTcor1;
569 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
571 for (Int_t r=0; r<nRobs; r++) {
572 for(Int_t m=0; m<16; m++) {
573 Int_t dest = 1<<10 | r<<7 | m;
574 if(fGtbl.GetGainTableROC(det) && fGtbl.GetGainTableROC(det)->GetGainTableMCM(r, m))
575 ltuParam.GetCorrectionFactors(det, r, m, 9, cor0, cor1, fGtbl.GetGainTableROC(det)->GetGainTableMCM(r, m)->GetMCMGain());
577 ltuParam.GetCorrectionFactors(det, r, m, 9, cor0, cor1);
578 AddValues(det, fgkScsnCmdWrite, dest, addrLUTcor0, cor0);
579 AddValues(det, fgkScsnCmdWrite, dest, addrLUTcor1, cor1);
585 Bool_t AliTRDtrapConfigHandler::AddValues(UInt_t det, UInt_t cmd, UInt_t extali, Int_t addr, UInt_t data)
587 // transfer the informations provided by LoadConfig to the internal class variables
590 AliError("No TRAPconfig given");
594 if(cmd != fgkScsnCmdWrite) {
595 AliError(Form("Invalid command received: %i", cmd));
599 AliTRDtrapConfig::TrapReg_t mcmReg = fTrapConfig->GetRegByAddress(addr);
600 Int_t rocType = AliTRDgeometry::GetStack(det) == 2 ? 0 : 1;
602 static const int mcmListSize=40; // 40 is more or less arbitrary
603 Int_t mcmList[mcmListSize];
605 // configuration registers
606 if(mcmReg >= 0 && mcmReg < AliTRDtrapConfig::kLastReg) {
608 for(Int_t linkPair=0; linkPair<fgkMaxLinkPairs; linkPair++) {
609 if(AliTRDfeeParam::ExtAliToAli(extali, linkPair, rocType, mcmList, mcmListSize)!=0) {
611 while(mcmList[i] != -1 && i<mcmListSize) {
612 if(mcmList[i]==127) {
613 AliDebug(1, Form("broadcast write to %s: 0x%08x",
614 fTrapConfig->GetRegName((AliTRDtrapConfig::TrapReg_t) mcmReg), data));
615 fTrapConfig->SetTrapReg( (AliTRDtrapConfig::TrapReg_t) mcmReg, data, det);
618 AliDebug(1, Form("individual write to %s (%i, %i): 0x%08x",
619 fTrapConfig->GetRegName((AliTRDtrapConfig::TrapReg_t) mcmReg), (mcmList[i]>>7), (mcmList[i]&0x7F), data));
620 fTrapConfig->SetTrapReg( (AliTRDtrapConfig::TrapReg_t) mcmReg, data, det, (mcmList[i]>>7)&0x7, (mcmList[i]&0x7F));
629 else if ( (addr >= AliTRDtrapConfig::fgkDmemStartAddress) &&
630 (addr < (AliTRDtrapConfig::fgkDmemStartAddress + AliTRDtrapConfig::fgkDmemWords))) {
631 for(Int_t linkPair=0; linkPair<fgkMaxLinkPairs; linkPair++) {
632 if(AliTRDfeeParam::ExtAliToAli(extali, linkPair, rocType, mcmList, mcmListSize)!=0) {
634 while(mcmList[i] != -1 && i < mcmListSize) {
635 if(mcmList[i] == 127)
636 fTrapConfig->SetDmem(addr, data, det, 0, 127);
638 fTrapConfig->SetDmem(addr, data, det, mcmList[i] >> 7, mcmList[i] & 0x7f);
645 else if ( (addr >= AliTRDtrapConfig::fgkImemStartAddress) &&
646 (addr < (AliTRDtrapConfig::fgkImemStartAddress + AliTRDtrapConfig::fgkImemWords))) {
647 // IMEM is ignored for now
650 else if ( (addr >= AliTRDtrapConfig::fgkDbankStartAddress) &&
651 (addr < (AliTRDtrapConfig::fgkDbankStartAddress + AliTRDtrapConfig::fgkImemWords))) {
652 // DBANK is ignored for now
656 AliError(Form("Writing to unhandled address 0x%04x", addr));