23 fHitsNum_F_Ch.clear();
29 fHitsNum_B_Ch.clear();
35 fDecayTriggerSi =
false;
36 fCosmicTriggerUp =
false;
37 fCosmicTriggerBottom =
false;
45 G4int modeType =
static_cast<const MyPrimaryGenerator*
>(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction())->GetModeType();
53 if(!(fCosmicTriggerUp*fCosmicTriggerBottom))
59 G4HCofThisEvent *hce =
event->GetHCofThisEvent();
66 G4int nHits = THC->entries();
67 for(G4int i = 0; i < nHits; i++)
72 fHitsNum_F_Ch[(*THC)[i]->GetDetectorChannel()]++;
73 fT_F.push_back((*THC)[i]->GetDetectionTime());
74 fX_F.push_back((*THC)[i]->GetDetectorPosition().x());
75 fY_F.push_back((*THC)[i]->GetDetectorPosition().y());
76 fChannel_F.push_back((*THC)[i]->GetDetectorChannel());
82 fHitsNum_B_Ch[(*THC)[i]->GetDetectorChannel()]++;
83 fT_B.push_back((*THC)[i]->GetDetectionTime());
84 fX_B.push_back((*THC)[i]->GetDetectorPosition().x());
85 fY_B.push_back((*THC)[i]->GetDetectorPosition().y());
86 fChannel_B.push_back((*THC)[i]->GetDetectorChannel());
91 G4PrimaryVertex* primaryVertex =
event->GetPrimaryVertex();
92 G4PrimaryParticle *primaryParticle = primaryVertex->GetPrimary();
95 G4AnalysisManager *man = G4AnalysisManager::Instance();
96 G4int evt =
event->GetEventID();
99 man->FillNtupleIColumn(0, evt);
100 man->FillNtupleIColumn(1, primaryParticle->GetParticleDefinition()->GetPDGEncoding());
101 man->FillNtupleDColumn(2, primaryParticle->GetTotalEnergy());
102 man->FillNtupleDColumn(3, primaryVertex->GetX0());
103 man->FillNtupleDColumn(4, primaryVertex->GetY0());
104 man->FillNtupleDColumn(5, primaryVertex->GetZ0());
105 man->FillNtupleDColumn(6, primaryParticle->GetMomentumDirection().x());
106 man->FillNtupleDColumn(7, primaryParticle->GetMomentumDirection().y());
107 man->FillNtupleDColumn(8, primaryParticle->GetMomentumDirection().z());
108 man->FillNtupleDColumn(9,
fTimeIn);
109 man->FillNtupleDColumn(10,
fPosXIn);
110 man->FillNtupleDColumn(11,
fPosYIn);
111 man->FillNtupleDColumn(12,
fPosZIn);
117 man->FillNtupleDColumn(17,
fEdep);
118 man->FillNtupleDColumn(18,
fMaxEdep);
127 man->AddNtupleRow(0);
G4double fMaxEdep
Maximum deposit of energy per unit length (MeV/mm) in the crystal.
G4double fPosXIn
X position of arrival of primary gamma.
std::vector< G4double > fT_F
Vector containing times of detection of optical photons on the front face.
G4ThreeVector fMaxEdepPos
Position of the maximum deposit of energy per unit length in the crystal.
G4double fPosYFirstInter
Y position of first interaction of primary gamma.
void EndOfEventAction(const G4Event *event) override
Fills the TTree with the data of the event.
G4double fPosXFirstInter
X position of first interaction of primary gamma.
std::vector< G4double > fT_B
Vector containing times of detection of optical photons on the back face.
G4double fEdep
Total energy deposited inside the crystal.
void BeginOfEventAction(const G4Event *event) override
Resets every data containers at the beginning of a new event.
std::vector< G4double > fY_F
Vector containing y-positions of detection of optical photons on the front face.
std::vector< G4double > fX_B
Vector containing x-positions of detection of optical photons on the back face.
G4double fTimeFirstInter
Time of first interaction of primary gamma.
std::vector< G4int > fChannel_B
Vector containing SiPM channels of detection of optical photons on the back face.
G4int fHitsNum_F
Total number of optical photons detected by SiPMs on the front face.
G4double fPosYIn
Y position of arrival of primary gamma.
G4double fPosZIn
Z position of arrival of primary gamma.
G4double fPosZFirstInter
Z position of first interaction of primary gamma.
G4int fHitsNum_B
Total number of optical photons detected by SiPMs on the back face.
std::vector< G4double > fX_F
Vector containing x-positions of detection of optical photons on the front face.
G4double fTimeIn
Time of arrival of primary gamma.
std::vector< G4double > fY_B
Vector containing y-positions of detection of optical photons on the back face.
std::vector< G4int > fChannel_F
Vector containing SiPM channels of detection of optical photons on the front face.
Mandatory user action concrete class of G4VUserPrimaryGeneratorAction. It defines the settings for th...
Declaration of the class MyEventAction.
G4THitsCollection< MyHit > MyHitsCollection
Concrete hit collection class for MyHit.
constexpr G4double zScintillator
z-position of the scintillator crystal.
constexpr G4int nOfSiPMs
The number of SiPMs on a detector face.