MasterTasks =========== These classes serve as default settings for PandaRoot runs. They are steered by a prefix and option strings to keep the actual macros small and user-friendly. In the following part the available options are being described. In general the prefix manages the file name splitting between the stages. A prefix called ``"data/signal"`` will set up the chain to produce files in the folder ``data/``, relative to the current directory. These files will be called ``signal_sim.root``, ``signal_digi.root``, ``signal_rec.root`` & ``signal_pid.root``, depending on which stages are being written to separate files. Also all parameters for this run will be stored in ``signal_par.root`` in the same directory. Simulations Macro ~~~~~~~~~~~~~~~~~ Here is the simulation macro fromm ``macro/master``: .. literalinclude:: ../../macro/master/sim_complete.C :language: C++ :lines: 30-58 :caption: macro/master/sim_complete.C Quick Event Generator Setup --------------------------- There is an easy way to set the event generator by just a string. For detailed information on the event generators please refer to :ref:`eventgenerators` EvtGen Let the string end on ``.dec``, which should point to a valid decay file. One may append a resonance name in the form of ``:myResonance`` to specify where EvtGen should start off. By default the top resonance is searched for in the decay file. Background The standard generic background is provided by the FTF model, which is enabled by starting the string with ``ftf``. Similarly one can use DPM with ``dpm``. Particle Gun Starting the string with ``box`` enables a particle gun, which can be configured right within the string. Adding ``type(pdgcode,mult)`` specifies the particle type and number per event. Also the ranges for momentum (``p(min,max)``), theta (``tht(min,max)``), phi (``phi(min,max)``) and the starting point (``xyz(x,y,z)``) can be set. As an example this is a single pion with 1 GeV/c that covers the barrel of the detector: ``"box:type(211,1):p(1,1):tht(10,120):phi(0,360)"`` Pythia8 Starting the string with ``pythia8`` will allow to use Pythia8 as a generator. A list of parameters may be attached to this string, separated by ``;`` which will be passed to Pythia8. Without providing any option, by default ``SoftQCD:inelastic = on`` is set. ASCII file If an external generator produced an ASCII file in the EvtGen format, one can include that by a string like ``myFile.asc`` PIPI Generator The form of ``pipi:cosTheta(min,max)`` will enable this generator with some settings. Lepton Pair Generator Choosing a string in this form ``leplep:pid(value):gegm(value):cosTheta(min,max)`` enables the two lepton generator with its settings. If one needs a custom generator or setting, there is always the option to skip the ``fRun->SetGenerator();`` statement and attach the custom generator by ``fRun->AddGenerator(myGen)``. Event Filter ------------ There is the possibility to filter out events before even attempting the simulation. This may save a lot of computing time as well as storage, if one for example ignores background events which could never pass the analysis selection of the signal. Here is an example to have at least four charged particles in the event. .. code-block:: C++ TString generatorOptions = ""; fRun->SetGenerator(); // ----- Event filter setup ------------------------------------------- FairFilteredPrimaryGenerator *primGen = fRun->GetFilteredPrimaryGenerator(); primGen->SetVerbose(0); // ---- Example configuration for the event filter ------------------------ FairEvtFilterOnSingleParticleCounts* chrgFilter = new FairEvtFilterOnSingleParticleCounts("chrgFilter"); chrgFilter->AndMinCharge(4, FairEvtFilter::kCharged); primGen->AndFilter(chrgFilter); Beam & Target settings ---------------------- In the experiment the interaction region will be no ideal point at (0,0,0), but rather a distribution with a beam width and beam opening angle folded with the target material and residual gas along the beam line. Event generators are able to handle those and the MasterTasks feature a few preset settings, which are accessed by an integer setting. For analysis which look for a realistic setting please choose **TargetMode 4**. .. code-block:: C++ fRun->SetTargetMode(imode); **TargetMode 0** (default): - All events originate from (0,0,0) **TargetMode 1** - a cluster-jet sized beam-target region at the interaction zone - horizontal gaussian width of dx = 1 mm - FWHM length in beam direction of dz = 10 mm. - Target TDR, page 44 **TargetMode 2** - Pellet target sized beam-target at the interaction zone - horizontal gaussian width of dx = 3 mm - gaussian length in beam direction of dz = 3 mm. - At PANDA a beam diameter around 3mm is needed and one may want even smaller size when PTR is not possible. - Target TDR, page 61 **TargetMode 3** - Pellet beam-target at the interaction zone - horizontal gaussian width of dx = 0.2 mm - FWHM length in beam direction of dz = 0.2 mm. - A position resolution sigma(x, y, z) < 0.2 mm in the interaction position is desirable for event reconstruction. - Target TDR, page 61 **TargetMode 4** - Gaussian beam size of 2 mm - An opening of dr/dz=0.1 which matches the specifications of the "Fair Operation Modes" document v.6 (2020). The opening starts at the "edges" of the solenoid field, defined by the points of half field strength. - Realistic Target & rest gas density along the beam pipe (Apr. 2021) - ``input/restgasthickness_210421_Normal_IP_with_Cryopump.txt`` **TargetMode 5** - Gaussian beam size of 2 mm - An opening of dr/dz=0.1 which matches the specifications of the "Fair Operation Modes" document v.6 (2020) - A flat profile along the beam (``input/H_flatprofile.txt``) for development purposes **TargetMode 6** - No beam size distribution - A realistic profile along the beam (``input/restgasthickness_210421_Normal_IP_with_Cryopump.txt``) for development purposes **TargetMode 7** - No beam size distribution - A flat profile along the beam (``input/H_flatprofile.txt``) for development purposes Transport Model Options ----------------------- The transport model does calculation and simulation of the passage of particles through matter. GEANT4 should be the default and can be activated through setting a string: .. code-block:: C++ fRun->SetName("TGeant4"); In order to use GEANT3 as transport model, choose .. code-block:: C++ fRun->SetName("TGeant3"); Mind, that GEANT3 has a code base where the algorithms are not being actively developed since a ling time. For most applications this should suffice. Option String ------------- These options may be put in the option string. ``"phase1"`` Reduced setup for the whole Phase 1 of Panda, leaving out the RICH, the DISC ``"day1"`` Reduced detector setup for the first beam time, leaving out the RICH & the DISC, using only 2 GEM stations and a reduced FTS with stations 1-4. With further parts to the string one can change the Day1 setup. ``"strip"`` or ``"nopixels`` Removes the Pixel part of the MVD in the Day1 setup ``"gem0"`` or ``"nogem`` Removes the GEM detectors ``"gem3"`` Will extend the Day1 setup to feature the full 3 GEM stations ``"fts1256"`` Here the FTS stations 4-5 are missing, and stations 5-6 are added Digitization/Reconstruction Macro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here's the content of the default chain which reads the ``*_sim.root`` and produces directly a ``*_pid.root`` file. The option string handles the detector layout as well as which reconstruction algorithms are being used. .. literalinclude:: ../../macro/master/full_complete.C :language: C++ :lines: 6-35 :caption: macro/master/full_complete.C Digitization can be activated by ``fRun->AddDigiTasks(kFALSE);``, which digitizes the simulated data. The flag switches the persistency of the digitized data. For analysis runs this can be switched off, if the reconstruction will be performed within the same run. This saves some disk space. Local reconstruction, clustering and tracking is enabled by ``fRun->AddRecoTasks(kFALSE)``. Also here a persistency flag decides wether the intermediate data is written to the files. In the end the analysis object data is produced by ``fRunt->AddPidTasks()``. This should be stored to disk in most cases. In order to see which parts are being used in the digitization one may refer to the ``PndMasterDigiTask``, ``PndMasterRecoTask`` and ``PndMasterMultiPidTask`` classes. Option String for Digitization & Reconstruction ----------------------------------------------- These options may be put in an option string. For readability one should separate them, e.g. by semicolons. ``"day1"`` Reduced detector setup for the first beam time, leaving out the RICH digitization as well as the DISC PID ``"phase1"`` Reduced setup for the whole Phase 1 of Panda, leaving out the RICH digitization as well as the DISC PID ``"fakeonline"`` Emulating a worse tracking resolution by simple smearing of reconstructed tracks. ``"nogem"`` or ``"gem0"`` Deactivating the GEM processing as well as falling back to an older tracking code. ``"nomc"`` This option disables the ideal PID as well as the cloning of the MC truth tracks. ``"multikalman"`` This creates five times the tracking & PID chain for the hypotheses of the charged final state particle types ``"electron"``, ``"muon"``, ``"pion"``, ``"kaon"`` & ``"proton"``. Adding any combination of these particle type strings will restrict the reconstruction to those only, effectively speeding up the whole process. ``"genfit2"`` Using GenFit2 instead of the older version GenFit1 ``"newGF2"``` Using the new interface for GenFit2 with the faster Kalman algorithm instead of the older one. This feature will become the default in the next release. ``"stttracking"`` Fall back to an old track finding algorithm ``"ftsca"`` Use the CA tracking in the forward straws instead of ideal tracking. This feature will be discontinued with updated tracking code. ``"ftstrack"``` Use PndFtsTracking for the forward straws instead of ideal tracking. This feature will become the default in the next release. ``"goodtracks"`` Add some track preselection before the PID. For example a Lambda-Lambdabar channel analysis in Phase 1 of Panda could use this option string: ``"phase1;multikalman;pion;proton;genfit2"`` This will ensure optimal tracking and speed for the very different particle types.