Compare commits

...

147 Commits

Author SHA1 Message Date
James Szalkie 18cb077fe2 Randomized energy fix 2026-08-10 10:52:20 -04:00
James Szalkie 94169fed70 ignore 2026-08-06 12:04:04 -04:00
James Szalkie 9a1ad9bd39 AnasenML 2026-08-06 12:02:51 -04:00
James Szalkie 6ef362fca3 gitignore 2026-08-06 12:01:53 -04:00
james szalkie 304cf2b7e3 Read me added workflow 2026-07-22 11:05:41 -04:00
James Szalkie ff2171c2f1 Plotting updates 2026-07-20 14:43:13 -04:00
James Szalkie 9848725f58 LISE agreement 2026-07-20 13:51:50 -04:00
james szalkie 26be64416c range v thickness graph 2026-07-20 10:06:59 -04:00
James Szalkie d6e72f1cc7 punch-through study 2026-07-17 16:10:00 -04:00
James Szalkie f3882bc313 QQQ punchthrough 2026-07-15 16:10:37 -04:00
James Szalkie 9f39dad3bd fixed beam and macros 2026-07-15 14:25:28 -04:00
James Szalkie 4d74f51db8 geant code and sx3 thickness correction 2026-07-15 11:26:38 -04:00
James Szalkie fe711c5485 Fixed .cc geometry 2026-07-09 11:33:33 -04:00
James Szalkie 7ed01201aa fixed alpha punch-through plots 2026-07-08 14:04:57 -04:00
James Szalkie 99fe598ee4 Fixed eloss bug 2026-07-01 14:59:11 -04:00
James Szalkie 3a0c04b1c0 saving work again, refining and benchmarking energy loss and deposition 2026-06-18 15:40:15 -04:00
James Szalkie 4db59641cd refining energy loss with Lise 2026-06-17 12:03:07 -04:00
james szalkie bcaa540a95 expanded dual-plotter into multi-plotter 2026-06-15 14:31:46 -04:00
James Szalkie 7fb4fc542c screwy plot 2026-06-05 16:00:31 -04:00
James Szalkie 19928ac432 QQQ data 2026-06-05 15:47:35 -04:00
James Szalkie e4a490245c python structure fixes 2026-06-05 14:14:21 -04:00
James Szalkie 92d831678e QQQ 2026-06-04 17:26:34 -04:00
James Szalkie 151e649fe9 concatation fix 2026-06-04 12:36:19 -04:00
James Szalkie 258306d442 sausage eliminated 2026-06-04 12:16:54 -04:00
James Szalkie d94795ae33 expanded analysis 2026-06-03 10:35:26 -04:00
James Szalkie 7b489612f6 more plotting troubleshooting 2026-05-29 16:48:53 -04:00
James Szalkie 4feca6c104 sequential decay 2026-05-28 11:40:52 -04:00
James Szalkie d2953531ef Cleaned up old Eloss functions in favor of new program 2026-05-27 13:18:51 -04:00
james szalkie b4eb81a0ec OS checker on makefile 2026-05-26 12:25:38 -04:00
James Szalkie f001bb21e0 fixed memory issues and dual plotting 2026-05-26 10:55:34 -04:00
James Szalkie b1a53e9047 debug workflow of python app 2026-05-22 14:41:23 -04:00
James Szalkie 17e36ad451 Streamlined, save new data as root file 2026-05-22 14:04:52 -04:00
James Szalkie 804c89b320 Name resolved particles for isotopes 2026-05-21 12:36:23 -04:00
James Szalkie 6ef916ba1c cmd line feature for eloss app 2026-05-21 11:59:47 -04:00
James Szalkie ca33ba17b3 energy loss app 2026-05-20 16:54:28 -04:00
James Szalkie f317505721 new analysis and comments 2026-05-19 16:00:49 -04:00
James Szalkie 168904b260 eloss calculator 2026-05-18 15:11:08 -04:00
James Szalkie 8d08b0d355 Expanded analysis capabilities and script 2026-05-14 14:52:22 -04:00
James Szalkie 851d044f25 Plot full kientic energy spectrum 2026-05-13 13:48:41 -04:00
James Szalkie f0f5b57afc Catima data source and new Eloss table generator 2026-05-12 16:01:10 -04:00
James Szalkie 36f9958562 new eloss function 2026-05-11 12:57:30 -04:00
James Szalkie 8cf637d0dd change desnity from pressure 2026-04-20 17:18:09 -04:00
James Szalkie 049365a549 E vs dE plotter 2026-04-20 15:31:53 -04:00
James Szalkie fe112a6004 updated root script 2026-04-20 13:37:31 -04:00
James Szalkie 38ac66a721 NIST stopping table file 2026-04-20 11:11:36 -04:00
James Szalkie 10a210cbab Energy loss loop 2026-04-14 16:04:58 -04:00
James Szalkie 36b230d23a energy loss table plot 2026-04-13 16:04:00 -04:00
James Szalkie 2bd5b18f63 rearranged energy loss settings, added macro script, updated mass plotter 2026-04-13 15:44:39 -04:00
James Szalkie 9ae1c99200 He 2026-04-09 15:13:16 -04:00
James Szalkie 0337877dda fixed detached head ugh 2026-04-09 13:09:20 -04:00
James Szalkie 1339218088 vis 2 2026-04-02 15:56:55 -04:00
James Szalkie 5c48fd699f Vis enabled 2026-04-02 15:18:38 -04:00
James Szalkie 4bbb1399cc two trees, cleaned up 2026-04-02 12:50:48 -04:00
James Szalkie 6e969434da energy dep comments 2026-03-30 15:21:44 -04:00
James Szalkie e78b378e05 Energy deposition 2026-03-30 10:59:14 -04:00
James Szalkie a0f0a7083d redo 2026-03-30 10:49:41 -04:00
James Szalkie e3ffe56351 ROOT tinkering 2026-03-12 12:00:38 -04:00
Vignesh Sitaraman 9af7e70f26 modified: MakeVertex.C 2026-03-06 16:09:28 -05:00
Vignesh Sitaraman 6e6d281dd3 modified: MakeVertex.C hist scale changed 2026-03-06 16:00:27 -05:00
Vignesh Sitaraman 411ef2d9de modified: MakeVertex.C implemented diagnostics to compare the behaviour of singleton cathodes vs events with higher multiplicty 2026-03-06 15:56:48 -05:00
Vignesh Sitaraman cbd4bf42a7 modified: MakeVertex.C 2026-02-26 12:42:02 -05:00
Vignesh Sitaraman 601caa3881 modified: MakeVertex.C 2026-02-24 21:06:24 -05:00
Vignesh Sitaraman 2938411c35 modified: .gitignore
new file:   ELoss/Eloss_17F
	new file:   ELoss/Eloss_27Al
	new file:   ELoss/Eloss_alpha
	new file:   ELoss/Eloss_p
	modified:   MakeVertex.C
	deleted:    MakeVertex.C:Zone.Identifier
	deleted:    MakeVertex.h:Zone.Identifier
2026-02-24 11:59:01 -05:00
Vignesh Sitaraman 8c2657255c modified: Armory/ClassPW.h
new file:   Armory/SX3Geom.h
	modified:   MakeVertex.C
	renamed:    sx3cal/sx3cal/EXFit.C -> sx3cal/EXFit.C
	renamed:    sx3cal/sx3cal/LRFit.C -> sx3cal/LRFit.C
	renamed:    sx3cal/sx3cal/backgains.dat -> sx3cal/backgains.dat
	renamed:    sx3cal/sx3cal/backgains.dat.unity -> sx3cal/backgains.dat.unity
	renamed:    sx3cal/sx3cal/frontgains.dat -> sx3cal/frontgains.dat
	renamed:    sx3cal/sx3cal/frontgains.dat.unity -> sx3cal/frontgains.dat.unity
	renamed:    sx3cal/sx3cal/rightgains.dat -> sx3cal/rightgains.dat
	renamed:    sx3cal/sx3cal/rightgains.dat.unity -> sx3cal/rightgains.dat.unity
2026-02-19 14:49:49 -05:00
Vignesh Sitaraman 00f8460e36 modified: MakeVertex.C
new file:   sx3cal/sx3cal/EXFit.C
	new file:   sx3cal/sx3cal/LRFit.C
	new file:   sx3cal/sx3cal/backgains.dat
	new file:   sx3cal/sx3cal/backgains.dat.unity
	new file:   sx3cal/sx3cal/frontgains.dat
	new file:   sx3cal/sx3cal/frontgains.dat.unity
	new file:   sx3cal/sx3cal/rightgains.dat
	new file:   sx3cal/sx3cal/rightgains.dat.unity
2026-02-18 16:01:55 -05:00
Vignesh Sitaraman 7260d42d8d modified: Armory/ANASEN_model.C
modified:   Armory/ClassPW.h
	modified:   MakeVertex.C
	modified:   TrackRecon.C
2026-02-18 12:06:54 -05:00
Vignesh Sitaraman 4401ae8eb2 new file: MakeVertex.C
new file:   MakeVertex.C:Zone.Identifier
	new file:   MakeVertex.h
	new file:   MakeVertex.h:Zone.Identifier
	modified:   TrackRecon.C
2026-02-11 15:08:11 -05:00
Vignesh Sitaraman 282aa5ecea modified: .gitignore
new file:   Armory/ClassData.h
	new file:   Armory/Hit.h
	modified:   Armory/Makefile
	new file:   Armory/fsuReader.h
	new file:   Armory/macro.h
	new file:   BatchProcess.sh
	modified:   ProcessRun.sh
	modified:   process_mapped_run.sh
2026-02-10 17:01:27 -05:00
Vignesh Sitaraman 9f949edd00 new file: RunTimeSummary.C
new file:   Timing_Summary_Matplotlib.png
	modified:   TrackRecon.C
	modified:   process_mapped_run.sh
2026-02-09 16:11:07 -05:00
Vignesh Sitaraman 56cc900b61 modified: .gitignore
modified:   TrackRecon.C
	deleted:    batchproces_mapped_run.sh
	modified:   process_mapped_run.sh
2026-02-05 15:20:17 -05:00
Vignesh Sitaraman 17ab8c884a modified: TrackRecon.C
new file:   batchproces_mapped_run.sh
	new file:   process_mapped_run.sh
2026-01-30 10:53:34 -05:00
Vignesh Sitaraman 67199cdb60 modified: QQQ_Calcheck.C
modified:   TrackRecon.C
	new file:   qqq_Calib.dat
	new file:   qqq_GainMatch.dat
	renamed:    slope_intercept_cathode.txt -> slope_intercept_cathode.dat
	renamed:    slope_intercept_results.txt -> slope_intercept_results.dat
	renamed:    slope_intercept_results_anode.txt -> slope_intercept_results_anode.dat
2026-01-28 14:27:42 -05:00
Vignesh Sitaraman ac035370b4 modified: QQQ_Calcheck.C made changes to bring it in line with the new consistent Wedge-Ring mapping
modified:   TrackRecon.C
2026-01-25 14:15:45 -05:00
Vignesh Sitaraman c4b543bdeb modified: ProcessRun.sh
modified:   TrackRecon.C
	modified:   mapping.h corrrrected QQQ0 rings
2026-01-25 11:23:27 -05:00
Vignesh Sitaraman 0a8432e4e3 modified: TrackRecon.C phi and theta plots for PC and QQQ included 2026-01-23 17:55:55 -05:00
Vignesh Sitaraman 0883ebdb6e modified: Armory/Makefile
deleted:    Armory/README.md
	modified:   Calibration.C Sudarsan pointed out that the gain match and calibration stages have the ring and wedge swapped, so I fixed that.
	modified:   ProcessRun.sh changes for running on laptop
	modified:   TrackRecon.C same inconsistency as in Calibration.C fixed
	deleted:    makeplots.C not used anymore
	modified:   mapping.h corrected teh mapping for the QQQs poptentially, need to confirm
	modified:   mapping_old.txt
2026-01-22 15:07:10 -05:00
Vignesh Sitaraman 9c20c4abfe modified: TrackRecon.C QQQ wedge channels flipped but the energy gains have not, thus QQQ energy needs to be recalibrated. 2026-01-21 11:56:32 -05:00
Vignesh Sitaraman 13bfafe9c4 modified: Armory/ClassPW.h
modified:   TrackRecon.C
2026-01-18 15:41:54 -05:00
Vignesh Sitaraman 22e32c7ebc Refactor plotting logic in TrackRecon::Process for clarity and added neighbour checks for anode and cathode hits 2026-01-16 16:36:25 -05:00
Vignesh Sitaraman 4599ad2a38 modified: TrackRecon.C 2026-01-13 17:55:27 -05:00
Vignesh Sitaraman c1ffaa8340 modified: TrackRecon.C 2026-01-13 17:51:01 -05:00
Vignesh Sitaraman 19286055ea modified: TrackRecon.C inlcuded timing plots for the PC 2026-01-13 12:04:14 -05:00
Vignesh Sitaraman 82c2127b4d modified: TrackRecon.C included test cases for 1,2,&3 cathode events. Also stopped sorting the cathode anmd anodehits arrays. 2026-01-09 15:49:32 -05:00
Vignesh Sitaraman d81e35d5e4 modified: Analyzer.C
modified:   TrackRecon.C Reconstruction only for the QQQ tracks
	new file:   TrackRecon.h
2025-12-19 11:56:10 -05:00
Vignesh Sitaraman 97880940be modified: .gitignore
modified:   .vscode/settings.json
	modified:   Analyzer.C
	modified:   Calibration.C
	modified:   GainMatchQQQ.C
	modified:   QQQ_Calcheck.C
2025-12-16 15:41:21 -05:00
Vignesh Sitaraman aee3a2467d modified: Calibration.C
modified:   GainMatchQQQ.C
	modified:   QQQ_Calcheck.C
	modified:   makeplots.C
2025-12-01 13:49:23 -05:00
Vignesh Sitaraman c32215e293 modified: .vscode/settings.json
modified:   Calibration.C
	modified:   GainMatchQQQ.C
	new file:   QQQ_Calcheck.C
	new file:   QQQ_Calcheck.h
	new file:   makeplots.C
2025-11-26 11:32:16 -05:00
Vignesh Sitaraman 535afcb704 modified: Calibration.C
modified:   GainMatchQQQ.C
2025-11-17 18:33:11 -05:00
Vignesh Sitaraman 0773b9e6cc modified: .gitignore
modified:   .vscode/settings.json
	renamed:    HistPlotter.h -> Armory/HistPlotter.h
	new file:   Armory/LICENSE
	new file:   Armory/README.md
	modified:   Calibration.C
	modified:   GainMatchQQQ.C
	modified:   GainMatchSX3.C
	modified:   sx3_GainMatchfront.txt
2025-11-17 09:33:08 -05:00
Vignesh Sitaraman 7582731de4 new file: sx3_BackGains.txt
new file:   sx3_GainMatchfront.txt
2025-10-29 17:47:40 -04:00
Vignesh Sitaraman 49de3b64a8 modified: Analyzer.C
modified:   GainMatchSX3.C
	modified:   GainMatchSX3Front.C
	new file:   HistPlotter.h
2025-10-29 17:42:54 -04:00
Vignesh Sitaraman 61473ca14e modified: Calibration.C use both front and back gains
modified:   GainMatchSX3.C changed structure a bit
	modified:   GainMatchSX3Front.C removed some redundant code that I was trying out
2025-10-06 15:11:31 -04:00
Vignesh Sitaraman ecd755e09c modified: Calibration.C looking at 1d hists for sx3 backs 2025-09-30 15:45:16 -04:00
Vignesh Sitaraman 265ebd3372 modified: Calibration.C
modified:   GainMatchQQQ.C
	modified:   GainMatchSX3.C
	modified:   GainMatchSX3Front.C trying out not doing back gainmatching to see if that improves fits.
2025-09-30 15:17:00 -04:00
Vignesh Sitaraman afef56df12 modified: Analyzer.C
modified:   GainMatchSX3.C
2025-09-22 13:31:22 -04:00
Vignesh Sitaraman 579f4e4f6c modified: .vscode/settings.json
modified:   GainMatchSX3.C to make the calib a 2 factor calib insteade of inlcuding the fronts
	modified:   GainMatchSX3Front.C chcanged the readout for the  new back calib
2025-09-18 13:28:02 -04:00
Vignesh Sitaraman d59b22ff78 modified: Calibration.C 2025-09-17 13:42:12 -04:00
Vignesh Sitaraman 49610e9c2f modified: Calibration.C 2025-09-17 13:22:11 -04:00
Vignesh Sitaraman fa4b1dd2f5 new file: Calibration.C
renamed:    GainMatch.h -> Calibration.h
	renamed:    GainMatch.C -> GainMatchQQQ.C
	new file:   GainMatchQQQ.h
2025-09-04 14:56:55 -04:00
Vignesh Sitaraman 877f765357 modified: GainMatchSX3Front.C 2025-08-20 17:09:01 -07:00
Vignesh Sitaraman 06fbc1afd9 modified: GainMatchSX3.C
modified:   GainMatchSX3Front.C
2025-08-20 15:25:40 -07:00
Vignesh Sitaraman b44ffd7fdf modified: .vscode/c_cpp_properties.json made changes to include the laptop
modified:   GainMatchSX3.C included flags to allow interactive mode and verbose fit
	modified:   GainMatchSX3Front.C included flags to allow interactive mode and verbose fit
2025-07-31 12:07:07 -04:00
Vignesh Sitaraman 3d0d176f5a modified: GainMatchSX3.C
modified:   GainMatchSX3Front.C
    changes made to the GainMatchSX3.C and GainMatchSX3Front.C files to include reduced Chisquared and fixed uncertainties for the gain matching process.
2025-07-24 16:12:46 -04:00
Vignesh Sitaraman 4fc05ea338 new file: GainMatchSX3Front.C using a 2 step fit for the same method, going to implement a inverse fit now wherein the fronts are fit first and then the sum is fit against the backs.
new file:   GainMatchSX3Front.h
	new file:   GainMatchSX3Front1.C
2025-07-21 11:19:27 -04:00
Vignesh Sitaraman dd2ec66db1 modified: GainMatchSX3.C multidimfit now runs but does not work as expected,
the fit curve is empty.
2025-07-09 15:30:12 -04:00
Vignesh Sitaraman a8d4e8f0f6 modified: GainMatchSX3.C multidimfit WIP 2025-07-08 13:53:00 -04:00
Vignesh Sitaraman 2864036ec8 fix: correct include path formatting in c_cpp_properties.json 2025-06-10 11:31:08 -04:00
Vignesh Sitaraman 050cb425d5 modified: GainMatchSX3.C 2025-06-10 11:24:01 -04:00
Vignesh Sitaraman fb355a3cc4 modified: GainMatchSX3.C
changes made to GainMatchSX3  when I found a bug in the way the sx3 condition was being checked
2025-06-10 11:18:08 -04:00
Vignesh Sitaraman 5b43d60b30 modified: GainMatchSX3.C changed terminate to accomodate for events which don't have a back but have more than 3 SX3hits 2025-05-27 13:29:01 -04:00
Vignesh Sitaraman e86ab5ed4d modified: GainMatchSX3.C gainmatching of backs fixed. fronts in progress 2025-05-19 13:16:22 -04:00
Vignesh Sitaraman 9cadfdd191 modified: GainMatchSX3.C 2025-05-13 13:32:22 -04:00
Vignesh Sitaraman d4582d80ff modified: GainMatch.C
new file:   GainMatchSX3.C
	new file:   GainMatchSX3.h
2025-05-12 17:21:25 -04:00
Vignesh Sitaraman 18870ed82b modified: GainMatch.C 2025-04-25 16:18:58 -04:00
Vignesh Sitaraman 5c1c5348f4 modified: GainMatch.C QQQs now show up as gain matched. 2025-04-25 15:41:10 -04:00
Vignesh Sitaraman 65ab69ebe6 modified: GainMatch.C 2025-04-24 10:48:14 -04:00
Vignesh Sitaraman 1df7470ca1 modified: .vscode/settings.json 2025-04-10 09:51:36 -04:00
Vignesh Sitaraman a7a765c059 modified: Analyzer.C
new file:   GainMatch.C
	new file:   GainMatch.h
2025-04-10 09:50:54 -04:00
Vignesh Sitaraman 39e8f41ab1 modified: Analyzer.C implemented basic trackreconstruction
modified:   Armory/ANASEN_model.C changed qqq radii
	modified:   Armory/ClassPW.h implemented basic trackreconstruction
2025-02-27 10:34:41 -05:00
Vignesh Sitaraman 9225620426 modified: Analyzer.C
modified:   Armory/ClassPW.h edited to account for the 4 wire offset instead of 3 in cathodes. This has been crossreferenced using the alpha source data in QQQ coinincidence to confirm
    the position of the source.
2025-02-21 15:40:52 -05:00
Vignesh Sitaraman 2225b3a942 modified: .gitignore 2025-02-17 17:06:33 -05:00
Vignesh Sitaraman 6cfb38b564 modified: Analyzer.C 2025-02-17 17:03:58 -05:00
Vignesh Sitaraman cb72c14ca4 modified: Analyzer.C modfied the algorithm for selection of valid cathodes, the section is now based on geometry
modified:   Armory/ClassPW.h the rotation of the cathodes was reversed
2025-02-17 16:59:08 -05:00
Vignesh Sitaraman 5995081396 modified: Analyzer.C
modified:   Armory/ClassPW.h
    adjusted the Cathode geometry to  incorporate the offsett of 3 wires
2025-02-05 14:59:02 -05:00
Vignesh Sitaraman d623e0cd17 modified: Analyzer.C
made changes to correct for geomtry and eliminating redundant variables to a make the  code more readable
	modified:   Armory/ClassPW.h
    made changes to correct for the fact that the physical geometry of the detector is not the same as the geometry in the simulation, it is reversed and has an offset of 3
2025-02-05 08:23:23 -05:00
Vignesh Sitaraman 8d7322cf5a modified: Analyzer.C 2025-02-03 10:32:07 -05:00
Vignesh Sitaraman 699b0f8701 modified: Analyzer.C
HPZProjection implemented, testing seems to result in a plot with 0s. Need to debug
2025-01-31 09:25:37 -05:00
Vignesh Sitaraman 02213caaee modified: Analyzer.C
implementation of function to fgiure out the cqreelated cathodes in events
2025-01-28 10:19:14 -05:00
Vignesh Sitaraman 56a6389b4f modified: Analyzer.C
modified the analyser to include gain matching for the anodes and the cathodes
	modified:   FitHistogramsWithTSpectrum_Sequential_Improved.C
	modified:   MatchAndPlotCentroids.C
	modified:   centroids.txt
	modified:   slope_intercept_results.txt
2025-01-27 16:34:39 -05:00
Vignesh Sitaraman b99ad4e4d7 new file: FitHistogramsWithTSpectrum_Sequential_Improved.C
new file:   MatchAndPlotCentroids.C
	new file:   centroids.txt
	new file:   centroids_edited.txt
	new file:   slope_intercept_cathode.txt
	new file:   slope_intercept_results.txt
	new file:   slope_intercept_results_anode.txt
2025-01-27 15:11:27 -05:00
Vignesh Sitaraman a5dfa2ecd3 modified: .vscode/settings.json
modified:   Analyzer.C
	modified:   Analyzer.h
	modified:   ProcessRun.sh
2025-01-27 10:55:22 -05:00
Vignesh Sitaraman 26e943adc8 modified: .vscode/settings.json
modified:   Analyzer.C
2025-01-27 09:51:25 -05:00
vs19g 42e093b104 modified: .vscode/c_cpp_properties.json
modified:   .vscode/settings.json
	modified:   Analyzer.C
	new file:   Armory/#ClassPW.h#
	modified:   Armory/ClassDet.h
	modified:   Armory/ClassPW.h
	modified:   Armory/Mapper.cpp
2025-01-17 11:18:07 -05:00
dirac 3129339647 modified: Analyzer.C
modified:   ProcessRun.sh
	modified:   mapping.h
2024-11-05 08:48:21 -05:00
dirac 7a70340b18 modified: Analyzer.C
modified:   mapping.h
2024-10-30 09:28:01 -04:00
dirac a10081ea81 modified: .vscode/settings.json
modified:   Analyzer.C
	modified:   Analyzer.h
	modified:   Armory/ClassDet.h
	modified:   Armory/ClassPW.h
	modified:   Armory/Mapper.cpp
	modified:   PCGainMatch.C
	modified:   ProcessRun.sh
	modified:   mapping.h
2024-10-25 15:02:59 -04:00
vs19g 4cb8a2c48c new file: Analyzer1.C
new file:   Analyzer1.h
2024-10-04 12:43:24 -04:00
vs19g fe6dbee171 Refactor PCGainMatch.C and Analyzer.C for improved efficiency and readability 2024-10-01 14:13:53 -04:00
vs19g 7805481ead Refactor PCGainMatch.C and Analyzer.C for improved efficiency and readability 2024-09-16 10:25:13 -04:00
vs19g 511b4aa808 modified: PCGainMatch.C 2024-09-06 15:06:32 -04:00
vs19g 43233ceb02 modified: PCGainMatch.C 2024-09-06 14:32:22 -04:00
vs19g 68fc36a8f6 modified: PCGainMatch.C 2024-09-03 16:41:17 -04:00
vs19g a6e754b958 modified: Analyzer.C
new file:   PCGainMatch.C
	new file:   PCGainMatch.h
2024-08-28 10:49:36 -04:00
vs19g 48ede97992 modified: Analyzer.C implemented cuts and histograms for the 2D histograms 2024-08-26 11:41:06 -04:00
vs19g f0a393abe2 modified: Analyzer.C 2024-08-26 10:34:13 -04:00
vs19g 4ba9c73b98 modified: Analyzer.C 2024-08-26 10:33:29 -04:00
vs19g 238ec8961e modified: Analyzer.C 2024-08-26 10:33:29 -04:00
192 changed files with 1029599 additions and 4572 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

22
.gitignore vendored
View File

@ -4,9 +4,29 @@ EventBuilder*
*.pcm
*.root
*.exe
*.txt
*.err
*.seq
*.png
*.pdf
*.keras
Mapper
AnasenMS
Armory/anasenMS
data/
data_proton/
Sudarshan/
Analyzer_C_ACLiC_dict0713aaa966_dictContent.h
.gitignore
Analyzer_C_ACLiC_dict5411fecd5c_dictUmbrella.h
gainmatch.C
gainmatch.h
MakePlotsQQQ.C
MakePlotsQQQ.h
MakePlotsSX3.C
MakePlotsSX3.h
qqq_gains_det3.dat
qqq_relative_gains.dat
Armory/CorrelateQQQ.h
QQQStage2.C

View File

@ -1,23 +1,24 @@
{
"configurations": [
{
"name": "splitpole",
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/home/splitpole/cern/root/**"
"/opt/root-6.36.06/include",
"/home/jamesszalkie/anasen/Armory"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
"compilerPath": "/usr/bin/g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
},
{
"name": "Ryan",
"name": "Hades",
"includePath": [
"${workspaceFolder}/**",
"/home/ryan/Downloads/root_build/**",
"/home/ryan/Downloads/root_build/include"
"/usr/include/x86_64-linux-gnu/qt6/**",
"/usr/local/cern/root_v6.26.06/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
@ -29,7 +30,8 @@
"name": "RyanUbuntu",
"includePath": [
"${workspaceFolder}/**",
"/opt/root/**"
"/usr/include/x86_64-linux-gnu/qt6/**",
"/opt/root/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
@ -38,10 +40,11 @@
"intelliSenseMode": "linux-gcc-x64"
},
{
"name": "RyanHome",
"name": "Anasen",
"includePath": [
"${workspaceFolder}/**",
"/home/ryan/root_v6.30.06/**"
"/usr/include/x86_64-linux-gnu/qt6/**",
"/opt/root/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
@ -50,10 +53,38 @@
"intelliSenseMode": "linux-gcc-x64"
},
{
"name": "Dirac",
"name": "Splitpole",
"includePath": [
"${workspaceFolder}/**",
"/usr/opt/root/**"
"/usr/include/x86_64-linux-gnu/qt6/**",
"/home/splitpole/cern/root/include/**",
"/usr/include/x86_64-linux-gnu/qt6/QtWidgets",
"/usr/include/x86_64-linux-gnu/qt6/QtCore"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
},
{
"name": "Penguin",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/x86_64-linux-gnu/qt6/**",
"/usr/local/cern/root/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
},
{
"name": "VigneshROG",
"includePath": [
"${workspaceFolder}/**",
"/home/vsitaraman/root/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",

40
.vscode/settings.json vendored
View File

@ -90,6 +90,42 @@
"processRun.C": "cpp",
"TrackRecon.C": "cpp",
"processRuns.C": "cpp",
"Analysis.C": "cpp"
}
"Analysis.C": "cpp",
"datastructs.h": "c",
"ANASENPlotEdit.C": "cpp",
"GetMean_Q3_new.C": "cpp",
"AlphaCal_new.C": "cpp",
"f1.C": "cpp",
"GeoCal_Maria_new.C": "cpp",
"PCPulser_All_new.C": "cpp",
"PosCal_2.C": "cpp",
"AutoFit.C": "cpp",
"Fitting.C": "cpp",
"PCGainMatch.C": "cpp",
"Analyzer1.C": "cpp",
"FitHistogramsWithTSpectrum_Sequential_Improved.C": "cpp",
"PlotAndFitCentroids.C": "cpp",
"MatchAndPlotCentroids.C": "cpp",
"GainMatch.C": "cpp",
"GainMatchSX3.C": "cpp",
"RelBack_Fix_new.C": "cpp",
"SiRelativeGains_Step1_new.C": "cpp",
"charconv": "cpp",
"format": "cpp",
"GainMatchSX3Front.C": "cpp",
"GainMatchSX3Front1.C": "cpp",
"Calibration.C": "cpp",
"GainMatchQQQ.C": "cpp",
"UTF-8gainmatch.C": "cpp",
"MakePlotsQQQ.C": "cpp",
"MakePlotsSX3.C": "cpp",
"QQQ_Calibcheck.C": "cpp",
"QQQ_Calcheck.C": "cpp",
"makeplots.C": "cpp",
"GlobalMinimizeQQQ.C": "cpp",
"QQQStage2.C": "cpp",
"inspect.C": "cpp"
},
"github-enterprise.uri": "https://fsunuc.physics.fsu.edu",
"C_Cpp.default.compilerPath": "/usr/bin/gcc"
}

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@ public :
Det sx3;
Det qqq;
Det pc ;
Det misc;
ULong64_t evID;
UInt_t run;
@ -40,6 +41,13 @@ public :
TBranch *b_pcCh; //!
TBranch *b_pcE; //!
TBranch *b_pcT; //!
TBranch *b_miscMulti; //!
TBranch *b_miscID; //!
TBranch *b_miscCh; //!
TBranch *b_miscE; //!
TBranch *b_miscT; //!
TBranch *b_miscTf; //!
Analyzer(TTree * /*tree*/ =0) : fChain(0) { }
virtual ~Analyzer() { }
@ -92,6 +100,13 @@ void Analyzer::Init(TTree *tree){
fChain->SetBranchAddress("pcCh", &pc.ch, &b_pcCh);
fChain->SetBranchAddress("pcE", &pc.e, &b_pcE);
fChain->SetBranchAddress("pcT", &pc.t, &b_pcT);
fChain->SetBranchAddress("miscMulti", &misc.multi, &b_miscMulti);
fChain->SetBranchAddress("miscID", &misc.id, &b_miscID);
fChain->SetBranchAddress("miscCh", &misc.ch, &b_miscCh);
fChain->SetBranchAddress("miscE", &misc.e, &b_miscE);
fChain->SetBranchAddress("miscT", &misc.t, &b_miscT);
// fChain->SetBranchAddress("miscF", &misc.tf, &b_miscTf);
}

402
Analyzer1.C Normal file
View File

@ -0,0 +1,402 @@
#define Analyzer1_cxx
#include "Analyzer1.h"
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TMath.h>
#include <utility>
#include <algorithm>
#include "Armory/ClassSX3.h"
#include "Armory/ClassPW.h"
#include "TVector3.h"
TH2F * hsx3IndexVE;
TH2F * hqqqIndexVE;
TH2F * hpcIndexVE;
TH2F * hsx3Coin;
TH2F * hqqqCoin;
TH2F * hpcCoin;
TH2F * hqqqPolar;
TH2F * hsx3VpcIndex;
TH2F * hqqqVpcIndex;
TH2F * hqqqVpcE;
TH2F * hsx3VpcE;
TH2F * hanVScatsum;
int padID = 0;
SX3 sx3_contr;
PW pw_contr;
TVector3 hitPos;
bool HitNonZero;
TH1F * hZProj;
void Analyzer1::Begin(TTree * /*tree*/){
TString option = GetOption();
hsx3IndexVE = new TH2F("hsx3IndexVE", "SX3 index vs Energy; sx3 index ; Energy", 24*12, 0, 24*12, 400, 0, 5000); hsx3IndexVE->SetNdivisions( -612, "x");
hqqqIndexVE = new TH2F("hqqqIndexVE", "QQQ index vs Energy; QQQ index ; Energy", 4*2*16, 0, 4*2*16, 400, 0, 5000); hqqqIndexVE->SetNdivisions( -1204, "x");
hpcIndexVE = new TH2F("hpcIndexVE", "PC index vs Energy; PC index ; Energy", 2*24, 0, 2*24, 400, 0, 4000); hpcIndexVE->SetNdivisions( -1204, "x");
hsx3Coin = new TH2F("hsx3Coin", "SX3 Coincident", 24*12, 0, 24*12, 24*12, 0, 24*12);
hqqqCoin = new TH2F("hqqqCoin", "QQQ Coincident", 4*2*16, 0, 4*2*16, 4*2*16, 0, 4*2*16);
hpcCoin = new TH2F("hpcCoin", "PC Coincident", 2*24, 0, 2*24, 2*24, 0, 2*24);
hqqqPolar = new TH2F("hqqqPolar", "QQQ Polar ID", 16*4, -TMath::Pi(), TMath::Pi(),16, 10, 50);
hsx3VpcIndex = new TH2F("hsx3Vpcindex", "sx3 vs pc; sx3 index; pc index", 24*12, 0, 24*12, 48, 0, 48);
hsx3VpcIndex->SetNdivisions( -612, "x");
hsx3VpcIndex->SetNdivisions( -12, "y");
hqqqVpcIndex = new TH2F("hqqqVpcindex", "qqq vs pc; qqq index; pc index", 4*2*16, 0, 4*2*16, 48, 0, 48);
hqqqVpcIndex->SetNdivisions( -612, "x");
hqqqVpcIndex->SetNdivisions( -12, "y");
hqqqVpcE = new TH2F("hqqqVpcEnergy", "qqq vs pc; qqq energy; pc energy", 400, 0, 5000, 400, 0, 5000);
hqqqVpcE->SetNdivisions( -612, "x");
hqqqVpcE->SetNdivisions( -12, "y");
hsx3VpcE = new TH2F("hsx3VpcEnergy", "sx3 vs pc; sx3 energy; pc energy", 400, 0, 5000, 400, 0, 5000);
hsx3VpcE->SetNdivisions( -612, "x");
hsx3VpcE->SetNdivisions( -12, "y");
hZProj = new TH1F("hZProj", "Z Projection", 1200, -600, 600);
hanVScatsum = new TH2F("hanVScatsum", "Anode vs Cathode Sum; Anode E; Cathode E", 400,0 , 10000, 400, 0 , 16000);
sx3_contr.ConstructGeo();
pw_contr.ConstructGeo();
}
Bool_t Analyzer1::Process(Long64_t entry){
// if ( entry > 100 ) return kTRUE;
hitPos.Clear();
HitNonZero = false;
// if( entry > 1) return kTRUE;
// printf("################### ev : %llu \n", entry);
b_sx3Multi->GetEntry(entry);
b_sx3ID->GetEntry(entry);
b_sx3Ch->GetEntry(entry);
b_sx3E->GetEntry(entry);
b_sx3T->GetEntry(entry);
b_qqqMulti->GetEntry(entry);
b_qqqID->GetEntry(entry);
b_qqqCh->GetEntry(entry);
b_qqqE->GetEntry(entry);
b_qqqT->GetEntry(entry);
b_pcMulti->GetEntry(entry);
b_pcID->GetEntry(entry);
b_pcCh->GetEntry(entry);
b_pcE->GetEntry(entry);
b_pcT->GetEntry(entry);
sx3.CalIndex();
qqq.CalIndex();
pc.CalIndex();
// sx3.Print();
//########################################################### Raw data
// //======================= SX3
std::vector<std::pair<int, int>> ID; // first = id, 2nd = index
for( int i = 0; i < sx3.multi; i ++){
ID.push_back(std::pair<int, int>(sx3.id[i], i));
hsx3IndexVE->Fill( sx3.index[i], sx3.e[i] );
for( int j = i+1; j < sx3.multi; j++){
hsx3Coin->Fill( sx3.index[i], sx3.index[j]);
}
for( int j = 0; j < pc.multi; j++){
hsx3VpcIndex->Fill( sx3.index[i], pc.index[j] );
// if( sx3.ch[index] > 8 ){
// hsx3VpcE->Fill( sx3.e[i], pc.e[j] );
// }
}
}
if( ID.size() > 0 ){
std::sort(ID.begin(), ID.end(), [](const std::pair<int, int> & a, const std::pair<int, int> & b) {
return a.first < b.first;
} );
// printf("##############################\n");
// for( size_t i = 0; i < ID.size(); i++) printf("%zu | %d %d \n", i, ID[i].first, ID[i].second );
std::vector<std::pair<int, int>> sx3ID;
sx3ID.push_back(ID[0]);
bool found = false;
for( size_t i = 1; i < ID.size(); i++){
if( ID[i].first == sx3ID.back().first) {
sx3ID.push_back(ID[i]);
if( sx3ID.size() >= 3) {
found = true;
}
}else{
if( !found ){
sx3ID.clear();
sx3ID.push_back(ID[i]);
}
}
}
// printf("---------- sx3ID Multi : %zu \n", sx3ID.size());
if( found ){
int sx3ChUp, sx3ChDn, sx3ChBk;
float sx3EUp, sx3EDn;
// printf("------ sx3 ID : %d, multi: %zu\n", sx3ID[0].first, sx3ID.size());
for( size_t i = 0; i < sx3ID.size(); i++ ){
int index = sx3ID[i].second;
// printf(" %zu | index %d | ch : %d, energy : %d \n", i, index, sx3.ch[index], sx3.e[index]);
if( sx3.ch[index] < 8 ){
if( sx3.ch[index] % 2 == 0) {
sx3ChDn = sx3.ch[index];
sx3EDn = sx3.e[index];
}else{
sx3ChUp = sx3.ch[index];
sx3EUp = sx3.e[index];
}
}else{
sx3ChBk = sx3.ch[index];
}
for( int j = 0; j < pc.multi; j++){
// hsx3VpcIndex->Fill( sx3.index[i], pc.index[j] );
if( sx3.ch[index] > 8 ){
hsx3VpcE->Fill( sx3.e[i], pc.e[j] );
// hpcIndexVE->Fill( pc.index[i], pc.e[i] );
}
}
}
sx3_contr.CalSX3Pos(sx3ID[0].first, sx3ChUp, sx3ChDn, sx3ChBk, sx3EUp, sx3EDn);
hitPos = sx3_contr.GetHitPos();
HitNonZero = true;
// hitPos.Print();
}
}
// //======================= QQQ
for( int i = 0; i < qqq.multi; i ++){
// for( int j = 0; j < pc.multi; j++){
// if(pc.index[j]==4){
hqqqIndexVE->Fill( qqq.index[i], qqq.e[i] );
// }
// }
for( int j = 0; j < qqq.multi; j++){
if ( j == i ) continue;
hqqqCoin->Fill( qqq.index[i], qqq.index[j]);
}
for( int j = i + 1; j < qqq.multi; j++){
for( int k = 0; k < pc.multi; k++){
if(pc.index[k]<24 && pc.e[k]>50 ){
hqqqVpcE->Fill( qqq.e[i], pc.e[k] );
// hpcIndexVE->Fill( pc.index[i], pc.e[i] );
hqqqVpcIndex->Fill( qqq.index[i], pc.index[j] );
}
// }
}
// if( qqq.used[i] == true ) continue;
//if( qqq.id[i] == qqq.id[j] && (16 - qqq.ch[i]) * (16 - qqq.ch[j]) < 0 ){ // must be same detector and wedge and ring
if( qqq.id[i] == qqq.id[j] ){ // must be same detector
int chWedge = -1;
int chRing = -1;
if( qqq.ch[i] < qqq.ch[j]){
chRing = qqq.ch[j] - 16;
chWedge = qqq.ch[i];
}else{
chRing = qqq.ch[i];
chWedge = qqq.ch[j] - 16;
}
// printf(" ID : %d , chWedge : %d, chRing : %d \n", qqq.id[i], chWedge, chRing);
double theta = -TMath::Pi()/2 + 2*TMath::Pi()/16/4.*(qqq.id[i]*16 + chWedge +0.5);
double rho = 10.+40./16.*(chRing+0.5);
// if(qqq.e[i]>50){
hqqqPolar->Fill( theta, rho);
// }
// qqq.used[i] = true;
// qqq.used[j] = true;
if( !HitNonZero ){
double x = rho * TMath::Cos(theta);
double y = rho * TMath::Sin(theta);
hitPos.SetXYZ(x, y, 23 + 75 + 30);
HitNonZero = true;
}
}
}
}
// //======================= PC
ID.clear();
int counter=0;
std::vector<std::pair<int, double>> E;
E.clear();
for( int i = 0; i < pc.multi; i ++){
if( pc.e[i] > 100 ) ID.push_back(std::pair<int, int>(pc.id[i], i));
if( pc.e[i] > 100 ) E.push_back(std::pair<int, double>(pc.index[i], pc.e[i]));
hpcIndexVE->Fill( pc.index[i], pc.e[i] );
for( int j = i+1; j < pc.multi; j++){
hpcCoin->Fill( pc.index[i], pc.index[j]);
}
}
// for( size_t i = 0; i < E.size(); i++) printf("%zu | %d %d \n", i, E[i].first, E[i].second );
if( E.size()>=3 ){
int aID = 0;
int cID = 0;
float aE = 0;
float cE = 0;
bool multi_an =false;
// if( ID[0].first < 1 ) {
// aID = pc.ch[ID[0].second];
// cID = pc.ch[ID[1].second];
// }else{
// cID = pc.ch[ID[0].second];
// aID = pc.ch[ID[1].second];
// }
// printf("anode= %d, cathode = %d\n", aID, cID);
// for( int k = 0; k < qqq.multi; k++){
// if(qqq.index[k]==75 && pc.index[k]==2 && pc.e[k]>100){
for(int l=0;l<E.size();l++){
if(E[l].first<24 ){
if(!multi_an){
aE = E[l].second;
}
multi_an=true;
}
else if (E[l].first>=24){
cE = E[l].second + cE;
}
}
// }
// }
hanVScatsum->Fill(aE,cE);
if( ID[0].first < 1 ) {
aID = pc.ch[ID[0].second];
cID = pc.ch[ID[1].second];
}else{
cID = pc.ch[ID[0].second];
aID = pc.ch[ID[1].second];
}
if( HitNonZero){
pw_contr.CalTrack( hitPos, aID, cID);
hZProj->Fill(pw_contr.GetZ0());
}
}
//########################################################### Track constrcution
//############################## DO THE KINEMATICS
return kTRUE;
}
void Analyzer1::Terminate(){
gStyle->SetOptStat("neiou");
TCanvas * canvas = new TCanvas("cANASEN", "ANASEN", 2000, 2000);
canvas->Divide(3,3);
//hsx3VpcIndex->Draw("colz");
//=============================================== pad-1
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
hsx3IndexVE->Draw("colz");
//=============================================== pad-2
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
hqqqIndexVE->Draw("colz");
//=============================================== pad-3
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
hpcIndexVE->Draw("colz");
//=============================================== pad-4
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
hsx3Coin->Draw("colz");
//=============================================== pad-5
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
canvas->cd(padID)->SetLogz(true);
hqqqCoin->Draw("colz");
//=============================================== pad-6
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
hpcCoin->Draw("colz");
//=============================================== pad-7
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
// hsx3VpcIndex ->Draw("colz");
hsx3VpcE->Draw("colz") ;
//=============================================== pad-8
padID ++; canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
// hqqqVpcIndex ->Draw("colz");
hqqqVpcE ->Draw("colz");
//=============================================== pad-9
padID ++;
// canvas->cd(padID)->DrawFrame(-50, -50, 50, 50);
// hqqqPolar->Draw("same colz pol");
canvas->cd(padID); canvas->cd(padID)->SetGrid(1);
// hZProj->Draw();
hanVScatsum->Draw("colz");
}

114
Analyzer1.h Normal file
View File

@ -0,0 +1,114 @@
#ifndef Analyzer1_h
#define Analyzer1_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <TSelector.h>
#include "Armory/ClassDet.h"
class Analyzer1 : public TSelector {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
// Fixed size dimensions of array or collections stored in the TTree if any.
// Declaration of leaf types
Det sx3;
Det qqq;
Det pc ;
ULong64_t evID;
UInt_t run;
// List of branches
TBranch *b_eventID; //!
TBranch *b_run; //!
TBranch *b_sx3Multi; //!
TBranch *b_sx3ID; //!
TBranch *b_sx3Ch; //!
TBranch *b_sx3E; //!
TBranch *b_sx3T; //!
TBranch *b_qqqMulti; //!
TBranch *b_qqqID; //!
TBranch *b_qqqCh; //!
TBranch *b_qqqE; //!
TBranch *b_qqqT; //!
TBranch *b_pcMulti; //!
TBranch *b_pcID; //!
TBranch *b_pcCh; //!
TBranch *b_pcE; //!
TBranch *b_pcT; //!
Analyzer1(TTree * /*tree*/ =0) : fChain(0) { }
virtual ~Analyzer1() { }
virtual Int_t Version() const { return 2; }
virtual void Begin(TTree *tree);
virtual void SlaveBegin(TTree *tree);
virtual void Init(TTree *tree);
virtual Bool_t Notify();
virtual Bool_t Process(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
virtual void SetOption(const char *option) { fOption = option; }
virtual void SetObject(TObject *obj) { fObject = obj; }
virtual void SetInputList(TList *input) { fInput = input; }
virtual TList *GetOutputList() const { return fOutput; }
virtual void SlaveTerminate();
virtual void Terminate();
ClassDef(Analyzer1,0);
};
#endif
#ifdef Analyzer1_cxx
void Analyzer1::Init(TTree *tree){
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("evID", &evID, &b_eventID);
fChain->SetBranchAddress("run", &run, &b_run);
sx3.SetDetDimension(24,12);
qqq.SetDetDimension(4,32);
pc.SetDetDimension(2,24);
fChain->SetBranchAddress("sx3Multi", &sx3.multi, &b_sx3Multi);
fChain->SetBranchAddress("sx3ID", &sx3.id, &b_sx3ID);
fChain->SetBranchAddress("sx3Ch", &sx3.ch, &b_sx3Ch);
fChain->SetBranchAddress("sx3E", &sx3.e, &b_sx3E);
fChain->SetBranchAddress("sx3T", &sx3.t, &b_sx3T);
fChain->SetBranchAddress("qqqMulti", &qqq.multi, &b_qqqMulti);
fChain->SetBranchAddress("qqqID", &qqq.id, &b_qqqID);
fChain->SetBranchAddress("qqqCh", &qqq.ch, &b_qqqCh);
fChain->SetBranchAddress("qqqE", &qqq.e, &b_qqqE);
fChain->SetBranchAddress("qqqT", &qqq.t, &b_qqqT);
fChain->SetBranchAddress("pcMulti", &pc.multi, &b_pcMulti);
fChain->SetBranchAddress("pcID", &pc.id, &b_pcID);
fChain->SetBranchAddress("pcCh", &pc.ch, &b_pcCh);
fChain->SetBranchAddress("pcE", &pc.e, &b_pcE);
fChain->SetBranchAddress("pcT", &pc.t, &b_pcT);
}
Bool_t Analyzer1::Notify(){
return kTRUE;
}
void Analyzer1::SlaveBegin(TTree * /*tree*/){
TString option = GetOption();
}
void Analyzer1::SlaveTerminate(){
}
#endif // #ifdef Analyzer_cxx

BIN
Armory/.DS_Store vendored Normal file

Binary file not shown.

178
Armory/ANASEN_ML.py Normal file
View File

@ -0,0 +1,178 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 15:52:39 2026
@author: jamesszalkie
"""
import uproot
import joblib
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.metrics import mean_absolute_error
# User settings
ROOT_FILE = "/Users/jamesszalkie/ANASEN_analysis/Armory/SimAnasen1.root"
TREE_NAME = "tree1"
MODEL = "beam_predictor.keras"
INPUT_SCALER = "input_scaler.pkl"
OUTPUT_SCALER = "output_scaler.pkl"
INPUT_BRANCHES = [
"Tb",
"thetab",
"vZ",
"MBeam",
"MTarget",
"MLight",
"MHeavy",
]
# Load model
model = tf.keras.models.load_model(MODEL)
input_scaler = joblib.load(INPUT_SCALER)
output_scaler = joblib.load(OUTPUT_SCALER)
# Read ROOT file
with uproot.open(ROOT_FILE) as f:
tree = f[TREE_NAME]
arrays = tree.arrays(INPUT_BRANCHES, library="np")
X = np.column_stack([arrays[b] for b in INPUT_BRANCHES])
# Remove NaN events
mask = np.all(np.isfinite(X), axis=1)
X = X[mask]
print(f"Predicting {len(X)} events")
# Predict
X_scaled = input_scaler.transform(X)
pred_scaled = model.predict(X_scaled, verbose=0)
pred = output_scaler.inverse_transform(pred_scaled)
beam = pred[:,0]
Ex = pred[:,1]
# See whether truth branches exist
truth_beam = None
truth_Ex = None
with uproot.open(ROOT_FILE) as f:
tree = f[TREE_NAME]
branches = tree.keys()
if "beamEnergy" in branches:
truth_beam = tree["beamEnergy"].array(library="np")[mask]
if "Ex" in branches:
truth_Ex = tree["Ex"].array(library="np")[mask]
print("\n============================")
print("Model Performance")
print("============================")
if truth_beam is not None:
beam_mae = mean_absolute_error(truth_beam, beam)
beam_rmse = np.sqrt(np.mean((truth_beam - beam)**2))
print(f"Beam Energy MAE : {beam_mae:.4f} MeV")
print(f"Beam Energy RMSE: {beam_rmse:.4f} MeV")
if truth_Ex is not None:
Ex_mae = mean_absolute_error(truth_Ex, Ex)
Ex_rmse = np.sqrt(np.mean((truth_Ex - Ex)**2))
print(f"Excitation MAE : {Ex_mae:.4f} MeV")
print(f"Excitation RMSE : {Ex_rmse:.4f} MeV")
# Plot Beam Energy
plt.figure(figsize=(8,6))
plt.hist(
beam,
bins=250,
histtype="step",
linewidth=2,
label="Predicted",
)
if truth_beam is not None:
plt.hist(
truth_beam,
bins=250,
histtype="step",
linewidth=2,
label="Truth",
)
plt.xlabel("Beam Energy (MeV)")
plt.ylabel("Counts")
plt.title("Beam Energy")
plt.legend()
plt.tight_layout()
# Plot Excitation Energy
plt.figure(figsize=(8,6))
plt.hist(
Ex,
bins=250,
histtype="step",
linewidth=2,
label="Predicted",
)
if truth_Ex is not None:
plt.hist(
truth_Ex,
bins=250,
histtype="step",
linewidth=2,
label="Truth",
)
plt.xlabel("Excitation Energy (MeV)")
plt.ylabel("Counts")
plt.title("Excitation Energy")
plt.legend()
plt.tight_layout()
plt.figure(figsize=(6,6))
plt.scatter(truth_beam, beam, s=2)
mn = min(truth_beam.min(), beam.min())
mx = max(truth_beam.max(), beam.max())
plt.plot([mn, mx], [mn, mx], 'k--')
plt.xlabel("True Beam Energy (MeV)")
plt.ylabel("Predicted Beam Energy (MeV)")
plt.title("Beam Energy Reconstruction")
plt.figure(figsize=(6,6))
plt.scatter(truth_Ex, Ex, s=2)
mn = min(truth_Ex.min(), Ex.min())
mx = max(truth_Ex.max(), Ex.max())
plt.plot([mn, mx], [mn, mx], 'k--')
plt.xlabel("True Excitation Energy (MeV)")
plt.ylabel("Predicted Excitation Energy (MeV)")
plt.title("Excitation Energy Reconstruction")

View File

@ -26,23 +26,35 @@ void ANASEN_model(int anodeID1 = -1, int anodeID2 = -1, int cathodeID1 = -1, int
TGeoVolume *worldBox = geom->MakeBox("ROOT", Vacuum, worldx, worldy, worldz);
geom->SetTopVolume(worldBox);
//--- making axis
TGeoVolume *axisX = geom->MakeTube("axisX", Al, 0, 0.1, 5.);
axisX->SetLineColor(1);
worldBox->AddNode(axisX, 1, new TGeoCombiTrans(5, 0, 0., new TGeoRotation("rotA", 90., 90., 0.)));
//--- making axis (X=red, Y=green, Z=blue)
Double_t axisLen = 100.;
TGeoVolume *axisX = geom->MakeTube("axisX", Al, 0, 0.1, axisLen/2);
axisX->SetLineColor(kRed);
worldBox->AddNode(axisX, 1, new TGeoCombiTrans(axisLen/2, 0, 0., new TGeoRotation("rotA", 90., 90., 0.)));
TGeoVolume *axisY = geom->MakeTube("axisY", Al, 0, 0.1, 5.);
axisY->SetLineColor(1);
worldBox->AddNode(axisY, 1, new TGeoCombiTrans(0, 5, 0., new TGeoRotation("rotB", 0., 90., 0.)));
TGeoVolume *axisY = geom->MakeTube("axisY", Al, 0, 0.1, axisLen/2);
axisY->SetLineColor(kGreen);
worldBox->AddNode(axisY, 1, new TGeoCombiTrans(0, axisLen/2, 0., new TGeoRotation("rotB", 0., 90., 0.)));
TGeoVolume *axisZ = geom->MakeTube("axisZ", Al, 0, 0.1, 5.);
axisZ->SetLineColor(1);
worldBox->AddNode(axisZ, 1, new TGeoTranslation(0, 0, 5));
TGeoVolume *axisZ = geom->MakeTube("axisZ", Al, 0, 0.1, axisLen/2);
axisZ->SetLineColor(kBlue);
worldBox->AddNode(axisZ, 1, new TGeoTranslation(0, 0, axisLen/2));
//--- axis labels (draw as TPolyMarker3D + text because TGeo does not label directly)
TPolyMarker3D *marker = new TPolyMarker3D();
marker->SetMarkerSize(1.2);
marker->SetMarkerColor(kRed);
marker->SetPoint(0, axisLen, 0, 0); // X
marker->SetMarkerColor(kGreen);
marker->SetPoint(1, 0, axisLen, 0); // Y
marker->SetMarkerColor(kBlue);
marker->SetPoint(2, 0, 0, axisLen); // Z
marker->Draw();
//--- making ANASEN
const int nWire = 24;
const int wireShift = 3;
const int zLen = 300; //mm
const int zLen = 350; //mm
const int radiusA = 38;
const int radiusC = 43;
@ -103,8 +115,8 @@ void ANASEN_model(int anodeID1 = -1, int anodeID2 = -1, int cathodeID1 = -1, int
new TGeoRotation("rot1", 360/nSX3 * (i + 0.5), 0., 0.)));
}
const int qqqR1 = 10;
const int qqqR2 = 50;
const int qqqR1 = 50;
const int qqqR2 = 100;
TGeoVolume *qqq = geom->MakeTubs("qqq", Al, qqqR1, qqqR2, 0.5, 5, 85);
qqq->SetLineColor(7);
for( int i = 0; i < 4; i++){
@ -119,3 +131,5 @@ void ANASEN_model(int anodeID1 = -1, int anodeID2 = -1, int cathodeID1 = -1, int
geom->SetVisLevel(4);
worldBox->Draw("ogle");
}

View File

@ -0,0 +1,64 @@
/run/verbose 2
/event/verbose 0
/tracking/verbose 0
/run/initialize
/control/execute vis.mac
/vis/open
/vis/sceneHandler/create TSG
/vis/viewer/create ! ! 600x600-0+0
/vis/viewer/refresh
/vis/viewer/set/autoRefresh false
/vis/verbose errors
/vis/drawVolume
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0
/vis/sceneHandler/attach
/vis/viewer/set/viewpointVector -1 0 0
/vis/viewer/set/lightsVector -1 0 0
/vis/viewer/set/style wireframe
/vis/viewer/set/auxiliaryEdge true
/vis/viewer/set/lineSegmentsPerCircle 100
/tracking/storeTrajectory 1
/vis/scene/add/trajectories smooth
/tracking/storeTrajectory 2
/vis/scene/notifyHandlers
/vis/modeling/trajectories/create/drawByParticleID
/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
/vis/scene/notifyHandlers scene-0
/vis/modeling/trajectories/drawByParticleID-0/default/setStepPtsSize 2
/vis/scene/notifyHandlers scene-0
/vis/modeling/trajectories/drawByParticleID-0/set proton magenta
/vis/scene/notifyHandlers scene-0
/vis/modeling/trajectories/drawByParticleID-0/set alpha orange
/vis/scene/notifyHandlers scene-0
/vis/scene/endOfEventAction accumulate 20
/vis/geometry/set/visibility World 0 false
/vis/scene/notifyHandlers
/vis/scene/add/axes 0 0 0 20 mm
/vis/scene/notifyHandlers
/vis/viewer/set/background 0 0 0
/vis/viewer/set/style surface
/vis/viewer/set/hiddenMarker true
/vis/viewer/set/viewpointThetaPhi 120 150
/vis/viewer/set/autoRefresh true
/vis/viewer/refresh
/vis/verbose warnings
/vis/viewer/flush
/vis/viewer/refresh viewer-0
/vis/viewer/update viewer-0
/control/execute run.mac
/control/verbose 1
/run/verbose 1
/event/verbose 0
/tracking/verbose 0
/anasen/output/includeElectrons false
/run/initialize
/vis/filtering/trajectories/create/particleFilter
/vis/filtering/trajectories/particleFilter-0/add e-
/vis/scene/notifyHandlers scene-0
/vis/filtering/trajectories/particleFilter-0/add e+
/vis/scene/notifyHandlers scene-0
/vis/filtering/trajectories/particleFilter-0/invert true
/vis/scene/notifyHandlers scene-0
/run/beamOn 1000
/vis/scene/notifyHandlers scene-0

34
Armory/AnasenG4/README.md Normal file
View File

@ -0,0 +1,34 @@
# AnasenG4 Geant4 Simulation
This folder contains a minimal Geant4 application that:
- builds the ANASEN detector geometry,
- adds a helium target volume,
- generates outgoing proton events from an `18Ne + 4He` alpha/p reaction using the external `ClassTransfer` reaction model,
- and propagates the particles with the Geant4 `FTFP_BERT` physics list.
## Build
```bash
cd /home/jamesszalkie/anasen/Armory/AnasenG4
rm -rf build
mkdir build
cd build
cmake ..
make -j4
```
## Run
```bash
cd /home/jamesszalkie/anasen/Armory/AnasenG4
./build/AnasenG4 macros/run.mac
```
## Notes
- The reaction generator uses `/home/jamesszalkie/anasen/Armory/mass20.txt` for isotope mass lookups.
- You can also run the interactive visualization macro:
```bash
./build/AnasenG4 macros/init_vis.mac
```

BIN
Armory/AnasenG4/build/AnasenG4 Executable file

Binary file not shown.

View File

@ -0,0 +1,83 @@
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "11.4.0")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17")
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-11")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-11")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/11;/usr/include/x86_64-linux-gnu/c++/11;/usr/include/c++/11/backward;/usr/lib/gcc/x86_64-linux-gnu/11/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/11;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")

View File

@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Linux-6.8.0-124-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "6.8.0-124-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-6.8.0-124-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "6.8.0-124-generic")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)

View File

@ -0,0 +1,791 @@
/* This source file must have a .cpp extension so that all C++ compilers
recognize the extension without flags. Borland does not know .cxx for
example. */
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif
#if !defined(__has_include)
/* If the compiler does not have __has_include, pretend the answer is
always no. */
# define __has_include(x) 0
#endif
/* Version number components: V=Version, R=Revision, P=Patch
Version date components: YYYY=Year, MM=Month, DD=Day */
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# if defined(__GNUC__)
# define SIMULATE_ID "GNU"
# endif
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
except that a few beta releases use the old format with V=2021. */
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# else
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
# endif
# else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
/* The third version component from --version is an update index,
but no macro is provided for it. */
# define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
# elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
# define COMPILER_ID "IntelLLVM"
#if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
#endif
#if defined(__GNUC__)
# define SIMULATE_ID "GNU"
#endif
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
* VVVV is no smaller than the current year when a version is released.
*/
#if __INTEL_LLVM_COMPILER < 1000000L
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
#else
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
#endif
#if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
#endif
#if defined(__GNUC__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
#elif defined(__GNUG__)
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
#endif
#if defined(__GNUC_MINOR__)
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
#endif
#if defined(__GNUC_PATCHLEVEL__)
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
#endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
# define COMPILER_ID "Embarcadero"
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
# define COMPILER_ID "Watcom"
/* __WATCOMC__ = VVRR */
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
/* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
/* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
/* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
#elif defined(__NVCOMPILER)
# define COMPILER_ID "NVHPC"
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__CLANG_FUJITSU)
# define COMPILER_ID "FujitsuClang"
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
#elif defined(__FUJITSU)
# define COMPILER_ID "Fujitsu"
# if defined(__FCC_version__)
# define COMPILER_VERSION __FCC_version__
# elif defined(__FCC_major__)
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
# endif
# if defined(__fcc_version)
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
# elif defined(__FCC_VERSION)
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
# endif
#elif defined(__ghs__)
# define COMPILER_ID "GHS"
/* __GHS_VERSION_NUMBER = VVVVRP */
# ifdef __GHS_VERSION_NUMBER
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
# endif
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
# define COMPILER_ID "ARMCC"
#if __ARMCC_VERSION >= 1000000
/* __ARMCC_VERSION = VRRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#else
/* __ARMCC_VERSION = VRPPPP */
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
#endif
#elif defined(__clang__) && defined(__apple_build_version__)
# define COMPILER_ID "AppleClang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
# define COMPILER_ID "ARMClang"
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# if defined(_MSC_VER)
# define SIMULATE_ID "MSVC"
# endif
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
# if defined(_MSC_VER)
/* _MSC_VER = VVRR */
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
# endif
#elif defined(__GNUC__) || defined(__GNUG__)
# define COMPILER_ID "GNU"
# if defined(__GNUC__)
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# else
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
# endif
# if defined(__GNUC_MINOR__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# endif
# if defined(__GNUC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
/* _MSC_VER = VVRR */
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
# define COMPILER_ID "ADSP"
#if defined(__VISUALDSPVERSION__)
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
#endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# define COMPILER_ID "IAR"
# if defined(__VER__) && defined(__ICCARM__)
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
# endif
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
#elif defined(__hpux) || defined(__hpua)
# define COMPILER_ID "HP"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#define STRINGIFY_HELPER(X) #X
#define STRINGIFY(X) STRINGIFY_HELPER(X)
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__MSYS__)
# define PLATFORM_ID "MSYS"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"
#elif defined(__MINGW32__)
# define PLATFORM_ID "MinGW"
#elif defined(__APPLE__)
# define PLATFORM_ID "Darwin"
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
# define PLATFORM_ID "Windows"
#elif defined(__FreeBSD__) || defined(__FreeBSD)
# define PLATFORM_ID "FreeBSD"
#elif defined(__NetBSD__) || defined(__NetBSD)
# define PLATFORM_ID "NetBSD"
#elif defined(__OpenBSD__) || defined(__OPENBSD)
# define PLATFORM_ID "OpenBSD"
#elif defined(__sun) || defined(sun)
# define PLATFORM_ID "SunOS"
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku"
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS"
#elif defined(__QNX__) || defined(__QNXNTO__)
# define PLATFORM_ID "QNX"
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
# define PLATFORM_ID "Tru64"
#elif defined(__riscos) || defined(__riscos__)
# define PLATFORM_ID "RISCos"
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
# define PLATFORM_ID "SINIX"
#elif defined(__UNIX_SV__)
# define PLATFORM_ID "UNIX_SV"
#elif defined(__bsdos__)
# define PLATFORM_ID "BSDOS"
#elif defined(_MPRAS) || defined(MPRAS)
# define PLATFORM_ID "MP-RAS"
#elif defined(__osf) || defined(__osf__)
# define PLATFORM_ID "OSF1"
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
# define PLATFORM_ID "SCO_SV"
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
# define PLATFORM_ID "ULTRIX"
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
# define PLATFORM_ID "Xenix"
#elif defined(__WATCOMC__)
# if defined(__LINUX__)
# define PLATFORM_ID "Linux"
# elif defined(__DOS__)
# define PLATFORM_ID "DOS"
# elif defined(__OS2__)
# define PLATFORM_ID "OS2"
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
# elif defined(__VXWORKS__)
# define PLATFORM_ID "VxWorks"
# else /* unknown platform */
# define PLATFORM_ID
# endif
#elif defined(__INTEGRITY)
# if defined(INT_178B)
# define PLATFORM_ID "Integrity178"
# else /* regular Integrity */
# define PLATFORM_ID "Integrity"
# endif
#else /* unknown platform */
# define PLATFORM_ID
#endif
/* For windows compilers MSVC and Intel we can determine
the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
#if defined(_WIN32) && defined(_MSC_VER)
# if defined(_M_IA64)
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_ARM64EC)
# define ARCHITECTURE_ID "ARM64EC"
# elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM64)
# define ARCHITECTURE_ID "ARM64"
# elif defined(_M_ARM)
# if _M_ARM == 4
# define ARCHITECTURE_ID "ARMV4I"
# elif _M_ARM == 5
# define ARCHITECTURE_ID "ARMV5I"
# else
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__WATCOMC__)
# if defined(_M_I86)
# define ARCHITECTURE_ID "I86"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
# if defined(__ICCARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
# elif defined(__ICCRH850__)
# define ARCHITECTURE_ID "RH850"
# elif defined(__ICCRL78__)
# define ARCHITECTURE_ID "RL78"
# elif defined(__ICCRISCV__)
# define ARCHITECTURE_ID "RISCV"
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
# elif defined(__ICC430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
# elif defined(__ICCSTM8__)
# define ARCHITECTURE_ID "STM8"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__ghs__)
# if defined(__PPC64__)
# define ARCHITECTURE_ID "PPC64"
# elif defined(__ppc__)
# define ARCHITECTURE_ID "PPC"
# elif defined(__ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__x86_64__)
# define ARCHITECTURE_ID "x64"
# elif defined(__i386__)
# define ARCHITECTURE_ID "X86"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
# elif defined(__MSP430__)
# define ARCHITECTURE_ID "MSP430"
# elif defined(__TMS320C28XX__)
# define ARCHITECTURE_ID "TMS320C28x"
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
# define ARCHITECTURE_ID "TMS320C6x"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
#else
# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
#define DEC(n) \
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
/* Convert integer to hex digit literals. */
#define HEX(n) \
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))
/* Construct a string literal encoding the version number. */
#ifdef COMPILER_VERSION
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
/* Construct a string literal encoding the version number components. */
#elif defined(COMPILER_VERSION_MAJOR)
char const info_version[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
COMPILER_VERSION_MAJOR,
# ifdef COMPILER_VERSION_MINOR
'.', COMPILER_VERSION_MINOR,
# ifdef COMPILER_VERSION_PATCH
'.', COMPILER_VERSION_PATCH,
# ifdef COMPILER_VERSION_TWEAK
'.', COMPILER_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct a string literal encoding the internal version number. */
#ifdef COMPILER_VERSION_INTERNAL
char const info_version_internal[] = {
'I', 'N', 'F', 'O', ':',
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#elif defined(COMPILER_VERSION_INTERNAL_STR)
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
#endif
/* Construct a string literal encoding the version number components. */
#ifdef SIMULATE_VERSION_MAJOR
char const info_simulate_version[] = {
'I', 'N', 'F', 'O', ':',
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
SIMULATE_VERSION_MAJOR,
# ifdef SIMULATE_VERSION_MINOR
'.', SIMULATE_VERSION_MINOR,
# ifdef SIMULATE_VERSION_PATCH
'.', SIMULATE_VERSION_PATCH,
# ifdef SIMULATE_VERSION_TWEAK
'.', SIMULATE_VERSION_TWEAK,
# endif
# endif
# endif
']','\0'};
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
# if defined(__INTEL_CXX11_MODE__)
# if defined(__cpp_aggregate_nsdmi)
# define CXX_STD 201402L
# else
# define CXX_STD 201103L
# endif
# else
# define CXX_STD 199711L
# endif
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
#endif
const char* info_language_standard_default = "INFO" ":" "standard_default["
#if CXX_STD > 202002L
"23"
#elif CXX_STD > 201703L
"20"
#elif CXX_STD >= 201703L
"17"
#elif CXX_STD >= 201402L
"14"
#elif CXX_STD >= 201103L
"11"
#else
"98"
#endif
"]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
/* !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. */
#if (defined(__clang__) || defined(__GNUC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__) && !defined(_MSC_VER)
"ON"
#else
"OFF"
#endif
"]";
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
require += info_cray[argc];
#endif
require += info_language_standard_default[argc];
require += info_language_extensions_default[argc];
(void)argv;
return require;
}

Binary file not shown.

View File

@ -0,0 +1,28 @@
# Consider dependencies only in project.
set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
)
# The set of dependency files which are needed:
set(CMAKE_DEPENDS_DEPENDENCY_FILES
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc" "CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc" "CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc" "CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc" "CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc" "CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc" "CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc" "CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc" "CMakeFiles/AnasenG4.dir/src/RunAction.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc" "CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d"
"/home/jamesszalkie/anasen/Armory/AnasenG4/src/main.cc" "CMakeFiles/AnasenG4.dir/src/main.cc.o" "gcc" "CMakeFiles/AnasenG4.dir/src/main.cc.o.d"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@ -0,0 +1,290 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4/build
# Include any dependencies generated for this target.
include CMakeFiles/AnasenG4.dir/depend.make
# Include any dependencies generated by the compiler for this target.
include CMakeFiles/AnasenG4.dir/compiler_depend.make
# Include the progress variables for this target.
include CMakeFiles/AnasenG4.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/main.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/main.cc.o: ../src/main.cc
CMakeFiles/AnasenG4.dir/src/main.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/AnasenG4.dir/src/main.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/main.cc.o -MF CMakeFiles/AnasenG4.dir/src/main.cc.o.d -o CMakeFiles/AnasenG4.dir/src/main.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/main.cc
CMakeFiles/AnasenG4.dir/src/main.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/main.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/main.cc > CMakeFiles/AnasenG4.dir/src/main.cc.i
CMakeFiles/AnasenG4.dir/src/main.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/main.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/main.cc -o CMakeFiles/AnasenG4.dir/src/main.cc.s
CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o: ../src/ActionInitialization.cc
CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o -MF CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o.d -o CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc
CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc > CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.i
CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/ActionInitialization.cc -o CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: ../src/RunAction.cc
CMakeFiles/AnasenG4.dir/src/RunAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/AnasenG4.dir/src/RunAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/RunAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/RunAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc
CMakeFiles/AnasenG4.dir/src/RunAction.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/RunAction.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc > CMakeFiles/AnasenG4.dir/src/RunAction.cc.i
CMakeFiles/AnasenG4.dir/src/RunAction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/RunAction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/RunAction.cc -o CMakeFiles/AnasenG4.dir/src/RunAction.cc.s
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: ../src/PrimaryGeneratorAction.cc
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc > CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.i
CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/PrimaryGeneratorAction.cc -o CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.s
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: ../src/BeamReactionSteppingAction.cc
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o -MF CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc > CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.i
CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/BeamReactionSteppingAction.cc -o CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: ../src/DetectorSensitiveDetector.cc
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o -MF CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d -o CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc > CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i
CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorSensitiveDetector.cc -o CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: ../src/HitOutputManager.cc
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o -MF CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d -o CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc > CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i
CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/HitOutputManager.cc -o CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: ../src/WireTrackingManager.cc
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o -MF CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d -o CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc > CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i
CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/WireTrackingManager.cc -o CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: ../src/ReactionGenerator.cc
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o -MF CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d -o CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc > CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.i
CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/ReactionGenerator.cc -o CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: CMakeFiles/AnasenG4.dir/flags.make
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: ../src/DetectorConstruction.cc
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o: CMakeFiles/AnasenG4.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o -MF CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d -o CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc > CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.i
CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/jamesszalkie/anasen/Armory/AnasenG4/src/DetectorConstruction.cc -o CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s
# Object files for target AnasenG4
AnasenG4_OBJECTS = \
"CMakeFiles/AnasenG4.dir/src/main.cc.o" \
"CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o" \
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o" \
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o" \
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o" \
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o" \
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o" \
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
# External object files for target AnasenG4
AnasenG4_EXTERNAL_OBJECTS =
AnasenG4: CMakeFiles/AnasenG4.dir/src/main.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/RunAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o
AnasenG4: CMakeFiles/AnasenG4.dir/build.make
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4Tree.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4FR.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4GMocren.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4visHepRep.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4RayTracer.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4VRML.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4ToolsSG.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4vis_management.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4modeling.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4interfaces.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4mctruth.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4geomtext.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4error_propagation.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4readout.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4physicslists.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4run.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4event.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4tracking.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4parmodels.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4processes.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4digits_hits.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4track.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4particles.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4geometry.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4materials.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4graphics_reps.so
AnasenG4: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3
AnasenG4: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3
AnasenG4: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4analysis.so
AnasenG4: /usr/lib/x86_64-linux-gnu/libexpat.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4zlib.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4intercoms.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4global.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4clhep.so
AnasenG4: /home/jamesszalkie/geant4_installation/geant4-install/lib/libG4ptl.so.2.3.3
AnasenG4: CMakeFiles/AnasenG4.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Linking CXX executable AnasenG4"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/AnasenG4.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
CMakeFiles/AnasenG4.dir/build: AnasenG4
.PHONY : CMakeFiles/AnasenG4.dir/build
CMakeFiles/AnasenG4.dir/clean:
$(CMAKE_COMMAND) -P CMakeFiles/AnasenG4.dir/cmake_clean.cmake
.PHONY : CMakeFiles/AnasenG4.dir/clean
CMakeFiles/AnasenG4.dir/depend:
cd /home/jamesszalkie/anasen/Armory/AnasenG4/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/jamesszalkie/anasen/Armory/AnasenG4 /home/jamesszalkie/anasen/Armory/AnasenG4 /home/jamesszalkie/anasen/Armory/AnasenG4/build /home/jamesszalkie/anasen/Armory/AnasenG4/build /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/AnasenG4.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : CMakeFiles/AnasenG4.dir/depend

View File

@ -0,0 +1,29 @@
file(REMOVE_RECURSE
"AnasenG4"
"AnasenG4.pdb"
"CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o"
"CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o"
"CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o"
"CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o"
"CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o"
"CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o"
"CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o"
"CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o"
"CMakeFiles/AnasenG4.dir/src/RunAction.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o"
"CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o.d"
"CMakeFiles/AnasenG4.dir/src/main.cc.o"
"CMakeFiles/AnasenG4.dir/src/main.cc.o.d"
)
# Per-language clean rules from dependency scanning.
foreach(lang CXX)
include(CMakeFiles/AnasenG4.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
# CMAKE generated file: DO NOT EDIT!
# Timestamp file for compiler generated dependencies management for AnasenG4.

View File

@ -0,0 +1,2 @@
# Empty dependencies file for AnasenG4.
# This may be replaced when dependencies are built.

View File

@ -0,0 +1,10 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# compile CXX with /usr/bin/c++
CXX_DEFINES = -DANASENG4_DATA_DIR=\"/home/jamesszalkie/anasen/Armory/AnasenG4\" -DG4LIB_BUILD_DLL -DG4UI_USE_QT -DG4VIS_USE -DG4VIS_USE_TOOLSSG_QT_GLES -DG4VIS_USE_TOOLSSG_QT_ZB -DG4VIS_USE_TOOLSSG_X11_GLES -DPTL_BUILD_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB
CXX_INCLUDES = -I/home/jamesszalkie/anasen/Armory/AnasenG4/include -I/home/jamesszalkie/anasen/Armory -isystem /home/jamesszalkie/geant4_installation/geant4-install/include/Geant4 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets
CXX_FLAGS = -pthread -std=c++17 -m64 -I/opt/root-6.36.06/include -fPIC -std=gnu++17

View File

@ -0,0 +1,12 @@
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8
CMAKE_PROGRESS_9 = 9
CMAKE_PROGRESS_10 = 10
CMAKE_PROGRESS_11 = 11

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/jamesszalkie/anasen/Armory/AnasenG4")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/jamesszalkie/anasen/Armory/AnasenG4/build")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1,362 @@
The system is: Linux - 6.8.0-124-generic - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/3.22.1/CompilerIdCXX/a.out"
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_e5bc8/fast && /usr/bin/gmake -f CMakeFiles/cmTC_e5bc8.dir/build.make CMakeFiles/cmTC_e5bc8.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -v -o CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04.3' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/'
/usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_e5bc8.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccBHOSsy.s
GNU C++17 (Ubuntu 11.4.0-1ubuntu1~22.04.3) version 11.4.0 (x86_64-linux-gnu)
compiled by GNU C version 11.4.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/11"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/11
/usr/include/x86_64-linux-gnu/c++/11
/usr/include/c++/11/backward
/usr/lib/gcc/x86_64-linux-gnu/11/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C++17 (Ubuntu 11.4.0-1ubuntu1~22.04.3) version 11.4.0 (x86_64-linux-gnu)
compiled by GNU C version 11.4.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ac7fa628ee459f217e6fdb88b3db0bde
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/'
as -v --64 -o CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccBHOSsy.s
GNU assembler version 2.38 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.38
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.'
Linking CXX executable cmTC_e5bc8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e5bc8.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e5bc8
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04.3' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e5bc8' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e5bc8.'
/usr/lib/gcc/x86_64-linux-gnu/11/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccwskxBE.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_e5bc8 /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e5bc8' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e5bc8.'
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Parsed CXX implicit include dir info from above output: rv=done
found start of include info
found start of implicit include info
add: [/usr/include/c++/11]
add: [/usr/include/x86_64-linux-gnu/c++/11]
add: [/usr/include/c++/11/backward]
add: [/usr/lib/gcc/x86_64-linux-gnu/11/include]
add: [/usr/local/include]
add: [/usr/include/x86_64-linux-gnu]
add: [/usr/include]
end of search list found
collapse include dir [/usr/include/c++/11] ==> [/usr/include/c++/11]
collapse include dir [/usr/include/x86_64-linux-gnu/c++/11] ==> [/usr/include/x86_64-linux-gnu/c++/11]
collapse include dir [/usr/include/c++/11/backward] ==> [/usr/include/c++/11/backward]
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/11/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/11/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/include/c++/11;/usr/include/x86_64-linux-gnu/c++/11;/usr/include/c++/11/backward;/usr/lib/gcc/x86_64-linux-gnu/11/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
Parsed CXX implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_e5bc8/fast && /usr/bin/gmake -f CMakeFiles/cmTC_e5bc8.dir/build.make CMakeFiles/cmTC_e5bc8.dir/build]
ignore line: [gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp']
ignore line: [Building CXX object CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04.3' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-nvptx/usr amdgcn-amdhsa=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/']
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.22/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_e5bc8.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccBHOSsy.s]
ignore line: [GNU C++17 (Ubuntu 11.4.0-1ubuntu1~22.04.3) version 11.4.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 11.4.0 GMP version 6.2.1 MPFR version 4.1.0 MPC version 1.2.1 isl version isl-0.24-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/11"]
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/include/c++/11]
ignore line: [ /usr/include/x86_64-linux-gnu/c++/11]
ignore line: [ /usr/include/c++/11/backward]
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/11/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include/x86_64-linux-gnu]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C++17 (Ubuntu 11.4.0-1ubuntu1~22.04.3) version 11.4.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 11.4.0 GMP version 6.2.1 MPFR version 4.1.0 MPC version 1.2.1 isl version isl-0.24-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: ac7fa628ee459f217e6fdb88b3db0bde]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccBHOSsy.s]
ignore line: [GNU assembler version 2.38 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.38]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.']
ignore line: [Linking CXX executable cmTC_e5bc8]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e5bc8.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e5bc8 ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04.3' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-nvptx/usr amdgcn-amdhsa=/build/gcc-11-0odw26/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2]
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e5bc8' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e5bc8.']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/11/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccwskxBE.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_e5bc8 /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/11/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccwskxBE.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [--as-needed] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-pie] ==> ignore
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_e5bc8] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/11] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/11]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/11/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../..]
arg [CMakeFiles/cmTC_e5bc8.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
arg [-lgcc_s] ==> lib [gcc_s]
arg [-lgcc] ==> lib [gcc]
arg [/usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o]
collapse obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o] ==> [/usr/lib/x86_64-linux-gnu/Scrt1.o]
collapse obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o] ==> [/usr/lib/x86_64-linux-gnu/crti.o]
collapse obj [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o] ==> [/usr/lib/x86_64-linux-gnu/crtn.o]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/11] ==> [/usr/lib/gcc/x86_64-linux-gnu/11]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/11/../../..] ==> [/usr/lib]
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
implicit objs: [/usr/lib/x86_64-linux-gnu/Scrt1.o;/usr/lib/x86_64-linux-gnu/crti.o;/usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o;/usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o;/usr/lib/x86_64-linux-gnu/crtn.o]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/11;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []
Determining if the include file pthread.h exists passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_aff5e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_aff5e.dir/build.make CMakeFiles/cmTC_aff5e.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_aff5e.dir/CheckIncludeFile.cxx.o
/usr/bin/c++ -std=gnu++17 -o CMakeFiles/cmTC_aff5e.dir/CheckIncludeFile.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
Linking CXX executable cmTC_aff5e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aff5e.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_aff5e.dir/CheckIncludeFile.cxx.o -o cmTC_aff5e
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Performing C++ SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD succeeded with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_ee057/fast && /usr/bin/gmake -f CMakeFiles/cmTC_ee057.dir/build.make CMakeFiles/cmTC_ee057.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_ee057.dir/src.cxx.o
/usr/bin/c++ -DCMAKE_HAVE_LIBC_PTHREAD -std=gnu++17 -o CMakeFiles/cmTC_ee057.dir/src.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTC_ee057
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ee057.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_ee057.dir/src.cxx.o -o cmTC_ee057
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function XOpenDisplay exists in the /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_29692/fast && /usr/bin/gmake -f CMakeFiles/cmTC_29692.dir/build.make CMakeFiles/cmTC_29692.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_29692.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=XOpenDisplay -std=gnu++17 -o CMakeFiles/cmTC_29692.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_29692
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_29692.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=XOpenDisplay CMakeFiles/cmTC_29692.dir/CheckFunctionExists.cxx.o -o cmTC_29692 /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Determining if the function gethostbyname exists passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_d85c6/fast && /usr/bin/gmake -f CMakeFiles/cmTC_d85c6.dir/build.make CMakeFiles/cmTC_d85c6.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_d85c6.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=gethostbyname -std=gnu++17 -o CMakeFiles/cmTC_d85c6.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckFunctionExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_d85c6
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d85c6.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=gethostbyname CMakeFiles/cmTC_d85c6.dir/CheckFunctionExists.cxx.o -o cmTC_d85c6
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Determining if the function connect exists passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_2b29b/fast && /usr/bin/gmake -f CMakeFiles/cmTC_2b29b.dir/build.make CMakeFiles/cmTC_2b29b.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_2b29b.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=connect -std=gnu++17 -o CMakeFiles/cmTC_2b29b.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckFunctionExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_2b29b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2b29b.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=connect CMakeFiles/cmTC_2b29b.dir/CheckFunctionExists.cxx.o -o cmTC_2b29b
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Determining if the function remove exists passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_df88a/fast && /usr/bin/gmake -f CMakeFiles/cmTC_df88a.dir/build.make CMakeFiles/cmTC_df88a.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_df88a.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=remove -std=gnu++17 -o CMakeFiles/cmTC_df88a.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckFunctionExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_df88a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_df88a.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=remove CMakeFiles/cmTC_df88a.dir/CheckFunctionExists.cxx.o -o cmTC_df88a
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Determining if the function shmat exists passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_31bb2/fast && /usr/bin/gmake -f CMakeFiles/cmTC_31bb2.dir/build.make CMakeFiles/cmTC_31bb2.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_31bb2.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=shmat -std=gnu++17 -o CMakeFiles/cmTC_31bb2.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckFunctionExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_31bb2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_31bb2.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=shmat CMakeFiles/cmTC_31bb2.dir/CheckFunctionExists.cxx.o -o cmTC_31bb2
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Determining if the function IceConnectionNumber exists in the ICE passed with the following output:
Change Dir: /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_f6c0f/fast && /usr/bin/gmake -f CMakeFiles/cmTC_f6c0f.dir/build.make CMakeFiles/cmTC_f6c0f.dir/build
gmake[1]: Entering directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f6c0f.dir/CheckFunctionExists.cxx.o
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=IceConnectionNumber -std=gnu++17 -o CMakeFiles/cmTC_f6c0f.dir/CheckFunctionExists.cxx.o -c /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx
Linking CXX executable cmTC_f6c0f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f6c0f.dir/link.txt --verbose=1
/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=IceConnectionNumber CMakeFiles/cmTC_f6c0f.dir/CheckFunctionExists.cxx.o -o cmTC_f6c0f -lICE
gmake[1]: Leaving directory '/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles/CMakeTmp'

View File

@ -0,0 +1,28 @@
#ifdef CHECK_FUNCTION_EXISTS
# ifdef __cplusplus
extern "C"
# endif
char
CHECK_FUNCTION_EXISTS(void);
# ifdef __CLASSIC_C__
int main()
{
int ac;
char* av[];
# else
int main(int ac, char* av[])
{
# endif
CHECK_FUNCTION_EXISTS();
if (ac > 1000) {
return *av[0];
}
return 0;
}
#else /* CHECK_FUNCTION_EXISTS */
# error "CHECK_FUNCTION_EXISTS has to specify the function"
#endif /* CHECK_FUNCTION_EXISTS */

View File

@ -0,0 +1,28 @@
#ifdef CHECK_FUNCTION_EXISTS
# ifdef __cplusplus
extern "C"
# endif
char
CHECK_FUNCTION_EXISTS(void);
# ifdef __CLASSIC_C__
int main()
{
int ac;
char* av[];
# else
int main(int ac, char* av[])
{
# endif
CHECK_FUNCTION_EXISTS();
if (ac > 1000) {
return *av[0];
}
return 0;
}
#else /* CHECK_FUNCTION_EXISTS */
# error "CHECK_FUNCTION_EXISTS has to specify the function"
#endif /* CHECK_FUNCTION_EXISTS */

View File

@ -0,0 +1,109 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"../CMakeLists.txt"
"CMakeFiles/3.22.1/CMakeCXXCompiler.cmake"
"CMakeFiles/3.22.1/CMakeSystem.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/G4EXPATShim.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/G4X11Shim.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Geant4Config.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Geant4ConfigVersion.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Geant4LibraryDepends-release.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Geant4LibraryDepends.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Geant4PackageCache.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Modules/IntelCompileFeatures.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/Modules/MSVCCompileFeatures.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/PTL/PTLConfig.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/PTL/PTLConfigVersion.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/PTL/PTLTargets-release.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/PTL/PTLTargets.cmake"
"/home/jamesszalkie/geant4_installation/geant4-install/lib/cmake/Geant4/UseGeant4.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigVersion.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigVersion.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QComposePlatformInputContextPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSEmulatorIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSKmsGbmIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevKeyboardPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevMousePlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTabletPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QEvdevTouchScreenPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QGifPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QICOPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QIbusPlatformInputContextPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QJpegPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLibInputPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QLinuxFbIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalEglIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QMinimalIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QOffscreenIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QTuioTouchPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QVncIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbGlxIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QXcbIntegrationPlugin.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL/Qt5OpenGLConfig.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL/Qt5OpenGLConfigVersion.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfigVersion.cmake"
"/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsMacros.cmake"
"/usr/share/cmake-3.22/Modules/CMakeCXXInformation.cmake"
"/usr/share/cmake-3.22/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake"
"/usr/share/cmake-3.22/Modules/CMakeGenericSystem.cmake"
"/usr/share/cmake-3.22/Modules/CMakeInitializeConfigs.cmake"
"/usr/share/cmake-3.22/Modules/CMakeLanguageInformation.cmake"
"/usr/share/cmake-3.22/Modules/CMakeParseArguments.cmake"
"/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/share/cmake-3.22/Modules/CheckCXXSourceCompiles.cmake"
"/usr/share/cmake-3.22/Modules/CheckFunctionExists.cmake"
"/usr/share/cmake-3.22/Modules/CheckIncludeFileCXX.cmake"
"/usr/share/cmake-3.22/Modules/CheckLibraryExists.cmake"
"/usr/share/cmake-3.22/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
"/usr/share/cmake-3.22/Modules/Compiler/GNU-CXX.cmake"
"/usr/share/cmake-3.22/Modules/Compiler/GNU.cmake"
"/usr/share/cmake-3.22/Modules/FindEXPAT.cmake"
"/usr/share/cmake-3.22/Modules/FindOpenGL.cmake"
"/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake"
"/usr/share/cmake-3.22/Modules/FindPackageMessage.cmake"
"/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake"
"/usr/share/cmake-3.22/Modules/FindThreads.cmake"
"/usr/share/cmake-3.22/Modules/FindX11.cmake"
"/usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake"
"/usr/share/cmake-3.22/Modules/Platform/Linux-GNU-CXX.cmake"
"/usr/share/cmake-3.22/Modules/Platform/Linux-GNU.cmake"
"/usr/share/cmake-3.22/Modules/Platform/Linux.cmake"
"/usr/share/cmake-3.22/Modules/Platform/UnixPaths.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"CMakeFiles/AnasenG4.dir/DependInfo.cmake"
)

View File

@ -0,0 +1,112 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4/build
#=============================================================================
# Directory level rules for the build root directory
# The main recursive "all" target.
all: CMakeFiles/AnasenG4.dir/all
.PHONY : all
# The main recursive "preinstall" target.
preinstall:
.PHONY : preinstall
# The main recursive "clean" target.
clean: CMakeFiles/AnasenG4.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/AnasenG4.dir
# All Build rule for target.
CMakeFiles/AnasenG4.dir/all:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/depend
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10,11 "Built target AnasenG4"
.PHONY : CMakeFiles/AnasenG4.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/AnasenG4.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 11
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/AnasenG4.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 0
.PHONY : CMakeFiles/AnasenG4.dir/rule
# Convenience name for target.
AnasenG4: CMakeFiles/AnasenG4.dir/rule
.PHONY : AnasenG4
# clean rule for target.
CMakeFiles/AnasenG4.dir/clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/clean
.PHONY : CMakeFiles/AnasenG4.dir/clean
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View File

@ -0,0 +1 @@
11

View File

@ -0,0 +1,424 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.22
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/jamesszalkie/anasen/Armory/AnasenG4/build
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles /home/jamesszalkie/anasen/Armory/AnasenG4/build//CMakeFiles/progress.marks
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /home/jamesszalkie/anasen/Armory/AnasenG4/build/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named AnasenG4
# Build rule for target.
AnasenG4: cmake_check_build_system
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 AnasenG4
.PHONY : AnasenG4
# fast build rule for target.
AnasenG4/fast:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/build
.PHONY : AnasenG4/fast
src/ActionInitialization.o: src/ActionInitialization.cc.o
.PHONY : src/ActionInitialization.o
# target to build an object file
src/ActionInitialization.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.o
.PHONY : src/ActionInitialization.cc.o
src/ActionInitialization.i: src/ActionInitialization.cc.i
.PHONY : src/ActionInitialization.i
# target to preprocess a source file
src/ActionInitialization.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.i
.PHONY : src/ActionInitialization.cc.i
src/ActionInitialization.s: src/ActionInitialization.cc.s
.PHONY : src/ActionInitialization.s
# target to generate assembly for a file
src/ActionInitialization.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ActionInitialization.cc.s
.PHONY : src/ActionInitialization.cc.s
src/BeamReactionSteppingAction.o: src/BeamReactionSteppingAction.cc.o
.PHONY : src/BeamReactionSteppingAction.o
# target to build an object file
src/BeamReactionSteppingAction.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.o
.PHONY : src/BeamReactionSteppingAction.cc.o
src/BeamReactionSteppingAction.i: src/BeamReactionSteppingAction.cc.i
.PHONY : src/BeamReactionSteppingAction.i
# target to preprocess a source file
src/BeamReactionSteppingAction.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.i
.PHONY : src/BeamReactionSteppingAction.cc.i
src/BeamReactionSteppingAction.s: src/BeamReactionSteppingAction.cc.s
.PHONY : src/BeamReactionSteppingAction.s
# target to generate assembly for a file
src/BeamReactionSteppingAction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/BeamReactionSteppingAction.cc.s
.PHONY : src/BeamReactionSteppingAction.cc.s
src/DetectorConstruction.o: src/DetectorConstruction.cc.o
.PHONY : src/DetectorConstruction.o
# target to build an object file
src/DetectorConstruction.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.o
.PHONY : src/DetectorConstruction.cc.o
src/DetectorConstruction.i: src/DetectorConstruction.cc.i
.PHONY : src/DetectorConstruction.i
# target to preprocess a source file
src/DetectorConstruction.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.i
.PHONY : src/DetectorConstruction.cc.i
src/DetectorConstruction.s: src/DetectorConstruction.cc.s
.PHONY : src/DetectorConstruction.s
# target to generate assembly for a file
src/DetectorConstruction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorConstruction.cc.s
.PHONY : src/DetectorConstruction.cc.s
src/DetectorSensitiveDetector.o: src/DetectorSensitiveDetector.cc.o
.PHONY : src/DetectorSensitiveDetector.o
# target to build an object file
src/DetectorSensitiveDetector.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.o
.PHONY : src/DetectorSensitiveDetector.cc.o
src/DetectorSensitiveDetector.i: src/DetectorSensitiveDetector.cc.i
.PHONY : src/DetectorSensitiveDetector.i
# target to preprocess a source file
src/DetectorSensitiveDetector.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.i
.PHONY : src/DetectorSensitiveDetector.cc.i
src/DetectorSensitiveDetector.s: src/DetectorSensitiveDetector.cc.s
.PHONY : src/DetectorSensitiveDetector.s
# target to generate assembly for a file
src/DetectorSensitiveDetector.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/DetectorSensitiveDetector.cc.s
.PHONY : src/DetectorSensitiveDetector.cc.s
src/HitOutputManager.o: src/HitOutputManager.cc.o
.PHONY : src/HitOutputManager.o
# target to build an object file
src/HitOutputManager.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.o
.PHONY : src/HitOutputManager.cc.o
src/HitOutputManager.i: src/HitOutputManager.cc.i
.PHONY : src/HitOutputManager.i
# target to preprocess a source file
src/HitOutputManager.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.i
.PHONY : src/HitOutputManager.cc.i
src/HitOutputManager.s: src/HitOutputManager.cc.s
.PHONY : src/HitOutputManager.s
# target to generate assembly for a file
src/HitOutputManager.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/HitOutputManager.cc.s
.PHONY : src/HitOutputManager.cc.s
src/PrimaryGeneratorAction.o: src/PrimaryGeneratorAction.cc.o
.PHONY : src/PrimaryGeneratorAction.o
# target to build an object file
src/PrimaryGeneratorAction.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.o
.PHONY : src/PrimaryGeneratorAction.cc.o
src/PrimaryGeneratorAction.i: src/PrimaryGeneratorAction.cc.i
.PHONY : src/PrimaryGeneratorAction.i
# target to preprocess a source file
src/PrimaryGeneratorAction.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.i
.PHONY : src/PrimaryGeneratorAction.cc.i
src/PrimaryGeneratorAction.s: src/PrimaryGeneratorAction.cc.s
.PHONY : src/PrimaryGeneratorAction.s
# target to generate assembly for a file
src/PrimaryGeneratorAction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/PrimaryGeneratorAction.cc.s
.PHONY : src/PrimaryGeneratorAction.cc.s
src/ReactionGenerator.o: src/ReactionGenerator.cc.o
.PHONY : src/ReactionGenerator.o
# target to build an object file
src/ReactionGenerator.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.o
.PHONY : src/ReactionGenerator.cc.o
src/ReactionGenerator.i: src/ReactionGenerator.cc.i
.PHONY : src/ReactionGenerator.i
# target to preprocess a source file
src/ReactionGenerator.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.i
.PHONY : src/ReactionGenerator.cc.i
src/ReactionGenerator.s: src/ReactionGenerator.cc.s
.PHONY : src/ReactionGenerator.s
# target to generate assembly for a file
src/ReactionGenerator.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/ReactionGenerator.cc.s
.PHONY : src/ReactionGenerator.cc.s
src/RunAction.o: src/RunAction.cc.o
.PHONY : src/RunAction.o
# target to build an object file
src/RunAction.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.o
.PHONY : src/RunAction.cc.o
src/RunAction.i: src/RunAction.cc.i
.PHONY : src/RunAction.i
# target to preprocess a source file
src/RunAction.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.i
.PHONY : src/RunAction.cc.i
src/RunAction.s: src/RunAction.cc.s
.PHONY : src/RunAction.s
# target to generate assembly for a file
src/RunAction.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/RunAction.cc.s
.PHONY : src/RunAction.cc.s
src/WireTrackingManager.o: src/WireTrackingManager.cc.o
.PHONY : src/WireTrackingManager.o
# target to build an object file
src/WireTrackingManager.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.o
.PHONY : src/WireTrackingManager.cc.o
src/WireTrackingManager.i: src/WireTrackingManager.cc.i
.PHONY : src/WireTrackingManager.i
# target to preprocess a source file
src/WireTrackingManager.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.i
.PHONY : src/WireTrackingManager.cc.i
src/WireTrackingManager.s: src/WireTrackingManager.cc.s
.PHONY : src/WireTrackingManager.s
# target to generate assembly for a file
src/WireTrackingManager.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/WireTrackingManager.cc.s
.PHONY : src/WireTrackingManager.cc.s
src/main.o: src/main.cc.o
.PHONY : src/main.o
# target to build an object file
src/main.cc.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/main.cc.o
.PHONY : src/main.cc.o
src/main.i: src/main.cc.i
.PHONY : src/main.i
# target to preprocess a source file
src/main.cc.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/main.cc.i
.PHONY : src/main.cc.i
src/main.s: src/main.cc.s
.PHONY : src/main.s
# target to generate assembly for a file
src/main.cc.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/AnasenG4.dir/build.make CMakeFiles/AnasenG4.dir/src/main.cc.s
.PHONY : src/main.cc.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... rebuild_cache"
@echo "... AnasenG4"
@echo "... src/ActionInitialization.o"
@echo "... src/ActionInitialization.i"
@echo "... src/ActionInitialization.s"
@echo "... src/BeamReactionSteppingAction.o"
@echo "... src/BeamReactionSteppingAction.i"
@echo "... src/BeamReactionSteppingAction.s"
@echo "... src/DetectorConstruction.o"
@echo "... src/DetectorConstruction.i"
@echo "... src/DetectorConstruction.s"
@echo "... src/DetectorSensitiveDetector.o"
@echo "... src/DetectorSensitiveDetector.i"
@echo "... src/DetectorSensitiveDetector.s"
@echo "... src/HitOutputManager.o"
@echo "... src/HitOutputManager.i"
@echo "... src/HitOutputManager.s"
@echo "... src/PrimaryGeneratorAction.o"
@echo "... src/PrimaryGeneratorAction.i"
@echo "... src/PrimaryGeneratorAction.s"
@echo "... src/ReactionGenerator.o"
@echo "... src/ReactionGenerator.i"
@echo "... src/ReactionGenerator.s"
@echo "... src/RunAction.o"
@echo "... src/RunAction.i"
@echo "... src/RunAction.s"
@echo "... src/WireTrackingManager.o"
@echo "... src/WireTrackingManager.i"
@echo "... src/WireTrackingManager.s"
@echo "... src/main.o"
@echo "... src/main.i"
@echo "... src/main.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1,54 @@
# Install script for directory: /home/jamesszalkie/anasen/Armory/AnasenG4
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/home/jamesszalkie/anasen/Armory/AnasenG4/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")

View File

@ -0,0 +1,15 @@
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization();
virtual ~ActionInitialization();
virtual void Build() const override;
};
#endif

View File

@ -0,0 +1,17 @@
#ifndef BeamConfig_h
#define BeamConfig_h 1
#include "globals.hh"
#include "G4SystemOfUnits.hh"
namespace BeamConfig {
inline constexpr G4int kAtomicNumber = 13;
inline constexpr G4int kAtomicMass = 27;
inline constexpr G4double kRadius = 5.0 * mm;
inline constexpr G4double kStartZ = -190.0 * mm;
inline constexpr G4double kTotalBeamEnergy = 72.0 * MeV;
inline constexpr G4double kEnergyPerU = kTotalBeamEnergy / kAtomicMass; // Approximately 2.67 MeV/u for 27Al
inline constexpr char kTargetVolumeName[] = "Target";
} // namespace BeamConfig
#endif

View File

@ -0,0 +1,21 @@
#ifndef BeamReactionSteppingAction_h
#define BeamReactionSteppingAction_h 1
#include "G4UserSteppingAction.hh"
class G4Step;
class ReactionGenerator;
class BeamReactionSteppingAction : public G4UserSteppingAction
{
public:
BeamReactionSteppingAction();
virtual ~BeamReactionSteppingAction();
virtual void UserSteppingAction(const G4Step* step) override;
private:
ReactionGenerator* fReaction;
};
#endif

View File

@ -0,0 +1,27 @@
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
class G4LogicalVolume;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
virtual ~DetectorConstruction();
virtual G4VPhysicalVolume* Construct() override;
virtual void ConstructSDandField() override;
G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; }
private:
G4LogicalVolume* fScoringVolume;
G4LogicalVolume* fAnodeLogical;
G4LogicalVolume* fCathodeLogical;
G4LogicalVolume* fSX3Logical;
G4LogicalVolume* fQQQLogical;
};
#endif

View File

@ -0,0 +1,18 @@
#ifndef DetectorSensitiveDetector_h
#define DetectorSensitiveDetector_h 1
#include "G4VSensitiveDetector.hh"
class G4Step;
class G4TouchableHistory;
class DetectorSensitiveDetector : public G4VSensitiveDetector
{
public:
explicit DetectorSensitiveDetector(const G4String& name);
virtual ~DetectorSensitiveDetector();
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
};
#endif

View File

@ -0,0 +1,83 @@
#ifndef HitOutputManager_h
#define HitOutputManager_h 1
#include "G4ThreeVector.hh"
#include <fstream>
#include <string>
class TFile;
class TTree;
class TH1D;
class TH2D;
class HitOutputManager
{
public:
static HitOutputManager& Instance();
void Open();
void Close();
void SetIncludeElectrons(bool includeElectrons);
bool GetIncludeElectrons() const;
bool ShouldRecordParticle(const std::string& particleType) const;
void RecordHit(int eventId,
const std::string& particleType,
double kineticEnergy,
double energyDeposit,
double wireDeltaESinTheta,
const std::string& detectorType,
int detectorId,
int anodeId,
int cathodeId,
double anodeEnergy,
double cathodeEnergy,
double wireDeltaE,
const std::string& volumeName,
const G4ThreeVector& position,
const G4ThreeVector& vertexPosition);
private:
HitOutputManager();
~HitOutputManager();
HitOutputManager(const HitOutputManager&) = delete;
HitOutputManager& operator=(const HitOutputManager&) = delete;
void ResetBuffers();
TFile* fRootFile;
TTree* fTree;
std::ofstream fTextFile;
int fEventId;
int fDetectorId;
int fAnodeId;
int fCathodeId;
double fKineticEnergy;
double fEnergyDeposit;
double fWireDeltaESinTheta;
double fAnodeEnergy;
double fCathodeEnergy;
double fWireDeltaE;
double fX;
double fY;
double fZ;
double fVertexX;
double fVertexY;
double fVertexZ;
char fParticleType[64];
char fDetectorType[32];
char fVolumeName[32];
TH1D* fKineticEnergyHist;
TH1D* fEnergyDepositHist;
TH1D* fWireDeltaEHist;
TH2D* fWireDeltaESinThetaVsDetEHist;
TH1D* fHitZHist;
TH1D* fVertexZHist;
TH1D* fDetectorIdHist;
TH2D* fHitXYHist;
TH2D* fVertexXYHist;
bool fIncludeElectrons;
};
#endif

View File

@ -0,0 +1,24 @@
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ThreeVector.hh"
class G4ParticleGun;
class G4Event;
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event* event) override;
private:
G4ParticleGun* fParticleGun;
G4double fBeamRadius;
G4double fBeamStartZ;
};
#endif

View File

@ -0,0 +1,33 @@
#ifndef ReactionGenerator_h
#define ReactionGenerator_h 1
#include "G4ThreeVector.hh"
enum class ReactionChannel {
Proton,
Alpha
};
struct ReactionOutput {
ReactionChannel channel;
double kineticEnergy;
double px;
double py;
double pz;
};
class ReactionGenerator {
public:
ReactionGenerator();
~ReactionGenerator();
ReactionOutput SampleEvent(double beamKineticEnergy, const G4ThreeVector& beamDirection);
double GetEffectiveCrossSection() const;
private:
class Impl;
Impl* fImpl;
double fEffectiveSigma;
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
class G4Run;
class G4GenericMessenger;
class RunAction : public G4UserRunAction
{
public:
RunAction();
virtual ~RunAction();
virtual void BeginOfRunAction(const G4Run* run) override;
virtual void EndOfRunAction(const G4Run* run) override;
private:
void DefineCommands();
G4GenericMessenger* fMessenger;
bool fIncludeElectrons;
};
#endif

View File

@ -0,0 +1,45 @@
#ifndef WireTrackingManager_h
#define WireTrackingManager_h 1
#include "G4ThreeVector.hh"
#include <unordered_map>
class G4Step;
class G4Track;
class G4StepPoint;
struct WireCrossingInfo
{
int anodeId = -1;
int cathodeId = -1;
double anodeEnergy = 0.0;
double cathodeEnergy = 0.0;
double deltaE = 0.0;
bool sawAnode = false;
bool sawCathode = false;
};
class WireTrackingManager
{
public:
static WireTrackingManager& Instance();
void UpdateForStep(const G4Step* step);
bool GetInfo(int eventId, int trackId, WireCrossingInfo& info);
WireCrossingInfo InferFromTrackGeometry(const G4Track* track, const G4StepPoint* hitPoint);
private:
WireTrackingManager();
~WireTrackingManager();
WireTrackingManager(const WireTrackingManager&) = delete;
WireTrackingManager& operator=(const WireTrackingManager&) = delete;
void EnsureEvent(int eventId);
int fCurrentEventId;
std::unordered_map<int, WireCrossingInfo> fTrackInfo;
};
#endif

View File

@ -0,0 +1,7 @@
/control/verbose 2
/control/saveHistory
/run/verbose 2
/event/verbose 0
/tracking/verbose 0
/run/initialize
/control/execute vis.mac

14
Armory/AnasenG4/run.mac Normal file
View File

@ -0,0 +1,14 @@
/control/verbose 1
/run/verbose 1
/event/verbose 0
/tracking/verbose 0
/anasen/output/includeElectrons false
/run/initialize
/vis/filtering/trajectories/create/particleFilter
/vis/filtering/trajectories/particleFilter-0/add e-
/vis/filtering/trajectories/particleFilter-0/add e+
/vis/filtering/trajectories/particleFilter-0/invert true
/run/beamOn 1000000
#/run/beamOn 1000

View File

@ -0,0 +1,17 @@
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "BeamReactionSteppingAction.hh"
#include "RunAction.hh"
ActionInitialization::ActionInitialization()
: G4VUserActionInitialization()
{}
ActionInitialization::~ActionInitialization() {}
void ActionInitialization::Build() const
{
SetUserAction(new RunAction());
SetUserAction(new PrimaryGeneratorAction());
SetUserAction(new BeamReactionSteppingAction());
}

View File

@ -0,0 +1,106 @@
#include "BeamReactionSteppingAction.hh"
#include "BeamConfig.hh"
#include "ReactionGenerator.hh"
#include "WireTrackingManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4DynamicParticle.hh"
#include "G4EventManager.hh"
#include "G4StackManager.hh"
#include "G4ParticleDefinition.hh"
#include "G4Proton.hh"
#include "G4Alpha.hh"
#include "G4SystemOfUnits.hh"
#include "G4RandomTools.hh"
#include <cmath>
BeamReactionSteppingAction::BeamReactionSteppingAction()
: G4UserSteppingAction(),
fReaction(new ReactionGenerator())
{}
BeamReactionSteppingAction::~BeamReactionSteppingAction()
{
delete fReaction;
}
void BeamReactionSteppingAction::UserSteppingAction(const G4Step* step)
{
WireTrackingManager::Instance().UpdateForStep(step);
const G4Track* track = step->GetTrack();
if (track->GetTrackStatus() != fAlive) {
return;
}
const G4ParticleDefinition* particle = track->GetDefinition();
if (particle->GetParticleType() != "nucleus") {
return;
}
if (particle->GetAtomicNumber() != BeamConfig::kAtomicNumber ||
particle->GetAtomicMass() != BeamConfig::kAtomicMass) {
return;
}
const auto* prePoint = step->GetPreStepPoint();
if (!prePoint || !prePoint->GetPhysicalVolume()) {
return;
}
if (prePoint->GetPhysicalVolume()->GetName() != BeamConfig::kTargetVolumeName) {
return;
}
const G4double stepLength = step->GetStepLength();
if (stepLength <= 0.0) {
return;
}
const auto* material = prePoint->GetMaterial();
if (!material) {
return;
}
const G4double atomDensity = material->GetTotNbOfAtomsPerVolume();
const G4double sigma = fReaction->GetEffectiveCrossSection();
const G4double probability = 1.0 - std::exp(-atomDensity * sigma * stepLength);
if (G4UniformRand() > probability) {
return;
}
ReactionOutput output = fReaction->SampleEvent(track->GetKineticEnergy(), track->GetMomentumDirection());
if (output.kineticEnergy <= 0.0) {
return;
}
const G4ThreeVector momentum(output.px, output.py, output.pz);
G4ThreeVector direction = momentum;
if (direction.mag2() > 0.0) {
direction = direction.unit();
} else {
direction = G4ThreeVector(0.0, 0.0, 1.0);
}
G4ParticleDefinition* product = nullptr;
if (output.channel == ReactionChannel::Proton) {
product = G4Proton::ProtonDefinition();
} else {
product = G4Alpha::AlphaDefinition();
}
auto* dynamicParticle = new G4DynamicParticle(product, direction, output.kineticEnergy);
auto* secondaryTrack = new G4Track(dynamicParticle, track->GetGlobalTime(), prePoint->GetPosition());
secondaryTrack->SetParentID(track->GetTrackID());
secondaryTrack->SetTouchableHandle(track->GetTouchableHandle());
G4EventManager::GetEventManager()->GetStackManager()->PushOneTrack(secondaryTrack, nullptr);
G4Track* mutableTrack = const_cast<G4Track*>(track);
mutableTrack->SetTrackStatus(fStopAndKill);
}

View File

@ -0,0 +1,185 @@
#include "DetectorConstruction.hh"
#include "DetectorSensitiveDetector.hh"
#include "G4RunManager.hh"
#include "G4SDManager.hh"
#include "G4NistManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4SystemOfUnits.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4VisAttributes.hh"
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fScoringVolume(nullptr),
fAnodeLogical(nullptr),
fCathodeLogical(nullptr),
fSX3Logical(nullptr),
fQQQLogical(nullptr)
{}
DetectorConstruction::~DetectorConstruction()
{}
G4VPhysicalVolume* DetectorConstruction::Construct()
{
// Get nist material manager
G4NistManager* nist = G4NistManager::Instance();
// Materials
G4Material* vacuum = nist->FindOrBuildMaterial("G4_Galactic");
G4Material* al = nist->FindOrBuildMaterial("G4_Al");
// World
G4double worldx = 200.*mm;
G4double worldy = 200.*mm;
G4double worldz = 200.*mm;
G4Box* solidWorld = new G4Box("World", worldx, worldy, worldz);
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, vacuum, "World");
G4VPhysicalVolume* physWorld = new G4PVPlacement(0, G4ThreeVector(), logicWorld, "World", 0, false, 0, true);
// Helium target
G4double pressure = 379.0 * 133.322368 * pascal;
G4double temperature = 293.15 * kelvin;
G4double density = 8.29e-5 * g/cm3;
G4Material* HeGas =
new G4Material("HeGas",
density,
1,
kStateGas,
temperature,
pressure);
HeGas->AddElement(nist->FindOrBuildElement("He"), 1);
const G4double targetRadius = 37.0*mm;
const G4double targetHalfLength = 175.*mm;
G4Tubs* solidTarget = new G4Tubs("Target", 0, targetRadius, targetHalfLength, 0, 360*deg);
G4LogicalVolume* logicTarget =
new G4LogicalVolume(solidTarget, HeGas, "Target");
new G4PVPlacement(0, G4ThreeVector(), logicTarget, "Target", logicWorld, false, 0, true);
logicTarget->SetVisAttributes(G4VisAttributes::GetInvisible());
fScoringVolume = logicTarget;
// Axes (optional, for visualization)
G4Tubs* solidAxis = new G4Tubs("Axis", 0, 0.1*mm, 5.*mm, 0, 360*deg);
G4LogicalVolume* logicAxisX = new G4LogicalVolume(solidAxis, al, "AxisX");
G4LogicalVolume* logicAxisY = new G4LogicalVolume(solidAxis, al, "AxisY");
G4LogicalVolume* logicAxisZ = new G4LogicalVolume(solidAxis, al, "AxisZ");
G4RotationMatrix* rotX = new G4RotationMatrix();
rotX->rotateY(90*deg);
rotX->rotateZ(90*deg);
new G4PVPlacement(rotX, G4ThreeVector(5*mm, 0, 0), logicAxisX, "AxisX", logicWorld, false, 0);
G4RotationMatrix* rotY = new G4RotationMatrix();
rotY->rotateX(90*deg);
new G4PVPlacement(rotY, G4ThreeVector(0, 5*mm, 0), logicAxisY, "AxisY", logicWorld, false, 0);
new G4PVPlacement(0, G4ThreeVector(0, 0, 5*mm), logicAxisZ, "AxisZ", logicWorld, false, 0);
// ANASEN geometry
const int nWire = 24;
const int wireShift = 4;
const G4double zLen = 350.*mm;
const G4double radiusA = 38.*mm;
const G4double radiusC = 43.*mm;
G4double dAngle = wireShift * 2 * CLHEP::pi / nWire;
G4double radiusAnew = radiusA * cos(dAngle / 2.);
G4double wireALength = sqrt(zLen*zLen + pow(2 * radiusA * sin(dAngle/2.), 2));
G4double wireATheta = atan2(2 * radiusA * sin(dAngle / 2.), zLen);
G4Tubs* solidPC_A = new G4Tubs("PC_A", 0, .1*mm, wireALength/2., 0, 360*deg);
G4LogicalVolume* logicPC_A = new G4LogicalVolume(solidPC_A, al, "PC_A");
fAnodeLogical = logicPC_A;
for(int i = 0; i < nWire; i++){
G4double phi = 2 * CLHEP::pi / nWire * i + dAngle / 2.;
G4ThreeVector pos(radiusAnew * cos(phi), radiusAnew * sin(phi), 0);
// Euler angles: phi (Z), theta (Y), psi (Z)
G4double phi_euler = 360./nWire * (i + wireShift/2.) * deg;
G4double theta_euler = wireATheta;
G4double psi_euler = 0;
G4RotationMatrix* rot = new G4RotationMatrix(phi_euler, theta_euler, psi_euler);
new G4PVPlacement(rot, pos, logicPC_A, "PC_A", logicWorld, false, i);
}
G4double radiusCnew = radiusC * cos(dAngle / 2.);
G4double wireCLength = sqrt(zLen*zLen + pow(2 * radiusC * sin(dAngle/2.), 2));
G4double wireCTheta = atan2(2 * radiusC * sin(dAngle / 2.), zLen);
G4Tubs* solidPC_C = new G4Tubs("PC_C", 0, .1*mm, wireCLength/2., 0, 360*deg);
G4LogicalVolume* logicPC_C = new G4LogicalVolume(solidPC_C, al, "PC_C");
fCathodeLogical = logicPC_C;
for(int i = 0; i < nWire; i++){
G4double phi = 2 * CLHEP::pi / nWire * i - dAngle/2.;
G4ThreeVector pos(radiusCnew * cos(phi), radiusCnew * sin(phi), 0);
// Euler angles: phi (Z), theta (Y), psi (Z)
G4double phi_euler = 360./nWire * (i - wireShift/2.) * deg;
G4double theta_euler = -wireCTheta;
G4double psi_euler = 0;
G4RotationMatrix* rot = new G4RotationMatrix(phi_euler, theta_euler, psi_euler);
new G4PVPlacement(rot, pos, logicPC_C, "PC_C", logicWorld, false, i);
}
const int nSX3 = 12;
const G4double sx3Radius = 88.*mm;
const G4double sx3Width = 40.*mm;
const G4double sx3Length = 75.*mm;
const G4double sx3Gap = 5.*mm;
G4Box* solidSX3 = new G4Box("SX3", 0.1*mm, sx3Width/2., sx3Length/2.);
G4LogicalVolume* logicSX3 = new G4LogicalVolume(solidSX3, al, "SX3");
fSX3Logical = logicSX3;
fScoringVolume = logicSX3;
for(int i = 0; i < nSX3; i++){
G4double phi = 2 * CLHEP::pi / nSX3 * (i + 0.5);
G4ThreeVector pos1(sx3Radius * cos(phi), sx3Radius * sin(phi), sx3Length/2. + sx3Gap);
// Euler angles: phi (Z), theta (Y), psi (Z)
G4double phi_euler = 360./nSX3 * (i + 0.5) * deg;
G4RotationMatrix* rot1 = new G4RotationMatrix(phi_euler, 0, 0);
new G4PVPlacement(rot1, pos1, logicSX3, "SX3_front", logicWorld, false, 2*i);
G4ThreeVector pos2(sx3Radius * cos(phi), sx3Radius * sin(phi), -sx3Length/2. - sx3Gap);
G4RotationMatrix* rot2 = new G4RotationMatrix(phi_euler, 0, 0);
new G4PVPlacement(rot2, pos2, logicSX3, "SX3_back", logicWorld, false, 2*i+1);
}
const G4double qqqR1 = 50.*mm;
const G4double qqqR2 = 100.*mm;
G4Tubs* solidQQQ = new G4Tubs("QQQ", qqqR1, qqqR2, 0.5*mm, 5*deg, 85*deg);
G4LogicalVolume* logicQQQ = new G4LogicalVolume(solidQQQ, al, "QQQ");
fQQQLogical = logicQQQ;
for(int i = 0; i < 4; i++){
G4ThreeVector pos(0, 0, 100.*mm);
// Euler angles: phi (Z), theta (Y), psi (Z)
G4double phi_euler = 360./4 * i * deg;
G4RotationMatrix* rot = new G4RotationMatrix(phi_euler, 0, 0);
new G4PVPlacement(rot, pos, logicQQQ, "QQQ", logicWorld, false, i);
}
return physWorld;
}
void DetectorConstruction::ConstructSDandField()
{
auto* detectorSD = new DetectorSensitiveDetector("AnasenSensitiveDetector");
G4SDManager::GetSDMpointer()->AddNewDetector(detectorSD);
if (fSX3Logical != nullptr) {
SetSensitiveDetector(fSX3Logical, detectorSD);
}
if (fQQQLogical != nullptr) {
SetSensitiveDetector(fQQQLogical, detectorSD);
}
}

View File

@ -0,0 +1,105 @@
#include "DetectorSensitiveDetector.hh"
#include "HitOutputManager.hh"
#include "WireTrackingManager.hh"
#include "G4RunManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4TouchableHistory.hh"
#include "G4VPhysicalVolume.hh"
#include "G4StepPoint.hh"
#include <cmath>
#include <string>
namespace {
std::string ClassifyDetectorType(const std::string& volumeName)
{
if (volumeName == "PC_A") {
return "Anode";
}
if (volumeName == "PC_C") {
return "Cathode";
}
if (volumeName == "QQQ") {
return "QQQ";
}
if (volumeName.rfind("SX3", 0) == 0) {
return "SX3";
}
return volumeName;
}
}
DetectorSensitiveDetector::DetectorSensitiveDetector(const G4String& name)
: G4VSensitiveDetector(name)
{}
DetectorSensitiveDetector::~DetectorSensitiveDetector() {}
G4bool DetectorSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*)
{
if (step == nullptr) {
return false;
}
G4StepPoint* preStepPoint = step->GetPreStepPoint();
if (preStepPoint == nullptr) {
return false;
}
G4VPhysicalVolume* volume = preStepPoint->GetPhysicalVolume();
if (volume == nullptr) {
return false;
}
const G4double kineticEnergy = preStepPoint->GetKineticEnergy();
const G4double energyDeposit = step->GetTotalEnergyDeposit();
if (kineticEnergy <= 0.0 && energyDeposit <= 0.0) {
return false;
}
const G4Event* currentEvent = G4RunManager::GetRunManager()->GetCurrentEvent();
if (currentEvent == nullptr) {
return false;
}
const std::string particleName = step->GetTrack()->GetParticleDefinition()->GetParticleName();
if (!HitOutputManager::Instance().ShouldRecordParticle(particleName)) {
return false;
}
const std::string volumeName = volume->GetName();
const std::string detectorType = ClassifyDetectorType(volumeName);
if (detectorType != "SX3" && detectorType != "QQQ") {
return false;
}
WireCrossingInfo wireInfo;
WireTrackingManager::Instance().GetInfo(currentEvent->GetEventID(), step->GetTrack()->GetTrackID(), wireInfo);
if (wireInfo.anodeId < 0 || wireInfo.cathodeId < 0) {
wireInfo = WireTrackingManager::Instance().InferFromTrackGeometry(step->GetTrack(), preStepPoint);
}
const G4ThreeVector trackDirection = step->GetTrack()->GetMomentumDirection();
const double sinThetaZ = std::sin(trackDirection.theta());
const double wireDeltaESinTheta = wireInfo.deltaE * sinThetaZ;
HitOutputManager::Instance().RecordHit(currentEvent->GetEventID(),
particleName,
kineticEnergy,
energyDeposit,
wireDeltaESinTheta,
detectorType,
volume->GetCopyNo(),
wireInfo.anodeId,
wireInfo.cathodeId,
wireInfo.anodeEnergy,
wireInfo.cathodeEnergy,
wireInfo.deltaE,
volumeName,
preStepPoint->GetPosition(),
step->GetTrack()->GetVertexPosition());
return true;
}

View File

@ -0,0 +1,279 @@
#include "HitOutputManager.hh"
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TTree.h"
#include <cstring>
#include <iomanip>
namespace {
const char* kRootOutputName = ANASENG4_DATA_DIR "/hits.root";
const char* kTextOutputName = ANASENG4_DATA_DIR "/hits.txt";
}
HitOutputManager& HitOutputManager::Instance()
{
static HitOutputManager instance;
return instance;
}
HitOutputManager::HitOutputManager()
: fRootFile(nullptr),
fTree(nullptr),
fEventId(0),
fDetectorId(0),
fAnodeId(-1),
fCathodeId(-1),
fKineticEnergy(0.0),
fEnergyDeposit(0.0),
fWireDeltaESinTheta(0.0),
fAnodeEnergy(0.0),
fCathodeEnergy(0.0),
fWireDeltaE(0.0),
fX(0.0),
fY(0.0),
fZ(0.0),
fVertexX(0.0),
fVertexY(0.0),
fVertexZ(0.0),
fKineticEnergyHist(nullptr),
fEnergyDepositHist(nullptr),
fWireDeltaEHist(nullptr),
fWireDeltaESinThetaVsDetEHist(nullptr),
fHitZHist(nullptr),
fVertexZHist(nullptr),
fDetectorIdHist(nullptr),
fHitXYHist(nullptr),
fVertexXYHist(nullptr),
fIncludeElectrons(true)
{
ResetBuffers();
}
HitOutputManager::~HitOutputManager()
{
Close();
}
void HitOutputManager::Open()
{
Close();
fRootFile = TFile::Open(kRootOutputName, "RECREATE");
fTree = new TTree("hits", "Sensitive detector hits");
fTree->Branch("eventID", &fEventId, "eventID/I");
fTree->Branch("particleType", fParticleType, "particleType/C");
fTree->Branch("kineticEnergy", &fKineticEnergy, "kineticEnergy/D");
fTree->Branch("energyDeposit", &fEnergyDeposit, "energyDeposit/D");
fTree->Branch("wireDeltaESinTheta", &fWireDeltaESinTheta, "wireDeltaESinTheta/D");
fTree->Branch("detectorType", fDetectorType, "detectorType/C");
fTree->Branch("detectorID", &fDetectorId, "detectorID/I");
fTree->Branch("anodeID", &fAnodeId, "anodeID/I");
fTree->Branch("cathodeID", &fCathodeId, "cathodeID/I");
fTree->Branch("anodeEnergy", &fAnodeEnergy, "anodeEnergy/D");
fTree->Branch("cathodeEnergy", &fCathodeEnergy, "cathodeEnergy/D");
fTree->Branch("wireDeltaE", &fWireDeltaE, "wireDeltaE/D");
fTree->Branch("volumeName", fVolumeName, "volumeName/C");
fTree->Branch("x", &fX, "x/D");
fTree->Branch("y", &fY, "y/D");
fTree->Branch("z", &fZ, "z/D");
fTree->Branch("vertexX", &fVertexX, "vertexX/D");
fTree->Branch("vertexY", &fVertexY, "vertexY/D");
fTree->Branch("vertexZ", &fVertexZ, "vertexZ/D");
fKineticEnergyHist = new TH1D("hKineticEnergy", "Hit kinetic energy;Kinetic energy [MeV];Counts", 200, 0.0, 200.0);
fEnergyDepositHist = new TH1D("hEnergyDeposit", "Step energy deposit;Energy deposit [MeV];Counts", 200, 0.0, 50.0);
fWireDeltaEHist = new TH1D("hWireDeltaE", "Energy loss between anode and cathode crossings;#DeltaE [MeV];Counts", 200, 0.0, 20.0);
fWireDeltaESinThetaVsDetEHist =
new TH2D("hWireDeltaESinThetaVsDetE",
"PC #DeltaE #times sin(#theta_{z}) vs detector deposited energy;Detector deposited energy [MeV];#DeltaE_{PC} #times sin(#theta_{z}) [MeV]",
200,
0.0,
14.0,
200,
0.0,
20.0);
fHitZHist = new TH1D("hHitZ", "Hit z position;z [mm];Counts", 200, -200.0, 200.0);
fVertexZHist = new TH1D("hVertexZ", "Track vertex z position;z_{vertex} [mm];Counts", 200, -250.0, 250.0);
fDetectorIdHist = new TH1D("hDetectorID", "Detector ID occupancy;Detector ID;Counts", 64, -0.5, 63.5);
fHitXYHist = new TH2D("hHitXY", "Hit position;x [mm];y [mm]", 200, -200.0, 200.0, 200, -200.0, 200.0);
fVertexXYHist = new TH2D("hVertexXY", "Track vertex position;x_{vertex} [mm];y_{vertex} [mm]", 200, -200.0, 200.0, 200, -200.0, 200.0);
fTextFile.open(kTextOutputName, std::ios::out | std::ios::trunc);
fTextFile << "eventID,particleType,kineticEnergy,energyDeposit,wireDeltaESinTheta,detectorType,detectorID,anodeID,cathodeID,anodeEnergy,cathodeEnergy,wireDeltaE,volumeName,x,y,z,vertexX,vertexY,vertexZ\n";
}
void HitOutputManager::Close()
{
if (fRootFile != nullptr) {
fRootFile->cd();
if (fTree != nullptr) {
fTree->Write("", TObject::kOverwrite);
}
if (fKineticEnergyHist != nullptr) {
fKineticEnergyHist->Write("", TObject::kOverwrite);
}
if (fEnergyDepositHist != nullptr) {
fEnergyDepositHist->Write("", TObject::kOverwrite);
}
if (fWireDeltaEHist != nullptr) {
fWireDeltaEHist->Write("", TObject::kOverwrite);
}
if (fWireDeltaESinThetaVsDetEHist != nullptr) {
fWireDeltaESinThetaVsDetEHist->Write("", TObject::kOverwrite);
}
if (fHitZHist != nullptr) {
fHitZHist->Write("", TObject::kOverwrite);
}
if (fVertexZHist != nullptr) {
fVertexZHist->Write("", TObject::kOverwrite);
}
if (fDetectorIdHist != nullptr) {
fDetectorIdHist->Write("", TObject::kOverwrite);
}
if (fHitXYHist != nullptr) {
fHitXYHist->Write("", TObject::kOverwrite);
}
if (fVertexXYHist != nullptr) {
fVertexXYHist->Write("", TObject::kOverwrite);
}
fRootFile->Close();
delete fRootFile;
fRootFile = nullptr;
fTree = nullptr;
fKineticEnergyHist = nullptr;
fEnergyDepositHist = nullptr;
fWireDeltaEHist = nullptr;
fWireDeltaESinThetaVsDetEHist = nullptr;
fHitZHist = nullptr;
fVertexZHist = nullptr;
fDetectorIdHist = nullptr;
fHitXYHist = nullptr;
fVertexXYHist = nullptr;
}
if (fTextFile.is_open()) {
fTextFile.close();
}
}
void HitOutputManager::SetIncludeElectrons(bool includeElectrons)
{
fIncludeElectrons = includeElectrons;
}
bool HitOutputManager::GetIncludeElectrons() const
{
return fIncludeElectrons;
}
bool HitOutputManager::ShouldRecordParticle(const std::string& particleType) const
{
if (fIncludeElectrons) {
return true;
}
return particleType != "e-" && particleType != "e+";
}
void HitOutputManager::RecordHit(int eventId,
const std::string& particleType,
double kineticEnergy,
double energyDeposit,
double wireDeltaESinTheta,
const std::string& detectorType,
int detectorId,
int anodeId,
int cathodeId,
double anodeEnergy,
double cathodeEnergy,
double wireDeltaE,
const std::string& volumeName,
const G4ThreeVector& position,
const G4ThreeVector& vertexPosition)
{
if (fRootFile == nullptr || fTree == nullptr || !fTextFile.is_open()) {
return;
}
ResetBuffers();
fEventId = eventId;
fDetectorId = detectorId;
fAnodeId = anodeId;
fCathodeId = cathodeId;
fKineticEnergy = kineticEnergy;
fEnergyDeposit = energyDeposit;
fWireDeltaESinTheta = wireDeltaESinTheta;
fAnodeEnergy = anodeEnergy;
fCathodeEnergy = cathodeEnergy;
fWireDeltaE = wireDeltaE;
fX = position.x();
fY = position.y();
fZ = position.z();
fVertexX = vertexPosition.x();
fVertexY = vertexPosition.y();
fVertexZ = vertexPosition.z();
std::strncpy(fParticleType, particleType.c_str(), sizeof(fParticleType) - 1);
std::strncpy(fDetectorType, detectorType.c_str(), sizeof(fDetectorType) - 1);
std::strncpy(fVolumeName, volumeName.c_str(), sizeof(fVolumeName) - 1);
fTree->Fill();
if (fKineticEnergyHist != nullptr) {
fKineticEnergyHist->Fill(fKineticEnergy);
}
if (fEnergyDepositHist != nullptr) {
fEnergyDepositHist->Fill(fEnergyDeposit);
}
if (fWireDeltaEHist != nullptr && fAnodeId >= 0 && fCathodeId >= 0) {
fWireDeltaEHist->Fill(fWireDeltaE);
}
if (fWireDeltaESinThetaVsDetEHist != nullptr && fAnodeId >= 0 && fCathodeId >= 0) {
fWireDeltaESinThetaVsDetEHist->Fill(fEnergyDeposit, 100.0 * fWireDeltaESinTheta); //2D histogram programmed
}
if (fHitZHist != nullptr) {
fHitZHist->Fill(fZ);
}
if (fVertexZHist != nullptr) {
fVertexZHist->Fill(fVertexZ);
}
if (fDetectorIdHist != nullptr) {
fDetectorIdHist->Fill(fDetectorId);
}
if (fHitXYHist != nullptr) {
fHitXYHist->Fill(fX, fY);
}
if (fVertexXYHist != nullptr) {
fVertexXYHist->Fill(fVertexX, fVertexY);
}
fTextFile << fEventId << ','
<< fParticleType << ','
<< std::setprecision(12) << fKineticEnergy << ','
<< fEnergyDeposit << ','
<< fWireDeltaESinTheta << ','
<< fDetectorType << ','
<< fDetectorId << ','
<< fAnodeId << ','
<< fCathodeId << ','
<< fAnodeEnergy << ','
<< fCathodeEnergy << ','
<< fWireDeltaE << ','
<< fVolumeName << ','
<< fX << ','
<< fY << ','
<< fZ << ','
<< fVertexX << ','
<< fVertexY << ','
<< fVertexZ << '\n';
}
void HitOutputManager::ResetBuffers()
{
fParticleType[0] = '\0';
fDetectorType[0] = '\0';
fVolumeName[0] = '\0';
}

View File

@ -0,0 +1,50 @@
#include "PrimaryGeneratorAction.hh"
#include "BeamConfig.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4Proton.hh"
#include "G4SystemOfUnits.hh"
#include "G4Event.hh"
#include "G4PhysicalConstants.hh"
#include "G4RandomTools.hh"
#include "G4UnitsTable.hh"
#include <cmath>
PrimaryGeneratorAction::PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(nullptr),
fBeamRadius(BeamConfig::kRadius),
fBeamStartZ(BeamConfig::kStartZ)
{
G4int nParticle = 1;
fParticleGun = new G4ParticleGun(nParticle);
fParticleGun->SetParticleDefinition(G4Proton::ProtonDefinition());
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
fParticleGun->SetParticleEnergy(BeamConfig::kTotalBeamEnergy);
}
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete fParticleGun;
}
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* event)
{
auto* ion = G4IonTable::GetIonTable()->GetIon(BeamConfig::kAtomicNumber, BeamConfig::kAtomicMass, 0.0);
if (ion) {
fParticleGun->SetParticleDefinition(ion);
}
G4double r = fBeamRadius * std::sqrt(G4UniformRand());
G4double phi = twopi * G4UniformRand();
G4double x = r * std::cos(phi);
G4double y = r * std::sin(phi);
G4double z = fBeamStartZ;
fParticleGun->SetParticlePosition(G4ThreeVector(x, y, z));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
fParticleGun->SetParticleEnergy(BeamConfig::kTotalBeamEnergy);
fParticleGun->GeneratePrimaryVertex(event);
}

View File

@ -0,0 +1,83 @@
#include "ReactionGenerator.hh"
#include "BeamConfig.hh"
#include "ClassTransfer.h"
#include "G4SystemOfUnits.hh"
#include "TRandom.h"
#include "TVector3.h"
#include "TLorentzVector.h"
#include <cmath>
struct ReactionGenerator::Impl {
TransferReaction transferP;
TransferReaction transferAlpha;
};
ReactionGenerator::ReactionGenerator()
: fImpl(nullptr),
fEffectiveSigma(5e5 * barn) //originally 5e6
{
// Ensure the isotope mass table is found when running from the AnasenG4 folder.
massData = "/home/jamesszalkie/anasen/Armory/mass20.txt";
fImpl = new Impl();
// p-channel: 27Al + 4He -> p + 30Si
fImpl->transferP.SetA(BeamConfig::kAtomicMass, BeamConfig::kAtomicNumber, 0);
fImpl->transferP.Seta(4, 2);
fImpl->transferP.Setb(1, 1);
fImpl->transferP.SetB(30, 14, 0);
// alpha-channel: 27Al + 4He -> alpha + 27Al
fImpl->transferAlpha.SetA(BeamConfig::kAtomicMass, BeamConfig::kAtomicNumber, 0);
fImpl->transferAlpha.Seta(4, 2);
fImpl->transferAlpha.Setb(4, 2);
fImpl->transferAlpha.SetB(BeamConfig::kAtomicMass, BeamConfig::kAtomicNumber, 0);
}
ReactionGenerator::~ReactionGenerator()
{
delete fImpl;
}
ReactionOutput ReactionGenerator::SampleEvent(double beamKineticEnergy, const G4ThreeVector& beamDirection)
{
// Forward-peaked sampling gives the expected inverse E(theta)-like trend in lab observables.
double thetaCM = 0.0;
while (true) {
const double trial = gRandom->Rndm() * M_PI;
const double weight = 1.0 / (1.0 + 20.0 * trial * trial);
if (gRandom->Rndm() < weight) {
thetaCM = trial;
break;
}
}
const double phiCM = gRandom->Rndm() * 2.0 * M_PI;
const double beamEnergyPerU = beamKineticEnergy / (BeamConfig::kAtomicMass * MeV);
const double beamThetaDeg = beamDirection.theta() / deg;
const double beamPhiDeg = beamDirection.phi() / deg;
// Use a mild energy-dependent branching to mix p and alpha events.
const double protonFraction = (beamEnergyPerU > 8.0) ? 0.65 : 0.45;
const bool isProtonChannel = (gRandom->Rndm() < protonFraction);
TransferReaction* transfer = isProtonChannel ? &fImpl->transferP : &fImpl->transferAlpha;
transfer->SetIncidentEnergyAngle(beamEnergyPerU, beamThetaDeg, beamPhiDeg);
transfer->CalReactionConstant();
TLorentzVector* reactionOutput = transfer->Event(thetaCM, phiCM);
TLorentzVector light = reactionOutput[2];
delete[] reactionOutput;
ReactionOutput output;
output.channel = isProtonChannel ? ReactionChannel::Proton : ReactionChannel::Alpha;
output.kineticEnergy = light.E() - light.M();
output.px = light.Px();
output.py = light.Py();
output.pz = light.Pz();
return output;
}
double ReactionGenerator::GetEffectiveCrossSection() const
{
return fEffectiveSigma;
}

View File

@ -0,0 +1,40 @@
#include "RunAction.hh"
#include "HitOutputManager.hh"
#include "G4GenericMessenger.hh"
RunAction::RunAction()
: G4UserRunAction(),
fMessenger(nullptr),
fIncludeElectrons(false)
{
DefineCommands();
}
RunAction::~RunAction()
{
delete fMessenger;
}
void RunAction::DefineCommands()
{
fMessenger = new G4GenericMessenger(this, "/anasen/output/", "ANASEN output controls");
auto& includeElectronsCmd =
fMessenger->DeclareProperty("includeElectrons",
fIncludeElectrons,
"Enable or disable recording electron and positron hits.");
includeElectronsCmd.SetParameterName("includeElectrons", false);
includeElectronsCmd.SetDefaultValue("false");
}
void RunAction::BeginOfRunAction(const G4Run*)
{
HitOutputManager::Instance().SetIncludeElectrons(fIncludeElectrons);
HitOutputManager::Instance().Open();
}
void RunAction::EndOfRunAction(const G4Run*)
{
HitOutputManager::Instance().Close();
}

View File

@ -0,0 +1,205 @@
#include "WireTrackingManager.hh"
#include "ClassPW.h"
#include "G4Event.hh"
#include "G4RunManager.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
#include "G4Track.hh"
#include "G4SystemOfUnits.hh"
#include <algorithm>
#include <cmath>
namespace {
constexpr double kAnodeRadius = 37.0 * mm;
constexpr double kCathodeRadius = 43.0 * mm;
bool CrossesRadius(double preR, double postR, double targetR)
{
return (preR - targetR) * (postR - targetR) <= 0.0 && std::abs(postR - preR) > 1e-12;
}
TVector3 ToTVector3(const G4ThreeVector& value)
{
return TVector3(value.x(), value.y(), value.z());
}
bool SolveRadiusIntersection(const G4ThreeVector& origin,
const G4ThreeVector& direction,
double radius,
double& distance)
{
const double a = direction.x() * direction.x() + direction.y() * direction.y();
if (a <= 0.0) {
return false;
}
const double b = 2.0 * (origin.x() * direction.x() + origin.y() * direction.y());
const double c = origin.x() * origin.x() + origin.y() * origin.y() - radius * radius;
const double discriminant = b * b - 4.0 * a * c;
if (discriminant < 0.0) {
return false;
}
const double sqrtDiscriminant = std::sqrt(discriminant);
const double t1 = (-b - sqrtDiscriminant) / (2.0 * a);
const double t2 = (-b + sqrtDiscriminant) / (2.0 * a);
distance = -1.0;
if (t1 >= 0.0 && t2 >= 0.0) {
distance = std::min(t1, t2);
} else if (t1 >= 0.0) {
distance = t1;
} else if (t2 >= 0.0) {
distance = t2;
}
return distance >= 0.0;
}
}
WireTrackingManager& WireTrackingManager::Instance()
{
static WireTrackingManager instance;
return instance;
}
WireTrackingManager::WireTrackingManager()
: fCurrentEventId(-1)
{}
WireTrackingManager::~WireTrackingManager() {}
void WireTrackingManager::EnsureEvent(int eventId)
{
if (eventId != fCurrentEventId) {
fCurrentEventId = eventId;
fTrackInfo.clear();
}
}
void WireTrackingManager::UpdateForStep(const G4Step* step)
{
if (step == nullptr) {
return;
}
const G4Track* track = step->GetTrack();
if (track == nullptr) {
return;
}
const G4Event* event = G4RunManager::GetRunManager()->GetCurrentEvent();
if (event == nullptr) {
return;
}
EnsureEvent(event->GetEventID());
const G4StepPoint* prePoint = step->GetPreStepPoint();
const G4StepPoint* postPoint = step->GetPostStepPoint();
if (prePoint == nullptr || postPoint == nullptr) {
return;
}
if (prePoint->GetPhysicalVolume() == nullptr || prePoint->GetPhysicalVolume()->GetName() != "Target") {
return;
}
if (track->GetDefinition()->GetParticleType() == "nucleus") {
return;
}
const G4ThreeVector& prePos = prePoint->GetPosition();
const G4ThreeVector& postPos = postPoint->GetPosition();
const double preR = prePos.perp();
const double postR = postPos.perp();
if (!CrossesRadius(preR, postR, kAnodeRadius) && !CrossesRadius(preR, postR, kCathodeRadius)) {
return;
}
PW pw;
pw.ConstructGeo();
pw.FindWireID(ToTVector3(track->GetVertexPosition()), ToTVector3(track->GetMomentumDirection()), false);
auto& info = fTrackInfo[track->GetTrackID()];
auto interpolateEnergy = [&](double targetR) {
const double fraction = (targetR - preR) / (postR - preR);
return prePoint->GetKineticEnergy() + fraction * (postPoint->GetKineticEnergy() - prePoint->GetKineticEnergy());
};
if (!info.sawAnode && CrossesRadius(preR, postR, kAnodeRadius)) {
info.sawAnode = true;
info.anodeId = pw.GetNearestID().first;
info.anodeEnergy = interpolateEnergy(kAnodeRadius);
}
if (!info.sawCathode && CrossesRadius(preR, postR, kCathodeRadius)) {
info.sawCathode = true;
info.cathodeId = pw.GetNearestID().second;
info.cathodeEnergy = interpolateEnergy(kCathodeRadius);
}
if (info.sawAnode && info.sawCathode) {
info.deltaE = std::abs(info.anodeEnergy - info.cathodeEnergy);
}
}
bool WireTrackingManager::GetInfo(int eventId, int trackId, WireCrossingInfo& info)
{
EnsureEvent(eventId);
auto iterator = fTrackInfo.find(trackId);
if (iterator == fTrackInfo.end()) {
return false;
}
info = iterator->second;
return true;
}
WireCrossingInfo WireTrackingManager::InferFromTrackGeometry(const G4Track* track, const G4StepPoint* hitPoint)
{
WireCrossingInfo info;
if (track == nullptr || hitPoint == nullptr) {
return info;
}
const G4ThreeVector origin = track->GetVertexPosition();
G4ThreeVector direction = hitPoint->GetPosition() - origin;
const double totalPath = direction.mag();
if (totalPath <= 0.0) {
return info;
}
direction = direction.unit();
PW pw;
pw.ConstructGeo();
pw.FindWireID(ToTVector3(origin), ToTVector3(direction), false);
info.anodeId = pw.GetNearestID().first;
info.cathodeId = pw.GetNearestID().second;
const double vertexEnergy = track->GetVertexKineticEnergy();
const double hitEnergy = hitPoint->GetKineticEnergy();
double anodeDistance = 0.0;
double cathodeDistance = 0.0;
if (SolveRadiusIntersection(origin, direction, 37.0 * mm, anodeDistance)) {
const double fraction = std::clamp(anodeDistance / totalPath, 0.0, 1.0);
info.anodeEnergy = vertexEnergy + fraction * (hitEnergy - vertexEnergy);
info.sawAnode = true;
}
if (SolveRadiusIntersection(origin, direction, 43.0 * mm, cathodeDistance)) {
const double fraction = std::clamp(cathodeDistance / totalPath, 0.0, 1.0);
info.cathodeEnergy = vertexEnergy + fraction * (hitEnergy - vertexEnergy);
info.sawCathode = true;
}
if (info.sawAnode && info.sawCathode) {
info.deltaE = std::abs(info.anodeEnergy - info.cathodeEnergy);
}
return info;
}

View File

@ -0,0 +1,44 @@
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "G4RunManagerFactory.hh"
#include "G4UImanager.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "G4PhysListFactory.hh"
int main(int argc, char** argv)
{
G4UIExecutive* ui = nullptr;
if (argc == 1) {
ui = new G4UIExecutive(argc, argv);
}
auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::SerialOnly);
runManager->SetUserInitialization(new DetectorConstruction());
G4PhysListFactory physListFactory;
runManager->SetUserInitialization(physListFactory.GetReferencePhysList("FTFP_BERT"));
runManager->SetUserInitialization(new ActionInitialization());
auto* visManager = new G4VisExecutive(argc, argv);
visManager->Initialize();
auto* uiManager = G4UImanager::GetUIpointer();
if (ui) {
uiManager->ApplyCommand("/control/execute init_vis.mac");
ui->SessionStart();
delete ui;
} else {
G4String command = "/control/execute ";
G4String fileName = argv[1];
uiManager->ApplyCommand(command + fileName);
}
delete visManager;
delete runManager;
return 0;
}

31
Armory/AnasenG4/vis.mac Normal file
View File

@ -0,0 +1,31 @@
/vis/open
/vis/viewer/set/autoRefresh false
/vis/verbose errors
/vis/drawVolume
/vis/viewer/set/viewpointVector -1 0 0
/vis/viewer/set/lightsVector -1 0 0
/vis/viewer/set/style wireframe
/vis/viewer/set/auxiliaryEdge true
/vis/viewer/set/lineSegmentsPerCircle 100
/tracking/storeTrajectory 1
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByParticleID
/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByParticleID-0/default/setStepPtsSize 2
/vis/modeling/trajectories/drawByParticleID-0/set proton magenta
/vis/modeling/trajectories/drawByParticleID-0/set alpha orange
/vis/scene/endOfEventAction accumulate 20
/vis/geometry/set/visibility World 0 false
/vis/scene/add/axes 0 0 0 20 mm
/vis/viewer/set/background 0 0 0
/vis/viewer/set/style surface
/vis/viewer/set/hiddenMarker true
/vis/viewer/set/viewpointThetaPhi 120 150
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
/vis/viewer/flush

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.AnasenMS</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
---
triple: 'arm64-apple-darwin'
binary-path: AnasenMS
relocations: []
...

View File

@ -15,6 +15,9 @@
#include "ClassSX3.h"
#include "ClassPW.h"
#include "ClassQQQ.h"
//to not include certain wires in the simulation, pass the anode and cathode IDs to the constructor, e.g. for anode wires 5-10, pass anodeID1 = 5, anodeID2 = 10, and for cathode wires 20-25, pass cathodeID1 = 20, cathodeID2 = 25. To include all wires, pass -1 for all IDs.
class ANASEN{
public:
@ -41,11 +44,15 @@ public:
PW * GetPW() {return pw;}
SX3 * GetSX3() {return sx3;}
QQQ * GetQQQ() {return qqq;}
TGeoManager * GetGeoManager() {return geom;}
TGeoVolume * GetWorldBox() {return worldBox;}
private:
PW * pw;
SX3 * sx3;
QQQ * qqq;
double sigmaA, sigmaC; // pw
double sigmaW, sigmaL; // sx3
@ -73,7 +80,7 @@ inline ANASEN::ANASEN(){
pw = new PW();
sx3 = new SX3();
qqq = new QQQ();
CalGeometry();
geom = nullptr;
@ -106,17 +113,21 @@ inline void ANASEN::Construct3DModel(int anodeID1, int anodeID2, int cathodeID1,
geom = new TGeoManager("Detector", "ANASEN");
//--- define some materials
TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0);
//TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0); //name, A, Z, density
TGeoMaterial *matHe = new TGeoMaterial("He", 4.0026, 2, 0.000861);
TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMaterial *matSi = new TGeoMaterial("Si", 28.085,14,2.33);
//--- define some media
TGeoMedium *Vacuum = new TGeoMedium("Vacuum",1, matVacuum);
//TGeoMedium *Vacuum = new TGeoMedium("Vacuum",1, matVacuum); //name, number of materials, material
TGeoMedium *He = new TGeoMedium("He",2, matHe);
TGeoMedium *Al = new TGeoMedium("Root Material",2, matAl);
TGeoMedium *Si = new TGeoMedium("Si",3, matSi);
//--- make the top container volume
Double_t worldx = 200.; //mm
Double_t worldy = 200.; //mm
Double_t worldz = 200.; //mm
worldBox = geom->MakeBox("ROOT", Vacuum, worldx, worldy, worldz);
worldBox = geom->MakeBox("ROOT", He, worldx, worldy, worldz); // name, medium, x half-length, y half-length, z half-length
geom->SetTopVolume(worldBox);
//--- making axis
@ -181,7 +192,8 @@ inline void ANASEN::Construct3DModel(int anodeID1, int anodeID2, int cathodeID1,
new TGeoRotation("rot1", wirePhi , wireTheta, 0.)));
}
TGeoVolume * sx3Det = geom->MakeBox("box", Al, 0.1, sx3->GetWidth()/2, sx3->GetLength()/2);
// Half-thickness is 0.5 mm so full Si thickness is 1.0 mm (0.1 cm).
TGeoVolume * sx3Det = geom->MakeBox("box", Si, 0.5, sx3->GetWidth()/2, sx3->GetLength()/2);
sx3Det->SetLineColor(kGreen+3);
for( int i = 0; i < sx3->GetNumDet(); i++){
@ -228,6 +240,7 @@ inline void ANASEN::DrawTrack(TVector3 pos, TVector3 direction, bool drawEstima
pw->FindWireID(pos, direction);
sx3->FindSX3Pos(pos, direction);
qqq->FindQQQPos(pos, direction);
std::pair<short, short> wireID = pw->GetNearestID();

1270
Armory/ClassData.h Normal file

File diff suppressed because it is too large Load Diff

446
Armory/ClassPW.h Normal file → Executable file
View File

@ -2,17 +2,24 @@
#define ClassPW_h
#include <cstdio>
#include <iostream>
#include <TMath.h>
#include <TVector3.h>
#include <TRandom.h>
struct PWHitInfo{
std::vector<int> skipAnodes = {};
std::vector<int> skipCathodes = {};
struct PWHitInfo
{
std::pair<short, short> nearestWire; // anode, cathode
std::pair<double, double> nearestDist; // anode, cathode
std::pair<short, short> nextNearestWire; // anode, cathode
std::pair<double, double> nextNearestDist; // anode, cathode
void Clear(){
void Clear()
{
nearestWire.first = -1;
nearestWire.second = -1;
nearestDist.first = 999999999;
@ -24,50 +31,74 @@ struct PWHitInfo{
}
};
//!########################################################
class PW{ // proportional wire
struct Coord
{
float x, y, z;
Coord() : x(0), y(0), z(0) {}
Coord(const TVector3 &vec)
{
x = vec.X(); // TVector3's X() returns the x-coordinate
y = vec.Y(); // TVector3's Y() returns the y-coordinate
z = vec.Z(); // TVector3's Z() returns the z-coordinate
}
};
//! ########################################################
class PW
{ // proportional wire
public:
PW(){ ClearHitInfo();};
~PW(){};
PW() { ClearHitInfo(); };
~PW() {};
PWHitInfo GetHitInfo() const {return hitInfo;}
std::pair<short, short> GetNearestID() const {return hitInfo.nearestWire;}
std::pair<double, double> GetNearestDistance() const {return hitInfo.nearestDist;}
std::pair<short, short> Get2ndNearestID() const {return hitInfo.nextNearestWire;}
std::pair<double, double> Get2ndNearestDistance() const {return hitInfo.nextNearestDist;}
PWHitInfo GetHitInfo() const { return hitInfo; }
std::pair<short, short> GetNearestID() const { return hitInfo.nearestWire; }
std::pair<double, double> GetNearestDistance() const { return hitInfo.nearestDist; }
std::pair<short, short> Get2ndNearestID() const { return hitInfo.nextNearestWire; }
std::pair<double, double> Get2ndNearestDistance() const { return hitInfo.nextNearestDist; }
TVector3 GetTrackPos() const {return trackPos;}
TVector3 GetTrackVec() const {return trackVec;}
double GetTrackTheta() const {return trackVec.Theta();}
double GetTrackPhi() const {return trackVec.Phi();}
std::vector<std::pair<TVector3, TVector3>> An; // the anode wire position vector in space
std::vector<std::pair<TVector3, TVector3>> Ca; // the cathode wire position vector in space
TVector3 GetTrackPos() const { return trackPos; }
TVector3 GetTrackVec() const { return trackVec; }
double GetTrackTheta() const { return trackVec.Theta(); }
double GetTrackPhi() const { return trackVec.Phi(); }
double GetZ0();
int GetNumWire() const {return nWire;}
double GetDeltaAngle() const {return dAngle;}
double GetAnodeLength() const {return anodeLength;}
double GetCathodeLength() const {return cathodeLength;}
TVector3 GetAnodeDn(short id) const {return An[id].first;}
TVector3 GetAnodeUp(short id) const {return An[id].second;}
TVector3 GetCathodeDn(short id) const {return Ca[id].first;}
TVector3 GetCathodeUp(short id) const {return Ca[id].second;}
inline std::tuple<std::pair<TVector3, TVector3>, double, double, double> GetPseudoWire(const std::vector<std::tuple<int,double,double>>& cluster, std::string type);
TVector3 GetAnodneMid(short id) const {return (An[id].first + An[id].second) * 0.5; }
double GetAnodeTheta(short id) const {return (An[id].first - An[id].second).Theta();}
double GetAnodePhi(short id) const {return (An[id].first - An[id].second).Phi();}
inline std::tuple<TVector3,double,double,double,double,double,double,double>
FindCrossoverProperties(const std::vector<std::tuple<int,double,double>>& a_cluster, const std::vector<std::tuple<int,double,double>>& c_cluster);
TVector3 GetCathodneMid(short id) const {return (Ca[id].first + Ca[id].second) * 0.5; }
double GetCathodeTheta(short id) const {return (Ca[id].first - Ca[id].second).Theta();}
double GetCathodePhi(short id) const {return (Ca[id].first - Ca[id].second).Phi();}
inline std::vector<std::vector<std::tuple<int,double,double>>>
Make_Clusters(std::unordered_map<int,std::tuple<int,double,double>> wireEvents);
int GetNumWire() const { return nWire; }
double GetDeltaAngle() const { return dAngle; }
double GetAnodeLength() const { return anodeLength; }
double GetCathodeLength() const { return cathodeLength; }
TVector3 GetAnodeDn(short id) const { return An[id].first; }
TVector3 GetAnodeUp(short id) const { return An[id].second; }
TVector3 GetCathodeDn(short id) const { return Ca[id].first; }
TVector3 GetCathodeUp(short id) const { return Ca[id].second; }
TVector3 GetAnodneMid(short id) const { return (An[id].first + An[id].second) * 0.5; }
double GetAnodeTheta(short id) const { return (An[id].first - An[id].second).Theta(); }
double GetAnodePhi(short id) const { return (An[id].first - An[id].second).Phi(); }
TVector3 GetCathodneMid(short id) const { return (Ca[id].first + Ca[id].second) * 0.5; }
double GetCathodeTheta(short id) const { return (Ca[id].first - Ca[id].second).Theta(); }
double GetCathodePhi(short id) const { return (Ca[id].first - Ca[id].second).Phi(); }
void ClearHitInfo();
void ConstructGeo();
void FindWireID(TVector3 pos, TVector3 direction, bool verbose = false);
void CalTrack(TVector3 sx3Pos, int anodeID, int cathodeID, bool verbose = false);
void CalTrack2(TVector3 sx3Pos, PWHitInfo hitInfo, double sigmaA = 0, double sigmaC = 0, bool verbose = false);
//void CalTrack2(TVector3 sx3Pos, TVector3 anodeInt, bool verbose = false);
void CalTrack2(TVector3 sx3Pos, PWHitInfo hitInfo, double sigmaA, double sigmaC, bool verbose);
double CircularMean(std::vector<std::pair<int, double>> wireList);
void Print(){
void Print()
{
printf(" The nearest | Anode: %2d(%5.2f) Cathode: %2d(%5.2f)\n", hitInfo.nearestWire.first,
hitInfo.nearestDist.first,
hitInfo.nearestWire.second,
@ -80,7 +111,6 @@ public:
}
private:
PWHitInfo hitInfo;
TVector3 trackPos;
@ -88,7 +118,8 @@ private:
const int nWire = 24;
const int wireShift = 3;
const float zLen = 380; //mm
//const float zLen = 380; // mm
const float zLen = 348.6; // mm
const float radiusA = 37;
const float radiusC = 43;
@ -96,23 +127,25 @@ private:
double anodeLength;
double cathodeLength;
std::vector<std::pair<TVector3,TVector3>> An; // the anode wire position vector in space
std::vector<std::pair<TVector3,TVector3>> Ca; // the cathode wire position vector in space
// std::vector<std::pair<TVector3, TVector3>> An; // the anode wire position vector in space
// std::vector<std::pair<TVector3, TVector3>> Ca; // the cathode wire position vector in space
double Distance(TVector3 a1, TVector3 a2, TVector3 b1, TVector3 b2){
double Distance(TVector3 a1, TVector3 a2, TVector3 b1, TVector3 b2)
{
TVector3 na = a1 - a2;
TVector3 nb = b1 - b2;
TVector3 nd = (na.Cross(nb)).Unit();
return TMath::Abs(nd.Dot(a1-b2));
return TMath::Abs(nd.Dot(a1 - b2));
}
};
inline void PW::ClearHitInfo(){
inline void PW::ClearHitInfo()
{
hitInfo.Clear();
}
inline void PW::ConstructGeo(){
inline void PW::ConstructGeo()
{
An.clear();
Ca.clear();
@ -120,108 +153,296 @@ inline void PW::ConstructGeo(){
std::pair<TVector3, TVector3> p1; // anode
std::pair<TVector3, TVector3> q1; // cathode
//anode and cathode start at pos-Y axis and count in right-Hand
//anode wire shift is right-hand.
//cathode wire shift is left-hand.
// anode and cathode start at pos-Y axis and count in right-Hand
// anode wire shift is right-hand.
// cathode wire shift is left-hand.
for(int i = 0; i < nWire; i++ ){
for (int i = 0; i < nWire; i++)
{
// Anode rotate right-hand
p1.first.SetXYZ( radiusA * TMath::Cos( TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
radiusA * TMath::Sin( TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
zLen/2);
p1.second.SetXYZ( radiusA * TMath::Cos( TMath::TwoPi() / nWire * (i + wireShift) + TMath::PiOver2()),
radiusA * TMath::Sin( TMath::TwoPi() / nWire * (i + wireShift) + TMath::PiOver2()),
-zLen/2);
p1.first.SetXYZ(radiusA * TMath::Cos(TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
radiusA * TMath::Sin(TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
zLen / 2);
p1.second.SetXYZ(radiusA * TMath::Cos(TMath::TwoPi() / nWire * (i + wireShift) + TMath::PiOver2()),
radiusA * TMath::Sin(TMath::TwoPi() / nWire * (i + wireShift) + TMath::PiOver2()),
-zLen / 2);
An.push_back(p1);
// Cathod rotate left-hand
q1.first.SetXYZ( radiusC * TMath::Cos( TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
radiusC * TMath::Sin( TMath::TwoPi() / nWire * (i) + TMath::PiOver2()),
zLen/2);
q1.second.SetXYZ( radiusC * TMath::Cos( TMath::TwoPi() / nWire * (i - wireShift) + TMath::PiOver2()),
radiusC * TMath::Sin( TMath::TwoPi() / nWire * (i - wireShift) + TMath::PiOver2()),
-zLen/2);
// Cathod rotate left-hand with the 3 wire offset accounted for (+1 from the calculated offset from the PC coincidence spectrum)
q1.first.SetXYZ(radiusC * TMath::Cos(TMath::TwoPi() / nWire * (i + wireShift + 1) + TMath::PiOver2()),
radiusC * TMath::Sin(TMath::TwoPi() / nWire * (i + wireShift + 1) + TMath::PiOver2()),
zLen / 2);
q1.second.SetXYZ(radiusC * TMath::Cos(TMath::TwoPi() / nWire * (i + 1) + TMath::PiOver2()),
radiusC * TMath::Sin(TMath::TwoPi() / nWire * (i + 1) + TMath::PiOver2()),
-zLen / 2);
Ca.push_back(q1);
}
// correcting for the fact that the order of the cathode wires is reversed
std::reverse(Ca.begin(), Ca.end());
// adjusting for the 3 wire offset, the rbegin and rend are used as the rotation of the wires is done in the opposite direction i.e. 1,2,3 -> 3,1,2
// NOT NECESSARY ANY MORE, HAS BEEN IMCORPORATED INTO THE WIREOFFSET IN THE BEGINNING
// std::rotate(Ca.rbegin(), Ca.rbegin() + 4, Ca.rend());
dAngle = wireShift * TMath::TwoPi() / nWire;
anodeLength = TMath::Sqrt( zLen*zLen + TMath::Power(2* radiusA * TMath::Sin(dAngle/2),2) );
cathodeLength = TMath::Sqrt( zLen*zLen + TMath::Power(2* radiusC * TMath::Sin(dAngle/2),2) );
anodeLength = TMath::Sqrt(zLen * zLen + TMath::Power(2 * radiusA * TMath::Sin(dAngle / 2), 2));
cathodeLength = TMath::Sqrt(zLen * zLen + TMath::Power(2 * radiusC * TMath::Sin(dAngle / 2), 2)); //chord length subtending an angle alpha is 2rsin(alpha/2)
}
inline void PW::FindWireID(TVector3 pos, TVector3 direction, bool verbose ){
inline std::vector<std::vector<std::tuple<int,double,double>>>
PW::Make_Clusters(std::unordered_map<int,std::tuple<int,double,double>> wireEvents) {
std::vector<std::vector<std::tuple<int,double,double>>> wireClusters;
std::vector<std::tuple<int,double,double>> wireCluster;
//TODO: Write a macro once, call it twice
int wirecount=0;
while(wirecount < 24) {
if(wireEvents.find(wirecount)==wireEvents.end()) {
wirecount++;
continue;
}
wireCluster.clear();
int ctr2=wirecount;
do {
wireCluster.emplace_back(wireEvents[ctr2]);
ctr2+=1;
if(ctr2==24 || ctr2-wirecount == 7) break; //loose logic, needs to be looked at.
} while(wireEvents.find(ctr2)!=wireEvents.end());
wireClusters.push_back(std::move(wireCluster));
wirecount = ctr2; //we already dealt with wires until the last value of ctr2
}
if(wireClusters.size() > 1) { //Deal with wraparound if required
auto first_cluster = wireClusters.front(); //front and back provide references to the elements themselves. less copy, can modify etc
auto last_cluster = wireClusters.back();
if(std::get<0>(last_cluster.back())==23 && std::get<0>(first_cluster.front())==0) {
last_cluster.insert(last_cluster.end(),first_cluster.begin(),first_cluster.end());
}
wireClusters.erase(wireClusters.begin()); //canonically, erase() needs an iterator, hence begin() not front()
//TODO: Can also deal with 'gaps' of missing wires similarly. end of one segment and beginning of another segment will be separated by missing wire --> combine the two
//TODO: Also needs some development regarding the time-correlation. Don't put wires in the same cluster if they aren't time coincident
}
return wireClusters;
/*if(aClusters.size()>1 || cClusters.size() > 1) {
std::cout << " ============== " << std::endl;
}
if(aClusters.size()>1 && cClusters.size() >=1) {
std::cout << aClusters.size() << " new anode clusters ----> " << std::endl;
int cc=1;
for(auto ac : aClusters) {
std::cout << " Cluster " << cc << std::endl;
double first_ts = std::get<2>(ac.at(0));
for(auto item : ac) {
std::cout << " \t" << std::get<0>(item) << " " << std::get<1>(item) << " " << std::get<2>(item)-first_ts << std::endl;
}
std::cout << " ------" << std::endl;
cc++;
}
}
if(cClusters.size()>=1 ) {
std::cout << cClusters.size() << " new cathode clusters ----> " << std::endl;
int cc=1;
for(auto ac : cClusters) {
std::cout << " Cluster " << cc << std::endl;
double first_ts = std::get<2>(ac.at(0));
for(auto item : ac) {
std::cout << " \t" << std::get<0>(item) << " " << std::get<1>(item) << " " << std::get<2>(item)-first_ts << std::endl;
}
std::cout << " ------" << std::endl;
cc++;
}
} */
}
inline std::tuple<std::pair<TVector3, TVector3>, double, double, double>
PW::GetPseudoWire(const std::vector<std::tuple<int,double,double>>& cluster, std::string type) {
std::pair<TVector3,TVector3> avgvec = std::pair(TVector3(0,0,0),TVector3(0,0,0));
double sumEnergy = 0;
double maxEnergy = 0;
double tsMaxEnergy = 0;
if(type=="ANODE") {
//if(cluster.size()>1) std::cout << " -------anodes" << std::endl;
for( auto wire : cluster) {
avgvec.first += std::get<1>(wire)*TVector3(An.at(std::get<0>(wire)).first.X(), An.at(std::get<0>(wire)).first.Y(), 0) ;
avgvec.second += std::get<1>(wire)*TVector3(An.at(std::get<0>(wire)).second.X(), An.at(std::get<0>(wire)).second.Y(), 0);
sumEnergy += std::get<1>(wire);
if(std::get<1>(wire) > maxEnergy) {
maxEnergy = std::get<1>(wire);
tsMaxEnergy = std::get<2>(wire);
}
/*if(cluster.size()>1) {
std::cout << "\t\t ch:" << std::get<0>(wire) << " " << std::get<1>(wire) << " " << std::get<2>(wire) << std::endl;
std::cout << "\t\t w1(r,phi,z):" << An.at(std::get<0>(wire)).first.Perp() << " " << An.at(std::get<0>(wire)).first.Phi()*180/M_PI << " " << An.at(std::get<0>(wire)).first.Z() << std::endl;
std::cout << "\t\t w2(r,phi,z):" << An.at(std::get<0>(wire)).second.Perp() << " " << An.at(std::get<0>(wire)).second.Phi()*180/M_PI << " " << An.at(std::get<0>(wire)).second.Z() << std::endl;
}*/
}
avgvec.first = avgvec.first*(1.0/sumEnergy);
avgvec.second = avgvec.second*(1.0/sumEnergy);
double phi1 = avgvec.first.Phi();
double phi2 = avgvec.second.Phi();
avgvec.first.SetXYZ(radiusA*TMath::Cos(phi1), radiusA*TMath::Sin(phi1), zLen/2);
avgvec.second.SetXYZ(radiusA*TMath::Cos(phi2), radiusA*TMath::Sin(phi2), -zLen/2);
/*if(cluster.size()>1) {
std::cout << "\t\t avg1(r,phi,z):" << avgvec.first.Perp() << " " << avgvec.first.Phi()*180/M_PI << " " << avgvec.first.Z() << std::endl;
std::cout << "\t\t avg2(r,phi,z):" << avgvec.second.Perp() << " " << avgvec.second.Phi()*180/M_PI << " " << avgvec.second.Z() << std::endl;
}*/
} else if(type =="CATHODE") {
for( auto wire : cluster) {
avgvec.first += std::get<1>(wire)*TVector3(Ca.at(std::get<0>(wire)).first.X(), Ca.at(std::get<0>(wire)).first.Y(), 0) ;
avgvec.second += std::get<1>(wire)*TVector3(Ca.at(std::get<0>(wire)).second.X(), Ca.at(std::get<0>(wire)).second.Y(), 0);
sumEnergy += std::get<1>(wire);
if(std::get<1>(wire) > maxEnergy) {
maxEnergy = std::get<1>(wire);
tsMaxEnergy = std::get<2>(wire);
}
}
avgvec.first = avgvec.first*(1.0/sumEnergy);
avgvec.second = avgvec.second*(1.0/sumEnergy);
double phi1 = avgvec.first.Phi();
double phi2 = avgvec.second.Phi();
avgvec.first.SetXYZ(radiusC*TMath::Cos(phi1), radiusC*TMath::Sin(phi1), zLen/2);
avgvec.second.SetXYZ(radiusC*TMath::Cos(phi2), radiusC*TMath::Sin(phi2), -zLen/2);
}
return std::tuple(avgvec, sumEnergy, maxEnergy, tsMaxEnergy);
}
inline std::tuple<TVector3,double,double,double,double,double,double,double> PW::FindCrossoverProperties(const std::vector<std::tuple<int,double,double>>& a_cluster,
const std::vector<std::tuple<int,double,double>>& c_cluster) {
//std::pair<TVector3, TVector3> apwire = GetPseudoWire(a_cluster,"ANODE",anodeSumE);
//std::pair<TVector3, TVector3> cpwire = GetPseudoWire(c_cluster,"CATHODE",cathodeSumE);
auto [apwire, apSumE, apMaxE, apTSMaxE] = GetPseudoWire(a_cluster,"ANODE");
auto [cpwire, cpSumE, cpMaxE, cpTSMaxE] = GetPseudoWire(c_cluster,"CATHODE");
TVector3 crossover;
crossover.Clear();
TVector3 a, c, diff;
double a2, ac, c2, adiff, cdiff, denom, alpha=0;
if(apSumE && cpSumE) {
a = apwire.first - apwire.second;
c = cpwire.first - cpwire.second;
diff = apwire.first - cpwire.first;
a2 = a.Dot(a);
c2 = c.Dot(c);
ac = a.Dot(c);
adiff = a.Dot(diff);
cdiff = c.Dot(diff);
denom = a2 * c2 - ac * ac;
alpha = (ac * cdiff - c2 * adiff) / denom;
crossover = apwire.first + alpha*a;
if(crossover.z() < -190 || crossover.Z() > 190 ) {
alpha = 9999999;
apSumE=-1; cpSumE=-1;
apMaxE=-1; cpMaxE=-1;
apTSMaxE=-1; cpTSMaxE=-1;
}
}
//std::cout << apSumE << " " << cpSumE << " " << " " << crossover.Perp() << std::endl;
return std::tuple(crossover,alpha,apSumE,cpSumE,apMaxE,cpMaxE,apTSMaxE,cpTSMaxE);
}
inline void PW::FindWireID(TVector3 pos, TVector3 direction, bool verbose)
{
//to skip certain wires, add their IDs to the skipAnodes and skipCathodes vectors above, then in this function, add a check to set the distance to a large number if the wire ID is in the skip list, e.g. if(std::find(skipAnodes.begin(), skipAnodes.end(), i) != skipAnodes.end()) { disA = 99999999; } to skip anode wire i, and if(std::find(skipCathodes.begin(), skipCathodes.end(), i) != skipCathodes.end()) { disC = 99999999; } to skip cathode wire i.
//do this on the line before the line "if (phiS < phi && phi < phiL)" in the anode and cathode loops below, respectively, so that the wires will be marked as invalid and not used in track reconstruction
hitInfo.Clear();
double phi = direction.Phi();
for( int i = 0; i < nWire; i++){
for (int i = 0; i < nWire; i++)
{
double disA = 99999999;
double phiS = An[i].first.Phi() - TMath::PiOver4();
double phiL = An[i].second.Phi() + TMath::PiOver4();
// printf("A%2d: %f %f | %f\n", i, phiS * TMath::RadToDeg(), phiL * TMath::RadToDeg(), phi * TMath::RadToDeg());
if( phi > 0 && phiS > phiL ) phiL = phiL + TMath::TwoPi();
if( phi < 0 && phiS > phiL ) phiS = phiS - TMath::TwoPi();
if( phiS < phi && phi < phiL) {
disA = Distance( pos, pos + direction, An[i].first, An[i].second);
if( disA < hitInfo.nearestDist.first ){
if (phi > 0 && phiS > phiL)
phiL = phiL + TMath::TwoPi();
if (phi < 0 && phiS > phiL)
phiS = phiS - TMath::TwoPi();
if(std::find(skipAnodes.begin(), skipAnodes.end(), i) != skipAnodes.end()) { // check if the current anode wire ID is in the skipAnodes vector
disA = 99999999;
}
if (phiS < phi && phi < phiL) // check if the track direction is within the angular range of the wire
{
disA = Distance(pos, pos + direction, An[i].first, An[i].second);
if (disA < hitInfo.nearestDist.first)
{
hitInfo.nearestDist.first = disA;
hitInfo.nearestWire.first = i;
}
}
double disC = 99999999;
phiS = Ca[i].second.Phi()- TMath::PiOver4();
phiS = Ca[i].second.Phi() - TMath::PiOver4();
phiL = Ca[i].first.Phi() + TMath::PiOver4();
// printf("C%2d: %f %f\n", i, phiS * TMath::RadToDeg(), phiL * TMath::RadToDeg());
if( phi > 0 && phiS > phiL ) phiL = phiL + TMath::TwoPi();
if( phi < 0 && phiS > phiL ) phiS = phiS - TMath::TwoPi();
if(std::find(skipCathodes.begin(), skipCathodes.end(), i) != skipCathodes.end()) { // check if the current cathode wire ID is in the skipCathodes vector
disC = 99999999;
}
if (phi > 0 && phiS > phiL)
phiL = phiL + TMath::TwoPi();
if (phi < 0 && phiS > phiL)
phiS = phiS - TMath::TwoPi();
if(phiS < phi && phi < phiL) {
disC = Distance( pos, pos + direction, Ca[i].first, Ca[i].second);
if( disC < hitInfo.nearestDist.second ){
if (phiS < phi && phi < phiL)
{
disC = Distance(pos, pos + direction, Ca[i].first, Ca[i].second);
if (disC < hitInfo.nearestDist.second)
{
hitInfo.nearestDist.second = disC;
hitInfo.nearestWire.second = i;
}
}
if(verbose) printf(" %2d | %8.2f, %8.2f\n", i, disA, disC);
if (verbose)
printf(" %2d | %8.2f, %8.2f\n", i, disA, disC);
}
//==== find the 2nd nearest wire
short anode1 = hitInfo.nearestWire.first;
short aaa1 = anode1 - 1; if( aaa1 < 0 ) aaa1 += nWire;
short aaa1 = anode1 - 1;
if (aaa1 < 0)
aaa1 += nWire;
short aaa2 = (anode1 + 1) % nWire;
double haha1 = Distance( pos, pos + direction, An[aaa1].first, An[aaa1].second);
double haha2 = Distance( pos, pos + direction, An[aaa2].first, An[aaa2].second);
if( haha1 < haha2){
double haha1 = Distance(pos, pos + direction, An[aaa1].first, An[aaa1].second);
double haha2 = Distance(pos, pos + direction, An[aaa2].first, An[aaa2].second);
if (haha1 < haha2)
{
hitInfo.nextNearestWire.first = aaa1;
hitInfo.nextNearestDist.first = haha1;
}else{
}
else
{
hitInfo.nextNearestWire.first = aaa2;
hitInfo.nextNearestDist.first = haha2;
}
short cathode1 = hitInfo.nearestWire.second;
short ccc1 = cathode1 - 1; if( ccc1 < 0 ) ccc1 += nWire;
short ccc1 = cathode1 - 1;
if (ccc1 < 0)
ccc1 += nWire;
short ccc2 = (cathode1 + 1) % nWire;
haha1 = Distance( pos, pos + direction, Ca[ccc1].first, Ca[ccc1].second);
haha2 = Distance( pos, pos + direction, Ca[ccc2].first, Ca[ccc2].second);
if( haha1 < haha2){
haha1 = Distance(pos, pos + direction, Ca[ccc1].first, Ca[ccc1].second);
haha2 = Distance(pos, pos + direction, Ca[ccc2].first, Ca[ccc2].second);
if (haha1 < haha2)
{
hitInfo.nextNearestWire.second = ccc1;
hitInfo.nextNearestDist.second = haha1;
}else{
}
else
{
hitInfo.nextNearestWire.second = ccc2;
hitInfo.nextNearestDist.second = haha2;
}
if( verbose ) Print();
if (verbose)
Print();
}
inline void PW::CalTrack(TVector3 sx3Pos, int anodeID, int cathodeID, bool verbose){
inline void PW::CalTrack(TVector3 sx3Pos, int anodeID, int cathodeID, bool verbose)
{
trackPos = sx3Pos;
@ -231,11 +452,13 @@ inline void PW::CalTrack(TVector3 sx3Pos, int anodeID, int cathodeID, bool verbo
// if the handiness of anode and cathode revered, it should be n2 cross n1
trackVec = (n2.Cross(n1)).Unit();
if( verbose ) printf("Theta, Phi = %f, %f \n", trackVec.Theta() *TMath::RadToDeg(), trackVec.Phi()*TMath::RadToDeg());
if (verbose)
printf("Theta, Phi = %f, %f \n", trackVec.Theta() * TMath::RadToDeg(), trackVec.Phi() * TMath::RadToDeg());
}
inline void PW::CalTrack2(TVector3 sx3Pos, PWHitInfo hitInfo, double sigmaA, double sigmaC, bool verbose){
inline void PW::CalTrack2(TVector3 sx3Pos, PWHitInfo hitInfo, double sigmaA, double sigmaC, bool verbose)
{
trackPos = sx3Pos;
@ -267,36 +490,31 @@ inline void PW::CalTrack2(TVector3 sx3Pos, PWHitInfo hitInfo, double sigmaA, dou
// if the handiness of anode and cathode revered, it should be n2 cross n1
trackVec = (n2.Cross(n1)).Unit();
if( verbose ) printf("Theta, Phi = %f, %f \n", trackVec.Theta() *TMath::RadToDeg(), trackVec.Phi()*TMath::RadToDeg());
if (verbose)
printf("Theta, Phi = %f, %f \n", trackVec.Theta() * TMath::RadToDeg(), trackVec.Phi() * TMath::RadToDeg());
}
inline double PW::GetZ0(){
/*inline TVector3 PW::CalTrack3(TVector3 siPos, TVector3 anodeInt, bool verbose)
{
double x = trackPos.X();
double y = trackPos.Y();
double rho = TMath::Sqrt(x*x + y*y);
double theta = trackVec.Theta();
TVector3 v = anodeInt-siPos;
double t_minimum = -1.0*(siPos.X()*v.X()+siPos.Y()*v.Y())/(v.X()*v.X()+v.Y()*v.Y());
TVector3 vector_closest_to_z = siPos + t_minimum*v;
return trackPos.Z() - rho / TMath::Tan(theta);
return vector_closest_to_z;
if (verbose)
printf("X slope = %f and Y slope = %f \n", mx, my);
}*/
}
inline double PW::GetZ0()
{
inline double PW::CircularMean(std::vector<std::pair<int, double>> wireList){
//use unit vector, wireID start from Zero
double xCom = 0, yCom = 0;
for( size_t i = 0; i < wireList.size() ; i++){
xCom += TMath::Cos(TMath::TwoPi() * wireList[i].first / nWire) * wireList[i].second;
yCom += TMath::Sin(TMath::TwoPi() * wireList[i].first / nWire) * wireList[i].second;
}
//calculate the angle of the summed unit vectors
double angle = TMath::ATan2(yCom, xCom);
if( angle < 0 ) angle += TMath::TwoPi(); // convert the angle from 0 to 2 pi
return angle/ TMath::TwoPi() * nWire;
[[maybe_unused]]double x = trackPos.X();
[[maybe_unused]]double y = trackPos.Y();
[[maybe_unused]]double rho = TMath::Sqrt(x * x + y * y);
[[maybe_unused]]double theta = trackVec.Theta();
return trackVec.Z();
}
#endif

280
Armory/ClassQQQ.h Normal file
View File

@ -0,0 +1,280 @@
#ifndef ClassQQQ_h
#define ClassQQQ_h
#include <cstdio>
#include <TMath.h>
#include <TVector3.h>
#include <TRandom.h>
#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "TGeoBBox.h"
class QQQ{
public:
QQQ(){Clear();};
~QQQ(){}
short GetID() const {return id;}
short GetChUp() const {return chUp;}
short GetChDn() const {return chDn;}
short GetChBk() const {return chBk;}
TVector3 GetHitPos() const {return hitPos;}
TVector3 GetHitPosWithSigma(double sigmaY_mm, double sigmaZ_mm);
double GetZFrac() const {return zFrac;} // range from -0.5 to 0.5
void Clear();
void ConstructGeo();
void FindQQQPos(TVector3 pos, TVector3 direction, bool verbose = false);
void CalQQQPos(unsigned short ID, unsigned short chUp, unsigned short chDown, unsigned short chBack, float eUp, float eDown);
double GetNumDet() const {return numDet;}
void Print(){
if( id == -1 ){
printf("Did not hit any QQQ.\n");
}else{
printf("ID: %d, U,D,B: %d %d %d| zFrac : %.2f\n", id, chUp, chDn, chBk, zFrac);
printf("Hit Pos: %.2f, %.2f, %.2f\n", hitPos.X(), hitPos.Y(), hitPos.Z());
}
}
// void CalZFrac(){
// zFrac = (eUp - eDn)/(eUp + eDn);
// }
private:
const int numDet = 4;
const float qqqR1 = 50;
const float qqqR2 = 100;
const float qqqZPos = 23 + 75 + 30;
short id; // -1 when no hit
short chUp;
short chDn;
short chBk;
double zFrac; // from +1 (downstream) to -1 (upstream)
double eUp;
double eDn;
double eBk;
TVector3 hitPos;
TGeoManager *geom;
TGeoVolume *worldBox;
TGeoMedium *Al;
// helper function to calculate intersection between line segments, return pair of (fraction along line1, fraction along line2) where the intersection occurs. If no intersection, return (0, -1).
std::pair<double, double> Intersect(TVector3 p1, TVector3 p2, TVector3 q1, TVector3 q2, bool verbose){
//see https://nukephysik101.wordpress.com/2023/12/30/intersect-between-2-line-segments/
//zero all z-component
TVector3 a0 = p1; a0.SetZ(0);
TVector3 a1 = p2; a1.SetZ(0);
TVector3 b0 = q1; b0.SetZ(0);
TVector3 b1 = q2; b1.SetZ(0);
double h = 0, k = 0; // placeholder values, implementation of intersection logic
if( verbose ) printf(" ----h, k : %f, %f\n", h, k);
return std::pair<double,double>(h,k);
}
};
inline void QQQ::Clear(){
id = -1;
chUp = -1;
chDn = -1;
chBk = -1;
zFrac = TMath::QuietNaN();
eUp = TMath::QuietNaN();
eDn = TMath::QuietNaN();
eBk = TMath::QuietNaN();
}
inline void QQQ::ConstructGeo(){
TGeoVolume *qqq = geom->MakeTubs("qqq", Al, qqqR1, qqqR2, 0.5, 5, 85); // thickness 0.5 mm, phi from 5 to 90 deg in each quadrant
qqq->SetLineColor(7);
for( int i = 0; i < 4; i++){
worldBox->AddNode(qqq, i+1, new TGeoCombiTrans( 0,
0,
qqqZPos,
new TGeoRotation("rot1", 360/4 * (i), 0., 0.))); //arguments are (name, material, inner radius, outer radius, half length in z, start phi, delta phi
}
}
inline void QQQ::FindQQQPos(TVector3 pos,
TVector3 direction,
bool verbose){
id = -1;
chUp = -1;
chDn = -1;
chBk = -1;
if( TMath::Abs(direction.Z()) < 1e-10 ) return;
double t = (qqqZPos - pos.Z()) / direction.Z();
if( t <= 0 ) return;
hitPos = pos + t * direction;
//--------------------------------------------
// Cylindrical coordinates
//--------------------------------------------
double x = hitPos.X();
double y = hitPos.Y();
double r = TMath::Sqrt(x*x + y*y);
if( r < qqqR1 || r > qqqR2 ) return;
double phi = hitPos.Phi() * TMath::RadToDeg();
if( phi < 0 ) phi += 360.0;
//--------------------------------------------
// Determine detector ID
//--------------------------------------------
id = -1;
for(int det = 0; det < 4; det++){
double phiMin = det*90.0 + 5.0;
double phiMax = phiMin + 85.0;
if( phi >= phiMin && phi <= phiMax ){
id = det;
break;
}
}
if( id < 0 ) return;
const double ringWidth =
(qqqR2 - qqqR1)/32.0;
int ring =
(int)((r - qqqR1)/ringWidth);
if( ring < 0 ) ring = 0;
if( ring > 31 ) ring = 31;
//--------------------------------------------
// Sector number (4 strips)
//--------------------------------------------
double localPhi =
phi - (id*90.0 + 5.0);
int sector =
(int)(localPhi/(85.0/4.0));
if( sector < 0 ) sector = 0;
if( sector > 3 ) sector = 3;
chBk = ring;
chDn = sector;
chUp = sector;
zFrac = 0.0;
if(verbose){
printf("\nQQQ Hit\n");
printf(" ID = %d\n", id);
printf(" Ring = %d\n", ring);
printf(" Sector = %d\n", sector);
printf(" r = %.2f mm\n", r);
printf(" phi = %.2f deg\n", phi);
hitPos.Print();
}
}
/*s
inline TVector3 QQQ::GetHitPosWithSigma(double sigmaY_mm, double sigmaZ_mm){
double phi = SNorml[id%numDet].Phi();
TVector3 haha = hitPos;
haha.RotateZ(-phi);
double y = haha.Y() + gRandom->Gaus(0, sigmaY_mm);
if( sigmaY_mm < 0 ){
double deltaW = width/4;
y = TMath::Floor((haha.Y()-deltaW)/deltaW)*deltaW + deltaW*1.5; // when ever land on each strip, set the position to be center of the strip.
if( y >= 25 ) y = 15;
}
double z = haha.Z() + gRandom->Gaus(0, sigmaZ_mm);
if( sigmaZ_mm < 0 ){
haha.Z();
double delta = length/4;
int sign = z > 0 ? 1 : -1;
z = TMath::Floor( (abs(z)-gap/2)/delta )*delta + 0.5 * delta + gap/2;
if( z >= 107.375 ) z = 88.625;
z = sign * z;
}
haha.SetY(y);
haha.SetZ(z);
haha.RotateZ(phi);
return haha;
}*/
inline void QQQ::CalQQQPos(unsigned short ID,
unsigned short chUp,
unsigned short chDown,
unsigned short chBack,
float eUp,
float eDown){
hitPos.Clear();
if( ID > 3 ) return;
if( chBack > 31 ) return;
if( chDown > 3 ) return;
const double ringWidth =
(qqqR2 - qqqR1)/32.0;
double r =
qqqR1 + (chBack + 0.5)*ringWidth;
const double sectorWidth =
85.0/4.0;
double phiDeg =
ID*90.0 + 5.0 +
(chDown + 0.5)*sectorWidth;
double phi =
phiDeg * TMath::DegToRad();
hitPos.SetXYZ(
r*TMath::Cos(phi),
r*TMath::Sin(phi),
qqqZPos
);
id = ID;
chBk = chBack;
chDn = chDown;
chUp = chUp;
}
#endif

View File

@ -57,8 +57,8 @@ private:
const int numDet = 12;
const float radius = 88;
const float width = 40;
const float length = 75;
const float gap = 46;
const float length = 75; // 75
const float gap = 46; // 46
short id; // -1 when no hit
short chUp;

View File

@ -16,7 +16,6 @@
#include "Isotope.h"
class ReactionConfig{
public:
ReactionConfig(){}
@ -47,9 +46,9 @@ public:
std::vector<float> beamEx; ///excitation_energy_of_A[MeV]
void SetReaction(int beamA, int beamZ,
int targetA, int targetZ,
int recoilA, int recoilZ, float beamEnergy_AMeV){
void SetReaction(int beamA, int beamZ, // projectile
int targetA, int targetZ, // target
int recoilA, int recoilZ, float beamEnergy_AMeV){ // light recoil, e.g. alpha
this->beamA = beamA;
this->beamZ = beamZ;
this->targetA = targetA;
@ -176,10 +175,10 @@ public:
void SetA(int A, int Z, double Ex);
void Seta(int A, int Z);
void Setb(int A, int Z);
void SetB(int A, int Z);
void SetB(int A, int Z, double Ex);
void SetIncidentEnergyAngle(double KEA, double theta, double phi);
void SetExA(double Ex);
void SetExB(double Ex);
void SetExA(double Ex); // excitation energy of A in MeV
void SetExB(double Ex); // excitation energy of B in MeV
void SetReactionFromFile(string settingFile);
TString GetReactionName();
@ -246,8 +245,8 @@ TransferReaction::TransferReaction(){
SetA(24, 12, 0);
Seta(4,2);
Setb(1,1);
SetB(27,13);
TA = 2.5;
SetB(27,13, 0);
TA = 2.5; // MeV/u
T = TA * reaction.beamA;
ExA = 0;
@ -301,17 +300,19 @@ void TransferReaction::Setb(int A, int Z){
isReady = false;
isBSet = false;
}
void TransferReaction::SetB(int A, int Z){
void TransferReaction::SetB(int A, int Z, double Ex = 0){
Isotope temp (A, Z);
mB = temp.Mass;
double mB0 = temp.Mass; // ground state mass
mB = mB0;
reaction.recoilHeavyA = A;
reaction.recoilHeavyZ = Z;
nameB = temp.Name;
ExB = Ex;
isReady = false;
isBSet = true;
}
void TransferReaction::SetIncidentEnergyAngle(double KEA, double theta, double phi){
void TransferReaction::SetIncidentEnergyAngle(double KEA, double theta, double phi){ // KEA in MeV/u, theta and phi in degree
this->TA = KEA;
this->T = TA * reaction.beamA;
this->thetaIN = theta;
@ -390,7 +391,8 @@ void TransferReaction::CalReactionConstant(){
beta = k / (mA + ExA + ma + T);
gamma = 1 / TMath::Sqrt(1- beta * beta);
Etot = TMath::Sqrt(TMath::Power(mA + ExA + ma + T,2) - k * k);
p = TMath::Sqrt( (Etot*Etot - TMath::Power(mb + mB + ExB,2)) * (Etot*Etot - TMath::Power(mb - mB - ExB,2)) ) / 2 / Etot;
double mBtot = mB + ExB;
p = TMath::Sqrt( (Etot*Etot - TMath::Power(mb + mBtot,2)) * (Etot*Etot - TMath::Power(mb - mBtot,2)) ) / 2 / Etot;
PA.SetXYZM(0, 0, k, mA + ExA);
PA.RotateY(thetaIN);

414
Armory/HistPlotter.h Normal file
View File

@ -0,0 +1,414 @@
#ifndef HISTPLOTTER_H
#define HISTPLOTTER_H
#include <TCanvas.h>
#include <TROOT.h>
#include <TSystem.h>
#include <TStyle.h>
#include <iostream>
#include <TFile.h>
#include <TMemFile.h>
#include <TH1.h>
#include <TH2.h>
#include <TCutG.h>
#include <signal.h>
#include <cstdlib>
#include <utility>
#include <fstream>
#include <sstream>
#include <unordered_map>
#include <set>
#include <TGraphErrors.h>
class HistPlotter {
private:
long long barrier_count, barrier_limit; //meant to keep track of how often to call FillN() on histograms
enum {TFILE, TMEMFILE} filetype;
std::unordered_map<std::string,TObject*> oMap; //!< Maps std::string to all TH1, TH2 objects in the class
std::unordered_map<std::string,TObject*> cutsMap; //!< Maps std::string to TCutG objects held by the class
std::set<std::string> folderList; //!< List of all folder names used to nest objects
std::unordered_map<TObject*,std::string> foldersForObjects; //!< Map that returns the folder corresponding to the object whose pointer is specified
TFile *ofile=nullptr; //!< TFile pointer for the output file
TMemFile *omfile=nullptr; //!< TFile pointer for the output memfile
//Caches to permit FillN() calls
std::unordered_map<std::string, std::vector<double>> onedimcache;
std::unordered_map<std::string, std::pair<std::vector<double>, std::vector<double>>> twodimcache;
inline void FillN_All_Histograms();
public:
HistPlotter(std::string outfile, std::string type);
inline void FlushToDisk(); //!< Writes all objects to file before closing, nesting objects in folders as is found necessary
inline void PrintObjects(); //!< Dump objects to std::cout for inspection
inline void ReadCuts(std::string);
inline TCutG* FindCut(std::string cut) {
return static_cast<TCutG*>(cutsMap.at(cut));
}
inline void set_barrier_limit(long long limit) { barrier_limit = limit; }
inline void barrier_increment() {
barrier_count++;
if(barrier_count == barrier_limit) {
FillN_All_Histograms();
barrier_count=0;
}
}
/*! \fn void FindCut()
\brief
- Searches for a cut by name 'cut' in the internal list of cuts 'cutsMap'. Ugly fails (via unresolved at()) if such a cut isn't found.
\param filename - name of the plainxtext file containing the cut file locations and identifiers
\return Pointer to the TCutG object that matches the name. Very useful to use this as plotter.FindCut("protonbarrelpid")->IsInside(deltaE, E) for instance.
*/
inline void SetNewTitle(std::string name, std::string title) {
auto result = oMap.find(name); //result is an iterator
if(result==oMap.end()) return; //no warnings, could be changed in future
else
static_cast<TNamed*>(oMap.at(name))->SetTitle(title.c_str()); // set new title
}
//Smart functions that create a new histogram if it doesn't exist.
inline void FillGraph(const std::string &name, float valuex, float valuey, float errx=0, float erry=0);
inline void Fill1D(const std::string& name,int nbinsx, float xlow, float xhigh, float value);
inline void Fill2D(const std::string& name,int nbinsx, float xlow, float xhigh
,int nbinsy, float ylow, float yhigh, float valuex, float valuey);
inline void Fill1D(const std::string& name,int nbinsx, float xlow, float xhigh, float value, const std::string& folder);
inline void Fill2D(const std::string& name,int nbinsx, float xlow, float xhigh
,int nbinsy, float ylow, float yhigh, float valuex, float valuey, const std::string& folder);
//TObject* findObject(std::string key);
};
HistPlotter::HistPlotter(std::string outfile, std::string type="") {
/*!
\brief Constructor. Opens a TFile instance with the specified filename
\param outfile : std::string that holds the desired output ROOT filename
\return None
*/
if(type=="" || type == "TFILE") {
ofile = new TFile(outfile.c_str(),"recreate");
filetype = TFILE;
} else if(type =="TMEMFILE") {
omfile = new TMemFile(outfile.c_str(),"recreate");
filetype=TMEMFILE;
} else {
std::cout << "Unknown type "<< type << " specified for HistPlotter (use \"TFILE\" or \"TMEMFILE\"), using default \"TFILE\" " << std::endl;
ofile = new TFile(outfile.c_str(),"recreate");
filetype = TFILE;
}
barrier_count=0;
barrier_limit=1000;
}
void HistPlotter::FillN_All_Histograms() {
for(auto it=oMap.begin(); it!=oMap.end(); it++ ) {
//it->first is std::string 'name', it->second is the TObject
if(it->second->InheritsFrom("TH1F")) {
//FillN(size, array-of-doubles, array-of-weights); //we set array-of-weights to (1,1,1,.. (size)
static_cast<TH1F*>(it->second)->FillN(onedimcache[it->first].size(), //size
onedimcache[it->first].data(), //array
std::vector<double>(onedimcache[it->first].size(),1.0).data()); //weight of ones
onedimcache[it->first].clear();
} else if(it->second->InheritsFrom("TH2F")) {
//FillN(size, array-of-doubles, array-of-weights); //we set array-of-weights to (1,1,1,.. (size))
static_cast<TH2F*>(it->second)->FillN(twodimcache[it->first].first.size(), //size
twodimcache[it->first].first.data(), //x array
twodimcache[it->first].second.data(), //y array
std::vector<double>(twodimcache[it->first].first.size(),1.0).data()); //weight of ones
twodimcache[it->first].first.clear();
twodimcache[it->first].second.clear();
}
}
std::cout << "." << std::endl;
}
void HistPlotter::FlushToDisk() {
/*! \fn void FlushToDisk()
\brief Function that can be used at any point to exit smoothly by saving all ROOT objects in memory
to the output file before closing it. Obeys the binding of histograms to separate folders, if so specified.
\return No return -- void
*/
if(filetype==TMEMFILE && omfile) {
std::cout << "Not flushing a TMemfile .. exiting .." << std::endl;
delete omfile;
return;
}
if(ofile->IsZombie() || !ofile) {
std::cerr << "Output file is zombie, finishing up without writing to disk!" << std::endl;
return;
}
FillN_All_Histograms();
for(auto it=oMap.begin(); it!=oMap.end(); it++ ) {
//omap maps: name(first) to object address(second).
// foldersForObjects maps: object address(first) to foldername(second)
auto result = foldersForObjects.find(it->second); //returns <TObject* histogram,std::string foldername> pair if found
if(result!=foldersForObjects.end()) { //we try to create folder if needed and cd to it
ofile->mkdir(result->second.c_str(),"",kTRUE); // args: name, title, returnExistingDirectory
ofile->cd(result->second.c_str());
} else {
ofile->cd(); //toplevel for all default histograms. Default setting
}
it->second->Write();
}
//Create a directory for all cuts, and save all cuts in them
ofile->mkdir("gCUTS","",kTRUE);
ofile->cd("gCUTS");
for(auto it=cutsMap.begin(); it!=cutsMap.end(); it++) {
(static_cast<TNamed*>(it->second))->SetName(it->first.c_str());
it->second->Write();
}
ofile->Close();
std::cout << "Wrote " << oMap.size() << " histograms to TFile " << std::string(ofile->GetName()) << std::endl;
}
void HistPlotter::FillGraph(const std::string& name, float valuex, float valuey, float errx, float erry) {
/*! \fn void FillGraph()
\brief
- Creates a TGraphError in memory with name 'name' if it doesn't exist, and fills it with valuex, valuey
- Writes present state to disk and fails with return value -1 if the name clashes with another object that's not of type TGraph*
\param name name of the TGraph
\param valuex The xvalue
\param valuey The yvalue
\param errx The x error
\param erry The y error
\return No return void
*/
auto result = oMap.find(name);
if(result==oMap.end()) {
TGraphErrors *tempG = new TGraphErrors();
tempG->SetName(name.c_str());
oMap.insert(std::make_pair(name,static_cast<TObject*>(tempG)));
}
if(!oMap.at(name)->InheritsFrom("TGraphErrors")) {
std::cerr << "Object " << name << " refers to something other than a TGraph*, not filling it hence!" << std::endl;
std::cerr << "Abort.." << std::endl;
FlushToDisk();
exit(-1);
}
// static_cast<TGraphErrors*>(oMap.at(name))->AddPointError(valuex,valuey,errx,erry);
}
void HistPlotter::Fill1D(const std::string& name, int nbinsx, float xlow, float xhigh, float value) {
/*! \fn void Fill1D()
\brief
- Creates a TH1F in memory with name 'name' if it doesn't exist, and fills it with valuex, valuey
- Writes present state to disk and fails with return value -1 if the name clashes with another object that's not of type TH1*
\param name name of the TH1F histogram
\param nbinsx Number of bins in the histogram
\param xlow Lower limit on x-axis
\param xhigh Upper limit on x-axis
\param value The bin corresponding to value in (nbinsx, xlow, xhigh) is incremented by 1
\return No return void
*/
auto result = oMap.find(name); //result is an iterator
if(result==oMap.end()) {
TH1F* temp1D = new TH1F(name.c_str(), name.c_str(), nbinsx, xlow, xhigh);
oMap.insert(std::make_pair(name,static_cast<TObject*>(temp1D)));
onedimcache.insert(std::make_pair(name, std::vector<double>()));
onedimcache[name].reserve(16384);
} else if(foldersForObjects.find(oMap.at(name))!=foldersForObjects.end()) { //shouldn't have a folder associated with it
std::cerr << "Object " << name << " already registered at " << foldersForObjects[oMap[name]] << ", choose a different name for the histogram to be stored in toplevel .." << std::endl;
}
//Check if the string 'name' maps to a 1D hist. If there's any other object by this name raise issue
if(!oMap.at(name)->InheritsFrom("TH1F")) {
std::cerr << "Object " << name << " refers to something other than a TH1*, not filling it hence!" << std::endl;
std::cerr << "Abort.." << std::endl;
FlushToDisk();
exit(-1);
}
onedimcache[name].emplace_back(value);
//static_cast<TH1F*>(oMap.at(name))->Fill(value);
}
void HistPlotter::Fill1D(const std::string& name, int nbinsx, float xlow, float xhigh, float value, const std::string& foldername) {
/*! \fn void Fill1D()
\brief
- Creates a TH1F in memory with name 'name' if it doesn't exist, and fills it with valuex, valuey
- Writes present state to disk and fails with return value -1 if the name clashes with another object that's not of type TH1*
- Remembers the foldername this particular histogram maps to, if provided. If not, defaults to toplevel.
\param name name of the TH1F histogram
\param nbinsx Number of bins in the histogram
\param xlow Lower limit on x-axis
\param xhigh Upper limit on x-axis
\param value The bin corresponding to value in (nbinsx, xlow, xhigh) is incremented by 1
\param foldername Name of the folder to put this histogram into. Defaults to toplevel if left empty
\return No return -- void
*/
auto result = oMap.find(name); //result is an iterator
if(result==oMap.end()) {
TH1F* temp1D = new TH1F(name.c_str(), name.c_str(), nbinsx, xlow, xhigh);
oMap.insert(std::make_pair(name,static_cast<TObject*>(temp1D)));
onedimcache.insert(std::make_pair(name, std::vector<double>()));
onedimcache[name].reserve(16384);
if(foldername!="") {
if(folderList.find(foldername)==folderList.end()) {
folderList.insert(foldername);
}
foldersForObjects.insert(std::make_pair(static_cast<TObject*>(temp1D),foldername));
}
} else {
//object is present in map, but we enforce unique names
//it must already have a folder attached to it
if(foldersForObjects.find(oMap.at(name))==foldersForObjects.end()) {
std::cerr << "Object " << name << " already registered at toplevel, choose a different name for the histogram to be stored in " << foldername << " folder .." << std::endl;
} else if(foldersForObjects[oMap[name]]!=foldername) {
std::cerr << "Object " << name << " already registered at " << foldersForObjects[oMap[name]] << ", choose a different name for the histogram to be stored in " << foldername << " folder .." << std::endl;
}
}
//Check if the string 'name' maps to a 1D hist. If there's any other object by this name raise issue
if(!oMap.at(name)->InheritsFrom("TH1F")) {
std::cerr << "Object " << name << " refers to something other than a TH1*, not filling it hence!" << std::endl;
std::cerr << "Abort.." << std::endl;
FlushToDisk();
exit(-1);
}
onedimcache[name].emplace_back(value);
//static_cast<TH1F*>(oMap.at(name))->Fill(value);
}
void HistPlotter::Fill2D(const std::string& name, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, float valuex, float valuey) {
/*! \fn void Fill2D()
\brief
- Creates a TH2F in memory with name 'name' if it doesn't exist, and fills it with valuex, valuey
- Writes present state to disk and fails with return value -1 if the name clashes with another object that's not of type TH2*
\param name name of the TH1F histogram
\param nbinsx Number of xbins in the histogram
\param xlow Lower limit on x-axis
\param xhigh Upper limit on x-axis
\param nbinsy Number of ybins in the histogram
\param ylow Lower limit on y-axis
\param yhigh Upper limit on y-axis
\param valuex
\param valuey The bin corresponding to (valuex, valuey) in (nbinsx, xlow, xhigh, ybinsx, ylow, yhigh) is incremented by 1
\return No return -- void
*/
auto result = oMap.find(name); //result is an iterator
if(result==oMap.end()) {
TH2F* temp2D = new TH2F(name.c_str(), name.c_str(), nbinsx, xlow, xhigh, nbinsy, ylow, yhigh);
oMap.insert(std::make_pair(name,static_cast<TObject*>(temp2D)));
twodimcache.insert(std::make_pair(name, std::make_pair(std::vector<double>(),std::vector<double>())));
twodimcache[name].first.reserve(16384);
twodimcache[name].second.reserve(16384);
} else if(foldersForObjects.find(oMap.at(name))!=foldersForObjects.end()) { //shouldn't have a folder associated with it
std::cerr << "Object " << name << " already registered at " << foldersForObjects[oMap[name]] << ", choose a different name for the histogram to be stored in toplevel .." << std::endl;
}
//Check if the string 'name' maps to a 1D hist. If there's any other object by this name raise issue
if(!oMap.at(name)->InheritsFrom("TH2F")) {
std::cerr << "Object " << name << " refers to something other than a TH2*, not filling it hence!" << std::endl;
std::cerr << "Abort.." << std::endl;
FlushToDisk();
exit(-1);
}
twodimcache[name].first.emplace_back(valuex);
twodimcache[name].second.emplace_back(valuey);
//static_cast<TH2F*>(oMap.at(name))->Fill(valuex,valuey);
}
void HistPlotter::Fill2D(const std::string& name, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, float valuex, float valuey, const std::string& foldername) {
/*! \fn void Fill2D()
\brief
- Creates a TH2F in memory with name 'name' if it doesn't exist, and fills it with valuex, valuey
- Writes present state to disk and fails with return value -1 if the name clashes with another object that's not of type TH2*
- Remembers the foldername this particular histogram maps to, if provided. If not defaults to toplevel
\param name name of the TH1F histogram
\param nbinsx Number of xbins in the histogram
\param xlow Lower limit on x-axis
\param xhigh Upper limit on x-axis
\param nbinsy Number of ybins in the histogram
\param ylow Lower limit on y-axis
\param yhigh Upper limit on y-axis
\param valuex
\param valuey The bin corresponding to (valuex, valuey) in (nbinsx, xlow, xhigh, ybinsx, ylow, yhigh) is incremented by 1
\param foldername Name of the folder to put this histogram into. Defaults to toplevel if left empty
\return No return -- void
*/
auto result = oMap.find(name); //result is an iterator
if(result==oMap.end()) {
TH2F* temp2D = new TH2F(name.c_str(), name.c_str(), nbinsx, xlow, xhigh, nbinsy, ylow, yhigh);
oMap.insert(std::make_pair(name,static_cast<TObject*>(temp2D)));
twodimcache.insert(std::make_pair(name, std::make_pair(std::vector<double>(),std::vector<double>())));
twodimcache[name].first.reserve(16384);
twodimcache[name].second.reserve(16384);
if(foldername!="") {
if(folderList.find(foldername)==folderList.end()) {
folderList.insert(foldername);
}
foldersForObjects.insert(std::make_pair(static_cast<TObject*>(temp2D),foldername));
}
} else {
//object is present in map, but we enforce unique names
//it must already have a folder attached to it
if(foldersForObjects.find(oMap.at(name))==foldersForObjects.end()) {
std::cerr << "Object " << name << " already registered at toplevel, choose a different name for the histogram to be stored in " << foldername << " folder .." << std::endl;
} else if(foldersForObjects[oMap.at(name)]!=foldername) {
std::cerr << "Object " << name << " already registered at " << foldersForObjects[oMap[name]] << ", choose a different name for the histogram to be stored in " << foldername << " folder .." << std::endl;
}
}
//Check if the string 'name' maps to a 1D hist. If there's any other object by this name raise issue
if(!oMap.at(name)->InheritsFrom("TH2F")) {
std::cerr << "Object " << name << " refers to something other than a TH2*, not filling it hence!" << std::endl;
std::cerr << "Abort.." << std::endl;
FlushToDisk();
exit(-1);
}
twodimcache[name].first.emplace_back(valuex);
twodimcache[name].second.emplace_back(valuey);
//static_cast<TH2F*>(oMap.at(name))->Fill(valuex,valuey);
}
void HistPlotter::ReadCuts(std::string filename) {
/*! \fn void ReadCuts()
\brief Reads a list of cuts from a file. The file must have the format below, two columns
- Column#1 - path to a file that contains a single TCutG object named "CUTG", the default name in ROOT.
- Column#2 - The identifier name you plan to use in the code, like 'protonbarrelpid' or something, that will be searched by FindCut()
\param filename name of the plainxtext file containing the cut file locations and identifiers
\return No return -- void
*/
std::ifstream infile;
infile.open(filename);
std::string cutfilename, cutname;
for(std::string line; std::getline(infile, line); ) {
if(line.size()!=0 && line[0]=='#')
; //don't do anything with '#' lines
else {
std::stringstream ss(line);
ss>>cutfilename>>cutname;
TFile f(cutfilename.c_str());
if(f.IsZombie()) {
std::cerr << "Cannot open cutfile " << cutfilename << " .. skipping.." << std::endl;
continue;
}
TCutG *cut = (TCutG*)(f.Get("CUTG"));
cutsMap.insert(std::make_pair(cutname,static_cast<TObject*>(cut)));
f.Close();
} //else
}//for loop
infile.close();
}
void HistPlotter::PrintObjects() {
/*
void PrintObjects()
Prints the contents of the unordered_maps oMap and cutsMap to facilitate debugging
*/
std::cout << "Type | Name " << std::endl;
std::cout << "---- | --------------------- " << std::endl;
for(auto it=oMap.begin(); it!=oMap.end(); it++ ) {
std::cout << it->second->ClassName() << " | "<< it->first << std::endl;
}
for(auto it=cutsMap.begin(); it!=cutsMap.end(); it++ ) {
std::cout << it->second->ClassName() << " | "<< it->first << std::endl;
}
std::cout << "---- | --------------------- " << std::endl;
}
#endif

52
Armory/Hit.h Normal file
View File

@ -0,0 +1,52 @@
#ifndef Hit_H
#define Hit_H
#include <vector>
class Hit{
public:
unsigned short sn;
uint8_t ch;
unsigned short energy;
unsigned short energy2;
unsigned long long timestamp;
unsigned short fineTime;
bool pileUp;
unsigned short traceLength;
std::vector<short> trace;
Hit(){
Clear();
}
void Clear(){
sn = 0;
ch = 0;
energy = 0;
energy2 = 0;
timestamp = 0;
fineTime = 0;
traceLength = 0;
pileUp = false;
trace.clear();
}
void Print(){
printf("(%5d, %2d) %6d %16llu, %6d, %d, %5ld\n", sn, ch, energy, timestamp, fineTime, pileUp, trace.size());
}
void PrintTrace(){
for( unsigned short i = 0; i < traceLength; i++){
printf("%3u | %6d \n", i, trace[i]);
}
}
// Define operator< for sorting
bool operator<(const Hit& other) const {
return timestamp < other.timestamp;
}
};
#endif

674
Armory/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,28 +1,74 @@
########################################################################
#
#
#########################################################################
# Cross-platform Makefile (macOS + Linux)
########################################################################
CC = g++
UNAME_S := $(shell uname -s)
#COPTS = -fPIC -DLINUX -O2 -std=c++17 -lpthread
COPTS = -fPIC -DLINUX -g -O0 -Wall -std=c++17 -lpthread
########################################################################
# Defaults
########################################################################
ROOTLIBS = `root-config --cflags --glibs`
ifeq ($(UNAME_S),Darwin)
ALL = Mapper AnasenMS
########################################################################
# macOS (Homebrew + Apple Clang)
########################################################################
#########################################################################
SDKROOT := $(shell xcrun --show-sdk-path)
all : $(ALL)
CXX := clang++
clean :
/bin/rm -f $(OBJS) $(ALL)
ROOTCFLAGS := $(shell root-config --cflags | sed 's/-stdlib=libc++//g')
ROOTLIBS := $(shell root-config --libs | sed 's/-stdlib=libc++//g')
Mapper : Mapper.cpp ../mapping.h ClassDet.h
CXXFLAGS := -g -O0 -Wall -std=c++17 -fPIC
CXXFLAGS += $(ROOTCFLAGS)
CXXFLAGS += -isysroot $(SDKROOT)
CXXFLAGS += -I$(SDKROOT)/usr/include/c++/v1
LDFLAGS := $(shell root-config --glibs) -lGeom -lEve -lGui
else
########################################################################
# Linux (system g++)
########################################################################
CXX := g++
COPTS := -fPIC -DLINUX -g -O0 -Wall -std=c++17 -pthread
ROOTCFLAGS := $(shell root-config --cflags)
ROOTLIBS := $(shell root-config --libs)
CXXFLAGS := $(COPTS) $(ROOTCFLAGS)
LDFLAGS := $(ROOTLIBS) -lGeom -lEve -lGui
endif
########################################################################
# Targets
########################################################################
ALL = Mapper EventBuilder AnasenMS
all: $(ALL)
clean:
/bin/rm -f $(ALL)
########################################################################
# Build rules
########################################################################
Mapper: Mapper.cpp ../mapping.h ClassDet.h
@echo "--------- making Mapper"
$(CC) $(COPTS) -o Mapper Mapper.cpp $(ROOTLIBS)
$(CXX) $(CXXFLAGS) Mapper.cpp -o Mapper $(LDFLAGS)
AnasenMS : constant.h Isotope.h ClassTransfer.h ClassSX3.h ClassPW.h ClassAnasen.h anasenMS.cpp
EventBuilder: EventBuilder.cpp ClassData.h fsuReader.h Hit.h
@echo "--------- making EventBuilder"
$(CXX) $(CXXFLAGS) EventBuilder.cpp -o EventBuilder $(LDFLAGS)
AnasenMS: anasenMS.cpp constant.h Isotope.h ClassTransfer.h ClassSX3.h ClassPW.h ClassAnasen.h
@echo "--------- making ANASEN Monte Carlo"
$(CC) $(COPTS) -o AnasenMS anasenMS.cpp $(ROOTLIBS)
$(CXX) $(CXXFLAGS) anasenMS.cpp -o AnasenMS $(LDFLAGS)

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.Mapper</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
---
triple: 'arm64-apple-darwin'
binary-path: Mapper
relocations: []
...

98
Armory/README_anasenMS.md Normal file
View File

@ -0,0 +1,98 @@
# ANASEN Monte Carlo (anasenMS.cpp)
## Overview
`anasenMS.cpp` is a standalone Monte Carlo simulation for an ANASEN-style detector setup. It generates transfer reaction kinematics, propagates products to a wire chamber (PW) and a silicon array (SX3), reconstructs tracks, and writes output to a ROOT tree.
## Requirements
- ROOT (e.g. `root-config` for compile flags)
- C++ compiler (gcc/g++)
- Project includes: `ClassTransfer.h`, `ClassAnasen.h`, plus their dependent implementation files.
## Build
In `Armory` directory:
the directory contains a make file
Run `make AnasenMS` and it will automatically run
```bash
g++ -O2 -o anasenMS anasenMS.cpp ClassTransfer.cpp ClassAnasen.cpp ... `root-config --cflags --libs`
```
(Adjust source file list based on actual project layout.)
## Run
```bash
./anasenMS [numEvents] vis(optional)
```
- `numEvents`: optional integer, default `1000000`
- Outputs: `SimAnasen1.root` containing `tree1` and `tree2`
tree1 contains pre-energy loss calculations
tree2 contains post-energy loss calculations (subject to change)
## What the code does
- Detector geometry is built within ClassAnasen.h
-To assign dead channels (anode/cathode/SX3), add ID's to IsDead<detector> boolean functions at top of simulation,
inside the set
- Initializes reaction: `TransferReaction transfer`
- `SetA(24,12,0)` target
- `SetIncidentEnergyAngle(10,0,0)` beam energy and direction
- `Seta`, `Setb` reaction fragment indices
- Sets excitation lists: `ExAList`, `ExList`
- Vertex and resolution settings:
- `vertexX/Y/Z` ranges
- `sigmaSX3_W`, `sigmaSX3_L`, `sigmaPW_A`, `sigmaPW_C`
- Loads energy loss tables from `../ELoss/` using `TGraph` for interpolation
- Prepares ROOT output tree and branches for truth/reconstructed
- Loop over events:
- Sample excitation and CM direction
- `transfer.Event(thetaCM, phiCM)` outputs `TLorentzVector` products
- Compute lab angles/energies
- Random vertex inside target volume
- Run detector response:
- `pw->FindWireID(...)`
- `sx3->FindSX3Pos(...)`
- Read out wire hits and SX3 channel + depth
- Apply position smearing for SX3
- **Apply energy loss** to light particle using interpolated dE/dx from table, based on path length from vertex to hit
- Reconstruct track via `pw->CalTrack` and `pw->CalTrack2`
- Fill ROOT tree
- At end: write tree, close file, clean up
## Notes
- Important methods are from:
- `ClassTransfer` (`SetA`, `SetIncidentEnergyAngle`, `Seta`, `Setb`, `SetExA`, `SetExB`, `CalReactionConstant`, `Event`)
- `ClassAnasen` / `SX3` / `PW` (`FindWireID`, `FindSX3Pos`, `GetHitInfo`, `CalTrack`, `CalTrack2`, `GetTrackTheta`, `GetTrackPhi`, `GetZ0`, `GetHitPosWithSigma`, `GetID`, etc.)
- Optional: change excitation lists, vertex spread, and sigma values to mimic different beam/target conditions.
## Example Workflow
- Say you want to do a beam of Al27 through standard pressure gas.
- If using the random energy scan route, determine the depth your beam travels in the detector, and set the appropriate window in the .cpp file in <<vertexZRange>>.
- If you want to track it's energy loss through the detector, create a lookup table with PCEnergyAnalysis.py in the helium and import it using <<elossbeam>>. When making the table, set the initial energy of the beam as the 'max energy' of the table.
To take into account things like the kapton window and other materials, make lookup tables for them and map their energy loss through them one after another, and use the final energy from that as the maximum beam energy.
- For there you need to run a simulation for each reaction you want to measure. Declare their components in the transfer.Set(A,a,b,B). A is your beam, a is the helium target, b is your proton, alpha, deuterium, etc, and B is the daughter nuclei.
- Run 'make AnasenMS' in the build directory and let it compile. From there, run the excecutable './AnasenMS'. The simulation will run and automatically load all the data into the root file 'SimAnasen1.root'. This is the file that gets read into PCEnergyAnalysis.py.
- Once the simulation is complete, start the analysis script. Do not start it while the simulation is still running, or you will miss data. The simulation will automatically open the file SimAnasen1.root, and with that you can run 'make_plots'. If it's proton data, it will assume that automatically, but if it is alpha data, you need to pass 'alpha' as an additional argument.
- If you have two reactions to analyze, you can use 'dual_plotter'. Renaming them 'SimAnasenProton.root' and 'SimAnasenAlpha.root' will allow you to run the function with no additional arguments. However, for any other names or additional reactions, you will need to add the file names manually as additional arguments. The program assumes them to be in the Armory directory, so if they are in a subfile, include the subfile in the argument.
- Plots and histograms will automatically get saved to the ELoss folder. By default reactions are on tree1, and are sorted by particle
- Tree2 is used for secondary decay channels, and simulating double-proton decays. The secondary decay data is stored in tree2. Dual plotter will combine trees automatically, but make_plots assumes to use tree1. This can be switched using set_tree in the program, and then running make_plots
- Secondary reactions can be turned off and on with a boolean <<enableSequentialDecay>>
- Fill in relevant data about the decay in the lines following
- Additional features include terminal energy loss calculations using initial energy, final energy and distance travelled. Using two of these three there are three different functions to find the third variable. For range, use energy_distance, declare the particle, medium, the initial energy, and set final energy to 0. This will give you the range of the given particle.

183
Armory/SX3Geom.h Executable file
View File

@ -0,0 +1,183 @@
#ifndef SX3Geom_h
#define SX3Geom_h
#include <vector>
const double DEFAULT_NULL=-987654321.;
class sx3_geometry_scalefactors {
public:
//If sx3 has L, R being the left and right extremities, we choose add, stretch here such that
// x_mm = (x_raw+add)*stretch; so add=abs(L), stretch=75/(abs(L)+R)
float add[4];
float stretch[4];
};
class qqq5_finegains {
public:
std::array<std::pair<float,float>,32> front;
//front.at(30).first = slope at clkpos 0, ring 30 for E front layer
//front.at(30).second = intercept for the same as above
std::array<std::pair<float,float>,4> back;
};
class sx3_fbgains {
public:
//Order of indices is [pad][strip]
float padoffsets[4][4];
float padgains[4][4];
float stripLoffsets[4][4];
float stripLgains[4][4];
float stripRoffsets[4][4];
float stripRgains[4][4];
};
std::array<sx3_fbgains,24> sx3_xtalk_gains; //every sx3 needs to be gainmatched as a frontL-back, frontR-back pair (pad strip pair)
std::array<sx3_geometry_scalefactors,24> sx3gs;
class sx3 {
public:
//TODO: Convert to std::array
//Holds all information in an event, including ped subtraction+scaling. back[2].at(0) will have the largest energy seen in ch2, if any
std::vector<float> back[4];
std::vector<float> frontL[4];
std::vector<float> frontR[4];
double ts = DEFAULT_NULL;
//Easy lookup of final calibrated event. Only filled for valid cases, assumed for now to be 1L, 1R, 1B
float frontX=DEFAULT_NULL;
float frontXmm=DEFAULT_NULL;
float frontE=DEFAULT_NULL;
float backE=DEFAULT_NULL;
int stripF=DEFAULT_NULL;
int stripB=DEFAULT_NULL;
float frontEL=DEFAULT_NULL;
float frontER=DEFAULT_NULL;
float phi=DEFAULT_NULL; //
std::set<int> valid_front_chans;
std::set<int> valid_back_chans;
std::set<int> unmatched_front_chans; //every front channel is unmatched and invalid at first. when it gets matched, it gets removed and sent to valid
bool foundevent=false;
bool valid=false;//valid will be set to false in all cases where we have ambiguity
int flags=-1;//flags settable to different types of values to indicate different invalid situations
void fillevent(const std::string& position, const int subchannel, const float value); //make 'const' what functions don't need to change, helps with performance
void validate(const sx3_fbgains&, const sx3_geometry_scalefactors&);
void validate();
};
void sx3::fillevent(const std::string& positionstring, const int subchannel, const float value) {
assert(subchannel>=0 && subchannel<4);
if(positionstring=="FRONT_L") {
frontL[subchannel].push_back(value);
unmatched_front_chans.insert(subchannel);
} else if(positionstring=="FRONT_R") {
frontR[subchannel].push_back(value);
unmatched_front_chans.insert(subchannel);
} else if(positionstring=="BACK") {
back[subchannel].push_back(value);
valid_back_chans.insert(subchannel);
} else {
std::cout << "Unknown string "+positionstring+" encountered in sx3::fillevent \n" << std::endl;
}
if(frontL[subchannel].size()!=0 && frontR[subchannel].size()!=0 ) {
unmatched_front_chans.erase(subchannel);
valid_front_chans.insert(subchannel); //std::set, so no duplication will happen
}
}
//void sx3::validate(const sx3_fbgains& fbgains, const sx3_geometry_scalefactors& sx3gs) {
void sx3::validate() {
if(valid_front_chans.size()!=0 && valid_back_chans.size()!=0) {
valid=true;
float maxFE=0;
float maxBE=0;
//float zpos=0;
int bchan=-1;
int fchan=-1;
/* for(auto cc: valid_front_chans) {
std::cout << "fc" << cc << std::endl;// " " << frontL[cc].at(0) << " " << frontR[cc].at(0) << std::endl;
}
for(auto cc: valid_back_chans) {
std::cout << "bc" << cc << std::endl; //" " << back[cc].at(0) << std::endl;
}
*/
for(auto chan: valid_front_chans) {
if(frontL[chan].size()>1) {
printf("\nmultihit sx3 at Lsubchan:%d, ts:%1.13g\n",chan,ts);
for(const auto& e: frontL[chan]) printf("e: %f\t",e);
std::sort(frontL[chan].begin(), frontL[chan].end(), std::greater<float>());
flags += (-1000);
}
if(frontR[chan].size()>1) {
printf("\nmultihit sx3 at Rsubchan:%d, ts:%1.13g\n",chan,ts);
for(const auto& e: frontR[chan]) printf("e: %f\t",e);
std::sort(frontR[chan].begin(), frontR[chan].end(), std::greater<float>());
flags += (-2000);
}
//assign position using max L+R value
/*printf("chan:%d sizeL: %d sizeR: %d\n",chan, frontL[chan].size(), frontR[chan].size()); fflush(stdout);
printf("foo\n");
std::cout << "\nL:" << std::endl;
for(auto thing: frontL[chan]) std::cout << thing << " " << std::flush;
std::cout << "\nR:" << std::endl;
for(auto thing: frontR[chan]) std::cout << thing << " " << std::flush;*/
if(frontL[chan].at(0) + frontR[chan].at(0)> maxFE) {
maxFE = frontL[chan].at(0) + frontR[chan].at(0);
//zpos = (frontL[chan].at(0)-frontR[chan].at(0))/maxFE;
fchan = chan;
}
}
for(auto chan: valid_back_chans) {
if(back[chan].size()>1) {
printf("\nmultihit sx3 at Bsubchan:%d, ts:%1.13g\n",chan,ts);
for(const auto& e: back[chan]) printf("e: %f\t",e);
std::sort(back[chan].begin(), back[chan].end(), std::greater<float>());
flags += (-3000);
}
if(back[chan].size() ==0 ) {
printf("foo\n");
//continue;
}
if(back[chan].at(0) > maxBE) {
maxBE = back[chan].at(0);
bchan = chan;
}
}
/*
Cross-talk corrections are important when evaluating 'energy' signals from strips/pads.
They can cause unexpected behavior when used universally for all EL, ER cases, so we split scenarios in two.
- Positions along each strip (frontX) *are not* corrected for crosstalk.
- Total F and B energies (frontE, backE) *are*.
Sudarsan B, 31 Oct 2024
*/
float Eleft = frontL[fchan].at(0);
float Eright = frontR[fchan].at(0);
frontEL = Eleft;
frontER = Eright;
frontX = (Eleft-Eright)/(Eleft+Eright);
//frontXmm = (frontX+sx3gs.add[fchan])*sx3gs.stretch[fchan]; //convert to mm
//frontE = Eleft*fbgains.stripLgains[bchan][fchan] + fbgains.stripLoffsets[bchan][fchan]
// + Eright*fbgains.stripRgains[bchan][fchan] + fbgains.stripRoffsets[bchan][fchan];
//backE = back[bchan].at(0)*fbgains.padgains[bchan][fchan]+fbgains.padoffsets[bchan][fchan];
frontE = Eleft+Eright;
backE = maxBE;
stripF=fchan;
stripB=bchan;
flags = 0;
} else if(valid_front_chans.size()!=0 && valid_back_chans.size()==0) {
flags = -10;
} else if(valid_front_chans.size()==0 && valid_back_chans.size()!=0) {
flags = -20;
}
}
typedef sx3 sx3det;
#endif

180
Armory/TrainingBuilder.py Normal file
View File

@ -0,0 +1,180 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Train a TensorFlow model from a directory of ROOT files.
Inputs:
Tb
thetab
vZ
MBeam
MTarget
MLight
MHeavy
Outputs:
beamEnergy
Ex
"""
import numpy as np
from pathlib import Path
import joblib
import pandas as pd
import uproot
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.callbacks import EarlyStopping
ROOT_FOLDER = Path("/Users/jamesszalkie/ANASEN_analysis/Armory/Training_Data_Ne/")
TREE_NAME = "tree1"
INPUT_BRANCHES = [
"Tb",
"thetab",
"vZ",
"MBeam",
"MTarget",
"MLight",
"MHeavy",
]
OUTPUT_BRANCHES = [
"beamEnergy",
"Ex",
]
MODEL_NAME = "beam_predictor.keras"
print("Reading ROOT files...")
dfs = []
for root_file in sorted(ROOT_FOLDER.glob("*.root")):
print(f" {root_file.name}")
with uproot.open(root_file) as f:
tree = f[TREE_NAME]
arrays = tree.arrays(
INPUT_BRANCHES + OUTPUT_BRANCHES,
library="np"
)
dfs.append(pd.DataFrame(arrays))
dataset = pd.concat(dfs, ignore_index=True)
# Remove events with missing or invalid values
dataset = dataset.replace([np.inf, -np.inf], np.nan)
dataset = dataset.dropna()
print(f"Training on {len(dataset)} complete events.")
print(dataset.describe())
print()
print(dataset.isna().sum())
print()
print(np.isinf(dataset).sum())
print()
print("Total events:", len(dataset))
X = dataset[INPUT_BRANCHES].values
Y = dataset[OUTPUT_BRANCHES].values
X_train, X_test, Y_train, Y_test = train_test_split(
X,
Y,
test_size=0.20,
random_state=42,
)
input_scaler = StandardScaler()
output_scaler = StandardScaler()
X_train = input_scaler.fit_transform(X_train)
X_test = input_scaler.transform(X_test)
Y_train = output_scaler.fit_transform(Y_train)
Y_test = output_scaler.transform(Y_test)
model = Sequential([
Dense(128, activation="relu"),
Dense(128, activation="relu"),
Dense(64, activation="relu"),
Dense(32, activation="relu"),
Dense(2)
])
model.build((None, len(INPUT_BRANCHES)))
model.compile(
optimizer="adam",
loss="mse",
metrics=["mae"]
)
model.summary()
early_stop = EarlyStopping(
monitor="val_loss",
patience=20,
restore_best_weights=True
)
history = model.fit(
X_train,
Y_train,
epochs=25,
batch_size=512,
validation_split=0.20,
callbacks=[early_stop],
verbose=1,
)
loss, mae = model.evaluate(
X_test,
Y_test,
verbose=0,
)
pred_scaled = model.predict(X_test, verbose=0)
pred = output_scaler.inverse_transform(pred_scaled)
truth = output_scaler.inverse_transform(Y_test)
print()
print(f"Test Loss : {loss:.6f}")
print(f"Test MAE : {mae:.6f}")
beam_error = np.mean(np.abs(pred[:,0] - truth[:,0]))
Ex_error = np.mean(np.abs(pred[:,1] - truth[:,1]))
print(f"Beam Energy MAE: {beam_error:.6f} MeV")
print(f"Ex MAE: {Ex_error:.6f} MeV")
model.save(MODEL_NAME)
joblib.dump(input_scaler, "input_scaler.pkl")
joblib.dump(output_scaler, "output_scaler.pkl")
print()
print("Training complete.")
print("Saved:")
print(" ", MODEL_NAME)
print(" input_scaler.pkl")
print(" output_scaler.pkl")

134
Armory/aarootscript.C Normal file
View File

@ -0,0 +1,134 @@
#include "TFile.h"
#include "TTree.h"
#include "TGraph.h"
#include "TLegend.h"
#include "TCanvas.h"
#include "TH1D.h"
#include "TObjArray.h"
#include "TBranch.h"
#include <iostream>
#include <fstream>
void aarootscript(int argument = 0) {
std::cout << "\n\n\n";
std::cout << "=========================================\n";
std::cout << "========= ANASEN Root Script =========\n";
std::cout << "=========================================\n";
TFile *f = new TFile("SimAnasen1.root");
TTree *tree1 = (TTree*)f->Get("tree");
if (!tree1) {
std::cerr << "Error: tree1 not found in the file!" << std::endl;
return;
}
TTree *tree2 = (TTree*)f->Get("tree2");
TTreeReader reader("tree");
TTreeReaderValue<double> Tb1(reader, "Tb"); // this line will read the "Tb" branch from the tree and save it as
TTreeReaderValue<double> TB1(reader, "TB"); // this line will read the "TB" branch from the tree and save it as Tb1
//add Tb1 and TB1 together
double totalSum = 0;
while (reader.Next()) {
totalSum += *Tb1;
}
std::cout << "Total Sum: " << totalSum << std::endl;
TTreeReader reader2("tree2");
TTreeReaderValue<double> Tb2(reader2, "Tb");
double totalSum2 = 0;
int zeroCount = 0;
while (reader2.Next()) {
totalSum2 += *Tb2;
if (*Tb2 == 0) {
zeroCount++;
}
}
std::cout << "Total Sum: " << totalSum2 << std::endl;
std::cout << "Difference: " << totalSum - totalSum2 << std::endl;
std::cout << "Zero Count: " << zeroCount << std::endl;
//std::cout << "Making histograms..." << std::endl;
gErrorIgnoreLevel = 2001;
gROOT->ProcessLine(".x histcomp.C");
std::cout << "=========================================\n";
if (argument == 1) {
if (tree1) {
gROOT->ProcessLine("tree->Print();");
} else {
std::cout << "Tree1 not found!" << std::endl;
}
}
if (argument == 2) {
if (tree2) {
gROOT->ProcessLine("tree2->Print();");
} else {
std::cout << "Tree2 not found!" << std::endl;
}
}
std::cout << "Creating Tb vs dEb plot..." << std::endl;
// Readers for both trees
TTreeReader r1(tree1);
TTreeReader r2(tree2);
TTreeReaderValue<double> Tb_val(r1, "Tb");
TTreeReaderValue<double> TB_val(r2, "TB");
TTreeReaderValue<double> dEb_val(r2, "dEb");
std::vector<double> x; // Tb (tree1)
std::vector<double> y; // dEb (tree2)
// Loop over both trees simultaneously
while (r1.Next() && r2.Next()) {
x.push_back(*Tb_val);
y.push_back(*dEb_val);
}
std::cout << "x length: " << x.size() << ", y length: " << y.size() << std::endl;
std::ofstream outfile("Tb_dEb_data.txt");
if (!outfile.is_open()) {
std::cerr << "Error: Could not open output file!" << std::endl;
return;
}
for (size_t i = 0; i < x.size(); i++) {
outfile << x[i] << " " << y[i] << "\n";
}
outfile.close();
std::cout << "Data written to Tb_dEb_data.txt" << std::endl;
/*
// Create graph
TGraph *gr = new TGraph(x.size(), &x[0], &y[0]);
gr->SetTitle("Tb (tree1) vs dEb (tree2);Tb;dEb");
gr->SetMarkerStyle(20);
// Draw
TCanvas *c1 = new TCanvas("c1", "Tb vs dEb", 800, 600);
gr->Draw("AP");
c1->Update();
c1->SaveAs("Tb_vs_dEb.png");
std::cout << "Plot saved as Tb_vs_dEb.pdf" << std::endl;
std::cout << "\n\n\n";
delete c1;
delete gr;*/
}

111
Armory/analyze.C Normal file
View File

@ -0,0 +1,111 @@
#include "TFile.h"
#include "TTree.h"
#include "TCanvas.h"
#include "TH1D.h"
#include "TLegend.h"
#include "TString.h"
#include "TStyle.h"
#include <iostream>
void analyze(const char* filename = "SimAnasen1.root")
{
gStyle->SetOptStat(1);
TFile *f = TFile::Open(filename);
if (!f || f->IsZombie()) {
std::cerr << "ERROR: cannot open file " << filename << std::endl;
return;
}
TTree *tree = (TTree*)f->Get("tree");
TTree *tree2 = (TTree*)f->Get("tree2");
if (!tree) {
std::cerr << "ERROR: tree not found\n";
return;
}
std::cout << "\n===== BASIC TREE INFO =====\n";
tree->Print();
// Event inspection tools
std::cout << "\n===== FIRST 10 EVENTS =====\n";
tree->Scan("Tb:TB:anodeID[0]:cathodeID[0]:sx3ID", "", "", 10);
std::cout << "\n===== SINGLE EVENT EXAMPLE (0) =====\n";
tree->Show(0);
// Quick detector gating examples
std::cout << "\n===== GATED STATS =====\n";
std::cout << "Events with anodeID[0]==5: "
<< tree->GetEntries("anodeID[0]==5") << std::endl;
std::cout << "Events with sx3ID>=0: "
<< tree->GetEntries("sx3ID>=0") << std::endl;
// Tb vs TB comparison histogram
TCanvas *c1 = new TCanvas("c1","Tb vs TB",800,600);
//set min and max from tree values
double min = tree->GetMinimum("Tb");
double max = tree->GetMaximum("TB");
min = min - max*0.1;
max = max * 1.1;
TH1D *hTb = new TH1D("hTb","Tb and TB;Energy (MeV);Counts",200,min,max); //arguments are name, title (with axis labels), number of bins, x-min, x-max
TH1D *hTB = new TH1D("hTB","",200,min,max);
tree->Draw("Tb>>hTb","","goff");
tree->Draw("TB>>hTB","","goff");
hTb->SetLineColor(kRed);
hTB->SetLineColor(kBlue);
hTb->Draw("HIST");
hTB->Draw("HIST SAME");
TLegend *leg = new TLegend(0.65,0.75,0.88,0.88);
leg->AddEntry(hTb,"Tb (light)","l");
leg->AddEntry(hTB,"TB (heavy)","l");
leg->Draw();
c1->SaveAs("Tb_TB_compare.png");
// 4. Detector-gated histogram
TCanvas *c2 = new TCanvas("c2","Anode gated Tb",800,600);
double min2 = tree->GetMinimum("Tb");
double max2 = tree->GetMaximum("Tb");
min2 = min2 - max2*0.1;
max2 = max2 * 1.1;
TH1D *hGate = new TH1D("hGate","Tb (anodeID[0]==5);Energy;Counts",200,min2,max2);
tree->Draw("Tb>>hGate","anodeID[0]==5","goff");
hGate->SetLineColor(kGreen+2);
hGate->Draw("HIST");
c2->SaveAs("Tb_anode5.png");
// Tb vs TB correlation (with gate)
TCanvas *c3 = new TCanvas("c3","dEb vs SX3z",800,600);
tree->Draw("TB:Tb>>h2(200,min,max,200,min,max)","","COLZ"); //arguments are "y:x>>histogram(bins,xmin,xmax,bins,ymin,ymax)", "selection", "options"
c3->SaveAs("Tb_vs_TB.png");
// Make gated trees
TFile *out = new TFile("gated_output.root","RECREATE");
TTree *t_anode5 = tree->CopyTree("anodeID[0]==5");
t_anode5->Write("tree_anode5");
TTree *t_sx3valid = tree->CopyTree("sx3ID>=0");
t_sx3valid->Write("tree_sx3valid");
out->Close();
std::cout << "\n===== DONE =====\n";
std::cout << "Saved plots + gated trees in gated_output.root\n";
}

View File

@ -0,0 +1,632 @@
#include "TRandom.h" // ROOT random number generators, gRandom
#include "TFile.h" // ROOT file I/O
#include "TTree.h" // ROOT tree storage
#include "TH1.h" // 1D histograms
#include "TH2.h" // 2D histograms
#include "TStyle.h" // ROOT plotting style controls
#include "TCanvas.h" // ROOT canvas drawing
#include "TBenchmark.h" // timing measurement
#include "TGraph.h" // for energy loss interpolation
#include <cstring>
#include "TApplication.h" // ROOT app loop
#include "ClassTransfer.h" // Reaction kinematics and MC event generation
#include "ClassAnasen.h" // ANASEN detector model classes (SX3, PW, etc.)
#include <stdio.h>
#include <stdlib.h>
#include <set>
#include "TLegend.h"
#include "TH1D.h"
#include "TObjArray.h"
#include "TBranch.h"
#include <iostream>
#include <fstream>
//======== Generate light particle based on reaction
// calculate real and reconstructed tracks and Q-value uncertainty
// Function to load energy loss table from file
TGraph* LoadELoss(const char* filename) {
TGraph* g = new TGraph(filename, "%lg %lg");
return g;
}
bool IsDeadAnode(int id){
static std::set<int> dead = {}; // add dead anode IDs here, 0-23
return dead.count(id);
}
bool IsDeadCathode(int id){
static std::set<int> dead = {}; // add dead cathode IDs here, 0-23
return dead.count(id);
}
bool IsDeadSX3(int id){
static std::set<int> dead = {}; // add dead SX3 IDs here, 0-23 1,7,9,3
return dead.count(id);
}
// Simulate sequential two-body decay of an unstable parent in its rest frame.
// The parent is boosted from the lab frame, the daughter (A1,Z1) is returned in lab frame,
// and the emitted ejectile (A2,Z2) is written to ejectileOut.
TLorentzVector SimulateSequentialDecay(const TLorentzVector &parent,
int daughterA, int daughterZ,
int ejectA, int ejectZ,
TLorentzVector &ejectileOut){
Isotope daughter(daughterA, daughterZ);
Isotope ejectile(ejectA, ejectZ);
double M = parent.M();
double mD = daughter.Mass;
double mE = ejectile.Mass;
double sqM = M * M;
double sum = mD + mE;
double diff = mD - mE;
double p2 = (sqM - sum*sum) * (sqM - diff*diff) / (4.0 * sqM);
if( p2 < 0 ) p2 = 0;
double p = TMath::Sqrt(p2);
double cosTheta = 2.0 * gRandom->Rndm() - 1.0;
double theta = TMath::ACos(cosTheta);
double phi = gRandom->Rndm() * TMath::TwoPi();
TVector3 v;
v.SetMagThetaPhi(p, theta, phi);
TLorentzVector daughterLab;
daughterLab.SetVectM(v, mD);
TLorentzVector ejectileLab;
ejectileLab.SetVectM(-v, mE);
TVector3 boost = parent.BoostVector();
daughterLab.Boost(boost);
ejectileLab.Boost(boost);
ejectileOut = ejectileLab;
return daughterLab;
}
int main(int argc, char **argv){
printf("=========================================\n");
printf("=== ANASEN Monte Carlo ===\n");
printf("=========================================\n");
// number of events can be overridden from command line
int numEvent = 1000000;
if( argc >= 2 ) numEvent = atoi(argv[1]);
// Reaction setup for 18Ne + 4He -> p + 21Na*.
// The heavy product 21Na* is then decayed to 20Ne + p in the simulation.
TransferReaction transfer;
transfer.SetA(18, 10, 0); // 18Ne
transfer.SetIncidentEnergyAngle(4.4, 0, 0); // KEA in MeV/u, theta and phi in degree
transfer.Seta(4, 2); // 4He target
transfer.Setb(1, 1); // outgoing proton from the primary transfer
transfer.SetB(21, 11); // 21Na* heavy product
bool enableSequentialDecay = true;
const int decayDaughterA = 20;
const int decayDaughterZ = 10;
const int decayEjectA = 1;
const int decayEjectZ = 1;
// Excited state lists (projectile and heavy-product excitation states)
std::vector<float> ExAList = {0}; // 18Ne projectile excitations in MeV
std::vector<float> ExList = {2.5}; // 21Na* excitation in MeV (above proton separation threshold)
// define vertex position uniform distribution ranges (mm)
double vertexXRange[2] = { -5, 5}; // mm
double vertexYRange[2] = { -5, 5};
double vertexZRange[2] = { -100, 100};
// detector resolution / uncertainty parameters
double sigmaSX3_W = -1; // mm, if < 0 use mid-point (no spread in SX3 horizontal dimension)
double sigmaSX3_L = 3; // mm, vertical spread for SX3
double sigmaPW_A = 0; // normalized anode uncertainty term (0-1)
double sigmaPW_C = 0; // normalized cathode uncertainty term (0-1)
// status printout
printf("------------ Vertex :\n");
printf("X : %7.2f - %7.2f mm\n", vertexXRange[0], vertexXRange[1]);
printf("Y : %7.2f - %7.2f mm\n", vertexYRange[0], vertexYRange[1]);
printf("Z : %7.2f - %7.2f mm\n", vertexZRange[0], vertexZRange[1]);
printf("------------ Uncertainty :\n");
printf(" SX3 horizontal : %.1f\n", sigmaSX3_W);
printf(" SX3 vertical : %.1f\n", sigmaSX3_L);
printf(" Anode : %.1f mm\n", sigmaPW_A);
printf(" Cathode : %.1f mm\n", sigmaPW_C);
printf(" num_eve : %d \n",numEvent);
// calculates energy/momentum/kinematics constants for transfer reaction
transfer.CalReactionConstant();
printf("Primary reaction: %s at %.2f MeV/u\n", transfer.GetReactionName().Data(), 4.4);
printf("Sequential decay enabled: %s\n", enableSequentialDecay ? "yes" : "no");
int nExA = ExAList.size();
int nEx = ExList.size();
// optional visualization control: pass "vis" as 3rd arg
bool enableVis = (argc >= 3 && strcmp(argv[2], "vis") == 0);
TApplication *app = nullptr;
if(enableVis){
app = new TApplication("anasenVis", &argc, argv);
}
// storage for tracks during simulation (for visualization)
std::vector<TVector3> visTrackVertex, visTrackDir, visTrackHitPos;
std::vector<std::pair<int,int>> visTrackWires; // {anodeID, cathodeID}
// create detector representation in memory
ANASEN * anasen = new ANASEN(); // top-level detector object
SX3 * sx3 = anasen->GetSX3(); // silicon array part
PW * pw = anasen->GetPW(); // proportional wire chamber part
// output file + trees
TString saveFileName = "SimAnasen1.root";
printf("\e[32m#################################### building Tree in %s\e[0m\n", saveFileName.Data());
TFile * saveFile = new TFile(saveFileName, "recreate");
TTree * tree1 = new TTree("tree1", "tree1");
TTree * tree2 = new TTree("tree2", "tree2");
// beam and CM variables saved in tree
double KEA;
double KEA2;
tree1->Branch("beamKEA", &KEA, "beamKEA/D");
tree2->Branch("beamKEA", &KEA2, "beamKEA/D");
double thetaCM, phiCM;
double thetaCM2, phiCM2;
tree1->Branch("thetaCM", &thetaCM, "thetaCM/D");
tree1->Branch("phiCM", &phiCM, "phiCM/D");
tree2->Branch("thetaCM", &thetaCM2, "thetaCM/D");
tree2->Branch("phiCM", &phiCM2, "phiCM/D");
// outgoing particles in lab frame (light/heavy)
double thetab, phib;
double Tb;
double thetaB, phiB, TB;
std::array<double, 2> T;
tree1->Branch("thetab", &thetab, "thetab/D"); // polar angle of light particle in lab frame
tree1->Branch("phib", &phib, "phib/D"); // azimuthal angle of light particle in lab frame
tree1->Branch("Tb", &Tb, "Tb/D"); // kinetic energy of light particle at vertex (before energy loss)
tree1->Branch("thetaB", &thetaB, "thetaB/D");
tree1->Branch("phiB", &phiB, "phiB/D");
tree1->Branch("TB", &TB, "TB/D"); // kinetic energy of heavy particle at vertex
tree1->Branch("T", &T, "T/D"); // placeholder for true Q-value, currently set to 0 for simplicity
double thetab2, phib2;
double Tb2;
double thetaB2, phiB2, TB2;
std::array<double, 2> T2;
tree2->Branch("thetab", &thetab2, "thetab/D");
tree2->Branch("phib", &phib2, "phib/D");
tree2->Branch("Tb", &Tb2, "Tb/D");
tree2->Branch("thetaB", &thetaB2, "thetaB/D");
tree2->Branch("phiB", &phiB2, "phiB/D");
tree2->Branch("TB", &TB2, "TB/D");
tree2->Branch("T", &T2, "T/D");
// excitation state identifiers
int ExAID;
double ExA;
tree1->Branch("ExAID", &ExAID, "ExAID/I"); // projectile excitation state ID
tree1->Branch("ExA", &ExA, "ExA/D"); // projectile excitation energy in MeV
int ExAID2;
double ExA2;
tree2->Branch("ExAID", &ExAID2, "ExAID/I");
tree2->Branch("ExA", &ExA2, "ExA/D");
int ExID;
double Ex;
tree1->Branch("ExID", &ExID, "ExID/I"); // target excitation state ID
tree1->Branch("Ex", &Ex, "Ex/D"); // target excitation energy in MeV
int ExID2;
double Ex2;
tree2->Branch("ExID", &ExID2, "ExID/I");
tree2->Branch("Ex", &Ex2, "Ex/D");
// true vertex position in target volume
double vertexX, vertexY, vertexZ;
tree1->Branch("vX", &vertexX, "VertexX/D"); // true vertex X position in mm
tree1->Branch("vY", &vertexY, "VertexY/D"); // true vertex Y position in mm
tree1->Branch("vZ", &vertexZ, "VertexZ/D"); // true vertex Z position in mm
double vertexX2, vertexY2, vertexZ2;
tree2->Branch("vX", &vertexX2, "VertexX/D");
tree2->Branch("vY", &vertexY2, "VertexY/D");
tree2->Branch("vZ", &vertexZ2, "VertexZ/D");
// reconstructed SX3 hit position
double sx3X, sx3Y, sx3Z;
tree1->Branch("sx3X", &sx3X, "sx3X/D"); // reconstructed X position from SX3 (with optional smearing)
tree1->Branch("sx3Y", &sx3Y, "sx3Y/D"); // reconstructed Y position from SX3 (with optional smearing)
tree1->Branch("sx3Z", &sx3Z, "sx3Z/D"); // reconstructed Z position from SX3 (with optional smearing)
double sx3X2, sx3Y2, sx3Z2;
tree2->Branch("sx3X", &sx3X2, "sx3X/D");
tree2->Branch("sx3Y", &sx3Y2, "sx3Y/D");
tree2->Branch("sx3Z", &sx3Z2, "sx3Z/D");
// PW nearest and next nearest wires
int anodeID[2], cathodeID[2];
int anodeID2[2], cathodeID2[2];
tree1->Branch("aID", anodeID, "anodeID/I"); // anodeID[0] is nearest anode wire, anodeID[1] is next nearest anode wire
tree1->Branch("cID", cathodeID, "cathodeID/I"); // cathodeID[0] is nearest cathode wire, cathodeID[1] is next nearest cathode wire
tree2->Branch("aID", anodeID2, "anodeID/I");
tree2->Branch("cID", cathodeID2, "cathodeID/I");
// distances to nearest wires
double anodeDist[2], cathodeDist[2];
double anodeDist2[2], cathodeDist2[2];
tree1->Branch("aDist", anodeDist, "anodeDist/D");
tree1->Branch("cDist", cathodeDist, "cathodeDist/D");
tree2->Branch("aDist", anodeDist2, "anodeDist/D");
tree2->Branch("cDist", cathodeDist2, "cathodeDist/D");
// SX3 channel assignment and Z fraction (depth) information
int sx3ID, sx3Up, sx3Dn, sx3Bk;
double sx3ZFrac;
int sx3ID2, sx3Up2, sx3Dn2, sx3Bk2;
double sx3ZFrac2;
tree1->Branch("sx3ID", &sx3ID, "sx3ID/I");
tree1->Branch("sx3Up", &sx3Up, "sx3Up/I");
tree1->Branch("sx3Dn", &sx3Dn, "sx3Dn/I");
tree1->Branch("sx3Bk", &sx3Bk, "sx3Bk/I");
tree1->Branch("sx3ZFrac", &sx3ZFrac, "sx3ZFrac/D");
tree2->Branch("sx3ID", &sx3ID2, "sx3ID/I");
tree2->Branch("sx3Up", &sx3Up2, "sx3Up/I");
tree2->Branch("sx3Dn", &sx3Dn2, "sx3Dn/I");
tree2->Branch("sx3Bk", &sx3Bk2, "sx3Bk/I");
tree2->Branch("sx3ZFrac", &sx3ZFrac2, "sx3ZFrac/D");
// reconstructed angles from PW track fit, method 1 and 2
double reTheta, rePhi;
double reTheta2, rePhi2;
tree1->Branch("reTheta", &reTheta, "reconstucted_theta/D");
tree1->Branch("rePhi", &rePhi, "reconstucted_phi/D");
tree2->Branch("reTheta", &reTheta2, "reconstucted_theta/D");
tree2->Branch("rePhi", &rePhi2, "reconstucted_phi/D");
double reTheta1, rePhi1;
double reTheta12, rePhi12;
tree1->Branch("reTheta1", &reTheta1, "reconstucted_theta1/D");
tree1->Branch("rePhi1", &rePhi1, "reconstucted_phi1/D");
tree2->Branch("reTheta1", &reTheta12, "reconstucted_theta1/D");
tree2->Branch("rePhi1", &rePhi12, "reconstucted_phi1/D");
// reconstructed vertex Z from PW fit
double z0;
double z02;
tree1->Branch("z0", &z0, "reconstucted_Z/D");
tree2->Branch("z0", &z02, "reconstucted_Z/D");
//========timer
TBenchmark clock;
bool shown ;
clock.Reset();
clock.Start("timer");
shown = false;
//================================= Calculate event loop
for( int i = 0; i < numEvent ; i++){
// randomly sample target/projectile excitations
ExAID = gRandom->Integer(nExA);
ExA = ExAList[ExAID];
transfer.SetExA(ExA);
ExID = gRandom->Integer(nEx);
Ex = ExList[ExID];
transfer.SetExB(Ex);
// recalc kinematic constants for chosen states
transfer.CalReactionConstant();
// isotropic CM direction
thetaCM = TMath::ACos(2 * gRandom->Rndm() - 1) ;
phiCM = (gRandom->Rndm() - 0.5) * TMath::TwoPi();
//==== Calculate reaction kinematics in lab frame for the primary transfer
TLorentzVector * output = transfer.Event(thetaCM, phiCM); // returns array of outputs
TLorentzVector Pb = output[2]; // primary proton from transfer
TLorentzVector PB = output[3]; // excited 21Na* heavy product
thetab = Pb.Theta() * TMath::RadToDeg();
Tb = (Pb.E() - Pb.M()); // kinetic energy of the light proton from the primary transfer
thetaB = PB.Theta() * TMath::RadToDeg();
TB = (PB.E() - PB.M());
phib = Pb.Phi() * TMath::RadToDeg();
phiB = PB.Phi() * TMath::RadToDeg();
T[0] = Tb;
T[1] = TB;
// prepare secondary proton from 21Na* sequential decay
TLorentzVector decayProton;
TLorentzVector heavy20;
if(enableSequentialDecay){
heavy20 = SimulateSequentialDecay(PB, decayDaughterA, decayDaughterZ,
decayEjectA, decayEjectZ, decayProton);
thetab2 = decayProton.Theta() * TMath::RadToDeg();
phib2 = decayProton.Phi() * TMath::RadToDeg();
Tb2 = decayProton.E() - decayProton.M();
thetaB2 = heavy20.Theta() * TMath::RadToDeg();
phiB2 = heavy20.Phi() * TMath::RadToDeg();
TB2 = heavy20.E() - heavy20.M();
T2[0] = Tb2;
T2[1] = TB2;
} else {
thetab2 = TMath::QuietNaN();
phib2 = TMath::QuietNaN();
Tb2 = TMath::QuietNaN();
thetaB2 = TMath::QuietNaN();
phiB2 = TMath::QuietNaN();
TB2 = TMath::QuietNaN();
T2[0] = TMath::QuietNaN();
T2[1] = TMath::QuietNaN();
}
delete [] output;
// vertex position in target volume
vertexX = (vertexXRange[1]- vertexXRange[0])*gRandom->Rndm() + vertexXRange[0];
vertexY = (vertexYRange[1]- vertexYRange[0])*gRandom->Rndm() + vertexYRange[0];
vertexZ = (vertexZRange[1]- vertexZRange[0])*gRandom->Rndm() + vertexZRange[0];
TVector3 vertex(vertexX, vertexY, vertexZ);
// set direction vector from lab angle
TVector3 dir(1, 0, 0);
dir.SetTheta(thetab * TMath::DegToRad());
dir.SetPhi(phib * TMath::DegToRad());
// run detector response models for PW and SX3
pw->FindWireID(vertex, dir, false);
sx3->FindSX3Pos(vertex, dir, false);
PWHitInfo hitInfo = pw->GetHitInfo();
anodeID[0] = hitInfo.nearestWire.first; // nearest anode wire ID
cathodeID[0] = hitInfo.nearestWire.second; // nearest cathode wire ID
anodeID[1] = hitInfo.nextNearestWire.first; // next nearest anode wire ID
cathodeID[1] = hitInfo.nextNearestWire.second; // next nearest cathode wire ID
anodeDist[1] = hitInfo.nextNearestDist.first; // distance to next nearest anode wire
cathodeDist[1] = hitInfo.nextNearestDist.second; // distance to next nearest cathode wire
if(IsDeadAnode(anodeID[0])) continue;
if(IsDeadCathode(cathodeID[0])) continue;
// SX3 hit channel info and depth fraction
sx3ID = sx3->GetID();
if(IsDeadSX3(sx3ID)) continue;
anodeDist[0] = hitInfo.nearestDist.first; // distance to nearest anode wire
cathodeDist[0] = hitInfo.nearestDist.second; // distance to nearest cathode wire
if( sx3ID >= 0 ){
sx3Up = sx3->GetChUp();
sx3Dn = sx3->GetChDn();
sx3Bk = sx3->GetChBk();
sx3ZFrac = sx3->GetZFrac();
// apply intrinsic detector resolution to true SX3 hit position
// for no smearing comment out and use GetHitPos();
TVector3 hitPos = sx3->GetHitPosWithSigma(sigmaSX3_W, sigmaSX3_L);
sx3X = hitPos.X();
sx3Y = hitPos.Y();
sx3Z = hitPos.Z();
// store track data for visualization if enabled
if(enableVis){
visTrackVertex.push_back(vertex);
visTrackDir.push_back(dir);
visTrackHitPos.push_back(hitPos);
visTrackWires.push_back({anodeID[0], cathodeID[0]});
}
// reconstruct track from PW readings + SX3 hit
pw->CalTrack(hitPos, anodeID[0], cathodeID[0], false);
reTheta = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi = pw->GetTrackPhi() * TMath::RadToDeg();
// alternative track algorithm with uncertainty parameters
pw->CalTrack2(hitPos, hitInfo, sigmaPW_A, sigmaPW_C, false);
reTheta1 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi1 = pw->GetTrackPhi() * TMath::RadToDeg();
z0 = pw->GetZ0();
tree1->Fill();
// fill tree2 using the secondary proton (proton 2) track
TVector3 dir2(1, 0, 0);
dir2.SetTheta(thetab2 * TMath::DegToRad());
dir2.SetPhi(phib2 * TMath::DegToRad());
pw->FindWireID(vertex, dir2, false);
sx3->FindSX3Pos(vertex, dir2, false);
PWHitInfo hitInfo2 = pw->GetHitInfo();
anodeID2[0] = hitInfo2.nearestWire.first;
cathodeID2[0] = hitInfo2.nearestWire.second;
anodeID2[1] = hitInfo2.nextNearestWire.first;
cathodeID2[1] = hitInfo2.nextNearestWire.second;
anodeDist2[1] = hitInfo2.nextNearestDist.first;
cathodeDist2[1] = hitInfo2.nextNearestDist.second;
if(IsDeadAnode(anodeID2[0]) || IsDeadCathode(cathodeID2[0])){
sx3ID2 = -1;
} else {
sx3ID2 = sx3->GetID();
}
if(sx3ID2 < 0 || IsDeadSX3(sx3ID2)){
sx3ID2 = -1;
sx3Up2 = -1;
sx3Dn2 = -1;
sx3Bk2 = -1;
sx3ZFrac2 = TMath::QuietNaN();
sx3X2 = TMath::QuietNaN();
sx3Y2 = TMath::QuietNaN();
sx3Z2 = TMath::QuietNaN();
anodeDist2[0] = TMath::QuietNaN();
cathodeDist2[0] = TMath::QuietNaN();
reTheta2 = TMath::QuietNaN();
rePhi2 = TMath::QuietNaN();
reTheta12 = TMath::QuietNaN();
rePhi12 = TMath::QuietNaN();
z02 = TMath::QuietNaN();
} else {
anodeDist2[0] = hitInfo2.nearestDist.first;
cathodeDist2[0] = hitInfo2.nearestDist.second;
sx3Up2 = sx3->GetChUp();
sx3Dn2 = sx3->GetChDn();
sx3Bk2 = sx3->GetChBk();
sx3ZFrac2 = sx3->GetZFrac();
TVector3 hitPos2 = sx3->GetHitPosWithSigma(sigmaSX3_W, sigmaSX3_L);
sx3X2 = hitPos2.X();
sx3Y2 = hitPos2.Y();
sx3Z2 = hitPos2.Z();
pw->CalTrack(hitPos2, anodeID2[0], cathodeID2[0], false);
reTheta2 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi2 = pw->GetTrackPhi() * TMath::RadToDeg();
pw->CalTrack2(hitPos2, hitInfo2, sigmaPW_A, sigmaPW_C, false);
reTheta12 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi12 = pw->GetTrackPhi() * TMath::RadToDeg();
z02 = pw->GetZ0();
}
// copy common event info to tree2
KEA2 = KEA;
thetaCM2 = thetaCM;
phiCM2 = phiCM;
ExAID2 = ExAID;
ExA2 = ExA;
ExID2 = ExID;
Ex2 = Ex;
vertexX2 = vertexX;
vertexY2 = vertexY;
vertexZ2 = vertexZ;
tree2->Fill();
}else{
// no valid SX3 hit: mark clearly invalid
sx3Up = -1;
sx3Dn = -1;
sx3Bk = -1;
sx3ZFrac = TMath::QuietNaN();
sx3X = TMath::QuietNaN();
sx3Y = TMath::QuietNaN();
sx3Z = TMath::QuietNaN();
reTheta = TMath::QuietNaN();
rePhi = TMath::QuietNaN();
reTheta1 = TMath::QuietNaN();
rePhi1 = TMath::QuietNaN();
z0 = TMath::QuietNaN();
//Tb = -12354567; // mark kinetic energy as invalid for no hit case
// fill tree with original data (no energy loss for these events)
//comment out tree fill for no hit case
//tree->Fill();
}
//#################################################################### Timer
// measure elapsed real time and print progress roughly every 10 sec
clock.Stop("timer");
Double_t time = clock.GetRealTime("timer");
clock.Start("timer");
if ( !shown ) {
if (fmod(time, 10) < 1 ){
printf( "%10d[%2d%%]| %8.2f sec | expect: %5.1f min \n", i, TMath::Nint((i+1)*100./numEvent), time , numEvent*time/(i+1)/60);
shown = 1;
}
} else {
if (fmod(time, 10) > 9 ){
shown = 0;
}
}
}
// write results to ROOT file and close
tree1->Write("", TObject::kOverwrite);
tree2->Write("", TObject::kOverwrite);
int count1 = tree1->GetEntries();
int count2 = tree2->GetEntries();
saveFile->Close();
printf("=============== done. saved as %s. tree1 entries: %d, tree2 entries: %d\n", saveFileName.Data(), count1, count2);
if(enableVis){ // to enable visualization, run with 3rd argument "vis", e.g. "./anasenMC 1000 vis"
printf("Displaying geometry with %zu tracks from simulation\n", visTrackVertex.size());
// Build full geometry with all wires
anasen->DrawAnasen(0, 23, 0, 23, -1, true);
// Add all stored tracks to the geometry
TGeoManager *geom = anasen->GetGeoManager();
TGeoVolume *worldBox = anasen->GetWorldBox();
if(geom && worldBox && visTrackVertex.size() > 0){
int trackNodeID = 500; // start node IDs for tracks
for(size_t iTrack = 0; iTrack < visTrackVertex.size(); ++iTrack){
TVector3 vertex = visTrackVertex[iTrack];
TVector3 dir = visTrackDir[iTrack];
TVector3 hitPos = visTrackHitPos[iTrack];
double theta = dir.Theta() * TMath::RadToDeg();
double phi = dir.Phi() * TMath::RadToDeg();
// Add a line marker at the vertex
TGeoVolume *startMarker = geom->MakeSphere("startMarker", 0, 0, 2.0);
startMarker->SetLineColor(kBlack);
worldBox->AddNode(startMarker, trackNodeID,
new TGeoCombiTrans(vertex.X(), vertex.Y(), vertex.Z(),
new TGeoRotation("rot", 0, 0, 0)));
trackNodeID++;
// Add track line from vertex toward hit position
TGeoVolume *trackLine = geom->MakeTube("trackLine", 0, 0, 0.08, 150.0);
trackLine->SetLineColor(kBlue);
worldBox->AddNode(trackLine, trackNodeID,
new TGeoCombiTrans(vertex.X(), vertex.Y(), vertex.Z(),
new TGeoRotation("rotTrack", phi + 90, theta, 0)));
trackNodeID++;
// Add hit position marker
TGeoVolume *hitMarker = geom->MakeSphere("hitMarker", 0, 0, 2.0);
hitMarker->SetLineColor(kRed);
worldBox->AddNode(hitMarker, trackNodeID,
new TGeoCombiTrans(hitPos.X(), hitPos.Y(), hitPos.Z(),
new TGeoRotation("rotHit", 0, 0, 0)));
trackNodeID++;
}
// Redraw geometry with all tracks
geom->CloseGeometry();
geom->SetVisLevel(4);
worldBox->Draw("ogle");
}
if(app){
printf("Entering ROOT event loop\n");
app->Run();
}
}
delete anasen;
return 0;
}

View File

@ -1,18 +1,90 @@
#include "TRandom.h"
#include "TFile.h"
#include "TTree.h"
#include "TH1.h"
#include "TH2.h"
#include "TStyle.h"
#include "TCanvas.h"
#include "TBenchmark.h"
#include "TRandom.h" // ROOT random number generators, gRandom
#include "TFile.h" // ROOT file I/O
#include "TTree.h" // ROOT tree storage
#include "TH1.h" // 1D histograms
#include "TH2.h" // 2D histograms
#include "TStyle.h" // ROOT plotting style controls
#include "TCanvas.h" // ROOT canvas drawing
#include "TBenchmark.h" // timing measurement
#include "TGraph.h" // for energy loss interpolation
#include <cstring>
#include "TApplication.h" // ROOT app loop
#include "ClassTransfer.h" // Reaction kinematics and MC event generation
#include "ClassAnasen.h" // ANASEN detector model classes (SX3, PW, etc.)
#include "ClassQQQ.h" // QQQ detector model class
#include <stdio.h>
#include <stdlib.h>
#include <set>
#include "TLegend.h"
#include "TH1D.h"
#include "TObjArray.h"
#include "TBranch.h"
#include <iostream>
#include <fstream>
#include "ClassTransfer.h"
#include "ClassAnasen.h"
//======== Generate light particle based on reaction
// calculate real and reconstructed tracks and Q-value uncertainty
//======== Gerneate light particle based on reaction
// find out the CalTrack and the real track
// find out the Q-value uncertaintly
// Function to load energy loss table from file
TGraph* LoadELoss(const char* filename) {
TGraph* g = new TGraph(filename, "%lg %lg");
return g;
}
bool IsDeadAnode(int id){
static std::set<int> dead = {}; // add dead anode IDs here, 0-23
return dead.count(id);
}
bool IsDeadCathode(int id){
static std::set<int> dead = {}; // add dead cathode IDs here, 0-23
return dead.count(id);
}
bool IsDeadSX3(int id){
static std::set<int> dead = {}; // add dead SX3 IDs here, 0-23 1,7,9,3
return dead.count(id);
}
// Simulate sequential two-body decay of an unstable parent in its rest frame.
TLorentzVector SimulateSequentialDecay(const TLorentzVector &parent,
int daughterA, int daughterZ,
int ejectA, int ejectZ,
TLorentzVector &ejectileOut){
Isotope daughter(daughterA, daughterZ);
Isotope ejectile(ejectA, ejectZ);
double M = parent.M();
double mD = daughter.Mass;
double mE = ejectile.Mass;
double sqM = M * M;
double sum = mD + mE;
double diff = mD - mE;
double p2 = (sqM - sum*sum) * (sqM - diff*diff) / (4.0 * sqM); // two-body decay momentum squared
if( p2 < 0 ) p2 = 0; // handle unphysical case where parent mass is less than sum of daughter and ejectile masses
double p = TMath::Sqrt(p2); // two-body decay momentum
double cosTheta = 2.0 * gRandom->Rndm() - 1.0; // isotropic decay in parent rest frame
double theta = TMath::ACos(cosTheta); // polar angle of daughter in parent rest frame
double phi = gRandom->Rndm() * TMath::TwoPi(); // azimuthal angle of daughter in parent rest frame
TVector3 v; // momentum vector of daughter in parent rest frame
v.SetMagThetaPhi(p, theta, phi); // daughter momentum in parent rest frame
TLorentzVector daughterLab; // daughter 4-vector in lab frame, initialized with momentum from decay and mass of daughter
daughterLab.SetVectM(v, mD); // set daughter 4-vector in parent rest frame, then boost to lab frame
TLorentzVector ejectileLab; // ejectile 4-vector in lab frame, initialized with momentum opposite to daughter and mass of ejectile
ejectileLab.SetVectM(-v, mE); // set ejectile 4-vector in parent rest frame, then boost to lab frame
TVector3 boost = parent.BoostVector(); // boost vector to go from parent rest frame to lab frame
daughterLab.Boost(boost); // boost daughter to lab frame
ejectileLab.Boost(boost); // boost ejectile to lab frame
ejectileOut = ejectileLab; // return ejectile in lab frame
return daughterLab;
}
int main(int argc, char **argv){
@ -20,33 +92,49 @@ int main(int argc, char **argv){
printf("=== ANASEN Monte Carlo ===\n");
printf("=========================================\n");
// number of events can be overridden from command line
int numEvent = 1000000;
if( argc >= 2 ) numEvent = atoi(argv[1]);
//Reaction
TransferReaction transfer;
transfer.SetA(24,12, 0);
transfer.SetIncidentEnergyAngle(10, 0, 0);
transfer.Seta( 4, 2);
transfer.Setb( 1, 1);
//To set beam energy loss, use energy loss app, and create table with target isotope, set Initial beam energy as max energy
transfer.SetA(18, 9, 0); // 18Ne projectile
//TGraph* elossBeam = LoadELoss("../ELoss/HeLoss/E_vs_x_Na-21.dat");
transfer.Seta(4, 2); // 4He target
transfer.Setb(1, 1); // outgoing proton from the primary transfer
transfer.SetB(21, 11); // 21Na* heavy product
const ReactionConfig reactionConfig = transfer.GetRectionConfig();
const double beamA = reactionConfig.beamA; // mass number of 14N beam
const double beamE = 3; // maximum beam energy in MeV/u
//TODO add alpha source
const int kMBeam = reactionConfig.beamA; // mass number of beam
const int kMTarget = reactionConfig.targetA; // mass number of target
const int kMLight = reactionConfig.recoilLightA; // mass number of light ejectile
const int kMHeavy = reactionConfig.recoilHeavyA; // mass number of heavy product
bool enableSequentialDecay = false; // turning to false to disable sequential decay for now, can be set to true to enable
const int decayDaughterA = 20;
const int decayDaughterZ = 10;
const int decayEjectA = 1;
const int decayEjectZ = 1;
std::vector<float> ExAList = {0};
std::vector<float> ExList = {0, 1, 2};
// Excited state lists (projectile and heavy-product excitation states)
std::vector<float> ExAList = {0}; // Beam excited energy
std::vector<float> ExList = {0, .3, 1.7, 2.4, 2.8, 3.5, 3.9, 4, 4.3, 4.5}; // Heavy product excited energy
double vertexXRange[2] = { -5, 5}; // mm
double vertexYRange[2] = { -5, 5};
double vertexZRange[2] = { -100, 100};
// define vertex position uniform distribution ranges (mm)
double vertexXRange[2] = { -5, 5}; // mm - 5, 5
double vertexYRange[2] = { -5, 5}; // -5, 5
double vertexZRange[2] = { -174.3, 174.3}; // -174.3, 174.3 (full length of gas volume, centered at 0)
const double beamEntranceZ = -280; //vertexZRange[0]; // mm, assumed beam entrance into the gas
double sigmaSX3_W = -1; // mm, < 0 use mid-point
double sigmaSX3_L = 3; // mm, < 0 use mid-point
double sigmaPW_A = 0; // from 0 to 1.
double sigmaPW_C = 0; // from 0 to 1.
//###################################################
// detector resolution / uncertainty parameters
double sigmaSX3_W = 0; // mm, if < 0 use mid-point (no spread in SX3 horizontal dimension)
double sigmaSX3_L = 0; // mm, vertical spread for SX3
double sigmaPW_A = 0; // normalized anode uncertainty term (0-1)
double sigmaPW_C = 0; // normalized cathode uncertainty term (0-1)
// status printout
printf("------------ Vertex :\n");
printf("X : %7.2f - %7.2f mm\n", vertexXRange[0], vertexXRange[1]);
printf("Y : %7.2f - %7.2f mm\n", vertexYRange[0], vertexYRange[1]);
@ -57,83 +145,216 @@ int main(int argc, char **argv){
printf(" Anode : %.1f mm\n", sigmaPW_A);
printf(" Cathode : %.1f mm\n", sigmaPW_C);
printf(" num_eve : %d \n",numEvent);
// calculates energy/momentum/kinematics constants for transfer reaction
transfer.CalReactionConstant();
int nExA = ExAList.size();
int nEx = ExList.size();
ANASEN * anasen = new ANASEN();
SX3 * sx3 = anasen->GetSX3();
PW * pw = anasen->GetPW();
// optional visualization control: pass "vis" as 3rd arg
bool enableVis = (argc >= 3 && strcmp(argv[2], "vis") == 0);
TApplication *app = nullptr;
if(enableVis){
app = new TApplication("anasenVis", &argc, argv);
}
// storage for tracks during simulation (for visualization)
std::vector<TVector3> visTrackVertex, visTrackDir, visTrackHitPos;
std::vector<std::pair<int,int>> visTrackWires; // {anodeID, cathodeID}
// create detector representation in memory
ANASEN * anasen = new ANASEN(); // top-level detector object
SX3 * sx3 = anasen->GetSX3(); // silicon array part
PW * pw = anasen->GetPW(); // proportional wire chamber part
QQQ * qqq = anasen->GetQQQ(); // optional QQQ detector part, not used in this simulation but can be enabled for visualization
// output file + trees
TString saveFileName = "SimAnasen1.root";
printf("\e[32m#################################### building Tree in %s\e[0m\n", saveFileName.Data());
TFile * saveFile = new TFile(saveFileName, "recreate");
TTree * tree = new TTree("tree", "tree");
//TFile * saveFile2 = new TFile("SimAnasen2.root", "recreate");
TTree * tree1 = new TTree("tree1", "tree1");
TTree * tree2 = new TTree("tree2", "tree2");
//TTree * tree3 = new TTree("tree3", "tree3"); // only includes Tb and thetab
// beam and CM variables saved in tree
double KEA;
tree->Branch("beamKEA", &KEA, "beamKEA/D");
double KEA2;
double beamPath_cm;
double beamEnergy;
double beamEnergyLoss;
int MBeamOut;
int MTargetOut;
int MLightOut;
int MHeavyOut;
tree1->Branch("beamKEA", &KEA, "beamKEA/D");
tree2->Branch("beamKEA", &KEA2, "beamKEA/D");
tree1->Branch("beamPath_cm", &beamPath_cm, "beamPath_cm/D");
tree2->Branch("beamPath_cm", &beamPath_cm, "beamPath_cm/D");
tree1->Branch("beamEnergy", &beamEnergy, "beamEnergy/D");
tree2->Branch("beamEnergy", &beamEnergy, "beamEnergy/D");
tree1->Branch("beamEnergyLoss", &beamEnergyLoss, "beamEnergyLoss/D");
tree2->Branch("beamEnergyLoss", &beamEnergyLoss, "beamEnergyLoss/D");
tree1->Branch("MBeam", &MBeamOut, "MBeam/I");
tree1->Branch("MTarget", &MTargetOut, "MTarget/I");
tree1->Branch("MLight", &MLightOut, "MLight/I");
tree1->Branch("MHeavy", &MHeavyOut, "MHeavy/I");
tree2->Branch("MBeam", &MBeamOut, "MBeam/I");
tree2->Branch("MTarget", &MTargetOut, "MTarget/I");
tree2->Branch("MLight", &MLightOut, "MLight/I");
tree2->Branch("MHeavy", &MHeavyOut, "MHeavy/I");
// constant reaction mass numbers stored in every event entry
MBeamOut = kMBeam;
MTargetOut = kMTarget;
MLightOut = kMLight;
MHeavyOut = kMHeavy;
double thetaCM, phiCM;
tree->Branch("thetaCM", &thetaCM, "thetaCM/D");
tree->Branch("phiCM", &phiCM, "phiCM/D");
double thetaCM2, phiCM2;
tree1->Branch("thetaCM", &thetaCM, "thetaCM/D");
tree1->Branch("phiCM", &phiCM, "phiCM/D");
tree2->Branch("thetaCM", &thetaCM2, "thetaCM/D");
tree2->Branch("phiCM", &phiCM2, "phiCM/D");
double thetab, phib, Tb;
double thetaB, phiB, TB;
tree->Branch("thetab", &thetab, "thetab/D");
tree->Branch("phib", &phib, "phib/D");
tree->Branch("Tb", &Tb, "Tb/D");
tree->Branch("thetaB", &thetaB, "thetaB/D");
tree->Branch("phiB", &phiB, "phiB/D");
tree->Branch("TB", &TB, "TB/D");
// outgoing particles in lab frame (light/heavy)
double thetab, phib, Tb, qqqTb;
double thetaB, phiB, TB, qqqTB;
std::array<double, 2> T;
tree1->Branch("thetab", &thetab, "thetab/D"); // polar angle of light particle in lab frame
tree1->Branch("phib", &phib, "phib/D"); // azimuthal angle of light particle in lab frame
tree1->Branch("Tb", &Tb, "Tb/D"); // kinetic energy of light particle at vertex (before energy loss)
tree1->Branch("thetaB", &thetaB, "thetaB/D");
tree1->Branch("phiB", &phiB, "phiB/D");
tree1->Branch("TB", &TB, "TB/D"); // kinetic energy of heavy particle at vertex (before energy loss)
tree1->Branch("T", &T, "T/D"); // placeholder for true Q-value, currently set to 0 for simplicity
tree1->Branch("qqqTb", &qqqTb, "qqqTb/D"); // kinetic energy of light particle at vertex (before energy loss) for events where the light particle hits the QQQ, currently set to 0 for simplicity
tree1->Branch("qqqTB", &qqqTB, "qqqTB/D"); // kinetic energy of heavy particle at vertex (before energy loss) for events where the light
double thetab2, phib2, Tb2, qqqTb2;
double thetaB2, phiB2, TB2, qqqTB2;
std::array<double, 2> T2;
tree2->Branch("thetab", &thetab2, "thetab/D");
tree2->Branch("phib", &phib2, "phib/D");
tree2->Branch("Tb", &Tb2, "Tb/D");
tree2->Branch("thetaB", &thetaB2, "thetaB/D");
tree2->Branch("phiB", &phiB2, "phiB/D");
tree2->Branch("TB", &TB2, "TB/D");
tree2->Branch("T", &T2, "T/D");
tree2->Branch("qqqTb", &qqqTb2, "qqqTb/D");
tree2->Branch("qqqTB", &qqqTB2, "qqqTB/D");
//tree3->Branch("Tb", &Tb, "Tb/D");
//tree3->Branch("thetab", &thetab, "thetab/D");
// excitation state identifiers
int ExAID;
double ExA;
tree->Branch("ExAID", &ExAID, "ExAID/I");
tree->Branch("ExA", &ExA, "ExA/D");
tree1->Branch("ExAID", &ExAID, "ExAID/I"); // projectile excitation state ID
tree1->Branch("ExA", &ExA, "ExA/D"); // projectile excitation energy in MeV
int ExAID2;
double ExA2;
tree2->Branch("ExAID", &ExAID2, "ExAID/I");
tree2->Branch("ExA", &ExA2, "ExA/D");
int ExID;
double Ex;
tree->Branch("ExID", &ExID, "ExID/I");
tree->Branch("Ex", &Ex, "Ex/D");
tree1->Branch("ExID", &ExID, "ExID/I"); // target excitation state ID
tree1->Branch("Ex", &Ex, "Ex/D"); // target excitation energy in MeV
int ExID2;
double Ex2;
tree2->Branch("ExID", &ExID2, "ExID/I");
tree2->Branch("Ex", &Ex2, "Ex/D");
// true vertex position in target volume
double vertexX, vertexY, vertexZ;
tree->Branch("vX", &vertexX, "VertexX/D");
tree->Branch("vY", &vertexY, "VertexY/D");
tree->Branch("vZ", &vertexZ, "VertexZ/D");
tree1->Branch("vX", &vertexX, "VertexX/D"); // true vertex X position in mm
tree1->Branch("vY", &vertexY, "VertexY/D"); // true vertex Y position in mm
tree1->Branch("vZ", &vertexZ, "VertexZ/D"); // true vertex Z position in mm
double vertexX2, vertexY2, vertexZ2;
tree2->Branch("vX", &vertexX2, "VertexX/D");
tree2->Branch("vY", &vertexY2, "VertexY/D");
tree2->Branch("vZ", &vertexZ2, "VertexZ/D");
// reconstructed SX3 hit position
double sx3X, sx3Y, sx3Z;
tree->Branch("sx3X", &sx3X, "sx3X/D");
tree->Branch("sx3Y", &sx3Y, "sx3Y/D");
tree->Branch("sx3Z", &sx3Z, "sx3Z/D");
tree1->Branch("sx3X", &sx3X, "sx3X/D"); // reconstructed X position from SX3 (with optional smearing) in mm
tree1->Branch("sx3Y", &sx3Y, "sx3Y/D"); // reconstructed Y position from SX3 (with optional smearing)
tree1->Branch("sx3Z", &sx3Z, "sx3Z/D"); // reconstructed Z position from SX3 (with optional smearing)
double sx3X2, sx3Y2, sx3Z2;
tree2->Branch("sx3X", &sx3X2, "sx3X/D");
tree2->Branch("sx3Y", &sx3Y2, "sx3Y/D");
tree2->Branch("sx3Z", &sx3Z2, "sx3Z/D");
double qqqX, qqqY, qqqZ;
tree1->Branch("qqqX", &qqqX, "qqqX/D"); // reconstructed X position from QQQ (with optional smearing) in mm
tree1->Branch("qqqY", &qqqY, "qqqY/D"); // reconstructed Y position from QQQ (with optional smearing)
tree1->Branch("qqqZ", &qqqZ, "qqqZ/D"); // reconstructed Z position from QQQ (with optional smearing)
double qqqX2, qqqY2, qqqZ2;
tree2->Branch("qqqX", &qqqX2, "qqqX/D");
tree2->Branch("qqqY", &qqqY2, "qqqY/D");
tree2->Branch("qqqZ", &qqqZ2, "qqqZ/D");
// PW nearest and next nearest wires
int anodeID[2], cathodeID[2];
tree->Branch("aID", anodeID, "anodeID/I");
tree->Branch("cID", cathodeID, "cathodeID/I");
int anodeID2[2], cathodeID2[2];
tree1->Branch("aID", anodeID, "anodeID/I"); // anodeID[0] is nearest anode wire, anodeID[1] is next nearest anode wire
tree1->Branch("cID", cathodeID, "cathodeID/I"); // cathodeID[0] is nearest cathode wire, cathodeID[1] is next nearest cathode wire
tree2->Branch("aID", anodeID2, "anodeID/I");
tree2->Branch("cID", cathodeID2, "cathodeID/I");
// distances to nearest wires
double anodeDist[2], cathodeDist[2];
tree->Branch("aDist", anodeDist, "anodeDist/D");
tree->Branch("cDist", cathodeDist, "cathodeDist/D");
double anodeDist2[2], cathodeDist2[2];
tree1->Branch("aDist", anodeDist, "anodeDist/D");
tree1->Branch("cDist", cathodeDist, "cathodeDist/D");
tree2->Branch("aDist", anodeDist2, "anodeDist/D");
tree2->Branch("cDist", cathodeDist2, "cathodeDist/D");
int sx3ID, sx3Up, sx3Dn, sx3Bk;
// SX3 channel assignment and Z fraction (depth) information
int sx3ID, sx3Up, sx3Dn, sx3Bk, qqqID;
double sx3ZFrac;
tree->Branch("sx3ID", &sx3ID, "sx3ID/I");
tree->Branch("sx3Up", &sx3Up, "sx3Up/I");
tree->Branch("sx3Dn", &sx3Dn, "sx3Dn/I");
tree->Branch("sx3Bk", &sx3Bk, "sx3Bk/I");
tree->Branch("sx3ZFrac", &sx3ZFrac, "sx3ZFrac/D");
int sx3ID2, sx3Up2, sx3Dn2, sx3Bk2, qqqID2;
double sx3ZFrac2;
tree1->Branch("sx3ID", &sx3ID, "sx3ID/I");
tree1->Branch("qqqID", &qqqID, "qqqID/I");
tree1->Branch("sx3Up", &sx3Up, "sx3Up/I");
tree1->Branch("sx3Dn", &sx3Dn, "sx3Dn/I");
tree1->Branch("sx3Bk", &sx3Bk, "sx3Bk/I");
tree1->Branch("sx3ZFrac", &sx3ZFrac, "sx3ZFrac/D");
tree2->Branch("sx3ID", &sx3ID2, "sx3ID/I");
tree2->Branch("qqqID", &qqqID2, "qqqID/I");
tree2->Branch("sx3Up", &sx3Up2, "sx3Up/I");
tree2->Branch("sx3Dn", &sx3Dn2, "sx3Dn/I");
tree2->Branch("sx3Bk", &sx3Bk2, "sx3Bk/I");
tree2->Branch("sx3ZFrac", &sx3ZFrac2, "sx3ZFrac/D");
// reconstructed angles from PW track fit, method 1 and 2
double reTheta, rePhi;
tree->Branch("reTheta", &reTheta, "reconstucted_theta/D");
tree->Branch("rePhi", &rePhi, "reconstucted_phi/D");
double reTheta2, rePhi2;
tree1->Branch("reTheta", &reTheta, "reconstucted_theta/D");
tree1->Branch("rePhi", &rePhi, "reconstucted_phi/D");
tree2->Branch("reTheta", &reTheta2, "reconstucted_theta/D");
tree2->Branch("rePhi", &rePhi2, "reconstucted_phi/D");
double reTheta1, rePhi1;
tree->Branch("reTheta1", &reTheta1, "reconstucted_theta1/D");
tree->Branch("rePhi1", &rePhi1, "reconstucted_phi1/D");
double reTheta12, rePhi12;
tree1->Branch("reTheta1", &reTheta1, "reconstucted_theta1/D");
tree1->Branch("rePhi1", &rePhi1, "reconstucted_phi1/D");
tree2->Branch("reTheta1", &reTheta12, "reconstucted_theta1/D");
tree2->Branch("rePhi1", &rePhi12, "reconstucted_phi1/D");
// reconstructed vertex Z from PW fit
double z0;
tree->Branch("z0", &z0, "reconstucted_Z/D");
double z02;
tree1->Branch("z0", &z0, "reconstucted_Z/D");
tree2->Branch("z0", &z02, "reconstucted_Z/D");
//========timer
TBenchmark clock;
@ -142,9 +363,10 @@ int main(int argc, char **argv){
clock.Start("timer");
shown = false;
//================================= Calculate event
//================================= Calculate event loop
for( int i = 0; i < numEvent ; i++){
// randomly sample target/projectile excitations
ExAID = gRandom->Integer(nExA);
ExA = ExAList[ExAID];
transfer.SetExA(ExA);
@ -153,77 +375,218 @@ int main(int argc, char **argv){
Ex = ExList[ExID];
transfer.SetExB(Ex);
// recalc kinematic constants for chosen states
transfer.CalReactionConstant();
thetaCM = TMath::ACos(2 * gRandom->Rndm() - 1) ;
phiCM = (gRandom->Rndm() - 0.5) * TMath::TwoPi();
//==== Calculate reaction
TLorentzVector * output = transfer.Event(thetaCM, phiCM);
TLorentzVector Pb = output[2];
TLorentzVector PB = output[3];
thetab = Pb.Theta() * TMath::RadToDeg();
thetaB = PB.Theta() * TMath::RadToDeg();
Tb = Pb.E() - Pb.M();
TB = PB.E() - PB.M();
phib = Pb.Phi() * TMath::RadToDeg();
phiB = PB.Phi() * TMath::RadToDeg();
// vertex position in target volume
vertexX = (vertexXRange[1]- vertexXRange[0])*gRandom->Rndm() + vertexXRange[0];
vertexY = (vertexYRange[1]- vertexYRange[0])*gRandom->Rndm() + vertexYRange[0];
vertexZ = (vertexZRange[1]- vertexZRange[0])*gRandom->Rndm() + vertexZRange[0];
TVector3 vertex(vertexX, vertexY, vertexZ);
// compute beam energy at the event vertex from the gas path length
beamPath_cm = TVector3(vertexZ - beamEntranceZ, vertexX, vertexY).Mag() * 0.1;
if( beamPath_cm < 0 ) beamPath_cm = 0;
//beamEnergy = elossBeam->Eval(beamPath_cm); // MeV
//beamEnergyLoss = elossBeam->Eval(0.0) - beamEnergy;
//KEA = beamEnergy / beamA;
KEA = gRandom->Uniform(0, beamE);
beamEnergy = KEA * beamA;
beamEnergyLoss = 0;
transfer.SetIncidentEnergyAngle(KEA, 0, 0);
transfer.CalReactionConstant();
// isotropic CM direction
thetaCM = TMath::ACos(2 * gRandom->Rndm() - 1) ; // polar angle in CM frame
phiCM = (gRandom->Rndm() - 0.5) * TMath::TwoPi();
//==== Calculate reaction kinematics in lab frame for the primary transfer
TLorentzVector * output = transfer.Event(thetaCM, phiCM); // returns array of outputs
TLorentzVector Pb = output[2]; // primary proton from transfer
TLorentzVector PB = output[3]; // excited 21Na* heavy product
thetab = Pb.Theta() * TMath::RadToDeg();
Tb = (Pb.E() - Pb.M()); // kinetic energy of the light proton from the primary transfer
thetaB = PB.Theta() * TMath::RadToDeg();
TB = (PB.E() - PB.M());
phib = Pb.Phi() * TMath::RadToDeg();
phiB = PB.Phi() * TMath::RadToDeg();
T[0] = Tb;
T[1] = TB;
//secondary decay
TLorentzVector decayProton;
TLorentzVector heavy20;
if(enableSequentialDecay){
heavy20 = SimulateSequentialDecay(PB, decayDaughterA, decayDaughterZ,
decayEjectA, decayEjectZ, decayProton);
thetab2 = decayProton.Theta() * TMath::RadToDeg();
phib2 = decayProton.Phi() * TMath::RadToDeg();
Tb2 = decayProton.E() - decayProton.M();
thetaB2 = heavy20.Theta() * TMath::RadToDeg();
phiB2 = heavy20.Phi() * TMath::RadToDeg();
TB2 = heavy20.E() - heavy20.M();
T2[0] = Tb2;
T2[1] = TB2;
} else {
thetab2 = TMath::QuietNaN();
phib2 = TMath::QuietNaN();
Tb2 = TMath::QuietNaN();
thetaB2 = TMath::QuietNaN();
phiB2 = TMath::QuietNaN();
TB2 = TMath::QuietNaN();
T2[0] = TMath::QuietNaN();
T2[1] = TMath::QuietNaN();
}
delete [] output;
// set direction vector from lab angle
TVector3 dir(1, 0, 0);
dir.SetTheta(thetab * TMath::DegToRad());
dir.SetPhi(phib * TMath::DegToRad());
// run detector response models for PW and SX3
pw->FindWireID(vertex, dir, false);
sx3->FindSX3Pos(vertex, dir, false);
qqq->FindQQQPos(vertex, dir, false);
PWHitInfo hitInfo = pw->GetHitInfo();
anodeID[0] = hitInfo.nearestWire.first;
cathodeID[0] = hitInfo.nearestWire.second;
anodeID[1] = hitInfo.nextNearestWire.first;
cathodeID[1] = hitInfo.nextNearestWire.second;
anodeID[0] = hitInfo.nearestWire.first; // nearest anode wire ID
cathodeID[0] = hitInfo.nearestWire.second; // nearest cathode wire ID
anodeID[1] = hitInfo.nextNearestWire.first; // next nearest anode wire ID
cathodeID[1] = hitInfo.nextNearestWire.second; // next nearest cathode wire ID
anodeDist[0] = hitInfo.nearestDist.first;
cathodeDist[0] = hitInfo.nearestDist.second;
anodeDist[1] = hitInfo.nextNearestDist.first;
cathodeDist[1] = hitInfo.nextNearestDist.second;
anodeDist[1] = hitInfo.nextNearestDist.first; // distance to next nearest anode wire
cathodeDist[1] = hitInfo.nextNearestDist.second; // distance to next nearest cathode wire
if(IsDeadAnode(anodeID[0])) continue;
if(IsDeadCathode(cathodeID[0])) continue;
// SX3 hit channel info and depth fraction
sx3ID = sx3->GetID();
qqqID = qqq->GetID();
if(IsDeadSX3(sx3ID)) continue;
anodeDist[0] = hitInfo.nearestDist.first; // distance to nearest anode wire
cathodeDist[0] = hitInfo.nearestDist.second; // distance to nearest cathode wire
//start HERE
if( sx3ID >= 0 ){
sx3Up = sx3->GetChUp();
sx3Dn = sx3->GetChDn();
sx3Bk = sx3->GetChBk();
sx3ZFrac = sx3->GetZFrac();
//Introduce uncertaity
// TVector3 hitPos = sx3->GetHitPos();
// apply intrinsic detector resolution to true SX3 hit position
// for no smearing comment out and use GetHitPos();
TVector3 hitPos = sx3->GetHitPosWithSigma(sigmaSX3_W, sigmaSX3_L);
sx3X = hitPos.X();
sx3Y = hitPos.Y();
sx3Z = hitPos.Z();
// store track data for visualization if enabled
if(enableVis){
visTrackVertex.push_back(vertex);
visTrackDir.push_back(dir);
visTrackHitPos.push_back(hitPos);
visTrackWires.push_back({anodeID[0], cathodeID[0]});
}
// reconstruct track from PW readings + SX3 hit
pw->CalTrack(hitPos, anodeID[0], cathodeID[0], false);
reTheta = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi = pw->GetTrackPhi() * TMath::RadToDeg();
// alternative track algorithm with uncertainty parameters
pw->CalTrack2(hitPos, hitInfo, sigmaPW_A, sigmaPW_C, false);
reTheta1 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi1 = pw->GetTrackPhi() * TMath::RadToDeg();
z0 = pw->GetZ0();
tree1->Fill();
//tree3->Fill();
}else{
// fill tree2 using the secondary proton from 21Na* decay
TVector3 dir2(1, 0, 0);
dir2.SetTheta(thetab2 * TMath::DegToRad());
dir2.SetPhi(phib2 * TMath::DegToRad());
pw->FindWireID(vertex, dir2, false);
sx3->FindSX3Pos(vertex, dir2, false);
PWHitInfo hitInfo2 = pw->GetHitInfo();
anodeID2[0] = hitInfo2.nearestWire.first;
cathodeID2[0] = hitInfo2.nearestWire.second;
anodeID2[1] = hitInfo2.nextNearestWire.first;
cathodeID2[1] = hitInfo2.nextNearestWire.second;
anodeDist2[1] = hitInfo2.nextNearestDist.first;
cathodeDist2[1] = hitInfo2.nextNearestDist.second;
if(IsDeadAnode(anodeID2[0]) || IsDeadCathode(cathodeID2[0])){
sx3ID2 = -1;
} else {
sx3ID2 = sx3->GetID();
}
if(sx3ID2 < 0 || IsDeadSX3(sx3ID2)){
sx3ID2 = -1;
sx3Up2 = -1;
sx3Dn2 = -1;
sx3Bk2 = -1;
sx3ZFrac2 = TMath::QuietNaN();
sx3X2 = TMath::QuietNaN();
sx3Y2 = TMath::QuietNaN();
sx3Z2 = TMath::QuietNaN();
anodeDist2[0] = TMath::QuietNaN();
cathodeDist2[0] = TMath::QuietNaN();
reTheta2 = TMath::QuietNaN();
rePhi2 = TMath::QuietNaN();
reTheta12 = TMath::QuietNaN();
rePhi12 = TMath::QuietNaN();
z02 = TMath::QuietNaN();
} else {
anodeDist2[0] = hitInfo2.nearestDist.first;
cathodeDist2[0] = hitInfo2.nearestDist.second;
sx3Up2 = sx3->GetChUp();
sx3Dn2 = sx3->GetChDn();
sx3Bk2 = sx3->GetChBk();
sx3ZFrac2 = sx3->GetZFrac();
TVector3 hitPos2 = sx3->GetHitPosWithSigma(sigmaSX3_W, sigmaSX3_L);
sx3X2 = hitPos2.X();
sx3Y2 = hitPos2.Y();
sx3Z2 = hitPos2.Z();
pw->CalTrack(hitPos2, anodeID2[0], cathodeID2[0], false);
reTheta2 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi2 = pw->GetTrackPhi() * TMath::RadToDeg();
pw->CalTrack2(hitPos2, hitInfo2, sigmaPW_A, sigmaPW_C, false);
reTheta12 = pw->GetTrackTheta() * TMath::RadToDeg();
rePhi12 = pw->GetTrackPhi() * TMath::RadToDeg();
z02 = pw->GetZ0();
}
KEA2 = KEA;
thetaCM2 = thetaCM;
phiCM2 = phiCM;
ExAID2 = ExAID;
ExA2 = ExA;
ExID2 = ExID;
Ex2 = Ex;
vertexX2 = vertexX;
vertexY2 = vertexY;
vertexZ2 = vertexZ;
qqqX = TMath::QuietNaN();
qqqY = TMath::QuietNaN();
qqqZ = TMath::QuietNaN();
tree2->Fill();
}else if (qqqID >= 0){
// handle QQQ hit case
sx3Up = -1;
sx3Dn = -1;
sx3Bk = -1;
@ -233,23 +596,97 @@ int main(int argc, char **argv){
sx3Y = TMath::QuietNaN();
sx3Z = TMath::QuietNaN();
// for( int i = 0; i < 12; i++){
// sx3Index[i] = -1;
// }
reTheta = TMath::QuietNaN();
rePhi = TMath::QuietNaN();
reTheta1 = TMath::QuietNaN();
rePhi1 = TMath::QuietNaN();
z0 = TMath::QuietNaN();
qqqTb = Tb; // for simplicity, using the same kinetic energy for QQQ hit events, can be modified to simulate energy loss if desired
qqqTB = TB;
Tb = TMath::QuietNaN(); // mark kinetic energy as invalid for SX3 hit case
TB = TMath::QuietNaN();
TVector3 hitPos = qqq->GetHitPos();
qqqX = hitPos.X();
qqqY = hitPos.Y();
qqqZ = hitPos.Z();
if(enableVis){
visTrackVertex.push_back(vertex);
visTrackDir.push_back(dir);
visTrackHitPos.push_back(hitPos);
//visTrackWires.push_back({anodeID[0], cathodeID[0]});
}
tree1->Fill();
//tree3->Fill();
TVector3 dir2(1, 0, 0);
dir2.SetTheta(thetab2 * TMath::DegToRad());
dir2.SetPhi(phib2 * TMath::DegToRad());
qqq->FindQQQPos(vertex, dir2, false);
if(qqqID2 < 0){
qqqID2 = -1;
qqqX2 = TMath::QuietNaN();
qqqY2 = TMath::QuietNaN();
qqqZ2 = TMath::QuietNaN();
anodeDist2[0] = TMath::QuietNaN();
cathodeDist2[0] = TMath::QuietNaN();
reTheta2 = TMath::QuietNaN();
rePhi2 = TMath::QuietNaN();
reTheta12 = TMath::QuietNaN();
rePhi12 = TMath::QuietNaN();
z02 = TMath::QuietNaN();
anodeID2[0] = TMath::QuietNaN(); // no valid anode wire for QQQ hit case
cathodeID2[0] = TMath::QuietNaN(); // no valid cathode wire for QQQ hit case
anodeID2[1] = TMath::QuietNaN(); // no valid next nearest anode wire for QQQ hit case
cathodeID2[1] = TMath::QuietNaN(); // no valid next nearest cathode wire for QQQ hit case
anodeDist2[1] = TMath::QuietNaN();
cathodeDist2[1] = TMath::QuietNaN();
}
KEA2 = KEA;
thetaCM2 = thetaCM;
phiCM2 = phiCM;
ExAID2 = ExAID;
ExA2 = ExA;
ExID2 = ExID;
Ex2 = Ex;
vertexX2 = vertexX;
vertexY2 = vertexY;
vertexZ2 = vertexZ;
tree2->Fill();
}else{
// no valid SX3 hit: mark clearly invalid
sx3Up = -1;
sx3Dn = -1;
sx3Bk = -1;
sx3ZFrac = TMath::QuietNaN();
sx3X = TMath::QuietNaN();
sx3Y = TMath::QuietNaN();
sx3Z = TMath::QuietNaN();
reTheta = TMath::QuietNaN();
rePhi = TMath::QuietNaN();
reTheta1 = TMath::QuietNaN();
rePhi1 = TMath::QuietNaN();
z0 = TMath::QuietNaN();
Tb = TMath::QuietNaN(); // mark kinetic energy as invalid for no hit case
TB = TMath::QuietNaN();
// fill tree with original data (no energy loss for these events)
//comment out tree fill for no hit case
//tree1->Fill();
}
tree->Fill();
//#################################################################### Timer
// measure elapsed real time and print progress roughly every 10 sec
clock.Stop("timer");
Double_t time = clock.GetRealTime("timer");
clock.Start("timer");
@ -259,7 +696,7 @@ int main(int argc, char **argv){
printf( "%10d[%2d%%]| %8.2f sec | expect: %5.1f min \n", i, TMath::Nint((i+1)*100./numEvent), time , numEvent*time/(i+1)/60);
shown = 1;
}
}else{
} else {
if (fmod(time, 10) > 9 ){
shown = 0;
}
@ -267,14 +704,78 @@ int main(int argc, char **argv){
}
tree->Write();
int count = tree->GetEntries();
// write results to ROOT file and close
tree1->Write("", TObject::kOverwrite);
tree2->Write("", TObject::kOverwrite);
//tree3->Write("", TObject::kOverwrite);
int count1 = tree1->GetEntries();
int count2 = tree2->GetEntries();
//int count3 = tree3->GetEntries();
saveFile->Close();
printf("=============== done. saved as %s. count(hit==1) : %d\n", saveFileName.Data(), count);
printf("=============== done. saved as %s. tree1 entries: %d, tree2 entries: %d\n", saveFileName.Data(), count1, count2);
if(enableVis){ // to enable visualization, run with 3rd argument "vis", e.g. "./anasenMC 1000 vis"
printf("Displaying geometry with %zu tracks from simulation\n", visTrackVertex.size());
// Build full geometry with all wires
anasen->DrawAnasen(0, 23, 0, 23, -1, true);
// Add all stored tracks to the geometry
TGeoManager *geom = anasen->GetGeoManager();
TGeoVolume *worldBox = anasen->GetWorldBox();
if(geom && worldBox && visTrackVertex.size() > 0){
int trackNodeID = 500; // start node IDs for tracks
for(size_t iTrack = 0; iTrack < visTrackVertex.size(); ++iTrack){
TVector3 vertex = visTrackVertex[iTrack];
TVector3 dir = visTrackDir[iTrack];
TVector3 hitPos = visTrackHitPos[iTrack];
double theta = dir.Theta() * TMath::RadToDeg();
double phi = dir.Phi() * TMath::RadToDeg();
// Add a line marker at the vertex
TGeoVolume *startMarker = geom->MakeSphere("startMarker", 0, 0, 2.0);
startMarker->SetLineColor(kBlack);
worldBox->AddNode(startMarker, trackNodeID,
new TGeoCombiTrans(vertex.X(), vertex.Y(), vertex.Z(),
new TGeoRotation("rot", 0, 0, 0)));
trackNodeID++;
// Add track line from vertex toward hit position
TGeoVolume *trackLine = geom->MakeTube("trackLine", 0, 0, 0.08, 150.0);
trackLine->SetLineColor(kBlue);
worldBox->AddNode(trackLine, trackNodeID,
new TGeoCombiTrans(vertex.X(), vertex.Y(), vertex.Z(),
new TGeoRotation("rotTrack", phi + 90, theta, 0)));
trackNodeID++;
// Add hit position marker
TGeoVolume *hitMarker = geom->MakeSphere("hitMarker", 0, 0, 2.0);
hitMarker->SetLineColor(kRed);
worldBox->AddNode(hitMarker, trackNodeID,
new TGeoCombiTrans(hitPos.X(), hitPos.Y(), hitPos.Z(),
new TGeoRotation("rotHit", 0, 0, 0)));
trackNodeID++;
}
// Redraw geometry with all tracks
geom->CloseGeometry();
geom->SetVisLevel(4);
worldBox->Draw("ogle");
}
if(app){
printf("Entering ROOT event loop\n");
app->Run();
}
}
delete anasen;
return 0;
}

178
Armory/histcomp.C Normal file
View File

@ -0,0 +1,178 @@
void histcomp() {
gROOT->SetBatch(kTRUE);
// Open file
TFile *f = new TFile("SimAnasen1.root");
// Get trees (MAKE SURE names are correct)
TTree *tree1 = (TTree*)f->Get("tree");
TTree *tree2 = (TTree*)f->Get("tree2");
if (!tree1 || !tree2) {
printf("Error: could not find trees. Check names!\n");
return;
}
// Create output directory (overwrite-safe)
gSystem->Exec("mkdir -p plots");
// Get list of branches
TObjArray *branches = tree1->GetListOfBranches();
int nBranches = branches->GetEntries();
//int nBranches = 1;
// Loop over branches
for (int i = 0; i < nBranches; i++) {
TBranch *br = (TBranch*)branches->At(i);
TString name = br->GetName();
//printf("Processing branch: %s\n", name.Data());
// Create histograms (auto-range using Draw first)
TString h1name = "h1_" + name;
TString h2name = "h2_" + name;
// Temporary draw to get range
double min, max;
if(name == "T"){
//Get minimum value of T[0] and use as min
min = tree2->GetMinimum("Tb");
max = tree1->GetMaximum("TB");
}else{
tree1->Draw(name, "", "goff");
min = fmin(tree1->GetMinimum(name),
tree2->GetMinimum(name));
max = fmax(tree1->GetMaximum(name),
tree2->GetMaximum(name));
}
//if (min == max) continue; // skip constant branches
// Expand range slightly
double margin = 0.1 * (max - min);
min -= margin;
max += margin;
TH1D *h1 = new TH1D(h1name, name, 100, min, max);
TH1D *h2 = new TH1D(h2name, name, 100, min, max);
// Fill histograms
if(name == "T"){
// Fill both array elements into same histogram
tree1->Draw("Tb>>+" + h1name, "", "goff");
tree1->Draw("TB>>+" + h1name, "", "goff");
tree2->Draw("Tb>>+" + h2name, "", "goff");
tree2->Draw("TB>>+" + h2name, "", "goff");
}else{
tree1->Draw(name + ">>" + h1name, "", "goff");
tree2->Draw(name + ">>" + h2name, "", "goff");
}
// Style
h1->SetLineColor(kRed);
h1->SetLineWidth(2);
h2->SetLineColor(kBlue);
h2->SetLineWidth(2);
// Normalize (optional but useful)
//if (h1->GetEntries() > 0) h1->Scale(1.0 / h1->GetEntries());
//if (h2->GetEntries() > 0) h2->Scale(1.0 / h2->GetEntries());
// Canvas
TCanvas *c = new TCanvas("c", name, 900, 600); //arguments are (name, title, width, height)
c->SetRightMargin(0.18);
c->Modified();
c->Update();
h1->SetTitle(name + ";"+name+";Counts");
h1->Draw("HIST");
h2->Draw("HIST SAME");
gPad->Update();
TPaveStats *st = (TPaveStats*)h1->FindObject("stats");
st->SetX1NDC(0.85); // New X start (left)
st->SetY1NDC(0.5); // New Y start (bottom)
st->SetX2NDC(0.98); // New X end (right)
st->SetY2NDC(0.8); // New Y end (top)
st->Draw();
gPad->Modified();
gPad->Update();
// Legend
TLegend *leg = new TLegend(0.65 + .2,0.75 + .1,0.88 + .1,0.88 + .1);
leg->AddEntry(h1, "tree1", "l");
leg->AddEntry(h2, "tree2", "l");
leg->Draw();
//to plot both as one histogram in root, can use tree2->Draw("T(0)"); for light particle and tree2->Draw("T(1)") for heavy particle
// Save plot (overwrite each run)
TString filename = "plots/" + name + ".png";
c->SaveAs(filename);
// Optional: save log plots as well
if (false) { // set to True to also save log plots
c->SetLogy(1);
h1->SetTitle(name + " (log);"+name+";Counts");
c->SaveAs("plots/" + name + "_logy.png");
c->SetLogy(0);
c->SetLogx(1);
h1->SetTitle(name + " (log);"+name+";Counts");
c->SaveAs("plots/" + name + "_logx.png");
// Clean up
delete c;
delete h1;
delete h2;
}
}
// dEb on y, SX3z on x
TH2D *h2d = new TH2D("h2d", "dEb vs SX3z;SX3z (cm);dEb (MeV)", 500, tree2->GetMinimum("sx3Z"), tree2->GetMaximum("sx3Z"), 500, tree2->GetMinimum("dEb"), tree2->GetMaximum("dEb")); //arguments are (name, title, xbins, xlow, xup, ybins, ylow, yup)
tree2->Draw("dEb:sx3Z>>h2d", "", "goff"); // arguments are "y:x>>histogram", "selection", "options"
TCanvas *c2d = new TCanvas("c2d", "dEb vs SX3z", 900, 600);
h2d->Draw("COLZ");
c2d->SaveAs("plots/dEb_vs_SX3z.png");
TH2D *h2z = new TH2D("h2z", "dEb vs z0", 500, tree2->GetMinimum("z0"), tree2->GetMaximum("z0"), 500, tree2->GetMinimum("dEb"), tree2->GetMaximum("dEb"));
tree2->Draw("dEb:z0>>h2z", "", "goff"); // arguments are "y:x>>histogram", "selection", "options"
TCanvas *c2z = new TCanvas("c2z", "dEb vs z0", 900, 600);
h2z->Draw("COLZ");
c2z->SaveAs("plots/dEb_vs_z0.png");
TH2D *h2theta = new TH2D("h2theta", "dEb vs reTheta", 500, tree2->GetMinimum("reTheta"), tree2->GetMaximum("reTheta"), 500, tree2->GetMinimum("dEb"), tree2->GetMaximum("dEb"));
tree2->Draw("dEb:reTheta>>h2theta", "", "goff"); // arguments are "y:x>>histogram", "selection", "options"
TCanvas *c2theta = new TCanvas("c2theta", "dEb vs reTheta", 900, 600);
h2theta->Draw("COLZ");
c2theta->SaveAs("plots/dEb_vs_reTheta.png");
TH2D *h2phi = new TH2D("h2phi", "dEb vs rePhi", 500, tree2->GetMinimum("rePhi"), tree2->GetMaximum("rePhi"), 500, tree2->GetMinimum("dEb"), tree2->GetMaximum("dEb"));
tree2->Draw("dEb:rePhi>>h2phi", "", "goff"); // arguments are "y:x>>histogram", "selection", "options"
TCanvas *c2phi = new TCanvas("c2phi", "dEb vs rePhi", 900, 600);
h2phi->Draw("COLZ");
c2phi->SaveAs("plots/dEb_vs_rePhi.png");
TH2D *h2dE = new TH2D("h2dE", "dEb vs Tb", 500, tree2->GetMinimum("Tb"), tree2->GetMaximum("Tb"), 500, tree2->GetMinimum("dEb"), tree2->GetMaximum("dEb"));
tree2->Draw("dEb:Tb>>h2dE", "", "goff"); // arguments are "y:x>>histogram", "selection", "options"
TCanvas *c2dE = new TCanvas("c2dE", "dEb vs Tb", 900, 600);
h2dE->Draw("COLZ");
c2dE->SaveAs("plots/dEb_vs_Tb.png");
printf("Done! Plots saved in ./plots/\n");
}

56
Armory/macro.h Normal file
View File

@ -0,0 +1,56 @@
#ifndef MACRO_H
#define MACRO_H
#define MaxNPorts 4 //for optical link
#define MaxNBoards 4 //for both optical link and usb
#define MaxNDigitizer MaxNPorts * MaxNBoards
#define MaxRegChannel 16
#define MaxNChannels 64
#define MaxRecordLength 0x3fff * 8
#define MaxSaveFileSize 1024 * 1024 * 1024 * 2
#define MaxDisplayTraceTimeLength 20000 //ns
#define ScopeUpdateMiliSec 200 // msec
#define MaxNumberOfTrace 5 // in an event
#define SETTINGSIZE 2048
#define DAQLockFile "DAQLock.dat"
#define PIDFile "pid.dat"
#include <sys/time.h> /** struct timeval, select() */
inline unsigned int getTime_us(){
unsigned int time_us;
struct timeval t1;
struct timezone tz;
gettimeofday(&t1, &tz);
time_us = (t1.tv_sec) * 1000 * 1000 + t1.tv_usec;
return time_us;
}
#include <chrono>
inline unsigned long long getTime_ns(){
std::chrono::high_resolution_clock::time_point currentTime = std::chrono::high_resolution_clock::now();
std::chrono::nanoseconds nanoseconds = std::chrono::duration_cast<std::chrono::nanoseconds>(currentTime.time_since_epoch());
return nanoseconds.count();
}
typedef unsigned short uShort;
typedef unsigned int uInt;
typedef unsigned long uLong;
typedef unsigned long long ullong;
#define DebugMode 0 //process check, when 1, print out all function call
// if DebugMode is 1, define DebugPrint() to be printf(), else, DebugPrint() define nothing
#if DebugMode
#define DebugPrint(fmt, ...) printf(fmt "::%s\n",##__VA_ARGS__, __func__);
#else
#define DebugPrint(fmt, ...)
#endif
#endif

File diff suppressed because it is too large Load Diff

4
Armory/run_script.C Normal file
View File

@ -0,0 +1,4 @@
.L ANASEN_model.C
.L anasenMS_root.cpp+
ANASEN_model();
Run(10);

61
Armory/vis_helpers.h Normal file
View File

@ -0,0 +1,61 @@
#ifndef VIS_HELPERS_H
#define VIS_HELPERS_H
#include <TSystem.h>
#include <TEvePointSet.h>
#include <TTree.h>
#include <vector>
#include <mutex>
static TEvePointSet* gVisPts = nullptr;
static std::mutex gVisMutex;
// Recommended: call once after opening TEve and adding a point set to gEve
inline void SetVisPointSet(TEvePointSet* pts) { gVisPts = pts; }
inline void UpdateVisPointSet(const std::vector<double>& x,
const std::vector<double>& y,
const std::vector<double>& z)
{
if(!gVisPts) return;
std::lock_guard<std::mutex> lk(gVisMutex);
gVisPts->Reset();
size_t n = std::min({x.size(), y.size(), z.size()});
for(size_t i=0; i<n; ++i) gVisPts->SetNextPoint(x[i], y[i], z[i]);
if(gEve) {
gEve->Redraw3D();
gSystem->ProcessEvents();
}
}
// Fill a tree with pointlists (one entry per event); must have branches defined once by caller
inline void RecordTreeXYZ(TTree* outTree,
const std::vector<double>& x,
const std::vector<double>& y,
const std::vector<double>& z)
{
if(!outTree) return;
static std::vector<double> tx, ty, tz;
tx = x;
ty = y;
tz = z;
if(outTree->GetBranch("x") == nullptr) outTree->Branch("x", &tx);
if(outTree->GetBranch("y") == nullptr) outTree->Branch("y", &ty);
if(outTree->GetBranch("z") == nullptr) outTree->Branch("z", &tz);
// Do NOT call SetBranchAddress() for the branch we are filling.
outTree->Fill();
outTree->GetCurrentFile()->Flush();
}
inline void PushEventAndRecord(const std::vector<double>& x,
const std::vector<double>& y,
const std::vector<double>& z,
TTree* outTree = nullptr)
{
if(outTree) RecordTreeXYZ(outTree, x, y, z);
UpdateVisPointSet(x,y,z);
}
#endif // VIS_HELPERS_H

BIN
Armory/vis_inproc Executable file

Binary file not shown.

65
Armory/vis_inproc.cpp Normal file
View File

@ -0,0 +1,65 @@
//In-ROOT sim data
// vis_inproc.cpp
#include <TApplication.h>
#include <TGeoManager.h>
#include <TEveManager.h>
#include <TEvePointSet.h>
#include <TSystem.h>
#include <TRandom3.h>
#include <thread>
#include <chrono>
#include <vector>
#include <iostream>
void runSimulationAndUpdate(TEvePointSet* pts){
TRandom3 rnd(0);
for(int ev=0; ev<10000; ++ev){
pts->Reset();
int n = 100;
for(int i=0;i<n;++i){
double x = rnd.Uniform(-50,50);
double y = rnd.Uniform(-50,50);
double z = rnd.Uniform(-50,50);
pts->SetNextPoint(x,y,z);
}
gEve->Redraw3D();
gSystem->ProcessEvents();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
void StartVis(const char* geomfile=nullptr){
int argc=0; char** argv=nullptr;
TApplication app("app",&argc,argv);
if(geomfile) TGeoManager::Import(geomfile);
TEveManager::Create();
TEvePointSet *pts = new TEvePointSet("hits");
gEve->AddElement(pts);
// runSimulationAndUpdate(pts); // or leave update API to caller
app.Run();
}
int main(int argc, char** argv){
TApplication app("app",&argc,argv);
if(argc>1) TGeoManager::Import(argv[1]);
TEveManager::Create();
TEvePointSet *pts = new TEvePointSet("hits");
pts->SetMarkerStyle(20);
pts->SetMarkerSize(1.2);
pts->SetMarkerColor(kRed);
gEve->AddElement(pts);
// Option A: run simulation in same thread but yield to event loop inside the sim
runSimulationAndUpdate(pts);
// Option B: run sim in a separate thread (only if sim avoids ROOT globals)
// std::thread simThread(runSimulationAndUpdate, pts);
// simThread.detach();
app.Run();
return 0;
}

6
BatchProcess.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
#parallel -j 6 echo ./ProcessRun.sh {1} 2000 0 ::: {020..400}
#parallel --results log/log_{}.txt --ctag -j 6 ./ProcessRun.sh {1} 2000 0 ::: {020..400} # for 17F
parallel --results log/log_{}.txt --ctag -j 6 ./ProcessRun.sh {1} 2000 0 ::: {001..021}

Some files were not shown because too many files have changed in this diff Show More