ROOT logo
//*-- AUTHOR : Ilse Koenig
//*-- Modified last : 22/10/2002 by Denis Bertini

//_HADES_CLASS_DESCRIPTION 
/////////////////////////////////////////////////////////////
//  HRuntimeDb
//
//  Administration class for parameter input/output
//
/////////////////////////////////////////////////////////////
using namespace std;
#include "hades.h"
#include "hruntimedb.h"
#include "hcontfact.h"
#include "hparset.h"
#include "hpario.h"
#include "hparrootfileio.h"
#include "hspectrometer.h"
#include "hmessagemgr.h"
#include "hrun.h"
#include "hparamfilegenerator.h"
#include "hruninfo.h"
#include "TKey.h"
#include "TClass.h"
#include <iostream> 
#include <iomanip> 

ClassImp(HRuntimeDb)

HRuntimeDb* HRuntimeDb::gRtdb=0;

HRuntimeDb* HRuntimeDb::instance(void) {
  if (gRtdb==0) gRtdb=new HRuntimeDb;
  return gRtdb;
}

HRuntimeDb::HRuntimeDb(void) {
  // constructor creates an empty list for parameter containers
  // and an empty list of runs for the version management
  gRtdb=this;
  containerList=new TList();
  runs=new TList();
  firstInput=0;
  secondInput=0;
  output=0;
  versionsChanged=kFALSE;
  currentRun=0;
  isRootFileOutput=kFALSE;
  pParamFileGenerator=0;
}

HRuntimeDb::~HRuntimeDb() {
  // destructor
  // deletes the list of runs and all containers
  if (pParamFileGenerator) {
    delete pParamFileGenerator;
    pParamFileGenerator=0;
  } 
  closeFirstInput();
  closeSecondInput();
  closeOutput();
  if (containerList) {
    containerList->Delete();
    delete containerList;
  }
  if (runs) {
    runs->Delete();
    delete runs;
  }
  gRtdb=0;
}

void HRuntimeDb::addContFactory(HContFact* fact) {
  // Adds a container factory to the list of factories
  if (!(contFactories.FindObject(fact->GetName()))) {
    printf("- RTDB container factory %s \n",fact->GetName() );
    contFactories.Add(fact);
  }
}

Bool_t HRuntimeDb::addParamContext(const Char_t* context) {
  // Sets via the container factories the context of all parameter containers,
  // which accept this context 
  Bool_t found=kFALSE;
  TIter next(&contFactories);
  HContFact* fact;
  while((fact=(HContFact*)next())) {
    if (fact->addContext(context)) found=kTRUE;
  }
  if (!found) { ERROR_msg(HMessageMgr::DET_ALL,"Unknown context"); }
      //Error("addParamContext","Unknown context");
  return found;
}

void HRuntimeDb::printParamContexts() {
  // Prints the context of all parameter containers, which can be created by
  // the container factories
  TIter next(&contFactories);
  HContFact* fact;
  while((fact=(HContFact*)next())) fact->print();
}

Bool_t HRuntimeDb::addContainer(HParSet* container) {
  // adds a container to the list of containers
  Text_t* name=(Char_t*)container->GetName();
  if (!containerList->FindObject(name)) {
    containerList->Add(container);
    TIter next(runs);
    HRun* run;
    HParVersion* vers;
    while ((run=(HRun*)next())) {
      if (!run->getParVersion(name)) {
        vers=new HParVersion(name);
        run->addParVersion(vers);
      }
    }      
    return kTRUE;
  }
  gHades->getMsg()->warning(10,HMessageMgr::DET_ALL,this->GetName(),"Container with name %s exists already!",name);
  //Warning("addContainer","Container with name %s exists already!",name);
  return kFALSE;
}

HParSet* HRuntimeDb::getContainer(const Text_t* name) {
  // The function loops over the container factories to find the corresponding container
  // with the give name and its context.
  // The name is the original name of the parameter container without the concatination
  // with the context.
  // The factory checks, if the container exists already in the runtime database. Otherwise
  // it will be created and added by the factory.    
  // The function returns a pointer to the container or NULL, if not created.
  TIter next(&contFactories);
  HContFact* fact;
  HParSet* c=0;
  while(!c && (fact=(HContFact*)next())) {
    c=fact->getContainer(name);
  }
  if (!c) gHades->getMsg()->error(1,HMessageMgr::DET_ALL,this->GetName(),"Container %s not created!",name);
      //Error("getContainer","Container %s not created!",name); 
  return c;
}

HParSet* HRuntimeDb::findContainer(const Char_t* name) {
  // returns a pointer to the container called by name
  // The name is the original name of the parameter container eventually concatinated with
  // a non-default context.
  return (HParSet*)(containerList->FindObject(name));
}

void HRuntimeDb::removeContainer(Text_t* name) {
  // removes the container from the list and deletes it
  TObject* c=containerList->FindObject(name);
  if (c) {
    containerList->Remove(c);
    delete c;
  }
}

void HRuntimeDb::removeAllContainers(void) {
  // removes all containers from the list and deletes them
  containerList->Delete();
}

HRun* HRuntimeDb::addRun(Int_t runId,Int_t refId) {
  // adds a run at the end of the list of runs
  // returns a pointer to the run newly added
  HRun* run;
  if (refId!=-1) {
    run=getRun(refId);
    if (!run) addRun(refId);
  }
  run=getRun(runId);
  if (!run) {
    run=new HRun(runId,refId);
    TIter next(containerList);
    HParSet* cont;
    HParVersion* vers;
    while ((cont=(HParSet*)next())) {
      vers=new HParVersion(((Char_t*)cont->GetName()));
      run->addParVersion(vers);
    }    
    runs->Add(run);
    currentRun=run;
  } else WARNING_msg(10,HMessageMgr::DET_ALL,"run exists already!");
      //cout<<"WARNING: run exists already!"<<endl;
  return run;
}

HRun* HRuntimeDb::getRun(Int_t id) {
  // returns a pointer to the run called by the run id
  Char_t name[255];
  sprintf(name,"%i",id);
  return (HRun*)(runs->FindObject(name));
}

HRun* HRuntimeDb::getRun(Text_t* name) {
  // returns a pointer to the run called by name
  return (HRun*)(runs->FindObject(name));
}

void HRuntimeDb::removeRun(Text_t* name) {
  // removes the run from the list and deletes it
  TObject* c=runs->FindObject(name);
  if (c) {
    runs->Remove(c);
    delete c;
    if(c==currentRun) currentRun=0;
  }
}

void HRuntimeDb::clearRunList() {
  runs->Delete();
}

void HRuntimeDb::writeSetup() {
  // writes the setup to the output if the setup has changed
  HSpectrometer* spec=gHades->getSetup();
  if (spec->hasChanged() && getOutput() && output->check()&& output->isAutoWritable()
                         && firstInput!=output) 
      spec->write(output);
}

void HRuntimeDb::writeVersions() {
  // writes the parameter versions for all runs to the output
  if (getOutput() && output->check()) {
    if (versionsChanged && isRootFileOutput) {
      output->cd();
      if (gFile->IsWritable()) runs->Write();
      versionsChanged=kFALSE;
    }
  }
}


