]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Analyzer: Added Pipper2 gaus fit to seed spectrum
authorTobias Bus <tbus@jspc48.x-matter.uni-frankfurt.de>
Tue, 1 Nov 2016 13:46:18 +0000 (14:46 +0100)
committerTobias Bus <tbus@jspc48.x-matter.uni-frankfurt.de>
Tue, 1 Nov 2016 13:46:18 +0000 (14:46 +0100)
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/ChargeSpektrumFunctions.c
MABS_run_analyzer/Run.c

index 07459df11e7fd8aea90b0a4f2e04252d2b379dc7..fa6146d8066f7c76733ed38360aaea3c1f32bf55 100644 (file)
@@ -102,9 +102,14 @@ void ChargeSpektrum(TString runnumber = "")
                     
                     // Uncomment below to do classical analysis withour RTS
 //                     compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS->normalized->calibrated);
-//                     compareHistogramClassVector.push_back(runs[runi]->histogram);
+                   
+                     runs[runi]->plotAllHistograms(runs[runi]->histogram);
+                     //compareHistogramClassVector.push_back(runs[runi]->histogram->normalized->calibrated);
+                     //compareHistogramClassVector2.push_back(runs[runi]->histogram->normalized);
 //                     compareHistogramClassVector2.push_back(runs[runi]->histogramthreshold);
-//                     compareHistogramVector2.push_back(runs[runi]->histogramwoRTS->normalized->calibrated->Seed);
+                     compareHistogramVector.push_back(runs[runi]->histogram->normalized->calibrated->Seed);
+                     compareHistogramVector2.push_back(runs[runi]->histogram->normalized->Seed);
+                    //runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized->calibrated, runs[runi]->histogram->normalized->calibrated->Seed, "landau", 1);
 //                     runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Seed, "landau", true);
 //                     runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Sum, "gaus", true);
                     
index 2756ab4082c05d3e10e492e0c01e927e78da2332..7e1b426274c34adf43fe4af7335d0824462abef8 100644 (file)
@@ -614,7 +614,8 @@ Bool_t plotAllRuns(vector<HistogramType*>* ptCompareHistogramClassVector)
             curhistogramclone->GetXaxis()->UnZoom();
             heighestval1 = (curhistogramclone->GetMaximum()>heighestval1?curhistogramclone->GetMaximum():heighestval1);  
             lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,1)):lastbin1;       
-//             cout << "Last bin: " << colorcyan << lastbin1 << endlr;
+//              cout << "Last bin: " << colorcyan << lastbin1 << endlr;
+//                     cout << "curhistogramclone->GetMaximum(): " << colorcyan << curhistogramclone->GetMaximum() << endlr;
             
             curhistogramclone = (TH1F*) curhistogramclassp->Sum->Clone();
             curhistogramclone->GetXaxis()->UnZoom();
@@ -651,8 +652,11 @@ Bool_t plotAllRuns(vector<HistogramType*>* ptCompareHistogramClassVector)
             leg1->AddEntry(curhistogramclone, legendEntry, "l");
             leg1->Draw("SAME");
             curhistogramclone->SetAxisRange(0,lastbin1*1.1,"X");
-            curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval1*4);
-            gPad->SetLogy(1);
+            curhistogramclone->SetAxisRange(0,heighestval1*1.1,"Y");
+            curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval1*1.0);
+            //gPad->SetLogy(1);
+           gPad->SetGrid(1);
+           gPad->SetGridy(1);
             owntitle->Clear();
             owntitle->AddText(trimRunnumberAtBegin(curhistogramclone->GetName()));
             owntitle->Draw("SAME");
@@ -662,14 +666,18 @@ Bool_t plotAllRuns(vector<HistogramType*>* ptCompareHistogramClassVector)
             curhistogramclone->SetLineColor(rootcolors[histogrami%13]);
             curhistogramclone->Draw("SAME");
             hs->Add(curhistogramclone);
+            legendEntry = Form("%s", curhistogramclone->GetTitle());
             leg2->AddEntry(curhistogramclone, legendEntry, "l");
             leg2->Draw("SAME");
 //             hs->Add(leg1);
             curhistogramclone->SetAxisRange(0,lastbin2*1.1,"X");
