diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19f6c3b83a89ff6e997e459985a0a0cd88d5ae58..08411c10458a9e07a361d6b7519402d76c10c198 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ build: run_on_IT: stage: run dependencies: - - build + - build before_script: - printf $USER_PASS | base64 -d | kinit $USER_NAME - xrdcp -r root://eosuser.cern.ch//eos/user/c/cmstkph2/ci_repo/ci_tools . @@ -53,7 +53,7 @@ run_on_IT: - cp ci_tools/Results/Run000001_ThrEqualization.root . - cp ci_tools/Results/Run000002_SCurve.root . artifacts: - paths: + paths: - Run000000_PixelAlive.root - Run000001_ThrEqualization.root - Run000002_SCurve.root @@ -65,9 +65,9 @@ check_run_on_IT: stage: check needs: [run_on_IT] script: - - python ci_tools/plot_canvas.py Run000000_PixelAlive.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_M(0)_PixelAlive_Chip(0)" -o plots - - python ci_tools/plot_canvas.py Run000001_ThrEqualization.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_M(0)_ThrEqualization_Chip(0)" -o plots - - python ci_tools/plot_canvas.py Run000002_SCurve.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_M(0)_SCurves_Chip(0)" -o plots + - python ci_tools/plot_canvas.py Run000000_PixelAlive.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_H(0)_PixelAlive_Chip(0)" -o plots + - python ci_tools/plot_canvas.py Run000001_ThrEqualization.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_H(0)_ThrEqualization_Chip(0)" -o plots + - python ci_tools/plot_canvas.py Run000002_SCurve.root "Detector/Board_0/OpticalGroup_0/Hybrid_0/Chip_0/D_B(0)_O(0)_H(0)_SCurves_Chip(0)" -o plots artifacts: paths: - plots @@ -91,7 +91,7 @@ run_on_2S: - cp Results/*/Hybrid.root . artifacts: paths: - - Hybrid.root + - Hybrid.root - ci_tools/plot_hist.py expire_in: 1 week @@ -105,7 +105,6 @@ check_run_on_2S: - plots expire_in: 1 week - ## 2S hybrid run_on_2S_FNAL: tags: @@ -124,7 +123,7 @@ run_on_2S_FNAL: - cp Results/*/Hybrid.root . artifacts: paths: - - Hybrid.root + - Hybrid.root - ci_tools/plot_hist.py expire_in: 1 week @@ -137,5 +136,3 @@ check_run_on_2S_FNAL: paths: - plots expire_in: 1 week - - diff --git a/HWInterface/RD53FWInterface.cc b/HWInterface/RD53FWInterface.cc index 3fc6e9c154cebc3e7fc162e06671947e688bf126..fa3c4c30716a7fe56748e004c043c5f5a5010836 100644 --- a/HWInterface/RD53FWInterface.cc +++ b/HWInterface/RD53FWInterface.cc @@ -339,6 +339,11 @@ bool RD53FWInterface::CheckChipCommunication() LOG(ERROR) << BOLDRED << "\t--> Some data lanes are enabled but inactive" << RESET; return false; } + else if(chips_en == 0) + { + LOG(ERROR) << BOLDRED << "\t--> No data lane is enabled: aborting" << RESET; + exit(EXIT_FAILURE); + } LOG(INFO) << BOLDBLUE << "\t--> All enabled data lanes are active" << RESET; return true; @@ -1231,8 +1236,8 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, size_t RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_first_prime = 0; RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_ecr = 0; RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_inject = 0; - RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger = INJdelay::BeforePrimeCal; - RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays); + RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays); + RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime = 0; RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.first_cal_en = false; RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.second_cal_en = false; @@ -1243,8 +1248,8 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, size_t if(enableAutozero == true) { RD53FWInterface::localCfgFastCmd.autozero_source = AutozeroSource::FastCMDFSM; - RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_autozero = RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime; - RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_prime = 0; + RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_autozero = RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger; + RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_trigger = 0; } } else @@ -1794,8 +1799,10 @@ bool RD53FWInterface::RunPRBStest(bool given_time, unsigned long long frames_or_ unsigned time_per_step = std::min(std::max((unsigned)time2run / n_prints, (unsigned)1), (unsigned)3600); // The runtime of the PRBS test will have a precision of one step (at most 1h and at least 1s) - // Reset counter - WriteStackReg({{"user.ctrl_regs.PRBS_checker.reset_cntr", 1}, {"user.ctrl_regs.PRBS_checker.reset_cntr", 0}}); + WriteStackReg({{"user.ctrl_regs.PRBS_checker.module_addr", hybrid_id}, + {"user.ctrl_regs.PRBS_checker.chip_address", chip_id}, + {"user.ctrl_regs.PRBS_checker.reset_cntr", 1}, + {"user.ctrl_regs.PRBS_checker.reset_cntr", 0}}); // Set PRBS frames to run uint32_t lowFrames, highFrames; @@ -1834,15 +1841,7 @@ bool RD53FWInterface::RunPRBStest(bool given_time, unsigned long long frames_or_ } LOG(INFO) << BOLDGREEN << "===== Run finished =====" << RESET; - WriteStackReg({ - - // Stop PRBS - {"user.ctrl_regs.PRBS_checker.stop_checker", 1}, - {"user.ctrl_regs.PRBS_checker.stop_checker", 0}, - - // Select hybrid and chip - {"user.ctrl_regs.PRBS_checker.module_addr", hybrid_id}, - {"user.ctrl_regs.PRBS_checker.chip_address", chip_id}}); + WriteStackReg({{"user.ctrl_regs.PRBS_checker.stop_checker", 1}, {"user.ctrl_regs.PRBS_checker.stop_checker", 0}}); // Read PRBS frame counter uint32_t PRBScntrLO = ReadReg("user.stat_regs.prbs_frame_cntr_low"); diff --git a/HWInterface/RD53Interface.cc b/HWInterface/RD53Interface.cc index 73d23edb5636c13a2fe3be0a449cdb9fec6f354e..f324cc39954db665e9a74f8640a17004e5084d44 100644 --- a/HWInterface/RD53Interface.cc +++ b/HWInterface/RD53Interface.cc @@ -51,15 +51,7 @@ bool RD53Interface::ConfigureChip(Chip* pChip, bool pVerifLoop, uint32_t pBlockS // ############################### // # Programmig global registers # // ############################### - static const char* registerBlackList[] = {"HighGain_LIN", - "INJECTION_SELECT_DELAY", - "CLK_DATA_DELAY_CLK_DELAY", - "CLK_DATA_DELAY_DATA_DELAY", - "I_MONITOR_SELECT", - "V_MONITOR_SELECT", - "ADC_OFFSET_VOLT", - "ADC_MAXIMUM_VOLT", - "TEMPSENS_IDEAL_FACTOR"}; + static const char* registerBlackList[] = {"HighGain_LIN", "ADC_OFFSET_VOLT", "ADC_MAXIMUM_VOLT", "TEMPSENS_IDEAL_FACTOR"}; for(const auto& cRegItem: pRD53RegMap) if(cRegItem.second.fPrmptCfg == true) @@ -75,19 +67,58 @@ bool RD53Interface::ConfigureChip(Chip* pChip, bool pVerifLoop, uint32_t pBlockS // ################# // # Special cases # // ################# - if(cRegItem.first == "ADC_MONITOR_CONFIG") + if(cRegItem.first == "MONITOR_CONFIG_ADC") { value = - cRegItem.second.fValue | (pRD53RegMap["MONITOR_CONFIG"].fValue & (RD53Shared::setBits(pRD53RegMap["MONITOR_CONFIG"].fBitSize) ^ RD53Shared::setBits(cRegItem.second.fBitSize))); + cRegItem.second.fValue | (pRD53RegMap["MONITOR_CONFIG"].fValue & (RD53Shared::setBits(pRD53RegMap["MONITOR_CONFIG"].fBitSize) - RD53Shared::setBits(cRegItem.second.fBitSize))); regName = "MONITOR_CONFIG"; } - else if(cRegItem.first == "BG_MONITOR_CONFIG") + else if(cRegItem.first == "MONITOR_CONFIG_BG") { - value = (cRegItem.second.fValue << pRD53RegMap["ADC_MONITOR_CONFIG"].fBitSize) | + value = (cRegItem.second.fValue << pRD53RegMap["MONITOR_CONFIG_ADC"].fBitSize) | (pRD53RegMap["MONITOR_CONFIG"].fValue & - (RD53Shared::setBits(pRD53RegMap["MONITOR_CONFIG"].fBitSize) ^ (RD53Shared::setBits(cRegItem.second.fBitSize) << pRD53RegMap["ADC_MONITOR_CONFIG"].fBitSize))); + (RD53Shared::setBits(pRD53RegMap["MONITOR_CONFIG"].fBitSize) - (RD53Shared::setBits(cRegItem.second.fBitSize) << pRD53RegMap["MONITOR_CONFIG_ADC"].fBitSize))); regName = "MONITOR_CONFIG"; } + if(cRegItem.first == "VOLTAGE_TRIM_DIG") + { + value = cRegItem.second.fValue | (pRD53RegMap["VOLTAGE_TRIM"].fValue & (RD53Shared::setBits(pRD53RegMap["VOLTAGE_TRIM"].fBitSize) - RD53Shared::setBits(cRegItem.second.fBitSize))); + regName = "VOLTAGE_TRIM"; + } + else if(cRegItem.first == "VOLTAGE_TRIM_ANA") + { + value = (cRegItem.second.fValue << pRD53RegMap["VOLTAGE_TRIM_DIG"].fBitSize) | + (pRD53RegMap["VOLTAGE_TRIM"].fValue & + (RD53Shared::setBits(pRD53RegMap["VOLTAGE_TRIM"].fBitSize) - (RD53Shared::setBits(cRegItem.second.fBitSize) << pRD53RegMap["VOLTAGE_TRIM_DIG"].fBitSize))); + regName = "VOLTAGE_TRIM"; + } + else if(cRegItem.first == "INJECTION_SELECT_DELAY") + { + value = cRegItem.second.fValue | + (pRD53RegMap["INJECTION_SELECT"].fValue & (RD53Shared::setBits(pRD53RegMap["INJECTION_SELECT"].fBitSize) - RD53Shared::setBits(cRegItem.second.fBitSize))); + regName = "INJECTION_SELECT"; + } + else if(cRegItem.first == "CLK_DATA_DELAY_DATA_DELAY") + { + value = + cRegItem.second.fValue | (pRD53RegMap["CLK_DATA_DELAY"].fValue & (RD53Shared::setBits(pRD53RegMap["CLK_DATA_DELAY"].fBitSize) - RD53Shared::setBits(cRegItem.second.fBitSize))); + regName = "CLK_DATA_DELAY"; + } + else if(cRegItem.first == "CLK_DATA_DELAY_CLK_DELAY") + { + value = (cRegItem.second.fValue << pRD53RegMap["CLK_DATA_DELAY_DATA_DELAY"].fBitSize) | + (pRD53RegMap["CLK_DATA_DELAY"].fValue & + (RD53Shared::setBits(pRD53RegMap["CLK_DATA_DELAY"].fBitSize) - (RD53Shared::setBits(cRegItem.second.fBitSize) << pRD53RegMap["CLK_DATA_DELAY_DATA_DELAY"].fBitSize))); + regName = "CLK_DATA_DELAY"; + } + else if(cRegItem.first == "CLK_DATA_DELAY_CLK_PHASE") + { + value = (cRegItem.second.fValue << (pRD53RegMap["CLK_DATA_DELAY_DATA_DELAY"].fBitSize + pRD53RegMap["CLK_DATA_DELAY_CLK_DELAY"].fBitSize)) | + (pRD53RegMap["CLK_DATA_DELAY"].fValue & + (RD53Shared::setBits(pRD53RegMap["CLK_DATA_DELAY"].fBitSize) - + (RD53Shared::setBits(cRegItem.second.fBitSize) << (pRD53RegMap["CLK_DATA_DELAY_DATA_DELAY"].fBitSize + pRD53RegMap["CLK_DATA_DELAY_CLK_DELAY"].fBitSize)))); + regName = "CLK_DATA_DELAY"; + } RD53Interface::WriteChipReg(pChip, regName, value, true); } @@ -472,7 +503,7 @@ uint32_t RD53Interface::measureADC(ReadoutChip* pChip, uint32_t data) { const uint16_t GLOBAL_PULSE_ROUTE = pChip->getRegItem("GLOBAL_PULSE_ROUTE").fAddress; const uint8_t chipID = pChip->getId(); - const uint16_t trimADC = bits::pack<1, 5, 6>(true, pChip->getRegItem("BG_MONITOR_CONFIG").fValue, pChip->getRegItem("ADC_MONITOR_CONFIG").fValue); + const uint16_t trimADC = bits::pack<1, 5, 6>(true, pChip->getRegItem("MONITOR_CONFIG_BG").fValue, pChip->getRegItem("MONITOR_CONFIG_ADC").fValue); // [10:6] band-gap trim [5:0] ADC trim. According to wafer probing they should give an average VrefADC of 0.9 V const uint16_t GlbPulseVal = RD53Interface::ReadChipReg(pChip, "GLOBAL_PULSE_ROUTE"); diff --git a/README.md b/README.md index 9767a8f7ff2a6c51f8bd08985b524d38feab5ff3..7c1fdfb617ecaf7d4bc8ee8776134ac620db2d8c 100755 --- a/README.md +++ b/README.md @@ -26,11 +26,11 @@ More informations can be found at https://indico.cern.ch/event/842824/attachment ## Middleware for the Inner-Tracker (IT) system ```diff -+ Last change made to this section: 09/10/2020 ++ Last change made to this section: 06/11/2020 ``` **Suggested software and firmware versions:** -- Software git branch / tag : `master` / `IT-v3.9.7` +- Software git branch / tag : `master` / `IT-v3.9.8` - Firmware tag: `3.4` - Mattermost forum: `cms-it-daq` (https://mattermost.web.cern.ch/cms-it-daq/) @@ -172,7 +172,7 @@ else echo "Argument not recognized: $1" fi ``` -**N.B.:** steps **4** and **5** are meant to measure the so called "in-time threhsold", to be compared with the threshold measured at step **3**, which is the so called "absoulte threshold" +**N.B.:** steps **4** and **5** are meant to measure the so called "in-time threshold", to be compared with the threshold measured at step **3**, which is the so called "absoulte threshold" ### ~=-=~ End of Inner-Tracker section ~=-=~ <hr> diff --git a/RootUtils/RootContainerFactory.h b/RootUtils/RootContainerFactory.h index e600b225f0093f3b57776191c2aa98a9eb652b9b..27605fa014b2e45dda57c67163550f03ca8f232f 100644 --- a/RootUtils/RootContainerFactory.h +++ b/RootUtils/RootContainerFactory.h @@ -166,8 +166,8 @@ void bookHistogramsFromStructure(TFile* theOutputFile, SC theChipSummary; initializePlot(&theChipSummary, - Form("D_B(%d)_O(%d)_M(%d)_%s_Chip(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chipSummaryHistogramGenericName.c_str(), chip->getId()), - Form("D_B(%d)_O(%d)_M(%d)_%s_Chip(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chipSummaryHistogramGenericTitle.c_str(), chip->getId()), + Form("D_B(%d)_O(%d)_H(%d)_%s_Chip(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chipSummaryHistogramGenericName.c_str(), chip->getId()), + Form("D_B(%d)_O(%d)_H(%d)_%s_Chip(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chipSummaryHistogramGenericTitle.c_str(), chip->getId()), &chipSummary); copyChip->getSummary<SC, T>() = std::move(theChipSummary); @@ -188,13 +188,13 @@ void bookHistogramsFromStructure(TFile* theOutputFile, if(chip->getNumberOfCols() == 1) { histogramName = Form( - "D_B(%d)_O(%d)_M(%d)_C(%d)_%s_Channel(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chip->getId(), channelHistogramGenericName.data(), row); + "D_B(%d)_O(%d)_H(%d)_C(%d)_%s_Channel(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chip->getId(), channelHistogramGenericName.data(), row); histogramTitle = Form( - "D_B(%d)_O(%d)_M(%d)_C(%d)_%s_Channel(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chip->getId(), channelHistogramGenericTitle.data(), row); + "D_B(%d)_O(%d)_H(%d)_C(%d)_%s_Channel(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), chip->getId(), channelHistogramGenericTitle.data(), row); } else { - histogramName = Form("D_B(%d)_O(%d)_M(%d)_C(%d)_%s_Row(%d)_Col(%d)", + histogramName = Form("D_B(%d)_O(%d)_H(%d)_C(%d)_%s_Row(%d)_Col(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), @@ -202,7 +202,7 @@ void bookHistogramsFromStructure(TFile* theOutputFile, channelHistogramGenericName.data(), row, col); - histogramTitle = Form("D_B(%d)_O(%d)_M(%d)_C(%d)_%s_Row(%d)_Col(%d)", + histogramTitle = Form("D_B(%d)_O(%d)_H(%d)_C(%d)_%s_Row(%d)_Col(%d)", board->getId(), opticalGroup->getId(), hybrid->getId(), diff --git a/settings/CMSIT.xml b/settings/CMSIT.xml index 15483ec764c5644956feb6a1b37d51c8389a3987..584ad3e7a0d80ae4c3ecf748afc864eb093b85f8 100755 --- a/settings/CMSIT.xml +++ b/settings/CMSIT.xml @@ -60,16 +60,17 @@ CLK_DATA_DELAY = "0" INJECTION_SELECT = "9" - VOLTAGE_TRIM = "528" + VOLTAGE_TRIM_DIG = "16" + VOLTAGE_TRIM_ANA = "16" - ADC_MONITOR_CONFIG = "5" - BG_MONITOR_CONFIG = "12" + MONITOR_CONFIG_ADC = "5" + MONITOR_CONFIG_BG = "12" ADC_OFFSET_VOLT = "63" ADC_MAXIMUM_VOLT = "839" TEMPSENS_IDEAL_FACTOR = "1225" /> <!-- - Monitoring: ADC_MONITOR_CONFIG, BG_MONITOR_CONFIG, ADC_OFFSET_VOLT, ADC_MAXIMUM_VOLT, TEMPSENS_IDEAL_FACTOR + Monitoring: MONITOR_CONFIG_ADC, MONITOR_CONFIG_BG, ADC_OFFSET_VOLT, ADC_MAXIMUM_VOLT, TEMPSENS_IDEAL_FACTOR CLK_DATA_DELAY: [8] clk phase; [7:4] clk delay; [3:0] data delay --> </RD53> diff --git a/settings/RD53Files/CMSIT_RD53.txt b/settings/RD53Files/CMSIT_RD53.txt index 264d2ffbbdb7c1d11453603fffdb88b1e20e7fae..5753e414b28a70d63d9600c403608176d31a4e84 100755 --- a/settings/RD53Files/CMSIT_RD53.txt +++ b/settings/RD53Files/CMSIT_RD53.txt @@ -197,15 +197,17 @@ SELF_TRIGGER_ENABLE 0x89 0b0000 0b0000 *------------------------------------------------------------------------------------------------------- HighGain_LIN 0xA0 0b1 0b1 1 INJECTION_SELECT_DELAY 0xA1 0b0000 0b0000 4 -CLK_DATA_DELAY_CLK_DELAY 0xA2 0b0000 0b0000 4 -CLK_DATA_DELAY_DATA_DELAY 0xA3 0b0000 0b0000 4 -I_MONITOR_SELECT 0xA4 0x00 0x00 6 -V_MONITOR_SELECT 0xA5 0x00 0x00 7 -ADC_MONITOR_CONFIG 0xA6 0d5 0d5 6 -BG_MONITOR_CONFIG 0xA7 0d12 0d12 5 -ADC_OFFSET_VOLT 0xA8 0d63 0d63 16 -ADC_MAXIMUM_VOLT 0xA9 0d839 0d839 16 -TEMPSENS_IDEAL_FACTOR 0xAA 0d1225 0d1225 16 +VOLTAGE_TRIM_DIG 0xA2 0b10000 0b10000 5 +VOLTAGE_TRIM_ANA 0xA3 0b10000 0b10000 5 +CLK_DATA_DELAY_DATA_DELAY 0xA4 0b0000 0b0000 4 +CLK_DATA_DELAY_CLK_DELAY 0xA5 0b0000 0b0000 4 +CLK_DATA_DELAY_CLK_PHASE 0xA6 0b0 0b0 1 +MONITOR_CONFIG_ADC 0xA7 0d5 0d5 6 +MONITOR_CONFIG_BG 0xA8 0d12 0d12 5 + +ADC_OFFSET_VOLT 0xA9 0d63 0d63 16 +ADC_MAXIMUM_VOLT 0xAA 0d839 0d839 16 +TEMPSENS_IDEAL_FACTOR 0xAB 0d1225 0d1225 16 *------------------------------------------------------------------------------------------------------- PIXELCONFIGURATION diff --git a/src/CMSITminiDAQ.cc b/src/CMSITminiDAQ.cc index a0d2f68ebefcef4e59adb01ceb9856e42607f79c..69dee0f7989f28b6a1fcdb9b177cff3b6522da66 100644 --- a/src/CMSITminiDAQ.cc +++ b/src/CMSITminiDAQ.cc @@ -87,13 +87,6 @@ void readBinaryData(std::string binaryFile, SystemController& mySysCntr, std::ve int main(int argc, char** argv) { - // ######################## - // # Configure the logger # - // ######################## - el::Configurations conf("../settings/logger.conf"); - conf.set(el::Level::Global, el::ConfigurationType::Format, "|%thread|%levshort| %msg"); - el::Loggers::reconfigureAllLoggers(conf); - // ############################# // # Initialize command parser # // ############################# @@ -103,32 +96,32 @@ int main(int argc, char** argv) cmd.setHelpOption("h", "help", "Print this help page"); - cmd.defineOption("file", "Hardware description file. Default value: CMSIT.xml", CommandLineProcessing::ArgvParser::OptionRequiresValue); + cmd.defineOption("file", "Hardware description file", CommandLineProcessing::ArgvParser::OptionRequiresValue); cmd.defineOptionAlternative("file", "f"); cmd.defineOption("calib", "Which calibration to run [latency pixelalive noise scurve gain threqu gainopt thrmin thradj " - "injdelay clockdelay physics eudaq prbstime prbsframes]. Default: pixelalive", + "injdelay clockdelay physics eudaq prbstime prbsframes]", CommandLineProcessing::ArgvParser::OptionRequiresValue); cmd.defineOptionAlternative("calib", "c"); - cmd.defineOption("binary", "Binary file to decode.", CommandLineProcessing::ArgvParser::OptionRequiresValue); + cmd.defineOption("binary", "Binary file to decode", CommandLineProcessing::ArgvParser::OptionRequiresValue); cmd.defineOptionAlternative("binary", "b"); - cmd.defineOption("prog", "Program the system components.", CommandLineProcessing::ArgvParser::NoOptionAttribute); + cmd.defineOption("prog", "Just program the system components", CommandLineProcessing::ArgvParser::NoOptionAttribute); cmd.defineOptionAlternative("prog", "p"); - cmd.defineOption("sup", "Run in producer(Middleware) - consumer(DQM) mode.", CommandLineProcessing::ArgvParser::NoOptionAttribute); + cmd.defineOption("sup", "Run in producer(Middleware) - consumer(DQM) mode", CommandLineProcessing::ArgvParser::NoOptionAttribute); cmd.defineOptionAlternative("sup", "s"); - cmd.defineOption("eudaqRunCtr", "EUDA-IT run control address. Defaut: tcp://localhost:44000", CommandLineProcessing::ArgvParser::OptionRequiresValue); + cmd.defineOption("eudaqRunCtr", "EUDAQ-IT run control address [e.g. tcp://localhost:44000]", CommandLineProcessing::ArgvParser::OptionRequiresValue); cmd.defineOption("reset", "Reset the backend board", CommandLineProcessing::ArgvParser::NoOptionAttribute); cmd.defineOptionAlternative("reset", "r"); - cmd.defineOption("capture", "Capture communication with board (extension .raw).", CommandLineProcessing::ArgvParser::OptionRequiresValue); + cmd.defineOption("capture", "Capture communication with board (extension .raw)", CommandLineProcessing::ArgvParser::OptionRequiresValue); - cmd.defineOption("replay", "Replay previously captured communication (extension .raw).", CommandLineProcessing::ArgvParser::OptionRequiresValue); + cmd.defineOption("replay", "Replay previously captured communication (extension .raw)", CommandLineProcessing::ArgvParser::OptionRequiresValue); int result = cmd.parse(argc, argv); if(result != CommandLineProcessing::ArgvParser::NoParserError) @@ -150,8 +143,8 @@ int main(int argc, char** argv) // #################### // # Retrieve options # // #################### - std::string configFile = cmd.foundOption("file") == true ? cmd.optionValue("file") : "CMSIT.xml"; - std::string whichCalib = cmd.foundOption("calib") == true ? cmd.optionValue("calib") : "pixelalive"; + std::string configFile = cmd.foundOption("file") == true ? cmd.optionValue("file") : ""; + std::string whichCalib = cmd.foundOption("calib") == true ? cmd.optionValue("calib") : ""; std::string binaryFile = cmd.foundOption("binary") == true ? cmd.optionValue("binary") : ""; bool program = cmd.foundOption("prog") == true ? true : false; bool supervisor = cmd.foundOption("sup") == true ? true : false; @@ -162,6 +155,18 @@ int main(int argc, char** argv) RegManager::enableReplay(cmd.optionValue("replay")); std::string eudaqRunCtr = cmd.foundOption("eudaqRunCtr") == true ? cmd.optionValue("eudaqRunCtr") : "tcp://localhost:44000"; + // ######################## + // # Configure the logger # + // ######################## + std::string fileName("logs/CMSITminiDAQ" + RD53Shared::fromInt2Str(runNumber)); + if(whichCalib != "") fileName += "_" + whichCalib; + fileName += ".log"; + el::Configurations conf(std::string(std::getenv("PH2ACF_BASE_DIR")) + "/settings/logger.conf"); + conf.set(el::Level::Global, el::ConfigurationType::Format, "|%thread|%levshort| %msg"); + conf.set(el::Level::Global, el::ConfigurationType::Filename, fileName); + el::Loggers::reconfigureAllLoggers(conf); + // el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Filename, fileName); + // ###################### // # Supervisor section # // ###################### @@ -182,7 +187,7 @@ int main(int argc, char** argv) else if(runControllerPid == 0) { char* argv[] = {(char*)"RunController", NULL}; - execv((std::string(getenv("PH2ACF_BASE_DIR")) + "/bin/RunController").c_str(), argv); + execv((std::string(std::getenv("PH2ACF_BASE_DIR")) + "/bin/RunController").c_str(), argv); LOG(ERROR) << BOLDRED << "I can't run RunController, error occured" << RESET; exit(EXIT_FAILURE); } @@ -309,11 +314,6 @@ int main(int argc, char** argv) LOG(INFO) << BOLDMAGENTA << "@@@ Initializing the Hardware @@@" << RESET; mySysCntr.Configure(configFile); LOG(INFO) << BOLDMAGENTA << "@@@ Hardware initialization done @@@" << RESET; - if(program == true) - { - LOG(INFO) << BOLDMAGENTA << "@@@ End of CMSIT miniDAQ @@@" << RESET; - exit(EXIT_SUCCESS); - } } std::cout << std::endl; @@ -602,7 +602,7 @@ int main(int argc, char** argv) mySysCntr.fReadoutChipInterface->WriteChipReg(static_cast<RD53*>(cChip), "SER_SEL_OUT", 1, true); } } - else + else if(program == false) { LOG(ERROR) << BOLDRED << "Option not recognized: " << BOLDYELLOW << whichCalib << RESET; exit(EXIT_FAILURE); diff --git a/tools/RD53ClockDelay.cc b/tools/RD53ClockDelay.cc index 038878fe0d61aee81800a209c6abbf3164923486..2f824d1028b291a4d9fdec33d9ce4906458c0182 100644 --- a/tools/RD53ClockDelay.cc +++ b/tools/RD53ClockDelay.cc @@ -217,11 +217,11 @@ void ClockDelay::draw() histos->book(fResultFile, *fDetectorContainer, fSettingsMap); ClockDelay::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53Gain.cc b/tools/RD53Gain.cc index e2e0041eeab85312e0695d72185557aac3ff8231..ffdbc3ee5a4184a9bc3104a36309bffe79c48838 100644 --- a/tools/RD53Gain.cc +++ b/tools/RD53Gain.cc @@ -209,14 +209,11 @@ void Gain::draw(bool saveData) histos->book(fResultFile, *fDetectorContainer, fSettingsMap); Gain::fillHisto(); histos->process(); - - if(saveData == true) - { - this->WriteRootFile(); - this->CloseResultFile(); - } + if(saveData == true) this->WriteRootFile(); if(doDisplay == true) myApp->Run(true); + + if(saveData == true) this->CloseResultFile(); #endif // ##################### diff --git a/tools/RD53GainOptimization.cc b/tools/RD53GainOptimization.cc index 728387a1c14f0883e63cbd1cdabf83aa11d0da42..88e4f97d9b5cc581f1681ed1660f5c6a30390d5b 100644 --- a/tools/RD53GainOptimization.cc +++ b/tools/RD53GainOptimization.cc @@ -166,11 +166,11 @@ void GainOptimization::draw() histos->book(fResultFile, *fDetectorContainer, fSettingsMap); GainOptimization::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53InjectionDelay.cc b/tools/RD53InjectionDelay.cc index 291b64052f1917414236faba4e3c87e5e3a6b5e9..de7f060eec5a7a9ff4e17ee376ed8d5fe961a8d2 100644 --- a/tools/RD53InjectionDelay.cc +++ b/tools/RD53InjectionDelay.cc @@ -215,11 +215,11 @@ void InjectionDelay::draw() histos->book(fResultFile, *fDetectorContainer, fSettingsMap); InjectionDelay::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53Latency.cc b/tools/RD53Latency.cc index 9bcb200ef593e6931cd3f2148feef4eee4eee3a7..df4185ff7f2bae2eb5865f3a78f9a855e5e99c09 100644 --- a/tools/RD53Latency.cc +++ b/tools/RD53Latency.cc @@ -150,11 +150,11 @@ void Latency::draw(bool saveData) histos->book(fResultFile, *fDetectorContainer, fSettingsMap); Latency::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53Physics.cc b/tools/RD53Physics.cc index 582634c293dc79649ee84b5a3604ddda6f1db500..205514dbfe4920dec46bb3e93df05817c17a76ba 100644 --- a/tools/RD53Physics.cc +++ b/tools/RD53Physics.cc @@ -174,11 +174,11 @@ void Physics::draw() histos->book(fResultFile, *fDetectorContainer, fSettingsMap); Physics::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53PixelAlive.cc b/tools/RD53PixelAlive.cc index 00b303bb33cf4bfa91fc663edccaa86c16983c54..2423d2720444bfc98eb070e96195ec0fea274482 100644 --- a/tools/RD53PixelAlive.cc +++ b/tools/RD53PixelAlive.cc @@ -183,14 +183,11 @@ void PixelAlive::draw(bool saveData) histos->book(fResultFile, *fDetectorContainer, fSettingsMap); PixelAlive::fillHisto(); histos->process(); - - if(saveData == true) - { - this->WriteRootFile(); - this->CloseResultFile(); - } + if(saveData == true) this->WriteRootFile(); if(doDisplay == true) myApp->Run(true); + + if(saveData == true) this->CloseResultFile(); #endif } diff --git a/tools/RD53SCurve.cc b/tools/RD53SCurve.cc index 5c75a2817590ef580af1e47991c90660ed34fdea..6e12f1548059ba2a20400180e19eab8ae8695935 100644 --- a/tools/RD53SCurve.cc +++ b/tools/RD53SCurve.cc @@ -206,11 +206,11 @@ void SCurve::draw() histos->book(fResultFile, *fDetectorContainer, fSettingsMap); SCurve::fillHisto(); histos->process(); - this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif // ##################### diff --git a/tools/RD53ThrAdjustment.cc b/tools/RD53ThrAdjustment.cc index 8051469c431018f5491e2143f26aeb18ebae5c03..30e5e996c4bbb06b2e7a36e8d330e51880545e1d 100644 --- a/tools/RD53ThrAdjustment.cc +++ b/tools/RD53ThrAdjustment.cc @@ -166,9 +166,10 @@ void ThrAdjustment::draw() PixelAlive::draw(false); this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53ThrEqualization.cc b/tools/RD53ThrEqualization.cc index c344e599c56b5d3c38e1ed697d71427c5b2e5d4e..c1aba0e98aeb389165118ad8284712d51cd8183d 100644 --- a/tools/RD53ThrEqualization.cc +++ b/tools/RD53ThrEqualization.cc @@ -211,9 +211,10 @@ void ThrEqualization::draw() PixelAlive::draw(false); this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif } diff --git a/tools/RD53ThrMinimization.cc b/tools/RD53ThrMinimization.cc index 86e592c11cd8f74fa54b8b37765b6313fa52398c..7d692bc9f279bee5c45e8e2c9cfa083dc6416f88 100644 --- a/tools/RD53ThrMinimization.cc +++ b/tools/RD53ThrMinimization.cc @@ -164,9 +164,10 @@ void ThrMinimization::draw() PixelAlive::draw(false); this->WriteRootFile(); - this->CloseResultFile(); if(doDisplay == true) myApp->Run(true); + + this->CloseResultFile(); #endif }