Skip to content

Commit

Permalink
Merge pull request #52 from HGCDAQ/Shift-H6-October
Browse files Browse the repository at this point in the history
Merging the code used for H6 data-taking
  • Loading branch information
andreypz authored Oct 24, 2017
2 parents ea0aaaa + 2ee2cc3 commit e21b92d
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 152 deletions.
4 changes: 2 additions & 2 deletions STARTRUN
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ elif [[ $1 == "testrpi" ]]; then
elif [[ $1 == "rpi" ]]; then
script=./producers/cmshgcal/STARTRUN_RPI
elif [[ $1 == "cmshgcal" ]]; then
script=./producers/cmshgcal/STARTRUN
script=./producers/cmshgcal/STARTRUN_tmp
elif [[ $1 == "cmshgcal_with_dwc" ]]; then
script=./producers/cmshgcal/STARTRUN_WITH_DWC
elif [[ $1 == "dwc" ]]; then
Expand All @@ -21,7 +21,7 @@ elif [[ $1 == "ahcal" ]]; then
elif [[ $1 == "all" ]]; then
script=./producers/cmshgcal/STARTRUN_ALL
elif [[ $1 == "ped" ]]; then
script=./producers/cmshgcal/STARTRUN_PED
script=./producers/cmshgcal/STARTRUN_tmp
else
# default
echo "This producer is not known to me: ${1}. Sorry."
Expand Down
3 changes: 1 addition & 2 deletions producers/cmshgcal/STARTRUN_ALL
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ printf '\033[22;33m\t caliceProducer-scintillator \033[0m \n'
flog="../logs/Run${NEWRUNNUM}_AHCALProducer_$dt.log"
nohup ./AHCALProducer.exe -n CaliceSc -r tcp://$TLUIP:$RCPORT > $flog 2>&1 &
printf "The logs from the AHCALProducer are in $flog file. \n"

sleep 2
#sleep 2

######################################################################
# wire chamber Producer
Expand Down
4 changes: 2 additions & 2 deletions producers/cmshgcal/STARTRUN_RPI
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ printf '\033[22;33m\t cms hgcal *Rpi* Producer \033[0m \n'

#xterm -sb -sl 1000 -geom 80x500-200-900 -fn fixed -T "RPI Producer 2" -e './RpiProducer.exe -n RPI-2 -r tcp://$HOSTIP:$RCPORT' &

flog="../logs/Run${NEWRUNNUM}_RpiProducer_RDB2_$dt.log"
nohup ./RpiProducer.exe -n RPI-BRD2 -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 &
flog="../logs/Run${NEWRUNNUM}_RpiProducer_RDB3_$dt.log"
nohup ./RpiProducer.exe -n RPI-BRD3 -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 &
printf "The logs from the RPiProducer are in $flog file. \n"

#flog="../logs/Run${NEWRUNNUM}_RpiProducer_RDB3_$dt.log"
Expand Down
104 changes: 4 additions & 100 deletions producers/cmshgcal/conf/AllInOneProducer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SaveLevel = EXTRA
PrintLevel = DEBUG

[Producer.CMS-HGCAL]
UhalLogLevel = 5
UhalLogLevel = 3

DataBlockSize = 30787
AcquisitionMode = 1 #0 for DEBUG mode with print out and pause, 1 for beam test
Expand Down Expand Up @@ -84,7 +84,7 @@ triggerMatchMode = 1
emptyEventEnable = 1
edgeDetectionMode = 2
timeResolution = 3
maxHitsPerEvent = 9
maxHitsPerEvent = 129
enabledChannels = 0xFFFF
windowWidth = 0x40
windowOffset = -20
Expand Down Expand Up @@ -114,8 +114,8 @@ channel_15 = 1

dwc1_left_channel = 0
dwc1_right_channel = 1
dwc1_down_channel = 2
dwc1_up_channel = 3
dwc1_down_channel = 3
dwc1_up_channel = 2
dwc2_left_channel = 4
dwc2_right_channel = 5
dwc2_down_channel = 6
Expand All @@ -131,99 +131,3 @@ dwc4_up_channel = 8

