Skip to content

Commit

Permalink
Scintillation process: counter update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vesna Cuplov committed Nov 14, 2012
1 parent b78015c commit ac443d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions source/digits_hits/include/GateToRoot.hh
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private:
G4int nCrystalOpticalMie;
G4int nCrystalOpticalAbsorption;
G4int nScintillation, nCrystalOpticalWLS, nPhantomOpticalWLS;

G4int NumCrystalWLS, NumPhantomWLS;
G4int CrystalLastHit, PhantomLastHit;
G4double CrystalLastHitPos_X,CrystalLastHitPos_Y,CrystalLastHitPos_Z, CrystalLastHitEnergy;
Expand Down
40 changes: 21 additions & 19 deletions source/digits_hits/src/GateToRoot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -854,10 +854,10 @@ void GateToRoot::RecordOpticalData(const G4Event * event)
if (processName.find("OpticalMie") != G4String::npos) nPhantomOpticalMie++;
if (processName.find("OpticalAbsorption") != G4String::npos) {

nPhantomOpticalAbsorption++;
PhantomAbsorbedPhotonHitPos_X = (*PHC)[iPHit]->GetPos().x();
PhantomAbsorbedPhotonHitPos_Y = (*PHC)[iPHit]->GetPos().y();
PhantomAbsorbedPhotonHitPos_Z = (*PHC)[iPHit]->GetPos().z();
nPhantomOpticalAbsorption++;
PhantomAbsorbedPhotonHitPos_X = (*PHC)[iPHit]->GetPos().x();
PhantomAbsorbedPhotonHitPos_Y = (*PHC)[iPHit]->GetPos().y();
PhantomAbsorbedPhotonHitPos_Z = (*PHC)[iPHit]->GetPos().z();
}

PhantomLastHit=iPHit;
Expand Down Expand Up @@ -889,33 +889,35 @@ void GateToRoot::RecordOpticalData(const G4Event * event)
CrystalAbsorbedPhotonHitPos_Y = -999;
CrystalAbsorbedPhotonHitPos_Z = -999;

for (G4int iHit=0;iHit<NbHits;iHit++)
{
GateCrystalHit* aHit = (*CHC)[iHit];
G4String processName = aHit->GetProcess();
for (G4int iHit=0;iHit<NbHits;iHit++)
{
GateCrystalHit* aHit = (*CHC)[iHit];
G4String processName = aHit->GetProcess();

if (aHit->GoodForAnalysis()) {

if (aHit->GoodForAnalysis() && aHit-> GetPDGEncoding()==0) // looking at optical photons only
{
strcpy (NameOfProcessInCrystal, aHit->GetProcess().c_str());

strcpy (NameOfProcessInCrystal, aHit->GetProcess().c_str());
if(processName.find("Scintillation") != G4String::npos) nScintillation++;

if(aHit-> GetPDGEncoding()==0){ // looking at optical photons only

if(processName.find("Scintillation") != G4String::npos) nScintillation++;
if(processName.find("OpticalWLS") != G4String::npos) nCrystalOpticalWLS++;
if (processName.find("OpRayleigh") != G4String::npos) nCrystalOpticalRayleigh++;
if (processName.find("OpticalMie") != G4String::npos) nCrystalOpticalMie++;
if (processName.find("OpticalAbsorption") != G4String::npos) {

nCrystalOpticalAbsorption++;
CrystalAbsorbedPhotonHitPos_X = (*CHC)[iHit]->GetGlobalPos().x();
CrystalAbsorbedPhotonHitPos_Y = (*CHC)[iHit]->GetGlobalPos().y();
CrystalAbsorbedPhotonHitPos_Z = (*CHC)[iHit]->GetGlobalPos().z();
}
nCrystalOpticalAbsorption++;
CrystalAbsorbedPhotonHitPos_X = (*CHC)[iHit]->GetGlobalPos().x();
CrystalAbsorbedPhotonHitPos_Y = (*CHC)[iHit]->GetGlobalPos().y();
CrystalAbsorbedPhotonHitPos_Z = (*CHC)[iHit]->GetGlobalPos().z();
}

CrystalLastHit=iHit;
} // end GoodForAnalysis() and optical photon
} // end loop over crystal hits

} // end optical photon
} // end GoodForAnalysis()
} // end loop over crystal hits

if(CrystalLastHit!=-1) {
CrystalLastHitPos_X = (*CHC)[CrystalLastHit]->GetGlobalPos().x();
Expand Down

0 comments on commit ac443d8

Please sign in to comment.