Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4CellScoreComposer.cc,v 1.2 2004/07/01 09:19:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4CellStoreScorer.cc,v 1.1 2003/10/03 10:10:56 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HCtable.cc,v 1.3 2004/03/15 19:16:07 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include "G4HCtable.hh"
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MultiFunctionalDetector.cc,v 1.3 2005/11/16 22:59:01 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4MultiFunctionalDetector
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
|
||||
G4MultiFunctionalDetector::G4MultiFunctionalDetector(G4String name)
|
||||
:G4VSensitiveDetector(name)
|
||||
{;}
|
||||
|
||||
G4MultiFunctionalDetector::~G4MultiFunctionalDetector()
|
||||
{;}
|
||||
|
||||
G4bool G4MultiFunctionalDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* aTH)
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->HitPrimitive(aStep,aTH); }
|
||||
return true;
|
||||
}
|
||||
|
||||
G4bool G4MultiFunctionalDetector::RegisterPrimitive(G4VPrimitiveScorer* aPS)
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{
|
||||
if(primitives[iPrim]==aPS)
|
||||
{
|
||||
G4cerr << "Primitive <" << aPS->GetName() << "> is already defined in <" << SensitiveDetectorName
|
||||
<< ">." << G4endl << "Method RegisterPrimitive() is ignored." << G4endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
primitives.push_back(aPS);
|
||||
aPS->SetMultiFunctionalDetector(this);
|
||||
collectionName.insert(aPS->GetName());
|
||||
if(G4SDManager::GetSDMpointer()->FindSensitiveDetector(SensitiveDetectorName,false))
|
||||
{
|
||||
// This G4MultiFunctionalDetector has already been registered to G4SDManager.
|
||||
// Make sure this new primitive is registered as well.
|
||||
G4SDManager::GetSDMpointer()->AddNewCollection(SensitiveDetectorName,aPS->GetName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
G4bool G4MultiFunctionalDetector::RemovePrimitive(G4VPrimitiveScorer* aPS)
|
||||
{
|
||||
std::vector<G4VPrimitiveScorer*>::iterator iterPS;
|
||||
std::vector<G4String>::iterator iterName = collectionName.begin();
|
||||
for(iterPS=primitives.begin();iterPS!=primitives.end();iterPS++)
|
||||
{
|
||||
if(*iterPS==aPS)
|
||||
{
|
||||
primitives.erase(iterPS);
|
||||
aPS->SetMultiFunctionalDetector(0);
|
||||
return true;
|
||||
}
|
||||
iterName++;
|
||||
}
|
||||
G4cerr << "Primitive <" << aPS->GetName() << "> is not defined in <" << SensitiveDetectorName
|
||||
<< ">." << G4endl << "Method RemovePrimitive() is ignored." << G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void G4MultiFunctionalDetector::Initialize(G4HCofThisEvent* HC)
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->Initialize(HC); }
|
||||
}
|
||||
|
||||
void G4MultiFunctionalDetector::EndOfEvent(G4HCofThisEvent* HC)
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->EndOfEvent(HC); }
|
||||
}
|
||||
|
||||
void G4MultiFunctionalDetector::clear()
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->clear(); }
|
||||
}
|
||||
|
||||
void G4MultiFunctionalDetector::DrawAll()
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->DrawAll(); }
|
||||
}
|
||||
|
||||
void G4MultiFunctionalDetector::PrintAll()
|
||||
{
|
||||
G4int nPrim = primitives.size();
|
||||
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
|
||||
{ primitives[iPrim]->PrintAll(); }
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SDManager.cc,v 1.2 2004/05/03 08:14:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4SDManager.cc,v 1.3 2005/09/22 22:21:36 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include "G4SDManager.hh"
|
||||
@@ -64,16 +64,17 @@ G4SDManager::~G4SDManager()
|
||||
|
||||
void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
|
||||
{
|
||||
G4String pathName = aSD->GetPathName();
|
||||
G4int numberOfCollections = aSD->GetNumberOfCollections();
|
||||
G4String pathName = aSD->GetPathName();
|
||||
if( pathName(0) != '/' ) pathName.prepend("/");
|
||||
if( pathName(pathName.length()-1) != '/' ) pathName += "/";
|
||||
treeTop->AddNewDetector(aSD,pathName);
|
||||
if(numberOfCollections<1) return;
|
||||
for(G4int i=0;i<numberOfCollections;i++)
|
||||
{
|
||||
G4String SDname = aSD->GetName();
|
||||
G4String DCname = aSD->GetCollectionName(i);
|
||||
HCtable->Registor(SDname,DCname);
|
||||
AddNewCollection(SDname,DCname);
|
||||
}
|
||||
if( verboseLevel > 0 )
|
||||
{
|
||||
@@ -82,6 +83,18 @@ void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
|
||||
}
|
||||
}
|
||||
|
||||
void G4SDManager::AddNewCollection(G4String SDname,G4String DCname)
|
||||
{
|
||||
G4int i = HCtable->Registor(SDname,DCname);
|
||||
if(verboseLevel>0)
|
||||
{
|
||||
if(i<0) G4cerr << "G4SDManager::AddNewCollection : the collection <"
|
||||
<< SDname << "/" << DCname << "> has already been reginstered." << G4endl;
|
||||
else G4cout << "G4SDManager::AddNewCollection : the collection <"
|
||||
<< SDname << "/" << DCname << "> is registered at " << i << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4HCofThisEvent* G4SDManager::PrepareNewEvent()
|
||||
{
|
||||
G4HCofThisEvent* HCE = new G4HCofThisEvent(HCtable->entries());
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SDStructure.cc,v 1.2 2004/05/03 08:14:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
// G4SDStructure
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SDmessenger.cc,v 1.1 2003/10/03 10:11:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SensitiveVolumeList.cc,v 1.1 2003/10/03 10:12:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackLogger.cc,v 1.2 2004/07/01 09:19:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VPrimitiveScorer.cc,v 1.1 2005/11/16 22:59:01 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4VPrimitiveScorer
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
|
||||
|
||||
G4VPrimitiveScorer::G4VPrimitiveScorer(G4String name, G4int depth)
|
||||
:primitiveName(name),detector(0),filter(0),verboseLevel(0),indexDepth(depth)
|
||||
{;}
|
||||
|
||||
G4VPrimitiveScorer::~G4VPrimitiveScorer()
|
||||
{;}
|
||||
|
||||
G4int G4VPrimitiveScorer::GetCollectionID(G4int)
|
||||
{
|
||||
if(detector)
|
||||
return G4SDManager::GetSDMpointer()
|
||||
->GetCollectionID(detector->GetName()+"/"+primitiveName);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
void G4VPrimitiveScorer::Initialize(G4HCofThisEvent*)
|
||||
{;}
|
||||
|
||||
void G4VPrimitiveScorer::EndOfEvent(G4HCofThisEvent*)
|
||||
{;}
|
||||
|
||||
void G4VPrimitiveScorer::clear()
|
||||
{;}
|
||||
|
||||
void G4VPrimitiveScorer::DrawAll()
|
||||
{;}
|
||||
|
||||
void G4VPrimitiveScorer::PrintAll()
|
||||
{;}
|
||||
|
||||
G4int G4VPrimitiveScorer::GetIndex(G4Step* aStep)
|
||||
{
|
||||
G4StepPoint* preStep = aStep->GetPreStepPoint();
|
||||
G4TouchableHistory* th = (G4TouchableHistory*)(preStep->GetTouchable());
|
||||
return th->GetReplicaNumber(indexDepth);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VReadOutGeometry.cc,v 1.1 2003/10/03 10:12:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSDFilter.cc,v 1.1 2005/09/22 22:21:36 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4VSensitiveDetector
|
||||
#include "G4VSDFilter.hh"
|
||||
|
||||
G4VSDFilter::G4VSDFilter(G4String name)
|
||||
:filterName(name)
|
||||
{;}
|
||||
|
||||
G4VSDFilter::~G4VSDFilter()
|
||||
{;}
|
||||
@@ -21,15 +21,15 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSensitiveDetector.cc,v 1.1 2003/10/03 10:12:56 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VSensitiveDetector.cc,v 1.2 2005/09/22 22:21:36 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4VSensitiveDetector
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
G4VSensitiveDetector::G4VSensitiveDetector(G4String name)
|
||||
:verboseLevel(0),active(true),ROgeometry(0)
|
||||
:verboseLevel(0),active(true),ROgeometry(0),filter(0)
|
||||
{
|
||||
size_t sLast = name.last('/');
|
||||
if(sLast==std::string::npos)
|
||||
@@ -56,6 +56,7 @@ G4VSensitiveDetector::G4VSensitiveDetector(const G4VSensitiveDetector &right)
|
||||
verboseLevel = right.verboseLevel;
|
||||
active = right.active;
|
||||
ROgeometry = right.ROgeometry;
|
||||
filter = right.filter;
|
||||
}
|
||||
|
||||
G4VSensitiveDetector::~G4VSensitiveDetector()
|
||||
@@ -70,6 +71,7 @@ const G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveD
|
||||
verboseLevel = right.verboseLevel;
|
||||
active = right.active;
|
||||
ROgeometry = right.ROgeometry;
|
||||
filter = right.filter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user