Skip to content

Commit

Permalink
Changes at H2 on production PC
Browse files Browse the repository at this point in the history
  • Loading branch information
HGCAL DAQ committed Jun 17, 2018
1 parent b1a518d commit c79c845
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 25 deletions.
2 changes: 1 addition & 1 deletion main/lib/src/DataCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down
42 changes: 38 additions & 4 deletions monitors/cmshgcal_onlinemon/src/HexagonHistos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");


Expand Down Expand Up @@ -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");


Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions producers/cmshgcal/conf/AllInOneProducer.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[RunControl]

RunEventLimit = 10000
RunEventLimit = 50000

[DataCollector]
# "data" is now a link to "/disk2_2TB/July2017_TB_data_eudaq" directory
Expand All @@ -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

Expand Down Expand Up @@ -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
slope_y = 0.2
8 changes: 5 additions & 3 deletions producers/cmshgcal/src/HGCalController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<int,ipbus::IpbusHwController*>::iterator it=m_rdout_orms.begin(); it!=m_rdout_orms.end(); ++it )
if( it->second->ReadRegister("BLOCK_READY")!=1 )
Expand All @@ -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<m_triggerId ){
Expand Down
21 changes: 12 additions & 9 deletions producers/cmshgcal/src/HexaBoardConverterPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const int nSCA=13;
// Size of ZS data (per channel)
const char hitSizeZS = 33;

const int thresh_HGTS3over0 = 20;
const int thresh_HGTS3over5 = 20;
const int thresh_HGTS3over0 = 5;
const int thresh_HGTS3over5 = 5;

namespace eudaq {

Expand Down Expand Up @@ -563,15 +563,18 @@ namespace eudaq {
}
else if (m_runMode==2){
// For the last hexaboard in the last readout board (4-7) always do a TOA selection
if ( board_id == 4 && hexa == 7)
if ( board_id == 4 && hexa == 7){
if (! (decoded[ski][chArrPos] & 0x1000))
continue;
// For the rest of them, do MIP selection
if (! (hg_TS3over0 > 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));
Expand Down
8 changes: 7 additions & 1 deletion producers/cmshgcal/src/IpbusHwController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c79c845

Please sign in to comment.