slope_x = 0.2
slope_y = 0.2


[Producer.RPI-BRD2]
RDBOARD = 2
#RPI_1_IP = '127.0.0.1'
# svhgcal01:
#RPI_1_IP = '128.141.151.253'
# Main RPI on the ReadOut board::
RPI_1_IP = '192.168.222.112'
# Spare RPI:
#RPI_1_IP = '192.168.222.99'

# Other addresses for tests:
#RPI_1_IP = '128.141.196.154'
#RPI_1_IP = '128.141.196.225'
#RPI_1_IP = '128.141.149.196'

# These should not be changed:
portTCP = '55211'
portUDP = '55212'

# Instead of IP addresses, we use aliases for SSH for clarity. The alias-to-IP-address correspondence is defined here: $HOME/.ssh/config
piSynch_IP = "piS"
piRDOUT1_IP = "pi1"
piRDOUT2_IP = "pi2"
piRDOUT3_IP = "pi3"
piRDOUT4_IP = "pi4"

# Mask for which RDOUT boards to configure, as a string of 1s and 0s. 1 = enable, 0 = disable; leftmost digit is assumed to correspond to the board with IP = piRDOUT1_IP. For example, "0010" enables configuring only piRDOUT3, "1100" configures piRDOUT1 and piRDOUT2, etc.
RDOUTMask = "0000"

# Hardcoded SKIROC configuration strings for individual RDOUT boards. The script is executed in the following format:
# source targetDirPath_Skirocs/resetConfiguration_Skirocs_exe_fileName INDICES_STRING
# where INDICES_STRING is the following:
# skirocIndices_RDOUT1 = "1 3 2 4"
# skirocIndices_RDOUT2 = "1 3 2 4"
# skirocIndices_RDOUT3 = "1 3 2 4"
# skirocIndices_RDOUT4 = "1 3 2 4"
skirocIndices_RDOUT1 = " "
skirocIndices_RDOUT2 = " "
skirocIndices_RDOUT3 = "0 1 2 3 4"
skirocIndices_RDOUT4 = " "

sourceDirPath_Synch = "/home/daq/forConfiguration_EUDAQ/sourceDir_Synch"
targetDirPath_Synch = "/home/pi/forConfiguration_EUDAQ/targetDir_Synch"
resetConfiguration_Synch_exe_fileName = "resetConfiguration_Synch.sh"
sourceDirPath_Readout = "/home/daq/forConfiguration_EUDAQ/sourceDir_Readout"
targetDirPath_Readout = "/home/pi/forConfiguration_EUDAQ/targetDir_Readout"
resetConfiguration_Readout_exe_fileName = "resetConfiguration_Readout.sh"
sourceDirPath_Skirocs = "/home/daq/forConfiguration_EUDAQ/sourceDir_Skirocs"
targetDirPath_Skirocs = "/home/pi/forConfiguration_EUDAQ/targetDir_Skirocs"
resetConfiguration_Skirocs_exe_fileName = "resetConfiguration_Skirocs.sh"


[Producer.RPI-BRD3]

RDBOARD = 3

# Main RPI on the ReadOut board::
RPI_1_IP = '192.168.222.113'

# These should not be changed:
portTCP = '55511'
portUDP = '55512'

# Instead of IP addresses, we use aliases for SSH for clarity. The alias-to-IP-address correspondence is defined here: $HOME/.ssh/config
piSynch_IP = "piS"
piRDOUT1_IP = "pi1"
piRDOUT2_IP = "pi2"
piRDOUT3_IP = "pi3"
piRDOUT4_IP = "pi4"

# Mask for which RDOUT boards to configure, as a string of 1s and 0s. 1 = enable, 0 = disable; leftmost digit is assumed to correspond to the board with IP = piRDOUT1_IP. For example, "0010" enables configuring only piRDOUT3, "1100" configures piRDOUT1 and piRDOUT2, etc.
RDOUTMask = "0000"

