5#include "tpcclibConfig.h"
40 int verbose=0;
if(status!=NULL) verbose=status->
verbose;
41 if(verbose>0) printf(
"%s(tac, par, %d)\n", __func__, sampleNr);
44 if(tac==NULL || par==NULL) {
48 if(sampleNr<1 || par->tacNr<1) {
57 statusSet(status, __func__, __FILE__, __LINE__, ret);
66 if(i<0) i=
iftFindKey(&par->
h,
"calibration_unit", 0);
102 int verbose=0;
if(status!=NULL) verbose=status->
verbose;
103 if(verbose>0) printf(
"%s(par, tac, %d)\n", __func__, parNr);
106 if(tac==NULL || par==NULL) {
110 if(parNr<1 || tac->tacNr<1) {
118 if(verbose>2) printf(
"allocate memory for PAR\n");
125 if(verbose>3) printf(
"copy TAC names\n");
126 for(
int i=0; i<par->
tacNr; i++) strcpy(par->
r[i].
name, tac->
c[i].
name);
129 if(verbose>3) printf(
"copy header\n");
136 if(i<0) i=
iftFindKey(&tac->
h,
"injection time", 0);
149 else iftPut(&par->
h,
"weighting",
"no", 0, NULL);
178 int verbose=0;
if(status!=NULL) verbose=status->
verbose;
179 if(verbose>0) printf(
"%s(par, tac)\n", __func__);
184 if(tac==NULL || par==NULL) {
198 for(
int i=0; i<tac->
tacNr; i++)
199 for(
int j=0; j<par->
parNr; j++)
200 par->
r[i].
p[j]=tac->
c[i].
y[j];
int iftPut(IFT *ift, const char *key, const char *value, char comment, TPCSTATUS *status)
int iftFindKey(IFT *ift, const char *key, int start_index)
int parAllocate(PAR *par, int parNr, int tacNr)
int tacAllocateWithPAR(TAC *tac, PAR *par, int sampleNr, TPCSTATUS *status)
Allocate TAC based on data in PAR.
int parAllocateWithTAC(PAR *par, TAC *tac, int parNr, TPCSTATUS *status)
Allocate PAR based on data in TAC.
int tacToPAR(TAC *tac, PAR *par, TPCSTATUS *status)
Copy the contents of TAC struct into PAR struct.
void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error)
IFT h
Optional (but often useful) header information.
char name[MAX_TACNAME_LEN+1]
char name[MAX_TACNAME_LEN+1]
IFT h
Optional (but often useful) header information.
int verbose
Verbose level, used by statusPrint() etc.
int tacAllocate(TAC *tac, int sampleNr, int tacNr)
int tacIsWeighted(TAC *tac)
Header file for library libtpcextensions.
@ UNIT_UNKNOWN
Unknown unit.
@ TPCERROR_FAIL
General error.
@ TPCERROR_NO_DATA
File contains no data.
int unitIdentify(const char *s)
char * unitName(int unit_code)
Header file for libtpcmodels.
Header file for libtpcpar.
Header file for library libtpctac.
Header file for libtpctacmod.