<commit_before>

// STL
#include <iostream>
#include <exception>
#include <stdlib.h> // for atoi

// RooBarb
#include "Logger.h"
#include "LoggerConfig.h"
#include "XmlConfig.h"
using namespace jdb;

// Rcp Maker

// Spectra 
	#include "Spectra/InclusiveSpectra.h"
	#include "Spectra/PidHistoMaker.h"
	#include "Spectra/PidDataMaker.h"
	#include "Spectra/TofEffSpectra.h"


// // McMaker
	#include "McMaker/TofEffMaker.h"
	#include "McMaker/EnergyLoss.h"
	#include "McMaker/TofEffFitter.h"
	#include "McMaker/TpcEffFitter.h"
	#include "McMaker/TpcEffMaker.h"

// // Presentation
// 	#include "Present/PidYieldPresenter.h"

// // Feed down
	#include "McMaker/FeedDownMaker.h"
	#include "McMaker/FeedDownFitter.h"


// // PID Fitting
	#include "TSF/FitRunner.h"
	using namespace TSF;

// // Corrections
	#include "Correction/ApplyPostCorr.h"


void ssGo( XmlConfig &config, string fileList, string jobPrefix );
void conGo( XmlConfig &config, int jobIndex );

int main( int argc, char* argv[] ) {

	Logger::setGlobalLogLevel( "all" );

	cout << "Arguments " << argc << endl;

	if ( argc >= 2 ){

		try{
			XmlConfig config( argv[ 1 ] );
			//config.report();

			LoggerConfig::setup( &config, "Logger" );

			string fileList = "";
			string jobPrefix = "";

			cout << "Arguments " << argc << endl;
			if ( argc >= 4 ){
				fileList = argv[ 2 ];
				jobPrefix = argv[ 3 ];
				ssGo( config, fileList, jobPrefix );
			} else if ( argc >= 3 ){
				int jobIndex = atoi( argv[2] );
				conGo( config, jobIndex );
			} else {
				conGo( config, -1 );
			}
		}catch ( exception &e ){
			cout << "HEllo" << endl;
			cout << e.what() << endl;
		}
	}
	
	return 0;

}



void conGo( XmlConfig &config, int jobIndex ){

	cout << "conGo" << endl;
	string job = config.getString( "jobType" );

	if ( "InclusiveSpectra" == job ){
		InclusiveSpectra is;
		is.init( config, "InclusiveSpectra.", jobIndex );
		is.run();
	}
	else if ( "TofEffSpectra" == job ){
		TofEffSpectra tes;
		tes.init( config, "TofEffSpectra.", jobIndex );
		tes.run();
	} 
	else if ( "TofEffFitter" == job ){
		TofEffFitter tef( config, "TofEffFitter." );
		tef.make();     
	} 
	else if ( "EnergyLoss" == job ){
		EnergyLoss el;
		el.init( config, "EnergyLoss.", jobIndex );
		el.run();
	} 
	else if ( "TpcEffMaker" == job ){
		TpcEffMaker tem;
		tem.init( config, "TpcEffMaker.", jobIndex );
		tem.run();
	} 
	else if ( "TpcEffFitter" == job ){
		TpcEffFitter tef( config, "TpcEffFitter." );
		tef.make();
	} 
	else if ( "FeedDownMaker" == job ){
		FeedDownMaker fdm;
		fdm.init( config, "FeedDownMaker.", jobIndex );
		fdm.run();
	}
	else if ( "FeedDownFitter" == job ){
		FeedDownFitter fdf( config, "FeedDownFitter." );
		fdf.make();
	}
	else if ( "PidHistoMaker" == job ){
		PidHistoMaker pps;
		pps.init( config, "PidHistoMaker.", jobIndex  );
		pps.run();
	} 
	else if ( "PidDataMaker" == job ){
		PidDataMaker pdm;
		pdm.init( config, "PidDataMaker.", jobIndex  );
		pdm.run();
	} 
	else if ( "SimultaneousTPid" == job ){
		cout << "WOW:" << endl;
		// int iCharge = atoi( fileList.c_str() );
		// if ( "" == fileList )
		// 	iCharge = -2;
		// int iCen = atoi( jobPrefix.c_str() );
		// if ( "" == jobPrefix )
		// 	iCen = -1;

		// FitRunner fr( config, "SimultaneousPid.", iCharge, iCen );
		// fr.make();

	}  
	else if ( "ApplyPostCorr" == job ){
		ApplyPostCorr apc( config, "ApplyPostCorr." );
		apc.make();
	} 
	
}

