GENIEGenerator
Loading...
Searching...
No Matches
PointGeomAnalyzer.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6
7 Costas Andreopoulos <c.andreopoulos \at cern.ch>
8 University of Liverpool - July 14, 2005
9
10 For the class documentation see the corresponding header file.
11
12 Important revisions after version 2.0.0 :
13 @ Feb 05, 2008 - CA
14 Support a mix of targets (with their corresponding weights) in the same
15 'point geometry'.
16*/
17//____________________________________________________________________________
18
19#include <TLorentzVector.h>
20#include <TVector3.h>
21
28
29using namespace genie;
30using namespace genie::geometry;
31
32//___________________________________________________________________________
35{
36 map<int,double> tgtmap;
37 tgtmap.insert( map<int, double>::value_type(pdg, 1.) );
38
39 this->Initialize(tgtmap);
40}
41//___________________________________________________________________________
43 unsigned int n, const int tgtpdgc[], const double weight[]) :
45{
46 map<int,double> tgtmap;
47 for(unsigned int i=0; i<n; i++)
48 tgtmap.insert( map<int, double>::value_type(tgtpdgc[i], weight[i]) );
49
50 this->Initialize(tgtmap);
51}
52//___________________________________________________________________________
53PointGeomAnalyzer::PointGeomAnalyzer(const map<int,double> & tgtmap) :
55{
56 this->Initialize(tgtmap);
57}
58//___________________________________________________________________________
63//___________________________________________________________________________
65{
66// pdg code list contains a single code corresponding to the material passed
67// at the geom analyser ctor
68
69 return *fCurrPDGCodeList;
70}
71//___________________________________________________________________________
73{
74// this is irrelevant for the 'point' geometry - return a path length of 1.
75// for the only defined material
76
77 return *fCurrPathLengthList;
78}
79//___________________________________________________________________________
81 const TLorentzVector & /*x*/, const TLorentzVector & /*p*/)
82{
83// this is irrelevant for the 'point' geometry - return a path length of 1.
84// for the only defined material
85
86 return *fCurrPathLengthList;
87}
88//___________________________________________________________________________
90 const TLorentzVector & /*x*/, const TLorentzVector & /*p*/, int /*tgtpdg*/)
91{
92// this is irrelevant for the 'point' geometry - return a vtx at (0,0,0)
93
94 return *fCurrVertex;
95}
96//___________________________________________________________________________
97void PointGeomAnalyzer::Initialize(const map<int,double> & tgtmap)
98{
99 fCurrVertex = new TVector3(0,0,0);
100
102 fCurrPDGCodeList->clear();
103
104 map<int,double>::const_iterator iter;
105 for(iter = tgtmap.begin(); iter != tgtmap.end(); ++iter) {
106 int tgtpdgc = iter->first;
107 fCurrPDGCodeList->push_back(tgtpdgc);
108 }
109
111
112 LOG("PointGeom", pNOTICE) << *fCurrPDGCodeList;
113 LOG("PointGeom", pNOTICE) << *fCurrPathLengthList;
114}
115//___________________________________________________________________________
117{
118 if( fCurrVertex ) delete fCurrVertex;
121}
122//___________________________________________________________________________
123
#define pNOTICE
Definition Messenger.h:61
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
A list of PDG codes.
Definition PDGCodeList.h:32
Object to be filled with the neutrino path-length, for all detector geometry materials,...
void Initialize(const map< int, double > &tgtmap)
const PathLengthList & ComputePathLengths(const TLorentzVector &x, const TLorentzVector &p)
const PathLengthList & ComputeMaxPathLengths(void)
PDGCodeList * fCurrPDGCodeList
current list of target nuclei
TVector3 * fCurrVertex
current generated vertex
const TVector3 & GenerateVertex(const TLorentzVector &x, const TLorentzVector &p, int tgtpdg)
const PDGCodeList & ListOfTargetNuclei(void)
PathLengthList * fCurrPathLengthList
current list of path-lengths
void Initialize(void)
GENIE geometry drivers.
Utilities for improving the code readability when using PDG codes.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25