# Hardcoded SKIROC configuration strings for individual RDOUT boards. The script is executed in the following format:
# source targetDirPath_Skirocs/resetConfiguration_Skirocs_exe_fileName INDICES_STRING
# where INDICES_STRING is the following:
# skirocIndices_RDOUT1 = "1 3 2 4"
# skirocIndices_RDOUT2 = "1 3 2 4"
# skirocIndices_RDOUT3 = "1 3 2 4"
# skirocIndices_RDOUT4 = "1 3 2 4"
skirocIndices_RDOUT1 = " "
skirocIndices_RDOUT2 = " "
skirocIndices_RDOUT3 = "0 1 2 3 4"
skirocIndices_RDOUT4 = " "

sourceDirPath_Synch = "/home/daq/forConfiguration_EUDAQ/sourceDir_Synch"
targetDirPath_Synch = "/home/pi/forConfiguration_EUDAQ/targetDir_Synch"
resetConfiguration_Synch_exe_fileName = "resetConfiguration_Synch.sh"
sourceDirPath_Readout = "/home/daq/forConfiguration_EUDAQ/sourceDir_Readout"
targetDirPath_Readout = "/home/pi/forConfiguration_EUDAQ/targetDir_Readout"
resetConfiguration_Readout_exe_fileName = "resetConfiguration_Readout.sh"
sourceDirPath_Skirocs = "/home/daq/forConfiguration_EUDAQ/sourceDir_Skirocs"
targetDirPath_Skirocs = "/home/pi/forConfiguration_EUDAQ/targetDir_Skirocs"
resetConfiguration_Skirocs_exe_fileName = "resetConfiguration_Skirocs.sh"
4 changes: 2 additions & 2 deletions producers/cmshgcal/conf/RpiProducer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RPI_1_IP = "127.0.0.1"
# svhgcal01:
#RPI_1_IP = '128.141.151.253'
# Main RPI on the ReadOut board::
#RPI_1_IP = '192.168.222.3'
#RPI_1_IP = '192.168.222.113'
# Spare RPI:
#RPI_1_IP = '192.168.222.99'

Expand Down Expand Up @@ -51,7 +51,7 @@ resetConfiguration_Skirocs_exe_fileName = "resetConfiguration_Skirocs.sh"

[Producer.RPI-BRD3]
RDBOARD = 3
RPI_1_IP = "127.0.0.1"
RPI_1_IP = "192.168.222.113"