void ssGo( XmlConfig &config, string fileList, string jobPrefix ){
	cout << "ssGo" << endl;
	string job = config.getString( "jobType" );

	// if ( "InclusiveSpectra" == job ){<commit_msg>working on Engine for Fitter<commit_after>

// STL
#include <iostream>
#include <exception>
#include <stdlib.h> // for atoi

// RooBarb
#include "Logger.h"
#include "LoggerConfig.h"
#include "XmlConfig.h"
using namespace jdb;

// Rcp Maker

// Spectra 
	#include "Spectra/InclusiveSpectra.h"
	#include "Spectra/PidHistoMaker.h"
	#include "Spectra/PidDataMaker.h"
	#include "Spectra/TofEffSpectra.h"


// // McMaker
	#include "McMaker/TofEffMaker.h"
	#include "McMaker/EnergyLoss.h"
	#include "McMaker/TofEffFitter.h"
	#include "McMaker/TpcEffFitter.h"
	#include "McMaker/TpcEffMaker.h"

// // Presentation
// 	#include "Present/PidYieldPresenter.h"

// // Feed down
	#include "McMaker/FeedDownMaker.h"
	#include "McMaker/FeedDownFitter.h"


// // PID Fitting
	#include "TSF/FitRunner.h"
	using namespace TSF;

// // Corrections
	#include "Correction/ApplyPostCorr.h"


void ssGo( XmlConfig &config, string fileList, string jobPrefix );
void conGo( XmlConfig &config, int jobIndex );

int main( int argc, char* argv[] ) {

	Logger::setGlobalLogLevel( "all" );

	cout << "Arguments " << argc << endl;

	if ( argc >= 2 ){

		try{
			XmlConfig config( argv[ 1 ] );
			//config.report();

			LoggerConfig::setup( &config, "Logger" );

			string fileList = "";
			string jobPrefix = "";

			cout << "Arguments " << argc << endl;
			if ( argc >= 4 ){
				fileList = argv[ 2 ];
				jobPrefix = argv[ 3 ];
				ssGo( config, fileList, jobPrefix );
			} else if ( argc >= 3 ){
				int jobIndex = atoi( argv[2] );
				conGo( config, jobIndex );
			} else {
				conGo( config, -1 );
			}
		}catch ( exception &e ){
			cout << "HEllo" << endl;
			cout << e.what() << endl;
		}
	}
	
	return 0;

}



void conGo( XmlConfig &config, int jobIndex ){

	cout << "conGo" << endl;
	string job = config.getString( "jobType" );

	if ( "InclusiveSpectra" == job ){
		InclusiveSpectra is;
		is.init( config, "InclusiveSpectra.", jobIndex );
		is.run();
	}
	else if ( "TofEffSpectra" == job ){
		TofEffSpectra tes;
		tes.init( config, "TofEffSpectra.", jobIndex );
		tes.run();
	} 
	else if ( "TofEffFitter" == job ){
		TofEffFitter tef( config, "TofEffFitter." );
		tef.make();     
	} 
	else if ( "EnergyLoss" == job ){
		EnergyLoss el;
		el.init( config, "EnergyLoss.", jobIndex );
		el.run();
	} 
	else if ( "TpcEffMaker" == job ){
		TpcEffMaker tem;
		tem.init( config, "TpcEffMaker.", jobIndex );
		tem.run();
	} 
	else if ( "TpcEffFitter" == job ){
		TpcEffFitter tef( config, "TpcEffFitter." );
		tef.make();
	} 
	else if ( "FeedDownMaker" == job ){
		FeedDownMaker fdm;
		fdm.init( config, "FeedDownMaker.", jobIndex );
		fdm.run();
	}
	else if ( "FeedDownFitter" == job ){
		FeedDownFitter fdf( config, "FeedDownFitter." );
		fdf.make();
	}
	else if ( "PidHistoMaker" == job ){
		PidHistoMaker pps;
		pps.init( config, "PidHistoMaker.", jobIndex  );
		pps.run();
	} 
	else if ( "PidDataMaker" == job ){
		PidDataMaker pdm;
		pdm.init( config, "PidDataMaker.", jobIndex  );
		pdm.run();
	} 
	else if ( "SimultaneousTPid" == job ){
		cout << "WOW:" << endl;
		// int iCharge = atoi( fileList.c_str() );
		// if ( "" == fileList )
		// 	iCharge = -2;
		// int iCen = atoi( jobPrefix.c_str() );
		// if ( "" == jobPrefix )
		// 	iCen = -1;

		// FitRunner fr( config, "SimultaneousPid.", iCharge, iCen );
		// fr.make();

	}  
	else if ( "ApplyPostCorr" == job ){
		ApplyPostCorr apc( config, "ApplyPostCorr." );
		apc.make();
	} 
	
}

void ssGo( XmlConfig &config, string fileList, string jobPrefix ){
	cout << "ssGo" << endl;
	string job = config.getString( "jobType" );
	if ( "SimultaneousTPid" == job ){
		cout << "WOW:" << endl;
		int iCharge = atoi( fileList.c_str() );
		if ( "" == fileList )
			iCharge = -2;
		int iCen = atoi( jobPrefix.c_str() );
		if ( "" == jobPrefix )
			iCen = -1;

		FitRunner fr( config, "SimultaneousPid.", iCharge, iCen );
		fr.make();

	}
	
	// if ( "InclusiveSpectra" == job ){
{'fraction_non_alphanumeric': 0.17635243706480985, 'fraction_numerical': 0.0032137118371719335, 'mean_word_length': 3.1633221850613156, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 15, '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': '5061712', 'n_tokens_mistral': 3296, 'n_tokens_neox': 2974, 'n_words': 671}