#include <Hardroc2Reader.hh>
Inheritance diagram for Hardroc2Reader:
Public Member Functions | |
Hardroc2Reader (Run &aRun, FILE *aFile, ui32 lastEventId) | |
~Hardroc2Reader () | |
virtual int | getNextEvent (Event &eventToFill)=0 |
Static Public Member Functions | |
static const char * | type (const int subtype=0) |
Protected Member Functions | |
virtual int | getScData ()=0 |
virtual int | getAcqData (Event &event)=0 |
void | reset () |
int | storeEvent (Event &event) |
int | newHit (Event &event, const Detector &detector, int data, const int chNum, const int chipId, const int difId) |
Protected Attributes | |
unsigned short | CRC |
int | difId |
ui32 | difTriggerCounter |
ui32 | acqTriggerCounter |
ui32 | globalTriggerCounter |
ui32 | bcPeriod |
i64 | bcId_Abs |
i64 | bcId_AbsOrg |
i64 | bcId_Dif |
i64 | bcId_Hit |
i64 | eventTime |
i32 | difSynchro |
int | SkippedBcId |
Definition at line 25 of file Hardroc2Reader.hh.
Hardroc2Reader::Hardroc2Reader | ( | Run & | aRun, | |
FILE * | aFile, | |||
ui32 | lastEventId | |||
) |
Definition at line 47 of file Hardroc2Reader.cpp.
00047 : DifReader(aRun, aFile, lastEventId) 00048 { 00049 FILE_LOG(logDEBUG1) << "--Hardroc2Reader constructor()"<< endl; 00050 reset(); 00051 }
Hardroc2Reader::~Hardroc2Reader | ( | ) |
static const char* Hardroc2Reader::type | ( | const int | subtype = 0 |
) | [static] |
Reimplemented in DifSynchroReader, Hardroc2LabviewReader, and Hardroc2XdaqReader.
virtual int Hardroc2Reader::getNextEvent | ( | Event & | eventToFill | ) | [pure virtual] |
Implements AcquisitionParser.
Implemented in DifSynchroReader, Hardroc2LabviewReader, and Hardroc2XdaqReader.
virtual int Hardroc2Reader::getScData | ( | ) | [protected, pure virtual] |
Implemented in DifSynchroReader, Hardroc2LabviewReader, and Hardroc2XdaqReader.
virtual int Hardroc2Reader::getAcqData | ( | Event & | event | ) | [protected, pure virtual] |
Implemented in DifSynchroReader, Hardroc2LabviewReader, and Hardroc2XdaqReader.
void Hardroc2Reader::reset | ( | ) | [protected] |
Definition at line 60 of file Hardroc2Reader.cpp.
Referenced by DifSynchroReader::DifSynchroReader(), Hardroc2XdaqReader::getNextEvent(), Hardroc2LabviewReader::getNextEvent(), DifSynchroReader::getNextEvent(), Hardroc2LabviewReader::Hardroc2LabviewReader(), Hardroc2Reader(), and Hardroc2XdaqReader::Hardroc2XdaqReader().
00060 { 00061 bcId_AbsOrg = -1; // the bcId origin in milliseconds 00062 CRC = 0; // current CRC for the whole file 00063 SkippedBcId = 0; 00064 00065 // following initializations are useless 00066 globalTime = 0; 00067 difId = -1; 00068 difTriggerCounter = acqTriggerCounter = globalTriggerCounter = 0; 00069 bcPeriod = 200; 00070 bcId_Abs = bcId_Dif = bcId_Hit = 0; 00071 } // Hardroc2Reader.reset
int Hardroc2Reader::storeEvent | ( | Event & | event | ) | [protected] |
int Hardroc2Reader::newHit | ( | Event & | event, | |
const Detector & | detector, | |||
int | data, | |||
const int | chNum, | |||
const int | chipId, | |||
const int | difId | |||
) | [protected] |
Definition at line 75 of file Hardroc2Reader.cpp.
Referenced by Hardroc2XdaqReader::getAcqData(), and Hardroc2LabviewReader::getAcqData().
00075 { 00076 // cannot be binary pattern 10 00077 00078 const ChamberMap_t &chambers = detector.getChambers(); 00079 for (ChamberMap_t::const_iterator it = chambers.begin(); it != chambers.end(); ++it) { 00080 try { 00081 Chamber& chamber = *(it->second); 00082 const BoardMap_t& boards = chamber.getBoardsByDifId(difId); 00083 // look for type of chamber 00084 // if (chamber.getType() != HARDROC1CHAMBER) 00085 // continue; 00086 // store new event data 00087 try { 00088 const Channel& channel = chamber.getChannelById(chNum, chipId, difId); 00089 i32 analogValue = 0; 00090 ChannelHit *hit = new ChannelHit(channel, data, analogValue); 00091 00092 hit->setHardrocTime(globalTime, bcId_Abs, bcId_Dif, bcId_Hit,0); 00093 event.insertHit(chamber, hit); 00094 FILE_LOG(logDEBUG) << " new Hit : ch " << chNum << ", chip " << chipId << ", dif " << difId 00095 << ", Time=" << globalTime << " abs=" << bcId_Abs << " dif=" << bcId_Dif << " hit=" << bcId_Hit << " Data=" << data << endl; 00096 return(1); 00097 } 00098 catch (MicroException &e) { 00099 FILE_LOG(logERROR) << "ch " << chNum << ", chip " << chipId << ", dif " << difId << " : " << e.getMessage() << endl; 00100 return(0); 00101 } 00102 } 00103 catch (...) { 00104 FILE_LOG(logDEBUG) << " board list not found - try next" << endl; 00105 continue; 00106 } 00107 00108 } // for 00109 FILE_LOG(logERROR) << " ch " << chNum << ", chip " << chipId << ", dif " << difId << " : geometry element not found" << endl; 00110 return(0); 00111 } // Hardroc2Reader.newHit
unsigned short Hardroc2Reader::CRC [protected] |
int Hardroc2Reader::difId [protected] |
Definition at line 46 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), Hardroc2LabviewReader::getScData(), DifSynchroReader::getScData(), and reset().
ui32 Hardroc2Reader::difTriggerCounter [protected] |
Definition at line 47 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().
ui32 Hardroc2Reader::acqTriggerCounter [protected] |
Definition at line 48 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().
ui32 Hardroc2Reader::globalTriggerCounter [protected] |
Definition at line 49 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().
ui32 Hardroc2Reader::bcPeriod [protected] |
Definition at line 50 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().
i64 Hardroc2Reader::bcId_Abs [protected] |
Definition at line 51 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), newHit(), and reset().
i64 Hardroc2Reader::bcId_AbsOrg [protected] |
Definition at line 52 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().
i64 Hardroc2Reader::bcId_Dif [protected] |
Definition at line 53 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), newHit(), and reset().
i64 Hardroc2Reader::bcId_Hit [protected] |
Definition at line 54 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), newHit(), and reset().
i64 Hardroc2Reader::eventTime [protected] |
Definition at line 55 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), and Hardroc2LabviewReader::getAcqData().
i32 Hardroc2Reader::difSynchro [protected] |
Definition at line 56 of file Hardroc2Reader.hh.
int Hardroc2Reader::SkippedBcId [protected] |
Definition at line 58 of file Hardroc2Reader.hh.
Referenced by Hardroc2XdaqReader::getAcqData(), Hardroc2LabviewReader::getAcqData(), and reset().