TWiki
>
CMS Web
>
TrackerSoftware
>
EmbedParticles
(revision 5) (raw view)
Edit
Attach
In the following we will generate manually a 'single kaon' event, which can be fed into OSCAR and ORCA. ---++ The HEPEVT ntuple structure OSCAR expects its input in an HBOOK ntuple with the following fields: <blockquote> <verbatim> Block HEPEVT: integer NEVHEP = event number integer NHEP = number of entries (particles, partons) integer ISTHEP(NHEP) = status code integer IDHEP(NHEP) = PDG identifier integer JMOHEP(2,NHEP) = position of 1st and 2nd mother integer JDAHEP(2,NHEP) = position of 1st and last daughter real PHEP(5,NHEP) = 4-momentum and mass (single precision in ntuple file) real VHEP(4,NHEP) = vertex xyz and production time (single precision in ntuple file), OSCAR do not care about this... Block MC_PARAM: integer IRNMCP = run number integer IEVMCP = event number (must equal to NEVHEP) real WGTMCP = event weight (1.0) real XSECN = cross section equivalent (1.0) integer IFILTER = filter pattern (0) integer NVRMCP = number of additional variables real VARMCP(NMXMCP) = list of additional variables </verbatim> </blockquote> ---++ Writing ntuples Writing such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program [[%ATTACHURL%/writehbook.f][writehbook.f]]. 1. Define the data blocks as Fortran COMMON's. 2. Create an ntuple with the =HROPEN= procedure (say _test.ntpl_), and define its structure with =HBNAME=. *Note:* ntuple's ID must be 100 (unpacked) or 101 (packed; a bit tricky). *Additonal note:* Ntuple variable names have to be in capital letters. Don't ask why... 3. Do a loop over the events, generate some particles, etc; at the end of the loop =call hfnt(ID)= 4. Close the ntuple. Compile the program with =g77 -c writehbook.f= and link with =g77 -o writehbook.run writehbook.o `cernlib packlib,mathlib`= This requires a running =g77= system with =cernlib= properly installed (on debian: =apt-get install cernlib=) Run the executable. Now the file _test.ntpl_ should contain the particles. You can test it by opening with PAW: <blockquote> <verbatim> h/file 0 test.ntpl 4096 n/print 101 n/plot 101.idhep </verbatim> </blockquote> TODO: this example program does not call Pythia to decay instable particles, but who cares anyway? We want now to control everything manually. ---++ Modify (extend) an existing ntuple In the previous section, we created a brand new ntuple containing our particles (a more common example is when the ntuple is generated by some fancy CMKIN routine). We can further tailor it, add or remove particles, change their properties etc. With an appropriate Fortran program (see [[%ATTACHURL%/extendhbook.f][extendhbook.f]]) read the original ntuple, do your modifications, and write out to an other ntuple. TODO: there _has_ to be a more elegant solution than just write out to a _second_ ntuple. Maybe =hropen(... 'U' ...)= ? ---++ Feed into OSCAR This note assumes that you have a properly installed OSCAR environment. Copy or symlink _test.ntpl_ into the OSCAR working directory (in my case, it's _OSCAR_3_9_9/src/Workspace_). Edit _oscarrc_: <blockquote> <verbatim> ... OutputDataSet = /System/sim/test EventNtplReader:NtplFileName = test.ntpl EventNtplReader:NtplID = 101 # or 100 if you generated unpacked ntuple ... </verbatim> </blockquote> Do the ritual =eval `scram run -sh`= (or =-csh=), and run =oscar -c oscarrc= This will produce a lot of _sim_ and _xml_ files (see [[ProduceSimulatedEvents][ProduceSimulatedEvents]]) ---++ Further readings [[http://cmsdoc.cern.ch/cmsoo/projects/CMKIN/index.html][CMKIN]] [[http://wwwasdoc.web.cern.ch/wwwasdoc/hbook_html3/hboomain.html][HBOOK Reference]] -- Main.GergelyPatay - 30 May 2006
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
f
extendhbook.f
r1
manage
3.7 K
2006-05-30 - 23:17
UnknownUser
f
writehbook.f
r1
manage
2.9 K
2006-05-25 - 09:46
UnknownUser
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r7
<
r6
<
r5
<
r4
<
r3
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r5 - 2006-05-30
-
GergelyPatay
CMS
Hungarian Academy of Sciences (MTA)
Wigner RCP
Department of High Energy Physics
CMS (CERN)
Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback