/[PAMELA software]/YodaProfiler/src/PamelaDBOperations.cpp
ViewVC logotype

Diff of /YodaProfiler/src/PamelaDBOperations.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mocchiut, Tue Sep 5 10:48:58 2006 UTC revision 1.6 by mocchiut, Fri Sep 8 16:06:02 2006 UTC
# Line 223  Int_t PamelaDBOperations::SetUpperLimits Line 223  Int_t PamelaDBOperations::SetUpperLimits
223    ULong64_t upperobt2 = 0;    ULong64_t upperobt2 = 0;
224    UInt_t zomp = 0;    UInt_t zomp = 0;
225    UInt_t jump = 50000; // was 5000    UInt_t jump = 50000; // was 5000
226      EventCounter *code=0;
227      //
228      //   pcksList packetsNames;
229      //   pcksList::iterator Iter;
230      //   getPacketsNames(packetsNames);
231    //    //
232    pktfirst = 0;    pktfirst = 0;
233    obtfirst = 0;    obtfirst = 0;
# Line 240  Int_t PamelaDBOperations::SetUpperLimits Line 245  Int_t PamelaDBOperations::SetUpperLimits
245    pktfirst = ph->GetCounter();    pktfirst = ph->GetCounter();
246    obtfirst = ph->GetOrbitalTime();      obtfirst = ph->GetOrbitalTime();  
247    //    //
248      //   code = eh->GetCounter();
249      //   UInt_t en = 0;
250      //   for(Iter = packetsNames.begin(); Iter != packetsNames.end(); Iter++){
251      //     en = code->Get(GetPacketType(*Iter));
252      //     if ( en ) printf(" Packet type is %s, entries: %i \n",*Iter,en);
253      //};  
254      //
255    T->GetEntry(nevent-1);    T->GetEntry(nevent-1);
256    ph = eh->GetPscuHeader();    ph = eh->GetPscuHeader();
257    pktlast = ph->GetCounter();    pktlast = ph->GetCounter();
# Line 308  Int_t PamelaDBOperations::SetUpperLimits Line 320  Int_t PamelaDBOperations::SetUpperLimits
320    // check if last runtrailer is within limits, if not extend limits (one should check for all packets but we need only runtrailer)    // check if last runtrailer is within limits, if not extend limits (one should check for all packets but we need only runtrailer)
321    //    //
322    PacketType *pctp=0;    PacketType *pctp=0;
   EventCounter *code=0;  
   T->GetEntry(upperentry);  
   code = eh->GetCounter();  
   Int_t lasttrail = code->Get(pctp->RunTrailer);  
   Int_t lasthead = code->Get(pctp->RunHeader);  
