--- chewbacca/PamOffLineSW/PacketUser.cpp 2008/12/18 12:58:37 1.3 +++ chewbacca/PamOffLineSW/PacketUser.cpp 2008/12/22 16:50:10 1.5 @@ -1,5 +1,5 @@ //============================================================================ -// $Id: PacketUser.cpp,v 1.69 2008-10-27 10:41:27 messineo Exp $ +// $Id: PacketUser.cpp,v 1.4 2008/12/18 14:46:56 mocchiut Exp $ // Description : //============================================================================ #include "PacketUser.h" @@ -243,7 +243,7 @@ //starts a new root file void PacketUser::StartGroup() { - pRun = new PamelaRun(rootfilename, outDir, multiFile, compression); + pRun = new PamelaRun(rootfilename, gSystem->ExpandPathName(outDir), multiFile, compression); // EMI strcat(rootfilename,".root"); reader->Init(pRun); stringstream oss; @@ -524,7 +524,7 @@ if((!real_time_init)&&(!real_time_last)) { //saved in another table for future study - if(saveROOT_DB(Table_ROOT_Bad, outDir, + if(saveROOT_DB(Table_ROOT_Bad, outDir,// here outDir is good, no expand EMI filename, pkt_number_init, pkt_number_last, obt_init, obt_last, @@ -559,7 +559,7 @@ if(boot_number==0) boot_number=boot_number_prevvalue; - if(saveROOT_DB(Table_ROOT_Good, outDir, + if(saveROOT_DB(Table_ROOT_Good, outDir, // here outDir is good, no expand EMI filename, pkt_number_init, pkt_number_last, obt_init, obt_last, @@ -614,7 +614,7 @@ << bad_pkt <<"','" << bad_pkt_read <<"','"<< bad_pkt_CalRead <<"','"<< num_PKT_Saved<<"','" << nome_input <<"'," <<"NULL,"<<_time_is_estimated<< - ")"; + ");"; string msg = oss.str(); mainLogUtil->logAll(msg); @@ -664,7 +664,8 @@ return; for (int i = 0; iQuery(query.c_str()); if(!res) @@ -676,12 +677,13 @@ } } -for (int i = 0; iQuery(query.c_str()); + if(!res) + { oss1<<"DBError UNABLE to: "<logError(msg1); @@ -935,7 +937,8 @@ } else if(type_rel == BIGGER){ //marco_new: ok anche se coincidenti etc - oss << "DELETE FROM "<< table_name <<" WHERE ID_N ="<< ID_record<<";"; + // oss << "DELETE FROM "<< table_name <<" WHERE ID_N ="<< ID_record<<";"; // EMILIANO + oss << "UPDATE "<< table_name <<" SET GOOD=0 WHERE ID_N ="<< ID_record<<";"; // EMILIANO DO NOT DELETE FROM ROOT_TABLE_MERGING JUST SET GOOD FLAG TO ZERO mainLogUtil->logInfo("Record deleted from merging table"); } else @@ -972,13 +975,13 @@ query.str(""); if(type_rel == AFTER) - query<<"select * from "< "<< mtime_init <<" and REAL_TIME_LAST <= "<< mtime_last <<" and REAL_TIME_INIT < "<< mtime_init; + query<<"select * from "< "<< mtime_init <<" and REAL_TIME_LAST <= "<< mtime_last <<" and REAL_TIME_INIT < "<< mtime_init; // EMI else if(type_rel == BEFORE) - query<<"select * from "<= "<< mtime_init <<" and REAL_TIME_INIT < "<< mtime_last <<" and REAL_TIME_LAST > "<< mtime_last; + query<<"select * from "<= "<< mtime_init <<" and REAL_TIME_INIT < "<< mtime_last <<" and REAL_TIME_LAST > "<< mtime_last; // EMI else if(type_rel == SMALLER) - query<<"select * from "< "<< mtime_last; + query<<"select * from "< "<< mtime_last; // EMI else if(type_rel == BIGGER) - query<<"select * from "<= "<< mtime_init <<" and REAL_TIME_LAST <= "<< mtime_last; + query<<"select * from "<= "<< mtime_init <<" and REAL_TIME_LAST <= "<< mtime_last; // EMI else return 0; @@ -1232,7 +1235,7 @@ { char fno[80]=""; ofstream fout; - sprintf(fno,"%s/pkt%d_of_%s.pkt", outDir, numPKTSaved, nomefile); + sprintf(fno,"%s/pkt%d_of_%s.pkt", gSystem->ExpandPathName(outDir), numPKTSaved, nomefile); // EMI if(append==true) fout.open(fno, ios::binary | ios::app); @@ -1252,11 +1255,11 @@ ofstream fout; if(append==true) { - sprintf(fno,"%s/packets.pkt", outDir); + sprintf(fno,"%s/packets.pkt", gSystem->ExpandPathName(outDir)); // EMI fout.open(fno, ios::binary | ios::app); } else{ - sprintf(fno,"%s/packet%d.pkt", outDir, numPKT ); + sprintf(fno,"%s/packet%d.pkt", gSystem->ExpandPathName(outDir), numPKT ); // EMI fout.open(fno, ios::binary); }