| 29 |
#include <stdlib.h> |
#include <stdlib.h> |
| 30 |
#include <math.h> |
#include <math.h> |
| 31 |
// |
// |
| 32 |
|
// RunInfo header |
| 33 |
|
// |
| 34 |
|
#include <RunInfo.h> |
| 35 |
|
#include <GLTables.h> |
| 36 |
|
// |
| 37 |
// YODA headers |
// YODA headers |
| 38 |
// |
// |
| 39 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
| 43 |
#include <CalibS4Event.h> |
#include <CalibS4Event.h> |
| 44 |
#include <physics/S4/S4Event.h> |
#include <physics/S4/S4Event.h> |
| 45 |
//#include <yodaUtility.h> |
//#include <yodaUtility.h> |
| 46 |
// |
|
|
// RunInfo header |
|
|
// |
|
|
#include <RunInfo.h> |
|
|
#include <GLTables.h> |
|
| 47 |
// |
// |
| 48 |
// This program headers |
// This program headers |
| 49 |
// |
// |
| 73 |
// |
// |
| 74 |
GL_S4_CALIB *glS4calib = new GL_S4_CALIB(); |
GL_S4_CALIB *glS4calib = new GL_S4_CALIB(); |
| 75 |
// |
// |
| 76 |
|
if ( !dbc->IsConnected() ) throw -504; |
| 77 |
glS4calib->Query_GL_S4_CALIB(atime, dbc); |
glS4calib->Query_GL_S4_CALIB(atime, dbc); |
| 78 |
// |
// |
| 79 |
GL_ROOT *glroot = new GL_ROOT(); |
GL_ROOT *glroot = new GL_ROOT(); |
| 80 |
|
if ( !dbc->IsConnected() ) throw -504; |
| 81 |
glroot->Query_GL_ROOT(glS4calib->ID_ROOT_L0,dbc); |
glroot->Query_GL_ROOT(glS4calib->ID_ROOT_L0,dbc); |
| 82 |
// |
// |
| 83 |
stringstream ftmpname; |
stringstream ftmpname; |
| 199 |
// |
// |
| 200 |
// variables needed to reprocess data |
// variables needed to reprocess data |
| 201 |
// |
// |
| 202 |
|
Long64_t maxsize = 10000000000LL; |
| 203 |
|
TTree::SetMaxTreeSize(maxsize); |
| 204 |
|
// |
| 205 |
TString S4version; |
TString S4version; |
| 206 |
ItoRunInfo *runinfo = 0; |
ItoRunInfo *runinfo = 0; |
| 207 |
TArrayI *runlist = 0; |
TArrayI *runlist = 0; |
| 347 |
// |
// |
| 348 |
// tree exists, we are reprocessing data. Are we reprocessing a single run or all the file? |
// tree exists, we are reprocessing data. Are we reprocessing a single run or all the file? |
| 349 |
// |
// |
| 350 |
|
S4trclone->SetAutoSave(900000000000000LL); |
| 351 |
reproc = true; |
reproc = true; |
| 352 |
// |
// |
| 353 |
// update versioning information |
// update versioning information |
| 392 |
// |
// |
| 393 |
file->cd(); |
file->cd(); |
| 394 |
S4tr = new TTree("S4-new","PAMELA Level2 S4 data"); |
S4tr = new TTree("S4-new","PAMELA Level2 S4 data"); |
| 395 |
|
S4tr->SetAutoSave(900000000000000LL); |
| 396 |
S4tr->Branch("S4Level2","S4Level2",&s4); |
S4tr->Branch("S4Level2","S4Level2",&s4); |
| 397 |
// |
// |
| 398 |
if ( reproc && !reprocall ){ |
if ( reproc && !reprocall ){ |
| 401 |
// |
// |
| 402 |
tempfile = new TFile(tempname.str().c_str(),"READ"); |
tempfile = new TFile(tempname.str().c_str(),"READ"); |
| 403 |
S4trclone = (TTree*)tempfile->Get("S4-old"); |
S4trclone = (TTree*)tempfile->Get("S4-old"); |
| 404 |
|
S4trclone->SetAutoSave(900000000000000LL); |
| 405 |
S4trclone->SetBranchAddress("S4Level2",&s4clone); |
S4trclone->SetBranchAddress("S4Level2",&s4clone); |
| 406 |
// |
// |
| 407 |
if ( nobefrun > 0 ){ |
if ( nobefrun > 0 ){ |
| 470 |
// |
// |
| 471 |
// prepare the timesync for the db |
// prepare the timesync for the db |
| 472 |
// |
// |
| 473 |
|
if ( !dbc->IsConnected() ) throw -504; |
| 474 |
dbtime = new GL_TIMESYNC(runinfo->ID_ROOT_L0,"ID",dbc); |
dbtime = new GL_TIMESYNC(runinfo->ID_ROOT_L0,"ID",dbc); |
| 475 |
// |
// |
| 476 |
// Search in the DB the path and name of the LEVEL0 file to be processed. |
// Search in the DB the path and name of the LEVEL0 file to be processed. |
| 477 |
// |
// |
| 478 |
|
if ( !dbc->IsConnected() ) throw -504; |
| 479 |
glroot->Query_GL_ROOT(runinfo->ID_ROOT_L0,dbc); |
glroot->Query_GL_ROOT(runinfo->ID_ROOT_L0,dbc); |
| 480 |
// |
// |
| 481 |
ftmpname.str(""); |
ftmpname.str(""); |