some more work towards musrt0
This commit is contained in:
parent
e35c2256be
commit
99ccb9e0ae
@ -79,12 +79,15 @@ PMusrT0::PMusrT0()
|
|||||||
* \param rawRunData
|
* \param rawRunData
|
||||||
* \param histoNo
|
* \param histoNo
|
||||||
*/
|
*/
|
||||||
PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag)
|
PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag, int addRunNo)
|
||||||
{
|
{
|
||||||
cout << endl << "run Name = " << rawRunData->fRunName.Data() << ", histoNo = " << histoNo << endl;
|
cout << endl << "run Name = " << rawRunData->fRunName.Data() << ", histoNo = " << histoNo << endl;
|
||||||
|
|
||||||
|
fStatus = 0; // default is quit locally
|
||||||
|
|
||||||
fRunNo = runNo;
|
fRunNo = runNo;
|
||||||
fDetectorTag = detectorTag;
|
fDetectorTag = detectorTag;
|
||||||
|
fAddRunNo = addRunNo;
|
||||||
|
|
||||||
TString str = rawRunData->fRunName + TString(" : ");
|
TString str = rawRunData->fRunName + TString(" : ");
|
||||||
str += histoNo;
|
str += histoNo;
|
||||||
@ -92,7 +95,7 @@ PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTa
|
|||||||
// feed necessary objects
|
// feed necessary objects
|
||||||
|
|
||||||
// feed raw data histo
|
// feed raw data histo
|
||||||
Int_t noOfBins = rawRunData->fDataBin[histoNo].size();
|
Int_t noOfBins = rawRunData->fDataBin[histoNo-1].size();
|
||||||
Double_t start = -0.5;
|
Double_t start = -0.5;
|
||||||
Double_t end = noOfBins + 0.5;
|
Double_t end = noOfBins + 0.5;
|
||||||
fHisto = new TH1F("fHisto", str.Data(), noOfBins, start, end);
|
fHisto = new TH1F("fHisto", str.Data(), noOfBins, start, end);
|
||||||
@ -100,12 +103,13 @@ PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTa
|
|||||||
fHisto->SetMarkerSize(0.5);
|
fHisto->SetMarkerSize(0.5);
|
||||||
fHisto->SetMarkerColor(TColor::GetColor(0,0,0)); // black
|
fHisto->SetMarkerColor(TColor::GetColor(0,0,0)); // black
|
||||||
|
|
||||||
for (unsigned int i=0; i<rawRunData->fDataBin[histoNo].size(); i++) {
|
for (unsigned int i=0; i<rawRunData->fDataBin[histoNo-1].size(); i++) {
|
||||||
fHisto->SetBinContent(i+1, rawRunData->fDataBin[histoNo][i]);
|
fHisto->SetBinContent(i+1, rawRunData->fDataBin[histoNo-1][i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate canvas etc
|
// generate canvas etc
|
||||||
fMainCanvas = new TCanvas("fMainCanvas", str);
|
fMainCanvas = new TCanvas("fMainCanvas", str);
|
||||||
|
fMainCanvas->SetFillColor(TColor::GetColor(255,255,255));
|
||||||
|
|
||||||
// add canvas menu
|
// add canvas menu
|
||||||
fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp();
|
fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp();
|
||||||
@ -127,14 +131,13 @@ PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTa
|
|||||||
fBar->Layout();
|
fBar->Layout();
|
||||||
fPopupMain->Connect("TGPopupMenu", "Activated(Int_t)", "PMusrT0", this, "HandleMenuPopup(Int_t)");
|
fPopupMain->Connect("TGPopupMenu", "Activated(Int_t)", "PMusrT0", this, "HandleMenuPopup(Int_t)");
|
||||||
|
|
||||||
fMainCanvas->cd();
|
|
||||||
fMainCanvas->Show();
|
fMainCanvas->Show();
|
||||||
|
|
||||||
fMainCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "PMusrT0",
|
fMainCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", "PMusrT0",
|
||||||
this, "HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
|
this, "HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
|
||||||
|
|
||||||
// draw histos etc
|
// draw histos etc
|
||||||
fHisto->Draw("p0 hist");
|
fHisto->Draw("p0 9 hist");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -145,10 +148,6 @@ PMusrT0::PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTa
|
|||||||
*/
|
*/
|
||||||
PMusrT0::~PMusrT0()
|
PMusrT0::~PMusrT0()
|
||||||
{
|
{
|
||||||
if (fMainCanvas) {
|
|
||||||
delete fMainCanvas;
|
|
||||||
fMainCanvas = 0;
|
|
||||||
}
|
|
||||||
if (fHisto) {
|
if (fHisto) {
|
||||||
delete fHisto;
|
delete fHisto;
|
||||||
fHisto = 0;
|
fHisto = 0;
|
||||||
@ -161,6 +160,30 @@ PMusrT0::~PMusrT0()
|
|||||||
delete fBkg;
|
delete fBkg;
|
||||||
fBkg = 0;
|
fBkg = 0;
|
||||||
}
|
}
|
||||||
|
if (fT0Line) {
|
||||||
|
delete fT0Line;
|
||||||
|
fT0Line = 0;
|
||||||
|
}
|
||||||
|
if (fFirstBkgLine) {
|
||||||
|
delete fFirstBkgLine;
|
||||||
|
fFirstBkgLine = 0;
|
||||||
|
}
|
||||||
|
if (fLastBkgLine) {
|
||||||
|
delete fLastBkgLine;
|
||||||
|
fLastBkgLine = 0;
|
||||||
|
}
|
||||||
|
if (fFirstDataLine) {
|
||||||
|
delete fFirstDataLine;
|
||||||
|
fFirstDataLine = 0;
|
||||||
|
}
|
||||||
|
if (fLastDataLine) {
|
||||||
|
delete fLastDataLine;
|
||||||
|
fLastDataLine = 0;
|
||||||
|
}
|
||||||
|
if (fMainCanvas) {
|
||||||
|
delete fMainCanvas;
|
||||||
|
fMainCanvas = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -187,18 +210,15 @@ void PMusrT0::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
|||||||
if (event != kKeyPress)
|
if (event != kKeyPress)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// cout << ">this " << this << endl;
|
|
||||||
// cout << ">fMainCanvas " << fMainCanvas << endl;
|
|
||||||
// cout << ">selected " << selected << endl;
|
|
||||||
//
|
|
||||||
//cout << "x : " << (char)x << endl;
|
|
||||||
//cout << "px: " << (char)fMainCanvas->GetEventX() << endl;
|
|
||||||
|
|
||||||
// handle keys and popup menu entries
|
// handle keys and popup menu entries
|
||||||
if (x == 'q') { // quit
|
if (x == 'q') { // quit
|
||||||
|
fStatus = 0; // will quit locally
|
||||||
|
Done(0);
|
||||||
|
} else if (x == 'Q') { // terminate musrt0
|
||||||
|
fStatus = 1; // will quit globally
|
||||||
Done(0);
|
Done(0);
|
||||||
} else if (x == 'u') { // unzoom to the original range
|
} else if (x == 'u') { // unzoom to the original range
|
||||||
cout << endl << "will unzoom ..." << endl;
|
UnZoom();
|
||||||
} else if (x == 't') { // set t0 channel
|
} else if (x == 't') { // set t0 channel
|
||||||
cout << endl << "will set t0 channel ..." << endl;
|
cout << endl << "will set t0 channel ..." << endl;
|
||||||
} else if (x == 'b') { // set first background channel
|
} else if (x == 'b') { // set first background channel
|
||||||
@ -221,6 +241,23 @@ void PMusrT0::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
|||||||
*/
|
*/
|
||||||
void PMusrT0::HandleMenuPopup(Int_t id)
|
void PMusrT0::HandleMenuPopup(Int_t id)
|
||||||
{
|
{
|
||||||
|
switch (id) {
|
||||||
|
case P_MENU_ID_T0:
|
||||||
|
break;
|
||||||
|
case P_MENU_ID_FIRST_BKG_CHANNEL:
|
||||||
|
break;
|
||||||
|
case P_MENU_ID_LAST_BKG_CHANNEL:
|
||||||
|
break;
|
||||||
|
case P_MENU_ID_FIRST_DATA_CHANNEL:
|
||||||
|
break;
|
||||||
|
case P_MENU_ID_LAST_DATA_CHANNEL:
|
||||||
|
break;
|
||||||
|
case P_MENU_ID_UNZOOM:
|
||||||
|
UnZoom();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -246,16 +283,27 @@ void PMusrT0::SetMsrHandler(PMsrHandler *msrHandler)
|
|||||||
*/
|
*/
|
||||||
void PMusrT0::InitDataAndBkg()
|
void PMusrT0::InitDataAndBkg()
|
||||||
{
|
{
|
||||||
|
// get addRun offset which depends on the fit type
|
||||||
|
int addRunOffset = 0;
|
||||||
|
int fitType = fMsrHandler->GetMsrRunList()->at(fRunNo).fFitType;
|
||||||
|
if (fitType == MSR_FITTYPE_SINGLE_HISTO) {
|
||||||
|
addRunOffset = 2;
|
||||||
|
} else if (fitType == MSR_FITTYPE_ASYM) {
|
||||||
|
addRunOffset = 4;
|
||||||
|
} else if (fitType == MSR_FITTYPE_ASYM_RRF) {
|
||||||
|
addRunOffset = 8;
|
||||||
|
}
|
||||||
|
|
||||||
// feed data range histo
|
// feed data range histo
|
||||||
int dataRange[2];
|
int dataRange[2];
|
||||||
switch (fDetectorTag) {
|
switch (fDetectorTag) {
|
||||||
case DETECTOR_TAG_FORWARD:
|
case DETECTOR_TAG_FORWARD:
|
||||||
dataRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[0];
|
dataRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[0 + fAddRunNo * addRunOffset];
|
||||||
dataRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[1];
|
dataRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[1 + fAddRunNo * addRunOffset];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_BACKWARD:
|
case DETECTOR_TAG_BACKWARD:
|
||||||
dataRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[2];
|
dataRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[2 + fAddRunNo * addRunOffset];
|
||||||
dataRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[3];
|
dataRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fDataRange[3 + fAddRunNo * addRunOffset];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_RIGHT:
|
case DETECTOR_TAG_RIGHT:
|
||||||
// not clear yet what to be done
|
// not clear yet what to be done
|
||||||
@ -279,18 +327,18 @@ void PMusrT0::InitDataAndBkg()
|
|||||||
for (int i=0; i<noOfBins; i++) {
|
for (int i=0; i<noOfBins; i++) {
|
||||||
fData->SetBinContent(i+1, fHisto->GetBinContent(dataRange[0]+i+1));
|
fData->SetBinContent(i+1, fHisto->GetBinContent(dataRange[0]+i+1));
|
||||||
}
|
}
|
||||||
fData->Draw("p0 hist same");
|
fData->Draw("p0 9 hist same");
|
||||||
|
|
||||||
// feed background histo
|
// feed background histo
|
||||||
int bkgRange[2];
|
int bkgRange[2];
|
||||||
switch (fDetectorTag) {
|
switch (fDetectorTag) {
|
||||||
case DETECTOR_TAG_FORWARD:
|
case DETECTOR_TAG_FORWARD:
|
||||||
bkgRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[0];
|
bkgRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[0 + fAddRunNo * addRunOffset];
|
||||||
bkgRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[1];
|
bkgRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[1 + fAddRunNo * addRunOffset];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_BACKWARD:
|
case DETECTOR_TAG_BACKWARD:
|
||||||
bkgRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[2];
|
bkgRange[0] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[2 + fAddRunNo * addRunOffset];
|
||||||
bkgRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[3];
|
bkgRange[1] = fMsrHandler->GetMsrRunList()->at(fRunNo).fBkgRange[3 + fAddRunNo * addRunOffset];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_RIGHT:
|
case DETECTOR_TAG_RIGHT:
|
||||||
// not clear yet what to be done
|
// not clear yet what to be done
|
||||||
@ -314,17 +362,17 @@ void PMusrT0::InitDataAndBkg()
|
|||||||
for (int i=0; i<noOfBins; i++) {
|
for (int i=0; i<noOfBins; i++) {
|
||||||
fBkg->SetBinContent(i+1, fHisto->GetBinContent(bkgRange[0]+i+1));
|
fBkg->SetBinContent(i+1, fHisto->GetBinContent(bkgRange[0]+i+1));
|
||||||
}
|
}
|
||||||
fBkg->Draw("p0 hist same");
|
fBkg->Draw("p0 9 hist same");
|
||||||
|
|
||||||
// add lines
|
// add lines
|
||||||
// t0 line
|
// t0 line
|
||||||
int t0Bin;
|
int t0Bin;
|
||||||
switch (fDetectorTag) {
|
switch (fDetectorTag) {
|
||||||
case DETECTOR_TAG_FORWARD:
|
case DETECTOR_TAG_FORWARD:
|
||||||
t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[0];
|
t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[0 + fAddRunNo * addRunOffset/2];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_BACKWARD:
|
case DETECTOR_TAG_BACKWARD:
|
||||||
t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[1];
|
t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[1 + fAddRunNo * addRunOffset/2];
|
||||||
break;
|
break;
|
||||||
case DETECTOR_TAG_RIGHT:
|
case DETECTOR_TAG_RIGHT:
|
||||||
// not clear yet what to be done
|
// not clear yet what to be done
|
||||||
@ -369,7 +417,23 @@ void PMusrT0::InitDataAndBkg()
|
|||||||
fLastBkgLine->SetLineWidth(2);
|
fLastBkgLine->SetLineWidth(2);
|
||||||
fLastBkgLine->Draw();
|
fLastBkgLine->Draw();
|
||||||
|
|
||||||
fMainCanvas->cd();
|
fMainCanvas->Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// UnZoom
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void PMusrT0::UnZoom()
|
||||||
|
{
|
||||||
|
cout << endl << ">> in UnZoom ..." << endl;
|
||||||
|
|
||||||
|
fHisto->GetXaxis()->UnZoom();
|
||||||
|
|
||||||
|
fMainCanvas->Modified(); // needed that Update is actually working
|
||||||
fMainCanvas->Update();
|
fMainCanvas->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class PMusrT0 : public TObject, public TQObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PMusrT0();
|
PMusrT0();
|
||||||
PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag);
|
PMusrT0(PRawRunData *rawRunData, int runNo, int histoNo, int detectorTag, int addRunNo);
|
||||||
|
|
||||||
virtual ~PMusrT0();
|
virtual ~PMusrT0();
|
||||||
|
|
||||||
@ -75,13 +75,18 @@ class PMusrT0 : public TObject, public TQObject
|
|||||||
virtual void SetMsrHandler(PMsrHandler *msrHandler);
|
virtual void SetMsrHandler(PMsrHandler *msrHandler);
|
||||||
#endif // __MAKECINT__
|
#endif // __MAKECINT__
|
||||||
|
|
||||||
|
virtual Int_t GetStatus() { return fStatus; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef __MAKECINT__
|
#ifndef __MAKECINT__
|
||||||
PMsrHandler *fMsrHandler;
|
PMsrHandler *fMsrHandler;
|
||||||
#endif // __MAKECINT__
|
#endif // __MAKECINT__
|
||||||
|
|
||||||
|
int fStatus;
|
||||||
|
|
||||||
int fRunNo;
|
int fRunNo;
|
||||||
int fDetectorTag;
|
int fDetectorTag;
|
||||||
|
int fAddRunNo;
|
||||||
|
|
||||||
// canvas menu related variables
|
// canvas menu related variables
|
||||||
TRootCanvas *fImp;
|
TRootCanvas *fImp;
|
||||||
@ -102,6 +107,7 @@ class PMusrT0 : public TObject, public TQObject
|
|||||||
TLine *fLastDataLine;
|
TLine *fLastDataLine;
|
||||||
|
|
||||||
void InitDataAndBkg();
|
void InitDataAndBkg();
|
||||||
|
void UnZoom();
|
||||||
|
|
||||||
ClassDef(PMusrT0, 1)
|
ClassDef(PMusrT0, 1)
|
||||||
};
|
};
|
||||||
|
149
src/musrt0.cpp
149
src/musrt0.cpp
@ -69,14 +69,15 @@ void musrt0_syntax()
|
|||||||
* \param app
|
* \param app
|
||||||
* \param msrHandler
|
* \param msrHandler
|
||||||
* \param rawRunData
|
* \param rawRunData
|
||||||
* \param histoNo
|
|
||||||
* \param runNo
|
* \param runNo
|
||||||
|
* \param histoNo
|
||||||
* \param detectorTag 0=forward, 1=backward, 2=left, 3=right
|
* \param detectorTag 0=forward, 1=backward, 2=left, 3=right
|
||||||
|
* \param addRunNo
|
||||||
*/
|
*/
|
||||||
bool musrt0_item(TApplication &app, PMsrHandler *msrHandler, PRawRunData *rawRunData,
|
bool musrt0_item(TApplication &app, PMsrHandler *msrHandler, PRawRunData *rawRunData,
|
||||||
unsigned int histoNo, unsigned int runNo, unsigned int detectorTag)
|
unsigned int runNo, int histoNo, int detectorTag, int addRunNo)
|
||||||
{
|
{
|
||||||
PMusrT0 *musrT0 = new PMusrT0(rawRunData, histoNo, runNo, detectorTag);
|
PMusrT0 *musrT0 = new PMusrT0(rawRunData, runNo, histoNo, detectorTag, addRunNo);
|
||||||
|
|
||||||
if (musrT0 == 0) {
|
if (musrT0 == 0) {
|
||||||
cout << endl << "**ERROR** Couldn't invoke musrT0 ...";
|
cout << endl << "**ERROR** Couldn't invoke musrT0 ...";
|
||||||
@ -91,10 +92,41 @@ bool musrt0_item(TApplication &app, PMsrHandler *msrHandler, PRawRunData *rawRun
|
|||||||
musrT0->Connect("Done(Int_t)", "TApplication", &app, "Terminate(Int_t)");
|
musrT0->Connect("Done(Int_t)", "TApplication", &app, "Terminate(Int_t)");
|
||||||
|
|
||||||
app.Run(true); // true needed that Run will return after quit
|
app.Run(true); // true needed that Run will return after quit
|
||||||
|
bool result = true;
|
||||||
|
if (musrT0->GetStatus() == 1)
|
||||||
|
result = false;
|
||||||
|
else
|
||||||
|
result = true;
|
||||||
|
|
||||||
delete musrT0;
|
delete musrT0;
|
||||||
musrT0 = 0;
|
musrT0 = 0;
|
||||||
|
|
||||||
return true;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void musrt0_cleanup(TSAXParser *saxParser, PStartupHandler *startupHandler, PMsrHandler *msrHandler, PRunDataHandler *dataHandler)
|
||||||
|
{
|
||||||
|
if (saxParser) {
|
||||||
|
delete saxParser;
|
||||||
|
saxParser = 0;
|
||||||
|
}
|
||||||
|
if (startupHandler) {
|
||||||
|
delete startupHandler;
|
||||||
|
startupHandler = 0;
|
||||||
|
}
|
||||||
|
if (msrHandler) {
|
||||||
|
delete msrHandler;
|
||||||
|
msrHandler = 0;
|
||||||
|
}
|
||||||
|
if (dataHandler) {
|
||||||
|
delete dataHandler;
|
||||||
|
dataHandler = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -209,118 +241,53 @@ int main(int argc, char *argv[])
|
|||||||
switch (runList->at(i).fFitType) {
|
switch (runList->at(i).fFitType) {
|
||||||
case MSR_FITTYPE_SINGLE_HISTO:
|
case MSR_FITTYPE_SINGLE_HISTO:
|
||||||
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0))
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSR_FITTYPE_ASYM:
|
case MSR_FITTYPE_ASYM:
|
||||||
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0))
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fBackwardHistoNo, 1))
|
}
|
||||||
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fBackwardHistoNo, 1, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSR_FITTYPE_ASYM_RRF:
|
case MSR_FITTYPE_ASYM_RRF:
|
||||||
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
for (unsigned int j=0; j<runList->at(i).fRunName.size(); j++) { // necessary in case of ADDRUN
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0))
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fForwardHistoNo, 0, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fBackwardHistoNo, 1))
|
}
|
||||||
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fBackwardHistoNo, 1, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fRightHistoNo, 2))
|
}
|
||||||
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fRightHistoNo, 2, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fLeftHistoNo, 3))
|
}
|
||||||
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(runList->at(i).fRunName[j]), i, runList->at(i).fLeftHistoNo, 3, j)) {
|
||||||
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
vector<PMusrT0*> t0CanvasVector;
|
|
||||||
PMusrT0 *t0Canvas;
|
|
||||||
|
|
||||||
bool ok = true;
|
|
||||||
for (unsigned int i=0; i<msrHandler->GetMsrPlotList()->size(); i++) {
|
|
||||||
|
|
||||||
if (startupHandler)
|
|
||||||
musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(),
|
|
||||||
10+i*100, 10+i*100, 800, 600,
|
|
||||||
startupHandler->GetFourierDefaults(),
|
|
||||||
startupHandler->GetMarkerList(),
|
|
||||||
startupHandler->GetColorList());
|
|
||||||
else
|
|
||||||
musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(),
|
|
||||||
10+i*100, 10+i*100, 800, 600);
|
|
||||||
|
|
||||||
if (!musrCanvas->IsValid()) {
|
|
||||||
cout << endl << "**SEVERE ERROR** Couldn't invoke all necessary objects, will quit.";
|
|
||||||
cout << endl;
|
|
||||||
ok = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// connect signal/slot
|
|
||||||
TQObject::Connect("TCanvas", "Closed()", "PMusrCanvas", musrCanvas, "LastCanvasClosed()");
|
|
||||||
|
|
||||||
// ugly but rootcint cannot handle the spirit-parser framework
|
|
||||||
musrCanvas->SetMsrHandler(msrHandler);
|
|
||||||
musrCanvas->SetRunListCollection(runListCollection);
|
|
||||||
|
|
||||||
if (!musrCanvas->IsValid()) { // something went wrong
|
|
||||||
ok = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
musrCanvas->Connect("Done(Int_t)", "TApplication", &app, "Terminate(Int_t)");
|
|
||||||
|
|
||||||
// keep musrCanvas objects
|
|
||||||
canvasVector.push_back(musrCanvas);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check that everything is ok
|
|
||||||
if (ok)
|
|
||||||
app.Run(true); // true needed that Run will return after quit so that cleanup works
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
cout << endl << "clean up canvas vector ...";
|
|
||||||
char canvasName[32];
|
|
||||||
for (unsigned int i=0; i<canvasVector.size(); i++) {
|
|
||||||
// check if canvas is still there before calling the destructor **TO BE DONE**
|
|
||||||
sprintf(canvasName, "fMainCanvas%d", i);
|
|
||||||
cout << endl << ">> canvasName=" << canvasName << ", canvasVector[" << i << "]=" << canvasVector[i];
|
|
||||||
if (gROOT->GetListOfCanvases()->FindObject(canvasName) != 0) {
|
|
||||||
cout << endl << ">> canvasName=" << canvasName << ", found ...";
|
|
||||||
cout << endl;
|
|
||||||
canvasVector[i]->~PMusrCanvas();
|
|
||||||
} else {
|
|
||||||
cout << endl << ">> canvasName=" << canvasName << ", NOT found ...";
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
canvasVector.empty();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (saxParser) {
|
musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler);
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = 0;
|
|
||||||
}
|
|
||||||
if (msrHandler) {
|
|
||||||
delete msrHandler;
|
|
||||||
msrHandler = 0;
|
|
||||||
}
|
|
||||||
if (dataHandler) {
|
|
||||||
delete dataHandler;
|
|
||||||
dataHandler = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user