--- yoda/techmodel/physics/NeutronDetectorReader.cpp 2005/01/13 14:50:01 2.3 +++ yoda/techmodel/physics/NeutronDetectorReader.cpp 2005/03/05 15:54:21 2.3.2.1 @@ -22,12 +22,20 @@ */ std::string NeutronDetectorReader::GetVersionInfo(void) const { return - "$Header: /home/cvsmanager/yoda/techmodel/physics/NeutronDetectorReader.cpp,v 2.2 2004/12/09 08:48:54 kusanagi Exp $"; + "$Header: /home/cvsmanager/yoda/techmodel/physics/NeutronDetectorReader.cpp,v 3.0 2005/03/04 15:54:11 kusanagi Exp $"; } /** * Initialize the algorithm with a special run. This will initialize the * event reader routines for all packet types. + * For definition the definition for Neutron detector data is located in the + * end of the physics packet. + * More explicitely the neutronData is composed by 4 bytes; + * a pattern 00 0F TR BK + * where: + * 00 0f is a fixed pattern + * TR is the NeutronCounter for a trigger event + * BK is the NeutronCounter beetween two trigger events */ void NeutronDetectorReader::Init(PamelaRun *run) { logger->debug(_T("Initialize")); @@ -57,8 +65,7 @@ for (int i = 0; i < 3; i++){ offset = lenNeutronData - 4*i; rec = new(recs[i]) NeutronRecord(); //aggiungo un nuovo NeutronRecord all'evento - rec->upperTrig = (((UINT8)data[lenght-offset])>>4); - rec->bottomTrig = (((UINT8)data[lenght-offset])&0x0F); + rec->trigPhysics = (UINT8)data[lenght-offset]; rec->upperBack = (((UINT8)data[lenght-offset+1])>>4); rec->bottomBack = (((UINT8)data[lenght-offset+1])&0x0F); } @@ -66,11 +73,10 @@ } else { neutronEvent->unpackError = 1; } - delete[] data; + delete [] data; } -/* For definition the definition for Neutron detector data is - * "The last data bunch in the phyics packet" */ + bool NeutronDetectorReader::haveData(const char data[], long int lenght){ bool ret = false; if (((data[lenght-1] && data[lenght - 5] && data[lenght - 9]) && 0x0F) &&