Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
lastgeorge committed Aug 29, 2024
1 parent 9b006f1 commit 35df037
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
13 changes: 8 additions & 5 deletions apps/merge_glee.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ int main( int argc, char** argv )
TString outfile_name = argv[3];

Int_t gl_run, gl_sub, gl_evt, gl_sel_type, gl_file_type;
Float_t gl_true_Enu, gl_true_Elep, gl_reco_Eshower, gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight,gl_overlap_weight, gl_wc_total_overlapped_weight;
Float_t gl_true_Enu, gl_true_Elep, gl_reco_Eshower, gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight,gl_overlap_weight, gl_overlap_weight_tweaked, gl_wc_total_overlapped_weight;



std::map<std::pair<int, int>, std::tuple<Int_t, Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t> > map_gl_info;
std::map<std::pair<int, int>, std::tuple<Int_t, Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t> > map_gl_info;
std::set<std::pair<int, int> > set_gl_rs;

// read in PeLEE Np
Expand All @@ -63,11 +63,11 @@ int main( int argc, char** argv )
while(!infile.eof()){

infile >> gl_run >> gl_sub >> gl_evt >> gl_sel_type >> gl_file_type >>
gl_true_Enu >> gl_true_Elep >> gl_reco_Eshower >> gl_reco_shower_dirz >> gl_reco_shower_implied_dirz >> gl_simple_pot_weight >> gl_rem_orig_wc_pot_weight >> gl_new_pot_weight >> gl_overlap_weight >> gl_wc_total_overlapped_weight;
gl_true_Enu >> gl_true_Elep >> gl_reco_Eshower >> gl_reco_shower_dirz >> gl_reco_shower_implied_dirz >> gl_simple_pot_weight >> gl_rem_orig_wc_pot_weight >> gl_new_pot_weight >> gl_overlap_weight >> gl_overlap_weight_tweaked >> gl_wc_total_overlapped_weight;

// std::cout << gl_run << " " << gl_true_Elep << std::endl;

map_gl_info[std::make_pair(gl_run, gl_evt)] = std::make_tuple(gl_sel_type, gl_file_type, gl_true_Enu, gl_true_Elep, gl_reco_Eshower, gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight, gl_overlap_weight, gl_wc_total_overlapped_weight);
map_gl_info[std::make_pair(gl_run, gl_evt)] = std::make_tuple(gl_sel_type, gl_file_type, gl_true_Enu, gl_true_Elep, gl_reco_Eshower, gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight, gl_overlap_weight, gl_overlap_weight_tweaked, gl_wc_total_overlapped_weight);
set_gl_rs.insert(std::make_pair(gl_run, gl_sub));
}

Expand Down Expand Up @@ -408,6 +408,7 @@ int main( int argc, char** argv )
t1->Branch("gl_rem_orig_wc_pot_weight",&gl_rem_orig_wc_pot_weight,"gl_rem_orig_wc_pot_weight/F");
t1->Branch("gl_new_pot_weight",&gl_new_pot_weight,"gl_new_pot_weight/F");
t1->Branch("gl_overlap_weight",&gl_overlap_weight,"gl_overlap_weight/F");
t1->Branch("gl_overlap_weight_tweaked",&gl_overlap_weight_tweaked,"gl_overlap_weight_tweaked/F");
t1->Branch("gl_wc_total_overlapped_weight",&gl_wc_total_overlapped_weight,"gl_wc_total_overlapped_weight/F");


Expand All @@ -433,6 +434,7 @@ int main( int argc, char** argv )
gl_rem_orig_wc_pot_weight = 0;
gl_new_pot_weight = 0;
gl_overlap_weight = 0;
gl_overlap_weight_tweaked = 0;
gl_wc_total_overlapped_weight = 0;


Expand All @@ -449,7 +451,8 @@ int main( int argc, char** argv )
gl_rem_orig_wc_pot_weight = std::get<8>(it1->second);
gl_new_pot_weight = std::get<9>(it1->second);
gl_overlap_weight = std::get<10>(it1->second);
gl_wc_total_overlapped_weight = std::get<11>(it1->second);
gl_overlap_weight_tweaked = std::get<11>(it1->second);
gl_wc_total_overlapped_weight = std::get<12>(it1->second);
}


Expand Down
2 changes: 2 additions & 0 deletions apps/xf_cov_matrix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ int main( int argc, char** argv )
TMatrixD* cov_xf_mat = new TMatrixD(cov_add_mat->GetNrows(), cov_add_mat->GetNcols());
TVectorD* vec_mean = new TVectorD(cov_add_mat->GetNrows());

