OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PeakFinder Class Reference

#include <PeakFinder.h>

Collaboration diagram for PeakFinder:

Public Types

using container_t = std::vector<double>

Public Member Functions

 PeakFinder ()=delete
 PeakFinder (std::string elem, double min, double max, double binwidth, bool singlemode)
void addParticle (const Vector_t &R)
void evaluate (const int &turn)
void save ()

Private Member Functions

void createHistogram_m ()
void open_m ()
 Open output file.
void append_m ()
 Open output file in append mode.
void close_m ()
 Close output file.
void saveASCII_m ()
 Write to output file.
void computeCentroid_m ()

Private Attributes

container_t radius_m
container_t globHist_m
 global histogram values
std::string fileName_m
 filename with extension (.peaks)
std::string hist_m
 histogram filename with extension (.hist)
std::ofstream os_m
 used to write out the data
std::ofstream hos_m
 used to write out the histrogram
std::string outputName_m
 Element/probe name, for name output file.
unsigned int nBins_m
 Number of bins.
double binWidth_m
 Bin width in mm.
double min_m
 histogram size
double max_m
int turn_m
double peakRadius_m
int registered_m
std::list< double > peaks_m
bool singlemode_m
bool first_m
bool finished_m

Detailed Description

Definition at line 32 of file PeakFinder.h.

Member Typedef Documentation

◆ container_t

using PeakFinder::container_t = std::vector<double>

Definition at line 35 of file PeakFinder.h.

Constructor & Destructor Documentation

◆ PeakFinder() [1/2]

PeakFinder::PeakFinder ( )
delete

References max(), and min().

Here is the call graph for this function:

◆ PeakFinder() [2/2]

PeakFinder::PeakFinder ( std::string elem,
double min,
double max,
double binwidth,
bool singlemode )

Definition at line 35 of file PeakFinder.cpp.

References binWidth_m, finished_m, first_m, max(), max_m, min(), min_m, nBins_m, outputName_m, peakRadius_m, registered_m, singlemode_m, and turn_m.

Here is the call graph for this function:

Member Function Documentation

◆ addParticle()

void PeakFinder::addParticle ( const Vector_t & R)

Append the particle coordinates to the container

Parameters
Ris a particle position (x, y, z)

Definition at line 56 of file PeakFinder.cpp.

References peakRadius_m, radius_m, and registered_m.

◆ append_m()

void PeakFinder::append_m ( )
private

Open output file in append mode.

Definition at line 184 of file PeakFinder.cpp.

References fileName_m, hist_m, hos_m, and os_m.

Referenced by save().

◆ close_m()

void PeakFinder::close_m ( )
private

Close output file.

Definition at line 190 of file PeakFinder.cpp.

References hos_m, and os_m.

Referenced by save().

◆ computeCentroid_m()

void PeakFinder::computeCentroid_m ( )
private

Definition at line 130 of file PeakFinder.cpp.

References IpplInfo::myNode(), peakRadius_m, peaks_m, reduce(), registered_m, and singlemode_m.

Referenced by evaluate(), and save().

Here is the call graph for this function:

◆ createHistogram_m()

void PeakFinder::createHistogram_m ( )
private

Definition at line 149 of file PeakFinder.cpp.

References binWidth_m, globHist_m, min_m, nBins_m, radius_m, reduce(), and singlemode_m.

Referenced by save().

Here is the call graph for this function:

◆ evaluate()

void PeakFinder::evaluate ( const int & turn)

Evaluate the centroid of a turn.

Definition at line 66 of file PeakFinder.cpp.

References allreduce(), computeCentroid_m(), finished_m, first_m, peakRadius_m, registered_m, singlemode_m, and turn_m.

Here is the call graph for this function:

◆ open_m()

void PeakFinder::open_m ( )
private

Open output file.

Definition at line 178 of file PeakFinder.cpp.

References fileName_m, hist_m, hos_m, and os_m.

Referenced by save().

◆ save()

void PeakFinder::save ( )

Definition at line 98 of file PeakFinder.cpp.

