This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
community:refhepsim_analysis [2015/05/10 20:49] asc [HepSim Analysis Primer] |
community:refhepsim_analysis [2016/04/28 15:24] (current) asc [HepSim Analysis Primer] |
||
---|---|---|---|
Line 2: | Line 2: | ||
- | This analysis tutorial covers Java/Jython | + | This analysis tutorial covers |
For C++/ROOT, please refer [[asc: | For C++/ROOT, please refer [[asc: | ||
- | To ensure platform independence and a possibility to run using web browsers, validation programs are written in Jython, which is an implementation of the Python language on the Java platform. | + | To ensure platform independence and a possibility to run programs |
Look at several links: | Look at several links: | ||
* [[http:// | * [[http:// | ||
- | * [[http:// | + | * [[http:// |
Line 16: | Line 16: | ||
* Using Java web start from the browser. | * Using Java web start from the browser. | ||
* " | * " | ||
- | * " | + | * " |
- | * [[http:// | + | * [[http:// |
+ | * [[http:// | ||
Line 64: | Line 65: | ||
from proto import FileMC | from proto import FileMC | ||
f=FileMC(" | f=FileMC(" | ||
+ | des=f.getDescription() | ||
header = f.getHeader() | header = f.getHeader() | ||
un=float(header.getMomentumUnit()) | un=float(header.getMomentumUnit()) | ||
Line 71: | Line 73: | ||
The latter | The latter | ||
to double values. The values are typically around 1000-10000, depending on importance of representing low-momentum with a better precision. | to double values. The values are typically around 1000-10000, depending on importance of representing low-momentum with a better precision. | ||
- | The header file also stores some additional information. Look at Java API: | + | The header file also stores some additional information. Look at Java API |
+ | * [[http:// | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
Line 100: | Line 103: | ||
* [[http:// | * [[http:// | ||
- | In the above example, " | + | In the above example, " |
<code python> | <code python> | ||
Line 118: | Line 121: | ||
e= pa.getEnergy(j)/ | e= pa.getEnergy(j)/ | ||
m= pa.getMass(j)/ | m= pa.getMass(j)/ | ||
- | | + | |
</ | </ | ||
To access the PDG status code, us " | To access the PDG status code, us " | ||
Line 137: | Line 140: | ||
Look at the API of the Lorentz-particle class: | Look at the API of the Lorentz-particle class: | ||
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | In addition, you can build an ArrayList with particles using a convenient class [[http:// | + | In addition, you can build an ArrayList with particles using a convenient class [[http:// |
- | Also, when pssible, use the method " | + | Also, when possible, use the method " |
<code python> | <code python> | ||
Line 158: | Line 161: | ||
The above example fills a list with all stable particles, without any cuts on pT and Eta (2 second arguments). | The above example fills a list with all stable particles, without any cuts on pT and Eta (2 second arguments). | ||
- | The next example creates [[http:// | + | The next example creates [[http:// |
<code python> | <code python> | ||
from proto import FileMC | from proto import FileMC | ||
Line 177: | Line 180: | ||
In this example, we fill a list with all stable particles (status " | In this example, we fill a list with all stable particles (status " | ||
- | The object " | + | The object " |
Finality, let us extend the above example: we will create anti-kT jets using the list " | Finality, let us extend the above example: we will create anti-kT jets using the list " | ||
Line 201: | Line 204: | ||
print "pT of a leading jet =", | print "pT of a leading jet =", | ||
</ | </ | ||
- | To build anti-kT jets, we use [[http:// | + | To build anti-kT jets, we use [[http:// |
+ | The description of this algorithm is given in [[http:// | ||
+ | It is a similar to FastJet N*N algorithm and typically shows | ||
a performance similar to the C++ analogue. Tests indicate that the JetN2 clustering algorithm is about twice slower that C++, but by a factor 20 faster than the traditional N^3 jet clustering algorithms. You can find benchmarking results in [[https:// | a performance similar to the C++ analogue. Tests indicate that the JetN2 clustering algorithm is about twice slower that C++, but by a factor 20 faster than the traditional N^3 jet clustering algorithms. You can find benchmarking results in [[https:// | ||
Look at a typical example of jet clustering in the [[http:// | Look at a typical example of jet clustering in the [[http:// | ||
Line 226: | Line 231: | ||
====== Plots and histograms ====== | ====== Plots and histograms ====== | ||
- | HepSim uses histogram packages supported by SCaVis | + | HepSim uses histogram packages supported by DataMelt |
Here are a few most common classes: | Here are a few most common classes: | ||
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | The main canvas to show histograms [[http:// | + | The main canvas to show histograms [[http:// |
Usually, plots are saved in the vector-graphics SVG format. They can be converted on Linux to EPS as: | Usually, plots are saved in the vector-graphics SVG format. They can be converted on Linux to EPS as: | ||
Line 243: | Line 248: | ||
However, one can also save images in PDF or EPS using the corresponding file extensions for the " | However, one can also save images in PDF or EPS using the corresponding file extensions for the " | ||
- | In addition, data are saved in the form of XML (with the extension " | + | In addition, data are saved in the form of XML (with the extension " |
For example, one can read such files and create histograms or data objects as: | For example, one can read such files and create histograms or data objects as: | ||
Line 253: | Line 258: | ||
print p1.toString() | print p1.toString() | ||
</ | </ | ||
- | The object p1 belongs to the class [[http:// | + | The object p1 belongs to the class [[http:// |
====== HepSim API ====== | ====== HepSim API ====== | ||
Line 260: | Line 265: | ||
stored inside ProMC data files: | stored inside ProMC data files: | ||
- | | + | ===== Histograms and plots ===== |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | |
+ | See also other math and graphics classes in the [[http:// | ||
+ | ===== Lorentz particles and Jets ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
| | ||
| | ||
Java implementation of the longitudinally invariant kT and anti-kT clustering algorithms uses the E-scheme to combine particles (p1+p2) and Eta-Phi space (not Rapidity-Phi). Also, Cambridge/ | Java implementation of the longitudinally invariant kT and anti-kT clustering algorithms uses the E-scheme to combine particles (p1+p2) and Eta-Phi space (not Rapidity-Phi). Also, Cambridge/ | ||
- | See also other classes in [[http:// | + | |
- | You can build the standard kt-jets using [[http:// | + | You can build the standard kt-jets using [[http:// |
- | [[http:// | + | [[http:// |
+ | |||
+ | ===== Working with ProMC files ===== | ||
+ | |||
+ | Also, look at the ProMC Java API that is used to store data: | ||
* [[http:// | * [[http:// | ||
Line 284: | Line 303: | ||
It is simplified compared to full MC simulations, | It is simplified compared to full MC simulations, | ||
information on event weights and uncertainties. | information on event weights and uncertainties. | ||
+ | |||
+ | The project uses the community edition of [[http:// | ||
--- // | --- // |