Project
Loading...
Searching...
No Matches
FastSimModel.h
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FASTSIM_MODEL_H_
13#define O2_FASTSIM_MODEL_H_
14
23
24#include "G4VFastSimulationModel.hh"
25
26#include <vector>
27
28class G4FastStep;
29class G4FastTrack;
30class G4ParticleDefinition;
31
32namespace o2::fastsim
33{
34
38 int pdg = 0;
39 double position[3] = {};
40 double direction[3] = {};
41 double kineticEnergy = 0.;
42 double mass = 0.;
43 double time = 0.;
44 double exitDistance = 0.;
45};
46
49 int pdg = 0;
50 double position[3] = {};
51 double momentum[3] = {};
52 double time = 0.;
53};
54
58constexpr double kSurfaceEpsilonCm = 1e-5;
59
74{
75 public:
76 FastSimModel(const G4String& name, const G4String& envelopeVolume, double minEnergyGeV);
77
78 G4bool IsApplicable(const G4ParticleDefinition& particle) override;
79 G4bool ModelTrigger(const G4FastTrack& fastTrack) override;
80
86 void DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep) override;
87
88 protected:
91 virtual std::vector<FastSimOutput> sample(const FastSimInput& input) const = 0;
92
93 private:
96 int envelopeDepth(const G4Track* track) const;
97
98 G4String mEnvelope;
99 double mMinEnergy = 0.;
100 mutable bool mWarned = false;
101};
102
103} // namespace o2::fastsim
104
105#endif // O2_FASTSIM_MODEL_H_
G4bool IsApplicable(const G4ParticleDefinition &particle) override
virtual std::vector< FastSimOutput > sample(const FastSimInput &input) const =0
void DoIt(const G4FastTrack &fastTrack, G4FastStep &fastStep) override
G4bool ModelTrigger(const G4FastTrack &fastTrack) override
GLuint const GLchar * name
Definition glcorearb.h:781
constexpr double kSurfaceEpsilonCm
double position[3]
global, on the envelope surface
double direction[3]
unit vector
double exitDistance
cm from position to the ENVELOPE surface along direction
One particle leaving the envelope.
double position[3]
global; put it outside the envelope surface