From c4614c3563c734202241672bdccab3d83e2d9602 Mon Sep 17 00:00:00 2001 From: Hideki Date: Fri, 18 Feb 2022 05:46:21 +0900 Subject: [PATCH] debug TsMerger & TsTrreeObject --- include/TsMerger.h | 48 +++++++++++++++++++++++++++++++----------- include/TsTreeObject.h | 26 +++++++++++++++++------ 2 files changed, 55 insertions(+), 19 deletions(-) diff --git a/include/TsMerger.h b/include/TsMerger.h index daa38c5..71814f8 100644 --- a/include/TsMerger.h +++ b/include/TsMerger.h @@ -24,8 +24,8 @@ class TsMerger TFile* output_file = nullptr; TTree* output = nullptr; - ULong64_t search_window_offset = 0; - ULong64_t search_window_width = 0; + Long64_t search_window_offset = 0; + Long64_t search_window_width = 0; std::string class_name = " "; @@ -45,7 +45,7 @@ class TsMerger } - void set_search_window( const ULong64_t width, const ULong64_t offset = 0){ + void set_search_window( const Long64_t width, const Long64_t offset = 0){ search_window_offset = offset; search_window_width= width; } @@ -63,21 +63,23 @@ class TsMerger std::cout << class_name << "about to merge " << endl; for (auto itr=0; itr < base_obj.get_size() ; itr++ ) { - ULong64_t base_ts = base_obj.get_time_stamp(); - ULong64_t from = base_ts + search_window_offset; - ULong64_t to = from + search_window_width; + //for (auto itr=0; itr < 10 ; itr++ ) { + Long64_t base_ts = (Long64_t)base_obj.get_time_stamp(); + Long64_t from = base_ts + search_window_offset; + Long64_t to = from + search_window_width; - std::cout << "base.ts" << base_ts << std::endl; - std::cout << "sub.ts" << sub_obj.get_time_stamp() << std::endl; + //std::cout << "base.ts" << base_ts << std::endl; + //std::cout << "sub.ts" << sub_obj.get_time_stamp() << std::endl; - std::cout << "Search Window : " << from << " ~ " << to << std::endl; + //std::cout << "Search Window : " << from << " ~ " << to << std::endl; - if (sub_obj.search(from, to) ) {} else {break;} + if (sub_obj.search(from, to) ) {} else {continue;} - while( sub_obj.get_time_stamp() <= to && ! sub_obj.end() ) { + + while( (Long64_t)sub_obj.get_time_stamp() <= to && ! sub_obj.end() ) { + // std::cout << "tdiff = "<< (Long64_t)sub_obj.get_time_stamp() - (Long64_t)base_ts < to) return false; } else { - while( get_time_stamp() > from ) back(); + //std::cout << "current ts higher than from" << std::endl; + while( get_time_stamp() > from ) { + back(); + // std::cout << get_time_stamp() << " "; + } + //next(); + if ( get_time_stamp() > to) return false; + next(); + } - std::cout << "search ok, now at " << get_time_stamp() << std::endl; + //std::cout << "search ok, now at " << get_time_stamp(); + //std::cout << " search window * from : " << from << ", to : " << to << std::endl; + //std::cout << " tdiff : " << (long long)get_time_stamp() - (long long)from << std::endl; return true; } -- GitLab