Message: Unsure why my detection isn't working? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Unsure why my detection isn't working? 

Forum: Processes Involving Optical Photons
Date: 10 Aug, 2009
From: <jdswado@gatech.edu>

Could anyone give me some ideas here I've tried to set up a volume to act as an optical photon detector but I'm getting no detection events. Essentially what I've done is below but I tried to edit out the irrelevant stuff and so may have missed a parenthesis or something like that.

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////// Definition of Optical Surface of Detector ////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

const G4int num = 2; G4double EPhoton[num] = {3.2627*eV, 1.6531*eV};

G4OpticalSurface* photocath_opsurf=
     new G4OpticalSurface("photocath_opsurf",glisur,polished,
                           dielectric_metal);

  G4double photocath_EFF[num]=
                              {1.0, 1.0}; 

  G4double photocath_REFLECT[num] =
                              {0.,0.};

 G4MaterialPropertiesTable* Surface_Glass_MPT = new G4MaterialPropertiesTable();
Surface_Glass_MPT->AddProperty("REFLECTIVITY",EPhoton,photocath_REFLECT,num);
Surface_Glass_MPT->AddProperty("EFFICIENCY",EPhoton,photocath_EFF,num);                                                 
photocath_opsurf->SetMaterialPropertiesTable(Surface_Glass_MPT);
new G4LogicalSkinSurface("PMTSurface",logicDetector,photocath_opsurf);

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////// Counting the # of Detection Events in Stepping Action //////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

if(theTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
{
  G4OpBoundaryProcessStatus boundaryStatus=Undefined;
  static G4OpBoundaryProcess* boundary=NULL;

  //find the boundary process only once
  if(!boundary){
    G4ProcessManager* pm 
      = theTrack->GetDefinition()->GetProcessManager();
    G4int nprocesses = pm->GetProcessListLength();
    G4ProcessVector* pv = pm->GetProcessList();
    G4int f;
    for( f=0;f<nprocesses;f++){
      if((*pv)[f]->GetProcessName()=="OpBoundary"){
	boundary = (G4OpBoundaryProcess*)(*pv)[f];
	break;
	  }
	}
  }

  boundaryStatus=boundary->GetStatus();

switch(boundaryStatus){
case Detection:
	G4cout << "Detection" << G4endl;
	eventAction->addDetect(1);
	break;
default:
       break;
}

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////// EventAction.hh //////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

class ExN01EventAction : public G4UserEventAction { public: void addDetect(G4int i) {TotalDetect += i;};

private: G4int TotalDetect;

};

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////// EventAction.cc //////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

void EventAction::BeginOFEventAction(const G4Event* evt)
{
   G4int evtNb = evt->GetEventID();
   TotalDetect = 0;
}

void EventAction::EndofEventAction(const G4Event* evt) { runAct->fillPerEvent(TotalDetect); }

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

So I print out how many detection events are registered but none ever show up. I don't think this is a probably with my counting method because I can get counts on all the other boundary processes. So I think that for some reason my volume is not detecting opticals.

Any help would be great. Thanks, Jason

 Add Message Add Message
to: "Unsure why my detection isn't working?"

 Subscribe Subscribe

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