Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
booststrapping.inl
/*----------------------------------------------------------------------------
*
* Copyright (C) 2016 - 2023 Antonio Augusto Alves Junior
*
* This file is part of Hydra Data Analysis Framework.
*
* Hydra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Hydra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Hydra. If not, see <http://www.gnu.org/licenses/>.
*
*---------------------------------------------------------------------------*/
/*
* booststrapping.inl
*
* Created on: 04/11/2018
* Author: Antonio Augusto Alves Junior
*/
#ifndef BOOSTSTRAPPING_INL_
#define BOOSTSTRAPPING_INL_
/**
* \example booststrapping.inl
*
*/
#include <iostream>
#include <assert.h>
#include <time.h>
#include <chrono>
//command line
#include <tclap/CmdLine.h>
//this lib
#include <hydra/Range.h>
#include <hydra/Zip.h>
/*-------------------------------------
* Include classes from ROOT to fill
* and draw histograms and plots.
*-------------------------------------
*/
#ifdef _ROOT_AVAILABLE_
#include <TROOT.h>
#include <TH1D.h>
#include <TApplication.h>
#include <TCanvas.h>
#endif //_ROOT_AVAILABLE_
//command line arguments
#include <tclap/CmdLine.h>
int main(int argv, char** argc)
{
size_t nentries = 0;
try {
TCLAP::CmdLine cmd("Command line arguments for ", '=');
TCLAP::ValueArg<size_t> EArg("n", "number-of-events","Number of events", true, 10e6, "size_t");
cmd.add(EArg);
// Parse the argv array.
cmd.parse(argv, argc);
// Get the value parsed by each arg.
nentries = EArg.getValue();
}
catch (TCLAP::ArgException &e) {
std::cerr << "error: " << e.error() << " for arg " << e.argId()
<< std::endl;
}
//device
{
std::cout << "=========================================="<<std::endl;
std::cout << "| <--- DEVICE ---> |"<<std::endl;
std::cout << "=========================================="<<std::endl;
auto points = hydra::range(0, 10);
auto bs_points = hydra::boost_strapped_range( points, 15753 );
auto zipped = hydra::zip( points, bs_points);
printf("%f %f \n", hydra::get<0>(a),hydra::get<1>(a));
});
}//device
return 0;
}
#endif /* BOOSTSTRAPPING_INL_ */