]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Run analyzer: Bugfixes and examples
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 12:45:26 +0000 (14:45 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 12:45:26 +0000 (14:45 +0200)
.gitignore
MABS_run_analyzer/ChargeSpektrum.c [new file with mode: 0644]
MABS_run_analyzer/ChargeSpektrumFunctions.c
MABS_run_analyzer/HistogramType.h
MABS_run_analyzer/Run.c
MABS_run_analyzer/Run.h

index aa483a782d631d142f4896cf37f776917d14ec87..2c8a09cd2184c1cb133790957e073a92568cb4b8 100644 (file)
@@ -10,6 +10,5 @@
 *.MOV
 */results/*
 *runlist.txt
-ChargeSpektrum.c
 MABS_run_analyzer/html/*
 MABS_run_analyzer/latex/*
\ No newline at end of file
diff --git a/MABS_run_analyzer/ChargeSpektrum.c b/MABS_run_analyzer/ChargeSpektrum.c
new file mode 100644 (file)
index 0000000..316b814
--- /dev/null
@@ -0,0 +1,179 @@
+/**
+ * @file ChargeSpektrum.c
+ * @brief Use brief, otherwise the index won't have a brief explanation.
+ *
+ * Detailed explanation.
+ * 
+ * 
+ */
+
+#include "MAPS.c"
+#include "Run.c"
+#include "CSVRow.h"
+#include "CSVRow.C"
+#include <TTimeStamp.h>
+#include "help.h"
+
+Run** runs;
+Int_t numberRuns;
+Bool_t isBatch = kFALSE;
+
+#include "ChargeSpektrumFunctions.c"
+
+void ChargeSpektrum(TString runnumber = "")
+{
+    cout << endl << endl; 
+    if (gROOT->IsBatch())
+        isBatch = kTRUE;
+    
+    numberRuns=0;
+    std::vector<int> runList;
+    if (runnumber.Length() > 0)
+    {
+        if (runnumber.Contains("-"))
+        {
+            TObjArray* runarray = runnumber.Tokenize("-");
+            if (runarray->GetEntries()==2)
+            {
+                TObjString* tempstrobj;
+                tempstrobj=static_cast<TObjString*>(runarray->At(0));
+                if (tempstrobj->GetString().Length()>0)
+                {
+                    Int_t tempintstart = tempstrobj->GetString().Atoi();
+                    tempstrobj=static_cast<TObjString*>(runarray->At(1));
+                    if (tempstrobj->GetString().Length()>0)
+                    {
+                        Int_t tempintend = tempstrobj->GetString().Atoi();
+                        if (tempintend-tempintstart > 0)
+                        {
+                            for (Int_t i=tempintstart; i <= tempintend; i++)
+                            {
+                                runList.push_back(i);
+                                numberRuns++;
+                            }
+                        }
+                        else
+                            cout << coloryellow << "Invalid run number range "<< colorreset << colorwhite << tempintstart << " till " << tempintend << endlr;
+                    }
+                    else
+                        cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempstrobj->GetString() << endlr;  
+                    
+                }
+                else
+                    cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempstrobj->GetString() << endlr;    
+            }
+            else
+            {
+                cout << endl << colorred << "Given parameters have wrong format, please enter integer run numbers devided by '" << colorreset << colorwhite << "," << colorreset << colorred << " or 2 runnumbers devided by " << colorreset << colorwhite << "-" << colorreset << colorred << "' and surrounded by '" << colorreset << colorwhite << "\"" << colorreset  << colorred << "'." << endlr;
+                cout << "For example run: " << colorwhite << "root -l 'ChargeSpektrum.c+(\"342815,342816\")'" << endl;
+                exit(1);
+            }  
+            
+        }
+        else
+        {
+            TObjArray* runarray = runnumber.Tokenize(",");
+            if (runarray->GetEntries()>0)
+            {
+                TObjString* tempstrobj;
+                for (Int_t i=0; i < runarray->GetEntries(); i++)
+                {
+                    tempstrobj=static_cast<TObjString*>(runarray->At(i));
+                    if (tempstrobj->GetString().Length()>0)
+                    {
+                        Int_t tempint = tempstrobj->GetString().Atoi();
+                        if (tempint > 0)
+                        {
+                            runList.push_back(tempint);
+                            numberRuns++;
+                        }
+                        else
+                            cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempint << endlr;
+                    }
+                    else
+                        cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempstrobj->GetString() << endlr;
+                }                
+            }
+            else
+            {
+                cout << endl << colorred << "Given parameters have wrong format, please enter integer run numbers devided by '" << colorreset << colorwhite << "," << colorreset << colorred << "' and surrounded by '" << colorreset << colorwhite << "\"" << colorreset  << colorred << "'." << endlr;
+                cout << "For example run: " << colorwhite << "root -l 'ChargeSpektrum.c+(\"342815,342816\")'" << endl;
+                exit(1);
+            }         
+        }
+    }
+    else
+    {
+        /// number of runs to be analyzed, number of lines read by @c ReadRunList() 
+        ReadRunList(&runList);
+    }
+    runs = new Run*[numberRuns];
+    
+    cout << "Found " << numberRuns << " run(s) in 'runlist.txt' or given as parameters." << endl;
+    for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+    {
+        if (runList[runi]>0)
+        {
+            runs[runi] = new Run(runList[runi], runi);
+            if (!runs[runi]->error)
+            {
+                runs[runi]->setResultsPath("./results/");
+                runs[runi]->error=runs[runi]->initRun();
+                runs[runi]->setDynamicalNoiseMode("simple");
+                runs[runi]->useDynamicalNoise(true);
+                runs[runi]->useCommonModeFilter(false);
+                runs[runi]->setFixedThresholdValueElectrons(1440);
+                
+//                 runs[runi]->analyzeFrame(57826);
+//                 runs[runi]->analyzeFrame(57827);
+//                 runs[runi]->analyzeFrame(983603); 
+                
+                // creates or opens .root file, can analyze the RAW data
+                runs[runi]->error=runs[runi]->analyzeRun(false); // creates or opens .root file, can analyze the RAW data
+                if (!runs[runi]->error)
+                {
+            //         gROOT->SetBatch(kTRUE);
+                    //           runs[runi]->plotSeed();
+
+//                     runs[runi]->plotSeedThresholdCalibrated();
+//                     runs[runi]->plotSeedThreshold();
+//                     runs[runi]->plotSeed();
+            //         runs[runi]->plotSum();
+            //         runs[runi]->plotVeto();
+                    //         runs[runi]->plotNoise();
+                    if (!isBatch)
+                        gROOT->SetBatch(kFALSE);
+                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogram->calibrated);
+                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramthreshold->calibrated);
+                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->dennismegacut->calibrated);
+                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramfixedthreshold->calibrated);
+                    runs[runi]->plotCompareHistograms();
+                    runs[runi]->plotAllHistograms(runs[runi]->histogram->calibrated);
+                    runs[runi]->plotAllHistograms(runs[runi]->dennismegacut->calibrated);
+                    runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->Seed, "landau");
+                    runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->calibrated->Seed, "landau");
+                    compareHistogramClassVector.push_back(runs[runi]->histogram->calibrated);
+//                     runs[runi]->integrateSr90Spectra(&runs[runi]->histogramfixedthresholdCalibrated, runs[runi]->histogramfixedthresholdCalibrated.Seed, 0); 
+//                     runs[runi]->plot1DHistogram(&runs[runi]->histogramfixedthresholdCalibrated, runs[runi]->histogramfixedthresholdCalibrated.Seed, "landau");
+//                     runs[runi]->plot1DHistogram(&runs[runi]->histogramthresholdCalibrated, runs[runi]->histogramthresholdCalibrated.Seed, "landau");
+//                     runs[runi]->plotAllHistograms(&runs[runi]->histogramfixedthreshold);
+//                     runs[runi]->plotAllHistograms();
+//                     runs[runi]->plotAllHistograms();
+//                     runs[runi]->plotAllHistogramsThresholdCluster();                    
+//                     runs[runi]->plotAllHistogramsThresholdClusterCalibrated();
+//                     runs[runi]->plotClusterDistribution(&runs[runi]->histogramthresholdCalibrated);
+
+//                      runs[runi]->plotAllHistogramsCalibrated(); 
+                    runs[runi]->writeAllHistogramsToFile(); 
+                }
+            }
+        }
+    }
+    plotAllRuns();
+//     plotAllRuns("seed threshold calibrated");
+//     setCustomPath("Excel/");
+//     writeObservableToFile("seed threshold calibrated");
+//    writeObservableToFile("seed threshold");
+//     writeObservableToFile("seed threshold");
+//     writeObservableToFile("sum threshold");
+}
index d529180696e0d3bba15a3e5a7ce0cb3740035c4e..9362888fdf24baa970739861501cf044b7c783bf 100644 (file)
@@ -14,6 +14,15 @@ Bool_t plotAllRuns(TString);
 Bool_t writeObservableToFile(TString);
 Bool_t writeObservableToFile();
 void writeObservableToFileHistSelect(TString);
