Skip to content

Commit 93b1147

Browse files
committed
add cross section and fix branch names
1 parent fb7bfa0 commit 93b1147

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Pinpoint/convertGHEPPinPoint.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ void convertGHEPPinPoint(const std::string& inputFilename, const std::string& ou
156156
double W;
157157
double x;
158158
double y;
159+
double Xsec;
159160
double crossingAngle;
160161
bool isVerticalCrossingAngle;
161162
// to do: add interaction information
@@ -198,6 +199,7 @@ void convertGHEPPinPoint(const std::string& inputFilename, const std::string& ou
198199
outTree->Branch("W",&W,"W/D");
199200
outTree->Branch("x",&x,"x/D");
200201
outTree->Branch("y",&y,"y/D");
202+
outTree->Branch("XSec", &Xsec, "XSec/D");
201203
outTree->Branch("crossingAngle",&crossingAngle,"crossingAngle/D");
202204
outTree->Branch("isVerticalCrossingAngle",&isVerticalCrossingAngle,
203205
"isVerticalCrossingAngle/O");
@@ -299,6 +301,8 @@ void convertGHEPPinPoint(const std::string& inputFilename, const std::string& ou
299301

300302
// Hit nucleon
301303
hitnuc = (hitnucl) ? hitnucl->Pdg() : 0;
304+
305+
Xsec = event.XSec() * (1E+38/units::cm2);
302306

303307
// Process type
304308
cc = proc_info.IsWeakCC();

Pinpoint/include/generators/GFaserGenerator.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class GFaserGenerator : public GeneratorBase
4646
int fIntType, fScatType;
4747
bool fIsCc, fIsNc;
4848
int fTgtZ, fTgtA, fTgtPdg;
49+
double xsec;
4950

5051
std::vector<std::string>* fName = nullptr;
5152
std::vector<int>* fPdgc = nullptr;

Pinpoint/src/generators/GFaserGenerator.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ void GFaserGenerator::LoadData()
9797
fGfaserTree->SetBranchAddress("W", &fW);
9898
fGfaserTree->SetBranchAddress("x", &fX);
9999
fGfaserTree->SetBranchAddress("y", &fY);
100+
fGfaserTree->SetBranchAddress("xsec", &xsec);
100101
fGfaserTree->SetBranchAddress("intType", &fIntType);
101102
fGfaserTree->SetBranchAddress("scatteringType", &fScatType);
102103
fGfaserTree->SetBranchAddress("cc", &fIsCc);
103104
fGfaserTree->SetBranchAddress("nc", &fIsNc);
104105
fGfaserTree->SetBranchAddress("Z", &fTgtZ);
105106
fGfaserTree->SetBranchAddress("A", &fTgtA);
106-
fGfaserTree->SetBranchAddress("tgt_pdg", &fTgtPdg);
107-
fGfaserTree->SetBranchAddress("nu_pdg", &fNuPdg);
108-
fGfaserTree->SetBranchAddress("lepton_pdg", &fLeptonPdg);
107+
fGfaserTree->SetBranchAddress("tgt", &fTgtPdg);
108+
fGfaserTree->SetBranchAddress("neu", &fNuPdg);
109+
fGfaserTree->SetBranchAddress("fspl", &fLeptonPdg);
109110
fGfaserTree->SetBranchAddress("hitnuc", &fHitPdg);
110111

111112
fCurrentEvent = fFirstEvent;
@@ -186,6 +187,7 @@ void GFaserGenerator::GeneratePrimaries(G4Event* event)
186187
metadata.xBj = fX;
187188
metadata.y = fY;
188189
metadata.W = fW;
190+
metadata.xs = xsec;
189191
fVertexMetadata.push_back(metadata);
190192

191193
fCurrentEvent++;

0 commit comments

Comments
 (0)