X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALPreprocessor.cxx;h=93af03ca6a2a50b14a364bff64111619e63df7b0;hb=772f286b82ad82a05f37c5b0501af20ac7004440;hp=d25ca57c2b843528dc82453e25b911e66c2a3b50;hpb=676ff15378f3e05f6677e96cfa7329b93be616c9;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALPreprocessor.cxx b/EMCAL/AliEMCALPreprocessor.cxx index d25ca57c2b8..93af03ca6a2 100644 --- a/EMCAL/AliEMCALPreprocessor.cxx +++ b/EMCAL/AliEMCALPreprocessor.cxx @@ -39,6 +39,7 @@ #include "AliDCSValue.h" #include "AliCDBMetaData.h" #include "AliEMCALTriggerTRUDCSConfig.h" +#include "AliEMCALTriggerSTUDCSConfig.h" #include "AliEMCALTriggerDCSConfig.h" #include "AliCaloCalibPedestal.h" #include "AliCaloCalibSignal.h" @@ -60,7 +61,7 @@ const int kReturnCodeNoInfo = 9; const int kReturnCodeNoObject = 2; const int kReturnCodeNoEntries = 1; -const int kNTRU = 30; // From 2011; 10 SuperModules (SM) * 3 TRU per SM +const int kNTRU = 32; // From 2012; 10 + 2/3 SuperModules (SM) * 3 TRU per SM ClassImp(AliEMCALPreprocessor) @@ -196,11 +197,9 @@ UInt_t AliEMCALPreprocessor::Process(TMap* dcsAliasMap) // Trigger configuration processing: only for Physics runs TString triggerConf = fConfEnv->GetValue("Trigger","ON"); triggerConf.ToUpper(); - if( runType == kPhysicsRunType || runType == kPedestalRunType ) { - // if (triggerConf != "OFF" && dcsAliasMap ) { - if ( dcsAliasMap ) { + if( runType == kPhysicsRunType ) { + if (triggerConf != "OFF" && dcsAliasMap ) { UInt_t triggerResult = MapTriggerConfig(dcsAliasMap); - AliInfo(Form("triggerConf %s\n", triggerConf.Data())); result+=triggerResult; status = new TParameter("triggerResult",triggerResult); resultArray->Add(status); @@ -318,6 +317,7 @@ UInt_t AliEMCALPreprocessor::MapTemperature(TMap* dcsAliasMap) Bool_t storeOK = Store("Calib", "Temperature", fTemp, &metaData, 0, kFALSE); if ( !storeOK ) result=1; + AliInfo(Form("Temperature info stored. result %d\n", result)); } return result; @@ -326,6 +326,11 @@ UInt_t AliEMCALPreprocessor::MapTemperature(TMap* dcsAliasMap) //______________________________________________________________________________________________ UInt_t AliEMCALPreprocessor::MapTriggerConfig(TMap* dcsAliasMap) { // extract DCS trigger info + + + AliInfo("Print DCS alias map content"); + dcsAliasMap->Print(); + AliInfo(Form("Get TRU info from DCS DPs.\n")); Int_t i, iTRU; const Int_t bufsize = 1000; @@ -334,7 +339,10 @@ UInt_t AliEMCALPreprocessor::MapTriggerConfig(TMap* dcsAliasMap) AliDCSValue *dcsVal; TObjArray *arrL0ALGSEL, *arrPEAKFINDER, *arrGLOBALTHRESH, *arrCOSMTHRESH; TObjArray *arrMASK[6]; - + + TObjArray *arrSTUG[3][2], *arrSTUJ[3][2]; + TObjArray *arrSTUD, *arrSTUR, *arrSTUF; + // overall object to hold STU and DCS config info // DS comment: for now only holds TRU info, i.e. only partially filled // (STU info only in raw data header; unfortunately not also picked up via DCS DPs) @@ -346,6 +354,8 @@ UInt_t AliEMCALPreprocessor::MapTriggerConfig(TMap* dcsAliasMap) } trigConfig->SetTRUArr(truArr); + AliEMCALTriggerSTUDCSConfig *stuConfig = new AliEMCALTriggerSTUDCSConfig(); + // loop through all TRUs bool debug = true; // debug flag for AliInfo printouts for each TRU for( iTRU = 0; iTRU < kNTRU; iTRU++){ @@ -368,79 +378,195 @@ UInt_t AliEMCALPreprocessor::MapTriggerConfig(TMap* dcsAliasMap) // fill the objects AliEMCALTriggerTRUDCSConfig* truConfig = trigConfig->GetTRUDCSConfig(iTRU); if( ! truConfig ){ - AliWarning( Form("EMC DCS TRU%02d config not retrieved!\n", iTRU )); + AliWarning( Form("EMC TRU%02d config not retrieved!\n", iTRU )); continue; } // get last entries. fill the TRU object if( ! arrL0ALGSEL ){ - AliWarning( Form("EMC DCS TRU%02d L0ALGSEL alias not found!\n", iTRU )); + AliWarning( Form("EMC_TRU%02d_L0ALGSEL alias not found!\n", iTRU )); } else{ if (debug) AliInfo( Form("arrL0ALGSEL has %d entries \n", arrL0ALGSEL->GetEntries()) ); if ( arrL0ALGSEL->GetEntries() > 0 ) { dcsVal = (AliDCSValue *) arrL0ALGSEL->At( arrL0ALGSEL->GetEntries() - 1 ); - if (dcsVal) truConfig->SetL0SEL( dcsVal->GetUInt() ); + if (dcsVal) { + truConfig->SetL0SEL( dcsVal->GetUInt() ); + if (debug) AliInfo( Form("saving value: %u\n", dcsVal->GetUInt()) ); + } } + else + AliWarning( Form("EMC_TRU%02d_L0ALGSEL has no entries!\n", iTRU )); } if( ! arrPEAKFINDER ){ - AliWarning( Form("EMC DCS TRU%02d PEAKFINDER alias not found!\n", iTRU )); + AliWarning( Form("EMC_TRU%02d_PEAKFINDER alias not found!\n", iTRU )); } else{ if (debug) AliInfo( Form("arrPEAKFINDER has %d entries \n", arrPEAKFINDER->GetEntries()) ); if ( arrPEAKFINDER->GetEntries() > 0 ) { dcsVal = (AliDCSValue *) arrPEAKFINDER->At( arrPEAKFINDER->GetEntries() - 1 ); - if (dcsVal) truConfig->SetSELPF( dcsVal->GetUInt() ); + if (dcsVal){ + truConfig->SetSELPF( dcsVal->GetUInt() ); + if (debug) AliInfo( Form("saving value: %u\n", dcsVal->GetUInt()) ); + } } + else + AliWarning( Form("EMC_TRU%02d_PEAKFINDER has no entries!\n", iTRU )); } if( ! arrGLOBALTHRESH ){ - AliWarning( Form("EMC DCS TRU%02d GLOBALTHRESH alias not found!\n", iTRU )); + AliWarning( Form("EMC_TRU%02d_GLOBALTHRESH alias not found!\n", iTRU )); } else{ if (debug) AliInfo( Form("arrGLOBALTHRESH has %d entries \n", arrGLOBALTHRESH->GetEntries()) ); if ( arrGLOBALTHRESH->GetEntries() > 0 ) { dcsVal = (AliDCSValue *) arrGLOBALTHRESH->At( arrGLOBALTHRESH->GetEntries() - 1 ); - if (dcsVal) truConfig->SetGTHRL0( dcsVal->GetUInt() ); + if (dcsVal){ + truConfig->SetGTHRL0( dcsVal->GetUInt() ); + if (debug) AliInfo( Form("saving value: %u\n", dcsVal->GetUInt()) ); + } } + else + AliWarning( Form("EMC_TRU%02d_GLOBALTHRESH has no entries!\n", iTRU )); } if( ! arrCOSMTHRESH ){ - AliWarning( Form("EMC DCS TRU%02d COSMTHRESH alias not found!\n", iTRU )); + AliWarning( Form("EMC_TRU%02d_COSMTHRESH alias not found!\n", iTRU )); } else{ if (debug) AliInfo( Form("arrCOSMTHRESH has %d entries \n", arrCOSMTHRESH->GetEntries()) ); if ( arrCOSMTHRESH->GetEntries() > 0 ) { dcsVal = (AliDCSValue *) arrCOSMTHRESH->At( arrCOSMTHRESH->GetEntries() - 1 ); - if (dcsVal) truConfig->SetL0COSM( dcsVal->GetUInt() ); + if (dcsVal){ + truConfig->SetL0COSM( dcsVal->GetUInt() ); + if (debug) AliInfo( Form("saving value: %u\n", dcsVal->GetUInt()) ); + } } + else + AliWarning( Form("EMC_TRU%02d_COSMTHRESH has no entries!\n", iTRU )); } for( i = 0; i < 6; i++ ){ if( ! arrMASK[i] ){ - AliWarning( Form("EMC DCS TRU%02d MASK%d alias not found!\n", iTRU, i )); + AliWarning( Form("EMC_TRU%02d_MASK%d alias not found!\n", iTRU, i )); } else{ if (debug) AliInfo( Form("arrMASK[%d] has %d entries \n", i, arrMASK[i]->GetEntries()) ); if ( arrMASK[i]->GetEntries() > 0 ) { dcsVal = (AliDCSValue *) arrMASK[i]->At( arrMASK[i]->GetEntries() - 1 ); - if (dcsVal) truConfig->SetMaskReg( dcsVal->GetUInt(), i ); + if (dcsVal){ + truConfig->SetMaskReg( dcsVal->GetUInt(), i ); + if (debug) AliInfo( Form("saving value: %u\n", dcsVal->GetUInt()) ); + } } + else + AliWarning( Form("EMC_TRU%02d_MASK%d has no entries!\n", iTRU, i )); } } } // TRUs AliInfo(Form("TRU info retrieved.\n")); + + // STU + for (i = 0; i < 3; i++) { + for (int j = 0; j < 2; j++) { + arrSTUG[i][j] = (TObjArray*)dcsAliasMap->GetValue(Form("EMC_STU_G%c%d", i + 65, j)); + arrSTUJ[i][j] = (TObjArray*)dcsAliasMap->GetValue(Form("EMC_STU_J%c%d", i + 65, j)); + + if (!arrSTUG[i][j]) { + AliWarning(Form("EMC_STU_G%c%d alias not found!", i + 65, j)); + } else { + if (debug) AliInfo( Form("EMC_STU_G%c%d has %d entries", i + 65, j, arrSTUG[i][j]->GetEntries())); + if (arrSTUG[i][j]->GetEntries() > 0) { + dcsVal = (AliDCSValue*)arrSTUG[i][j]->At(arrSTUG[i][j]->GetEntries() - 1); + if (dcsVal) { + stuConfig->SetG(i, j, dcsVal->GetInt()); + if (debug) AliInfo(Form("saving value: %u", dcsVal->GetInt())); + } + } else + AliWarning(Form("EMC_STU_G%c%d has no entry!", i + 65, j)); + } + + if (!arrSTUJ[i][j]) { + AliWarning(Form("EMC_STU_J%c%d alias not found!", i + 65, j)); + } else { + if (debug) AliInfo( Form("EMC_STU_J%c%d has %d entries", i + 65, j, arrSTUJ[i][j]->GetEntries())); + if (arrSTUJ[i][j]->GetEntries() > 0) { + dcsVal = (AliDCSValue*)arrSTUJ[i][j]->At(arrSTUJ[i][j]->GetEntries() - 1); + if (dcsVal) { + stuConfig->SetJ(i, j, dcsVal->GetInt()); + if (debug) AliInfo(Form("saving value: %u", dcsVal->GetInt())); + } + } else + AliWarning(Form("EMC_STU_J%c%d has no entry!", i + 65, j)); + } + } + } + + arrSTUD = (TObjArray*)dcsAliasMap->GetValue("EMC_STU_GETRAW"); + arrSTUR = (TObjArray*)dcsAliasMap->GetValue("EMC_STU_REGION"); + arrSTUF = (TObjArray*)dcsAliasMap->GetValue("EMC_STU_FWVERS"); + + if (!arrSTUD) { + AliWarning("EMC_STU_GETRAW alias not found!"); + } else { + if (debug) AliInfo(Form("EMC_STU_GETRAW has %d entries", arrSTUD->GetEntries())); + if (arrSTUD->GetEntries() > 0) { + dcsVal = (AliDCSValue*)arrSTUD->At(arrSTUD->GetEntries() - 1); + if (dcsVal) { + stuConfig->SetRawData(dcsVal->GetInt()); + if (debug) AliInfo(Form("saving value: %u", dcsVal->GetInt())); + } + } else + AliWarning("EMC_STU_GETRAW has no entry!"); + } + + if (!arrSTUR) { + AliWarning("EMC_STU_REGION"); + } else { + if (debug) AliInfo( Form("EMC_STU_REGION has %d entries", arrSTUR->GetEntries())); + if (arrSTUR->GetEntries() > 0) { + dcsVal = (AliDCSValue*)arrSTUR->At(arrSTUR->GetEntries() - 1); + if (dcsVal) { + stuConfig->SetRegion(dcsVal->GetInt()); + if (debug) AliInfo(Form("saving value: %u", dcsVal->GetInt())); + } + } else + AliWarning("EMC_STU_REGION has no entry!"); + } + + if (!arrSTUF) { + AliWarning("EMC_STU_FWVERS"); + } else { + if (debug) AliInfo(Form("EMC_STU_FWVERS has %d entries", arrSTUF->GetEntries())); + if (arrSTUF->GetEntries() > 0) { + dcsVal = (AliDCSValue*)arrSTUF->At(arrSTUF->GetEntries() - 1); + if (dcsVal) { + stuConfig->SetFw(dcsVal->GetInt()); + if (debug) AliInfo(Form("saving value: %u", dcsVal->GetInt())); + } + } else + AliWarning("EMC_STU_FWVERS has no entry!"); + } + + trigConfig->SetSTUObj(stuConfig); + + AliInfo(Form("STU info retrieved.")); + + // save the objects AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible(kMetaResponsible); metaData.SetComment(kMetaComment); - Bool_t retCode = Store("Calib", "Trigger", trigConfig, &metaData, 0, kFALSE); - AliInfo(Form("TRU info stored.\n")); - return retCode; + UInt_t result=0; + Bool_t storeOK = Store("Calib", "Trigger", trigConfig, &metaData, 0, kFALSE); + if ( !storeOK ) result=1; + AliInfo(Form("TRU info stored. result %d\n", result)); + + return result; } //______________________________________________________________________________________________