+            curhistogramclone->SetAxisRange(0,heighestval2*1.1,"Y");
 //             heighestval2 = (curhistogramclone->GetMaximum()>heighestval2?curhistogramclone->GetMaximum():heighestval2);
-            curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval2*4);
+            curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval2*1.2);
             curhistogramclone->Draw("SAME");
-            gPad->SetLogy(1);
+//             gPad->SetLogy(1);
+           gPad->SetGrid(1);
+           gPad->SetGridy(1);
             owntitle2->Clear();
             owntitle2->AddText(trimRunnumberAtBegin(curhistogramclone->GetName()));
 //             hs->Add(owntitle2);
@@ -679,11 +687,16 @@ Bool_t plotAllRuns(vector<HistogramType*>* ptCompareHistogramClassVector)
             curhistogramclone = (TH1F*) curhistogramclassp->Veto->Clone();
             curhistogramclone->SetLineColor(rootcolors[histogrami%13]);
             curhistogramclone->Draw("SAME");
+            legendEntry = Form("%s", curhistogramclone->GetTitle());
             leg3->AddEntry(curhistogramclone, legendEntry, "l");
             leg3->Draw("SAME");
-            curhistogramclone->SetAxisRange(1,lastbin3*1.1,"X");            
+            curhistogramclone->SetAxisRange(1,lastbin3*1.1,"X"); 
+            curhistogramclone->SetAxisRange(1,heighestval3*1.1,"Y");           
 //             heighestval3 = (curhistogramclone->GetMaximum()>heighestval3?curhistogramclone->GetMaximum():heighestval3);
             curhistogramclone->GetYaxis()->SetRangeUser(0,heighestval3*1.2);
+            curhistogramclone->Draw("SAME");
+           gPad->SetGrid(1);
+           gPad->SetGridy(1);
             owntitle3->Clear();
             owntitle3->AddText(trimRunnumberAtBegin(curhistogramclone->GetName()));
             owntitle3->Draw("SAME");
@@ -695,7 +708,7 @@ Bool_t plotAllRuns(vector<HistogramType*>* ptCompareHistogramClassVector)
             legendEntry = Form("%d Noise: %.2f + %.2f - %.2f",curhistogramclassp->labbook->runnumber, curhistogramclassp->avgNoise, curhistogramclassp->avgNoisePlus, curhistogramclassp->avgNoiseMinus);
             leg4->AddEntry(curhistogramclone, legendEntry, "l");
             leg4->Draw();            
-            curhistogramclone->GetYaxis()->SetRangeUser(0,heighestval4*1.4);
+            curhistogramclone->GetYaxis()->SetRangeUser(0,heighestval4*1.2);
             owntitle4->Clear();
             owntitle4->AddText(trimRunnumberAtBegin(curhistogramclone->GetName()));
             owntitle4->Draw("SAME");
index 699ad5fc34d114dd552f2d47a2f1497fd1181e29..5a4a8968128e6e2aa5754413b4f56f46251b6dbf 100644 (file)
@@ -251,7 +251,7 @@ void Run::setSystemSpecificParameters()
     systemparam systemparamPXI (800*16,800,75,150,150);
     systemparam systemparamFSBB (2800,2800/4,25,10,100);
     systemparam systemparamUSBMi19 (400/*maxbin*/,400/1/*nbins*/, 25/*vetothreshold*/, 10/*maxbinnoise*/, 100/*nbinsnoise*/);
-    systemparam systemparamPipper2 (2800,2800/4,15,10,100);
+    systemparam systemparamPipper2 (1000,1000,15,10,100);
     if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi34") )
         cursystemparam = systemparamUSB;
     else if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("FSBB") )
@@ -1380,7 +1380,10 @@ Bool_t Run::binSeedSumVeto()
             //             cout << (*curHistogramClass)->histogramdescription << ": " << colorcyan <<  parameters[1] << endlr;
             (*curHistogramClass)->integralVeto = parameters[6];
         }
-        parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "landau");
+        if (labbook.chipGen.EqualTo("Pipper2")) 
+            parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "gaus");
+        else
+            parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Seed, "landau");
         (*curHistogramClass)->posSeed = parameters[1];
         parameters = (*curHistogramClass)->FitPerform((*curHistogramClass)->Sum, "gaus");
         (*curHistogramClass)->posSum = parameters[1];