Belle II Software development
StackingAction Class Reference

The basf2 stacking action. More...

#include <StackingAction.h>

Inheritance diagram for StackingAction:

Public Member Functions

 StackingAction ()
 The StackingAction constructor.
 
 ~StackingAction ()
 The StackingAction destructor.
 
virtual G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack)
 Function that classifies new tracks.
 
virtual void NewStage ()
 Function that is called at each event when "urgent" stack is empty.
 
virtual void PrepareNewEvent ()
 Function called at begining of event.
 
void setPropagatedPhotonFraction (double fraction)
 Set fraction of Cerenkov photons that are actually propagated.
 

Private Attributes

double m_photonFraction
 The fraction of Cerenkov photons which will be kept and propagated.
 

Detailed Description

The basf2 stacking action.

Definition at line 26 of file StackingAction.h.

Constructor & Destructor Documentation

◆ StackingAction()

The StackingAction constructor.

Definition at line 24 of file StackingAction.cc.

24 : m_photonFraction(1.0)
25{
26 if (false) {
27 G4Track* aTrack;
28 ClassifyNewTrack(aTrack);
29 NewStage();
31 }
32}
virtual void NewStage()
Function that is called at each event when "urgent" stack is empty.
double m_photonFraction
The fraction of Cerenkov photons which will be kept and propagated.
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
Function that classifies new tracks.
virtual void PrepareNewEvent()
Function called at begining of event.

◆ ~StackingAction()

The StackingAction destructor.

Definition at line 34 of file StackingAction.cc.

35{
36
37}

Member Function Documentation

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack ClassifyNewTrack ( const G4Track *  aTrack)
virtual

Function that classifies new tracks.

Definition at line 40 of file StackingAction.cc.

41{
42 // look for optical photon
43 if (aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition())
44 return fUrgent;
45
46 // check if creator process is available
47 if (!aTrack->GetCreatorProcess()) return fUrgent;
48
49 // look for Cerenkov photon
50 if (aTrack->GetCreatorProcess()->GetProcessName() != "Cerenkov") return fUrgent;
51
52 // get track info
53 TrackInfo* info = dynamic_cast<TrackInfo*>(aTrack->GetUserInformation());
54 if (!info) return fUrgent;
55
56 // chech if prescaling already done
57 if (info->getStatus() != 0) return fUrgent;
58
59 // if not, do it
60 if (gRandom->Uniform() > m_photonFraction) {
61 TrackInfo::getInfo(*aTrack).setIgnore();
62 return fKill;
63 }
64
65 // set new status and store prescaling fraction
66 info->setStatus(1);
67 info->setFraction(m_photonFraction);
68
69 return fUrgent;
70}
static Payload getInfo(Carrier &obj)
Static function to just return UserInformation attached to the obj of type Carrier.
Definition: UserInfo.h:100

◆ NewStage()

void NewStage ( )
virtual

Function that is called at each event when "urgent" stack is empty.

Definition at line 73 of file StackingAction.cc.

74{
75
76}

◆ PrepareNewEvent()

void PrepareNewEvent ( )
virtual

Function called at begining of event.

Definition at line 79 of file StackingAction.cc.

80{
81
82}

◆ setPropagatedPhotonFraction()

void setPropagatedPhotonFraction ( double  fraction)
inline

Set fraction of Cerenkov photons that are actually propagated.

Definition at line 46 of file StackingAction.h.

46{ m_photonFraction = fraction; };

Member Data Documentation

◆ m_photonFraction

double m_photonFraction
private

The fraction of Cerenkov photons which will be kept and propagated.

Definition at line 51 of file StackingAction.h.


The documentation for this class was generated from the following files: