]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
run analyzer: Code cleanup
authorBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Thu, 28 Jul 2016 14:20:26 +0000 (16:20 +0200)
committerBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Thu, 28 Jul 2016 14:20:26 +0000 (16:20 +0200)
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/ChargeSpektrumFunctions.c
MABS_run_analyzer/MAPS.c
MABS_run_analyzer/Run.c

index 55b0a95c33e7c4e5704aee27a9ecaa772562d9f5..f52aa6d033a6788813c36d7b4fd8cb2d54330a3d 100644 (file)
@@ -1,8 +1,11 @@
 /**
  * @file ChargeSpektrum.c
- * @brief Use brief, otherwise the index won't have a brief explanation.
+ * @brief This is the main program, it manages the user input and creats classes of type Run.c
  *
- * Detailed explanation.
+ * The main program reads in and interprets the user input, and organizes it. Each runnumber is used
+ * to create classes of type "Run.c".
+ * 
+ * Modify this file to enable/disable plots and data outputs.
  *
  *
  */
@@ -24,113 +27,19 @@ TString savepathresults = "./results/";
 
 void ChargeSpektrum(TString runnumber = "")
 {
-#include "SetStyle.c"
     cout << endl << endl;
     if (gROOT->IsBatch())
         isBatch = kTRUE;
-
+    
     numberRuns=0;
     std::vector<int> runList;
     std::vector<Bool_t> runListForceAnalysis;
     std::vector<TString> runListCustomTitle;
     std::vector<TString> sumuprunList; // not used yet, add runs to each other, combine statistics
-    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);
-                                runListForceAnalysis.push_back(kFALSE);
-                                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(","); // seperate run numbers by ','
-            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)
-                    {
-                        TString sumrunsstr = "";
-                        TObjArray* sumrunarray = tempstrobj->GetString().Tokenize("+");
-                        TObjString* sumuprunsstrobj;
-                        for (Int_t j=0; j < sumrunarray->GetEntries(); j++)
-                        {
-                            sumuprunsstrobj=static_cast<TObjString*>(sumrunarray->At(j));
-                            TString currunnumberstr = sumuprunsstrobj->GetString();
-                            Int_t tempint = currunnumberstr.Atoi();
-                            if (tempint > 0)
-                            {
-                                runList.push_back(tempint);
-                                if (currunnumberstr.Contains("!"))
-                                    runListForceAnalysis.push_back(kTRUE);
-                                else
-                                    runListForceAnalysis.push_back(kFALSE);
-                                if (currunnumberstr.Contains("=")) {
-                                    cout << colorcyan << currunnumberstr << endlr;
-                                    runListCustomTitle.push_back(currunnumberstr(currunnumberstr.Index('=')+1,currunnumberstr.Length()-currunnumberstr.Index('=')-1));                                    
-                                } else {
-                                    runListCustomTitle.push_back("");
-                                }
-                                sumrunsstr.Append(Form("%d,",tempint));
-                                numberRuns++;
-                            }
-                            else
-                                cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempint << endlr;
-                        }
-                        sumuprunList.push_back(sumrunsstr);
-                    }
-                    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);
-    }
+    
+    #include "SetStyle.c"
+    InterpreteUserInput(runnumber, &runList, &runListForceAnalysis, &runListCustomTitle, &sumuprunList);
+    
     runs = new Run*[numberRuns];
 
     cout << "Found " << numberRuns << " run(s) in 'runlist.txt' or given as parameters." << endl;
@@ -149,9 +58,7 @@ void ChargeSpektrum(TString runnumber = "")
                 //runs[runi]->setFixedThresholdValueElectrons(1440);
                 //runs[runi]->setNoisethresholdborderADU(30);
 
-//                 runs[runi]->analyzeFrame(57826);
-//                 runs[runi]->analyzeFrame(57827);
-//                 runs[runi]->analyzeFrame(983603);
+//                   runs[runi]->analyzeFrame(1000);
 
                 // creates or opens .root file, can analyze the RAW data
                 if (runListForceAnalysis.size() >= (unsigned)runi+1)
@@ -185,15 +92,16 @@ void ChargeSpektrum(TString runnumber = "")
 //                     runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramthreshold->calibrated);
 //                     runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramfixedthreshold);
 //                     runs[runi]->plotCompareHistograms();
-//                        runs[runi]->plotAllHistograms(runs[runi]->histogramthreshold);
-                    compareHistogramClassVector.push_back(runs[runi]->histogramthreshold->normalized);
-                    compareHistogramVector.push_back(runs[runi]->histogramthreshold->normalized->calibrated->Seed);
-                    compareHistogramVector2.push_back(runs[runi]->histogramthreshold->normalized->Seed);
+                        runs[runi]->plotAllHistograms(runs[runi]->histogram);
+                     compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
+//                     compareHistogramVector.push_back(runs[runi]->histogramthreshold->normalized->calibrated->Seed);
+//                     compareHistogramVector2.push_back(runs[runi]->histogramthreshold->normalized->Seed);
                     //compareHistogramClassVector.push_back(runs[runi]->histogram);
                     //                      runs[runi]->plot1DHistogram(runs[runi]->histogramthreshold, runs[runi]->histogramthreshold->Veto, "gaus");
-                      runs[runi]->plot1DHistogram(runs[runi]->histogramthreshold, runs[runi]->histogramthreshold->normalized->Sum, "gaus", 1);
-                      runs[runi]->plot1DHistogram(runs[runi]->histogramthreshold, runs[runi]->histogramthreshold->normalized->Veto, "GaussTail", 1);
-  //                   compareHistogramVector.push_back(runs[runi]->histogramthreshold->calibrated->normalized->Veto);
+//                      runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogram->Sum, "gaus", 1);
+//                       runs[runi]->plot1DHistogram(runs[runi]->histogramthreshold, runs[runi]->histogramthreshold->Veto, "GaussTail", 1);
+                      //                   compareHistogramVector.push_back(runs[runi]->histogramthreshold->calibrated->normalized->Veto);
+//                      runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogram->Seed, "landau", 1);
                     runs[runi]->writeAllHistogramsToFile();
                 }
                 //cout << runs[runi]->histogram
@@ -217,7 +125,7 @@ void ChargeSpektrum(TString runnumber = "")
 //     runs[3]->setLabel("HR18, P13, 5.0 V");
 printSummaryTable(&compareHistogramClassVector);
 // CompareHistograms(&compareHistogramVector);
-CompareHistograms(&compareHistogramVector2);
+// CompareHistograms(&compareHistogramVector2);
 plotAllRuns(&compareHistogramClassVector);
 //    plotAllRuns(&compareHistogramClassVector2);
 //     plotAllRuns(&compareHistogramClassVector3);
index 3a0776b1f80c3a2c522b2e372094f5089c5762cd..23656aa11fb518f3c3ca4abe77dfa836a54d7323 100644 (file)
@@ -19,6 +19,7 @@ using namespace std;
 
 Int_t* ReadRunList();
 Int_t ReadRunList(std::vector<int>*);