+/** @brief A vector able to hold pointer of type #Run::histogramstruct
+ * 
+ * You push in pointer of the type Run::histogramstruct in ChargeSpectrum.C and then 
+ * compare different histograms of the same run.
+ * 
+ * See Run::plotCompareHistograms( ) for more information and usage.
+ *     
+ */
+vector<HistogramType*> compareHistogramClassVector;
 
 TString ownpath = "";
 
@@ -169,100 +178,90 @@ Bool_t writeObservableToFile()
     return 0;
 }
 
-Bool_t plotAllRuns(TString histogramtype)
+
+
+Bool_t plotAllRuns()
 {
-    if (histogramtype.Contains("threshold"))
-    {
-        if (histogramtype.Contains("calibrated"))
+    if (numberRuns>0)
+    { 
+        if ( !compareHistogramClassVector.size() )
         {
-            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */
-                if (runs[runi]->histogramthreshold->iscalibrated)
-                    runs[runi]->plothistogramclasspointer = runs[runi]->histogramthreshold->calibrated;
-                else
-                    return 1;
+            cout << colorred << "plotCompareHistograms(): No plots to compare, please push them into the vector: compareHistogramClassVector." << endlr;
+            return 1;
         }
-        else
+        Bool_t calibrated = true;
+        Bool_t uncalibrated = true;
+        for (UInt_t histogrami=0; histogrami < compareHistogramClassVector.size(); histogrami++)
         {
-            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */ 
-                runs[runi]->plothistogramclasspointer = runs[runi]->histogramthreshold;
+            calibrated = calibrated && compareHistogramClassVector.at(histogrami)->iscalibrated;
+            uncalibrated = uncalibrated && !compareHistogramClassVector.at(histogrami)->iscalibrated;
+            // cout << colorcyan << compareHistogramClassVector.at(histogrami)->histogramdescription << endlr;
+        }
+        //         cout << "Calibrated   " << (calibrated?"Yes":"No") << endl;
+        //         cout << "Uncalibrated " << (uncalibrated?"Yes":"No") << endl;
+        if ( !(calibrated != uncalibrated)) // XOR operator !=
+        {
+            cout << colorred << "plotCompareHistograms(): Mixing of calibrated and uncalibrated histograms when comparing plots. Aborting." << endlr;
+            return 1;
         }
         
-    }
-    else if (histogramtype.Contains("calibrated") || histogramtype.Contains("electron")) {
-        for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
-            if (runs[runi]->histogram->iscalibrated)
-                runs[runi]->plothistogramclasspointer = runs[runi]->histogram->calibrated;
-            else
-                return 1;  } }
-                else {
-                    for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
-                        runs[runi]->plothistogramclasspointer = runs[runi]->histogram; } }
-                        plotAllRuns();
-                        return 0;
-}
-
-Bool_t plotAllRuns()
-{
-    if (numberRuns > 1)
-    {
-        Float_t lastbin;
-        TTimeStamp* time = new TTimeStamp();
-        
-        TCanvas* canvas = new TCanvas(Form("%d",time->GetNanoSec()), "Summary", 1600, 1000);
-        if (isBatch)
-            canvas->SetCanvasSize(3200,2000);
+        // legend entries
+        Float_t height = compareHistogramClassVector.size() * 0.04;
+        TLegend* leg1 = new TLegend(0.4,0.89-height,0.89,0.89);//(0.6,0.7,0.89,0.89);
+        leg1->SetTextSize(0.02);
+        leg1->SetFillColor(0); leg1->SetBorderSize(0);
+        TLegend* leg2 = (TLegend*) leg1->Clone();
+        TString  legendEntry;
         
+        Float_t lastbin1=0;
+        Float_t lastbin2=0;
+        Float_t lastbin3=0;
+        Float_t lastbin4=0;
+        TString canvastitle = Form("Summary");
+        TTimeStamp* time = new TTimeStamp();        
+        TString canvasname = Form("%d",time->GetNanoSec());
+        TCanvas* canvas = new TCanvas(canvasname, canvastitle, 1200, 800);
         canvas->Divide(2,2);
-        Float_t height = numberRuns * 0.04;
-        TLegend* leg1 = new TLegend(0.3,0.89-height,0.89,0.89);//(0.6,0.7,0.89,0.89);
-                    TLegend* leg2 = new TLegend(0.6,0.89-height,0.89,0.89);//(0.6,0.7,0.89,0.89);
-                    leg1->SetTextSize(0.02);
-                    leg2->SetTextSize(0.02);
-                    leg1->SetFillColor(0); leg1->SetBorderSize(0);
-                    leg2->SetFillColor(0); leg2->SetBorderSize(0);
-                    TString  legendEntry;
-                    
-                    for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
-                    {
-                        if (runs[runi] != nullptr)
-                        {
-                            if (!runs[runi]->error)
-                            {
-                                canvas->cd(1);
-                                runs[runi]->plothistogramclasspointer->Seed->Draw("SAME");
-                                lastbin = runs[runi]->plothistogramclasspointer->Seed->GetBinCenter(runs[runi]->plothistogramclasspointer->Seed->FindLastBinAbove(2,1));
-                                runs[runi]->plothistogramclasspointer->Seed->SetAxisRange(0,lastbin*1.1,"X");
-                                gPad->SetLogy(1);
-                                legendEntry = Form("%s", runs[runi]->plothistogramclasspointer->Seed->GetTitle());
-                                leg1->AddEntry(runs[runi]->plothistogramclasspointer->Veto, legendEntry, "l");
-                                leg1->Draw("SAME");
-                                canvas->cd(2);
-                                runs[runi]->plothistogramclasspointer->Sum->Draw("SAME");
-                                lastbin = runs[runi]->plothistogramclasspointer->Sum->GetBinCenter(runs[runi]->plothistogramclasspointer->Sum->FindLastBinAbove(2,1));
-                                runs[runi]->plothistogramclasspointer->Sum->SetAxisRange(0,lastbin*1.1,"X");
-                                canvas->cd(3);
-                                runs[runi]->plothistogramclasspointer->Veto->Draw("SAME");
-                                runs[runi]->plothistogramclasspointer->Veto->SetAxisRange(runs[runi]->plothistogramclasspointer->posVeto*0.7,runs[runi]->plothistogramclasspointer->posVeto*1.4,"X");
-                                canvas->cd(4);
-                                runs[runi]->plothistogramclasspointer->Noise->Draw("SAME");
-                                legendEntry = Form("%s, Noise: %.2f", runs[runi]->labbook.matrix.Data(), runs[runi]->plothistogramclasspointer->avgNoise);
-                    leg2->AddEntry(runs[runi]->plothistogramclasspointer->Veto, legendEntry, "l");
-                    leg2->Draw("SAME");
-                            }
-                        }
-                    }
-                    
-                    //         canvas -> Print( runs[0]->savepathresults + "/" + canvastitle + ".eps");
-                    TImageDump *img = new TImageDump(runs[0]->savepathresults + "/" + Form("%s - %s",runs[0]->runcode.Data(), runs[numberRuns-1]->runcode.Data()) + ".png");
-                    canvas->Paint();
-                    img->Close();
-                    
-                    TFile *f = new TFile(runs[0]->savepathresults + "/" + Form("%s - %s",runs[0]->runcode.Data(),runs[numberRuns-1]->runcode.Data()) + ".root","RECREATE");
-                    f->cd();
-                    f->Append(canvas);
-                    f->Append(img);
-                    f->Write();
+        for (UInt_t histogrami=0; histogrami < compareHistogramClassVector.size(); histogrami++)
+        {
+            HistogramType* curhistogramclassp = compareHistogramClassVector.at(histogrami);
+            TH1F* curhistogramclone;
+            canvas->cd(1);
+            curhistogramclone = (TH1F*) curhistogramclassp->Seed->Clone();
+//             curhistogramclone->SetLineColor(rootcolors[histogrami]);
+            curhistogramclone->Draw("SAME");
+            legendEntry = Form("%s", curhistogramclone->GetTitle());
+            leg1->AddEntry(curhistogramclone, legendEntry, "l");
+            leg1->Draw("SAME");
+            lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1)):lastbin1;
+            curhistogramclone->SetAxisRange(0,lastbin1*1.1,"X");
+            gPad->SetLogy(1);
+            canvas->cd(2);
+            curhistogramclone = (TH1F*) curhistogramclassp->Sum->Clone();
+//             curhistogramclone->SetLineColor(rootcolors[histogrami]);
+            curhistogramclone->Draw("SAME");
+            leg1->Draw("SAME");
+            lastbin2 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1))>lastbin2)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1)):lastbin2;
+            curhistogramclone->SetAxisRange(0,lastbin2*1.1,"X");
+            gPad->SetLogy(1);
+            canvas->cd(3);
+            curhistogramclone = (TH1F*) curhistogramclassp->Veto->Clone();
+//             curhistogramclone->SetLineColor(rootcolors[histogrami]);
+            curhistogramclone->Draw("SAME");
+            leg1->Draw("SAME");
+            lastbin3 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1))>lastbin3)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1)):lastbin3;
+            curhistogramclone->SetAxisRange(0,lastbin3*1.1,"X");
+            canvas->cd(4);
+            curhistogramclone = (TH1F*) curhistogramclassp->Noise->Clone();
+//             curhistogramclone->SetLineColor(rootcolors[histogrami]);
+            curhistogramclone->Draw();
+            legendEntry = Form("Noise: %.2f + %.2f - %.2f",curhistogramclassp->avgNoise, curhistogramclassp->avgNoisePlus, curhistogramclassp->avgNoiseMinus);
+            leg2->AddEntry(curhistogramclone, legendEntry, "l");
+            leg2->Draw();
+        }
+        
+        return 0;
     }
-    return 0;
+    return 1;
 }
 
index f8deeabfd4deb371504728b673daf2774b71425c..68c7fceb972bc77b813cdb7b24647ffa6f53608a 100644 (file)
@@ -32,6 +32,20 @@ private:
     //*****************
         
     
+    
+    //*****************
+    // INIT FUNCTIONS
+    //*****************
+    /// 
+    /** @brief initializes all histograms, set binwidth, bin amount and names
+     *      * 
+     * @param histogramstruct Pointer to a structure of type #Run::histogramstruct
+     * @param suffix A string which will be appended to the generated title of each histograms 
+     */
+    void initHistograms(Int_t gotcolor, Int_t gotstyle);
+    /// init one specific histogram
+    void initHistogram(TH1F* &histogrampointer, TString prefix, Int_t color, Int_t style);
+    
     //*****************
     // GENERAL HISTOGRAM PROPERTIES
     //*****************
@@ -76,7 +90,7 @@ public:
     
     ~HistogramType(void);
     /** @brief constructor */
-    HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, Bool_t threshold, Int_t gotcolor, Int_t gotstyle );
+    HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, Bool_t threshold=0, Int_t gotcolor=0, Int_t gotstyle=0);
         
     //*****************
     // TH HISTOGRAMS 
@@ -126,15 +140,7 @@ public:
     //*****************
     // INIT FUNCTIONS
     //*****************
