Project
Loading...
Searching...
No Matches
O2MCApplicationEvalMat.cxx
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
15#include <TObjArray.h>
16#include <TLorentzVector.h>
17#include <FairPrimaryGenerator.h>
18
19namespace o2
20{
21namespace steer
22{
24{
26 FairMCApplication::FinishPrimary();
27}
28
30{
31 // dispatch to MaterialBudget Map
32 if (fMC->IsNewTrack()) {
33 TLorentzVector p;
34 fMC->TrackMomentum(p);
35 Float_t x, y, z;
36 fMC->TrackPosition(x, y, z);
37
38 mPhi = p.Phi() * 180. / TMath::Pi();
39 if (mPhi < 0.) {
40 mPhi += 360.;
41 }
42
43 mC1[0] = p.Theta() * 180. / TMath::Pi();
44 mC1[1] = p.Eta();
45 mC1[2] = z;
46 }
47
49}
50
52{
53 if (!mMaterialBudgetMap) {
55 Float_t c1min, c1max;
56 Int_t n1;
57 if (p.ntheta != 0) {
58 // theta-phi binning
59 mMode = 0;
60 n1 = p.ntheta;
61 c1min = p.thetamin;
62 c1max = p.thetamax;
63 } else if (p.neta != 0) {
64 // eta-phi binning
65 mMode = 1;
66 n1 = p.neta;
67 c1min = p.etamin;
68 c1max = p.etamax;
69 } else if (p.nzv != 0) {
70 // z-phi binning
71 mMode = 2;
72 n1 = p.nzv;
73 c1min = p.zvmin;
74 c1max = p.zvmax;
75 }
76 printf("MaterialBudgetMap: %5d %13.3f %13.3f %5d %13.3f %13.3f %13.3f %13.3f\n", n1, c1min, c1max, p.nphi, p.phimin, p.phimax, p.rmax, p.zmax);
78 n1, c1min, c1max, p.nphi, p.phimin, p.phimax, p.rmin, p.rmax, p.zmax);
79
80 auto gen = GetGenerator();
81 gen->GetListOfGenerators()->Clear();
82 gen->AddGenerator(new o2::eventgen::GeneratorGeantinos(mMode, n1, c1min, c1max, p.nphi, p.phimin, p.phimax, p.rmin, p.rmax, p.zmax));
83 }
85}
86
92
93} // namespace steer
94} // namespace o2
default_random_engine gen(dev())
void FinishPrimary(Float_t c1, Float_t c2)
GLint GLenum GLint x
Definition glcorearb.h:403
GLint y
Definition glcorearb.h:270
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...