References append_m(), OpalData::checkAndAddOutputFileName(), close_m(), computeCentroid_m(), createHistogram_m(), endl(), fileName_m, OpalData::getInstance(), globHist_m, gmsg, hist_m, level2(), open_m(), outputName_m, peaks_m, radius_m, and saveASCII_m().

Here is the call graph for this function:

◆ saveASCII_m()

void PeakFinder::saveASCII_m ( )
private

Write to output file.

Definition at line 196 of file PeakFinder.cpp.

References binWidth_m, globHist_m, hos_m, max_m, min_m, nBins_m, os_m, and peaks_m.

Referenced by save().

Member Data Documentation

◆ binWidth_m

double PeakFinder::binWidth_m
private

Bin width in mm.

Definition at line 99 of file PeakFinder.h.

Referenced by createHistogram_m(), PeakFinder(), and saveASCII_m().

◆ fileName_m

std::string PeakFinder::fileName_m
private

filename with extension (.peaks)

Definition at line 81 of file PeakFinder.h.

Referenced by append_m(), open_m(), and save().

◆ finished_m

bool PeakFinder::finished_m
private

Definition at line 109 of file PeakFinder.h.

Referenced by evaluate(), and PeakFinder().

◆ first_m

bool PeakFinder::first_m
private

Definition at line 108 of file PeakFinder.h.

Referenced by evaluate(), and PeakFinder().

◆ globHist_m

container_t PeakFinder::globHist_m
private

global histogram values

Definition at line 78 of file PeakFinder.h.

Referenced by createHistogram_m(), save(), and saveASCII_m().

◆ hist_m

std::string PeakFinder::hist_m
private

histogram filename with extension (.hist)

Definition at line 84 of file PeakFinder.h.

Referenced by append_m(), open_m(), and save().

◆ hos_m

std::ofstream PeakFinder::hos_m
private

used to write out the histrogram

Definition at line 90 of file PeakFinder.h.

Referenced by append_m(), close_m(), open_m(), and saveASCII_m().

◆ max_m

double PeakFinder::max_m
private

Definition at line 101 of file PeakFinder.h.

Referenced by PeakFinder(), and saveASCII_m().

◆ min_m

double PeakFinder::min_m
private

histogram size

Definition at line 101 of file PeakFinder.h.

Referenced by createHistogram_m(), PeakFinder(), and saveASCII_m().

◆ nBins_m

unsigned int PeakFinder::nBins_m
private

Number of bins.

Definition at line 97 of file PeakFinder.h.

Referenced by createHistogram_m(), PeakFinder(), and saveASCII_m().

◆ os_m

std::ofstream PeakFinder::os_m
private

used to write out the data

Definition at line 87 of file PeakFinder.h.

Referenced by append_m(), close_m(), open_m(), and saveASCII_m().

◆ outputName_m

std::string PeakFinder::outputName_m
private

Element/probe name, for name output file.

Definition at line 93 of file PeakFinder.h.

Referenced by PeakFinder(), and save().

◆ peakRadius_m

double PeakFinder::peakRadius_m
private

Definition at line 104 of file PeakFinder.h.

Referenced by addParticle(), computeCentroid_m(), evaluate(), and PeakFinder().

◆ peaks_m

std::list<double> PeakFinder::peaks_m
private

Definition at line 106 of file PeakFinder.h.

Referenced by computeCentroid_m(), save(), and saveASCII_m().

◆ radius_m

container_t PeakFinder::radius_m
private

Definition at line 76 of file PeakFinder.h.

Referenced by addParticle(), createHistogram_m(), and save().

◆ registered_m

int PeakFinder::registered_m
private

Definition at line 105 of file PeakFinder.h.

Referenced by addParticle(), computeCentroid_m(), evaluate(), and PeakFinder().

◆ singlemode_m

bool PeakFinder::singlemode_m
private

Definition at line 107 of file PeakFinder.h.

Referenced by computeCentroid_m(), createHistogram_m(), evaluate(), and PeakFinder().

◆ turn_m

int PeakFinder::turn_m
private

Definition at line 103 of file PeakFinder.h.

Referenced by evaluate(), and PeakFinder().


The documentation for this class was generated from the following files: