00001 #define GlastDigi_ReadDigi_CPP
00002
00003
00004 #include "ReadDigi.h"
00005
00006 #include "GaudiKernel/MsgStream.h"
00007 #include "GaudiKernel/AlgFactory.h"
00008 #include "GaudiKernel/IDataProviderSvc.h"
00009 #include "GaudiKernel/SmartDataPtr.h"
00010
00011 #include "GlastSvc/GlastDetSvc/IGlastDetSvc.h"
00012 #include "GlastEvent/TopLevel/EventModel.h"
00013 #include "GlastEvent/TopLevel/Event.h"
00014 #include "GaudiKernel/ObjectVector.h"
00015
00016 #include "GlastEvent/TopLevel/IrfEvent.h"
00017 #include "GlastEvent/Irf/IrfAcdHit.h"
00018
00019 #include "GlastEvent/Digi/AcdDigi.h"
00020
00021
00022 static const AlgFactory<ReadDigi> Factory;
00023 const IAlgFactory& ReadDigiFactory = Factory;
00024
00025
00028
00029 Algorithm(name, pSvcLocator) {
00030
00031 }
00032
00033
00034
00039 StatusCode ReadDigi::initialize() {
00040
00041 MsgStream log(msgSvc(), name());
00042 log << MSG::INFO << "initialize" << endreq;
00043
00044
00045 setProperties();
00046
00047 return StatusCode::SUCCESS;
00048 }
00049
00050
00051
00057 StatusCode ReadDigi::execute() {
00058
00059 StatusCode sc = StatusCode::SUCCESS;
00060 MsgStream log( msgSvc(), name() );
00061 log << MSG::INFO << "execute" << endreq;
00062
00067 SmartDataPtr<AcdDigiVector> DigiAcd(eventSvc(),"/Event/Digi/AcdDigis");
00068
00069 if (DigiAcd == 0) {
00070 log << MSG::INFO << "no acd data is available" << endreq;
00071 return sc;
00072 }
00073
00074
00075
00076
00077 for (ObjectVector<AcdDigi>::const_iterator it = DigiAcd->begin(); it != DigiAcd->end(); it++) {
00078 const unsigned int myId = int((*it)->ID());
00079 log << MSG::INFO << " ACD Digi Id = "
00080 << (*it)->ID() << " "
00081 << " PHA = " << (*it)->PulseHeight()
00082 << " LowThres = " << (*it)->LowThreshold()
00083 << " VetoThres = " << (*it)->Veto()
00084 << " HighThres = " << (*it)->HighThreshold()
00085 << endreq;
00086 }
00087
00088
00089 return sc;
00090 }
00091
00092
00093
00094
00095
00096
00097
00098 StatusCode ReadDigi::finalize() {
00099
00100 MsgStream log(msgSvc(), name());
00101 log << MSG::INFO << "finalize" << endreq;
00102
00103 return StatusCode::SUCCESS;
00104 }
00105
00106
00107
00108
00109
00110