// compareHistogramVector.push_back(runs[runi]->histogramwoRTS->normalized->Seed);
runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS, runs[runi]->histogramwoRTS->pixeltimefired, "", 0);
runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS, runs[runi]->histogramwoRTS->pixeltimefiredsorted, "", 0, true, true);
+ runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS, runs[runi]->histogramwoRTS->LeakageCurrent, "", 0);
// runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogram->pixeltimefired, "gaus", 1);
// compareHistogramVector2.push_back(runs[runi]->histogramthreshold->normalized->Seed);
//compareHistogramClassVector.push_back(runs[runi]->histogram);
initHistogram(Sum, "Sum" + histogramdescription, color, style);
initHistogram(Veto, "Veto" + histogramdescription, color, style);
initHistogram(Noise, "Noise" + histogramdescription, color, style);
+ initHistogram(NoiseEnd, "Noise at end" + histogramdescription, 16, style);
initHistogramCustom(SeedPerc, "Seed Percentage" + histogramdescription, color, style, 0, 120, 121, Form("Entries [1/%%]"), "Q_coll [%]");
- initHistogramCustom(pixeltimefired, "Pixel fired" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows-1, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Counts");
- initHistogramCustom(pixeltimefiredsorted, "Fire counter" + histogramdescription, color, style, 0, labbook->frames_foundDB/250-1, labbook->frames_foundDB/250, "times fired", "Counts");
- initHistogramCustom(LeakageCurrent, "Leakage current per pixel" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
+ initHistogramCustom(pixeltimefired, "Pixel fired", color, style, 0, cursensorinfo->columns*cursensorinfo->rows-1, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Counts");
+ initHistogramCustom(pixeltimefiredsorted, "Fire counter", color, style, 0, labbook->frames_foundDB/250-1, labbook->frames_foundDB/250, "times fired", "Counts");
+ initHistogramCustom(LeakageCurrent, "Leakage current per pixel", color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
SeedPerc->GetXaxis()->SetRangeUser(0,50);
Noise->SetBins(cursystempar->nbinsnoise, 0, cursystempar->maxbinnoise);
+ NoiseEnd->SetBins(cursystempar->nbinsnoise, 0, cursystempar->maxbinnoise);
}
void HistogramType::initHistogram(TH1F* &histogrampointer, TString prefix, Int_t color, Int_t style) {
TH1F* Veto = 0;
/// Noise histogram
TH1F* Noise = 0;
+ /// Noise histogram at the end of a run
+ TH1F* NoiseEnd = 0;
/// histogram with cluster data, rotated if staggered
TH2F* histAvgCluster = 0;
/// Percentage of charge gathered by seed pixel (Seed to Sum ratio)
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");
+ fNoiseTree = new TTree("noisefolder", "noisefolder");
fNoiseTree->Branch("frame" , &fFrameInfo.frame , "frame/i" , 32000);
- fNoiseTree->Branch("noise" , &(fNoiseInfo.fNoise) , "noise/F" , 32000);
- fNoiseTree->Branch("pedestal" , &(fNoiseInfo.fPedestals) , "pedestal/F" , 32000);
+ fNoiseTree->Branch("noise" , &fNoiseInfo.fNoise[0] , "noise[100000]/F" , 32000);
+ fNoiseTree->Branch("pedestal" , &fNoiseInfo.fPedestals[0] , "pedestal[100000]/F" , 32000);
initHistograms();
cout<<"-----------------------"<<endl;
fHitTree->SetBranchAddress( Form("p%i",i+1) , &fFrameInfo.p[i][0]);
}
// Noise TTree
- fNoiseTree = (TTree*) fOutputFile->Get("noise");
+ fNoiseTree = (TTree*) fOutputFile->Get("noisefolder");
if (!fNoiseTree) // got pointer
{
cout<< colorred << "Error finding noise TTree in old ROOT file!"<< endlr;
return 1;
}
fNoiseTree->SetBranchAddress("frame" , &fFrameInfo.frame);
- fNoiseTree->SetBranchAddress("noise" , &(fNoiseInfo.fNoise));
- fNoiseTree->SetBranchAddress("pedestal" , &(fNoiseInfo.fPedestals));
+ fNoiseTree->SetBranchAddress("noise" , &fNoiseInfo.fNoise[0]);
+ fNoiseTree->SetBranchAddress("pedestal" , &fNoiseInfo.fPedestals[0]);
+
+ Int_t BytesRead=fNoiseTree->GetEntry(1);
+ cout << colorred << "BytesRead: " << BytesRead << endlr;
+
+ for (Int_t pixeli=0; pixeli<fPixelsData ; pixeli++) {
+ if (pixeli > 500 && pixeli < 550 ) {
+ cout << "pixeli: " << pixeli << endl;
+ cout << " " << fNoiseInfo.fNoise[pixeli];
+ }
+ }
+
+
+ fHitTree->GetEntry(1);
+ for(Int_t hiti=0; (unsigned int)hiti<fFrameInfo.hits;hiti++)
+ {
+ cout << " " << fFrameInfo.pixel[hiti];
+ }
+
+
initHistograms();
cout<<"-----------------------"<<endl;
fF0matrix = new Int_t [fPixelsData]();
fF1matrix = new Int_t [fPixelsData]();
fCdsmatrix = new Float_t [fPixelsData]();
- fNoiseInfo.fNoise = new Float_t [fPixelsData]();
- fNoiseInfo.fPedestals = new Float_t [fPixelsData]();
fHittedPixel= new Int_t [fPixelsData]();
+ cout << colorcyan << "INIT !!!!!!!!" << endl;
+
//-----------------------------------------------
return true;
}
fF0matrix = new Int_t [fPixelsData]();
fF1matrix = new Int_t [fPixelsData]();
fCdsmatrix = new Float_t [fPixelsData]();
- fNoiseInfo.fNoise = new Float_t [fPixelsData]();
- fNoiseInfo.fPedestals = new Float_t [fPixelsData]();
fHittedPixel= new Int_t [fPixelsData]();
//-----------------------------------------------
return true;
if( fSave )
{
- fNoiseTree->Fill();
+// fNoiseTree->Fill();
cout << colorcyan << fNoiseInfo.fNoise[100] << endlr;
// getNoise(startframe, frames);
}
Bool_t Run::binLeakageCurrent(HistogramType* oneHistogramClass)
{
-/* Float_t pedestial;
- TBranch* noiseBranch;
-// oneHistogramClass->LeakageCurrent->Reset();
- processed->fNoiseTree->SetBranchAddress("pedestal", &pedestial, &noiseBranch);
- cout << colorcyan << "processed->fNoiseTree->GetEntries(): " << processed->fNoiseTree->GetEntries() << endlr;
+ Double_t pedestals [cursensorinfo.columns*cursensorinfo.rows];
for (Int_t framei=0; framei<processed->fNoiseTree->GetEntries(); framei++) { // loop over all frames
-//
processed->fNoiseTree->GetEntry(framei);
-// cout << pedestial << endl;
- oneHistogramClass->LeakageCurrent->Fill(1);
- } */
+ for (Int_t pixeli=0; pixeli<cursensorinfo.columns*cursensorinfo.rows ; pixeli++) {
+ pedestals[pixeli] += processed->fNoiseInfo.fPedestals[pixeli];
+ }
+ }
+ for (Int_t pixeli=0; pixeli<cursensorinfo.columns*cursensorinfo.rows ; pixeli++) {
+ pedestals[pixeli] /= cursensorinfo.columns*cursensorinfo.rows;
+ }
return 0;
-
-
-// for (Int_t framei=0; framei<processed->fHitTree->GetEntries(); framei++) { // loop over all frames
-// processed->fHitTree->GetEntry(framei);
-// for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++) {
-// pixelnumber = processed->fFrameInfo.pixel[hiti];
-// HistogramTypepointer->pixeltimefired->Fill(pixelnumber);
-// }
-// }
}
Bool_t Run::binNoise(HistogramType* oneHistogramClass)
{
- Double_t const probabilities[] = {0.3415/2, 0.5, 1-0.3415/2}; // sigma/2 from gaus to the left and to the right //{0.17, 0.5, 1-0.17};
- oneHistogramClass->Noise->Reset();
- cout << colorcyan << "Entries in noise : " << processed->fNoiseTree->GetEntries() << endlr;
- processed->fNoiseTree->GetEntry(0);
- for (Int_t framei=0; framei<processed->fNoiseTree->GetEntries(); framei++) { // loop over all frames
- processed->fNoiseTree->GetEntry(framei);
- cout << processed->fNoiseInfo.fNoise[100] << " ";
- cout << processed->fNoiseInfo.fNoise[110] << " ";
- }
-// for (Int_t cnt=0; cnt<processed->fNoiseTree->GetEntries(); cnt++) {
+
+ Double_t const probabilities[] = {0.3415/2, 0.5, 1-0.3415/2}; // sigma/2 from gaus to the left and to the right //{0.17, 0.5, 1-0.17};
+ cout << "processed->fNoiseTree->GetEntries: " << processed->fNoiseTree->GetEntries() << endl;
+
+ processed->fNoiseTree->GetEntry(0);
for (Int_t pixeli=0; pixeli<cursensorinfo.columns*cursensorinfo.rows ; pixeli++) {
- oneHistogramClass->Noise->Fill(processed->fNoiseInfo.fNoise[pixeli]);
+// if (pixeli > 500 && pixeli < 550 ) {
+// cout << "pixeli: " << pixeli;
+// cout << " " << processed->fNoiseInfo.fNoise[pixeli] << endl;
+// }
+ oneHistogramClass->Noise->Fill(processed->fNoiseInfo.fNoise[pixeli]);
}
-// }
oneHistogramClass->Noise->GetQuantiles( 3, noisequantiles, probabilities);
oneHistogramClass->avgNoise = noisequantiles[1];
oneHistogramClass->avgNoisePlus = noisequantiles[2] - noisequantiles[1];
oneHistogramClass->avgNoiseMinus = noisequantiles[1] - noisequantiles[0];
- // if (labbook.system == "PXI")
- // for (int j=0; j<3; j++)
- // noisequantiles[j] /= 16.0; // TODO analyze PXI scales
+
+ cout << "HistogramEnd" << endl;
+ processed->fNoiseTree->GetEntry(processed->fNoiseTree->GetEntries()-1);
+ for (Int_t pixeli=0; pixeli<cursensorinfo.columns*cursensorinfo.rows ; pixeli++) {
+ oneHistogramClass->NoiseEnd->Fill(processed->fNoiseInfo.fNoise[pixeli]);
+ }
return 0;
}
owntitle3->AddText(trimRunnumberAtBegin(HistogramTypepointer->Veto->GetName()));
owntitle3->Draw("SAME");
canvas->cd(4);
- HistogramTypepointer->Noise->Draw();
+ HistogramTypepointer->NoiseEnd->Draw("SAME");
+ HistogramTypepointer->Noise->Draw("SAME");
TString legendEntry = Form("Noise: %.2f + %.2f - %.2f",HistogramTypepointer->avgNoise, HistogramTypepointer->avgNoisePlus, HistogramTypepointer->avgNoiseMinus);
TLegend* leg = new TLegend(0.5,0.8,0.89,0.89);//(0.6,0.7,0.89,0.89);
leg->AddEntry(HistogramTypepointer->Veto, legendEntry, "l");
#include <TLegend.h>
#define MAXHITS 1000000
+#define MAXPIXELS 100000
//####################################################################
/**
* @file help.h
*/
struct noiseInfo{
// Int_t pixel;
- Int_t frame;
+ UInt_t frame;
/// Array with noise information of. given pixel, estimated in @c InitialDynNoise()
- Float_t* fNoise;/**< Some documentation for first. */
+ Float_t fNoise [MAXPIXELS];
/// Array with pedestial information of given pixel
- Float_t* fPedestals;
+ Float_t fPedestals [MAXPIXELS];
};