R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDigitizingTacQuila.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#ifndef NEULAND_DIGITIZING_TACQUILA_H
15#define NEULAND_DIGITIZING_TACQUILA_H
16
17#include "R3BDigitizingEngine.h"
18#include "TRandom3.h"
19#include "Validated.h"
20
22{
23 struct Params
24 {
25 double fPMTThresh; // [MeV]
28 double fTimeRes; // time + Gaus(0., fTimeRes) [ns]
29 double fEResRel; // Gaus(e, fEResRel * e) []
30 double fIntegrationTime; // [ns]
31 std::shared_ptr<TRandom3> fRnd;
32
33 Params();
34 };
35
36 extern const Params TACQUILA_DEFAULT_PARAM;
38 {
39 public:
40 Channel(const Channel&) = delete;
41 Channel(Channel&&) = delete;
42 Channel& operator=(const Channel&) = delete;
45 ~Channel() override = default;
46 void AddHit(Hit newHit) override;
47 bool HasFired() override;
48 double GetQDC();
49 double GetTDC();
50 double GetEnergy();
51 double GetTrigTime() override { return GetTDC(); }
52
53 private:
54 // NOTE: Some expensive calculations and random distributions are cached
55 // so they do not need to be recomputed every time a Getter is called
56 auto ConstructSignals() -> Signals override;
57 std::vector<Hit> fPMTHits;
58 mutable Validated<std::vector<Hit>::const_iterator> cachedFirstHitOverThresh;
59 std::vector<Hit>::const_iterator FindThresholdExceedingHit() const;
60
61 double BuildQDC();
62 mutable Validated<double> cachedQDC;
63
64 double BuildTDC();
65 mutable Validated<double> cachedTDC;
66
67 double BuildEnergy();
68 mutable Validated<double> cachedEnergy;
69
70 const TacQuila::Params& par;
71 };
72
73} // namespace R3B::Digitizing::Neuland::TacQuila
74
75#endif // NEULAND_DIGITIZING_TACQUILA_H
std::vector< Signal > Signals
Channel & operator=(const Channel &)=delete
Channel & operator=(Channel &&)=delete