Message: Re: Determining sommation coefficient for nuclides with isomeric states Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Determining sommation coefficient for nuclides with isomeric states 

Forum: Event and Track Management
Re: None Determining sommation coefficient for nuclides with isomeric states (Delaune Olivier)
Re: None Re: Determining sommation coefficient for nuclides with isomeric states (michel maire)
Date: 11 Jan, 2018
From: Delaune Olivier <Delaune Olivier>

I do it in the EndOfEventAction function

void EventAction::EndOfEventAction(const G4Event* evt)

{

 G4double edepInCristal = 0.;

 G4int fCollID_cryst
             = G4SDManager::GetSDMpointer()->GetCollectionID("detector/edep"));

     G4HCofThisEvent* HCE = evt->GetHCofThisEvent();

     if(!HCE) return;

     G4THitsMap<G4double>* evtMap =
             static_cast<G4THitsMap<G4double>*>(HCE->GetHC(fCollID_cryst));

     std::map<G4int,G4double*>::iterator itr;

     for (itr = evtMap->GetMap()->begin(); itr != evtMap->GetMap()->end(); itr++) {

         edepInCristal += *(itr->second);

     }

 }

 G4AnalysisManager::Instance()->FillH1(0, edepInCristal);

}

And I defined my sensitive detector in DetectorConstruction::ConstructSDandField() as follow:

void DetectorConstruction::ConstructSDandField() {

    // Register some of the volumes as "sensitive" and decide the

    // type of sensitivity that they have

    G4SDManager::GetSDMpointer()->SetVerboseLevel(1);

        // declare crystal as a MultiFunctionalDetector scorer

        //

        // Create a new scorer (G4MultiFunctionalDetector) and set its

        // "capability" to G4PSEnergyDeposit (will score total energy deposit)

        G4MultiFunctionalDetector* detectorMFD = new G4MultiFunctionalDetector("detector");

        G4SDManager::GetSDMpointer()->AddNewDetector(detectorMFD); // useful for GEANT 4.10.03 otherwise it crashes (<detector/edep> is not found.)

        G4VPrimitiveScorer* primitiv1 = new G4PSEnergyDeposit("edep");

        detectorMFD->RegisterPrimitive(primitiv1);

        // Attach the scorer to the logical volume

        SetSensitiveDetector(detector->getDetectorLV()->GetName(),detectorMFD);
}

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Determining sommation coefficient for nuclides with isomeric states   (Delaune Olivier - 17 Jan, 2018)
 Add Message Add Message
to: "Re: Determining sommation coefficient for nuclides with isomeric states"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]