Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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

2 event_type = evbuffer[1]>>16; switch(event_type) { case EPICS_EVTYPE : ret = epics_decode(evbuffer); break; case SCALER_EVTYPE : ret = scaler_event_decode(evbuffer); break; Database defines event types An EventTypeHandler, defined for each event type, decodes the evbuffer. e.g. EpicsEventHandler ScalerEventHandler are EventTypeHandlers Motivation, 1 OLD WAY NEW WAY R. Michaels, Dec 18, 2013 HA Software Mtg

3 p = evbuffer + ipt; model = fMap->getModel(roc,slot); switch(model) { case 1182 : // LeCroy 1182 ADC for (chan = 0; chan < 8; chan++){ crateslot[roc,slot]-> loadData(chan,*p); } break; case 7510 : // Struck 7510 ADC // etc Database defines modules in crates A Module, defined for each slot in a crate, decodes the relevant portion of evbuffer e.g. LeCroy1182 Struck7510 are Modules Motivation, 2 OLD WAY NEW WAY R. Michaels, Dec 18, 2013 HA Software Mtg

4 Public Interface Will not change, but new methods added CODA Decoder Data 14 year old class in Podd R. Michaels, Dec 18, 2013 HA Software Mtg * *

5 Public Interface CODA Decoder Data AnalyzersDetectorsOutput 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

6 OO Design : A verbal description of the problem defines the classes and their relationships. 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. A Module belongs to a Slot / Crate. -- examples are the Fastbus1881M 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 Classes (capital, underlined) R. Michaels, Dec 18, 2013 HA Software Mtg

7 OO Design : A verbal description of the problem defines the classes and their relationships. 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. A Module belongs to a Slot / Crate. -- examples are the Fastbus1881M 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 Classes (capital, underlined) inheritance containment usage

8 OO Decoder Design, 1 R. Michaels, 12 GeV Software Review EvData CodaDecoder EventTypeHandler EpicsEventHandler ScalerEventHandler PhysicsEventHandler Existing class. Public interface preserved and augmented. Modules (new class) belong to CrateSlot data member. Existing class. New EVIO library incorporated. Support for multiblock data structure. New class. Handles events. Belongs to CodaDecoder New class. Uses parent class (EvData) to obtain event buffer. Loads EvDatas CrateSlot data using Module methods. inheritance

9 OO Decoder Design, 2 R. Michaels, 12 GeV Software Review CrateMap Module FastBusModule Scaler3801 FADC250 Caen550 Existing class. Uses database to define location of modules and decoder rules New, abstract How to add a new module: 1) Write a new Module class; 2) Add to CrateMap database; 3) Data appears in EvDatas Get methods inheritance VmeModule New, abstract TDC1877 TDC1881 TDC1872 F1TDC inheritance

10 Dec Status : Toy Code written ToyCodaDecoder ToyEvtTypeHandler ToyPhysicsHandler ToyScalerEvtHandler ToyModule ToyFastbusModule ToyModuleX 7 New classes + small mods to existing classes R. Michaels, Dec 18, 2013 HA Software Mtg Obtain code from https://github.com/rwmichaels/analyzer/tree/master/oodecoder

11 A few highlights of Toy Code, 1 class ToyCodaDecoder : public THaEvData { protected: void InitHandlers(); // initialize event type handlers vector event_handler; } R. Michaels, Dec 18, 2013 HA Software Mtg * * Obtain code from https://github.com/rwmichaels/analyzer/tree/master/oodecoder

12 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

13 A few highlights of Toy Code, 3 // Event processing ToyFastbusModule::Decode(THaEvData *evdata, Int_t start) { // index: loops from start to end of modules 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

14 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 Aug 2014 Release for Podd Oct 2014 OO Decoder : Summary & Plan Goal to finish R. Michaels, Dec 18, 2013 HA Software Mtg


Download ppt "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."

Similar presentations


Ads by Google