Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import geant4maker. #659

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
05dab3a
[g4star] Expose partcile stack for the geant4 application.
klendathu2k Oct 31, 2023
4ef0d92
[geant4star] Load packages required for G4* for 64bit builds.
klendathu2k Nov 8, 2023
78ea6c0
... and the CLHEP package required by G4 as well ...
klendathu2k Nov 9, 2023
e4a4ba7
Fix duplicate.
klendathu2k Feb 20, 2024
6dca37a
Restore gcomad for agstar dummy routines
klendathu2k Feb 20, 2024
5c25821
Extern causes issues at runtime
klendathu2k Feb 20, 2024
b5a7f99
Duplicate load removed.
klendathu2k Feb 21, 2024
6c1e9dc
Make multi-engine simulation the default. Comment out the "NAME:engi…
klendathu2k Feb 21, 2024
40e8340
Handle ROOT version dependence for VMC library.
klendathu2k Mar 12, 2024
f164cd2
Add VMC include path if separate from ROOT.
klendathu2k Mar 12, 2024
80f70bb
Load VMC, G3/G4 VMC and concrete libraries for 64bit builds.
klendathu2k Mar 12, 2024
ca409ab
Invoke local copy for sensitive volume materials.
klendathu2k May 1, 2024
6597aec
Different set of sensitive volumes in sTGC geometry.
klendathu2k May 1, 2024
23627ac
Think we really want muons here...
klendathu2k May 1, 2024
d7b18de
Volume sensitivitiy can be flagged in either the material or medium b…
klendathu2k May 1, 2024
cfc6767
... and definitely want them here...
klendathu2k May 1, 2024
1a136be
libgeom not needed for geant3vmc / fix EEmcUtil chain option.
klendathu2k May 15, 2024
9dcbce8
Add g3 vmc as default chain option.
klendathu2k May 15, 2024
0f5dace
libPhysics does not need to be preloaded.
klendathu2k May 15, 2024
7b3f604
Reduce unneccesary verbosity.
klendathu2k May 15, 2024
4012f0c
Apply the NODEBUG environment variable.
klendathu2k May 15, 2024
b3285d7
[g4star] Expose partcile stack for the geant4 application.
klendathu2k Oct 31, 2023
00e6e42
[geant4star] Load packages required for G4* for 64bit builds.
klendathu2k Nov 8, 2023
5e2f517
... and the CLHEP package required by G4 as well ...
klendathu2k Nov 9, 2023
4e93513
Fix duplicate.
klendathu2k Feb 20, 2024
42b1eb0
Restore gcomad for agstar dummy routines
klendathu2k Feb 20, 2024
e46192d
Extern causes issues at runtime
klendathu2k Feb 20, 2024
151231a
Duplicate load removed.
klendathu2k Feb 21, 2024
75d5ccf
Make multi-engine simulation the default. Comment out the "NAME:engi…
klendathu2k Feb 21, 2024
250e023
Handle ROOT version dependence for VMC library.
klendathu2k Mar 12, 2024
9ff6986
Add VMC include path if separate from ROOT.
klendathu2k Mar 12, 2024
c9324af
Load VMC, G3/G4 VMC and concrete libraries for 64bit builds.
klendathu2k Mar 12, 2024
89ebf66
Invoke local copy for sensitive volume materials.
klendathu2k May 1, 2024
d00c2b7
Different set of sensitive volumes in sTGC geometry.
klendathu2k May 1, 2024
e860df6
Think we really want muons here...
klendathu2k May 1, 2024
da18036
Volume sensitivitiy can be flagged in either the material or medium b…
klendathu2k May 1, 2024
b20950b
... and definitely want them here...
klendathu2k May 1, 2024
ceddeb4
libgeom not needed for geant3vmc / fix EEmcUtil chain option.
klendathu2k May 15, 2024
8d3d5fb
Add g3 vmc as default chain option.
klendathu2k May 15, 2024
6797477
libPhysics does not need to be preloaded.
klendathu2k May 15, 2024
383a1ce
Reduce unneccesary verbosity.
klendathu2k May 15, 2024
e6b4a73
Apply the NODEBUG environment variable.
klendathu2k May 15, 2024
7f4a3d9
Do not build geant4star if we are not at 64bit and we are not at leas…
klendathu2k May 22, 2024
ac2a2bc
Remove dead code.
klendathu2k May 22, 2024
570cc5a
Cleanup comments.
klendathu2k May 22, 2024
109bb35
Merge branch 'import-geant4maker-rebased' of https://github.com/klend…
klendathu2k May 22, 2024
210df98
libVMC --> LIBVMC
klendathu2k May 22, 2024
ea7c71a
Problem between chair and keyboard... the EEmcUtil class is provided…
klendathu2k May 29, 2024
40631c8
ROOT5 / CINT doesn't replace the LIBVMC definition which concatinatin…
klendathu2k May 30, 2024
7d8abe0
Merge branch 'main' into import-geant4maker-rebased
klendathu2k May 31, 2024
1e1cd29
Local code implies local search path for headers.
klendathu2k Aug 2, 2024
9123eee
Cling wrap... to prevent ROOT from ingesting class definitions multip…
klendathu2k Aug 2, 2024
400539f
From PR#693
klendathu2k Aug 2, 2024
16cc33b
When geant4maker is set, we should add the geantBranch to the output …
klendathu2k Sep 12, 2024
029e112
Add pythia6 chain option.
klendathu2k Sep 13, 2024
c3f6681
Output implies geant4out, not geantout.
klendathu2k Sep 25, 2024
5e8ebff
Option to load geant tables w/out other dependencies.
klendathu2k Oct 30, 2024
fa71fe4
The protected against both CINT and CLING.
klendathu2k Oct 30, 2024
9ca2b32
Remove ancient version of geant3 vmc from our source tree.
klendathu2k Oct 30, 2024
476fdf9
TGeant3TGeo available under the TGeant3/ directory.
klendathu2k Oct 30, 2024
deca9e8
...
klendathu2k Nov 1, 2024
4ca7499
Use R__LOAD_LIBRARY rather than initialization macro. Add valgrind o…
klendathu2k Nov 1, 2024
f462b52
This removes the internal CLHEP library distributed with G4, so we ca…
klendathu2k Nov 1, 2024
e630bf0
Use R__LOAD_LIBRARY ...
klendathu2k Nov 6, 2024
b80757e
Clingwrap header files.
klendathu2k Nov 6, 2024
b204aee
Add (possibly nonfunctional) hijing macro.
klendathu2k Nov 6, 2024
5612264
Will need to expose TCallf77 in 32bit builds as well. So make sure w…
klendathu2k Nov 6, 2024
14e8592
Handle the (hopefully rare) case where truth track is not defined.
klendathu2k Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions StRoot/StBFChain/BigFullChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ ________________________________________________________________________________
*/
#endif

