/[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.26 by mocchiut, Wed Jan 31 16:15:03 2007 UTC revision 1.27 by mocchiut, Mon Feb 12 13:32:18 2007 UTC
# Line 56  string getTleDatetime(cTle*); Line 56  string getTleDatetime(cTle*);
56   * @param debug        debug flag.   * @param debug        debug flag.
57   * @param tlefilename  ascii file with TLE 3 line elements.   * @param tlefilename  ascii file with TLE 3 line elements.
58   */   */
59  PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, TString tlefilename){  PamelaDBOperations::PamelaDBOperations(TString host, TString user, TString password, TString filerawname, TString filerootname, UInt_t boot, UInt_t tsync, UInt_t obt0, Bool_t debug, TString tlefilename, UInt_t dwinput){
60    //    //
61    //    //
62    SetConnection(host,user,password);    SetConnection(host,user,password);
# Line 79  PamelaDBOperations::PamelaDBOperations(T Line 79  PamelaDBOperations::PamelaDBOperations(T
79    INSERT_ROOT = !filerootname.IsNull();    INSERT_ROOT = !filerootname.IsNull();
80    if( INSERT_ROOT ){    if( INSERT_ROOT ){
81      this->SetRootName(filerootname);      this->SetRootName(filerootname);
82      this->SetOrbitNo();      this->SetOrbitNo(dwinput);
83      file = TFile::Open(this->GetRootName().Data());      file = TFile::Open(this->GetRootName().Data());
84    } else {    } else {
85      this->SetRootName("");      this->SetRootName("");
# Line 215  void PamelaDBOperations::SetRootName(TSt Line 215  void PamelaDBOperations::SetRootName(TSt
215  /**  /**
216   * Store the downlink orbit number from filename.   * Store the downlink orbit number from filename.
217   */   */
218  void PamelaDBOperations::SetOrbitNo(){  void PamelaDBOperations::SetOrbitNo(UInt_t dwinput){
219    dworbit = 0;    dworbit = 0;
220      //
221      if ( dwinput ){
222        dworbit = dwinput;
223        if ( IsDebug() ) printf(" Downlink orbit given by hand: %i  \n",dworbit);
224        return;
225      };
226      //
227    TString name = this->GetRootFile();    TString name = this->GetRootFile();
228    Int_t nlength = name.Length();    Int_t nlength = name.Length();
229    if ( nlength < 5 ) return;    if ( nlength < 5 ) return;
# Line 361  Int_t PamelaDBOperations::SetUpperLimits Line 368  Int_t PamelaDBOperations::SetUpperLimits
368    if ( !nevent ) return(2);    if ( !nevent ) return(2);
369    //    //
370    if ( nevent < 2 ) return(4);    if ( nevent < 2 ) return(4);
371      if ( nevent < jump ) jump = 1;
372      //  if ( nevent < jump ) jump = int(nevent/10);
373      //  if ( !jump ) jump = 1;
374    //    //
375    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) ){    if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){
376      //      //
377        if ( IsDebug() ) printf(" starting jump %i \n",jump);
378      // go back      // go back
379      zomp = nevent - 2;      zomp = nevent - 2;
380      //      //
# Line 439  Int_t PamelaDBOperations::SetUpperLimits Line 450  Int_t PamelaDBOperations::SetUpperLimits
450    Long64_t pkth = 0LL;    Long64_t pkth = 0LL;
451    Long64_t obth = 0LL;    Long64_t obth = 0LL;
452    //    //
453      if ( rhev || rtev ){
454    
455    
456    T->GetEntry(upperentry);    T->GetEntry(upperentry);
457    code = eh->GetCounter();    code = eh->GetCounter();
458    Int_t lasttrail = code->Get(pctp->RunTrailer);    Int_t lasttrail = code->Get(pctp->RunTrailer);
# Line 645  Int_t PamelaDBOperations::SetUpperLimits Line 659  Int_t PamelaDBOperations::SetUpperLimits
659    };    };
660    if ( IsDebug() ) printf(" rtev after %i  pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt);    if ( IsDebug() ) printf(" rtev after %i  pt %lld upperp %lld ot %lld uppero %lld \n",rtev,pktt,upperpkt,obtt,upperobt);
661    //    //
662    
663    
664      };
665      //
666    if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry);    if ( IsDebug() ) printf(" Upper limits are: OBT %lld pkt_num %lld upper entry %i \n",upperobt,upperpkt,upperentry);
667    //    //
668    return(0);    return(0);
# Line 1380  Int_t PamelaDBOperations::assignBOOT_NUM Line 1398  Int_t PamelaDBOperations::assignBOOT_NUM
1398    //    //
1399    Int_t sgn = 0;    Int_t sgn = 0;
1400    //    //
1401    if ( !found ){    if ( !found && !BOOTNO ){
1402      throw -29;      throw -29;
1403    } else {    } else {
1404      if ( afound ){      if ( afound ){

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.23