Message: change Sensitive Detector between runs? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None change Sensitive Detector between runs? 

Forum: Geometry
Date: 19 Apr, 2011
From: Haori Yang <Haori Yang>

is it possible to change a solid/logic volume that is attached to a SD between runs?

for example, I have a sphere which is attached to a SD. Can I change the radius of the sphere between runs?

what I usually do is to delete the pointers of solid/logic/physical and rebuild them in the function called by the messenger. how can I assign the same SD used before to the new logic volume?

I tried the following but it doesn't seem to work.

************************ logicWorld->RemoveDaughter(physiDet); delete logicDet; delete solidDet; delete physiDet;

solidDet = new G4Sphere("detector",fTargetLength + 10.*cm,fTargetLength + 11.*cm,0, 2*pi, 0, pi);
  logicDet = new G4LogicalVolume(solidDet,Air,"Detector",0,0,0);
  physiDet = new G4PVPlacement(0,               // no rotation
				  positionTarget,  // at (x,y,z)
				  logicDet,     // its logical volume				  
				  "Detector",        // its name
				  logicWorld,      // its mother  volume
				  false,           // no boolean operations
				  0);   

G4MultiFunctionalDetector* det = (G4MultiFunctionalDetector*)G4SDManager::GetSDMpointer()->FindSensitiveDetector("detector");
  logicDet->SetSensitiveDetector(det);

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

1 None: Re: change Sensitive Detector between runs?   (Makoto Asai - 21 Apr, 2011)
(_ None: Re: change Sensitive Detector between runs?   (Haori Yang - 21 Apr, 2011)
 Add Message Add Message
to: "change Sensitive Detector between runs?"

 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 ]