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

remove hists not usefull for producer

add the possibility to have different SMZ sizes for each actor
parent 8798a85f
#define MAX_TH1BINS 4096
#define MAX_TH2BINS 1024
#define MAX_TH1HISTS 79
#define MAX_TH2HISTS 1
#define MAX_CHAR_SIZE 200
//38*ERaw + 2*timestamps
#define N_TH1HISTS_PROD 40
#define N_TH2HISTS_PROD 0
//38*ERaw + 38*Baseline + 2*timestamps
#define N_TH1HISTS_PREP 78
//1*EvsId
#define N_TH2HISTS_PREP 1
struct Hist
{
Int_t nevts = 0;
......@@ -35,10 +42,18 @@ struct Hist2F : Hist
char ytitle[MAX_CHAR_SIZE];
};
struct ActorMap
struct ProdMap
{
int N_TH1_Entries = 0; // number of 1d histograms
int N_TH2_Entries = 0; // number of 2d histograms
Hist1F hist1f_list[N_TH1HISTS_PROD];
Hist2F hist2f_list[N_TH2HISTS_PROD];
};
struct PrepMap
{
int N_TH1_Entries = 0; // number of 1d histograms
int N_TH2_Entries = 0; // number of 2d histograms
Hist1F hist1f_list[MAX_TH1HISTS];
Hist2F hist2f_list[MAX_TH2HISTS];
Hist1F hist1f_list[N_TH1HISTS_PREP];
Hist2F hist2f_list[N_TH2HISTS_PREP];
};
......@@ -207,12 +207,21 @@ std::string Histogramer::GetSegmentNameFromID(const Int_t id)
return name;
}
Hist1F *Histogramer::NewHist1F(std::string name, std::string title, std::string xtitle, std::string gruname, int nbins, float min, float max, ActorMap *map_ptr, Int_t PortNumber)
Hist1F *Histogramer::NewHist1F(std::string name, std::string title, std::string xtitle, std::string gruname, int nbins, float min, float max, void *map_ptr, Int_t PortNumber)
{
Log.ClearMessage();
Log.SetProcessMethod("NewHist1F");
fFrameIO.Print(Log());
ProdMap *prodmap = nullptr;
PrepMap *prepmap = nullptr;
if(fBasePortNumber==10)
prodmap = static_cast<ProdMap*>(map_ptr);
else if(fBasePortNumber==11)
prepmap = static_cast<PrepMap*>(map_ptr);
else return nullptr;
if(nbins>MAX_TH1BINS)
{
Log.SetLevel(LogMessage::kError);
......@@ -220,19 +229,35 @@ Hist1F *Histogramer::NewHist1F(std::string name, std::string title, std::string
return nullptr;
}
if(map_ptr->N_TH1_Entries == MAX_TH1HISTS)
if(prodmap && prodmap->N_TH1_Entries == N_TH1HISTS_PROD)
{
Log.SetLevel(LogMessage::kError);
Log << "Cannot allocate more than " << N_TH1HISTS_PROD << " TH1F at producer level, in the shared memory" << dolog;
return nullptr;
}
if(prepmap && prepmap->N_TH1_Entries == N_TH1HISTS_PREP)
{
Log.SetLevel(LogMessage::kError);
Log << "Cannot allocate more than " << MAX_TH1HISTS << " TH1F, in the shared memory" << dolog;
Log << "Cannot allocate more than " << N_TH1HISTS_PREP << " TH1F at preprocessing level, in the shared memory" << dolog;
return nullptr;
}
Hist1F *histptr = &map_ptr->hist1f_list[map_ptr->N_TH1_Entries];
Hist1F *histptr = nullptr;
if(prodmap)
histptr = &prodmap->hist1f_list[prodmap->N_TH1_Entries];
else if(prepmap)
histptr = &prepmap->hist1f_list[prepmap->N_TH1_Entries];
strcpy(histptr->name,name.data());
strcpy(histptr->title,title.data());
strcpy(histptr->gruname,gruname.data());
histptr->spec_number = PortNumber*10000+1000 + map_ptr->N_TH1_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
if(prodmap)
histptr->spec_number = PortNumber*10000+1000 + prodmap->N_TH1_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
else if(prepmap)
histptr->spec_number = PortNumber*10000+1000 + prepmap->N_TH1_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
histptr->nevts = 0;
histptr->xbinmin=min;
......@@ -241,17 +266,29 @@ Hist1F *Histogramer::NewHist1F(std::string name, std::string title, std::string
strcpy(histptr->xtitle,xtitle.data());
memset(histptr->bins, 0, sizeof(histptr->bins));
map_ptr->N_TH1_Entries++;
if(prodmap)
prodmap->N_TH1_Entries++;
if(prepmap)
prepmap->N_TH1_Entries++;
return histptr;
}
Hist2F *Histogramer::NewHist2F(std::string name, std::string title, std::string xtitle, std::string ytitle, std::string gruname, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax, ActorMap *map_ptr, Int_t PortNumber)
Hist2F *Histogramer::NewHist2F(std::string name, std::string title, std::string xtitle, std::string ytitle, std::string gruname, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax, void *map_ptr, Int_t PortNumber)
{
Log.ClearMessage();
Log.SetProcessMethod("NewHist2F");
fFrameIO.Print(Log());
ProdMap *prodmap = nullptr;
PrepMap *prepmap = nullptr;
if(fBasePortNumber==10)
prodmap = static_cast<ProdMap*>(map_ptr);
else if(fBasePortNumber==11)
prepmap = static_cast<PrepMap*>(map_ptr);
else return nullptr;
Hist2F *histptr = nullptr;
if(nbinsx>MAX_TH2BINS || nbinsy>MAX_TH2BINS)
......@@ -261,19 +298,34 @@ Hist2F *Histogramer::NewHist2F(std::string name, std::string title, std::string
return nullptr;
}
if(map_ptr->N_TH2_Entries == MAX_TH2HISTS)
if(prodmap && prodmap->N_TH2_Entries == N_TH2HISTS_PROD)
{
Log.SetLevel(LogMessage::kError);
Log << "Cannot allocate more than " << N_TH2HISTS_PROD << " TH2F at producer level, in the shared memory" << dolog;
return nullptr;
}
if(prepmap && prepmap->N_TH2_Entries == N_TH2HISTS_PREP)
{
Log.SetLevel(LogMessage::kError);
Log << "Cannot allocate more than " << MAX_TH2HISTS << " TH2F, in the shared memory" << dolog;
Log << "Cannot allocate more than " << N_TH2HISTS_PREP << " TH2F at preprocessing level, in the shared memory" << dolog;
return nullptr;
}
histptr = &map_ptr->hist2f_list[map_ptr->N_TH2_Entries];
if(prodmap)
histptr = &prodmap->hist2f_list[prodmap->N_TH2_Entries];
else if(prepmap)
histptr = &prepmap->hist2f_list[prepmap->N_TH2_Entries];
strcpy(histptr->name,name.data());
strcpy(histptr->title,title.data());
strcpy(histptr->gruname,gruname.data());
histptr->spec_number = PortNumber*10000+2000 + map_ptr->N_TH2_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
if(prodmap)
histptr->spec_number = PortNumber*10000+2000 + prodmap->N_TH2_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
else if(prepmap)
histptr->spec_number = PortNumber*10000+2000 + prepmap->N_TH2_Entries; //2 first digits: actor ; 3 next: crystal id ; 1next: (1 -> TH1 ; 2 -> TH2) ; 3 next, spectrum id
histptr->nevts = 0;
histptr->xnbins = nbinsx;
......@@ -288,7 +340,10 @@ Hist2F *Histogramer::NewHist2F(std::string name, std::string title, std::string
memset(histptr->bins, 0, sizeof(histptr->bins));
map_ptr->N_TH2_Entries++;
if(prodmap)
prodmap->N_TH2_Entries++;
else if(prepmap)
prepmap->N_TH2_Entries++;
return histptr;
}
......@@ -317,7 +372,7 @@ void Histogramer::FillHist1F(Hist1F *hist, Float_t val, Float_t weight)
hist->bins[bin] += weight;
hist->nevts++;
// cout<<"val = "<<val<<" ; bin "<<bin<<" filled : "<<hist->bins[bin]<<" ; nevts = "<<hist->nevts<<endl;
// cout<<"val = "<<val<<" ; bin "<<bin<<" filled : "<<hist->bins[bin]<<" ; nevts = "<<hist->nevts<<endl;
}
void Histogramer::FillHist2F(Hist2F *hist, Float_t valx, Float_t valy, Float_t weight)
......@@ -335,10 +390,10 @@ void Histogramer::FillHist2F(Hist2F *hist, Float_t valx, Float_t valy, Float_t w
hist->bins[bin] += weight;
hist->nevts++;
// cout<<hist->nevts<<" "<<bin<<" "<< binx << " " << valx << " " << biny << " " << valy <<" "<<hist->bins[bin]<<endl;
// cout<<hist->nevts<<" "<<bin<<" "<< binx << " " << valx << " " << biny << " " << valy <<" "<<hist->bins[bin]<<endl;
}
ActorMap *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumber)
void *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumber)
{
Log.ClearMessage();
Log.SetProcessMethod("NewHist2F");
......@@ -346,7 +401,9 @@ ActorMap *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumb
int fd;
ostringstream SMZ;
ActorMap *map_ptr = nullptr;
ProdMap *prodmap = nullptr;
PrepMap *prepmap = nullptr;
bool SMZ_exists = TestSMZ(name);
......@@ -384,7 +441,7 @@ ActorMap *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumb
SMZ << "\"port\":" << PortNumber << ", ";
SMZ << "\"log_level\":\"debug\"}'";
SMZ << " -H \"Content-Type: application/json\" -X POST ";
// cout<<SMZ.str()<<endl;
// cout<<SMZ.str()<<endl;
result = system(SMZ.str().data());
cout<<endl;
if(result==-1)
......@@ -399,7 +456,7 @@ ActorMap *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumb
SMZ << "\"name\":\"source_" << name << "\", ";
SMZ << "\"action\":\"connect\"}'";
SMZ << " -H \"Content-Type: application/json\" -X PUT ";
// cout<<SMZ.str()<<endl;
// cout<<SMZ.str()<<endl;
result = system(SMZ.str().data());
cout<<endl;
if(result==-1)
......@@ -421,23 +478,37 @@ ActorMap *Histogramer::CreateNewSMz(const char *name, Int_t Size, Int_t PortNumb
exit(EXIT_FAILURE);
}
//alocate the size of the shared memory zone
if (ftruncate(fd, sizeof(ActorMap)) == -1)
if (ftruncate(fd, Size) == -1)
{
fprintf(stderr, "truncate failed for hist %s :%s\n",name, strerror(errno));
exit(EXIT_FAILURE);
}
//map the data on a ActorMap pointer
map_ptr = (ActorMap*) mmap(NULL, sizeof(ActorMap), PROT_WRITE, MAP_SHARED, fd, 0);
if (map_ptr == MAP_FAILED)
if(fBasePortNumber==10)
prodmap = (ProdMap*) mmap(NULL, Size, PROT_WRITE, MAP_SHARED, fd, 0);
else if(fBasePortNumber==11)
prepmap = (PrepMap*) mmap(NULL, Size, PROT_WRITE, MAP_SHARED, fd, 0);
if ((prodmap && prodmap == MAP_FAILED) || (prepmap && prepmap == MAP_FAILED))
{
fprintf(stderr, "Map failed for hist %s :%s\n",name,strerror(errno));
exit(EXIT_FAILURE);
}
if(prodmap)
{
prodmap->N_TH1_Entries = 0;
prodmap->N_TH2_Entries = 0;
map_ptr->N_TH1_Entries = 0;
map_ptr->N_TH2_Entries = 0;
return prodmap;
}
else if(prepmap)
{
prepmap->N_TH1_Entries = 0;
prepmap->N_TH2_Entries = 0;
return map_ptr;
return prepmap;
}
else return nullptr;
}
bool Histogramer::TestSMZ(const char *name)
......
......@@ -110,11 +110,11 @@ protected:
virtual UInt_t GetParameters(const std::string& confFile, Bool_t doList=false){return 0;}
virtual void InitSMZ(Int_t){return;}
ActorMap *CreateNewSMz(const char *name, Int_t Size, Int_t PortNumber);
void *CreateNewSMz(const char *name, Int_t Size, Int_t PortNumber);
bool TestSMZ(const char *name);
Hist1F *NewHist1F(std::string name, std::string title, std::string xtitle, std::string gruname, int nbins, float min, float max, ActorMap *map_ptr, Int_t PortNumber);
Hist2F *NewHist2F(std::string name, std::string title, std::string xtitle, std::string ytitle, std::string gruname, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax, ActorMap *map_ptr, Int_t PortNumber);
Hist1F *NewHist1F(std::string name, std::string title, std::string xtitle, std::string gruname, int nbins, float min, float max, void *map_ptr, Int_t PortNumber);
Hist2F *NewHist2F(std::string name, std::string title, std::string xtitle, std::string ytitle, std::string gruname, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax, void *map_ptr, Int_t PortNumber);
void ResetHist1F(Hist1F *hist);
void FillHist1F(Hist1F *hist, Float_t val, Float_t weight=1.);
......
......@@ -162,7 +162,7 @@ UInt_t PreproHist::Process()
vector< void* > TSlist = fListOfHists[(Int_t)HistLib::TimeStamps];
if(fPlotTimeStamps && TSlist.size() == 3)
if(fPlotTimeStamps && TSlist.size() == 2)
{
if(fFirstTS == 0)
{
......@@ -173,11 +173,9 @@ UInt_t PreproHist::Process()
{
auto hists = (Hist1F*)TSlist[0];
auto histm = (Hist1F*)TSlist[1];
auto histh = (Hist1F*)TSlist[2];
double TSinSec = fmod((timestamp-fFirstTS)*10*1e-9,3600);
double TSinMin = fmod((timestamp-fFirstTS)*10*1e-9/60.,720);
double TSinH = fmod((timestamp-fFirstTS)*10*1e-9/3600.,48);
if((timestamp-fFirstTS)*10*1e-9 > fNextCycleSec)
{
......@@ -189,15 +187,9 @@ UInt_t PreproHist::Process()
ResetHist1F(histm);
fNextCycleMin += 720.;
}
if((timestamp-fFirstTS)*10*1e-9/3600. > fNextCycleH)
{
ResetHist1F(histh);
fNextCycleH += 48.;
}
FillHist1F(hists,TSinSec,(3600./3600.));
FillHist1F(histm,TSinMin,(3600./720.)/60.);
FillHist1F(histh,TSinH,(2880./48.)/3600.);
}
else
{
......@@ -352,11 +344,11 @@ void PreproHist::InitSMZ(Int_t id)
ostringstream YTitle;
ostringstream GruName;
ActorMap *map_ptr;
PrepMap *map_ptr = nullptr;
Int_t PortNumber = fBasePortNumber*1000 + id;
map_ptr = CreateNewSMz(mapname.str().data(),sizeof(ActorMap),PortNumber);
map_ptr = static_cast<PrepMap*>(CreateNewSMz(mapname.str().data(),sizeof(PrepMap),PortNumber));
if(fPlotAmpli)
{
......@@ -449,13 +441,5 @@ void PreproHist::InitSMZ(Int_t id)
hist1F = NewHist1F(Name.str(),Title.str(),XTitle.str(),GruName.str(),3600,0,720,map_ptr,PortNumber);
Name.str("");Title.str("");XTitle.str("");
if(hist1F) list.push_back(hist1F);
Name<<"Prepro_TimeStamp_Cry" << id << "_2d";
Title<<"Prepro_TS_Cry"<<CrystalName.data()<<"_2days (1bin=1min)";
XTitle<<"Elapsed time on the last 2 days (hours)";
hist1F = NewHist1F(Name.str(),Title.str(),XTitle.str(),GruName.str(),2880,0,48,map_ptr,PortNumber);
Name.str("");Title.str("");XTitle.str("");GruName.str("");
if(hist1F) list.push_back(hist1F);
}
}
......@@ -53,44 +53,40 @@ ProdHist::ProdHist() :
vector<void* > AmpliList;
fListOfHists.push_back(AmpliList);
vector<void* > Ampli_vs_Id_List;
fListOfHists.push_back(Ampli_vs_Id_List);
vector<void* > BaselineList;
fListOfHists.push_back(BaselineList);
// vector<void* > BaselineList;
// fListOfHists.push_back(BaselineList);
vector<void* > TimeStampList;
fListOfHists.push_back(TimeStampList);
fNextCycleSec = 3600.;
fNextCycleMin = 720.;
fNextCycleH = 48.;
fTraceLengthRaw = defTraceLengthRaw;
fTraceLengthPSA = defTraceLengthPSA;
// fTraceLengthRaw = defTraceLengthRaw;
// fTraceLengthPSA = defTraceLengthPSA;
memset(uTracesSG, 0, sizeof(uTracesSG));
memset(uTracesCC, 0, sizeof(uTracesCC));
memset(fTracesSG, 0, sizeof(fTracesSG));
memset(fTracesCC, 0, sizeof(fTracesCC));
// memset(uTracesSG, 0, sizeof(uTracesSG));
// memset(uTracesCC, 0, sizeof(uTracesCC));
// memset(fTracesSG, 0, sizeof(fTracesSG));
// memset(fTracesCC, 0, sizeof(fTracesCC));
}
ProdHist::~ProdHist()
{
cServer.Finish();
for(int nn = 0; nn < kNSG; nn++) {
if(uTracesSG[nn])
delete [] uTracesSG[nn];
if(fTracesSG[nn])
delete [] fTracesSG[nn];
}
for(int nn = 0; nn < kNCC; nn++) {
if(uTracesCC[nn])
delete [] uTracesCC[nn];
if(fTracesCC[nn])
delete [] fTracesCC[nn];
}
// for(int nn = 0; nn < kNSG; nn++) {
// if(uTracesSG[nn])
// delete [] uTracesSG[nn];
// if(fTracesSG[nn])
// delete [] fTracesSG[nn];
// }
// for(int nn = 0; nn < kNCC; nn++) {
// if(uTracesCC[nn])
// delete [] uTracesCC[nn];
// if(fTracesCC[nn])
// delete [] fTracesCC[nn];
// }
// in principle not needed ... just in case reset it has not been called by narval
UInt_t error = 0u; process_reset(&error) ;
......@@ -114,61 +110,49 @@ UInt_t ProdHist::Process()
auto hist = (Hist1F*)Amplilist[nn];
FillHist1F(hist,SegE[nn]);
if(fPlotAmplivsId && fListOfHists[(Int_t)HistLib::Ampli_vs_Id].size()==1)
{
auto hist2d = (Hist2F*)fListOfHists[(Int_t)HistLib::Ampli_vs_Id][0];
FillHist2F(hist2d,SegE[nn],nn);
}
}
for(int nn = 0; nn < kNCC; nn++)
{
auto hist = (Hist1F*)Amplilist[kNSG+nn];
FillHist1F(hist,CoreE[nn]);
if(fPlotAmplivsId && fListOfHists[(Int_t)HistLib::Ampli_vs_Id].size()==1)
{
auto hist2d = (Hist2F*)fListOfHists[(Int_t)HistLib::Ampli_vs_Id][0];
FillHist2F(hist2d,CoreE[nn],kNSG+nn);
}
}
}
vector< void* > Baselinelist = fListOfHists[(Int_t)HistLib::Baseline];
if(fPlotBaseline && Baselinelist.size() == (kNSG+kNCC))
{
int baseLen = (fTraceLengthRaw+4)/5;
baseLen = max(1, baseLen);
for(int nn = 0; nn < kNSG; nn++)
{
UInt_t baseVal = 0;
UShort_t *pW = uTracesSG[nn];
for(int ii = 0; ii < baseLen; ii++)
baseVal += *pW++;
baseVal /= baseLen;
SegBase[nn] = baseVal;
auto hist = (Hist1F*)Baselinelist[nn];
FillHist1F(hist,SegBase[nn]);
}
for(int nn = 0; nn < kNCC; nn++)
{
UInt_t baseVal = 0;
UShort_t *pW = uTracesCC[nn];
for(int ii = 0; ii < baseLen; ii++)
baseVal += *pW++;
baseVal /= baseLen;
CoreBase[nn] = baseVal;
auto hist = (Hist1F*)Baselinelist[kNSG+nn];
FillHist1F(hist,CoreBase[nn]);
}
}
// vector< void* > Baselinelist = fListOfHists[(Int_t)HistLib::Baseline];
// if(fPlotBaseline && Baselinelist.size() == (kNSG+kNCC))
// {
// int baseLen = (fTraceLengthRaw+4)/5;
// baseLen = max(1, baseLen);
// for(int nn = 0; nn < kNSG; nn++)
// {
// UInt_t baseVal = 0;
// UShort_t *pW = uTracesSG[nn];
// for(int ii = 0; ii < baseLen; ii++)
// baseVal += *pW++;
// baseVal /= baseLen;
// SegBase[nn] = baseVal;
// auto hist = (Hist1F*)Baselinelist[nn];
// FillHist1F(hist,SegBase[nn]);
// }
// for(int nn = 0; nn < kNCC; nn++)
// {
// UInt_t baseVal = 0;
// UShort_t *pW = uTracesCC[nn];
// for(int ii = 0; ii < baseLen; ii++)
// baseVal += *pW++;
// baseVal /= baseLen;
// CoreBase[nn] = baseVal;
// auto hist = (Hist1F*)Baselinelist[kNSG+nn];
// FillHist1F(hist,CoreBase[nn]);
// }
// }
vector< void* > TSlist = fListOfHists[(Int_t)HistLib::TimeStamps];
if(fPlotTimeStamps && TSlist.size() == 3)
if(fPlotTimeStamps && TSlist.size() == 2)
{
if(fFirstTS == 0)
{
......@@ -179,11 +163,9 @@ UInt_t ProdHist::Process()
{
auto hists = (Hist1F*)TSlist[0];
auto histm = (Hist1F*)TSlist[1];
auto histh = (Hist1F*)TSlist[2];
double TSinSec = fmod((timestamp-fFirstTS)*10*1e-9,3600);
double TSinMin = fmod((timestamp-fFirstTS)*10*1e-9/60.,720);
double TSinH = fmod((timestamp-fFirstTS)*10*1e-9/3600.,48);
if((timestamp-fFirstTS)*10*1e-9 > fNextCycleSec)
{
......@@ -195,15 +177,9 @@ UInt_t ProdHist::Process()
ResetHist1F(histm);
fNextCycleMin += 720.;
}
if((timestamp-fFirstTS)*10*1e-9/3600. > fNextCycleH)
{
ResetHist1F(histh);
fNextCycleH += 48.;
}
FillHist1F(hists,TSinSec,(3600./3600.));
FillHist1F(histm,TSinMin,(3600./720.)/60.);
FillHist1F(histh,TSinH,(2880./48.)/3600.);
}
else
{
......@@ -256,14 +232,14 @@ void ProdHist::process_initialise (UInt_t *error_code)
return;
}
for(int nn = 0; nn < kNSG; nn++) {
uTracesSG[nn] = new UShort_t[defTraceLengthRaw];
fTracesSG[nn] = new Float_t [defTraceLengthRaw];
}
for(int nn = 0; nn < kNCC; nn++) {
uTracesCC[nn] = new UShort_t[defTraceLengthRaw];
fTracesCC[nn] = new Float_t [defTraceLengthRaw];
}
// for(int nn = 0; nn < kNSG; nn++) {
// uTracesSG[nn] = new UShort_t[defTraceLengthRaw];
// fTracesSG[nn] = new Float_t [defTraceLengthRaw];
// }
// for(int nn = 0; nn < kNCC; nn++) {
// uTracesCC[nn] = new UShort_t[defTraceLengthRaw];
// fTracesCC[nn] = new Float_t [defTraceLengthRaw];
// }
// state set to kIdle so that the data can be treated
fFrameIO.SetStatus(BaseFrameIO::kIdle);
......@@ -287,18 +263,18 @@ Int_t ProdHist::SetInput()
frame_in->Read();
// get the real length from the data (assuming all traces have the same length)
fTraceLengthRaw = cdata->GetCore(0)->GetSignal()->GetLength();
// fTraceLengthRaw = cdata->GetCore(0)->GetSignal()->GetLength();
for(int iseg = 0; iseg < kNSG; iseg++)
{
seg = cdata->GetSegment(iseg);
SegE[iseg] = (Float_t)seg->GetE();
seg->GetSignal()->Get(uTracesSG[iseg], fTraceLengthRaw);
UShort_t *pu = uTracesSG[iseg];
Float_t *pf = fTracesSG[iseg];
for(UInt_t ii = 0; ii < fTraceLengthRaw; ii++)
*pf++ = (Float_t)*pu++;
// seg->GetSignal()->Get(uTracesSG[iseg], fTraceLengthRaw);
// UShort_t *pu = uTracesSG[iseg];
// Float_t *pf = fTracesSG[iseg];
// for(UInt_t ii = 0; ii < fTraceLengthRaw; ii++)
// *pf++ = (Float_t)*pu++;
}
for(UShort_t icc=0; icc<kNCC; icc++)
......@@ -307,11 +283,11 @@ Int_t ProdHist::SetInput()
CoreE[icc] =