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 AliTRDtrapConfigHandler::AliTRDtrapConfigHandler(AliTRDtrapConfig *cfg) :
50 , fRestrictiveMask((0x3ffff << 11) | (0x1f << 6) | 0x3f)
58 AliTRDtrapConfigHandler::~AliTRDtrapConfigHandler()
63 void AliTRDtrapConfigHandler::Init()
66 AliError("No TRAPconfig given");
70 // setup of register allocation
71 // I/O configuration which we don't care about
72 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kSEBDOU, AliTRDtrapConfig::kAllocNone);
73 // position look-up table by layer
74 for (Int_t iBin = 0; iBin < 128; iBin++)
75 fTrapConfig->SetTrapRegAlloc((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + iBin), AliTRDtrapConfig::kAllocByLayer);
77 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kC14CPUA, AliTRDtrapConfig::kAllocByMCM);
78 fTrapConfig->SetTrapRegAlloc(AliTRDtrapConfig::kC15CPUA, AliTRDtrapConfig::kAllocByMCM);
80 // setup of DMEM allocation
81 for(Int_t iAddr = AliTRDtrapConfig::fgkDmemStartAddress;
82 iAddr < (AliTRDtrapConfig::fgkDmemWords + AliTRDtrapConfig::fgkDmemStartAddress); iAddr++) {
84 if(iAddr == AliTRDmcmSim::fgkDmemAddrDeflCorr)
85 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
87 else if(iAddr == AliTRDmcmSim::fgkDmemAddrNdrift)
88 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByDetector);
90 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrDeflCutStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrDeflCutEnd))
91 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
93 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrTrackletStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrTrackletEnd))
94 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCM);
96 else if((iAddr >= AliTRDmcmSim::fgkDmemAddrLUTStart) && (iAddr <= AliTRDmcmSim::fgkDmemAddrLUTEnd))
97 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
99 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTcor0)
100 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
102 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTcor1)
103 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocByMCMinSM);
105 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTnbins)
106 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
108 else if(iAddr == AliTRDmcmSim::fgkDmemAddrLUTLength)
109 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
112 fTrapConfig->SetDmemAlloc(iAddr, AliTRDtrapConfig::kAllocGlobal);
116 void AliTRDtrapConfigHandler::ResetMCMs()
119 // Reset all MCM registers and DMEM
123 AliError("No TRAPconfig given");
127 fTrapConfig->ResetRegs();
128 fTrapConfig->ResetDmem();
132 Int_t AliTRDtrapConfigHandler::LoadConfig()
134 // load a default configuration which is suitable for simulation
135 // for a detailed description of the registers see the TRAP manual
136 // if you want to resimulate tracklets on real data use the appropriate config instead
139 AliError("No TRAPconfig given");
144 // ndrift (+ 5 binary digits)
145 ltuParam.SetNtimebins(20 << 5);
146 // deflection + tilt correction
147 ltuParam.SetRawOmegaTau(0.16133);
148 // deflection range table
149 ltuParam.SetRawPtMin(0.1);
151 ltuParam.SetRawMagField(0.0);
152 // scaling factors for q0, q1
153 ltuParam.SetRawScaleQ0(0);
154 ltuParam.SetRawScaleQ1(0);
155 // disable length correction and tilting correction
156 ltuParam.SetRawLengthCorrectionEnable(kFALSE);
157 ltuParam.SetRawTiltCorrectionEnable(kFALSE);
159 for (Int_t iDet = 0; iDet < 540; iDet++) {
160 // HC header configuration bits
161 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, 0x2102, iDet); // zs, deh
164 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC13CPUA, 24, iDet);
167 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPNP, 4*10, iDet);
168 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPTC, 0, iDet);
169 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFPBY, 0, iDet); // bypassed!
172 for (Int_t adc = 0; adc < 20; adc++) {
173 fTrapConfig->SetTrapReg(AliTRDtrapConfig::TrapReg_t(AliTRDtrapConfig::kFGA0+adc), 40, iDet);
174 fTrapConfig->SetTrapReg(AliTRDtrapConfig::TrapReg_t(AliTRDtrapConfig::kFGF0+adc), 15, iDet);
176 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGTA, 20, iDet);
177 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGTB, 2060, iDet);
178 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFGBY, 0, iDet); // bypassed!
181 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTAL, 200, iDet);
182 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTLL, 0, iDet);
183 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTLS, 200, iDet);
184 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kFTBY, 0, iDet);
186 // tracklet calculation
187 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQS0, 5, iDet);
188 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQE0, 10, iDet);
189 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQS1, 11, iDet);
190 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPQE1, 20, iDet);
191 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFS, 5, iDet);
192 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFE, 20, iDet);
193 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPVBY, 0, iDet);
194 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPVT, 10, iDet);
195 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPHT, 150, iDet);
196 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPFP, 40, iDet);
197 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPCL, 1, iDet);
198 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kTPCT, 10, iDet);
201 ConfigureDyCorr(iDet);
202 ConfigureDRange(iDet); // deflection range
203 ConfigureNTimebins(iDet); // timebins in the drift region
204 ConfigurePIDcorr(iDet); // scaling parameters for the PID
207 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBSF, 1, iDet); // 0: store filtered; 1: store unfiltered
209 // zs applied to data stored in event buffer (sel. by EBSF)
210 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIS, 15 << 2, iDet); // single indicator threshold (plus two digits)
211 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIT, 30 << 2, iDet); // sum indicator threshold (plus two digits)
212 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIL, 0xf0, iDet); // lookup table
213 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kEBIN, 0, iDet); // neighbour sensitivity
216 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kNES, (0x0000 << 16) | 0x1000, iDet);
219 // ****** hit position LUT
221 // now calculate it from PRF
222 AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
224 Double_t padResponse[3]; // pad response left, central, right
225 Double_t padResponseR[3]; // pad response left, central, right
226 Double_t padResponseL[3]; // pad response left, central, right
228 for (Int_t iLayer = 0; iLayer < 6; iLayer++) {
230 for (Int_t iBin = 0; iBin < 256*0.5; iBin++) {
231 cal->PadResponse(1., iBin*1./256., iLayer, padResponse);
232 cal->PadResponse(1., iBin*1./256.-1., iLayer, padResponseR);
233 cal->PadResponse(1., iBin*1./256.+1., iLayer, padResponseL);
234 gr.SetPoint(iBin, (0.5 * (padResponseR[1] - padResponseL[1])/padResponse[1] * 256), iBin);
236 for (Int_t iBin = 0; iBin < 128; iBin++) {
237 Int_t corr = (Int_t) (gr.Eval(iBin)) - iBin;
242 for (Int_t iStack = 0; iStack < 540/6; iStack++) {
243 fTrapConfig->SetTrapReg((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + iBin), corr, 6*iStack + iLayer);
247 // ****** hit position LUT configuration end
253 Int_t AliTRDtrapConfigHandler::LoadConfig(TString filename)
256 // load a TRAP configuration from a file
257 // The file format is the format created by the standalone
258 // command coder scc / show_cfdat but without the running number
259 // scc /show_cfdat adds as the first column
260 // which are two tools to inspect/export configurations from wingDB
264 AliError("No TRAPconfig given");
268 Int_t ignoredLines=0;
273 AliDebug(5, Form("Processing file %s", filename.Data()));
274 std::ifstream infile;
275 infile.open(filename.Data(), std::ifstream::in);
276 if (!infile.is_open()) {
277 AliError(Form("Can not open MCM configuration file %s", filename.Data()));
282 Int_t extali, addr, data;
284 // reset restrictive mask
285 fRestrictiveMask = (0x3ffff << 11) | (0x1f << 6) | 0x3f;
286 char linebuffer[512];
289 while(infile.getline(linebuffer, 512) && infile.good()) {
291 line.str(linebuffer);
296 line >> std::skipws >> cmd >> addr >> data >> extali; // the lines read from config file can contain additional columns.
297 // Therefore the detour via istringstream
299 if(cmd!=999 && addr != -1 && data!= -1 && extali!=-1) {
301 if(cmd==fgkScsnCmdWrite) {
302 for(Int_t det=0; det<AliTRDgeometry::Ndet(); det++) {
303 UInt_t rocpos = (1 << (AliTRDgeometry::GetSector(det)+11)) | (1 << (AliTRDgeometry::GetStack(det)+6)) | (1 << AliTRDgeometry::GetLayer(det));
304 AliDebug(1, Form("checking restriction: mask=0x%08x, rocpos=0x%08x", fRestrictiveMask, rocpos));
305 if ((fRestrictiveMask & rocpos) == rocpos) {
306 AliDebug(1, Form("match: %i %i %i %i", cmd, extali, addr, data));
307 AddValues(det, cmd, extali, addr, data);
312 else if(cmd == fgkScsnLTUparam) {
313 ProcessLTUparam(extali, addr, data);
316 else if(cmd == fgkScsnCmdRestr) {
317 fRestrictiveMask = data;
318 AliDebug(1, Form("updated restrictive mask to 0x%08x", fRestrictiveMask));
321 else if((cmd == fgkScsnCmdReset) ||
322 (cmd == fgkScsnCmdRobReset)) {
323 fTrapConfig->ResetRegs();
326 else if (cmd == fgkScsnCmdSetHC) {
327 Int_t fullVersion = ((data & 0x7F00) >> 1) | (data & 0x7f);
329 for (Int_t iDet = 0; iDet < AliTRDgeometry::Ndet(); iDet++) {
330 Int_t smls = (AliTRDgeometry::GetSector(iDet) << 6) | (AliTRDgeometry::GetLayer(iDet) << 3) | AliTRDgeometry::GetStack(iDet);
332 for (Int_t iRob = 0; iRob < 8; iRob++) {
334 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, 0xc << 16, iDet, iRob, 17);
335 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, 17);
338 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, 0, iDet, iRob, 16);
339 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, 16);
341 // and now for the others
342 for (Int_t iMcm = 0; iMcm < 16; iMcm++) {
343 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC14CPUA, iMcm | (iRob << 4) | (3 << 16), iDet, iRob, iMcm);
344 fTrapConfig->SetTrapReg(AliTRDtrapConfig::kC15CPUA, ((1<<29) | (fullVersion<<15) | (1<<12) | (smls<<1) | (iRob%2)), iDet, iRob, iMcm);
350 else if((cmd == fgkScsnCmdRead) ||
351 (cmd == fgkScsnCmdPause) ||
352 (cmd == fgkScsnCmdPtrg) ||
353 (cmd == fgkScsnCmdHwPtrg) ||
354 (cmd == fgkScsnCmdRobPower) ||
355 (cmd == fgkScsnCmdTtcRx) ||
356 (cmd == fgkScsnCmdMcmTemp) ||
357 (cmd == fgkScsnCmdOri) ||
358 (cmd == fgkScsnCmdPM) ) {
359 AliDebug(2, Form("ignored SCSN command: %i %i %i %i", cmd, addr, data, extali));
363 AliWarning(Form("unknown SCSN command: %i %i %i %i", cmd, addr, data, extali));
370 else if(!infile.eof() && !infile.good()) {
372 infile.ignore(256, '\n');
382 AliDebug(5, Form("Ignored lines: %i, ignored cmds: %i", ignoredLines, ignoredCmds));
385 if(ignoredLines>readLines)
386 AliError(Form("More than 50 %% of the input file could not be processed. Perhaps you should check the input file %s", filename.Data()));
394 Int_t AliTRDtrapConfigHandler::SetGaintable(AliTRDCalOnlineGainTable const >bl)
401 void AliTRDtrapConfigHandler::ProcessLTUparam(Int_t dest, Int_t addr, UInt_t data)
404 // Process the LTU parameters and stores them in internal class variables
405 // or transfer the stored values to AliTRDtrapConfig, depending on the dest parameter
410 case 0: // set the parameters in AliTRDtrapConfig
411 for(Int_t det=0; det<AliTRDgeometry::Ndet(); det++) {
412 ConfigureDyCorr(det);
413 ConfigureDRange(det); // deflection range
414 ConfigureNTimebins(det); // timebins in the drift region
415 ConfigurePIDcorr(det); // scaling parameters for the PID
419 case 1: // set variables
422 case 0: ltuParam.SetPtMin(data); break; // pt_min in GeV/c (*1000)
423 case 1: ltuParam.SetMagField(data); break; // B in T (*1000)
424 case 2: ltuParam.SetOmegaTau(data); break; // omega*tau
425 case 3: ltuParam.SetNtimebins(data); break;
426 // ntimbins: drift time (for 3 cm) in timebins (5 add. bin. digits)
427 case 4: ltuParam.SetScaleQ0(data); break;
428 case 5: ltuParam.SetScaleQ1(data); break;
429 case 6: ltuParam.SetLengthCorrectionEnable(data); break;
430 case 7: ltuParam.SetTiltCorrectionEnable(data); break;
435 AliError(Form("dest %i not implemented", dest));
441 void AliTRDtrapConfigHandler::ConfigureNTimebins(Int_t det)
444 // Set timebins in the drift region
448 AliError("No TRAPconfig given");
452 AddValues(det, fgkScsnCmdWrite, 127, AliTRDmcmSim::fgkDmemAddrNdrift, ltuParam.GetNtimebins());
457 void AliTRDtrapConfigHandler::ConfigureDyCorr(Int_t det)
460 // Deflection length correction
461 // due to Lorentz angle and tilted pad correction
462 // This correction is in units of padwidth / (256*32)
466 AliError("No TRAPconfig given");
470 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
472 for (Int_t r = 0; r < nRobs; r++) {
473 for (Int_t m = 0; m < 16; m++) {
474 Int_t dest = 1<<10 | r<<7 | m;
475 Int_t dyCorrInt = ltuParam.GetDyCorrection(det, r, m);
476 AddValues(det, fgkScsnCmdWrite, dest, AliTRDmcmSim::fgkDmemAddrDeflCorr, dyCorrInt);
485 void AliTRDtrapConfigHandler::ConfigureDRange(Int_t det)
488 // deflection range LUT
489 // range calculated according to B-field (in T) and pt_min (in GeV/c)
490 // if pt_min < 0.1 GeV/c the maximal allowed range for the tracklet
491 // deflection (-64..63) is used
495 AliError("No TRAPconfig given");
499 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
504 for (Int_t r = 0; r < nRobs; r++) {
505 for (Int_t m = 0; m < 16; m++) {
506 for (Int_t c = 0; c < 18; c++) {
508 // cout << "maxdefl: " << maxDeflAngle << ", localPhi " << localPhi << endl;
509 // cout << "r " << r << ", m" << m << ", c " << c << ", min angle: " << localPhi-maxDeflAngle << ", max: " << localPhi+maxDeflAngle
510 // << ", min int: " << dyMinInt << ", max int: " << dyMaxInt << endl;
511 Int_t dest = 1<<10 | r<<7 | m;
512 Int_t lutAddr = AliTRDmcmSim::fgkDmemAddrDeflCutStart + 2*c;
513 ltuParam.GetDyRange(det, r, m, c, dyMinInt, dyMaxInt);
514 AddValues(det, fgkScsnCmdWrite, dest, lutAddr+0, dyMinInt);
515 AddValues(det, fgkScsnCmdWrite, dest, lutAddr+1, dyMaxInt);
521 void AliTRDtrapConfigHandler::PrintGeoTest()
524 // Prints some information about the geometry. Only for debugging
528 // for(int sm=0; sm<6; sm++) {
529 for(int stack=0; stack<5; stack++) {
530 for(int layer=0; layer<6; layer++) {
532 Int_t det = sm*30+stack*6+layer;
533 for (Int_t r = 0; r < 6; r++) {
534 for (Int_t m = 0; m < 16; m++) {
535 for (Int_t c = 7; c < 8; c++) {
536 cout << stack << ";" << layer << ";" << r << ";" << m
537 << ";" << ltuParam.GetX(det, r, m)
538 << ";" << ltuParam.GetLocalY(det, r, m, c)
539 << ";" << ltuParam.GetLocalZ(det, r, m) << endl;
549 void AliTRDtrapConfigHandler::ConfigurePIDcorr(Int_t det)
552 // Calculate the MCM individual correction factors for the PID
553 // and transfer them to AliTRDtrapConfig
557 AliError("No TRAPconfig given");
561 static const Int_t addrLUTcor0 = AliTRDmcmSim::fgkDmemAddrLUTcor0;
562 static const Int_t addrLUTcor1 = AliTRDmcmSim::fgkDmemAddrLUTcor1;
567 Int_t nRobs = AliTRDgeometry::GetStack(det) == 2 ? 6 : 8;
569 for (Int_t r=0; r<nRobs; r++) {
570 for(Int_t m=0; m<16; m++) {
571 Int_t dest = 1<<10 | r<<7 | m;
572 if(fGtbl.GetGainTableROC(det) && fGtbl.GetGainTableROC(det)->GetGainTableMCM(r, m))
573 ltuParam.GetCorrectionFactors(det, r, m, 9, cor0, cor1, fGtbl.GetGainTableROC(det)->GetGainTableMCM(r, m)->GetMCMGain());
575 ltuParam.GetCorrectionFactors(det, r, m, 9, cor0, cor1);
576 AddValues(det, fgkScsnCmdWrite, dest, addrLUTcor0, cor0);
577 AddValues(det, fgkScsnCmdWrite, dest, addrLUTcor1, cor1);
583 Bool_t AliTRDtrapConfigHandler::AddValues(UInt_t det, UInt_t cmd, UInt_t extali, Int_t addr, UInt_t data)
585 // transfer the informations provided by LoadConfig to the internal class variables
588 AliError("No TRAPconfig given");
592 if(cmd != fgkScsnCmdWrite) {
593 AliError(Form("Invalid command received: %i", cmd));
597 AliTRDtrapConfig::TrapReg_t mcmReg = fTrapConfig->GetRegByAddress(addr);
598 Int_t rocType = AliTRDgeometry::GetStack(det) == 2 ? 0 : 1;
600 static const int mcmListSize=40; // 40 is more or less arbitrary
601 Int_t mcmList[mcmListSize];
603 // configuration registers
604 if(mcmReg >= 0 && mcmReg < AliTRDtrapConfig::kLastReg) {
606 for(Int_t linkPair=0; linkPair<fgkMaxLinkPairs; linkPair++) {
607 if(AliTRDfeeParam::ExtAliToAli(extali, linkPair, rocType, mcmList, mcmListSize)!=0) {
609 while(mcmList[i] != -1 && i<mcmListSize) {
610 if(mcmList[i]==127) {
611 AliDebug(1, Form("broadcast write to %s: 0x%08x",
612 fTrapConfig->GetRegName((AliTRDtrapConfig::TrapReg_t) mcmReg), data));
613 fTrapConfig->SetTrapReg( (AliTRDtrapConfig::TrapReg_t) mcmReg, data, det);
616 AliDebug(1, Form("individual write to %s (%i, %i): 0x%08x",
617 fTrapConfig->GetRegName((AliTRDtrapConfig::TrapReg_t) mcmReg), (mcmList[i]>>7), (mcmList[i]&0x7F), data));
618 fTrapConfig->SetTrapReg( (AliTRDtrapConfig::TrapReg_t) mcmReg, data, det, (mcmList[i]>>7)&0x7, (mcmList[i]&0x7F));
627 else if ( (addr >= AliTRDtrapConfig::fgkDmemStartAddress) &&
628 (addr < (AliTRDtrapConfig::fgkDmemStartAddress + AliTRDtrapConfig::fgkDmemWords))) {
629 for(Int_t linkPair=0; linkPair<fgkMaxLinkPairs; linkPair++) {
630 if(AliTRDfeeParam::ExtAliToAli(extali, linkPair, rocType, mcmList, mcmListSize)!=0) {
632 while(mcmList[i] != -1 && i < mcmListSize) {
633 if(mcmList[i] == 127)
634 fTrapConfig->SetDmem(addr, data, det, 0, 127);
636 fTrapConfig->SetDmem(addr, data, det, mcmList[i] >> 7, mcmList[i] & 0x7f);
643 else if ( (addr >= AliTRDtrapConfig::fgkImemStartAddress) &&
644 (addr < (AliTRDtrapConfig::fgkImemStartAddress + AliTRDtrapConfig::fgkImemWords))) {
645 // IMEM is ignored for now
648 else if ( (addr >= AliTRDtrapConfig::fgkDbankStartAddress) &&
649 (addr < (AliTRDtrapConfig::fgkDbankStartAddress + AliTRDtrapConfig::fgkImemWords))) {
650 // DBANK is ignored for now
654 AliError(Form("Writing to unhandled address 0x%04x", addr));