Bool_t HRuntimeDb::writeContainers() {
  // writes all containers to the output
  // loops over the list of containers and calls for each the
  // function writeContainer(...)
  TIter next(containerList);
  HParSet* cont;
  Bool_t rc=kTRUE;
  HRun* refRun=0;
  if (currentRun) {
    const Char_t* refRunName=currentRun->getRefRun();
    if (strlen(refRunName)>0) {
      refRun=(HRun*)(runs->FindObject(refRunName));
    }
    while ((cont=(HParSet*)next()) && rc) {
      rc=writeContainer(cont,currentRun,refRun);
    }
  }
  if (!rc) { ERROR_msg(HMessageMgr::DET_ALL,"error while writing container to output"); }
      //cerr<<"error while writing container to output"<<endl;
  return rc;
}


Int_t HRuntimeDb::findOutputVersion(HParSet* cont) {
  Int_t in1=cont->getInputVersion(1);
  Int_t in2=cont->getInputVersion(2);
  HRun* run;
  HParVersion* vers;
  Text_t* name=(Char_t*)cont->GetName();
  Int_t v=0;
  if (in1==-1 && in2==-1) {
    if (cont->hasChanged()) return 0;
    else {
      Int_t i=runs->IndexOf(currentRun); //FIXME: This can be optimized with a backwards iter.
      while (i>=0) {
        run=(HRun*)runs->At(i);
        vers=run->getParVersion(name);
        if (vers->getInputVersion(1)==in1 && vers->getInputVersion(2)==in2) {
          if ((v=vers->getRootVersion())!=0) return v;
        }
        --i;
      }
      return 0;
    }
  }
  if ((firstInput==output) && (in1>0 && in2==-1)) return in1;
  TIter next(runs);
  v=0;
  while ((run=(HRun*)next())) {
    vers=run->getParVersion(name);
    if (vers->getInputVersion(1)==in1 && vers->getInputVersion(2)==in2) {
      if ((v=vers->getRootVersion())!=0) return v;
    }
  }
  return 0;
}


Bool_t HRuntimeDb::writeContainer(HParSet* cont, HRun* run, HRun* refRun) {
  // writes a container to the output if the containers has changed
  // The output might be suppressed if the changes is due an
  // initialisation from a ROOT file which serves also as output
  // or if it was already written
  Text_t* c=(Char_t*)cont->GetName();
  HParVersion* vers=run->getParVersion(c);
  Bool_t rc=kTRUE;
  Int_t cv=0;
  if (getOutput() && output->check() && output->isAutoWritable()) {
    if (isRootFileOutput) {
      if (cont->hasChanged()) {
        cv=findOutputVersion(cont);
        if (cv==0){
          cv=cont->write(output);
          if (cv>0) {
	      gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),"%s written to ROOT file, version: %d",c,cv);
	      //cout<<"***  "<<c<<" written to ROOT file   version: "<<cv<<'\n';
          }
          else if (cv==-1) return kFALSE;
             // -1 indicates and error during write
	     // 0 is allowed for all containers which have no write function
        }
        vers->setRootVersion(cv);
      } else {
        if (vers->getRootVersion()==0) {
          cv=findOutputVersion(cont);
          vers->setRootVersion(cv);
        }
      }
    } else {   // might be Ascii I/O
      if (cont->hasChanged()) {
        cv=cont->write(output);
        if (cv<0) return kFALSE;
        if (cv>0) gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),"%s written to output",c);
	    //cout<<"***  "<<c<<" written to output"<<'\n';
        vers->setRootVersion(cv);
      }
    }
  }
  vers->setInputVersion(cont->getInputVersion(1),1);
  vers->setInputVersion(cont->getInputVersion(2),2);
  cont->setChanged(kFALSE);
  if (refRun) {
    HParVersion* refVers=refRun->getParVersion(c);
    if (refVers) {
      refVers->setInputVersion(cont->getInputVersion(1),1);
      refVers->setInputVersion(cont->getInputVersion(2),2);
      refVers->setRootVersion(cv);
    }
  }
  return rc;
}

Bool_t HRuntimeDb::initContainers(Int_t runId,Int_t refId,
                                  const Text_t* fileName) {
  // loops over the list of containers and calls the init() function of each
  // container if it is not static
  // (typically called by Hades::eventLoop(...))
  if (currentRun && currentRun->getRunId()!=runId) writeContainers();
  HRun* run=getRun(runId);
  if (!run) run=addRun(runId,refId);
  else {
    run->setRefRun(refId);
    if (refId!=-1 && !getRun(refId)) addRun(refId);
  }
  currentRun=run;
  currentFileName=fileName;
  return initContainers();
}

Bool_t HRuntimeDb::readAll() {
  // reads all containers with all versions for all runs and writes the
  // containers, the setup information and the version table to the output
  if (!(getOutput() && output->check())) {
      SEPERATOR_msg("*",80);
      WARNING_msg(10,HMessageMgr::DET_ALL,"no output !");
      SEPERATOR_msg("*",80);
      //cout<<"***********************************************************"<<endl;
      //cout<<"*********************  W A R N I N G  *********************"<<endl;
      //cout<<"*********************   no output !   *********************"<<endl;
      //cout<<"***********************************************************"<<endl;
  }
  currentRun=0;
  Bool_t rc=kTRUE;
  TIter next(runs);
  while ((currentRun=(HRun*)next())!=0 &&rc) {
    rc=initContainers();
    writeContainers();
  }
  saveOutput();
  currentRun=0;
  return kTRUE;
}

Bool_t HRuntimeDb::initContainers(void) {
  // private function 
  Text_t* refRunName=(Char_t*)currentRun->getRefRun();
  Int_t len=strlen(refRunName);
  if (len<1) {
    if (firstInput) firstInput->readVersions(currentRun);
    if (secondInput) secondInput->readVersions(currentRun);
  } else {
    HRun* refRun=getRun(refRunName);
    if (firstInput) firstInput->readVersions(refRun);    
    if (secondInput) secondInput->readVersions(refRun);
  }
  TIter next(containerList);
  HParSet* cont;
  Bool_t rc=kTRUE;
  //cout<<'\n'<<"*************************************************************"<<'\n';
  SEPERATOR_msg("*",60);
  if (currentFileName.IsNull())
    {
      gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName()," initialisation for run id %s",currentRun->GetName());
    }
    //cout<<"     initialisation for run id "<<currentRun->GetName();
  else {
    gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName()," initialisation for event file %s",currentFileName.Data());
    gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),"  run id %s",currentRun->GetName());
    //cout<<"     initialisation for event file "<<currentFileName.Data()<<'\n';
    //cout<<"     run id "<<currentRun->GetName();
  }
  if (len>0) 
    {
      gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),"%10s %s","-->",refRunName);
      //cout << " --> " << refRunName;
    }
  SEPERATOR_msg("*",60);
  //cout << '\n';
  //cout<<"*************************************************************"<<'\n';
  while ((cont=(HParSet*)next()) && rc) {
    if (!cont->isStatic()) rc=cont->init();
    //cont->print();
  }
  if (!rc){ ERROR_msg(HMessageMgr::DET_ALL,"error occured during initialization"); }
    //cerr<<"error occured during initialization"<<endl;
  return rc;
}


void HRuntimeDb::printContainers(void) {
  // calls the print() function of all containers
  TIter next(containerList);
  HParSet* cont;
  SEPERATOR_msg("*",60);
  while ((cont=(HParSet*)next())) {
    cont->print();
    SEPERATOR_msg("*",60);
  }
}