#include <RVersion.h>

#if ROOT_VERSION_CODE>=ROOT_VERSION(6,24,0)
#define libVMC "libVMCLibrary.so"
#else
#define libVMC "libVMC.so"
klendathu2k marked this conversation as resolved.
Show resolved Hide resolved
#endif

#define STAR_CHAIN_OBSOLETE "WARNING *** Option is OBSOLETE ***"

//#define __NoStrangeMuDst__
Expand Down Expand Up @@ -1212,7 +1220,7 @@ Bfc_st BFC[] = { // standard chains
{"StarMiniCern","" ,"","geant3","" ,"","STAR addition to minicern OBSOLETE",kFALSE},
{"mysql" ,"" ,"","","" ,"libmysqlclient","MySQL",kFALSE},
{"libPhysics" ,"" ,"","","" ,"libPhysics","TVector",kFALSE},
{"geant3vmc" ,"" ,"","-usexgeom,-xgeometry","", "libGeom,libVMC,libgeant3", "VMC geant3",kFALSE},
{"geant3vmc" ,"" ,"","-usexgeom,-xgeometry","", "libGeom," libVMC ",libgeant321.so", "VMC geant3",kFALSE},
{"geant3" ,"" ,"","geant3vmc","" ,"EG,Pythia6,EGPythia6","VMC geant3 plus ROOT EG,pythia6",kFALSE},
{"geometry" ,"" ,"","","" ,"geometry","geometry+Mag.Field",kFALSE},
{"StarMagField","", "","magF" ,"","VMC,StarMagField","Load StarMagField",kFALSE},
Expand Down Expand Up @@ -1275,13 +1283,15 @@ Bfc_st BFC[] = { // standard chains
{"------------","-----------","-----------","------------------------------------------","","","",kFALSE},
{"Generators ","-----------","-----------","------------------------------------------","","","",kFALSE},
{"------------","-----------","-----------","------------------------------------------","","","",kFALSE},
{"stargen", "","", "gen_T,sim_T"/*+++*/, "", "libVMC.so,libStarGeneratorUtil.so,libStarGeneratorEvent.so,libStarGeneratorBase.so,libStarGeneratorFilt.so,libMathMore.so","STAR Generator BASE",false},
{"stargen", "","", "gen_T,sim_T"/*+++*/, "", libVMC ",libfastjet.so,libStarGeneratorUtil.so,libStarGeneratorEvent.so,libStarGeneratorBase.so,libStarGeneratorFilt.so,libMathMore.so","STAR Generator BASE",false},
{"pythia8.1.86","","","stargen", "", "Pythia8_1_86.so", "Load Pythia 8.1.86 generator", false },
{"pythia8.2.35","","","stargen", "", "Pythia8_2_35.so", "Load Pythia 8.1.86 generator", false },
{"hijing1.383" ,"","","stargen", "", "Hijing1_383.so", "Load Hijing 1.383 generator", false },
{"kinematics" ,"","","stargen", "", "Kinematics.so", "Load STAR Particle Gun", false },
{"genreader" ,"","","stargen", "", "StarGenEventReader.so", "Load STAR Gen Event Reader", false },

{"fastjet" ,"","","" , "", "libfastjet.so", "Load fast jet reconstruction algo", false},


{"------------","-----------","-----------","------------------------------------------","","","",kFALSE},
{"GEANT4 Libs ","-----------","-----------","------------------------------------------","","","",kFALSE},
Expand All @@ -1292,6 +1302,9 @@ Bfc_st BFC[] = { // standard chains
{"g4geant3", "", "", "", "", "libG3toG4.so", "Load g3 to g4 support", false },
{"geant4", "", "", "g4physics,g4interfaces","","","Load G4 libs", false},

{"geant4vmc", "","", "geant4", "", libVMC ",libgeant4vmc.so", "Load G4 VMC libs", false},
{"geant4mk", "","", "stargen,geant4vmc,geant3vmc", "", "StGeant4Maker.so,StarMagField.so", "Load G4 VMC libs", false},
klendathu2k marked this conversation as resolved.
Show resolved Hide resolved


{"------------","-----------","-----------","------------------------------------------","","","",kFALSE},
{"I/O Makers ","-----------","-----------","------------------------------------------","","","",kFALSE},
Expand Down
Empty file.
38 changes: 38 additions & 0 deletions StRoot/StGeant4Maker/AgMLBTofVolumeId.h
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgMLBTofVolumeId and similarly named classes implement the unique volume IDs defined in pams/sim/g2t/g2t_volume_id.g. They provide the unique associated between hits and hardware channels.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef __AgMLBtofVolumeId_h__
#define __AgMLBtofVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLBtofVolumeId : public AgMLVolumeId {
public:

AgMLBtofVolumeId(){}
// Applies to btog.version = 8 with btog.choice =13 (run 13 onwards)

virtual int id( int* numbv ) const {

int rileft = numbv[0];
int sector = numbv[1];
int module = numbv[2];
int layer = numbv[3];

// Adjust for GMT modules
if ( rileft==1 ) {
if ( sector== 8 ) module += 4;
if ( sector==23 ) module += 4;
}
else if ( rileft==2 ) {
if ( sector == 33 ) module += 4;
if ( sector == 48 ) module += 4;
}

int _id = layer + 10 * (module + 100 * (sector+100*rileft) );

return _id;

};
};


#endif
70 changes: 70 additions & 0 deletions StRoot/StGeant4Maker/AgMLEEmcVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ifndef __AgMLEEmcVolumeId_h__
#define __AgMLEEmcVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <TGeoNavigator.h>
#include <StMessMgr.h>
#include <TLorentzVector.h>
#include <TVirtualMC.h>
#include <TMath.h>

#include <TString.h>
#include <StMessMgr.h>

class AgMLEEmcVolumeId : public AgMLVolumeId {

const int onoff = 1;
const int fillmode = 3;
const int sectormap[2][6] = {
{ 4, 5, 6, 7, 8, 9},
{10,11,12, 1, 2, 3}
};


public:

AgMLEEmcVolumeId() : AgMLVolumeId() { /* nada */ };

virtual int id( int* numbv ) const {

// cd == ESCI
int rileft = onoff;
int shift = 0;

int wheel = numbv[0];
int section = numbv[1];
int idx = numbv[2];
int phi30d = sectormap[wheel-1][idx-1]; // sector number
int subsec = numbv[3]; // subsection (i.e. layer) within each section
int sublay = numbv[4]; // ???
int phi = numbv[5]; // phibin in sector
int eta = numbv[6];

int depth = subsec + 3 * ( section - 1 );

// int volumeid = 100000*rileft + 1000*(5*(phi30d-1)+phi) + 10*eta + depth;

int volumeid = 100000 * rileft
+ 1000 * ( 5 * ( phi30d-1 ) + phi )
+ 10 * eta
+ depth;

// LOG_INFO << Form("AgML EEmc VolumdId = wheel=%i section=%i idx=%i phi30d=%i subsection=%i %i %i %i %i",
// numbv[0],
// numbv[1],
// numbv[2],
// phi30d,
// numbv[3],
// numbv[4],
// numbv[5],
// numbv[6],
// volumeid ) << endm;


return volumeid;

};
};


#endif
66 changes: 66 additions & 0 deletions StRoot/StGeant4Maker/AgMLEmcVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#ifndef __AgMLEmcVolumeId_h__
#define __AgMLEmcVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <TGeoNavigator.h>
#include <StMessMgr.h>
#include <TLorentzVector.h>
#include <TVirtualMC.h>
#include <TMath.h>

#include <TString.h>
#include <StMessMgr.h>

class AgMLEmcVolumeId : public AgMLVolumeId {

const int numberOfEtaRings = 20;

public:

AgMLEmcVolumeId() : AgMLVolumeId() { /* nada */ };

virtual int id( int* numbv ) const {


int rileft = numbv[0]; // east barrel vs west barrel
int phi = numbv[1]; // module
int superl = numbv[2]; // before / after SMD layer

TLorentzVector _direction(0,0,0,0);
TVirtualMC::GetMC()->TrackPosition( _direction );

double xg[4], xl[4];
_direction.GetXYZT( xg );
double pseudoRapidity = TMath::Abs(_direction.Eta());

// Obtain local coordinates from global coordinates
TVirtualMC::GetMC()->Gmtod( xg, xl, 1 );

// Calculate the eta ring and submodule
int eta_tow = ( pseudoRapidity * double(numberOfEtaRings) ) + 1.0;
int phi_sub = ( xl[1]>= 0 )? 1 : 0; // (-13,0)=0, (0,13)=1

// LOG_INFO << Form("eta=%f xlocal=%f %f %f | phi_sub=%i eta_tow=%i", pseudoRapidity, xl[0], xl[1], xl[2],phi_sub,eta_tow) << endm;

int volumeid = -999;

if ( rileft==1 ) {
phi = 60 - phi + 1;
if ( phi_sub==0 ) {
phi_sub=2;
}
}
else {
phi = 60+phi;
phi_sub = phi_sub + 1;
}

volumeid=10000000*rileft+100000*eta_tow+100*phi+10*phi_sub+superl;

return volumeid;

};
};


#endif
40 changes: 40 additions & 0 deletions StRoot/StGeant4Maker/AgMLEpdVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef __AgMLEpdVolumeId_h__
#define __AgMLEpdVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLEpdVolumeId : public AgMLVolumeId {
public:

AgMLEpdVolumeId(){}

virtual int id( int* numbv ) const {

int epdm = numbv[0]; // 1=east, 2=west
int epss = numbv[1]; // 1 for PP1, 2 for PP2, PP-postion 1'o,2'o clock etc
int epdt = numbv[2]; // 1:T1 trap, 2:T1 Triangular, 3:T2 Thin, 4:T3 Thick

/*

" EPD volume_id "
" 100,000 : east or west "
" 1,000 : Position clock wise, 1 to 12 "
" 10 : Tile number 1 to 31, refer EPD Drupal page"
" 1 : 1 T1 trap or T2 thin; 0 T1 triangular or T2 thick

*/

int _id = 0;
_id += 100000 * epdm;
_id += 1000 * epss;
_id += 10 * ( epdt%2 + epdt/2 );
_id += 1 * ( epdt%2 );

return _id;

};
};


#endif
28 changes: 28 additions & 0 deletions StRoot/StGeant4Maker/AgMLFstVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef __AgMLFstVolumeId_h__
#define __AgMLFstVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLFstVolumeId : public AgMLVolumeId {
public:

AgMLFstVolumeId(){}

virtual int id( int* numbv ) const {

static const int mapping[] = { 2, 3, 1 };

int disk = numbv[0];
int wedge = numbv[1];
assert( numbv[2]>0 && numbv[2]<=3 );
int sensor = mapping[ numbv[2]-1 ];


return 1000*disk + 10*wedge + sensor;

};
};


