Skip to content

Commit

Permalink
Merge pull request #50 from HGCDAQ/dev-control-room
Browse files Browse the repository at this point in the history
October test beams version
  • Loading branch information
andreypz authored Oct 1, 2017
2 parents abef292 + 34b373d commit 6748488
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 40 deletions.
2 changes: 1 addition & 1 deletion producers/cmshgcal/STARTRUN_ALL
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ printf '\033[22;33m\t caliceProducer-scintillator \033[0m \n'
#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 &
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
Expand Down
5 changes: 3 additions & 2 deletions producers/cmshgcal/conf/AllInOneProducer.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[RunControl]
RunSizeLimit = 500

RunEventLimit = 10000

[DataCollector]
# "data" is now a link to "/disk2_2TB/July2017_TB_data_eudaq" directory
Expand Down Expand Up @@ -30,7 +31,7 @@ IPAddress = "192.168.222.42"
Reader = "Scintillator"
WriteRawOutput = 1
# "data" is now a link to /disk2_2TB/July2017_TB_data_eudaq directory
RawFileName = "../data/../July2017_TB_data_ahcal/rawAHCAL_%05d"
RawFileName = "../data_ahcal/rawAHCAL_%05d"

WriteRawFileNameTimestamp = 0
ColoredTerminalMessages = 1
Expand Down
14 changes: 7 additions & 7 deletions producers/cmshgcal/onlinemon/src/AhcalHistos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ AhcalHistos::AhcalHistos(eudaq::StandardPlane p, RootMonitor *mon)
SetHistoAxisLabelx(_hitYmap, "Y");


sprintf(out, "%s %i hot Pixel Map", _sensor.c_str(), _id);
sprintf(out2, "h_hotpixelmap_%s_%02d", _sensor.c_str(), _id);
_HotPixelMap = new TH2D(out2, out, _maxX + 1, 0, _maxX, _maxY + 1, 0, _maxY);
SetHistoAxisLabels(_HotPixelMap, "X", "Y");
//sprintf(out, "%s %i hot Pixel Map", _sensor.c_str(), _id);
//sprintf(out2, "h_hotpixelmap_%s_%02d", _sensor.c_str(), _id);
//_HotPixelMap = new TH2D(out2, out, _maxX + 1, 0, _maxX, _maxY + 1, 0, _maxY);
//SetHistoAxisLabels(_HotPixelMap, "X", "Y");


sprintf(out, "%s %i Number of Hits", _sensor.c_str(), _id);
Expand Down Expand Up @@ -135,9 +135,9 @@ void AhcalHistos::Reset() {
_hitYmap->Reset();

_nHits->Reset();
_nbadHits->Reset();
_nHotPixels->Reset();
_HotPixelMap->Reset();
//_nbadHits->Reset();
//_nHotPixels->Reset();
//_HotPixelMap->Reset();


// we have to reset the aux array as well
Expand Down
47 changes: 38 additions & 9 deletions producers/cmshgcal/onlinemon/src/HexagonHistos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,25 +245,54 @@ void HexagonHistos::Fill(const eudaq::StandardPlane &plane, int evNumber) {
if (pixel_x==3 && (pixel_y==32 || pixel_y==48))
continue;

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


// Module of May
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;


// Module #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 &&
pixel_x==1 && pixel_y==4 )
( pixel_x==0 && pixel_y==58 ) || ( pixel_x==0 && pixel_y==22 ) )
continue;

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

