Changeset 3438 in Sophya for trunk/SophyaLib/Manual/piapp.tex
- Timestamp:
- Dec 12, 2007, 10:34:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Manual/piapp.tex
r3437 r3438 110 110 loaded at run time. 111 111 \end{itemize} 112 113 \subsection{Acknowlegments} 114 Many people have contributed to the development SOPHYA and/or the PI library 115 and (s)piapp interactive analysis tool. 116 we are grateful to the following people: 117 118 \begin{tabular}{lcl} 119 Reza Ansari & \hspace{5mm} & (LAL-Univ.Paris Sud, Orsay) \\ 120 Eric Aubourg & & (DAPNIA-CEA/APC, Saclay) \\ 121 Sophie Henrot-Versille & & (LAL-IN2P3/CNRS, Orsay) \\ 122 Alex Kim & & (LBL, Berkeley) \\ 123 Guy Le Meur & & (LAL-IN2P3/CNRS, Orsay) \\ 124 Eric Lesquoy & & (DAPNIA-CEA, Saclay) \\ 125 Christophe Magneville & & (DAPNIA-CEA, Saclay) \\ 126 Bruno Mansoux & & (LAL-IN2P3/CNRS, Orsay) \\ 127 Olivier Perdereau & & (LAL-IN2P3/CNRS, Orsay) \\ 128 Nicolas Regnault & & (LPNHE-IN2P3/CNRS, Paris) \\ 129 Benoit Revenu & & (APC/Univ.Paris 7, Paris) \\ 130 Francois Touze & & (LAL-IN2P3/CNRS, Orsay) \\ 131 \end{tabular} 132 133 We thank also the persons who have helped us by useful suggestions, among others : \\ 134 S. Bargot, S. Du, S. Plasczczynski, C. Renault and D. Yvon. 135 112 136 %%% 113 137 \begin{figure}[ht!] … … 991 1015 %%%%%%%%%%%%%%% Section 5 : analyse a la paw 992 1016 \newpage 993 \section{Tables and interactive analysis}1017 \section{Tables and Expression Plotting} 994 1018 \label{tableplot} 1019 A powerful data analysis technic available in piapp is 1020 2D, 3D plot, and histogramming applied to arbitrary analytical 1021 expression of table columns. 1022 This analysis technic has been introduced by the popular 1023 CERN \href{http://paw.web.cern.ch/paw/}{\bf PAW} 1024 ({\bf P}hysics {\bf A}nalysis {\bf Workstation}) 1025 \footnote{PAW home page : http://paw.web.cern.ch/paw/ } program 1026 and the underlying HBOOK fortran library. 1027 Compared to PAW, piapp extends in many respects this capability, 1028 piapp offers in particular the possibility to manipulate many 1029 objects as if they where a DataTable, or NTuple. 1030 There are also additional 2D and 3D representations e.g. 1031 {\tt plot2de} \myppageref{plot2de}, 1032 {\tt plot2dw} \myppageref{plot2dw}, 1033 {\tt plot2dc} \myppageref{plot2dc} and 1034 {\tt plot3dw} \myppageref{plot3dw}. 1035 1036 \subsection{How does it work ?} 1037 1038 The Expression.Plotting commands in piapp operate on objects through the 1039 {\bf NTupleInterface} class methods. Some classes like NTuple or BaseDataTable 1040 inherit from NTupleInterface, while for the other classes, the corresponding 1041 NObjMgrAdapter class exposes an object conforming to NTupleInterface through the 1042 method : \\ 1043 \hspace*{5mm} {\tt NTupleInterface* NObjMgrAdapter::GetNTupleInterface()} \\ 1044 A C file (PIATmp\_xxx/expf\_pia\_dl.c) is created by piapp containing the 1045 specified expressions, which should conform to the C-language syntax. 1046 In addition to the functions in {\tt math.h} (sin, cos, log \ldots), 1047 the following functions are defined by piapp and can be used: 1048 \begin{itemize} 1049 \item Flat random number generators: {\tt drand01() , drandpm1() } 1050 \item Gaussian random number generator: {\tt GauRand() } 1051 \item Angle conversion: {\tt deg2rad(double d), rad2deg(double r) } 1052 \item $(\theta,\varphi)$ to Molleweide X,Y projection: \\ 1053 \hspace*{5mm}{\tt double tetphi2mollX(double theta, double phi)} \\ 1054 \hspace*{5mm}{\tt double tetphi2mollY(double theta)} 1055 \item Longitude(0..360) deg., Latitude(-90..90) deg. conversion to Molleweide X,Y: \\ 1056 \hspace*{5mm}{\tt double longlat2mollX(double longit, double lat) } \\ 1057 \hspace*{5mm}{\tt double longlat2mollY(double lat) } 1058 \end{itemize} 1059 1060 The processing steps for an Expression.Plotting in piapp : 1061 \begin{enumerate} 1062 \item Creation of the C-file. 1063 \item On the fly compilation of the generated file. 1064 \item The resulting shared-object is loaded and linked with the application 1065 \item Loop over the NTupleInterface object rows. The created function is called 1066 with the data from each row 1067 \item The return values are used to fill an histogram, or a matrix/vector or 1068 another NTuple or to produce a 2D or 3D graphic display. 1069 \end{enumerate} 1070 1071 Although rather complex, the efficiency gain during processing data easily compensates 1072 for the overhead of the compilation step. 1073 1074 \subsection{Column/variable names} 1075 1076 When working with real 2-D tables (NTuple, DataTable \ldots), the column names 1077 are the name of the variables which can be used in the C-expressions. 1078 There is an additional variable, called {\tt \_nl}, automatically 1079 provided by piapp, corresponding the table row number, starting from 0. 1080 1081 For the other objects in piapp, the variable names are listed below: 1082 \begin{itemize} 1083 \item[\rond] For 2D table objects {\bf (NTuple,DataTable,\ldots)}: ColumnNames,\_nl 1084 \item[\rond] For FITS files opened through {\tt fitsadapt} command: FITSColumnNames,\_nl 1085 \item[\rond] For {\bf Histo1D/HProf} objects : i,x,val,err,nb,\_nl 1086 \item[\rond] For {\bf Histo2D} objects : i,j,x,y,val,err,\_nl 1087 \item[\rond] For {\bf HistoErr} objects : i,x,val,err2,nb,\_nl 1088 \item[\rond] For {\bf Histo2DErr} objects : i,j,x,y,val,err2,nb,\_nl 1089 \item[\rond] For {\bf \tcls{TVector}, \tcls{TMatrix} , \tcls{Image} } objects : \\ 1090 \hspace*{10mm} n,r,c,val,real,imag,mod,phas,\_nl 1091 \item[\rond] For {\bf \tcls{TArray}} objects : n,x,y,z,t,u,val,real,imag,mod,phas,\_nl 1092 \item[\rond] For {\bf GeneralFitData} objects : x0,ex0 x1,ex1 ... xn,exn y,ey ,ok,\_nl 1093 \item[\rond] For {\bf \tcls{SphereHEALPix} , \tcls{SphereThetaPhi} , \tcls{SphereECP} 1094 \tcls{LocalMap} } objects : \hspace{10mm} i,k,val,real,imag,mod,phas,teta,phi,\_nl 1095 \end{itemize} 995 1096 996 1097 %%%%%%%%%%%%%%% Section 6 : command interpreter … … 1029 1130 managed by {\bf NamedObjMgr} (See below). 1030 1131 1132 \subsubsection{Interpreter/Commander variables} 1031 1133 \begin{itemize} 1032 1134 \item[\rond] {\bf Definition and initialisation of variables } … … 1087 1189 1088 1190 \par 1089 1090 \item[\rond] {\bf Special variables } 1191 \end{itemize} 1192 1193 \subsubsection{Special variables} 1091 1194 \begin{itemize} 1092 1195 \item {\tt \$retval} ou {\tt \$retstr} : the string specified in the last {\bf return} statement … … 1098 1201 \end{itemize} 1099 1202 1100 \item[\rond] {\bf Objects/Application level variables} \\ 1203 \subsubsection{Environment variables} 1204 Environment variables can simply be accessed by {\tt \$varenvname}. 1205 However, the environment variables have the lowest priority during substitution. 1206 Interpreter's variables have the highest priority, followed 1207 by the application level variables. 1208 1209 \subsubsection{Objects/Application level variables} 1101 1210 For some classes managed by NamedObjMgr, 1102 1211 PIACmd provide acces to some of the attributes of the object by … … 1107 1216 {\tt \${vname} } is replaced by its value, even if an interpreter variable with the 1108 1217 same name has been defined. 1218 \begin{itemize} 1219 \item[\rond] Accessing object attributes 1109 1220 \begin{verbatim} 1110 1221 # -------- Example with a Vector … … 1115 1226 # used to get list of valid attributes 1116 1227 piapp[3] echo ${va.?} 1117 TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum 1228 TMatrix.Att: rank size/nelts nrow/nrows ncol/ncols sum sumsq norm min ... 1118 1229 # Compound names, in the form name.att must be inclosed in 1119 1230 # braces {name.att} … … 1129 1240 \end{verbatim} 1130 1241 1131 \item[\rond] {\bf Environment variables} can simply be accessed by {\tt \$varenvname}. 1132 However, the environment variables have the lowest priority during substitution. 1133 Interpreter's variables have the highest priority, followed 1134 by the application level variables. 1135 1242 \item[\rond] Accessing object.Info() \\ 1243 For objects having an DVList Info() object (TArray/TVector/TMatrix , NTuple, DataTable, SwPPFDataTable, it is possible to access DVList members by the corresponding names : \\ 1244 \hspace*{10mm} {\tt \$\{objName.info.varName\} } 1245 \item[\rond] Getting DataTable rows \\ 1246 For NTuple and BaseDataTable objects (DataTable, SwPPFDataTable, SwFitsDataTable), it is 1247 possible to get a string representation of a given row, by specifying 1248 \$\{tableName.row\} followed by the row number (starting from 0) : \\ 1249 \hspace*{10mm} {\tt \$\{tableName.row.num\} } 1136 1250 \end{itemize} 1251 1137 1252 1138 1253 … … 1264 1379 \end{itemize} 1265 1380 1381 Executing commands in a separate thread is useful for CPU or data intensive 1382 commands. Most {\bf Expr.Plotting} 1383 (plot2d, plot2dw, plot2de, plot3d, ntloop, fillvec, fillmtx \ldots) 1384 and some of the {\bf pawCmd} (n/plot n/proj) are thread safe. However, due to the 1385 current mutex lock management for these Expr.Plotting/pawCmd commands, only one 1386 such command can run concurrently with other piapp threads. 1387 Some of the commands in the {\bf CxxExecutorCmd} ( 1388 c++exec, c++execfrf, c++create, c++createfrf, c++compile, c++link) are also thread safe. 1389 The same remark concerning lock management applies to these commands, while 1390 CxxExecutorCmd commands can run in parallel with Expr.Plotting commands. 1391 1392 1266 1393 %%%%%%%%%%%%%%% Section 7 : c++ execution 1267 1394 \newpage
Note:
See TracChangeset
for help on using the changeset viewer.