//std::cout << "test: " << std::endl;

cov.gen_xf_cov_matrix(run, map_covch_hist, map_histoname_hist, vec_mean, cov_xf_mat);

TMatrixD* frac_cov_xf_mat = new TMatrixD(cov_add_mat->GetNrows(), cov_add_mat->GetNcols());
Expand Down
4 changes: 3 additions & 1 deletion inc/WCPLEEANA/eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace LEEana{
// gLEE
Bool_t flag_gl;
Int_t gl_sel_type, gl_file_type;
Float_t gl_true_Enu, gl_true_Elep, gl_reco_Eshower,gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight, gl_overlap_weight,gl_wc_total_overlapped_weight;
Float_t gl_true_Enu, gl_true_Elep, gl_reco_Eshower,gl_reco_shower_dirz, gl_reco_shower_implied_dirz, gl_simple_pot_weight, gl_rem_orig_wc_pot_weight, gl_new_pot_weight, gl_overlap_weight, gl_overlap_weight_tweaked, gl_wc_total_overlapped_weight;
};

void set_tree_address(TTree *tree0, EvalInfo& eval_info, int flag = 1);
Expand Down Expand Up @@ -125,6 +125,7 @@ void LEEana::set_tree_address(TTree *tree0, EvalInfo& eval_info, int flag){
tree0->SetBranchAddress("gl_rem_orig_wc_pot_weight",&eval_info.gl_rem_orig_wc_pot_weight);
tree0->SetBranchAddress("gl_new_pot_weight",&eval_info.gl_new_pot_weight);
tree0->SetBranchAddress("gl_overlap_weight",&eval_info.gl_overlap_weight);
tree0->SetBranchAddress("gl_overlap_weight_tweaked",&eval_info.gl_overlap_weight_tweaked);
tree0->SetBranchAddress("gl_wc_total_overlapped_weight",&eval_info.gl_wc_total_overlapped_weight);
}

Expand Down Expand Up @@ -299,6 +300,7 @@ void LEEana::put_tree_address(TTree *tree0, EvalInfo& eval_info, int flag){
tree0->Branch("gl_rem_orig_wc_pot_weight",&eval_info.gl_rem_orig_wc_pot_weight,"gl_rem_orig_wc_pot_weight/F");
tree0->Branch("gl_new_pot_weight",&eval_info.gl_new_pot_weight,"gl_new_pot_weight/F");
tree0->Branch("gl_overlap_weight",&eval_info.gl_overlap_weight,"gl_overlap_weight/F");
tree0->Branch("gl_overlap_weight_tweaked",&eval_info.gl_overlap_weight_tweaked,"gl_overlap_weight_tweaked/F");
tree0->Branch("gl_wc_total_overlapped_weight",&eval_info.gl_wc_total_overlapped_weight,"gl_wc_total_overlapped_weight/F");
}

Expand Down
6 changes: 3 additions & 3 deletions src/mcm_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void LEEana::CovMatrix::gen_xf_cov_matrix(int run, std::map<int, TH1F*>& map_cov
map_no_histoname[ncount] = histoname;
ncount ++;

// std::cout << histoname << " " << obsch << " " << covch << " " << flag_lee << std::endl;
//std::cout << histoname << " " << obsch << " " << covch << " " << flag_lee << std::endl;
}
}

Expand Down Expand Up @@ -61,7 +61,7 @@ void LEEana::CovMatrix::gen_xf_cov_matrix(int run, std::map<int, TH1F*>& map_cov
if (sup_lengths.at(i) > max_sup_lengths.at(i)) max_sup_lengths.at(i) = sup_lengths.at(i);
}

//std::cout << input_filename << " " << lengths.size() << std::endl;
// std::cout << input_filename << " " << lengths.size() << " " << max_lengths.size() << std::endl;
}

double data_pot = 5e19;
Expand All @@ -77,7 +77,7 @@ void LEEana::CovMatrix::gen_xf_cov_matrix(int run, std::map<int, TH1F*>& map_cov
int nsize = max_lengths.at(j);
int sup_nsize = max_sup_lengths.at(j);

// std::cout << j << " " << nsize << " " << sup_nsize << std::endl;
// std::cout << j << " " << nsize << " " << sup_nsize << std::endl;

TMatrixD temp_mat(rows, rows);
temp_mat.Zero();
Expand Down

0 comments on commit 35df037

Please sign in to comment.