portTCP = "55311"
portUDP = "55312"
Expand Down
63 changes: 38 additions & 25 deletions producers/cmshgcal/onlinemon/src/HexagonHistos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,59 +243,72 @@ void HexagonHistos::Fill(const eudaq::StandardPlane &plane, int evNumber) {
// ----- Maskig noisy channels ----
// These are noisy pixels in every hexaboard. Let's just mask them from DQM.
// Upd Sept. 2017: after disabling LED, those are not noisy anymore in all module, except "May"
if ( (_sensor=="HexaBoard-RDB1" && _id==4 ) &&
if ( (_sensor=="HexaBoard-RDB1" && _id==0 ) &&
pixel_x==3 && (pixel_y==32 || pixel_y==48))
continue;

// May module:
if ( (_sensor=="HexaBoard-RDB1" && _id==0 ) &&
( (pixel_x==0 && pixel_y==0 ) || (pixel_x==0 && pixel_y==2 ) ||
(pixel_x==0 && pixel_y==4 ) || (pixel_x==0 && pixel_y==6 ) ||
(pixel_x==1 && pixel_y==0 ) ))
continue;

// Module #63
if ( (_sensor=="HexaBoard-RDB1" && _id==3 ) &&
pixel_x==0 && pixel_y==22 )
( pixel_x==0 && pixel_y==58 ) || ( pixel_x==0 && pixel_y==22 ) )
continue;


// Module of May
// Module #75
if ( (_sensor=="HexaBoard-RDB1" && _id==4 ) &&
( (pixel_x==0 && pixel_y==0 ) || (pixel_x==0 && pixel_y==2 ) || (pixel_x==1 && pixel_y==0 ) ))
continue;


// Modules #53,55,63,62
if ( (_sensor=="HexaBoard-RDB1" && (_id==0 || _id==1 || _id==3 || _id==5) ) &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #38
if ( _sensor=="HexaBoard-RDB2" && _id==2 &&
if ( _sensor=="HexaBoard-RDB2" && _id==0 &&
( pixel_x==0 && pixel_y==58 ) || ( pixel_x==0 && pixel_y==22 ) )
continue;

// Module #42
if ( _sensor=="HexaBoard-RDB2" && _id==3 &&
( pixel_x==1 && pixel_y==4 ) )
// Module #46
if ( _sensor=="HexaBoard-RDB2" && _id==2 &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #62
if ( _sensor=="HexaBoard-RDB2" && _id==5 &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #39
if ( _sensor=="HexaBoard-RDB3" && _id==0 &&
( pixel_x==0 && pixel_y==22 ) )
// Module #53:
if ( _sensor=="HexaBoard-RDB2" && _id==1 &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #55:
if ( _sensor=="HexaBoard-RDB2" && _id==6 &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// All Modules on readout board 3
if ( _sensor=="HexaBoard-RDB3" &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #64
// Module #42
if ( _sensor=="HexaBoard-RDB3" && _id==3 &&
( pixel_x==1 && pixel_y==4 ) )
continue;

// Module #39
if ( _sensor=="HexaBoard-RDB3" && _id==4 &&
( pixel_x==0 && pixel_y==58 ) || ( pixel_x==0 && pixel_y==22 ) )
( pixel_x==0 && pixel_y==22 ) )
continue;

// Module #64
if ( _sensor=="HexaBoard-RDB3" && _id==6 &&
( pixel_x==0 && pixel_y==22 ) )
continue;

// These are bad on some boards:
//if ( ( _sensor=="HexaBoard-RDB1" && _id==1 ||
// _sensor=="HexaBoard-RDB2" && _id==1 ||
// _sensor=="HexaBoard-RDB0" && _id==0 ) &&
//continue;

// -------- end masking -------------

//std::cout<<" We are getting a pixel with pix="<<pix
Expand Down
33 changes: 21 additions & 12 deletions producers/cmshgcal/src/HGCalProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class HGCalProducer : public eudaq::Producer {
if (m_state == STATE_RUNNING) {
if( !m_triggerController->checkState( (STATES)RDOUT_RDY ) ) continue;
if( m_ev==m_triggerController->eventNumber() ) continue;

boost::timer::cpu_timer timerReadout;
boost::timer::cpu_times times;
eudaq::RawDataEvent ev(EVENT_TYPE,m_run,m_ev);
Expand Down Expand Up @@ -203,9 +204,10 @@ class HGCalProducer : public eudaq::Producer {

// Let's start the scripts needed to be run on RPIs



EUDAQ_INFO("Starting sync_debug.exe on piS");

int executionStatus = -99;

executionStatus = system("ssh -T piS \" sudo killall sync_debug.exe \"");
Expand All @@ -229,9 +231,11 @@ class HGCalProducer : public eudaq::Producer {

for (int pi=0; pi<3; pi++){
std::string rpiName = "none";
//if (pi==0) rpiName = "pi2";
if (pi==0) rpiName = "piRBDev";
if (pi==1) rpiName = "pi2";
if (pi==2) rpiName = "pi3";
//if (pi==3) rpiName = "pi4";

EUDAQ_INFO("Starting new_rdout.exe on "+rpiName);

Expand All @@ -244,7 +248,7 @@ class HGCalProducer : public eudaq::Producer {
EUDAQ_INFO("Successfully killed on "+ rpiName);
}

executionStatus = system(("ssh -T "+rpiName+" \" nohup sudo /home/pi/RDOUT_BOARD_IPBus/rdout_software/bin/new_rdout.exe 200 1000000 0 > log.log 2>&1& \" ").data());
executionStatus = system(("ssh -T "+rpiName+" \" nohup sudo /home/pi/RDOUT_BOARD_IPBus/rdout_software/bin/new_rdout.exe 200 200000 0 > log.log 2>&1& \" ").data());

if (executionStatus != 0) {
EUDAQ_ERROR("Error: unable to run exe on "+rpiName);
Expand All @@ -255,19 +259,20 @@ class HGCalProducer : public eudaq::Producer {
}



// End of scripts on RPIs

// Do any configuration of the hardware here
// Configuration file values are accessible as config.Get(name, default)
m_uhalLogLevel = config.Get("UhalLogLevel", 5);
m_blockSize = config.Get("DataBlockSize",962);
int mode=config.Get("AcquisitionMode",0);
const int mode=config.Get("AcquisitionMode",0);
switch( mode ){
case 0 : m_acqmode = DEBUG; break;
case 1 : m_acqmode = BEAMTEST; break;
default : m_acqmode = DEBUG; break;
}
int n_orms = config.Get("NumberOfORMs",1);
const int n_orms = config.Get("NumberOfORMs",1);
std::ostringstream deviceName( std::ostringstream::ate );
for( int iorm=0; iorm<n_orms; iorm++ ){
deviceName.str(""); deviceName << config.Get("RDOUT_ORM_PrefixName","RDOUT_ORM") << iorm;
Expand Down Expand Up @@ -297,12 +302,12 @@ class HGCalProducer : public eudaq::Producer {
<< "Check34 = " << std::dec << m_rdout_orms[iorm]->ReadRegister("check34") << "\t"
<< "Check35 = " << std::dec << m_rdout_orms[iorm]->ReadRegister("check35") << "\t"
<< "Check36 = " << std::dec << m_rdout_orms[iorm]->ReadRegister("check36") << std::endl;

uint32_t mask=m_rdout_orms[iorm]->ReadRegister("SKIROC_MASK");
std::cout << "ORM " << iorm << "\t SKIROC_MASK = " << std::hex<<mask << std::endl;
uint32_t cst0=m_rdout_orms[iorm]->ReadRegister("CONSTANT0");
const uint32_t mask=m_rdout_orms[iorm]->ReadRegister("SKIROC_MASK");
std::cout << "ORM " << iorm << "\t SKIROC_MASK = " <<std::setw(8)<< std::hex<<mask << std::endl;
const uint32_t cst0=m_rdout_orms[iorm]->ReadRegister("CONSTANT0");
std::cout << "ORM " << iorm << "\t CONST0 = " << std::hex << cst0 << std::endl;
uint32_t cst1=m_rdout_orms[iorm]->ReadRegister("CONSTANT1");
const uint32_t cst1=m_rdout_orms[iorm]->ReadRegister("CONSTANT1");
std::cout << "ORM " << iorm << "\t CONST1 = " << std::hex << cst1 << std::endl;


Expand Down Expand Up @@ -394,15 +399,19 @@ class HGCalProducer : public eudaq::Producer {
// // we should also exit.
virtual void OnTerminate() {
SetStatus(eudaq::Status::LVL_OK, "Terminating...");
m_state = STATE_GOTOTERM;


int executionStatus = 0;
executionStatus = system("ssh -T piS \" sudo killall sync_debug.exe \"");
executionStatus = system("ssh -T piRBDev \" sudo killall new_rdout.exe \"");
executionStatus = system("ssh -T pi2 \" sudo killall new_rdout.exe \"");
executionStatus = system("ssh -T pi3 \" sudo killall new_rdout.exe \"");

//executionStatus = system("ssh -T pi4 \" sudo killall new_rdout.exe \"");


m_triggerController->stopRun();

m_state = STATE_GOTOTERM;

eudaq::mSleep(1000);
}
};
Expand Down
Loading

0 comments on commit e21b92d

Please sign in to comment.