{"id":6,"date":"2017-10-11T11:55:44","date_gmt":"2017-10-11T15:55:44","guid":{"rendered":"http:\/\/sites.nd.edu\/attpc\/?p=6"},"modified":"2017-10-11T15:36:06","modified_gmt":"2017-10-11T19:36:06","slug":"tbjcattpcroot-installation-instructions","status":"publish","type":"post","link":"https:\/\/sites.nd.edu\/attpc\/2017\/10\/11\/tbjcattpcroot-installation-instructions\/","title":{"rendered":"tbjcATTPCroot Installation Instructions"},"content":{"rendered":"<p>Finally, I think I should write a instruction of using my code.<\/p>\n<p>The code is basically divided into two parts. The C++ convertor, which is inherited from Yassid&#8217;s ATTPCroot and python analysis code. Between those two, there is also a python script converting the root tree data files into SQLite.<\/p>\n<p>The convertor and all other pyhton code needs to be installed differently.<\/p>\n<h2><a href=\"https:\/\/github.com\/tbjc1magic\/tbjcATTPCroot\">Convertor<\/a> :<\/h2>\n<p>The C++ part of the convertor converts a Raw binary data file to a Root tree file; then you need the python convertor to convert the Root tree file to a SQLite database.<\/p>\n<p><strong>Installation Requirements:\u00a0 <\/strong>Root&gt;6.xx, Boost, CMake, Linux environment, Python (Anaconda 2.x is recommended)<\/p>\n<p><strong>Installation steps:<\/strong><\/p>\n<p>### C++ part ###<\/p>\n<pre class=\"lang:default decode:true\"><span style=\"color: #808080\">to build:\r\nmkdir build\r\ncd build\r\ncmake ..\r\n<\/span><\/pre>\n<p>### python part ###<\/p>\n<pre class=\"lang-py prettyprint prettyprinted\"><span style=\"color: #808080\"><code>### download the Anaconda 2.x https:\/\/www.anaconda.com\/download\/#linux\r\nbash Anaconda-2.x.x-Linux-x86[_64].sh<\/code><\/span><\/pre>\n<p><strong>How to run:<\/strong><\/p>\n<p>There are two ways of running the program.<\/p>\n<ul>\n<li>single process: in the main folder, (the build\/example will only run in the main folder)<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\"><span style=\"color: #808080\">.\/build\/example &lt;root file name&gt; &lt;Binary file name&gt;  ## this convert binary data to root tree file\r\npython tbjcConvertor\/Convertor_sqlite.py &lt;root file name&gt; &lt;SQLite database name&gt; ## this convert the root tree file to SQLite database<\/span><\/pre>\n<ul>\n<li>multi process:<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \"><span style=\"color: #808080\">python mult.py<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Tested System:<\/strong><\/p>\n<p>Ubuntu 16.04.1 LTS<br \/>\nRed Hat Enterprise Linux Server release 7.4 (Maipo)<\/p>\n<p><strong>Multiprocess:<\/strong><\/p>\n<p>The C++ code is a single thread and process program, which can be paralleled (multiprocess) through the multi.py<\/p>\n<p>In multi.py, there are three variables need to be changed, all of the variables are <strong>RELATIVE DIRECTORY<\/strong><\/p>\n<p>parentPath: the relative directory of the parent folder of the <strong>DATA FOLDERS<\/strong>\u00a0of the raw binary<\/p>\n<p>SQLpath: where you want to store all your converted SQLite databases<\/p>\n<p>paths: all the data folders you want to convert<\/p>\n<p><strong>Analysis Part:<\/strong><\/p>\n<p>Ideally, the analysis part of the C++ code should be working, including\u00a0ATHoughTask,\u00a0ATPSATask,\u00a0ATAnalysisTask and\u00a0ATPhiRecoTask. However, it is not commonly used in my analysis work.<\/p>\n<p><strong>What&#8217;s different?<\/strong><\/p>\n<p>As mentioned in the ReadMe file, the FairRoot part and the Root TCloneArray, is completely faked. The fake classes only provide basic functions of iterating tasks and storing temporary variables. However, from my observation, all the analysis tasks should be functioning.<\/p>\n<h2><a href=\"https:\/\/github.com\/tbjc1magic\/tbjcATTPCanalyzor\">Analysis program<\/a> :<\/h2>\n<p>Though most of the programs are unfinished works, but they should give good insights of what the data look like.<\/p>\n<p>The most complete program is the VertexAnalyzer, which reconstruct the<\/p>\n<p><strong>Requirements:<\/strong><\/p>\n<p>besides built-in Anaconda packages, you will also need opencv2 and seaborn (mainly for visualizing, when debug option is on)<\/p>\n<pre class=\"lang:default decode:true \"><span style=\"color: #808080\">conda install -c menpo opencv\r\nconda install seaborn<\/span><\/pre>\n<p><strong>Tested System:<\/strong><\/p>\n<p>Ubuntu 16.04.1 LTS<br \/>\nRed Hat Enterprise Linux Server release 7.4 (Maipo)<\/p>\n<p><strong>Running:<\/strong><\/p>\n<p>under the main folder, run for the multi-process mode<\/p>\n<pre class=\"lang:default decode:true\"><span style=\"color: #808080\">python Multi.py<\/span><\/pre>\n<p>or run the jupyter notebook interactive mode<\/p>\n<pre class=\"lang:default decode:true\"><span style=\"color: #808080\">jupyter notebook<\/span><\/pre>\n<p>the Multi.py will produce a text file contains a list of ranges for reaction length.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally, I think I should write a instruction of using my code. The code is basically divided into two parts. The C++ convertor, which is inherited from Yassid&#8217;s ATTPCroot and python analysis code. Between those two, there is also a &hellip; <a href=\"https:\/\/sites.nd.edu\/attpc\/2017\/10\/11\/tbjcattpcroot-installation-instructions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2309,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[264463],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-attpcanalysis"],"_links":{"self":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/users\/2309"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":10,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":16,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/posts\/6\/revisions\/16"}],"wp:attachment":[{"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.nd.edu\/attpc\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}