Message: RE: question on how to use G4THitsMap Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: question on how to use G4THitsMap 

Forum: Hits, Digitization and Pileup
Re: None question on how to use G4THitsMap (long)
Date: 05 Jun, 2007
From: Makoto Asai <Makoto Asai>

Hi,

 Yes, we have identified this bug, and the coming release
by the end of this month has already been fixed. Meanwhile
please correct the line in GetIndex() method of each of four 
scorers provided in this example. The correct indexing 
scheme is 

  return iy*fNx*fNz+ix*fNz+iz;

We are sorry for this bug and inconvenience.

Makoto

 

> -----Original Message-----
> From: long [mailto:long@anl.gov] 
> Sent: Monday, June 04, 2007 1:33 PM
> To: publichypernews
> Subject: question on how to use G4THitsMap
> 
> *** Discussion title: Hits, Digitization and Pileup
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/hitsdigits/151"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Dear geant4 experts,
>       I feel confused on how to use G4THitsMap. As mentioned 
> in manual Section 4.4.5, 
> each of the concrete primitive scorers generates a 
> G4THitsMap<G4double> that maps a
> G4double value to its key integer number. By default, the key 
> is taken as the copy 
> number of the G4LogicalVolume to which 
> G4MultiFunctionalDetector is assigned. In case
> the key must consider more than one copy number of a 
> different geometry hierarchy, 
> the user can derive his/her own primitive scorer from the 
> provided concrete class and
> implement the GetIndex(G4Step*) virtual method to return the 
> unique key.
>      So for example RE02, the key value set by GetIndex() 
> should be less than the total
> number of sensitive cells(fNx*fNy*fNz). But in another 
> function called DumpAllScorer(), 
> it is found that the key value ()of HitsMaps sometimes is 
> larger than the total number 
> of cells. I listed these two functions below. How to 
> understand this? what is the exact
> relation between the CopyNo and key index of G4THitsMap?
>      Thanks a lot!
> 
> long
> 
> G4int RE02PSEnergyDeposit::GetIndex(G4Step* aStep)
> {
>   const G4VTouchable* touchable = 
> aStep->GetPreStepPoint()->GetTouchable();
>   G4int ix = touchable->GetReplicaNumber(1);
>   G4int iy = touchable->GetReplicaNumber(2);
>   G4int iz = touchable->GetReplicaNumber(0);
>   return iy*fNx*fNy+ix*fNz+iz;      //  ********key value************
> }
> 
> void RE02Run::DumpAllScorer(){
> 
>   // - Number of HitsMap in this RUN.
>   G4int n = GetNumberOfHitsMap();
>   // - GetHitsMap and dump values.
>   for ( G4int i = 0; i < n ; i++ ){
>     G4THitsMap<G4double>* RunMap =GetHitsMap(i);
>     if ( RunMap ) {
>       G4cout << " PrimitiveScorer RUN " 
>              << RunMap->GetSDname() <<","<< RunMap->GetName() 
> << G4endl;
>       G4cout << " Number of entries " << RunMap->entries() << G4endl;
>       std::map<G4int,G4double*>::iterator itr = 
> RunMap->GetMap()->begin();
>       for(; itr != RunMap->GetMap()->end(); itr++) {
>         G4cout << "  copy no.: " << itr->first       
> //*******key value**********    
>                << "  Run Value : " << *(itr->second) 
>                << G4endl;
>       }
>     }
>   }
> }
> 
> 

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

1 None: RE: question on how to use G4THitsMap   (long - 05 Jun, 2007)
 Add Message Add Message
to: "RE: question on how to use G4THitsMap"

 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 ]