Commit e522187a authored by Sarah Seif El Nasr's avatar Sarah Seif El Nasr
Browse files

Minor changes to merge with main Dev branch :

  1)Removed superflous Ph2_USBInstDriver headers from files in src/
  2)Removed ChangeHWDescription and ChangeSettings from SystemController
  3)Cosmetic changes to makefile (main and in src/) to use more generic variable names.
parent 5d4f27a5
......@@ -17,7 +17,7 @@ before_script:
- yum -y -q groupinstall uhal
- yum -y -q install root
- yum -y -q install root-net-http root-montecarlo-eg root-graf3d-eve root-geom root-physics root-graf3d-gl
- yum -y -q install zeromq
build_Ph2_ACF:
script:
- source setup.sh
......
......@@ -750,8 +750,7 @@ namespace Ph2_HwInterface {
if (cWriteAgain.size() < 100 && pWriteAttempts < cMaxWriteAttempts )
{
if (pReadback) LOG (INFO) << BOLDRED << "(WRITE#" << std::to_string(pWriteAttempts) << ") There were " << cWriteAgain.size() << " Readback Errors -trying again!" << RESET ;
else LOG (INFO) << BOLDRED << "(WRITE#" << std::to_string(pWriteAttempts) << ") There were " << cWriteAgain.size() << " CBC CMD acknowledge bits missing -trying again!" << RESET ;
pWriteAttempts++;
this->WriteCbcBlockReg ( cWriteAgain, pWriteAttempts, true);
}
......
......@@ -665,8 +665,7 @@ namespace Ph2_HwInterface {
if (cWriteAgain.size() < 100 && pWriteAttempts < cMaxWriteAttempts )
{
if (pReadback) LOG (INFO) << BOLDRED << "(WRITE#" << std::to_string(pWriteAttempts) << ") There were " << cWriteAgain.size() << " Readback Errors -trying again!" << RESET ;
else LOG (INFO) << BOLDRED << "(WRITE#" << std::to_string(pWriteAttempts) << ") There were " << cWriteAgain.size() << " CBC CMD acknowledge bits missing -trying again!" << RESET ;
pWriteAttempts++;
this->WriteCbcBlockReg ( cWriteAgain, pWriteAttempts, true);
}
......
ANTENNADIR=CMSPh2_AntennaDriver
AMC13DIR=/opt/cactus/include/amc13
HMP4040DIR=../Ph2_USBInstDriver
USBINSTDIR=../Ph2_USBInstDriver
#DEPENDENCIES := Utils HWDescription HWInterface System tools RootWeb Tracker src miniDAQ
DEPENDENCIES := Utils HWDescription HWInterface RootWeb Tracker
ANTENNAINSTALLED = no
AMC13INSTALLED = no
HMP4040INSTALLED = no
USBINSTINSTALLED = no
ifneq ("$(wildcard $(ANTENNADIR))","")
DEPENDENCIES := CMSPh2_AntennaDriver $(DEPENDENCIES)
......@@ -22,12 +22,12 @@ else
AMC13INSTRUCTIONS = This feature can only be built if the AMC13 libraries are installed with cactus!
endif
ifneq ("$(wildcard $(HMP4040DIR))","")
ifneq ("$(wildcard $(USBINSTDIR))","")
DEPENDENCIES := ../Ph2_USBInstDriver $(DEPENDENCIES)
HMP4040INSTALLED = yes
HMP4040INSTRUCTIONS = HMP4040 instrument driver found.
USBINSTINSTALLED = yes
USBINSTINSTRUCTIONS = HMP4040 instrument driver found.
else
HMP4040INSTRUCTIONS = To use the HMP4040 Instrument driver, please download the Driver from 'https://:@gitlab.cern.ch:8443/cms_tk_ph2/Ph2_USBInstDriver.git'.
USBINSTINSTRUCTIONS = To use the HMP4040 Instrument driver, please download the Driver from 'https://gitlab.cern.ch/cms_tk_ph2/Ph2_USBInstDriver.git'.
endif
.PHONY: print dependencies $(DEPENDENCIES) clean src miniDAQ tools
......@@ -63,8 +63,8 @@ print:
@echo 'Antenna Driver installed:' $(ANTENNAINSTALLED)
@echo $(ANTENNAINSTRUCTIONS)
@echo '*****************************'
@echo 'HMP4040 Driver installed:' $(HMP4040INSTALLED)
@echo $(HMP4040INSTRUCTIONS)
@echo 'Ph2 USB Inst Driver installed:' $(USBINSTINSTALLED)
@echo $(USBINSTINSTRUCTIONS)
@echo '*****************************'
......@@ -79,6 +79,5 @@ clean:
(cd miniDAQ; make clean)
(cd Tracker; make clean)
(cd AMC13; make clean)
(cd ../Ph2_USBInstDriver; make clean)
#(cd doc; make clean)
#(cd doc; make clean)
(rm -f lib/* bin/*)
\ No newline at end of file
......@@ -66,18 +66,8 @@ namespace Ph2_System {
else pVec = fFileHandler->readFileChunks (pNWords32);
}
void SystemController::ChangeHWDescription( const std::string& pFilename, std::ostream& os )
{
//os << "Before change , #: " << fBoardVector.size() << " BE boards!" << std::endl ;
fBoardVector.clear();
fBeBoardFWMap.clear();
this->fParser.parseHW (pFilename, fBeBoardFWMap, fBoardVector, os);
//os << "After change , #: " << fBoardVector.size() << " BE boards!" << std::endl ;
if (fWriteHandlerEnabled)
this->initializeFileHandler();
}
void SystemController::InitializeHw ( const std::string& pFilename, std::ostream& os )
void SystemController::InitializeHw ( const std::string& pFilename, std::ostream& os )
{
this->fParser.parseHW (pFilename, fBeBoardFWMap, fBoardVector, os );
......@@ -87,11 +77,7 @@ namespace Ph2_System {
if (fWriteHandlerEnabled)
this->initializeFileHandler();
}
void SystemController::ChangeSettings ( const std::string& pFilename, std::ostream& os )
{
fSettingsMap.clear();
this->fParser.parseSettings (pFilename, fSettingsMap, os);
}
void SystemController::InitializeSettings ( const std::string& pFilename, std::ostream& os )
{
this->fParser.parseSettings (pFilename, fSettingsMap, os );
......
......@@ -129,25 +129,13 @@ namespace Ph2_System {
cBoard->accept ( pVisitor );
}
/*!
* \brief change the hardware description via a config file.
* \Added to allow the reconfiguation of the GLIB during a test procedure.
* \param pFilename : HW Description file
*\param os : ostream to dump output
*/
void ChangeHWDescription ( const std::string& pFilename, std::ostream& os = std::cout );
/*!
* \brief Initialize the Hardware via a config file
* \param pFilename : HW Description file
*\param os : ostream to dump output
*/
void InitializeHw ( const std::string& pFilename, std::ostream& os = std::cout );
/*!
* \brief change the settings
* \param pFilename : settings file
*\param os : ostream to dump output
*/
void ChangeSettings ( const std::string& pFilename, std::ostream& os = std::cout );
/*!
* \brief Initialize the settings
* \Added to allow the reconfiguation of the settings during a test procedure.
......
......@@ -18,7 +18,7 @@ export BASE_DIR=$(pwd)
#ANTENNA
export ANTENNALIB=CMSPh2_AntennaDriver/lib
#HMP4040
export HMP4040LIB=../Ph2_USBInstDriver/lib
export USBINSTLIB=../Ph2_USBInstDriver/lib
export PATH=$BASE_DIR/bin:$PATH
......
......@@ -12,8 +12,8 @@ ANTENNADIR=../CMSPh2_AntennaDriver
AntennaFlag = -D__ANTENNA__
AMC13DIR=/opt/cactus/include/amc13
Amc13Flag = -D__AMC13__
HMP4040DIR=../../Ph2_USBInstDriver
HMP4040Flag = -D__HMP4040__
USBINSTDIR=../../Ph2_USBInstDriver
USBINSTFlag = -D__USBINST__
ZMQ_HEADER_PATH = /usr/include/zmq.hpp
LibraryDirs = /opt/cactus/lib ../lib
......@@ -64,10 +64,10 @@ endif
##################################################
## check if the HMP4040 drivers are installed
##################################################
ifneq ("$(wildcard $(HMP4040DIR))","")
LibraryDirs += $(HMP4040DIR)/lib $(HMP4040DIR)/Utils $(HMP4040DIR)/HMP4040
IncludeDirs += $(BOOST_INCLUDE) $(HMP4040DIR)/HMP4040 $(HMP4040DIR)/Utils $(HMP4040DIR)/Drivers
ExternalObjects += -lpthread -lboost_thread -lPh2_HMP4040 -lPh2_USBUtils -lPh2_Drivers $(HMP4040Flag)
ifneq ("$(wildcard $(USBINSTDIR))","")
LibraryDirs += $(USBINSTDIR)/lib $(USBINSTDIR)/Utils $(USBINSTDIR)/HMP4040
IncludeDirs += $(BOOST_INCLUDE) $(USBINSTDIR)/HMP4040 $(USBINSTDIR)/Utils $(USBINSTDIR)/Drivers
ExternalObjects += -lpthread -lboost_thread -lPh2_HMP4040 -lPh2_USBUtils -lPh2_Drivers $(USBINSTFlag)
HMP4040INSTALLED = yes
else
HMP4040INSTALLED = no
......
......@@ -13,16 +13,6 @@
#include "../Utils/Timer.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
using namespace Ph2_System;
......
......@@ -11,15 +11,6 @@
//#include "../Utils/easylogging++.h"
#include "TROOT.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -11,15 +11,6 @@
#include "TROOT.h"
#include "TApplication.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -3,18 +3,7 @@
#include "../Utils/argvparser.h"
#include "../System/SystemController.h"
#include "../Utils/CommonVisitors.h"
//#include "../Utils/easylogging++.h"
// Ph2_usb_instDriverStuff
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -17,16 +17,6 @@
#include "../Utils/CommonVisitors.h"
#include "../Tracker/TrackerEvent.h"
// Ph2_usb_instDriverStuff
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -15,15 +15,6 @@
#include "../Utils/ConsoleColor.h"
#include "../System/SystemController.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -11,15 +11,6 @@
//#include "../Utils/easylogging++.h"
#include "TROOT.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -27,9 +27,10 @@
#include "../Utils/Timer.h"
//#include "../Utils/easylogging++.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
// #ifdef __HTTP__
// #include "THttpServer.h"
// #endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../Utils/AppLock.cc"
......@@ -133,7 +134,7 @@ int launch_HMP4040server( std::string pHostname = "localhost" , int pZmqPortNum
{
// have to do this here because actually lvSupervisor attempts to access the LOCK file as well...
delete cLock;
LOG (INFO) << "HMP4040 server not running .... so try and launch it.";
// launch the server in the background with nohup... probably not the smartest way of doing this but the only way I know how without using screen/tmux
// // sprintf(cmd, "nohup bin/lvSupervisor -r %d -p %d -i %d 0< /dev/null", pZmqPortNumber, pHttpPortNumber, cMeasureInterval_s);
......@@ -311,11 +312,9 @@ bool check_Shorts(Tool pTool , std::string pHWFile , uint32_t cMaxNumShorts)
{
ShortFinder cShortFinder;
cShortFinder.Inherit (&pTool);
cShortFinder.ChangeHWDescription ( pHWFile );
cShortFinder.ChangeSettings ( pHWFile );
cShortFinder.ConfigureHw();
//reload the calibration values for the CBCs
cShortFinder.ReconfigureRegisters();
//cShortFinder.ReconfigureRegisters();
// I don't think this is neccesary ... but here for now
cShortFinder.ConfigureVcth(0x78);
......@@ -339,13 +338,11 @@ void perform_OccupancyMeasurment(Tool pTool , std::string pHWFile )
HybridTester cHybridTester;
cHybridTester.Inherit (&pTool);
cHybridTester.ChangeHWDescription ( pHWFile );
cHybridTester.ChangeSettings ( pHWFile );
cHybridTester.ConfigureHw();
cHybridTester.Initialize();
// re-configure CBC regsiters with values from the calibration
cHybridTester.ReconfigureCBCRegisters();
//cHybridTester.ReconfigureCBCRegisters();
// I don't think this is neccesary ... but here for now
cHybridTester.ConfigureVcth(0x78);
......@@ -375,14 +372,12 @@ void perform_AntennaOccupancyMeasurement(Tool pTool , std::string pHWFile )
AntennaTester cAntennaTester;
cAntennaTester.Inherit (&pTool);
cAntennaTester.ChangeHWDescription ( pHWFile );
cAntennaTester.ChangeSettings ( pHWFile );
cAntennaTester.ConfigureHw(outp);
LOG (INFO) << outp.str();
cAntennaTester.Initialize();
// re-configure CBC regsiters with values from the calibration
cAntennaTester.ReconfigureCBCRegisters();
//cAntennaTester.ReconfigureCBCRegisters();
cAntennaTester.ConfigureVcth(0x78);
// measure occupancy
......
......@@ -6,16 +6,6 @@
#include "../Utils/argvparser.h"
#include "TROOT.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
using namespace Ph2_System;
......
......@@ -2,17 +2,6 @@
#include "../Utils/CommonVisitors.h"
#include "../Utils/argvparser.h"
#include "../Utils/Timer.h"
//#include "../Utils/easylogging++.h"
#ifdef __HTTP__
#include "THttpServer.h"
#endif
#ifdef __ZMQ__
#include "../../Ph2_USBInstDriver/Utils/zmqutils.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Controller.h"
#include "../../Ph2_USBInstDriver/HMP4040/HMP4040Client.h"
using namespace Ph2_UsbInst;
#endif
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......
......@@ -494,24 +494,6 @@ void Calibration::toggleOffset ( uint8_t pGroup, uint8_t pBit, bool pBegin )
}
}
// void Calibration::normalizeHists()
// {
// std::string cHistName = "Occupancy";
// for ( const auto& cCbc : fCbcHistMap )
// {
// // loop the map of string vs TObject
// auto cHist = cCbc.second.find ( cHistName );
// if ( cHist != std::end ( cCbc.second ) )
// {
// fOffsetCanvas->cd ( cCbc.first->getCbcId() + 1 );
// TH1F* cTmpHist = static_cast<TH1F*> ( cHist->second );
// cTmpHist->Scale(100.0/(fEventsPerPoint*3));
// cTmpHist->DrawCopy();
// }
// else LOG (INFO) << "Error, could not find Histogram with name " << cHistName ;
// }
// }
void Calibration::updateHists ( std::string pHistname )
{
// loop the CBCs
......
......@@ -85,10 +85,6 @@ class Calibration : public Tool
void updateHists( std::string pHistname );
// normalize occupancy histograms : offsets were found by taking pMultiple*fEvents triggers
// therefore the normalization factor is 100./(pMultiple*fEventsPerPoint)
void normalizeHists();
void writeGraphs();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment