diff --git a/macros/REST_Detector_CheckReadout.C b/macros/REST_Detector_CheckReadout.C index ed7f62ec..ba7d68fb 100644 --- a/macros/REST_Detector_CheckReadout.C +++ b/macros/REST_Detector_CheckReadout.C @@ -87,7 +87,8 @@ Int_t REST_Detector_CheckReadout(TString rootFile, TString name, Double_t region vector modGraph(nModConst); vector channelIDLabel(nPixConst); - double xmin = 1E9, xmax = -1E9, ymin = 1E9, ymax = -1E9; + double xmin = std::numeric_limits::max(), xmax = std::numeric_limits::min(), + ymin = std::numeric_limits::max(), ymax = std::numeric_limits::min(); Int_t graph = 0; Int_t modGraphID = 0; diff --git a/macros/REST_Detector_ViewReadout.C b/macros/REST_Detector_ViewReadout.C index 24470c19..b892b9f7 100644 --- a/macros/REST_Detector_ViewReadout.C +++ b/macros/REST_Detector_ViewReadout.C @@ -67,7 +67,8 @@ int REST_Detector_ViewReadout(TString rootFile, TString name = "", Int_t plane = vector modGraph(nModConst); vector channelIDLabel(nPixConst); - double xmin = 1E9, xmax = -1E9, ymin = 1E9, ymax = -1E9; + double xmin = std::numeric_limits::max(), xmax = std::numeric_limits::min(), + ymin = std::numeric_limits::max(), ymax = std::numeric_limits::min(); Int_t graph = 0; Int_t modGraphID = 0; @@ -120,9 +121,9 @@ int REST_Detector_ViewReadout(TString rootFile, TString name = "", Int_t plane = // pixelGraph[graph]->SetMinimum( -200 ); // pixelGraph[graph]->GetXaxis()->SetLimits(-200,200); - Double_t xMin = 1e10; - Double_t yMin = 1e10; - Double_t xMax = -1e10; + Double_t xMin = numeric_limits::max(); + Double_t yMin = numeric_limits::max(); + Double_t xMax = numeric_limits::min(); for (int l = 0; l < 5; l++) { if (x[l] < xMin) xMin = x[l]; if (y[l] < yMin) yMin = y[l]; diff --git a/src/TRestDetectorDaqChannelSwitchingProcess.cxx b/src/TRestDetectorDaqChannelSwitchingProcess.cxx index d04799ac..0c81e040 100644 --- a/src/TRestDetectorDaqChannelSwitchingProcess.cxx +++ b/src/TRestDetectorDaqChannelSwitchingProcess.cxx @@ -45,7 +45,7 @@ void TRestDetectorDaqChannelSwitchingProcess::InitProcess() { auto mod = fReadout->GetReadoutModuleWithID(iter->first); if (mod == nullptr) continue; // finding out the old "firstdaqchannel" value - int mindaq = 1e9; + int mindaq = std::numeric_limits::max(); for (size_t i = 0; i < mod->GetNumberOfChannels(); i++) { if (mod->GetChannel(i)->GetDaqID() < mindaq) { mindaq = mod->GetChannel(i)->GetDaqID(); diff --git a/src/TRestDetectorGarfieldDriftProcess.cxx b/src/TRestDetectorGarfieldDriftProcess.cxx index b1d437e9..8f6bb7bf 100644 --- a/src/TRestDetectorGarfieldDriftProcess.cxx +++ b/src/TRestDetectorGarfieldDriftProcess.cxx @@ -264,7 +264,8 @@ void TRestDetectorGarfieldDriftProcess::InitProcess() { fGfSensor->AddElectrode(fGeometry->GetGfComponent(0), "m"); fGfSensor->SetTimeWindow(0., 0.1, 500); - double xmin = -1e9, xmax = 1e9, ymin = -1e9, ymax = 1e9; + double xmin = std::numeric_limits::min(), xmax = std::numeric_limits::max(), + ymin = std::numeric_limits::min(), ymax = std::numeric_limits::max(); TGeoShape* readoutshape = fGeometry->GetReadoutElecNode(0)->GetVolume()->GetShape(); TGeoMatrix* readoutmatrix = fGeometry->GetReadoutElecNode(0)->GetMatrix(); double xmid = 10. * readoutmatrix->GetTranslation()[0], diff --git a/src/TRestDetectorGas.cxx b/src/TRestDetectorGas.cxx index 10edf744..2a862d96 100644 --- a/src/TRestDetectorGas.cxx +++ b/src/TRestDetectorGas.cxx @@ -223,7 +223,7 @@ using namespace std; ClassImp(TRestDetectorGas); -// const char* defaultServer = "https://sultan.unizar.es/gasFiles/"; +// const char* defaultServer = "https://rest-for-physics.github.io/gas-files/"; ///////////////////////////////////////////// /// \brief TRestDetectorGas default constructor diff --git a/src/TRestDetectorHits3DReconstructionProcess.cxx b/src/TRestDetectorHits3DReconstructionProcess.cxx index 32667cc6..4c727ef7 100644 --- a/src/TRestDetectorHits3DReconstructionProcess.cxx +++ b/src/TRestDetectorHits3DReconstructionProcess.cxx @@ -548,7 +548,7 @@ TRestEvent* TRestDetectorHits3DReconstructionProcess::ProcessEvent(TRestEvent* i .z(); double dz = maxz2 - maxz1; - double mindistmean = 1e9; + double mindistmean = std::numeric_limits::max(); for (double i = -fZRange * 2; i <= fZRange * 2; i += fZRange / 2) { double distsum2 = 0; for (auto hit : hits1) { diff --git a/src/TRestDetectorReadoutEventViewer.cxx b/src/TRestDetectorReadoutEventViewer.cxx index 388a37d1..d4f06055 100644 --- a/src/TRestDetectorReadoutEventViewer.cxx +++ b/src/TRestDetectorReadoutEventViewer.cxx @@ -96,7 +96,7 @@ void TRestDetectorReadoutEventViewer::DrawReadoutPulses() { int maxIndex; - zmin = 1E9; + zmin = std::numeric_limits::max(); zmax = 1E-9; double z; diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 06e1d5a3..69a7a769 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -419,7 +419,8 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double Double_t x[4]; Double_t y[4]; - xmin = 1E9, xmax = -1E9, ymin = 1E9, ymax = -1E9; + xmin = std::numeric_limits::max(), xmax = std::numeric_limits::min(), + ymin = std::numeric_limits::max(), ymax = std::numeric_limits::min(); for (size_t mdID = 0; mdID < this->GetNumberOfModules(); mdID++) { TRestDetectorReadoutModule* module = &fReadoutModules[mdID]; diff --git a/src/TRestDetectorSignalEvent.cxx b/src/TRestDetectorSignalEvent.cxx index 5133de36..fe51dc9e 100644 --- a/src/TRestDetectorSignalEvent.cxx +++ b/src/TRestDetectorSignalEvent.cxx @@ -40,10 +40,10 @@ void TRestDetectorSignalEvent::Initialize() { TRestEvent::Initialize(); fSignal.clear(); fPad = nullptr; - fMinValue = 1E10; - fMaxValue = -1E10; - fMinTime = 1E10; - fMaxTime = -1E10; + fMinValue = std::numeric_limits::max(); + fMaxValue = std::numeric_limits::min(); + fMinTime = std::numeric_limits::max(); + fMaxTime = std::numeric_limits::min(); } void TRestDetectorSignalEvent::AddSignal(const TRestDetectorSignal& signal) { @@ -112,10 +112,10 @@ void TRestDetectorSignalEvent::PrintEvent() { // TODO: GetMaxTimeFast, GetMinTimeFast, GetMaxValueFast that return the value of fMinTime, fMaxTime, etc. void TRestDetectorSignalEvent::SetMaxAndMin() { - fMinValue = 1E10; - fMaxValue = -1E10; - fMinTime = 1E10; - fMaxTime = -1E10; + fMinValue = std::numeric_limits::max(); + fMaxValue = std::numeric_limits::min(); + fMinTime = std::numeric_limits::max(); + fMaxTime = std::numeric_limits::min(); for (int s = 0; s < GetNumberOfSignals(); s++) { if (fMinTime > fSignal[s].GetMinTime()) fMinTime = fSignal[s].GetMinTime(); @@ -137,7 +137,7 @@ Double_t TRestDetectorSignalEvent::GetMinValue() { } Double_t TRestDetectorSignalEvent::GetMinTime() { - Double_t minTime = 1.e10; + Double_t minTime = numeric_limits::max(); for (int s = 0; s < GetNumberOfSignals(); s++) if (minTime > fSignal[s].GetMinTime()) { minTime = fSignal[s].GetMinTime(); @@ -146,7 +146,7 @@ Double_t TRestDetectorSignalEvent::GetMinTime() { } Double_t TRestDetectorSignalEvent::GetMaxTime() { - Double_t maxTime = -1.e10; + Double_t maxTime = numeric_limits::min(); for (int s = 0; s < GetNumberOfSignals(); s++) { if (maxTime < fSignal[s].GetMaxTime()) { maxTime = fSignal[s].GetMaxTime(); @@ -166,10 +166,10 @@ TPad* TRestDetectorSignalEvent::DrawEvent(const TString& option) { return nullptr; } - fMinValue = 1E10; - fMaxValue = -1E10; - fMinTime = 1E10; - fMaxTime = -1E10; + fMinValue = std::numeric_limits::max(); + fMaxValue = std::numeric_limits::min(); + fMinTime = std::numeric_limits::max(); + fMaxTime = std::numeric_limits::min(); fPad = new TPad(this->GetName(), " ", 0, 0, 1, 1); fPad->Draw(); diff --git a/src/TRestDetectorSingleChannelAnalysisProcess.cxx b/src/TRestDetectorSingleChannelAnalysisProcess.cxx index 4dc341a5..142462ad 100644 --- a/src/TRestDetectorSingleChannelAnalysisProcess.cxx +++ b/src/TRestDetectorSingleChannelAnalysisProcess.cxx @@ -191,7 +191,7 @@ void TRestDetectorSingleChannelAnalysisProcess::FitChannelGain() { TSpectrum spc; int n = spc.Search(h); double* peaks = spc.GetPositionX(); - double min = 1e9; + double min = std::numeric_limits::max(); int minpos = 0; for (int i = 0; i < n; i++) { double dist = abs(peaks[i] - middle);