G4ProcessManager Class Reference

#include <G4ProcessManager.hh>


Public Types

 SizeOfProcVectorArray = 6
enum  { SizeOfProcVectorArray = 6 }

Public Member Functions

 G4ProcessManager (G4ProcessManager &right)
 G4ProcessManager (const G4ParticleDefinition *aParticleType)
 ~G4ProcessManager ()
G4int operator== (const G4ProcessManager &right) const
G4int operator!= (const G4ProcessManager &right) const
G4ProcessVectorGetProcessList () const
G4int GetProcessListLength () const
G4int GetProcessIndex (G4VProcess *) const
G4ProcessVectorGetProcessVector (G4ProcessVectorDoItIndex idx, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVectorGetAtRestProcessVector (G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVectorGetAlongStepProcessVector (G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVectorGetPostStepProcessVector (G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int GetProcessVectorIndex (G4VProcess *aProcess, G4ProcessVectorDoItIndex idx, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int GetAtRestIndex (G4VProcess *aProcess, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int GetAlongStepIndex (G4VProcess *aProcess, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int GetPostStepIndex (G4VProcess *aProcess, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int AddProcess (G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4int AddRestProcess (G4VProcess *aProcess, G4int ord=ordDefault)
G4int AddDiscreteProcess (G4VProcess *aProcess, G4int ord=ordDefault)
G4int AddContinuousProcess (G4VProcess *aProcess, G4int ord=ordDefault)
G4int GetProcessOrdering (G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
void SetProcessOrdering (G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetProcessOrderingToFirst (G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
void SetProcessOrderingToSecond (G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
void SetProcessOrderingToLast (G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4VProcessRemoveProcess (G4VProcess *aProcess)
G4VProcessRemoveProcess (G4int index)
G4VProcessSetProcessActivation (G4VProcess *aProcess, G4bool fActive)
G4VProcessSetProcessActivation (G4int index, G4bool fActive)
G4bool GetProcessActivation (G4VProcess *aProcess) const
G4bool GetProcessActivation (G4int index) const
G4ParticleDefinitionGetParticleType () const
void SetParticleType (const G4ParticleDefinition *)
void StartTracking (G4Track *aTrack=0)
void EndTracking ()
void DumpInfo ()
void SetVerboseLevel (G4int value)
G4int GetVerboseLevel () const

Protected Member Functions

G4int InsertAt (G4int position, G4VProcess *process, G4int ivec)
G4int RemoveAt (G4int position, G4VProcess *process, G4int ivec)
G4int FindInsertPosition (G4int ord, G4int ivec)
G4int GetProcessVectorId (G4ProcessVectorDoItIndex idx, G4ProcessVectorTypeIndex typ=typeGPIL) const
void CheckOrderingParameters (G4VProcess *) const

Protected Attributes

G4int verboseLevel


Detailed Description

Definition at line 106 of file G4ProcessManager.hh.


Member Enumeration Documentation

anonymous enum

Enumerator:
SizeOfProcVectorArray 

Definition at line 297 of file G4ProcessManager.hh.

00297 {SizeOfProcVectorArray = 6};


Constructor & Destructor Documentation

G4ProcessManager::G4ProcessManager ( G4ProcessManager right  ) 

Definition at line 100 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), FatalException, G4cout, G4endl, G4Exception(), G4ProcessManager(), G4ProcessTable::GetProcessTable(), GetVerboseLevel(), G4ProcessTable::Insert(), G4ProcessVector::insert(), isSetOrderingFirstInvoked, isSetOrderingLastInvoked, NDoit, numberOfProcesses, SizeOfProcVectorArray, theAttrVector, theProcessList, and theProcVector.

Referenced by G4ProcessManager().

00101             : theParticleType(right.theParticleType),
00102               numberOfProcesses(0),
00103               duringTracking(false),
00104               verboseLevel(right.verboseLevel)
00105 {
00106 #ifdef G4VERBOSE
00107    if (GetVerboseLevel() > 2) {
00108      G4cout <<  "G4ProcessManageer:: copy constructor " <<G4endl; 
00109     }
00110 #endif
00111 
00112    // create the process List and ProcessAttr Vector
00113    theProcessList = new G4ProcessVector();
00114    theAttrVector = new G4ProcessAttrVector();
00115    if ( ( theProcessList == 0) || (theAttrVector == 0) ){
00116      G4Exception( "G4ProcessManager::G4ProcessManager() [coopy constructor]",
00117                   "ProcMan011",FatalException, "Can not create G4ProcessList ");
00118    }
00119 
00120    for (G4int idx=0; idx < right.numberOfProcesses; idx++) {
00121      // copy contents in theProcessList
00122      theProcessList->insert((*right.theProcessList)[idx]);
00123     // create a G4ProcessAttribute same as source's one
00124      G4ProcessAttribute* sAttr = (*right.theAttrVector)[idx];
00125      G4ProcessAttribute* dAttr = new G4ProcessAttribute(*sAttr);
00126      // adds  a G4ProcessAttribute object
00127      theAttrVector->push_back(dAttr);
00128      numberOfProcesses +=1;
00129    }
00130   
00131 
00132   // fill up theProcVector
00133   for (G4int i=0; i<SizeOfProcVectorArray; ++i) {
00134     // create i-th ProcessVector in theProcVector
00135     theProcVector[i] = new G4ProcessVector();
00136     if ( theProcVector[i] == 0) {
00137       G4Exception( "G4ProcessManager::G4ProcessManager() [coopy constructor]",
00138                    "ProcMan011",FatalException, "Can not create G4ProcessVector ");
00139     }
00140 
00141     G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
00142     G4ProcessVector* src = right.theProcVector[i];
00143     for (G4int j=0; j< src->entries() ; j++){
00144       // copy j-th process in i-th ProcessVector 
00145       theProcVector[i]->insert((*src)[j]);
00146       //add aProcess and this ProcessManager into ProcesssTable 
00147       if (  (*src)[j] !=0 ) {
00148         theProcessTable->Insert((*src)[j], this);
00149       }
00150     }
00151   }
00152 
00153   for (G4int i=0; i<NDoit; ++i) {
00154     isSetOrderingFirstInvoked[i]= right.isSetOrderingFirstInvoked[i];
00155     isSetOrderingLastInvoked[i] = right.isSetOrderingLastInvoked[i];
00156   }
00157 
00158   // Increment counter of G4ProcessManager objects
00159   counterOfObjects+=1; 
00160 }

G4ProcessManager::G4ProcessManager ( const G4ParticleDefinition aParticleType  ) 

Definition at line 60 of file G4ProcessManager.cc.

References FatalException, G4Exception(), G4ProcessManager(), NDoit, and SizeOfProcVectorArray.

00060                                                                            :
00061                 theParticleType(aParticleType),
00062                 numberOfProcesses(0),
00063                 duringTracking(false),     
00064                 verboseLevel(1)
00065 {
00066   // create the process List
00067   theProcessList = new G4ProcessVector();
00068   if ( theProcessList == 0) {
00069     G4Exception( "G4ProcessManager::G4ProcessManager()","ProcMan012",
00070                  FatalException, "Can not create G4ProcessList ");
00071   }
00072 
00073   //create process vector
00074   for (G4int i=0; i<SizeOfProcVectorArray; ++i) {
00075     theProcVector[i] = new G4ProcessVector();
00076     if ( theProcVector[i] == 0) {
00077       G4Exception( "G4ProcessManager::G4ProcessManager()","ProcMan012",
00078                    FatalException, "Can not create G4ProcessVector ");
00079     }
00080   }
00081 
00082   // create Process Attribute vector
00083   theAttrVector = new G4ProcessAttrVector();
00084 
00085   // create Process Manager Messenger
00086   if (fProcessManagerMessenger == 0){
00087     fProcessManagerMessenger = new G4ProcessManagerMessenger();
00088   }
00089 
00090   for (G4int i=0; i<NDoit; ++i) {
00091     isSetOrderingFirstInvoked[i]=false;
00092     isSetOrderingLastInvoked[i]=false;
00093   }
00094 
00095   // Increment counter of G4ProcessManager objects
00096   counterOfObjects+=1; 
00097 }

G4ProcessManager::~G4ProcessManager (  ) 

Definition at line 201 of file G4ProcessManager.cc.

References G4ProcessVector::clear(), G4cout, G4endl, and GetVerboseLevel().

00202 {
00203   for (G4int i=0; i<SizeOfProcVectorArray; i++) {
00204     if (theProcVector[i]) {
00205       theProcVector[i]->clear();
00206       delete theProcVector[i];
00207     }
00208   }
00209   theProcessList->clear();
00210   delete theProcessList;
00211 
00212   G4ProcessAttrVector::iterator itr;
00213   for (itr = theAttrVector->begin(); itr!= theAttrVector->end(); ++itr) {
00214     delete (*itr);
00215   }
00216   theAttrVector->clear();
00217   delete  theAttrVector;
00218 
00219   counterOfObjects-=1; 
00220 
00221   // delete messenger if this object is last one
00222   if ( counterOfObjects == 0 ){
00223     if (fProcessManagerMessenger != 0){
00224       delete fProcessManagerMessenger;
00225       fProcessManagerMessenger = 0;
00226 #ifdef G4VERBOSE
00227       if (GetVerboseLevel() > 1) {
00228         G4cout << "G4ProcessManagerMessenger is deleted" << G4endl;
00229       } 
00230 #endif
00231     }
00232   }
00233 }


Member Function Documentation

G4int G4ProcessManager::AddContinuousProcess ( G4VProcess aProcess,
G4int  ord = ordDefault 
) [inline]

Definition at line 147 of file G4ProcessManager.icc.

References AddProcess(), and ordInActive.

Referenced by G4ErrorPhysicsList::ConstructEM().

00148 {
00149   return AddProcess(aProcess, ordInActive, ord, ordInActive);
00150 }

G4int G4ProcessManager::AddDiscreteProcess ( G4VProcess aProcess,
G4int  ord = ordDefault 
) [inline]

Definition at line 153 of file G4ProcessManager.icc.

References AddProcess(), and ordInActive.

Referenced by TLBE< T >::AddTransportation(), G4QProtonBuilder::Build(), G4QNeutronHPBuilder::Build(), G4QNeutronBuilder::Build(), G4QInelasticCHIPSBuilder::Build(), G4QInelasticCHIPS_HPBuilder::Build(), G4ProtonBuilder::Build(), G4PionBuilder::Build(), G4PiKBuilder::Build(), G4NeutronBuilder::Build(), G4MiscQGSCBuilder::Build(), G4MiscLHEPBuilder::Build(), G4MiscCHIPSBuilder::Build(), G4MiscBuilder::Build(), G4LHEPAntiBarionBuilder::Build(), G4KaonBuilder::Build(), G4HyperonLHEPBuilder::Build(), G4HyperonFTFPBuilder::Build(), G4HyperonCHIPSBuilder::Build(), G4ElectroNuclearBuilder::Build(), G4BertiniElectroNuclearBuilder::Build(), G4AntiBarionBuilder::Build(), TLBE< T >::ConstructEM(), G4ErrorPhysicsList::ConstructEM(), TLBE< T >::ConstructHad(), TLBE< T >::ConstructOp(), HadronPhysicsFTFP_BERT_TRV::ConstructProcess(), G4StepLimiterBuilder::ConstructProcess(), G4QIonPhysics::ConstructProcess(), G4QEmExtraPhysics::ConstructProcess(), G4QElasticPhysics::ConstructProcess(), G4QAtomicPhysics::ConstructProcess(), G4OpticalPhysics::ConstructProcess(), G4IonLHEPPhysics::ConstructProcess(), G4HadronQElasticPhysics::ConstructProcess(), G4HadronHElasticPhysics::ConstructProcess(), G4HadronElasticPhysicsLHEP::ConstructProcess(), G4HadronElasticPhysics::ConstructProcess(), G4HadronDElasticPhysics::ConstructProcess(), G4ChargeExchangePhysics::ConstructProcess(), G4VHadronPhysics::FindCaptureProcess(), G4VHadronPhysics::FindElasticProcess(), G4VHadronPhysics::FindFissionProcess(), G4VHadronPhysics::FindInelasticProcess(), and G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget().

00154 {
00155   return AddProcess(aProcess, ordInActive, ordInActive, ord);
00156 }

G4int G4ProcessManager::AddProcess ( G4VProcess aProcess,
G4int  ordAtRestDoIt = ordInActive,
G4int  ordAlongSteptDoIt = ordInActive,
G4int  ordPostStepDoIt = ordInActive 
)

Definition at line 410 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), FatalException, FindInsertPosition(), G4cout, G4endl, G4Exception(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4ProcessTable::GetProcessTable(), GetVerboseLevel(), G4ProcessAttribute::idxProcessList, G4ProcessAttribute::idxProcVector, G4ProcessVector::insert(), G4ProcessTable::Insert(), InsertAt(), G4VProcess::IsApplicable(), G4ProcessAttribute::ordProcVector, G4ProcessVector::removeLast(), and verboseLevel.

Referenced by AddContinuousProcess(), AddDiscreteProcess(), AddRestProcess(), G4PhysicsListHelper::AddTransportation(), TLBE< T >::ConstructEM(), TLBE< T >::ConstructGeneral(), TLBE< T >::ConstructOp(), G4QAtomicPhysics::ConstructProcess(), G4OpticalPhysics::ConstructProcess(), G4ErrorPhysicsList::ConstructProcess(), G4RunManager::ConstructScoringWorlds(), and G4PhysicsListHelper::RegisterProcess().

00416 { 
00417    
00418   //check the process is applicable to this particle type
00419   if (  !aProcess->IsApplicable(*theParticleType) ) {
00420 #ifdef G4VERBOSE
00421     if (GetVerboseLevel()>1) {
00422       G4cout << "G4ProcessManager::AddProcess()" << G4endl;
00423       G4cout << "This process is not applicable to this particle" << G4endl;
00424     }
00425 #endif
00426     return -1;
00427   }
00428 
00429 #ifdef G4VERBOSE
00430   if (GetVerboseLevel()>2) {
00431     G4cout << "G4ProcessManager::AddProcess()" << G4endl;
00432   }
00433 #endif
00434 
00435   //add aProcess and this ProcessManager into ProcesssTable
00436   G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
00437   theProcessTable->Insert(aProcess, this);
00438 
00439   //add aProcess to process List
00440   theProcessList->insert(aProcess);  
00441   G4int idx = (theProcessList->entries()) - 1;
00442 
00443   // check size of the ProcessVector[0]
00444   if (numberOfProcesses != idx){
00445     theProcessList->removeLast();
00446     G4String anErrorMessage("Bad ProcessList: Inconsistent process List size for ");
00447     anErrorMessage += "process[" + aProcess->GetProcessName() + "]";
00448     anErrorMessage += " particle[" + theParticleType->GetParticleName() + "]";
00449     G4Exception( "G4ProcessManager::AddProcess()","ProcMan012",
00450                  FatalException,anErrorMessage);
00451     return -1;
00452   }
00453 
00454   // create ProcessAttribute
00455   G4ProcessAttribute* pAttr = new G4ProcessAttribute(aProcess);
00456   pAttr->idxProcessList = idx;
00457 
00458   // check if ordering parameter is non-zero
00459   if (ordAtRestDoIt==0)    ordAtRestDoIt    = 1;
00460   if (ordAlongStepDoIt==0) ordAlongStepDoIt = 1;
00461   if (ordPostStepDoIt==0)  ordPostStepDoIt  = 1;
00462 
00463   // ordering parameter
00464   pAttr->ordProcVector[0] = ordAtRestDoIt;
00465   pAttr->ordProcVector[1] = ordAtRestDoIt;
00466   pAttr->ordProcVector[2] = ordAlongStepDoIt;
00467   pAttr->ordProcVector[3] = ordAlongStepDoIt;
00468   pAttr->ordProcVector[4] = ordPostStepDoIt;
00469   pAttr->ordProcVector[5] = ordPostStepDoIt;
00470  
00471   // add aProccess in Process vectors
00472   for (G4int ivec=1; ivec<SizeOfProcVectorArray; ivec+=2) {
00473     if (pAttr->ordProcVector[ivec] < 0 ) {
00474       // DoIt is inactive if ordering parameter is negative
00475       pAttr->idxProcVector[ivec] = -1;
00476 
00477     } else {
00478       //add aProcess in ordering of ordProcVector
00479       // G4ProcessVector* pVector = theProcVector[ivec];
00480       // find insert position
00481       G4int ip = FindInsertPosition(pAttr->ordProcVector[ivec], ivec);
00482       // insert 
00483       InsertAt(ip, aProcess, ivec);
00484       // set index in Process Attribute
00485       pAttr->idxProcVector[ivec] = ip;
00486 
00487 #ifdef G4VERBOSE
00488       if (verboseLevel>2) {
00489         G4cout << "G4ProcessManager::AddProcess()" << G4endl;
00490         G4cout << aProcess->GetProcessName() << " is inserted at "<< ip;
00491         G4cout << " in ProcessVetor[" << ivec<< "]";
00492         G4cout << " with Ordering parameter = " ;
00493         G4cout <<  pAttr->ordProcVector[ivec]  << G4endl;
00494       }
00495 #endif
00496      }
00497   }
00498 
00499   //add ProcessAttribute to ProcessAttrVector
00500   theAttrVector->push_back(pAttr);
00501 
00502   numberOfProcesses += 1;
00503 
00504  // check consistencies between ordering parameters and process 
00505   CheckOrderingParameters(aProcess);
00506 
00507   CreateGPILvectors();
00508 
00509   // inform process manager pointer to the process 
00510   aProcess->SetProcessManager(this);
00511 
00512   return idx;
00513 }

G4int G4ProcessManager::AddRestProcess ( G4VProcess aProcess,
G4int  ord = ordDefault 
) [inline]

Definition at line 141 of file G4ProcessManager.icc.

References AddProcess(), and ordInActive.

Referenced by G4StoppingHadronBuilder::Build(), G4LHEPStoppingHadronBuilder::Build(), TLBE< T >::ConstructHad(), G4StoppingPhysics::ConstructProcess(), G4QStoppingPhysics::ConstructProcess(), G4QCaptureAtRestPhysics::ConstructProcess(), and G4LHEPStoppingPhysics::ConstructProcess().

00142 {
00143   return AddProcess(aProcess, ord, ordInActive, ordInActive);
00144 }

void G4ProcessManager::CheckOrderingParameters ( G4VProcess  )  const [protected]

Definition at line 1149 of file G4ProcessManager.cc.

References FatalException, G4cerr, G4cout, G4Exception(), G4VProcess::GetProcessName(), GetVerboseLevel(), G4VProcess::isAlongStepDoItIsEnabled(), G4VProcess::isAtRestDoItIsEnabled(), G4VProcess::isPostStepDoItIsEnabled(), and G4ProcessAttribute::ordProcVector.

Referenced by SetProcessOrdering(), and SetProcessOrderingToFirst().

01150 {
01151   if (aProcess==0) return;
01152   G4ProcessAttribute* pAttr = GetAttribute(aProcess);
01153   if (pAttr ==0) {
01154 #ifdef G4VERBOSE
01155     if (GetVerboseLevel()>0) {
01156       G4cout << "G4ProcessManager::CheckOrderingParameters ";
01157       G4cout << " process " << aProcess->GetProcessName() 
01158              << " has no attribute" << G4endl;
01159     }
01160 #endif
01161     return;
01162   }
01163 
01164   // check consistencies between ordering parameters and 
01165   // validity of DoIt of the Process  
01166   G4bool isOK =true;
01167   if ( (pAttr->ordProcVector[0]>=0) && (!aProcess->isAtRestDoItIsEnabled()) ){
01168  #ifdef G4VERBOSE
01169     if (GetVerboseLevel()>0) {
01170       G4cerr << "G4ProcessManager::CheckOrderingParameters ";
01171       G4cerr << "You cannot set ordering parameter ["
01172              << pAttr->ordProcVector[0]
01173              << "] for AtRest DoIt  to the process "
01174              << aProcess->GetProcessName() << G4endl;
01175     }
01176 #endif
01177     isOK = false;
01178   }
01179 
01180   if ( (pAttr->ordProcVector[2]>=0) && (!aProcess->isAlongStepDoItIsEnabled()) ){
01181 #ifdef G4VERBOSE
01182     if (GetVerboseLevel()>0) {
01183       G4cerr << "G4ProcessManager::CheckOrderingParameters ";
01184       G4cerr << "You cannot set ordering parameter ["
01185              <<  pAttr->ordProcVector[2]
01186              << "] for AlongStep DoIt to the process "
01187              << aProcess->GetProcessName() << G4endl;
01188 
01189     }
01190 #endif
01191     isOK = false;
01192  } 
01193 
01194   if ( (pAttr->ordProcVector[4]>=0) && (!aProcess->isPostStepDoItIsEnabled()) ) {
01195 #ifdef G4VERBOSE
01196     if (GetVerboseLevel()>0) {
01197       G4cerr << "G4ProcessManager::CheckOrderingParameters ";
01198       G4cerr << "You cannot set ordering parameter [" 
01199              << pAttr->ordProcVector[4] 
01200              << "] for PostStep DoIt to the process"
01201              << aProcess->GetProcessName() << G4endl;
01202     }
01203 #endif
01204     isOK = false;
01205   } 
01206 
01207   if (!isOK) {
01208     G4String msg;
01209     msg = "Invalid ordering parameters are set for  ";
01210     msg +=  aProcess->GetProcessName();
01211     G4Exception( "G4ProcessManager::CheckOrderingParameters ",
01212                  "ProcMan013",FatalException, msg);
01213   }
01214   
01215   return;
01216 }

void G4ProcessManager::DumpInfo (  ) 

Definition at line 1007 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), G4cout, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessTypeName(), G4ProcessAttribute::idxProcVector, G4ProcessAttribute::ordProcVector, and verboseLevel.

Referenced by G4VUserPhysicsList::AddProcessManager(), G4ProcessTable::DumpInfo(), and G4ProcessManagerMessenger::SetNewValue().

01008 { 
01009   // Dump Information
01010 
01011   // particle type
01012   G4cout << "G4ProcessManager:  particle[" 
01013          << theParticleType->GetParticleName() << "]"
01014          << G4endl;
01015 
01016   // loop over all processes
01017   for (G4int idx=0; idx <theProcessList->entries(); idx++){
01018     // process name/type
01019     G4cout << "[" << idx << "]";
01020     G4cout << "=== process[" << ((*theProcessList)(idx))->GetProcessName()<< " :"; 
01021     G4cout << G4VProcess::GetProcessTypeName( ((*theProcessList)(idx))->GetProcessType() )<< "]";
01022 
01023     // process attribute    
01024     G4ProcessAttribute* pAttr = (*theAttrVector)[idx];
01025     // status
01026     if ( pAttr-> isActive ) {
01027       G4cout << " Active ";
01028     } else {
01029       G4cout << " InActive ";
01030     }
01031     G4cout << G4endl;
01032 
01033 #ifdef G4VERBOSE
01034     if (verboseLevel>0) {
01035       // order parameter    
01036       G4cout << "  Ordering::     ";
01037       G4cout << "        AtRest             AlongStep          PostStep   ";
01038       G4cout << G4endl;
01039       G4cout << "                 ";
01040       G4cout << "   GetPIL/    DoIt    GetPIL/    DoIt    GetPIL/    DoIt ";
01041       G4cout << G4endl;
01042       G4cout << "  Ordering::      " << G4endl;
01043       G4cout << "  index           ";
01044       for (G4int idx2 = 0; idx2 <6 ; idx2++) {
01045         G4cout << std::setw(8) << pAttr->idxProcVector[idx2] <<":";
01046       }
01047       G4cout << G4endl;
01048       G4cout << "  parameter       ";
01049       for (G4int idx3 = 0; idx3 <6 ; idx3++) {
01050         G4cout << std::setw(8) << pAttr->ordProcVector[idx3] <<":";
01051       }
01052       G4cout << G4endl;
01053     }
01054 #endif 
01055   }
01056 }

void G4ProcessManager::EndTracking (  ) 

Definition at line 1098 of file G4ProcessManager.cc.

References G4ProcessVector::entries().

Referenced by G4TrackingManager::ProcessOneTrack(), and G4ErrorPropagator::Propagate().

01099 {
01100   for (G4int idx = 0; idx<theProcessList->entries(); idx++){
01101     if (GetAttribute(idx)->isActive)
01102       ((*theProcessList)[idx])->EndTracking();
01103   }
01104   duringTracking = false;
01105 }

G4int G4ProcessManager::FindInsertPosition ( G4int  ord,
G4int  ivec 
) [protected]

Definition at line 391 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), INT_MAX, and ordLast.

Referenced by AddProcess(), and SetProcessOrdering().

00392 {
00393   G4ProcessVector* pVector = theProcVector[ivec];
00394   G4int ip =  pVector->entries();
00395   G4int tmp = INT_MAX;
00396   if (ord == ordLast) return ip;
00397 
00398   // find insert position
00399   for (G4int iproc=0; iproc<numberOfProcesses; iproc++) {
00400     G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
00401     if ( (aAttr->ordProcVector[ivec] > ord ) && (tmp > aAttr->ordProcVector[ivec])){
00402       tmp = aAttr->ordProcVector[ivec] ;
00403       if (ip > aAttr->idxProcVector[ivec]) ip = aAttr->idxProcVector[ivec];
00404     }
00405   }
00406   return ip;
00407 }

G4int G4ProcessManager::GetAlongStepIndex ( G4VProcess aProcess,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const [inline]

Definition at line 123 of file G4ProcessManager.icc.

References GetProcessVectorIndex(), and idxAlongStep.

00127 {
00128   return GetProcessVectorIndex(aProcess, idxAlongStep, typ);
00129 }

G4ProcessVector * G4ProcessManager::GetAlongStepProcessVector ( G4ProcessVectorTypeIndex  typ = typeGPIL  )  const [inline]

Definition at line 100 of file G4ProcessManager.icc.

References typeGPIL.

Referenced by G4SteppingManager::GetProcessNumber(), and G4ITStepProcessor::SetupGeneralProcessInfo().

00101 {
00102   if (typ == typeGPIL) { return theProcVector[2]; }
00103   else                { return theProcVector[3]; }
00104 }

G4int G4ProcessManager::GetAtRestIndex ( G4VProcess aProcess,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const [inline]

Definition at line 114 of file G4ProcessManager.icc.

References GetProcessVectorIndex(), and idxAtRest.

00118 {
00119   return GetProcessVectorIndex(aProcess, idxAtRest, typ);
00120 }

G4ProcessVector * G4ProcessManager::GetAtRestProcessVector ( G4ProcessVectorTypeIndex  typ = typeGPIL  )  const [inline]

Definition at line 93 of file G4ProcessManager.icc.

References typeGPIL.

Referenced by G4hImpactIonisation::AlongStepDoIt(), G4HadronicProcess::FillResult(), G4SteppingManager::GetProcessNumber(), G4WHadronElasticProcess::PostStepDoIt(), G4VEnergyLossProcess::PostStepDoIt(), G4VEmProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), and G4ITStepProcessor::SetupGeneralProcessInfo().

00094 {
00095   if (typ == typeGPIL) { return theProcVector[0]; }
00096   else                { return theProcVector[1]; }
00097 }

G4ParticleDefinition * G4ProcessManager::GetParticleType (  )  const [inline]

Definition at line 159 of file G4ProcessManager.icc.

Referenced by G4ProcessTable::DumpInfo(), G4ProcessTable::FindProcess(), G4ProcessTable::Insert(), G4ProcessTable::Remove(), and G4ProcessTable::SetProcessActivation().

00160 { 
00161   return (G4ParticleDefinition* )theParticleType; 
00162 }

G4int G4ProcessManager::GetPostStepIndex ( G4VProcess aProcess,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const [inline]

Definition at line 132 of file G4ProcessManager.icc.

References GetProcessVectorIndex(), and idxPostStep.

00136 {
00137   return GetProcessVectorIndex(aProcess, idxPostStep, typ);
00138 }

G4ProcessVector * G4ProcessManager::GetPostStepProcessVector ( G4ProcessVectorTypeIndex  typ = typeGPIL  )  const [inline]

Definition at line 107 of file G4ProcessManager.icc.

References typeGPIL.

Referenced by G4HadronElasticPhysicsXS::AddXSection(), G4SteppingManager::GetProcessNumber(), and G4ITStepProcessor::SetupGeneralProcessInfo().

00108 {
00109   if (typ == typeGPIL) { return theProcVector[4]; }
00110   else                { return theProcVector[5]; }
00111 }

G4bool G4ProcessManager::GetProcessActivation ( G4int  index  )  const

Definition at line 1131 of file G4ProcessManager.cc.

References G4cout, and GetVerboseLevel().

01132 {
01133   if (index <0) {
01134 #ifdef G4VERBOSE
01135     if (GetVerboseLevel()>0) {
01136       G4cout << "G4ProcessManager::GetProcessActivation  ";
01137       G4cout << " process (or its index) not found ";
01138     }
01139 #endif
01140     return false;
01141   }
01142   // process attribute    
01143   G4ProcessAttribute* pAttr = (*theAttrVector)[index];
01144   // status
01145   return pAttr-> isActive;
01146 }

G4bool G4ProcessManager::GetProcessActivation ( G4VProcess aProcess  )  const

Definition at line 1124 of file G4ProcessManager.cc.

References GetProcessIndex().

01125 {
01126   return GetProcessActivation(GetProcessIndex(aProcess));
01127 } 

G4int G4ProcessManager::GetProcessIndex ( G4VProcess  )  const [inline]

Definition at line 53 of file G4ProcessManager.icc.

References G4ProcessVector::index().

Referenced by GetProcessActivation(), GetProcessVectorIndex(), RemoveProcess(), G4ProcessTable::SetProcessActivation(), and SetProcessActivation().

00054 {
00055   G4int idx = theProcessList->index(aProcess);
00056   if (idx>=numberOfProcesses) idx = -1;
00057   return idx;
00058 }

G4ProcessVector * G4ProcessManager::GetProcessList (  )  const [inline]

Definition at line 41 of file G4ProcessManager.icc.

Referenced by G4ITStepProcessor::ActiveOnlyITProcess(), G4hImpactIonisation::BuildPhysicsTable(), G4PhysicsListHelper::CheckParticleList(), HadronPhysicsFTFP_BERT_TRV::ConstructProcess(), G4TheRayTracer::CreateBitMap(), G4VHadronPhysics::FindCaptureProcess(), G4VHadronPhysics::FindElasticProcess(), G4VHadronPhysics::FindFissionProcess(), G4VHadronPhysics::FindInelasticProcess(), G4PhysListUtil::FindInelasticProcess(), G4ProcessTable::FindProcesses(), G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), G4PhysicsListHelper::RegisterProcess(), G4ProcessTable::SetProcessActivation(), and G4GlobalFastSimulationManager::ShowSetup().

00042 {
00043   return theProcessList;
00044 }

G4int G4ProcessManager::GetProcessListLength (  )  const [inline]

Definition at line 47 of file G4ProcessManager.icc.

00048 {
00049   return numberOfProcesses;
00050 }

G4int G4ProcessManager::GetProcessOrdering ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idDoIt 
)

Definition at line 588 of file G4ProcessManager.cc.

References GetProcessVectorId(), G4ProcessAttribute::ordProcVector, and typeDoIt.

00592 {
00593   // get Process Vector Id
00594   G4int ivec = GetProcessVectorId(idDoIt, typeDoIt);
00595   if (ivec >=0 ) {
00596     // get attribute
00597     G4ProcessAttribute* pAttr = GetAttribute(aProcess); 
00598     if (pAttr != 0) { 
00599       return pAttr->ordProcVector[ivec];
00600     }
00601   }
00602   return -1;
00603 }

G4ProcessVector * G4ProcessManager::GetProcessVector ( G4ProcessVectorDoItIndex  idx,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const [inline]

Definition at line 79 of file G4ProcessManager.icc.

References GetProcessVectorId().

00083 {
00084   G4int ivec = GetProcessVectorId(idx, typ);
00085   if ( ivec >=0 ) {
00086     return theProcVector[ivec];
00087   } else {
00088     return 0;
00089   }
00090 }

G4int G4ProcessManager::GetProcessVectorId ( G4ProcessVectorDoItIndex  idx,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const [inline, protected]

Definition at line 61 of file G4ProcessManager.icc.

References idxAlongStep, idxAtRest, idxPostStep, and typeGPIL.

Referenced by GetProcessOrdering(), GetProcessVector(), GetProcessVectorIndex(), SetProcessOrdering(), SetProcessOrderingToFirst(), and SetProcessOrderingToSecond().

00063 {
00064   if ( idx == idxAtRest ) {
00065     if (typ == typeGPIL) { return 0; }
00066     else                 { return 1; }
00067   } else if ( idx == idxAlongStep ) {
00068     if (typ == typeGPIL) { return 2; }
00069     else                 { return 3; }
00070   } else if ( idx == idxPostStep ) {
00071     if (typ == typeGPIL) { return 4; }
00072     else                 { return 5; }
00073   } else {
00074     return -1;
00075   }
00076 }

G4int G4ProcessManager::GetProcessVectorIndex ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idx,
G4ProcessVectorTypeIndex  typ = typeGPIL 
) const

Definition at line 236 of file G4ProcessManager.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), GetProcessIndex(), G4VProcess::GetProcessName(), GetProcessVectorId(), G4ProcessAttribute::idxProcVector, and verboseLevel.

Referenced by GetAlongStepIndex(), GetAtRestIndex(), and GetPostStepIndex().

00241 {
00242   G4int idxVect =  -1;
00243   G4int idxProc = GetProcessIndex(aProcess); 
00244   G4int ivec = GetProcessVectorId(idx, typ);
00245 
00246   if ( ( idxProc >=0) && (ivec >=0) ){
00247     idxVect =  GetAttribute(idxProc)->idxProcVector[ivec];
00248   } else {
00249 #ifdef G4VERBOSE
00250     if (verboseLevel>0) {
00251       G4cout << " G4ProcessManager::GetProcessVectorIndex:";
00252       G4cout << "particle[" << theParticleType->GetParticleName() << "] " ;
00253       G4cout <<  "process[" << aProcess->GetProcessName() << "]" ;
00254       G4cout << G4endl;
00255       if (idxProc <0) { 
00256         G4cout << " is not registered yet ";
00257       }
00258       if (ivec <0) {
00259         G4cout << " illegal DoIt Index [= " << G4int(idx) << ","
00260                                             << G4int(typ) << "]";
00261       }
00262       G4cout << G4endl;
00263     }
00264 #endif
00265   }
00266   return idxVect;
00267 }

G4int G4ProcessManager::GetVerboseLevel (  )  const [inline]

Definition at line 172 of file G4ProcessManager.icc.

References verboseLevel.

Referenced by AddProcess(), CheckOrderingParameters(), G4ProcessTable::DumpInfo(), G4ProcessManager(), G4ProcessManagerMessenger::GetCurrentValue(), GetProcessActivation(), InsertAt(), RemoveAt(), SetProcessOrdering(), SetProcessOrderingToSecond(), and ~G4ProcessManager().

00173 {
00174   return  verboseLevel;
00175 }

G4int G4ProcessManager::InsertAt ( G4int  position,
G4VProcess process,
G4int  ivec 
) [protected]

Definition at line 332 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), G4cout, G4endl, GetVerboseLevel(), and G4ProcessVector::insertAt().

Referenced by AddProcess(), SetProcessOrdering(), and SetProcessOrderingToFirst().

00333 {
00334   G4ProcessVector* pVector = theProcVector[ivec];
00335   // check position
00336   if ( (ip<0) || (ip > pVector->entries()) ) return -1;
00337   
00338   // insert in pVector
00339   pVector->insertAt(ip, process);
00340 
00341   //correct index in ProcessAttributes of processes
00342   for (G4int iproc=0; iproc<numberOfProcesses; iproc++) {
00343     G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
00344     if (aAttr != 0) {
00345       if (aAttr->idxProcVector[ivec] >= ip){
00346         aAttr->idxProcVector[ivec] += 1;
00347       }
00348     } else {
00349 #ifdef G4VERBOSE
00350       if (GetVerboseLevel()>0) { 
00351         G4cout << " G4ProcessManager::InsertAt : No Process Attribute " << G4endl;
00352       }
00353 #endif
00354     }
00355   }
00356   return ip;
00357 }

G4int G4ProcessManager::operator!= ( const G4ProcessManager right  )  const

Definition at line 1001 of file G4ProcessManager.cc.

01002 {
01003   return (this != &right);
01004 }

G4int G4ProcessManager::operator== ( const G4ProcessManager right  )  const

Definition at line 995 of file G4ProcessManager.cc.

00996 {
00997   return (this == &right);
00998 }

G4int G4ProcessManager::RemoveAt ( G4int  position,
G4VProcess process,
G4int  ivec 
) [protected]

Definition at line 360 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), G4cout, G4endl, GetVerboseLevel(), ordInActive, and G4ProcessVector::removeAt().

Referenced by RemoveProcess(), SetProcessOrdering(), SetProcessOrderingToFirst(), and SetProcessOrderingToSecond().

00361 {
00362   G4ProcessVector* pVector = theProcVector[ivec];
00363   // check position
00364   if ( (ip<0) || (ip >= pVector->entries()) ) return -1;
00365 
00366   // remove process
00367   pVector->removeAt(ip);
00368 
00369   // correct index
00370   for(G4int iproc=0; iproc<numberOfProcesses; iproc++) {
00371     G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
00372     if (aAttr != 0) {
00373       if (ip < aAttr->idxProcVector[ivec]) {
00374         aAttr->idxProcVector[ivec] -=1;
00375       } else if (ip ==  aAttr->idxProcVector[ivec]) {
00376         aAttr->idxProcVector[ivec] = -1;
00377         aAttr->ordProcVector[ivec] = ordInActive;
00378       }
00379     }else {
00380 #ifdef G4VERBOSE
00381       if (GetVerboseLevel()>0) { 
00382         G4cout << " G4ProcessManager::RemoveAt : No Process Attribute " << G4endl;
00383       }
00384 #endif
00385     }
00386   } 
00387   return ip;
00388 }

G4VProcess * G4ProcessManager::RemoveProcess ( G4int  index  ) 

Definition at line 517 of file G4ProcessManager.cc.

References FatalException, G4Exception(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), G4ProcessTable::GetProcessTable(), G4ProcessAttribute::idxProcVector, G4ProcessAttribute::isActive, G4ProcessTable::Remove(), G4ProcessVector::removeAt(), and RemoveAt().

00518 {
00519   //find the process attribute
00520   G4ProcessAttribute* pAttr = GetAttribute(index);
00521   if (pAttr == 0) return 0;
00522 
00523   // remove process
00524   G4VProcess* removedProcess = (*theProcessList)[index];
00525 
00526   if (!(pAttr->isActive)) { ActivateProcess(index);}
00527   // remove process from vectors if the process is active
00528   for (G4int ivec=0; ivec<SizeOfProcVectorArray; ivec++) {
00529     G4ProcessVector* pVector = theProcVector[ivec];
00530     G4int idx = pAttr->idxProcVector[ivec];
00531     if ((idx >= 0)  && (idx < pVector->entries())) {
00532       //remove
00533       if (RemoveAt(idx, removedProcess, ivec) <0) {
00534         G4String anErrorMessage("Bad index in attribute");
00535         anErrorMessage += "for particle[" + theParticleType->GetParticleName() + "] ";
00536         anErrorMessage += "process[" + removedProcess->GetProcessName() + "]  " ;
00537         G4Exception( "G4ProcessManager::RemoveProcess()","Fatal Error",
00538                      FatalException,anErrorMessage);     
00539         return 0;
00540       }    
00541     } else if (idx<0) {
00542       // corresponding DoIt is not active  
00543     } else {
00544       // idx is out of range
00545       G4String anErrorMessage("Bad ProcessList : Index is out of range ");
00546       anErrorMessage += "for particle[" + theParticleType->GetParticleName() + "] ";
00547       anErrorMessage += "process[" + removedProcess->GetProcessName() + "]  " ;
00548       G4Exception( "G4ProcessManager::RemoveProcess()","ProcMan012",
00549                    FatalException,anErrorMessage);       
00550       return 0;
00551     }
00552   }
00553   pAttr->isActive = false;
00554   // remove from the process List and delete the attribute
00555   theProcessList->removeAt(index);
00556   G4ProcessAttrVector::iterator itr;
00557   for (itr = theAttrVector->begin(); itr!= theAttrVector->end(); ++itr) {
00558     if ( (*itr) == pAttr) {
00559       theAttrVector->erase(itr);
00560       break;
00561     }
00562   }
00563   delete pAttr;
00564   numberOfProcesses -= 1;
00565   
00566   // correct index
00567   for(G4int i=0; i<numberOfProcesses; i++) {
00568     G4ProcessAttribute* aAttr = (*theAttrVector)[i];
00569     if (index < aAttr->idxProcessList) aAttr->idxProcessList -=1;
00570   }
00571 
00572   CreateGPILvectors();
00573 
00574   //remove aProcess from ProcesssTable
00575   G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
00576   theProcessTable->Remove(removedProcess, this);
00577 
00578   return removedProcess;
00579 } 

G4VProcess * G4ProcessManager::RemoveProcess ( G4VProcess aProcess  ) 

Definition at line 582 of file G4ProcessManager.cc.

References GetProcessIndex().

Referenced by G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), and G4ProcessPlacer::RemoveProcess().

00583 {
00584   return RemoveProcess(GetProcessIndex(aProcess));
00585 } 

void G4ProcessManager::SetParticleType ( const G4ParticleDefinition  )  [inline]

Definition at line 35 of file G4ProcessManager.icc.

Referenced by G4VUserPhysicsList::AddProcessManager().

00036 {
00037   theParticleType = aParticle;
00038 }

G4VProcess * G4ProcessManager::SetProcessActivation ( G4int  index,
G4bool  fActive 
)

Definition at line 1117 of file G4ProcessManager.cc.

01118 {
01119   if (fActive) return ActivateProcess(index);
01120   else         return InActivateProcess(index);
01121 }

G4VProcess * G4ProcessManager::SetProcessActivation ( G4VProcess aProcess,
G4bool  fActive 
)

Definition at line 1109 of file G4ProcessManager.cc.

References GetProcessIndex().

Referenced by G4ITStepProcessor::ActiveOnlyITProcess(), G4ProcessManagerMessenger::SetNewValue(), and G4ProcessTable::SetProcessActivation().

01111 {
01112   return SetProcessActivation(GetProcessIndex(aProcess), fActive);
01113 } 

void G4ProcessManager::SetProcessOrdering ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idDoIt,
G4int  ordDoIt = ordDefault 
)

Definition at line 607 of file G4ProcessManager.cc.

References CheckOrderingParameters(), FindInsertPosition(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), GetProcessVectorId(), GetVerboseLevel(), G4ProcessAttribute::idxProcVector, InsertAt(), ordLast, G4ProcessAttribute::ordProcVector, RemoveAt(), typeDoIt, and verboseLevel.

Referenced by TLBE< T >::ConstructGeneral(), G4OpticalPhysics::ConstructProcess(), G4RunManager::ConstructScoringWorlds(), G4PhysicsListHelper::RegisterProcess(), and SetProcessOrderingToLast().

00612 {
00613   const G4String aErrorMessage(" G4ProcessManager::SetProcessOrdering");
00614 
00615 #ifdef G4VERBOSE
00616   if (GetVerboseLevel()>2) {
00617     G4cout << aErrorMessage ;
00618     G4cout << "particle[" + theParticleType->GetParticleName() +"] " ;
00619     G4cout <<"process[" + aProcess->GetProcessName() + "]"<<  G4endl;
00620   }
00621 #endif
00622 
00623   // get Process Vector Id
00624   G4int ivec = GetProcessVectorId(idDoIt, typeDoIt);
00625   if (ivec <0 ) {
00626 #ifdef G4VERBOSE
00627     if (verboseLevel>0) {
00628       G4cout <<  aErrorMessage << G4endl;
00629       G4cout << "particle[" << theParticleType->GetParticleName()  << "] " ;
00630       G4cout << "process[" << aProcess->GetProcessName() << "]"<<  G4endl;
00631       G4cout << " illegal DoIt Index [= " << G4int(idDoIt) << "]";
00632       G4cout << G4endl;
00633     }
00634 #endif
00635     return;
00636   }
00637  
00638   if (ordDoIt>ordLast) ordDoIt=ordLast;
00639   // get attribute 
00640   G4ProcessAttribute* pAttr = GetAttribute(aProcess); 
00641   if (pAttr == 0) {
00642     // can not get process attribute
00643     return;
00644 
00645   } else {
00646     G4int ip = pAttr->idxProcVector[ivec];
00647     // remove a process from the process vector
00648     if ( ip >=0 ) {
00649       RemoveAt(ip, aProcess, ivec);
00650     }
00651 
00652     // set ordering parameter to non-zero
00653     if (ordDoIt == 0) ordDoIt = 1;
00654     pAttr->ordProcVector[ivec-1] = ordDoIt;
00655     pAttr->ordProcVector[ivec] = ordDoIt;
00656 
00657     // insert in process vector  if ordDoIt >0
00658     if (ordDoIt >0) {
00659       // find insert position
00660       ip = FindInsertPosition(pAttr->ordProcVector[ivec], ivec);
00661       // insert 
00662       InsertAt(ip, aProcess, ivec);
00663       // set index in Process Attribute
00664       pAttr->idxProcVector[ivec] = ip;
00665 #ifdef G4VERBOSE
00666       if (verboseLevel>2) {
00667         G4cout <<  aErrorMessage << G4endl;
00668         G4cout << "particle[" << theParticleType->GetParticleName() << "] " ;
00669         G4cout <<"process[" << aProcess->GetProcessName() << "]"<<  G4endl;
00670         G4cout << aProcess->GetProcessName() << " is inserted at "<< ip;
00671         G4cout << " in ProcessVetor[" << ivec<< "]";
00672         G4cout << " with Ordering parameter = " <<  ordDoIt ;
00673         G4cout << G4endl;
00674       }
00675 #endif
00676     }
00677 
00678   }
00679   // check consistencies between ordering parameters and process 
00680   CheckOrderingParameters(aProcess);
00681 
00682   // create GPIL vectors 
00683   CreateGPILvectors();
00684 }

void G4ProcessManager::SetProcessOrderingToFirst ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idDoIt 
)

Definition at line 688 of file G4ProcessManager.cc.

References CheckOrderingParameters(), G4cout, G4endl, G4Exception(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), GetProcessVectorId(), G4ProcessAttribute::idxProcVector, InsertAt(), JustWarning, G4ProcessAttribute::ordProcVector, RemoveAt(), typeDoIt, and verboseLevel.

Referenced by G4PhysicsListHelper::AddTransportation(), G4ErrorPhysicsList::ConstructProcess(), and G4PhysicsListHelper::RegisterProcess().

00692 { 
00693   // get Process Vector Id(
00694   G4int ivec = GetProcessVectorId(idDoIt, typeDoIt);
00695   if (ivec <0 ) {
00696 #ifdef G4VERBOSE
00697     if (verboseLevel>0) {
00698       G4cout << "G4ProcessManager::SetProcessOrdering: ";
00699       G4cout << " illegal DoIt Index [= " << G4int(idDoIt) << "]";
00700       G4cout << G4endl;
00701     }
00702 #endif
00703     return;
00704   }
00705 
00706     // get attribute
00707    G4ProcessAttribute* pAttr = GetAttribute(aProcess); 
00708    if (pAttr == 0) {
00709      return;
00710    } else {
00711     G4int ip = pAttr->idxProcVector[ivec];
00712 
00713     // remove a process from the process vector
00714     if ( ip >=0 ) {
00715       RemoveAt(ip, aProcess, ivec);
00716     }
00717 
00718     // set ordering parameter to zero
00719     pAttr->ordProcVector[ivec] = 0;
00720     pAttr->ordProcVector[ivec-1] = 0;
00721 
00722     // insert 
00723     InsertAt(0, aProcess, ivec);
00724 
00725     // set index in Process Attribute
00726     pAttr->idxProcVector[ivec] = 0;
00727 
00728 #ifdef G4VERBOSE
00729     if (verboseLevel>2) {
00730       G4cout << "G4ProcessManager::SetProcessOrderingToFirst: ";
00731       G4cout << aProcess->GetProcessName() << " is inserted at top ";
00732       G4cout << " in ProcessVetor[" << ivec<< "]";
00733       G4cout << G4endl;
00734     }
00735 #endif
00736   }
00737  
00738   if (isSetOrderingFirstInvoked[idDoIt]){
00739     G4String anErrMsg = "Set Ordering First is invoked twice for ";
00740     anErrMsg += aProcess->GetProcessName();
00741     anErrMsg += " to ";
00742     anErrMsg += theParticleType->GetParticleName();
00743     G4Exception( "G4ProcessManager::SetProcessOrderingToFirst()",
00744                  "ProcMan113",
00745                  JustWarning,anErrMsg);  
00746    }
00747   isSetOrderingFirstInvoked[idDoIt] = true;
00748 
00749  // check consistencies between ordering parameters and process 
00750   CheckOrderingParameters(aProcess);
00751 
00752   // create GPIL vectors 
00753   CreateGPILvectors();
00754 
00755 }

void G4ProcessManager::SetProcessOrderingToLast ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idDoIt 
)

Definition at line 849 of file G4ProcessManager.cc.

References G4Exception(), G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), JustWarning, ordLast, and SetProcessOrdering().

Referenced by TLBE< T >::ConstructOp(), G4OpticalPhysics::ConstructProcess(), and G4PhysicsListHelper::RegisterProcess().

00853 {
00854   SetProcessOrdering(aProcess, idDoIt, ordLast );
00855 
00856   if (isSetOrderingLastInvoked[idDoIt]){
00857     G4String anErrMsg = "Set Ordering Last is invoked twice for ";
00858     anErrMsg += aProcess->GetProcessName();
00859     anErrMsg += " to ";
00860     anErrMsg += theParticleType->GetParticleName();
00861     G4Exception( "G4ProcessManager::SetProcessOrderingToLast()","ProcMan114",
00862                  JustWarning,anErrMsg);  
00863   }
00864   isSetOrderingLastInvoked[idDoIt] = true;
00865 }

void G4ProcessManager::SetProcessOrderingToSecond ( G4VProcess aProcess,
G4ProcessVectorDoItIndex  idDoIt 
)

Definition at line 758 of file G4ProcessManager.cc.

References G4ProcessVector::entries(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), GetProcessVectorId(), GetVerboseLevel(), G4ProcessAttribute::idxProcVector, INT_MAX, G4ProcessAttribute::ordProcVector, RemoveAt(), typeDoIt, and verboseLevel.

Referenced by G4RunManager::ConstructScoringWorlds().

00762 {
00763   const G4String aErrorMessage(" G4ProcessManager::SetProcessOrderingToSecond");
00764  
00765 #ifdef G4VERBOSE
00766   if (GetVerboseLevel()>2) {
00767     G4cout << aErrorMessage ;
00768     G4cout << "particle[" << theParticleType->GetParticleName()  << "] " ;
00769     G4cout <<"process[" << aProcess->GetProcessName() <<  "]"<<  G4endl;
00770   }
00771 #endif
00772 
00773   // get Process Vector Id
00774   G4int ivec = GetProcessVectorId(idDoIt, typeDoIt);
00775   if (ivec <0 ) {
00776 #ifdef G4VERBOSE
00777     if (verboseLevel>0) {
00778       G4cout <<  aErrorMessage << G4endl;
00779       G4cout << "particle[" << theParticleType->GetParticleName() << "] " ;
00780       G4cout << "process[" << aProcess->GetProcessName() << "]"<<  G4endl;
00781       G4cout << " illegal DoIt Index [= " << G4int(idDoIt) << "]";
00782       G4cout << G4endl;
00783     }
00784 #endif
00785     return;
00786   }
00787  
00788   // get attribute 
00789   G4ProcessAttribute* pAttr = GetAttribute(aProcess); 
00790   if (pAttr == 0) {
00791     // can not get process attribute
00792     return;
00793   } else {
00794     G4int ip = pAttr->idxProcVector[ivec];
00795     // remove a process from the process vector
00796     if ( ip >=0 ) {
00797       RemoveAt(ip, aProcess, ivec);
00798     }
00799   }
00800 
00801   // set ordering parameter to 1
00802   pAttr->ordProcVector[ivec-1] = 1;
00803   pAttr->ordProcVector[ivec]   = 1;
00804 
00805   // find insert position
00806   G4ProcessVector* pVector = theProcVector[ivec];
00807   G4int ip =  pVector->entries();
00808   G4int tmp = INT_MAX;
00809 
00810   // find insert position
00811   for (G4int iproc=0; iproc<numberOfProcesses; iproc++) {
00812     G4ProcessAttribute* aAttr = (*theAttrVector)[iproc];
00813     if ( aAttr->idxProcVector[ivec] >= 0 ) {
00814       if (    (aAttr->ordProcVector[ivec] !=0 )  &&
00815               (tmp >= aAttr->ordProcVector[ivec]) ) {
00816         tmp =  aAttr->ordProcVector[ivec];
00817         if ( ip > aAttr->idxProcVector[ivec] ) {          
00818           ip = aAttr->idxProcVector[ivec] ;
00819         }
00820       }
00821     }
00822   }
00823   
00824   // insert 
00825   InsertAt(ip, aProcess, ivec);
00826 
00827   // set index in Process Attribute
00828   pAttr->idxProcVector[ivec] = ip;
00829 #ifdef G4VERBOSE
00830   if (verboseLevel>2) {
00831     G4cout <<  aErrorMessage << G4endl;
00832     G4cout << "particle[" << theParticleType->GetParticleName()  << "] " ;
00833     G4cout <<"process[" << aProcess->GetProcessName() << "]"<<  G4endl;
00834     G4cout << aProcess->GetProcessName() << " is inserted at "<< ip;
00835     G4cout << " in ProcessVetor[" << ivec<< "]";
00836     G4cout << " with Ordering parameter = 1 ";
00837     G4cout << G4endl;
00838   }
00839 #endif
00840  
00841   // check consistencies between ordering parameters and process 
00842   CheckOrderingParameters(aProcess);
00843 
00844   // create GPIL vectors 
00845   CreateGPILvectors();
00846 }

void G4ProcessManager::SetVerboseLevel ( G4int  value  )  [inline]

Definition at line 166 of file G4ProcessManager.icc.

References verboseLevel.

Referenced by TLBE< T >::ConstructGeneral(), G4ProcessTable::DumpInfo(), and G4ProcessManagerMessenger::SetNewValue().

00167 {
00168   verboseLevel = value;
00169 }

void G4ProcessManager::StartTracking ( G4Track aTrack = 0  ) 

Definition at line 1088 of file G4ProcessManager.cc.

References G4ProcessVector::entries().

Referenced by G4ErrorPropagator::InitG4Track(), and G4TrackingManager::ProcessOneTrack().

01089 {
01090   for (G4int idx = 0; idx<theProcessList->entries(); idx++){
01091     if (GetAttribute(idx)->isActive)
01092       ((*theProcessList)[idx])->StartTracking(aTrack);
01093   }
01094   if(aTrack) duringTracking = true;
01095 }


Field Documentation

G4int G4ProcessManager::verboseLevel [protected]

Definition at line 360 of file G4ProcessManager.hh.

Referenced by AddProcess(), DumpInfo(), G4ParticleDefinition::GetAntiQuarkContent(), GetProcessVectorIndex(), G4ParticleDefinition::GetQuarkContent(), GetVerboseLevel(), G4ParticleDefinition::GetVerboseLevel(), SetProcessOrdering(), SetProcessOrderingToFirst(), SetProcessOrderingToSecond(), SetVerboseLevel(), and G4ParticleDefinition::SetVerboseLevel().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:59 2013 for Geant4 by  doxygen 1.4.7