fFEBV0Multiplicities(0x0),
fFEBV0LUTs(0x0),
fCBLUTs(0x0),
- fCBALUTequX(TString()),
- fCBALUTequY(TString()),
- fCBCLUTequX(TString()),
- fCBCLUTequY(TString()),
- fCBBLUTequX(TString()),
- fCBBLUTequY(TString()),
fPTmasks(AliTRDptrgPTmasks())
{
// ctor
this->fCBLUTs[iCB][iLUT] = 0x0;
}
}
+ if (iCB == kB) {
+ // CB-B has 3 LUTs!
+ if (this->fCBLUTs[iCB][2] != 0x0) {
+ delete[] this->fCBLUTs[iCB][2];
+ this->fCBLUTs[iCB][2] = 0x0;
+ }
+ }
delete[] this->fCBLUTs[iCB];
this->fCBLUTs[iCB] = 0x0;
}
return -6;
}
- // delete T0 FEB thresholds
+ // check T0 FEB thresholds
if (this->fFEBT0Thresholds != 0x0) {
if (this->fFEBT0Thresholds[0] == 0x0) {
return -7;
return -9;
}
- // delete T0 multiplicities
+ // check T0 multiplicities
if (this->fFEBT0Multiplicities != 0x0) {
for (UInt_t iPosition = 0; iPosition < 2; iPosition++) {
if (this->fFEBT0Multiplicities[iPosition] != 0x0) {
}
- // delete T0 LUTs
+ // check T0 LUTs
if (this->fFEBT0LUTs != 0x0) {
for (UInt_t iPosition = 0; iPosition < 2; iPosition++) {
if (this->fFEBT0LUTs[iPosition] != 0x0) {
return -15;
}
- // delete V0 FEB thresholds
+ // check V0 FEB thresholds
if (this->fFEBV0Thresholds != 0x0) {
for (UInt_t iPosition = 0; iPosition < 2; iPosition++) {
if (this->fFEBV0Thresholds[iPosition] != 0x0) {
return -18;
}
- // delete V0 multiplicities
+ // check V0 multiplicities
if (this->fFEBV0Multiplicities != 0x0) {
for (UInt_t iPosition = 0; iPosition < 2; iPosition++) {
if (this->fFEBV0Multiplicities[iPosition] != 0x0) {
return -22;
}
- // delete V0 LUTs
+ // check V0 LUTs
if (this->fFEBV0LUTs != 0x0) {
for (UInt_t iPosition = 0; iPosition < 2; iPosition++) {
if (this->fFEBV0LUTs[iPosition] != 0x0) {
return -26;
}
- // delete CB LUTs
+ // check CB LUTs
if (this->fCBLUTs != 0x0) {
for (UInt_t iCB = 0; iCB < 3; iCB++) {
if (this->fCBLUTs[iCB] != 0x0) {
return -27;
}
}
+ if (iCB == kB) {
+ if (this->fCBLUTs[iCB][2] == 0x0) {
+ return -28;
+ }
+ }
}
else {
- return -28;
+ return -29;
}
}
}
else {
- return -29;
+ return -30;
}
return 0;
}
this->fTLMUmultiplicity[6][1] = 400;
this->fTLMUmultiplicity[7][0] = 400;
this->fTLMUmultiplicity[7][1] = 576;
- this->fTLMUmultiplicity[8][0] = 100;
+ this->fTLMUmultiplicity[8][0] = 1;
this->fTLMUmultiplicity[8][1] = 576;
// TLMU output
}
// CB-A LUT equations
- this->fCBALUTequX = "T0_0 || (V0-0_0 || V0-1_0 || V0-2_0 || V0-3_0)";
- this->fCBALUTequY = "!T0_1 && !V0-0_1 && !V0-1_1 && !V0-2_1 && !V0-3_1";
+ this->fCBALUTequ[0] = "T0_0 || (V0-0_0 || V0-1_0 || V0-2_0 || V0-3_0)";
+ this->fCBALUTequ[1] = "!T0_1 && !V0-0_1 && !V0-1_1 && !V0-2_1 && !V0-3_1";
// CB-C LUT equations
- this->fCBCLUTequX = "T0_0 || ( V0-0_0 || V0-1_0 || V0-2_0 || V0-3_0 )";
- this->fCBCLUTequY = "!T0_1 && !V0-0_1 && !V0-1_1 && !V0-2_1 && !V0-3_1";
+ this->fCBCLUTequ[0] = "T0_0 || ( V0-0_0 || V0-1_0 || V0-2_0 || V0-3_0 )";
+ this->fCBCLUTequ[1] = "!T0_1 && !V0-0_1 && !V0-1_1 && !V0-2_1 && !V0-3_1";
// CB-B LUT equations
- this->fCBBLUTequX = "( CB-A_1 || CB-C_1 ) && TLMU_7";
- this->fCBBLUTequY = "( CB-A_1 || CB-C_1 ) && TLMU_7";
+ this->fCBBLUTequ[0] = "CB-A_1 && !CB-C_1 && TLMU_7";
+ this->fCBBLUTequ[1] = "!CB-A_1 && CB-C_1 && TLMU_7";
+ this->fCBBLUTequ[2] = "CB-A_1 && CB-C_1 && TLMU_7";
// PT output mask
this->fPTmasks.fLUTs[0] = kTRUE;
this->fPTmasks.fLUTs[1] = kTRUE;
+ this->fPTmasks.fLUTs[2] = kTRUE;
this->fPTmasks.fCBA[0] = kTRUE;
this->fPTmasks.fCBC[0] = kTRUE;
- for (Int_t i = 1; i < 8; i++) {
+ for (Int_t i = 1; i < 7; i++) {
this->fPTmasks.fTLMU[i] = kTRUE;
}
// initialize LUTs
this->fCBLUTs = new Int_t**[3];
for (Int_t iCB = 0; iCB < 3; iCB++) {
- this->fCBLUTs[iCB] = new Int_t*[2];
- this->fCBLUTs[iCB][0] = 0x0;
- this->fCBLUTs[iCB][1] = 0x0;
+ if (iCB == kB) { // B
+ fCBLUTs[iCB] = new Int_t*[3];
+ this->fCBLUTs[iCB][0] = 0x0;
+ this->fCBLUTs[iCB][1] = 0x0;
+ this->fCBLUTs[iCB][2] = 0x0;
+ }
+ else { // A + C
+ fCBLUTs[iCB] = new Int_t*[2];
+ this->fCBLUTs[iCB][0] = 0x0;
+ this->fCBLUTs[iCB][1] = 0x0;
+ }
}
// CB-A (CB = 1 / kA)
- this->fCBLUTs[1][0] = this->GenerateLUTbasedOnEq(this->fCBALUTequX, 10, 1);
- for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
- AliDebug(10, Form("fCBLUTs[@A][0]=%d", this->fCBLUTs[1][0]));
- }
- this->fCBLUTs[1][1] = this->GenerateLUTbasedOnEq(this->fCBALUTequY, 10, 1);
- for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
- AliDebug(10, Form("fCBLUTs[@A][1]=%d", this->fCBLUTs[1][1]));
+ for (Int_t iLUT = 0; iLUT < 2; iLUT++) {
+ this->fCBLUTs[1][iLUT] = this->GenerateLUTbasedOnEq(this->fCBALUTequ[iLUT],
+ 10,1);
+ for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
+ AliDebug(10, Form("fCBLUTs[@A][%d][0x%x]=%d", iLUT, iEntry,
+ this->fCBLUTs[1][iLUT][iEntry]));
+ }
}
// CB-C (CB = 2 / kC)
- this->fCBLUTs[2][0] = this->GenerateLUTbasedOnEq(this->fCBCLUTequX, 10, 1);
- for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
- AliDebug(6, Form("fCBLUTs[@C][0]=%d", this->fCBLUTs[2][0]));
- }
- this->fCBLUTs[2][1] = this->GenerateLUTbasedOnEq(this->fCBCLUTequY, 10, 1);
- for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
- AliDebug(10, Form("fCBLUTs[@C][1]=%d", this->fCBLUTs[2][0]));
- }
+ for (Int_t iLUT = 0; iLUT < 2; iLUT++) {
+ this->fCBLUTs[2][iLUT] = this->GenerateLUTbasedOnEq(this->fCBCLUTequ[iLUT],
+ 10,1);
+ for (Int_t iEntry = 0; iEntry < 1024; iEntry++) {
+ AliDebug(6, Form("fCBLUTs[@C][%d][0x%x]=%d", iLUT, iEntry,
+ this->fCBLUTs[2][iLUT][iEntry]));
+ }
+ }
// CB-B (CB = 0 / kB)
- this->fCBLUTs[0][0] = this->GenerateLUTbasedOnEq(this->fCBALUTequX, 12, 1);
- for (Int_t iEntry = 0; iEntry < 4096; iEntry++) {
- AliDebug(10, Form("fCBLUTs[@B][0]=%d", this->fCBLUTs[0][0]));
- }
- this->fCBLUTs[0][1] = this->GenerateLUTbasedOnEq(this->fCBALUTequY, 12, 1);
-
- for (Int_t iEntry = 0; iEntry < 4096; iEntry++) {
- AliDebug(10, Form("fCBLUTs[@B][1]=%d", this->fCBLUTs[0][1]));
+ for (Int_t iLUT = 0; iLUT < 3; iLUT++) {
+ this->fCBLUTs[0][iLUT] = this->GenerateLUTbasedOnEq(this->fCBBLUTequ[iLUT],
+ 12,1);
+ for (Int_t iEntry = 0; iEntry < 4096; iEntry++) {
+ AliDebug(10, Form("fCBLUTs[@B][%d][0x%x]=%d", iLUT, iEntry,
+ this->fCBLUTs[0][iLUT][iEntry]));
+ }
}
AliDebug(5, "LUTs were generated!");
}
}
}
- if (temp.Length() != 0) { // TODO
+ if (temp.Length() != 0) {
TObjString* t = new TObjString(temp.Data());
arr.Add(t);
}
maskStr += condition[iLetter++];
}
(*mask) = BinaryTStringToInt(maskStr);
- if ((*mask) == 0) { // TODO find a better method to detected parser errors
+ if ((*mask) == 0) {
AliDebug(5, Form("Invalid input mask: %s,[%s]", maskStr.Data(),
condition.Data()));
return kFALSE;
return kFALSE;
}
for (Int_t iValue = 0; iValue < arr.GetEntries(); iValue++) {
- this->fFEBT0Thresholds[0][iValue] =
- (dynamic_cast<TObjString*>(arr[iValue])->GetString()).Atoi();
+ TObjString *ostrng = dynamic_cast<TObjString*>(arr[iValue]);
+ if (ostrng) {
+ this->fFEBT0Thresholds[0][iValue] = (ostrng->GetString()).Atoi();
+ }
AliDebug(5, Form("FEB/T0/A/THR[%d]=%d", iValue,
this->fFEBT0Thresholds[0][iValue]));
}
return kFALSE;
}
for (Int_t iValue = 0; iValue < arr.GetEntries(); iValue++) {
- this->fFEBT0Thresholds[1][iValue] =
- (dynamic_cast<TObjString*>(arr[iValue])->GetString()).Atoi();
+ TObjString *ostrng = dynamic_cast<TObjString*>(arr[iValue]);
+ if (ostrng) {
+ this->fFEBT0Thresholds[1][iValue] = (ostrng->GetString()).Atoi();
+ }
AliDebug(5, Form("FEB/T0/C/THR[%d]=%d", iValue,
this->fFEBT0Thresholds[1][iValue]));
}
return kFALSE;
}
for (Int_t iValue = 0; iValue < arr.GetEntries(); iValue++) {
- this->fFEBV0Thresholds[0][cardID][iValue] =
- (dynamic_cast<TObjString*>(arr[iValue])->GetString()).Atoi();
+ TObjString *ostrng = dynamic_cast<TObjString*>(arr[iValue]);
+ if (ostrng) {
+ this->fFEBV0Thresholds[0][cardID][iValue] =
+ (ostrng->GetString()).Atoi();
+ }
AliDebug(5, Form("FEB/V0/A%d/THR[%d]=%d", cardID, iValue,
this->fFEBV0Thresholds[0][cardID][iValue]));
}
return kFALSE;
}
for (Int_t iValue = 0; iValue < arr.GetEntries(); iValue++) {
- this->fFEBV0Thresholds[1][cardID][iValue] =
- (dynamic_cast<TObjString*>(arr[iValue])->GetString()).Atoi();
+ TObjString *ostrng = dynamic_cast<TObjString*>(arr[iValue]);
+ if (ostrng) {
+ this->fFEBV0Thresholds[1][cardID][iValue] = (ostrng->GetString()).Atoi();
+ }
AliDebug(5, Form("FEB/V0/C%d/THR[%d]=%d", cardID, iValue,
this->fFEBV0Thresholds[1][cardID][iValue]));
}
TString eqIDstr = identifier(8, 1);
Int_t eqID = eqIDstr.Atoi();
- if (eqID == 0) {
- this->fCBALUTequX = this->CleanTString(value);
- AliDebug(5, Form("fCBALUTequX=%s", this->fCBALUTequX.Data()));
- }
- else if(eqID == 1) {
- this->fCBALUTequY= this->CleanTString(value);
- AliDebug(5, Form("fCBALUTequY=%s", this->fCBALUTequY.Data()));
+ if ((eqID == 0) || (eqID == 1)) {
+ this->fCBALUTequ[eqID] = this->CleanTString(value);
+ AliDebug(5, Form("fCBALUTequ[%d]=%s", eqID, this->fCBALUTequ[eqID].Data()));
}
return kTRUE;
}
TString eqIDstr = identifier(8, 1);
Int_t eqID = eqIDstr.Atoi();
- if (eqID == 0) {
- this->fCBCLUTequX = this->CleanTString(value);
- AliDebug(5, Form("fCBCLUTequX=%s", this->fCBCLUTequX.Data()));
+ if ((eqID == 0) || (eqID == 1)) {
+ this->fCBCLUTequ[eqID] = this->CleanTString(value);
+ AliDebug(5, Form("fCBCLUTequ[%d]=%s", eqID, this->fCBCLUTequ[eqID].Data()));
}
- else if(eqID == 1) {
- this->fCBCLUTequY= this->CleanTString(value);
- AliDebug(5, Form("fCBCLUTequY=%s", this->fCBCLUTequY.Data()));
- }
+ return kTRUE;
}
return kTRUE;
TString eqIDstr = identifier(8, 1);
Int_t eqID = eqIDstr.Atoi();
- if (eqID == 0) {
- this->fCBBLUTequX = this->CleanTString(value);
- AliDebug(5, Form("fCBBLUTequX=%s", this->fCBBLUTequX.Data()));
- }
- else if(eqID == 1) {
- this->fCBBLUTequY= this->CleanTString(value);
- AliDebug(5, Form("fCBBLUTequY=%s", this->fCBBLUTequY.Data()));
- }
+ if ((eqID == 0) || (eqID == 1) || (eqID == 2)) {
+ this->fCBBLUTequ[eqID] = this->CleanTString(value);
+ AliDebug(5, Form("fCBBLUTequ[%d]=%s", eqID, this->fCBBLUTequ[eqID].Data()));
+ }
return kTRUE;
}
AliDebug(5, Form("CBB/PT/MASK/CB-B_1/=%d", this->fPTmasks.fLUTs[1]));
return kTRUE;
}
+ else if (identifier.Index("CBB/PT/MASK/CB-B_2") == 0) { // CB-B_2
+ if (value.Index("YES") == 0) {
+ this->fPTmasks.fLUTs[2] = kTRUE;
+ }
+ else {
+ this->fPTmasks.fLUTs[2] = kFALSE;
+ }
+ AliDebug(5, Form("CBB/PT/MASK/CB-B_2/=%d", this->fPTmasks.fLUTs[2]));
+ return kTRUE;
+ }
else if (identifier.Index("BB/PT/MASK/TLMU_") == 0) {
TString indexStr = identifier(16, 1);
Int_t index = indexStr.Atoi();
SplitUpValues(value, arr);
- TString t0 = (dynamic_cast<TObjString*>(arr[0]))->GetString();
- TString t1 = (dynamic_cast<TObjString*>(arr[1]))->GetString();
+ TObjString *ostrng0 = dynamic_cast<TObjString*>(arr[0]);
+ TObjString *ostrng1 = dynamic_cast<TObjString*>(arr[1]);
+
+ if (ostrng0 && ostrng1) {
+
+ TString t0 = ostrng0->GetString();
+ TString t1 = ostrng1->GetString();
- this->fTLMUmultiplicity[index][0] = t0.Atoi();
- this->fTLMUmultiplicity[index][1] = t1.Atoi();
+ this->fTLMUmultiplicity[index][0] = t0.Atoi();
+ this->fTLMUmultiplicity[index][1] = t1.Atoi();
- AliDebug(5, Form("%d: %d %d", index, this->fTLMUmultiplicity[index][0],
- this->fTLMUmultiplicity[index][1]));
+ AliDebug(5, Form("%d: %d %d", index, this->fTLMUmultiplicity[index][0],
+ this->fTLMUmultiplicity[index][1]));
+
+ }
return kTRUE;
}
}
for (Int_t iEntry = 0; iEntry < arr.GetEntries(); iEntry++) {
- TString t = (dynamic_cast<TObjString*>(arr[iEntry]))->GetString();
+
+ TObjString *ostrng = dynamic_cast<TObjString*>(arr[iEntry]);
+ if (ostrng) {
+
+ TString t = ostrng->GetString();
- TString indexStr = t(2,1);
- if (t.Index("CM") == 0) { // coincidence matrix
- this->fTLMUoutput[iEntry][0] = indexStr.Atoi();
- }
- else if (t.Index("MC") == 0) { // multiplicity
- this->fTLMUoutput[iEntry][1] = indexStr.Atoi();
+ TString indexStr = t(2,1);
+ if (t.Index("CM") == 0) { // coincidence matrix
+ this->fTLMUoutput[iEntry][0] = indexStr.Atoi();
+ }
+ else if (t.Index("MC") == 0) { // multiplicity
+ this->fTLMUoutput[iEntry][1] = indexStr.Atoi();
+ }
+
}
+
AliDebug(5, Form("TLMU output: cm = %d, mc = %d",
this->fTLMUoutput[iEntry][0],
this->fTLMUoutput[iEntry][1]));
else if (identifier->CompareTo("TLMU_6", TString::kIgnoreCase) == 0)
return 0x400;
else if (identifier->CompareTo("TLMU_7", TString::kIgnoreCase) == 0)
- return 0x100;
+ return 0x800;
else return 0x0; // Error
}
if ((partResult1 == 0x0) || (partResult2 == 0x0) ||
(signalsInvolved1 == 0x0) || (signalsInvolved2 == 0x0)) {
AliError("fatal logical equation processing error!");
+ return;
}
// allocate results and signalsInvolved
ConvertLogicalEqToBitVectors(eq, results, signalsInvolved);
// generate bit vectors
+
+ if ((results != 0x0) && (signalsInvolved != 0x0)) {
- CheckSignalsInvolved(results, signalsInvolved, inputWidth);
- // add bit vectors for signals which are not taken into account
+ CheckSignalsInvolved(results, signalsInvolved, inputWidth);
+ // add bit vectors for signals which are not taken into account
- Int_t lutSize = 0x1 << inputWidth; // 2^inputwidth elements
- Int_t* resultingLUT = new Int_t[lutSize]; // create LUT
- for (Int_t iLUTentry = 0; iLUTentry < lutSize; iLUTentry++) { // init LUT
- resultingLUT[iLUTentry] = 0;
- }
- for (Int_t iEntry = 0; iEntry < results->GetSize(); iEntry++) {
- resultingLUT[(*results)[iEntry]] = initValue;
- }
+ Int_t lutSize = 0x1 << inputWidth; // 2^inputwidth elements
+ Int_t* resultingLUT = new Int_t[lutSize]; // create LUT
+ for (Int_t iLUTentry = 0; iLUTentry < lutSize; iLUTentry++) { // init LUT
+ resultingLUT[iLUTentry] = 0;
+ }
+ for (Int_t iEntry = 0; iEntry < results->GetSize(); iEntry++) {
+ resultingLUT[(*results)[iEntry]] = initValue;
+ }
- if (results != 0x0) {
delete results;
results = 0x0;
- }
- if (signalsInvolved != 0x0) {
+
delete signalsInvolved;
signalsInvolved = 0x0;
- }
- return resultingLUT;
+ return resultingLUT;
+
+ }
+ else {
+
+ return 0x0;
+
+ }
+
}
//______________________________________________________________________________