From 08a2f61262449ac0c3ec05f6bcf2048686247e78 Mon Sep 17 00:00:00 2001 From: Benjamin Linnik Date: Wed, 25 Feb 2015 19:05:10 +0100 Subject: [PATCH] Run analyzer: Code cleanup --- MABS_run_analyzer/ChargeSpektrum.c | 19 ++++++ MABS_run_analyzer/MAPS.c | 92 +++++++++++++---------------- MABS_run_analyzer/MAPS.h | 5 +- MABS_run_analyzer/Run.c | 17 +++++- MABS_run_analyzer/Run.h | 2 +- MABS_run_analyzer/Run_analyzer.h | 2 +- MABS_run_analyzer/doxygenconfig.cfg | 4 +- 7 files changed, 80 insertions(+), 61 deletions(-) diff --git a/MABS_run_analyzer/ChargeSpektrum.c b/MABS_run_analyzer/ChargeSpektrum.c index 6c7eaa5..6c1cf09 100644 --- a/MABS_run_analyzer/ChargeSpektrum.c +++ b/MABS_run_analyzer/ChargeSpektrum.c @@ -1,6 +1,25 @@ +/** + * @file ChargeSpektrum.c + * @brief Use brief, otherwise the index won't have a brief explanation. + * + * Detailed explanation. + * + * + */ + #include "Run.h" #include "MAPS.h" + +/** + * @file + * @brief Use brief, otherwise the index won't have a brief explanation. + * + * Detailed explanation. + * + * + */ + // bad c- style fix me #include "Run.c" #include "MAPS.c" diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index 8287669..e6d201b 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -1,3 +1,12 @@ +/** + * @file MAPS.c + * @brief Use brief, otherwise the index won't have a brief explanation. + * + * Detailed explanation. + * + * + */ + #include"MAPS.h" #include "Run.h" @@ -30,7 +39,6 @@ MAPS::MAPS(Run* runp) { } sleep(1); // TODO test if removable - if ( checkConf(fPixelsData) ) // TODO FileEvNbInConfig { //----------------------------------------------- @@ -116,7 +124,7 @@ void MAPS::initMapsRun( ) { fRootFile = fInDir+Form("/RUN_%i_i.root",fRunNumber); cout<<"================================================================="< 5 * sigma @@ -792,16 +798,13 @@ bool MAPS::InitialDynNoise(Int_t startframe, Int_t frames) { for(Int_t framei=startframe; frameiFill(); } } } - if ( fFrameNumber%10000==0) - { - debugStream<>(fPedestals, fPixels, fColumns, 2); - } +// debug +// if ( fFrameNumber%10000==0) +// { +// debugStream<>(fPedestals, fPixels, fColumns, 2); +// } return true; } @@ -1282,6 +1278,7 @@ void MAPS::hitana() { } } } +// debug // for(Int_t row=0; row<5; row++) // { // for(Int_t column=0; column<5; column++) @@ -1446,7 +1443,6 @@ void MAPS::filterCommonMode() { for(int column=0; column " << CommonModeInRow << endl; -// } - if(TMath::Abs(CommonModeInRow)>20) // TODO better warning criteria { warning = true; @@ -1478,10 +1466,10 @@ void MAPS::filterCommonMode() { fCdsmatrix[ row*fColumns+column ] -= CommonModeInRow; } } - if ( fFrameNumber%10000==0) - { - debugStream<>(fPedestals, fPixels, fColumns, 2); - } +// if ( fFrameNumber%10000==0) +// { +// debugStream<>(fPedestals, fPixels, fColumns, 2); +// } } //#################################################################### diff --git a/MABS_run_analyzer/MAPS.h b/MABS_run_analyzer/MAPS.h index ac72e38..19842e2 100644 --- a/MABS_run_analyzer/MAPS.h +++ b/MABS_run_analyzer/MAPS.h @@ -52,14 +52,14 @@ class Run; /** - * @file + * @file MAPS.h * @brief Use brief, otherwise the index won't have a brief explanation. * * Detailed explanation. * * */ -class MAPS { +class MAPS { private: /// Input Directory, set and passed initMapsRun() to in the constructor @@ -382,6 +382,7 @@ public: // pointer to TTree with hit, frame and cluster information TTree* fHitTree; + Bool_t useexponentialdecayingnoisewindow = 0; Long_t plus = 0; Long_t minus = 0; diff --git a/MABS_run_analyzer/Run.c b/MABS_run_analyzer/Run.c index 1401eb6..2e52091 100644 --- a/MABS_run_analyzer/Run.c +++ b/MABS_run_analyzer/Run.c @@ -1,3 +1,12 @@ +/** + * @file Run.c + * @brief Use brief, otherwise the index won't have a brief explanation. + * + * Detailed explanation. + * + * + */ + #include "Run.h" using namespace std; @@ -108,7 +117,7 @@ Bool_t Run::analyzeRun(Bool_t force) processed->hitana(); processed->regetDynNoise(); progress = (Int_t)(((i-start)*100)/(nframes-1)*10); -// if (progress!=progress_tmp) { print_progress( (((i-start)*100.)/(nframes-1)) ); progress_tmp=progress;} + if (progress!=progress_tmp) { print_progress( (((i-start)*100.)/(nframes-1)) ); progress_tmp=progress;} } cout << processed->plus << " vs. " << processed->minus << " : " << (processed->plus*1.0)/processed->minus<< endl; // print a dummy file to indicate, that a root file was created once @@ -136,8 +145,9 @@ Bool_t Run::analyzeRun(Bool_t force) // cout << "\033[1;31mError: cannot open " << rootfilepath << "\033[0m\n"; // exit(0); // } - + return true; } + return false; } @@ -155,13 +165,14 @@ Bool_t Run::analyzeFrame(Int_t frame) processed->hitana(); processed->plotFrame(frame); binNoise(); + return true; } else { cout << "\033[1;33mFrame number too big, max frame: " << entries << "\033[0m" << endl; } - } + return false; } // generateSeedSpectrum() diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index 237a4f4..3eebd9e 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -27,8 +27,8 @@ #include "MAPS.h" class MAPS; - /** + * @file Run.h * @brief Has all the raw and processed information about a specific run * * This class makes SQL requests to the server, gets database results to a given runnumber, diff --git a/MABS_run_analyzer/Run_analyzer.h b/MABS_run_analyzer/Run_analyzer.h index f630a1b..0049ae0 100644 --- a/MABS_run_analyzer/Run_analyzer.h +++ b/MABS_run_analyzer/Run_analyzer.h @@ -8,7 +8,7 @@ Int_t numberRuns=0; /** - * @file + * @file Run_analyzer.h * @brief Analyze and plot MABS runs * * Detailed explanation. diff --git a/MABS_run_analyzer/doxygenconfig.cfg b/MABS_run_analyzer/doxygenconfig.cfg index d2c864e..f79afb2 100644 --- a/MABS_run_analyzer/doxygenconfig.cfg +++ b/MABS_run_analyzer/doxygenconfig.cfg @@ -788,12 +788,12 @@ FILTER_SOURCE_PATTERNS = # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. -INLINE_SOURCES = NO +INLINE_SOURCES = YES # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code -- 2.43.0