Import Geant4 5.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:28:22 +02:00
parent fbd4999cf7
commit 4aea781e80
5454 changed files with 223141 additions and 67347 deletions
@@ -0,0 +1,198 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// AerogelRefData.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <fstream.h>
#include "AerogelRefData.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbMaterialParameters.hh"
AerogelRefData::AerogelRefData(G4String AgelRefIndFile)
:NumberOfRefIndBins(NumAerogelRefIndexPhotonEnergyBins),
StdAerogelRefphotE(vector<G4double>(NumAerogelRefIndexPhotonEnergyBins)),
StdAerogelRefIndexValue(vector<G4double>(NumAerogelRefIndexPhotonEnergyBins)),
AerogelRefIndShift(vector<G4double>( MaxNumberOfAerogelTypes)),
AerogelWavelengthRef(vector<G4double>( MaxNumberOfAerogelTypes)) {
AerogelRefIndexFileName=AgelRefIndFile;
StdAerogelNominalRefractiveIndex= StdAerogelNominalRefIndex;
ReadStdAerogelRefIndex();
G4double AerogelRefEnergy,AerogelReferenceRefInd;
for(G4int ityp=0; ityp< MaxNumberOfAerogelTypes; ityp++ ){
AerogelWavelengthRef[ityp]=AerogelReferenceRefIndWavelength[ityp];
AerogelRefEnergy=
(PhotMomWaveConv/(AerogelWavelengthRef[ityp]/nanometer))*eV;
AerogelReferenceRefInd = GetStdAgelRefIndexE(AerogelRefEnergy);
AerogelRefIndShift[ityp] = AerogelReferenceRefInd -
StdAerogelNominalRefractiveIndex ;
}
}
G4double AerogelRefData::GetStdAgelRefIndexE(G4double StdAgelRefEnergy) {
G4double refint= StdAerogelNominalRefractiveIndex;
if(StdAgelRefEnergy <= StdAerogelRefphotE[0] ) {
refint= StdAerogelRefphotE[0];
G4cout<<"Ref index reference value outside bounds "<<G4endl;
}
if(StdAgelRefEnergy > StdAerogelRefphotE[ NumberOfRefIndBins-1 ] ) {
refint= StdAerogelRefphotE[ NumberOfRefIndBins-1 ];
G4cout<<"Ref index reference value outside bounds "<<G4endl;
}
for(G4int iabin=0; iabin < NumberOfRefIndBins-1 ; iabin++ ){
G4double E1= StdAerogelRefphotE[iabin];
G4double E2= StdAerogelRefphotE[iabin+1];
if(StdAgelRefEnergy > E1 && StdAgelRefEnergy <= E2 && E1 != E2 ){
//Now interpolate
G4double r1= StdAerogelRefIndexValue[iabin];
G4double r2= StdAerogelRefIndexValue[iabin+1];
G4double slp=(r2-r1)/(E2-E1);
G4double ain= r1-slp*E1;
refint= slp*StdAgelRefEnergy + ain;
break;
}
}
return refint;
}
void AerogelRefData::ReadStdAerogelRefIndex() {
const char* StdAerogelRefIndFile= AerogelRefIndexFileName.c_str();
if( StdAerogelRefIndFile == 0 ){
G4cout<<" Aerogel RefIndex Input file missing"
<< " Please provide the correct file name "
<<G4endl;
}else {
G4cout<<"Now reading Std Aerogel Ref Index from "
<<StdAerogelRefIndFile<<G4endl;
ifstream finpga(StdAerogelRefIndFile);
G4double ephot,rind;
for (G4int fbin=0; fbin< NumberOfRefIndBins ; fbin++){
finpga>>ephot;
finpga>>rind;
StdAerogelRefphotE[fbin]=ephot*eV;
StdAerogelRefIndexValue[fbin]=rind;
//for test avoid the variation in ref index. SE 18-10-01
// StdAerogelRefIndexValue[fbin]= StdAerogelNominalRefractiveIndex;
}
}
}
vector<G4double> AerogelRefData::GetCurAerogelRefIndValueVect (G4int AerogelTnum ) {
// no test for tdr rich. now put back to TB conditions.
vector<G4double>CAgel(NumberOfRefIndBins);
AerogelType Ctype;
G4double CRn = GetRefnominal( AerogelTnum );
for (G4int ib=0; ib < NumberOfRefIndBins; ib++ ){
CAgel[ib]= StdAerogelRefIndexValue[ib]
- StdAerogelNominalRefractiveIndex-AerogelRefIndShift[ AerogelTnum] + CRn;
}
return CAgel;
}
G4double AerogelRefData:: GetCurAerogelRefIndValue( G4int rbinw , G4int AerogelTnum ){
// no test for tdr. now in TB conditions.
G4double crn= GetRefnominal( AerogelTnum );
return StdAerogelRefIndexValue[rbinw]
- StdAerogelNominalRefractiveIndex-AerogelRefIndShift[ AerogelTnum] +crn;
// - StdAerogelNominalRefractiveIndex-AerogelRefIndShift[ AerogelTnum] +crn;
// return StdAerogelRefIndexValue[rbinw]-1.03269+crn;
}
G4double AerogelRefData::GetRefnominal(G4int AgelTnum ) {
G4double CRnominal = StdAerogelNominalRefractiveIndex;
if(AgelTnum == 0 ){
CRnominal= AerogelTypeANominalRefIndex;
}else if (AgelTnum == 1 ) {
CRnominal= AerogelTypeBNominalRefIndex;
}else if (AgelTnum == 2 ) {
CRnominal= AerogelTypeCNominalRefIndex;
}else if (AgelTnum == 3 ) {
CRnominal= AerogelTypeDNominalRefIndex;
}else if (AgelTnum == 4 ) {
CRnominal= AerogelTypeENominalRefIndex;
} else {G4cout<<"Unknown Aerogel Type "<<G4endl; }
}
AerogelType AerogelRefData::GetAerogelType(G4int AgelTnum ) {
AerogelType Ctype;
if(AgelTnum == 0 ){
Ctype=AerogelTypeA;
}else if (AgelTnum == 1 ) {
Ctype=AerogelTypeB;
}else if (AgelTnum == 2 ) {
Ctype=AerogelTypeC;
}else if (AgelTnum == 3 ) {
Ctype=AerogelTypeD;
}else if (AgelTnum == 4 ) {
Ctype=AerogelTypeE;
} else {G4cout<<"Unknown Aerogel Type "<<G4endl; }
}
AerogelRefData::~AerogelRefData(){ ; }
+123
View File
@@ -0,0 +1,123 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// filterTrData.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <fstream.h>
#include "FilterTrData.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbMaterialParameters.hh"
FilterTrData::FilterTrData(G4int FilterTypeNum, G4String FilterDataFileName )
:NumberOfTrBins(NumFilterTransBins),
TransWaveL(vector<G4double>(NumFilterTransBins)),
TransValue(vector<G4double>(NumFilterTransBins)),
TransTotValue(vector<G4double>(NumFilterTransBins))
{
// In the G4example the same type of filter is used
// for all types of filters.
FilterTypeNumber= FilterTypeNum;
FilterTransDataFileName=FilterDataFileName;
if( FilterTypeNum >= 0 && FilterTypeNum <= 5 ) {
FilterTypeIndex = GlassD263;
FilterRefIndexNominal = RefIndexGlassD263 ;
} else if (FilterTypeNum == -1 ) {
G4cout<<" No filter for this run "<<G4endl;
} else {G4cout<<"FilterTrData : Unknown Filter Type "<<G4endl; }
//for now default ref index is provided as that of glassd263.
CurNeighbourRefIndexNominal= NitrogenNominalRefIndex;
ReadFilterTrans();
if(FilterTypeNum >=0 ) {
FilterThickness = 2.0*FilterHalfZArray[FilterTypeNum];
}
}
void FilterTrData::ReadFilterTrans() {
//first get the filter type index
FilterType Ftype = GetFilterTypeIndex();
if(Ftype == GlassD263 ) {
const char* D263FilterTransFile= FilterTransDataFileName.c_str();
if(D263FilterTransFile != 0 ) {
G4cout<<"Glass D263 Filter trans is from "<<D263FilterTransFile<<G4endl;
if(NumberOfTrBins != NumPhotBinGlassD263Trans ) {
NumberOfTrBins = NumPhotBinGlassD263Trans;
TransWaveL.resize(NumberOfTrBins);
TransValue.resize(NumberOfTrBins);
TransTotValue.resize(NumberOfTrBins);
}
ifstream finpga(D263FilterTransFile);
G4double wa,trn;
//set the order to have increasing in wavelength after reading in.
//the data file is with decreasing order of wavelength.
for (G4int fbin=0; fbin< NumberOfTrBins ; fbin++){
finpga>>wa;
finpga>>trn;
TransWaveL[NumberOfTrBins-fbin-1]=wa;
// TransValue[NumberOfTrBins-fbin-1]=trn/100.0;
TransValue[NumberOfTrBins-fbin-1]=GetCurrentFilTrans(trn);
TransTotValue[NumberOfTrBins-fbin-1]=GetTotFilTrans(trn);
}
}else {
G4cout<<" Unknown file name for filter transmission Data input "<<G4endl;
G4cout<<" Please specify the correct file name for filter transmission " <<G4endl;
}
} else {
G4cout<<"Unknown Filter or No filter"<<G4endl;
G4cout<<" Please provide the Filter transmission Data " <<G4endl;
}
}
G4double FilterTrData::GetCurrentFilTrans(G4double trnData) {
// No wavelength dependance yet for the Fresnel loss at the
// surfaces.
G4double trn = trnData/100.0;
G4double na= FilterRefIndexNominal;
G4double nb= CurNeighbourRefIndexNominal;
G4double LossAtFEntrance=pow(((na-nb)/(na+nb)),2.0);
G4double LossAtFExit = pow(((nb-na)/(nb+na)),2.0);
if(trn > 1.0 ) trn=1.0;
return trn;
}
G4double FilterTrData::GetTotFilTrans(G4double trnData) {
// No wavelength dependance yet.
return trnData/100.0;
}
FilterTrData::~FilterTrData(){ ; }
@@ -0,0 +1,164 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// HpdSiEnergyLoss.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "HpdSiEnergyLoss.hh"
#include "G4Material.hh"
#include "Randomize.hh"
#include "RichTbMaterialParameters.hh"
#include "RichTbAnalysisManager.hh"
HpdSiEnergyLoss::HpdSiEnergyLoss(const G4String& materialName,
const G4String& processName)
: G4VEnergyLoss(processName),
MinKineticEnergy(1.*eV),MipEnergy(30000.0*eV),
finalRangeforStep(0.15*mm) {
ElossMaterialName= materialName;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
G4int numberOfMat = G4Material::GetNumberOfMaterials();
for(G4int iMat=0;iMat<numberOfMat;iMat++) {
if ( materialName == (*theMaterialTable)[iMat]->GetName()){
fMatIndex=(*theMaterialTable)[iMat]->GetIndex();
break;
}
}
if(iMat >= numberOfMat ) {
G4Exception("Invalid material Name in HpdSiEnergyLoss constructor" );
}
}
HpdSiEnergyLoss::~HpdSiEnergyLoss() { }
G4bool HpdSiEnergyLoss::IsApplicable(const G4ParticleDefinition&
aParticleType) {
return(aParticleType.GetPDGCharge()!= 0.);
}
G4double HpdSiEnergyLoss::GetContinuousStepLimit(const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety){
G4double RangeForStep = finalRangeforStep;
if( fMatIndex != track.GetMaterial() -> GetIndex() ) {
RangeForStep = DBL_MAX;
}
return RangeForStep;
}
G4double HpdSiEnergyLoss::GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition) {
// return infinity so that it does nothing.
*condition = NotForced;
return DBL_MAX;
}
G4VParticleChange* HpdSiEnergyLoss::PostStepDoIt(const G4Track& aTrack,
const G4Step& aStep) {
// Do nothing
aParticleChange.Initialize(aTrack) ;
return G4VContinuousDiscreteProcess::PostStepDoIt(aTrack,aStep);
}
G4VParticleChange* HpdSiEnergyLoss::AlongStepDoIt(const G4Track& aTrack,
const G4Step& aStep) {
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
#endif
aParticleChange.Initialize(aTrack);
G4int aMaterialIndex = aTrack.GetMaterial()->GetIndex();
if(fMatIndex != aTrack.GetMaterial()->GetIndex() ) {
return &aParticleChange;
}
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
G4double aKinEnergyInit = aParticle->GetKineticEnergy();
G4double Eloss, aKinEnergyFinal;
if(aKinEnergyInit < MinKineticEnergy ) { Eloss=0.0 ; }
else if( aKinEnergyInit < MipEnergy ) {Eloss= aKinEnergyInit ;}
else { Eloss = MipEnergy; }
aKinEnergyFinal=aKinEnergyInit-Eloss;
//In the G4example the backscattering is implemented in
//an adhoc manner as done below. It simply causes an
// efficiency loss.
G4double bckratio;
if( SignalToNoiseInData > 0.0 ){
bckratio = NsigmaInPedCut/ SignalToNoiseInData ;
}
G4double Effs = 1.0 - backscaprob * bckratio;
G4double Randbsk = G4UniformRand();
if(Randbsk <= Effs && Eloss > 0.0 ) {
aParticleChange.SetLocalEnergyDeposit(Eloss);
#ifdef G4ANALYSIS_USE
analysis->bumpNumHitInSi();
#endif
G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
G4String tpreVol = pPreStepPoint -> GetPhysicalVolume()->GetName();
G4int tpreVP = pPreStepPoint -> GetPhysicalVolume()->GetCopyNo();
G4int tpreVPS = pPreStepPoint -> GetPhysicalVolume()
->GetMother()->GetCopyNo();
}
if (aKinEnergyFinal <= MinKineticEnergy ) {
aParticleChange.SetStatusChange(fStopAndKill);
}else {
aParticleChange.SetEnergyChange(aKinEnergyFinal);
}
return &aParticleChange;
}
@@ -0,0 +1,276 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// PadHpdPhotoElectricEffect.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "globals.hh"
#include <math.h>
#include "PadHpdPhotoElectricEffect.hh"
#include "RichTbGeometryParameters.hh"
#include "G4TransportationManager.hh"
#include "Randomize.hh"
#include "RichTbAnalysisManager.hh"
#include "RichTbRunConfig.hh"
#include "RichTbMaterialParameters.hh"
#include "RichTbAnalysisManager.hh"
PadHpdPhotoElectricEffect::PadHpdPhotoElectricEffect(const G4String& processName ,
RichTbRunConfig* RConfig)
:G4VDiscreteProcess(processName),
HpdQE(NumHpdTot, vector<G4double>( NumQEbins)),
HpdWabin(NumHpdTot, vector<G4double>( NumQEbins)),
DemagnificationFactor(vector<G4double>(NumHpdTot)),
DemagnificationQuadFactor(vector<G4double>(NumHpdTot)) {
rConfig=RConfig;
PrePhotoElectricVolName="PadHpdWindowQuartz";
PostPhotoElectricVolName="BiAlkaliPhCathode";
HpdPhElectronKE=(RConfig-> getHpdPhElectronEnergy())*keV;
PhCathodeToSilDetDist= HpdPhotoCathodeSiZdist;
PSFsigma=PadHpdPSFsigma;
for(G4int ihpdq=0; ihpdq<NumHpdTot; ihpdq++ ) {
if( HpdDemagLinearTerm[ihpdq] != 0.0 ) {
DemagnificationFactor[ihpdq]=1.0 / HpdDemagLinearTerm[ihpdq];
}else { DemagnificationFactor[ihpdq] =1.0 / 2.3;}
if( HpdDemagQuadraticTerm[ihpdq] != 0.0 ) {
DemagnificationQuadFactor[ihpdq]=1.0 / HpdDemagQuadraticTerm[ihpdq];
}else{DemagnificationQuadFactor[ihpdq]=0.0*(1.0/(1.0*mm)); }
// Now to apply the error on the HPD demag factor. SE 28-4-02
// for now a flat error is applied. the uniform number from -1.0 to
// 1.0 is obtained and then multiplied with the factor.
G4double DemagError= (HpdDemagErrorPercent/100.0)*(2.0*G4UniformRand()-1.0) ;
DemagnificationFactor[ihpdq] = DemagnificationFactor[ihpdq]*(1.0+DemagError);
vector<G4double>qeCurHpd = InitializeHpdQE(ihpdq);
vector<G4double>waCurHpd = InitializeHpdWaveL(ihpdq);
if(qeCurHpd.size() != waCurHpd.size() ) {
G4cout<<"Wrong size for Hpd QE "<<ihpdq<<" "<<qeCurHpd.size()
<<" "<< waCurHpd.size()<<G4endl;
}
for(G4int iqbin=0; iqbin < qeCurHpd.size(); iqbin++){
HpdQE[ihpdq][iqbin]=qeCurHpd[iqbin]/100;
HpdWabin[ihpdq][iqbin]=waCurHpd[iqbin];
}
}
G4cout<<GetProcessName() <<" is created "<<G4endl;
}
PadHpdPhotoElectricEffect::~PadHpdPhotoElectricEffect() {; }
G4bool PadHpdPhotoElectricEffect::IsApplicable(const G4ParticleDefinition&
aParticleType)
{
return ( &aParticleType == G4OpticalPhoton::OpticalPhoton() );
}
G4double PadHpdPhotoElectricEffect::GetMeanFreePath(const G4Track& ,
G4double ,
G4ForceCondition* condition)
{
*condition = Forced;
return DBL_MAX;
}
G4VParticleChange* PadHpdPhotoElectricEffect::PostStepDoIt(const G4Track& aTrack,
const G4Step& aStep)
{
aParticleChange.Initialize(aTrack);
G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
if (pPostStepPoint->GetStepStatus() != fGeomBoundary){
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
G4String PrePhName = pPreStepPoint -> GetPhysicalVolume() ->
GetLogicalVolume() -> GetMaterial()->GetName();
G4String PostPhName= pPostStepPoint -> GetPhysicalVolume() ->
GetLogicalVolume() -> GetMaterial() ->GetName();
if(( PrePhName == PrePhotoElectricVolName &&
PostPhName == PostPhotoElectricVolName) ||
( PostPhName == PrePhotoElectricVolName &&
PrePhName == PostPhotoElectricVolName) ) {
}else {
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
if (aTrack.GetStepLength()<=kCarTolerance/2){
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
const G4DynamicParticle* aDynamicPhoton = aTrack.GetDynamicParticle();
G4double PhotonEnergy = aDynamicPhoton->GetKineticEnergy();
if(PhotonEnergy <= 0.0 ) {
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
//Now use the QE for the current HPD to determine if a
// photoelectron should be produced or not.
G4int currentHpdNumber= pPreStepPoint->GetPhysicalVolume()
-> GetMother() -> GetCopyNo();
if(currentHpdNumber >= NumHpdTot ){
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
G4double PhotWLength=PhotMomWaveConv/(PhotonEnergy/eV);
G4double PhCathodeQE = getHpdQEff(currentHpdNumber, PhotWLength);
G4double randomnum = G4UniformRand();
//the following three lines are copied from few lines later just
// for histogramming convenience.
G4ThreeVector GlobalElectronOrigin= pPostStepPoint->GetPosition();
G4Navigator* theNavigator =
G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking();
G4ThreeVector LocalElectronOrigin = theNavigator->
GetGlobalToLocalTransform().
TransformPoint(GlobalElectronOrigin);
// For the histogram of the radius of the cherenkov circle.
// This assumes that the beam is along 001 axis in the global
// coord system.
G4double GLx=GlobalElectronOrigin.x();
G4double GLy=GlobalElectronOrigin.y();
G4double PhotCkvRad = pow((pow(GLx,2)+pow(GLy,2)),0.5);
G4double PhotCkvPhi = atan2(GLy,GLx)*180.0/pi;
if( PhotCkvPhi < - 180.0 )PhotCkvPhi+= 360.0;
if(randomnum < PhCathodeQE ) {
G4double CurDemagFactor=DemagnificationFactor[currentHpdNumber];
G4double CurDemagQuadFactor=DemagnificationQuadFactor[currentHpdNumber];
// now get the Point Spread function.
G4double PsfRandomAzimuth = twopi*G4UniformRand();
G4double PsfRandomRad= G4RandGauss::shoot(0.0,PSFsigma);
G4double PsfX= PsfRandomRad*cos( PsfRandomAzimuth);
G4double PsfY= PsfRandomRad*sin( PsfRandomAzimuth);
G4ThreeVector LocalElectronDirection(
(CurDemagFactor+CurDemagQuadFactor*LocalElectronOrigin.x()-1.0)*LocalElectronOrigin.x()+PsfX,
(CurDemagFactor+CurDemagQuadFactor*LocalElectronOrigin.y()-1.0)*LocalElectronOrigin.y()+PsfY,
-(PhCathodeToSilDetDist-
(HpdPhCathodeRInner-LocalElectronOrigin.z())));
//normalize this vector and then transform back to global coord system.
LocalElectronDirection = LocalElectronDirection.unit();
const G4ThreeVector GlobalElectronDirection = theNavigator->
GetLocalToGlobalTransform().
TransformAxis(LocalElectronDirection);
G4double ElecKineEnergy=getHpdPhElectronKE();
//create the electron
G4DynamicParticle* aElectron= new G4DynamicParticle (G4Electron::Electron(),
GlobalElectronDirection, ElecKineEnergy) ;
aParticleChange.SetNumberOfSecondaries(1) ;
// aParticleChange.AddSecondary( aElectron ) ;
aParticleChange.AddSecondary( aElectron,GlobalElectronOrigin,true ) ;
// Kill the incident photon when it has converted to photoelectron.
aParticleChange.SetLocalEnergyDeposit(PhotonEnergy);
aParticleChange.SetEnergyChange(0.);
aParticleChange.SetStatusChange(fStopAndKill);
}
//photon is not killed if it is not converted to photoelectron
//SE 26-09-01.
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
G4double PadHpdPhotoElectricEffect::getHpdQEff(G4int HpdNum,
G4double PhotonWLength){
G4double hq1,hq2, wa1, wa2,aslope,aintc;
G4double qeff=0.0;
for (G4int ibinq=0 ; ibinq<NumQEbins-1 ; ibinq++ ){
wa1 = HpdWabin[HpdNum][ibinq];
wa2 = HpdWabin[HpdNum][ibinq+1];
if( PhotonWLength >= wa1 && PhotonWLength <= wa2 ) {
hq1 = HpdQE[HpdNum][ibinq];
hq2 = HpdQE[HpdNum][ibinq+1];
aslope = (hq2-hq1)/(wa2-wa1);
aintc = hq1 - (aslope * wa1 );
qeff= aintc + aslope * PhotonWLength ;
return qeff;
}
}
return qeff;
}
@@ -0,0 +1,267 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbAnalysisManager.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "G4Timer.hh"
#include "globals.hh"
#include "fstream"
#include <ctype.h>
#include "G4ios.hh"
#include "G4Run.hh"
#include "G4Event.hh"
#include "G4Track.hh"
#include "G4VVisManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4SteppingManager.hh"
#include "G4SDManager.hh"
#include "G4HCofThisEvent.hh"
#include "RichTbHit.hh"
#include "RichTbRunConfig.hh"
#include "RichTbAnalysisMessenger.hh"
#ifdef G4ANALYSIS_USE
#include "RichTbAnalysisManager.hh"
#include "AIDA/AIDA.h"
RichTbAnalysisManager* RichTbAnalysisManager::instance = 0;
RichTbAnalysisManager::RichTbAnalysisManager()
:outputFileName("rich.his"), analysisFactory(0),tree(0),histogramFactory(0)
{
iTimer = new G4Timer;
NumPhotBeforeAerogel=0;
NumPhotBeforeMirror=0;
NumPhotAfterMirror=0;
NumPhotBeforeFilter=0;
NumPhotAfterFilter=0;
NumPhotAtHpd1Input=0;
NumPhotAtHpd2Input=0;
NumPhotAtHpd3Input=0;
NumPhotAtHpd4Input=0;
NumHitTotInHpd1=0;
NumHitTotInHpd2=0;
NumHitTotInHpd3=0;
NumHitTotInHpd4=0;
NumHitInSi=0;
analisysMessenger = new RichTbAnalysisMessenger(this);
// Hooking an AIDA compliant analysis system.
analysisFactory = AIDA_createAnalysisFactory();
if(analysisFactory) {
AIDA::ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
if(treeFactory) {
tree = treeFactory->create(outputFileName,"hbook",false,true);
delete treeFactory; // Will not delete the ITree.
histogramFactory = analysisFactory->createHistogramFactory(*tree);
}
}
}
RichTbAnalysisManager::~RichTbAnalysisManager(){
delete histogramFactory;
histogramFactory = 0;
delete analysisFactory;
analysisFactory = 0;
delete instance;
}
RichTbAnalysisManager* RichTbAnalysisManager::getInstance()
{
if(instance==0) {instance = new RichTbAnalysisManager;}
return instance;
}
void RichTbAnalysisManager::book()
{
fhistoNrPhotG = histogramFactory->createHistogram1D("1","Number of Photon Hits per Track",120,0.,20.);
fhistoNBeforeMirror = histogramFactory->createHistogram1D("2","Number of Photons before Mirror",100,0.,750.);
fhistoWBeforeMirror = histogramFactory->createHistogram1D("3","WaveLength of Photons before Mirror",100,200.,800.);
fhistoWAfterMirror = histogramFactory->createHistogram1D("4","WaveLength of Photons after Mirror",100,200.,800.);
fhistoCkvProdSmall = histogramFactory->createHistogram1D("9","Cherekov Angle at roduction all angles",500,0.,0.5);
fhistoEmisZ = histogramFactory->createHistogram1D("10","Z of the Photon Emission Point",120,0.,600.);
fhistoCkvRadius = histogramFactory->createHistogram1D("5","Cherenkov Ring Radius",300,80.,220.);
}
void RichTbAnalysisManager::finish()
{
if(tree){
tree->commit(); //Write histos and ntuples in file
tree->close();
}
}
void RichTbAnalysisManager::BeginOfEventAnalysis(const G4Event* evt){
//RichCollId is already defined in LHCbRichSimEventAction.cc
// Hence its extraction is not repeated here.
iTimer->Start();
NumPhotBeforeAerogel=0;
NumPhotBeforeMirror=0;
NumPhotAfterMirror=0;
NumPhotBeforeFilter=0;
NumPhotAfterFilter=0;
NumPhotAtHpd1Input=0;
NumPhotAtHpd2Input=0;
NumPhotAtHpd3Input=0;
NumPhotAtHpd4Input=0;
NumHitTotInHpd1=0;
NumHitTotInHpd2=0;
NumHitTotInHpd3=0;
NumHitTotInHpd4=0;
NumHitInSi=0;
}
void RichTbAnalysisManager::EndOfEventAnalysis(const G4Event* evt){
iTimer->Stop();
G4double TimeforThisEvent= iTimer->GetRealElapsed();
G4SDManager * SDman = G4SDManager::GetSDMpointer();
G4String colNam;
G4int RichTbCollID = SDman->GetCollectionID(colNam="RichTbHitsCollection");
G4int RichTbc = RichTbCollID;
G4int evtNb = evt->GetEventID();
if(RichTbc<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RichTbHitsCollection* RHC =
HCE ? (RichTbHitsCollection*)(HCE->GetHC(RichTbc)) : 0;
if(RHC)
{
int n_hit = RHC->entries();
G4cout << " " << n_hit
<< " hits are stored in RichTbHitsCollection in event "<<evtNb<< G4endl;
//fill the final number of hits in this event into a histogram
fhistoNrPhotG->fill(n_hit*1.0);
//To print and plot the number of hits per each HPD.
for (G4int iha=0; iha<n_hit; iha++ ) {
RichTbHit* aHit = (*RHC)[iha];
G4int CurHpdnum = aHit -> GetCurHpdNum();
if(CurHpdnum == 0 ) {
NumHitTotInHpd1++;
}else if (CurHpdnum == 1 ) {
NumHitTotInHpd2++;
}else if (CurHpdnum == 2 ) {
NumHitTotInHpd3++;
}else if (CurHpdnum == 3 ) {
NumHitTotInHpd4++;
}
}
//fill the number of photons before mirror into a histogram
fhistoNBeforeMirror->fill(NumPhotBeforeMirror);
G4cout<<"NumPhot before mirror "<<NumPhotBeforeMirror<<G4endl;
G4cout<<"NumPhot after mirror "<<NumPhotAfterMirror<<G4endl;
G4cout<<"NumPhot incident on Hpd 1 2 3 4 = "<< NumPhotAtHpd1Input
<<" "<< NumPhotAtHpd2Input<<" "<< NumPhotAtHpd3Input
<<" "<< NumPhotAtHpd4Input<<G4endl;
G4cout<<"Number of Si hits in Hpd 1 2 3 4 are "<<NumHitTotInHpd1
<<" "<<NumHitTotInHpd2<<" "<<NumHitTotInHpd3
<<" "<<NumHitTotInHpd4<<G4endl;
}
}
//void RichTbAnalysisManager::StepAnalysis(
// const G4SteppingManager* aSteppingManager ){
//}
void RichTbAnalysisManager::setMeanHXCoord(G4double cx ) {
G4double hcurx = NumHXCoord+1.0;
if(hcurx != 0.0 ) {
G4double Mhx = MeanHXCoord * (NumHXCoord / hcurx) + cx/hcurx ;
MeanHXCoord = Mhx;
NumHXCoord = hcurx;
}else { G4cout<< "Zero hcurx in setMeanHXCoord "<<G4endl; }
}
void RichTbAnalysisManager::setMeanHYCoord(G4double cy ) {
G4double hcury = NumHYCoord+1.0;
if(hcury != 0.0 ) {
G4double Mhy = MeanHYCoord * (NumHYCoord / hcury) + cy/hcury ;
MeanHYCoord = Mhy;
NumHYCoord = hcury;
}else { G4cout<< "Zero hcury in setMeanHYCoord "<<G4endl; }
}
void RichTbAnalysisManager::SetOutputFileName(G4String newName)
{
outputFileName = newName;
}
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// RichTbAnalysisMessenger.cc for Rich of LHCb
// Advanced example of Geant4
// Author: Patricia Mendez (patricia.mendez@cern.ch)
//
// History:
// -----------
// Patricia Mendez Created
//--------------------------------------------------------------------------
#ifdef G4ANALYSIS_USE
#include "RichTbAnalysisMessenger.hh"
#include "RichTbAnalysisManager.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbAnalysisMessenger::RichTbAnalysisMessenger(RichTbAnalysisManager* analysisManager)
:richAnalysis(analysisManager)
{
RichTbAnalysisDir = new G4UIdirectory("/analysis/");
RichTbAnalysisDir->SetGuidance("analysis control.");
ouputFileCommand = new G4UIcmdWithAString("/analysis/outputFile",this);
ouputFileCommand->SetGuidance("specify the name of the output file (lowercase for Hbook)");
ouputFileCommand->SetGuidance("default: rich.hbk");
ouputFileCommand->SetParameterName("choice",true);
ouputFileCommand->SetDefaultValue("rich.his");
ouputFileCommand->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbAnalysisMessenger::~RichTbAnalysisMessenger()
{
delete RichTbAnalysisDir;
}
#endif
@@ -0,0 +1,382 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbComponent.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "globals.hh"
#include "RichTbDetectorConstruction.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbMaterialParameters.hh"
#include "FilterTypeSpec.hh"
#include "RichTbComponent.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4Sphere.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4Material.hh"
#include "G4SubtractionSolid.hh"
RichTbComponent::RichTbComponent(){ ; }
RichTbComponent::RichTbComponent(RichTbMaterial* RMaterial,
RichTbHall* RTbHall , RichTbRunConfig* RConfig,
G4bool ConstructTrackingSwitch):
RichTbAgelLVol(vector<G4LogicalVolume*>(MaxNumberOfAerogelTiles)),
RichTbAgelPVol(vector<G4VPhysicalVolume*>(MaxNumberOfAerogelTiles)),
RichTbAgelWrapTopLVol(vector<G4LogicalVolume*>(MaxNumberOfAerogelTiles)),
RichTbAgelWrapTopPVol(vector<G4VPhysicalVolume*>(MaxNumberOfAerogelTiles)),
RichTbAgelWrapBotLVol(vector<G4LogicalVolume*>(MaxNumberOfAerogelTiles)),
RichTbAgelWrapBotPVol(vector<G4VPhysicalVolume*>(MaxNumberOfAerogelTiles))
{
ConstructTrackingGeometrySwitch=ConstructTrackingSwitch;
//First define the shapes.
//Components of the Vessel.
G4Tubs * VesselEnclosure
= new G4Tubs("VesselEnclosure",VesselInnerRad,VesselOuterRad,
VesselHalfZ,VesselStartPhi,VesselDelPhi);
G4RotationMatrix VesselBRot;
G4ThreeVector VesselBTrsl(VesselPosX,VesselPosY,VesselPosZ);
G4Transform3D VesselBTransform(VesselBRot,VesselBTrsl);
G4LogicalVolume* VesselEnclosureLog=
new G4LogicalVolume(VesselEnclosure, RMaterial->getNitrogenGas(),
"VesselEnclosure",0,0,0);
G4VPhysicalVolume* VesselEnclosurePhys=
new G4PVPlacement(VesselBTransform,"VesselEnclosure",
VesselEnclosureLog,
RTbHall->getRichTbHallPhysicalVolume(),
false,0);
//
//
if(ConstructTrackingSwitch){
G4int NAgelTiles=RConfig-> GetNumberOfAerogelTiles();
G4Box * RadFrame
= new G4Box("RadFrame",RadFrameHalfX,RadFrameHalfY,RadFrameHalfZ);
G4Box * RadHoldUps
= new G4Box("RadHoldUps",RadHoldUpHalfX,RadHoldUpHalfY,RadHoldUpHalfZ);
G4Tubs * RadHoldUpWin
= new G4Tubs("RadHoldUpWin", RadWinUpInnerRad, RadWinUpOuterRad,
RadWinUpHalfZ,RadWinUpStartPhi,RadWinUpDelPhi);
G4Box * RadHoldDns
= new G4Box("RadHoldDns",RadHoldDnHalfX,RadHoldDnHalfY,RadHoldDnHalfZ);
G4Tubs * RadHoldDnWin
= new G4Tubs("RadHoldDnWin", RadWinDnInnerRad, RadWinDnOuterRad,
RadWinDnHalfZ,RadWinDnStartPhi,RadWinDnDelPhi);
G4int FilterNum = RConfig->GetFilterTNumber();
G4Box * FilterBox;
if(FilterNum >= 0 ) {
G4double FilterHalfZ= FilterHalfZArray[FilterNum];
FilterBox
= new G4Box("FilterBox", FilterHalfX,FilterHalfY,FilterHalfZ);
}
//Mirror
G4double MirrThetaSize=2.0*asin(MirrorHorizontalChord/(MirrorRInner*2.0));
G4double MirrThetaStart=halfpi*rad-MirrThetaSize/2.0;
G4double MirrPhiSize=2.0*asin(MirrorVerticalChord/(MirrorRInner*2.0));
G4double MirrPhiStart=-MirrPhiSize/2.0;
G4Sphere* MirrorSphe= new G4Sphere("MirrorSphe",MirrorRInner,
MirrorROuter,MirrPhiStart,
MirrPhiSize,MirrThetaStart,
MirrThetaSize);
//Now for the rotations and translations..
G4RotationMatrix RadFrameRot;
G4RotationMatrix RadWinUpRot,RadWinDnRot,RadHoldUpRot,RadHoldDnRot;
G4ThreeVector RadFrameTrsl(RadFramePosX,RadFramePosY,RadFramePosZ);
G4Transform3D RadFrameTransform(RadFrameRot,RadFrameTrsl);
//
//
G4ThreeVector RadWinUpTrsl(RadWinUpShiftX,RadWinUpShiftY,RadWinUpShiftZ);
G4Transform3D RadWinUpTransform(RadWinUpRot,RadWinUpTrsl);
G4ThreeVector RadHoldUpTrsl(RadHoldUpPosX,RadHoldUpPosY,RadHoldUpPosZ);
G4Transform3D RadHoldUpTransform(RadHoldUpRot,RadHoldUpTrsl);
//
G4ThreeVector RadWinDnTrsl(RadWinDnShiftX,RadWinDnShiftY,RadWinDnShiftZ);
G4Transform3D RadWinDnTransform(RadWinDnRot,RadWinDnTrsl);
G4ThreeVector RadHoldDnTrsl(RadHoldDnPosX,RadHoldDnPosY,RadHoldDnPosZ);
G4Transform3D RadHoldDnTransform(RadHoldDnRot,RadHoldDnTrsl);
//
//
//
G4RotationMatrix MirrorRotationX, MirrorRotationY;
G4double MirrorExtraTiltX = RConfig->getMirrorAddTiltX();
G4double MirrorExtraTiltY = RConfig->getMirrorAddTiltY();
G4double MirrorTotRotX= MirrorNominalRotX+MirrorExtraTiltX;
G4double MirrorTotRotY= MirrorNominalRotY+MirrorExtraTiltY;
G4double MirrorPosX, MirrorPosY, MirrorPosZ;
if( MirrorTotRotX !=0.0 || MirrorTotRotY != 0.0 ) {
MirrorPosX =-VesselPosX-MirrorRInner*sin(MirrorTotRotY);
MirrorPosY =-VesselPosY+MirrorRInner*sin(MirrorTotRotX);
MirrorPosZ =MirrorShiftFromEnd-VesselHalfZ
-MirrorRInner*(cos(MirrorTotRotY)+cos(MirrorTotRotX)-1.0);
}else {
MirrorPosX =-VesselPosX;
MirrorPosY =-VesselPosY;
MirrorPosZ =MirrorNominalPosZ;
}
G4ThreeVector MirrorPos(MirrorPosX,MirrorPosY,MirrorPosZ);
if (MirrorTotRotX != 0.0 ) {
MirrorRotationX.rotateX(MirrorTotRotX);
}
MirrorRotationY.rotateY(-halfpi*rad+MirrorTotRotY);
G4Transform3D MirrorTransform(MirrorRotationX*MirrorRotationY,MirrorPos);
//
G4LogicalBorderSurface* VesselOuterSurface =
new G4LogicalBorderSurface("VesselOuterSurface",
RTbHall->getRichTbHallPhysicalVolume(),
VesselEnclosurePhys,
RMaterial->getOpticalEnclosureSurface());
G4LogicalBorderSurface* VesselInnerSurface =
new G4LogicalBorderSurface("VesselInnerSurface",
VesselEnclosurePhys,
RTbHall->getRichTbHallPhysicalVolume(),
RMaterial->getOpticalEnclosureSurface());
RichTbEnclosureOuterBSurf=VesselOuterSurface;
RichTbEnclosureInnerBSurf=VesselInnerSurface;
G4LogicalVolume* RadFrameLog=
new G4LogicalVolume(RadFrame,RMaterial->getNitrogenGas(),
"RadFrame",0,0,0);
G4VPhysicalVolume* RadFramePhys=
new G4PVPlacement(RadFrameTransform,"RadFrame",RadFrameLog,
VesselEnclosurePhys,false,0);
//Now for the holder upstream and downstream of the Aerogel Tiles.
G4SubtractionSolid* RadUpW =
new G4SubtractionSolid("RadUpW",RadHoldUps,RadHoldUpWin,
RadWinUpTransform);
G4LogicalVolume* RadUpWLog=
new G4LogicalVolume(RadUpW,RMaterial->getPlasticAg(),
"RadUpW",0,0,0);
G4VPhysicalVolume* RadUpWPhys=
new G4PVPlacement( RadHoldUpTransform,"RadUpW",RadUpWLog,
RadFramePhys ,false,0);
//
G4SubtractionSolid* RadDnW =
new G4SubtractionSolid("RadDnW",RadHoldDns,RadHoldDnWin,
RadWinDnTransform);
G4LogicalVolume* RadDnWLog=
new G4LogicalVolume(RadDnW,RMaterial->getAluminium(),
"RadDnW",0,0,0);
G4VPhysicalVolume* RadDnWPhys=
new G4PVPlacement( RadHoldDnTransform,"RadDnW",RadDnWLog,
RadFramePhys ,false,0);
//Now for the various aerogel tiles and the wraps above and
//below them
NumAerogelTiles= NAgelTiles;
G4RotationMatrix AgelRot,AgelWrapTopRot,AgelWrapBotRot;
G4double AgelPosSZ[MaxNumberOfAerogelTiles];
G4double AgelPosCurZ[MaxNumberOfAerogelTiles];
for(G4int agNum=0; agNum<NAgelTiles; agNum++ ){
G4int agTnumber= RConfig->GetCurAerogelTNumber(agNum);
G4Box* Agel = new G4Box("Agel", AgelHalfX[agTnumber],
AgelHalfY[agTnumber],AgelHalfZ[agTnumber]);
AgelPosSZ[agNum]=AgelHalfZ[agTnumber];
AgelPosCurZ[agNum]=AgelEndZ-AgelHalfZ[agTnumber];
for(G4int agt=0; agt<agNum; agt++ ) {
AgelPosCurZ[agNum] -= (2*AgelPosSZ[agt]+ AgelTileGapZ);
}
G4ThreeVector AgelTrsl(AgelPosX[agNum],
AgelPosY[agNum],AgelPosCurZ[agNum]);
G4Transform3D AgelTransform(AgelRot,AgelTrsl);
G4Material* CurAgelMaterial= RMaterial->getAerogelMaterial(agTnumber);
G4LogicalVolume* AgelLog=
new G4LogicalVolume(Agel,CurAgelMaterial,"Agel",0,0,0);
G4VPhysicalVolume* AgelPhys=
new G4PVPlacement(AgelTransform,"Agel",AgelLog,
RadFramePhys,false,agNum);
RichTbAgelLVol[agNum] = AgelLog;
RichTbAgelPVol[agNum] = AgelPhys;
G4Box* AgelWrapTop = new G4Box("AgelWrapTop", AgelWrapTopHalfX[agTnumber],
AgelWrapTopHalfY[agTnumber],
AgelWrapTopHalfZ[agTnumber]);
G4Box* AgelWrapBot = new G4Box("AgelWrapBot", AgelWrapBotHalfX[agTnumber],
AgelWrapBotHalfY[agTnumber],
AgelWrapBotHalfZ[agTnumber]);
G4double AgelWrapTopPosCurZ=AgelPosCurZ[agNum];
G4double AgelWrapBotPosCurZ=AgelPosCurZ[agNum];
G4double AgelWrapTopPosCurY=AgelHalfY[agTnumber]+
AgelWrapTopHalfY[agTnumber];
G4double AgelWrapBotPosCurY=-AgelHalfY[agTnumber]+
-AgelWrapBotHalfY[agTnumber];
G4ThreeVector AgelWrapTopTrsl(AgelWrapTopPosX[agNum],
AgelWrapTopPosCurY,AgelWrapTopPosCurZ);
G4Transform3D AgelWrapTopTransform(AgelWrapTopRot,AgelWrapTopTrsl);
G4ThreeVector AgelWrapBotTrsl(AgelWrapBotPosX[agNum],
AgelWrapBotPosCurY,AgelWrapBotPosCurZ);
G4Transform3D AgelWrapBotTransform(AgelWrapBotRot,AgelWrapBotTrsl);
G4LogicalVolume* AgelWrapTopLog=
new G4LogicalVolume(AgelWrapTop, RMaterial->getPlasticAg(),
"AgelWrapTop",0,0,0);
G4LogicalVolume* AgelWrapBotLog=
new G4LogicalVolume(AgelWrapBot, RMaterial->getPlasticAg(),
"AgelWrapBot",0,0,0);
G4VPhysicalVolume* AgelWrapTopPhys=
new G4PVPlacement(AgelWrapTopTransform,"AgelWrapTop",
AgelWrapTopLog,RadFramePhys,false,agNum);
G4VPhysicalVolume* AgelWrapBotPhys=
new G4PVPlacement(AgelWrapBotTransform,"AgelWrapBot",
AgelWrapBotLog,RadFramePhys,false,agNum);
RichTbAgelWrapTopLVol[agNum] = AgelWrapTopLog;
RichTbAgelWrapTopPVol[agNum] = AgelWrapTopPhys;
RichTbAgelWrapBotLVol[agNum] = AgelWrapBotLog;
RichTbAgelWrapBotPVol[agNum] = AgelWrapBotPhys;
}
// FilterType CurFil= RConfig->GetFilterType();
G4int Filnum= RConfig->GetFilterTNumber() ;
G4LogicalVolume* FilterLog;
G4VPhysicalVolume* FilterPhys;
if(Filnum >= 0 ) {
G4double FilterHalfZCur= FilterHalfZArray[Filnum];
G4double FilterPosZ= FilterPosZNominal-FilterHalfZNominal+FilterHalfZCur;
G4RotationMatrix FilterRot;
G4ThreeVector FilterTrsl(FilterPosX,FilterPosY,FilterPosZ);
G4Transform3D FilterTransform(FilterRot,FilterTrsl);
G4Material* CurFilterMaterial
= RMaterial-> getRichTbFilterMaterial( Filnum);
FilterLog=
new G4LogicalVolume(FilterBox, CurFilterMaterial,
"FilterBox",0,0,0);
FilterPhys=
new G4PVPlacement(FilterTransform,"FilterBox",FilterLog,
RadFramePhys,false,0);
G4LogicalBorderSurface* FilterInnerSurface =
new G4LogicalBorderSurface("RichTbFilterInnerSurface",
FilterPhys,VesselEnclosurePhys,
RMaterial->getOpticalFilterSurface());
G4LogicalBorderSurface* FilterOuterSurface =
new G4LogicalBorderSurface("RichTbFilterOuterSurface",
VesselEnclosurePhys,FilterPhys,
RMaterial->getOpticalFilterSurface());
}
G4LogicalVolume* MirrorLog=
new G4LogicalVolume(MirrorSphe,RMaterial->getMirrorQuartz(),
"MirrorSphe",0,0,0);
G4VPhysicalVolume* MirrorPhys=
new G4PVPlacement(MirrorTransform,"MirrorSphe",MirrorLog,
VesselEnclosurePhys,false,0);
G4LogicalBorderSurface* MirrorSurface =
new G4LogicalBorderSurface("RichTbMirrorSurface",
VesselEnclosurePhys,MirrorPhys,
RMaterial->getOpticalMirrorSurface());
RichTbRadFrameLVol= RadFrameLog;
RichTbRadFramePVol= RadFramePhys;
RichTbRadUpWLVol= RadUpWLog;
RichTbRadUpWPVol= RadUpWPhys;
RichTbRadDnWLVol= RadDnWLog;
RichTbRadDnWPVol= RadDnWPhys;
if(Filnum >= 0 ) {
RichTbFilterLVol = FilterLog;
RichTbFilterPVol = FilterPhys;
}
RichTbMirrorLVol=MirrorLog;
RichTbMirrorPVol=MirrorPhys;
RichTbMirrorBSurf=MirrorSurface;
}
RichTbEnclosureLVol=VesselEnclosureLog;
RichTbEnclosurePVol=VesselEnclosurePhys;
}
RichTbComponent::~RichTbComponent() {; }
@@ -0,0 +1,117 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbDetectorConstruction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "RichTbMaterialParameters.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbDetectorConstruction.hh"
#include "RichTbHall.hh"
#include "RichTbMaterial.hh"
#include "G4Box.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4SDManager.hh"
#include "RichTbSD.hh"
RichTbDetectorConstruction::RichTbDetectorConstruction(){; }
RichTbDetectorConstruction::RichTbDetectorConstruction(RichTbRunConfig* RConfig){
runConfiguration=RConfig;
}
RichTbDetectorConstruction::~RichTbDetectorConstruction(){;}
G4VPhysicalVolume* RichTbDetectorConstruction::Construct(){
RichTbRunConfig* rConfig= runConfiguration;
InitializeRichTbMaterial();
HistoRichTbMaterialProperties(rConfig);
rMaterial = new RichTbMaterial(rConfig);
InitializeRichTbGeometry();
rTbHall = new RichTbHall(rMaterial);
rTbComponent = new RichTbComponent(rMaterial,rTbHall,rConfig,true);
rTbPhotoDetector = new RichTbPhotoDetector(rMaterial,rTbComponent,rConfig,true);
//Now for the sensitive Detector
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String HpdSDname = "RichTbSD";
G4String RichTbHColname="RichTbHitsCollection";
RichTbSD* HpdSD = new RichTbSD( HpdSDname,
NumberOfHpds,NumberOfSiDetSectors,
NumberOfPadHpdSiPixels,
RichTbHColname );
G4String ROgeometryName = "RichTbROGeom";
rTbROGeom = new RichTbROGeometry(ROgeometryName,rMaterial, rConfig);
rTbROGeom -> BuildROGeometry();
HpdSD ->SetROgeometry( rTbROGeom);
SDman->AddNewDetector( HpdSD );
G4int NumHpd = NumberOfHpds;
for (G4int ihpd=0 ; ihpd < NumHpd ; ihpd++ ) {
G4int NumSiSect=rTbPhotoDetector-> getRichHPD(ihpd) ->
getNumSectInHpd();
for (G4int isec=0; isec < NumSiSect; isec++) {
G4LogicalVolume* RichTbSiDetSect_LV =rTbPhotoDetector ->
getRichHPD(ihpd)-> getRichHpdSiDetSect(isec)->
getHpdSiSectLogicalVolume();
RichTbSiDetSect_LV->SetSensitiveDetector( HpdSD );
}
}
rTbGraphics = new RichTbGraphics(rTbHall,rTbComponent,
rTbPhotoDetector,rTbROGeom, rConfig );
return rTbHall->getRichTbHallPhysicalVolume();
}
@@ -0,0 +1,189 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbEventAction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbEventAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4SDManager.hh"
#include "G4VVisManager.hh"
#include "RichTbVisManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "RichTbSD.hh"
#include "RichTbHit.hh"
#include "RichTbRunConfig.hh"
#include "RichTbAnalysisManager.hh"
#include "RichTbIOData.hh"
RichTbEventAction::RichTbEventAction(){
RichTbCollID = -1;
}
RichTbEventAction::RichTbEventAction(RichTbRunConfig* RConfig,
RichTbVisManager* RVisManager, RichTbIOData* RIOData){
RichTbCollID = -1;
runConfiguration=RConfig;
pVisManager=RVisManager;
rTbIOData = RIOData;
}
RichTbEventAction::~RichTbEventAction(){
}
void RichTbEventAction::BeginOfEventAction(const G4Event* evt){
G4SDManager * SDman = G4SDManager::GetSDMpointer();
if(RichTbCollID<0){
RichTbCollID = SDman->GetCollectionID("RichTbHitsCollection");
}
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
analysis->BeginOfEventAnalysis(evt);
#endif
}
void RichTbEventAction::EndOfEventAction(const G4Event* evt){
RichTbRunConfig* RConfig = runConfiguration;
// first get the trajectories
G4TrajectoryContainer* trajectoryContainer=evt->GetTrajectoryContainer();
G4int n_trajectories=0;
G4int totalhits = 0;
if(trajectoryContainer){n_trajectories=trajectoryContainer->entries();
G4cout << " " << n_trajectories
<< " Tracks are stored in Trajectorycontainer." << G4endl;
}
// Now get the hits
if(RichTbCollID<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RichTbHitsCollection* RHC = 0;
G4int n_hit = 0;
if(HCE)
{
RHC = (RichTbHitsCollection*)(HCE->GetHC(RichTbCollID));
}
if(RHC)
{
n_hit = RHC->entries();
for(G4int i=0;i<n_hit;i++)
{
totalhits += i;
}
// G4cout << " " << n_hit
// << " hits are stored in RichTbHitsCollection." << G4endl;
}
if(RConfig->getRichTbDrawTrajectory() > 0){
for (G4int i=0; i<n_trajectories; i++){
(*(evt->GetTrajectoryContainer()))[i]->DrawTrajectory();
}
}
//now for the hits.
if(RHC) {
G4int n_hith = RHC->entries();
for (G4int ih=0; ih<n_hith; ih++ ) {
RichTbHit* aHit = (*RHC)[ih];
aHit->DrawWithVisM(pVisManager);
}
}
//Now to Fill the Histograms
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
analysis->EndOfEventAnalysis(evt);
#endif
// Now to write out the data
if(RConfig -> DoWriteOutputFile() ) {
rTbIOData -> WriteOutEventHeaderData(evt);
rTbIOData -> WriteOutHitData(evt);
G4cout << ">>> End of Event Number " << evt->GetEventID() << G4endl;
}
}
@@ -0,0 +1,427 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbAnalysisManager.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "globals.hh"
#include "RichTbGeometryParameters.hh"
G4double GetCurAerogelLength(G4int Aerognum ) {
return 2.0*AgelHalfZ[Aerognum];
}
RichTbPadHpdSiPixPos::RichTbPadHpdSiPixPos(G4int ipixelnum) {
//coord system such that Origin at the top of a sector;
// which is near the center of the anode.
//The X is along the bottom and Y goes radially outward (from top to
// bottom).
icurpixel=ipixelnum;
PadHpdSiPixPosX=PixColNumSect[ipixelnum]*XsizePix;
if(ipixelnum == BigPixelNum ) {
PadHpdSiPixPosY=PixRowNumSect[ipixelnum]*YsizePix+RowInitPointBigPixel;
}else {
PadHpdSiPixPosY=PixRowNumSect[ipixelnum]*YsizePix+RowInitPoint;
}
}
RichTbPadHpdSiPixPos::~RichTbPadHpdSiPixPos(){ ; }
void InitializeRichTbGeometry(){
PixRowNumSect[59-1]=0.0;
PixRowNumSect[70-1]=1.0;
PixRowNumSect[60-1]=2.0;
PixRowNumSect[82-1]=3.0;
PixRowNumSect[47-1]=3.0;
PixRowNumSect[81-1]=4.0;
PixRowNumSect[48-1]=4.0;
PixRowNumSect[91-1]=5.0;
PixRowNumSect[69-1]=5.0;
PixRowNumSect[38-1]=5.0;
PixRowNumSect[101-1]=6.0;
PixRowNumSect[80-1]=6.0;
PixRowNumSect[49-1]=6.0;
PixRowNumSect[28-1]=6.0;
PixRowNumSect[100-1]=7.0;
PixRowNumSect[79-1]=7.0;
PixRowNumSect[50-1]=7.0;
PixRowNumSect[29-1]=7.0;
PixRowNumSect[99-1]=8.0;
PixRowNumSect[78-1]=8.0;
PixRowNumSect[51-1]=8.0;
PixRowNumSect[30-1]=8.0;
PixRowNumSect[109-1]=9.0;
PixRowNumSect[90-1]=9.0;
PixRowNumSect[61-1]=9.0;
PixRowNumSect[39-1]=9.0;
PixRowNumSect[20-1]=9.0;
PixRowNumSect[108-1]=10.0;
PixRowNumSect[89-1]=10.0;
PixRowNumSect[68-1]=10.0;
PixRowNumSect[40-1]=10.0;
PixRowNumSect[21-1]=10.0;
PixRowNumSect[107-1]=11.0;
PixRowNumSect[88-1]=11.0;
PixRowNumSect[62-1]=11.0;
PixRowNumSect[41-1]=11.0;
PixRowNumSect[22-1]=11.0;
PixRowNumSect[116-1]=12.0;
PixRowNumSect[98-1]=12.0;
PixRowNumSect[77-1]=12.0;
PixRowNumSect[52-1]=12.0;
PixRowNumSect[31-1]=12.0;
PixRowNumSect[13-1]=12.0;
PixRowNumSect[115-1]=13.0;
PixRowNumSect[97-1]=13.0;
PixRowNumSect[76-1]=13.0;
PixRowNumSect[53-1]=13.0;
PixRowNumSect[32-1]=13.0;
PixRowNumSect[14-1]=13.0;
PixRowNumSect[114-1]=14.0;
PixRowNumSect[96-1]=14.0;
PixRowNumSect[75-1]=14.0;
PixRowNumSect[54-1]=14.0;
PixRowNumSect[33-1]=14.0;
PixRowNumSect[15-1]=14.0;
PixRowNumSect[121-1]=15.0;
PixRowNumSect[106-1]=15.0;
PixRowNumSect[87-1]=15.0;
PixRowNumSect[67-1]=15.0;
PixRowNumSect[42-1]=15.0;
PixRowNumSect[23-1]=15.0;
PixRowNumSect[8-1]=15.0;
PixRowNumSect[120-1]=16.0;
PixRowNumSect[105-1]=16.0;
PixRowNumSect[86-1]=16.0;
PixRowNumSect[63-1]=16.0;
PixRowNumSect[43-1]=16.0;
PixRowNumSect[24-1]=16.0;
PixRowNumSect[9-1]=16.0;
PixRowNumSect[119-1]=17.0;
PixRowNumSect[104-1]=17.0;
PixRowNumSect[85-1]=17.0;
PixRowNumSect[66-1]=17.0;
PixRowNumSect[44-1]=17.0;
PixRowNumSect[25-1]=17.0;
PixRowNumSect[10-1]=17.0;
PixRowNumSect[125-1]=18.0;
PixRowNumSect[113-1]=18.0;
PixRowNumSect[95-1]=18.0;
PixRowNumSect[74-1]=18.0;
PixRowNumSect[55-1]=18.0;
PixRowNumSect[34-1]=18.0;
PixRowNumSect[16-1]=18.0;
PixRowNumSect[4-1]=18.0;
PixRowNumSect[124-1]=19.0;
PixRowNumSect[112-1]=19.0;
PixRowNumSect[94-1]=19.0;
PixRowNumSect[73-1]=19.0;
PixRowNumSect[56-1]=19.0;
PixRowNumSect[35-1]=19.0;
PixRowNumSect[17-1]=19.0;
PixRowNumSect[5-1]=19.0;
PixRowNumSect[123-1]=20.0;
PixRowNumSect[111-1]=20.0;
PixRowNumSect[93-1]=20.0;
PixRowNumSect[72-1]=20.0;
PixRowNumSect[57-1]=20.0;
PixRowNumSect[36-1]=20.0;
PixRowNumSect[18-1]=20.0;
PixRowNumSect[6-1]=20.0;
PixRowNumSect[127-1]=21.0;
PixRowNumSect[118-1]=21.0;
PixRowNumSect[103-1]=21.0;
PixRowNumSect[84-1]=21.0;
PixRowNumSect[65-1]=21.0;
PixRowNumSect[45-1]=21.0;
PixRowNumSect[26-1]=21.0;
PixRowNumSect[11-1]=21.0;
PixRowNumSect[2-1]=21.0;
PixRowNumSect[126-1]=22.0;
PixRowNumSect[117-1]=22.0;
PixRowNumSect[102-1]=22.0;
PixRowNumSect[83-1]=22.0;
PixRowNumSect[64-1]=22.0;
PixRowNumSect[46-1]=22.0;
PixRowNumSect[27-1]=22.0;
PixRowNumSect[12-1]=22.0;
PixRowNumSect[3-1]=22.0;
PixRowNumSect[128-1]=23.0;
PixRowNumSect[122-1]=23.0;
PixRowNumSect[110-1]=23.0;
PixRowNumSect[92-1]=23.0;
PixRowNumSect[71-1]=23.0;
PixRowNumSect[58-1]=23.0;
PixRowNumSect[37-1]=23.0;
PixRowNumSect[19-1]=23.0;
PixRowNumSect[7-1]=23.0;
PixRowNumSect[1-1]=23.0;
PixColNumSect[59-1]=0.0;
PixColNumSect[70-1]=0.0;
PixColNumSect[60-1]=0.0;
PixColNumSect[82-1]=-0.5;
PixColNumSect[47-1]=0.5;
PixColNumSect[81-1]=-0.5;
PixColNumSect[48-1]=0.5;
PixColNumSect[91-1]=-1.0;
PixColNumSect[69-1]=0.0;
PixColNumSect[38-1]=1.0;
PixColNumSect[101-1]=-1.5;
PixColNumSect[80-1]=-0.5;
PixColNumSect[49-1]=0.5;
PixColNumSect[28-1]=1.5;
PixColNumSect[100-1]=-1.5;
PixColNumSect[79-1]=-0.5;
PixColNumSect[50-1]=0.5;
PixColNumSect[29-1]=1.5;
PixColNumSect[99-1]=-1.5;
PixColNumSect[78-1]=-0.5;
PixColNumSect[51-1]=0.5;
PixColNumSect[30-1]=1.5;
PixColNumSect[109-1]=-2.0;
PixColNumSect[90-1]=-1.0;
PixColNumSect[61-1]=0.0;
PixColNumSect[39-1]=1.0;
PixColNumSect[20-1]=2.0;
PixColNumSect[108-1]=-2.0;
PixColNumSect[89-1]=-1.0;
PixColNumSect[68-1]=0.0;
PixColNumSect[40-1]=1.0;
PixColNumSect[21-1]=2.0;
PixColNumSect[107-1]=-2.0;
PixColNumSect[88-1]=-1.0;
PixColNumSect[62-1]=0.0;
PixColNumSect[41-1]=1.0;
PixColNumSect[22-1]=2.0;
PixColNumSect[116-1]=-2.5;
PixColNumSect[98-1]=-1.5;
PixColNumSect[77-1]=-0.5;
PixColNumSect[52-1]=0.5;
PixColNumSect[31-1]=1.5;
PixColNumSect[13-1]=2.5;
PixColNumSect[115-1]=-2.5;
PixColNumSect[97-1]=-1.5;
PixColNumSect[76-1]=-0.5;
PixColNumSect[53-1]=0.5;
PixColNumSect[32-1]=1.5;
PixColNumSect[14-1]=2.5;
PixColNumSect[114-1]=-2.5;
PixColNumSect[96-1]=-1.5;
PixColNumSect[75-1]=-0.5;
PixColNumSect[54-1]=0.5;
PixColNumSect[33-1]=1.5;
PixColNumSect[15-1]=2.5;
PixColNumSect[121-1]=-3.0;
PixColNumSect[106-1]=-2.0;
PixColNumSect[87-1]=-1.0;
PixColNumSect[67-1]=0.0;
PixColNumSect[42-1]=1.0;
PixColNumSect[23-1]=2.0;
PixColNumSect[8-1]=3.0;
PixColNumSect[120-1]=-3.0;
PixColNumSect[105-1]=-2.0;
PixColNumSect[86-1]=-1.0;
PixColNumSect[63-1]=0.0;
PixColNumSect[43-1]=1.0;
PixColNumSect[24-1]=2.0;
PixColNumSect[9-1]=3.0;
PixColNumSect[119-1]=-3.0;
PixColNumSect[104-1]=-2.0;
PixColNumSect[85-1]=-1.0;
PixColNumSect[66-1]=0.0;
PixColNumSect[44-1]=1.0;
PixColNumSect[25-1]=2.0;
PixColNumSect[10-1]=3.0;
PixColNumSect[125-1]=-3.5;
PixColNumSect[113-1]=-2.5;
PixColNumSect[95-1]=-1.5;
PixColNumSect[74-1]=-0.5;
PixColNumSect[55-1]=0.5;
PixColNumSect[34-1]=1.5;
PixColNumSect[16-1]=2.5;
PixColNumSect[4-1]=3.5;
PixColNumSect[124-1]=-3.5;
PixColNumSect[112-1]=-2.5;
PixColNumSect[94-1]=-1.5;
PixColNumSect[73-1]=-0.5;
PixColNumSect[56-1]=0.5;
PixColNumSect[35-1]=1.5;
PixColNumSect[17-1]=2.5;
PixColNumSect[5-1]=3.5;
PixColNumSect[123-1]=-3.5;
PixColNumSect[111-1]=-2.5;
PixColNumSect[93-1]=-1.5;
PixColNumSect[72-1]=-0.5;
PixColNumSect[57-1]=0.5;
PixColNumSect[36-1]=1.5;
PixColNumSect[18-1]=2.5;
PixColNumSect[6-1]=3.5;
PixColNumSect[127-1]=-4.0;
PixColNumSect[118-1]=-3.0;
PixColNumSect[103-1]=-2.0;
PixColNumSect[84-1]=-1.0;
PixColNumSect[65-1]=0.0;
PixColNumSect[45-1]=1.0;
PixColNumSect[26-1]=2.0;
PixColNumSect[11-1]=3.0;
PixColNumSect[2-1]=4.0;
PixColNumSect[126-1]=-4.0;
PixColNumSect[117-1]=-3.0;
PixColNumSect[102-1]=-2.0;
PixColNumSect[83-1]=-1.0;
PixColNumSect[64-1]=0.0;
PixColNumSect[46-1]=1.0;
PixColNumSect[27-1]=2.0;
PixColNumSect[12-1]=3.0;
PixColNumSect[3-1]=4.0;
PixColNumSect[128-1]=-4.5;
PixColNumSect[122-1]=-3.5;
PixColNumSect[110-1]=-2.5;
PixColNumSect[92-1]=-1.5;
PixColNumSect[71-1]=-0.5;
PixColNumSect[58-1]=0.5;
PixColNumSect[37-1]=1.5;
PixColNumSect[19-1]=2.5;
PixColNumSect[7-1]=3.5;
PixColNumSect[1-1]=4.5;
for (G4int ipixel=0;ipixel<NumberOfPadHpdSiPixels; ipixel++){
PixelAtSectEdge[ipixel]=false;
}
PixelAtSectEdge[59-1]=true;
PixelAtSectEdge[70-1]=true;
PixelAtSectEdge[59-1]=true;
PixelAtSectEdge[60-1]=true;
PixelAtSectEdge[82-1]=true;
PixelAtSectEdge[47-1]=true;
PixelAtSectEdge[81-1]=true;
PixelAtSectEdge[48-1]=true;
PixelAtSectEdge[91-1]=true;
PixelAtSectEdge[38-1]=true;
PixelAtSectEdge[101-1]=true;
PixelAtSectEdge[28-1]=true;
PixelAtSectEdge[100-1]=true;
PixelAtSectEdge[29-1]=true;
PixelAtSectEdge[99-1]=true;
PixelAtSectEdge[30-1]=true;
PixelAtSectEdge[109-1]=true;
PixelAtSectEdge[20-1]=true;
PixelAtSectEdge[108-1]=true;
PixelAtSectEdge[21-1]=true;
PixelAtSectEdge[107-1]=true;
PixelAtSectEdge[22-1]=true;
PixelAtSectEdge[116-1]=true;
PixelAtSectEdge[13-1]=true;
PixelAtSectEdge[115-1]=true;
PixelAtSectEdge[14-1]=true;
PixelAtSectEdge[114-1]=true;
PixelAtSectEdge[15-1]=true;
PixelAtSectEdge[121-1]=true;
PixelAtSectEdge[8-1]=true;
PixelAtSectEdge[120-1]=true;
PixelAtSectEdge[9-1]=true;
PixelAtSectEdge[119-1]=true;
PixelAtSectEdge[10-1]=true;
PixelAtSectEdge[125-1]=true;
PixelAtSectEdge[4-1]=true;
PixelAtSectEdge[124-1]=true;
PixelAtSectEdge[5-1]=true;
PixelAtSectEdge[123-1]=true;
PixelAtSectEdge[6-1]=true;
PixelAtSectEdge[127-1]=true;
PixelAtSectEdge[2-1]=true;
PixelAtSectEdge[126-1]=true;
PixelAtSectEdge[3-1]=true;
PixelAtSectEdge[128-1]=true;
PixelAtSectEdge[1-1]=true;
}
@@ -0,0 +1,522 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbGraphics.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "RichTbDetectorConstruction.hh"
#include "RichTbHall.hh"
#include "RichTbComponent.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbPhotoDetector.hh"
#include "RichTbHpd.hh"
#include "RichTbSiDet.hh"
#include "RichTbGraphics.hh"
#include "G4LogicalVolume.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "RichTbRunConfig.hh"
RichTbGraphics::RichTbGraphics(){ ; }
RichTbGraphics::RichTbGraphics(RichTbHall* RTbHall,
RichTbComponent* RTbComponent,
RichTbPhotoDetector* RTbPhotoDetector,
RichTbROGeometry* RTbROGeom,
RichTbRunConfig* RConfig){
//For Following variables 0 means make the volume invisible;
// 1 means make it visible as a solid.
// 2 means make it visible as a wireframe.
G4int RichTbHall_vis= RConfig->getRichTbHall_visib();
G4int RichTbEnclosure_vis = RConfig->getRichTbEnclosure_visib() ;
G4int RichTbRadFrame_vis = RConfig->getRichTbRadFrame_visib() ;
G4int RichTbRadUpW_vis = RConfig->getRichTbRadUpW_visib() ;
G4int RichTbRadDnW_vis = RConfig->getRichTbRadDnW_visib() ;
G4int RichTbAerogel_vis = RConfig->getRichTbAerogel_visib() ;
G4int RichTbAerogelWrap_vis = RConfig->getRichTbAerogelWrap_visib() ;
G4int RichTbAerogelWrapTop_vis = RichTbAerogelWrap_vis;
G4int RichTbAerogelWrapBot_vis = RichTbAerogelWrap_vis;
G4int RichTbFilter_vis = RConfig->getRichTbFilter_visib() ;
G4int RichTbMirror_vis = RConfig->getRichTbMirror_visib();
G4int RichTbHpdMaster_vis= RConfig->getRichTbHpdMaster_visib() ;
G4int RichTbHpdEnvelopeTube_vis= RConfig->getRichTbHpdEnvelopeTube_visib();
G4int RichTbHpdQuartzW_vis= RConfig->getRichTbHpdQuartzW_visib() ;
G4int RichTbHpdPhCathode_vis= RConfig->getRichTbHpdPhCathode_visib() ;
G4int RichTbHpdSiDet_vis= RConfig->getRichTbHpdSiDet_visib() ;
G4int RichTbHpdSectCoat_vis =RConfig->getRichTbHpdSectCoat_visib() ;
G4int RichTbHpdSiPx_vis= RConfig->getRichTbHpdSiPx_visib() ;
//
//Now for the RichTbHall
G4LogicalVolume* RichTbHall_LV = RTbHall->getRichTbHallLogicalVolume();
if(RichTbHall_vis == 0 ) {
RichTbHall_LV->SetVisAttributes(G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHall_logVisAtt
= new G4VisAttributes(G4Colour(0.,1.,1.));
if(RichTbHall_vis == 2 ){
RichTbHall_logVisAtt->SetForceWireframe(true);
}
RichTbHall_logVisAtt->SetVisibility(true);
RichTbHall_LV->SetVisAttributes(RichTbHall_logVisAtt);
//
}
//
//
//Now for the RichTbEnclosure
G4LogicalVolume* RichTbEnclosure_LV =
RTbComponent->getEnclosureLogicalVolume();
if(RichTbEnclosure_vis == 0 ){
RichTbEnclosure_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbEnclosure_logVisAtt
= new G4VisAttributes(G4Colour(1.,1.,0.));
if( RichTbEnclosure_vis == 2) {
RichTbEnclosure_logVisAtt->SetForceWireframe(true);
}else {
RichTbEnclosure_logVisAtt->SetForceSolid(true);
}
RichTbEnclosure_logVisAtt->SetVisibility(true);
RichTbEnclosure_LV->
SetVisAttributes(RichTbEnclosure_logVisAtt);
}
//
//Now for the Radiator frame
G4LogicalVolume* RichTbRadFrame_LV =
RTbComponent->getRadFrameLogicalVolume();
if(RichTbRadFrame_vis == 0 ){
RichTbRadFrame_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbRadFrame_logVisAtt
= new G4VisAttributes(G4Colour(1.,1.,0.));
if( RichTbRadFrame_vis == 2) {
RichTbRadFrame_logVisAtt->SetForceWireframe(true);
}else {
RichTbRadFrame_logVisAtt->SetForceSolid(true);
}
RichTbRadFrame_logVisAtt->SetVisibility(true);
RichTbRadFrame_LV->
SetVisAttributes(RichTbRadFrame_logVisAtt);
}
//
//Now for the upstream window of the radiator frame
G4LogicalVolume* RichTbRadUpW_LV =
RTbComponent->getRadUpWLogicalVolume();
if(RichTbRadUpW_vis == 0 ){
RichTbRadUpW_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbRadUpW_logVisAtt
= new G4VisAttributes(G4Colour(0.0,0.3,0.7));
if( RichTbRadUpW_vis == 2) {
RichTbRadUpW_logVisAtt->SetForceWireframe(true);
}else {
RichTbRadUpW_logVisAtt->SetForceSolid(true);
}
RichTbRadUpW_logVisAtt->SetVisibility(true);
RichTbRadUpW_LV->
SetVisAttributes(RichTbRadUpW_logVisAtt);
}
//
// Now for the downstream window of the radiator frame
G4LogicalVolume* RichTbRadDnW_LV =
RTbComponent->getRadDnWLogicalVolume();
if(RichTbRadDnW_vis == 0 ){
RichTbRadDnW_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbRadDnW_logVisAtt
= new G4VisAttributes(G4Colour(0.0,0.2,0.8));
if( RichTbRadDnW_vis == 2) {
RichTbRadDnW_logVisAtt->SetForceWireframe(true);
}else {
RichTbRadDnW_logVisAtt->SetForceSolid(true);
}
RichTbRadDnW_logVisAtt->SetVisibility(true);
RichTbRadDnW_LV->
SetVisAttributes(RichTbRadDnW_logVisAtt);
}
//
//
//Now for the Aerogel
G4int NumTiles=RConfig->GetNumberOfAerogelTiles();
for (G4int ng=0; ng< NumTiles; ng++ ) {
G4LogicalVolume* RichTbAerogel_LV =
RTbComponent->getAgelLogicalVolume(ng);
if(RichTbAerogel_vis == 0 ){
RichTbAerogel_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbAerogel_logVisAtt;
if(ng == 0 || ng == 2 || ng || 4 ) {
RichTbAerogel_logVisAtt = new G4VisAttributes(G4Colour(1.,0.2,0.8));
}else {
RichTbAerogel_logVisAtt = new G4VisAttributes(G4Colour(0.7,0.6,0.9));
}
if( RichTbAerogel_vis == 2) {
RichTbAerogel_logVisAtt->SetForceWireframe(true);
}else {
RichTbAerogel_logVisAtt->SetForceSolid(true);
}
RichTbAerogel_logVisAtt->SetVisibility(true);
RichTbAerogel_LV->
SetVisAttributes(RichTbAerogel_logVisAtt);
}
//Now for the top Wrap of the Aerogel tile.
if( RTbComponent->getAgelWrapTopLogicalVolume(ng)) {
G4LogicalVolume* RichTbAerogelWrapTop_LV =
RTbComponent->getAgelWrapTopLogicalVolume(ng);
if(RichTbAerogelWrapTop_vis == 0 ){
RichTbAerogelWrapTop_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbAerogelWrapTop_logVisAtt;
if(ng == 0 || ng == 2 || ng || 4 ) {
RichTbAerogelWrapTop_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.2,0.6));
}else {
RichTbAerogelWrapTop_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.4,0.8));
}
if( RichTbAerogelWrapTop_vis == 2) {
RichTbAerogelWrapTop_logVisAtt->SetForceWireframe(true);
}else {
RichTbAerogelWrapTop_logVisAtt->SetForceSolid(true);
}
RichTbAerogelWrapTop_logVisAtt->SetVisibility(true);
RichTbAerogelWrapTop_LV->
SetVisAttributes(RichTbAerogelWrapTop_logVisAtt);
}
}
//Now for the Bottom Wrap of the Aerogel tile.
if(RTbComponent->getAgelWrapBotLogicalVolume(ng)){
G4LogicalVolume* RichTbAerogelWrapBot_LV =
RTbComponent->getAgelWrapBotLogicalVolume(ng);
if(RichTbAerogelWrapBot_vis == 0 ){
RichTbAerogelWrapBot_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbAerogelWrapBot_logVisAtt;
if(ng == 0 || ng == 2 || ng || 4 ) {
RichTbAerogelWrapBot_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.2,0.6));
}else {
RichTbAerogelWrapBot_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.4,0.8));
}
if( RichTbAerogelWrapBot_vis == 2) {
RichTbAerogelWrapBot_logVisAtt->SetForceWireframe(true);
}else {
RichTbAerogelWrapBot_logVisAtt->SetForceSolid(true);
}
RichTbAerogelWrapBot_logVisAtt->SetVisibility(true);
RichTbAerogelWrapBot_LV->
SetVisAttributes(RichTbAerogelWrapBot_logVisAtt);
}
}
}
//
//
//Now for the Filter
// First verify that the filter exists.
G4int Filnum=RConfig->GetFilterTNumber() ;
if(Filnum >=0 ) {
G4LogicalVolume* RichTbFilter_LV =
RTbComponent->getFilterLogicalVolume();
if(RichTbFilter_vis == 0 ){
RichTbFilter_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbFilter_logVisAtt
= new G4VisAttributes(G4Colour(0.3,0.9,0.4));
if( RichTbFilter_vis == 2) {
RichTbFilter_logVisAtt->SetForceWireframe(true);
}else {
RichTbFilter_logVisAtt->SetForceSolid(true);
}
RichTbFilter_logVisAtt->SetVisibility(true);
RichTbFilter_LV->
SetVisAttributes(RichTbFilter_logVisAtt);
}
}
//
//
//
//Now for the Mirror
G4LogicalVolume* RichTbMirror_LV =
RTbComponent->getMirrorLogicalVolume();
if(RichTbMirror_vis == 0 ){
RichTbMirror_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbMirror_logVisAtt =
new G4VisAttributes(G4Colour(0.,0.5,0.5));
if(RichTbMirror_vis == 2 ){
RichTbMirror_logVisAtt->SetForceWireframe(true);
}else{
RichTbMirror_logVisAtt->SetForceWireframe(false);
RichTbMirror_logVisAtt->SetForceSolid(true);
}
RichTbMirror_logVisAtt->SetVisibility(true);
RichTbMirror_LV->
SetVisAttributes(RichTbMirror_logVisAtt);
}
//Now for the HPDs.
G4int numhpd= RTbPhotoDetector->getNumberOfHpds();
for(G4int ihpd=0; ihpd<numhpd; ihpd++){
//Now for the HPD master volume
G4LogicalVolume* RichTbHpdMaster_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getHpdLogicalVolume();
if(RichTbHpdMaster_vis == 0 ){
RichTbHpdMaster_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdMaster_logVisAtt =
new G4VisAttributes(G4Colour(0.8,0.6,0.2));
if(RichTbHpdMaster_vis == 2 ){
RichTbHpdMaster_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdMaster_logVisAtt->SetForceWireframe(false);
RichTbHpdMaster_logVisAtt->SetForceSolid(true);
}
RichTbHpdMaster_logVisAtt->SetVisibility(true);
RichTbHpdMaster_LV->
SetVisAttributes(RichTbHpdMaster_logVisAtt);
}
//hpd Envelope Tube
G4LogicalVolume* RichTbHpdEnvelopeTube_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getHpdEnvelopeTubeGrandLogicalVolume();
if(RichTbHpdEnvelopeTube_vis == 0 ){
RichTbHpdEnvelopeTube_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdEnvelopeTube_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.2,0.8));
if(RichTbHpdEnvelopeTube_vis == 2 ){
RichTbHpdEnvelopeTube_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdEnvelopeTube_logVisAtt->SetForceWireframe(false);
RichTbHpdEnvelopeTube_logVisAtt->SetForceSolid(true);
}
RichTbHpdEnvelopeTube_logVisAtt->SetVisibility(true);
RichTbHpdEnvelopeTube_LV->
SetVisAttributes(RichTbHpdEnvelopeTube_logVisAtt);
}
//hpd quartz window
G4LogicalVolume* RichTbHpdQuartzW_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getHpdQuartzWLogicalVolume();
if(RichTbHpdQuartzW_vis == 0 ){
RichTbHpdQuartzW_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdQuartzW_logVisAtt =
new G4VisAttributes(G4Colour(0.8,0.8,0.8));
if(RichTbHpdQuartzW_vis == 2 ){
RichTbHpdQuartzW_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdQuartzW_logVisAtt->SetForceWireframe(false);
RichTbHpdQuartzW_logVisAtt->SetForceSolid(true);
}
RichTbHpdQuartzW_logVisAtt->SetVisibility(true);
RichTbHpdQuartzW_LV->
SetVisAttributes(RichTbHpdQuartzW_logVisAtt);
}
//hpd Ph Cathode
G4LogicalVolume* RichTbHpdPhCathode_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getHpdPhCathodeLogicalVolume();
if(RichTbHpdPhCathode_vis == 0 ){
RichTbHpdPhCathode_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdPhCathode_logVisAtt =
new G4VisAttributes(G4Colour(0.2,0.3,0.3));
if(RichTbHpdPhCathode_vis == 2 ){
RichTbHpdPhCathode_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdPhCathode_logVisAtt->SetForceWireframe(false);
RichTbHpdPhCathode_logVisAtt->SetForceSolid(true);
}
RichTbHpdPhCathode_logVisAtt->SetVisibility(true);
RichTbHpdPhCathode_LV->
SetVisAttributes(RichTbHpdPhCathode_logVisAtt);
}
//Hpd Silicon Detector sectors
for(G4int isect=0; isect<NumberOfSiDetSectors; isect++) {
G4LogicalVolume* RichTbHpdSiDet_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getRichHpdSiDetSect(isect)->
getHpdSiSectLogicalVolume();
if(RichTbHpdSiDet_vis == 0 ){
RichTbHpdSiDet_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdSiDet_logVisAtt =
new G4VisAttributes(G4Colour(0.6,0.6,0.9));
if(RichTbHpdSiDet_vis == 2 ){
RichTbHpdSiDet_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdSiDet_logVisAtt->SetForceWireframe(false);
RichTbHpdSiDet_logVisAtt->SetForceSolid(true);
}
RichTbHpdSiDet_logVisAtt->SetVisibility(true);
RichTbHpdSiDet_LV->
SetVisAttributes(RichTbHpdSiDet_logVisAtt);
}
//Coating on the silicon sector
G4LogicalVolume* RichTbHpdSectCoat_LV =
RTbPhotoDetector->getRichHPD(ihpd)->getRichHpdSiDetSect(isect)->
getHpdSectCoatLogicalVolume();
if(RichTbHpdSectCoat_vis == 0 ){
RichTbHpdSectCoat_LV->
SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdSectCoat_logVisAtt =
new G4VisAttributes(G4Colour(0.8,0.3,0.9));
if(RichTbHpdSectCoat_vis == 2 ){
RichTbHpdSectCoat_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdSectCoat_logVisAtt->SetForceWireframe(false);
RichTbHpdSectCoat_logVisAtt->SetForceSolid(true);
}
RichTbHpdSectCoat_logVisAtt->SetVisibility(true);
RichTbHpdSectCoat_LV->
SetVisAttributes(RichTbHpdSectCoat_logVisAtt);
}
G4int numPix=RTbROGeom -> getROPhotDet()-> getRichHPD(ihpd) ->
getRichHpdSiDetSect(isect) ->getNumSiPixels();
for(G4int ipixel=0; ipixel<numPix ; ipixel++){
G4LogicalVolume* RichTbHpdSiPx_LV=
RTbROGeom -> getROPhotDet() -> getRichHPD(ihpd) ->
getRichHpdSiDetSect(isect) -> getHpdSiPx(ipixel) ->
getHpdSiPixelLogicalVolume();
if(RichTbHpdSiPx_vis == 0 ){
RichTbHpdSiPx_LV->SetVisAttributes (G4VisAttributes::Invisible);
}else {
G4VisAttributes* RichTbHpdSiPx_logVisAtt =
new G4VisAttributes(G4Colour(0.0,0.7,0.6));
if(RichTbHpdSiPx_vis == 2 ){
RichTbHpdSiPx_logVisAtt->SetForceWireframe(true);
}else{
RichTbHpdSiPx_logVisAtt->SetForceWireframe(false);
RichTbHpdSiPx_logVisAtt->SetForceSolid(true);
}
RichTbHpdSiPx_logVisAtt->SetVisibility(true);
RichTbHpdSiPx_LV-> SetVisAttributes(RichTbHpdSiPx_logVisAtt);
}
}
}
}
}
RichTbGraphics::~RichTbGraphics(){;}
+56
View File
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbHall.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "RichTbDetectorConstruction.hh"
#include "RichTbHall.hh"
#include "RichTbMaterial.hh"
#include "RichTbGeometryParameters.hh"
#include "G4Box.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
RichTbHall::RichTbHall() { ; }
RichTbHall::RichTbHall(RichTbMaterial* RMaterial) {
G4Box * RichTbHallBox
= new G4Box("World",ExpHallHalfX,ExpHallHalfY,ExpHallHalfZ);
G4LogicalVolume * RichTbHallLog
= new G4LogicalVolume(RichTbHallBox,RMaterial->getAir(),"World",0,0,0);
G4VPhysicalVolume * RichTbHallPhys
= new G4PVPlacement(0,G4ThreeVector(),"World",RichTbHallLog,0,false,0);
RichTbHallLVol = RichTbHallLog;
RichTbHallPVol = RichTbHallPhys;
}
RichTbHall::~RichTbHall() {; }
+123
View File
@@ -0,0 +1,123 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbHit.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbHit.hh"
#include "G4VVisManager.hh"
#include "G4Circle.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4Transform3D.hh"
#include "G4LogicalVolume.hh"
#include "RichTbVisManager.hh"
#include "G4Transform3D.hh"
G4Allocator<RichTbHit> RichTbHitAllocator;
RichTbHit::RichTbHit()
{;}
RichTbHit::~RichTbHit()
{;}
RichTbHit::RichTbHit(const RichTbHit &right)
{
edep = right.edep;
posAtSilicon = right.posAtSilicon;
posAtPhotoCathode=right.posAtPhotoCathode;
CurHpdNum=right.CurHpdNum;
CurSectNum=right.CurSectNum;
CurPixelNum=right.CurPixelNum;
}
const RichTbHit& RichTbHit::operator=(const RichTbHit &right)
{
edep = right.edep;
posAtSilicon = right.posAtSilicon;
posAtPhotoCathode=right.posAtPhotoCathode;
CurHpdNum=right.CurHpdNum;
CurSectNum=right.CurSectNum;
CurPixelNum=right.CurPixelNum;
return *this;
}
int RichTbHit::operator==(const RichTbHit &right) const
{
return 0;
}
void RichTbHit::Draw()
{
// The folowing does not work anymore .. SE 26-04-01
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Transform3D dummy;
G4Circle circle(posAtPhotoCathode);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.0,0.0,0.0);
G4VisAttributes attribs(colour);
circle.SetVisAttributes(attribs);
pVVisManager->Draw(circle,dummy);
}
}
void RichTbHit::DrawWithVisM(RichTbVisManager* pVisManager)
{
G4VisManager* pVVisManager = pVisManager;
if(pVVisManager)
{
G4Transform3D dummy2;
G4Circle circle(posAtPhotoCathode);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.0,0.0,0.0);
G4VisAttributes attribs(colour);
circle.SetVisAttributes(attribs);
pVVisManager->Draw(circle,dummy2);
}
}
void RichTbHit::Print()
{;}
// This is a forward declarations of an instantiated G4Allocator<Type> object.
// It has been added in order to make code portable for the GNU g++
// (release 2.7.2) compiler.
// Whenever a new Type is instantiated via G4Allocator, it has to be forward
// declared to make object code (compiled with GNU g++) link successfully.
//
#ifdef GNU_GCC
template class G4Allocator<RichTbHit>;
#endif
+290
View File
@@ -0,0 +1,290 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbHpd.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "globals.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4Cons.hh"
#include "G4Tubs.hh"
#include "G4Sphere.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4UnionSolid.hh"
#include "RichTbGeometryParameters.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4OpticalSurface.hh"
#include "G4SDManager.hh"
#include "RichTbSD.hh"
#include "RichTbHpd.hh"
RichTbHpd::RichTbHpd() {; }
RichTbHpd::~RichTbHpd() { ; }
RichTbHpd::RichTbHpd(RichTbMaterial* RMaterial,
G4VPhysicalVolume* MotherOfHpd, G4int ihpd,
G4int NumberofSectorsInHpd,
G4bool ConstructTrackingGeomSwitch){
HpdNumber=ihpd;
NumSectInHpd= NumberofSectorsInHpd;
ConstructTrackGeomSwitch=ConstructTrackingGeomSwitch;
G4Tubs* HpdMaster=
new G4Tubs("HPDMaster",HpdMasterInnerRad,
HpdMasterRad,HpdMasterHalfZ,
HpdMasterStartPhi,HpdMasterEndPhi);
//Overall rotations of the HPD
G4RotationMatrix HpdMasterRotationX,HpdMasterRotationY;
G4RotationMatrix HpdMasterRotationZ;
HpdMasterRotationZ.rotateZ(HpdMasterRotZ[ihpd]);
G4ThreeVector HpdMasterTrsl(HpdMasterPosX[ihpd],HpdMasterPosY[ihpd],
HpdMasterPosZ[ihpd]);
G4Transform3D HpdMasterTransform(HpdMasterRotationZ,
HpdMasterTrsl);
//Now for the placements of the HpdMaster
// use vacuum . the photoelectrons travel in vacuum. hence
// just for simplicity the the hpdmaster is set as vacuum.
G4LogicalVolume* HpdMasterLog=
new G4LogicalVolume(HpdMaster,RMaterial->getVacuum(),
"HpdMaster",0,0,0);
G4VPhysicalVolume* HpdMasterPhys=
new G4PVPlacement(HpdMasterTransform,"HpdMaster",
HpdMasterLog, MotherOfHpd ,false,HpdNumber);
//Now create the Silicon Detector sectors inside the HPD.
for (G4int isec=0; isec<NumberOfSiDetSectors; isec++){
richSiliconDetectorSect[isec] = new RichTbSiDet(RMaterial,HpdMasterPhys,
ConstructTrackGeomSwitch,ihpd,isec);
}
//Now for the rest of the components of the HPD
if(ConstructTrackingGeomSwitch) {
G4Tubs* HpdEnvelopeLargeTube=
new G4Tubs("HpdEnvelopeLargeTube",HpdEnvelopeLargeTubeInnerRad,
HpdEnvelopeLargeTubeOuterRad,HpdEnvelopeLargeTubeHalfZ,
HpdEnvelopeLargeTubeStartPhi, HpdEnvelopeLargeTubeEndPhi);
G4Cons* HpdEnvelopeCone =
new G4Cons("HpdEnvelopeCone",HpdEnvelopeConeInnerR1,
HpdEnvelopeConeOuterR1,HpdEnvelopeConeInnerR2,
HpdEnvelopeConeOuterR2,HpdEnvelopeConeHalfZ,
HpdEnvelopeConeStartPhi,HpdEnvelopeConeEndPhi);
G4Tubs* HpdEnvelopeSmallTube=
new G4Tubs("HpdEnvelopeSmallTube",HpdEnvelopeSmallTubeInnerRad,
HpdEnvelopeSmallTubeOuterRad,HpdEnvelopeSmallTubeHalfZ,
HpdEnvelopeSmallTubeStartPhi, HpdEnvelopeSmallTubeEndPhi);
G4Tubs* HpdEnvelopeEndCap=
new G4Tubs("HpdEnvelopeEndcap",HpdEnvelopeEndCapInnerRad,
HpdEnvelopeEndCapRad,
HpdEnvelopeEndCapHalfZ,HpdEnvelopeEndCapStartPhi,
HpdEnvelopeEndCapEndPhi);
G4Sphere* HpdQuartzWindowSphereseg =
new G4Sphere("HpdQuartzWindow", HpdQuarzWindowRInner,
HpdQuarzWindowROuter,HpdQuartzWStartPhi,
HpdQuartzWPhiSize,HpdQuartzWStartTheta,
HpdQuartzWThetaSize);
G4Sphere* HpdPhCathodeSphereseg =
new G4Sphere("HpdPhCathodeWindow", HpdPhCathodeRInner,
HpdPhCathodeROuter,HpdPhCathodeStartPhi,
HpdPhCathodePhiSize,HpdPhCathodeStartTheta,
HpdPhCathodeThetaSize);
//rotations and translations
//Define Rotations for the HPD components
// even if they have no real rotations.
G4RotationMatrix HpdEnvelopeLargeTubeRotation,
HpdEnvelopeConeRotation,
HpdEnvelopeSmallTubeRotation;
G4RotationMatrix HpdEnvelopeEndCapRotation,HpdQuartzWRotation;
G4RotationMatrix HpdPhCathodeRotation;
G4ThreeVector HpdEnvelopeLargeTubeTrsl(HpdEnvelopeLargeTubePosX,
HpdEnvelopeLargeTubePosY,
HpdEnvelopeLargeTubePosZ);
G4Transform3D HpdEnvelopeLargeTubeTransform(HpdEnvelopeLargeTubeRotation,
HpdEnvelopeLargeTubeTrsl);
G4ThreeVector HpdEnvelopeConeTrsl(HpdEnvelopeConeShiftX,
HpdEnvelopeConeShiftY,
HpdEnvelopeConeShiftZ);
G4Transform3D HpdEnvelopeConeTransform(HpdEnvelopeConeRotation,
HpdEnvelopeConeTrsl);
G4ThreeVector HpdEnvelopeSmallTubeTrsl(HpdEnvelopeSmallTubeShiftX,
HpdEnvelopeSmallTubeShiftY,
HpdEnvelopeSmallTubeShiftZ);
G4Transform3D HpdEnvelopeSmallTubeTransform(HpdEnvelopeSmallTubeRotation,
HpdEnvelopeSmallTubeTrsl);
G4ThreeVector HpdEnvelopeEndCapTrsl(HpdEnvelopeEndCapShiftX,
HpdEnvelopeEndCapShiftY,
HpdEnvelopeEndCapShiftZ);
G4Transform3D HpdEnvelopeEndCapTransform(HpdEnvelopeEndCapRotation,
HpdEnvelopeEndCapTrsl);
G4ThreeVector HpdQuartzWTrsl(HpdQuartzWPosX,
HpdQuartzWPosY,
HpdQuartzWPosZ);
G4Transform3D HpdQuartzWTransform(HpdQuartzWRotation,
HpdQuartzWTrsl);
G4ThreeVector HpdPhCathodeTrsl(HpdPhCathodePosX,
HpdPhCathodePosY,
HpdPhCathodePosZ);
G4Transform3D HpdPhCathodeTransform(HpdPhCathodeRotation,
HpdPhCathodeTrsl);
//Now for the placements
G4UnionSolid* HpdEnvelopeTubeLC =
new G4UnionSolid("HpdEnvelopeTubeLC", HpdEnvelopeLargeTube,
HpdEnvelopeCone,
HpdEnvelopeConeTransform);
G4LogicalVolume* HpdEnvelopeTubeLCLog=
new G4LogicalVolume(HpdEnvelopeTubeLC,RMaterial->getHpdTubeMaterial(),
"HpdEnvelopeTubeLC",0,0,0);
G4UnionSolid* HpdEnvelopeTubeLCS =
new G4UnionSolid("HpdEnvelopeTubeLCS", HpdEnvelopeTubeLC,
HpdEnvelopeSmallTube,
HpdEnvelopeSmallTubeTransform);
G4LogicalVolume* HpdEnvelopeTubeLCSLog=
new G4LogicalVolume(HpdEnvelopeTubeLCS,RMaterial->getHpdTubeMaterial(),
"HpdEnvelopeTubeLCS",0,0,0);
G4UnionSolid* HpdEnvelopeTubeGrand =
new G4UnionSolid("HpdEnvelopeTubeGrand", HpdEnvelopeTubeLCS,
HpdEnvelopeEndCap,HpdEnvelopeEndCapTransform);
G4LogicalVolume* HpdEnvelopeTubeGrandLog=
new G4LogicalVolume(HpdEnvelopeTubeGrand,RMaterial->getHpdTubeMaterial(),
"HpdEnvelopeTubeGrand",0,0,0);
//
//
G4LogicalVolume* HpdQuartzWindowLog=
new G4LogicalVolume( HpdQuartzWindowSphereseg,
RMaterial->getPadHpdQuartzWMaterial(),
"HpdQuartzWindow",0,0,0);
G4LogicalVolume* HpdPhCathodeLog=
new G4LogicalVolume( HpdPhCathodeSphereseg,
RMaterial->getPadHpdPhCathodeMaterial(),
"HpdPhCathode",0,0,0);
//
//
G4VPhysicalVolume* HpdEnvelopeTubeGrandPhys=
new G4PVPlacement(HpdEnvelopeLargeTubeTransform,
"HpdEnvelopeTubeGrand",
HpdEnvelopeTubeGrandLog,HpdMasterPhys,false,HpdNumber);
G4VPhysicalVolume* HpdQuartzWindowPhys=
new G4PVPlacement(HpdQuartzWTransform,"HpdQuartzWindow",
HpdQuartzWindowLog,HpdMasterPhys,false,HpdNumber);
G4VPhysicalVolume* HpdPhCathodePhys=
new G4PVPlacement(HpdPhCathodeTransform,"HpdPhCathode",
HpdPhCathodeLog,HpdMasterPhys,false,HpdNumber);
G4LogicalBorderSurface* HpdQuartzWSurface =
new G4LogicalBorderSurface("HpdQuartzWSurface",HpdMasterPhys,
HpdQuartzWindowPhys,
RMaterial->getOpticalHpdTQuartzWSurface());
G4LogicalBorderSurface* HpdQPhCathodeSurface =
new G4LogicalBorderSurface("HpdQPhCathodeSurface",HpdQuartzWindowPhys,
HpdPhCathodePhys,
RMaterial->getOpticalHpdQuartzWPhCathodeSurface());
G4LogicalBorderSurface* HpdPhCathodeQSurface =
new G4LogicalBorderSurface("HpdQPhCathodeSurface", HpdPhCathodePhys,
HpdQuartzWindowPhys,
RMaterial->getOpticalHpdQuartzWPhCathodeSurface());
//change made on 26-9-01 SE to make photocathode transparent.
// G4LogicalSkinSurface* HpdPhCathodeSkinSurface =
// new G4LogicalSkinSurface("HpdPhCathodeSkinSurface",
// HpdPhCathodeLog,
// RMaterial->getOpticalPhCathodeSkinSurface());
G4LogicalBorderSurface* HpdPhCathodeMasterSurface =
new G4LogicalBorderSurface("HpdPhCathodeMasterSurface",
HpdPhCathodePhys,HpdMasterPhys,
RMaterial->getOpticalPhCathodeBorderSurface());
G4LogicalBorderSurface* HpdMasterPhCathodeSurface =
new G4LogicalBorderSurface("HpdMasterPhCathodeSurface",
HpdMasterPhys,HpdPhCathodePhys,
RMaterial->getOpticalPhCathodeBorderSurface());
G4LogicalBorderSurface* HpdEnvelopeSurface =
new G4LogicalBorderSurface("HpdEnvelopeSurface",HpdMasterPhys,
HpdEnvelopeTubeGrandPhys,
RMaterial->getOpticalHpdMetalSurface());
RichTbHpdEnvelopeTubeGrandLVol=HpdEnvelopeTubeGrandLog;
RichTbHpdEnvelopeTubeGrandPVol=HpdEnvelopeTubeGrandPhys;
RichTbHpdQuartzWLVol=HpdQuartzWindowLog;
RichTbHpdQuartzWPVol=HpdQuartzWindowPhys;
RichTbPhCathodeLVol=HpdPhCathodeLog;
RichTbPhCathodePVol=HpdPhCathodePhys;
}
RichTbHpdLVol=HpdMasterLog;
RichTbHpdPVol=HpdMasterPhys;
}
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbIOData.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbIOData.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "RichTbHit.hh"
#include <fstream>
RichTbIOData::RichTbIOData(RichTbRunConfig* RConfig )
:OutputDataFS((RConfig -> getOutputFileName()).c_str())
{
aOutFileString=RConfig -> getOutputFileName();
}
RichTbIOData::~RichTbIOData() { }
void RichTbIOData::WriteOutEventHeaderData( const G4Event* evt ) { }
void RichTbIOData::WriteOutHitData( const G4Event* evt ) {
G4SDManager * SDman = G4SDManager::GetSDMpointer();
G4String colNam;
G4int RichTbCID = SDman->GetCollectionID(colNam="RichTbHitsCollection");
if(RichTbCID<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RichTbHitsCollection* RHC = NULL;
if(HCE)
{
RHC = (RichTbHitsCollection*)(HCE->GetHC(RichTbCID));
}
if(RHC)
{
G4int n_hit = RHC->entries();
G4cout << " " << n_hit << "Hits being written out "<<G4endl;
// OutputDataFS<<n_hit<<G4endl;
for (G4int ih=0; ih<n_hit; ih++ ) {
RichTbHit* aHit = (*RHC)[ih];
G4int aHitHpdNum = aHit -> GetCurHpdNum();
G4int aHitSectNum = aHit -> GetCurSectNum();
G4int aHitPixelNum = aHit -> GetCurPixNum();
G4ThreeVector aHitPosPC = aHit -> GetPosPC();
OutputDataFS<<" "<< aHitHpdNum<<" "<< aHitSectNum
<<" "<<aHitPixelNum
<<" "<< aHitPosPC.x()<<" "<< aHitPosPC.y()
<<" "<< aHitPosPC.z()<<G4endl;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,234 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbMaterialParameters.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <fstream.h>
#include "globals.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbMaterialParameters.hh"
#include "FilterTrData.hh"
#include "AerogelTypeSpec.hh"
#include "RichTbAnalysisManager.hh"
void InitializeRichTbMaterial(){
}
vector<G4double> InitializePhotonMomentumVector() {
G4double PhotonEnergyStep=(PhotonMaxEnergy-PhotonMinEnergy)/
NumPhotWaveLengthBins;
vector<G4double>PhotMomVect(NumPhotWaveLengthBins);
for (G4int ibin=0; ibin<NumPhotWaveLengthBins; ibin++){
PhotMomVect[ibin]=PhotonMinEnergy+PhotonEnergyStep*ibin;
}
return PhotMomVect;
}
vector<G4double> InitN2RefIndex(G4double pressure, G4double temperature){
vector<G4double> PmV=InitN2RefPhotW();
vector<G4double> RefN2(NumPhotWaveLengthBins);
G4double GasRhoN2Cur=GasRhoN2atSTP*(GasTemperature_STP/temperature)*
(pressure/ GasPressure_STP);
G4double epho,pfe,cpfe;
for(G4int ibinwn =0; ibinwn<NumPhotWaveLengthBins ; ibinwn++ ){
epho = PmV[ibinwn]/eV;
pfe = SellN2F1/(SellN2E1*SellN2E1 - epho*epho ) +
SellN2F2/(SellN2E2*SellN2E2 - epho*epho );
cpfe=0.3738*(GasRhoN2Cur/GasMolWeightN2)*pfe;
RefN2[ibinwn]=pow((1.0+2*cpfe)/(1.0-cpfe),0.5);
}
return RefN2;
}
vector<G4double> InitN2RefPhotW() {
return InitializePhotonMomentumVector() ;
}
vector<G4double> InitAgelPhotW() {
return InitializePhotonMomentumVector() ;
}
vector<G4double> InitializeHpdQE(G4int ihpdqe) {
// Initialize the HPD QE
G4int iqb;
if(ihpdqe >= NumHpdTot ) {
G4cout<<"Wrong HPD Number for QE " <<ihpdqe<<" vs "
<<NumHpdTot <<G4endl;
}
vector<G4double>qeCurPerCent(NumQEbins);
if(ihpdqe == 0 ){
for(iqb=0; iqb<NumQEbins; iqb++){
qeCurPerCent[iqb] = Hpd0QEPerCent[iqb]* HpdQEReductionFactor;
}
}
if(ihpdqe == 1 ){
for(iqb=0; iqb<NumQEbins; iqb++){
qeCurPerCent[iqb] = Hpd1QEPerCent[iqb]* HpdQEReductionFactor;
}
}
if(ihpdqe == 2 ){
for(iqb=0; iqb<NumQEbins; iqb++){
qeCurPerCent[iqb] = Hpd2QEPerCent[iqb]* HpdQEReductionFactor;
}
}
if(ihpdqe == 3 ){
for(iqb=0; iqb<NumQEbins; iqb++){
qeCurPerCent[iqb] = Hpd3QEPerCent[iqb]* HpdQEReductionFactor;
}
}
return qeCurPerCent;
}
vector<G4double> InitializeHpdWaveL(G4int ihpdqe) {
G4int iqb;
if(ihpdqe >= NumHpdTot ) {
G4cout<<"Wrong HPD Number for QE wavelength " <<ihpdqe<<" vs "
<<NumHpdTot <<G4endl;
}
// for now all HPDs have the same wavelength bins.
vector<G4double>HpdQEW(NumQEbins);
for (iqb=0; iqb<NumQEbins; iqb++){
HpdQEW[iqb]= HpdQEWaveL[iqb];
}
return HpdQEW;
}
void HistoRichTbMaterialProperties(RichTbRunConfig* RConfig) {
G4int AerogelNum=0;
G4double waL=200;
G4double stepsize=7.0;
G4double thickness=(GetCurAerogelLength(AerogelNum))/cm;
AerogelType CurAerogelType=RConfig-> GetCurAerogelType(AerogelNum);
G4double Aparam, Cparam;
if(CurAerogelType == AerogelTypeA ) {
Aparam = AerogelTypeATotTrans;
Cparam = AerogelTypeAClarity*cm/(micrometer*micrometer*micrometer*micrometer);
}
for(G4int Iabin=0; Iabin<100; Iabin ++ ) {
G4double waLInmu = waL/1000.0;
G4double Aetr = Aparam* exp(-Cparam * thickness / pow(waLInmu,4) );
waL += stepsize;
}
G4int ihpdqa;
ihpdqa=0;
vector<G4double>WaveL1 = InitializeHpdWaveL(ihpdqa);
vector<G4double>QEff1 = InitializeHpdQE(ihpdqa);
}
vector<G4int> getDeadPixelList(G4int ihpdNum, G4int isectNum){
vector<G4int>DeadPixelList;
G4int isc,ipsc;
if(DeadPixelList.size() > MaxNumDeadPixelPerHpdSect ){
G4cout<<" Too Many dead Pixels in Hpd "<<DeadPixelList.size()
<<" in Hpd "<<ihpdNum<<G4endl;
}
return DeadPixelList;
}
vector<G4double>GetAerogelRScatLength(AerogelType CurrentAerogelType) {
vector<G4double>AgelRayleighScatLength(NumPhotWaveLengthBins);
vector<G4double>AgelPhotW = InitAgelPhotW();
G4double aClarity;
if(CurrentAerogelType == AerogelTypeA ) {
aClarity=AerogelTypeAClarity/(micrometer*micrometer*micrometer*micrometer);
}else if (CurrentAerogelType == AerogelTypeB ) {
aClarity=AerogelTypeBClarity/(micrometer*micrometer*micrometer*micrometer);
}else if (CurrentAerogelType == AerogelTypeC ) {
aClarity=AerogelTypeCClarity/(micrometer*micrometer*micrometer*micrometer);
}else if (CurrentAerogelType == AerogelTypeD ) {
aClarity=AerogelTypeDClarity/(micrometer*micrometer*micrometer*micrometer);
}else if (CurrentAerogelType == AerogelTypeE ) {
aClarity=AerogelTypeEClarity/(micrometer*micrometer*micrometer*micrometer);
}else {G4cout<<"Unknown Aerogel Type for Rayleigh Scat Length "<<endl; }
if(aClarity != 0.0 ) {
for(G4int ibinw=0; ibinw<NumPhotWaveLengthBins; ibinw++ ){
G4double ephoton=AgelPhotW[ibinw]/eV;
//In the following the 1000 is to convert form nm to micrometer
G4double wphoton=(PhotMomWaveConv/ephoton)/1000.0;
AgelRayleighScatLength[ibinw]=(pow(wphoton,4))/aClarity;
}
}
return AgelRayleighScatLength;
}
G4double GetCurrentBulkTrans(G4double currentMatRefIndex,
G4double currentNeighbourRefIndex,
G4double MaxTotMeasuredTransmission){
G4double ATrans=MaxTotMeasuredTransmission;
G4double ePhot;
// in the following the energy of the photon is not used since
// it is only an approximate calulation.
G4double na= currentMatRefIndex;
G4double nb= currentNeighbourRefIndex;
G4double LossAtEntrance=pow(((na-nb)/(na+nb)),2.0);
G4double LossAtExit=pow(((nb-na)/(nb+na)),2.0);
G4double LightLossAtExternalSurface= LossAtEntrance+ LossAtExit;
ATrans += LightLossAtExternalSurface;
if(ATrans >= 1.0) ATrans=1.0;
return ATrans;
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbPhotoDetector.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <fstream.h>
#include "globals.hh"
#include "RichTbPhotoDetector.hh"
#include "G4VPhysicalVolume.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbSiDet.hh"
#include "RichTbSiPixel.hh"
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
RichTbPhotoDetector::RichTbPhotoDetector() {;}
RichTbPhotoDetector::RichTbPhotoDetector(RichTbMaterial* RMaterial,
RichTbComponent* RTbComponent, RichTbRunConfig* rConfig,
G4bool ConstructTrackingSwitch){
ConstructTrackingGeometrySwitch=ConstructTrackingSwitch;
G4VPhysicalVolume* EnclosurePhys=
RTbComponent-> getEnclosurePhysicalVolume();
//Now for the Individual HPDS
NumOfHpds=NumberOfHpds;
//Normally all hpds have the same number of Si sectors.
G4int NumSect= NumberOfSiDetSectors;
// Loop through the HPDs
for(G4int ihpd=0; ihpd<NumberOfHpds; ihpd++){
// create the HPDs
richHPD[ihpd] = new RichTbHpd(RMaterial,EnclosurePhys,ihpd,NumSect,
ConstructTrackingGeometrySwitch);
}
}
RichTbPhotoDetector::~RichTbPhotoDetector(){ ; }
@@ -0,0 +1,293 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbPhysicsList.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "G4ios.hh"
#include <iomanip>
#include "globals.hh"
#include "RichTbPhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ParticleTable.hh"
#include "G4VUserPhysicsList.hh"
#include "G4ParticleTable.hh"
#include "G4UserPhysicsListMessenger.hh"
#include "G4UImanager.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4UnitsTable.hh"
RichTbPhysicsList::RichTbPhysicsList(RichTbRunConfig* RConfig)
: G4VUserPhysicsList() {
G4cout<<" Now define the physics List"<<G4endl;
rConfigPh = RConfig;
defaultCutValue = 0.1*mm;
// pointer to the particle table
theParticleTable = G4ParticleTable::GetParticleTable();
theParticleIterator = theParticleTable->GetIterator();
}
RichTbPhysicsList::RichTbPhysicsList() :G4VUserPhysicsList(){
// pointer to the particle table
theParticleTable = G4ParticleTable::GetParticleTable();
theParticleIterator = theParticleTable->GetIterator();
}
RichTbPhysicsList::~RichTbPhysicsList() {}
void RichTbPhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
void RichTbPhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
void RichTbPhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
void RichTbPhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
}
void RichTbPhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
void RichTbPhysicsList::ConstructProcess()
{
AddTransportation();
ConstructGeneral();
ConstructEM();
ConstructOp();
}
#include "G4Decay.hh"
void RichTbPhysicsList::ConstructGeneral()
{
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager->AddDiscreteProcess(theDecayProcess);
}
}
}
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
#include "HpdSiEnergyLoss.hh"
void RichTbPhysicsList::ConstructEM()
{
theParticleIterator->reset();
G4cout<<" Now creating EM processes"<<G4endl;
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
HpdSiEnergyLoss* HpdSiEnergyLossProcess =
new HpdSiEnergyLoss("Silicon","HpdSiEnergyLoss");
pmanager->AddProcess( HpdSiEnergyLossProcess ,-1,2,2);
if (particleName == "gamma") {
// gamma
// Construct processes for gamma
pmanager->AddDiscreteProcess(new G4GammaConversion());
pmanager->AddDiscreteProcess(new G4ComptonScattering());
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
} else if (particleName == "e-") {
//electron
//Construct processes for electron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
// Construct processes for muon
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
// all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
}
}
}
}
#include "G4Cerenkov.hh"
#include "G4OpAbsorption.hh"
#include "G4OpRayleigh.hh"
#include "G4OpBoundaryProcess.hh"
#include "PadHpdPhotoElectricEffect.hh"
#include "RichTbMaterialParameters.hh"
void RichTbPhysicsList::ConstructOp()
{
G4cout<<"Now creating Optical processes"<<G4endl;
G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
G4cout<<"Now creating the Rayleigh scattering process "<<G4endl;
G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
G4cout<<"Now creating the boundary process "<<G4endl;
G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
PadHpdPhotoElectricEffect* theHpdPhotoElectricProcess=
new PadHpdPhotoElectricEffect("PadHpdPhot",rConfigPh);
theCerenkovProcess->SetVerboseLevel(0);
theAbsorptionProcess->SetVerboseLevel(0);
theRayleighScatteringProcess->SetVerboseLevel(0);
theBoundaryProcess->SetVerboseLevel(0);
G4int MaxNumPhotons = 300;
theCerenkovProcess->SetTrackSecondariesFirst(true);
theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
G4OpticalSurfaceModel themodel = unified;
theBoundaryProcess->SetModel(themodel);
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (theCerenkovProcess->IsApplicable(*particle)) {
pmanager->AddContinuousProcess(theCerenkovProcess);
}
if (particleName == "opticalphoton") {
G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
pmanager->AddDiscreteProcess(theAbsorptionProcess);
pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
pmanager->AddDiscreteProcess(theBoundaryProcess);
pmanager->AddDiscreteProcess(theHpdPhotoElectricProcess);
}
}
}
void RichTbPhysicsList::SetCuts()
{
if (verboseLevel >1){
G4cout << "RichTbPhysicsList::SetCuts:";
}
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
}
@@ -0,0 +1,156 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbAnalysisManager.cc for Rich of LHCb
// History:
// Created: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "G4Timer.hh"
#include "RichTbPrimaryGeneratorAction.hh"
#include "RichTbDetectorConstruction.hh"
#include "RichTbPrimaryGeneratorMessenger.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4String RichTbPrimaryGeneratorAction::thePrimaryParticleName="proton" ;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbPrimaryGeneratorAction::RichTbPrimaryGeneratorAction(
RichTbDetectorConstruction* RichTbDC)
:RichTbDetector(RichTbDC),rndmFlag("off"),xvertex(0.),yvertex(0.),zvertex(0.),
vertexdefined(false)
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new RichTbPrimaryGeneratorMessenger(this);
// default particle kinematic
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="proton");
particleGun->SetParticleDefinition(particle);
thePrimaryParticleName = particle->GetParticleName() ;
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.1,0.2,1.));
particleGun->SetParticleEnergy(100.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(xvertex,yvertex,zvertex));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbPrimaryGeneratorAction::~RichTbPrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void RichTbPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
thePrimaryParticleName = particleGun->GetParticleDefinition()->
GetParticleName() ;
G4double x0,y0,z0 ;
G4double x1,y1,z1 ;
if(vertexdefined)
{
x1 = 0. ;
y1 = 0. ;
z1 = 1. ;
x0 = xvertex ;
y0 = yvertex ;
z0 = zvertex ;
}
else
{
x1 = 0. ;
y1 = 0. ;
z1 = 1. ;
x0 = 0. ;
y0 = 0. ;
z0 = 0. ; // -0.5*(RichTbDetector->GetWorldSizeZ()) ;
}
G4double r0,phi0 ;
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
}
///////////////////////////////////////////////////////////////////////
//
//
G4String RichTbPrimaryGeneratorAction::GetPrimaryName()
{
return thePrimaryParticleName ;
}
void RichTbPrimaryGeneratorAction::Setxvertex(G4double x)
{
vertexdefined = true ;
xvertex = x ;
G4cout << " X coordinate of the primary vertex = " << xvertex/mm <<
" mm." << G4endl;
}
void RichTbPrimaryGeneratorAction::Setyvertex(G4double y)
{
vertexdefined = true ;
yvertex = y ;
G4cout << " Y coordinate of the primary vertex = " << yvertex/mm <<
" mm." << G4endl;
}
void RichTbPrimaryGeneratorAction::Setzvertex(G4double z)
{
vertexdefined = true ;
zvertex = z ;
G4cout << " Z coordinate of the primary vertex = " << zvertex/mm <<
" mm." << G4endl;
}
@@ -0,0 +1,89 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbPrimaryGeneratorMessenger.cc for Rich of LHCb
// History:
// Created: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbPrimaryGeneratorMessenger.hh"
#include "RichTbPrimaryGeneratorAction.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbPrimaryGeneratorMessenger::RichTbPrimaryGeneratorMessenger(RichTbPrimaryGeneratorAction* RichTbGun)
:RichTbAction(RichTbGun)
{
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
RndmCmd->SetGuidance(" Choice : on, off(default)");
RndmCmd->SetParameterName("choice",true);
RndmCmd->SetDefaultValue("off");
RndmCmd->SetCandidates("on off");
RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
setxvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
setxvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
setxvertexCmd->SetParameterName("xv",true);
setxvertexCmd->SetDefaultValue(0.0*mm) ;
setyvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
setyvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
setyvertexCmd->SetParameterName("yv",true);
setyvertexCmd->SetDefaultValue(0.0*mm) ;
setzvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
setzvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
setzvertexCmd->SetParameterName("zv",true);
setzvertexCmd->SetDefaultValue(0.0*mm) ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbPrimaryGeneratorMessenger::~RichTbPrimaryGeneratorMessenger()
{
delete RndmCmd;
delete setxvertexCmd;
delete setyvertexCmd;
delete setzvertexCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void RichTbPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command == RndmCmd )
{ RichTbAction->SetRndmFlag(newValue);}
if( command == setxvertexCmd)
{ RichTbAction->Setxvertex(setxvertexCmd->GetNewDoubleValue(newValue));}
if( command == setyvertexCmd)
{ RichTbAction->Setyvertex(setyvertexCmd->GetNewDoubleValue(newValue));}
if( command == setzvertexCmd)
{ RichTbAction->Setzvertex(setzvertexCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbROGeometry.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbROGeometry.hh"
RichTbROGeometry::RichTbROGeometry(RichTbMaterial* RMaterial,
RichTbRunConfig* RConfig)
: G4VReadOutGeometry() {
rMaterial=RMaterial;
ROTbConfig=RConfig;
}
RichTbROGeometry::RichTbROGeometry(G4String aString,
RichTbMaterial* RMaterial,
RichTbRunConfig* RConfig)
: G4VReadOutGeometry(aString ) {
rMaterial=RMaterial;
ROTbConfig=RConfig;
}
RichTbROGeometry::~RichTbROGeometry() { }
G4VPhysicalVolume* RichTbROGeometry::Build() {
//Construct the ReadoutGeometry.
ROTbHall =new RichTbHall(rMaterial);
ROTbComponent = new RichTbComponent(rMaterial,ROTbHall,ROTbConfig,false);
ROPhotDet= new RichTbPhotoDetector(rMaterial,ROTbComponent,ROTbConfig,false);
return ROTbHall->getRichTbHallPhysicalVolume();
}
@@ -0,0 +1,94 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbRunAction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "G4Timer.hh"
#include "RichTbRunAction.hh"
#include "G4ios.hh"
#include "G4Run.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "RichTbAnalysisManager.hh"
#include "RichTbRunConfig.hh"
RichTbRunAction::RichTbRunAction(){
timer = new G4Timer;
}
RichTbRunAction::~RichTbRunAction()
{
delete timer;
}
void RichTbRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
if(G4VVisManager::GetConcreteInstance())
{
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/vis/scene/notifyHandlers");
}
timer->Start();
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
analysis->book();
#endif
}
void RichTbRunAction::EndOfRunAction(const G4Run* aRun)
{
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
#endif
timer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent()
<< " " << *timer << G4endl;
#ifdef G4ANALYSIS_USE
analysis->finish();
#endif
}
@@ -0,0 +1,246 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbRunConfig.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <fstream.h>
#include "RichTbRunConfig.hh"
#include "RichTbMaterialParameters.hh"
#include "globals.hh"
RichTbRunConfig::RichTbRunConfig()
:CurAerogelTNumber(vector<G4int>(MaxNumberOfAerogelTiles)),
CurAerogelType(vector<AerogelType>(MaxNumberOfAerogelTiles)){
const char* RunConfigFile = "RunConfig.dat" ;
G4cout<<" Run Configuration Input is from "<< RunConfigFile<<G4endl;
G4double rPressureN2,rTemperatureN2;
G4double rMirrorAddTiltXDeg;
G4double rMirrorAddTiltYDeg;
G4double unitofPressureN2=1.0*bar;
G4double unitofTemperatureN2=1.0*kelvin;
// To reduce the number of control variables to input
// from the RunConfig.dat
// file, define a defualt set for most them here for the G4Example.
// Pressure in bar for the nitrogen.
rPressureN2=1.0;
//temperature of nitrogen in kelvin.
rTemperatureN2=292.0;
// refractive index parametrization for nitrogen.
// to be removed.
RefIndexPara=1;
// Mirror tilt in X and Y
rMirrorAddTiltXDeg=0.0;
rMirrorAddTiltYDeg=0.0;
// Assign a default for the graphics variables.
RichTbHall_visib=0;
RichTbEnclosure_visib=2;
RichTbRadFrame_visib=2;
RichTbRadUpW_visib=1;
RichTbRadDnW_visib=1;
RichTbAerogel_visib=1;
RichTbAerogelWrap_visib=1;
RichTbFilter_visib=1;
RichTbMirror_visib=1;
RichTbHpdMaster_visib=1;
RichTbHpdEnvelopeTube_visib=0;
RichTbHpdQuartzW_visib=1;
RichTbHpdPhCathode_visib=1;
RichTbHpdSiDet_visib=1;
RichTbHpdSectCoat_visib=0;
RichTbHpdSiPx_visib=0;
RichTbDrawTrajectory_visib=1;
// Photoelectron energy in keV
HpdPhElectronEnergy=16.0;
FilterTNumber=1;
NumberOfAerogelTiles=1;
CurAerogelTNumber[0]=0;
//
RichTbNumPartEvent=1;
RichTbParticleTypeCode=0;
RichTbParticleStartPosCode=0;
RichTbParticleDirectionCode=0;
RichTbParticleEnergyCode=0;
RichTbParticleEnergy=9.0;
RichTbPhotLowE=1.305;
RichTbPhotHighE=7.2;
WriteMiscOutputFlag=0;
OutputFileName ="../outputData/MyOutputDataFile";
OutputHistoDirName="../HistoOutputVop/";
AerogelRefDataInputFileName="../inputData/aerogelRefIndexInput.dat";
FilterTransDataInputFileName="../inputData/FilterTransInput.dat";
MiscOutFileName="../outputData/MyMiscOutputFile";
//
if(RunConfigFile == 0 ) {
G4cout<<"Unable to read the run configuration file "
<<" using default values for the control variables "
<<" and input and output file names "<<G4endl;
}else {
G4cout<<"Now getting the run configuration file. "
<< "the Runconfig file name is "<< RunConfigFile <<G4endl;
ifstream finp(RunConfigFile);
finp>>RichTbHall_visib;
finp>>RichTbEnclosure_visib;
finp>>RichTbRadFrame_visib;
finp>>RichTbRadUpW_visib;
finp>>RichTbRadDnW_visib;
finp>>RichTbAerogel_visib;
finp>>RichTbAerogelWrap_visib;
finp>>RichTbFilter_visib;
finp>>RichTbMirror_visib;
finp>>RichTbHpdMaster_visib;
finp>>RichTbHpdEnvelopeTube_visib;
finp>>RichTbHpdQuartzW_visib;
finp>>RichTbHpdPhCathode_visib;
finp>>RichTbHpdSiDet_visib;
finp>>RichTbHpdSectCoat_visib;
finp>>RichTbHpdSiPx_visib;
finp>>RichTbDrawTrajectory_visib;
finp>>RichTbParticleEnergy;
finp>>FilterTNumber;
finp>>WriteOutputFile;
finp>>OutputFileName;
finp>>OutputHistoDirName;
finp>>AerogelRefDataInputFileName;
finp>>FilterTransDataInputFileName;
}
CurrentPressureN2=rPressureN2*unitofPressureN2;
CurrentTemperatureN2=rTemperatureN2*unitofTemperatureN2;
MirrorAddTiltX = (rMirrorAddTiltXDeg*pi/180)*rad;
MirrorAddTiltY = (rMirrorAddTiltYDeg*pi/180)*rad;
G4cout<<"Current Run Configuration "<<G4endl;
G4cout<<"Nitrogen Gas Pressure= "<<
CurrentPressureN2/unitofPressureN2<<" bar"<<G4endl;
G4cout<<"Nitrogen Gas Temperature = "
<<CurrentTemperatureN2/unitofTemperatureN2<<
" kelvin"<<G4endl;
G4cout<<"Ref Index parametrization used "<<RefIndexPara<<G4endl;
G4cout<<"Addtional Mirror tilts wrt X and Y in rad "<<MirrorAddTiltX
<<" "<<MirrorAddTiltY<<G4endl;
//For Following variables 0 means make the volume invisible;
// 1 means make it visible as a solid.
// 2 means make it visible as a wireframe.
G4cout<<" RichTbHall_visib = "<<RichTbHall_visib<<G4endl;
G4cout<<"RichTbEnclosure_visib = "<<RichTbEnclosure_visib<<G4endl;
G4cout<<"RichTbRad Frame_visib, FrameUpW_visib, FrameDnW = "
<<RichTbRadFrame_visib
<<" "<<RichTbRadUpW_visib<<" "<<RichTbRadDnW_visib
<<G4endl;
G4cout<<"RichTbAerogel_visib, AerogelWrap_visib = "
<<RichTbAerogel_visib<<RichTbAerogelWrap_visib<<G4endl;
G4cout<<"RichTbFilter_visib = "<<RichTbFilter_visib<<G4endl;
G4cout<<"RichTbMirror_visib = "<<RichTbMirror_visib<<G4endl;
G4cout<<"RichTbHpdMaster_visib = "<<RichTbHpdMaster_visib<<G4endl;
G4cout<<"RichTbHpdEnvelopeTube_visib = "<<RichTbHpdEnvelopeTube_visib<<G4endl;
G4cout<<"RichTbHpdQuartzW_visib = "<<RichTbHpdQuartzW_visib<<G4endl;
G4cout<<"RichTbHpdPhCathode_visib = "<<RichTbHpdPhCathode_visib<<G4endl;
G4cout<<"RichTbHpdSiDet_visib = "<<RichTbHpdSiDet_visib<<G4endl;
G4cout<<"RichTbHpdSiSectCoat_visib = "<<RichTbHpdSectCoat_visib<<G4endl;
G4cout<<"RichTbHpdSiPx_visib = "<<RichTbHpdSiPx_visib<<G4endl;
G4cout<<"RichTbDrawTrajectory_visib = "<<RichTbDrawTrajectory_visib<<G4endl;
G4cout<<"RichTbPhElectronEnergy = "<< HpdPhElectronEnergy<<G4endl;
// In the G4example only upto 1 type of filter is used.
if (FilterTNumber > 0 ) {
G4cout<<"RichTbRunConfig: In the G4example "
<<" only 1 type of filter used " <<G4endl;
FilterTNumber =0;
}
FilterTransData =
new FilterTrData(FilterTNumber,FilterTransDataInputFileName);
CurFilterType= FilterTransData->GetFilterTypeIndex();
G4cout<<"Filter Number = "<<FilterTNumber<<G4endl;
if(FilterTNumber >= 0 ) {
G4cout<<" Filter Type = "<<CurFilterType<<G4endl;
} else {
G4cout<<"No Filter for this Run "<<G4endl;
}
// for the G4example 1 tile is used. In the LHCb implementation
// upto 5 tiles can be used.
if(NumberOfAerogelTiles > 1 ) {
G4cout<<" RichTbRunConfig: For the G4Example "
<<" the number of aerogel tiles is limited to 1 "
<<" Hence setting the number of Tiles to 1 "<<G4endl;
NumberOfAerogelTiles =1;
}
for(G4int iia=0; iia<NumberOfAerogelTiles; iia++) {
if(CurAerogelTNumber[iia] == 0 ) CurAerogelType[iia]=AerogelTypeA;
if(CurAerogelTNumber[iia] == 1 ) CurAerogelType[iia]=AerogelTypeB;
if(CurAerogelTNumber[iia] == 2 ) CurAerogelType[iia]=AerogelTypeC;
if(CurAerogelTNumber[iia] == 3 ) CurAerogelType[iia]=AerogelTypeD;
if(CurAerogelTNumber[iia] == 4 ) CurAerogelType[iia]=AerogelTypeE;
}
G4cout<<"Number of Aerogel Tiles "<<NumberOfAerogelTiles<<G4endl;
for(G4int ia=0; ia<NumberOfAerogelTiles; ia++ ) {
G4cout<<" AerogelNumber and Type "<<CurAerogelTNumber[ia]<<" "<<
CurAerogelType[ia]<<G4endl;
}
G4cout<<"Aerogel RefIndex Input file Name is "
<<AerogelRefDataInputFileName<<G4endl;
AerogelRefractiveInd= new AerogelRefData(AerogelRefDataInputFileName);
G4cout<<"Write Outfile File Flag set to "<<WriteOutputFile<<G4endl;
G4cout<<"OutputData file = "<<OutputFileName <<G4endl;
G4cout<<"OutputHistoDir = "<<OutputHistoDirName <<G4endl;
G4String PaType;
if(RichTbParticleTypeCode == 0 )PaType="piminus";
if(RichTbParticleTypeCode == 1 )PaType="optical photon";
if(RichTbParticleTypeCode == 2 )PaType="Mixture of piminus and proton";
G4cout<<"Number of beam particles per event = "<<RichTbNumPartEvent<<G4endl;
G4cout<<"Particle Type Code "<<RichTbParticleTypeCode
<<" "<< PaType <<G4endl;
G4cout<<"Particle Start Pos and Direction Energy codes "
<< RichTbParticleStartPosCode <<" "<< RichTbParticleDirectionCode
<<" "<<RichTbParticleEnergyCode<<G4endl;
G4cout<<"Energy code 0 is for charged particle and 1 is for photon generation"
<< " using particle gun "<<G4endl;
G4cout<<"Gun Gen Charged Particle energy in GeV is "
<<RichTbParticleEnergy<<G4endl;
G4cout<<"Gun Gen Photon energy range in eV is "<<RichTbPhotLowE
<<" "<< RichTbPhotHighE <<G4endl;
}
RichTbRunConfig::~RichTbRunConfig() { ; }
+149
View File
@@ -0,0 +1,149 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbSD.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbSD.hh"
#include "RichTbHit.hh"
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"
#include "G4Track.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
#include "G4VProcess.hh"
RichTbSD::RichTbSD(G4String DetName, G4int Numhpd , G4int NumSect,
G4int NumPixel,
G4String CollectionName)
:G4VSensitiveDetector(DetName),NumberOfSensitiveHpds(Numhpd),
NumberOfSensitiveSectorsInHpd(NumSect),
NumberOfSensitivePixelsInSector(NumPixel),
HpdSDID(Numhpd*NumSect*NumPixel),HCID(-1)
{
G4String HCname;
collectionName.insert(HCname="RichTbHitsCollection");
}
RichTbSD::~RichTbSD(){
}
void RichTbSD::Initialize(G4HCofThisEvent* HCE)
{
RichTbHitCollection = new RichTbHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int jhpd =0; jhpd < NumberOfHpds; jhpd++){
for(G4int jsect=0; jsect < NumberOfSiDetSectors; jsect++){
for (G4int jpixel = 0; jpixel < NumberOfPadHpdSiPixels ; jpixel++ ){
HpdSDID[NumberOfSensitiveSectorsInHpd*
NumberOfSensitivePixelsInSector*jhpd+
NumberOfSensitivePixelsInSector*jsect+jpixel]=-1;
}
}
}
}
G4bool RichTbSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
{
G4Track* aTrack = aStep->GetTrack();
if(aTrack ->GetDefinition()->GetPDGCharge() == 0.0 ) return false;
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep < 0.0001) return false;
G4StepPoint* PrePosition = aStep->GetPreStepPoint();
G4int CurrentHpdNumber = PrePosition->GetPhysicalVolume()
-> GetMother() -> GetCopyNo();
G4int CurrentSectorNumber= PrePosition->GetPhysicalVolume()
->GetCopyNo();
G4VPhysicalVolume* ROphysVol = ROhist -> GetVolume();
G4int CurrentPixelNumber = ROphysVol->GetCopyNo();
G4ThreeVector HitAtPhotoCathode;
if(aTrack->GetCreatorProcess() -> GetProcessName() == "PadHpdPhot") {
HitAtPhotoCathode=aTrack->GetVertexPosition();
}
G4int CopyId= NumberOfSensitiveSectorsInHpd*
NumberOfSensitivePixelsInSector*CurrentHpdNumber+
NumberOfSensitivePixelsInSector*CurrentSectorNumber+
CurrentPixelNumber;
if( HpdSDID[CopyId ] == -1 ) {
RichTbHit* newHit = new RichTbHit();
newHit->SetEdep( edep );
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
newHit->SetPosPC(HitAtPhotoCathode);
newHit->SetCurHpdNum ( CurrentHpdNumber );
newHit->SetCurSectNum ( CurrentSectorNumber );
newHit->SetCurPixNum ( CurrentPixelNumber );
//For now the same SD detector cell is allowed to have
//multiple hits from the same event. This is ok for
// analogue readout for photoelectron counting.
//This is to be changed in the future.
G4int NumHits = RichTbHitCollection->insert( newHit );
HpdSDID[CopyId]= NumHits -1 ;
} else {
// the current pixel is already hit in this event.
// here we can add extra energy (adc counts) to the
// existing hit. But this is not relevant to the
// current Tb analysis.
(*RichTbHitCollection)[HpdSDID[CopyId]]->AddEdep( edep );
G4cout << " Multiple hits in Hpd sector pixel " << CurrentHpdNumber
<<" "<< CurrentSectorNumber<<" "<< CurrentPixelNumber<< G4endl;
}
return true;
}
void RichTbSD::EndOfEvent(G4HCofThisEvent*HCE){
if( HCID < 0 ){
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
HCE->AddHitsCollection( HCID, RichTbHitCollection );
}
void RichTbSD::clear(){}
void RichTbSD::DrawAll(){ }
void RichTbSD::PrintAll(){ }
+160
View File
@@ -0,0 +1,160 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbSiDet.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "globals.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4UnionSolid.hh"
#include "RichTbSiDet.hh"
#include "G4SDManager.hh"
#include "RichTbSD.hh"
#include "G4LogicalBorderSurface.hh"
RichTbSiDet::RichTbSiDet() {;}
RichTbSiDet::~RichTbSiDet() {;}
RichTbSiDet::RichTbSiDet(RichTbMaterial* RMaterial,
G4VPhysicalVolume* MotherOfSiDet,
G4bool ConstructTrackingGeomSwitch,
G4int IHpdNum, G4int SectNum){
//
//
ConstructTrackGeomSwitch=ConstructTrackingGeomSwitch;
IHpdNumber=IHpdNum;
CurSiSectNum=SectNum;
//This is done for each sector.
G4double SiSectRotZ;
G4double SiSectPosX,SiSectPosY;
G4double SiSectCoatingRotZ;
G4double SiSectCoatingPosX,SiSectCoatingPosY;
G4int isec=SectNum;
G4Trd* HpdSiSect=
new G4Trd("HpdSiSect",SiSectTrapHalfX1, SiSectTrapHalfX2,
SiSectTrapHalfY1,SiSectTrapHalfY2,SiSectTrapHalfZ);
G4RotationMatrix SiSectRotationX,SiSectRotationZ;
SiSectRotationX.rotateX(SiSectRotX);
SiSectRotZ = SiSectAngStart-isec*SiSectAngSize;
SiSectRotationZ.rotateZ(SiSectRotZ);
SiSectPosX=SiSectTrapHalfZ*cos(SiSectRotZ-pi/2.0);
//
if(isec < NumberOfSiDetSectors/2 ) {
SiSectPosY=SiSectTrapHalfZ*sin(SiSectRotZ-pi/2.0)-SiSectHalfMoonGap/2.0;
}else{
SiSectPosY=SiSectTrapHalfZ*sin(SiSectRotZ-pi/2.0)+SiSectHalfMoonGap/2.0;
}
G4ThreeVector SiSectTrapPos(SiSectPosX,SiSectPosY,SiSectPosZ);
G4Transform3D SiSectTransform(SiSectRotationZ*SiSectRotationX,
SiSectTrapPos);
G4LogicalVolume* HpdSiSectLog =
new G4LogicalVolume(HpdSiSect,RMaterial->getHpdSiDetMaterial(),
"HpdSiSect",0,0,0);
G4VPhysicalVolume* HpdSiSectPhys=
new G4PVPlacement(SiSectTransform,"HpdSiSect",
HpdSiSectLog,MotherOfSiDet,false,SectNum);
if(ConstructTrackingGeomSwitch) {
G4Trd* HpdSectCoat=
new G4Trd("HpdSectCoat",SiSectCoatingTrapHalfX1,
SiSectCoatingTrapHalfX2,
SiSectCoatingTrapHalfY1,SiSectCoatingTrapHalfY2,
SiSectCoatingTrapHalfZ);
G4RotationMatrix SiSectCoatingRotationX,SiSectCoatingRotationZ;
SiSectCoatingRotationX.rotateX(SiSectCoatingRotX);
SiSectCoatingRotZ = SiSectRotZ;
SiSectCoatingRotationZ.rotateZ(SiSectCoatingRotZ);
SiSectCoatingPosX= SiSectPosX;
SiSectCoatingPosY=SiSectPosY;
G4ThreeVector SiSectCoatingTrapPos(SiSectCoatingPosX,SiSectCoatingPosY,
SiSectCoatingPosZ);
G4Transform3D SiSectCoatingTransform(SiSectCoatingRotationZ*SiSectCoatingRotationX, SiSectCoatingTrapPos);
G4LogicalVolume* HpdSectCoatLog =
new G4LogicalVolume(HpdSectCoat,RMaterial->getHpdSiCoatingMaterial(),
"HpdSectCoat",0,0,0);
G4VPhysicalVolume* HpdSectCoatPhys=
new G4PVPlacement(SiSectCoatingTransform,"HpdSectCoat",
HpdSectCoatLog,MotherOfSiDet,false,SectNum);
G4LogicalBorderSurface* HpdSectCoatSurface =
new G4LogicalBorderSurface("HpdSectCoatSurface",MotherOfSiDet ,
HpdSectCoatPhys ,
RMaterial-> getHpdSiCoatSurface());
RichTbHpdSectCoatLVol=HpdSectCoatLog;
RichTbHpdSectCoatPVol=HpdSectCoatPhys;
}
//Construct the Silicon Pixels
NumHpdSiPix=NumberOfPadHpdSiPixels;
if(!ConstructTrackingGeomSwitch) {
for (G4int ipix=0; ipix<NumberOfPadHpdSiPixels; ipix++){
hpdSiPixel[ipix] = new RichTbSiPixel(RMaterial,HpdSiSectPhys,
IHpdNum,isec,ipix);
}
}
RichTbHpdSiSectLVol=HpdSiSectLog;
RichTbHpdSiSectPVol=HpdSiSectPhys;
}
+145
View File
@@ -0,0 +1,145 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbSiPixel.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "globals.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4UnionSolid.hh"
#include "RichTbSiPixel.hh"
#include "G4SDManager.hh"
#include "RichTbSD.hh"
#include "RichTbRODummySD.hh"
#include "RichTbMaterialParameters.hh"
#include "G4IntersectionSolid.hh"
RichTbSiPixel::RichTbSiPixel() {;}
RichTbSiPixel::~RichTbSiPixel() {;}
RichTbSiPixel::RichTbSiPixel(RichTbMaterial* RMaterial,
G4VPhysicalVolume* MotherOfSiPixel,
G4int IHpdNum, G4int Isector ,G4int ipixel){
//
//
ICurSectorNumber=Isector;
HpdSiPixelnum=ipixel;
ICurHpdNumber=IHpdNum;
G4Trd* HpdSiSectTrapInt=
new G4Trd("HpdSiSectTrapInt",SiSectTrapHalfX1, SiSectTrapHalfX2,
SiSectTrapHalfY1,SiSectTrapHalfY2,SiSectTrapHalfZ);
G4Box* HpdSiPxBox;
if(ipixel == BigPixelNum ) {
HpdSiPxBox=new G4Box("HpdSiPxBigBox",
SiPixelHalfX,SiPixelHalfY,SiBigPixelHalfZ);
}else {
HpdSiPxBox=new G4Box("HpdSiPxBox",SiPixelHalfX,SiPixelHalfY,SiPixelHalfZ);
}
//
//For the rotation and translation of the Si Pixel.
G4RotationMatrix HpdSiPxRotation, HpdSiSectTrapIntRotation;
G4double RichTbHpdSiPxShiftY=HpdSiPixPosZ;
G4double RichTbHpdSiPxShiftX
=RichTbPadHpdSiPixPos(ipixel).getPadHpdSiPixPosX();
G4double RichTbHpdSiPxShiftZ
=RichTbPadHpdSiPixPos(ipixel).getPadHpdSiPixPosY()-SiSectTrapHalfZ;
G4ThreeVector HpdSiPxTrsl( RichTbHpdSiPxShiftX,
RichTbHpdSiPxShiftY,
RichTbHpdSiPxShiftZ);
G4Transform3D HpdSiPxTransform(HpdSiPxRotation,HpdSiPxTrsl);
G4ThreeVector HpdSiSectTrapIntTrsl(0.0*mm, 0.0*mm, 0.0*mm);
G4Transform3D HpdSiSectTrapIntTransform( HpdSiSectTrapIntRotation,
HpdSiSectTrapIntTrsl);
//Now for the placements
G4LogicalVolume* HpdSiPxLog;
G4VPhysicalVolume* HpdSiPxPhys;
// The pixels at the pixel edge are intersected with the
// sector. The BigPixel is also at the edge.
if(PixelAtSectEdge[ipixel]){
G4IntersectionSolid* HpdSiPxTrapBox
= new G4IntersectionSolid("PixelSectTrapInt", HpdSiSectTrapInt,
HpdSiPxBox, HpdSiPxTransform);
HpdSiPxLog=
new G4LogicalVolume( HpdSiPxTrapBox,RMaterial->getHpdSiDetMaterial(),
"PixelSectTrapInt",0,0,0);
HpdSiPxPhys=
new G4PVPlacement(HpdSiSectTrapIntTransform,"PixelSectTrapInt",
HpdSiPxLog,MotherOfSiPixel,false,ipixel);
}else{
HpdSiPxLog=
new G4LogicalVolume( HpdSiPxBox,RMaterial->getHpdSiDetMaterial(),
"HpdSiPxBox",0,0,0);
HpdSiPxPhys=
new G4PVPlacement(HpdSiPxTransform,"HpdSiPxBox",
HpdSiPxLog,MotherOfSiPixel,false,ipixel);
}
//Now for the readout dummy sensitive detector
// This just flags the pixel as active.
//First Get the deadPixel List
G4bool thisPixelisAlive=true;
vector<G4int>DeadPxL = getDeadPixelList(IHpdNum,Isector);
for(G4int ideadP=0; ideadP<DeadPxL.size(); ideadP++){
if(ipixel == DeadPxL[ideadP] )thisPixelisAlive=false;
}
PixelIsAlive= thisPixelisAlive;
if(thisPixelisAlive){
RichTbRODummySD * DummySensi = new RichTbRODummySD;
HpdSiPxLog->SetSensitiveDetector(DummySensi);
}
RichTbHpdSiPixelLVol=HpdSiPxLog;
RichTbHpdSiPixelPVol=HpdSiPxPhys;
}
@@ -0,0 +1,32 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbStackingAction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbStackingAction.hh"
RichTbStackingAction::RichTbStackingAction() { ;}
RichTbStackingAction::~RichTbStackingAction() { ;}
@@ -0,0 +1,256 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbSteppingAction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "globals.hh"
#include "RichTbSteppingAction.hh"
#include "G4SteppingManager.hh"
#include "RichTbAnalysisManager.hh"
#include "RichTbMaterial.hh"
#include "RichTbGeometryParameters.hh"
#include "RichTbMaterialParameters.hh"
#include "RichTbRunConfig.hh"
#include "RichTbPrimaryGeneratorAction.hh"
#include "G4ParticleDefinition.hh"
#include "G4DynamicParticle.hh"
#include "G4Material.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4Electron.hh"
#include "G4ThreeVector.hh"
#include "G4OpticalPhoton.hh"
#include "G4PionMinus.hh"
#include "AIDA/AIDA.h"
RichTbSteppingAction::RichTbSteppingAction(RichTbRunConfig* rConfig , RichTbPrimaryGeneratorAction* RPrimGenAction){
richtbRunConfig= rConfig;
rPrimGenAction = RPrimGenAction;
HpdPhElectronKE=rConfig->getHpdPhElectronEnergy();
uParticleChange=new G4VParticleChange();
}
RichTbSteppingAction::~RichTbSteppingAction() { ;}
void RichTbSteppingAction::UserSteppingAction(const G4Step* aStep){
RichTbGenericHisto(aStep);
}
void RichTbSteppingAction:: RichTbDebugHisto(const G4Step* aStep){
}
void RichTbSteppingAction::RichTbGenericHisto(const G4Step* aStep) {
G4StepPoint* pPreStepPoint = aStep ->GetPreStepPoint();
G4StepPoint* pPostStepPoint = aStep ->GetPostStepPoint();
const G4ThreeVector prePos= pPreStepPoint->GetPosition();
const G4ThreeVector postPos= pPostStepPoint->GetPosition();
//In the following 1000 mm is the Z coord of a point
// between the mirror and the dowstream end of the vessel.
if(prePos.z()<1000*mm && prePos.z() > 0.0*mm ){
//check to see if we are at a boundary
if (pPostStepPoint->GetStepStatus() == fGeomBoundary){
G4Track* aPhotTrack = aStep -> GetTrack();
const G4DynamicParticle* aParticle = aPhotTrack->GetDynamicParticle();
const G4double PhotonEnergy =
aParticle->GetKineticEnergy();
G4String VolNameD="Agel";
G4String VolNameE="VesselEnclosure";
G4String VolNameF="MirrorSphe";
G4String VolNameG="RadFrame";
G4String VolNameH="FilterBox";
G4String VolNameQ="HpdQuartzWindow";
G4String VolNameP="HpdMaster";
//
if( aParticle->GetDefinition() == G4OpticalPhoton::OpticalPhoton()){
if( pPreStepPoint -> GetPhysicalVolume() &&
pPostStepPoint -> GetPhysicalVolume() ) {
G4String tpreVol = pPreStepPoint -> GetPhysicalVolume()->GetName();
G4String tpostVol = pPostStepPoint -> GetPhysicalVolume()->GetName();
if(richtbRunConfig-> GetRichTbParticleEnergyCode() == 1 ||
richtbRunConfig-> GetRichTbParticleEnergyCode() == 2 ) {
// Optical photons are generated as beam particle.
// count the photons entering the aerogel volume.
// this is essentially same as the photons generated.
if(( tpreVol == VolNameG || tpreVol == VolNameE ) &&
tpostVol == VolNameD ) {
#ifdef G4ANALISYS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
analysis->bumpNumPhotonsBeforeAerogel();
#endif
}
}
if(PhotonEnergy > 0.0 ) {
const G4double PhotonWavelength =
PhotMomWaveConv*1.0*eV/ PhotonEnergy;
//
G4String tpreVol = pPreStepPoint -> GetPhysicalVolume()->GetName();
G4String tpostVol = pPostStepPoint -> GetPhysicalVolume()->GetName();
// First for the mirror volume
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
if(tpreVol == VolNameE && tpostVol == VolNameF ) {
analysis->getfhistoWBeforeMirror()->fill(PhotonWavelength);
analysis->bumpNumPhotonsBeforeMirror();
}
if(tpreVol == VolNameF && tpostVol == VolNameE ) {
analysis->getfhistoWAfterMirror()->fill(PhotonWavelength);
analysis->bumpNumPhotonsAfterMirror();
#endif
}
//
//Now for the Aerogel Volume
if(richtbRunConfig-> GetRichTbParticleEnergyCode() == 0 ) {
if(( tpreVol == VolNameG || tpreVol == VolNameE ) &&
tpostVol == VolNameD ) {
if(prePos.z() < postPos.z() ) {
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
analysis->bumpNumPhotonsBeforeAerogel();
#endif
}
}
}
if(tpreVol == VolNameD &&
( tpostVol == VolNameG || tpostVol == VolNameE ) ) {
// G4double XatAgelExit=postPos.x();
//G4double YatAgelExit=postPos.y();
//G4double ZatAgelExit=postPos.z();
const G4ThreeVector PhotCurMom =
aPhotTrack->GetMomentumDirection();
//G4double CurExitangle= acos(PhotCurMom.z());
// Plot the Angle of emission of the photon.
// When there is no Raylegh scattering this is the
// Cherenkov angle. For now we only consider the charged
// track to be of direction 001. Later this may be changed.
// So the angle considered is just the angle of the photon
// track.
#ifdef G4ANALYSIS_USE
RichTbAnalysisManager * analysis = RichTbAnalysisManager::getInstance();
const G4ThreeVector PhotOrgUnitMom =
aPhotTrack->GetVertexMomentumDirection();
G4double Ckv_angle= acos(PhotOrgUnitMom.z());
analysis->getfhistoCkvProdSmall()->fill(Ckv_angle);
//Now for the photon emission point in aerogel
const G4ThreeVector PhotEmisPt = aPhotTrack->GetVertexPosition();
analysis->getfhistoEmisZ()->fill( PhotEmisPt.z());
#endif
}
}
}
}
}
}
}
@@ -0,0 +1,31 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbTrackingAction.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#include "RichTbTrackingAction.hh"
RichTbTrackingAction::RichTbTrackingAction() { ;}
RichTbTrackingAction::~RichTbTrackingAction() { ;}
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Rich advanced example for Geant4
// RichTbVisManager.cc for Rich of LHCb
// History:
// Created: Sajan Easo (Sajan.Easo@cern.ch)
// Revision and changes: Patricia Mendez (Patricia.Mendez@cern.ch)
/////////////////////////////////////////////////////////////////////////////
#ifdef G4VIS_USE
#include "RichTbVisManager.hh"
// Supported drivers...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_DAWNFILE
#include "G4DAWNFILE.hh"
#endif
#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
#ifdef G4VIS_USE_OIX
// #include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
#ifdef G4VIS_USE_VRMLFILE
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
#endif
#ifdef G4VIS_USE_RAYTRACER
#include "G4RayTracer.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RichTbVisManager::RichTbVisManager () { ; }
RichTbVisManager::~RichTbVisManager () {;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void RichTbVisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_DAWNFILE
RegisterGraphicsSystem (new G4DAWNFILE);
#endif
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
#ifdef G4VIS_USE_OIX
// RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
#ifdef G4VIS_USE_VRMLFILE
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
#endif
#ifdef G4VIS_USE_RAYTRACER
RegisterGraphicsSystem (new G4RayTracer);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....