From 7788992c42645b6d61bb0d41de61fde2fb0751b0 Mon Sep 17 00:00:00 2001 From: cblume Date: Wed, 19 May 2010 08:31:05 +0000 Subject: [PATCH] Extended CBB to use 3 LUTs to separate decisions for single gap trigger at a and c side --- TRD/AliTRDTriggerL0.cxx | 7 +- TRD/AliTRDptrgCBB.cxx | 20 ++- TRD/AliTRDptrgParam.cxx | 162 ++++++++++++----------- TRD/AliTRDptrgParam.h | 17 +-- TRD/AliTRDptrgParamConfigurationFile.txt | 16 ++- 5 files changed, 122 insertions(+), 100 deletions(-) diff --git a/TRD/AliTRDTriggerL0.cxx b/TRD/AliTRDTriggerL0.cxx index 88f7f0c1f8a..c0976d61aa5 100644 --- a/TRD/AliTRDTriggerL0.cxx +++ b/TRD/AliTRDTriggerL0.cxx @@ -73,16 +73,17 @@ void AliTRDTriggerL0::Trigger() for (Int_t iResult = 1; iResult <= simulationResult[0]; iResult++) { AliDebug(5, Form("Result[%d]=0x%x\n",iResult,simulationResult[iResult])); } - if (simulationResult[0] > 0) { + if ((simulationResult[0] > 0) || (simulationResult[1] > 0)) { AliInfo("Fired single gap trigger"); SetInput("0HSG"); } - if (simulationResult[1] > 0) { + if (simulationResult[2] > 0) { AliInfo("Fired double gap trigger"); SetInput("0HDG"); } - if (simulationResult[2] > 0) { + + if (simulationResult[3] > 0) { AliInfo("Fired TRD wake up call trigger"); SetInput("0HWU"); } diff --git a/TRD/AliTRDptrgCBB.cxx b/TRD/AliTRDptrgCBB.cxx index 3e6655770c8..8769d7b5deb 100644 --- a/TRD/AliTRDptrgCBB.cxx +++ b/TRD/AliTRDptrgCBB.cxx @@ -113,7 +113,13 @@ Bool_t AliTRDptrgCBB::LoadParams() // 1 LUT = new AliTRDptrgLUT(); LUT->InitTable(12, 12, this->fParam->GetCBLUT(0, 1), kFALSE); - // get CB-B_0 and do not copy lut content + // get CB-B_1 and do not copy lut content + this->fLUTArray.AddLast(LUT); + + // 2 + LUT = new AliTRDptrgLUT(); + LUT->InitTable(12, 12, this->fParam->GetCBLUT(0, 2), kFALSE); + // get CB-B_2 and do not copy lut content this->fLUTArray.AddLast(LUT); // masks @@ -126,6 +132,8 @@ Bool_t AliTRDptrgCBB::LoadParams() this->fLUTArray.AddLast(LUT); LUT = new AliTRDptrgLUT(); // this->fRunLoader this->fLUTArray.AddLast(LUT); + LUT = new AliTRDptrgLUT(); // this->fRunLoader + this->fLUTArray.AddLast(LUT); // the following lines are only needed for test reasons LUT = dynamic_cast(this->fLUTArray.At(0)); Int_t* initData = new Int_t[4096]; // 2^12 @@ -133,6 +141,11 @@ Bool_t AliTRDptrgCBB::LoadParams() initData[i] = i; } LUT->InitTable(12, 12, initData, kTRUE); // make a copy + LUT = dynamic_cast(this->fLUTArray.At(0)); + for (Int_t i = 0; i < 4096; i++ ) { + initData[i] = i; + } + LUT->InitTable(12, 12, initData, kTRUE); // make a copy LUT = dynamic_cast(this->fLUTArray.At(1)); for (Int_t i = 4096; i >= 0; i--) { initData[4096 - i] = i; // inverse ramp @@ -143,6 +156,7 @@ Bool_t AliTRDptrgCBB::LoadParams() new AliTRDptrgParam::AliTRDptrgPTmasks(); masks->fLUTs[0] = kTRUE; masks->fLUTs[1] = kTRUE; + masks->fLUTs[2] = kTRUE; this->fPTmasks = masks; } return false; @@ -212,6 +226,10 @@ Int_t* AliTRDptrgCBB::Simulate() result[nLUTs + 1]++; } } + if (this->fPTmasks->fLUTs[2] && result[3]) { // CB-B (third own LUT) + result[nLUTs + 1]++; + } + // TLMU for (Int_t i = 0; i < 8; i++) { if (this->fPTmasks->fTLMU[i] && partResults[2][i + 1]) { diff --git a/TRD/AliTRDptrgParam.cxx b/TRD/AliTRDptrgParam.cxx index e017783824c..bd8b1875a0c 100644 --- a/TRD/AliTRDptrgParam.cxx +++ b/TRD/AliTRDptrgParam.cxx @@ -58,12 +58,6 @@ AliTRDptrgParam::AliTRDptrgParam() fFEBV0Multiplicities(0x0), fFEBV0LUTs(0x0), fCBLUTs(0x0), - fCBALUTequX(TString()), - fCBALUTequY(TString()), - fCBCLUTequX(TString()), - fCBCLUTequY(TString()), - fCBBLUTequX(TString()), - fCBBLUTequY(TString()), fPTmasks(AliTRDptrgPTmasks()) { // ctor @@ -332,6 +326,13 @@ AliTRDptrgParam::~AliTRDptrgParam() 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; } @@ -382,7 +383,7 @@ Int_t AliTRDptrgParam::CheckVariables() const return -6; } - // delete T0 FEB thresholds + // check T0 FEB thresholds if (this->fFEBT0Thresholds != 0x0) { if (this->fFEBT0Thresholds[0] == 0x0) { return -7; @@ -395,7 +396,7 @@ Int_t AliTRDptrgParam::CheckVariables() const 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) { @@ -415,7 +416,7 @@ Int_t AliTRDptrgParam::CheckVariables() const } - // delete T0 LUTs + // check T0 LUTs if (this->fFEBT0LUTs != 0x0) { for (UInt_t iPosition = 0; iPosition < 2; iPosition++) { if (this->fFEBT0LUTs[iPosition] != 0x0) { @@ -434,7 +435,7 @@ Int_t AliTRDptrgParam::CheckVariables() const 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) { @@ -453,7 +454,7 @@ Int_t AliTRDptrgParam::CheckVariables() const 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) { @@ -479,7 +480,7 @@ Int_t AliTRDptrgParam::CheckVariables() const 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) { @@ -505,7 +506,7 @@ Int_t AliTRDptrgParam::CheckVariables() const 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) { @@ -514,14 +515,19 @@ Int_t AliTRDptrgParam::CheckVariables() const 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; } @@ -636,7 +642,7 @@ void AliTRDptrgParam::LoadStandardConfiguration() { 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 @@ -693,23 +699,25 @@ void AliTRDptrgParam::LoadStandardConfiguration() { } // 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; } @@ -858,46 +866,47 @@ Int_t AliTRDptrgParam::GenerateLUTs() { // 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][0x%x]=%d", iEntry, - this->fCBLUTs[1][0][iEntry])); - } - this->fCBLUTs[1][1] = this->GenerateLUTbasedOnEq(this->fCBALUTequY, 10, 1); - for (Int_t iEntry = 0; iEntry < 1024; iEntry++) { - AliDebug(10, Form("fCBLUTs[@A][1][0x%x]=%d", iEntry, - this->fCBLUTs[1][1][iEntry])); + 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][0x%x]=%d", iEntry, - this->fCBLUTs[2][0][iEntry])); - } - this->fCBLUTs[2][1] = this->GenerateLUTbasedOnEq(this->fCBCLUTequY, 10, 1); - for (Int_t iEntry = 0; iEntry < 1024; iEntry++) { - AliDebug(10, Form("fCBLUTs[@C][1][0x%x]=%d", iEntry, - this->fCBLUTs[2][0][iEntry])); - } + 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->fCBBLUTequX, 12, 1); - for (Int_t iEntry = 0; iEntry < 4096; iEntry++) { - AliDebug(10, Form("fCBLUTs[@B][0][0x%x]=%d", iEntry, - this->fCBLUTs[0][0][iEntry])); - } - this->fCBLUTs[0][1] = this->GenerateLUTbasedOnEq(this->fCBBLUTequY, 12, 1); - - for (Int_t iEntry = 0; iEntry < 4096; iEntry++) { - AliDebug(10, Form("fCBLUTs[@B][1][0x%x]=%d", iEntry, - this->fCBLUTs[0][1][iEntry])); + 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!"); @@ -1278,13 +1287,9 @@ Bool_t AliTRDptrgParam::ParseCBAC(TString identifier, TString value) { 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; } @@ -1295,14 +1300,11 @@ Bool_t AliTRDptrgParam::ParseCBAC(TString identifier, TString value) { 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; @@ -1318,14 +1320,10 @@ Bool_t AliTRDptrgParam::ParseCBB(TString identifier, TString value) { 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; } @@ -1390,6 +1388,16 @@ Bool_t AliTRDptrgParam::ParseCBB(TString identifier, TString value) { 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(); diff --git a/TRD/AliTRDptrgParam.h b/TRD/AliTRDptrgParam.h index 49fef9f6d0f..d444e41f57e 100644 --- a/TRD/AliTRDptrgParam.h +++ b/TRD/AliTRDptrgParam.h @@ -27,7 +27,7 @@ class AliTRDptrgParam : public TObject { struct AliTRDptrgPTmasks { Bool_t fCBA[2]; // contribute CB-A look up results to pretrigger decision? Bool_t fCBC[2]; // contribute CB-C look up results to pretrigger decision? - Bool_t fLUTs[2]; // CB-B look up results contribution to pretrigger decision + Bool_t fLUTs[3]; // CB-B look up results contribution to pretrigger decision Bool_t fTLMU[8]; // TLMU output signal contribution to pretrigger decisions AliTRDptrgPTmasks() { @@ -37,6 +37,7 @@ class AliTRDptrgParam : public TObject { fCBC[1] = kFALSE; fLUTs[0] = kFALSE; fLUTs[1] = kFALSE; + fLUTs[2] = kFALSE; for (Int_t i = 0; i < 8; i++) { fTLMU[i] = kFALSE; } @@ -190,27 +191,19 @@ class AliTRDptrgParam : public TObject { Int_t*** fCBLUTs; // control box look up tables // CB-A ---------------------------------------------------------------------- - TString fCBALUTequX; // logical equation used for generation of LUT X of CB-A - TString fCBALUTequY; // logical equation used for generation of LUT Y of CB-A + TString fCBALUTequ[2]; // logical equations used for LUT generation for CB-A // CB-C ---------------------------------------------------------------------- - TString fCBCLUTequX; // logical equation used for generation of LUT X of CB-C - TString fCBCLUTequY; // logical equation used for generation of LUT Y of CB-C + TString fCBCLUTequ[2]; // logical equations used for LUT generation for CB-C // CBB ----------------------------------------------------------------------- - TString fCBBLUTequX; // logical equation used for generation of LUT X of CB-B - TString fCBBLUTequY; // logical equation used for generation of LUT Y of CB-B + TString fCBBLUTequ[3]; // logical equations used for LUT generation for CB-B // CTP ----------------------------------------------------------------------- // PT mask AliTRDptrgPTmasks fPTmasks; // masks usage of internal signals for the pretrigger wake up signal - - // CBB-LUT to TriggerInput assignment - - // class state --------------------------------------------------------------- - private: AliTRDptrgParam(); // instance only via Instance() AliTRDptrgParam(const AliTRDptrgParam &rhs); // not implemented diff --git a/TRD/AliTRDptrgParamConfigurationFile.txt b/TRD/AliTRDptrgParamConfigurationFile.txt index 3f515d09870..630a2fb46fe 100644 --- a/TRD/AliTRDptrgParamConfigurationFile.txt +++ b/TRD/AliTRDptrgParamConfigurationFile.txt @@ -171,8 +171,9 @@ CBC/LUT/1 !T0_1 && !V0-0_1 && !V0-1_1 && !V0-2_1 && !V0-3_1 # Lookup table at CB-B -CBB/LUT/0 ( CB-A_1 || CB-C_1 ) && TLMU_7 -CBB/LUT/1 ( CB-A_1 && CB-C_1 ) && TLMU_7 +CBB/LUT/0 ( CB-A_1 && !CB-C_1 ) && TLMU_7 +CBB/LUT/1 ( !CB-A_1 && CB-C_1 ) && TLMU_7 +CBB/LUT/2 ( CB-A_1 && CB-C_1 ) && TLMU_7 # Timing parameter for trigger processor @@ -240,11 +241,11 @@ CBB/RND/THR 150000 CBB/BC/RESET_VALUE 222 CBB/PT/MASK/CB-A_0 YES -CBB/PT/MASK/CB-A_1 YES +CBB/PT/MASK/CB-A_1 NO CBB/PT/MASK/CB-C_0 YES -CBB/PT/MASK/CB-C_1 YES -CBB/PT/MASK/RND YES -CBB/PT/MASK/BC YES +CBB/PT/MASK/CB-C_1 NO +CBB/PT/MASK/RND NO +CBB/PT/MASK/BC NO CBB/PT/MASK/TLMU_0 YES CBB/PT/MASK/TLMU_1 YES CBB/PT/MASK/TLMU_2 YES @@ -252,8 +253,9 @@ CBB/PT/MASK/TLMU_3 YES CBB/PT/MASK/TLMU_4 YES CBB/PT/MASK/TLMU_5 YES CBB/PT/MASK/TLMU_6 YES -CBB/PT/MASK/TLMU_7 YES +CBB/PT/MASK/TLMU_7 NO CBB/PT/MASK/CB-B_0 YES CBB/PT/MASK/CB-B_1 YES +CBB/PT/MASK/CB-B_2 YES # EOF -- 2.43.0