Warning, /eic.github.io/_software/eicsmear.md is written in an unsupported language. File is not indexed.
0001 ---
0002 title: Smearing with eic-smear
0003 name: eicsmear_1
0004 category: eicsmear
0005 layout: default
0006 ---
0007
0008 {% include layouts/title.md %}
0009
0010 * TOC
0011 {:toc}
0012
0013 ##### About #####
0014
0015 Currently hosted on
0016 [github](https://github.com/eic/eic-smear)
0017 and mirrored on [gitlab](https://gitlab.com/eic/eic-smear).
0018 Detailed installation instructions are in the
0019 [README.md](https://github.com/eic/eic-smear#building) file, but
0020 for most users it is recommended to use centrally installed or packaged versions,
0021 for example via
0022 {% include navigation/pagelink.md folder=site.software name='eicsmear_generators_singularity' tag='cvmfs' %} or {% include navigation/pagelink.md folder=site.software name='escalate_singularity_1' tag='ESCalate' -%}.
0023
0024 The parameterizations are in a
0025 [separate repository](https://github.com/eic/eicsmeardetectors)
0026 to facilitate local installation and experimentation, but they too are of course
0027 available centrally.
0028
0029 Contacts
0030 * Alexander Kiselev <ayk@bnl.gov>
0031 * Kolja Kauder <kkauder@bnl.gov>
0032
0033
0034 ##### Overview #####
0035
0036 Eic-smear is a Monte Carlo analysis package originally developed by the BNL EIC task force.
0037 It is designed for use with the [ROOT](https://root.cern/) analysis framework.
0038
0039 It contains classes and routines for:
0040 1. Building events in a C++ object and writing them to a ROOT file in a tree data structure.
0041 2. Performing fast detector smearing on those Monte Carlo events.
0042
0043 Both portions of the code are included in the ```libeicsmear``` shared library.
0044
0045
0046 ##### Tree Generation #####
0047 The tree-building portion processes plain text files, formatted according to
0048 the EIC convention, into a ROOT TTree containing events.
0049 A wide range of Monte Carlo generators are supported, including any that create HepMC2 or HepMC3 output.
0050 Gzipped files, detected by the ```.gz``` extension, can be directly used as well.
0051
0052 Most of these are currently hosted on [GitLab](https://gitlab.com/eic/mceg).
0053 Please see the associated documentation for further information on
0054 individual generators.
0055 Creation will typically be of the form
0056 ```bash
0057 pythiaeRHIC < STEER_FILE > out.log
0058 ```
0059 The output file name is specified in the steering card; the log file is needed
0060 to save cross section information.
0061 A few small example files are included for testing.
0062
0063 The basic command to generate a tree is
0064 ```
0065 root [] gSystem->Load("libeicsmear");
0066 root [] BuildTree ("pythia.txt.gz",".",-1, "log.txt");
0067 Processed 10000 events containing 346937 particles in 6.20576 seconds (0.000620576 sec/event)
0068 ```
0069
0070 Each entry in the TTree named EicTree is a single C++ event object,
0071 storing event-wise quantities common to all generators,
0072 generator-specific variables and a list of particle objects.
0073
0074 ##### Smearing #####
0075 The smearing portion of the code provides a collection of classes and routines
0076 that allow simple parameterizations of detector performance, provided via a
0077 ROOT script, to be applied to any of the above Monte Carlo
0078 events. Detector acceptance can also be defined. When run, a ROOT file with
0079 smeared events is produced.
0080
0081 ```
0082 root [] gSystem->Load("libeicsmear")
0083 root [] .L SmearMatrixDetector_0_1.cxx // Assuming you copied this here
0084 root [] SmearTree(BuildMatrixDetector_0_1(),"pythia.root", "smeared.root",-1)
0085 /-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/
0086 / Commencing Smearing of 10000 events.
0087 /-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-/
0088 ```
0089
0090 If you use the compiled collection ```libeicsmeardetectors```, a "nickname" functionality
0091 can be used instead.
0092
0093 ```
0094 root [] gSystem->Load("libeicsmear")
0095 root [] gSystem->Load("libeicsmeardetectors")
0096 root [] auto det = BuildByName("matrix01");
0097 root [] SmearTree( det,"pythia.root", "smeared.root",-1)
0098 ```
0099
0100 The output tree, called Smeared, will mirror the behavior of a true
0101 detector system, i.e. it will only contain entries for particles that
0102 were smeared (=measured), and only partial information if only parts
0103 were smeared. E. g., if only momentum is smeared, the energy field will be
0104 zero reflecting information gathered only by a tracker.
0105 Particles further have methods of the form
0106 ```c++
0107 bool psmeared = p->IsPSmeared();
0108 ```
0109 to differentiate between "not measured" and "measured as 0".
0110 In such a
0111 case, the analyzer can of course rely on the truth level, but a more
0112 realistic approach would be to make same kind of assumptions that one
0113 would have to make for a physical detector, such as assuming pion mass
0114 for all tracks baring PID information etc.
0115
0116 The smeared tree can be used by itself or linked to truth level information via
0117 the ["friend" mechanism in ROOT](https://github.com/eic/eicsmeardetectors#analyze-the-tree).
0118
0119
0120 For more details, examples, tests, please refer to the discussion in the [README](https://github.com/eic/eicsmeardetectors#basic-interactive-usage).
0121
0122 ##### Available Detectors #####
0123 The [detector repository](https://github.com/eic/eicsmeardetectors#official-parameterizations)
0124 has a variety of paramterizations, some of them quite old and mostly preserved for legacy reasons, and
0125 some of them semi-official variations of the official Yellow Report reference detector versions.
0126 Here, we will only highlight three official versions.
0127
0128 ##### Matrix 0.2 #####
0129
0130 Based on the [Detector Matrix](https://physdiv.jlab.org/DetectorMatrix) from November 21 2020.
0131 **This is the most up-to-date version released by the YR DWG**
0132 The implementation aims to be completely faithful (with perfect angular resolution) to the configuration available online.
0133
0134 Separate scripts are made for B=1.5T and B=3T, namely
0135 ```SmearMatrixDetector_0_2_B1_5T.cxx``` and ```SmearMatrixDetector_0_2_B3T.cxx```.
0136 Shortcut names for ```BuildByName``` are "MATRIXDETECTOR_0_2_B1_5T",
0137 "MATRIX_0_2_B1_5T", and MATRIX02B15" (and similar for 3T).
0138
0139 ###### Notes and details #####
0140 * Where ranges are given, the more conservative number is chosen.
0141
0142 * Without available specifications, angular resolution is assumed to be perfect.
0143
0144 * Momentum and energy acceptance specifications are NOT implemented
0145 1. "90% acceptance" is not specific enough to introduce efficiency
0146 2. It is not a priori clear whether cuts should apply to truth or smeared value
0147 A "looper" may not reach the detector. On the other hand, a calorimetry deposit may fluctuate above threshold. Users should implement this acceptance as an afterburner. Alternatively, if a consensus can be achieved about the above, it can be added to the script as well.
0148
0149 * PID for pi/K/p is (crudely) implemented with perfect PID in the acceptance (and momentum range) where >3σ separation is specified.
0150
0151 * Electron PID is not implemented. Very high purity is important and not handled well with the above approach
0152
0153
0154 ##### Matrix 0.1 #####
0155
0156 Based on the [Detector Matrix](https://physdiv.jlab.org/DetectorMatrix) from June 16.
0157 This version was used for large parts of the first YR draft but should be replaced by 0.2 going forward.
0158
0159 There have been three changes with respect to the
0160 {% include navigation/findlink.md name='eic_handbook_v1.2' title='Detector Requirements and R&D Handbook' -%}:
0161
0162 For the Backward Detector the Tracking Resolution column was updated as follows:
0163 * eta =-3.5 - -2.5: σp/p ~ 0.1%×p+2.0% -> σp/p ~ 0.1%⊕0.5%
0164 * eta=-2.5 - -2.0: σp/p ~ 0.1%×p+1.0% -> σp/p ~ 0.1%⊕0.5%
0165 * eta=-2.0 - -1.0: σp/p ~ 0.1%×p+1.0% -> σp/p ~ 0.05%⊕0.5%
0166
0167 Notably, all assumptions made in the previous Handbook script have been removed
0168 to be as faithful as possible to the matrix specifications.
0169
0170 The script name is ```SmearMatrixDetector_0_1.cxx``` and shortcut names for ```BuildByName```
0171 are "MATRIXDETECTOR_0_1", "MATRIX_0_1", and "MATRIX01".
0172
0173 ##### Handbook #####
0174 Based on the initial table on page 26 of the {% include navigation/findlink.md name='eic_handbook_v1.2' title='Detector Requirements and R&D Handbook' -%}. Since the handbook at the time was versioned 1.2, the script inherited this version number,
0175 but this does not indicate that it is "newer" than the matrix detectors.
0176 **You should use Matrix 0.2 instead.**
0177
0178 The script name is ```SmearHandbook_1_2.cxx``` and shortcut names for ```BuildByName```
0179 are "HANDBOOK_1_2" and "HANDBOOK".
0180
0181 ###### Notes and details #####
0182 Contrary to the matrix detctor scripts, I took some liberty where information was missing or incomplete:
0183 * All angular resolutions are assumed to be 1 mrad. While this may be a good guess
0184 for tracking, it is too optimistic for calorimetry.
0185 * "Reasonable" constant terms were added to EMCal resolutions.
0186 * A CMS-like barrel HCal was added.
0187 * Forward and backward HCals with values from DWG discussions was used (45% stochastic, 6% constant).