-    /// 
-    /** @brief initializes all histograms, set binwidth, bin amount and names
-     *      * 
-     * @param histogramstruct Pointer to a structure of type #Run::histogramstruct
-     * @param suffix A string which will be appended to the generated title of each histograms 
-     */
-    void initHistograms(Int_t gotcolor, Int_t gotstyle);
-    /// init one specific histogram
-    void initHistogram(TH1F* &histogrampointer, TString prefix, Int_t color, Int_t style);
+    
     /** @brief initializes the TH2F cluster for the binning for a specific structure of type #Run::histogramstruct one points to*/
     void initCluster(TString suffix, Float_t xcoord_min_step, Float_t xcoord_abs_min, Float_t xcoord_abs_max, Float_t ycoord_min_step, Float_t ycoord_abs_min, Float_t ycoord_abs_max);
     
index 649f00ccf6a4b34f152edc71c524a7ce00244dff..07a8e556fe4b6d24c99f7ef38b2adfc9f58bb466 100644 (file)
@@ -146,6 +146,7 @@ Run::Run(Int_t runnumber, Int_t loopi)
             generateReadableRunCode();
             cout << colorwhite << "initRootParameters():" << endlr;
             initRootParameters();
+            
             cout << colorwhite << "init Histogram classes:" << endlr;
             // default histogram class, no special cuts applied
             histogram = new HistogramType("", &cursystemparam, &cursensorinfo, 0, rootcolors[plotStyle], rootlinestyle[plotStyle] );
