AIDA
GELINA
BRIKEN
nToF
CRIB
ISOLDE
CIRCE
nTOFCapture
DESPEC
DTAS
EDI_PSA
179Ta
CARME
StellarModelling
DCF
K40
nToF
Draft saved at 00:00:00
Fields marked with
*
are required
Entry time:
Tue Mar 25 20:23:45 2025
Author
*
:
Subject
*
:
<p>To run raw2root on LXPLUS, you will need to add the following line to your .bashrc, performed using</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>gedit ~/.bashrc &</em></strong></div> <p>then paste line at the bottome of the file</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/afs/cern.ch/user/n/ntofuser/public</em></strong></div> <p>then save and close the gedit (a linux text editor similar to Windows Notepad). Text file .bashrc is responsible for setting correct paths to various system settings when you log in. The line above sets correct libraries for raw2root from the n_TOF official directories.</p> <p> </p> <p>The old version of raw2root which I use is stored in a directory on EOS accessible via LXPLUS:</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>cd /eos/home-n/nsosnin/public/raw2root</em></strong></div> <p>If you examine the contents of the directory using command <strong><em>ls</em></strong>, there will be two folders: ntoflib and prg. The relative location of these folders on your system should always be the same, and you do not need to do anything in the ntoflib directory, so we can explore the next directory</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>cd prg && ls</em></strong></div> <p>Command cd means change directory and ls is list contents, double-& chains commands in a sequence. Your terminal should now display two more directories: detector and raw2root. detector is a list of codes for various detector types, examine its contents with <em><strong>ls detector</strong></em>. We use <em>MWDdetector.cc</em> and its library header file <em>MWDdetector.h</em>. All the filters are defined and can be changed in <em>MWDdetector.cc</em>, which is a C++ code. You can browse and change its contents with gedit. raw2root codes, however, are run from the raw2root directory, so let's change to it</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><em><strong>cd raw2root && ls</strong></em></div> <p>When you list the contents of this directory there will be many files, none of which you need to edit. There will also be a directory called Traces, which I created as the default location for signal traces to be written, if relevant sections of <em>MWDdetector.cc</em> are uncommented (discussed below). If you are happy with the contents of <em>MWDdetector.cc</em>, you need to re-compile raw2root. Using C++ code, unlike some others, is a two-step process: compilation and execution. Various bits of code in raw2root and its libraries are put together into one executable file called <em>raw2root</em> during compilation stage, and then the code can be run by executing the executable. To compile raw2root, you need to be in its directory, which you can check by typing in</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>pwd</em></strong></div> <p>which should then display <em>/eos/home-n/nsosnin/public/raw2root/prg/raw2root</em> and if you it displays something else, use</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>cd /eos/home-n/nsosnin/public/raw2root/prg/raw2root</em></strong></div> <p>To compile raw2root in this directory use</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><em><strong>make clean && make proper && make</strong></em></div> <p>The code will start compiling and do so for a while. It will display some warnings associated with other older n_TOF codes. There should, however, be no errors. If there are errors, something went wrong in MWDdetector.cc, so try troubleshooting it by Googling the errors (the line with the error will also display two numbers, something like <em>error: MWDdetector.cc:1211:45</em>, and the the second number is the line where the problem occurred). C++ errors are a dark art though, so feel free to contact me for help.</p> <p>If the compilation displays no errors (woo!), the code compiled successfully. To test it, two things are needed: UserInput file and .raw.finished file. UserInput file called <em>UserInput_Silicons.h</em>, which I use, is already stored in that directory. If you examine it with gedit, you will see lines with detector names and numbers and the filtering parameters. The parameters are read in at the top of <em>MWDdetector.cc</em> in order, so you can follow the variables they are read into throughout the code to figure out which parameter does what (this is not an easy task!).</p> <p>.raw.finished files are binary data files with detector signal traces, which raw2root filters and makes into ROOT files. These need to be downloaded from CERN servers (I left two example ones in the directory though). While the experiment is running these are stored, but will eventually be deleted, so if they don't download, contact me on staging data (i.e. writing it onto servers again after deletion). To download such a binary file for this experiment to the directory you are in use</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><em><strong>xrdcp xroot://eosctapublicdisk.cern.ch//eos/ctapublicdisk/archive/ntof/2023/EAR2/26Al_DSSSD/<span class="marker">216408</span>/stream1/run<span class="marker">216408</span>_<span class="marker">1</span>_s1.raw.finished .</strong></em></div> <p>Here, <em><strong>xrdcp</strong></em> command is CERN's own copying command, which takes data from the directory listed in the command. I have highlighted above in yellow the bits you may need to change in the command. The first two are simply run number. The last one is the data segment. n_TOF data within a run are subdivided into 20 proton bunch segments, so one such .raw.finished file that you download contains 20 bunches (which is a very small amount of data, so if you need mass_processing, contact me or Fran (francisco.garcia.infantes@cern.ch) at n_TOF). You can download different segments by changing this number. Bunches 1-20 are in segment 0, bunches 21-40 in segment 1, etc.</p> <p>Once you have downloaded the file of interest execute raw2root with command</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>./raw2root -p UserInput_Silicons.h -f run216408_1_s1.raw.finished -r <span class="marker">rootout.root</span></em></strong></div> <p>This will run for some time, applying settings from UserInput to filters in <em>MWDdetector.cc</em>, and running the filters over data in the .raw.finished file. This will produce an output file called <em>rootout.root</em>, but feel free to change the name in the command to whatever you like, otherwise you will just keep overwriting the old files. This output file will have the amplitudes, times etc. of all the extracted signals listed, but it will not produce traces, as that is not standard raw2root functionality, and requires my code, which I added to <em>MWDdetector.cc</em></p> <p>To print traces, open <em>MWDdetector.cc</em> using</p> <div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><strong><em>gedit ../detector/MWDdetector.cc &</em></strong></div> <p>Note, ".." on Linux means "previous directory", so the command above will leave raw2root directory, go to detector directory and open the code. In this code, uncomment (i.e. remove // or /* or */ characters in C++) from lines 310-312, 441, 442, 465 and 529. This will now print trace ROOT files into the Traces directory. Warning: this runs very slowly, as it's a lot of data being written to disk!</p> <p>The <em>if()</em> statment on line 465 allows you to gate on specific bunches and detectors for producing traces. The contents of histograms inside the output files can be understood in terms of what <em>MWDdetector.cc</em> does by reading the lines 514-522 of that code. This should be everything you need to get started with processing traces and filtering outputs. Good luck!</p>
Encoding
:
HTML
ELCode
plain
Suppress Email notification
Attachment 1:
Drop attachments here...
Draft saved at 00:00:00
ELOG V3.1.4-unknown