// Module #39
if ( _sensor=="HexaBoard-RDB3" && _id==0 &&
( 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 ) &&
// All Modules on readout board 3
if ( _sensor=="HexaBoard-RDB3" &&
( pixel_x==0 && pixel_y==58 ) )
continue;

// Module #64
if ( _sensor=="HexaBoard-RDB3" && _id==4 &&
( pixel_x==0 && pixel_y==58 ) || ( 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 -------------

Expand Down
32 changes: 16 additions & 16 deletions producers/cmshgcal/src/HGCalProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ class HGCalProducer : public eudaq::Producer {
// Adding trailer
// checkCRC( "RDOUT.CRC",m_rdout_orms[i]);
uint32_t trailer=i;//8 bits for orm id
std::cout << "board id = " << trailer;
//std::cout << "board id = " << trailer;
trailer|=m_triggerController->eventNumber()<<8;//24 bits for trigger number
std::cout << "\t event number id = " << m_triggerController->eventNumber();
std::cout << "\t trailer = " << trailer << std::endl; //m_rdout_orms[i]->addTrailerToData(trailer);
//std::cout << "\t event number id = " << m_triggerController->eventNumber();
//std::cout << "\t trailer = " << trailer << std::endl; //m_rdout_orms[i]->addTrailerToData(trailer);

the_data.push_back(trailer);

Expand All @@ -155,12 +155,12 @@ class HGCalProducer : public eudaq::Producer {
ev.AddBlock( 2*i, head, sizeof(head));
ev.AddBlock( 2*i+1, the_data);

std::cout<<i<<" head[0]="<<head[0]<<" Size of the data (bytes): "<<std::dec<<the_data.size()*4<<std::endl;
std::cout<<"rdout board "<<i<<" skiroc mask="<<std::setw(8)<<std::setfill('0')<<std::hex<<the_data[0]<<" Size of the data (bytes): "<<std::dec<<the_data.size()*4<<std::endl;

//Add trigger timestamp to raw data :
the_data.push_back( m_rdout_orms[i]->ReadRegister("CLK_COUNT0") );
the_data.push_back( m_rdout_orms[i]->ReadRegister("CLK_COUNT1") );
std::cout << std::setw(8) << std::setfill('0') << std::hex << m_rdout_orms[i]->ReadRegister("CLK_COUNT0") << "\t" << m_rdout_orms[i]->ReadRegister("CLK_COUNT1") << std::endl;
//std::cout << std::setw(8) << std::setfill('0') << std::hex << m_rdout_orms[i]->ReadRegister("CLK_COUNT0") << "\t" << m_rdout_orms[i]->ReadRegister("CLK_COUNT1") << std::endl;

// Write it into raw file:
m_rawFile.write(reinterpret_cast<const char*>(&the_data[0]), the_data.size()*sizeof(uint32_t));
Expand Down Expand Up @@ -232,25 +232,25 @@ class HGCalProducer : public eudaq::Producer {
if (pi==0) rpiName = "piRBDev";
if (pi==1) rpiName = "pi2";
if (pi==2) rpiName = "pi3";

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

executionStatus = system(("ssh -T "+rpiName+" \" sudo killall new_rdout.exe \"").data());

if (executionStatus != 0) {
EUDAQ_WARN("Error: unable to kill on "+rpiName+". It's probably already dead...");
EUDAQ_WARN("Error: unable to kill on "+rpiName+". It's probably already dead...");
}
else {
EUDAQ_INFO("Successfully killed on "+ rpiName);
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 100000 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 1000000 0 > log.log 2>&1& \" ").data());

if (executionStatus != 0) {
EUDAQ_ERROR("Error: unable to run exe on "+rpiName);
EUDAQ_ERROR("Error: unable to run exe on "+rpiName);
}
else {
EUDAQ_INFO("Successfully run exe on "+rpiName);
EUDAQ_INFO("Successfully run exe on "+rpiName);
}
}

Expand Down Expand Up @@ -299,7 +299,7 @@ class HGCalProducer : public eudaq::Producer {
<< "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 = " << mask << std::endl;
std::cout << "ORM " << iorm << "\t SKIROC_MASK = " << std::hex<<mask << std::endl;
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");
Expand Down Expand Up @@ -334,7 +334,7 @@ class HGCalProducer : public eudaq::Producer {

// Let's open a file for raw data:
char rawFilename[256];
sprintf(rawFilename, "/disk2_2TB/July2017_TB_data_orm/HexaData_Run%04d.raw", m_run); // The path is relative to eudaq/bin
sprintf(rawFilename, "../raw_data/HexaData_Run%04d.raw", m_run); // The path is relative to eudaq/bin; raw_data is a symbolic link
m_rawFile.open(rawFilename, std::ios::binary);

uint32_t header[3];
Expand Down
10 changes: 6 additions & 4 deletions producers/cmshgcal/src/HexaBoardConverterPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

const size_t RAW_EV_SIZE_32 = 123152;

const size_t nSkiPerBoard[3] = {8, 16, 16};
const uint32_t skiMask[3] = {0xF0F00000, 0xF0F0F0F0, 0xF0F0F0F0};
const size_t nSkiPerBoard[3] = {24, 20, 24};
const uint32_t skiMask[3] = {0xFFFFFF00, 0xFF000FFF, 0x00FFFFFF};
//const uint32_t skiMask[3] = {0xF0F00000, 0xF0F0F0F0, 0x0000F0F0};
//const uint32_t skiMask = 0;

Expand All @@ -28,7 +28,7 @@ const int nSCA=13;
//( these are not used anymore, because ZS is done with HA bit )
//const int ped = 250; // pedestal. It is now calculated as median from all channels in hexaboard
//const int noi = 10; // noise
//const int thresh = 250; // ZS threshold (above pedestal)
//const int thresh = 300; // ZS threshold (above pedestal)

// Size of ZS data ()per channel
const char hitSizeZS = 31;
Expand Down Expand Up @@ -484,7 +484,7 @@ namespace eudaq {
*/

unsigned short adc = 0;

/*
const int TS2 = (TS0+2)%13;
const int TS3 = (TS0+3)%13;
Expand All @@ -500,7 +500,9 @@ namespace eudaq {
chargeHG_avg_in3TS += adc;
chargeHG_avg_in3TS = chargeHG_avg_in3TS/3;
*/

//adc = gray_to_brady(decoded[ski][mainFrame*128 + chArrPos] & 0x0FFF);
//if (adc==0) adc=4096;

Expand Down
2 changes: 1 addition & 1 deletion producers/cmshgcal/src/TriggerController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void TriggerController::startrunning( uint32_t runNumber, const ACQ_MODE mode )
m_state=WAIT;
m_acqmode=mode;
m_gotostop=false;

switch( m_acqmode ){
case BEAMTEST : run(); break;
case DEBUG : runDebug(); break;
Expand Down

0 comments on commit 6748488

Please sign in to comment.