@@ -156,6 +157,10 @@ Run::Run(Int_t runnumber, Int_t loopi)
             // fixed threshold cut
             histogramfixedthreshold = new HistogramType(" fixed Threshold", &cursystemparam, &cursensorinfo, 1, rootcolors[plotStyle], rootlinestyle[plotStyle] );
             HistogramClassVector.push_back(histogramfixedthreshold);
+            // dennis megacut
+            dennismegacut = new HistogramType(" Dennis Mega Cut", &cursystemparam, &cursensorinfo, 0, rootcolors[plotStyle], rootlinestyle[plotStyle] );
+            HistogramClassVector.push_back(dennismegacut);
+            
             debugDBreadout();
         }
         else
@@ -434,7 +439,7 @@ Bool_t Run::rescaleHistogramClasses()
     }
     Float_t gain = 1640.0/vetopeakposition;
     for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++)  {
-        (*curHistogramClass)->calibrateHistograms(gain);;
+        (*curHistogramClass)->calibrateHistograms(gain);
     }
     return 1;
 }
@@ -808,6 +813,16 @@ Bool_t Run::binSeedSumVeto()
                         if (TMath::Abs(notSeedSum) < cursystemparam.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
                             histogramfixedthreshold->Veto->Fill(processed->fFrameInfo.p[12][hiti]);    // histogram with the single pixel
                     }
