]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
FSBB letzte Version vor dem Merge, funktioniert ganz gut FSBB
authorDennis Doering <doering@physik.uni-frankfurt.de>
Mon, 21 Sep 2015 14:17:37 +0000 (16:17 +0200)
committerDennis Doering <doering@physik.uni-frankfurt.de>
Mon, 21 Sep 2015 14:17:37 +0000 (16:17 +0200)
MABS_run_analyzer/MAPS.c
MABS_run_analyzer/Run.c
MABS_run_analyzer/Run.h

index 8d3e6d628c5287d39f0529b9e34458f4a8d4f02a..4685f96f0ecb9b77d40d3b2d95f35ce8c2c7d890 100644 (file)
@@ -82,9 +82,9 @@ Bool_t MAPS::initOldRootFile() {
     }
     //-----------------------------------------------
     //Check and open Data Files
-    int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig);
-    if( checkDataFiles(MaxFiles) )
-    {
+    //int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig);
+    //if( checkDataFiles(MaxFiles) )
+    //{
                fOutputFile     = new TFile(fRootFile,"READ");
                if (fOutputFile->IsZombie())
                {
@@ -115,7 +115,7 @@ Bool_t MAPS::initOldRootFile() {
                cout<<"-----------------------"<<endl;
                cout<<fRootFile<<" opened!"<<endl;
                cout<<"-----------------------"<<endl;
-       }
+       //}
     return 0;    
 }
 //####################################################################
@@ -1304,6 +1304,7 @@ void MAPS::hitana() {
                        {
                                if( (float)(1.*fCdsmatrix[i]-fPedestals[i]) > (5.*fNoise[i]) )
                                {
+                               //cout<<fCdsmatrix[i]<<"Ped:"<<fPedestals[i]<<"CDS-Ped"<<1.*fCdsmatrix[i]-fPedestals[i]<<"5timesNoise"<<5.*fNoise[i]<<endl;
                 HITNR++;
                 HITS.Set(HITNR);
                 HITS.AddAt(i,(HITNR-1));                
@@ -1572,15 +1573,16 @@ void MAPS::hitana() {
                        Float_t chargesumincluster4=0;
                        Float_t noisesumincluster4=0;
                        Float_t noisesumincluster4Square=0;
-                       for(Int_t iClusterLauf=0;iClusterLauf<4;iClusterLauf++)
+                       for(Int_t iClusterLauf=0;iClusterLauf<20;iClusterLauf++)
                        {
+                       //cout<<iClusterLauf<<"."<<noiseincluster[index[iClusterLauf]]<<endl;
                                chargesumincluster4+=pixelchargeincluster[index[iClusterLauf]];
                                //noisesumincluster4+=noiseincluster[index[iClusterLauf]];
                                noisesumincluster4Square+=TMath::Power(noiseincluster[index[iClusterLauf]],2);
                        }
                        noisesumincluster=TMath::Sqrt(noisesumincluster);
                        noisesumincluster4=TMath::Sqrt(noisesumincluster4Square);
-               //      cout<<"Chargesumme"<<chargesumincluster4<<","<<noisesumincluster4<<","<<noisesumincluster4Square<<endl;
+                       //cout<<"Chargesumme"<<chargesumincluster4<<","<<noisesumincluster4<<","<<noisesumincluster4Square<<endl;
                        // Float_t cdsMatrixMinusPedestal[fPixels];
                        // Float_t cdsMatrixSum=0;
                        // for(Int_t i=0; i<fPixels; i++)
@@ -1721,8 +1723,12 @@ void MAPS::hitana() {
                     // if cluster charge > clusternoise * const
                                        if(fOrderCode=="FSBB")
                                        {
+                               //      cout<<"Chargesumme"<<chargesumincluster4<<","<<noisesumincluster4<<","<<noisesumincluster4*5.0<<endl;
                                                if (1.0*chargesumincluster4 > noisesumincluster4*5.0)
+                                               {
+                                                       
                                                        fFrameInfo.pixelthreshold[fHits] = Hitlist[hit];
+                                               }
                                                else
                                                        fFrameInfo.pixelthreshold[fHits] = 0;
                                        }
@@ -1845,7 +1851,7 @@ void MAPS::plotFrame(Int_t FrameNumber) {
         cout <<endl <<endl << colorwhite << "---------------- FRAME " << fFrameNumber << " ----------------" << colorreset << endl << endl;
         cout<<"CDS matrix:"<<endl;
         debugStream<>(fCdsmatrix, fPixels, fColumns, 0, 39);
-
+               debugStream<>(fPedestals, fPixels, fColumns, 0, 39);
                Float_t cdsmatrixCorrPed[fPixels];
                for(Int_t i=0; i<fPixels; i++)
         {
index d16e39a2fef98ce6a76442269faff6ac522377ff..cd0c549967a251f9ee2b8479847a11a70d301146 100644 (file)
@@ -301,7 +301,7 @@ Bool_t Run::analyzeRun(Bool_t force)
             cout << "Skipped analysis of run " << labbook.runnumber << ", I think the root file for this run allready exists." << endl;
             cout << colorwhite << "initOldRootFile():" << endlr;
         }
-        if (processed->initOldRootFile()) return 1;
+               if (processed->initOldRootFile()) return 1;
         cout << colorwhite << "binNoise():" << endlr;
         binNoise();
         cout << colorwhite << "binSeedSumVeto():" << endlr;
@@ -456,6 +456,7 @@ Bool_t Run::analyzeFrame(Int_t frame)
             // processed->filterCommonMode();
             processed->hitana();
             processed->plotFrame(frame);
+                       processed->plotPixSignal(0,300,795);
           //  delete processed;
             // return 0;
         // }
@@ -566,7 +567,7 @@ void Run::setSystemSpecificParameters()
     if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi34") )
         systemparamcur = systemparamUSB;
        else if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("FSBB") )
-        systemparamcur = systemparamUSB;
+        systemparamcur = systemparamFSBB;
     else if (labbook.system.EqualTo("PXI")) // && labbook.chipGen.EqualTo("34") )
         systemparamcur = systemparamPXI;
     else if (labbook.system.EqualTo("Pegasus")) // && labbook.chipGen.EqualTo("34") )
@@ -792,10 +793,14 @@ Bool_t Run::binSeedSumVeto()
 //     UInt_t seedPixel[10000];
 //     /// Array of processed->clustersize * processed->clustersize clusters, seed pixel in the middle
 //     Float_t pixelcluster[processed->clustersize*processed->clustersize][10000];
-    
+       Int_t pixels=sensorinfocur.columns*sensorinfocur.rows;
+    histoPixelDiodeDiff = new TH1F("histoPixelDiodeDiff","histoPixelDiodeDiff",pixels,0,pixels);
     /// collected charge in cluster
     Float_t pixelSum = 0;
     Float_t notSeedSum = 0;
+       fPixelFakeHits  = new Float_t [pixels]();
+       for(int iPixel=0;iPixel<pixels;iPixel++)
+       fPixelFakeHits[iPixel]=1; //Initiate fPixelFakeHits so that all pixel are accepted (=1), will be overwritten, if getPixelWithFakehits is executed
        getPixelWithFakehits();
        
    //  for (Int_t framei=0; framei<10000; framei++) // loop over all frames   
@@ -856,12 +861,16 @@ Bool_t Run::binSeedSumVeto()
                     if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
                         histogram.Veto->Fill(processed->fFrameInfo.p[12][hiti]);    // histogram with the single pixel
                     
-                    if (processed->fFrameInfo.pixelthreshold[hiti]*fPixelFakeHits[processed->fFrameInfo.pixel[hiti]]>0)//If clustercharge is above threshold AND pixel is NOT a fake hit pixel according getPixelWithFakehits()
+                    if (processed->fFrameInfo.pixelthreshold[hiti]*fPixelFakeHits[processed->fFrameInfo.pixel[hiti]+1]>0)//If clustercharge is above threshold AND pixel is NOT a fake hit pixel according getPixelWithFakehits() WARUM +1? WARUM GEHT fPixelFakeHits NICHT NORMAL??? ICH HABE GERADE KEINE AHNUNG
                     {
                                                
                         histogramthreshold.numberofhits++;
-                        
-                        histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
+                                               if(processed->fFrameInfo.p[12][hiti]>30)
+                                               {       
+                                               //      cout<<framei<<"\t"<<hiti<<"\t"<<processed->fFrameInfo.pixel[hiti]<<"\t"<<fPixelFakeHits[processed->fFrameInfo.pixel[hiti]]<<endl;
+                                                       histoPixelDiodeDiff->Fill(processed->fFrameInfo.pixel[hiti]);
+                        }
+                                               histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
                                                // cout<<"Hitnummer"<<framei<<":"<<hiti<<": "<<"Threshold: "<<processed->fFrameInfo.pixelthreshold[hiti]<<":";
                                                        // for(int col=0;col<25;col++)
                                                        // cout<<processed->fFrameInfo.p[col][hiti]<<",";
@@ -897,7 +906,13 @@ Bool_t Run::binSeedSumVeto()
             }
         }
     }
-
+       
+//     for(int iPixel=0;iPixel<pixels;iPixel++)
+//     cout<<iPixel<<":"<<histoPixelDiodeDiff->GetBinContent(iPixel)<<"\t";
+//     for(int iPixel=0;iPixel<pixels;iPixel++)
+//     cout<<histoPixelDiodeDiff->GetBinContent(iPixel)<<"\t";
+       //cout<<iPixel<<":"<<histoPixelDiodeDiff->GetBinContent(iPixel)<<"-----";
+//     cout<<endl;
 //     gROOT->SetBatch(kTRUE);
     if (labbook.source.Contains("Fe")||labbook.source.Contains("Cd"))
         histogram.posVeto=FitPerform(histogram.Veto, "gaus", true);
@@ -2034,7 +2049,7 @@ void Run::getPixelWithFakehits()
        }
        fPixelFakeHits  = new Float_t [pixels]();
        fcountPixelFakeHits=0;
-       Float_t fakehitrate=0.00001;
+       Float_t fakehitrate=0.0001;
        Float_t sourceIntensity=1;//Adjust it depending on the intensity of the used source
        if(labbook.source.Contains("Fe"))
        {
@@ -2058,7 +2073,8 @@ void Run::getPixelWithFakehits()
                //       cout<<ipixel<<":"<<histoPixel->GetBinContent(ipixel)<<endl;
                }
                else
-               {
+               {       
+               //      cout<<ipixel<<":"<<histoPixel->GetBinContent(ipixel)<<"\t";
                        fPixelFakeHits[ipixel]=1;//pixel is NOT a fake hit pixel
                }
                
index bee99901a1cbf29c39548745de7ab84e8014b6fd..783b61c0b495ba7a7a0183dbd95a1952e223405e 100644 (file)
@@ -273,7 +273,7 @@ private:
         systemparam systemparamFSBB {
         2800, // maxbin;
         2800/4,// nbins;
-        25, //vetothreshold
+        20, //vetothreshold
         10,
         100
     };
@@ -281,6 +281,7 @@ private:
     Int_t* rootlinestyle;
        
         void getPixelWithFakehits();
+               TH1F* histoPixelDiodeDiff;
        TH1F* histoPixel; 
     Float_t* fPixelFakeHits;
        Int_t fcountPixelFakeHits;