From 03e4c1423e637e093a713b6b568b777b82f3e480 Mon Sep 17 00:00:00 2001 From: Benjamin Linnik Date: Thu, 25 Jun 2015 15:39:28 +0200 Subject: [PATCH] Run analyzer: Added possibility to analyze runs not finished yet --- MABS_run_analyzer/ChargeSpektrum.c | 6 +- MABS_run_analyzer/MAPS.c | 175 ++++++++++++++++------------- MABS_run_analyzer/MAPS.h | 9 ++ MABS_run_analyzer/Run.c | 8 +- 4 files changed, 110 insertions(+), 88 deletions(-) diff --git a/MABS_run_analyzer/ChargeSpektrum.c b/MABS_run_analyzer/ChargeSpektrum.c index a7c1adb..ee658a8 100644 --- a/MABS_run_analyzer/ChargeSpektrum.c +++ b/MABS_run_analyzer/ChargeSpektrum.c @@ -160,8 +160,8 @@ void ChargeSpektrum(TString runnumber = "") if (!isBatch) gROOT->SetBatch(kFALSE); runs[runi]->plotAllHistograms(); -// runs[runi]->plotAllHistogramsThresholdCluster(); -// runs[runi]->plotAllHistogramsThresholdClusterCalibrated(); +// runs[runi]->plotAllHistogramsThresholdCluster(); + runs[runi]->plotAllHistogramsThresholdClusterCalibrated(); runs[runi]->plotAllHistogramsCalibrated(); runs[runi]->writeAllHistogramsToFile(); } @@ -171,6 +171,6 @@ void ChargeSpektrum(TString runnumber = "") // plotAllRuns(""); plotAllRuns("seed calibrated"); // writeObservableToFile("seed threshold calibrated"); - writeObservableToFile("seed threshold"); +// writeObservableToFile("seed threshold"); writeObservableToFile("seed threshold calibrated"); } diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index c692665..427a817 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -43,34 +43,33 @@ MAPS::MAPS(Run* runp) { Bool_t MAPS::initNewRootFile() { fSave = true; - if ( checkConf(fPixelsData) ) // TODO FileEvNbInConfig + if ( !checkConf(fPixelsData) ) { // TODO FileEvNbInConfig + defaultConf(); + } + //----------------------------------------------- + //Check and open Data Files + int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig); + if( checkDataFiles(MaxFiles) ) { - //----------------------------------------------- - //Check and open Data Files - int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig); - if( checkDataFiles(MaxFiles) ) - fOutputFile = new TFile(fRootFile,"RECREATE"); - { - // Hit TTree - fHitTree = new TTree("hit", "hit"); - fHitTree->Branch("frame" , &fFrameInfo.frame , "frame/i" , 32000); - fHitTree->Branch("hits" , &fFrameInfo.hits , "hits/i" , 32000); - fHitTree->Branch("pixel" , &fFrameInfo.pixel[0] , "pixel[hits]/i" , 32000); - fHitTree->Branch("pixelthreshold", &fFrameInfo.pixelthreshold[0],"pixelthreshold[hits]/i", 32000); - for(int i=0; i<25; i++) { - fHitTree->Branch( Form("p%i",i+1) , &fFrameInfo.p[i][0] , Form("p%i [hits]/F",i+1) , 32000); - } - // Noise TTree - fNoiseTree = new TTree("noise", "noise"); - fDynNoiseTree = fNoiseTree; - initHistograms(); - cout<<"-----------------------"<Branch("frame" , &fFrameInfo.frame , "frame/i" , 32000); + fHitTree->Branch("hits" , &fFrameInfo.hits , "hits/i" , 32000); + fHitTree->Branch("pixel" , &fFrameInfo.pixel[0] , "pixel[hits]/i" , 32000); + fHitTree->Branch("pixelthreshold", &fFrameInfo.pixelthreshold[0],"pixelthreshold[hits]/i", 32000); + for(int i=0; i<25; i++) { + fHitTree->Branch( Form("p%i",i+1) , &fFrameInfo.p[i][0] , Form("p%i [hits]/F",i+1) , 32000); } - //----------------------------------------------- - } sleep(1); // TODO test if removable + // Noise TTree + fNoiseTree = new TTree("noise", "noise"); + fDynNoiseTree = fNoiseTree; + initHistograms(); + cout<<"-----------------------"< Check config file ..."< Number of Pixels defined is bigger than found: "< "<sensorinfocur.columns*run->sensorinfocur.rows; +//----------------------------------------------- + cout<<"-----------------------"< Load default config file ..."<0)?labbook.frames_foundDB:frames_found); + header += Form("#bin [ADU]\tbin [e]\tSeed\tSum\tVeto\tSeed thrsh\tSum thrsh\tbin noise [ADU]\tbin noise [e]\tnoise\n"); header += Form("#posVeto, run: %.1f, DB: %.1f, Fe55 DB (%d, %.1f): %.1f\n", histogram.posVeto, labbook.posVetoDB, Fe55run.posVetorunnumber, Fe55run.temperature, Fe55run.posVeto); header += Form("#posSeed, run: %.1f, DB: %.1f\n", histogram.posSeed, labbook.posSeedDB); header += Form("#posSum, run: %.1f, DB: %.1f\n", histogram.posSum, labbook.posSumDB); -- 2.43.0