OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
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 
22 
23 #include <memory>
24 #include <string>
25 
26 class PeakFinder;
27 
28 class Probe: public PluginElement {
29 
30 public:
32  explicit Probe(const std::string &name);
33 
34  Probe();
35  Probe(const Probe &);
36  void operator=(const Probe &) = delete;
37  virtual ~Probe();
38 
40  virtual void accept(BeamlineVisitor &) const override;
41 
43  void setStep(double step);
45  virtual double getStep() const;
47  virtual ElementBase::ElementType getType() const override;
48 
49 private:
51  virtual void doInitialise(PartBunchBase<double, 3> *bunch) override;
53  virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
55  virtual void doGoOffline() override;
57  virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
58 
59  double step_m;
60  std::unique_ptr<PeakFinder> peakfinder_m;
61 };
62 
63 #endif // CLASSIC_Probe_HH
const std::string name
Definition: Probe.h:28
void setStep(double step)
Set probe histogram bin width.
Definition: Probe.cpp:59
virtual ~Probe()
Definition: Probe.cpp:41
std::unique_ptr< PeakFinder > peakfinder_m
Pointer to Peakfinder instance.
Definition: Probe.h:60
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:84
virtual ElementBase::ElementType getType() const override
Get element type std::string.
Definition: Probe.cpp:121
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise peakfinder file.
Definition: Probe.cpp:47
double step_m
Step size of the probe (bin width in histogram file)
Definition: Probe.h:59
Probe()
Definition: Probe.cpp:28
void operator=(const Probe &)=delete
virtual void doGoOffline() override
Hook for goOffline.
Definition: Probe.cpp:52
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition: Probe.cpp:67
virtual double getStep() const
Member variable access.
Definition: Probe.cpp:63
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Probe.
Definition: Probe.cpp:43