/** @file * $Source: /home/cvsmanager/yoda/techmodel/physics/AnticounterReader.cpp,v $ * $Id: TrackerReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the CalorimeterReader class. */ #include #include #include "CalorimeterReader.h" extern "C" { extern struct { int IEV2; int dexy[96][22][2]; int dexyc[96][22][2]; int base[96][22][2]; int calselftrig[7][4]; int calIItrig[4]; int calstripshift[4]; int calDSPtaberr[4]; int calevnum[4]; } evento_; int calunpack_(unsigned short[], long int*, int*); //Struct per il passaggio di dati da e verso la chiamata fortran } using namespace pamela; using namespace pamela::calorimeter; static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.calorimeter.CalorimeterReader"); /** * Constructor. */ CalorimeterReader::CalorimeterReader(void): TechmodelAlgorithm(PacketType::Physics, "TechmodelCalorimeterReader") { cat.debug("Constructor"); calorimeter = new CalorimeterEvent(); } /** * Get a string with the version info of the algorithm. */ std::string CalorimeterReader::GetVersionInfo(void) const { return "$Header: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $"; } /** * Initialize the algorithm with a special run. This will initialize the * event reader routines for all packet types. */ void CalorimeterReader::Init(PamelaRun *run) { SetInputStream(run); run->WriteSubPacket(this, &calorimeter, calorimeter->Class()); } /** * Unpack the calorimeter event from an input file. */ void CalorimeterReader::RunEvent(int EventNumber) { } /** * Unpack the Calorimeter data event from the physical packet. */ void CalorimeterReader::RunEvent(int EventNumber, const char subData[], long int length) { char data[length]; memcpy(data, subData, length); int ERROR = 0; unsigned short convdata[length]; for (int i = 0; iIEV2 = evento_.IEV2; memcpy(calorimeter->dexy, evento_.dexy, sizeof(calorimeter->dexy)); memcpy(calorimeter->dexyc, evento_.dexyc, sizeof(calorimeter->dexyc)); memcpy(calorimeter->base, evento_.base, sizeof(calorimeter->base)); memcpy(calorimeter->calselftrig, evento_.calselftrig, sizeof(calorimeter->calselftrig)); memcpy(calorimeter->calIItrig, evento_.calIItrig, sizeof(calorimeter->calIItrig)); memcpy(calorimeter->calstripshift, evento_.calstripshift, sizeof(calorimeter->calstripshift)); memcpy(calorimeter->calDSPtaberr, evento_.calDSPtaberr, sizeof(calorimeter->calDSPtaberr)); memcpy(calorimeter->calevnum, evento_.calevnum, sizeof(calorimeter->calevnum)); cat << log4cpp::Priority::ERROR << "Fortran77 function calunpack error code = " << ERROR << "\n " << log4cpp::CategoryStream::ENDLINE; }