| 129 |
Float_t winy = (float)hw*0.80; // 95 |
Float_t winy = (float)hw*0.80; // 95 |
| 130 |
Float_t winrap = winx/winy; |
Float_t winrap = winx/winy; |
| 131 |
// |
// |
| 132 |
|
// |
| 133 |
|
// |
| 134 |
|
TString plugindir = (TString)gSystem->ExpandPathName("$FEV_PLUGIN"); |
| 135 |
|
if ( strcmp(plugindir,"$FEV_PLUGIN") ){ |
| 136 |
|
TString wdir = gSystem->WorkingDirectory(); |
| 137 |
|
printf("\n\n Plugin directory is %s \n",plugindir.Data()); |
| 138 |
|
printf(" Loading plugins: \n"); |
| 139 |
|
// |
| 140 |
|
TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(plugindir),plugindir); |
| 141 |
|
TList *temp = datadir->GetListOfFiles(); |
| 142 |
|
TIter next(temp); |
| 143 |
|
TSystemFile *questo = 0; |
| 144 |
|
Int_t npl = 0; |
| 145 |
|
while ( (questo = (TSystemFile*) next()) ) { |
| 146 |
|
TString name = questo->GetName(); |
| 147 |
|
if( name.EndsWith(".so") || name.EndsWith(".o") ){ |
| 148 |
|
npl++; |
| 149 |
|
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(plugindir),gSystem->BaseName(name)); |
| 150 |
|
gSystem->Load(fullpath); |
| 151 |
|
printf(" %i -> %s plugin loaded \n",npl,name.Data()); |
| 152 |
|
delete fullpath; |
| 153 |
|
}; |
| 154 |
|
} |
| 155 |
|
delete temp; |
| 156 |
|
delete datadir; |
| 157 |
|
}; |
| 158 |
|
// |
| 159 |
// book the canvas |
// book the canvas |
| 160 |
// |
// |
| 161 |
TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy); |
TCanvas *figure = new TCanvas("PAMELA event viewer", "PAMELA event viewer",(int)winx,(int)winy); |
| 325 |
// |
// |
| 326 |
// load the structure header |
// load the structure header |
| 327 |
// |
// |
| 328 |
carica.str(""); |
carica.str(""); |
| 329 |
carica << paminc.str().c_str() << "/feventvstruct.h"; |
carica << paminc.str().c_str() << "/feventvstruct.h"; |
| 330 |
gROOT->LoadMacro(carica.str().c_str()); |
gROOT->LoadMacro(carica.str().c_str()); |
| 331 |
// carica.str(""); |
// carica.str(""); |
| 332 |
// carica << paminc.str().c_str() << "/CaloNuclei.h"; |
// carica << paminc.str().c_str() << "/CaloNuclei.h"; |
| 333 |
// gROOT->LoadMacro(carica.str().c_str()); |
// gROOT->LoadMacro(carica.str().c_str()); |
| 396 |
// |
// |
| 397 |
// ok, open file and determine if it is a YODA or DARTHVADER file |
// ok, open file and determine if it is a YODA or DARTHVADER file |
| 398 |
// |
// |
| 399 |
|
|
| 400 |
headerFile=new TFile(filename.Data()); |
headerFile=new TFile(filename.Data()); |
| 401 |
if ( FORCELEV == 0 ){ |
if ( FORCELEV == 0 ){ |
| 402 |
pamela->level.file = 0; |
pamela->level.file = 0; |
| 403 |
L0 = (TTree*)headerFile->Get("Physics"); |
L0 = (TTree*)headerFile->Get("Physics"); |
| 404 |
if ( !L0 ){ |
if ( !L0 ){ |
| 478 |
goto refresh; |
goto refresh; |
| 479 |
}; |
}; |
| 480 |
}; |
}; |
| 481 |
|
headerFile->Close("R"); |
| 482 |
// |
// |
| 483 |
if ( pamela->level.file != 2 ){ |
if ( pamela->level.file != 2 ){ |
| 484 |
printf(" This is a YODA (level0) file \n"); |
printf(" This is a YODA (level0) file \n"); |
| 493 |
// Load the file |
// Load the file |
| 494 |
// |
// |
| 495 |
if ( otr0 || L0 ){ |
if ( otr0 || L0 ){ |
| 496 |
otr = pamela->Load(*headerFile); |
otr = pamela->Load(filename.Data()); |
| 497 |
if ( !otr ){ |
if ( !otr ){ |
| 498 |
pamela->level.file = -1; |
pamela->level.file = -1; |
| 499 |
printf("ERROR: problems opening file...\n"); |
printf("ERROR: problems opening file...\n"); |
| 513 |
// |
// |
| 514 |
// get the number of entries |
// get the number of entries |
| 515 |
// |
// |
|
// otr = pamela->GetChain(); |
|
| 516 |
if ( !otr ) printf(" AGH! \n"); |
if ( !otr ) printf(" AGH! \n"); |
| 517 |
// |
// |
| 518 |
Long64_t nevents = otr->GetEntries(); |
Long64_t nevents = otr->GetEntries(); |
| 521 |
// check we have at least one event |
// check we have at least one event |
| 522 |
// |
// |
| 523 |
if (nevents<=0) { |
if (nevents<=0) { |
| 524 |
headerFile->Close(); |
// headerFile->Close(); |
| 525 |
printf("The file is empty, exiting...\n"); |
printf("The file is empty, exiting...\n"); |
| 526 |
pamgui->DIALOG(0," The file contains no physics data! "); |
pamgui->DIALOG(0," The file contains no physics data! "); |
| 527 |
pamela->var.waitforever = true; |
pamela->var.waitforever = true; |
| 657 |
if ( pamela->GetL2() ) pamela->GetL2()->Reset(); |
if ( pamela->GetL2() ) pamela->GetL2()->Reset(); |
| 658 |
if ( pamela->level.file != 2 ) pamela->GetChain()->Delete(); |
if ( pamela->level.file != 2 ) pamela->GetChain()->Delete(); |
| 659 |
otr = NULL; |
otr = NULL; |
| 660 |
if ( headerFile ) headerFile->Close("R"); |
// if ( headerFile ) headerFile->Close("R"); |
| 661 |
if ( pamela->var.refresh ) goto refresh; |
if ( pamela->var.refresh ) goto refresh; |
| 662 |
if ( pamela->var.restart ){ |
if ( pamela->var.restart ){ |
| 663 |
filename = pamela->var.thefilename.Data(); |
filename = pamela->var.thefilename.Data(); |