+                    
+                    if (processed->fFrameInfo.pixel[hiti]>200)
+                    {
+                        dennismegacut->numberofhits++;
+                        
+                        dennismegacut->Seed->Fill(processed->fFrameInfo.p[12][hiti]);
+                        dennismegacut->Sum->Fill(pixelSum);
+                        if (TMath::Abs(notSeedSum) < cursystemparam.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
+                            dennismegacut->Veto->Fill(processed->fFrameInfo.p[12][hiti]);    // histogram with the single pixel
+                    }
                 }
             }
         }
@@ -1073,8 +1088,8 @@ Bool_t Run::plotCompareHistograms()
         Bool_t uncalibrated = true;
         for (UInt_t histogrami=0; histogrami < compareHistogramClassVector.size(); histogrami++)
         {
-            calibrated = calibrated && compareHistogramClassVector.at(histogrami)->calibrated;
-            uncalibrated = uncalibrated && !compareHistogramClassVector.at(histogrami)->calibrated;
+            calibrated = calibrated && compareHistogramClassVector.at(histogrami)->iscalibrated;
+            uncalibrated = uncalibrated && !compareHistogramClassVector.at(histogrami)->iscalibrated;
             // cout << colorcyan << compareHistogramClassVector.at(histogrami)->histogramdescription << endlr;
         }
 //         cout << "Calibrated   " << (calibrated?"Yes":"No") << endl;