323    TTree *rh=(TTree*)file->Get("RunHeader");    TTree *rh=(TTree*)file->Get("RunHeader");
324    if ( !rh || rh->IsZombie() ) throw -17;    if ( !rh || rh->IsZombie() ) throw -17;
325    TTree *rt=(TTree*)file->Get("RunTrailer");    TTree *rt=(TTree*)file->Get("RunTrailer");
# Line 326  Int_t PamelaDBOperations::SetUpperLimits Line 333  Int_t PamelaDBOperations::SetUpperLimits
333    //    //
334    rhev = rh->GetEntries();    rhev = rh->GetEntries();
335    rtev = rt->GetEntries();    rtev = rt->GetEntries();
336      UInt_t sobtt = 0;
337      UInt_t sobth = 0;
338      UInt_t spktt = 0;
339      UInt_t spkth = 0;
340    UInt_t pktt = 0;    UInt_t pktt = 0;
341    ULong64_t obtt = 0;    ULong64_t obtt = 0;
342    UInt_t pkth = 0;    UInt_t pkth = 0;
343    ULong64_t obth = 0;    ULong64_t obth = 0;
344    //    //
345      T->GetEntry(upperentry);
346      code = eh->GetCounter();
347      Int_t lasttrail = code->Get(pctp->RunTrailer);
348      Int_t lasthead = code->Get(pctp->RunHeader);
349    if ( lasttrail < rtev ){    if ( lasttrail < rtev ){
350      rt->GetEntry(lasttrail);      rt->GetEntry(lasttrail);
351      pht = eht->GetPscuHeader();      pht = eht->GetPscuHeader();
# Line 338  Int_t PamelaDBOperations::SetUpperLimits Line 353  Int_t PamelaDBOperations::SetUpperLimits
353      obtt = OBT(pht->GetOrbitalTime());      obtt = OBT(pht->GetOrbitalTime());
354    };    };
355    //    //
356      if ( lasthead < rhev ){
357        rh->GetEntry(lasthead);
358        phh = ehh->GetPscuHeader();
359        pkth = PKT(phh->GetCounter());
360        obth = OBT(phh->GetOrbitalTime());
361      };
362      //
363      if ( IsDebug() ) printf(" rhev before %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);
364      if ( pkth > upperpkt && obth > upperobt ){
365        if ( IsDebug() ) printf(" Upper limits extended to include last header: ph %i upperp %i oh %llu uppero %llu \n",pkth,upperpkt,obth,upperobt);
366        upperpkt = pkth;
367        upperobt = obth;
368        rhev = lasthead+1;
369      } else {
370        rhev = lasthead;
371      };
372      if ( IsDebug() ) printf(" rhev after %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);
373      //
374    if ( IsDebug() ) printf(" rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);    if ( IsDebug() ) printf(" rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
375    if ( pktt > upperpkt && obtt > upperobt ){    if ( pktt > upperpkt && obtt > upperobt ){
376      if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %i upperp %i ot %llu uppero %llu \n",pktt,upperpkt,obtt,upperobt);      if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %i upperp %i ot %llu uppero %llu \n",pktt,upperpkt,obtt,upperobt);
# Line 348  Int_t PamelaDBOperations::SetUpperLimits Line 381  Int_t PamelaDBOperations::SetUpperLimits
381      rtev = lasttrail;      rtev = lasttrail;
382    };    };
383    if ( IsDebug() ) printf(" rtev after %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);    if ( IsDebug() ) printf(" rtev after %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
384      //  goto kikko;
385      //
386      //
387      // Check if runtrailer/runheader are within lower limits
388      //
389      //
390      pkth = 0;
391      obth = 0;
392      spkth = 0;
393      sobth = 0;
394      for (Int_t k=0; k<rhev; k++){
395        if ( k > 0 ){
396          spkth = pkth;
397          sobth = obth;
398        };
399        rh->GetEntry(k);
400        phh = ehh->GetPscuHeader();
401        pkth = PKT(phh->GetCounter());
402        obth = OBT(phh->GetOrbitalTime());
403        //
404        if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth);
405        //
406        if ( pkth < spkth && obth < sobth ){
407          if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i  \n",rhev);
408          //
409          rhev = k-1;
410          rh->GetEntry(rhev);
411          pkth = spkth;
412          obth = sobth;
413          //
414          UInt_t evbefh = 0;
415          code = ehh->GetCounter();
416          evbefh = code->Get(pctp->Physics);    
417          if ( evbefh >= 0 ){
418            T->GetEntry(evbefh);
419            ph = eh->GetPscuHeader();
420            t_pktlast = PKT(ph->GetCounter());
421            t_obtlast = OBT(ph->GetOrbitalTime());
422            if ( t_pktlast < spkth && t_obtlast < sobth ){ // jump
423              upperpkt = pkth;
424              upperobt = obth;
425              upperentry = evbefh-1;
426            } else {
427              while ( t_pktlast > spkth && t_obtlast > sobth && evbefh < nevent ){
428                evbefh++;  
429                T->GetEntry(evbefh);
430                ph = eh->GetPscuHeader();
431                t_pktlast = PKT(ph->GetCounter());
432                t_obtlast = OBT(ph->GetOrbitalTime());
433              };
434              T->GetEntry(evbefh-1);
435              ph = eh->GetPscuHeader();
436              upperpkt = PKT(ph->GetCounter());
437              upperobt = OBT(ph->GetOrbitalTime());
438              upperentry = evbefh-1;
439            };    
440          };
441          if ( IsDebug() ) printf(" rhev after %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);
442          goto kikko0;
443        };
444      };
445     kikko0:
446      //
447      //
448      //
449      pktt = 0;
450      obtt = 0;
451      spktt = 0;
452      sobtt = 0;
453      for (Int_t k=0; k<rtev; k++){
454        if ( k > 0 ){
455          spktt = pktt;
456          sobtt = obtt;
457        };
458        rt->GetEntry(k);
459        pht = eht->GetPscuHeader();
460        pktt = PKT(pht->GetCounter());
461        obtt = OBT(pht->GetOrbitalTime());
462        //
463        if ( IsDebug() ) printf(" k %i rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt);
464        //
465        if ( pktt < spktt && obtt < sobtt ){
466          if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev);
467          //
468          rtev = k-1;
469          rt->GetEntry(rtev);
470          pktt = spktt;
471          obtt = sobtt;
472          if ( IsDebug() ) printf(" lasttrail %i pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
473          //
474          UInt_t evbeft = 0;
475          code = eht->GetCounter();
476          evbeft = code->Get(pctp->Physics);    
477          if ( evbeft >= 0 ){
478            T->GetEntry(evbeft);
479            ph = eh->GetPscuHeader();
480            t_pktlast = PKT(ph->GetCounter());
481            t_obtlast = OBT(ph->GetOrbitalTime());
482            if ( t_pktlast < spktt && t_obtlast < sobtt ){ // jump
483              upperpkt = pktt;
484              upperobt = obtt;
485              upperentry = evbeft-1;
486            } else {
487              while ( t_pktlast > spktt && t_obtlast > sobtt && evbeft < nevent ){
488                evbeft++;  
489                T->GetEntry(evbeft);
490                ph = eh->GetPscuHeader();
491                t_pktlast = PKT(ph->GetCounter());
492                t_obtlast = OBT(ph->GetOrbitalTime());
493              };
494              T->GetEntry(evbeft-1);
495              ph = eh->GetPscuHeader();
496              upperpkt = PKT(ph->GetCounter());
497              upperobt = OBT(ph->GetOrbitalTime());
498              upperentry = evbeft-1;
499            };
500          };
501          if ( IsDebug() ) printf(" rtev after %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
502          goto kikko;
503          //      break;
504          //
505        };
506        //  
507      };
508      //
509     kikko:
510      //
511      T->GetEntry(upperentry);
512      code = eh->GetCounter();
513      lasttrail = code->Get(pctp->RunTrailer);
514      lasthead = code->Get(pctp->RunHeader);
515      if ( lasttrail < rtev ){
516        rt->GetEntry(lasttrail);
517        pht = eht->GetPscuHeader();
518        pktt = PKT(pht->GetCounter());
519        obtt = OBT(pht->GetOrbitalTime());
520      };
521    //    //
522    if ( lasthead < rhev ){    if ( lasthead < rhev ){
523      rh->GetEntry(lasthead);      rh->GetEntry(lasthead);
524      phh = ehh->GetPscuHeader();      phh = ehh->GetPscuHeader();
525      pkth = PKT(pht->GetCounter());      pkth = PKT(phh->GetCounter());
526      obth = OBT(pht->GetOrbitalTime());      obth = OBT(phh->GetOrbitalTime());
527    };    };
528    //    //
529    if ( IsDebug() ) printf(" rhev before %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);    if ( IsDebug() ) printf(" rhev before %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);
# Line 367  Int_t PamelaDBOperations::SetUpperLimits Line 537  Int_t PamelaDBOperations::SetUpperLimits
537    };    };
538    if ( IsDebug() ) printf(" rhev after %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);    if ( IsDebug() ) printf(" rhev after %i ph %i upperp %i oh %llu uppero %llu \n",rhev,pkth,upperpkt,obth,upperobt);
539    //    //
540      if ( IsDebug() ) printf(" rtev beforev %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
541      if ( pktt > upperpkt && obtt > upperobt ){
542        if ( IsDebug() ) printf(" Upper limits extended to include last trailer: pt %i upperp %i ot %llu uppero %llu \n",pktt,upperpkt,obtt,upperobt);
543        upperpkt = pktt;
544        upperobt = obtt;
545        rtev = lasttrail+1;
546      } else {
547        rtev = lasttrail;
548      };
549      if ( IsDebug() ) printf(" rtev after %i  pt %i upperp %i ot %llu uppero %llu \n",rtev,pktt,upperpkt,obtt,upperobt);
550      //
551    if ( IsDebug() ) printf(" Upper limits are: OBT %llu pkt_num %i upper entry %i \n",upperobt,upperpkt,upperentry);    if ( IsDebug() ) printf(" Upper limits are: OBT %llu pkt_num %i upper entry %i \n",upperobt,upperpkt,upperentry);
552    //    //
553    return(0);    return(0);
# Line 3108  Int_t PamelaDBOperations::CleanGL_RUN_FR Line 3289  Int_t PamelaDBOperations::CleanGL_RUN_FR
3289  Int_t PamelaDBOperations::ValidateRuns(){  Int_t PamelaDBOperations::ValidateRuns(){
3290    //    //
3291    TSQLResult *result = 0;    TSQLResult *result = 0;
3292    // TSQLRow    *row    = 0;    TSQLRow    *row    = 0;
3293    //    //
3294    UInt_t timelim = 0;    UInt_t timelim = 0;
3295    TDatime *time = new TDatime();    TDatime *time = new TDatime();
# Line 3128  Int_t PamelaDBOperations::ValidateRuns() Line 3309  Int_t PamelaDBOperations::ValidateRuns()
3309    time->Set();    time->Set();
3310    timelim =  (UInt_t)time->Convert() - olderthan;    timelim =  (UInt_t)time->Convert() - olderthan;
3311    time->Set(timelim,false);    time->Set(timelim,false);
3312    //  
3313    // First of all validate runs with default calibration:    printf("Validate runs older than %s \n",time->AsSQLString());
3314    //  
3315    oss.str("");    // =======================================================
3316    oss << " UPDATE GL_RUN SET VALIDATION=1 WHERE"    // validate runs by checking missing calibrations
3317        << " VALIDATION = 0 AND TRK_CALIB_USED=104 AND "    // =======================================================
3318        << " INSERT_TIME <= '" << time->AsSQLString() << "';";    UInt_t t_stop  = 0;
3319    //    UInt_t t_start = 0;
3320    if ( IsDebug() ) printf(" Validate runs with trk default calibration inserted before %s : query is \n %s \n",time->AsSQLString(),oss.str().c_str());    // --------------------------------------------------------------
3321      // 1) get the OBT of the last run inserted after clean-time limit
3322      // --------------------------------------------------------------
3323      oss.str("");
3324      oss << " SELECT * FROM GL_RUN  WHERE INSERT_TIME <= '" << time->AsSQLString()
3325          << "' ORDER BY INSERT_TIME DESC LIMIT 1;";
3326      printf(" Get start validation-time: query is \n %s \n",oss.str().c_str());
3327      result = conn->Query(oss.str().c_str());
3328      if ( !result ) throw -4;
3329      if ( !result->GetRowCount() ) {
3330              printf(" No runs to validate \n");
3331              return(1);
3332      }else{
3333            row = result->Next();
3334            t_start = (UInt_t)atoll(row->GetField(4));
3335            printf("t_start %i\n",t_start);
3336      };  
3337      // --------------------------------------------------------------
3338      // 2) get the OBT of the last validated run
3339      // --------------------------------------------------------------
3340      oss.str("");
3341      oss << " SELECT * FROM GL_RUN  WHERE VALIDATION=1 AND RUNHEADER_TIME<="<< t_start
3342          <<" ORDER BY RUNHEADER_TIME DESC LIMIT 1;";
3343      printf(" Get stop validation-time: query is \n %s \n",oss.str().c_str());
3344    result = conn->Query(oss.str().c_str());    result = conn->Query(oss.str().c_str());
   //  
3345    if ( !result ) throw -4;    if ( !result ) throw -4;
3346      if ( result->GetRowCount() ){
3347              row = result->Next();
3348              t_stop = (UInt_t)atoll(row->GetField(4));
3349      };
3350      printf("t_stop %i\n",t_stop);
3351      // --------------------------------------------------------------
3352      // now retrieves runs to be validated
3353      // --------------------------------------------------------------
3354      oss.str("");
3355      oss << " SELECT * FROM GL_RUN  WHERE  RUNHEADER_TIME <=" << t_start;
3356      oss << " AND RUNHEADER_TIME >="<< t_stop;
3357      oss << " ORDER BY RUNHEADER_TIME DESC;";
3358    //  if ( IsDebug() )
3359      printf(" Check runs for validation: query is \n %s \n",oss.str().c_str());
3360      result = conn->Query(oss.str().c_str());
3361      if ( !result ) throw -4;
3362      if ( !result->GetRowCount() ) printf(" No runs to validate \n");
3363      printf("------------------------------------------------------------------------------- \n");
3364      
3365      Int_t nrow = 0;
3366      GL_RUN* this_run = new GL_RUN();
3367      GL_RUN* next_run = new GL_RUN();
3368      Int_t   nseq_max = 100;
3369    //  UInt_t* sequence = new UInt_t[100];
3370      vector<UInt_t> sequence(nseq_max);
3371      Int_t   nseq = 0;
3372      Bool_t CHECK = false;
3373      Bool_t this_ONLINE = false;
3374      Bool_t next_ONLINE = false;
3375      UInt_t t1=0,t2=0;
3376      // ---------------------------------------------------------------------------------
3377      // - loop over runs, back in time,
3378      // - select sequences of runs close in time (less than 60 s apart),
3379      //   which could be preceeded by a calibration
3380      // - check if there might be a missing calibration
3381      // ---------------------------------------------------------------------------------
3382      while(1){
3383              
3384              row = result->Next();
3385              if( row == NULL ) break;
3386              
3387              //------------
3388              //get run info
3389              //------------
3390              this_run->Set_GL_RUN(row);
3391              
3392              printf(" RUN ID %i --- TRK_CALIB_USED %i --- RM_ACQ_AFTER_CALIB %i --- TIME %i %i \n",this_run->ID,this_run->TRK_CALIB_USED,this_run->RM_ACQ_AFTER_CALIB,this_run->RUNHEADER_TIME, this_run->RUNTRAILER_TIME);
3393              
3394              Bool_t this_BAD = false;
3395              if(this_run->GetTRK_CALIB_USED() == 1 || this_run->GetTRK_CALIB_USED() == 2) this_ONLINE = true;
3396              else if (this_run->GetTRK_CALIB_USED() == 104)                          this_ONLINE = false;
3397              else{
3398                      printf("Missing or corrupted header!! \n");
3399                      this_ONLINE = false;
3400                      this_BAD = true;
3401              };
3402    
3403              //-----------------------------------
3404              //compare with previous(next in time)
3405              //-----------------------------------
3406              CHECK = false;
3407              UInt_t interval=0;
3408              
3409              if( nrow != 0){
3410            
3411                      
3412                      t1 = this_run->GetRUNTRAILER_TIME();
3413                      t2 = next_run->GetRUNHEADER_TIME();
3414                      interval = (t2-t1);
3415                      
3416                      if(this_ONLINE && next_ONLINE){                               // this: ON-LINE + next: ON-LINE
3417                              
3418                              if( this_run->ID == next_run->ID_RUN_FRAG ) interval = 0;     //=> run fragments
3419                              
3420                              if( interval >= 60 )CHECK = true;                     //more than 60 s => there might be a calibration
3421                              
3422    /*                        if( CHECK && !next_run->GetRM_ACQ_AFTER_CALIB() )
3423                                      printf(" ValidateRuns ***WARNING*** : DT = %i but RM_ACQ_AFTER_CALIB = %i \n",(t2-t1),next_run->GetRM_ACQ_AFTER_CALIB());*/
3424                                                      
3425                              
3426                              if( !CHECK && this_run->VALIDATION ){
3427                                      for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],true);
3428                                      nseq=0;
3429                              }
3430                      
3431                      }else if( !this_ONLINE && next_ONLINE) {              // this: DEFAULT + next:ON-LINE
3432                              
3433                              CHECK = true;
3434    //                        if( interval < 60 ) printf(" ValidateRuns ***WARNING*** : kkkkkk DT = %i \n",interval);
3435    
3436                      }else if( !next_ONLINE ){                                             // this:ANY + next:DEFAULT
3437                              
3438                              assignVALIDATION(next_run->ID,true);
3439                              nseq=0;
3440                      }
3441              }
3442    
3443              //----------------------------
3444              //check run sequence for calib
3445              //----------------------------
3446              if( CHECK ){
3447                      // check if calibration exists
3448                      printf("DT %i ===> CHECK Missing calibration\n",interval);
3449                      Bool_t MISSING = MissingTRK_CALIB(t1,t2);
3450                      for (Int_t irun = 0; irun < nseq; irun++)assignVALIDATION(sequence[irun],!MISSING);
3451                      nseq=0;
3452              } else printf("DT %i\n",interval);
3453              //--------------
3454              //store run info
3455              //--------------
3456              *next_run   = *this_run;
3457              next_ONLINE = this_ONLINE;
3458              if( !this_BAD ){
3459                      if(nseq < nseq_max){
3460                              sequence[nseq] = this_run->ID;
3461                              nseq++;
3462                      }else printf("ValidateRuns ***WARNING*** : run sequence exceed assumed size (%i) \n",nseq_max);
3463              };
3464              
3465              nrow++;
3466              
3467      };
3468      delete this_run;
3469      delete next_run;
3470    //    //
3471    return(0);    return(0);
3472  };  };
3473    /**
3474     * Check if there might be a missing tracker calibration in a given time interval
3475     * @param t1 From absolute time
3476     * @param t2 To absolute time
3477     * @return true if there might be a missing calibration
3478     */
3479    Bool_t PamelaDBOperations::MissingTRK_CALIB(UInt_t t1,UInt_t t2){
3480            
3481            GL_TRK_CALIB* trkcalib = new GL_TRK_CALIB();
3482            
3483            // get the closest VALIDATED calibration before the run start (t2)
3484            if ( trkcalib->Query_GL_TRK_CALIB(t2, conn) )return(true);      //>>> missing
3485            
3486            if ( trkcalib->TO_TIME  < t2 ) return(true);                                    //>>> missing
3487            
3488            //==============================================================
3489            // Check is done first on the basis of time between calibration,
3490            // which should be equal to the time between ascending-nodes.
3491            //==============================================================
3492            if ( t2 - trkcalib->FROM_TIME > 5700) {
3493                    printf("Long time to previous calib %i :-( \n",t2 - trkcalib->FROM_TIME);
3494            //==============================================================
3495            // there might be a missing calibration, due to:
3496            // - MM full
3497            // - corrupted packets
3498            // - loss of data
3499            // There is an exception in case a download was done during ascending node
3500            //==============================================================
3501                    Bool_t DOWNLOAD = false;
3502                    // check if the calib was skipped becouse of download .... DA FARE!!
3503                    if(DOWNLOAD)return(false);
3504                    
3505                    return(true);                                   //>>> missing
3506                    
3507            };
3508            
3509            //==============================================================
3510            // If the last calibration is close to the run less than this time,
3511            // it is enough to say that there are no missing calibrations
3512            //==============================================================
3513            // the long time interval bewteen runs might be due to download
3514            printf("Short time to previous calib %i :-) \n",t2 - trkcalib->FROM_TIME);
3515            return(false);
3516            
3517    };
3518    /**
3519     * Assign VALIDATION value to a GL_RUN entry
3520     * @param idrun Run ID
3521     * @param validation true/false
3522     */
3523    Int_t PamelaDBOperations::assignVALIDATION(UInt_t idrun, Bool_t validation){
3524            TSQLResult *result = 0;
3525            stringstream oss;
3526            oss.str("");
3527            oss << " UPDATE GL_RUN SET VALIDATION="<< (UInt_t)validation <<" WHERE ID= " << idrun << "';";
3528            //
3529    //      if ( IsDebug() )
3530            printf(" Set VALIDATION = %i for run %i \n",validation,idrun);
3531    //      printf(" Set VALIDATION = %i for run %i : query is \n %s \n",validation,idrun,oss.str().c_str());
3532    //      result = conn->Query(oss.str().c_str());
3533    //      if ( !result ) throw -4;
3534            return(0);
3535    }
3536    
3537    
3538    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23