Problem 530

Summary: Collect information about the total energy deposit in one event
Product: Geant4 Reporter: courtine
Component: digits_hitsAssignee: Makoto.Asai
Status: CLOSED INVALID    
Severity: major    
Priority: P2    
Version: 5.2   
Hardware: PC   
OS: Linux   

Description courtine 2003-09-16 03:04:04 CEST
i want to collect information about the total energy deposit in one event which
is the sum of all the hit of this event. So i use the method digitize() of the
class G4VDigitizerModule. Here found what i made:
PuitsDigitizer::PuitsDigitizer(const G4String& name)
:G4VDigitizerModule(name)
{
G4cout << "essai1" << G4endl;
}

PuitsDigitizer::~PuitsDigitizer()
{
G4cout << "essai2" << G4endl;
}

void PuitsDigitizer::Digitize()
{
G4cout << "essai3" << G4endl;
G4DigiManager* fDM = G4DigiManager::GetDMpionter();
G4int myHitsCollID = fDM->GetHitsCollectionID("hits_collection_name");
PuitsGeHitsCollection* HC = fDM->GetHitsCollection(myHitsCollID);
G4int n_hit = 0;
G4double totE=9, totL=0;
PuitsGeDigiCollection* digiCollection = 0;
n_hit = HC->entries();
for (G4int i=0;i<n_hit;i++)
{
totE += (*HC) [i]->GetEdep();
totL += (*HC) [i]->GetTrackL();
G4cout << "essai5" << G4endl;
}
PuitsGeDigi* newDigi = new PuitsGeDigi();
digiCollection->insert(newDigi);
newDigi->Print();
G4cout << "essai6 << G4endl;
if (digiCollection) StoreDigiCollection(digiCollection);
if (verboseLevel==0){
G4cout
  << " Germanium total energy deposit " << G4BestUnit(totE,"Energy");
  << G4endl;
G4int NbDigi = digiCollection->entries();
for (G4int i=0,i<NbDigi,i++) (*digiCollection) [i] ->Print();
}
}
I can compile and run the program but when i have access to the digicollection
it return no digits. Moreover when i run i should view all the message essai1,
essai2... and i see none.
So I suupose that the class I derived don't work anymore but idon't know why
(this class is included in PuitsEventAction.cc where I took the value of digits)
Thank you for your help.
Best regards,
Fabien
Comment 1 Makoto.Asai 2003-09-16 11:04:59 CEST
I believe there is a miss-use of your digitizer module. Could you please
put your report to the Geant4 HyperNews (Hits, Digitization and Pileup
thread) so that people can share the same information? Please add codes
of your event action, which I believe problematic.
Let me close this Bugzilla incident, since this is meant for the report
of any potential bug in Geant4 code.