diff --git a/producers/cmshgcal/STARTRUN_ALL b/producers/cmshgcal/STARTRUN_ALL index b9f7a6548a..b34cfa9213 100755 --- a/producers/cmshgcal/STARTRUN_ALL +++ b/producers/cmshgcal/STARTRUN_ALL @@ -46,7 +46,7 @@ if [ ! -d ./snapshots ]; then mkdir -p ./snapshots; fi -mkdir -p ./snapshots/run$NEWRUNNUM/; +#mkdir -p ./snapshots/run$NEWRUNNUM/; printf '\033[1;32;48m \t STARTING DAQ LOCALLY\033[0m \n' @@ -86,7 +86,7 @@ sleep 1 # euLog ############### printf '\033[22;33m\t Logger \033[0m \n' -./euLog.exe -x 0 -y 550 -w 1500 -g 450 -r tcp://$HOSTIP:44000 & +./euLog.exe -x 0 -y 550 -w 1500 -g 450 -r tcp://$HOSTIP:$RCPORT & sleep 2 ###################################################################### @@ -105,9 +105,16 @@ sleep 2 # cmshgcal or RpiProducer ############### printf '\033[22;33m\t cms hgcal *Rpi* Producer \033[0m \n' -#xterm -sb -sl 1000 -geom 80x600-280-900 -fn fixed -T "RPI Producer" -e './RpiProducer.exe -r tcp://$HOSTIP:$RCPORT' & -flog="../logs/Run${NEWRUNNUM}_RpiProducer_$dt.log" -nohup ./RpiProducer.exe -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & + +#xterm -sb -sl 1000 -geom 80x600-200-900 -fn fixed -T "RPI Producer RDB2" -e './RpiProducer.exe -n RPI-BRD2 -r tcp://$HOSTIP:$RCPORT' & +#xterm -sb -sl 1000 -geom 80x600-300-900 -fn fixed -T "RPI Producer RDB3" -e './RpiProducer.exe -n RPI-BRD3 -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 & +printf "The logs from the RPiProducer are in $flog file. \n" + +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" sleep 2 @@ -116,7 +123,8 @@ sleep 2 # AHCAL producer #################### printf '\033[22;33m\t caliceProducer-scintillator \033[0m \n' -#xterm -sb -sl 1000000 -geom 160x10-480-900 -fn fixed -T "CALICE AHCAL" -e "./AHCALProducer.exe -n CaliceSc -r tcp://$TLUIP:$RCPORT && read || read" & +#xterm -sb -sl 1000000 -geom 100x10-480-900 -fn fixed -T "CALICE AHCAL" -e "./AHCALProducer.exe -n CaliceSc -r tcp://$TLUIP:$RCPORT && read || read" & +#xterm -sb -sl 1000000 -geom 100x10-400-900 -fn fixed -T "CALICE AHCAL Two" -e "./AHCALProducer.exe -n CaliceSc-Two -r tcp://$TLUIP:$RCPORT && read || read" & 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" @@ -129,7 +137,12 @@ sleep 2 printf '\033[22;33m\t delay wire chamber Producer \033[0m \n' #ssh -Y -T wc "xterm -sb -sl 1000 -geom 80x600-280-900 -fn fixed -T \"Delay Wire Chamber Producer\" -e \"/home/cmsdaq/DAQ/eudaq/bin/WireChamberProducer.exe -l INFO -r tcp://192.168.222.1:44000\"" & flog="../logs/Run${NEWRUNNUM}_WireChamberProducer_$dt.log" +ssh -Y -T wc "killall WireChamberProducer.exe" & +sleep 1 nohup ssh -Y -T wc "/home/cmsdaq/DAQ/eudaq/bin/WireChamberProducer.exe -l INFO -r tcp://192.168.222.1:44000" > $flog 2>&1 & + +echo "\n" + sleep 2 @@ -141,6 +154,7 @@ then config_file="../producers/cmshgcal/conf/OnlineMon.conf" #./HgcOnlineMon.exe -u 100 -rf -rs -sc 2 -c $config_file -tc 0 -r tcp://$HOSTIP:$RCPORT nohup ./HgcOnlineMon.exe -u 100 -rf -rs -sc 2 -c $config_file -tc 0 -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & + #nohup ./HgcOnlineMon.exe -u 100 -rf -rs -sc 2 -c $config_file -tc 0 -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & printf "The logs from the Online Monitor are in $flog file. \n" else diff --git a/producers/cmshgcal/conf/AllInOneProducer.conf b/producers/cmshgcal/conf/AllInOneProducer.conf index f3c1b35c25..1eca1ee716 100644 --- a/producers/cmshgcal/conf/AllInOneProducer.conf +++ b/producers/cmshgcal/conf/AllInOneProducer.conf @@ -9,12 +9,13 @@ SaveLevel = EXTRA PrintLevel = DEBUG -[Producer.RPI] +[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.113' +RPI_1_IP = '192.168.222.112' # Spare RPI: #RPI_1_IP = '192.168.222.99' @@ -23,6 +24,50 @@ RPI_1_IP = '192.168.222.113' #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' @@ -59,6 +104,7 @@ sourceDirPath_Skirocs = "/home/daq/forConfiguration_EUDAQ/sourceDir_Skirocs" targetDirPath_Skirocs = "/home/pi/forConfiguration_EUDAQ/targetDir_Skirocs" resetConfiguration_Skirocs_exe_fileName = "resetConfiguration_Skirocs.sh" + [Producer.CaliceSc] #FileLEDsettings ="F:\\LEDEUDAQ\\LED1.ini" FileMode = 0 @@ -86,7 +132,7 @@ InsertDummyPackets = 1 #When RedirectInputFromFile is set, an existing raw raw data file is used as a fake input from detector #RedirectInputFromFile="/home/calice/Desktop/EUDAQ2-testbeam2017February/data/detector_45015.raw" #RedirectInputFromFile="../data/ahcal/detector_45131.raw" -#RedirectInputFromFile="../data/ahcal/rawAHCAL_00103__12p07p2017__18p06p17.raw" +#RedirectInputFromFile="/disk2_2TB/July2017_TB_data_ahcal/rawAHCAL_00106__12p07p2017__18p25p54.raw" #EventBuildingMode selects what event building will be used and #EventBuildingMode = "ROC" EventBuildingMode = "TRIGGERID" @@ -110,7 +156,6 @@ AHCALBXID0Offset = 2123 AHCALBXIDWidth = 160 - [Producer.DWCs] dataFilePrefix = "/home/cmsdaq/DAQ/eudaq/data/dwc_run_" AcquisitionMode = 1 @@ -123,10 +168,10 @@ triggerMatchMode = 1 emptyEventEnable = 1 edgeDetectionMode = 2 timeResolution = 3 -maxHitsPerEvent = 64 +maxHitsPerEvent = 9 enabledChannels = 0xFFFF -windowWidth = 60 -windowOffset = -30 +windowWidth = 0x40 +windowOffset = -20 defaultTimestamp = -999 diff --git a/producers/cmshgcal/conf/PedestalProducer.conf b/producers/cmshgcal/conf/PedestalProducer.conf index 50fc574e3d..3f6129d80c 100644 --- a/producers/cmshgcal/conf/PedestalProducer.conf +++ b/producers/cmshgcal/conf/PedestalProducer.conf @@ -9,12 +9,65 @@ SaveLevel = EXTRA PrintLevel = DEBUG -[Producer.RPI] +[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.113' +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' @@ -49,4 +102,4 @@ 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" +resetConfiguration_Skirocs_exe_fileName = "resetConfiguration_Skirocs.sh" \ No newline at end of file diff --git a/producers/cmshgcal/onlinemon/src/AhcalCollection.cc b/producers/cmshgcal/onlinemon/src/AhcalCollection.cc index 234661c966..e0898e116a 100644 --- a/producers/cmshgcal/onlinemon/src/AhcalCollection.cc +++ b/producers/cmshgcal/onlinemon/src/AhcalCollection.cc @@ -13,7 +13,7 @@ bool AhcalCollection::isPlaneRegistered(eudaq::StandardPlane p) { void AhcalCollection::fillHistograms(const eudaq::StandardPlane &pl) { std::cout<<"In AhcalCollection::fillHistograms(StandardPlane)"<20) - _nHits->Fill(20); // Overflow bin + if (plane.HitPixels()>=20) + _nHits->Fill(19); // Overflow bin else _nHits->Fill(plane.HitPixels()); if ((_nbadHits != NULL)) { - _nbadHits->Fill(0); + _nbadHits->Fill(2); } - - // Temporary lets just not show events with too many channels - if (plane.HitPixels()>20) + + // Temporary lets just not fill events with too many channels + if (plane.HitPixels()>40) return; @@ -250,13 +222,23 @@ void HexagonHistos::Fill(const eudaq::StandardPlane &plane) { for (unsigned int pix = 0; pix < plane.HitPixels(); pix++) { - const int pixel_x = plane.GetX(pix); const int pixel_y = plane.GetY(pix); const int ch = _ski_to_ch_map.find(make_pair(pixel_x,pixel_y))->second; - std::cout<<" We are getting a pixel with pix="<Fill(ped_LG); @@ -357,7 +334,7 @@ void HexagonHistos::Fill(const eudaq::StandardPlane &plane) { std::ostringstream oss; oss << "Sensor_" << icell+1; const string bin_name = oss.str(); - if (avg_hg > 100 && _hexagons_occ_adc!=NULL) + if (avg_hg > thresh_HG && _hexagons_occ_adc!=NULL) _hexagons_occ_adc->Fill(bin_name.c_str(), 1); if (tot_slow!=4 &&_hexagons_occ_tot!=NULL) @@ -422,8 +399,7 @@ void HexagonHistos::Write() { _hexagons_charge->Write(); _hit2Dmap->Write(); _hit1Docc->Write(); - //_clusterSize->Write(); - //_nClusters->Write(); + _nHits->Write(); _nbadHits->Write(); _HotPixelMap->Write(); @@ -445,7 +421,7 @@ void HexagonHistos::Write() { _LGvsTOTslow->Write(); _HGvsLG->Write(); - std::cout<<"Doing HexagonHistos::Write() before canvas drawing"<Sleep(100); @@ -471,7 +447,7 @@ void HexagonHistos::Write() { */ - std::cout<<"Doing HexagonHistos::Write() after canvas drawing"<Reset(); - + _recoX->Reset(); + _recoY->Reset(); + _goodAll->Reset(); + _goodX->Reset(); + _goodY->Reset(); + // we have to reset the aux array as well zero_plane_array(); } @@ -141,6 +146,12 @@ void WireChamberHistos::Write() { _XYmap->Write(); + _recoX->Write(); + _recoY->Write(); + _goodAll->Write(); + _goodX->Write(); + _goodY->Write(); + //std::cout<<"Doing WireChamberHistos::Write() before canvas drawing"< ( &ev ); @@ -91,18 +91,31 @@ namespace eudaq { const unsigned nBlocks = rev->NumBlocks(); std::cout<<"Number of Raw Data Blocks: "< brdID; + brdID.resize(bl.size() / sizeof(int)); + std::memcpy(&brdID[0], &bl[0], bl.size()); + RDBOARD = brdID[0]; + std::cout<<"RDBRD ID = "< rollPositions(const unsigned int r) const { @@ -316,7 +332,7 @@ namespace eudaq { std::bitset bits = r; //for( size_t i=0; i roll; if(bits.test(0) && bits.test(nSCA-1)){ roll[0]=0; @@ -338,7 +354,7 @@ namespace eudaq { } return roll; } - */ + */ std::vector> GetZSdata(const std::vector> &decoded) const{ @@ -383,7 +399,7 @@ namespace eudaq { std::sort(tmp_adc.begin(), tmp_adc.end()); - + unsigned median = 0 ; if (tmp_adc.size() == 32){ @@ -404,7 +420,7 @@ namespace eudaq { // <<"\t also, first guy:"< thresh) //std::cout<(std::chrono::steady_clock::now() - startTime).count(); + timeSinceStart = std::chrono::duration_cast(std::chrono::steady_clock::now() - startTime).count(); outTree->Fill(); - std::cout<<"+++ Event: "<