void HRuntimeDb::setContainersStatic(Bool_t flag) {
  // sets the status flag in all containers
  // flag kTRUE sets all 'static'
  // flag kFALSE sets all 'not static'
  TIter next(containerList);
  HParSet* cont;
  while ((cont=(HParSet*)next())) {
    cont->setStatic(flag);
  }
}


Bool_t HRuntimeDb::setInputVersion(Int_t run,Text_t* container,
                               Int_t version,Int_t inp) {
  // sets the input version of a container defined by its name and a
  // run defined by its id taken from input with inputNumber inp
  // (1 for first input and 2 for second input)
  HRun* r=getRun(run);
  if (r) {
    HParVersion* v=r->getParVersion(container);
    if (v) {
      v->setInputVersion(version,inp);
      return kTRUE;
    }
    else ERROR_msg(HMessageMgr::DET_ALL,"Container not found");
  }
  else ERROR_msg(HMessageMgr::DET_ALL,"run not found");
  return kFALSE;
}


Bool_t HRuntimeDb::setRootOutputVersion(Int_t run,Text_t* container,
                               Int_t version) {
  // sets the Root file output version of a container defined by its name
  // and a run defined by its id
  // should only be used after initialization 'by hand' on the interpreter level
  HRun* r=getRun(run);
  if (r) {
    HParVersion* v=r->getParVersion(container);
    if (v) {
      v->setRootVersion(version);
      return kTRUE;
    }
    else ERROR_msg(HMessageMgr::DET_ALL,"Container not found");
  }
  else ERROR_msg(HMessageMgr::DET_ALL,"run not found");
  return kFALSE;
}

void HRuntimeDb::print() {
  // prints the list of the actual containers, the list of the
  // runs/versions and information about input/output
  //cout<<"-----------------------------------------------------------"<<'\n';
  //cout<<"---------  actual containers in runtime database  ---------"<<'\n';
  SEPERATOR_msg("-",60);
  INFO_msg(10,HMessageMgr::DET_ALL,"actual containers in runtime database");
  TIter nextCont(containerList);
  HParSet* cont;
  while((cont=(HParSet*)nextCont())) {
    //printf("%s\t\t%s\n",cont->GetName(),cont->GetTitle());
    gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),"%s\t\t%s",cont->GetName(),cont->GetTitle());
  }
  TIter next(runs);
  HRun* run;
  //cout<<"-----------------  runs, versions  -----------------"<<'\n';
  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"runs, versions");
  //cout<<"run id"<<'\n';
  SEPERATOR_msg("-",80);
  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"run id");
  SEPERATOR_msg("-",40);
  gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),"%-22s%10s%10s%10s","container","1st-input","2nd-input","output");
  //cout<<"  "<<setiosflags(2)<<setw(45)<<"container"<<" "
  //            <<setiosflags(4)<<setw(10)<<"1st-inp"<<" "
  //                            <<setw(10)<<"2nd-inp"<<" "
  //	                      <<setw(10)<<" output"<<'\n';
  while ((run=(HRun*)next())) {
    run->print();
  }
  //cout<<"---------------------  input/output  ----------------------"<<'\n';
  SEPERATOR_msg("-",80);
  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"input/output");
  SEPERATOR_msg("-",40);
  //cout<<"first Input:"<<'\n';
  if (firstInput) 
      {
	  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"first Input:");
	  firstInput->print();
      }
  else 
      INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"first Input: none");
      //cout<<" none"<<'\n';
  //cout<<'\n'<<"second Input:"<<'\n';
  SEPERATOR_msg("-",80);
  if (secondInput) 
      {
	  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"second Input:");
	  secondInput->print();
      }
  else INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"second Input: none");
      //cout<<" none"<<'\n';
  //cout<<'\n'<<"Output:"<<'\n';
  SEPERATOR_msg("-",80);
  if (output)
      {
	  INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"Output:");
	  output->print();
      }
  else INFO_msg(10,HMessageMgr::DET_RUNTIMEDB,"Output: none");
  //cout<<" none"<<'\n';
  //cout<<"-----------------------------------------------------------"<<'\n';
  SEPERATOR_msg("-",80);
}

void HRuntimeDb::resetInputVersions() {
  // resets all input versions in the list of runs and in all containers
  //   which are not static
  // is called each time a new input is set
  TIter nextRun(runs);
  HRun* run;
  while ((run=(HRun*)nextRun())) {
    run->resetInputVersions();
  }
  TIter nextCont(containerList);
  HParSet* cont;
  while ((cont=(HParSet*)nextCont())) {
    if (!cont->isStatic()) cont->resetInputVersions();
  }
}

void HRuntimeDb::resetOutputVersions() {
  // resets all output versions in the list of runs
  // is called each time a new output is set
  // is called also each time a new input is set which is not
  // identical with the output
  TIter next(runs);
  HRun* run;
  while ((run=(HRun*)next())) {
    run->resetOutputVersions();
  }
}

void HRuntimeDb::resetAllVersions() {
  // resets all input and output versions in the list of runs
  // and in all containers which are not static
  resetInputVersions();
  resetOutputVersions();
}

Bool_t HRuntimeDb::setFirstInput(HParIo* inp1) {
  // sets the first input pointer
  firstInput=inp1;
  if (inp1->check()==kTRUE) {
    inp1->setInputNumber(1);
    resetInputVersions();
    if (output && firstInput!=output) resetOutputVersions();
    return kTRUE;
  }
  else ERROR_msg(HMessageMgr::DET_RUNTIMEDB, "no connection to input");
  //cerr<<"no connection to input"<<endl;
  return kFALSE;
}

Bool_t HRuntimeDb::setSecondInput(HParIo* inp2) {
  // sets the second input pointer
  secondInput=inp2;
  if (inp2->check()==kTRUE) {
    inp2->setInputNumber(2);
    resetInputVersions();
    if (output && firstInput!=output) resetOutputVersions();
    return kTRUE;
  }
  else ERROR_msg(HMessageMgr::DET_RUNTIMEDB,"no connection to input");
      //cerr<<"no connection to input"<<endl;
  return kFALSE;
}

Bool_t HRuntimeDb::setOutput(HParIo* op) {
  // sets the output pointer
  output=op;
  if (output->check()==kTRUE) {
    resetOutputVersions();
    if (strcmp(output->IsA()->GetName(),"HParRootFileIo")==0)
        isRootFileOutput=kTRUE;
    return kTRUE;
  }
  else ERROR_msg(HMessageMgr::DET_RUNTIMEDB,"no connection to output");
      //cerr<<"no connection to output"<<endl;
  return kFALSE;
}

HParIo* HRuntimeDb::getFirstInput() {
  // return a pointer to the first input
  if (firstInput) firstInput->cd();
  return firstInput;
}

HParIo* HRuntimeDb::getSecondInput() {
  // return a pointer to the second input
  if (secondInput) secondInput->cd();
  return secondInput;
}
HParIo* HRuntimeDb::getOutput() {
  // return a pointer to the output
  if (output) output->cd();
  return output;
}

void HRuntimeDb::closeFirstInput() {
  if (firstInput) {
    firstInput->cd();
    firstInput->close();
    firstInput=0;
  }
}

void HRuntimeDb::closeSecondInput() {
  if (secondInput) {
    secondInput->cd();
    secondInput->close();
    secondInput=0;
  }
}

