OO Decoder Upgrade for Podd (hall A/C analyzer) To include new CODA3 Hardware and Data Structures Podd already has a decoder.

Download Report

Transcript OO Decoder Upgrade for Podd (hall A/C analyzer) To include new CODA3 Hardware and Data Structures Podd already has a decoder.

OO Decoder Upgrade for Podd
(hall A/C analyzer)
To include new CODA3 Hardware and Data Structures
Podd already has a decoder. It works.
Goals of Upgrade
1. Maintain existing public interface ; no need to rewrite
dependent classes, e.g. detectors. However, some new
public methods will be available.
2. Support for new CODA3 Pipelining Hardware *
using software from DAQ group
* FADC250, F1TDC, SSP, CTP modules
3. Support for Multiblock data structure.
Using EVIO library from DAQ group
4. Cleaner Object-oriented design
 easier to add new modules and new event types
 easier to extend to hall-specific implementations
R. Michaels, Dec 18, 2013 HA Software Mtg
Motivation, 1
NEW WAY
OLD WAY
event_type = evbuffer[1]>>16;
Database defines event types
switch(event_type) {
An EventTypeHandler, defined
for each event type,
decodes the evbuffer.
case EPICS_EVTYPE :
ret = epics_decode(evbuffer);
break;
case SCALER_EVTYPE :
ret =
scaler_event_decode(evbuffer);
break;
e.g.
EpicsEventHandler
ScalerEventHandler
are EventTypeHandlers
R. Michaels, Dec 18, 2013 HA Software Mtg
Motivation, 2
NEW WAY
OLD WAY
p = evbuffer + ipt;
model = fMap->getModel(roc,slot);
Database defines modules in
crates
switch(model) {
case 1182 :
// LeCroy 1182 ADC
for (chan = 0; chan < 8; chan++){
crateslot[roc,slot]->
loadData(chan,*p);
}
break;
case 7510 :
// etc
A Module, defined for each
slot in a crate, decodes the
relevant portion of evbuffer
e.g.
LeCroy1182
Struck7510
// Struck 7510 ADC
are Modules
R. Michaels, Dec 18, 2013 HA Software Mtg
14 year old class* in Podd
Public Interface
Will not change, but
new methods added
*
CODA Decoder Data
R. Michaels, Dec 18, 2013 HA Software Mtg
Analyzers
Detectors
Output
Public Interface
CODA Decoder Data
Change inner-workings because:
• Podd philosophy : “Everything is a plug-in” -should include Modules and Event Type Handlers
• Make extensible (e.g. Hall C scalers)
R. Michaels, Dec 18, 2013 HA Software Mtg
OO Design : A verbal description of the problem
defines the classes and their relationships.
Classes
(capital, underlined)
The CODA-data-decoder ( type of Event Data “EvData”) contains Event Type Handlers to
process events. The EvTypeHandlers are of type Epics, Scalers, Physics Triggers, etc
The CODA-decoder uses a Crate Map to define Slots / Crates.
to a Slot / Crate. -- examples are the Fastbus1881M
A Module belongs
and FADC250.
A Module
knows how to decode the EvData and uses EvData::Load to store data so that
Detectors, Output, and Analyzers can EvData::Get the data
R. Michaels, Dec 18, 2013 HA Software Mtg
OO Design : A verbal description of the problem
defines the classes and their relationships.
Classes
(capital, underlined)
inheritance
containment
usage
The CODA-data-decoder ( type of Event Data “EvData”) contains Event Type Handlers to
process events. The EvTypeHandlers are of type Epics, Scalers, Physics Triggers, etc
The CODA-decoder uses a Crate Map to define Slots / Crates.
to a Slot / Crate. -- examples are the Fastbus1881M
A Module belongs
and FADC250.
A Module
knows how to decode the EvData and uses EvData::Load to store data so that
Detectors, Output, and Analyzers can EvData::Get the data
OO Decoder Design, 1
EvData
inheritance
Existing class. Public interface preserved and augmented.
Modules (new class) belong to CrateSlot data member.
CodaDecoder
Existing class. New EVIO library incorporated. Support for
multiblock data structure.
EventTypeHandler
New class. Handles events. Belongs to CodaDecoder
inheritance
EpicsEventHandler
ScalerEventHandler
PhysicsEventHandler
New class. Uses parent class (EvData) to obtain event buffer.
Loads EvData’s CrateSlot data using Module methods.
R. Michaels, 12 GeV Software Review
OO Decoder Design, 2
CrateMap
Existing class. Uses database to define location of
modules and “decoder rules”
Module
New , abstract
inheritance
FastBusModule
VmeModule
New , abstract
inheritance
TDC1877
TDC1881
TDC1872
Scaler3801
FADC250
Caen550
F1TDC
How to add a new module: 1) Write a new Module class; 2) Add to
CrateMap database; 3) Data appears in EvData’s “Get” methods
R. Michaels, 12 GeV Software Review
Dec. 2013 Status : “Toy” Code written
7 New classes + small mods to existing classes
Obtain code from
https://github.com/rwmichaels/analyzer/tree/master/oodecoder
ToyCodaDecoder
ToyEvtTypeHandler
ToyPhysicsHandler
ToyScalerEvtHandler
ToyModule
ToyFastbusModule
ToyModuleX
R. Michaels, Dec 18, 2013 HA Software Mtg
A few highlights of “Toy” * Code, 1
class ToyCodaDecoder : public THaEvData {
protected:
void InitHandlers(); // initialize event type handlers
vector<ToyEvtTypeHandler *> event_handler;
}
*
Obtain code from
https://github.com/rwmichaels/analyzer/tree/master/oodecoder
R. Michaels, Dec 18, 2013 HA Software Mtg
A few highlights of “Toy” Code, 2
// Event processing in ToyCodaDecoder::LoadEvent
event_handler[event_type]->Decode(this);
THaEvData
R. Michaels, Dec 18, 2013 HA Software Mtg
A few highlights of “Toy” Code, 3
// Event processing
ToyFastbusModule::Decode(THaEvData *evdata, Int_t start) {
// index: loops from “start” to “end” of module’s data
Int_t rawdata = evdata->GetRawData(index);
while (IsSlot(rawdata) ) {
rawdata = evdata->GetRawData(index++);
Int_t chan = (rawdata & fChanMask)>>fChanShift;
Int_t mdata = (rawdata & fDataMask);
evdata->LoadData(fCrate, fSlot, chan, mdata);
}
R. Michaels, Dec 18, 2013 HA Software Mtg
OO Decoder : Summary
&
Plan
• Design -- done, checked by Ole
• “Toy” code -- done, available for scrutiny
• Beta code
test on Compton test stand (FADC, etc) May 2014
check on old HRS data
• Release for Podd
Aug 2014
Oct 2014
Goal to finish
R. Michaels, Dec 18, 2013 HA Software Mtg