Project
Loading...
Searching...
No Matches
O2MCApplicationBase.h
Go to the documentation of this file.
1// Copyright 2019-2020 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/*
13 * O2MCApplicationBase.h
14 *
15 * Created on: Feb 13, 2019
16 * Author: swenzel
17 */
18
19#ifndef STEER_INCLUDE_STEER_O2MCAPPLICATIONBASE_H_
20#define STEER_INCLUDE_STEER_O2MCAPPLICATIONBASE_H_
21
22#include <FairMCApplication.h>
23#include "Rtypes.h" // for Int_t, Bool_t, Double_t, etc
24#include <TVirtualMC.h>
25#include "SimConfig/SimParams.h"
26
27namespace o2
28{
29namespace steer
30{
31
32// O2 specific changes/overrides to FairMCApplication
33// Here in particular for custom adjustments to stepping logic
34// and tracking limits
36{
37 public:
38 O2MCApplicationBase() : FairMCApplication(), mCutParams(o2::conf::SimCutParams::Instance())
39 {
42 }
43 O2MCApplicationBase(const char* name, const char* title, TObjArray* ModList, const char* MatName) : FairMCApplication(name, title, ModList, MatName), mCutParams(o2::conf::SimCutParams::Instance())
44 {
47 }
48
49 ~O2MCApplicationBase() override = default;
50
51 void Stepping() override;
52 void PreTrack() override;
53 void BeginEvent() override;
54 void FinishEvent() override;
55 void ConstructGeometry() override;
56 void InitGeometry() override;
57 bool MisalignGeometry() override;
58 void AddParticles() override;
59
60 // specific implementation of our hard geometry limits
61 double TrackingRmax() const override { return mCutParams.maxRTracking; }
62 double TrackingZmax() const override { return mCutParams.maxAbsZTracking; }
63
64 typedef std::function<void(TVirtualMC const*)> TrackRefFcn;
65 typedef std::function<bool(TVirtualMC const*)> KeepStepFcn;
66
68
69 protected:
70 o2::conf::SimCutParams const& mCutParams; // reference to parameter system
71 unsigned long long mStepCounter{0};
72 std::map<int, std::string> mModIdToName{}; // mapping of module id to name
73 std::map<int, std::string> mSensitiveVolumes{}; // collection of all sensitive volumes with
74 // keeping track of volumeIds and volume names
75
77 bool mTrackSeedWarned{false}; // whether we already complained that seeding never fired
78
81 bool seedsInPreTrack() const;
83 void finishEventCommon();
84 TrackRefFcn mTrackRefFcn; // a function hook that gets (optionally) called during Stepping
85 void initTrackRefHook();
89 bool mHasStepFilterMacro = false;
90 void initStepFilterHook();
91
93};
94
95} // end namespace steer
96} // end namespace o2
97
98#endif /* STEER_INCLUDE_STEER_O2MCAPPLICATIONBASE_H_ */
double TrackingRmax() const override
~O2MCApplicationBase() override=default
void finishEventCommon()
some common parts of finishEvent
o2::conf::SimCutParams const & mCutParams
std::map< int, std::string > mSensitiveVolumes
double TrackingZmax() const override
O2MCApplicationBase(const char *name, const char *title, TObjArray *ModList, const char *MatName)
std::map< int, std::string > mModIdToName
std::function< bool(TVirtualMC const *)> KeepStepFcn
ClassDefOverride(O2MCApplicationBase, 1)
std::function< void(TVirtualMC const *)> TrackRefFcn
GLuint const GLchar * name
Definition glcorearb.h:781
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...