<commit_before>/*===========================================================================*\

Author: <NAME>
Email:  <EMAIL>
Date:   11/02/14

Detail: This is a new test program for my FID libraries 

\*===========================================================================*/

//--- std includes ----------------------------------------------------------//
#include <fstream>
#include <iostream>

//--- other includes --------------------------------------------------------//
#include "TFile.h"
#include "TTree.h"
#include "TString.h"

//--- project includes ------------------------------------------------------//
#include "fid.h"

using namespace fid;
using namespace fid::sim;

int main(int argc, char **argv)
{
  // initialize the configurable parameters
  load_params(argc, argv);

  // some necessary parameters
  vec wf;
  vec tm;
  wf.reserve(len_fids);
  tm.reserve(len_fids);
  double delta_b;
  double max_grad = 500; // in ppm
  double freq_0 = sim::freq_larmor;

  construct_time_vector(len_fids, i_time, d_time, tm);

  // Set up the ROOT tree to hold the results
  TFile pf("sim_fids.root", "recreate");
  TTree pt("t", "FID Tree");

  pt.Branch("db", &delta_b, "delta_b/D");
  pt.Branch("fid", &wf[0], TString::Format("fid[%d]/D", len_fids));
  pt.Branch("tm", &tm[0], TString::Format("time[%d]/D", len_fids));

  // begin grad sims
  for (int i = -1 * num_fids / 2; i < num_fids / 2 + 1; ++i){

    delta_b = max_grad * 2.0 * i / num_fids;
    sim::freq_larmor = (1.0 + 1.0e-6 * delta_b) * freq_0;

    std::cout << sim::freq_larmor << std::endl;

    // Make FidFactory
    FidFactory ff;
    ff.SimulateFid(wf, tm);

    pt.Fill();

  } // grad

  pf.Write();
  pf.Close();

  return 0;
}<commit_msg>Updated generate_root_fids.cxx to work with new library format.<commit_after>/*===========================================================================*\

Author: <NAME>
Email:  <EMAIL>
Date:   11/02/14

Detail: This is a new test program for my FID libraries 

\*===========================================================================*/

//--- std includes ----------------------------------------------------------//
#include <fstream>
#include <iostream>

//--- other includes --------------------------------------------------------//
#include "TFile.h"
#include "TTree.h"
#include "TString.h"

//--- project includes ------------------------------------------------------//
#include "fid.h"

using namespace fid;

int main(int argc, char **argv)
{
  // initialize the configurable parameters
  if (argc > 1) load_params(argv[1]);

  // some necessary parameters
  vec wf;
  vec tm;
  wf.reserve(sim::num_samples);
  tm.reserve(sim::num_samples);
  double delta_b;
  double max_grad = 500; // in ppb
  int num_fids = 100;
  double freq_0 = sim::freq_larmor;

  double final_time = sim::start_time + sim::num_samples*sim::delta_time;
  tm = construct_range(sim::start_time, sim::delta_time, final_time);

  // Set up the ROOT tree to hold the results
  TFile pf("sim_fids.root", "recreate");
  TTree pt("t", "FID Tree");
  cout.precision(12);

  pt.Branch("db", &delta_b, "delta_b/D");
  pt.Branch("fid", &wf[0], TString::Format("fid[%d]/D", sim::num_samples));
  pt.Branch("tm", &tm[0], TString::Format("time[%d]/D", sim::num_samples));

  // begin grad sims
  cout << "num_fids: " << num_fids << endl;
  for (int i = -1 * num_fids / 2; i < num_fids / 2 + 1; ++i){

    delta_b = max_grad * 2.0 * i / num_fids;
    sim::freq_larmor = (1.0 + 1.0e-9 * delta_b) * freq_0;

    std::cout << sim::freq_larmor << std::endl;

    // Make FidFactory
    FidFactory ff;
    ff.SimulateFid(wf, tm);

    pt.Fill();

  } // grad

  pf.Write();
  pf.Close();

  return 0;
}
{'fraction_non_alphanumeric': 0.3191891891891892, 'fraction_numerical': 0.015405405405405406, 'mean_word_length': 2.5080568720379146, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6869540', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1231, 'n_words': 302}