diff --git a/README.md b/README.md index a663de0fb..5fd144213 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ LCIO ( **L**inear **C**ollider **I/O** ) is a persistency framework and event da ## Introduction LCIO is intended to be used in both simulation studies and analysis frameworks. Its light weight and portability makes it also suitable for use in detector R&D -testbeam applications. It provides a C++ and optionally a Java implementation with a common interface (API) - a Fortran interface to the C++ implementation also exists, -if built with ROOT, Python bindings are available . +testbeam applications. It provides a C++ and optionally a Java implementation with a common interface (API) - if built with ROOT, Python bindings are available . Using a common persistency format and event data model allows to easily share results and compare reconstruction algorithms. LCIO is used by almost all groups involved in linear collider detector studies and thus has become a de facto standard. diff --git a/cmake/manual.tex.in b/cmake/manual.tex.in index e9bdfa9cd..469680bb9 100644 --- a/cmake/manual.tex.in +++ b/cmake/manual.tex.in @@ -77,7 +77,6 @@ analysis frameworks. Its light weight and portability makes it also suitable for use in detector R\&D applications. It provides a C++ and a Java implementation with a common interface (API). -A Fortran interface to the C++ implementation is provided as well. This manual is intended for application developers that want to incorporate LCIO in their programs. This includes e.g. simulation developers as well as physicists that want to @@ -231,11 +230,6 @@ Both ways of building LCIO will create the following libraries and executables: lcio_event_counter stdhepjob - ./bin <-- f77 examples - anajob_F - simjob_F - recjob_F - \end{verbatim} @@ -310,8 +304,6 @@ This section gives an introduction on how to use LCIO. We describe the user inte provide some code examples. For most of the section we focus on Java and C++ as these are the main languages supported by LCIO. Thanks to the AID~\cite{ref_aid} tool Java and C++ hava an API which is generated from a common source and thus very similar. -The Fortran interface, implemented as a wrapper to the C++ implementation, is described -in \ref{f77api}. \subsection{Java and C++ API} \label{sec_api} Detailed documentation of the API is provided both for Java and C++ on the @@ -1009,16 +1001,13 @@ Of course if you use your own implementation of the EVENT interface you are also memory management.} - -\input{f77api} - \section{Real world examples} \label{realworld} -All the examples described above show how to use LCIO with Java, C++ and Fortran. They are build +All the examples described above show how to use LCIO with Java and C++. They are build with LCIO and provided as binaries in \verb#$LCIO/bin#. %$ We also provide some examples that show how to use LCIO with some common physiscs simulation and analysis packages, such as {\em Pythia, Root and AIDA (JAS)} in -\verb#$LCIO/examples/java[cpp,f77]#. +\verb#$LCIO/examples/java[cpp]#. %$ As these examples depend on external tools and libraries they are not build by default with LCIO. Please check the corresponding \verb$README$ files for instructions on how to build these examples: @@ -1037,23 +1026,6 @@ This Java example creates an AIDA file from an LCIO file with some histograms and an Ntuple. You can use any AIDA~\cite{ref_aida} compliant analysis tools for viewing the histograms, e.g. JAS3~\cite{ref_jas}. -\subsection{lciohbook (Fortran, Hbook)} \label{rwhbook} - -A Fortran example that creates an Hbook~\cite{ref_cernlib} file from an LCIO file with -some histograms to be analyzed with PAW~\cite{ref_cernlib}. - -\subsection{pythia (Fortran, Pythia)} \label{rwpythia} - -An ASCII file of generator output can be produced by the script \verb$pythiahepevt.sh$. -This script runs a Pythia~\cite{ref_pythia} job -using the Pythia routine {\bf PYHEPC} to fill the \verb$hepevt$ common block -and a modified version of {\bf LCWRITE} to create the ASCII file (is included in the script). To run this script -one has to provide \verb$cernlib$~\cite{ref_cernlib} 2002 or later. The script has to be modified if necessary -to provide a valid path to the \verb$cernlib$ libraries. \\ -The program {\bf PYSIMJOB} (\verb$pysimjob.F$) reads the ASCII file, fills the \verb$hepevt$ common -block, and writes a LCIO file which is read again in a second pass to fill the \verb$hepevt$ common -block. - \newpage %\begin{latexonly} @@ -1158,10 +1130,6 @@ See UTIL::LCStdHepRdr and EXAMPLES/stdhepjob.cc. %{\footnotesize \verbatiminput{../../../doc/lcio.xml} } %\newpage -\section{Summary of Fortran API Functions} \label{ftn_summary} - -\input{f77summary.tex} - \newpage % Create the reference section using BibTeX: diff --git a/src/latex/manual/f77api.tex b/src/latex/manual/f77api.tex deleted file mode 100644 index 6fb8683af..000000000 --- a/src/latex/manual/f77api.tex +++ /dev/null @@ -1,324 +0,0 @@ -%----------------------------------------- -% LCIO fotran wrapper manual -% -% $Id: f77api.tex,v 1.17 2004-09-24 16:14:46 hvogt Exp $ $Name: not supported by cvs2svn $ -% -%----------------------------------------- -\subsection{The Fortran Interface} \label{f77api} - -The Fortran API of LCIO is based on a set of wrapper functions to the -C++ implementation using "cfrotran.h" to create the correct Fortran name. - -The main idea is that we use integers in Fortran to represent pointers to -objects on the C++ side. There will be one wrapper function for every class method -of the implementation classes (namespaces IMPL and IO) plus two additional methods -to create and delete the object respectively. All functions that operate on objects, i.e. -all functions except for the creation functions (constructors) need as a first argument -the integer pointer to the particluar object. - -By using a unique naming convention the documentation of the C++ version of the API -can be utilized for the Fortran API as well. - -Moreover example code written in C++ can be translated into Fortran basically line by -line as far as LCIO is concerned -- of course language specific control structures -will have to be different. So even if you are only intereseted in using LCIO from Fortran -it is probably a good idea to read the above sections on Java and C++ as well to get some -insight into the general structure of LCIO. - - -\subsubsection{ Note} \label{f77note} -{\em The handling of pointers in Fortran {\bf\em must} be done carefully. -One has to ensure that pointers are always used in the right context. -Pointers of objects given back to C++ can not be checked by the language to be applicable. -In most cases of wrong pointer usage the execution of the executable will result in a -{\bf\em{ segmentation violation}}. -} - - -\subsubsection{Naming convention} -The following naming convention is used for the fortran wrapper functions to the -C++ implementation of LCIO: -\begin{itemize} - -\item{all function names start with {\bf lc}} - -\item{{\bf lc} is followed by a three letter acronym that uniquley identifies the -corresponding C++ class, e.g. {\bf evt} for LCEvent.} See table \ref{tab_f77} for a complete listing -(for the classes 'LCVec, STL vector' see in the {\bf first part of Appendix~\ref{ftn_summary} under utility}) - -\item{the function name ends on the full lowercased name of the class method, e.g. \\ - \verb$LCEventImpl::getRunNumber()$ becomes {\bf lcevtgetrunnumber() } } - -\item{the constructor and destructor of the class end on {\bf create} and {\bf delete} -respectively, eg. {\bf lcevtdelete()} } - -\item{All constants defined in \verb$Event::LCIO$ are defined as constants in Fortran with the -same name prepended by {\bf 'LCIO\_'}, e.g. the type name for MCParticles defined in C++ in -\verb$LCIO::MCPARTICLE$ is defined in a character constant in Fortran named -{\bf LCIO\_MCPARTICLE} (see the Fortran include file {\bf lciof77apiext.inc}).} - -\end{itemize} - -\begin{table} -\begin{center} -\begin{tabular}{|c|c|} -\hline -\rule[-5mm]{0mm}{10mm} C++ class & f77 acronym \\ \hline \hline - - CalorimeterHitImpl & cah \\ \hline - ClusterImpl & clu \\ \hline - LCCollectionVec & col \\ \hline - LCEventImpl & evt \\ \hline - LCGenericObjectImpl & gob \\ \hline - MCParticleImpl & mcp \\ \hline - LCObject (Vector) & obv \\ \hline - ParticleIDImpl & pid \\ \hline - ReconstructedParticleImpl & rcp \\ \hline - LCReader & rdr \\ \hline - LCRelationImpl & rel \\ \hline - LCRunHeaderImpl & rhd \\ \hline - LCRelationNavigator & rnv \\ \hline - SimCalorimeterHitImpl & sch \\ \hline - SimTrackerHitImpl & sth \\ \hline - TPCHitImpl & tph \\ \hline - TrackerHitImpl & trh \\ \hline - TrackImpl & trk \\ \hline - LCWriter & wrt \\ \hline \hline - - LCVec, STL vector & ??? \\ \hline - -\end{tabular} -\end{center} -\caption{Three letter acronyms for f77 wrapper functions.} -\label{tab_f77} -\end{table} - -Additional methods to handle string, int and float vectors from Fortran are provided\\ -for the user extension classes (LCIntVec, LCFloatVec, LCStringVec):\\ -{\bf lcivcgetlength()}, {\bf lcivcgetintat()} \\ -{\bf lcfvcgetlength()}, {\bf lcfvcgetfloatat()} \\ -{\bf lcsvcgetlength()}, {\bf lcsvcgetstringat()} \\ - -and for the stl vector class:\\ -{\bf intvectorgetlength()}, {\bf intvectorgetelement()} \\ -{\bf floatvectorgetlength()}, {\bf floatvectorgetelement()} \\ -{\bf stringvectorgetlength()}, {\bf stringvectorgetelement()} . \\ - -For strings the Fortran CHARACTER* declaration has to be large enough, otherwise the original -string is truncated.\\ -A Summary of all functions in the basic Fortran API is given in the first part of {\bf Appendix~\ref{ftn_summary} }. - - -\subsubsection{Extension of the Base Fortran API} \label{f77ext} - -An additional set of Fortran functions is provided for user convenience. These are higher level functions -that usually allow to access several attributes of data objects with one function call. -These functions are declared in \verb#$LCIO/src/f77/lciof77apiext.inc#, -%$ -and are summarized in the second part of {\bf Appendix~\ref{ftn_summary} }. - -Most Fortran programs for simulation use the \verb$hepevt$ common block. -Conversion functions from the LCIO MCParticle collection to the \verb$hepevt$ common block and vice versa -are also provided in the extended interface. See the example in \ref{rwpythia}. - -The wrapper functions for the {\bf LCParametersImpl} class are provided in the extension of the base Fortran API. -This class is related to the classes\\ -{\bf LCRunHeaderImpl, LCEventImpl, and LCCollectionVec}\\ - and has the methods\\ -{\bf setIntValues, setFloatValues, setStringValues, getIntKeys, getFloatKeys, getStringtKeys, -getIntValues, getFloatValues, and getStringValues} .\\ - -The set/get methods are performed by the wrapper fuctions: -\begin{verbatim} -lcsetparameters (class_name, class_pointer, method_name, key_name, vector_pointer) -lcgetparameters (class_name, class_pointer, method_name, key_name, vector_pointer) -\end{verbatim} -. \\ -The vector\_pointer is given to lcsetparameters and obtained from lcgetparameters and the vector content -may be set or obtained by the stl vector wrapper fuctions. - -Methods of the extended Fortran API can be used\\ - -to create the vectors for the user extension classes (LCIntVec, LCFloatVec, LCStringVec)\\ - {\bf lcintvectorcreate(...)} \\ - {\bf lcfloatvectorcreate(...)} \\ - {\bf lcstringvectorcreate(...)} \\ - -and to fetch the content of a vector\\ - {\bf lcgetintvector(...)} \\ - {\bf lcgetfloatvector(...)} \\ - {\bf lcgetstringvector(...)} \\ - -to create/delete the stl vectors having int, float, string, and pointer datamembers -(e.g needed for the setShape method in the ClusterImpl Class)\\ - {\bf intvectorcreate(...)} \\ - {\bf intvectordelete(...)} \\ - {\bf floatvectorcreate(...)} \\ - {\bf floatvectordelete(...)} \\ - {\bf stringvectorcreate(...)} \\ - {\bf stringvectordelete(...)} \\ - {\bf pointervectorcreate(...)} \\ - {\bf pointervectordelete(...)} \\ - -and to fetch the content of a vector\\ - {\bf getintvector(...)} \\ - {\bf getfloatvector(...)} \\ - {\bf getstringvector(...)} \\ - {\bf getpointervector(...)} \\ - -The parameters of the functions above are explained in -the the second part of {\bf Appendix~\ref{ftn_summary} } -(The extended Fortran API to LCIO). - -\subsubsection{Reading and writing LCIO files} - -Examples for reading and writing LCIO files can be found in: -\begin{verbatim} - src/f77 - simjob.F - recjob.F - anajob.F -\end{verbatim} -To build these examples, do: -\begin{verbatim} - gmake -C src/f77 -\end{verbatim} - -These examples correspond to that provided in \verb#$LCIO/src/cpp/src/EXAMPLE# for C++. \\ - -The complete interface is declared in the include file \verb#$LCIO/src/f77/lciof77api.inc#. -%$ -A simple example for reading an LCIO file with Fortran is: - -\begin{verbatim} - ... -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - PTRTYPE reader, event, runhdr - integer status, irun, ievent - - reader = lcrdrcreate() - status = lcrdropen( reader, 'simjob.slcio' ) - - if( status.eq.LCIO_ERROR) then - goto 99 - endif - - do - event = lcrdrreadnextevent( reader ) - if( event.eq.0 ) goto 11 - - status = lcdumpevent( event ) - enddo - 11 continue - ... -\end{verbatim} -The function \verb$lcdumpevent(event)$ is part of the extended interface described in \ref{f77ext}. -Note that all functions that operate on existing objects have as a first argument the integer pointer -to this particluar object. -All functions that do not return a pointer to an object do return a status word instead that can be -compared to \verb$LCIO_ERROR$ (\verb$LCIO_SUCCESS$). - -An example how to write a LCIO file from Fortran is: - -\begin{verbatim} - ... - writer = lcwrtcreate() - status = lcwrtopen( writer, filename , LCIO_WRITE_NEW ) - - ... - do iev = 1,nev - - event = lcevtcreate() - - status = lcevtsetrunnumber( event, irun ) - status = lcevtseteventnumber( event, iev ) - - schcol = lccolcreate( LCIO_SIMCALORIMETERHIT ) - - do k=1,nhit - - hit = lcschcreate() - status = lcschsetcellid0( hit, 1234 ) - status = lcschsetenergy( hit, energy ) - - status = lccoladdelement( schcol, hit ) - enddo - - status = lcwrtwriteevent( writer , event ) - -c------- need to delete the event as we created it - status = lcevtdelete( event ) - - enddo - - status = lcevtaddcollection(event,schcol ,'MyCalHits') - - status = lcwrtclose( writer ) - ... -\end{verbatim} - -Note that as in the C++ case we have to delete the event if we created it as described in \ref{cppmem}. \\ - -\subsubsection{Using a C++ RunEventProcessor class for LCIO files processing in Fortran} - -A RunEventProcessor class is added to the Fortran API. To use it a wrapper function {\bf lcrdreventprocessor} -is provided which has to be called as: -\begin{verbatim} -... -#include "lciof77api.inc" - integer lcrdreventprocessor, status - character*30 filenamesin(3) - character*30 filenameout - PTRTYPE writer, pv - common /outinfo/ writer -... - filenamesin(1) = 'simjob_f1.slcio' - filenamesin(2) = 'simjob_f2.slcio' - filenamesin(3) = 'simjob_f3.slcio' - filenameout = 'recjob_f.slcio' -*** create writer, open output file - writer = lcwrtcreate() - status = lcwrtopen( writer, filenameout , LCIO_WRITE_NEW ) -*** create a stringvector of input file names - pv = lcstringvectorcreate( filenamesin, 3, len (filenamesin(1)) -*** create reader, open input file chain, start event loop - status = lcrdreventprocessor( pv ) -... - subroutine processrunheader ( pheader ) - PTRTYPE pheader -*** some code if wanted, e.g. - status = lcdumprunheader ( pheader ) - end - - subroutine modifyrunheader ( pheader ) - PTRTYPE pheader -*** some code if wanted - end - - subroutine processevent ( pevent ) - PTRTYPE pevent -*** some code if wanted - end - - subroutine modifyevent ( pevent ) -#include "lciof77api.inc" - PTRTYPE pevent - PTRTYPE writer - common /outinfo/ writer -... -*** some code if wanted -* -*** write event - status = lcwrtwriteevent ( writer, pevent ) -... - - end -\end{verbatim} - -The 4 subroutines {\bf processrunheader, modifyrunheader, processevent, and modifyevent} must be provided if -the wrapper function {\bf lcrdreventprocessor} is used. They are called via the LCRunListener, LCEventListener classes. -As an expample the code in \verb#$LCIO/src/f77/recjob.F# may be looked at. -The function \verb$lcdumprunheader(pheader)$ is part of the extended interface described in \ref{f77ext}. - diff --git a/src/latex/manual/f77summary.tex b/src/latex/manual/f77summary.tex deleted file mode 100644 index e7bd75935..000000000 --- a/src/latex/manual/f77summary.tex +++ /dev/null @@ -1,550 +0,0 @@ - -{\large\bf The basic Fortran API to LCIO} \\ - -\begin{scriptsize} - -{\bf Remarks:} \\ - -The return value of the functions and the meaning of arguments are either: \\ -$*$ pointers denoted by a name beginning with the {\bf letter p} \\ -$*$ character strings denoted by {\bf ...name} or {\bf string} \\ -$*$ logicals denoted by {\bf bool} \\ -$*$ integers denoted by {\bf status} or a variable name starting with {\bf i} or {\bf n}\\ -$*$ long integers (INTEGER*8) denoted by {\bf ilong}\\ -$*$ double precision variables name starting with {\bf d} \\ -$*$ reals {\bf else} -$*$ arrays are denoted by a name ending with {\bf v} \\ - - -\begin{verbatim} - -class LCReader: - -create -> preader = lcrdrcreate() -delete -> status = lcrdrdelete( preader ) -open -> status = lcrdropen( preader, filename ) -close -> status = lcrdrclose( preader ) -readStream -> status = lcrdrreadstream( preader, nmax ) -readNextRunHeader -> pheader = lcreadnextrunheader( preader, iaccessmode ) -readNextEvent -> pevent = lcrdrreadnextevent( preader, iaccessmode ) -readEvent -> pevent = lcrdrreadevent( preader, irun, ievt ) - -RunEventProcessor (includes registerLCEventListener, registerLCRunListener) - -> status = lcrdreventprocessor( filename ) - -class LCWriter: - -create -> pwriter = lcwrtcreate() -delete -> status = lcwrtdelete( pwriter ) -open -> status = lcwrtopen( pwriter, filename, imode ) -close -> status = lcwrtclose( pwriter ) -writeRunHeader -> status = lcwrtwriterunheader( pwriter, pheader ) -writeEvent -> status = lcwrtwriteevent( pwriter, pevent ) - - -class LCRunHeader: - -create -> pheader = lcrhdcreate() -delete -> status = lcrhddelete( pheader ) -setRunNumber -> status = lcrhdsetrunnumber( pheader ) -setDetectorName -> status = lcrhdsetdetectorname( pheader , detname) -setDescription -> status = lcrhdsetdescription( pheader , descrstring ) -addActiveSubdetector -> status = lcrhdaddactivesubdetector( pheader , sdname ) - -getRunNumber -> irun = lcrhgetrunnumber( pheader ) -getDetectorName -> detname = lcrhdgetdetectorname( pheader ) -getDescription -> string = lcrhdgetdescription( pheader ) - -getActiveSubdetectors by: -getActiveSubdetectors -> psdvec = lcrhdgetactivesubdetectors( pheader ) -getNumberOfElements -> nelem = lcsvcgetlength( psdvec ) (stl vector Interface) -getElementAt -> sdname = lcsvcgetstringat( psdvec , i ) (i=1,...,nelem) (stl vector Interface) - - -class LCEvent: - -create -> pevent = lcevtcreate() -delete -> status = lcevtdelete( pevent ) -setRunNumber -> status = lcevtsetrunnumber( pevent , irun) -setEventNumber -> status = lcevtseteventnumber( pevent , ievt) -setDetectorName -> status = lcevtsetdetectorname( pevent , detname) -setTimeStamp -> status = lcevtsettimestamp( pevent , ilong) -addCollection -> status = lcevtaddcollection( pevent , pcol , colname) -removeCollection -> status = lcevtremovecollection( pevent , colname) - -getRunNumber -> irun = lcevtgetrunnumber( pevent ) -getEventNumber -> ievt = lcevtgeteventnumber( pevent ) -getDetectorName -> detname = lcevtgetdetectorname( pevent ) -getTimeStamp -> ilong = lcevtgettimestamp( pevent ) -getCollection -> pcol = lcevtgetcollection( pevent , colname) - -getCollectionNames by: -getCollectionNames -> pstv = lcevtgetcollectionnames( pevent ) -getNumberOfElements -> nelem = lcsvcgetlength( pstv ) (stl vector Interface) -getElementAt -> colname = lcsvcgetstringat( pstv , i ) (i=1,...,nelem) (stl vector Interface) - - -class LCCollection: - -create -> pcol = lccolcreate( colname ) -delete -> status = lccoldelete( pcol ) -addElement -> status = lccoladdelement( pcol , pobject) -removeElementAt -> status = lccolremoveelementat ( pcol , i ) -setFlag -> status = lccolsetflag( pcol , iflag ) -setTransient -> status = lccolsettransient( pcol , bool ) (bool=true,false) - -getTypeName -> name = lccolgettypename( pcol ) -getNumberOfElements -> number = lccolgetnumberofelements( pcol ) -getElementAt -> pobject = lccolgetelementat( pcol , i ) (i=1,...,number) -getFlag -> iflag = lccolgetflag( pcol ) -isTransient -> bool = lccolistransient( pcol ) - - -class LCRelation, LCObject: - -create (defaults) -> prel = lcrelcreate0() -create -> prel = lcrelcreate( pobjectfrom , pobjectto, weight ) -delete -> status = lcreldelete( prel ) -setFrom -> status = lcrelsetfrom( prel, pobjectfrom ) -setTo -> status = lcrelsetto( prel, pobjectto ) -setWeight -> status = lcrelsetweight( prel, weight ) - -id -> id = lcrelid( prel ) -getFrom -> pfrom = lcrelgetfrom( prel ) -getTo -> pto = lcrelgetto( prel ) -getWeight -> weight = lcrelgetweight( prel ) - -getLength -> nelem = lcobvgetlength( pobjv ) (pobjv = pfrom, pto) -getObject -> id = lcobvgetobject( pobjv , i ) (i=1,...,nelem) -getObjectID -> id = lcobvgetobjectid( pobjv , i ) (i=1,...,nelem) -getWeight -> weight = lcobvgetweight( pobjv , i ) (i=1,...,nelem) - - -class LCRelationNavigator: - -create -> prnv = lcrnvcreate( fromname, toname ) -create (from col) -> prnv = lcrnvcreatefromcollection( pcol ) -delete -> status = lcrnvdelete() -addRelation -> status = lcrnvgaddrelation( prel, pobjectfrom , pobjectto, weight ) -removeRelation -> status = lcrnvgremoverelation( prel, pobjectfrom , pobjectto ) -createLCCollection -> pcol = lcrnvcreatecollection( prel ) - -getFromType -> namefr = lcrnvgetfromtype( prnv ) -getToType -> nameto = lcrnvgettotype( prnv ) -getRelatedToObjects -> pobjvto = lcrnvgetrelatedtoobjects( prnv, pobj ) -getRelatedFromObjects -> pobjvfr = lcrnvgetrelatedfromobjects( prnv, pobj ) -getRelatedToWeights -> pweightv= lcrnvgetrelatedtoweights( prnv, pobj ) -getRelatedFromWeights -> pweightv= lcrnvgetrelatedfromweights( prnv, pobj ) - - - -class LCGenericObject: - -create -> pgob = lcgobcreate() -create (dimensions) -> pgob = lcgobcreatefixed( nint, nfloat, ndouble ) -delete -> status = lcgobdelete( pgob ) -setIntVal -> status = lcgobsetintval( pgob, i, ival ) -setFloatVal -> status = lcgobsetfloatval( pgob, i, fval ) -setDoubleVal -> status = lcgobsetdoubleval( pgob, i, dval ) - -id -> id = lcgobid( pgob ) -getNInt -> nint = lcgobgetnint( pgob ) -getNFloat -> nfloat = lcgobgetnfloat( pgob ) -getNDouble -> ndouble = lcgobgetdoubleval( pgob ) -getIntVal -> ival = lcgobgetintval( pgob , i ) (i=1,...,nint) -getFloatVal -> fval = lcgobgetfloatval( pgob , i ) (i=1,...,nfloat) -getDoubleVal -> dval = lcgobsetdoubleval( pgob , i ) (i=1,...,ndouble) -isFixedSize -> bool = lcgobisfixedsize( pgob ) -getTypeName -> name = lcgobgettypename( pgob ) -getDataDescription -> string = lcgobgetdatadescription( pgob ) - - -class SimTrackerHit: - -create -> pthit = lcsthcreate() -delete -> status = lcsthdelete( pthit ) -setCellID -> status = lcsthsetcellid( pthit , icellid ) -setPosition -> status = lcsthsetposition( pthit , dposv ) -setdEdx -> status = lcsthsetdedx( pthit , fdedx ) -setEDep -> status = lcsthsetedep( pthit , fedep ) -setTime -> status = lcsthsettime( pthit , ftime ) -setMCParticle -> status = lcsthsetmcparticle( pthit , pmcp ) -setMomentum -> status = lcsthsetmomentum( pthit , fpv ) -setMomentumXYZ -> status = lcsthsetmomentumxyz( pthit , px, py, pz ) -setPathLength -> status = lcsthsetpathlength( pthit , pathl ) - -getCellID -> icellid = lcsthgetcellid( pthit ) -getPosition -> dposv(i)= lcsthgetposition( pthit , i ) (i=1,2,3) -getMomentum -> fpv(i) = lcsthgetmomentum( pthit , i ) (i=1,2,3) -getPathLength -> pathl = lcsthgetpathlength ( pthit ) -getdEdx -> fdedx = lcsthgetdedx( pthit ) -getEDep -> fedep = lcsthgetedep( pthit ) -getTime -> ftime = lcsthgettime( pthit ) -getMCParticle -> pmcp = lcsthgetmcparticle( pthit ) - - -class SimCalorimeterHit: - -create -> pschit = lcschcreate() -delete -> status = lcschdelete( pschit ) -setCellID0 -> status = lcschsetcellid0( pschit , icellid0 ) -setCellID1 -> status = lcschsetcellid1( pschit , icellid1 ) -setEnergy -> status = lcschsetenergy( pschit , energy ) -setPosition -> status = lcschsetposition( pschit , posv ) -addMCParticleContr.. -> status = lcschaddmcparticlecontribution( pschit , pmcp , energy , time , ipdg ) - -id -> id = lccahid( pschit ) -getCellID0 -> icellid0= lcschgetcellid0( pschit ) -getCellID1 -> icellid1= lcschgetcellid1( pschit ) -getEnergy -> energy = lcschgetenergy( pschit ) -getPosition -> status = lcschgetposition( pschit , posv ) -getNMCParticles -> number = lcschgetnmcparticles( pschit ) -getParticleCont -> pmcp = lcschgetparticlecont( pschit , i ) (i=1,...,number) -getEnergyCont -> energy = lcschgetenergycont( pschit , i ) (i=1,...,number) -getTimeCont -> time = lcschgettimecont( pschit , i ) (i=1,...,number) -getPDGCont -> ipdg = lcschgetpdgcont( pschit , i ) (i=1,...,number) - - -class CalorimeterHit: - -create -> pchit = lccahcreate() -delete -> status = lccahdelete( pchit ) -setCellID0 -> status = lccahsetcellid0( pchit , icellid0 ) -setCellID1 -> status = lccahsetcellid1( pchit , icellid1 ) -setEnergy -> status = lccahsetenergy( pchit , energy ) -setPosition -> status = lccahsetposition( pchit , posv ) -setTime -> status = lccahsettime( pchit , time ) -setType -> status = lccahsettype( pchit , itype ) -setRawHit -> status = lccahsetrawhit( pchit , praw ) - -id -> id = lccahid( pchit ) -getCellID0 -> icellid0= lccahgetcellid0( pchit ) -getCellID1 -> icellid1= lccahgetcellid1( pchit ) -getEnergy -> energy = lccahgetenergy( pchit ) -getPosition -> status = lccahgetposition( pchit , posv ) -getTime -> time = lccahgettime( pchit ) -getType -> itype = lccahgettype( pchit ) -getRawHit -> prawhit = lccahsetrawhit( pchit ) - - -class TPCHit: - -create -> pthit = lctphcreate() -delete -> status = lctphdelete( pthit ) -setCellID -> status = lctphsetcellid( pthit , icellid ) -setTime -> status = lctphsettime( pthit , time ) -setCharge -> status = lctphsetcharge( pthit , charge ) -setQuality -> status = lctphsetquality( pthit , iquality ) -setRawData -> status = lctphsetrawdata( pthit , irawv, nraw ) - -id -> id = lctphid( pthit ) -getCellID -> icellid = lctphgetcellid( pthit ) -getTime -> time = lctphgettime( pthit ) -getCharge -> charge = lctphgcharge( pthit ) -getQuality -> iquality= lctphgetquality( pthit ) -getNRawDataWords -> nraw = lctphgetnrawdatawords( pthit ) -getRawDataWord -> iword = lctphgetrawdataword( pthit, i ) (i=1,...,nraw) - - -class TrackerHit: - -create -> ptrhit = lctrhcreate() -delete -> status = lctrhdelete( ptrhit ) -setPosition -> status = lctrhsetposition( ptrhit, dposv ) -setCovMatrix -> status = lctrhsetcovmatrix( ptrhit, covmxv ) -setdEdx -> status = lctrhsetdedx( ptrhit , dedx ) -setEDep -> status = lctrhsetedep( ptrhit , edep ) -setEDepError -> status = lctrhsetedeperr( ptrhit , error ) -setTime -> status = lctrhsettime( ptrhit, time ) -setType -> status = lctrhsettype( ptrhit, itype ) -setQuality -> status = lctrhsetquality( ptrhit , iquality ) -addRawHit -> status = lctrhaddrawhit( ptrhit, prawh ) - -id -> id = lctrhid( ptrhit ) -getPosition -> status = lctrhgetposition( ptrhit, dposv ) -getCovMatrix -> status = lctrhsetcovmatrix( ptrhit, covmxv ) -getdEdx -> dedx = lctrhgetdedx( ptrhit ) -getEDep -> edep = lctrhgetedep( ptrhit ) -getEDepError -> edeperr = lctrhgetedeperr( ptrhit ) -getTime -> time = lctrhgettime( ptrhit ) -getType -> itype = lctrhgettype( ptrhit ) -getQuality -> iquality= lctrhgetquality( ptrhit ) -getRawHits -> prawhv = lctrhgetrawhits( ptrhit ) - - -class Track: - -create -> ptrk = lctrkcreate() -delete -> status = lctrkdelete( ptrk ) -setTypeBit -> status = lctrksettypebit( ptrk, ibit, ival) -setOmega -> status = lctrksetomega ( ptrk, omega ) -setTanLambda -> status = lctrksettanlambda( ptrk, tanlambda ) -setPhi -> status = lctrksetphi( ptrk, phi ) -setD0 -> status = lctrksetd0( ptrk, d0 ) -setZ0 -> status = lctrksetz0( ptrk, z0 ) -setCovMatrix -> status = lctrksetcovmatrix( ptrk, covmxv ) -setReferencePoint -> status = lctrksetreferencepoint( ptrk, refpointv ) -setChi2 -> status = lctrksetchi2( ptrk, chi2 ) -setNdf -> status = lctrksetndf( ptrk, ndf ) -setdEdx -> status = lctrksetdedx( ptrk, dedx ) -setdEdxError -> status = lctrksetdedxerror( ptrk, dedxerr ) -setNholes -> status = lctrksetnholes( ptrk, nholes ) -setRadiusOfInnermostHit-> status = lctrksetradiusofinnermosthit( ptrk, radius) -addTrack -> status = lctrkaddtrack( ptrk, ptrack ) -addHit -> status = lctrkaddhit( ptrk, phit ) -subdetectorHitNumbers -> status = lctrksetsubdetectorhitnumbers( ptrk, intv, nintv) (not in C++ API) -subdetectorHoleNumbers -> status = lctrksetsubdetectorholenumbers( ptrk, intv, nintv) (not in C++ API) - -id -> id = lctrkid( ptrk ) -getType -> itype = lctrkgettype( ptrk ) -getOmega -> omega = lctrkgetomega( ptrk ) -getTanLambda -> tanlam = lctrkgettanlambda( ptrk ) -getPhi -> phi = lctrkgetphi( ptrk ) -getD0 -> d0 = lctrkgetd0( ptrk ) -getZ0 -> z0 = lctrkgetz0( ptrk ) -getCovMatrix -> status = lctrkgetcovmatrix( ptrk, covmxv ) -getReferencePoint -> status = lctrkgetreferencepoint( ptrk, refpointv ) -getChi2 -> chi2 = lctrkgetchi2( ptrk ) -getNdf -> ndf = lctrkgetndf( ptrk ) -getdEdx -> dedx = lctrkgetdedx( ptrk ) -getdEdxError -> dedxerr = lctrkgetdedxerror( ptrk ) -getNholes -> nholes = lctrkgetnholes( ptrk ) -getRadiusOfInnermostHit-> radius = lctrkgetradiusofinnermosthit( ptrk ) -subdetectorHitNumbers -> status = lctrkgetsubdetectorhitnumbers( ptrk, intv, nintv) -subdetectorHoleNumbers -> status = lctrkgetsubdetectorholenumbers( ptrk, intv, nintv) -getTracks -> ptrackv = lctrkgettracks( ptrk ) -getTrackerHits -> ptrhitv = lctrkgettrackerhits( ptrk ) - - -class Cluster: - -create -> pclu = lcclucreate() -delete -> status = lccludelete( pclu ) -setTypeBit -> status = lcclusettypebit( pclu, ibit, ival) -setEnergy -> status = lcclusetenergy( pclu, energy ) -setPosition -> status = lcclusetposition( pclu, posv ) -setPositionError -> status = lcclusetpositionerror( pclu, poserrv ) -setITheta -> status = lcclusetitheta( pclu, theta ) -setIPhi -> status = lcclusetiphi( pclu, phi ) -setDirectionError -> status = lcclusetdirectionerror( pclu, direrrv ) -setShape -> status = lcclusetshape( pclu, pshapev ) -addParticleID -> status = lccluaddparticleid( pclu, ppid ) -addCluster -> status = lccluaddcluster( pclu, pcluadd ) -addHit -> status = lccluaddhit( pclu, pcalhit, weight ) -setsubdetectorEnergies -> status = lcclusetsubdetectorenergies( pclu, energiesv, nenergies) (not in C++ API) - -id -> id = lccluid( pclu ) -getType -> itype = lcclugettype( pclu ) -getEnergy -> energy = lcclugetenergy( pclu ) -getPosition -> status = lcclugetposition( pclu, posv ) -getPositionError -> status = lcclugetpositionerror( pclu, poserrv ) -getITheta -> theta = lcclugetitheta( pclu, theta ) -getIPhi -> phi = lcclugetiphi( pclu, phi ) -getDirectionError -> status = lcclugetdirectionerror( pclu, direrr ) -getShape -> pshapev = lcclugetshape( pclu ) -getParticleIDs -> ppidvec = lcclugetparticleids( pclu ) -getClusters -> pcluget = lcclugetclusters( pclu ) -getCalorimeterHits -> pcalhv = lcclugetcalorimeterhits( pclu ) -getSubdetectorEnergies -> pfloatv = lcclugetsubdetectorenergies( pclu ) -getHitContributions -> status = lcclugethitcontributions( pclu, energiesv, nenergies) (not in C++ API) - - - -class ReconstructedParticle: - -create -> prcp = lcrcpcreate() -delete -> status = lcrcpdelete( prcp ) -setType -> status = lcrcpsettype( prcp, itype ) -setMomentum -> status = lcrcpsetmomentum( prcp, xmomv ) -setEnergy -> status = lcrcpsetenergy( prcp, energy ) -setCovMatrix -> status = lcrcpsetcovmatrix( prcp, covmxv ) -setMass -> status = lcrcpsetmass( prcp, xmass ) -setCharge -> status = lcrcpsetcharge( prcp, charge ) ; -setReferencePoint -> status = lcrcpsetreferencepoint( prcp, refpointv ) ; -setGoodnessOfPID -> status lcrcpsetgoodnessofpid( prcp, goodns ) ; -addParticleID -> status = lcrcpaddparticleid( prcp, pid ) ; -addParticle -> status = lcrcpaddparticle( prcp, pparticle, weigth ) ; -addCluster -> status = lcrcpaddcluster( prcp, pclus, weigth ) ; -addTrack -> status = lcrcpaddtrack( prcp, ptrack, weigth ) ; - -id -> id = lcrcpid( prcp ) -getType -> itype = lcrcpgettype( prcp ) -isPrimary -> lprim = lcrcpisprimary( prcp ) (lprim = type logical) -getMomentum -> status = lcrcpgetmomentum( prcp, xmomv ) -getEnergy -> energy = lcrcpgetenergy( prcp ) -getCovMatrix -> status = lctrkgetcovmatrix( prcp, covmxv ) -getMass -> xmass = lcrcpgetmass( prcp ) -getCharge -> charge = lcrcpgetcharge( prcp ) -getReferencePoint -> status = lcrcpgetreferencepoint( prcp, refpointv ) -getGoodnessOfPID -> goodns = lcrcpgetgoodnessofpid( prcp ) -getParticleIDs -> pids = lcrcpgetparticleids( prcp ) -getParticles -> ppartv = lcrcpgetparticles( prcp ) -getClusters -> pclusv = lcrcpgetclusters( prcp ) -getTracks -> ptrkv = lcrcpgettracks( prcp ) - - -class ParticleID: - -create -> ppid = lcpidcreate() -delete -> status = lcpiddelete( ppid ) -setType -> status = lcpidsettype( ppid, idtype ) -setPDG -> status = lcpidsetpdg( ppid, ipdg ) -setLikelihood -> status = lcpidsetlikelihood( ppid, xlogl ) -setAlgorithmType -> status = lcpidsetalgorithmtype( ppid, itype ) -addParameter -> status = lcpidaddparameter( ppid, param ) - -id -> id = lcpidid( ppid ) -getType -> idtype = lcpidgettype( ppid ) -getPDG -> ipdg = lcpidgetpdg( ppid ) -getLikelihood -> xlogl = lcpidgetlikelihood( ppid ) -getAlgorithmType -> itype = lcpidgetalgorithmtype( ppid ) -getParameters -> status = lcpidgetparameters( ppid, paramv, nparam) - - -class MCParticle: - -create -> pmcp = lcmcpcreate() -delete -> status = lcmcpdelete( pmcp ) -addParent -> status = lcmcpaddparent( pmcp , pmcpp ) -setPDG -> status = lcmcpsetpdg( pmcp , ipdg ) -setGeneratorStatus -> status = lcmcpsetgeneratorstatus( pmcp , istatus ) -setSimulatorStatus -> status = lcmcpsetsimulatorstatus( pmcp , istatus ) -setVertex -> status = lcmcpsetvertex( pmcp , dvtxv ) -setEndpoint -> status = lcmcpsetendpoint( pmcp , dvtxv ) -setMomentum -> status = lcmcpsetmomentum( pmcp , momv ) -setMass -> status = lcmcpsetmass( pmcp , mass ) -setCharge -> status = lcmcpsetcharge( pmcp , charge ) - -getNumberOfParents -> number = lcmcpgetnumberofparents( pmcp ) -getParent -> pmcpp = lcmcpgetparent( pmcp , i ) -getNumberOfDaughters -> number = lcmcpgetnumberofdaughters( pmcp ) -getDaughter -> pmcpd = lcmcpgetdaughter( pmcp , i ) (i=1,...,number) -getPDG -> ipdg = lcmcpgetpdg( pmcp ) -getGeneratorStatus -> istatg = lcmcpgetgeneratorstatus( pmcp ) -getSimulatorStatus -> istats = lcmcpgetsimulatorstatus( pmcp ) -getVertex -> status = lcmcpgetvertex( pmcp , dvtxv ) -getEndpoint -> status = lcmcpgetendpoint( pmcp , dvtxv ) -getMomentum -> status = lcmcpgetmomentum( pmcp , dmomv ) -getEnergy -> denergy = lcmcpgetenergy( pmcp ) -getMass -> dmass = lcmcpgetmass( pmcp ) -getCharge -> charge = lcmcpgetcharge( pmcp ) - - - -utility: - -LCIntVec, LCFloatVec, LCStrVec classes: - -getLengthofIntVector -> nelem = lcivcgetlength( pintvec ) -getIntAt -> int = lcivcgetintat( pintvec , i ) (i=1,...,nelem) -getLengthofFloatVector -> nelem = lcfvcgetlength( pfloatvec ) -getFloatAt -> float = lcfvcgetfloatat( pfloatvec , i ) (i=1,...,nelem) -getLengthofStringVector-> nelem = lcsvcgetlength( pstrvec ) -getStringAt -> string = lcsvcgetstringat( pstrvec , i ) (i=1,...,nelem) - -stl vector class (int, float, string, pointer): - -IntVectorGetLength -> nelem = intvectorgetlength( pintvec ) -IntVectorGetElement -> int = intvectorgetelement( pintvec , i ) (i=1,...,nelem) -FloatVectorGetLength -> nelem = floatvectorgetlength( pfloatvec ) -FloatVectorGetElement -> float = floatvectorgetelement( pfloatvec , i ) (i=1,...,nelem) -StringVectorGetLength -> nelem = stringvectorgetlength( pstrvec ) -StringVectorGetElement -> string = stringvectorgetelement( pstrvec , i ) (i=1,...,nelem) -PointerVectorGetLength -> nelem = pointervectorgetlength( ppointervec ) -PointerVectorGetElement-> pointer = pointervectorgetelement( ppointervec , i ) (i=1,...,nelem) - -\end{verbatim} - -\end{scriptsize} - - - -\newpage -{\large\bf The extended Fortran API to LCIO} \\ - -\begin{scriptsize} - -{\bf Remarks:} \\ - -The return value of the functions and the meaning of arguments are either: \\ -$*$ pointers denoted by a name beginning with the {\bf letter p} \\ -$*$ character strings denoted by {\bf ...name} or {\bf string} \\ -$*$ integers denoted by {\bf status} or a variable name starting with {\bf i} or {\bf n} \\ -$*$ double precision variables denoted by a name starting with {\bf d} \\ -$*$ arrays denoted by a name ending with {\bf v} \\ -$*$ reals {\bf else} \\ -If arguments of the type {\bf array of character strings} are used the last -argument has to be the length of a character string in the array. \\ -Integers starting with n are also used to give the length of an array -(input/output argument for get... functions, input: dimension of the array, output: number of values stored). - - -\begin{verbatim} - -for class LCReader: - -lcrdropenchain -> status = lcrdropenchain(preader, filenamesv, nfiles, len(filenamesv(1))) - -for class LCRunHeader: - -writeRunHeader -> status = lcwriterunheader( pwriter, irun, detname, descrname, sdnamev, nsdn, len(sdnamev(1)) ) -readNextRunHeader -> pheader = lcreadnextrunheader( preader, irun, detname, descrname, sdnamev, nsdn, len(sdnamev(1)) ) - -for class LCEvent: - -setEventHeader -> status = lcseteventheader ( pevent, irun, ievt, itim, detname ) -getEventHeader -> status = lcgeteventheader ( pevent, irun, ievt, itim, detname ) -dumpEvent -> status = lcdumpevent ( pevent ) -dumpEventDetailed -> status = lcdumpeventdetailed ( pevent ) - -for class SimTrackerHit: - -addSimTrackerHit -> status = lcaddsimtrackerhit( pcolhitt, icellid, dposv, fdedx, ftime, pmcp ) -getSimTrackerHit -> status = lcgetsimtrackerhit( pcolhitt, i, icellid, dposv, fdedx, ftime, pmcp ) - -for class SimCalorimeterHit: - -addSimCaloHit -> phit = lcaddsimcalohit( pcolhitc, icellid0, icellid1, energy, posv ) -addSimCaloHitMCont -> status = lcschaddmcparticlecontribution( phit, pmcp, energy, time, ipdg ) (from basic f77 API) -getSimCaloHit -> phit = lcgetsimcalohit( pcolhitc, i, icellid0, icellid1, energy, posv ) -getSimCaloHitMCont -> status = lcgetsimcalohitmccont( phit, i, pmcp, energy, time, ipdg ) - -for class MCParticle: - -getMCParticleData -> status = lcgetmcparticledata ( pmcp, ipdg, igstat, isstat, dvtxv, momv, mass, charge, ndaughters ) - -for class HEPEVT (Fortran interface to COMMON /HEPEVT/ ): - -toHepEvt -> status = lcio2hepevt( pevent ) -fromHepEvt -> status = hepevt2lcio( pevent ) - -for the user extension classes (LCIntVec, LCFloatVec, LCStringVec): - -createIntVector -> pvec = lcintvectorcreate( intv, nint ) -createFloatVector -> pvec = lcfloatvectorcreate( floatv, nfloat ) -createStringVector -> pvec = lcstringvectorcreate( stringsv, nstrings, len(stringsv(1)) ) - -getIntVector -> status = lcgetintvector( pvec , intv, nintv ) -getFloatVector -> status = lcgetfloatvector( pvec , floatv , nfloatv ) -getStringVector -> status = lcgetstringvector( pvec , stringv , nstringv, len(stringv(1)) ) - -for the stl vector class (int, float ,string, pointer): - -IntVectorCreate -> pveci = intvectorcreate( intv, nintv ) -IntVectorDelete -> status = intvectordelete( pveci ) -FloatVectorCreate -> pvecf = floatvectorcreate( floatv , nfloatv ) -FloatVectorDelete -> status = floatvectordelete( pvecf ) -StringVectorCreate -> pvecs = stringvectorcreate( stringsv, nstrings, len(stringsv(1)) ) -StringVectorDelete -> status = stringvectordelete( pvecs ) -PointerVectorCreate -> pvecp = pointervectorcreate( pointerv, npointerv ) -PointerVectorDelete -> status = pointervectordelete( pvecp ) - -getIntVector -> status = getintvector( pveci , intv, nintv ) -getFloatVector -> status = getfloatvector( pvecf , floatv , nfloatv ) -getStringVector -> status = getstringvector( pvecs , stringv , nstringv, len(stringv(1)) ) -get PointerVector -> status = getpointervector( pvecp , pointerv, npointerv ) -\end{verbatim} - -\end{scriptsize} - -