Commit d0bbe594 authored by Vratislav Chudoba's avatar Vratislav Chudoba

New version of GNU make for ROOT version 6 (using rootcling instead of rootcint) created.

Some text variables changed from char[] to TString to suppress warnings.
parent 3a55bcf8
...@@ -44,8 +44,8 @@ private: ...@@ -44,8 +44,8 @@ private:
Int_t nCuts; //number of cuts Int_t nCuts; //number of cuts
TClonesArray cutsCol; TClonesArray cutsCol;
TH1I *hfull[NOCALFILES][16]; TH1I *hfull[NOCALFILES][16]; //!
TH1I *hcut[NOCALFILES][16]; TH1I *hcut[NOCALFILES][16]; //!
Int_t peakMin[NOCALFILES][16]; Int_t peakMin[NOCALFILES][16];
Int_t peakMax[NOCALFILES][16]; Int_t peakMax[NOCALFILES][16];
......
...@@ -23,11 +23,11 @@ AculCalibration::AculCalibration() : fEnergy(0), fEnergyInput(0), fA(0), fB(0), ...@@ -23,11 +23,11 @@ AculCalibration::AculCalibration() : fEnergy(0), fEnergyInput(0), fA(0), fB(0),
fCurrentHStack = NULL; fCurrentHStack = NULL;
fCurrentHistList.IsOwner(); fCurrentHistList.IsOwner();
// todo: change size of fA and fB in some other place // todo: change size of fA and fB in some other place
fA.Set(32); fA.Set(32);
fB.Set(32); fB.Set(32);
// fEnergy.Set(4); // fEnergy.Set(4);
// fEnergyInput.Set(4); // fEnergyInput.Set(4);
kRaNOPEAKS = 0; kRaNOPEAKS = 0;
fLowerPeakRelativeHight = 0.; fLowerPeakRelativeHight = 0.;
...@@ -171,7 +171,7 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s ...@@ -171,7 +171,7 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
if (peaksNumber != kRaNOPEAKS) { if (peaksNumber != kRaNOPEAKS) {
Info("PeaksFitting", "In histogram %s was found %d peaks", hSpectrum->GetName(), peaksNumber); Info("PeaksFitting", "In histogram %s was found %d peaks", hSpectrum->GetName(), peaksNumber);
return 1; return 1;
} }
//should be optional output //should be optional output
Info("PeaksFitting", "Number of peaks in %s: %d", hSpectrum->GetName(), peaksNumber); Info("PeaksFitting", "Number of peaks in %s: %d", hSpectrum->GetName(), peaksNumber);
...@@ -258,7 +258,7 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s ...@@ -258,7 +258,7 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
TMath::Sort(peaksNumber, peak, j, kFALSE); TMath::Sort(peaksNumber, peak, j, kFALSE);
fPeak.Set(peaksNumber); fPeak.Set(peaksNumber);
for (Int_t i = 0; i < peaksNumber; i++) { for (Int_t i = 0; i < peaksNumber; i++) {
fPeak[i] = peak[j[i]]; fPeak[i] = peak[j[i]];
//printf("\tPeak peak\t%f\n", fPeak[i]); //printf("\tPeak peak\t%f\n", fPeak[i]);
} }
...@@ -267,23 +267,23 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s ...@@ -267,23 +267,23 @@ Int_t AculCalibration::PeaksFitting(TH1* hSpectrum, Option_t* option, Double_t s
for (Int_t i = 0; i < peaksNumber; i++) { for (Int_t i = 0; i < peaksNumber; i++) {
printf("\tPeak position is\t%f\n", fPeak[i]); printf("\tPeak position is\t%f\n", fPeak[i]);
} }
} }
// provest kontrolu pomerne polohy piku, // provest kontrolu pomerne polohy piku,
// jestli jsou spatne, provest urcita opatreni, // jestli jsou spatne, provest urcita opatreni,
// napr. zapis daneho histogramu do souboru, // napr. zapis daneho histogramu do souboru,
// zapis do souboru s chybama, vypis na obrazovku, ... // zapis do souboru s chybama, vypis na obrazovku, ...
for (Int_t i = 0; i < peaksNumber; i++) { for (Int_t i = 0; i < peaksNumber; i++) {
if ( !( (((1-fPeakPositionTolerance)*(fEnergy[0]/fEnergy[i])) < (fPeak[0]/fPeak[i])) && (((1+fPeakPositionTolerance)*(fEnergy[0]/fEnergy[i])) > (fPeak[0]/fPeak[i])) ) ) { if ( !( (((1-fPeakPositionTolerance)*(fEnergy[0]/fEnergy[i])) < (fPeak[0]/fPeak[i])) && (((1+fPeakPositionTolerance)*(fEnergy[0]/fEnergy[i])) > (fPeak[0]/fPeak[i])) ) ) {
//printf("\tPeaksFitt fEnergy\t%f\n", fEnergy[i]); //printf("\tPeaksFitt fEnergy\t%f\n", fEnergy[i]);
if (fCalInformation /* && opt.Contains("writebad")*/) { if (fCalInformation /* && opt.Contains("writebad")*/) {
fCalInformation->cd(); fCalInformation->cd();
hSpectrum->Write(); hSpectrum->Write();
} }
//return 2;*/ //return 2;*/
} }
}//for }//for
return 0; return 0;
} }
...@@ -358,27 +358,27 @@ void AculCalibration::PrintInputParameters() ...@@ -358,27 +358,27 @@ void AculCalibration::PrintInputParameters()
return; return;
} }
Double_t AculCalibration::GetA(Int_t i) Double_t AculCalibration::GetA(Int_t i)
{ {
if (i >= fA.GetSize()) //if i >= number of array element if (i >= fA.GetSize()) //if i >= number of array element
{ {
return 0.; return 0.;
} }
return fA[i]; return fA[i];
} }
Double_t AculCalibration::GetB(Int_t i) Double_t AculCalibration::GetB(Int_t i)
{ {
if (i >= fB.GetSize()) if (i >= fB.GetSize())
{ {
return 0.; return 0.;
} }
return fB[i]; return fB[i];
} }
Bool_t AculCalibration::SetCalibrationParameters(const char* calparfile) Bool_t AculCalibration::SetCalibrationParameters(const char* calparfile)
...@@ -393,7 +393,7 @@ Bool_t AculCalibration::SetCalibrationParameters(const char* calparfile) ...@@ -393,7 +393,7 @@ Bool_t AculCalibration::SetCalibrationParameters(const char* calparfile)
char cA[40], cB[40], cC[40], cD[40]; char cA[40], cB[40], cC[40], cD[40];
//open file with calibration parameters //open file with calibration parameters
ifstream calFileR; std::ifstream calFileR;
calFileR.open(calparfile); calFileR.open(calparfile);
...@@ -439,10 +439,10 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC ...@@ -439,10 +439,10 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC
// xaxismax: maximal channel, which will be displayed // xaxismax: maximal channel, which will be displayed
// subaddress: // subaddress:
Char_t address[40]; TString address;
Char_t histName[40]; TString histName;
Char_t fillCommand[40]; TString command;
Char_t fillCondition[40]; TString condition;
if (!rawCanvas) { if (!rawCanvas) {
...@@ -453,11 +453,8 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC ...@@ -453,11 +453,8 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC
rawCanvas->Clear(); rawCanvas->Clear();
// cout << "hovno" << endl;
rawCanvas->SetFillColor(10); rawCanvas->SetFillColor(10);
// cout << "hovno" << endl;
TFile *fr = new TFile(filename); TFile *fr = new TFile(filename);
if (fr->IsOpen() == 0) { if (fr->IsOpen() == 0) {
cout << endl << "File " << filename << " was not opened and won't be processed" << endl << endl; cout << endl << "File " << filename << " was not opened and won't be processed" << endl << endl;
...@@ -465,23 +462,21 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC ...@@ -465,23 +462,21 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC
} }
TH1I *hRead = 0; TH1I *hRead = 0;
TTree *tr = (TTree*)fr->Get("RAW"); TTree *tr = (TTree*)fr->Get("RAW");
// cout << "hovno" << endl;
if (subaddress > 15) { if (subaddress > 15) {
rawCanvas->Divide(4, 4); rawCanvas->Divide(4, 4);
rawCanvas->SetFillColor(10); rawCanvas->SetFillColor(10);
// cout << "hovno" << endl;
for (Int_t i = 0; i < 16; i++) { for (Int_t i = 0; i < 16; i++) {
cout << i << endl; cout << i << endl;
rawCanvas->cd(i+1); rawCanvas->cd(i+1);
hRead = new TH1I("name", "title", 4096, 0, 4095); hRead = new TH1I("name", "title", 4096, 0, 4095);
sprintf(address, "C3[%d][%d]", block, i); address.Form("C3[%d][%d]", block, i);
sprintf(histName, "H3[%d][%d]", block, i); histName.Form("H3[%d][%d]", block, i);
hRead->SetName(histName); hRead->SetName(histName);
sprintf(fillCommand, "%s >> %s", address, hRead->GetName()); command.Form("%s >> %s", address.Data(), hRead->GetName());
sprintf(fillCondition, "%s > 0", address); // sprintf(fillCondition, "%s > 0", address);
tr->Draw(fillCommand, fillCondition, ""); condition.Form("%s > 0", address.Data());
tr->Draw(command, condition, "");
if (hRead) { if (hRead) {
hRead->SetDirectory(0); hRead->SetDirectory(0);
// cout << hRead->GetEntries() << endl; // cout << hRead->GetEntries() << endl;
...@@ -496,13 +491,14 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC ...@@ -496,13 +491,14 @@ void AculCalibration::ShowRawSpectra(const char* filename, const Int_t block, TC
else { else {
fr->cd(); fr->cd();
hRead = new TH1I("name", "title", 4096, 0, 4095); hRead = new TH1I("name", "title", 4096, 0, 4095);
sprintf(address, "C3[%d][%d]", block, subaddress); address.Form("C3[%d][%d]", block, subaddress);
sprintf(histName, "H3[%d][%d]", block, subaddress); histName.Form("H3[%d][%d]", block, subaddress);
hRead->SetName(histName); hRead->SetName(histName);
sprintf(fillCommand, "%s >> %s", address, hRead->GetName()); command.Form("%s >> %s", address.Data(), hRead->GetName());
sprintf(fillCondition, "%s > 0", address); // sprintf(fillCondition, "%s > 0", address);
condition.Form("%s > 0", address.Data());
// cout << fillCommand << setw(20) << fillCondition << endl; // cout << fillCommand << setw(20) << fillCondition << endl;
tr->Draw(fillCommand, fillCondition, "goff"); tr->Draw(command, condition, "goff");
if (hRead) { if (hRead) {
hRead->SetDirectory(0); hRead->SetDirectory(0);
// if (fHRawList) { // if (fHRawList) {
...@@ -621,11 +617,16 @@ void AculCalibration::FillRawSpectraFile(const char* rawdatafile, const char* bl ...@@ -621,11 +617,16 @@ void AculCalibration::FillRawSpectraFile(const char* rawdatafile, const char* bl
return; return;
} }
char address[40]; // char address[40];
char histName[40]; // char histName[40];
char histTitle[40]; // char histTitle[40];
char fillCommand[40]; // char fillCommand[40];
char fillCondition[40]; // char fillCondition[40];
TString address;
TString histName;
TString histTitle;
TString command;
TString condition;
fw.cd(); fw.cd();
TH1I *hRead = 0; TH1I *hRead = 0;
...@@ -633,14 +634,16 @@ void AculCalibration::FillRawSpectraFile(const char* rawdatafile, const char* bl ...@@ -633,14 +634,16 @@ void AculCalibration::FillRawSpectraFile(const char* rawdatafile, const char* bl
for (Int_t i = 0; i < 16; i++) { //zkontrolovat hranice for (Int_t i = 0; i < 16; i++) { //zkontrolovat hranice
cout << i << endl; //predelat na info cout << i << endl; //predelat na info
hRead = new TH1I("name", "title", 4096, 0, 4095); hRead = new TH1I("name", "title", 4096, 0, 4095);
sprintf(address, "%s[%d]", block, i); address.Form("%s[%d]", block, i);
sprintf(histName, "%s[%d]", block, i); histName.Form("%s[%d]", block, i);
sprintf(histTitle, "%s : %s", rawdatafile, histName); histTitle.Form("%s : %s", rawdatafile, histName.Data());
hRead->SetName(histName); hRead->SetName(histName);
hRead->SetTitle(histTitle); hRead->SetTitle(histTitle);
sprintf(fillCommand, "%s >> %s", address, hRead->GetName()); // sprintf(fillCommand, "%s >> %s", address, hRead->GetName());
sprintf(fillCondition, "%s > 0", address); command.Form("%s >> %s", address.Data(), hRead->GetName());
tr->Draw(fillCommand, fillCondition, "goff"); //prozkoumat goff // sprintf(fillCondition, "%s > 0", address);
condition.Form("%s > 0", address.Data());
tr->Draw(command, condition, "goff"); //prozkoumat goff
hRead->Write(); hRead->Write();
}//for }//for
...@@ -679,7 +682,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfile, const ch ...@@ -679,7 +682,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfile, const ch
else { oFileName.Form("%s[%d-%d].cal", block, lowersubaddress, uppersubaddress); } else { oFileName.Form("%s[%d-%d].cal", block, lowersubaddress, uppersubaddress); }
}//if }//if
ofstream outcalfile; std::ofstream outcalfile;
outcalfile.open(oFileName.Data()); outcalfile.open(oFileName.Data());
if (!outcalfile.is_open()) { if (!outcalfile.is_open()) {
Error("CalculateCalibParameters", "Output file %s was not opened", oFileName.Data()); Error("CalculateCalibParameters", "Output file %s was not opened", oFileName.Data());
...@@ -783,7 +786,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfile, const ch ...@@ -783,7 +786,7 @@ Bool_t AculCalibration::CalculateCalibParameters(const char* inputfile, const ch
//calibration parameters calculation //ok //calibration parameters calculation //ok
for (Int_t j = 0; j < kRaNOPEAKS; j++) { //delat podle poctu zkoumanych piku for (Int_t j = 0; j < kRaNOPEAKS; j++) { //delat podle poctu zkoumanych piku
calGraph->SetPoint(j, fPeak[j], fEnergy[j]); //calibration graph filling calGraph->SetPoint(j, fPeak[j], fEnergy[j]); //calibration graph filling
printf("\tPeak\t%f and energy\t%f\n", fPeak[j], fEnergy[j]); printf("\tPeak\t%f and energy\t%f\n", fPeak[j], fEnergy[j]);
}//for }//for
calGraph->Fit(calFunction, "Q", "goff", 0, 4096); //omezit hlasitost fitovani, udelat volitelne, dodelat volby rozsahu calGraph->Fit(calFunction, "Q", "goff", 0, 4096); //omezit hlasitost fitovani, udelat volitelne, dodelat volby rozsahu
...@@ -1087,7 +1090,7 @@ void AculCalibration::FindEnergyPeaks(TCanvas *c1, const char* ifile, const char ...@@ -1087,7 +1090,7 @@ void AculCalibration::FindEnergyPeaks(TCanvas *c1, const char* ifile, const char
//creation of output text file with positions of peaks in MeV //creation of output text file with positions of peaks in MeV
TString workFile = outfile; TString workFile = outfile;
ofstream ofile; std::ofstream ofile;
ofile.open(workFile.Data()); ofile.open(workFile.Data());
if (!ofile.is_open()) { if (!ofile.is_open()) {
Error("PeaksFitting", "Output file %s was not opened", workFile.Data()); Error("PeaksFitting", "Output file %s was not opened", workFile.Data());
...@@ -1103,17 +1106,17 @@ void AculCalibration::FindEnergyPeaks(TCanvas *c1, const char* ifile, const char ...@@ -1103,17 +1106,17 @@ void AculCalibration::FindEnergyPeaks(TCanvas *c1, const char* ifile, const char
c1->cd(i+1); c1->cd(i+1);
PeaksFitting(hWork); PeaksFitting(hWork);
hWork->Draw(); hWork->Draw();
ofile<<i<<"\t"; ofile<<i<<"\t";
for(Int_t j=0; j<kRaNOPEAKS; j++) { for(Int_t j=0; j<kRaNOPEAKS; j++) {
ofile << fPeak[j] <<"\t"; ofile << fPeak[j] <<"\t";
} }
ofile<<endl; ofile<<endl;
} }
ofile.close(); ofile.close();
} }
void AculCalibration::FindAverageEnergies(const char* ifile, const char* outfile) { void AculCalibration::FindAverageEnergies(const char* ifile, const char* outfile) {
TString iFile = ifile; TString iFile = ifile;
...@@ -1128,51 +1131,51 @@ void AculCalibration::FindAverageEnergies(const char* ifile, const char* outfile ...@@ -1128,51 +1131,51 @@ void AculCalibration::FindAverageEnergies(const char* ifile, const char* outfile
//creation of output text file with average values of peak energies in MeV //creation of output text file with average values of peak energies in MeV
TString workFile = outfile; TString workFile = outfile;
ofstream ofile; std::ofstream ofile;
ofile.open(workFile.Data()); ofile.open(workFile.Data());
if (!ofile.is_open()) { if (!ofile.is_open()) {
Error("PeaksFitting", "Output file %s was not opened", workFile.Data()); Error("PeaksFitting", "Output file %s was not opened", workFile.Data());
return; return;
} }
TH1 *hWork = 0; TH1 *hWork = 0;
Double_t hArray[histList->GetEntries()][kRaNOPEAKS]; Double_t hArray[histList->GetEntries()][kRaNOPEAKS];
//TString hSumName; //TString hSumName;
Double_t hSumE1 = 0.; Double_t hSumE1 = 0.;
Double_t hAvrE1 = 0.; Double_t hAvrE1 = 0.;
Double_t hSumE2 = 0.; Double_t hSumE2 = 0.;
Double_t hAvrE2 = 0.; Double_t hAvrE2 = 0.;
Double_t hSumE3 = 0.; Double_t hSumE3 = 0.;
Double_t hAvrE3 = 0.; Double_t hAvrE3 = 0.;
Double_t hSumE4 = 0.; Double_t hSumE4 = 0.;
Double_t hAvrE4 = 0.; Double_t hAvrE4 = 0.;
// c1->Clear(); // c1->Clear();
// c1->Divide(6, 6); // c1->Divide(6, 6);
for (Int_t i = 0; i < histList->GetEntries(); i++) { for (Int_t i = 0; i < histList->GetEntries(); i++) {
fr->GetObject(histList->At(i)->GetName(), hWork); fr->GetObject(histList->At(i)->GetName(), hWork);
PeaksFitting(hWork); PeaksFitting(hWork);
for(Int_t j = 0; j < kRaNOPEAKS; j++) { for(Int_t j = 0; j < kRaNOPEAKS; j++) {
hArray[i][j] = fPeak[j]; hArray[i][j] = fPeak[j];
if(fPeak[j]==0.){ if(fPeak[j]==0.){
Error("FindAverageEnergies", "No peak in channel %i !", histList->GetEntries()); Error("FindAverageEnergies", "No peak in channel %i !", histList->GetEntries());
} }
//hSumName.Form("hSumE%i",j); //hSumName.Form("hSumE%i",j);
} }
hSumE1 += hArray[i][0]; hSumE1 += hArray[i][0];
hSumE2 += hArray[i][1]; hSumE2 += hArray[i][1];
hSumE3 += hArray[i][2]; hSumE3 += hArray[i][2];
hSumE4 += hArray[i][3]; hSumE4 += hArray[i][3];
// std::cout<<"i "<<i<<" hSumE1 "<<hSumE1<<std::endl; // std::cout<<"i "<<i<<" hSumE1 "<<hSumE1<<std::endl;
} }
hAvrE1 = hSumE1/histList->GetEntries(); hAvrE1 = hSumE1/histList->GetEntries();
hAvrE2 = hSumE2/histList->GetEntries(); hAvrE2 = hSumE2/histList->GetEntries();
hAvrE3 = hSumE3/histList->GetEntries(); hAvrE3 = hSumE3/histList->GetEntries();
hAvrE4 = hSumE4/histList->GetEntries(); hAvrE4 = hSumE4/histList->GetEntries();
ofile <<"Average energies are:\t"<<hAvrE1<<"\t"<<hAvrE2<<"\t"<<hAvrE3<<"\t"<<hAvrE4<<std::endl; ofile <<"Average energies are:\t"<<hAvrE1<<"\t"<<hAvrE2<<"\t"<<hAvrE3<<"\t"<<hAvrE4<<std::endl;
ofile.close(); ofile.close();
} }
void AculCalibration::ShowAnalyzedSpectra(const char *filename, TCanvas* fittedRawCanvas, Int_t xaxismin, Int_t xaxismax, Int_t subaddress) void AculCalibration::ShowAnalyzedSpectra(const char *filename, TCanvas* fittedRawCanvas, Int_t xaxismin, Int_t xaxismax, Int_t subaddress)
...@@ -1380,7 +1383,7 @@ void AculCalibration::SetInputParameters() { ...@@ -1380,7 +1383,7 @@ void AculCalibration::SetInputParameters() {
Char_t identificator[100]; Char_t identificator[100];
ifstream fipr; std::ifstream fipr;
fipr.open(fParFileName.Data()); fipr.open(fParFileName.Data());
if (!fipr.is_open()) { if (!fipr.is_open()) {
Error("AculCalibration::SetInputsParameters", "File with input parameters \"%s\" was not opened.", fParFileName.Data()); Error("AculCalibration::SetInputsParameters", "File with input parameters \"%s\" was not opened.", fParFileName.Data());
...@@ -1400,8 +1403,8 @@ void AculCalibration::SetInputParameters() { ...@@ -1400,8 +1403,8 @@ void AculCalibration::SetInputParameters() {
if ( strcmp(identificator, "noPeaks") == 0 ) { if ( strcmp(identificator, "noPeaks") == 0 ) {
kRaNOPEAKS = static_cast<Int_t>(atoi(parameter)); kRaNOPEAKS = static_cast<Int_t>(atoi(parameter));
fEnergyInput.Set(kRaNOPEAKS); fEnergyInput.Set(kRaNOPEAKS);
fEnergy.Set(kRaNOPEAKS); fEnergy.Set(kRaNOPEAKS);
fPeak.Set(kRaNOPEAKS); fPeak.Set(kRaNOPEAKS);
for (Int_t i = 0; i < kRaNOPEAKS; i++) { for (Int_t i = 0; i < kRaNOPEAKS; i++) {
fipr.getline(line, lineLength); fipr.getline(line, lineLength);
......
...@@ -74,7 +74,7 @@ private: ...@@ -74,7 +74,7 @@ private:
//these variables are the main for the class //these variables are the main for the class
TArrayD fA; //calibration parameter, f(x) = fA*x + fB TArrayD fA; //calibration parameter, f(x) = fA*x + fB
TArrayD fB; //calibration parameter, f(x) = fA*x + fB TArrayD fB; //calibration parameter, f(x) = fA*x + fB
TArrayD fPeak; //v teto promenne je ulozena momentalni hodnota piku v kanalech, zejmena v jedne fci, mozno udelat ji jako lokalni, bude navratovou hodnotou fce PeaksFitting, predelat delku pole TArrayD fPeak; //v teto promenne je ulozena momentalni hodnota piku v kanalech, zejmena v jedne fci, mozno udelat ji jako lokalni, bude navratovou hodnotou fce PeaksFitting, predelat delku pole
...@@ -83,7 +83,7 @@ private: ...@@ -83,7 +83,7 @@ private:
TString fParFileName; TString fParFileName;
//it is very doubtful that we need this class variable //it is very doubtful that we need this class variable
TFile *fCalInformation; TFile *fCalInformation;
...@@ -144,7 +144,7 @@ public: ...@@ -144,7 +144,7 @@ public:
Bool_t CalculateCalibParameters(const char* inputfile, const char* block, Bool_t CalculateCalibParameters(const char* inputfile, const char* block,
const char* treename, Int_t lowerchannel = 0, const char* treename, Int_t lowerchannel = 0,
Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0,
Int_t uppersubaddress = ADDRESSNUMBER-1); //calculate calibration parameters for given block in given file Int_t uppersubaddress = ADDRESSNUMBER-1); //calculate calibration parameters for given block in given file
//function is not completely ready to use //function is not completely ready to use
// //
...@@ -176,13 +176,13 @@ public: ...@@ -176,13 +176,13 @@ public:
void CalibrateRawSpectra(const char* inputfile, const char* block, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1); void CalibrateRawSpectra(const char* inputfile, const char* block, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);
void FindEnergyPeaks(TCanvas *c1, const char* ifile, const char* outfile); void FindEnergyPeaks(TCanvas *c1, const char* ifile, const char* outfile);
// Outputs calibrated energies for each channel in txt file // Outputs calibrated energies for each channel in txt file
// //
// //
// //
void FindAverageEnergies(const char* ifile, const char* outfile); void FindAverageEnergies(const char* ifile, const char* outfile);
// Outputs average values of calibrated energies for the whole detector in txt file // Outputs average values of calibrated energies for the whole detector in txt file
// //
// //
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# AculData input with some variables # AculData input with some variables
################################################################################ ################################################################################
ACULDATALIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf -lSpectrum #-lTELoss ACULDATALIBS := -lCore -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf -lSpectrum #-lTELoss
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables
ACULDATA_HEADERS += \ ACULDATA_HEADERS += \
...@@ -13,14 +13,14 @@ $(ACULDATA)/linkdef.h ...@@ -13,14 +13,14 @@ $(ACULDATA)/linkdef.h
ACULDATACPP_SRCS += \ ACULDATACPP_SRCS += \
$(ACULDATA)/AculCalibration.cpp \ $(ACULDATA)/AculCalibration.cpp \
$(ACULDATA)/AculCalibCsI.cpp \ $(ACULDATA)/AculCalibCsI.cpp \
$(ACULDATA)/AculDataCint.cpp $(ACULDATA)/AculDataDict.cpp
ACULDATAOBJS += \ ACULDATAOBJS += \
$(ACULDATA)/AculCalibration.o \ $(ACULDATA)/AculCalibration.o \
$(ACULDATA)/AculCalibCsI.o \ $(ACULDATA)/AculCalibCsI.o \
$(ACULDATA)/AculDataCint.o $(ACULDATA)/AculDataDict.o
ACULDATACPP_DEPS += \ ACULDATACPP_DEPS += \
$(ACULDATA)/AculCalibration.d \ $(ACULDATA)/AculCalibration.d \
$(ACULDATA)/AculCalibCsI.d \ $(ACULDATA)/AculCalibCsI.d \
$(ACULDATA)/AculDataCint.d $(ACULDATA)/AculDataDict.d
\ No newline at end of file \ No newline at end of file
...@@ -2,19 +2,24 @@ ...@@ -2,19 +2,24 @@
# TELoss input with some variables # TELoss input with some variables
################################################################################ ################################################################################
TELOSSLIBS := -lCore -lCint -lMathCore -lMatrix -lHist -lgfortran # TELOSSLIBS := -lCore -lCint -lMathCore -lMatrix -lHist -lgfortran
TELOSSLIBS := -lCore -lMathCore -lMatrix -lHist -lgfortran
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables
TELOSS_HEADERS += \
$(TELOSS)/TELoss.h \
$(TELOSS)/linkdef.h
TELOSSCPP_SRCS += \ TELOSSCPP_SRCS += \
$(TELOSS)/TELoss.cpp \ $(TELOSS)/TELoss.cpp \
$(TELOSS)/TELossCint.cpp $(TELOSS)/TELossDict.cpp
TELOSSOBJS += \ TELOSSOBJS += \
$(TELOSS)/ELOSS.o \ $(TELOSS)/ELOSS.o \
$(TELOSS)/TELoss.o \ $(TELOSS)/TELoss.o \
$(TELOSS)/TELossCint.o $(TELOSS)/TELossDict.o
TELOSSCPP_DEPS += \ TELOSSCPP_DEPS += \
$(TELOSS)/TELoss.d \ $(TELOSS)/TELoss.d \
$(TELOSS)/TELossCint.d $(TELOSS)/TELossDict.d
{ {
gSystem->Load("~/workspace/Utilities/libAculData.so"); gSystem->Load("libTELoss.so");
gSystem->Load("libAculData.so");
} }
...@@ -41,23 +41,30 @@ htmldoc: libAculData.so ...@@ -41,23 +41,30 @@ htmldoc: libAculData.so
clean: clean:
-$(RM) $(ACULDATAOBJS) $(ACULDATACPP_DEPS) -$(RM) $(ACULDATAOBJS) $(ACULDATACPP_DEPS)
-$(RM) $(ACULDATA)/AculDataCint.* libAculData.so -$(RM) $(ACULDATA)/AculDataDict.* *.pcm $(ACULDATA)/*.pcm
-$(RM) libAculData.so
-@echo ' ' -@echo ' '
-$(RM) $(TELOSSOBJS) $(TELOSSCPP_DEPS) -$(RM) $(TELOSSOBJS) $(TELOSSCPP_DEPS)
-$(RM) $(TELOSS)/TELossCint.* libTELoss.so -$(RM) $(TELOSS)/TELossDict.* *.pcm $(TELOSS)/*.pcm
-$(RM) libTELoss.so
-@echo ' ' -@echo ' '
-$(RM) htmldoc -$(RM) htmldoc
-@echo ' ' -@echo ' '
# Those *Cint* files below need special treating: # Those *Dictionary* files below need special treating:
$(ACULDATA)/AculDataCint.cpp: $(ACULDATA)/AculDataDict.cpp:
-@echo 'Pre-building AculDataCint.cpp and AculDataCint.h files' -@echo 'Pre-building AculDataDict.cpp and AculDataCint.h files'
-rootcint -f $(ACULDATA)/AculDataCint.cpp -c -p $(ACULDATA_HEADERS) -rootcling -f $(ACULDATA)/AculDataDict.cpp -p $(ACULDATA_HEADERS)
-@echo 'Creating: link to AculDataDict_rdict.pcm'
-ln -s $(ACULDATA)/AculDataDict_rdict.pcm .
-@echo ' ' -@echo ' '
$(TELOSS)/TELossCint.cpp: $(TELOSS)/TELossDict.cpp:
-@echo 'Pre-building TELossCint.cpp and TELossCint.h files' -@echo 'Pre-building TELossDict.cpp and TELossDict_rdict.pcm files'
-rootcint -f $(TELOSS)/TELossCint.cpp -c -p $(TELOSS)/TELoss.h $(TELOSS)/linkdef.h @echo
-rootcling -f $@ -c $(CXXFLAGS) -p $(TELOSS_HEADERS)
-@echo 'Creating: link to TELossDict_rdict.pcm'
-ln -s $(TELOSS)/TELossDict_rdict.pcm .
-@echo ' ' -@echo ' '
#*.so files #*.so files
...@@ -83,7 +90,6 @@ libTELoss.so: $(TELOSSOBJS) ...@@ -83,7 +90,6 @@ libTELoss.so: $(TELOSSOBJS)
@echo 'Building file: $@' @echo 'Building file: $@'
@echo 'Invoking: $(CC) Compiler' @echo 'Invoking: $(CC) Compiler'
$(CC) -I$(ROOTINCS) -O0 -g3 -Wall -c -fmessage-length=0 -fPIC $(ROOTCFLAGS) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" $(CC) -I$(ROOTINCS) -O0 -g3 -Wall -c -fmessage-length=0 -fPIC $(ROOTCFLAGS) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
# $(CC) -I$(ROOTINCS) -O2 -Wall -mmmx -msse -msse2 -msse3 -mfpmath=sse,387 -march=nocona -mtune=nocona -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $@' @echo 'Finished building: $@'
@echo ' ' @echo ' '
......
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