+void InterpreteUserInput(TString, std::vector<int>*, std::vector<Bool_t>*, std::vector<Bool_t>*, std::vector<Bool_t>*);
 Bool_t plotAllRuns();
 Bool_t plotAllRuns(vector<HistogramType*>*);
 /** @brief A function to plot TH1F histograms of different runs into one file
@@ -80,6 +81,108 @@ void ChargeSpektrum(Int_t runnumber, Int_t runnumber2)
     exit(1);
 }
 
+void InterpreteUserInput(TString runnumber, std::vector<int> *runList, std::vector<Bool_t> *runListForceAnalysis, std::vector<TString> *runListCustomTitle, std::vector<TString> *sumuprunList)
+{
+    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);
+                                runListForceAnalysis->push_back(kFALSE);
+                                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(","); // seperate run numbers by ','
+            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)
+                    {
+                        TString sumrunsstr = "";
+                        TObjArray* sumrunarray = tempstrobj->GetString().Tokenize("+");
+                        TObjString* sumuprunsstrobj;
+                        for (Int_t j=0; j < sumrunarray->GetEntries(); j++)
+                        {
+                            sumuprunsstrobj=static_cast<TObjString*>(sumrunarray->At(j));
+                            TString currunnumberstr = sumuprunsstrobj->GetString();
+                            Int_t tempint = currunnumberstr.Atoi();
+                            if (tempint > 0)
+                            {
+                                runList->push_back(tempint);
+                                if (currunnumberstr.Contains("!"))
+                                    runListForceAnalysis->push_back(kTRUE);
+                                else
+                                    runListForceAnalysis->push_back(kFALSE);
+                                if (currunnumberstr.Contains("=")) {
+                                    cout << colorcyan << currunnumberstr << endlr;
+                                    runListCustomTitle->push_back(currunnumberstr(currunnumberstr.Index('=')+1,currunnumberstr.Length()-currunnumberstr.Index('=')-1));                                    
+                                } else {
+                                    runListCustomTitle->push_back("");
+                                }
+                                sumrunsstr.Append(Form("%d,",tempint));
+                                numberRuns++;
+                            }
+                            else
+                                cout << coloryellow << "Invalid run number "<< colorreset << colorwhite << tempint << endlr;
+                        }
+                        sumuprunList->push_back(sumrunsstr);
+                    }
+                    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);
+    }
+}
+
+
 Int_t ReadRunList(std::vector<int>* runlist)
 {
     std::ifstream file("runlist.txt");
index e48397b99c7e7bed21ecff7874aeb3bad1e66b57..2bc586a817c424ba09a2b4f7043533ae58529bd0 100644 (file)
@@ -751,6 +751,7 @@ if(fOk)
         }
         
         PEDESTAL = PEDESTAL/Frames;
+        cout << colorcyan << "Pedestal :" << PEDESTAL << endlr;
         
         for(UInt_t j=0; j<Frames; j++)
         {
@@ -758,6 +759,7 @@ if(fOk)
         }
         
         NOISE = TMath::Sqrt(NOISE/(Frames-1));
+        cout << colorcyan << "NOISE :" << NOISE << endlr;
         
         fNoise[i]       = NOISE;
         fPedestals[i]   = PEDESTAL;
@@ -1253,10 +1255,10 @@ void MAPS::hitana() {
             //  cout<<fCdsmatrix[i]<<",";
         }
         
-        //  cout<<fFrameNumber<<":________:"<<cdsMatrixSum<<endl;
-        //    debugStream<>(fCdsmatrix, fPixels, fColumns, 2, 20);
-        //  cout<<"Pedestals"<<endl;
-        //  debugStream<>(fPedestals, fPixels, fColumns, 2, 20);        
+//            cout<<fFrameNumber<<":________:"<<cdsMatrixSum<<endl;
+//            debugStream<>(fCdsmatrix, fPixels, fColumns, 2, 20);
+//           cout<<"Pedestals"<<endl;
+//           debugStream<>(fPedestals, fPixels, fColumns, 2, 20);        
         for(Int_t i=0; i<fPixels; i++)
         {
             cdsmatrixCorrPed[i]=(float)(1.*fCdsmatrix[i]-fPedestals[i]);
@@ -1404,8 +1406,8 @@ void MAPS::hitana() {
                         }
                     }
                 }
-                //                cout<<"Hitted pixel discriminator matrix:"<<endl;
-                //                debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
+//                                cout<<"Hitted pixel discriminator matrix:"<<endl;
+//                                debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
                 fHittedPixel[rechargePixellist[rechargingpixeli]] = -4;
                 
             }
@@ -1576,7 +1578,8 @@ void MAPS::hitana() {
                 }
             }
             
-            
+//             if ( B < 10) CHANCE=0; // TODO remove me, buggy column 3 in Mi19, triing to ommit dirty?
+                
             
             
             
@@ -1617,8 +1620,8 @@ void MAPS::hitana() {
                         }
                     }
                 }
-                //       cout<<"Hitted pixel discriminator matrix:"<<endl;
-                //       debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
+//                       cout<<"Hitted pixel discriminator matrix:"<<endl;
+//                       debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
                 if (bordercluster)
                     fHittedPixel[Hitlist[hit]] = -2;
                 else
@@ -1676,19 +1679,22 @@ void MAPS::hitana() {
                     // {
                     // cout<<"Charge"<<chargesumincluster4<<"must bigger than NOISE"<<noisesumincluster4*6.0<<endl;
                     // debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
-                    // for(Int_t row=0; row<5; row++)
-                    // {
-                    // for(Int_t column=0; column<5; column++)
-                    // {
-                    // std::cout.width(10);
-                    // std::cout << std::fixed;
-                    // std::cout << std::left << std::setprecision(2) << pixelchargeincluster[row*5+column];
-                    // }
-                    // cout << endl;
-                    // }
-                    // cout << endl;
+                    // Uncomment below to see hot cluster and their charge
+//                     for(Int_t row=0; row<5; row++)
+//                     {
+//                     for(Int_t column=0; column<5; column++)
+//                     {
+//                     std::cout.width(10);
+//                     std::cout << std::fixed;
+//                     std::cout << std::left << std::setprecision(2) << pixelchargeincluster[row*5+column];
+//                     }
+//                     cout << endl;
+//                     }
+//                     cout << "Charge sum: " << chargesumincluster << endl;
+//                     cout << endl;
                     // debugStream<>(cdsmatrixCorrPed, fPixels, fColumns, 1, 10);  
                     // }
+                    
                     fHits++;
                 }
                 
@@ -1705,7 +1711,6 @@ void MAPS::hitana() {
                 {
                     fdiscriminatedhitmatrix->SetBinContent(i%fColumns, (int)(i/fColumns), fHittedPixel[i]);
                     fADCHitmatrix->SetBinContent(i%fColumns, (int)(i/fColumns), fCdsmatrix[i]);
-                    //  cout<<"HITHERE"<<i<<":"<<fHittedPixel[i]<<";"<<fCdsmatrix[i]<<endl;
                 }
             }
             
@@ -1774,18 +1779,23 @@ void MAPS::plotFrame(Int_t FrameNumber) {
     }
     else {
         cout <<endl <<endl << colorwhite << "---------------- FRAME " << fFrameNumber << " ----------------" << colorreset << endl << endl;
+        cout<<"F0 matrix:"<<endl;
+        debugStream<>(fF0matrix, fPixels/fColumns, fColumns, 0, 39);
+        cout<<"F1 matrix:"<<endl;
+        debugStream<>(fF1matrix, fPixels/fColumns, fColumns, 0, 39);
+        
         cout<<"CDS matrix:"<<endl;
-        debugStream<>(fCdsmatrix, fPixels, fColumns, 0, 39);
+        debugStream<>(fCdsmatrix, fPixels/fColumns, fColumns, 0, 39);
         Float_t cdsmatrixCorrPed[fPixels];
         for(Int_t i=0; i<fPixels; i++)
         {
             cdsmatrixCorrPed[i]=(float)(1.*fCdsmatrix[i]-fPedestals[i]);
         }
         cout<<"CDS matrix minus pedestals:"<<endl;
-        debugStream<>(cdsmatrixCorrPed, fPixels, fColumns, 0, 10);
-        // cout<<fCdsmatrix[0]<<","<<fCdsmatrix[1]<<","<<fCdsmatrix[2]<<","<<fCdsmatrix[3]<<","<<fCdsmatrix[4]<<","<<fCdsmatrix[5]<<","<<fCdsmatrix[6]<<endl;
+        debugStream<>(cdsmatrixCorrPed, fPixels/fColumns, fColumns, 0, 10);
+//         cout<<fCdsmatrix[0]<<","<<fCdsmatrix[1]<<","<<fCdsmatrix[2]<<","<<fCdsmatrix[3]<<","<<fCdsmatrix[4]<<","<<fCdsmatrix[5]<<","<<fCdsmatrix[6]<<endl;
         cout<<"Hitted pixel discriminator matrix:"<<endl;
-        debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
+        debugStream<>(fHittedPixel, fPixels/fColumns, fColumns, 1, 1);
         
         TCanvas* cm1 = new TCanvas(Form("Frame %d",FrameNumber),Form("Frame %d",FrameNumber),50,100,1200,800);
         cm1->Divide(2,3);
@@ -1798,12 +1808,13 @@ void MAPS::plotFrame(Int_t FrameNumber) {
         TH2F *h1  = new TH2F("CDS matrix", "CDS matrix",            fColumns, 0, fColumns, fRows, 0, fRows);
         TH2F *h2  = new TH2F("Frame 0 matrix", "Frame 0 matrix",    fColumns, 0, fColumns, fRows, 0, fRows);
         TH2F *h3  = new TH2F("Frame 1 matrix", "Frame 1 matrix",    fColumns, 0, fColumns, fRows, 0, fRows);
+        TH2F *h6  = new TH2F("CDS matrix - Pedestial", "CDS matrix - Pedestial", fColumns, 0, fColumns, fRows, 0, fRows);
         TH1F *h4  = new TH1F("Frame 0 histo", "Frame 0 histo",      2*16384, -16384, 16384);
         TH1F *h5  = new TH1F("Frame 1 histo", "Frame 1 histo",      2*16384, -16384, 16384);
         
         Int_t column;
         Int_t row;
-        Float_t F0,F1,CDS;
+        Float_t F0,F1,CDS,CDSminusPed;
         
         for(Int_t i=0; i<fPixels; i++)
         {
@@ -1811,6 +1822,7 @@ void MAPS::plotFrame(Int_t FrameNumber) {
             column  = i%fColumns;
             
             CDS = fCdsmatrix[i];
+            CDSminusPed = cdsmatrixCorrPed[i];
             
             F0  = fF0matrix[i];
             F1  = fF1matrix[i];
@@ -1820,19 +1832,20 @@ void MAPS::plotFrame(Int_t FrameNumber) {
             h3->Fill(column,row,F1);
             h4->Fill(F0);
             h5->Fill(F1);
+            h6->Fill(column,row,CDSminusPed);
         }
         
         cm1->cd(1);
-        h1->Draw("colz");
-        h1->GetXaxis()->SetTitle("column");
-        h1->GetYaxis()->SetTitle("row");
-        h1->GetZaxis()->SetTitle("Signal [ADC]");
+        h6->Draw("colz");
+        h6->GetXaxis()->SetTitle("column");
+        h6->GetYaxis()->SetTitle("row");
+        h6->GetZaxis()->SetTitle("Signal [ADC]");
         
         cm1->cd(2);
-        h1->Draw("surf2z");
-        h1->GetXaxis()->SetTitle("column");
-        h1->GetYaxis()->SetTitle("row");
-        h1->GetZaxis()->SetTitle("Signal [ADC]");
+        h6->Draw("surf2z");
+        h6->GetXaxis()->SetTitle("column");
+        h6->GetYaxis()->SetTitle("row");
+        h6->GetZaxis()->SetTitle("Signal [ADC]");
         
         cm1->cd(3);
         h2->Draw("surf2z");
index 4a6ccf047a66f1cf0c9f1a618c3bb17f9b10ba79..347b48267533b2f86ce5e29552e7b5076063bcbe 100644 (file)
@@ -225,6 +225,7 @@ void Run::setSystemSpecificParameters()
     systemparam systemparamPegasus (2800,2800/2,20,10,100);
     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*/);
     if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi34") )
         cursystemparam = systemparamUSB;
     else if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("FSBB") )
