This page describes the steps and tools needed to embed simulated single
particles into real DSTs for EMCal efficiency calculation. It basically
applies to Run-1 data but with minor modifications will be also perfectly
usable for Run-2 data. It supersedes the older Run-1 HOWTO.
In a general way, the embedding process includes the following steps described below:
-
SIMULATED DST PRODUCTION:
-
EXODUS: Generation of the PISA (ascii) input
file
-
PISA: Generation of (ROOT) PISA hits file
-
Response (camresp.* chain): Generation of simulated
PRDF
-
Reconstruction (preco): Generation of simulated DST
-
MERGING OF SIMULATED AND REAL DSTs:
-
Embedding and Evaluation (pdst-based code)
-
EFFICIENCY CALCULATION
Running interactively the whole chain described here in a RCF Pentium III biprocessor (1 GHz CPU), takes 1:30 per run (1600 events). The most time-consuming processes are by-far the generation of the PISA hits file (~30 min.) and the response (~30 min., without MVD very-slow response).
The process described here is roughly a written transcription of the
following C-shell scripts:
1. Whole merging chain: merge_chain.sh
2. Needed directory/files installation: merge_install.sh
3. EXODUS file generation: merge_exodus.sh
4. PISA hits file generation (B field on/off): merge_pisa_on.sh, merge_pisa_off.sh
5. Simul. PRDF generation: merge_respo.sh
6. Simul. DST generation: merge_reco.sh
7. QA of simul. DST: merge_qa.sh
8. Simul. + Real DST merging: merge_embedding.sh
1. SIMULATED DST PRODUCTION:
The current plans for last year data full efficiency calculations are
to produce a unique simulated DST per real DST (containing roughly the
same number of events, i.e. ~1600 evts/run) and for 3 different species: photon,
pi0 and eta (pbar and nbar would be potentially next in the list). The
list of total valid runs can be found here.
This makes more or less 3 x [1600 evts/real-run x 4300 real-runs] = 3 x
7.0E+06 single-particle events.
1.1. EXODUS: Generation of PISA single-particle input file:
-
Run (an EMCal-modified version of) R.
Averbeck's exodus_generate code
to output an ascii (OSCAR-compliant) file which contains 1600 single test-particle
events randomly generated within the following pT-y-phi and z-vertex distribution:
-
pT= 0.0 - 5.0 GeV/c (flat)
-
|y| < 0.38 (slightly larger than the real EMCal acceptance)
-
|phi| = 3 sectors (W0,W1 for PbSc, and E1 for PbGl).
-
|z_vtx| < 30 cm
-
The latest EMCal version of EXODUS single-particle executable and ancillary
files are: /afs/rhic/phenix/users/enterria/exodus/exodus_generate,/afs/rhic/phenix/users/enterria/exodus/defined_particles.txt
and
/afs/rhic/phenix/users/enterria/exodus/seeds.txt [The source files can be found in the same directory in case you want to customize EXODUS to fit your needings. The original (non-EMCal adapted) code is in CVS.]
-
Practical example: merge_exodus.sh
1.2. PISA: Generation of PISA hits file:
-
For last year data, we will run PISA with only 2 different sets of control
files corresponding to the (3600) magnetic field
ON runs and to the
(760) magnetic field
OFF runs:
-
PISA with magnetic-field OFF : "Zero
magnetic field, normal arms (run00b)" conditions are obtained via:
source
/afs/rhic/phenix/software/simulation/run00b/pisaBLinker.csh
on your working directory (*).
-
PISA with magnetic-field ON: "2D
magnetic field, normal arms (run00c)" conditions are obtained via:
source /afs/rhic/phenix/software/simulation/run00c/pisaCLinker.csh
onyour working directory (*).
(*) This will install all the files which PISA needs to perform the
simulation.
-
Due to the fact that in the current version of PISA in the repository,
the z-vertex coordinates of the EXODUS simulated event are not taken into
account (details
here) one needs a modified version of last year's PISA. A working binary
can be found here: /phenix/workarea/enterria/simulation/pisa2000-install/bin. To run this binary you need also to redefine your $ROOTSYS (to point to root-2.25-gcc2.95) and $LD_LIBRARY_PATH (to point the ROOT 2.25 libs and to /phenix/workarea/enterria/simulation/pisa2000-install/lib)
-
Run *this* version of PISA (./pisa),
enter the 3 usual carriage-returns and once you have your PISA prompt,
type:
PISA> text_file to select the
ascii output file of the single-particle event generator (which has to
be called, or soft-linked to, oscar.input)
PISA> ptrig 1600 (number of events
to simulate)
PISA> ...
PISA> exit (this is important,
because otherwise your hits file won't be closed ...)
-
The output of PISA is a typical PISAEvent.root
hits file.
-
Practical example: merge_pisa_on.sh, merge_pisa_off.sh
1.3. Response (campresp.* chain): Generation of simulated PRDF:
-
Install the official macros for PISA-to-PRDF production camrespRun.C,
camrespIni.C, and
camrespPar.C on your working directory (we use the macros corresponding
to Run01 because Run00 response macros are not fully working) via :
source /afs/rhic/phenix/software/simulation/run2a/respALinker.csh
-
You are now ready to run camrespRun.C:
root [] .x camrespRun.C(1600,1,1,"PISAEvent.root",0,0.0,"","","","","PISA.prdf","rawpar.root","rawrel.root",run-num);
root [] ...
-
We assign a run number to the simulated prdf file in order to: (i) Identify
it (i.e. know that it has been produced under the simulated experimental
conditions which correspond to the real run with the same number), and
(ii) be able later to assign to it the corresponding (run dependent) real
dead-maps.
-
The output of the response consists in the PISA.prdf
file plus 2 more files: rawrel.root, rawpar.root
. The rawrel file contains the GEANT relational tables including, among
others, the original test-particle input kinematics as well as the
ancestry
information of all potentially secondary and tertiary particles produced
from the original one in its way to the calorimeter (decays, conversions
...).
-
Practical example: merge_respo.sh
1.4. Reconstruction (preco): Generation of simulated DST:
-
Install the official present version of preco
in your working directory:
/afs/rhic/phenix/software/calibration/data/LuxorLinker.pl -1 your-run-num
-
I have modified emcfuncs.C of preco so that an additional analysis routine
is called during the process of PRDF-to-DST production. This function is
named AssignRealDeadMaptoSimulTowers()
and belongs to a new EMCal analysis module called mEmcEmbeddingModule
[this piece of code encapsulates a set of methods used in the present merging
analysis, can be found at /afs/rhic/phenix/users/enterria/emcal301/offline/framework/emc/, and will hopefully soon be part of the official CVS distribution].
As its name indicates, this function retrieves the QA objects (deadmaps)
of real data from the database and propagates them to each one of the simulated
towers (CDOs/Calibtowers) before the clustering process. Thus, the finally
produced simulated DST will contain data as close as possible to the real
data for our efficiency calculations.
-
Here you have a typical preco ROOT session (do setenv LD_LIBRARY_PATH /afs/rhic/phenix/users/enterria/installnew/lib:$LD_LIBRARY_PATH before, so that you can use the new mEmcEmbeddingModule):
root[] gSystem.Load("/afs/rhic/phenix/users/enterria/installnew/lib/libpreco.so");
root[] pfileopen("PISA.prdf");
root[] poutfileopen("SimulDST.root");
root[] setSimulationFlag();
root[] precoSelect::None();
root[] precoSelect::setBBC();
root[] precoSelect::setEMC();
root[] precoSelect::setPAD();
root[] precoSelect::List();
root[] prun(-1);
root[] pend();
root[] pexit();
Mind the Simulation flag,and the selection of EMCal, BBC and PAD as
our "relevant" subsystems (for gamma, pi0,eta analysis). The information of these subsystems will appear in the
final simulated DST (of course if one is interested in electrons or baryons
as test-particles, the selection of subsystems will differ).
-
The final output of this step is a simulated DST containing exactly the
same EMCal information as a real DST (Calibrated towers and Clusters).
-
A possible by-product of this step is also set of "quality histograms"
(to monitor the content of the produced DST) obtained running the official
QA code.
-
Practical example: merge_preco.sh (and merge_qa.sh)
2. MERGING AND EVALUATION:
- This last phase consists in taking each pair of real and simulated DSTs
(identified by their common run numbers), (1) merge them at the tower level,
(2) redo the clustering, (3) perform the evaluation and output the information
(in a PHENIX microDST-like style) that will be used for the final calculation
of the efficiency. This process is done by a new compiled program based in pdst.
A typical session using the embedding program looks like this:
root[] gSystem.Load("/afs/rhic/phenix/users/enterria/installnew/lib/libemcEmbed.so");
root[] dfileopen("RealDST.root");
root[] dfileopen2("SimulDST.root","rawrel.root");
root[] doutfileopen("output_file.root");
root[] setverbose(0)
root[] drun(-1);
root[] dexit();
- The embedding program source can be found here: offline/packages/emc-embed/.
- Importantly, the code performs a selection of the real and simulated
events before merging them. A part from "trivial" selections (e.g. trigger
in the real case or correct relational tables in the simulated one), the
program merges only events with a good (and compatible within 5 cm) simulated
and real vertices.
- The present version of the code proceeds through points (1) and (2)
above (merging + reclustering) and has a working implementation of
the evaluation and output information for PbGl (for PbSc this is under progress/discussion
now).
- A more detailed example of such a process can be seen here: merge_embedding.sh.
EMCal embedding practical details:
Back to my home page
/WWW/p/draft/enterria/ 
/WWW/publish/enterria/
enterria@in2p3.fr,
denterri@bnl.gov
Last modified: Tue Jul 6 16:50:00 EDT 2004