OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Probe.h
Go to the documentation of this file.
1//
2// Class Probe
3// Interface for a probe
4//
5// Copyright (c) 2016-2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef CLASSIC_Probe_HH
19#define CLASSIC_Probe_HH
20
23
24#include <memory>
25#include <string>
26
27class BeamlineVisitor;
28template <class T, unsigned int Dim> class PartBunchBase;
29class PeakFinder;
30
31class Probe: public PluginElement {
32
33public:
35 explicit Probe(const std::string &name);
36
37 Probe();
38 Probe(const Probe &);
39 void operator=(const Probe &) = delete;
40 virtual ~Probe();
41
43 virtual void accept(BeamlineVisitor &) const override;
44
46 void setStep(double step);
48 virtual double getStep() const;
50 virtual ElementType getType() const override;
51
52private:
54 virtual void doInitialise(PartBunchBase<double, 3> *bunch) override;
56 virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
58 virtual void doGoOffline() override;
60 virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
61
62 double step_m;
63 std::unique_ptr<PeakFinder> peakfinder_m;
64};
65
66#endif // CLASSIC_Probe_HH
ElementType
Definition ElementBase.h:89
const std::string name
Definition Probe.h:31
void setStep(double step)
Set probe histogram bin width.
Definition Probe.cpp:70
virtual ~Probe()
Definition Probe.cpp:47
std::unique_ptr< PeakFinder > peakfinder_m
Pointer to Peakfinder instance.
Definition Probe.h:63
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record probe hits when bunch particles pass.
Definition Probe.cpp:100
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise peakfinder file.
Definition Probe.cpp:53
double step_m
Step size of the probe (bin width in histogram file)
Definition Probe.h:62
Probe()
Definition Probe.cpp:34
void operator=(const Probe &)=delete
virtual void doGoOffline() override
Hook for goOffline.
Definition Probe.cpp:63
virtual ElementType getType() const override
Get element type std::string.
Definition Probe.cpp:152
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition Probe.cpp:78
virtual double getStep() const
Member variable access.
Definition Probe.cpp:74
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Probe.
Definition Probe.cpp:49