diff --git a/README.md b/README.md index ec39ab1..599ec48 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,19 @@ 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 diff --git a/apps/Analysis.cpp b/apps/Analysis.cpp index f69a84d..b8ab3cd 100644 --- a/apps/Analysis.cpp +++ b/apps/Analysis.cpp @@ -33,7 +33,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) @@ -379,6 +409,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{std::numeric_limits::max()}; @@ -545,7 +581,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 @@ -577,7 +613,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; @@ -597,7 +633,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 /* * * @@ -652,7 +688,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 { @@ -684,7 +720,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);