#endif
23 changes: 23 additions & 0 deletions StRoot/StGeant4Maker/AgMLHcaVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef __AgMLHcaVolumeId_h__
#define __AgMLHcaVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLHcaVolumeId : public AgMLVolumeId {
public:

AgMLHcaVolumeId(){}

virtual int id( int* numbv ) const {

int mod = numbv[0]; // module
int tow = numbv[1]; // tower

return 1000*mod + tow;

};
};


#endif
25 changes: 25 additions & 0 deletions StRoot/StGeant4Maker/AgMLMtdVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef __AgMLMtdVolumeId_h__
#define __AgMLMtdVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLMtdVolumeId : public AgMLVolumeId {
public:

AgMLMtdVolumeId(){}
// Applies to btog.version = 8 with btog.choice =13 (run 13 onwards)

virtual int id( int* numbv ) const {

int sector = numbv[0];
int module = numbv[1];
int layer = numbv[2];

return 1000 * sector + 100 * module + layer;

};
};


#endif
23 changes: 23 additions & 0 deletions StRoot/StGeant4Maker/AgMLPreVolumeId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef __AgMLPreVolumeId_h__
#define __AgMLPreVolumeId_h__

#include <StarVMC/StarAgmlLib/AgMLExtension.h>
#include <StMessMgr.h>

class AgMLPreVolumeId : public AgMLVolumeId {
public:

AgMLPreVolumeId(){}

virtual int id( int* numbv ) const {

int layer = numbv[0]; // layer
int slat = numbv[1]; // slat

return 1000*layer + slat;

};
};


#endif
Loading
Loading