@@ -233,6 +234,10 @@ void Run::setSystemSpecificParameters()
         cursystemparam = systemparamPXI;
     else if (labbook.system.EqualTo("Pegasus")) // && labbook.chipGen.EqualTo("34") )
         cursystemparam = systemparamPegasus;
+    if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi19") )
+        cursystemparam = systemparamUSBMi19;
+    else if (labbook.system.EqualTo("USB")) // && labbook.chipGen.EqualTo("34") )
+        cursystemparam = systemparamUSB;
     
     setSensorInSystemParam();
 }
@@ -243,6 +248,7 @@ void Run::setSensorInSystemParam()
     sensorinfostruct sensorinfoMi34PXI( 16, /* rows */  64 /* columns */   );
     sensorinfostruct sensorinfoPegasus( 8, 56 );
     sensorinfostruct sensorinfoFSBB( 4, 416 );
+    sensorinfostruct sensorinfoMi19USB( 192, /* rows */  192 /* columns */   );
     
     if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi34") )
         cursensorinfo=sensorinfoMi34USB;
@@ -252,6 +258,8 @@ void Run::setSensorInSystemParam()
         cursensorinfo=sensorinfoMi34PXI;
     else if (labbook.system.EqualTo("Pegasus")) // && labbook.chipGen.EqualTo("34") )
         cursensorinfo=sensorinfoPegasus;
