diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index de35582787f..09a4c234cf1 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -47,7 +47,7 @@ jobs: strategy: fail-fast: false matrix: - test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125] + test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128] compiler: [gcc485, gcc11] env: STARENV: root5-${{ matrix.compiler }} diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index 1de6d36fe77..761780c3cd5 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -1395,12 +1395,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.so,libStarGeneratorUtil.so,libStarGeneratorEvent.so,libStarGeneratorBase.so,libMathMore.so","STAR Generator BASE",false}, + {"stargen.filt", "","", "stargen,fastjet" /*+++*/, "", "libStarGeneratorFilt.so","STAR Generator FILT (requires fastjet-3.3.4)",false}, + {"fastjet", "","", "" /*+++*/, "", "libfastjet.so","Fastjet",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 }, + {"genmuons" ,"","","", "StarPrimaryMaker", "", "Setup test for StarGenerator ala gstar", false }, {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, {"I/O Makers ","-----------","-----------","------------------------------------------","","","",kFALSE}, {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 008f2509850..fba911a478a 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -234,6 +234,7 @@ Int_t StBFChain::Instantiate() maker == "StMagFMaker" || maker == "StEEmcDbMaker" || maker == "St_geant_Maker" || + maker == "StarPrimaryMaker" || maker == "StVMCMaker") { mk = GetTopChain()->GetMakerInheritsFrom(maker); if (mk) { @@ -409,7 +410,7 @@ Int_t StBFChain::Instantiate() Int_t NwGeant = 10; // default geant parameters if (!GetOption("fzin") && !GetOption("ntin") && - !GetOption("gstar") && + !GetOption("gstar") && !GetOption("genmuons") && !GetOption("pythia")) NwGeant = 5; if (GetOption("big")) NwGeant = 20; if (GetOption("bigbig")) NwGeant = 40; @@ -420,6 +421,7 @@ Int_t StBFChain::Instantiate() if (GetOption("fzin") || GetOption("ntin") || GetOption("gstar") || + GetOption("genmuons") || GetOption("pythia") || GetOption("hijing") || GetOption("PrepEmbed") || @@ -442,6 +444,21 @@ Int_t StBFChain::Instantiate() SetGeantOptions(mk); } + if (maker == "StarPrimaryMaker") { + if ( GetOption("genmuons") ) { + LOG_INFO << "Setup StarKinematics for 80 muons per event" << endm; + TString cmd = Form( "((StarPrimaryMaker*)%p)->AddGenerator( new StarKinematics );", mk ); + ProcessLine( cmd ); + auto* kine=GetMaker("StarKine"); assert(kine); + kine->SetAttr("kine:ntrack",80); + kine->SetAttr("kine:type","mu+,mu-"); + kine->SetAttr("kine:ptmin",0.1); + kine->SetAttr("kine:ptmax",10.0); + kine->SetAttr("kine:etamin",-4.0); + kine->SetAttr("kine:etamax",+4.0); + } + } + // special maker options // m_Mode xyz // x = 1 phys_off @@ -1707,6 +1724,7 @@ void StBFChain::SetOutputFile (const Char_t *outfile){ else if (GetOption("hijing")) fFileOut = "hijing.root"; else if (GetOption("VMC")) fFileOut = "VMC.root"; else if (GetOption("gstar")) fFileOut = "gtrack.root"; + else if (GetOption("genmuons")) fFileOut = "stargen.root"; } if ( fFileOut != "") { fFileOut.ReplaceAll("*",""); @@ -1961,6 +1979,7 @@ void StBFChain::SetTreeOptions() if (GetOption("fzin") || GetOption("ntin") || GetOption("gstar") || + GetOption("genmuons") || GetOption("pythia") || GetOption("VMC") || GetOption("PrepEmbed")) { diff --git a/StRoot/StarGenerator/Kinematics/StarKinematics.cxx b/StRoot/StarGenerator/Kinematics/StarKinematics.cxx index a2c90442ba2..c911e8da4ec 100644 --- a/StRoot/StarGenerator/Kinematics/StarKinematics.cxx +++ b/StRoot/StarGenerator/Kinematics/StarKinematics.cxx @@ -46,6 +46,7 @@ StarKinematics::StarKinematics( const Char_t *name ) : StarGenerator(name) { mEvent = new StarGenEvent("kine"); gEvent = mEvent; mUser = new StarGenEvent("user"); gUser = mUser; + SetAttr( "kine:ntrack", int(0) ); } // ---------------------------------------------------------------------------- Int_t StarKinematics::PreGenerate() @@ -55,6 +56,19 @@ Int_t StarKinematics::PreGenerate() // ---------------------------------------------------------------------------- Int_t StarKinematics::Generate() { + + int ntrack=IAttr("kine:ntrack"); + if ( ntrack>0 ) + { + TString type=SAttr("kine:type"); + double ptmin=DAttr("kine:ptmin"); + double ptmax=DAttr("kine:ptmax"); + double etamin=DAttr("kine:etamin"); + double etamax=DAttr("line:etamax"); + Kine( ntrack, type, ptmin, ptmax, etamin, etamax ); + LOG_INFO << "Adding ntrack=" << ntrack << " type="<< type.Data() << endm; + mUser->Print(); + } // Copy user event into mEvent for ( Int_t i=0;iGetNumberOfParticles(); i++ ) diff --git a/tests/executest.py b/tests/executest.py index 2bb1f055033..52e7f4e3218 100755 --- a/tests/executest.py +++ b/tests/executest.py @@ -40,7 +40,11 @@ def _json_object_hook(d): for job in joblist: if job.jobid != args.jobid: continue if args.description: print("{descr}".format(**job._asdict())) - if args.command: print("root4star -b -q -l \'bfc.C({nevents}, \"{chopts}\", \"{inppath}/{inpfile}\")\'".format(**job._asdict())) + if args.command: + if job.inpfile: + print("root4star -b -q -l \'bfc.C({nevents}, \"{chopts}\", \"{inppath}/{inpfile}\")\'".format(**job._asdict())) + else: + print("root4star -b -q -l \'bfc.C({nevents}, \"{chopts}\")\'".format(**job._asdict())) if args.attribute: if args.attribute == 'fullpath': print("{}/{}".format(job.inppath, job.inpfile)) diff --git a/tests/joblist.json b/tests/joblist.json index 091ed6446ae..c8657055cea 100644 --- a/tests/joblist.json +++ b/tests/joblist.json @@ -1123,5 +1123,23 @@ "inppath": "/star/rcf/test/daq/2023/072/23072022/", "outpath": "", "nevents": "200" + }, + { + "jobid": "126", + "descr": "2023 simple simulation 80 muons", + "chopts": "sdt20230214 gstar", + "inpfile": "", + "inppath": "", + "outpath": "", + "nevents": "50" + }, + { + "jobid": "127", + "descr": "2023 simple simulation 80 muons using StarGenerator", + "chopts": "sdt20230202 stargen kinematics genmuons geant", + "inpfile": "", + "inppath": "", + "outpath": "", + "nevents": "50" } ]