Commit fe899b80 authored by Stefano Mersi's avatar Stefano Mersi
Browse files

Merge branch 'daqSchool2021_codeReformat' into 'daqSchool2021'

Just reformatting code

See merge request cms_tk_ph2/Ph2_ACF!198
parents 51e2ac19 dd023aee
......@@ -7,28 +7,23 @@
*/
#include "../DQMUtils/DQMHistogramCalibrationExample.h"
#include "../RootUtils/HistContainer.h"
#include "../RootUtils/RootContainerFactory.h"
#include "../Utils/Container.h"
#include "../Utils/ContainerFactory.h"
#include "../RootUtils/RootContainerFactory.h"
#include "../Utils/ContainerStream.h"
#include "../RootUtils/HistContainer.h"
#include "TCanvas.h"
#include "TH1F.h"
#include "TFile.h"
#include "TH1F.h"
//========================================================================================================================
DQMHistogramCalibrationExample::DQMHistogramCalibrationExample ()
{
}
DQMHistogramCalibrationExample::DQMHistogramCalibrationExample() {}
//========================================================================================================================
DQMHistogramCalibrationExample::~DQMHistogramCalibrationExample ()
{
}
DQMHistogramCalibrationExample::~DQMHistogramCalibrationExample() {}
//========================================================================================================================
void DQMHistogramCalibrationExample::book(TFile *theOutputFile, const DetectorContainer &theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap)
void DQMHistogramCalibrationExample::book(TFile* theOutputFile, const DetectorContainer& theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap)
{
// SoC utilities only - BEGIN
// THIS PART IT IS JUST TO SHOW HOW DATA ARE DECODED FROM THE TCP STREAM WHEN WE WILL GO ON THE SOC
......@@ -36,45 +31,41 @@ void DQMHistogramCalibrationExample::book(TFile *theOutputFile, const DetectorCo
// make fDetectorData ready to receive the information fromm the stream
ContainerFactory::copyStructure(theDetectorStructure, fDetectorData);
// SoC utilities only - END
// creating the histograms fo all the chips:
// create the HistContainer<TH1F> as you would create a TH1F (it implements some feature needed to avoid memory leaks in copying histograms like the move constructor)
HistContainer<TH1F> theTH1FPedestalContainer("HitPerChannel", "Hit Per Channel", 254, -0.5, 253.5);
// create Histograms for all the chips, they will be automatically accosiated to the output file, no need to save them, change the name for every chip or set their directory
RootContainerFactory::bookChipHistograms<HistContainer<TH1F>>(theOutputFile, theDetectorStructure,
fDetectorHitHistograms, theTH1FPedestalContainer);
RootContainerFactory::bookChipHistograms<HistContainer<TH1F>>(theOutputFile, theDetectorStructure, fDetectorHitHistograms, theTH1FPedestalContainer);
}
//========================================================================================================================
void DQMHistogramCalibrationExample::fillCalibrationExamplePlots(DetectorDataContainer &theHitContainer)
void DQMHistogramCalibrationExample::fillCalibrationExamplePlots(DetectorDataContainer& theHitContainer)
{
for(auto board : theHitContainer) //for on boards - begin
for(auto board: theHitContainer) // for on boards - begin
{
size_t boardIndex = board->getIndex();
for(auto opticalGroup : *board) //for on opticalGroups - begin
for(auto opticalGroup: *board) // for on opticalGroups - begin
{
size_t opticalGroupIndex = opticalGroup->getIndex();
for(auto hybrid: *opticalGroup) //for on hybrid - begin
for(auto hybrid: *opticalGroup) // for on hybrid - begin
{
size_t hybridIndex = hybrid->getIndex();
for(auto chip: *hybrid) //for on chip - begin
for(auto chip: *hybrid) // for on chip - begin
{
size_t chipIndex = chip->getIndex();
// Retreive the corresponging chip histogram:
TH1F *chipHitHistogram = fDetectorHitHistograms.at(boardIndex)->at(opticalGroupIndex)->at(hybridIndex)->at(chipIndex)
->getSummary<HistContainer<TH1F>>().fTheHistogram;
uint channelBin=1;
TH1F* chipHitHistogram = fDetectorHitHistograms.at(boardIndex)->at(opticalGroupIndex)->at(hybridIndex)->at(chipIndex)->getSummary<HistContainer<TH1F>>().fTheHistogram;
uint channelBin = 1;
// Check if the chip data are there (it is needed in the case of the SoC when data may be sent chip by chip and not in one shot)
if(chip->getChannelContainer<uint32_t>() == nullptr ) continue;
if(chip->getChannelContainer<uint32_t>() == nullptr) continue;
// Get channel data and fill the histogram
for(auto channel : *chip->getChannelContainer<uint32_t>()) //for on channel - begin
{
chipHitHistogram->SetBinContent(channelBin++,channel);
} //for on channel - end
} //for on chip - end
} //for on hybrid - end
} //for on opticalGroups - end
} //for on boards - end
for(auto channel: *chip->getChannelContainer<uint32_t>()) // for on channel - begin
{ chipHitHistogram->SetBinContent(channelBin++, channel); } // for on channel - end
} // for on chip - end
} // for on hybrid - end
} // for on opticalGroups - end
} // for on boards - end
}
//========================================================================================================================
......@@ -82,36 +73,35 @@ void DQMHistogramCalibrationExample::process()
{
// This step it is not necessary, unless you want to format / draw histograms,
// otherwise they will be automatically saved
for(auto board : fDetectorHitHistograms) //for on boards - begin
for(auto board: fDetectorHitHistograms) // for on boards - begin
{
size_t boardIndex = board->getIndex();
for(auto opticalGroup : *board) //for on opticalGroups - begin
for(auto opticalGroup: *board) // for on opticalGroups - begin
{
size_t opticalGroupIndex = opticalGroup->getIndex();
for(auto hybrid: *opticalGroup) //for on hybrid - begin
for(auto hybrid: *opticalGroup) // for on hybrid - begin
{
size_t hybridIndex = hybrid->getIndex();
//Create a canvas do draw the plots
TCanvas *cValidation = new TCanvas(("Hits_hybrid_" + std::to_string(hybrid->getId())).data(),("Hits hybrid " + std::to_string(hybrid->getId())).data(), 0, 0, 650, 650 );
// Create a canvas do draw the plots
TCanvas* cValidation = new TCanvas(("Hits_hybrid_" + std::to_string(hybrid->getId())).data(), ("Hits hybrid " + std::to_string(hybrid->getId())).data(), 0, 0, 650, 650);
cValidation->Divide(hybrid->size());
for(auto chip: *hybrid) //for on chip - begin
for(auto chip: *hybrid) // for on chip - begin
{
size_t chipIndex = chip->getIndex();
cValidation->cd(chipIndex+1);
cValidation->cd(chipIndex + 1);
// Retreive the corresponging chip histogram:
TH1F *chipHitHistogram = fDetectorHitHistograms.at(boardIndex)->at(opticalGroupIndex)->at(hybridIndex)->at(chipIndex)
->getSummary<HistContainer<TH1F>>().fTheHistogram;
TH1F* chipHitHistogram = fDetectorHitHistograms.at(boardIndex)->at(opticalGroupIndex)->at(hybridIndex)->at(chipIndex)->getSummary<HistContainer<TH1F>>().fTheHistogram;
//Format the histogram (here you are outside from the SoC so you can use all the ROOT functions you need)
// Format the histogram (here you are outside from the SoC so you can use all the ROOT functions you need)
chipHitHistogram->SetStats(false);
chipHitHistogram->SetLineColor(kRed);
chipHitHistogram->DrawCopy();
} //for on chip - end
} //for on hybrid - end
} //for on opticalGroups - end
} //for on boards - end
} // for on chip - end
} // for on hybrid - end
} // for on opticalGroups - end
} // for on boards - end
}
//========================================================================================================================
......@@ -127,17 +117,17 @@ bool DQMHistogramCalibrationExample::fill(std::vector<char>& dataBuffer)
// THIS PART IT IS JUST TO SHOW HOW DATA ARE DECODED FROM THE TCP STREAM WHEN WE WILL GO ON THE SOC
// IF YOU DO NOT WANT TO GO INTO THE SOC WITH YOUR CALIBRATION YOU DO NOT NEED THE FOLLOWING COMMENTED LINES
//I'm expecting to receive a data stream from an uint32_t contained from calibration "CalibrationExample"
ChannelContainerStream<uint32_t> theHitStreamer("CalibrationExample");
// I'm expecting to receive a data stream from an uint32_t contained from calibration "CalibrationExample"
ChannelContainerStream<uint32_t> theHitStreamer("CalibrationExample");
// Try to see if the char buffer matched what I'm expection (container of uint32_t from CalibrationExample procedure)
if(theHitStreamer.attachBuffer(&dataBuffer))
{
//It matched! Decoding chip data
// It matched! Decoding chip data
theHitStreamer.decodeChipData(fDetectorData);
//Filling the histograms
// Filling the histograms
fillCalibrationExamplePlots(fDetectorData);
//Cleaning the data container to be ready for the next TCP string
// Cleaning the data container to be ready for the next TCP string
fDetectorData.cleanDataStored();
return true;
}
......
......@@ -20,12 +20,11 @@ class TFile;
*/
class DQMHistogramCalibrationExample : public DQMHistogramBase
{
public:
/*!
* constructor
*/
DQMHistogramCalibrationExample ();
DQMHistogramCalibrationExample();
/*!
* destructor
......@@ -38,32 +37,31 @@ class DQMHistogramCalibrationExample : public DQMHistogramBase
* \param theDetectorStructure : Detector container as obtained after file parsing, used to create histograms for all board/chip/opticalGroup/hybrid/channel
* \param pSettingsMap : setting as for Tool setting map in case coe informations are needed (i.e. FitSCurve)
*/
void book(TFile *theOutputFile, const DetectorContainer &theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap) override;
void book(TFile* theOutputFile, const DetectorContainer& theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap) override;
/*!
* \brief fill : fill histograms from TCP stream, need to be overwritten to avoid compilation errors, but it is not needed if you do not fo into the SoC
* \param dataBuffer : vector of char with the TCP datastream
*/
bool fill (std::vector<char>& dataBuffer) override;
bool fill(std::vector<char>& dataBuffer) override;
/*!
* \brief process : do something with the histogram like colors, fit, drawing canvases, etc
*/
void process () override;
void process() override;
/*!
* \brief Reset histogram
*/
void reset(void) override;
/*!
* \brief fillCalibrationExamplePlots
* \param theHitContainer : Container with the hits you want to plot
* \param theHitContainer : Container with the hits you want to plot
*/
void fillCalibrationExamplePlots(DetectorDataContainer &theHitContainer);
void fillCalibrationExamplePlots(DetectorDataContainer& theHitContainer);
private:
DetectorDataContainer fDetectorHitHistograms;
DetectorDataContainer fDetectorData;
};
......
......@@ -7,28 +7,23 @@
*/
#include "../DQMUtils/DQMHistogramSimpleSCurve.h"
#include "../RootUtils/HistContainer.h"
#include "../RootUtils/RootContainerFactory.h"
#include "../Utils/Container.h"
#include "../Utils/ContainerFactory.h"
#include "../RootUtils/RootContainerFactory.h"
#include "../Utils/ContainerStream.h"
#include "../RootUtils/HistContainer.h"
#include "TCanvas.h"
#include "TFile.h"
#include "TH2F.h"
//========================================================================================================================
DQMHistogramSimpleSCurve::DQMHistogramSimpleSCurve ()
{
}
DQMHistogramSimpleSCurve::DQMHistogramSimpleSCurve() {}
//========================================================================================================================
DQMHistogramSimpleSCurve::~DQMHistogramSimpleSCurve ()
{
}
DQMHistogramSimpleSCurve::~DQMHistogramSimpleSCurve() {}
//========================================================================================================================
void DQMHistogramSimpleSCurve::book(TFile *theOutputFile, const DetectorContainer &theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap)
void DQMHistogramSimpleSCurve::book(TFile* theOutputFile, const DetectorContainer& theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap)
{
// SoC utilities only - BEGIN
// THIS PART IT IS JUST TO SHOW HOW DATA ARE DECODED FROM THE TCP STREAM WHEN WE WILL GO ON THE SOC
......@@ -36,21 +31,20 @@ void DQMHistogramSimpleSCurve::book(TFile *theOutputFile, const DetectorContaine
// make fDetectorData ready to receive the information fromm the stream
ContainerFactory::copyStructure(theDetectorStructure, fDetectorData);
// SoC utilities only - END
// EDIT - begin //
// Allocate for each chip a TH2F to store occupancy vs (channel, threshold)
// EDIT
// EDIT - begin //
// Allocate for each chip a TH1F to store the pedestal distribution
// EDIT
}
//========================================================================================================================
void DQMHistogramSimpleSCurve::fillSimpleSCurvePlots(uint16_t VThr, DetectorDataContainer &theOccupancyContainer)
void DQMHistogramSimpleSCurve::fillSimpleSCurvePlots(uint16_t VThr, DetectorDataContainer& theOccupancyContainer)
{
for(auto board : theOccupancyContainer) //for on boards - begin
for(auto board: theOccupancyContainer) // for on boards - begin
{
board->getId(); // I am here just to avoid a unused-variable compilation error (developers are pedantic)
......@@ -59,7 +53,7 @@ void DQMHistogramSimpleSCurve::fillSimpleSCurvePlots(uint16_t VThr, DetectorData
// loop over all the channels and fill the 2D histogram
// EDIT
} //for on boards - end
} // for on boards - end
}
//========================================================================================================================
......@@ -67,7 +61,7 @@ void DQMHistogramSimpleSCurve::process()
{
// This step it is not necessary, unless you want to format / draw histograms,
// otherwise they will be automatically saved
for(auto board : fDetectorSCurveHistograms) //for on boards - begin
for(auto board: fDetectorSCurveHistograms) // for on boards - begin
{
board->getId(); // I am here just to avoid a unused-variable compilation error (developers are pedantic)
......@@ -78,7 +72,7 @@ void DQMHistogramSimpleSCurve::process()
// plot the distribution of the pedestal in the TH1F plots and draw it into the Canvas
// EDIT
} //for on boards - end
} // for on boards - end
}
//========================================================================================================================
......@@ -90,22 +84,22 @@ void DQMHistogramSimpleSCurve::reset(void)
//========================================================================================================================
bool DQMHistogramSimpleSCurve::fill(std::vector<char>& dataBuffer)
{
//IGNORE ME!! I'M HERE JUST FOR COMPLETENESS
// IGNORE ME!! I'M HERE JUST FOR COMPLETENESS
// SoC utilities only - BEGIN
// THIS PART IT IS JUST TO SHOW HOW DATA ARE DECODED FROM THE TCP STREAM WHEN WE WILL GO ON THE SOC
// IF YOU DO NOT WANT TO GO INTO THE SOC WITH YOUR CALIBRATION YOU DO NOT NEED THE FOLLOWING COMMENTED LINES
//I'm expecting to receive a data stream from an uint32_t contained from calibration "SimpleSCurve"
ChannelContainerStream<float,uint16_t> theSCurveStreamer("SimpleSCurve");
// I'm expecting to receive a data stream from an uint32_t contained from calibration "SimpleSCurve"
ChannelContainerStream<float, uint16_t> theSCurveStreamer("SimpleSCurve");
// Try to see if the char buffer matched what I'm expection (container of uint32_t from SimpleSCurve procedure)
if(theSCurveStreamer.attachBuffer(&dataBuffer))
{
//It matched! Decoding chip data
// It matched! Decoding chip data
theSCurveStreamer.decodeChipData(fDetectorData);
//Filling the histograms
fillSimpleSCurvePlots(theSCurveStreamer.getHeaderElement(),fDetectorData);
//Cleaning the data container to be ready for the next TCP string
// Filling the histograms
fillSimpleSCurvePlots(theSCurveStreamer.getHeaderElement(), fDetectorData);
// Cleaning the data container to be ready for the next TCP string
fDetectorData.cleanDataStored();
return true;
}
......
......@@ -20,12 +20,11 @@ class TFile;
*/
class DQMHistogramSimpleSCurve : public DQMHistogramBase
{
public:
/*!
* constructor
*/
DQMHistogramSimpleSCurve ();
DQMHistogramSimpleSCurve();
/*!
* destructor
......@@ -38,32 +37,31 @@ class DQMHistogramSimpleSCurve : public DQMHistogramBase
* \param theDetectorStructure : Detector container as obtained after file parsing, used to create histograms for all board/chip/opticalGroup/hybrid/channel
* \param pSettingsMap : setting as for Tool setting map in case coe informations are needed (i.e. FitSCurve)
*/
void book(TFile *theOutputFile, const DetectorContainer &theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap) override;
void book(TFile* theOutputFile, const DetectorContainer& theDetectorStructure, const Ph2_System::SettingsMap& pSettingsMap) override;
/*!
* \brief fill : fill histograms from TCP stream, need to be overwritten to avoid compilation errors, but it is not needed if you do not fo into the SoC
* \param dataBuffer : vector of char with the TCP datastream
*/
bool fill (std::vector<char>& dataBuffer) override;
bool fill(std::vector<char>& dataBuffer) override;
/*!
* \brief process : do something with the histogram like colors, fit, drawing canvases, etc
*/
void process () override;
void process() override;
/*!
* \brief Reset histogram
*/
void reset(void) override;
/*!
* \brief fillSimpleSCurvePlots
* \param theHitContainer : Container with the hits you want to plot
* \param theHitContainer : Container with the hits you want to plot
*/
void fillSimpleSCurvePlots(uint16_t VThr, DetectorDataContainer &theOccupancyContainer);
void fillSimpleSCurvePlots(uint16_t VThr, DetectorDataContainer& theOccupancyContainer);
private:
DetectorDataContainer fDetectorSCurveHistograms;
DetectorDataContainer fDetectorPedestalHistograms;
DetectorDataContainer fDetectorData;
......
......@@ -41,7 +41,6 @@ void RD53DQMHistogramSimpleSCurve::book(TFile* theOutputFile, const DetectorCont
// Allocate for each chip a TH2F to store occupancy vs (channel, threshold)
// EDIT
// EDIT - begin //
// Allocate for each chip a TH1F to store the pedestal distribution
// EDIT
......@@ -53,12 +52,11 @@ void RD53DQMHistogramSimpleSCurve::fillSimpleSCurvePlots(uint16_t VThr, Detector
for(auto board: theOccupancyContainer) // for on boards - begin
{
board->getId(); // I am here just to avoid a unused-variable compilation error (developers are pedantic)
// EDIT - begin //
// Loop over all module and chip, retrieve the TH2F plot for the corresponging chip (as usual same chip = same index for 2 containers)
// loop over all the channels and fill the 2D histogram
// EDIT
}
}
......@@ -78,7 +76,7 @@ void RD53DQMHistogramSimpleSCurve::process()
// plot the distribution of the pedestal in the TH1F plots and draw it into the Canvas
// EDIT
} // for on board - end
} // for on board - end
}
//========================================================================================================================
......
......@@ -71,7 +71,7 @@ class RD53FWInterface : public BeBoardFWInterface
uint32_t ReadoutSpeed();
bool DidIwriteChipReg(uint16_t optGroup_id) // @TMP@
{
/* RegManager::WriteReg("user.ctrl_regs.PRBS_checker.upgroup_addr", optGroup_id); */ // @TMP@
/* RegManager::WriteReg("user.ctrl_regs.PRBS_checker.upgroup_addr", optGroup_id); */ // @TMP@
RD53Cmd::WrReg(RD53Constants::BROADCAST_CHIPID, 0x44, RD53Constants::PATTERN_CLOCK);
usleep(1000);
......
......@@ -65,7 +65,9 @@ std::size_t TCPReceiverSocket::receive(char* buffer, std::size_t bufferSize, int
// as if the connection was closed correctly.
return dataRead;
}
default: { error << "Read: returned -1...Errno: " << errno;
default:
{
error << "Read: returned -1...Errno: " << errno;
}
}
throw std::runtime_error(error.str());
......
......@@ -59,7 +59,9 @@ void TCPTransmitterSocket::send(char const* buffer, std::size_t size, bool force
// Temporary error.
throw std::runtime_error(std::string("Write: temporary error: ") + strerror(errno));
}
default: { throw std::runtime_error(std::string("Write: returned -1: ") + strerror(errno));
default:
{
throw std::runtime_error(std::string("Write: returned -1: ") + strerror(errno));
}
}
}
......
......@@ -60,12 +60,12 @@ int main(int argc, char* argv[])
// create a generic Tool Object, I can then construct all other tools from that using the Inherit() method
// this tool stays on the stack and lives until main finishes - all other tools will update the HWStructure from cTool
Tool cTool;
Tool cTool;
std::stringstream outp;
cTool.InitializeHw ( cHWFile, outp );
cTool.InitializeSettings ( cHWFile, outp );
LOG (INFO) << outp.str();
outp.str ("");
cTool.InitializeHw(cHWFile, outp);
cTool.InitializeSettings(cHWFile, outp);
LOG(INFO) << outp.str();
outp.str("");
cTool.ConfigureHw();
cTool.CreateResultDirectory(cDirectory);
cTool.InitResultFile("CalibrationResults");
......
#include <cstring>
#include "tools/BackEndAlignment.h"
#include "tools/CicFEAlignment.h"
#include "../tools/CalibrationExample.h"
#include "../Utils/Timer.h"
#include "../Utils/argvparser.h"
#include "TROOT.h"
#include "../tools/CalibrationExample.h"
#include "TApplication.h"
#include "../Utils/Timer.h"
#include "TROOT.h"
#include "tools/BackEndAlignment.h"
#include "tools/CicFEAlignment.h"
#include <cstring>
using namespace Ph2_HwDescription;
using namespace Ph2_HwInterface;
......@@ -14,66 +14,68 @@ using namespace CommandLineProcessing;
INITIALIZE_EASYLOGGINGPP
int main ( int argc, char* argv[] )
int main(int argc, char* argv[])
{
//configure the logger
el::Configurations conf ("settings/logger.conf");
el::Loggers::reconfigureAllLoggers (conf);
// configure the logger
el::Configurations conf("settings/logger.conf");
el::Loggers::reconfigureAllLoggers(conf);
ArgvParser cmd;
// init
cmd.setIntroductoryDescription ( "CMS Ph2_ACF calibration example" );
cmd.setIntroductoryDescription("CMS Ph2_ACF calibration example");
// error codes
cmd.addErrorCode ( 0, "Success" );
cmd.addErrorCode ( 1, "Error" );
cmd.addErrorCode(0, "Success");
cmd.addErrorCode(1, "Error");
// options
cmd.setHelpOption ( "h", "help", "Print this help page" );
cmd.setHelpOption("h", "help", "Print this help page");
cmd.defineOption ( "file", "Hw Description File . Default value: settings/Calibration8CBC.xml", ArgvParser::OptionRequiresValue /*| ArgvParser::OptionRequired*/ );
cmd.defineOptionAlternative ( "file", "f" );
cmd.defineOption("file", "Hw Description File . Default value: settings/Calibration8CBC.xml", ArgvParser::OptionRequiresValue /*| ArgvParser::OptionRequired*/);
cmd.defineOptionAlternative("file", "f");
cmd.defineOption ( "output", "Output Directory . Default value: Results", ArgvParser::OptionRequiresValue /*| ArgvParser::OptionRequired*/ );
cmd.defineOptionAlternative ( "output", "o" );
cmd.defineOption("output", "Output Directory . Default value: Results", ArgvParser::OptionRequiresValue /*| ArgvParser::OptionRequired*/);
cmd.defineOptionAlternative("output", "o");
cmd.defineOption ( "batch", "Run the application in batch mode", ArgvParser::NoOptionAttribute );
cmd.defineOptionAlternative ( "batch", "b" );
cmd.defineOption("batch", "Run the application in batch mode", ArgvParser::NoOptionAttribute);
cmd.defineOptionAlternative("batch", "b");
cmd.defineOption("withCIC", "With CIC. Default : false", ArgvParser::NoOptionAttribute);
int result = cmd.parse ( argc, argv );
int result = cmd.parse(argc, argv);
if ( result != ArgvParser::NoParserError )
if(result != ArgvParser::NoParserError)
{
LOG (INFO) << cmd.parseErrorDescription ( result );
exit ( 1 );
LOG(INFO) << cmd.parseErrorDescription(result);
exit(1);
}
// now query the parsing results
std::string cHWFile = ( cmd.foundOption ( "file" ) ) ? cmd.optionValue ( "file" ) : "settings/Calibration8CBC.xml";
std::string cDirectory = ( cmd.foundOption ( "output" ) ) ? cmd.optionValue ( "output" ) : "Results/";
std::string cHWFile = (cmd.foundOption("file")) ? cmd.optionValue("file") : "settings/Calibration8CBC.xml";
std::string cDirectory = (cmd.foundOption("output")) ? cmd.optionValue("output") : "Results/";
bool cWithCIC = (cmd.foundOption("withCIC"));
cDirectory += "CalibrationExample";
bool batchMode = ( cmd.foundOption ( "batch" ) ) ? true : false;
TApplication cApp ( "Root Application", &argc, argv );
bool batchMode = (cmd.foundOption("batch")) ? true : false;
if ( batchMode ) gROOT->SetBatch ( true );
else TQObject::Connect ( "TCanvas", "Closed()", "TApplication", &cApp, "Terminate()" );
TApplication cApp("Root Application", &argc, argv);
//create a generic Tool Object, I can then construct all other tools from that using the Inherit() method
//this tool stays on the stack and lives until main finishes - all other tools will update the HWStructure from cTool
Tool cTool;
if(batchMode)
gROOT->SetBatch(true);
else
TQObject::Connect("TCanvas", "Closed()", "TApplication", &cApp, "Terminate()");
// create a generic Tool Object, I can then construct all other tools from that using the Inherit() method
// this tool stays on the stack and lives until main finishes - all other tools will update the HWStructure from cTool
Tool cTool;
std::stringstream outp;
cTool.InitializeHw ( cHWFile, outp );
cTool.InitializeSettings ( cHWFile, outp );
LOG (INFO) << outp.str();
outp.str ("");
cTool.ConfigureHw ();
cTool.CreateResultDirectory ( cDirectory );
cTool.InitResultFile ( "CalibrationResults" );
cTool.InitializeHw(cHWFile, outp);
cTool.InitializeSettings(cHWFile, outp);
LOG(INFO) << outp.str();
outp.str("");
cTool.ConfigureHw();
cTool.CreateResultDirectory(cDirectory);
cTool.InitResultFile("CalibrationResults");
Timer t;
t.start();
......@@ -98,15 +100,15 @@ int main ( int argc, char* argv[] )
cCicAligner.Reset();
cCicAligner.dumpConfigFiles();
}