+    else if (labbook.system.EqualTo("USB")  && labbook.chipGen.EqualTo("Mi19") )
+        cursensorinfo=sensorinfoMi19USB;
 }
 
 void Run::setMatrixSpecificParameters()
@@ -356,7 +364,7 @@ Bool_t Run::analyzeRun(Bool_t force)
             processed->InitialDynNoise();
             int start   = 0;
             int nframes = processed->GetNumberFrames();
-          //   for(int i=0; i<1000;i++) // TODO remove 100000 run 342272
+//              for(int i=0; i<10000;i++) // TODO remove 100000 run 342272
            for(int i=0; i<nframes;i++) // TODO remove 100000 run 342272
             {
 //                 cout << "getframe " << i << endl;
@@ -828,7 +836,8 @@ Bool_t Run::binSeedSumVeto()
     {
         processed->fHitTree->GetEntry(framei);
         // account only frames with less then 10 hits
-        if (processed->fFrameInfo.hits<(unsigned int)10)
+//          cout << colorcyan << processed->fFrameInfo.hits << endlr;
+//         if (processed->fFrameInfo.hits<(unsigned int)10)
         {
             for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++)
             {
@@ -845,6 +854,7 @@ Bool_t Run::binSeedSumVeto()
                     
                     // histogram with the single pixel
                     histogram->Seed->Fill(processed->fFrameInfo.p[12][hiti]);
+//                     cout << colorcyan << "filled seed" << endlr;
                     
                     // sum histogram
                     pixelSum = 0;
@@ -896,7 +906,6 @@ Bool_t Run::binSeedSumVeto()
                     }
                     
                     if (histogramfixedthreshold != 0) {
-                        cout << colorred << "NOT NULL! " << endlr;
                         if (processed->fFrameInfo.pixelfixedthreshold[hiti]>0)
                         {
                             histogramfixedthreshold->numberofhits++;