Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 27 to 27 | ||||||||
Added: | ||||||||
> > | Packed ntuple trick: jmohep(i)=mod(isthep(i),100)*4000*4000 + jmohep(1,i)*4000+jmohep(2,i) jdahep(i)=mod(isthep(j)/100,100)*4000*4000+jdahep(1,i)*4000+jdahep(2,i) | |||||||
Writing ntuplesWriting such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program writehbook.f.
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 49 to 49 | ||||||||
TODO: this example program does not call Pythia to decay instable particles, but who cares anyway? We want now to control everything manually. | ||||||||
Added: | ||||||||
> > |
Modify (extend) an existing ntupleIn 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 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. Maybehropen(... 'U' ...) ? | |||||||
Feed into OSCARThis note assumes that you have a properly installed OSCAR environment. | ||||||||
Line: 76 to 82 | ||||||||
HBOOK Reference![]() | ||||||||
Deleted: | ||||||||
< < | -- GergelyPatay - 08 Mar 2006 | |||||||
Added: | ||||||||
> > | -- GergelyPatay - 30 May 2006 | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 30 to 30 | ||||||||
Writing ntuplesWriting such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program writehbook.f.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
g77 -c writehbook.f and link with g77 -o writehbook.run writehbook.o `cernlib packlib,mathlib` |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Changed: | ||||||||
< < | In the following we will generate manually a 'single proton' event, which can be fed into OSCAR and ORCA. | |||||||
> > | In the following we will generate manually a 'single kaon' event, which can be fed into OSCAR and ORCA. | |||||||
The HEPEVT ntuple structureOSCAR expects its input in an HBOOK ntuple with the following fields: | ||||||||
Line: 14 to 14 | ||||||||
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) | ||||||||
Changed: | ||||||||
< < | real VHEP(4,NHEP) = vertex xyz and production time (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 | ||||||||
Changed: | ||||||||
< < | integer IEVMCP = event number real WGTMCP = event weight real XSECN = cross section equivalent integer IFILTER = filter pattern | |||||||
> > | 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
Writing ntuples | ||||||||
Changed: | ||||||||
< < | Writing such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program. | |||||||
> > | Writing such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program writehbook.f. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < | Compile the program with g77 -c test.f and link with g77 -o test.run test.o `cernlib packlib,mathlib` | |||||||
> > | 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. | ||||||||
Line: 43 to 43 | ||||||||
h/file 0 test.ntpl 4096 | ||||||||
Changed: | ||||||||
< < | n/print 100 n/plot 100.idhep | |||||||
> > | n/print 101 n/plot 101.idhep | |||||||
Line: 60 to 60 | ||||||||
... OutputDataSet = /System/sim/test EventNtplReader :NtplFileName = test.ntpl | ||||||||
Changed: | ||||||||
< < | EventNtplReader :NtplID = 100 | |||||||
> > | EventNtplReader :NtplID = 101 # or 100 if you generated unpacked ntuple | |||||||
... | ||||||||
Line: 77 to 77 | ||||||||
HBOOK Reference![]() | ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
The HEPEVT ntuple structureOSCAR expects its input in an HBOOK ntuple with the following fields: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) Block MC_PARAM: integer IRNMCP = run number integer IEVMCP = event number real WGTMCP = event weight real XSECN = cross section equivalent integer IFILTER = filter pattern integer NVRMCP = number of additional variables real VARMCP(NMXMCP) = list of additional variables Writing ntuplesWriting such an ntuple is straightforward in Fortran [TODO: C/C++ interface via cfortran.h], see the attached example program.
g77 -c test.f and link with g77 -o test.run test.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:
TODO: this example program does not call Pythia to decay instable particles, but who cares anyway? We want now to control everything manually.h/file 0 test.ntpl 4096 n/print 100 n/plot 100.idhep Feed into OSCARThis 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:Do the ritual... OutputDataSet = /System/sim/test EventNtplReader:NtplFileName = test.ntpl EventNtplReader:NtplID = 100 ... eval `scram run -sh` (or -csh ), and run oscar -c oscarrc
This will produce a lot of sim and xml files (see ProduceSimulatedEvents)
Further readingsCMKIN![]() ![]() |