Bool_t HRuntimeDb::reconnectInputs() {
  // reconnects the inputs (actually only used for the Oracle interface)
  Bool_t rc=kTRUE;
  if (firstInput) rc=firstInput->reconnect();
  if (rc&&secondInput) rc=secondInput->reconnect();
  return rc;
}

void HRuntimeDb::disconnectInputs() {
  // disconnects the inputs (actually only used for the Oracle interface)
  if (firstInput) firstInput->disconnect(); 
  if (secondInput) secondInput->disconnect();  
}

void HRuntimeDb::saveOutput() {
  // writes the setup, the versions and the containers (if not
  // yet written out) 
  // without the setup and version information the containers cannot
  // be read again!
  Bool_t rc=kTRUE;
  writeSetup();
  if (currentRun!=0) rc=writeContainers();
  if (rc&&pParamFileGenerator) fillParamFile();
  writeVersions();
  if (!rc) { ERROR_msg(HMessageMgr::DET_RUNTIMEDB,"error occured during write"); }
      //cerr<<"error occured during write"<<endl;
}

void HRuntimeDb::closeOutput() {
  // calls saveOutput() and deletes then the output
  if (output) {
    if (output->isAutoWritable()) saveOutput();
    output->close();
    resetOutputVersions();
    output=0;
    isRootFileOutput=kFALSE;
  }
}

Bool_t HRuntimeDb::makeParamFile(const Char_t* fName,const Char_t* experiment,
                                 const Char_t* startAt,const Char_t* endAt) {
  // Creates the parameter file generator, which opens a ROOT file and a log file
  // Returns kFALSE if the ROOT file already exists
  gHades->setEnableCloseInput(kFALSE);
  closeOutput();
  pParamFileGenerator=new HParamFileGenerator(experiment,startAt,endAt);
  output=pParamFileGenerator->openParameterFile(fName);
  if (output&&output->check()==kTRUE) {
    resetOutputVersions();
    isRootFileOutput=kTRUE;
    return kTRUE;
  } else {
    delete pParamFileGenerator;
    pParamFileGenerator=0;
    return kFALSE;
  } 
}

Bool_t HRuntimeDb::fillParamFile() {
  // This function is called in saveOutput, if the parameter file generator exists
  // It gets the lists of runs from Oracle and initializes the parameter containers for each run
  // The loop does not break, if an error occurs, but error information is written to a log file
  // It returns kFALSE if there is not open Oracle connection
  HParIo* pio=0;
  if (firstInput&&firstInput->InheritsFrom("HParOra2Io")) pio=firstInput;
  else if (secondInput&&secondInput->InheritsFrom("HParOra2Io")) pio=secondInput;
  if (!pio) {
      Error("fillParamFile","No Oracle Input");
    return kFALSE;
  }
  SEPERATOR_msg("*",60);
  gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
          "Parameter file generator started");
  TList * pRuns=pio->getListOfRuns(pParamFileGenerator->getExperiment(),
                                   pParamFileGenerator->getRangeStart(),
                                   pParamFileGenerator->getRangeEnd());
  if (!pRuns) {
    Error("fillParamFile","List of Runs not generated");
    return kFALSE;
  }
  SEPERATOR_msg("-",60);
  pParamFileGenerator->setListOfRuns(pRuns);
  pParamFileGenerator->writeRuns();
  fstream* logFile=pParamFileGenerator->getLogFile();
  fstream& fout=*logFile;
  fout<<"//------------------------------------------------------------------------------\n";
  fout<<"---------  actual containers in runtime database  ---------\n";
  TIter iterCont(containerList);
  HParSet* cont;
  while((cont=(HParSet*)iterCont())) {
    fout<<setw(45)<<cont->GetName()<<"  "<<cont->GetTitle()<<'\n';
  }
  fout<<"//------------------------------------------------------------------------------\n";
  HRunInfo* pRunInfo=0;
  TIter iterInfo(pRuns);
  Int_t nRuns=0, numReadErrors=0, numWriteErrors=0;
  while ((pRunInfo=(HRunInfo*)iterInfo())!=0) {
    Int_t runId=pRunInfo->getRunId();
    HRun* run=getRun(runId);
    iterCont.Reset();
    Bool_t noError=kTRUE;
    TString contNames("  Error in init of");
    if (!run) {
      run=addRun(runId,-1);
      currentRun=run;
      currentFileName=pRunInfo->GetName();
      Bool_t rc=kTRUE;
      while ((cont=(HParSet*)iterCont())) {
        if (!cont->isStatic()) rc=cont->init();
        if (!rc) {
          noError=kFALSE;
          contNames.Append(" ");
          contNames+=cont->GetName();
	} else {
          rc=writeContainer(cont,currentRun,0);
          if (!rc) {
            fout<<"Error during write of run "<<currentFileName.Data()
                <<" (runId "<<runId<<") for container "<<cont->GetName()<<'\n';
            numWriteErrors++;
          }
        }
      }
    } else {
      while ((cont=(HParSet*)iterCont())) {
        HParVersion* v=run->getParVersion((Char_t*)(cont->GetName()));
        if (!v||(v->getInputVersion(1)==-1&&v->getInputVersion(2)==-1)) {
          noError=kFALSE;
          contNames.Append(" ");
          contNames+=cont->GetName();
        }
      }
    }
    if (!noError) { 
      fout<<"Error during initialization of run "<<currentFileName.Data()
          <<" (runId "<<runId<<")"<<'\n'<<contNames<<'\n';
      numReadErrors++;
    }
    if ((++nRuns % 1000)==0) {
      gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),
                             "%5i runs processed",nRuns);
    }
  }
  fout<<"Number runs of not fully initialized: "<<numReadErrors<<'\n';
  fout<<"Number of write errors :              "<<numWriteErrors<<'\n';
  fout<<"//------------------------------------------------------------------------------\n";
  TIter iterRuns(runs);
  HRun* run;
  fout<<"-----------------  runs, versions  -----------------\n";
  fout<<"run id"<<'\n';
  fout.setf(ios::left,ios::adjustfield);
  fout<<"  "<<setw(45)<<"container";
  fout.setf(ios::right,ios::adjustfield);
  fout<<setw(11)<<"1st-inp"
      <<setw(11)<<" 2nd-inp"
      <<setw(11)<<" output"<<'\n';
  while ((run=(HRun*)iterRuns())) {
    run->write(fout);
  }
  fout<<"---------------------  output  ----------------------\n";
  fout<<"Parameter output: "<<pParamFileGenerator->getParamFilename()<<endl;
  gHades->getMsg()->info(10,HMessageMgr::DET_ALL,this->GetName(),
                         "%5i runs processed",nRuns);
  SEPERATOR_msg("-",60);
  if (numReadErrors==0 && numWriteErrors==0) {
    gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
            "All runs initialized without errors");
  } else {
    gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
            "Number of runs not initialized: %5i",pParamFileGenerator->getParamFilename());
    gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
            "Number of write errors:         %5i",pParamFileGenerator->getParamFilename());
    SEPERATOR_msg("-",60);
  }
  gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
          "Parameter output: %s",pParamFileGenerator->getParamFilename());
  gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),
          "Log file:         %s",pParamFileGenerator->getLogFilename());
  SEPERATOR_msg("*",60);
  return kTRUE;
}

