Changeset 7010


Ignore:
Timestamp:
05/10/05 14:52:19 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7007 r7010  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23
     24 2005/05/10 Daniela Dorner
     25
     26    * datacenter/macros/fillcalib.C:
     27      - added some parameters (reading from calib*.root and inserting
     28        into db)
     29
     30    * datacenter/macros/setupdb.C:
     31      - adapted macro to the new columns in the calibration db
     32
     33    * datacenter/macros/fillsignal.C:
     34      - fixed typo
     35
     36
     37
    2338 2005/05/10 Markus Meyer
    2439
     
    2944     - commented out the ArcLength and Estimpact (will be not
    3045       calculated for the moment)
     46
    3147
    3248
  • trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C

    r6935 r7010  
    6161#include <TRegexp.h>
    6262
     63#include <TH1.h>
     64
    6365#include <TFile.h>
    6466#include <TSQLResult.h>
     
    6769#include "MSQLServer.h"
    6870
     71#include "MStatusArray.h"
     72#include "MHCamera.h"
    6973#include "MGeomCamMagic.h"
    7074#include "MBadPixelsCam.h"
     
    143147    //     hist.DrawCopy();
    144148
     149    //Getting values from the status display
     150    MStatusArray arr;
     151    if (arr.Read()<=0)
     152        return 0;
     153
     154    TH1 *h;
     155
     156    //getting the mean and rms from the arrival time (inner cam)
     157    h = (TH1*)arr.FindObjectInCanvas("HRelTimeHiGainArea0", "TH1F", "Time");
     158    if (!h)
     159    {
     160        cout << "WARNING - Could not find histogram HRelTimeHiGainArea0." << endl;
     161        return 0;
     162    }
     163
     164    Float_t meani = h->GetMean();
     165    Float_t rmsi  = h->GetRMS();
     166    meani = TMath::Nint(meani*10)/10.;
     167    rmsi  = TMath::Nint(rmsi*10)/10.;
     168    TString meaninner = Form("%4.1f", meani);
     169    TString rmsinner  = Form("%4.1f", rmsi);
     170
     171    cout << "bla: " << meaninner << ", " << rmsinner << endl;
     172    cout << "bla: " << meaninner.Data() << ", " << rmsinner.Data() << endl;
     173
     174
     175    //getting the mean and rms from the arrival time (outer cam)
     176    h = (TH1*)arr.FindObjectInCanvas("HRelTimeHiGainArea1", "TH1F", "Time");
     177    if (!h)
     178    {
     179        cout << "WARNING - Could not find histogram HRelTimeHiGainArea1." << endl;
     180        return 0;
     181    }
     182
     183    Float_t meano = h->GetMean();
     184    Float_t rmso  = h->GetRMS();
     185    meano = TMath::Nint(meano*10)/10.;
     186    rmso  = TMath::Nint(rmso*10)/10.;
     187    TString meanouter = Form("%4.1f", meano);
     188    TString rmsouter  = Form("%4.1f", rmso);
     189
     190
     191    //Getting conversion factors
     192    MHCamera *c = (MHCamera*)arr.FindObjectInCanvas("TotalConv", "MHCamera", "Conversion");
     193    if (!c)
     194    {
     195        cout << "WARNING - Could not find MHCamera TotalConv." << endl;
     196        return 0;
     197    }
     198
     199    TArrayI inner(1), outer(1);
     200    inner[0] = 0;
     201    outer[0] = 1;
     202
     203    Int_t s0[] = { 1, 2, 3, 4, 5, 6 };
     204
     205    Stat_t meanconvi = c->GetMeanSectors(TArrayI(6, s0), inner);
     206    Stat_t meanconvo = c->GetMeanSectors(TArrayI(6, s0), outer);
     207    meanconvi = TMath::Nint(meanconvi*10)/10.;
     208    meanconvo = TMath::Nint(meanconvo*10)/10.;
     209    TString meanconvinner=Form("%4.1f", meanconvi);
     210    TString meanconvouter=Form("%4.1f", meanconvo);
     211
     212
     213    //Getting sequ# from filename
    145214    TString sequence = fname(TRegexp("calib[0-9]+[.]root$"));
    146215    if (sequence.IsNull())
    147         return 0;
     216    {
     217        cout << "WARNING - Could get sequence# from filename: " << fname << endl;
     218        return 0;
     219    }
    148220
    149221    Int_t seq = atoi(sequence.Data()+5);
    150222
     223
    151224    cout << "Sequence #" << seq << endl;
    152     cout << "  Unsuitable:  (i/o)  " << Form("%3d %3d", (int)unsin, (int)unsout) << endl; // Unbrauchbar
    153     cout << "  Unreliable:  (i/o)  " << Form("%3d %3d", (int)unrin, (int)unrout) << endl; // Unzuverlaessig
    154     cout << "  Isolated:    (i/o)  " << Form("%3d %3d", (int)isoin, (int)isoout) << endl; // Isolated (unbrauchbar)
    155     cout << "  Max.Cluster: (i/o)  " << Form("%3d", (int)clumax) << endl;                 // Max Cluster
     225    cout << "  Unsuitable: (i/o) " << Form("%3d %3d", (int)unsin, (int)unsout) << endl; // Unbrauchbar
     226    cout << "  Unreliable: (i/o) " << Form("%3d %3d", (int)unrin, (int)unrout) << endl; // Unzuverlaessig
     227    cout << "  Isolated:   (i/o) " << Form("%3d %3d", (int)isoin, (int)isoout) << endl; // Isolated (unbrauchbar)
     228    cout << "  Max.Cluster:      " << Form("%3d", (int)clumax)                 << endl; // Max Cluster
     229    cout << "  Arr Time inner:    " << Form("%4.1f +- %4.1f", meani, rmsi)      << endl;
     230    cout << "  Arr Time outer:    " << Form("%4.1f +- %4.1f", meano, rmso)      << endl;
     231    cout << "  Mean Conv inner:   " << Form("%4.1f", meanconvi)                 << endl;
     232    cout << "  Mean Conv outer:   " << Form("%4.1f", meanconvo)                 << endl;
    156233
    157234    TString query;
     
    167244                     " fIsolatedInner=%d, "
    168245                     " fIsolatedOuter=%d, "
    169                      " fIsolatedMaxCluster=%d",
     246                     " fIsolatedMaxCluster=%d, ",
     247                     " fArrTimeMeanInner=%s, "
     248                     " fArrTimeRmsInner=%s, "
     249                     " fArrTimeMeanOuter=%s, "
     250                     " fArrTimeRmsOuter=%s, "
     251                     " fConvFactorInner=%s, "
     252                     " fConvFactorOuter=%s ",
    170253                     seq, (int)unsin, (int)unsout, (int)unrin,
    171                      (int)unrout, (int)isoin, (int)isoout, (int)clumax);
     254                     (int)unrout, (int)isoin, (int)isoout,
     255                     (int)clumax,
     256                     meaninner.Data(), rmsinner.Data(),
     257                     meanouter.Data(), rmsouter.Data(),
     258                     meanconvinner.Data(), meanconvouter.Data());
    172259    }
    173260    else
     
    180267                     " fIsolatedInner=%d, "
    181268                     " fIsolatedOuter=%d, "
    182                      " fIsolatedMaxCluster=%d"
    183                      " WHERE fSequenceFirst=%d,",
     269                     " fIsolatedMaxCluster=%d, "
     270                     " fArrTimeMeanInner=%s, "
     271                     " fArrTimeRmsInner=%s, "
     272                     " fArrTimeMeanOuter=%s, "
     273                     " fArrTimeRmsOuter=%s, "
     274                     " fConvFactorInner=%s, "
     275                     " fConvFactorOuter=%s "
     276                     " WHERE fSequenceFirst=%d ",
    184277                     (int)unsin, (int)unsout, (int)unrin,(int)unrout,
    185                      (int)isoin, (int)isoout, (int)clumax, seq);
    186     }
     278                     (int)isoin, (int)isoout, (int)clumax,
     279                     meaninner.Data(), rmsinner.Data(),
     280                     meanouter.Data(), rmsouter.Data(),
     281                     meanconvinner.Data(), meanconvouter.Data(),
     282                     seq);
     283    }
     284
     285    cout << "q: " << query << endl;
    187286
    188287    if (dummy)
  • trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C

    r6933 r7010  
    119119
    120120    cout << "Sequence #" << seq << endl;
    121     cout << "  Mean Ped RMS inner [phe] " << Form("%4.1f", meani) << endl; // Unbrauchbar
    122     cout << "  Mean Ped RMS outer [phe] " << Form("%4.1f", meano) << endl; // Unbrauchbar
     121    cout << "  Mean Ped RMS inner [phe] " << Form("%4.1f", meani) << endl;
     122    cout << "  Mean Ped RMS outer [phe] " << Form("%4.1f", meano) << endl;
    123123
    124124    TString query = Form("UPDATE MyMagic.Calibration SET fMeanPedRmsInner=%s, "
  • trunk/MagicSoft/Mars/datacenter/macros/setupdb.C

    r6937 r7010  
    516516         "  fMeanPedRmsInner    FLOAT(5,1)            NOT NULL,"
    517517         "  fMeanPedRmsOuter    FLOAT(5,1)            NOT NULL,"
     518         "  fArrTimeMeanInner   FLOAT(5,1)            NOT NULL,"
     519         "  fArrTimeRmsInner    FLOAT(5,1)            NOT NULL,"
     520         "  fArrTimeMeanOuter   FLOAT(5,1)            NOT NULL,"
     521         "  fArrTimeRmsOuter    FLOAT(5,1)            NOT NULL,"
     522         "  fConvFactorInner    FLOAT(5,1)            NOT NULL,"
     523         "  fConvFactorOuter    FLOAT(5,1)            NOT NULL,"
    518524         "  fLastUpdate         TIMESTAMP"
    519525         ")"));
Note: See TracChangeset for help on using the changeset viewer.