From c79c8452e78787c602a3269a29b9680d2dc52572 Mon Sep 17 00:00:00 2001 From: HGCAL DAQ Date: Sun, 17 Jun 2018 14:16:53 +0200 Subject: [PATCH] Changes at H2 on production PC --- main/lib/src/DataCollector.cc | 2 +- .../cmshgcal_onlinemon/src/HexagonHistos.cc | 42 +++++++++++++++++-- producers/cmshgcal/conf/AllInOneProducer.conf | 14 +++---- producers/cmshgcal/src/HGCalController.cc | 8 ++-- .../cmshgcal/src/HexaBoardConverterPlugin.cc | 21 ++++++---- producers/cmshgcal/src/IpbusHwController.cc | 8 +++- 6 files changed, 70 insertions(+), 25 deletions(-) diff --git a/main/lib/src/DataCollector.cc b/main/lib/src/DataCollector.cc index 40f0ea890e..b8cbf1d4d6 100644 --- a/main/lib/src/DataCollector.cc +++ b/main/lib/src/DataCollector.cc @@ -209,7 +209,7 @@ namespace eudaq { continue; if (m_buffer[i].events.front()->GetRunNumber() != m_runnumber) { EUDAQ_ERROR("Run number mismatch in event " + - to_string(ev.GetEventNumber())); + to_string(ev.GetEventNumber()) + " run number = " + to_string(m_runnumber) + " run number attached to event = " + to_string(m_buffer[i].events.front()->GetRunNumber())); } if (m_ireceived[i] != "SlowProducer") { if ((m_buffer[i].events.front()->GetEventNumber() != m_eventnumber) && diff --git a/monitors/cmshgcal_onlinemon/src/HexagonHistos.cc b/monitors/cmshgcal_onlinemon/src/HexagonHistos.cc index ca10a7dd66..3d120d283f 100644 --- a/monitors/cmshgcal_onlinemon/src/HexagonHistos.cc +++ b/monitors/cmshgcal_onlinemon/src/HexagonHistos.cc @@ -65,12 +65,12 @@ HexagonHistos::HexagonHistos(eudaq::StandardPlane p, RootMonitor *mon) sprintf(out, "%s-%i, Signal at LG", _sensor.c_str(), _id); sprintf(out2, "h_sigAdcLG_TS3_%s_%i", _sensor.c_str(), _id); - _sigAdcLG = new TH1I(out2, out, 100, -50, 500); + _sigAdcLG = new TH1I(out2, out, 200, -50, 500); SetHistoAxisLabelx(_sigAdcLG, "LG (peak) - PED, ADC counts"); sprintf(out, "%s-%i, Signal at HG", _sensor.c_str(), _id); sprintf(out2, "h_sigAdcHG_TS3_%s_%i", _sensor.c_str(), _id); - _sigAdcHG = new TH1I(out2, out, 100, -100, 2600); + _sigAdcHG = new TH1I(out2, out, 500, -100, 2600); SetHistoAxisLabelx(_sigAdcHG, "HG (peak) - PED, ADC counts"); @@ -119,12 +119,12 @@ HexagonHistos::HexagonHistos(eudaq::StandardPlane p, RootMonitor *mon) // --------- sprintf(out, "%s-%i Waveform LG", _sensor.c_str(), _id); sprintf(out2, "h_waveform_LG_%s_%i", _sensor.c_str(), _id); - _waveformLG = new TH2I(out2, out, 2*nSCA, 0, nSCA, 100, 0, 3000); + _waveformLG = new TH2I(out2, out, 2*nSCA, 0, nSCA, 100, 0, 1500); SetHistoAxisLabels(_waveformLG, "Time Sample of 25 ns", "LG ADC"); sprintf(out, "%s-%i, Waveform HG", _sensor.c_str(), _id); sprintf(out2, "h_waveform_HG_%s_%i", _sensor.c_str(), _id); - _waveformHG = new TH2I(out2, out, 2*nSCA, 0, nSCA, 100, 0, 4000); + _waveformHG = new TH2I(out2, out, 2*nSCA, 0, nSCA, 100, 0, 2600); SetHistoAxisLabels(_waveformHG, "Time Sample of 25 ns", "HG ADC"); @@ -217,9 +217,43 @@ void HexagonHistos::Fill(const eudaq::StandardPlane &plane, int evNumber) { continue; // Masking for June 2018 beam tests: + + // Mask 3, 44 in many modules if ( (_sensor=="HexaBoard-RDB1" && _id==1 ) && pixel_x==3 && pixel_y==44) continue; + if ( (_sensor=="HexaBoard-RDB1" && _id==2 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB1" && _id==3 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB2" && _id==0 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB2" && _id==4 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB2" && _id==6 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB2" && _id==7 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB3" && _id==0 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB3" && _id==3 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB3" && _id==6 ) && + pixel_x==3 && pixel_y==44) + continue; + if ( (_sensor=="HexaBoard-RDB4" && _id==1 ) && + pixel_x==3 && pixel_y==44) + continue; + + // others if ( (_sensor=="HexaBoard-RDB2" && _id==5 ) && pixel_x==3 && pixel_y==12) continue; diff --git a/producers/cmshgcal/conf/AllInOneProducer.conf b/producers/cmshgcal/conf/AllInOneProducer.conf index c4b8dd5fd8..3fed31fa6e 100644 --- a/producers/cmshgcal/conf/AllInOneProducer.conf +++ b/producers/cmshgcal/conf/AllInOneProducer.conf @@ -1,6 +1,6 @@ [RunControl] -RunEventLimit = 10000 +RunEventLimit = 50000 [DataCollector] # "data" is now a link to "/disk2_2TB/July2017_TB_data_eudaq" directory @@ -19,7 +19,7 @@ UhalLogLevel = 5 TimeToWaitAtEndOfRun = 1000 saveRawData = false checkCRC = false -ThrowFirstTrigger=1 +ThrowFirstTrigger=0 DoCompression = 1 CompressionLevel = 5 #0 is no compression (but still using boost gzip library); 9 is best compression @@ -100,14 +100,14 @@ dwc2_left_channel = 4 dwc2_right_channel = 5 dwc2_down_channel = 6 dwc2_up_channel = 7 -dwc3_left_channel = 8 -dwc3_right_channel = 9 +dwc3_left_channel = 9 +dwc3_right_channel = 8 dwc3_down_channel = 10 dwc3_up_channel = 11 -dwc4_left_channel = 12 -dwc4_right_channel = 13 +dwc4_left_channel = 13 +dwc4_right_channel = 12 dwc4_down_channel = 14 dwc4_up_channel = 15 slope_x = 0.2 -slope_y = 0.2 \ No newline at end of file +slope_y = 0.2 diff --git a/producers/cmshgcal/src/HGCalController.cc b/producers/cmshgcal/src/HGCalController.cc index ddc0638086..74ab363c41 100644 --- a/producers/cmshgcal/src/HGCalController.cc +++ b/producers/cmshgcal/src/HGCalController.cc @@ -132,9 +132,9 @@ void HGCalController::startrun(int runId) void HGCalController::stoprun() { - m_mutex.lock(); + //m_mutex.lock(); m_state=CONFED; - m_mutex.unlock(); + //m_mutex.unlock(); boost::this_thread::sleep( boost::posix_time::microseconds(m_config.timeToWaitAtEndOfRun) ); //wait sometime until run thread is done m_mutex.lock(); m_rootfile->Write(); @@ -167,6 +167,7 @@ void HGCalController::run() eventTimer.start(); rdoutreadyTimer.start(); while(1){ + if( m_state!=RUNNING ) break; bool rdout_ready=true; for( std::map::iterator it=m_rdout_orms.begin(); it!=m_rdout_orms.end(); ++it ) if( it->second->ReadRegister("BLOCK_READY")!=1 ) @@ -177,8 +178,9 @@ void HGCalController::run() } else break; } + if( m_state!=RUNNING ) {m_mutex.unlock(); break;} rdoutreadyTimer.stop(); - std::cout << "\t HGCalController received block ready" << std::endl; + std::cout << "\t HGCalController received block ready\a" << std::endl; uint32_t trid=m_rdout_orms.begin()->second->ReadRegister("TRIG_COUNT"); if( trid thresh_HGTS3over0 - && hg_TS3over5 > thresh_HGTS3over5 - && hg_TS7 - hg_TS0 < 0 - ) ) - continue; + } + else { + // For the rest of them, do MIP selection + if (! (hg_TS3over0 > thresh_HGTS3over0 + && hg_TS3over5 > thresh_HGTS3over5 + && hg_TS7 - hg_TS0 < 0 + ) ) + continue; + } } else EUDAQ_WARN("This run-mode is not yet implemented: "+eudaq::to_string(m_runMode)); diff --git a/producers/cmshgcal/src/IpbusHwController.cc b/producers/cmshgcal/src/IpbusHwController.cc index 916bff20ca..b311e12f31 100644 --- a/producers/cmshgcal/src/IpbusHwController.cc +++ b/producers/cmshgcal/src/IpbusHwController.cc @@ -42,9 +42,15 @@ namespace ipbus{ void IpbusHwController::SetRegister( const std::string &name, uint32_t val ) { try { - m_hw->getNode(name).write( val ); + uhal::ValHeader vhead = m_hw->getNode(name).write( val ); m_hw->dispatch(); + while(1){ + if( vhead.valid() ) break; + else + std::cout << "ValHeader is not valid" << std::endl; + } } catch (...) { + std::cout << "ValHeader could not be valid (strange to reach this point)" << std::endl; return; } }