Skip to content

Commit

Permalink
Further fixing the name for DEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
billlee77 committed Mar 5, 2020
1 parent 3a42e83 commit 42b1ee0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"experiment" : "solid",
//"experiment" : "eic",

// "file_name" : "example_output",
"n_events" : 10000,
// "output_file" : "RootFiles/Test.root",

//**************************************
/// This section if for EIC simulation only
"file_name" : "example_output",
"Targ_dir" : 1, // Target Direction (1->Up, 2->Down)
"Kinematics_type" : 1, // Kinematics type (1->FF, 2->TSSA)

Expand Down
4 changes: 2 additions & 2 deletions include/TreeBuilder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class TreeBuilder
int nVars;

const char* tree_name;
const char* file_name;
// const char* file_name;

TTree * Tree_Out;
TFile * File_Out;

void Retrieve();
public:

TreeBuilder(const char * name);
TreeBuilder(const char*, const char*);

void AddParticle(Particle * p);
void AddDouble(double * x, const char* name);
Expand Down
15 changes: 7 additions & 8 deletions src/TreeBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@

using namespace std;

TreeBuilder::TreeBuilder(const char * name)
{
TreeBuilder::TreeBuilder(const char * file_name, const char * name) {

extern Json::Value obj;

tree_name = name;
string str_copy = "RootFiles/" + obj["file_name"].asString() + ".root";
file_name = str_copy.c_str();

cout << obj["output_file"].asString() << endl;

cout << file_name << endl;
// string str_copy = "RootFiles/" + obj["file_name"].asString() + ".root";
// file_name = str_copy.c_str();
//
// cout << obj["output_file"].asString() << endl;
// cout << file_name << endl;
// cout << file_name <<endl;

cout << file_name <<endl;

File_Out = new TFile(file_name, "RECREATE");
Tree_Out = new TTree(tree_name, tree_name);
Expand Down
10 changes: 5 additions & 5 deletions src/eic_evgen/eic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ void eic() {
cout << "Enter the number of events: "; cin >> fNEvents; cout << endl;
cout << "Enter the file number: "; cin >> fNFile; cout << endl;

eic(target_direction, kinematics_type, fNEvents);
// eic(target_direction, kinematics_type, fNEvents);

}



void eic(int event_number, int target_direction, int kinematics_type) {
void eic(int event_number, int target_direction, int kinematics_type, TString file_name) {


fNFile = 1;
Expand Down Expand Up @@ -81,11 +81,11 @@ void eic(int event_number, int target_direction, int kinematics_type) {


string sTFile;
sTFile = Form("./LundFiles/eic_demp_%i.txt",(int)fNFile);
sTFile = Form("./LundFiles/eic_%s.txt", file_name.Data());
string sRFile;
sRFile = Form("./RootFiles/eic_demp_%i.root",(int)fNFile);
sRFile = Form("./RootFiles/eic_%s.root", file_name.Data());
string sLFile;
sLFile= Form("./LundFiles/input_%i.dat",(int)fNFile);
sLFile= Form("./LundFiles/eic_input_%s.dat", file_name.Data());

ofstream ppiOut ( sLFile.c_str() );
ofstream ppiDetails ( sTFile.c_str() );
Expand Down
2 changes: 1 addition & 1 deletion src/eic_evgen/eic.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


void eic();
void eic(int, int, int);
void eic(int, int, int, TString);



Expand Down
5 changes: 4 additions & 1 deletion src/main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ int main(int argc, char** argv){

int event_status = 0;

TreeBuilder * Output = new TreeBuilder("t1");

file_name = "RootFiles/Solid_DEMP_" + file_name + ".root";

TreeBuilder * Output = new TreeBuilder(file_name.Data(), "t1");

Output->AddEvent(VertEvent);
//Output->AddEvent(CofMEvent);
Expand Down

0 comments on commit 42b1ee0

Please sign in to comment.