@@ -1213,7 +1228,7 @@ Bool_t Run::plotClusterDistribution(HistogramType* HistogramTypepointer)
         canvastitle += "_trsh";
     TString canvasname = Form("%s%d",runcode.Data(),random);
     TCanvas* Canvas_1 = new TCanvas(canvasname, canvastitle, 1200, 800);
-    TView *view = TView::CreateView(1);;
+    TView *view = TView::CreateView(1);
     
     Canvas_1->SetFillColor(0);
     Canvas_1->SetBorderMode(0);
@@ -1468,7 +1483,7 @@ Bool_t Run::writeAllHistogramsToFile()
     if (labbook.source.Contains("Sr90")) {
         header += Form("#Sr90 integral: ");
         for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++)
-            header += Form("%s: %.6f\t", (*curHistogramClass)->histogramdescription.Data(), histogram->sr90IntegralVal);
+            header += Form("%s: %.6f\t", (*curHistogramClass)->histogramdescription.Data(), (*curHistogramClass)->sr90IntegralVal);
         header += Form("\n");
     }
     header += Form("#Noise [ADU]: %.2f +%.2f -%.2f\n", histogram->avgNoise, histogram->avgNoisePlus, histogram->avgNoiseMinus );
@@ -1493,7 +1508,7 @@ Bool_t Run::writeAllHistogramsToFile()
             outline+=Form("%.1f\t%.1f\t%.1f\t", (*curHistogramClass)->Seed->GetBinContent(bin), (*curHistogramClass)->Sum->GetBinContent(bin), (*curHistogramClass)->Veto->GetBinContent(bin));
         }
         if (bin <= cursystemparam.nbinsnoise)
-            outline+=Form("\t%.1f\t%.1f\t%.1f", histogram->Noise->GetBinCenter(bin),histogram->iscalibrated?histogram->calibrated->Noise->GetBinCenter(bin):0,histogram->Noise->GetBinContent(bin));
+            outline+=Form("%.1f\t%.1f\t%.1f", histogram->Noise->GetBinCenter(bin),histogram->iscalibrated?histogram->calibrated->Noise->GetBinCenter(bin):0,histogram->Noise->GetBinContent(bin));
         *fout<<outline<<endl;
     }
     fout->close();
index d2f8a3b65c986287510b26dd9e1332ca3f6f75b3..bfea9abd50a4dbe20de529aa9752b7703017e598 100644 (file)
@@ -394,6 +394,7 @@ public:
     HistogramType* histogramthreshold;
     HistogramType* histogramfixedthreshold;
     HistogramType* plothistogramclasspointer;
+    HistogramType* dennismegacut;
     TH1F* plothistogrampointer;
     /// 
     /** @brief A vector able to hold pointer of type #Run::histogramstruct