Message: Re: GetCopyNo(depth=1) fails Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GetCopyNo(depth=1) fails 

Forum: Event and Track Management
Re: Question GetCopyNo(depth=1) fails (Ryan Braid)
Re: None Re: GetCopyNo(depth=1) fails (michel maire)
Re: Question Re: GetCopyNo(depth=1) fails (Ryan Braid)
Date: 10 Sep, 2013
From: Marc Verderi <Marc Verderi>

Hi Ryan,

Please be careful that this is the GetCopyNumber method of the 
*touchable* which can receive an argument, not the one of the physical 
volume. In the page you mentioned it is written:

"To get the copy number of the mother volume:

G4int copyNumber = touch1->GetCopyNumber(depth=1); "

and touch1 is :

G4TouchableHandle touch1 = point1->GetTouchableHandle();

with point1 being:

G4StepPoint* point1 = step->GetPreStepPoint();


On 09/09/2013 10:07 PM, Ryan Braid wrote:
> *** Discussion title: Event and Track Management
> On Mon, 09 Sep 2013 17:44:52 GMT, michel maire wrote:
>> G4int depth=1;
>> G4int momcopyNo = thePhysical->GetCopyNo(depth);
>> or only:
>> G4int momcopyNo = thePhysical->GetCopyNo(1);
> Thank you for your reply. I had already tried the second option and it
> fails as well:
> Compiling ...
> src/ In member function ‘virtual G4bool
> SiliconSD::ProcessHits(G4Step*, G4TouchableHistory*)’:
> src/ error: no matching function for call to
> ‘G4VPhysicalVolume::GetCopyNo(int)’
> src/ note: candidate is:
> /geant4.9.4.p02/source/geometry/management/include/G4VPhysicalVolume.hh:142:19:
> note: virtual G4int G4VPhysicalVolume::GetCopyNo() const
> /geant4.9.4.p02/source/geometry/management/include/G4VPhysicalVolume.hh:142:19:
> note: candidate expects 0 arguments, 1 provided
> This is what made me suspect that my Geant4 version is out of date.
> However, I have downloaded the source for the latest beta, and the
> header file seems to indicate that even the latest version will not take
> any arguments. From
> source/geometry/management/include/G4VPhysicalVolume.hh:
> virtual G4int GetCopyNo() const = 0;
> Is the tutorial wrong, or am I still missing something critically
> important? I know a virtual function can be overwritten by a definition
> later, but I can't find one. Doing geant4.10.00.b01/source$ grep -r
> "GetCopyNo" . shows no header or function call with any arguments
> passed.
> -------------------------------------------------------------
> Visit this GEANT4 at message (to reply or unsubscribe) at:

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

1 Ok: Re: GetCopyNo(depth=1) fails   (Ryan Braid - 11 Sep, 2013)
 Add Message Add Message
to: "Re: GetCopyNo(depth=1) fails"

 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 ]