int main( int argc, char **argv ) { int err = 0; void *v; int flag=0; int vval; int rank; double t1; MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Attr_get( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag ); #ifdef DEBUG if (v) vval = *(int*)v; else vval = 0; printf( "WTIME flag = %d; val = %d\n", flag, vval ); #endif if (flag) { /* Wtime need not be set */ vval = *(int*)v; if (vval < 0 || vval > 1) { err++; fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n", vval ); } } if (flag && vval) { /* Wtime is global is true. Check it */ #ifdef DEBUG printf( "WTIME_IS_GLOBAL\n" ); #endif err += CheckTime(); /* Wait for 10 seconds */ t1 = MPI_Wtime(); while (MPI_Wtime() - t1 < 10.0) ; err += CheckTime(); } if (rank == 0) { if (err > 0) { printf( "Errors in MPI_WTIME_IS_GLOBAL\n" ); } else { printf( " No Errors\n" ); } } /* The SGI implementation of MPI sometimes fails to flush stdout properly. This fflush will work around that bug. */ /* fflush( stdout ); */ MPI_Finalize( ); return err; }
BOOL CMyDateEdit::CheckChar(UINT nChar) { int nTime = 0; //如果不使用掩码,则返回 if(!m_bUseMask) return TRUE; //如果是控制字符,则返回 if(!isprint(nChar)) return TRUE; if(!isdigit(nChar)) { MessageBeep((UINT)-1); return FALSE; } //如果存在选择区域,则取消选择 int startPos,endPos; GetSel(startPos,endPos); SetSel(-1,0); //重新选中原选择区域的第一个字符 SetSel(startPos,startPos); GetSel(startPos,endPos); //确保字符串的长度不超过掩码的长度 if(endPos>=m_strMask.GetLength()) { MessageBeep((UINT)-1); return FALSE; } //时间格式 if(m_isTime) { if(!CheckTime(nChar,startPos,endPos)) { return FALSE; } } //日期格式 if(m_isDate) { if(!CheckDate(nChar,startPos,startPos)) { return FALSE; } } if(m_isDateTime) { if(!CheckDate(nChar,startPos,startPos)) { return FALSE; } if(!CheckTime(nChar,startPos,startPos)) { return FALSE; } } return TRUE; }
void Time::Set(int hour, int minute, int second) { CheckTime(hour, minute, second); hour_ = hour; minute_ = minute; second_ = second; }
// convert broken time to calendar time (seconds since 1970) time_t mktime(struct tm *timeptr) { int year=timeptr->tm_year+1900, month=timeptr->tm_mon, i; long seconds; CheckTime(timeptr); // seconds from 1970 till 1 jan 00:00:00 this year seconds= (year-1970)*(60*60*24L*365); // add extra days for leap years for (i=1970; i<year; i++) { if (LEAP_YEAR(i)) { seconds+= 60*60*24L; } } // add days for this year for (i=0; i<month; i++) { if (i==1 && LEAP_YEAR(year)) { seconds+= 60*60*24L*29; } else { seconds+= 60*60*24L*monthDays[i]; } } seconds+= (timeptr->tm_mday-1)*60*60*24L; seconds+= timeptr->tm_hour*60*60L; seconds+= timeptr->tm_min*60; seconds+= timeptr->tm_sec; return seconds; }
// format the time into "Sat Feb 17 17:45:23 2001\n" char *asctime(struct tm *timeptr) { CheckTime(timeptr); sprintf (ascTimeBuffer, "%s %s %2d %02d:%02d:%02d %04d\n", __day[timeptr->tm_wday], __month[timeptr->tm_mon], timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, timeptr->tm_year+1900); return ascTimeBuffer; }
/* handle time, delays, stuff */ Bool TimeOk(Action *action, struct timeval *cur) { if (CheckTime(action, cur)) { SetTime(&action->prev_time, cur); return TRUE; } if (action->flags & CharToFlag('D')) SetTime(&action->prev_time, cur); return FALSE; }
gboolean ReadVCALDateTime(const char *Buffer, GSM_DateTime *dt) { time_t timestamp; char year[5]="", month[3]="", day[3]="", hour[3]="", minute[3]="", second[3]=""; memset(dt,0,sizeof(GSM_DateTime)); /* YYYY-MM-DD is invalid, though used */ if (sscanf(Buffer, "%d-%d-%d", &dt->Year, &dt->Month, &dt->Day) == 3) { goto checkdt; } if (strlen(Buffer) < 8) { return FALSE; } strncpy(year, Buffer, 4); strncpy(month, Buffer+4, 2); strncpy(day, Buffer+6, 2); dt->Year = atoi(year); dt->Month = atoi(month); dt->Day = atoi(day); if (Buffer[8] == 'T') { if (strlen(Buffer + 9) < 6) return FALSE; strncpy(hour, Buffer+9, 2); strncpy(minute, Buffer+11, 2); strncpy(second, Buffer+13, 2); dt->Hour = atoi(hour); dt->Minute = atoi(minute); dt->Second = atoi(second); /** * @todo Handle properly timezone information */ if (Buffer[15] == 'Z') dt->Timezone = 0; /* Z = ZULU = GMT */ } checkdt: if (!CheckTime(dt)) { dbgprintf(NULL, "incorrect date %d-%d-%d %d:%d:%d\n",dt->Day,dt->Month,dt->Year,dt->Hour,dt->Minute,dt->Second); return FALSE; } if (dt->Year!=0) { if (!CheckDate(dt)) { dbgprintf(NULL, "incorrect date %d-%d-%d %d:%d:%d\n",dt->Day,dt->Month,dt->Year,dt->Hour,dt->Minute,dt->Second); return FALSE; } } if (dt->Timezone != 0) { timestamp = Fill_Time_T(*dt) + dt->Timezone; Fill_GSM_DateTime(dt, timestamp); } return TRUE; }
void CheckRun(bool IsStartup, bool ForceRun = false) { std::string LogPath; GetProcDir (LogPath); CFAbsoluteTime DeltaTime; CFAbsoluteTime NextTime; CFAbsoluteTime AlignTime; bool ShouldRun = ForceRun; if (ForceRun == false) ShouldRun = CheckTime (IsStartup, NextTime, DeltaTime, AlignTime); LogPath += '/'; LogPath += LogFileName; std::ofstream LogStream; LogStream.open (LogFileName); LogStream << "SCATimeCheck Log" << std::endl; std::string TimeString; CFAbsoluteTime CurrTime; CurrTime = CFAbsoluteTimeGetCurrent(); GetDateString(CurrTime, TimeString); LogStream << "Current Time is: " << TimeString << std::endl; if (ShouldRun) { LogStream << "It is time to run the Collector" << std::endl; long Status; Status = ExecuteCollector(); if (Status == 0) { // Write back the aligned exec time if we suceeded. SyslistPrefs::setAlignTime (AlignTime); SyslistPrefs::Sync(); } LogStream << "Collector returned: " << Status << std::endl; } else { LogStream << "It is not yet time to run the collector" << std::endl; } LogStream.close(); }
void Aquarium::loop() { SerialDebug(); if (display) display->OnLoop(); // Heater Routine CheckTemp(); // Light Routine CheckTime(); int32_t val = myEnc.read(); if (val != encval) { Serial.println(val - encval); encval = val; } // testcode /* switch (counter) { case 0: mySwitch.switchOn("10101", "10000"); break; case 1: mySwitch.switchOn("10101", "01000"); break; case 2: mySwitch.switchOn("10101", "00100"); break; case 3: mySwitch.switchOff("10101", "10000"); break; case 4: mySwitch.switchOff("10101", "01000"); break; case 5: mySwitch.switchOff("10101", "00100"); break; } counter ++; if (counter == 6) counter = 0; */ }
TEST(TimeStamp, ToMicrosoftAccessTime) { #define CheckTime(val, year, month, day, hour, minute, second) { \ std::time_t const current = RPG::ToUnixTime(val); \ struct tm const* const t = std::gmtime(¤t); \ \ ASSERT_EQ(t->tm_year, year - 1900); \ ASSERT_EQ(t->tm_mon + 1, month); \ ASSERT_EQ(t->tm_mday, day); \ ASSERT_EQ(t->tm_hour, hour); \ ASSERT_EQ(t->tm_min, minute); \ ASSERT_EQ(t->tm_sec, second); \ } \ // 27468.96875 27468 1975 年 3 月 15 日 .96875 11:15:00 P.M. CheckTime(27468.96875, 1975, 3, 15, 23, 15, 0); // 36836.125 36836 2000 年 11 月 6 日 .125 3:00:00 A.M. CheckTime(36836.125, 2000, 11, 6, 3, 0, 0); // 36295.0 1999/5/15 1999/05/15 12:00:00 AM CheckTime(36295.0, 1999, 5, 15, 0, 0, 0); // 36232.9375 1999/03/13 22:30:00 1999/03/13 10:30:00 PM CheckTime(36232.9375, 1999, 3, 13, 22, 30, 0); #undef CheckTime }
void CQuest::OnQuestEvent( CPlayer* pPlayer, CQuestGroup* pQuestGroup, CQuestEvent* pQuestEvent, DWORD dwQuestIdx ) { if( dwQuestIdx != 0 ) if( m_pQuestInfo->GetQuestIdx() != dwQuestIdx ) return; if( !CheckTime( pQuestEvent->m_dwQuestEventKind ) ) return; if( m_CurSubQuestInfoArray[0] && m_CurSubQuestInfoArray[0]->OnQuestEvent( pPlayer, pQuestGroup, this, pQuestEvent ) == TRUE ) return; for( int i = m_dwSubQuestCount-1; i > 0; --i ) { if( m_CurSubQuestInfoArray[i] && m_CurSubQuestInfoArray[i]->OnQuestEvent( pPlayer, pQuestGroup, this, pQuestEvent ) == TRUE ) return; } }
/** * Recalculates struct tm content. We can not use mktime directly, as it * works only for dates > 1970. Day of week calculation is nased on article * in Polish PC-Kurier 8/1998 page 104. * * @see http://www.pckurier.pl */ int RecalcDateTime(struct tm *st, const int year, const int month, const int day, const int hour, const int minute, const int second) { const int days[] = {31,28,31,30,31,30,31,31,30,31,30,31}; int i, p, q, r; GSM_DateTime Date; Date.Year = year; Date.Month = month; Date.Day = day; Date.Hour = hour; Date.Minute = minute; Date.Second = second; Date.Timezone = 0; if (!CheckDate(&Date) || !CheckTime(&Date)) return 0; memset(st, 0, sizeof(*st)); /* Calculate day of year */ st->tm_yday = day; for (i = 0; i < month - 1; i++) st->tm_yday += days[i]; /* Calculate day of week */ p = (14 - month) / 12; q = month + 12 * p - 2; r = year - p; st->tm_wday = (day + (31 * q) / 12 + r + r / 4 - r / 100 + r / 400) % 7; st->tm_hour = hour; st->tm_min = minute; st->tm_sec = second; st->tm_year = year - 1900; st->tm_mon = month - 1; st->tm_mday = day; st->tm_isdst = -1; /* FIXME */ return 1; }
void CMenu::ButtonsPressed() { gc_btnsPressed = 0; if (CheckTime()) { ds3_btnsPressed = DS3_ButtonsDown(); UpdateTime(); } else ds3_btnsPressed = 0; if(ds3_btnsPressed & DBTN_SELECT) shutdown = 1; { for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) { wii_btnsPressed[chan] = WPAD_ButtonsDown(chan); gc_btnsPressed |= PAD_ButtonsDown(chan); wupc_btnsPressed[chan] = WUPC_ButtonsDown(chan); } } }
void ScreenSaverFilter::ReloadSettings() { BAutolock _(this); bool isFirst = !fWatchingDirectory && !fWatchingFile; _WatchSettings(); if (fWatchingDirectory && !isFirst) { // there is no settings file yet return; } delete fCornerRunner; delete fRunner; fRunner = fCornerRunner = NULL; fSettings.Load(); fBlankCorner = fSettings.BlankCorner(); fNeverBlankCorner = fSettings.NeverBlankCorner(); fBlankTime = fSnoozeTime = fSettings.BlankTime(); CheckTime(); if (fBlankCorner != NO_CORNER || fNeverBlankCorner != NO_CORNER) { BMessage invoke(kMsgCornerInvoke); fCornerRunner = new (std::nothrow) BMessageRunner(fController, &invoke, B_INFINITE_TIMEOUT); // will be reset in Filter() } BMessage check(kMsgCheckTime); fRunner = new (std::nothrow) BMessageRunner(fController, &check, fSnoozeTime); if (fRunner == NULL || fRunner->InitCheck() != B_OK) { syslog(LOG_ERR, "screen saver filter runner init failed\n"); } }
void Downloader() { int nfds = 0, maxfd; int maxfd_tracker, maxfd_ctcs, maxfd_console, maxfd_peer; struct timeval timeout; fd_set rfd, rfdnext; fd_set wfd, wfdnext; int stopped = 0, f_poll = 0; double maxsleep; FD_ZERO(&rfdnext); FD_ZERO(&wfdnext); do{ g_disk_access = 0; UpdateTime(); if( !stopped ){ if( !TRACKER.IsQuitting() && BTCONTENT.SeedTimeout() ) TRACKER.Stop(); if( TRACKER.IsQuitting() ){ stopped = 1; WORLD.Pause(); if( *cfg_ctcs ) CTCS.Send_Status(); } } maxfd = -1; maxsleep = -1; rfd = rfdnext; wfd = wfdnext; maxfd_tracker = maxfd_ctcs = maxfd_console = -1; if( f_poll ){ FD_ZERO(&rfd); FD_ZERO(&wfd); // remove non-peers from sets maxsleep = 0; // waited for bandwidth--poll now }else{ WORLD.DontWaitBW(); maxfd_tracker = TRACKER.IntervalCheck(&rfd, &wfd); if( maxfd_tracker > maxfd ) maxfd = maxfd_tracker; if( *cfg_ctcs ){ maxfd_ctcs = CTCS.IntervalCheck(&rfd, &wfd); if( maxfd_ctcs > maxfd ) maxfd = maxfd_ctcs; } maxfd_console = CONSOLE.IntervalCheck(&rfd, &wfd); if( maxfd_console > maxfd ) maxfd = maxfd_console; if( WORLD.IsIdle() ){ if( BTCONTENT.CheckedPieces() < BTCONTENT.GetNPieces() && !BTCONTENT.NeedFlush() ){ if( BTCONTENT.CheckNextPiece() < 0 ){ CONSOLE.Warning(1, "Error while checking piece %d of %d", (int)BTCONTENT.CheckedPieces(), (int)BTCONTENT.GetNPieces()); TRACKER.Stop(); maxsleep = 2; } CheckTime(); } } } maxfd_peer = WORLD.IntervalCheck(&rfd, &wfd); if( maxfd_peer > maxfd ) maxfd = maxfd_peer; if( !f_poll ){ UpdateTime(); while( BTCONTENT.NeedFlush() && WORLD.IsIdle() ){ BTCONTENT.FlushQueue(); CheckTime(); } while( BTCONTENT.NeedMerge() && WORLD.IsIdle() ){ BTCONTENT.MergeNext(); CheckTime(); } } rfdnext = rfd; wfdnext = wfd; if( g_disk_access && WORLD.IdleState() == DT_IDLE_POLLING ){ maxsleep = 0; }else if( maxsleep < 0 ){ // not yet set maxsleep = WORLD.WaitBW(); // must do after intervalchecks! if( maxsleep <= -100 ) maxsleep = 0; else if( maxsleep <= 0 || maxsleep > MAX_SLEEP ) maxsleep = MAX_SLEEP; } timeout.tv_sec = (long)maxsleep; timeout.tv_usec = (long)((maxsleep - (long)maxsleep) * 1000000); nfds = select(maxfd + 1, &rfd, &wfd, (fd_set *)0, &timeout); if( nfds < 0 ){ CONSOLE.Debug("Error from select: %s", strerror(errno)); FD_ZERO(&rfdnext); FD_ZERO(&wfdnext); nfds = 0; } if( f_poll ) f_poll = 0; else if( nfds > 0 ) WORLD.DontWaitBW(); else if( maxsleep > 0 && maxsleep < MAX_SLEEP ) f_poll = 1; UpdateTime(); if( !f_poll && nfds > 0 ){ if( maxfd_tracker >= 0 ) TRACKER.SocketReady(&rfd, &wfd, &nfds, &rfdnext, &wfdnext); if( nfds > 0 && maxfd_ctcs >= 0 ) CTCS.SocketReady(&rfd, &wfd, &nfds, &rfdnext, &wfdnext); if( nfds > 0 && maxfd_console >= 0 ) CONSOLE.User(&rfd, &wfd, &nfds, &rfdnext, &wfdnext); } if( nfds > 0 && maxfd_peer >= 0 ) WORLD.AnyPeerReady(&rfd, &wfd, &nfds, &rfdnext, &wfdnext); }while( TRACKER.GetStatus() != DT_TRACKER_FINISHED || TRACKER.IsRestarting() ); }
void check(unsigned char *cert_buffer, size_t cert_len, CertFormat format, CertType type) { X509_NAME *issuer; X509_NAME *subject; int ret; X509 *x509; int ca; struct tm tm_before; struct tm tm_after; Clear(); x509 = LoadCert(cert_buffer, cert_len, format); if (x509 == NULL) { SetError(ERR_INVALID); return; } ca = X509_check_ca(x509); if (ca > 0 && type == SubscriberCertificate) { SetWarning(WARN_CHECKED_AS_SUBSCRIBER); } else if (ca == 0 && type != SubscriberCertificate) { SetWarning(WARN_CHECKED_AS_CA); } ret = X509_get_version(x509); if (ret != 2) { SetError(ERR_NOT_VERSION3); } //CheckASN1_integer(x509->cert_info->version); issuer = X509_get_issuer_name(x509); if (issuer == NULL) { SetError(ERR_INVALID); return; } CheckDN(issuer); CheckSerial(x509); CheckTime(x509, &tm_before, &tm_after, type); /* Required by CAB base 9.1.3 */ if (!IsNameObjPresent(issuer, obj_organizationName)) { SetError(ERR_ISSUER_ORG_NAME); } /* Required by CAB base 9.1.4 */ if (!IsNameObjPresent(issuer, obj_countryName)) { SetError(ERR_ISSUER_COUNTRY); } subject = X509_get_subject_name(x509); if (subject == NULL) { SetError(ERR_INVALID); return; } CheckDN(subject); CheckDuplicateExtensions(x509); /* Prohibited in CAB base 7.1.4.2.2d */ if (!IsNameObjPresent(subject, obj_organizationName) && !IsNameObjPresent(subject, obj_givenName) && !IsNameObjPresent(subject, obj_surname) && IsNameObjPresent(subject, obj_StreetAddress)) { SetError(ERR_SUBJECT_ADDR); } /* Required in CAB base 7.1.4.2.2e and 7.1.4.2.2f */ if (((IsNameObjPresent(subject, obj_organizationName) && type == SubscriberCertificate) || IsNameObjPresent(subject, obj_givenName) || IsNameObjPresent(subject, obj_surname)) && !IsNameObjPresent(subject, obj_stateOrProvinceName) && !IsNameObjPresent(subject, obj_localityName)) { SetError(ERR_SUBJECT_ORG_NO_PLACE); } /* Prohibited in CAB base 7.1.4.2.2e or 7.1.4.2.2f */ if (!IsNameObjPresent(subject, obj_organizationName) && !IsNameObjPresent(subject, obj_givenName) && !IsNameObjPresent(subject, obj_surname) && (IsNameObjPresent(subject, obj_localityName) || IsNameObjPresent(subject, obj_stateOrProvinceName))) { SetError(ERR_SUBJECT_NO_ORG_PLACE); } /* Required by CAB base 7.1.4.2.2g */ if (!IsNameObjPresent(subject, obj_organizationName) && !IsNameObjPresent(subject, obj_givenName) && !IsNameObjPresent(subject, obj_surname) && IsNameObjPresent(subject, obj_postalCode)) { SetError(ERR_SUBJECT_POSTAL); } /* Required by CAB base 7.1.4.2.2h */ if ((IsNameObjPresent(subject, obj_organizationName) || IsNameObjPresent(subject, obj_givenName) || IsNameObjPresent(subject, obj_surname)) && !IsNameObjPresent(subject, obj_countryName)) { SetError(ERR_SUBJECT_COUNTRY); } CheckPolicy(x509, type, subject); CheckEKU(x509, type); CheckSAN(x509, type); /* Deprecated in CAB base 7.1.4.2.2a */ if (IsNameObjPresent(subject, obj_commonName)) { if (type == SubscriberCertificate) { SetInfo(INF_SUBJECT_CN); } } else if (type != SubscriberCertificate) { SetWarning(WARN_NO_CN); } CheckCRL(x509); CheckAIA(x509, type); CheckPublicKey(x509, tm_after); X509_free(x509); }
CString XMLRestriction::CheckDatatype(XmlDataType p_type,CString p_value) { CString result; // Empty value, nothing to check if(p_value.IsEmpty()) { return result; } try { // Checking only base datatypes // String and CDATA are never checked! switch(p_type & XDT_MaskTypes) { case XDT_AnyURI: result = CheckAnyURI (p_value); break; case XDT_Base64Binary: result = CheckBase64 (p_value); break; case XDT_Boolean: result = CheckBoolean (p_value); break; case XDT_Date: result = CheckDate (p_value); break; case XDT_Integer: result = CheckInteger (p_value); break; case XDT_Decimal: result = CheckDouble (p_value,false); break; case XDT_Double: result = CheckDouble (p_value,true); break; case XDT_DateTime: result = CheckDateTime (p_value,false); break; case XDT_DateTimeStamp: result = CheckDateTime (p_value,true); break; case XDT_Float: result = CheckDouble (p_value,true); break; case XDT_Duration: result = CheckDuration (p_value); break; case XDT_DayTimeDuration: result = CheckDaySecond(p_value); break; case XDT_YearMonthDuration: result = CheckYearMonth(p_value); break; case XDT_GregDay: result = CheckGregDay (p_value); break; case XDT_GregMonth: result = CheckGregMonth(p_value); break; case XDT_GregYear: result = CheckGregYear (p_value); break; case XDT_GregMonthDay: result = CheckGregMD (p_value); break; case XDT_GregYearMonth: result = CheckGregYM (p_value); break; case XDT_HexBinary: result = CheckHexBin (p_value); break; case XDT_Long: result = CheckLong (p_value); break; case XDT_Int: result = CheckLong (p_value); break; case XDT_Short: result = CheckShort (p_value); break; case XDT_NonNegativeInteger:result = CheckNNegInt (p_value); break; case XDT_PositiveInteger: result = CheckPosInt (p_value); break; case XDT_UnsignedLong: result = CheckUnsLong (p_value); break; case XDT_UnsignedInt: result = CheckUnsLong (p_value); break; case XDT_UnsignedShort: result = CheckUnsShort (p_value); break; case XDT_UnsignedByte: result = CheckUnsByte (p_value); break; case XDT_NonPositiveInteger:result = CheckNonPosInt(p_value); break; case XDT_NegativeInteger: result = CheckNegInt (p_value); break; case XDT_Time: result = CheckTime (p_value); break; case XDT_Token: result = CheckToken (p_value); break; case XDT_NMTOKEN: result = CheckNMTOKEN (p_value); break; case XDT_Name: result = CheckName (p_value); break; case XDT_ENTITY: result = CheckName (p_value); break; case XDT_ID: result = CheckName (p_value); break; case XDT_IDREF: result = CheckName (p_value); break; case XDT_QName: result = CheckQName (p_value); break; case XDT_NMTOKENS: result = CheckNMTOKENS (p_value); break; case XDT_ENTITIES: result = CheckNames (p_value); break; case XDT_IDREFS: result = CheckNames (p_value); break; default: break; } } catch(StdException& er) { ReThrowSafeException(er); // Primary datatype conversion went wrong result = er.GetErrorMessage(); } return result; }
//______________________________________________________________________________ void TaggerTime() { // Main method. Char_t tmp[256]; // load CaLib gSystem->Load("libCaLib.so"); // general configuration Bool_t watch = kFALSE; const Char_t* data = "Data.Tagger.T0"; // configuration (December 2007) const Char_t calibration[] = "LD2_Dec_07"; //const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Dec_07/AR/out/tagger_time"; const Char_t* fLoc = "/usr/cheetah_scratch0/kaeser/CaLib/Dec_07"; // configuration (February 2009) //const Char_t calibration[] = "LD2_Feb_09"; //const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Feb_09/AR/out/ADC"; // configuration (May 2009) //const Char_t calibration[] = "LD2_May_09"; //const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/May_09/AR/out/ADC"; // get number of sets Int_t nSets = TCMySQLManager::GetManager()->GetNsets(data, calibration); // file array gFiles = new TList(); gFiles->SetOwner(kTRUE); // loop over sets for (Int_t i = 0; i < nSets; i++) { // get runs of set Int_t nRuns; Int_t* runs = TCMySQLManager::GetManager()->GetRunsOfSet(data, calibration, i, &nRuns); // loop over runs for (Int_t j = 0; j < nRuns; j++) { // load ROOT file sprintf(tmp, "%s/ARHistograms_CB_%d.root", fLoc, runs[j]); TFile* f = new TFile(tmp); // check file if (!f) continue; if (f->IsZombie()) continue; // save file gFiles->Add(f); } // clean-up delete runs; } // check time CheckTime(fLoc); printf("%d runs analyzed.\n", gFiles->GetSize()); // clean-up delete gFiles; gSystem->Exit(0); }