From 9eabbd96f0fd5684595d4f2b4804162d3105a050 Mon Sep 17 00:00:00 2001 From: MaftyNaveyuErin <87958887+MaftyNaveyuErin@users.noreply.github.com> Date: Fri, 30 Jul 2021 17:26:18 +0800 Subject: [PATCH 1/7] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ec39ab1..e4d4710 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,9 @@ Analysis code for RPClab | | Linux Clang | Linux GCC | MacOS Clang | Windows M2sys | Windows MSVC | |-------------------|-------------------|-------------------|-------------------|-------------------|-------------------| | Github |[![Linux Clang](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml) | [![Linux GCC](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml) | [![MacOS Clang](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml) | [![Windows M2sys](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml) | [![Windows MSVC](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml) | + + +line 35-49 add a functioin to judge whether the channel is triggers +line 448-465 I add 17 channels +line 471 I add an if to judge if it is a chaanel +line 555 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers From dd3f5d32ede5bea2fb3dd2d09953c9819d10b344 Mon Sep 17 00:00:00 2001 From: MaftyNaveyuErin <87958887+MaftyNaveyuErin@users.noreply.github.com> Date: Sat, 31 Jul 2021 12:45:14 +0800 Subject: [PATCH 2/7] Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e4d4710..4c81145 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,11 @@ Analysis code for RPClab | Github |[![Linux Clang](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml) | [![Linux GCC](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml) | [![MacOS Clang](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml) | [![Windows M2sys](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml) | [![Windows MSVC](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml) | -line 35-49 add a functioin to judge whether the channel is triggers -line 448-465 I add 17 channels -line 471 I add an if to judge if it is a chaanel -line 555 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers +line 35-49 add a function to judge whether the channel is triggers +line 51-65 add a function to judge whether the channel needs to be analysed +line 220 fix the error +line 411 add an option to determine the channels need to be analysed +line 448-465 I add 17 channels +line 471 I add an if to judge if it is a chaanel +line 555 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers +534 From d599d2455b0154ac88d7328a56a6fb7d2467452c Mon Sep 17 00:00:00 2001 From: MaftyNaveyuErin <87958887+MaftyNaveyuErin@users.noreply.github.com> Date: Mon, 2 Aug 2021 12:16:01 +0800 Subject: [PATCH 3/7] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c81145..b44bc77 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,7 @@ line 220 fix the error line 411 add an option to determine the channels need to be analysed line 448-465 I add 17 channels line 471 I add an if to judge if it is a chaanel -line 555 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers -534 +line 576 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers +line 606 chage the condition +line 628 a new comment +line 682 change the condition From 53e776f47ac561ab2792c0eb094af9213492885b Mon Sep 17 00:00:00 2001 From: zhujiyang Date: Mon, 2 Aug 2021 21:17:19 +0800 Subject: [PATCH 4/7] for more channels --- apps/Analysis.cpp | 60 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/apps/Analysis.cpp b/apps/Analysis.cpp index 3ab3714..7dc3c5f 100644 --- a/apps/Analysis.cpp +++ b/apps/Analysis.cpp @@ -32,7 +32,37 @@ namespace fs = std::filesystem; #include #endif // Windows/Linux +int istrigger(int ch, std::vector& triggers) +{ + int i=0; + int result=0; + for(i=0;i& analysedchannels) +{ + int i=0; + int result=0; + for(i=0;i,std::pair> getMinMax(const Channel& std::size_t begin_{0}; std::size_t end_{channel.Data.size()}; if(begin>0) begin_=begin; - if(end!=-1||end<=channel.Data.size()) end_= end; + if(end!=-1&&end<=channel.Data.size()) end_= end; for(std::size_t j = begin_; j != end_; ++j) { if(channel.Data[j]>max) @@ -377,6 +407,9 @@ int main(int argc, char** argv) double NbrSigma=5.0; app.add_option("--sigma", NbrSigma, "Number of sigma above the mean noise"); + + std::vector analysedchannels{0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16} + app.add_option("--analysed", analysedchannels," channels want to be analysed"); try { @@ -439,22 +472,25 @@ int main(int argc, char** argv) channels.activateChannel(5, "N"); channels.activateChannel(6, "N"); channels.activateChannel(7, "N"); - // channels.activateChannel(8, "N"); - /* channels.activateChannel(9, "N"); + channels.activateChannel(8, "N"); + channels.activateChannel(9, "N"); channels.activateChannel(10, "N"); channels.activateChannel(11, "N"); channels.activateChannel(12, "N"); channels.activateChannel(13, "N"); channels.activateChannel(14, "N"); channels.activateChannel(15, "N"); - channels.activateChannel(16, "N");*/ + channels.activateChannel(16, "N"); std::map mins; for(auto channel : channels.getChannels()) { - mins[channel.first]=TH1D("min position distribution","min position distribution",1024,0,1024); - std::cout<<"*****"<clear(); - Run->GetEntry(evt); + Run->GetEntry(evt); std::vector Plots(event->Channels.size()); float min=+9999.0; @@ -537,7 +573,7 @@ int main(int argc, char** argv) double delta_t_new{0}; for(unsigned int ch = 0; ch != event->Channels.size(); ++ch) { - if(channels.DontAnalyseIt(ch)) continue; // Data for channel X is in file but i dont give a *** to analyse it ! + if(istrigger(ch,triggers)) continue; // Data for channel X is in file but i dont give a *** to analyse it ! maybe there need to be discussed @@ -569,7 +605,7 @@ int main(int argc, char** argv) ///BAD PLEASE FIX THIS !!! std::pair SignalWindow2; - if(ch<=8) + if(ischannel(ch,analysedchannels)) { SignalWindow2.first=trigger_ticks[8]-SignalWindow.second-SignalWindow.first/2; SignalWindow2.second=trigger_ticks[8]-SignalWindow.second+SignalWindow.first/2; @@ -589,7 +625,7 @@ int main(int argc, char** argv) */ std::pair,std::pair> min_max=getMinMax(event->Channels[ch]); mins[ch].Fill(trigger_ticks[8]-min_max.first.second); - total.Fill(trigger_ticks[8]-min_max.first.second); + total.Fill(trigger_ticks[8]-min_max.first.second); //maybe need to be modified when there are more triggers /* * * @@ -643,7 +679,7 @@ int main(int argc, char** argv) Plots[ch].GetYaxis()->SetLabelSize(0.07); Plots[ch].SetStats(); Plots[ch].SetTitle(";"); - if(ch==7) + if(ch==analysedchannels.back()) //maybe some problem { @@ -675,7 +711,7 @@ int main(int argc, char** argv) event_min.SetLineStyle(5); event_min.SetLineColor(kRed); - event_min.DrawLine(0,min_max.first.second,1024,min_max.first.second); + event_min.DrawLine(0,min_max.first.second,1024,min_max.first.second); //there may be a problem, if you want to draw a line to show the minmum, the parameter should be min_max.first.first //Mean noise event_min.SetLineColor(46); From b0d7948bdcbc23017e62acba63c9b13746172daa Mon Sep 17 00:00:00 2001 From: zhujiyang Date: Mon, 2 Aug 2021 21:18:06 +0800 Subject: [PATCH 5/7] changed --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index ec39ab1..2b4c162 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,14 @@ Analysis code for RPClab | | Linux Clang | Linux GCC | MacOS Clang | Windows M2sys | Windows MSVC | |-------------------|-------------------|-------------------|-------------------|-------------------|-------------------| | Github |[![Linux Clang](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml) | [![Linux GCC](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml) | [![MacOS Clang](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml) | [![Windows M2sys](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml) | [![Windows MSVC](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml) | +line 35-49 add a function to judge whether the channel is triggers +line 51-65 add a function to judge whether the channel needs to be analysed +line 220 fix the error +line 411 add an option to determine the channels need to be analysed +line 466-483 I add 17 channels +line 489 I add an if to judge if it is a chaanel +line 576 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers +line 608 chage the condition +line 628 a new comment +line 682 change the condition +line 714 there may be a problem From c3683e87a75caddc345849f2202b0bbc4e2f3f73 Mon Sep 17 00:00:00 2001 From: zhujiyang Date: Mon, 2 Aug 2021 22:08:04 +0800 Subject: [PATCH 6/7] readme --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index a7d9fe6..2b4c162 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,10 @@ Analysis code for RPClab | | Linux Clang | Linux GCC | MacOS Clang | Windows M2sys | Windows MSVC | |-------------------|-------------------|-------------------|-------------------|-------------------|-------------------| | Github |[![Linux Clang](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml) | [![Linux GCC](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml) | [![MacOS Clang](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml) | [![Windows M2sys](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml) | [![Windows MSVC](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml) | -<<<<<<< HEAD -======= - - ->>>>>>> d599d2455b0154ac88d7328a56a6fb7d2467452c line 35-49 add a function to judge whether the channel is triggers line 51-65 add a function to judge whether the channel needs to be analysed line 220 fix the error line 411 add an option to determine the channels need to be analysed -<<<<<<< HEAD line 466-483 I add 17 channels line 489 I add an if to judge if it is a chaanel line 576 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers @@ -22,11 +16,3 @@ line 608 chage the condition line 628 a new comment line 682 change the condition line 714 there may be a problem -======= -line 448-465 I add 17 channels -line 471 I add an if to judge if it is a chaanel -line 576 change the condition to judge whether the channels need analyse I think the channels you don't want to analyse is triggers -line 606 chage the condition -line 628 a new comment -line 682 change the condition ->>>>>>> d599d2455b0154ac88d7328a56a6fb7d2467452c From 0bfcd8db8bd459ad98b7643e07b84cf960f8f8f0 Mon Sep 17 00:00:00 2001 From: zhujiyang Date: Mon, 2 Aug 2021 22:09:03 +0800 Subject: [PATCH 7/7] readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 2b4c162..599ec48 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ Analysis code for RPClab | | Linux Clang | Linux GCC | MacOS Clang | Windows M2sys | Windows MSVC | |-------------------|-------------------|-------------------|-------------------|-------------------|-------------------| | Github |[![Linux Clang](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-Clang.yml) | [![Linux GCC](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Linux-GCC.yml) | [![MacOS Clang](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/MacOS-Clang.yml) | [![Windows M2sys](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-M2sys.yml) | [![Windows MSVC](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml/badge.svg)](https://github.com/RPClab/Analysis/actions/workflows/Windows-MSVC.yml) | + + + + + line 35-49 add a function to judge whether the channel is triggers line 51-65 add a function to judge whether the channel needs to be analysed line 220 fix the error