
{\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 )
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)

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 )
getRadiusOfInnermostHit-> radius  = lctrkgetradiusofinnermosthit( ptrk )
subdetectorHitNumbers  -> status  = lctrkgetsubdetectorhitnumbers( 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}


