Import Geant4 3.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:03:00 +02:00
parent cfcb558cfe
commit 137e303ecc
2843 changed files with 37082 additions and 38426 deletions
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelAnalysisManager.cc,v 1.1 2000/12/06 16:53:13 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelAnalysisMessenger.cc,v 1.1 2000/12/06 16:53:13 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -0,0 +1,92 @@
// 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: GammaRayTelAnticoincidenceHit.cc,v 1.1 2001/03/05 13:58:22 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
//
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelAnticoincidenceHit ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "GammaRayTelAnticoincidenceHit.hh"
G4Allocator<GammaRayTelAnticoincidenceHit> GammaRayTelAnticoincidenceHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelAnticoincidenceHit::GammaRayTelAnticoincidenceHit()
{
EdepACD = 0.;
ACDTileNumber = 0;
IsACDPlane = 0;
pos = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelAnticoincidenceHit::~GammaRayTelAnticoincidenceHit()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelAnticoincidenceHit::GammaRayTelAnticoincidenceHit(const GammaRayTelAnticoincidenceHit& right)
{
EdepACD = right.EdepACD;
ACDTileNumber = right.ACDTileNumber;
IsACDPlane = right.IsACDPlane;
pos = right.pos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const GammaRayTelAnticoincidenceHit& GammaRayTelAnticoincidenceHit::operator=(const GammaRayTelAnticoincidenceHit& right)
{
EdepACD = right.EdepACD;
ACDTileNumber = right.ACDTileNumber;
IsACDPlane = right.IsACDPlane;
pos = right.pos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int GammaRayTelAnticoincidenceHit::operator==(const GammaRayTelAnticoincidenceHit& right) const
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceHit::Draw()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceHit::Print()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,217 @@
// 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: GammaRayTelAnticoincidenceSD.cc,v 1.1 2001/03/05 13:58:22 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
//
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelAnticoincidenceSD ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
#include "GammaRayTelAnticoincidenceSD.hh"
#include "GammaRayTelAnticoincidenceHit.hh"
#include "GammaRayTelDetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelAnticoincidenceSD::GammaRayTelAnticoincidenceSD(G4String name,
GammaRayTelDetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
NbOfACDLateralTiles = Detector->GetNbOfACDLateralTiles();
NbOfACDTopTiles = Detector->GetNbOfACDTopTiles();
G4cout << NbOfACDLateralTiles << " LAT " << G4endl;
G4cout << NbOfACDTopTiles << " TOP " << G4endl;
HitLateralID = new G4int[NbOfACDLateralTiles];
HitTopID = new G4int[NbOfACDTopTiles];
collectionName.insert("AnticoincidenceCollection");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelAnticoincidenceSD::~GammaRayTelAnticoincidenceSD()
{
delete [] HitLateralID;
delete [] HitTopID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceSD::Initialize(G4HCofThisEvent*HCE)
{
AnticoincidenceCollection = new GammaRayTelAnticoincidenceHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int i=0;i<NbOfACDLateralTiles;i++)
{
HitLateralID[i] = -1;
};
for (G4int j=0;j<NbOfACDTopTiles;j++)
{
HitTopID[j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool GammaRayTelAnticoincidenceSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
if ((edep/keV == 0.)) return false;
// This TouchableHistory is used to obtain the physical volume
// of the hit
G4TouchableHistory* theTouchable
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* acd_tile = theTouchable->GetVolume();
G4int ACDTileNumber=acd_tile->GetCopyNo();
G4String ACDTileName = acd_tile->GetName();
G4cout << ACDTileName << " " << edep/keV << G4endl;
if (ACDTileName == "ACT" )
// The hit is on an top ACD tile (ACDType 0)
{
// This is a new hit
if (HitTopID[ACDTileNumber]==-1)
{
GammaRayTelAnticoincidenceHit*
AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
AnticoincidenceHit->SetACDType(0);
AnticoincidenceHit->AddEnergy(edep);
AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
HitTopID[ACDTileNumber] =
AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
}
else // This is not new
{
(*AnticoincidenceCollection)
[HitTopID[ACDTileNumber]]->AddEnergy(edep);
}
}
if (ACDTileName == "ACL1")
// The hit is on an lateral (left-right) ACD tile (ACDType 1)
{
// This is a new hit
if (HitLateralID[ACDTileNumber]==-1)
{
GammaRayTelAnticoincidenceHit*
AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
AnticoincidenceHit->SetACDType(1);
AnticoincidenceHit->AddEnergy(edep);
AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
HitLateralID[ACDTileNumber] =
AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
}
else // This is not new
{
(*AnticoincidenceCollection)
[HitLateralID[ACDTileNumber]]->AddEnergy(edep);
}
}
if (ACDTileName == "ACL2")
// The hit is on an lateral (rear - front) ACD tile (ACDType 2)
{
// This is a new hit
if (HitLateralID[ACDTileNumber]==-1)
{
GammaRayTelAnticoincidenceHit*
AnticoincidenceHit = new GammaRayTelAnticoincidenceHit;
AnticoincidenceHit->SetACDType(2);
AnticoincidenceHit->AddEnergy(edep);
AnticoincidenceHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
AnticoincidenceHit->SetACDTileNumber(ACDTileNumber);
HitLateralID[ACDTileNumber] =
AnticoincidenceCollection->insert(AnticoincidenceHit) -1;
}
else // This is not new
{
(*AnticoincidenceCollection)
[HitLateralID[ACDTileNumber]]->AddEnergy(edep);
}
}
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
}
HCE->AddHitsCollection(HCID,AnticoincidenceCollection);
for (G4int i=0;i<NbOfACDLateralTiles;i++)
{
HitLateralID[i] = -1;
};
for (G4int j=0;j<NbOfACDTopTiles;j++)
{
HitTopID[j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceSD::DrawAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelAnticoincidenceSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,95 @@
// 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: GammaRayTelCalorimeterHit.cc,v 1.1 2001/03/05 13:58:22 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
//
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelCalorimeterHit ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "GammaRayTelCalorimeterHit.hh"
G4Allocator<GammaRayTelCalorimeterHit> GammaRayTelCalorimeterHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelCalorimeterHit::GammaRayTelCalorimeterHit()
{
EdepCAL = 0.;
CALBarNumber = 0;
CALPlaneNumber = 0;
IsCALPlane = 0;
pos = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelCalorimeterHit::~GammaRayTelCalorimeterHit()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelCalorimeterHit::GammaRayTelCalorimeterHit(const GammaRayTelCalorimeterHit& right)
{
EdepCAL = right.EdepCAL;
CALBarNumber = right.CALBarNumber;
CALPlaneNumber = right.CALPlaneNumber;
IsCALPlane = right.IsCALPlane;
pos = right.pos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const GammaRayTelCalorimeterHit& GammaRayTelCalorimeterHit::operator=(const GammaRayTelCalorimeterHit& right)
{
EdepCAL = right.EdepCAL;
CALBarNumber = right.CALBarNumber;
CALPlaneNumber = right.CALPlaneNumber;
IsCALPlane = right.IsCALPlane;
pos = right.pos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int GammaRayTelCalorimeterHit::operator==(const GammaRayTelCalorimeterHit& right) const
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterHit::Draw()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterHit::Print()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,194 @@
// 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: GammaRayTelCalorimeterSD.cc,v 1.1 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
//
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelCalorimeterSD ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
#include "GammaRayTelCalorimeterSD.hh"
#include "GammaRayTelCalorimeterHit.hh"
#include "GammaRayTelDetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelCalorimeterSD::GammaRayTelCalorimeterSD(G4String name,
GammaRayTelDetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
NbOfCALBars = Detector->GetNbOfCALBars();
NbOfCALLayers = Detector->GetNbOfCALLayers();
G4cout << NbOfCALBars << " bars " << G4endl;
G4cout << NbOfCALLayers << " layers " << G4endl;
ChitXID = new G4int[NbOfCALBars][12];
ChitYID = new G4int[NbOfCALBars][12];
collectionName.insert("CalorimeterCollection");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelCalorimeterSD::~GammaRayTelCalorimeterSD()
{
delete [] ChitXID;
delete [] ChitYID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterSD::Initialize(G4HCofThisEvent*HCE)
{
CalorimeterCollection = new GammaRayTelCalorimeterHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int i=0;i<NbOfCALBars;i++)
for (G4int j=0;j<NbOfCALLayers;j++)
{
ChitXID[i][j] = -1;
ChitYID[i][j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool GammaRayTelCalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
if ((edep/keV == 0.)) return false;
// This TouchableHistory is used to obtain the physical volume
// of the hit
G4TouchableHistory* theTouchable
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* cal_bar = theTouchable->GetVolume();
G4VPhysicalVolume* cal_plane = cal_bar->GetMother();
G4int CALBarNumber=cal_bar->GetCopyNo();
G4String CALBarName = cal_bar->GetName();
G4int PlaneNumber = 0;
PlaneNumber=cal_plane->GetCopyNo();
G4String PlaneName = cal_plane->GetName();
if (PlaneName == "CALLayerX" )
// The hit is on an X CsI plane
{
// This is a new hit
if (ChitXID[CALBarNumber][PlaneNumber]==-1)
{
GammaRayTelCalorimeterHit* CalorimeterHit = new GammaRayTelCalorimeterHit;
CalorimeterHit->SetCALType(1);
CalorimeterHit->AddEnergy(edep);
CalorimeterHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
CalorimeterHit->SetCALPlaneNumber(PlaneNumber);
CalorimeterHit->SetCALBarNumber(CALBarNumber);
ChitXID[CALBarNumber][PlaneNumber] =
CalorimeterCollection->insert(CalorimeterHit) -1;
}
else // This is not new
{
(*CalorimeterCollection)
[ChitXID[CALBarNumber][PlaneNumber]]->AddEnergy(edep);
}
}
if (PlaneName == "CALLayerY")
// The hit is on an Y CsI plane
{
// This is a new hit
if (ChitYID[CALBarNumber][PlaneNumber]==-1)
{
GammaRayTelCalorimeterHit* CalorimeterHit
= new GammaRayTelCalorimeterHit;
CalorimeterHit->SetCALType(0);
CalorimeterHit->AddEnergy(edep);
CalorimeterHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
CalorimeterHit->SetCALPlaneNumber(PlaneNumber);
CalorimeterHit->SetCALBarNumber(CALBarNumber);
ChitYID[CALBarNumber][PlaneNumber] =
CalorimeterCollection->insert(CalorimeterHit)-1;
}
else // This is not new
{
(*CalorimeterCollection)
[ChitYID[CALBarNumber][PlaneNumber]]->AddEnergy(edep);
}
}
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
}
HCE->AddHitsCollection(HCID,CalorimeterCollection);
for (G4int i=0;i<NbOfCALBars;i++)
for (G4int j=0;j<NbOfCALLayers;j++)
{
ChitXID[i][j] = -1;
ChitYID[i][j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterSD::DrawAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelCalorimeterSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: GammaRayTelDetectorConstruction.cc,v 1.4 2000/12/06 16:53:13 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: GammaRayTelDetectorConstruction.cc,v 1.5 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -24,8 +24,11 @@
#include "GammaRayTelDetectorConstruction.hh"
#include "GammaRayTelDetectorMessenger.hh"
#include "GammaRayTelPayloadSD.hh"
#include "GammaRayTelPayloadROGeometry.hh"
#include "GammaRayTelTrackerSD.hh"
#include "GammaRayTelTrackerROGeometry.hh"
#include "GammaRayTelAnticoincidenceSD.hh"
#include "GammaRayTelCalorimeterSD.hh"
#include "G4Material.hh"
#include "G4Box.hh"
@@ -57,8 +60,10 @@ GammaRayTelDetectorConstruction::GammaRayTelDetectorConstruction()
solidTKRDetectorX(0),logicTKRDetectorX(0),
solidTKRDetectorY(0),logicTKRDetectorY(0),
physiTKRDetectorX(0),physiTKRDetectorY(0),
solidCALDetector(0),logicCALDetector(0),
physiCALDetectorX(0),physiCALDetectorY(0),
solidCALDetectorX(0),logicCALDetectorX(0),physiCALDetectorX(0),
solidCALDetectorY(0),logicCALDetectorY(0),physiCALDetectorY(0),
solidCALLayerX(0),logicCALLayerX(0),physiCALLayerX(0),
solidCALLayerY(0),logicCALLayerY(0),physiCALLayerY(0),
solidPlane(0),logicPlane(0),physiPlane(0)
{
@@ -77,6 +82,8 @@ GammaRayTelDetectorConstruction::GammaRayTelDetectorConstruction()
NbOfCALBars = 12;
NbOfCALLayers = 5;
ACDThickness = 1.*cm;
NbOfACDTopTiles = 1;
NbOfACDLateralTiles = 2;
TilesSeparation = 100.*micrometer;
ACDTKRDistance = 5.*cm;
@@ -246,427 +253,514 @@ G4VPhysicalVolume* GammaRayTelDetectorConstruction::ConstructPayload()
solidTKRDetectorX=0;logicTKRDetectorX=0;
solidTKRDetectorY=0;logicTKRDetectorY=0;
physiTKRDetectorX=0;physiTKRDetectorY=0;
solidCALDetector=0;logicCALDetector=0;
physiCALDetectorX=0;physiCALDetectorY=0;
solidCALDetectorX=0;logicCALDetectorX=0;physiCALDetectorX=0;
solidCALDetectorY=0;logicCALDetectorY=0;physiCALDetectorY=0;
solidPlane=0;logicPlane=0;physiPlane=0;
// if (PayloadSizeZ > 0.)
// {
//
// Payload
//
solidPayload = new G4Box("Payload",
PayloadSizeXY/2,
PayloadSizeXY/2,
PayloadSizeZ/2);
logicPayload = new G4LogicalVolume(solidPayload,
defaultMaterial,
"Payload");
physiPayload = new G4PVPlacement(0,
G4ThreeVector(),
"Payload",
logicPayload,
physiWorld,
false,
0);
//
// Calorimeter (CAL)
//
solidCAL = new G4Box("CAL",
CALSizeXY/2,CALSizeXY/2,CALSizeZ/2);
logicCAL = new G4LogicalVolume(solidCAL,
defaultMaterial,
"CAL");
physiCAL = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ/2),
"CAL",
logicCAL,
physiPayload,
false,
0);
//
// Tracker (TKR)
//
// Payload
//
solidPayload = new G4Box("Payload",
PayloadSizeXY/2,
PayloadSizeXY/2,
PayloadSizeZ/2);
logicPayload = new G4LogicalVolume(solidPayload,
defaultMaterial,
"Payload");
physiPayload = new G4PVPlacement(0,
G4ThreeVector(),
"Payload",
logicPayload,
physiWorld,
false,
0);
//
// Calorimeter (CAL)
//
solidCAL = new G4Box("CAL",
CALSizeXY/2,CALSizeXY/2,CALSizeZ/2);
logicCAL = new G4LogicalVolume(solidCAL,
defaultMaterial,
"CAL");
physiCAL = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ/2),
"CAL",
logicCAL,
physiPayload,
false,
0);
//
// Tracker (TKR)
//
solidTKR = new G4Box("TKR",
solidTKR = new G4Box("TKR",
TKRSizeXY/2,TKRSizeXY/2,TKRSizeZ/2);
logicTKR = new G4LogicalVolume(solidTKR,
defaultMaterial,
"TKR");
physiTKR = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ+
CALTKRDistance+TKRSizeZ/2),
"TKR",
logicTKR,
physiPayload,
false,
0);
//
// Anticoincidence Top (ACT)
//
solidACT = new G4Box("ACT",
ACTSizeXY/2,ACTSizeXY/2,ACTSizeZ/2);
logicACT = new G4LogicalVolume(solidACT,ACDMaterial,"ACT");
physiACT = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ+
CALTKRDistance+TKRSizeZ+
ACDTKRDistance+ACTSizeZ/2),
"ACT",
logicACT,
physiPayload,
false,
0);
//
// Anticoincidence Lateral Side (ACL)
//
solidACL1 = new G4Box("ACL1",
ACL1SizeX/2,ACL1SizeY/2,ACL1SizeZ/2);
logicACL1 = new G4LogicalVolume(solidACL1,ACDMaterial,"ACL");
physiACL1 = new G4PVPlacement(0,
G4ThreeVector(-PayloadSizeXY/2+ACL1SizeX/2,
-PayloadSizeXY/2+ACL1SizeY/2,
-PayloadSizeZ/2+ACL1SizeZ/2),
"ACL1",
logicACL1,
physiPayload,
false,
0);
physiACL1 = new G4PVPlacement(0,
G4ThreeVector(PayloadSizeXY/2-ACL1SizeX/2,
PayloadSizeXY/2-ACL1SizeY/2,
-PayloadSizeZ/2+ACL1SizeZ/2),
"ACL1",
logicACL1,
physiPayload,
false,
1);
solidACL2 = new G4Box("ACL2",
ACL2SizeX/2,ACL2SizeY/2,ACL2SizeZ/2);
logicACL2 = new G4LogicalVolume(solidACL2,
ACDMaterial,
"ACL2");
physiACL2 = new G4PVPlacement(0,
G4ThreeVector(-PayloadSizeXY/2+ACL2SizeX/2,
PayloadSizeXY/2-ACL2SizeY/2,
-PayloadSizeZ/2+ACL2SizeZ/2),
"ACL2",
logicACL2,
physiPayload,
false,
0);
physiACL2 = new G4PVPlacement(0,
G4ThreeVector(PayloadSizeXY/2-ACL2SizeX/2,
-PayloadSizeXY/2+ACL2SizeY/2,
-PayloadSizeZ/2+ACL2SizeZ/2),
"ACL2",
logicACL2,
physiPayload,
false,
1);
// Tracker Structure (Plane + Converter + TKRDetectorX + TKRDetectorY)
solidPlane = new G4Box("Plane",
TKRSizeXY/2,TKRSizeXY/2,TKRSupportThickness/2);
logicPlane = new G4LogicalVolume(solidPlane,
defaultMaterial,
"Plane");
solidTKRDetectorY = new G4Box
("TKRDetectorY",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
logicTKRDetectorY = new G4LogicalVolume(solidTKRDetectorY,
TKRMaterial,
"TKRDetector Y");
solidTKRDetectorX = new G4Box
("TKRDetectorX",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
logicTKRDetectorX = new G4LogicalVolume(solidTKRDetectorX,
TKRMaterial,
"TKRDetector X");
solidConverter = new G4Box
("Converter",TKRSizeXY/2,TKRSizeXY/2,ConverterThickness/2);
logicConverter = new G4LogicalVolume(solidConverter,
ConverterMaterial,
"Converter");
G4int i=0;
for (i = 0; i < NbOfTKRLayers; i++)
{
physiTKRDetectorY =
new G4PVPlacement(0,G4ThreeVector(0.,0.,-TKRSizeZ/2
+TKRSiliconThickness/2
+(i)*TKRLayerDistance),
"TKRDetectorY",
logicTKRDetectorY,
physiTKR,
false,
i);
physiTKRDetectorX =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
TKRSiliconThickness/2 +
TKRViewsDistance+
TKRSiliconThickness+
(i)*TKRLayerDistance),
"TKRDetectorX",
logicTKRDetectorX,
physiTKR,
false,
i);
physiConverter =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
2*TKRSiliconThickness +
TKRViewsDistance+
ConverterThickness/2+
(i)*TKRLayerDistance),
"Converter",
logicConverter,
physiTKR,
false,
i);
logicTKR = new G4LogicalVolume(solidTKR,
defaultMaterial,
"TKR");
physiTKR = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ+
CALTKRDistance+TKRSizeZ/2),
"TKR",
logicTKR,
physiPayload,
false,
0);
//
// Anticoincidence Top (ACT)
//
solidACT = new G4Box("ACT",
ACTSizeXY/2,ACTSizeXY/2,ACTSizeZ/2);
logicACT = new G4LogicalVolume(solidACT,ACDMaterial,"ACT");
physiACT = new G4PVPlacement(0,
G4ThreeVector(0,0,
-PayloadSizeZ/2+CALSizeZ+
CALTKRDistance+TKRSizeZ+
ACDTKRDistance+ACTSizeZ/2),
"ACT",
logicACT,
physiPayload,
false,
0);
//
// Anticoincidence Lateral Side (ACL)
//
solidACL1 = new G4Box("ACL1",
ACL1SizeX/2,ACL1SizeY/2,ACL1SizeZ/2);
logicACL1 = new G4LogicalVolume(solidACL1,ACDMaterial,"ACL");
physiACL1 = new G4PVPlacement(0,
G4ThreeVector(-PayloadSizeXY/2+ACL1SizeX/2,
-PayloadSizeXY/2+ACL1SizeY/2,
-PayloadSizeZ/2+ACL1SizeZ/2),
"ACL1",
logicACL1,
physiPayload,
false,
0);
physiACL1 = new G4PVPlacement(0,
G4ThreeVector(PayloadSizeXY/2-ACL1SizeX/2,
PayloadSizeXY/2-ACL1SizeY/2,
-PayloadSizeZ/2+ACL1SizeZ/2),
"ACL1",
logicACL1,
physiPayload,
false,
1);
solidACL2 = new G4Box("ACL2",
ACL2SizeX/2,ACL2SizeY/2,ACL2SizeZ/2);
logicACL2 = new G4LogicalVolume(solidACL2,
ACDMaterial,
"ACL2");
physiACL2 = new G4PVPlacement(0,
G4ThreeVector(-PayloadSizeXY/2+ACL2SizeX/2,
PayloadSizeXY/2-ACL2SizeY/2,
-PayloadSizeZ/2+ACL2SizeZ/2),
"ACL2",
logicACL2,
physiPayload,
false,
0);
physiACL2 = new G4PVPlacement(0,
G4ThreeVector(PayloadSizeXY/2-ACL2SizeX/2,
-PayloadSizeXY/2+ACL2SizeY/2,
-PayloadSizeZ/2+ACL2SizeZ/2),
"ACL2",
logicACL2,
physiPayload,
false,
1);
physiPlane =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
2*TKRSiliconThickness +
TKRViewsDistance+
ConverterThickness+
TKRSupportThickness/2),
"Plane",
logicPlane,
physiTKR,
false,
i);
// Tracker Structure (Plane + Converter + TKRDetectorX + TKRDetectorY)
solidPlane = new G4Box("Plane",
TKRSizeXY/2,TKRSizeXY/2,TKRSupportThickness/2);
logicPlane = new G4LogicalVolume(solidPlane,
defaultMaterial,
"Plane");
solidTKRDetectorY = new G4Box
("TKRDetectorY",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
logicTKRDetectorY = new G4LogicalVolume(solidTKRDetectorY,
TKRMaterial,
"TKRDetector Y");
solidTKRDetectorX = new G4Box
("TKRDetectorX",TKRSizeXY/2,TKRSizeXY/2,TKRSiliconThickness/2);
logicTKRDetectorX = new G4LogicalVolume(solidTKRDetectorX,
TKRMaterial,
"TKRDetector X");
solidConverter = new G4Box
("Converter",TKRSizeXY/2,TKRSizeXY/2,ConverterThickness/2);
logicConverter = new G4LogicalVolume(solidConverter,
ConverterMaterial,
"Converter");
G4int i=0;
for (i = 0; i < NbOfTKRLayers; i++)
}
G4VSolid * solidTKRActiveTileX = new
G4Box("Active Tile X", TKRActiveTileXY/2,
TKRActiveTileXY/2,TKRActiveTileZ/2);
G4VSolid * solidTKRActiveTileY = new
G4Box("Active Tile Y", TKRActiveTileXY/2,
TKRActiveTileXY/2,TKRActiveTileZ/2);
G4LogicalVolume* logicTKRActiveTileX =
new G4LogicalVolume(solidTKRActiveTileX, TKRMaterial,
"Active Tile X",0,0,0);
G4LogicalVolume* logicTKRActiveTileY =
new G4LogicalVolume(solidTKRActiveTileY, TKRMaterial,
"Active Tile Y",0,0,0);
G4int j=0;
G4int k=0;
G4VPhysicalVolume* physiTKRActiveTileX = 0;
G4VPhysicalVolume* physiTKRActiveTileY = 0;
G4double x=0.;
G4double y=0.;
G4double z=0.;
for (i=0;i< NbOfTKRTiles; i++)
{
for (j=0;j< NbOfTKRTiles; j++)
{
k = i*NbOfTKRTiles + j;
physiTKRDetectorY =
new G4PVPlacement(0,G4ThreeVector(0.,0.,-TKRSizeZ/2
+TKRSiliconThickness/2
+(i)*TKRLayerDistance),
"TKRDetectorY",
logicTKRDetectorY,
physiTKR,
x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+TilesSeparation+
TKRActiveTileXY);
z = 0.;
physiTKRActiveTileY =
new G4PVPlacement(0,
G4ThreeVector(x,y,z),
"Active Tile Y",
logicTKRActiveTileY,
physiTKRDetectorY,
false,
i);
physiTKRDetectorX =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
TKRSiliconThickness/2 +
TKRViewsDistance+
TKRSiliconThickness+
(i)*TKRLayerDistance),
"TKRDetectorX",
logicTKRDetectorX,
physiTKR,
false,
i);
physiConverter =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
2*TKRSiliconThickness +
TKRViewsDistance+
ConverterThickness/2+
(i)*TKRLayerDistance),
"Converter",
logicConverter,
physiTKR,
false,
i);
k);
physiPlane =
new G4PVPlacement(0,G4ThreeVector(0.,0.,
-TKRSizeZ/2+
2*TKRSiliconThickness +
TKRViewsDistance+
ConverterThickness+
TKRSupportThickness/2),
"Plane",
logicPlane,
physiTKR,
x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
z = 0.;
physiTKRActiveTileX =
new G4PVPlacement(0,
G4ThreeVector(x,y,z),
"Active Tile X",
logicTKRActiveTileX,
physiTKRDetectorX,
false,
i);
k);
}
}
G4VSolid * solidTKRActiveTileX = new
G4Box("Active Tile X", TKRActiveTileXY/2,TKRActiveTileXY/2,TKRActiveTileZ/2);
G4VSolid * solidTKRActiveTileY = new
G4Box("Active Tile Y", TKRActiveTileXY/2,TKRActiveTileXY/2,TKRActiveTileZ/2);
// Calorimeter Structure (CALLayerX + CALLayerY)
G4LogicalVolume* logicTKRActiveTileX =
new G4LogicalVolume(solidTKRActiveTileX, TKRMaterial,
"Active Tile X",0,0,0);
G4LogicalVolume* logicTKRActiveTileY =
new G4LogicalVolume(solidTKRActiveTileY, TKRMaterial,
"Active Tile Y",0,0,0);
G4int j=0;
G4int k=0;
G4VPhysicalVolume* physiTKRActiveTileX = 0;
G4VPhysicalVolume* physiTKRActiveTileY = 0;
G4double x=0.;
G4double y=0.;
G4double z=0.;
for (i=0;i< NbOfTKRTiles; i++)
{
for (j=0;j< NbOfTKRTiles; j++)
{
k = i*NbOfTKRTiles + j;
x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+TilesSeparation+
TKRActiveTileXY);
z = 0.;
physiTKRActiveTileY =
new G4PVPlacement(0,
G4ThreeVector(x,y,z),
"Active Tile Y",
logicTKRActiveTileY,
physiTKRDetectorY,
false,
k);
x = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(j)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
y = -TKRSizeXY/2+TilesSeparation+SiliconGuardRing+
TKRActiveTileXY/2+(i)*((2*SiliconGuardRing)+
TilesSeparation+TKRActiveTileXY);
z = 0.;
physiTKRActiveTileX =
new G4PVPlacement(0,
G4ThreeVector(x,y,z),
"Active Tile X",
logicTKRActiveTileX,
physiTKRDetectorX,
false,
k);
}
}
// Calorimeter Structure (CALDetectorX + CALDetectorY)
solidCALDetector = new G4Box("CALDetector",
solidCALLayerX = new G4Box("CALLayerX",
CALSizeXY/2,CALSizeXY/2,CALBarThickness/2);
logicCALDetector = new G4LogicalVolume(solidCALDetector,
CALMaterial,
"CALDetector");
for (i = 0; i < NbOfCALLayers; i++)
{
physiCALDetectorY =
new G4PVPlacement(0,G4ThreeVector(0,0,
-CALSizeZ/2+
CALBarThickness/2 +
(i)*2*CALBarThickness),
"CALDetectorY",
logicCALDetector,
physiCAL,
false,
i);
physiCALDetectorX =
new G4PVPlacement(0,G4ThreeVector(0,0,
-CALSizeZ/2+
CALBarThickness/2 +
CALBarThickness +
(i)*2*CALBarThickness),
"CALDetectorX",
logicCALDetector,
physiCAL,
false,
i);
}
//}
//
// Sensitive Detectors: TKRDetector
//
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(!payloadSD)
{
payloadSD = new GammaRayTelPayloadSD("PayloadSD",this);
SDman->AddNewDetector( payloadSD );
}
G4String ROgeometryName = "PayloadROGeom";
G4VReadOutGeometry* payloadRO =
payloadRO = new GammaRayTelPayloadROGeometry(ROgeometryName, this);
payloadRO->BuildROGeometry();
payloadSD->SetROgeometry(payloadRO);
// if (logicTKRDetector)
// logicTKRDetector->SetSensitiveDetector(payloadSD); // sensitive planes
if (logicTKRActiveTileX)
logicTKRActiveTileX->SetSensitiveDetector(payloadSD); // sensitive tile
if (logicTKRActiveTileY)
logicTKRActiveTileY->SetSensitiveDetector(payloadSD); // sensitive tile
//
// Visualization attributes
//
// Invisible Volume
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
logicPayload->SetVisAttributes (G4VisAttributes::Invisible);
logicTKR->SetVisAttributes(G4VisAttributes::Invisible);
logicTKRActiveTileX->SetVisAttributes(G4VisAttributes::Invisible);
logicTKRActiveTileY->SetVisAttributes(G4VisAttributes::Invisible);
logicPlane->SetVisAttributes(G4VisAttributes::Invisible);
logicConverter->SetVisAttributes(G4VisAttributes::Invisible);
logicCALLayerX = new G4LogicalVolume(solidCALLayerX,
CALMaterial,
"CALLayerX");
// Some visualization styles
G4VisAttributes* VisAtt1= new G4VisAttributes(G4Colour(0.3,0.8,0.1));
VisAtt1->SetVisibility(true);
VisAtt1->SetForceSolid(TRUE);
G4VisAttributes* VisAtt2= new G4VisAttributes(G4Colour(0.2,0.3,0.8));
VisAtt2->SetVisibility(true);
VisAtt2->SetForceSolid(FALSE);
G4VisAttributes* VisAtt3= new G4VisAttributes(G4Colour(0.8,0.2,0.3));
VisAtt3->SetVisibility(true);
VisAtt3->SetForceWireframe(TRUE);
// Visible Volumes
logicCAL->SetVisAttributes(VisAtt1);
logicTKRDetectorX->SetVisAttributes(VisAtt2);
logicTKRDetectorY->SetVisAttributes(VisAtt2);
logicACT->SetVisAttributes(VisAtt3);
logicACL1->SetVisAttributes(VisAtt3);
logicACL2->SetVisAttributes(VisAtt3);
solidCALLayerY = new G4Box("CALLayerY",
CALSizeXY/2,CALSizeXY/2,CALBarThickness/2);
logicCALLayerY = new G4LogicalVolume(solidCALLayerY,
CALMaterial,
"CALLayerY");
for (i = 0; i < NbOfCALLayers; i++)
{
physiCALLayerY =
new G4PVPlacement(0,G4ThreeVector(0,0,
-CALSizeZ/2+
CALBarThickness/2 +
(i)*2*CALBarThickness),
"CALLayerY",
logicCALLayerY,
physiCAL,
false,
i);
physiCALLayerX =
new G4PVPlacement(0,G4ThreeVector(0,0,
-CALSizeZ/2+
CALBarThickness/2 +
CALBarThickness +
(i)*2*CALBarThickness),
"CALLayerX",
logicCALLayerX,
physiCAL,
false,
i);
}
// Calorimeter Structure (CALDetectorX + CALDetectorY)
solidCALDetectorX = new G4Box("CALDetectorX",
CALBarX/2,CALBarY/2,CALBarThickness/2);
logicCALDetectorX = new G4LogicalVolume(solidCALDetectorX,
CALMaterial,
"CALDetectorX");
solidCALDetectorY = new G4Box("CALDetectorY",
CALBarY/2,CALBarX/2,CALBarThickness/2);
logicCALDetectorY = new G4LogicalVolume(solidCALDetectorY,
CALMaterial,
"CALDetectorY");
for (i = 0; i < NbOfCALBars; i++)
{
physiCALDetectorY =
new G4PVPlacement(0,
G4ThreeVector(-CALSizeXY/2+ CALBarY/2 +
(i)*CALBarY, 0, 0),
"CALDetectorY",
logicCALDetectorY,
physiCALLayerY,
false,
i);
physiCALDetectorX =
new G4PVPlacement(0,
G4ThreeVector(0,-CALSizeXY/2+ CALBarY/2 +
(i)*CALBarY, 0),
"CALDetectorX",
logicCALDetectorX,
physiCALLayerX,
false,
i);
}
// Sensitive Detector Manager
G4SDManager* SDman = G4SDManager::GetSDMpointer();
//
// Sensitive Detectors - Tracker
//
if(!trackerSD)
{
trackerSD = new GammaRayTelTrackerSD("TrackerSD",this);
SDman->AddNewDetector( trackerSD );
}
G4String ROgeometryName = "TrackerROGeom";
G4VReadOutGeometry* trackerRO =
new GammaRayTelTrackerROGeometry(ROgeometryName, this);
trackerRO->BuildROGeometry();
trackerSD->SetROgeometry(trackerRO);
if (logicTKRActiveTileX)
logicTKRActiveTileX->SetSensitiveDetector(trackerSD); // ActiveTileX
if (logicTKRActiveTileY)
logicTKRActiveTileY->SetSensitiveDetector(trackerSD); // ActiveTileY
//
// Sensitive Detectors: Calorimeter
//
if(!calorimeterSD)
{
calorimeterSD = new GammaRayTelCalorimeterSD("CalorimeterSD",this);
SDman->AddNewDetector( calorimeterSD );
}
if (logicCALDetectorX)
logicCALDetectorX->SetSensitiveDetector(calorimeterSD); // BarX
if (logicCALDetectorY)
logicCALDetectorY->SetSensitiveDetector(calorimeterSD); // BarY
//
// Sensitive Detectors: Anticoincidence
//
if(!anticoincidenceSD)
{
anticoincidenceSD = new GammaRayTelAnticoincidenceSD
("AnticoincidenceSD",this);
SDman->AddNewDetector( anticoincidenceSD );
}
if (logicACT)
logicACT->SetSensitiveDetector(anticoincidenceSD); // ACD top
if (logicACL1)
logicACL1->SetSensitiveDetector(anticoincidenceSD); // ACD lateral side
if (logicACL2)
logicACL2->SetSensitiveDetector(anticoincidenceSD); // ACD lateral side
//
// Visualization attributes
//
// Invisible Volume
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
logicPayload->SetVisAttributes (G4VisAttributes::Invisible);
logicTKR->SetVisAttributes(G4VisAttributes::Invisible);
logicTKRActiveTileX->SetVisAttributes(G4VisAttributes::Invisible);
logicTKRActiveTileY->SetVisAttributes(G4VisAttributes::Invisible);
logicPlane->SetVisAttributes(G4VisAttributes::Invisible);
logicConverter->SetVisAttributes(G4VisAttributes::Invisible);
logicCAL->SetVisAttributes(G4VisAttributes::Invisible);
logicCALLayerX->SetVisAttributes(G4VisAttributes::Invisible);
logicCALLayerY->SetVisAttributes(G4VisAttributes::Invisible);
// Some visualization styles
G4VisAttributes* VisAtt1= new G4VisAttributes(G4Colour(0.3,0.8,0.1));
VisAtt1->SetVisibility(true);
VisAtt1->SetForceSolid(TRUE);
G4VisAttributes* VisAtt2= new G4VisAttributes(G4Colour(0.2,0.3,0.8));
VisAtt2->SetVisibility(true);
VisAtt2->SetForceSolid(FALSE);
G4VisAttributes* VisAtt3= new G4VisAttributes(G4Colour(0.8,0.2,0.3));
VisAtt3->SetVisibility(true);
VisAtt3->SetForceWireframe(TRUE);
// Visible Volumes
logicCALDetectorX->SetVisAttributes(VisAtt1);
logicCALDetectorY->SetVisAttributes(VisAtt1);
logicTKRDetectorX->SetVisAttributes(VisAtt2);
logicTKRDetectorY->SetVisAttributes(VisAtt2);
logicACT->SetVisAttributes(VisAtt3);
logicACL1->SetVisAttributes(VisAtt3);
logicACL2->SetVisAttributes(VisAtt3);
//
//always return the physical World
//
PrintPayloadParameters();
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelDetectorConstruction::PrintPayloadParameters()
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelDetectorMessenger.cc,v 1.3 2000/12/06 16:53:14 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: GammaRayTelEventAction.cc,v 1.4 2000/12/06 16:53:14 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: GammaRayTelEventAction.cc,v 1.5 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -20,7 +20,10 @@
// ************************************************************
#include "GammaRayTelEventAction.hh"
#include "GammaRayTelPayloadHit.hh"
#include "GammaRayTelTrackerHit.hh"
#include "GammaRayTelAnticoincidenceHit.hh"
#include "GammaRayTelCalorimeterHit.hh"
#include "g4rw/tvordvec.h"
#ifdef G4ANALYSIS_USE
@@ -48,12 +51,14 @@ extern G4std::ofstream outFile;
#ifdef G4ANALYSIS_USE
GammaRayTelEventAction::GammaRayTelEventAction(GammaRayTelAnalysisManager* aMgr)
:drawFlag("all"),trackerCollID(-1),analysisManager(aMgr)
:drawFlag("all"),trackerCollID(-1), calorimeterCollID(-1),
anticoincidenceCollID(-1), analysisManager(aMgr)
{
}
#else
GammaRayTelEventAction::GammaRayTelEventAction()
:drawFlag("all"), trackerCollID(-1)
:drawFlag("all"), trackerCollID(-1),calorimeterCollID(-1),
anticoincidenceCollID(-1)
{
}
#endif
@@ -71,13 +76,22 @@ void GammaRayTelEventAction::BeginOfEventAction(const G4Event* evt)
G4int evtNb = evt->GetEventID();
G4cout << "Event: " << evtNb << G4endl;
G4SDManager * SDman = G4SDManager::GetSDMpointer();
if (trackerCollID==-1)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
trackerCollID = SDman->GetCollectionID("PayloadCollection");
trackerCollID = SDman->GetCollectionID("TrackerCollection");
}
if(anticoincidenceCollID==-1)
{
anticoincidenceCollID =
SDman->GetCollectionID("AnticoincidenceCollection");
}
if(calorimeterCollID==-1)
{
calorimeterCollID =
SDman->GetCollectionID("CalorimeterCollection");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -86,39 +100,50 @@ void GammaRayTelEventAction::EndOfEventAction(const G4Event* evt)
{
G4int event_id = evt->GetEventID();
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
GammaRayTelPayloadHitsCollection* CHC = NULL;
GammaRayTelTrackerHitsCollection* THC = 0;
GammaRayTelCalorimeterHitsCollection* CHC = 0;
GammaRayTelAnticoincidenceHitsCollection* AHC = 0;
if (HCE)
CHC = (GammaRayTelPayloadHitsCollection*)(HCE->GetHC(trackerCollID));
if (CHC)
{
int n_hit = CHC->entries();
G4cout << "Number of hits in this event = " << n_hit << G4endl;
THC = (GammaRayTelTrackerHitsCollection*)(HCE->GetHC(trackerCollID));
CHC = (GammaRayTelCalorimeterHitsCollection*)
(HCE->GetHC(calorimeterCollID));
AHC = (GammaRayTelAnticoincidenceHitsCollection*)
(HCE->GetHC(anticoincidenceCollID));
}
if (THC)
{
int n_hit = THC->entries();
G4cout << "Number of tracker hits in this event = " << n_hit << G4endl;
G4double ESil=0;
G4int NStrip, NPlane, IsX;
// This is a cycle on all the hits of this event
// This is a cycle on all the tracker hits of this event
for (int i=0;i<n_hit;i++)
{
// Here we put the hit data in a an ASCII file for
// later analysis
ESil = (*CHC)[i]->GetEdepSil();
NStrip = (*CHC)[i]->GetNStrip();
NPlane = (*CHC)[i]->GetNSilPlane();
IsX = (*CHC)[i]->GetPlaneType();
ESil = (*THC)[i]->GetEdepSil();
NStrip = (*THC)[i]->GetNStrip();
NPlane = (*THC)[i]->GetNSilPlane();
IsX = (*THC)[i]->GetPlaneType();
outFile << G4std::setw(7) << event_id << " " <<
ESil/keV << " " << NStrip <<
" " << NPlane << " " << IsX << " " <<
(*CHC)[i]->GetPos().x()/mm <<" "<<
(*CHC)[i]->GetPos().y()/mm <<" "<<
(*CHC)[i]->GetPos().z()/mm <<" "<<
(*THC)[i]->GetPos().x()/mm <<" "<<
(*THC)[i]->GetPos().y()/mm <<" "<<
(*THC)[i]->GetPos().z()/mm <<" "<<
G4endl;
#ifdef G4ANALYSIS_USE
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelPhysicsList.cc,v 1.2 2000/11/15 20:27:41 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelPrimaryGeneratorAction.cc,v 1.3 2000/11/24 16:57:00 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelPrimaryGeneratorMessenger.cc,v 1.2 2000/11/15 20:27:41 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: GammaRayTelRunAction.cc,v 1.3 2000/12/06 16:53:14 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: GammaRayTelPayloadHit.cc,v 1.2 2000/11/15 20:27:41 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: GammaRayTelTrackerHit.cc,v 1.1 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -14,20 +14,20 @@
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelPayloadHit ------
// ------------ GammaRayTelTrackerHit ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "GammaRayTelPayloadHit.hh"
#include "GammaRayTelTrackerHit.hh"
G4Allocator<GammaRayTelPayloadHit> GammaRayTelPayloadHitAllocator;
G4Allocator<GammaRayTelTrackerHit> GammaRayTelTrackerHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelPayloadHit::GammaRayTelPayloadHit()
GammaRayTelTrackerHit::GammaRayTelTrackerHit()
{
EdepSil = 0.;
NStrip = 0; NSilPlane = 0; IsXPlane = 0;
@@ -36,12 +36,12 @@ GammaRayTelPayloadHit::GammaRayTelPayloadHit()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelPayloadHit::~GammaRayTelPayloadHit()
GammaRayTelTrackerHit::~GammaRayTelTrackerHit()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelPayloadHit::GammaRayTelPayloadHit(const GammaRayTelPayloadHit& right)
GammaRayTelTrackerHit::GammaRayTelTrackerHit(const GammaRayTelTrackerHit& right)
{
EdepSil = right.EdepSil;
NStrip = right.NStrip; NSilPlane = right.NSilPlane;
@@ -51,7 +51,7 @@ GammaRayTelPayloadHit::GammaRayTelPayloadHit(const GammaRayTelPayloadHit& right)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const GammaRayTelPayloadHit& GammaRayTelPayloadHit::operator=(const GammaRayTelPayloadHit& right)
const GammaRayTelTrackerHit& GammaRayTelTrackerHit::operator=(const GammaRayTelTrackerHit& right)
{
EdepSil = right.EdepSil;
NStrip = right.NStrip; NSilPlane = right.NSilPlane;
@@ -62,19 +62,19 @@ const GammaRayTelPayloadHit& GammaRayTelPayloadHit::operator=(const GammaRayTelP
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int GammaRayTelPayloadHit::operator==(const GammaRayTelPayloadHit& right) const
int GammaRayTelTrackerHit::operator==(const GammaRayTelTrackerHit& right) const
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadHit::Draw()
void GammaRayTelTrackerHit::Draw()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadHit::Print()
void GammaRayTelTrackerHit::Print()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: GammaRayTelPayloadROGeometry.cc,v 1.2 2000/11/20 16:49:02 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: GammaRayTelTrackerROGeometry.cc,v 1.1 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -16,12 +16,12 @@
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelPayloadROGeometry class ------
// ------------ GammaRayTelTrackerROGeometry class ------
// by F.Longo, R.Giannitrapani & G.Santin (13 nov 2000)
//
// ************************************************************
#include "GammaRayTelPayloadROGeometry.hh"
#include "GammaRayTelTrackerROGeometry.hh"
#include "GammaRayTelDummySD.hh"
#include "GammaRayTelDetectorConstruction.hh"
@@ -35,25 +35,25 @@
#include "G4Material.hh"
GammaRayTelPayloadROGeometry::GammaRayTelPayloadROGeometry()
GammaRayTelTrackerROGeometry::GammaRayTelTrackerROGeometry()
: G4VReadOutGeometry()
{
}
GammaRayTelPayloadROGeometry::GammaRayTelPayloadROGeometry(G4String aString,GammaRayTelDetectorConstruction* GammaRayTelDC)
GammaRayTelTrackerROGeometry::GammaRayTelTrackerROGeometry(G4String aString,GammaRayTelDetectorConstruction* GammaRayTelDC)
:GammaRayTelDetector(GammaRayTelDC), G4VReadOutGeometry(aString)
{
}
GammaRayTelPayloadROGeometry::GammaRayTelPayloadROGeometry(G4String aString)
GammaRayTelTrackerROGeometry::GammaRayTelTrackerROGeometry(G4String aString)
: G4VReadOutGeometry(aString)
{
}
GammaRayTelPayloadROGeometry::~GammaRayTelPayloadROGeometry()
GammaRayTelTrackerROGeometry::~GammaRayTelTrackerROGeometry()
{
}
G4VPhysicalVolume* GammaRayTelPayloadROGeometry::Build()
G4VPhysicalVolume* GammaRayTelTrackerROGeometry::Build()
{
// A dummy material is used to fill the volumes of the readout geometry.
// ( It will be allowed to set a NULL pointer in volumes of such virtual
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: GammaRayTelPayloadSD.cc,v 1.6 2000/12/06 17:48:10 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: GammaRayTelTrackerSD.cc,v 1.1 2001/03/05 13:58:23 flongo Exp $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -14,14 +14,14 @@
// For information related to this code contact:
// CERN, IT Division, ASD group
//
// ------------ GammaRayTelPayloadSD ------
// ------------ GammaRayTelTrackerSD ------
// by R.Giannitrapani, F.Longo & G.Santin (13 nov 2000)
//
// ************************************************************
#include "GammaRayTelPayloadSD.hh"
#include "GammaRayTelTrackerSD.hh"
#include "GammaRayTelPayloadHit.hh"
#include "GammaRayTelTrackerHit.hh"
#include "GammaRayTelDetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
@@ -35,7 +35,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelPayloadSD::GammaRayTelPayloadSD(G4String name,
GammaRayTelTrackerSD::GammaRayTelTrackerSD(G4String name,
GammaRayTelDetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
@@ -44,36 +44,37 @@ GammaRayTelPayloadSD::GammaRayTelPayloadSD(G4String name,
NbOfTKRLayers = Detector->GetNbOfTKRLayers();
NbOfTKRStrips = NbOfTKRStrips*NbOfTKRTiles;
HitXID = new G4int[NbOfTKRStrips][30];
HitYID = new G4int[NbOfTKRStrips][30];
collectionName.insert("PayloadCollection");
ThitXID = new G4int[NbOfTKRStrips][30];
ThitYID = new G4int[NbOfTKRStrips][30];
collectionName.insert("TrackerCollection");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
GammaRayTelPayloadSD::~GammaRayTelPayloadSD()
GammaRayTelTrackerSD::~GammaRayTelTrackerSD()
{
delete [] HitXID;
delete [] HitYID;
delete [] ThitXID;
delete [] ThitYID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadSD::Initialize(G4HCofThisEvent*HCE)
void GammaRayTelTrackerSD::Initialize(G4HCofThisEvent*HCE)
{
PayloadCollection = new GammaRayTelPayloadHitsCollection
TrackerCollection = new GammaRayTelTrackerHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int i=0;i<NbOfTKRStrips;i++)
for (G4int i=0;i<NbOfTKRStrips;i++)
for (G4int j=0;j<NbOfTKRLayers;j++)
{
HitXID[i][j] = -1;
HitYID[i][j] = -1;
ThitXID[i][j] = -1;
ThitYID[i][j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool GammaRayTelPayloadSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
G4bool GammaRayTelTrackerSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -129,20 +130,20 @@ G4bool GammaRayTelPayloadSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhis
// The hit is on an X silicon plane
{
// This is a new hit
if (HitXID[StripNumber][PlaneNumber]==-1)
if (ThitXID[StripNumber][PlaneNumber]==-1)
{
GammaRayTelPayloadHit* PayloadHit = new GammaRayTelPayloadHit;
PayloadHit->SetPlaneType(1);
PayloadHit->AddSil(edep);
PayloadHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
PayloadHit->SetNSilPlane(PlaneNumber);
PayloadHit->SetNStrip(StripNumber);
HitXID[StripNumber][PlaneNumber] =
PayloadCollection->insert(PayloadHit) -1;
GammaRayTelTrackerHit* TrackerHit = new GammaRayTelTrackerHit;
TrackerHit->SetPlaneType(1);
TrackerHit->AddSil(edep);
TrackerHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
TrackerHit->SetNSilPlane(PlaneNumber);
TrackerHit->SetNStrip(StripNumber);
ThitXID[StripNumber][PlaneNumber] =
TrackerCollection->insert(TrackerHit) -1;
}
else // This is not new
{
(*PayloadCollection)[HitXID[StripNumber][PlaneNumber]]->AddSil(edep);
(*TrackerCollection)[ThitXID[StripNumber][PlaneNumber]]->AddSil(edep);
// G4cout << "X" << PlaneNumber << " " << StripNumber << G4endl;
}
}
@@ -151,20 +152,20 @@ G4bool GammaRayTelPayloadSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhis
// The hit is on an Y silicon plane
{
// This is a new hit
if (HitYID[StripNumber][PlaneNumber]==-1)
if (ThitYID[StripNumber][PlaneNumber]==-1)
{
GammaRayTelPayloadHit* PayloadHit = new GammaRayTelPayloadHit;
PayloadHit->SetPlaneType(0);
PayloadHit->AddSil(edep);
PayloadHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
PayloadHit->SetNSilPlane(PlaneNumber);
PayloadHit->SetNStrip(StripNumber);
HitYID[StripNumber][PlaneNumber] =
PayloadCollection->insert(PayloadHit)-1;
GammaRayTelTrackerHit* TrackerHit = new GammaRayTelTrackerHit;
TrackerHit->SetPlaneType(0);
TrackerHit->AddSil(edep);
TrackerHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
TrackerHit->SetNSilPlane(PlaneNumber);
TrackerHit->SetNStrip(StripNumber);
ThitYID[StripNumber][PlaneNumber] =
TrackerCollection->insert(TrackerHit)-1;
}
else // This is not new
{
(*PayloadCollection)[HitYID[StripNumber][PlaneNumber]]->AddSil(edep);
(*TrackerCollection)[ThitYID[StripNumber][PlaneNumber]]->AddSil(edep);
// G4cout << "Y" << PlaneNumber << " " << StripNumber << G4endl;
}
}
@@ -174,37 +175,37 @@ G4bool GammaRayTelPayloadSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhis
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadSD::EndOfEvent(G4HCofThisEvent* HCE)
void GammaRayTelTrackerSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
}
HCE->AddHitsCollection(HCID,PayloadCollection);
HCE->AddHitsCollection(HCID,TrackerCollection);
for (G4int i=0;i<NbOfTKRLayers;i++)
for (G4int j=0;j<NbOfTKRStrips;j++)
for (G4int i=0;i<NbOfTKRStrips;i++)
for (G4int j=0;j<NbOfTKRLayers;j++)
{
HitXID[i][j] = -1;
HitYID[i][j] = -1;
ThitXID[i][j] = -1;
ThitYID[i][j] = -1;
};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadSD::clear()
void GammaRayTelTrackerSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadSD::DrawAll()
void GammaRayTelTrackerSD::DrawAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void GammaRayTelPayloadSD::PrintAll()
void GammaRayTelTrackerSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -7,7 +7,7 @@
// and all its terms.
//
// $Id: GammaRayTelVisManager.cc,v 1.2 2000/11/15 20:27:42 flongo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland