Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed using namespace std from header files and fix errors #50

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion inc/TRestRawAFTERToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct EventHeader {
// uint16_t dummy;
};


// ATENTION!!!!!
// New verison of the DaqT2K (2.x)
// added 30th July 2012 (JuanAn)
Expand Down
1 change: 1 addition & 0 deletions inc/TRestRawCommonNoiseReductionProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define RestCore_TRestRawCommonNoiseReductionProcess

#include <TRestRawSignalEvent.h>

#include "TRestEventProcess.h"
#include "TRestRawSignal.h"

Expand Down
22 changes: 10 additions & 12 deletions inc/TRestRawFEUDreamToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
#ifndef RestCore_TRestFEUDreamToSignalProcess
#define RestCore_TRestFEUDreamToSignalProcess

#include "TRestRawSignalEvent.h"
#include "TRestRawToSignalProcess.h"

#include <arpa/inet.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <TError.h>
#include <TF1.h>
#include <TH1D.h>
Expand All @@ -42,13 +31,22 @@
#include <TROOT.h>
#include <TSystem.h>
#include <TTree.h>

#include <arpa/inet.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <iostream>
#include <list>
#include <map>
#include <string>
#include <vector>

#include "TRestRawSignalEvent.h"
#include "TRestRawToSignalProcess.h"
#include "math.h"

//! An process to read binary data from FEUDream electronics
Expand Down
5 changes: 2 additions & 3 deletions inc/TRestRawFFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
#ifndef RestCore_TRestRawFFT
#define RestCore_TRestRawFFT

#include <iostream>

#include <TArrayD.h>
#include <TObject.h>

#include <TRestRawSignal.h>

#include <iostream>

class TRestRawFFT : public TObject {
protected:
Int_t fNfft;
Expand Down
2 changes: 1 addition & 1 deletion inc/TRestRawFindResponseSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TRestRawFindResponseSignalProcess : public TRestEventProcess {
TRestEvent* ProcessEvent(TRestEvent* eventInput);
void EndProcess();

void LoadConfig(std::string cfgFilename, string name = "");
void LoadConfig(std::string cfgFilename, std::string name = "");

void PrintMetadata() {
BeginPrintProcess();
Expand Down
33 changes: 17 additions & 16 deletions inc/TRestRawMultiCoBoAsAdToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define RestCore_TRestRawMultiCoBoAsAdToSignalProcess

#include <map>

#include "TRestRawSignalEvent.h"
#include "TRestRawToSignalProcess.h"

Expand Down Expand Up @@ -72,20 +73,20 @@ struct CoBoHeaderFrame {
// int fEveTimeNanoSec;

void Show() {
cout << "------ Frame Header ------" << endl;
cout << "frameSize " << frameSize << endl;

cout << "frameType " << frameType << endl;
cout << "revision " << revision << endl;
cout << "headerSize " << headerSize << endl;
cout << "itemSize " << itemSize << endl;
cout << "nItems " << nItems << endl;
cout << "eventTime " << eventTime << endl;
cout << "eventIdx " << eventIdx << endl;

cout << "asadIdx " << asadIdx << endl;
cout << "readOffset " << readOffset << endl;
cout << "status " << status << endl;
std::cout << "------ Frame Header ------" << endl;
std::cout << "frameSize " << frameSize << endl;

std::cout << "frameType " << frameType << endl;
std::cout << "revision " << revision << endl;
std::cout << "headerSize " << headerSize << endl;
std::cout << "itemSize " << itemSize << endl;
std::cout << "nItems " << nItems << endl;
std::cout << "eventTime " << eventTime << endl;
std::cout << "eventIdx " << eventIdx << endl;

std::cout << "asadIdx " << asadIdx << endl;
std::cout << "readOffset " << readOffset << endl;
std::cout << "status " << status << endl;
}
};

Expand All @@ -101,7 +102,7 @@ class TRestRawMultiCoBoAsAdToSignalProcess : public TRestRawToSignalProcess {

std::map<int, CoBoDataFrame> fDataFrame; //!///asadId, dataframe

vector<CoBoHeaderFrame> fHeaderFrame; //!///reserves a header frame for each file
std::vector<CoBoHeaderFrame> fHeaderFrame; //!///reserves a header frame for each file

int fCurrentEvent = -1; //!
int fNextEvent = -1; //!
Expand All @@ -110,7 +111,7 @@ class TRestRawMultiCoBoAsAdToSignalProcess : public TRestRawToSignalProcess {
public:
void InitProcess();

Bool_t AddInputFile(string file);
Bool_t AddInputFile(std::string file);

void Initialize();

Expand Down
8 changes: 4 additions & 4 deletions inc/TRestRawSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#ifndef RestCore_TRestRawSignal
#define RestCore_TRestRawSignal

#include <iostream>

#include <TGraph.h>
#include <TObject.h>
#include <TString.h>
#include <TVector2.h>

#include <iostream>

//! It defines a Short_t array with a physical parameter that evolves in time
//! using a fixed time bin.
class TRestRawSignal : public TObject {
Expand All @@ -52,7 +52,7 @@ class TRestRawSignal : public TObject {
/// A TGraph pointer used to store the TRestRawSignal drawing
TGraph* fGraph; //!

/// A vector containing the index of points that are identified over
/// A std::vector containing the index of points that are identified over
/// threshold.
std::vector<Int_t> fPointsOverThreshold; //!

Expand Down Expand Up @@ -89,7 +89,7 @@ class TRestRawSignal : public TObject {
/// Returns the actual number of points, or size of the signal
Int_t GetNumberOfPoints() { return fSignalData.size(); }

/// Returns a vector containing the indexes of data points over threshold
/// Returns a std::vector containing the indexes of data points over threshold
std::vector<Int_t> GetPointsOverThreshold() { return fPointsOverThreshold; }

/// Returns the maximum value found in the data points. It includes baseline
Expand Down
2 changes: 1 addition & 1 deletion inc/TRestRawSignalAddNoiseProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TRestRawSignalAddNoiseProcess : public TRestEventProcess {
TRestEvent* ProcessEvent(TRestEvent* eventInput);
void EndProcess();

void LoadConfig(std::string cfgFilename, string name = "");
void LoadConfig(std::string cfgFilename, std::string name = "");

void PrintMetadata() {
BeginPrintProcess();
Expand Down
1 change: 1 addition & 0 deletions inc/TRestRawSignalChannelActivityProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#endif

#include <TRestRawSignalEvent.h>

#include "TRestEventProcess.h"

//! A pure analysis process to generate histograms with detector channels
Expand Down
12 changes: 6 additions & 6 deletions inc/TRestRawSignalEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#ifndef RestDAQ_TRestRawSignalEvent
#define RestDAQ_TRestRawSignalEvent

#include <iostream>

#include <TArrayD.h>
#include <TAxis.h>
#include <TGraph.h>
Expand All @@ -33,6 +31,8 @@
#include <TPad.h>
#include <TVector2.h>

#include <iostream>

#include "TRestEvent.h"
#include "TRestRawSignal.h"

Expand Down Expand Up @@ -61,7 +61,7 @@ class TRestRawSignalEvent : public TRestEvent {
}

// Setters
void AddSignal(TRestRawSignal &s);
void AddSignal(TRestRawSignal& s);

void RemoveSignalWithId(Int_t sId);

Expand Down Expand Up @@ -91,10 +91,10 @@ class TRestRawSignalEvent : public TRestEvent {

void PrintSignalIds() {
for (int n = 0; n < GetNumberOfSignals(); n++) {
if (n > 0) cout << " , ";
cout << GetSignal(n)->GetSignalID();
if (n > 0) std::cout << " , ";
std::cout << GetSignal(n)->GetSignalID();
}
cout << endl;
std::cout << std::endl;
}

std::vector<int> GetSignalIds() {
Expand Down
3 changes: 2 additions & 1 deletion inc/TRestRawSignalFitEventProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define RestCore_TRestRawSignalFitEventProcess

#include <TRestRawSignalEvent.h>

#include "TF1Convolution.h"
#include "TH1D.h"
#include "TMath.h"
Expand Down Expand Up @@ -112,7 +113,7 @@ class TRestRawSignalFitEventProcess : public TRestEventProcess {
if (fAgetFit == false) {
metadata << "Fitting mode : Convolution" << endl;
}

if (fAddAllPulses == true) {
metadata << "Adding all pulses in the event" << endl;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestRawSignalFittingProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TRestRawSignalFittingProcess : public TRestEventProcess {
void Initialize();

void LoadDefaultConfig();

Double_t fShaping = 0;
Double_t fStartPosition = 0;
Double_t fBaseline = 0;
Expand All @@ -51,7 +51,7 @@ class TRestRawSignalFittingProcess : public TRestEventProcess {
public:
any GetInputEvent() { return fRawSignalEvent; }
any GetOutputEvent() { return fRawSignalEvent; }

Double_t GetShaping() { return fShaping; }
Double_t GetStartPosition() { return fStartPosition; }
Double_t GetBaseline() { return fBaseline; }
Expand Down
4 changes: 2 additions & 2 deletions inc/TRestRawSignalGeneralFitProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TRestRawSignalGeneralFitProcess : public TRestEventProcess {
void LoadDefaultConfig();

TVector2 fFunctionRange = TVector2(0, 0);
string fFunction;
std::string fFunction;

TF1* fFitFunc = nullptr; //!

Expand Down Expand Up @@ -73,7 +73,7 @@ class TRestRawSignalGeneralFitProcess : public TRestEventProcess {
void PrintMetadata() {
BeginPrintProcess();

metadata << "Function string: " << fFunction << endl;
metadata << "Function std::string: " << fFunction << endl;
metadata << "Range: ( " << fFunctionRange.X() << " , " << fFunctionRange.Y() << " ) " << endl;

EndPrintProcess();
Expand Down
2 changes: 1 addition & 1 deletion inc/TRestRawSignalRemoveChannelsProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TRestRawSignalRemoveChannelsProcess : public TRestEventProcess {

TRestEvent* ProcessEvent(TRestEvent* eventInput);

void LoadConfig(std::string cfgFilename, string name = "");
void LoadConfig(std::string cfgFilename, std::string name = "");

/// It prints out the process parameters stored in the metadata structure
void PrintMetadata() {
Expand Down
7 changes: 3 additions & 4 deletions inc/TRestRawSignalViewerProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define RestCore_TRestRawSignalViewerProcess

#include <TH1D.h>

#include <TRestRawSignalEvent.h>

#include "TRestEventProcess.h"
Expand All @@ -35,8 +34,8 @@ class TRestRawSignalViewerProcess : public TRestEventProcess {
private:
TRestRawSignalEvent* fSignalEvent; //!

vector<TObject*> fDrawingObjects; //!
Double_t fDrawRefresh; //!
std::vector<TObject*> fDrawingObjects; //!
Double_t fDrawRefresh; //!

TVector2 fBaseLineRange; //!
int eveCounter = 0; //!
Expand Down Expand Up @@ -67,7 +66,7 @@ class TRestRawSignalViewerProcess : public TRestEventProcess {
void PrintMetadata() {
BeginPrintProcess();

cout << "Refresh value : " << fDrawRefresh << endl;
std::cout << "Refresh value : " << fDrawRefresh << endl;

EndPrintProcess();
}
Expand Down
10 changes: 5 additions & 5 deletions inc/TRestRawToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TRestRawToSignalProcess : public TRestEventProcess {
virtual void InitFromConfigFile();
unsigned int payload;
unsigned int frameBits;
string fElectronicsType; // AFTER or AGET
std::string fElectronicsType; // AFTER or AGET
Int_t fMinPoints;

Double_t tStart;
Expand All @@ -49,7 +49,7 @@ class TRestRawToSignalProcess : public TRestEventProcess {
Int_t nFiles; //!
Int_t iCurFile; //!
std::vector<FILE*> fInputFiles; //!
std::vector<string> fInputFileNames;
std::vector<std::string> fInputFileNames;
bool fgKeepFileOpen; //! true if need to open all raw files at the beginning

Int_t fShowSamples; //!
Expand Down Expand Up @@ -77,15 +77,15 @@ class TRestRawToSignalProcess : public TRestEventProcess {

// Bool_t OpenInputBinFile(TString fName);

virtual Bool_t OpenInputFiles(vector<string> files);
virtual Bool_t AddInputFile(string file);
virtual Bool_t OpenInputFiles(std::vector<std::string> files);
virtual Bool_t AddInputFile(std::string file);
Bool_t ResetEntry();

virtual Long64_t GetTotalBytesReaded() { return totalBytesReaded; }
virtual Long64_t GetTotalBytes() { return totalBytes; }
// Int_t GetRunNumber(){return fRunNumber;}
// Int_t GetRunIndex(){return fRunIndex;}
virtual string GetElectronicsType() { return fElectronicsType; }
virtual std::string GetElectronicsType() { return fElectronicsType; }

Bool_t GoToNextFile();

Expand Down
17 changes: 9 additions & 8 deletions inc/TRestRawUSTCToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define RestCore_TRestRawUSTCToSignalProcess

#include <map>

#include "TRestRawToSignalProcess.h"

//#define V3_Readout_Format_Long
Expand Down Expand Up @@ -88,14 +89,14 @@ class TRestRawUSTCToSignalProcess : public TRestRawToSignalProcess {
UChar_t fHeader[64];
UChar_t fEnding[32];

vector<vector<USTCDataFrame>> fEventBuffer; //!
int nBufferedEvent; //!
int fCurrentFile = 0; //!
int fCurrentEvent = -1; //!
int fCurrentBuffer = 0; //!
int fLastBufferedId = 0; //!
vector<int> errorevents; //!
int unknownerrors = 0; //!
std::vector<std::vector<USTCDataFrame>> fEventBuffer; //!
int nBufferedEvent; //!
int fCurrentFile = 0; //!
int fCurrentEvent = -1; //!
int fCurrentBuffer = 0; //!
int fLastBufferedId = 0; //!
std::vector<int> errorevents; //!
int unknownerrors = 0; //!

Long64_t fTimeOffset = 0;
std::set<int> fChannelOffset;
Expand Down
Loading