Commit fb60704c authored by Jérémie Dudouet's avatar Jérémie Dudouet Committed by Jérémie Dudouet
Browse files

up check run

parent 0ee77083
......@@ -159,7 +159,7 @@ void FSMainWindow::LoadRightSide()
fStatusBar->Draw3DCorner(kFALSE);
fVFRight->AddFrame(fStatusBar, new TGLayoutHints(kLHintsBottom | kLHintsLeft | kLHintsExpandX, 0, 0, 2, 0));
// NewTab();
// NewTab();
}
void FSMainWindow::NewTab(TString name, Int_t npx, Int_t npy)
......@@ -596,14 +596,19 @@ void FSMainWindow::ReadHistograms()
TString Buffer;
string line;
TObjArray *arr;
Int_t test=0;
Bool_t ok=false;
while(ok == false && test<10) {
if(!file) file.open(FileName.Data());
Int_t NHistRead = 0;
getline(file,line);getline(file,line);getline(file,line);
Buffer=line;
Buffer.ReplaceAll("FIPPintern ","");
while(Buffer.EndsWith(" ")) Buffer.Remove(Buffer.Length()-1);
//fCurrentDate = Buffer;
TObjArray *arr;
while(file) {
getline(file,line);Buffer=line;
......@@ -613,7 +618,8 @@ void FSMainWindow::ReadHistograms()
arr = Buffer.ReplaceAll("\t"," ").Tokenize(" ");
Int_t adc = ((TString)arr->First()->GetName()).Atoi()-1;
delete arr;
if(!fDetectors[adc]) continue;
if(fDetectors.count(adc)==0) continue;
getline(file,line);getline(file,line);Buffer=line;
arr = Buffer.Tokenize(" ");
Int_t NBins = ((TString)arr->First()->GetName()).Atoi();
......@@ -660,12 +666,19 @@ void FSMainWindow::ReadHistograms()
}
}
TString HistName = Form("Hist_%s_%d",fNames[type].Data(),DetNum);
if(!fListOfSpectra[id]) fListOfSpectra[id] = new TH1I(HistName,HistName,NBins,0,NBins);
if(fListOfSpectra.count(id)==0) fListOfSpectra[id] = new TH1I(HistName,HistName,NBins,0,NBins);
memcpy(((TH1I*)fListOfSpectra[id])->fArray,Array,sizeof(Array));
fListOfSpectra[id]->SetEntries(fListOfSpectra[id]->Integral());
NHistRead++;
}
if(NHistRead == fDetectors.size()) ok = true;
else {
test++;
WARN_MESS<<"Unable to read the full file, retry "<<test<<endl;
}
file.close();
}
fLastRun = Run;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment