~gkafka/maus/CkovMC2

« back to all changes in this revision

Viewing changes to src/common_cpp/Simulation/MAUSPhysicsList.cc

  • Committer: Gene Kafka
  • Date: 2013-02-28 22:17:18 UTC
  • Revision ID: gkafka@iit.edu-20130228221718-3dzq81pz6nhh7ar0
Ckov_MC

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "Geant4/G4ProcessVector.hh"
30
30
#include "Geant4/G4PhysListFactory.hh"
31
31
 
 
32
#include "Geant4/G4Cerenkov.hh"
 
33
#include "Geant4/G4Scintillation.hh"
 
34
#include "Geant4/G4OpAbsorption.hh"
 
35
#include "Geant4/G4OpRayleigh.hh"
 
36
#include "Geant4/G4OpBoundaryProcess.hh"
 
37
 
32
38
#include "Interface/Squeak.hh"
33
39
 
34
40
#include "src/common_cpp/Utils/Globals.hh"
192
198
void MAUSPhysicsList::ConstructProcess() {
193
199
    _list->ConstructProcess();
194
200
    SetSpecialProcesses();
 
201
    std::cerr << "CONSTRUCTPROCESS" << std::endl;
 
202
    ConstructOp();
 
203
}
 
204
 
 
205
void MAUSPhysicsList::ConstructOp()
 
206
{
 
207
    G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
 
208
    G4Scintillation* theScintillationProcess = new G4Scintillation("Scintillation");
 
209
    G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
 
210
    G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
 
211
    G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
 
212
    theCerenkovProcess->SetMaxNumPhotonsPerStep(20);
 
213
    theScintillationProcess->SetScintillationYieldFactor(1.);
 
214
    theScintillationProcess->SetTrackSecondariesFirst(true);
 
215
 
 
216
    G4OpticalSurfaceModel themodel = unified;
 
217
    theBoundaryProcess->SetModel(themodel);
 
218
 
 
219
    theParticleIterator->reset();
 
220
    while( (*theParticleIterator)() ){
 
221
      G4ParticleDefinition* particle = theParticleIterator->value();
 
222
      G4ProcessManager* pmanager = particle->GetProcessManager();
 
223
      G4String particleName = particle->GetParticleName();
 
224
      if (theCerenkovProcess->IsApplicable(*particle)) {
 
225
        pmanager->AddProcess(theCerenkovProcess);
 
226
        pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);
 
227
      }
 
228
      if (theScintillationProcess->IsApplicable(*particle)) {
 
229
        pmanager->AddProcess(theScintillationProcess);
 
230
        pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
 
231
        pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
 
232
      }
 
233
      if (particleName == "opticalphoton") {
 
234
        G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
 
235
        pmanager->AddDiscreteProcess(theAbsorptionProcess);
 
236
        pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
 
237
        pmanager->AddDiscreteProcess(theBoundaryProcess);
 
238
    }
 
239
  }
 
240
  std::cerr << "CONSTRUCT OP" << std::endl;
195
241
}
196
242
 
197
243
void MAUSPhysicsList::SetSpecialProcesses() {