]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Analysis: only std=c++11 warnings left
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Thu, 7 May 2015 10:26:43 +0000 (12:26 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Thu, 7 May 2015 10:26:43 +0000 (12:26 +0200)
MABS_run_analyzer/MAPS.c
MABS_run_analyzer/MAPS.h
MABS_run_analyzer/Run.c

index 5f4118a0d487652e789ec5701f7fa23ecf9d6035..24e0844cf5f6c05b78cb661279e3cc9dc7dd2400 100644 (file)
@@ -537,13 +537,13 @@ void MAPS::initHistograms() {
 
 //####################################################################
 
-bool MAPS::getFrame(Int_t FrameNumber) {
+bool MAPS::getFrame(UInt_t FrameNumber) {
 
     fFrameNumber = FrameNumber;
 
     if(fFrameNumber<fEventsSum)
     {
-        Int_t EVENTOFF = 0;
+        UInt_t EVENTOFF        = 0;
         Int_t FFILE            = 0;
 
         // Calculate offset, to start the readin of the file
@@ -632,7 +632,7 @@ bool MAPS::getFrame(Int_t FrameNumber) {
 
 //####################################################################
 
-bool MAPS::getNoise(Int_t Start, Int_t Frames) {
+bool MAPS::getNoise(UInt_t Start, UInt_t Frames) {
 //Noise + Pedestals
     if(fOk)
     {
@@ -659,7 +659,7 @@ bool MAPS::getNoise(Int_t Start, Int_t Frames) {
         Float_t NOISE;
         Int_t PIXEL;
 
-        for(Int_t i=Start; i<Frames+Start; i++)
+        for(UInt_t i=Start; i<Frames+Start; i++)
         {
             getFrame(i);
 
@@ -683,14 +683,14 @@ bool MAPS::getNoise(Int_t Start, Int_t Frames) {
             PEDESTAL   = 0;
             NOISE              = 0;
 
-            for(Int_t j=0; j<Frames; j++)
+            for(UInt_t j=0; j<Frames; j++)
             {
                 PEDESTAL+=ARR[j*fPixels+i];
             }
 
             PEDESTAL = PEDESTAL/Frames;
 
-            for(Int_t j=0; j<Frames; j++)
+            for(UInt_t j=0; j<Frames; j++)
             {
                 NOISE+=TMath::Power(ARR[j*fPixels+i]-PEDESTAL,2);
             }
@@ -934,7 +934,7 @@ arraytype MAPS::SumOverArray(const arraytype* (a), Int_t n) {
 
 
 template <typename arraytype>
-arraytype MAPS::debugStream(const arraytype* (a), Int_t n, Int_t columns, Int_t precision, float highlightabove) {
+void MAPS::debugStream(const arraytype* (a), Int_t n, Int_t columns, Int_t precision, float highlightabove) {
     cout << colorwhite << "----------------------------------" << colorreset << endl;
     for (int i=0; i<n;i++)
     {
@@ -951,162 +951,6 @@ arraytype MAPS::debugStream(const arraytype* (a), Int_t n, Int_t columns, Int_t
     cout << endl;
 }
 
-
-bool MAPS::getDynNoise2(Int_t Frames) {
-
-    if( fNoiseDyn )
-    {
-        delete[] fDynFrameArr;
-        delete[] fDynCounter;
-
-        fDynFrameArr   = new Float_t[Frames*fPixels];
-        fDynCounter            = new Int_t[fPixels];
-    }
-    else
-    {
-        fDynNoiseTree->Branch("frame"          , &fFrameNumber         , "frame/i"             , 32000);
-        fDynNoiseTree->Branch("noise"          , &fNoiseMean           , "noise/F"             , 32000);
-        fDynNoiseTree->Branch("pedestal"       , &fPedestalsMean       , "pedestal/F"  , 32000);
-    }
-
-    if(fOk)
-    {
-//Check amount of Frames
-        if(Frames<50)
-        {
-            cout<<"Too few Frames! Change Frames from "<<Frames<<" to ";
-            Frames = 50;
-            cout<<Frames<<" !"<<endl;
-        }
-// Warning: if too many pixels the dynamic array overflow the ram
-        Int_t End = Frames*fPixels*4;
-        cout<<"Run getDynNoise() initiated ..."<<endl;
-        cout<<"---"<<endl;
-        cout<<"'fDynFrameArr' allocates ";
-        if             (End/(TMath::Power(2,40)) >= 1) {
-            printf("%6.2f TB  ", (Float_t)(End/(TMath::Power(2,40))) );
-        }
-        else if        (End/(TMath::Power(2,30)) >= 1) {
-            printf("%6.2f GB  ", (Float_t)(End/(TMath::Power(2,30))) );
-        }
-        else if        (End/(TMath::Power(2,20)) >= 1) {
-            printf("%6.2f MB  ", (Float_t)(End/(TMath::Power(2,20))) );
-        }
-        else if        (End/(TMath::Power(2,10)) >= 1) {
-            printf("%6.2f kB  ", (Float_t)(End/(TMath::Power(2,10))) );
-        }
-        else                                                                   {
-            printf("%6.2f B   ", (Float_t)(End));
-        }
-        cout<<"for dynamic noise calculation! "<<endl;
-
-        fDynFrameArr   = new Float_t[Frames*fPixels];
-        fDynCounter            = new Int_t[fPixels];
-
-        for(Int_t i=0; i<fPixels; i++) {
-            fDynCounter[i]=0;
-        }
-
-        bool STOP      = false;
-        fNoiseDyn      = false;
-
-//Check availabilty of Frames
-        if( Frames                     > fEventsSum )  {
-            Frames = fEventsSum;
-            printf("Changed 'Number Frames' to: %u\n", Frames );
-        }
-// Get fPixels and allocate array
-        Float_t        PEDESTAL;
-        Float_t        NOISE;
-//             Int_t   PIXEL=0;
-
-        if(!fNoiseOk) {
-            getNoise(0,Frames);
-        }
-        {
-            int i=0;
-
-            
-            while(!STOP)
-            {
-                getFrame(i);
-                hitana();
-
-                STOP = true;
-
-                for(Int_t j=0; j<fPixels; j++)
-                {
-                    if( fHittedPixel[j]==0)
-                    {
-                        if( fDynCounter[j]<Frames )
-                        {
-                            fDynFrameArr[Frames*j+fDynCounter[j]] = fCdsmatrix[j];//-fPedestals[j];
-                            fDynCounter[j]++;
-
-                            STOP = false;
-                        }
-                    }
-                }
-                i++;
-            }
-        }
-
-        for(Int_t i=0; i<fPixels; i++)
-        {
-            PEDESTAL   = 0;
-            NOISE              = 0;
-
-            for(Int_t j=0; j<Frames; j++)
-            {
-                PEDESTAL+=fDynFrameArr[Frames*i+j];
-            }
-
-            PEDESTAL = PEDESTAL/Frames;
-
-            for(Int_t j=0; j<Frames; j++)
-            {
-                NOISE+=TMath::Power(fDynFrameArr[Frames*i+j]-PEDESTAL,2);
-            }
-
-            NOISE = TMath::Sqrt(NOISE/(Frames));
-
-            fNoise[i]          = NOISE;
-            fPedestals[i]      = PEDESTAL;
-//                     PIXEL                   = i;
-
-            fDynCounter[i] = 0;
-        }
-
-        cout<<"-----------------------"<<endl;
-
-        fNoiseOk       = true;
-        fNoiseDyn      = Frames;
-
-        if( fSave  )
-        {
-            fFrameNumber       = 0;
-            fNoiseMean         = 0;
-            fPedestalsMean     = 0;
-
-            fDynNoiseTree->Fill();
-
-            fFrameNumber       = 0;
-            fNoiseMean         = TMath::Mean((const int)fPixels, fNoise);
-            fPedestalsMean     = TMath::Mean((const int)fPixels, fPedestals);
-
-            fDynNoiseTree->Fill();
-        }
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-};
-
-//####################################################################
-
-
 bool MAPS::regetDynNoise(Int_t Frames) {
     for(Int_t pixeli=0; pixeli<fPixels; pixeli++)
     {
@@ -1204,6 +1048,7 @@ bool MAPS::regetDynNoise(Int_t Frames) {
 //###################################################################
 bool MAPS::loadNoise() {
     loadNoise(fRootFile);
+    return 0;
 }
 
 bool MAPS::loadNoise( TString filename) {
@@ -1724,7 +1569,7 @@ void MAPS::plotNoise() {
 
 //####################################################################
 
-void MAPS::plotHitDis(Int_t Start, Int_t Frames) {
+void MAPS::plotHitDis(UInt_t Start, UInt_t Frames) {
 
     if(fOk)
     {
@@ -1742,7 +1587,7 @@ void MAPS::plotHitDis(Int_t Start, Int_t Frames) {
 
 //####################################################################
 
-void MAPS::plotSignal(Int_t Start, Int_t Frames) {
+void MAPS::plotSignal(UInt_t Start, UInt_t Frames) {
 
     if(fOk)
     {
@@ -1764,7 +1609,7 @@ void MAPS::plotSignal(Int_t Start, Int_t Frames) {
         TH1F *h5  = new TH1F("Frames 1 histo"  , "Frames 1 histo"      ,               2*16384, -16384, 16384);
         TH1F *h6  = new TH1F("CDS histo"               , "CDS histo"           ,               2*16384, -16384, 16384);
 
-        for(int i=Start; i<Start+Frames; i++)
+        for(UInt_t i=Start; i<Start+Frames; i++)
         {
             if(getFrame(i))
             {
@@ -1831,7 +1676,7 @@ void MAPS::plotSignal(Int_t Start, Int_t Frames) {
 
 //####################################################################
 
-void MAPS::plotPixSignal(Int_t Start, Int_t Frames, Int_t Pixel) {
+void MAPS::plotPixSignal(UInt_t Start, UInt_t Frames, Int_t Pixel) {
 
     if(fOk)
     {
@@ -1862,7 +1707,7 @@ void MAPS::plotPixSignal(Int_t Start, Int_t Frames, Int_t Pixel) {
         TH1F *h5  = new TH1F("Frames 1 phisto" , "Frames 1 phisto"     ,               2*16384, -16384, 16384);
         TH1F *h6  = new TH1F("CDS phisto"              , "CDS phisto"          ,               2*16384, -16384, 16384);
 
-        for(int i=Start; i<Start+Frames; i++)
+        for(UInt_t i=Start; i<Start+Frames; i++)
         {
             if(getFrame(i))
             {
index 0efd512781da7c9f091ac179782cf6c379c4601d..ce472b48abf1c3b470a4514970691bed0d34e4cf 100644 (file)
@@ -81,7 +81,7 @@ private:
     UInt_t       fEventsSum;
     Int_t       fFile;
     
-    Int_t       fFrameNumber; /**< enum value 1 */
+    UInt_t       fFrameNumber; /**< enum value 1 */
     /// true if all data files OK
     bool        fOk; 
     /// if set to true, a root file for the analyzed run will be created, set and passed initMapsRun() to  in the constructor
@@ -267,7 +267,7 @@ private:
     arraytype SumOverArray(const arraytype* (a), Int_t n);
     
     template <typename arraytype>
-    arraytype debugStream(const arraytype* (a), Int_t n=512, Int_t columns=8, Int_t precision=2, float highlightabove = 99999999);
+    void debugStream(const arraytype* (a), Int_t n=512, Int_t columns=8, Int_t precision=2, float highlightabove = 99999999);
         
     /**
      * @brief Initialize histogram labels and histograms #hint1, #hint2, #fdiscriminatedhitmatrix, #fADCHitmatrix
@@ -335,10 +335,10 @@ public:
      *  @param FrameNumber TheFrame
      * 
      */ 
-    bool getFrame       (Int_t FrameNumber);
+    bool getFrame       (UInt_t FrameNumber);
     /**
      * @brief Old routine, shoould be deletable without side effects */
-    bool getNoise       (Int_t Start, Int_t Frames);
+    bool getNoise       (UInt_t Start, UInt_t Frames);
     
     /**
      *  @brief  Calculates a first estimate of the noise and pedestial of each pixel in #frames
@@ -357,10 +357,6 @@ public:
     /**
      * @brief Old routine, shoould be deletable without side effects */
     bool getDynNoise    (Int_t Frames = numberofframesfornoise);
-    /**
-     * @brief Old routine, shoould be deletable without side effects */
-    bool getDynNoise2(Int_t Frames = numberofframesfornoise);
-    
     /**
      *  @brief  Eliminates line structures in the chip
      * 
@@ -448,9 +444,9 @@ public:
     
     void plotNoise      (void);
     void plotFrame      (Int_t FrameNumber);
-    void plotHitDis     (Int_t Start, Int_t Frames);
-    void plotSignal     (Int_t Start, Int_t Frames);
-    void plotPixSignal  (Int_t Start, Int_t Frames, Int_t Pixel);
+    void plotHitDis     (UInt_t Start, UInt_t Frames);
+    void plotSignal     (UInt_t Start, UInt_t Frames);
+    void plotPixSignal  (UInt_t Start, UInt_t Frames, Int_t Pixel);
     
     void writeData      ();
     
index 532dc9bd4efcdfa22de2eb63d62e97ebe55e0535..b1dceee79b45017bf7a4354a9719eb8e2827bcc2 100644 (file)
@@ -652,6 +652,7 @@ Bool_t Run::plotSeed()
         plot1DHistogram(histogram.Seed, "landau");
         return 0;
     }
+    return 1;
 }
 
 
@@ -979,7 +980,7 @@ Bool_t Run::writeAllHistogramsToFile()
     TString filename= savepathresults + "/" + runcode + " histograms.dat";
     fstream* fout = new fstream(filename,ios::out);
     
-    TString header = Form("#bin [ADU]\tbin [e]\tSeed\tSum\t\Veto\tbin noise [ADU]\tbin noise [e]\tnoise\n");
+    TString header = Form("#bin [ADU]\tbin [e]\tSeed\tSum\tVeto\tbin noise [ADU]\tbin noise [e]\tnoise\n");
     header += Form("#posVeto, run: %.1f, DB: %.1f, Fe55 DB (%d, %.1f): %.1f\n", histogram.posVeto, labbook.posVetoDB, Fe55run.posVetorunnumber, Fe55run.temperature, Fe55run.posVeto);
     header += Form("#posSeed, run: %.1f, DB: %.1f\n", histogram.posSeed, labbook.posSeedDB);
     header += Form("#posSum, run: %.1f, DB: %.1f\n", histogram.posSum, labbook.posSumDB);