Skip to content

Commit 8d99a47

Browse files
committed
A2FileGenerator: added event weight member
1 parent e857a82 commit 8d99a47

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/A2FileGenerator.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected:
3939
EFileGenType fType; // type of file generator
4040
G4String fFileName; // input file name
4141
G4int fNEvents; // number of events
42+
G4double fWeight; // event weight
4243
A2GenParticle_t fBeam; // beam particle
4344
G4ThreeVector fVertex; // primary vertex [mm]
4445
std::vector<A2GenParticle_t> fPart; // list of particles
@@ -54,6 +55,7 @@ public:
5455
EFileGenType GetType() const { return fType; }
5556
const G4String& GetFileName() const { return fFileName; }
5657
G4int GetNEvents() const { return fNEvents; }
58+
G4double GetWeight() const { return fWeight; }
5759
const G4ThreeVector& GetVertex() const { return fVertex; }
5860
const A2GenParticle_t& GetBeam() const { return fBeam; }
5961

@@ -69,6 +71,7 @@ public:
6971
G4bool IsParticleTrack(G4int p) const { return fPart[p].fIsTrack; }
7072

7173
void SetParticleIsTrack(G4int p, G4bool t = true);
74+
void SetWeight(G4double w) { fWeight = w; }
7275

7376
void GenerateVertexCylinder(G4double t_length, G4double t_center,
7477
G4double b_diam);

src/A2FileGenerator.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ A2FileGenerator::A2FileGenerator(const char* filename, EFileGenType type)
1717
fType = type;
1818
fFileName = filename;
1919
fNEvents = 0;
20+
fWeight = 1;
2021
}
2122

2223
//______________________________________________________________________________
@@ -95,6 +96,7 @@ void A2FileGenerator::Print() const
9596
G4cout << "Generator type : " << type << G4endl
9697
<< "File name : " << fFileName << G4endl
9798
<< "Number of events : " << fNEvents << G4endl
99+
<< "Event weight : " << fWeight << G4endl
98100
<< "Number of particles : " << fPart.size() << G4endl
99101
<< "Primary vertex : " << fVertex << G4endl
100102
<< "Beam particle" << G4endl;

0 commit comments

Comments
 (0)