5 #include <pdbcalbase/PdbParameterMap.h>
7 #include <phparameter/PHParameters.h>
19 #include <Event/Event.h>
20 #include <Event/EventTypes.h>
21 #include <Event/packet.h>
36 , runinfo_node_name(
"RUN_INFO")
50 Event *
event = findNode::getClass<Event>(topNode,
"PRDF");
54 cout <<
"RunInfoUnpackPRDF::Process_Event - Event not found" << endl;
60 findNode::getClass<EventHeaderv1>(topNode,
"EventHeader");
82 cout <<
"RunInfoUnpackPRDF::process_event - with BEGRUNEVENT events ";
86 map<int, Packet *> packet_list;
90 for (typ_channel_map::const_iterator
it =
channel_map.begin();
93 const string &
name =
it->first;
94 const channel_info &info =
it->second;
96 if (packet_list.find(info.packet_id) == packet_list.end())
98 packet_list[info.packet_id] =
event->getPacket(info.packet_id);
101 Packet *packet = packet_list[info.packet_id];
106 cout <<
"RunInfoUnpackPRDF::process_event - failed to locate packet "
107 << info.packet_id <<
" from ";
110 Params.set_double_param(name, NAN);
114 const int ivalue = packet->
iValue(info.offset);
116 const double dvalue = ivalue * info.calibration_const;
120 cout <<
"RunInfoUnpackPRDF::process_event - " << name <<
" = " << dvalue
121 <<
", raw = " << ivalue <<
" @ packet " << info.packet_id
122 <<
", offset " << info.offset << endl;
125 Params.set_double_param(name, dvalue);
128 for (map<int, Packet *>::iterator
it = packet_list.begin();
129 it != packet_list.end(); ++
it)
150 nodeItr.findFirst(
"PHCompositeNode",
"RUN"));
153 cout <<
"PHComposite node created: RUN" << endl;
168 nodeItr.findFirst(
"PHCompositeNode",
"DST"));
171 cout <<
"PHComposite node created: DST" << endl;
178 eventheader,
"EventHeader",
"PHObject");
179 dst_node->
addNode(EventHeaderNode);
185 const unsigned int offset,
186 const double calibration_const
191 make_pair(name, channel_info(packet_id, offset, calibration_const)));