TestMicrorocParser Class Reference

#include <TestMicrorocParser.hh>

Inheritance diagram for TestMicrorocParser:

Inheritance graph
[legend]
Collaboration diagram for TestMicrorocParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TestMicrorocParser (Run &aRun, FILE *aFile, ui32 firstEventId)
virtual ~TestMicrorocParser ()
int getNextEvent (Event &event)

Static Public Member Functions

static const char * type ()

Private Member Functions

std::string getCtestString (void)

Private Attributes

bool serialNumberReaded

Detailed Description

Definition at line 18 of file TestMicrorocParser.hh.


Constructor & Destructor Documentation

TestMicrorocParser::TestMicrorocParser ( Run aRun,
FILE *  aFile,
ui32  firstEventId 
)

Definition at line 26 of file TestMicrorocParser.cpp.

00027 : CalibMicrorocParser(aRun, aFile,  _firstEventId, true), serialNumberReaded(false) 
00028 {
00029   FILE_LOG(logDEBUG1) << "--TestMicrorocParser constructor()"<< endl;
00030   run.setName("Microroc chip test Run");
00031         
00032 }

TestMicrorocParser::~TestMicrorocParser (  )  [virtual]

Definition at line 36 of file TestMicrorocParser.cpp.

00037 {
00038   FILE_LOG(logDEBUG1)<< "----CalibMicrorocParser destructeur"<< endl;
00039 }


Member Function Documentation

static const char* TestMicrorocParser::type (  )  [inline, static]

Reimplemented from CalibMicrorocParser.

Definition at line 24 of file TestMicrorocParser.hh.

Referenced by main().

00024 { return TESTMICRORC; }

int TestMicrorocParser::getNextEvent ( Event event  )  [virtual]

Reimplemented from CalibMicrorocParser.

Definition at line 43 of file TestMicrorocParser.cpp.

00044 {
00045 
00046 
00047 if ( serialNumberReaded == false)
00048 {
00049 string line;
00050 ui64 result = 0;
00051 unsigned int serialNumber = 0 ;
00052     size_t found;
00053     do
00054     {
00055        if ( getLine ( inputFile, line) == EOF ) { return 0 ;}
00056        found = line.find("CHIP MR1 N =" );
00057     }
00058     while  (found==string::npos);
00059 
00060     string mot;
00061     int equalpos = 0;
00062 
00063     equalpos = line.find('=') ;
00064     if ( equalpos != string::npos )
00065     {
00066         mot = line.substr(equalpos + 2, line.size() -( equalpos + 2)); // + 2 because of the space caractere behind equal // 13 -> lenth of "CHIP MR1 N = "
00067                 unsigned long buffer;
00068 
00069                 stringstream ss;
00070                 ss << mot.substr(0,mot.size());
00071                 ss >> dec >> serialNumber;
00072 
00073                  FILE_LOG(logINFO) << "Chip serial Number[" << serialNumber << "]" << endl;
00074         }
00075 
00076 
00077 
00078     serialNumberReaded = true;
00079 
00080     Detector& detector = run.getDetector();
00081     try {
00082           ChamberMap_t chambers = detector.getChambers();
00083             Chamber& chamber = *(chambers.begin()->second);
00084             DifMap_t difs = chamber.getDifs();
00085               Dif& dif = *difs.begin()->second;
00086               BoardMap_t boards = dif.getBoards();
00087                 Board& b = *boards.begin()->second;
00088                 ChipMap_t chips = b.getChips();
00089                   MicrorocChip &chip = dynamic_cast<MicrorocChip &> (*chips.begin()->second);
00090                   if (chip.getSerialNumber() != serialNumber)
00091                   {
00092                     FILE_LOG(logINFO) << "serial number readed does not correspond to serial number in xml file.Force it" << endl;
00093                     chip.setSerialNumber(serialNumber);
00094                   }
00095         }
00096 
00097         catch (MicroException& e){}
00098 
00099 }
00100   // Call super Class method
00101  CalibMicrorocParser::getNextEvent(event);
00102 
00103 }

std::string TestMicrorocParser::getCtestString ( void   )  [inline, private, virtual]

Reimplemented from CalibMicrorocParser.

Definition at line 29 of file TestMicrorocParser.hh.

00029 {return "motif Capa externes";} ;


Member Data Documentation

bool TestMicrorocParser::serialNumberReaded [private]

Definition at line 28 of file TestMicrorocParser.hh.

Referenced by getNextEvent().


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 13:19:05 2013 for MicromegasFramework by  doxygen 1.4.7