6 |
// |
// |
7 |
// ROOT headers |
// ROOT headers |
8 |
// |
// |
9 |
|
#include <TTimeStamp.h> |
10 |
#include <TString.h> |
#include <TString.h> |
11 |
#include <TSQLServer.h> |
#include <TSQLServer.h> |
12 |
#include <TFile.h> |
#include <TFile.h> |
588 |
// Start: |
// Start: |
589 |
// |
// |
590 |
printf("\n Welcome to the PAMELA LEVEL2 flight software, version %s (The Ultimate Warrior)\n\n",version.Data()); |
printf("\n Welcome to the PAMELA LEVEL2 flight software, version %s (The Ultimate Warrior)\n\n",version.Data()); |
591 |
if ( run ) printf("\n Processing run number %u \n\n",run); |
if ( run ){ |
592 |
|
printf("\n Processing run number %u \n",run); |
593 |
|
} else { |
594 |
|
printf("\n Re-processing all runs?\n"); |
595 |
|
} |
596 |
// |
// |
597 |
// Connect to the DB |
// Connect to the DB |
598 |
// |
// |
610 |
glt = new GL_TABLES(host,user,psw); |
glt = new GL_TABLES(host,user,psw); |
611 |
//GL_TABLES *glt = new GL_TABLES(host,user,psw); |
//GL_TABLES *glt = new GL_TABLES(host,user,psw); |
612 |
// |
// |
613 |
|
printf("\n DB settings:\n SQL: %s Version: %s Host %s Port %i \n",dbc->GetDBMS(),dbc->ServerInfo(),dbc->GetHost(),dbc->GetPort()); |
614 |
|
printf(" DB %s --- User %s \n\n",host.Data(),user.Data()); |
615 |
if ( debug ) printf("\n DB INFORMATIONS:\n SQL: %s Version: %s Host %s Port %i \n\n",dbc->GetDBMS(),dbc->ServerInfo(),dbc->GetHost(),dbc->GetPort()); |
if ( debug ) printf("\n DB INFORMATIONS:\n SQL: %s Version: %s Host %s Port %i \n\n",dbc->GetDBMS(),dbc->ServerInfo(),dbc->GetHost(),dbc->GetPort()); |
616 |
// |
// |
617 |
// Use UTC in the DB |
// Use UTC in the DB |
653 |
TTree::SetMaxTreeSize(maxsize); |
TTree::SetMaxTreeSize(maxsize); |
654 |
processFile->SetCompressionLevel(1); |
processFile->SetCompressionLevel(1); |
655 |
// |
// |
656 |
|
// ok, we are going to do some kinf of processing, the file is opened and ready. Save processing infos first |
657 |
|
// |
658 |
|
ProcInfo *procinfo = new ProcInfo(); |
659 |
|
procinfo->runID = run; |
660 |
|
TTimeStamp *dt = new TTimeStamp(); |
661 |
|
procinfo->date = dt->AsString(); |
662 |
|
delete dt; |
663 |
|
for ( Int_t icl = 0; icl<numinp; icl++){ |
664 |
|
procinfo->commandLine += Form("%s ",inps[icl]); |
665 |
|
} |
666 |
|
procinfo->outputFilename = filename; |
667 |
|
procinfo->localDir = gSystem->WorkingDirectory(); |
668 |
|
procinfo->uname = gSystem->GetFromPipe("uname -a"); |
669 |
|
procinfo->DB = host; |
670 |
|
|
671 |
|
TTree *pinfo = 0; |
672 |
|
pinfo = (TTree*)processFile->Get("ProcessingInfo"); |
673 |
|
// ProcessingInfo tree does not exist, crating proc info |
674 |
|
if ( !pinfo ){ |
675 |
|
if ( debug ) printf("ProcessingInfo tree does not exist, crating proc info\n"); |
676 |
|
pinfo = new TTree("ProcessingInfo","Log of data processing"); |
677 |
|
pinfo->Branch("ProcInfo","ProcInfo",&procinfo); |
678 |
|
} else { |
679 |
|
pinfo->SetBranchAddress("ProcInfo",&procinfo); |
680 |
|
} |
681 |
|
pinfo->Fill(); |
682 |
|
processFile->cd(); |
683 |
|
pinfo->Write("ProcessingInfo",TObject::kOverwrite); |
684 |
|
if ( procinfo ) delete procinfo; |
685 |
|
if ( pinfo ) pinfo->Delete(); |
686 |
// |
// |
687 |
// Run the core program, put any output error in the "error" variable |
// Run the core program, put any output error in the "error" variable |
688 |
// |
// |