Commit 02427975 authored by Florent Robinet's avatar Florent Robinet
Browse files

wip

parent 696e9781
......@@ -4,7 +4,7 @@ use GWOLLUM v3r1p0
setup_script $(OMICRONROOT)/$(Omicron_tag)/$(OMICRONCONFIG)/etc/omicron.env
apply_pattern pb_cmake execs="omicron omicron-print omicron-listfile omicron-plot"
apply_pattern pb_cmake execs="omicron omicron-print omicron-listfile omicron-plot omicron-coinc"
include_path "$(OMICRONROOT)/$(Omicron_tag)/include"
......
......@@ -210,21 +210,21 @@ target_link_libraries(
OmicronUtils
)
#add_executable(
# omicron-coinc
# omicron-coinc.cc
# )
#target_link_libraries(
# omicron-coinc
# ${ROOT_Core_LIBRARY}
# ${ROOT_Graf_LIBRARY}
# CUtils
# RootUtils
# Segments
# Triggers
# Coinc
# OmicronUtils
# )
add_executable(
omicron-coinc
omicron-coinc.cc
)
target_link_libraries(
omicron-coinc
${ROOT_Core_LIBRARY}
${ROOT_Graf_LIBRARY}
CUtils
RootUtils
Segments
Triggers
Coinc
OmicronUtils
)
#add_executable(
# omicron-metric-print
......@@ -284,7 +284,7 @@ install(
# omicron-scanfile
omicron-plot
omicron-print
# omicron-coinc
omicron-coinc
# omicron-metric-print
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
......
......@@ -174,8 +174,8 @@ int main (int argc, char* argv[]){
string chname2=""; // channel2 name
string tfile_pat1=""; // trigger file pattern 1
string tfile_pat2=""; // trigger file pattern 2
int gps_start=-1; // GPS start
int gps_end=-1; // GPS end
unsigned int gps_start=0;// GPS start
unsigned int gps_end=0;// GPS end
double snr_min1=7.0; // SNR min 1
double snr_min2=7.0; // SNR min 2
double cluster_dt=0.1; // cluster time window
......@@ -194,8 +194,8 @@ int main (int argc, char* argv[]){
if(!sarg[0].compare("channel2")) chname2=(string)sarg[1];
if(!sarg[0].compare("file1")) tfile_pat1=sarg[1];
if(!sarg[0].compare("file2")) tfile_pat2=sarg[1];
if(!sarg[0].compare("gps-start")) gps_start=atoi(sarg[1].c_str());
if(!sarg[0].compare("gps-end")) gps_end=atoi(sarg[1].c_str());
if(!sarg[0].compare("gps-start")) gps_start=stoul(sarg[1].c_str());
if(!sarg[0].compare("gps-end")) gps_end=stoul(sarg[1].c_str());
if(!sarg[0].compare("snr-min1")) snr_min1=atof(sarg[1].c_str());
if(!sarg[0].compare("snr-min2")) snr_min2=atof(sarg[1].c_str());
if(!sarg[0].compare("cluster-dt")) cluster_dt=atof(sarg[1].c_str());
......@@ -238,33 +238,32 @@ int main (int argc, char* argv[]){
// triggers
ReadTriggers *RT1 = new ReadTriggers(tfile_pat1,"",0);
if(!RT1->GetStatus()||!RT1->GetSegments()->GetLiveTime()) return 5;
if(!RT1->GetStatus()||!RT1->GetLiveTime()) return 5;
ReadTriggers *RT2 = new ReadTriggers(tfile_pat2,"",0);
if(!RT2->GetStatus()||!RT2->GetSegments()->GetLiveTime()) return 5;
if(!RT2->GetStatus()||!RT2->GetLiveTime()) return 5;
// clustering
RT1->SetClusterizeDt(cluster_dt);
RT1->SetClusterizeSNRthr(snr_min1);
RT1->SetClusterizeSnrThr(snr_min1);
RT1->Clusterize(1);
RT2->SetClusterizeDt(cluster_dt);
RT2->SetClusterizeSNRthr(snr_min2);
RT2->SetClusterizeSnrThr(snr_min2);
RT2->Clusterize(1);
// valid segments
if(gps_start<0.0) gps_start=TMath::Min(RT1->GetTimeMin(), RT2->GetTimeMin());
if(gps_end<0.0) gps_end=TMath::Max(RT1->GetTimeMax(), RT2->GetTimeMax());
if(gps_start=0) gps_start=TMath::Min(RT1->Segments::GetFirst(), RT2->Segments::GetLast());
if(gps_end=0) gps_end=TMath::Max(RT1->Segments::GetFirst(), RT2->Segments::GetLast());
Segments *seg = new Segments(gps_start, gps_end);
seg->Intersect(RT1->GetSegments());
seg->Intersect(RT2->GetSegments());
seg->Intersect(RT1);
seg->Intersect(RT2);
// coinc
Coinc2 *Co = new Coinc2(0);
Co->SetTriggerSamples(RT1, RT2, 0, 0, seg);
if(coinc_dt<0) coinc_dt = cluster_dt;
Co->SetCoincDt(coinc_dt);
int ncoinc = Co->MakeCoinc0();
if(ncoinc<0) return 6;
Co->SetTriggers(RT1, RT2, 0.0, 0.0, seg);
if(coinc_dt<0) coinc_dt = 0.0;
Co->SetCoincDeltat(coinc_dt);
unsigned int ncoinc = Co->MakeCoinc();
// print
if(print_list_nocoinc1) Co->PrintNoCoinc(0);
if(print_list_nocoinc2) Co->PrintNoCoinc(1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment