Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/underground_physics/src/DMXSteppingActionMessenger.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 //
0027 // --------------------------------------------------------------
0028 //   GEANT 4 - Underground Dark Matter Detector Advanced Example
0029 //
0030 //      For information related to this code contact: Alex Howard
0031 //      e-mail: alexander.howard@cern.ch
0032 // --------------------------------------------------------------
0033 // Comments
0034 //
0035 //                  Underground Advanced
0036 //               by A. Howard and H. Araujo 
0037 //                    (27th November 2001)
0038 //
0039 // SteppingActionMessenger program
0040 // --------------------------------------------------------------
0041 
0042 #include "DMXSteppingActionMessenger.hh"
0043 
0044 #include "DMXSteppingAction.hh"
0045 #include "DMXEventActionMessenger.hh"
0046 
0047 #include "globals.hh"
0048 #include "G4UIdirectory.hh"
0049 #include "G4UIcmdWithAString.hh"
0050 
0051 DMXSteppingActionMessenger::DMXSteppingActionMessenger
0052    (DMXSteppingAction* SA):steppingAction(SA) {
0053 
0054   colourNeutronCmd = new G4UIcmdWithAString("/dmx/draw/neutronColour",this);
0055   colourNeutronCmd->SetGuidance("Colour of neutron in the event");
0056   colourNeutronCmd->SetGuidance("  Choice : white, grey, lgrey, black, red, green, blue, cyan, magenta(default), yellow, lgreen, lblue");
0057   colourNeutronCmd->SetParameterName("colourNeutronFlag", false);
0058   colourNeutronCmd->SetCandidates("white grey lgrey black red green blue cyan magenta yellow lgreen lblue");
0059   colourNeutronCmd->AvailableForStates(G4State_Idle);
0060 
0061   colourGammaCmd = new G4UIcmdWithAString("/dmx/draw/gammaColour",this);
0062   colourGammaCmd->SetGuidance("Colour of gamma in the event");
0063   colourGammaCmd->SetGuidance("  Choice : white, grey, lgrey, black, red, green, blue, cyan(default), magenta, yellow, lgreen, lblue");
0064   colourGammaCmd->SetParameterName("colourGammaFlag", false);
0065   colourGammaCmd->SetCandidates("white grey lgrey black red green blue cyan magenta yellow lgreen lblue");
0066   colourGammaCmd->AvailableForStates(G4State_Idle);
0067 
0068   colourOpticalCmd = new G4UIcmdWithAString("/dmx/draw/opticalColour",this);
0069   colourOpticalCmd->SetGuidance("Colour of gamma in the event");
0070   colourOpticalCmd->SetGuidance("  Choice : white(default), grey, lgrey, black, red, green, blue, cyan, magenta, yellow, lgreen, lblue");
0071   colourOpticalCmd->SetParameterName("colourOpticalFlag", false);
0072   colourOpticalCmd->SetCandidates("white grey lgrey black red green blue cyan magenta yellow lgreen lblue");
0073   colourOpticalCmd->AvailableForStates(G4State_Idle);
0074 
0075   colourChargedPlusCmd = new G4UIcmdWithAString("/dmx/draw/chargedplusColour",this);
0076   colourChargedPlusCmd->SetGuidance("colour of chargedplus in the event");
0077   colourChargedPlusCmd->SetGuidance("  Choice : white, grey, lgrey, black, red (default), green, blue, cyan, magenta, yellow, lgreen, lblue");
0078   colourChargedPlusCmd->SetParameterName("ColourChargedPlusFlag", false);
0079   colourChargedPlusCmd->SetCandidates("white grey lgrey black red(default) green blue cyan magenta yellow lgreen lblue");
0080   colourChargedPlusCmd->AvailableForStates(G4State_Idle);
0081 
0082   colourChargedMinusCmd = new G4UIcmdWithAString("/dmx/draw/chargedminusColour",this);
0083   colourChargedMinusCmd->SetGuidance("colour of chargedminus in the event");
0084   colourChargedMinusCmd->SetGuidance("  Choice : white, grey, lgrey, black, red, green, blue(default), cyan, magenta, yellow, lgreen, lblue");
0085   colourChargedMinusCmd->SetParameterName("colourChargedMinusFlag", false);
0086   colourChargedMinusCmd->SetCandidates("white grey lgrey black red green blue cyan magenta yellow lgreen lblue");
0087   colourChargedMinusCmd->AvailableForStates(G4State_Idle);
0088 
0089 }
0090 
0091 
0092 //ooooooooooooooooooooooooooooooooooooooooo
0093 DMXSteppingActionMessenger::~DMXSteppingActionMessenger() {
0094 
0095   delete colourNeutronCmd;  
0096   delete colourGammaCmd;  
0097   delete colourOpticalCmd;  
0098   delete colourChargedPlusCmd;  
0099   delete colourChargedMinusCmd;  
0100 }
0101 
0102 
0103 //ooooooooooooooooooooooooooooooooooooooooo
0104 void DMXSteppingActionMessenger::SetNewValue(G4UIcommand* command, 
0105   G4String newValue) {
0106 
0107   if(command == colourNeutronCmd)
0108     steppingAction->SetColourNeutronFlag(newValue);
0109 
0110   if(command == colourGammaCmd)
0111     steppingAction->SetColourGammaFlag(newValue);
0112 
0113   if(command == colourOpticalCmd)
0114     steppingAction->SetColourOpticalFlag(newValue);
0115 
0116   if(command == colourChargedPlusCmd)
0117     steppingAction->SetColourChargedPlusFlag(newValue);
0118 
0119   if(command == colourChargedMinusCmd)
0120     steppingAction->SetColourChargedMinusFlag(newValue);
0121 
0122 }
0123 
0124 
0125