<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pct.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=DTC_toolkit</id>
	<title>DTC toolkit - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pct.wiki.uib.no/index.php?action=history&amp;feed=atom&amp;title=DTC_toolkit"/>
	<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=DTC_toolkit&amp;action=history"/>
	<updated>2026-05-05T06:45:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=DTC_toolkit&amp;diff=116&amp;oldid=prev</id>
		<title>Hpe090: Created page with &quot;The Digital Tracking Calorimeter Toolkit is located at Helge&#039;s github (but should be moved to the Gitlab when ready). :* https://github.com/HelgeEgil/focal To clone the projec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=DTC_toolkit&amp;diff=116&amp;oldid=prev"/>
		<updated>2017-02-23T17:58:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The Digital Tracking Calorimeter Toolkit is located at Helge&amp;#039;s github (but should be moved to the Gitlab when ready). :* https://github.com/HelgeEgil/focal To clone the projec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The Digital Tracking Calorimeter Toolkit is located at Helge&amp;#039;s github (but should be moved to the Gitlab when ready).&lt;br /&gt;
:* https://github.com/HelgeEgil/focal&lt;br /&gt;
To clone the project, run&lt;br /&gt;
    git clone https://github.com/HelgeEgil/focal&lt;br /&gt;
in a new folder to contain the project. The folder structure will be&lt;br /&gt;
    DTCToolkit/                 &amp;lt;- the reconstruction and analysis code&lt;br /&gt;
    DTCToolkit/Analysis         &amp;lt;- User programs for running the code&lt;br /&gt;
    DTCToolkit/Classes          &amp;lt;- All the classes needed for the project&lt;br /&gt;
    DTCToolkit/Data             &amp;lt;- Data files: Range-energy look up tables, Monte Carlo code, LET data from experiments, the beam data from Groningen, ...&lt;br /&gt;
    DTCToolkit/GlobalConstants  &amp;lt;- Constants to adjust how the programs are run. Material parameters, geometry, ...&lt;br /&gt;
    DTCToolkit/HelperFunctions  &amp;lt;- Small programs to help running the code.&lt;br /&gt;
    DTCToolkit/OutputFiles      &amp;lt;- All output files (csv, jpg, ...) should be put here&lt;br /&gt;
    DTCToolkit/RootFiles        &amp;lt;- ROOT specific configuration files.&lt;br /&gt;
    DTCToolkit/Scripts          &amp;lt;- Independent scripts for helping the analysis. E.g. to create Range-energy look up tables from Monte Carlo data&lt;br /&gt;
    gate/                       &amp;lt;- All Gate-related files&lt;br /&gt;
    gate/python                 &amp;lt;- The DTC geometry builder&lt;br /&gt;
    projects/                   &amp;lt;- Other projects related to WP1&lt;br /&gt;
&lt;br /&gt;
The best way to learn how to use the code is to look at the user programs, e.g. Analysis.C::DrawBraggPeakGraphFit which is the function used to create the Bragg Peak model fits and beam range estimation used in the 2017 NIMA article. From here it is possible to follow what the code does.&lt;br /&gt;
It is also a good idea to read through what the different classes are and how they interact:&lt;br /&gt;
* &amp;lt;code&amp;gt;Hit&amp;lt;/code&amp;gt;: A (int x,int y,int layer, float edep) object from a pixel hit. edep information only from MC&lt;br /&gt;
* &amp;lt;code&amp;gt;Hits&amp;lt;/code&amp;gt;: A &amp;lt;code&amp;gt;TClonesArray&amp;lt;/code&amp;gt; collection of Hit objects&lt;br /&gt;
* &amp;lt;code&amp;gt;Cluster&amp;lt;/code&amp;gt;: A (float x, float y, int layer, float clustersize) object from a cluster of &amp;lt;code&amp;gt;Hit&amp;lt;/code&amp;gt;s The (x,y) position is the mean position of all involved hits.&lt;br /&gt;
* &amp;lt;code&amp;gt;Clusters&amp;lt;/code&amp;gt;: A &amp;lt;code&amp;gt;TClonesArray&amp;lt;/code&amp;gt; collection of &amp;lt;code&amp;gt;Cluster&amp;lt;/code&amp;gt; objects.&lt;br /&gt;
* &amp;lt;code&amp;gt;Track&amp;lt;/code&amp;gt;: A &amp;lt;code&amp;gt;TClonesArray&amp;lt;/code&amp;gt; collection of &amp;lt;code&amp;gt;Cluster&amp;lt;/code&amp;gt; objects... But only one per layer, and is connected through a physical proton track. Many helpful member functions to calculate track properties.&lt;br /&gt;
* &amp;lt;code&amp;gt;Tracks&amp;lt;/code&amp;gt;: A &amp;lt;code&amp;gt;TClonesArray&amp;lt;/code&amp;gt; collection of &amp;lt;code&amp;gt;Track&amp;lt;/code&amp;gt; objects.&lt;br /&gt;
* &amp;lt;code&amp;gt;Layer&amp;lt;/code&amp;gt;: The contents of a single detector layer. Is stored as a &amp;lt;code&amp;gt;TH2F&amp;lt;/code&amp;gt; histogram, and has a &amp;lt;code&amp;gt;Layer::findHits&amp;lt;/code&amp;gt; function to find hits, as well as the cluster diffusion model &amp;lt;code&amp;gt;Layer::diffuseLayer&amp;lt;/code&amp;gt;. It is controlled from a &amp;lt;code&amp;gt;CalorimeterFrame&amp;lt;/code&amp;gt; object.&lt;br /&gt;
* &amp;lt;code&amp;gt;CalorimeterFrame&amp;lt;/code&amp;gt;: The collection of all &amp;lt;code&amp;gt;Layer&amp;lt;/code&amp;gt;s in the detector.&lt;br /&gt;
* &amp;lt;code&amp;gt;DataInterface&amp;lt;/code&amp;gt;: The class to talk to DTC data, either through semi-&amp;lt;code&amp;gt;Hit&amp;lt;/code&amp;gt; objects as retrieved from Utrecht from the Groningen beam test, or from ROOT files as generated in Gate.&lt;br /&gt;
&lt;br /&gt;
To run the code, do&lt;br /&gt;
    [DTCToolkit] $ root Load.C&lt;br /&gt;
and ROOT will run the script &amp;lt;code&amp;gt;Load.C&amp;lt;/code&amp;gt; which loads all code and starts the interpreter. From here it is possible to directly run scripts as defined in the &amp;lt;code&amp;gt;Analysis.C&amp;lt;/code&amp;gt; file:&lt;br /&gt;
    ROOT [1] drawBraggPeakGraphFit(...)&lt;br /&gt;
&lt;br /&gt;
=== Quick guide to drawBraggPeakGraphFit ===&lt;br /&gt;
In order to run the function drawBraggPeakGraphFit, which is the &amp;#039;&amp;#039;main body&amp;#039;&amp;#039; of the code used to generate interesting results, the following arguments are needed:&lt;br /&gt;
    drawBraggPeakGraphFit(Int_t Runs, Int_t dataType = kMC, Bool_t recreate = 0, Float_t energy = 188, Float_t degraderThickness = 0)&lt;br /&gt;
* Runs: The number of times to run the code on &amp;#039;&amp;#039;n&amp;#039;&amp;#039; proton histories. The number &amp;#039;&amp;#039;n&amp;#039;&amp;#039; is defined as &amp;lt;code&amp;gt;kEventsPerRun&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;GlobalConstants&amp;gt;Constants.C&amp;lt;/code&amp;gt;.&lt;br /&gt;
* dataType: Monte Carlo (0) or experimental data (1)&lt;br /&gt;
* recreate: Use stored tracks for this dataType/energy in Data/Tracks to save time (0), or recreate the tracks (1)&lt;br /&gt;
* energy: Which energy to run the code on. Fetches the corresponding MC / exp. file from Data/MonteCarlo[ExperimentalData]/...%dMeV....ROOT&lt;br /&gt;
* degraderThickness: If the code is to be run in energy degrader mode (constant initial energy modulated by a water phantom of varying thickness), then set &amp;lt;code&amp;gt;useDegrader = true&amp;lt;/code&amp;gt; in Constants.h and give the water thickness in mm here.&lt;br /&gt;
Example, to run MC with a 240 mm degrader, with a DTC geometry of 3 mm (this has to be set as the kAbsorberThickness in Constants.h), and do one run on new data:&lt;br /&gt;
    drawBraggPeakGraphFit(1, 0, 1, 250, 240)&lt;br /&gt;
The file &amp;lt;code&amp;gt;Data/MonteCarlo/DTC_Aluminium_Absorber3mm_Degrader240mm_250MeV.root&amp;lt;/code&amp;gt; is then loaded into memory.&lt;br /&gt;
&lt;br /&gt;
Tip: In order to run multiple files in batch mode, look at the script &amp;lt;code&amp;gt;DTCToolkit/Scripts/makeBraggPeakPDFDegrader.C&amp;lt;/code&amp;gt;, controlled with the bash script &amp;lt;code&amp;gt;DTCToolkit/makeFitResultPlotsDegrader.sh&amp;lt;/code&amp;gt;. The results are stored in the &amp;lt;code&amp;gt;DTCToolkit/OutputFiles/results_makebraggpeakfit.csv&amp;lt;/code&amp;gt; file. To loop through with the above configuration, but with degrader thicknesses of 50 to 350 with 5 MeV steps, do&lt;br /&gt;
    [DTCToolkit] $ sh makeFitResultPlotsDegrader.sh 50 5 350&lt;br /&gt;
When this is done, look through the file result_makebraggpeakfit.csv. The script &amp;lt;code&amp;gt;DTCToolkit/Scripts/makePlots.C&amp;lt;/code&amp;gt; can create nice output from this file:&lt;br /&gt;
    [DTCToolkit] $ root Scripts/makePlots.C&lt;/div&gt;</summary>
		<author><name>Hpe090</name></author>
	</entry>
</feed>