OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 OPALX_Probe_HH
19#define OPALX_Probe_HH
20
22
23#include <memory>
24#include <string>
25
26class PeakFinder;
27
28class Probe : public PluginElement {
29public:
31 explicit Probe(const std::string& name);
32
33 Probe();
34 Probe(const Probe&);
35 void operator=(const Probe&) = delete;
36 virtual ~Probe();
37
39 virtual void accept(BeamlineVisitor&) const override;
40
42 void setStep(double step);
44 virtual double getStep() const;
46 virtual ElementType getType() const override;
47
48private:
50 virtual void doInitialise(PartBunch_t* bunch) override;
52 virtual bool doCheck(
53 PartBunch_t* bunch, const int turnnumber, const double t, const double tstep) override;
55 virtual void doGoOffline() override;
57 virtual bool doPreCheck(PartBunch_t*) override;
58
59 double step_m;
60 std::unique_ptr<PeakFinder> peakfinder_m;
61};
62
63#endif // OPALX_Probe_HH
ElementType
Definition ElementBase.h:94
Definition Probe.h:28
void setStep(double step)
Set probe histogram bin width.
Definition Probe.cpp:50
virtual ~Probe()
Definition Probe.cpp:34
std::unique_ptr< PeakFinder > peakfinder_m
Pointer to Peakfinder instance.
Definition Probe.h:60
virtual void doInitialise(PartBunch_t *bunch) override
Initialise peakfinder file.
Definition Probe.cpp:38
virtual bool doCheck(PartBunch_t *bunch, const int turnnumber, const double t, const double tstep) override
Record probe hits when bunch particles pass.
Definition Probe.cpp:71
virtual bool doPreCheck(PartBunch_t *) override
Virtual hook for preCheck.
Definition Probe.cpp:54
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:44
virtual ElementType getType() const override
Get element type std::string.
Definition Probe.cpp:114
virtual double getStep() const
Member variable access.
Definition Probe.cpp:52
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Probe.
Definition Probe.cpp:36