12#define BOOST_TEST_MODULE Test MCStack class
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
15#include <boost/test/unit_test.hpp>
20#include "TMCProcess.h"
33 TMCProcess proc{kPPrimary};
35 st.
PushTrack(1, -1, 0, 0, 0., 0., 10., 5., 5., 5., 0.1, 0., 0., 0., proc,
a, 1., 1);
36 st.PushTrack(1, -1, 0, 0, 0., 0., 10., 5., 5., 5., 0.1, 0., 0., 0., proc,
a, 1., 1);
41 TFile
f(
"StackOut.root",
"RECREATE");
42 f.WriteObject(&
st,
"Stack");
48 TFile
f(
"StackOut.root",
"OPEN");
49 f.GetObject(
"Stack", inst);
58 st.PushTrack(1, parentId, 0, 0., 0., 0., 10., 5., 5., 5., 0.1, 0., 0., 0., proc, trackId, 1., 1);
68 const auto prim0 = pushTrack(
st, -1, kPPrimary);
69 const auto prim1 = pushTrack(
st, -1, kPPrimary);
74 const auto radDecay = pushTrack(
st, prim1, kPRadDecay);
75 const auto radChild = pushTrack(
st, radDecay, kPHadronic);
76 const auto radGrandChild = pushTrack(
st, radChild, kPHadronic);
79 const auto ordinary = pushTrack(
st, prim1, kPHadronic);
105 TestDetector() :
o2::base::Detector(
"ITS",
true) {}
109 for (
auto& hit : mHits) {
114 std::vector<o2::BaseHit> mHits;
118 void attachHits(fair::mq::Channel&, fair::mq::Parts&)
override {}
119 void fillHitBranch(TTree&, fair::mq::Parts&,
int&)
override {}
120 void collectHits(
int, fair::mq::Parts&,
int&)
override {}
122 std::vector<int>
const&)
override {}
123 void mergeHitEntries(TTree&, TTree&, std::vector<int>
const&, std::vector<int>
const&,
124 std::vector<int>
const&)
override {}
127 Bool_t ProcessHits(FairVolume* =
nullptr)
override {
return kFALSE; }
128 void Register()
override {}
129 void Reset()
override {}
130 void ConstructGeometry()
override {}
137 st.PushTrack(1, -1, 11, 0., 0., 1., 1., 0., 0., 0., 0., 0., 0., 0., kPPrimary, ntr, 1., 1);
138 st.SetCurrentTrack(0);
139 for (
int i = 0;
i < nsecondaries; ++
i) {
140 st.PushTrack(1, 0, 11, 0., 0., 0.1, 0.1, 0., 0., 0., 0., 0., 0., 0., kPHadronic, ntr, 1., 1);
149 const std::map<int, int> indexmapping{{0, 0}, {1, 1}};
163 transportOnePrimary(
st, 20);
164 st.UpdateTrackIndex(&detlist);
167 transportOnePrimary(
st, 1);
168 det.mHits.emplace_back(15);
169 st.UpdateTrackIndex(&detlist);
177 const int nprimaries = 5, primaryOffset = 10, secondaryOffset = 100;
Definition of the Detector class.
Definition of the Stack class.
virtual std::string getHitBranchNames(int probe) const =0
virtual void initializeLate()=0
virtual void attachHits(fair::mq::Channel &, fair::mq::Parts &)=0
static int updatedTrackIndex(std::map< int, int > const &indexmapping, int trackID)
virtual void updateHitTrackIndices(std::map< int, int > const &)=0
virtual void mergeHitEntries(TTree &origin, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)=0
virtual void fillHitBranch(TTree &tr, fair::mq::Parts &parts, int &index)=0
virtual void mergeHitEntriesAndFlush(int eventID, TTree &target, std::vector< int > const &trackoffsets, std::vector< int > const &nprimaries, std::vector< int > const &subevtsOrdered)=0
static int offsetTrackIndex(int trackID, int nprimaries, int primaryOffset, int secondaryOffset)
virtual void InitializeO2Detector()=0
virtual void collectHits(int eventID, fair::mq::Parts &parts, int &index)=0
void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is) override
const std::vector< TParticle > & getPrimaries() const
GLboolean GLboolean GLboolean GLboolean a
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_AUTO_TEST_CASE(FlatHisto)
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())