Changeset 9014 for trunk/MagicSoft
- Timestamp:
- 07/19/08 12:46:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r9006 r9014 19 19 ! Author(s): Daniela Dorner, 08/2004 <mailto:dorner@astro.uni-wuerzburg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 621 ! Copyright: MAGIC Software Development, 2000-2008 22 22 ! 23 23 ! … … 103 103 using namespace std; 104 104 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 105 115 106 116 class Rule : public TObject … … 113 123 114 124 public: 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 120 125 Rule(TObjArray &arr) : 121 126 fRegexp(arr.GetEntries()>0?Form("^%s", arr[0]->GetName()):""), … … 123 128 { 124 129 if (arr.GetEntries()>1) 125 fMin = atoi(arr[1]->GetName());130 fMin = GetId(arr[1]->GetName()); 126 131 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()); 130 133 } 131 134 … … 158 161 UInt_t fMin; 159 162 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 }170 163 171 164 void Init(const TObjArray &arr, Int_t idx=0) … … 472 465 const char *fmt2 = "AND fExcludedFDAKEY=1 AND (fRunTypeKEY BETWEEN 2 AND 4) ORDER BY Id"; 473 466 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); 475 468 const TString query2 = Form("%s fTelescopeNumber=%d AND fRunNumber*1000+fFileNumber BETWEEN %d AND %d %s", fmt1, fTelescopeNumber, runstart, runstop, fmt2); 476 469 … … 595 588 continue; 596 589 597 if (txt[0]=='[' /* && section!=2*/)590 if (txt[0]=='[') 598 591 { 599 592 TString sec = txt(regexp); 600 593 if (!sec.IsNull()) 601 594 { 602 section = 0;603 604 595 // 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()) 606 598 continue; 607 599 … … 609 601 if (sec.BeginsWith("[Transition")) 610 602 section = 1; 611 if (sec.BeginsWith("[Regexp ]"))603 if (sec.BeginsWith("[Regexp")) 612 604 section = 2; 605 613 606 continue; 614 607 }
Note:
See TracChangeset
for help on using the changeset viewer.