--- yoda/techmodel/physics/CalorimeterReader.cpp 2004/09/21 20:51:22 2.0 +++ yoda/techmodel/physics/CalorimeterReader.cpp 2004/10/17 12:28:46 2.1 @@ -1,6 +1,6 @@ /** @file * $Source: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v $ - * $Id: CalorimeterReader.cpp,v 1.5 2004/09/21 20:24:53 kusanagi Exp $ + * $Id: CalorimeterReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the CalorimeterReader class. @@ -14,21 +14,22 @@ extern "C" { + extern struct { - int IEV2; - int stwerr; - int perror; - int dexy[2][22][96]; - int dexyc[2][22][96]; - int base[2][22][96]; - int calselftrig[4][7]; - int calIItrig[4]; - int calstripshift[4]; - int calDSPtaberr[4]; - int calevnum[4]; + int IEV; + int stwerr[4]; + float perror[4]; + float dexy[2][22][96]; + float dexyc[2][22][96]; + float base[2][22][6]; + float calselftrig[4][7]; + float calIItrig[4]; + float calstripshit[4]; + float calDSPtaberr[4]; + float calevnum[4]; } evento_; - void calunpack_(short[], long int*, int*); + void calunpack_(unsigned char[], long int*, int*); //Struct per il passaggio di dati da e verso la chiamata fortran } @@ -51,7 +52,7 @@ */ std::string CalorimeterReader::GetVersionInfo(void) const { return - "$Header: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v 1.5 2004/09/21 20:24:53 kusanagi Exp $"; + "$Header: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $"; } /** @@ -80,13 +81,13 @@ memcpy(data, subData, length); int ERROR = 0; - unsigned short convdata[length]; + /*unsigned short convdata[length]; for (int i = 0; iwarn(oss.str().c_str()); } else { - calorimeter->IEV2 = evento_.IEV2; - calorimeter->stwerr = evento_.stwerr; - calorimeter->perror = evento_.perror; - + calorimeter->IEV = evento_.IEV; + memcpy(calorimeter->stwerr, evento_.stwerr, sizeof(calorimeter->stwerr)); + memcpy(calorimeter->perror, evento_.perror, sizeof(calorimeter->perror)); //--------have to invert array because of FORTRAN <-> C different management of the indexes - int tempDexy[96][22][2]; - int tempDexyc[96][22][2]; - int tempBase[96][22][2]; - int tempCalselftrig[7][4]; + float tempDexy[96][22][2]; + float tempDexyc[96][22][2]; + float tempBase[6][22][2]; + float tempCalselftrig[7][4]; memcpy(tempDexy, evento_.dexy, sizeof(tempDexy)); memcpy(tempDexyc, evento_.dexyc, sizeof(tempDexyc)); memcpy(tempBase, evento_.base, sizeof(tempBase)); @@ -122,14 +122,15 @@ for (int z = 0; z < 96; z++){ calorimeter->dexy[i][j][z] = tempDexy[z][j][i]; calorimeter->dexyc[i][j][z] = tempDexyc[z][j][i]; + } + for (int z = 0; z < 6; z++){ calorimeter->base[i][j][z] = tempBase[z][j][i]; } } } //----------------------------------------------------------------------------------------- - memcpy(calorimeter->calIItrig, evento_.calIItrig, sizeof(calorimeter->calIItrig)); - memcpy(calorimeter->calstripshift, evento_.calstripshift, sizeof(calorimeter->calstripshift)); + memcpy(calorimeter->calstripshit, evento_.calstripshit, sizeof(calorimeter->calstripshit)); memcpy(calorimeter->calDSPtaberr, evento_.calDSPtaberr, sizeof(calorimeter->calDSPtaberr)); memcpy(calorimeter->calevnum, evento_.calevnum, sizeof(calorimeter->calevnum)); }