Ignore:
Timestamp:
11/01/06 08:54:04 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/macros/plotdb.C

    r8185 r8186  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.30 2006-11-01 08:29:45 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.31 2006-11-01 08:53:26 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    9999    MDataSet *fDataSet;
    100100
    101     TString   fPrimary;
     101    TString   fPrimaryDate;
     102    TString   fPrimaryNumber;
    102103    TString   fSecondary;
    103104
     
    351352    void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; }
    352353    void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; }
    353     void SetPrimary(const char *ts) { fPrimary=ts; }
     354    void SetPrimaryDate(const char *ts) { fPrimaryDate=ts; }
     355    void SetPrimaryNumber(const char *ts) { fPrimaryNumber=ts; }
    354356    void SetSecondary(const char *ts) { fSecondary=ts; }
    355357
    356358    Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0)
    357359    {
    358         TString named  = fPrimary;
     360        TString named  = fPrimaryDate;
    359361        TString named2 = fSecondary;
    360362        TString namev  = value;
    361         TString join   = "fSequenceFirst";
    362363
    363364        TString tablev = namev(0, namev.First('.'));
     
    376377            query += value;
    377378            query += ", ";
    378             query += " Sequences.fSequenceFirst ";
     379            query += fPrimaryNumber;
     380            query += " ";
    379381        }
    380382        else
     
    384386            query += "), AVG(";
    385387            query += value;
    386             query += "), Sequences.fSequenceFirst, STD(";
     388            query += "), ";
     389            query += fPrimaryNumber;
     390            query += ", STD(";
    387391            query += fSecondary;
    388392            query += "), STD(";
     
    430434                where += " AND ";
    431435            where += Form("%s BETWEEN '%s' AND '%s' ",
    432                           fPrimary.Data(), fRequestFrom.Data(), fRequestTo.Data());
     436                          fPrimaryDate.Data(), fRequestFrom.Data(), fRequestTo.Data());
    433437        }
    434438
     
    448452            //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data());
    449453        }
    450         query += Form("ORDER BY %s ", fPrimary.Data());
     454        query += Form("ORDER BY %s ", fPrimaryDate.Data());
    451455
    452456
     
    475479    //plot.SetGroupBy(MPlot::kGroupByWeek);
    476480
    477     plot.SetPrimary("Sequences.fRunStart");
     481    plot.SetPrimaryDate("Sequences.fRunStart");
     482    plot.SetPrimaryNumber("Sequences.fSequenceFirst");
    478483    plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2");
    479484
  • trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C

    r8185 r8186  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.3 2006-11-01 08:29:45 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.4 2006-11-01 08:53:26 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    9999    MDataSet *fDataSet;
    100100
    101     TString   fPrimary;
     101    TString   fPrimaryDate;
     102    TString   fPrimaryNumber;
    102103    TString   fSecondary;
    103104
     
    352353    void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; }
    353354    void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; }
    354     void SetPrimary(const char *ts) { fPrimary=ts; }
     355    void SetPrimaryDate(const char *ts) { fPrimaryDate=ts; }
     356    void SetPrimaryNumber(const char *ts) { fPrimaryNumber=ts; }
    355357    void SetSecondary(const char *ts) { fSecondary=ts; }
    356358
     
    362364    Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0)
    363365    {
    364         TString named  = fPrimary;
     366        TString named  = fPrimaryDate;
    365367        TString named2 = fSecondary;
    366368        TString namev  = value;
    367         TString join   = "fSequenceFirst";
    368369
    369370        TString tablev = namev(0, namev.First('.'));
     
    381382            query += ", ";
    382383            query += value;
    383             query += ", 0 ";
     384            query += ", ";
     385            query += fPrimaryNumber;
     386            query += " ";
    384387        }
    385388        else
     
    389392            query += "), AVG(";
    390393            query += value;
    391             query += "), COUNT(*), STD(";
     394            query += "), ";
     395            query += fPrimaryNumber;
     396            query += ", STD(";
    392397            query += fSecondary;
    393398            query += "), STD(";
     
    443448            //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data());
    444449        }
    445         query += Form("ORDER BY %s ", fPrimary.Data());
     450        query += Form("ORDER BY %s ", fPrimaryDate.Data());
    446451
    447452
     
    464469void plotall(MPlot &plot, TString source)
    465470{
    466     plot.SetPrimary("OpticalData.fTimeStamp");
    467     plot.SetSecondary("fZenithDistance");
    468 
    469 
     471    plot.SetPrimaryDate("OpticalData.fTimestamp");
     472    plot.SetPrimaryNumber("OpticalData.fTimestamp");
     473    plot.SetSecondary("OpticalData.fZenithDistance");
    470474
    471475    TString cond = "fStatusKEY=13";
Note: See TracChangeset for help on using the changeset viewer.