#include <CalorimeterSIO.h>
Inheritance diagram for CalorimeterSIO:


Public Member Functions | |
| CalorimeterSIO (const char *i_name, std::vector< CalorimeterHit > calHits) | |
| void | clear () |
| void | addHit (CalorimeterHit hit) |
| unsigned int | version () |
| unsigned int | xfer (SIO_stream *, SIO_operation, unsigned int) |
Private Attributes | |
| std::vector< CalorimeterHit > | _calHits |
|
||||||||||||
|
Definition at line 22 of file CalorimeterSIO.cc. References SIO_record::connect(), and SIO_recordManager::get().
00022 : SIO_block(i_name), _calHits(calHits) 00023 { 00024 // SIO init -- join the event record. 00025 SIO_record* record; 00026 record = SIO_recordManager::get( "LCD_LCDG4_Event" ); 00027 if (record != NULL) 00028 record->connect(this); 00029 } |
|
|
Definition at line 38 of file CalorimeterSIO.cc. References _calHits.
00039 {
00040 _calHits.push_back(hit);
00041 }
|
|
|
Definition at line 32 of file CalorimeterSIO.cc. References _calHits.
|
|
|
Implements SIO_block. Definition at line 107 of file CalorimeterSIO.cc. References SIO_CALORIMETER_MAJOR, SIO_CALORIMETER_MINOR, and SIO_VERSION_ENCODE.
00108 { return( SIO_VERSION_ENCODE( SIO_CALORIMETER_MAJOR,
00109 SIO_CALORIMETER_MINOR ) ); }
|
|
||||||||||||||||
|
Implements SIO_block. Definition at line 47 of file CalorimeterSIO.cc. References CalorimeterHit::energy(), CalorimeterHit::getMcEnergyMap(), GeV, CalorimeterHit::id(), CalorimeterHit::McEnergyMap, SIO_BLOCK_SUCCESS, SIO_DATA, SIO_operation, and SIO_PNTR.
00052 {
00053 // Make compiler happy about unused vars
00054 if(op || version) ;
00055
00056 unsigned int status;
00057
00058 // write out the number of calorimeter hits...
00059 int nHits = _calHits.size();
00060 status = SIO_DATA( stream, &nHits, 1 );
00061
00062 // loop over calorimeter hits and write them out...
00063
00064 std::vector<CalorimeterHit>::const_iterator it;
00065 for(it=_calHits.begin(); it!=_calHits.end(); ++it)
00066 {
00067 CalorimeterHit hit = *it;
00068 // cell ID
00069 unsigned int id = hit.id();
00070 SIO_DATA(stream, &id, 1);
00071 // energy
00072 float energy = hit.energy()/GeV;
00073 SIO_DATA(stream, &energy, 1);
00074
00075 // For debugging
00076 //printf("CalorimeterSIO::hit.energy()=%f\n",hit.energy());
00077
00078 // now loop over the individual contributions to this cell...
00079 CalorimeterHit::McEnergyMap mcmap = hit.getMcEnergyMap();
00080 CalorimeterHit::McEnergyMap::const_iterator mapit;
00081 int mapsize = mcmap.size();
00082 SIO_DATA(stream, &mapsize, 1)
00083 for(mapit = mcmap.begin(); mapit!=mcmap.end(); ++mapit)
00084 {
00085 //MCParticle*
00086 SIO_PNTR(stream, &((*mapit).first) );
00087 // energy
00088 float energy = mapit->second / GeV;
00089 SIO_DATA(stream, &energy, 1);
00090 // SIO_DATA(stream, const_cast<float *>(&((*mapit).second)), 1);
00091 }
00092 }
00093
00094 //
00095 // That's all folks!
00096 //
00097 return( SIO_BLOCK_SUCCESS );
00098 }
|
|
|
Definition at line 31 of file CalorimeterSIO.h. |
1.3.4