本文整理汇总了C++中TApplication::Argv方法的典型用法代码示例。如果您正苦于以下问题:C++ TApplication::Argv方法的具体用法?C++ TApplication::Argv怎么用?C++ TApplication::Argv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApplication
的用法示例。
在下文中一共展示了TApplication::Argv方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// This is the standard "main" of C++ starting a ROOT application
int main ( int argc , char ** argv ) {
gROOT-> Reset() ;
TApplication app ( "Root Application" , &argc , argv ) ;
StandaloneApplication ( app.Argc(), app.Argv() ) ;
app.Run () ;
exit(0);
return 0 ;
}
示例2: main
int main(int argc , char* argv[]){
//Program Options
po::options_description desc("Allowed Options");
desc.add_options()
("help,h", "Produce this help message")
("startwl,s",po::value<double>(),"Set the start Wavelength for the Analysis")
("stopwl,p",po::value<double>(),"Set the stop Wavelength for the Analysis")
("non-interactive,n","Runs the program in Noninteractive mode. It quits when it's finished")
("version,v","Prints Version")
;
po::variables_map vm;
po::store(po::parse_command_line(argc,argv,desc),vm);
po::notify(vm);
if (vm.count("help")) {
std::cout << desc<< std::endl;
return 3;
}
if (vm.count("version")) {
std::cout << "VCSEL Laser Analysis Version " << _VERSION << std::endl;
std::cout << "Using ROOT version " << _ROOT_VERSION << " and Boost version " << _BOOST_VERSION << std::endl;
return 0;
}
if (argc < 4) {
std::cout << desc;
return 2;
}
double startwl, stopwl;
startwl = 842.;
stopwl = 860.;
bool run = true;
if (vm.count("startwl")) {
startwl = vm["startwl"].as<double>();
NUM_ARGS +=2;
}
if (vm.count("stopwl")) {
double tmp = vm["stopwl"].as<double>();
stopwl =tmp;
NUM_ARGS +=2;
}
if (vm.count("non-interactive")) {
run = false;
NUM_ARGS++;
}
//checking filetypes must be txt, csv or CSV
if (!check_extensions(argc, argv)) {
return 1;
}
std::cout <<"startwl: "<< startwl << '\t' << "stopwl: " << stopwl << std::endl;
Double_t max = -210;
Double_t maxwl = 0;
int _argc = argc;
TApplication *t = new TApplication("big",&_argc,argv);
std::cout << "Running with boost and ROOT" <<std::endl;
std::vector<double> _x,_y;
Double_t x[LINES], y[LINES], _inta[LINES], _intb[LINES];
Double_t *cmp_int = new Double_t[argc];
Double_t *argc_ary = new Double_t[argc];
Double_t *cmp_int_root = new Double_t[argc];
Double_t *asymmety_ary = new Double_t[argc];
Double_t *width_ary = new Double_t [argc];
TGraph2D *gr = new TGraph2D(LINES*(argc-1));
//Setting up canvas for plot of all sectrums (is it called spectrums? ;) )
TCanvas *c1 = new TCanvas("All Plots","All Plots",10,10,3000,1500);
TH1F *integral_hist = new TH1F("Asymmerty", "Asymmetry", 100,0, 100);
if(!(argc % ROWS)){
c1->Divide(argc/ROWS,ROWS);
}else{
c1->Divide(argc/ROWS+(argc %ROWS -1),ROWS);
}
for (Int_t i = NUM_ARGS +1; i < argc ; i++){
try{
max = -211;
maxwl = 0;
argc_ary[i] = i-NUM_ARGS;
std::ifstream in;
in.seekg(0, std::ios::beg);
// voodoo keep this;
char **arg1 = t->Argv() ;
std::string tmp = arg1[i];
in.open(tmp.c_str());
std::cout<< "file: " << tmp << std::endl;
std::string line;
//.........这里部分代码省略.........