From 804b828a6ef72019a199ad1021bc114dfe17f662 Mon Sep 17 00:00:00 2001 From: guernane Date: Fri, 2 Dec 2011 18:32:40 +0000 Subject: [PATCH] Re-enable trigger calculation removing STU OCDB access. Improve simulation (L0 time + time sum including rollback). Clean-up --- EMCAL/AliEMCALDigitizer.cxx | 2 +- EMCAL/AliEMCALGeometry.cxx | 64 ++++- EMCAL/AliEMCALGeometry.h | 4 + EMCAL/AliEMCALReconstructor.cxx | 11 +- EMCAL/AliEMCALTriggerBoard.cxx | 2 - EMCAL/AliEMCALTriggerDCSConfig.cxx | 8 +- EMCAL/AliEMCALTriggerDCSConfig.h | 2 +- EMCAL/AliEMCALTriggerDCSConfigDB.cxx | 78 ------ EMCAL/AliEMCALTriggerDCSConfigDB.h | 3 - EMCAL/AliEMCALTriggerData.cxx | 3 +- EMCAL/AliEMCALTriggerData.h | 9 +- EMCAL/AliEMCALTriggerElectronics.cxx | 337 +++++++++++++------------ EMCAL/AliEMCALTriggerRawDigit.cxx | 3 +- EMCAL/AliEMCALTriggerRawDigit.h | 3 +- EMCAL/AliEMCALTriggerRawDigitMaker.cxx | 53 ++-- EMCAL/AliEMCALTriggerSTU.cxx | 43 +++- EMCAL/AliEMCALTriggerSTU.h | 5 +- EMCAL/AliEMCALTriggerSTUDCSConfig.cxx | 19 +- EMCAL/AliEMCALTriggerSTURawStream.cxx | 2 +- EMCAL/AliEMCALTriggerTRU.cxx | 37 ++- EMCAL/AliEMCALTriggerTRU.h | 3 + EMCAL/AliEMCALTriggerTRUDCSConfig.cxx | 10 + EMCAL/AliEMCALTriggerTRUDCSConfig.h | 29 ++- EMCAL/CMakelibEMCALsim.pkg | 2 + 24 files changed, 395 insertions(+), 337 deletions(-) diff --git a/EMCAL/AliEMCALDigitizer.cxx b/EMCAL/AliEMCALDigitizer.cxx index f0eca4c281b..e5243a5113c 100644 --- a/EMCAL/AliEMCALDigitizer.cxx +++ b/EMCAL/AliEMCALDigitizer.cxx @@ -863,7 +863,7 @@ void AliEMCALDigitizer::Digits2FastOR(TClonesArray* digitsTMP, TClonesArray* dig if (digit) { Int_t id = digit->GetId(); - Float_t time = digit->GetTime(); + Float_t time = 50.e-9; Double_t depositedEnergy = 0.; for (Int_t j = 1; j <= digit->GetNprimary(); j++) depositedEnergy += digit->GetDEPrimary(j); diff --git a/EMCAL/AliEMCALGeometry.cxx b/EMCAL/AliEMCALGeometry.cxx index de3e7ceb8ff..62e10d86fde 100644 --- a/EMCAL/AliEMCALGeometry.cxx +++ b/EMCAL/AliEMCALGeometry.cxx @@ -1408,6 +1408,68 @@ void AliEMCALGeometry::BuildFastOR2DMap() } } +//________________________________________________________________________________________________ +Bool_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const +{ + //Trigger mapping method, from STU index get TRU index + + if (id > 31 || id < 0) + { + AliError(Form("TRU index out of range: %d",id)); + return kFALSE; + } + + idx = ((id % 6) < 3) ? 6 * int(id / 6) + 2 * (id % 3) : 6 * int(id / 6) + 2 * (2 - (id % 3)) + 1; + + return kTRUE; +} + +//________________________________________________________________________________________________ +Int_t AliEMCALGeometry::GetTRUIndexFromOnlineIndex(const Int_t id) const +{ + //Trigger mapping method, from STU index get TRU index + + if (id > 31 || id < 0) + { + AliError(Form("TRU index out of range: %d",id)); + } + + Int_t idx = (id > 15) ? 2 * (31 - id) : 2 * (15 - id) + 1; + + return idx; +} + +//________________________________________________________________________________________________ +Bool_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id, Int_t& idx) const +{ + //Trigger mapping method, from STU index get TRU index + + if (id > 31 || id < 0) + { + AliError(Form("TRU index out of range: %d",id)); + return kFALSE; + } + + idx = (id % 2) ? int((6 - (id % 6)) / 2) + 3 * (int(id / 6) + 1) : 3 * int(id / 6) + int(id / 2); + + return kTRUE; +} + +//________________________________________________________________________________________________ +Int_t AliEMCALGeometry::GetOnlineIndexFromTRUIndex(const Int_t id) const +{ + //Trigger mapping method, from STU index get TRU index + + if (id > 31 || id < 0) + { + AliError(Form("TRU index out of range: %d",id)); + } + + Int_t idx = (id % 2) ? int((6 - (id % 6)) / 2) + 3 * (int(id / 6) + 1) : 3 * int(id / 6) + int(id / 2); + + return idx; +} + //________________________________________________________________________________________________ Bool_t AliEMCALGeometry::GetFastORIndexFromL0Index(const Int_t iTRU, const Int_t id, Int_t idx[], const Int_t size) const { @@ -1510,8 +1572,6 @@ void AliEMCALGeometry::GetModulePhiEtaIndexInSModuleFromTRUIndex(Int_t itru, Int iphiSM = fEMCGeometry->GetNModulesInTRUPhi()*row + iphitru ; ietaSM = fEMCGeometry->GetNModulesInTRUEta()*col + ietatru ; - //printf(" GetModulePhiEtaIndexInSModuleFromTRUIndex : itru %2i iphitru %2i ietatru %2i iphiSM %2i ietaSM %2i \n", - // itru, iphitru, ietatru, iphiSM, ietaSM); } //__________________________________________________________________________________________________________________ diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index 4da43755058..524639e9d88 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -256,6 +256,10 @@ public: Bool_t GetCellIndexFromFastORIndex(const Int_t id, Int_t idx[4]) const; Bool_t GetTRUIndexFromSTUIndex(const Int_t id, Int_t& idx) const; Int_t GetTRUIndexFromSTUIndex(const Int_t id) const; + Bool_t GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const; + Int_t GetTRUIndexFromOnlineIndex(const Int_t id) const; + Bool_t GetOnlineIndexFromTRUIndex(const Int_t id, Int_t& idx) const; + Int_t GetOnlineIndexFromTRUIndex(const Int_t id) const; Bool_t GetFastORIndexFromL0Index(const Int_t iTRU, const Int_t id, Int_t idx[], const Int_t size) const; /////////////////// diff --git a/EMCAL/AliEMCALReconstructor.cxx b/EMCAL/AliEMCALReconstructor.cxx index 0a1e6660a49..7da97b3732a 100644 --- a/EMCAL/AliEMCALReconstructor.cxx +++ b/EMCAL/AliEMCALReconstructor.cxx @@ -354,15 +354,12 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, if (esdV0) { - for (Int_t i = 0; i < 32; i++) - { - v0M[0] += (Int_t)esdV0->GetAdcV0C(i); - v0M[1] += (Int_t)esdV0->GetAdcV0A(i); - } + v0M[0] = esdV0->GetTriggerChargeC(); + v0M[1] = esdV0->GetTriggerChargeA(); } else { - AliWarning("Cannot retrieve V0 ESD! Run w/ null V0 charges"); + AliWarning("No V0 ESD! Run trigger processor w/ null V0 charges"); } if (fgTriggerDigits) fgTriggerDigits->Clear(); @@ -379,7 +376,7 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, branchtrg->GetEntry(0); // Note: fgTriggerProcessor reset done at the end of this method -// fgTriggerProcessor->Digits2Trigger(fgTriggerDigits, v0M, fTriggerData); + fgTriggerProcessor->Digits2Trigger(fgTriggerDigits, v0M, fTriggerData); // Fill ESD AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("EMCAL"); diff --git a/EMCAL/AliEMCALTriggerBoard.cxx b/EMCAL/AliEMCALTriggerBoard.cxx index 8cf02a8bf19..f52fa408075 100644 --- a/EMCAL/AliEMCALTriggerBoard.cxx +++ b/EMCAL/AliEMCALTriggerBoard.cxx @@ -146,8 +146,6 @@ void AliEMCALTriggerBoard::SlidingWindow(TriggerType_t type, Int_t thres, Int_t } } - if ( type == kL1Jet ) sum /= 4; // truncate patch sum for jet case - if ( sum > thres ) { new((*fPatches)[fPatches->GetLast()+1]) diff --git a/EMCAL/AliEMCALTriggerDCSConfig.cxx b/EMCAL/AliEMCALTriggerDCSConfig.cxx index 3aeb5f795db..679337eeda4 100644 --- a/EMCAL/AliEMCALTriggerDCSConfig.cxx +++ b/EMCAL/AliEMCALTriggerDCSConfig.cxx @@ -29,13 +29,15 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3 ClassImp(AliEMCALTriggerDCSConfig) //_____________________________________________________________________________ -AliEMCALTriggerDCSConfig::AliEMCALTriggerDCSConfig(const char *name) : TObject() -,fTRUArr(new TClonesArray("AliEMCALTriggerTRUDCSConfig",32)) -,fSTUObj(new AliEMCALTriggerSTUDCSConfig()) +AliEMCALTriggerDCSConfig::AliEMCALTriggerDCSConfig() : TObject() +,fTRUArr(0x0) +,fSTUObj(0x0) { // // AliEMCALTriggerDCSConfig default constructor // + fTRUArr = new TClonesArray("AliEMCALTriggerTRUDCSConfig",32); + fSTUObj = new AliEMCALTriggerSTUDCSConfig(); } //_____________________________________________________________________________ diff --git a/EMCAL/AliEMCALTriggerDCSConfig.h b/EMCAL/AliEMCALTriggerDCSConfig.h index 0becb0d9f38..97a6c2d32da 100644 --- a/EMCAL/AliEMCALTriggerDCSConfig.h +++ b/EMCAL/AliEMCALTriggerDCSConfig.h @@ -21,7 +21,7 @@ class AliEMCALTriggerDCSConfig : public TObject { public: - AliEMCALTriggerDCSConfig(const char *name = ""); + AliEMCALTriggerDCSConfig(); virtual ~AliEMCALTriggerDCSConfig(); void SetTRUArr(TClonesArray* const ta) { fTRUArr = ta; } diff --git a/EMCAL/AliEMCALTriggerDCSConfigDB.cxx b/EMCAL/AliEMCALTriggerDCSConfigDB.cxx index 60717ee9141..56b9e77179e 100644 --- a/EMCAL/AliEMCALTriggerDCSConfigDB.cxx +++ b/EMCAL/AliEMCALTriggerDCSConfigDB.cxx @@ -245,81 +245,3 @@ const AliEMCALTriggerDCSConfig* AliEMCALTriggerDCSConfigDB::GetTriggerDCSConfig( else return dcsConf; } - -//_____________________________________________________________________________ -void AliEMCALTriggerDCSConfigDB::GetSTUSegmentation(Int_t ssg[], Int_t spg[], Int_t ssj[], Int_t spj[]) -{ - // - // Get STU segmentation - // - const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast(GetCachedCDBObject(kIDTriggerConfig)); - if(dcsConf){ - AliEMCALTriggerSTUDCSConfig* stuConf = dcsConf->GetSTUDCSConfig(); - if(stuConf){ - Int_t fw = stuConf->GetFw(); - - switch ( fw ) - { - case 2223: - ssg[0] = 1; - ssg[1] = 1; - spg[0] = 2; - spg[1] = 2; - - ssj[0] = 4; - ssj[1] = 4; - spj[0] = 2; - spj[1] = 2; - break; - default: - AliError("Firmware version do not match!"); - break; - } - } - else { - AliError("STUDCSConfig is null!"); - } - } - else { - AliError("DCSConfig is null!"); - } - -} - -//_____________________________________________________________________________ -Int_t AliEMCALTriggerDCSConfigDB::GetTRUSegmentation(Int_t iTRU) -{ - // Get TRU segmentation - - const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast(GetCachedCDBObject(kIDTriggerConfig)); - if(dcsConf){ - AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU); - if(truConf){ - Int_t sel = truConf->GetL0SEL(); - - if (sel & 0x0001) - return 2; - else - return 1; - } else AliError("TRUDCSConf Null!") ; - }else AliError("TriggerDCSConf Null!") ; - - return -1; -} - -//_____________________________________________________________________________ -Int_t AliEMCALTriggerDCSConfigDB::GetTRUGTHRL0(Int_t iTRU) -{ - // - // Get TRU L0 threshold - // - const AliEMCALTriggerDCSConfig* dcsConf = dynamic_cast(GetCachedCDBObject(kIDTriggerConfig)); - if(dcsConf){ - AliEMCALTriggerTRUDCSConfig* truConf = dcsConf->GetTRUDCSConfig(iTRU); - if(truConf){ - return truConf->GetGTHRL0(); - } else AliError("TRUDCSConf Null!") ; - }else AliError("TriggerDCSConf Null!") ; - - return -1; -} diff --git a/EMCAL/AliEMCALTriggerDCSConfigDB.h b/EMCAL/AliEMCALTriggerDCSConfigDB.h index 39444a17eac..8ecf5edde10 100644 --- a/EMCAL/AliEMCALTriggerDCSConfigDB.h +++ b/EMCAL/AliEMCALTriggerDCSConfigDB.h @@ -29,9 +29,6 @@ public: void SetRun(Long64_t run); Long64_t GetRun() const { return fRun; } const AliEMCALTriggerDCSConfig* GetTriggerDCSConfig(); - void GetSTUSegmentation(Int_t ssg[], Int_t spg[], Int_t ssj[], Int_t spj[]); - Int_t GetTRUSegmentation(Int_t iTRU); - Int_t GetTRUGTHRL0(Int_t iTRU); protected: diff --git a/EMCAL/AliEMCALTriggerData.cxx b/EMCAL/AliEMCALTriggerData.cxx index 149c3a07a4b..3c834875af7 100644 --- a/EMCAL/AliEMCALTriggerData.cxx +++ b/EMCAL/AliEMCALTriggerData.cxx @@ -42,7 +42,8 @@ fL1JetThreshold(0), fL1V0(), fL1FrameMask(0), fL1TriggerType(), -fL1DataDecoded(0) +fL1DataDecoded(0), +fL1RawData(0) { // Ctor diff --git a/EMCAL/AliEMCALTriggerData.h b/EMCAL/AliEMCALTriggerData.h index 98b87155e62..76bbef651f2 100644 --- a/EMCAL/AliEMCALTriggerData.h +++ b/EMCAL/AliEMCALTriggerData.h @@ -37,7 +37,8 @@ public: virtual void SetL1TriggerType( Int_t* v) {for (int i = 0; i < 8; i++) fL1TriggerType[i] = v[i];} virtual void SetL1DataDecoded( Int_t v) { fL1DataDecoded = v;} - + virtual void SetL1RawData( Int_t v) { fL1RawData = v;} + virtual void GetL0Trigger( Int_t i, Int_t j, Int_t& k ) const { k = fL0Trigger[i][j];} virtual Int_t GetL0Trigger( Int_t i, Int_t j ) const {return fL0Trigger[i][j];} @@ -53,7 +54,8 @@ public: virtual void GetL1TriggerType( Int_t v[]) const {for (int i = 0; i < 8; i++) v[i] = fL1TriggerType[i];} virtual Int_t GetL1DataDecoded( ) const {return fL1DataDecoded;} - + virtual Int_t GetL1RawData( ) const {return fL1RawData;} + virtual Int_t GetMode() const {return fMode;} virtual void Scan() const; @@ -85,7 +87,8 @@ private: Int_t fL1TriggerType[8]; // Trigger type Int_t fL1DataDecoded; // Raw data decoded - + Int_t fL1RawData; // Raw data + ClassDef(AliEMCALTriggerData,2) }; diff --git a/EMCAL/AliEMCALTriggerElectronics.cxx b/EMCAL/AliEMCALTriggerElectronics.cxx index 2bb9bd776fa..51fabdc2142 100644 --- a/EMCAL/AliEMCALTriggerElectronics.cxx +++ b/EMCAL/AliEMCALTriggerElectronics.cxx @@ -36,6 +36,7 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3 #include "AliEMCALDigit.h" #include "AliEMCALTriggerRawDigit.h" #include "AliEMCALTriggerPatch.h" +#include "AliEMCALTriggerSTUDCSConfig.h" #include @@ -91,7 +92,7 @@ AliEMCALTriggerElectronics::~AliEMCALTriggerElectronics() void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_t V0M[], AliEMCALTriggerData* data) { // Digits to trigger - + AliEMCALGeometry* geom = 0x0; AliRunLoader *rl = AliRunLoader::Instance(); @@ -104,7 +105,7 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_ if(!geom) AliError("Cannot access geometry!"); - // digits->Sort(); + Int_t pos, px, py, id; Int_t region[48][64], posMap[48][64]; for (Int_t i = 0; i < 48; i++) for (Int_t j = 0; j < 64; j++) @@ -117,7 +118,7 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_ { AliEMCALTriggerRawDigit* digit = (AliEMCALTriggerRawDigit*)digits->At(i); - Int_t id = digit->GetId(); + id = digit->GetId(); Int_t iTRU, iADC; @@ -133,225 +134,231 @@ void AliEMCALTriggerElectronics::Digits2Trigger(TClonesArray* digits, const Int_ if (isOK1 && isOK2 && amp) (static_cast(fTRU->At(iTRU)))->SetADC(iADC, time, amp); } - Int_t px, py; - if (geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) - { - posMap[px][py] = i; - - if (fSTU->GetRawData() && digit->GetL1TimeSum() >= 0) - { - region[px][py] = digit->GetL1TimeSum(); - } - } + if (geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) posMap[px][py] = i; } Int_t iL0 = 0; + Int_t timeL0[kNTRU] = {0}, timeL0min = 999; + for (Int_t i=0; i============\n", i)); AliEMCALTriggerTRU* iTRU = static_cast(fTRU->At(i)); - - // L0 is always computed from F-ALTRO - if (iTRU->L0()) + + if (iTRU->L0()) // L0 recomputation: *ALWAYS* done from FALTRO { - iL0 += iTRU->L0(); + iL0++; - Int_t sizeX = (Int_t) ((iTRU->PatchSize())->X() * (iTRU->SubRegionSize())->X()); + timeL0[i] = iTRU->GetL0Time(); - Int_t sizeY = (Int_t) ((iTRU->PatchSize())->Y() * (iTRU->SubRegionSize())->Y()); + if (!timeL0[i]) AliWarning(Form("TRU# %d has 0 trigger time",i)); + if (timeL0[i] < timeL0min) timeL0min = timeL0[i]; + + data->SetL0Trigger(0, i, 1); // TRU# i has issued a L0 + } + else + data->SetL0Trigger(0, i, 0); + } + + AliDebug(999, Form("=== %2d TRU (out of %2d) has issued a L0 / Min L0 time: %d\n", iL0, kNTRU, timeL0min)); + + AliEMCALTriggerRawDigit* dig = 0x0; + + if (iL0 && (!data->GetMode() || !fSTU->GetDCSConfig()->GetRawData())) + { + // Update digits after L0 calculation + for (Int_t i = 0; i < kNTRU; i++) + { + AliEMCALTriggerTRU *iTRU = static_cast(fTRU->At(i)); + + Int_t reg[24][4]; + iTRU->GetL0Region(timeL0min, reg); + + for (int j = 0; j < iTRU->RegionSize()->X(); j++) + { + for (int k = 0; k < iTRU->RegionSize()->Y(); k++) + { + if (geom->GetAbsFastORIndexFromPositionInTRU(i, j, k, id) + && + geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) + { + pos = posMap[px][py]; + + if (pos == -1) + { + // Add a new digit + new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); + + dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); + } + else + { + dig = (AliEMCALTriggerRawDigit*)digits->At(pos); + } + + dig->SetL1TimeSum(reg[j][k]); + } + } + } + } + } + + if (iL0 && !data->GetMode()) + { // transform local to global + + for (Int_t i = 0; i < kNTRU; i++) + { + AliEMCALTriggerTRU* iTRU = static_cast(fTRU->At(i)); + TIter Next(&iTRU->Patches()); while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)Next()) { - Int_t px, py, id; p->Position(px, py); - - if (geom->GetAbsFastORIndexFromPositionInTRU(i, px, py, id) - && - geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) p->SetPosition(px, py); + p->Position(px, py); + + // Local 2 Global + if (geom->GetAbsFastORIndexFromPositionInTRU(i, px, py, id) && + geom->GetPositionInEMCALFromAbsFastORIndex(id, px, py)) p->SetPosition(px, py); - if (!data->GetMode()) // Simulation - { - Int_t peaks = p->Peaks(); - - Int_t pos; - AliEMCALTriggerRawDigit* dig = 0x0; + Int_t peaks = p->Peaks(); + + Int_t sizeX = (Int_t) ((iTRU->PatchSize())->X() * (iTRU->SubRegionSize())->X()); + Int_t sizeY = (Int_t) ((iTRU->PatchSize())->Y() * (iTRU->SubRegionSize())->Y()); - for (Int_t j = 0; j < sizeX * sizeY; j++) + for (Int_t j = 0; j < sizeX * sizeY; j++) + { + if (peaks & (1 << j)) { - if (peaks & (1 << j)) - { - pos = posMap[px + j % sizeX][py + j / sizeX]; + pos = posMap[px + j % sizeX][py + j / sizeX]; - if (pos == -1) - { + if (pos == -1) + { // Add a new digit - new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); + new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); - dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); - } - else - { - dig = (AliEMCALTriggerRawDigit*)digits->At(pos); - } - - dig->SetL0Time(p->Time()); + dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); + } + else + { + dig = (AliEMCALTriggerRawDigit*)digits->At(pos); } + + dig->SetL0Time(timeL0min); } + } - pos = posMap[px][py]; + pos = posMap[px][py]; - if (pos == -1) - { + if (pos == -1) + { // Add a new digit - new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); + new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); - dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); - } - else - { - dig = (AliEMCALTriggerRawDigit*)digits->At(pos); - } - - dig->SetTriggerBit(kL0,0); + dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); + } + else + { + dig = (AliEMCALTriggerRawDigit*)digits->At(pos); } + + dig->SetTriggerBit(kL0, 0); } - - data->SetL0Trigger(0, i, 1); } - else - data->SetL0Trigger(0, i, 0); } - - // A L0 has been issued, run L1 - // Depending on raw data enabled or not in STU data: L1 computation - // should be done from F-ALTRO or directly on TRU time sums in STU raw data - if (iL0) + + // + // Prepare STU for L1 calculation + + for (int i = 0; i < (fSTU->RegionSize())->X(); i++) { - // Use L1 threshold from raw data when reconstructing raw data - if (data->GetMode()) - { - fSTU->SetThreshold(kL1Gamma, data->GetL1GammaThreshold()); - fSTU->SetThreshold(kL1Jet, data->GetL1JetThreshold() ); - } - else + for (int j = 0; j < (fSTU->RegionSize())->Y(); j++) { - fSTU->ComputeThFromV0(V0M); // C/A - data->SetL1GammaThreshold(fSTU->GetThreshold(kL1Gamma)); - data->SetL1JetThreshold( fSTU->GetThreshold(kL1Jet) ); - } + pos = posMap[i][j]; - if (fSTU->GetRawData()) - { - // Compute L1 from STU raw data - fSTU->SetRegion(region); - } - else - { - // Build STU raw data from F-ALTRO - TString str = "region"; - for (Int_t i = 0; i < kNTRU; i++) fSTU->Build(str, - i, - (static_cast(fTRU->At(i)))->Region(), - (static_cast(fTRU->At(i)))->RegionSize()); + if (pos >= 0) + { + AliEMCALTriggerRawDigit *digit = (AliEMCALTriggerRawDigit*)digits->At(pos); + + if (digit->GetL1TimeSum() > -1) region[i][j] = digit->GetL1TimeSum(); + } } + } + + fSTU->SetRegion(region); + + if (data->GetMode()) + { + fSTU->SetThreshold(kL1Gamma, data->GetL1GammaThreshold()); + fSTU->SetThreshold(kL1Jet, data->GetL1JetThreshold() ); + } + else + { + fSTU->ComputeThFromV0(kL1Gamma, V0M); + data->SetL1GammaThreshold( fSTU->GetThreshold(kL1Gamma)); + fSTU->ComputeThFromV0(kL1Jet, V0M); + data->SetL1JetThreshold( fSTU->GetThreshold(kL1Jet) ); + } - fSTU->L1(kL1Gamma); - - Int_t id, px, py; - AliEMCALTriggerRawDigit* dig = 0x0; + fSTU->L1(kL1Gamma); - TIterator* nP = 0x0; + TIterator* nP = 0x0; - nP = (fSTU->Patches()).MakeIterator(); - - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) - { - p->Position(px, py); + nP = (fSTU->Patches()).MakeIterator(); + + while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) + { + p->Position(px, py); - if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id)) + if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id)) + { + if (posMap[px][py] == -1) { - if (posMap[px][py] == -1) - { // Add a new digit - new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); + new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); - dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); - } - else - { - dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]); - } - - dig->SetTriggerBit(kL1Gamma,0); + dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); + } + else + { + dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]); } + + dig->SetTriggerBit(kL1Gamma,0); } + } - fSTU->Reset(); + fSTU->Reset(); - fSTU->L1(kL1Jet); + fSTU->L1(kL1Jet); - nP = (fSTU->Patches()).MakeIterator(); - - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) - { - p->Position(px, py); + nP = (fSTU->Patches()).MakeIterator(); + + while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) + { + p->Position(px, py); - px *= (Int_t)((fSTU->SubRegionSize())->X()); + px *= (Int_t)((fSTU->SubRegionSize())->X()); - py *= (Int_t)((fSTU->SubRegionSize())->Y()); + py *= (Int_t)((fSTU->SubRegionSize())->Y()); - if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id)) + if (geom->GetAbsFastORIndexFromPositionInEMCAL(px, py, id)) + { + if (posMap[px][py] == -1) { - if (posMap[px][py] == -1) - { // Add a new digit - new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); + new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); - dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); - } - else - { - dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]); - } - - dig->SetTriggerBit(kL1Jet,0); - } - } - - Int_t** reg = fSTU->Region(); - - if (!fSTU->GetRawData()) - { - // Update digits w/ L1 time sum - // Done in raw digit maker when raw data enabled - for (Int_t i = 0; i < 48; i++) + dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); + } + else { - for (Int_t j = 0; j < 64; j++) - { - if (reg[i][j]) - { - if (geom->GetAbsFastORIndexFromPositionInEMCAL(i, j, id)) - { - if (posMap[i][j] == -1) - { - // Add a new digit with L1 time sum - new((*digits)[digits->GetEntriesFast()]) AliEMCALTriggerRawDigit(id, 0x0, 0); - - dig = (AliEMCALTriggerRawDigit*)digits->At(digits->GetEntriesFast() - 1); - } - else - { - dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[i][j]); - } - - dig->SetL1TimeSum(reg[i][j]); - } - } - } + dig = (AliEMCALTriggerRawDigit*)digits->At(posMap[px][py]); } + + dig->SetTriggerBit(kL1Jet, 0); } } diff --git a/EMCAL/AliEMCALTriggerRawDigit.cxx b/EMCAL/AliEMCALTriggerRawDigit.cxx index de54e78cb00..ccaf833fd2a 100644 --- a/EMCAL/AliEMCALTriggerRawDigit.cxx +++ b/EMCAL/AliEMCALTriggerRawDigit.cxx @@ -25,7 +25,6 @@ #include #include "AliEMCALTriggerRawDigit.h" -#include "AliLog.h" ClassImp(AliEMCALTriggerRawDigit) @@ -69,7 +68,7 @@ Bool_t AliEMCALTriggerRawDigit::SetL0Time(const Int_t i) { if (i == fL0Times[j]) { - AliWarning("L0 time already there! Won't add it twice"); + AliDebug(1,Form("Digit id %d: L0 time %d already there! Won't add it twice",fId,i)); return kFALSE; } } diff --git a/EMCAL/AliEMCALTriggerRawDigit.h b/EMCAL/AliEMCALTriggerRawDigit.h index e9eb2655a72..494dab925f0 100644 --- a/EMCAL/AliEMCALTriggerRawDigit.h +++ b/EMCAL/AliEMCALTriggerRawDigit.h @@ -11,6 +11,7 @@ #include "AliEMCALRawDigit.h" #include "AliEMCALTriggerTypes.h" +#include "AliLog.h" class AliEMCALTriggerRawDigit : public AliEMCALRawDigit { @@ -35,7 +36,7 @@ public: Int_t GetL0TimeSum(const Int_t time) const; - void SetL1TimeSum(Int_t ts) {fL1TimeSum = ts;} + void SetL1TimeSum(Int_t ts) {if (fL1TimeSum >= 0) AliWarning("You're overwriting digit time sum! Please check"); fL1TimeSum = ts;} Int_t GetL1TimeSum( ) const {return fL1TimeSum;} virtual void Print(const Option_t* opt) const; diff --git a/EMCAL/AliEMCALTriggerRawDigitMaker.cxx b/EMCAL/AliEMCALTriggerRawDigitMaker.cxx index df469f8506d..0dee4f20fa3 100644 --- a/EMCAL/AliEMCALTriggerRawDigitMaker.cxx +++ b/EMCAL/AliEMCALTriggerRawDigitMaker.cxx @@ -32,6 +32,9 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3 #include "AliCaloBunchInfo.h" #include "AliRawReader.h" #include "AliEMCALTriggerDCSConfigDB.h" +#include "AliEMCALTriggerDCSConfig.h" +#include "AliEMCALTriggerTRUDCSConfig.h" +#include "AliEMCALTriggerSTUDCSConfig.h" #include "AliEMCALTriggerData.h" #include "AliEMCALTriggerPatch.h" #include "AliLog.h" @@ -286,9 +289,9 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() AliEMCALTriggerRawDigit* dig = 0x0; - Int_t sizeL1gsubr[2], sizeL1gpatch[2], sizeL1jsubr[2], sizeL1jpatch[2]; + TVector2 sizeL1gsubr, sizeL1gpatch, sizeL1jsubr, sizeL1jpatch; - fDCSConfig->GetSTUSegmentation(sizeL1gsubr, sizeL1gpatch, sizeL1jsubr, sizeL1jpatch); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->GetSegmentation(sizeL1gsubr, sizeL1gpatch, sizeL1jsubr, sizeL1jpatch); fRawReader->Reset(); fRawReader->Select("EMCAL",44); @@ -332,11 +335,23 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() fSTURawStream->GetRegionEnable(), fSTURawStream->GetFwVersion() }; + + // Modify DCS config from STU payload content + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetGA(type[0]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetGB(type[1]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetGC(type[2]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetJA(type[3]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetJB(type[4]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetJC(type[5]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetFw(type[7]); + fDCSConfig->GetTriggerDCSConfig()->GetSTUDCSConfig()->SetRawData(fSTURawStream->GetRawData()); fTriggerData->SetL1FrameMask(fSTURawStream->GetFrameReceived()); fTriggerData->SetL1V0(v0); fTriggerData->SetL1TriggerType(type); + fTriggerData->SetL1RawData(fSTURawStream->GetRawData()); + Int_t iTRU, x, y; if (fSTURawStream->GetRawData()) @@ -350,20 +365,9 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() UInt_t adc[96]; for (Int_t j = 0; j < 96; j++) adc[j] = 0; fSTURawStream->GetADC(i, adc); - /* - ofstream outfile(Form("data_TRU%d.txt",i),ios_base::trunc); - - for (Int_t j = 0; j < 96; j++) - { - outfile << adc[j] << endl; - } - - outfile.close(); - */ + for (Int_t j = 0; j < 96; j++) { - //if (adc[j] < 5) continue; - if (AliDebugLevel()) printf("| STU => TRU# %2d raw data: ADC# %2d: %d\n", iTRU, j, adc[j]); fGeometry->GetAbsFastORIndexFromTRU(iTRU, j, idx); @@ -394,13 +398,16 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() for (Int_t i = 0; i < fSTURawStream->GetNL0GammaPatch(); i++) { fSTURawStream->GetL0GammaPatch(i, iTRU, x); - + iTRU = fGeometry->GetTRUIndexFromSTUIndex(iTRU); - if (AliDebugLevel()) printf("| STU => Found L0 patch id: %2d in TRU# %2d\n", x, iTRU); - - const Int_t sizePatchL0 = fDCSConfig->GetTRUSegmentation(iTRU) * fDCSConfig->GetTRUSegmentation(iTRU); + const Int_t sizePatchL0 = + ((AliEMCALTriggerTRUDCSConfig*)fDCSConfig->GetTriggerDCSConfig()->GetTRUArr()->At(fGeometry->GetOnlineIndexFromTRUIndex(iTRU)))->GetSegmentation() + * + ((AliEMCALTriggerTRUDCSConfig*)fDCSConfig->GetTriggerDCSConfig()->GetTRUArr()->At(fGeometry->GetOnlineIndexFromTRUIndex(iTRU)))->GetSegmentation(); + if (AliDebugLevel()) printf("| STU => Found L0 patch id: %2d in TRU# %2d\n", x, iTRU); + Int_t idFastOR[4]; for (Int_t j = 0; j < 4; j++) idFastOR[j] = -1; @@ -442,8 +449,8 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() if (iTRU % 2) vx += 24; // C side - vx = vx - sizeL1gsubr[0] * sizeL1gpatch[0] + 1; - + vx = vx - int(sizeL1gsubr.X()) * int(sizeL1gpatch.X()) + 1; + if (vx >= 0 && vy < 63) { if (fGeometry->GetAbsFastORIndexFromPositionInEMCAL(vx, vy, idx)) @@ -474,9 +481,9 @@ void AliEMCALTriggerRawDigitMaker::PostProcess() { if (AliDebugLevel()) printf("| STU => Found L1 jet patch at (%2d , %2d)\n", x, y); - Int_t ix = sizeL1jsubr[0] * (11 - y - 4 + 1); - - Int_t iy = sizeL1jsubr[1] * (15 - x - 4 + 1); + Int_t ix = int(sizeL1jsubr.X()) * (11 - y - int(sizeL1jpatch.X()) + 1); + + Int_t iy = int(sizeL1jsubr.Y()) * (15 - x - int(sizeL1jpatch.Y()) + 1); // FIXME: x = 0 || y = 0 (Olivier's CS) patches a lost? diff --git a/EMCAL/AliEMCALTriggerSTU.cxx b/EMCAL/AliEMCALTriggerSTU.cxx index c5077700138..bf1eb1b48ee 100644 --- a/EMCAL/AliEMCALTriggerSTU.cxx +++ b/EMCAL/AliEMCALTriggerSTU.cxx @@ -67,14 +67,6 @@ AliEMCALTriggerSTU::~AliEMCALTriggerSTU() // Dtor } -//_______________ -Int_t AliEMCALTriggerSTU::GetRawData() const -{ - // Get raw data - - return fDCSConfig->GetRawData(); -} - //_______________ void AliEMCALTriggerSTU::Build( TString& str, Int_t iTRU, Int_t** M, const TVector2* rSize ) { @@ -287,16 +279,41 @@ void AliEMCALTriggerSTU::PatchGenerator(const TClonesArray* lpos, Int_t val) } //___________ -void AliEMCALTriggerSTU::ComputeThFromV0(const Int_t M[]) +void AliEMCALTriggerSTU::ComputeThFromV0(TriggerType_t type, const Int_t M[]) { // Compute threshold from V0 - if (!(M[0] + M[1])) AliWarning("V0A + V0C is null!"); // 0/1: V0C/V0A - + Short_t P[3] = {0}; + + switch (type) + { + case kL1Gamma: + P[0] = fDCSConfig->GetGA(); + P[1] = fDCSConfig->GetGB(); + P[2] = fDCSConfig->GetGC(); + break; + case kL1Jet: + P[0] = fDCSConfig->GetJA(); + P[1] = fDCSConfig->GetJB(); + P[2] = fDCSConfig->GetJC(); + break; + default: + AliError("AliEMCALTriggerSTU::ComputeThFromV0(): Undefined trigger type, pls check!"); + return; + } + + ULong64_t v0sum = M[0] + M[1]; + + ULong64_t sqrV0 = v0sum * v0sum; + + sqrV0 *= P[0]; + sqrV0 >>= 32; + + v0sum *= P[1]; - fGammaTh = fDCSConfig->GetGA()*(M[0] + M[1])*(M[0] + M[1]) + fDCSConfig->GetGB()*(M[0] + M[1]) + fDCSConfig->GetGC(); + v0sum >>= 16; - fJetTh = fDCSConfig->GetJA()*(M[0] + M[1])*(M[0] + M[1]) + fDCSConfig->GetJB()*(M[0] + M[1]) + fDCSConfig->GetJC(); + SetThreshold(type, (UShort_t)(sqrV0 + v0sum + P[2])); } //___________ diff --git a/EMCAL/AliEMCALTriggerSTU.h b/EMCAL/AliEMCALTriggerSTU.h index ca883b79fc7..7c43722627b 100644 --- a/EMCAL/AliEMCALTriggerSTU.h +++ b/EMCAL/AliEMCALTriggerSTU.h @@ -27,15 +27,16 @@ public: virtual void L1(TriggerType_t type); virtual void PatchGenerator(const TClonesArray* lpos, Int_t val); - virtual void ComputeThFromV0(const Int_t M[]); + virtual void ComputeThFromV0(TriggerType_t type, const Int_t M[]); virtual void SetThreshold(TriggerType_t type, Int_t v); virtual Int_t GetThreshold(TriggerType_t type); - virtual Int_t GetRawData() const; virtual void Reset(); + virtual AliEMCALTriggerSTUDCSConfig* GetDCSConfig() const {return fDCSConfig;} + protected: AliEMCALTriggerSTU(const AliEMCALTriggerSTU& rhs); diff --git a/EMCAL/AliEMCALTriggerSTUDCSConfig.cxx b/EMCAL/AliEMCALTriggerSTUDCSConfig.cxx index d95af407232..60ef971af4f 100644 --- a/EMCAL/AliEMCALTriggerSTUDCSConfig.cxx +++ b/EMCAL/AliEMCALTriggerSTUDCSConfig.cxx @@ -35,9 +35,9 @@ AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUDCSConfig() : TObject() ,fJA(0) ,fJB(1) ,fJC(0) - ,fGetRawData(0) + ,fGetRawData(1) ,fRegion(0xFFFFFFFF) - ,fFw(2223) + ,fFw(0x2A012) { // // AliEMCALTriggerSTUDCSConfig default constructor @@ -49,14 +49,11 @@ void AliEMCALTriggerSTUDCSConfig::GetSegmentation(TVector2& v1, TVector2& v2, TV { // Get Segmentation - switch (fFw) - { - case 2223: - v1.Set(1., 1.); - v2.Set(2., 2.); - v3.Set(4., 4.); - v4.Set(2., 2.); - break; - } + v1.Set(1., 1.); + v2.Set(2., 2.); + v3.Set(4., 4.); + + Double_t js = 2 + (fFw >> 16); + v4.Set(js, js); } diff --git a/EMCAL/AliEMCALTriggerSTURawStream.cxx b/EMCAL/AliEMCALTriggerSTURawStream.cxx index da1df99b6fe..de4b2c430b8 100644 --- a/EMCAL/AliEMCALTriggerSTURawStream.cxx +++ b/EMCAL/AliEMCALTriggerSTURawStream.cxx @@ -142,7 +142,7 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad() word32[iword++] = w32; } - + if (iword != kPayLoadSizeOld && iword != kPayLoadSizeNew && iword != (kPayLoadSizeOld + 1536) && iword != (kPayLoadSizeNew + 1536)) { AliError(Form("STU payload (eqId: %d, eqSize: %d) doesn't match expected size! %d word32", diff --git a/EMCAL/AliEMCALTriggerTRU.cxx b/EMCAL/AliEMCALTriggerTRU.cxx index d34a59558e4..679e40b93ce 100644 --- a/EMCAL/AliEMCALTriggerTRU.cxx +++ b/EMCAL/AliEMCALTriggerTRU.cxx @@ -43,7 +43,8 @@ ClassImp(AliEMCALTriggerTRU) //________________ AliEMCALTriggerTRU::AliEMCALTriggerTRU() : AliEMCALTriggerBoard(), -fDCSConfig(0x0) +fDCSConfig(0x0), +fL0Time(0) { // Ctor @@ -53,7 +54,8 @@ fDCSConfig(0x0) //________________ AliEMCALTriggerTRU::AliEMCALTriggerTRU(AliEMCALTriggerTRUDCSConfig* dcsConf, const TVector2& rSize, Int_t mapType) : AliEMCALTriggerBoard(rSize), -fDCSConfig(dcsConf) +fDCSConfig(dcsConf), +fL0Time(0) { // Ctor @@ -131,9 +133,7 @@ void AliEMCALTriggerTRU::ShowFastOR(Int_t iTimeWindow, Int_t iChannel) //________________ Int_t AliEMCALTriggerTRU::L0() { - // Mimick the TRU L0 'virtual' since not yet released algo - - // L0 issuing condition is: (2 up & 1 down) AND (time sum > thres) + // L0 issuing condition is: (2 up & 1 down) AND (patch sum > thres) // fill a matrix to support sliding window // compute the time sum for all the FastOR of a given TRU // and then move the space window @@ -294,7 +294,7 @@ Int_t AliEMCALTriggerTRU::L0() { fPatches->RemoveAt( j ); fPatches->Compress(); - } + } } //Delete, avoid leak @@ -308,6 +308,8 @@ Int_t AliEMCALTriggerTRU::L0() ZeroRegion(); else // Stop the algo when at least one patch is found ( thres & max ) { + fL0Time = i; + for (Int_t xx = 0; xx < fRegionSize->X(); xx++) { for (Int_t yy = 0; yy < fRegionSize->Y(); yy++) @@ -348,6 +350,29 @@ void AliEMCALTriggerTRU::SetADC( Int_t channel, Int_t bin, Int_t sig ) } } +//________________ +void AliEMCALTriggerTRU::GetL0Region(const int time, Int_t arr[][4]) +{ + Int_t r0 = time + fDCSConfig->GetRLBKSTU(); + + if (r0 < 0) + { + AliError(Form("TRU buffer not accessible! time: %d rollback: %d", time, fDCSConfig->GetRLBKSTU())); + return; + } + + for (Int_t i = 0; i < fRegionSize->X(); i++) + { + for (Int_t j = 0; j < fRegionSize->Y(); j++) + { + for (Int_t k = r0; k < r0 + kTimeWindowSize; k++) + { + arr[i][j] += fADC[fMap[i][j]][k]; + } + } + } +} + //________________ void AliEMCALTriggerTRU::SaveRegionADC(Int_t iTRU, Int_t iEvent) { diff --git a/EMCAL/AliEMCALTriggerTRU.h b/EMCAL/AliEMCALTriggerTRU.h index bf3fd2ec0d9..7a3ee26f126 100644 --- a/EMCAL/AliEMCALTriggerTRU.h +++ b/EMCAL/AliEMCALTriggerTRU.h @@ -28,6 +28,8 @@ public: virtual void SaveRegionADC(Int_t iTRU, Int_t iEvent); virtual void Reset(); virtual void ShowFastOR(Int_t timewindow, Int_t chan = -1); + virtual void GetL0Region(const int time, Int_t arr[][4]); + virtual Int_t GetL0Time() const {return fL0Time;} private: AliEMCALTriggerTRU(const AliEMCALTriggerTRU& rhs); @@ -36,6 +38,7 @@ private: AliEMCALTriggerTRUDCSConfig* fDCSConfig; // DCS config Int_t fADC[96][256]; //! FIXME: Check the maximum number of samples + Int_t fL0Time; // Time when the L0 is issued ClassDef(AliEMCALTriggerTRU,1) }; diff --git a/EMCAL/AliEMCALTriggerTRUDCSConfig.cxx b/EMCAL/AliEMCALTriggerTRUDCSConfig.cxx index ce57c0d7c8b..ddc2ab8b4a2 100644 --- a/EMCAL/AliEMCALTriggerTRUDCSConfig.cxx +++ b/EMCAL/AliEMCALTriggerTRUDCSConfig.cxx @@ -32,6 +32,7 @@ AliEMCALTriggerTRUDCSConfig::AliEMCALTriggerTRUDCSConfig() : TObject() ,fL0SEL(0) ,fL0COSM(0) ,fGTHRL0(0) +,fRLBKSTU(0) { // // AliEMCALTriggerTRUDCSConfig default constructor @@ -39,4 +40,13 @@ AliEMCALTriggerTRUDCSConfig::AliEMCALTriggerTRUDCSConfig() : TObject() for (Int_t i=0;i<6;i++) fMaskReg[i] = 0; } +//_____________________________________________________________________________ +Int_t AliEMCALTriggerTRUDCSConfig::GetSegmentation() +{ + // + if (fL0SEL & 0x0001) + return 2; + else + return 1; +} diff --git a/EMCAL/AliEMCALTriggerTRUDCSConfig.h b/EMCAL/AliEMCALTriggerTRUDCSConfig.h index bc696532d56..d073a67ef81 100644 --- a/EMCAL/AliEMCALTriggerTRUDCSConfig.h +++ b/EMCAL/AliEMCALTriggerTRUDCSConfig.h @@ -21,17 +21,21 @@ public: AliEMCALTriggerTRUDCSConfig(); virtual ~AliEMCALTriggerTRUDCSConfig() {} - void SetSELPF( UInt_t pf) { fSELPF = pf; } - void SetL0SEL( UInt_t la) { fL0SEL = la; } - void SetL0COSM(UInt_t lc) { fL0COSM = lc; } - void SetGTHRL0(UInt_t lg) { fGTHRL0 = lg; } - void SetMaskReg(UInt_t msk, Int_t pos) { fMaskReg[pos] = msk; } - - UInt_t GetSELPF() const { return fSELPF; } - UInt_t GetL0SEL() const { return fL0SEL; } - UInt_t GetL0COSM() const { return fL0COSM; } - UInt_t GetGTHRL0() const { return fGTHRL0; } - UInt_t GetMaskReg(Int_t pos) const { return fMaskReg[pos]; } + void SetSELPF( UInt_t pf) { fSELPF = pf; } + void SetL0SEL( UInt_t la) { fL0SEL = la; } + void SetL0COSM( UInt_t lc) { fL0COSM = lc; } + void SetGTHRL0( UInt_t lg) { fGTHRL0 = lg; } + void SetMaskReg(UInt_t msk, Int_t pos) { fMaskReg[pos] = msk; } + void SetRLBKSTU(UInt_t rb) { fRLBKSTU = rb; } + + UInt_t GetSELPF() const { return fSELPF; } + UInt_t GetL0SEL() const { return fL0SEL; } + UInt_t GetL0COSM() const { return fL0COSM; } + UInt_t GetGTHRL0() const { return fGTHRL0; } + UInt_t GetMaskReg(Int_t pos) const { return fMaskReg[pos]; } + UInt_t GetRLBKSTU() const { return fRLBKSTU; } + + Int_t GetSegmentation(); protected: @@ -45,7 +49,8 @@ private: UInt_t fL0COSM; // 2x2 UInt_t fGTHRL0; // 4x4 UInt_t fMaskReg[6]; // 6*16 = 96 mask bits per TRU + UInt_t fRLBKSTU; // TRU circular buffer rollback - ClassDef(AliEMCALTriggerTRUDCSConfig,2) // + ClassDef(AliEMCALTriggerTRUDCSConfig,3) // }; #endif diff --git a/EMCAL/CMakelibEMCALsim.pkg b/EMCAL/CMakelibEMCALsim.pkg index d04974977b5..2d08cc54c57 100644 --- a/EMCAL/CMakelibEMCALsim.pkg +++ b/EMCAL/CMakelibEMCALsim.pkg @@ -41,6 +41,8 @@ set ( SRCS string(REPLACE ".cxx" ".h" HDRS "${SRCS}") +set ( HDRS ${HDRS} AliEMCALTriggerTRUDCSConfig.h AliEMCALTriggerData.h AliEMCALTriggerSTUDCSConfig.h ) + set ( DHDR EMCALsimLinkDef.h) set ( EINCLUDE RAW VZERO STEER/STEER STEER/STEERBase) -- 2.39.3