本文整理汇总了C++中ConfigParameters::setDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigParameters::setDirectory方法的具体用法?C++ ConfigParameters::setDirectory怎么用?C++ ConfigParameters::setDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigParameters
的用法示例。
在下文中一共展示了ConfigParameters::setDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: singleTest
// ----------------------------------------------------------------------
// simple macro to illustrate how to call a test in a macro environment
// test parameters are changed from the macro
void singleTest(string testname = "PixelAlive", string rootfilename = "pixelalive.root", string cfgdirectory = "../data/defaultParametersRocPSI46digV2") {
ConfigParameters *configParameters = ConfigParameters::Singleton();
configParameters->setDirectory(cfgdirectory);
string cfgFile = configParameters->getDirectory() + string("/configParameters.dat");
configParameters->readConfigParameterFile(cfgFile);
string rootfile = rootfilename;
PixTestParameters *ptp = new PixTestParameters(configParameters->getDirectory() + "/" + configParameters->getTestParameterFileName());
PixSetup *ap = new PixSetup("DEBUG", ptp, configParameters);
cout << "pxar: dumping results into " << rootfile << endl;
TFile *rfile = TFile::Open(rootfile.c_str(), "RECREATE");
PixTestFactory *factory = PixTestFactory::instance();
PixTest *pt = factory->createTest(testname, ap);
if (!pt->getName().compare("PixelAlive")) {
pt->setParameter("Ntrig", "10");
pt->doTest();
pt->setParameter("Ntrig", "20");
pt->doTest();
}
if (!pt->getName().compare("Ph")) {
pt->setParameter("Ntrig", "2");
pt->setParameter("DAC", "Vcal");
pt->setParameter("DacVal", "200");
pt->dumpParameters();
pt->doTest();
pt->setParameter("PIX", "reset");
pt->setParameter("Ntrig", "4");
pt->setParameter("DacVal", "250");
pt->setParameter("PIX", "45,45");
pt->dumpParameters();
pt->doTest();
}
delete pt;
rfile->Close();
ap->killApi();
}
示例2: phOpt
// ----------------------------------------------------------------------
// create PH vs VCal scans for a grid of phscale and phoffset values
void phOpt(string rootfile = "phOpt.root", string cfgdirectory = "testROC") {
ConfigParameters *configParameters = ConfigParameters::Singleton();
configParameters->setDirectory(cfgdirectory);
string cfgFile = configParameters->getDirectory() + string("/configParameters.dat");
configParameters->readConfigParameterFile(cfgFile);
PixTestParameters *ptp = new PixTestParameters(configParameters->getDirectory() + "/" + configParameters->getTestParameterFileName());
PixSetup *ap = new PixSetup("DEBUG", ptp, configParameters);
cout << "pxar: dumping results into " << rootfile << endl;
TFile *rfile = TFile::Open(rootfile.c_str(), "RECREATE");
PixTestFactory *factory = PixTestFactory::instance();
PixTest *pt = factory->createTest("DacScan", ap);
pt->setDAC("ctrlreg", 4);
pt->setParameter("PHmap", "1");
pt->setParameter("DAC", "Vcal");
pt->setParameter("DACLO", "0");
pt->setParameter("DACHI", "255");
int cycle(0);
TH1D *h1(0);
for (unsigned int io = 0; io < 26; ++io) {
for (unsigned int is = 0; is < 52; ++is) {
pt->setDAC("phoffset", io*10);
pt->setDAC("phscale", is*5);
pt->doTest();
h1 = (TH1D*)rfile->Get(Form("DacScan/ph_Vcal_c11_r20_C0_V%d", cycle));
h1->SetTitle(Form("ph_Vcal_c11_r20_C0_V%d phscale=%d phoffset=%d", cycle, is*5, io*10));
++cycle;
}
}
rfile->Print();
delete pt;
rfile->Close();
ap->killApi();
}