Changeset 9014


Ignore:
Timestamp:
07/19/08 12:46:16 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r9006 r9014  
    1919!   Author(s): Daniela Dorner, 08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2006
     21!   Copyright: MAGIC Software Development, 2000-2008
    2222!
    2323!
     
    103103using namespace std;
    104104
     105    /*static*/ UInt_t GetId(const TString str)
     106    {
     107        const Ssiz_t dot = str.First('.');
     108
     109        const UInt_t run = str.Atoi();
     110        const UInt_t sub = dot<0 ? 0 : atoi(str.Data()+dot+1);
     111
     112        return run*1000+sub;
     113    }
     114
    105115
    106116class Rule : public TObject
     
    113123
    114124public:
    115     Rule(const char *regexp, UInt_t min=0, UInt_t max=(UInt_t)-1) :
    116         fRegexp(Form("^%s", regexp)), fMin(min), fMax(max)
    117     {
    118     }
    119 
    120125    Rule(TObjArray &arr) :
    121126        fRegexp(arr.GetEntries()>0?Form("^%s", arr[0]->GetName()):""),
     
    123128    {
    124129        if (arr.GetEntries()>1)
    125             fMin = atoi(arr[1]->GetName());
     130            fMin = GetId(arr[1]->GetName());
    126131        if (arr.GetEntries()>2)
    127             fMax = atoi(arr[2]->GetName());
    128 
    129         //cout << "Regexp: " << (arr.GetEntries()>0?Form("^%s", arr[0]->GetName()):"") << " " << fMin << " " << fMax << endl;
     132            fMax = GetId(arr[2]->GetName());
    130133    }
    131134
     
    158161    UInt_t fMin;
    159162    UInt_t fMax;
    160 
    161     static UInt_t GetId(const TString &str)
    162     {
    163         const Ssiz_t dot = str.First('.');
    164 
    165         const UInt_t run = str.Atoi();
    166         const UInt_t sub = dot<0 ? 0 : atoi(str.Data()+dot+1);
    167 
    168         return run*1000+sub;
    169     }
    170163
    171164    void Init(const TObjArray &arr, Int_t idx=0)
     
    472465        const char *fmt2 = "AND fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4) ORDER BY Id";
    473466
    474         const TString query1 = Form("%s fTelescopeNumber=%d AND fSequenceFirst=%d %s",    fmt1, fTelescopeNumber, runstart/1000, fTelescopeNumber, fmt2);
     467        const TString query1 = Form("%s fTelescopeNumber=%d AND fSequenceFirst=%d %s",                             fmt1, fTelescopeNumber, runstart/1000, fTelescopeNumber, fmt2);
    475468        const TString query2 = Form("%s fTelescopeNumber=%d AND fRunNumber*1000+fFileNumber BETWEEN %d AND %d %s", fmt1, fTelescopeNumber, runstart, runstop, fmt2);
    476469
     
    595588                continue;
    596589
    597             if (txt[0]=='['/* && section!=2*/)
     590            if (txt[0]=='[')
    598591            {
    599592                TString sec = txt(regexp);
    600593                if (!sec.IsNull())
    601594                {
    602                     section = 0;
    603 
    604595                    // Skip sections with the wrong telescope number
    605                     if (!sec(regnum).IsNull() && !sec(regtel).IsNull())
     596                    // (If section contains numbers but not the tel num)
     597                    if (!sec(regnum).IsNull() && sec(regtel).IsNull())
    606598                        continue;
    607599
     
    609601                    if (sec.BeginsWith("[Transition"))
    610602                        section = 1;
    611                     if (sec.BeginsWith("[Regexp]"))
     603                    if (sec.BeginsWith("[Regexp"))
    612604                        section = 2;
     605
    613606                    continue;
    614607                }
Note: See TracChangeset for help on using the changeset viewer.