Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 08:32:09

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file LXeEventMessenger.cc
0027 /// \brief Implementation of the LXeEventMessenger class
0028 
0029 #include "LXeEventMessenger.hh"
0030 
0031 #include "LXeEventAction.hh"
0032 
0033 #include "G4UIcmdWithABool.hh"
0034 #include "G4UIcmdWithAnInteger.hh"
0035 
0036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0037 
0038 LXeEventMessenger::LXeEventMessenger(LXeEventAction* event) : fLXeEvent(event)
0039 {
0040   fVerboseCmd = new G4UIcmdWithAnInteger("/LXe/eventVerbose", this);
0041   fVerboseCmd->SetGuidance("Set the verbosity of event data.");
0042   fVerboseCmd->SetParameterName("verbose", true);
0043   fVerboseCmd->SetDefaultValue(1);
0044 
0045   fPmtThresholdCmd = new G4UIcmdWithAnInteger("/LXe/pmtThreshold", this);
0046   fPmtThresholdCmd->SetGuidance("Set the pmtThreshold (in # of photons)");
0047 
0048   fForceDrawPhotonsCmd = new G4UIcmdWithABool("/LXe/forceDrawPhotons", this);
0049   fForceDrawPhotonsCmd->SetGuidance("Force drawing of photons.");
0050   fForceDrawPhotonsCmd->SetGuidance("(Higher priority than /LXe/forceDrawNoPhotons)");
0051 
0052   fForceDrawNoPhotonsCmd = new G4UIcmdWithABool("/LXe/forceDrawNoPhotons", this);
0053   fForceDrawNoPhotonsCmd->SetGuidance("Force no drawing of photons.");
0054   fForceDrawNoPhotonsCmd->SetGuidance("(Lower priority than /LXe/forceDrawPhotons)");
0055 }
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0058 
0059 LXeEventMessenger::~LXeEventMessenger()
0060 {
0061   delete fVerboseCmd;
0062   delete fPmtThresholdCmd;
0063   delete fForceDrawPhotonsCmd;
0064   delete fForceDrawNoPhotonsCmd;
0065 }
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0070 {
0071   if (command == fVerboseCmd) {
0072     fLXeEvent->SetEventVerbose(fVerboseCmd->GetNewIntValue(newValue));
0073   }
0074   else if (command == fPmtThresholdCmd) {
0075     fLXeEvent->SetPMTThreshold(fPmtThresholdCmd->GetNewIntValue(newValue));
0076   }
0077   else if (command == fForceDrawPhotonsCmd) {
0078     fLXeEvent->SetForceDrawPhotons(fForceDrawPhotonsCmd->GetNewBoolValue(newValue));
0079   }
0080   else if (command == fForceDrawNoPhotonsCmd) {
0081     fLXeEvent->SetForceDrawNoPhotons(fForceDrawNoPhotonsCmd->GetNewBoolValue(newValue));
0082   }
0083 }