void HRuntimeDb::Streamer(TBuffer &R__b)
{
 Int_t nentries=0;
 HParSet *param=0;
   // Stream an object of class HRuntimeDb
   if (R__b.IsReading()) {
      TObject::Streamer(R__b);

      R__b >> nentries;
      containerList = new TList();
      for(Int_t i=0 ; i < nentries ; i++) {

         R__b >> param;
	 gHades->getMsg()->info(10,HMessageMgr::DET_RUNTIMEDB,this->GetName(),"Loading container %s",param->GetName());
         //printf(" Loading container:  %s \n",param->GetName());
         containerList->Add( param );
      }
      R__b >> runs;

   } else {
     // R__b.WriteVersion(HRuntimeDb::IsA());
      TObject::Streamer(R__b);
      nentries = containerList->GetSize();
      R__b << nentries ;

      for (Int_t i=0; i < nentries ; i++) {
           param =  (HParSet*) containerList->At( i );
           R__b << param;
      }
      R__b << runs;
   }
}
 hruntimedb.cc:1
 hruntimedb.cc:2
 hruntimedb.cc:3
 hruntimedb.cc:4
 hruntimedb.cc:5
 hruntimedb.cc:6
 hruntimedb.cc:7
 hruntimedb.cc:8
 hruntimedb.cc:9
 hruntimedb.cc:10
 hruntimedb.cc:11
 hruntimedb.cc:12
 hruntimedb.cc:13
 hruntimedb.cc:14
 hruntimedb.cc:15
 hruntimedb.cc:16
 hruntimedb.cc:17
 hruntimedb.cc:18
 hruntimedb.cc:19
 hruntimedb.cc:20
 hruntimedb.cc:21
 hruntimedb.cc:22
 hruntimedb.cc:23
 hruntimedb.cc:24
 hruntimedb.cc:25
 hruntimedb.cc:26
 hruntimedb.cc:27
 hruntimedb.cc:28
 hruntimedb.cc:29
 hruntimedb.cc:30
 hruntimedb.cc:31
 hruntimedb.cc:32
 hruntimedb.cc:33
 hruntimedb.cc:34
 hruntimedb.cc:35
 hruntimedb.cc:36
 hruntimedb.cc:37
 hruntimedb.cc:38
 hruntimedb.cc:39
 hruntimedb.cc:40
 hruntimedb.cc:41
 hruntimedb.cc:42
 hruntimedb.cc:43
 hruntimedb.cc:44
 hruntimedb.cc:45
 hruntimedb.cc:46
 hruntimedb.cc:47
 hruntimedb.cc:48
 hruntimedb.cc:49
 hruntimedb.cc:50
 hruntimedb.cc:51
 hruntimedb.cc:52
 hruntimedb.cc:53
 hruntimedb.cc:54
 hruntimedb.cc:55
 hruntimedb.cc:56
 hruntimedb.cc:57
 hruntimedb.cc:58
 hruntimedb.cc:59
 hruntimedb.cc:60
 hruntimedb.cc:61
 hruntimedb.cc:62
 hruntimedb.cc:63
 hruntimedb.cc:64
 hruntimedb.cc:65
 hruntimedb.cc:66
 hruntimedb.cc:67
 hruntimedb.cc:68
 hruntimedb.cc:69
 hruntimedb.cc:70
 hruntimedb.cc:71
 hruntimedb.cc:72
 hruntimedb.cc:73
 hruntimedb.cc:74
 hruntimedb.cc:75
 hruntimedb.cc:76
 hruntimedb.cc:77
 hruntimedb.cc:78
 hruntimedb.cc:79
 hruntimedb.cc:80
 hruntimedb.cc:81
 hruntimedb.cc:82
 hruntimedb.cc:83
 hruntimedb.cc:84
 hruntimedb.cc:85
 hruntimedb.cc:86
 hruntimedb.cc:87
 hruntimedb.cc:88
 hruntimedb.cc:89
 hruntimedb.cc:90
 hruntimedb.cc:91
 hruntimedb.cc:92
 hruntimedb.cc:93
 hruntimedb.cc:94
 hruntimedb.cc:95
 hruntimedb.cc:96
 hruntimedb.cc:97
 hruntimedb.cc:98
 hruntimedb.cc:99
 hruntimedb.cc:100
 hruntimedb.cc:101
 hruntimedb.cc:102
 hruntimedb.cc:103
 hruntimedb.cc:104
 hruntimedb.cc:105
 hruntimedb.cc:106
 hruntimedb.cc:107
 hruntimedb.cc:108
 hruntimedb.cc:109
 hruntimedb.cc:110
 hruntimedb.cc:111
 hruntimedb.cc:112
 hruntimedb.cc:113
 hruntimedb.cc:114
 hruntimedb.cc:115
 hruntimedb.cc:116
 hruntimedb.cc:117
 hruntimedb.cc:118
 hruntimedb.cc:119
 hruntimedb.cc:120
 hruntimedb.cc:121
 hruntimedb.cc:122
 hruntimedb.cc:123
 hruntimedb.cc:124
 hruntimedb.cc:125
 hruntimedb.cc:126
 hruntimedb.cc:127
 hruntimedb.cc:128
 hruntimedb.cc:129
 hruntimedb.cc:130
 hruntimedb.cc:131
 hruntimedb.cc:132
 hruntimedb.cc:133
 hruntimedb.cc:134
 hruntimedb.cc:135
 hruntimedb.cc:136
 hruntimedb.cc:137
 hruntimedb.cc:138
 hruntimedb.cc:139
 hruntimedb.cc:140
 hruntimedb.cc:141
 hruntimedb.cc:142
 hruntimedb.cc:143
 hruntimedb.cc:144
 hruntimedb.cc:145
 hruntimedb.cc:146
 hruntimedb.cc:147
 hruntimedb.cc:148
 hruntimedb.cc:149
 hruntimedb.cc:150
 hruntimedb.cc:151
 hruntimedb.cc:152
 hruntimedb.cc:153
 hruntimedb.cc:154
 hruntimedb.cc:155
 hruntimedb.cc:156
 hruntimedb.cc:157
 hruntimedb.cc:158
 hruntimedb.cc:159
 hruntimedb.cc:160
 hruntimedb.cc:161
 hruntimedb.cc:162
 hruntimedb.cc:163
 hruntimedb.cc:164
 hruntimedb.cc:165
 hruntimedb.cc:166
 hruntimedb.cc:167
 hruntimedb.cc:168
 hruntimedb.cc:169
 hruntimedb.cc:170
 hruntimedb.cc:171
 hruntimedb.cc:172
 hruntimedb.cc:173
 hruntimedb.cc:174
 hruntimedb.cc:175
 hruntimedb.cc:176
 hruntimedb.cc:177
 hruntimedb.cc:178
 hruntimedb.cc:179
 hruntimedb.cc:180
 hruntimedb.cc:181
 hruntimedb.cc:182
 hruntimedb.cc:183
 hruntimedb.cc:184
 hruntimedb.cc:185
 hruntimedb.cc:186
 hruntimedb.cc:187
 hruntimedb.cc:188
 hruntimedb.cc:189
 hruntimedb.cc:190
 hruntimedb.cc:191
 hruntimedb.cc:192
 hruntimedb.cc:193
 hruntimedb.cc:194
 hruntimedb.cc:195
 hruntimedb.cc:196
 hruntimedb.cc:197
 hruntimedb.cc:198
 hruntimedb.cc:199
 hruntimedb.cc:200
 hruntimedb.cc:201
 hruntimedb.cc:202
 hruntimedb.cc:203
 hruntimedb.cc:204
 hruntimedb.cc:205
 hruntimedb.cc:206
 hruntimedb.cc:207
 hruntimedb.cc:208
 hruntimedb.cc:209
 hruntimedb.cc:210
 hruntimedb.cc:211
 hruntimedb.cc:212
 hruntimedb.cc:213
 hruntimedb.cc:214
 hruntimedb.cc:215
 hruntimedb.cc:216
 hruntimedb.cc:217
 hruntimedb.cc:218
 hruntimedb.cc:219
 hruntimedb.cc:220
 hruntimedb.cc:221
 hruntimedb.cc:222
 hruntimedb.cc:223
 hruntimedb.cc:224
 hruntimedb.cc:225
 hruntimedb.cc:226
 hruntimedb.cc:227
 hruntimedb.cc:228
 hruntimedb.cc:229
 hruntimedb.cc:230
 hruntimedb.cc:231
 hruntimedb.cc:232
 hruntimedb.cc:233
 hruntimedb.cc:234
 hruntimedb.cc:235
 hruntimedb.cc:236
 hruntimedb.cc:237
 hruntimedb.cc:238
 hruntimedb.cc:239
 hruntimedb.cc:240
 hruntimedb.cc:241
 hruntimedb.cc:242
 hruntimedb.cc:243
 hruntimedb.cc:244
 hruntimedb.cc:245
 hruntimedb.cc:246
 hruntimedb.cc:247
 hruntimedb.cc:248
 hruntimedb.cc:249
 hruntimedb.cc:250
 hruntimedb.cc:251
 hruntimedb.cc:252
 hruntimedb.cc:253
 hruntimedb.cc:254
 hruntimedb.cc:255
 hruntimedb.cc:256
 hruntimedb.cc:257
 hruntimedb.cc:258
 hruntimedb.cc:259
 hruntimedb.cc:260
 hruntimedb.cc:261
 hruntimedb.cc:262
 hruntimedb.cc:263
 hruntimedb.cc:264
 hruntimedb.cc:265
 hruntimedb.cc:266
 hruntimedb.cc:267
 hruntimedb.cc:268
 hruntimedb.cc:269
 hruntimedb.cc:270
 hruntimedb.cc:271
 hruntimedb.cc:272
 hruntimedb.cc:273
 hruntimedb.cc:274
 hruntimedb.cc:275
 hruntimedb.cc:276
 hruntimedb.cc:277
 hruntimedb.cc:278
 hruntimedb.cc:279
 hruntimedb.cc:280
 hruntimedb.cc:281
 hruntimedb.cc:282
 hruntimedb.cc:283
 hruntimedb.cc:284
 hruntimedb.cc:285
 hruntimedb.cc:286
 hruntimedb.cc:287
 hruntimedb.cc:288
 hruntimedb.cc:289
 hruntimedb.cc:290
 hruntimedb.cc:291
 hruntimedb.cc:292
 hruntimedb.cc:293
 hruntimedb.cc:294
 hruntimedb.cc:295
 hruntimedb.cc:296
 hruntimedb.cc:297
 hruntimedb.cc:298
 hruntimedb.cc:299
 hruntimedb.cc:300
 hruntimedb.cc:301
 hruntimedb.cc:302
 hruntimedb.cc:303
 hruntimedb.cc:304
 hruntimedb.cc:305
 hruntimedb.cc:306
 hruntimedb.cc:307
 hruntimedb.cc:308
 hruntimedb.cc:309
 hruntimedb.cc:310
 hruntimedb.cc:311
 hruntimedb.cc:312
 hruntimedb.cc:313
 hruntimedb.cc:314
 hruntimedb.cc:315
 hruntimedb.cc:316
 hruntimedb.cc:317
 hruntimedb.cc:318
 hruntimedb.cc:319
 hruntimedb.cc:320
 hruntimedb.cc:321
 hruntimedb.cc:322
 hruntimedb.cc:323
 hruntimedb.cc:324
 hruntimedb.cc:325
 hruntimedb.cc:326
 hruntimedb.cc:327
 hruntimedb.cc:328
 hruntimedb.cc:329
 hruntimedb.cc:330
 hruntimedb.cc:331
 hruntimedb.cc:332
 hruntimedb.cc:333
 hruntimedb.cc:334
 hruntimedb.cc:335
 hruntimedb.cc:336
 hruntimedb.cc:337
 hruntimedb.cc:338
 hruntimedb.cc:339
 hruntimedb.cc:340
 hruntimedb.cc:341
 hruntimedb.cc:342
 hruntimedb.cc:343
 hruntimedb.cc:344
 hruntimedb.cc:345
 hruntimedb.cc:346
 hruntimedb.cc:347
 hruntimedb.cc:348
 hruntimedb.cc:349
 hruntimedb.cc:350
 hruntimedb.cc:351
 hruntimedb.cc:352
 hruntimedb.cc:353
 hruntimedb.cc:354
 hruntimedb.cc:355
 hruntimedb.cc:356
 hruntimedb.cc:357
 hruntimedb.cc:358
 hruntimedb.cc:359
 hruntimedb.cc:360
 hruntimedb.cc:361
 hruntimedb.cc:362
 hruntimedb.cc:363
 hruntimedb.cc:364
 hruntimedb.cc:365
 hruntimedb.cc:366
 hruntimedb.cc:367
 hruntimedb.cc:368
 hruntimedb.cc:369
 hruntimedb.cc:370
 hruntimedb.cc:371
 hruntimedb.cc:372
 hruntimedb.cc:373
 hruntimedb.cc:374
 hruntimedb.cc:375
 hruntimedb.cc:376
 hruntimedb.cc:377
 hruntimedb.cc:378
 hruntimedb.cc:379
 hruntimedb.cc:380
 hruntimedb.cc:381
 hruntimedb.cc:382
 hruntimedb.cc:383
 hruntimedb.cc:384
 hruntimedb.cc:385
 hruntimedb.cc:386
 hruntimedb.cc:387
 hruntimedb.cc:388
 hruntimedb.cc:389
 hruntimedb.cc:390
 hruntimedb.cc:391
 hruntimedb.cc:392
 hruntimedb.cc:393
 hruntimedb.cc:394
 hruntimedb.cc:395
 hruntimedb.cc:396
 hruntimedb.cc:397
 hruntimedb.cc:398
 hruntimedb.cc:399
 hruntimedb.cc:400
 hruntimedb.cc:401
 hruntimedb.cc:402
 hruntimedb.cc:403
 hruntimedb.cc:404
 hruntimedb.cc:405
 hruntimedb.cc:406
 hruntimedb.cc:407
 hruntimedb.cc:408
 hruntimedb.cc:409
 hruntimedb.cc:410
 hruntimedb.cc:411
 hruntimedb.cc:412
 hruntimedb.cc:413
 hruntimedb.cc:414
 hruntimedb.cc:415
 hruntimedb.cc:416
 hruntimedb.cc:417
 hruntimedb.cc:418
 hruntimedb.cc:419
 hruntimedb.cc:420
 hruntimedb.cc:421
 hruntimedb.cc:422
 hruntimedb.cc:423
 hruntimedb.cc:424
 hruntimedb.cc:425
 hruntimedb.cc:426
 hruntimedb.cc:427
 hruntimedb.cc:428
 hruntimedb.cc:429
 hruntimedb.cc:430
 hruntimedb.cc:431
 hruntimedb.cc:432
 hruntimedb.cc:433
 hruntimedb.cc:434
 hruntimedb.cc:435
 hruntimedb.cc:436
 hruntimedb.cc:437
 hruntimedb.cc:438
 hruntimedb.cc:439
 hruntimedb.cc:440
 hruntimedb.cc:441
 hruntimedb.cc:442
 hruntimedb.cc:443
 hruntimedb.cc:444
 hruntimedb.cc:445
 hruntimedb.cc:446
 hruntimedb.cc:447
 hruntimedb.cc:448
 hruntimedb.cc:449
 hruntimedb.cc:450
 hruntimedb.cc:451
 hruntimedb.cc:452
 hruntimedb.cc:453
 hruntimedb.cc:454
 hruntimedb.cc:455
 hruntimedb.cc:456
 hruntimedb.cc:457
 hruntimedb.cc:458
 hruntimedb.cc:459
 hruntimedb.cc:460
 hruntimedb.cc:461
 hruntimedb.cc:462
 hruntimedb.cc:463
 hruntimedb.cc:464
 hruntimedb.cc:465
 hruntimedb.cc:466
 hruntimedb.cc:467
 hruntimedb.cc:468
 hruntimedb.cc:469
 hruntimedb.cc:470
 hruntimedb.cc:471
 hruntimedb.cc:472
 hruntimedb.cc:473
 hruntimedb.cc:474
 hruntimedb.cc:475
 hruntimedb.cc:476
 hruntimedb.cc:477
 hruntimedb.cc:478
 hruntimedb.cc:479
 hruntimedb.cc:480
 hruntimedb.cc:481
 hruntimedb.cc:482
 hruntimedb.cc:483
 hruntimedb.cc:484
 hruntimedb.cc:485
 hruntimedb.cc:486
 hruntimedb.cc:487
 hruntimedb.cc:488
 hruntimedb.cc:489
 hruntimedb.cc:490
 hruntimedb.cc:491
 hruntimedb.cc:492
 hruntimedb.cc:493
 hruntimedb.cc:494
 hruntimedb.cc:495
 hruntimedb.cc:496
 hruntimedb.cc:497
 hruntimedb.cc:498
 hruntimedb.cc:499
 hruntimedb.cc:500
 hruntimedb.cc:501
 hruntimedb.cc:502
 hruntimedb.cc:503
 hruntimedb.cc:504
 hruntimedb.cc:505
 hruntimedb.cc:506
 hruntimedb.cc:507
 hruntimedb.cc:508
 hruntimedb.cc:509
 hruntimedb.cc:510
 hruntimedb.cc:511
 hruntimedb.cc:512
 hruntimedb.cc:513
 hruntimedb.cc:514
 hruntimedb.cc:515
 hruntimedb.cc:516
 hruntimedb.cc:517
 hruntimedb.cc:518
 hruntimedb.cc:519
 hruntimedb.cc:520
 hruntimedb.cc:521
 hruntimedb.cc:522
 hruntimedb.cc:523
 hruntimedb.cc:524
 hruntimedb.cc:525
 hruntimedb.cc:526
 hruntimedb.cc:527
 hruntimedb.cc:528
 hruntimedb.cc:529
 hruntimedb.cc:530
 hruntimedb.cc:531
 hruntimedb.cc:532
 hruntimedb.cc:533
 hruntimedb.cc:534
 hruntimedb.cc:535
 hruntimedb.cc:536
 hruntimedb.cc:537
 hruntimedb.cc:538
 hruntimedb.cc:539
 hruntimedb.cc:540
 hruntimedb.cc:541
 hruntimedb.cc:542
 hruntimedb.cc:543
 hruntimedb.cc:544
 hruntimedb.cc:545
 hruntimedb.cc:546
 hruntimedb.cc:547
 hruntimedb.cc:548
 hruntimedb.cc:549
 hruntimedb.cc:550
 hruntimedb.cc:551
 hruntimedb.cc:552
 hruntimedb.cc:553
 hruntimedb.cc:554
 hruntimedb.cc:555
 hruntimedb.cc:556
 hruntimedb.cc:557
 hruntimedb.cc:558
 hruntimedb.cc:559
 hruntimedb.cc:560
 hruntimedb.cc:561
 hruntimedb.cc:562
 hruntimedb.cc:563
 hruntimedb.cc:564
 hruntimedb.cc:565
 hruntimedb.cc:566
 hruntimedb.cc:567
 hruntimedb.cc:568
 hruntimedb.cc:569
 hruntimedb.cc:570
 hruntimedb.cc:571
 hruntimedb.cc:572
 hruntimedb.cc:573
 hruntimedb.cc:574
 hruntimedb.cc:575
 hruntimedb.cc:576
 hruntimedb.cc:577
 hruntimedb.cc:578
 hruntimedb.cc:579
 hruntimedb.cc:580
 hruntimedb.cc:581
 hruntimedb.cc:582
 hruntimedb.cc:583
 hruntimedb.cc:584
 hruntimedb.cc:585
 hruntimedb.cc:586
 hruntimedb.cc:587
 hruntimedb.cc:588
 hruntimedb.cc:589
 hruntimedb.cc:590
 hruntimedb.cc:591
 hruntimedb.cc:592
 hruntimedb.cc:593
 hruntimedb.cc:594
 hruntimedb.cc:595
 hruntimedb.cc:596
 hruntimedb.cc:597
 hruntimedb.cc:598
 hruntimedb.cc:599
 hruntimedb.cc:600
 hruntimedb.cc:601
 hruntimedb.cc:602
 hruntimedb.cc:603
 hruntimedb.cc:604
 hruntimedb.cc:605
 hruntimedb.cc:606
 hruntimedb.cc:607
 hruntimedb.cc:608
 hruntimedb.cc:609
 hruntimedb.cc:610
 hruntimedb.cc:611
 hruntimedb.cc:612
 hruntimedb.cc:613
 hruntimedb.cc:614
 hruntimedb.cc:615
 hruntimedb.cc:616
 hruntimedb.cc:617
 hruntimedb.cc:618
 hruntimedb.cc:619
 hruntimedb.cc:620
 hruntimedb.cc:621
 hruntimedb.cc:622
 hruntimedb.cc:623
 hruntimedb.cc:624
 hruntimedb.cc:625
 hruntimedb.cc:626
 hruntimedb.cc:627
 hruntimedb.cc:628
 hruntimedb.cc:629
 hruntimedb.cc:630
 hruntimedb.cc:631
 hruntimedb.cc:632
 hruntimedb.cc:633
 hruntimedb.cc:634
 hruntimedb.cc:635
 hruntimedb.cc:636
 hruntimedb.cc:637
 hruntimedb.cc:638
 hruntimedb.cc:639
 hruntimedb.cc:640
 hruntimedb.cc:641
 hruntimedb.cc:642
 hruntimedb.cc:643
 hruntimedb.cc:644
 hruntimedb.cc:645
 hruntimedb.cc:646
 hruntimedb.cc:647
 hruntimedb.cc:648
 hruntimedb.cc:649
 hruntimedb.cc:650
 hruntimedb.cc:651
 hruntimedb.cc:652
 hruntimedb.cc:653
 hruntimedb.cc:654
 hruntimedb.cc:655
 hruntimedb.cc:656
 hruntimedb.cc:657
 hruntimedb.cc:658
 hruntimedb.cc:659
 hruntimedb.cc:660
 hruntimedb.cc:661
 hruntimedb.cc:662
 hruntimedb.cc:663
 hruntimedb.cc:664
 hruntimedb.cc:665
 hruntimedb.cc:666
 hruntimedb.cc:667
 hruntimedb.cc:668
 hruntimedb.cc:669
 hruntimedb.cc:670
 hruntimedb.cc:671
 hruntimedb.cc:672
 hruntimedb.cc:673
 hruntimedb.cc:674
 hruntimedb.cc:675
 hruntimedb.cc:676
 hruntimedb.cc:677
 hruntimedb.cc:678
 hruntimedb.cc:679
 hruntimedb.cc:680
 hruntimedb.cc:681
 hruntimedb.cc:682
 hruntimedb.cc:683
 hruntimedb.cc:684
 hruntimedb.cc:685
 hruntimedb.cc:686
 hruntimedb.cc:687
 hruntimedb.cc:688
 hruntimedb.cc:689
 hruntimedb.cc:690
 hruntimedb.cc:691
 hruntimedb.cc:692
 hruntimedb.cc:693
 hruntimedb.cc:694
 hruntimedb.cc:695
 hruntimedb.cc:696
 hruntimedb.cc:697
 hruntimedb.cc:698
 hruntimedb.cc:699
 hruntimedb.cc:700
 hruntimedb.cc:701
 hruntimedb.cc:702
 hruntimedb.cc:703
 hruntimedb.cc:704
 hruntimedb.cc:705
 hruntimedb.cc:706
 hruntimedb.cc:707
 hruntimedb.cc:708
 hruntimedb.cc:709
 hruntimedb.cc:710
 hruntimedb.cc:711
 hruntimedb.cc:712
 hruntimedb.cc:713
 hruntimedb.cc:714
 hruntimedb.cc:715
 hruntimedb.cc:716
 hruntimedb.cc:717
 hruntimedb.cc:718
 hruntimedb.cc:719
 hruntimedb.cc:720
 hruntimedb.cc:721
 hruntimedb.cc:722
 hruntimedb.cc:723
 hruntimedb.cc:724
 hruntimedb.cc:725
 hruntimedb.cc:726
 hruntimedb.cc:727
 hruntimedb.cc:728
 hruntimedb.cc:729
 hruntimedb.cc:730
 hruntimedb.cc:731
 hruntimedb.cc:732
 hruntimedb.cc:733
 hruntimedb.cc:734
 hruntimedb.cc:735
 hruntimedb.cc:736
 hruntimedb.cc:737
 hruntimedb.cc:738
 hruntimedb.cc:739
 hruntimedb.cc:740
 hruntimedb.cc:741
 hruntimedb.cc:742
 hruntimedb.cc:743
 hruntimedb.cc:744
 hruntimedb.cc:745
 hruntimedb.cc:746
 hruntimedb.cc:747
 hruntimedb.cc:748
 hruntimedb.cc:749
 hruntimedb.cc:750
 hruntimedb.cc:751
 hruntimedb.cc:752
 hruntimedb.cc:753
 hruntimedb.cc:754
 hruntimedb.cc:755
 hruntimedb.cc:756
 hruntimedb.cc:757
 hruntimedb.cc:758
 hruntimedb.cc:759
 hruntimedb.cc:760
 hruntimedb.cc:761
 hruntimedb.cc:762
 hruntimedb.cc:763
 hruntimedb.cc:764
 hruntimedb.cc:765
 hruntimedb.cc:766
 hruntimedb.cc:767
 hruntimedb.cc:768
 hruntimedb.cc:769
 hruntimedb.cc:770
 hruntimedb.cc:771
 hruntimedb.cc:772
 hruntimedb.cc:773
 hruntimedb.cc:774
 hruntimedb.cc:775
 hruntimedb.cc:776
 hruntimedb.cc:777
 hruntimedb.cc:778
 hruntimedb.cc:779
 hruntimedb.cc:780
 hruntimedb.cc:781
 hruntimedb.cc:782
 hruntimedb.cc:783
 hruntimedb.cc:784
 hruntimedb.cc:785
 hruntimedb.cc:786
 hruntimedb.cc:787
 hruntimedb.cc:788
 hruntimedb.cc:789
 hruntimedb.cc:790
 hruntimedb.cc:791
 hruntimedb.cc:792
 hruntimedb.cc:793
 hruntimedb.cc:794
 hruntimedb.cc:795
 hruntimedb.cc:796
 hruntimedb.cc:797
 hruntimedb.cc:798
 hruntimedb.cc:799
 hruntimedb.cc:800
 hruntimedb.cc:801
 hruntimedb.cc:802
 hruntimedb.cc:803
 hruntimedb.cc:804
 hruntimedb.cc:805
 hruntimedb.cc:806
 hruntimedb.cc:807
 hruntimedb.cc:808
 hruntimedb.cc:809
 hruntimedb.cc:810
 hruntimedb.cc:811
 hruntimedb.cc:812
 hruntimedb.cc:813
 hruntimedb.cc:814
 hruntimedb.cc:815
 hruntimedb.cc:816
 hruntimedb.cc:817
 hruntimedb.cc:818
 hruntimedb.cc:819
 hruntimedb.cc:820
 hruntimedb.cc:821
 hruntimedb.cc:822
 hruntimedb.cc:823
 hruntimedb.cc:824
 hruntimedb.cc:825
 hruntimedb.cc:826
 hruntimedb.cc:827
 hruntimedb.cc:828
 hruntimedb.cc:829
 hruntimedb.cc:830
 hruntimedb.cc:831
 hruntimedb.cc:832
 hruntimedb.cc:833
 hruntimedb.cc:834
 hruntimedb.cc:835
 hruntimedb.cc:836
 hruntimedb.cc:837
 hruntimedb.cc:838
 hruntimedb.cc:839
 hruntimedb.cc:840
 hruntimedb.cc:841
 hruntimedb.cc:842
 hruntimedb.cc:843
 hruntimedb.cc:844
 hruntimedb.cc:845
 hruntimedb.cc:846
 hruntimedb.cc:847
 hruntimedb.cc:848
 hruntimedb.cc:849
 hruntimedb.cc:850
 hruntimedb.cc:851
 hruntimedb.cc:852
 hruntimedb.cc:853
 hruntimedb.cc:854
 hruntimedb.cc:855
 hruntimedb.cc:856
 hruntimedb.cc:857
 hruntimedb.cc:858
 hruntimedb.cc:859
 hruntimedb.cc:860
 hruntimedb.cc:861
 hruntimedb.cc:862
 hruntimedb.cc:863
 hruntimedb.cc:864
 hruntimedb.cc:865
 hruntimedb.cc:866
 hruntimedb.cc:867
 hruntimedb.cc:868
 hruntimedb.cc:869
 hruntimedb.cc:870
 hruntimedb.cc:871
 hruntimedb.cc:872
 hruntimedb.cc:873
 hruntimedb.cc:874
 hruntimedb.cc:875
 hruntimedb.cc:876
 hruntimedb.cc:877
 hruntimedb.cc:878
 hruntimedb.cc:879
 hruntimedb.cc:880