ALLPix / allpix

AllPix is a powerful tool for various simulation goals with pixel detectors, see the Twiki page for more details
https://twiki.cern.ch/twiki/bin/view/Main/AllPix
12 stars 29 forks source link

Eu tel conv #33

Closed KilianLohmann closed 7 years ago

KilianLohmann commented 7 years ago

Over a summer project at the University of Goettingen were I used Allpix generated data to analyse the reconstruction capabilities of the EUTelescope framework, I have created a converter in C++ that converts the frame and hits root files into the lcio format, hence getting both the raw hit pixel information as well as the position of the true simulated hits. The converter reads in the root files containing the frames and hits, and outputs a lcio file with a collection for the true hits called "true_hits", a collection for the Mimosa26 raw data "zsdata_m26", and a collection for the DUT raw data "zsdata_DUT". The source code is located in share/EUTelConverter/RootFileConverter.cc.

The cmakelist was changed to allow for the optional building of the converter alongside Allpix if the CMake option BUILD_EUTELCONV is set to ON (by default it is set to OFF). If this option is turned on, the converter will be build under the name EUTelConverter.

An additional commit was made to fix the FEI4 single chip number of pixels to 336 in the y-direction, as per the manual p. 9 https://indico.cern.ch/event/261840/contributions/1594374/attachments/462649/641213/FE-I4B_V2.3.pdf I don't know how to make this commit a seperate pull request, so it is included in this one.

To run the converter, the following command line options must be supplied in the following order:

"path and prefix to input root files" "path and filename of output lcio file" "number of Mimosa26 planes" "list of DUT sensor IDs"

"path and prefix to input root files" refers to the path to the folder containing the input root files, as well as their prefix. The prefix refers to the value given to /allpix/config/setOutputPrefixWithPath in the Allpix macro. If there is no prefix, i.e. this field is the path to a folder containing the root files, then this field must end with a / or it will be misinterpreted as a prefix.

"path and filename of output lcio file" refers to the path and file name of the lcio file output by the converter. Note that the file name does not need to end in .slcio, as the lcio writer adds this to the end of the filename automatically.

"number of Mimosa26 planes" refers to the number of Mimos26 planes used in the telescope setup. In the case where the telescope planes used in the setup are not Mimosa26 planes, then this filed should be set to 0, and the corresponding IDs of the telescope planes added to the list of DUT sensor IDs

"list of DUT sensor IDs" refers to a list (separated by spaces) of the sensor IDs of DUTs used in the setup. The ID corresponds to the detector ID of the chip defined in the Allpix macro.

For example, if I have run Allpix for 6 Mimosa26 sensors and 1 FEI4 single chip, with the field /allpix/config/setOutputPrefixWithPath set to “root_files/example” in the Allpix macro. I want to create a lcio file of the name “example.slcio” in the folder “lcio_files”. To run the converter I would input: EUTelConverter root_files/example lcio_file/example 6 200

If there are anymore questions, I can be contacted at kl417@cam.ac.uk. My direct supervisor for this project was Tobias Bisanz.

schuetzepaul commented 7 years ago

Hi Kilian,

I did see that just now. That could have saved me several hours of work :-) Just now I also pull-requested my first working version of an LCIO output.

I'm afraid your message does not fully appear. Can you try to share them again? Do I get it right, that the converter has to be run seperately from AllPix?

Well, I'm not a maintainer here, I'm just curious.. Maybe you (or rather Tobias) are also interested in checking out my solution on that, I've integrated the LCIO output into AllPix itself.

Cheers Paul

KilianLohmann commented 7 years ago

Hey Paul,

Thanks for the heads up, just updated the comment, so it should be fine now. My converter has to be run separately from Allpix, i.e. after the simulation is done. The advantage of this method is I guess that it does not need to be build and run for every Allpix installation, so won't affect people who don't need it. Although your method has the obvious advantage of being much more convenient if conversion is desired.

Best wishes, Kilian

schuetzepaul commented 7 years ago

Hi Kilian,

thanks for the quick reply. Probably it's nice to have both on board, so one can choose.

Cheers Paul