source: Sophya/trunk/Poubelle/archTOI.old/toiboloproducer.cc@ 555

Last change on this file since 555 was 555, checked in by ansari, 26 years ago

portage cxx en cours

File size: 1.2 KB
RevLine 
[534]1// toiboloproducer.cc
2// Eric Aubourg CEA/DAPNIA/SPP septembre 1999
3
4#include "toiboloproducer.h"
5#include "archexc.h"
6#include "requesthandler.h"
7
8#define filt2 "boloMuV"
9
10
11TOIBoloProducer::TOIBoloProducer() {
12 possibleTOIs.insert(TOI(filt2, TOI::all, "", "microVolts"));
13}
14
15string TOIBoloProducer::getName() {
16 return("TOIBoloProducer 1.0");
17}
18
19
20void TOIBoloProducer::dataFeed(TOIProducer* source, TOI const& toi, long sampleNum, double value) {
21 if (source->canGetValue(sampleNum-1, toi)) {
22 value = (value + source->getValue(sampleNum-1, toi))/2.;
23 TOI toi2 = toi;
24 toi2.name = filt2;
25 computedValue(toi2, sampleNum, value);
26 }
27}
28
29set<TOI> TOIBoloProducer::reqTOIFor(TOI const& toi) {
30 TOI toi2 = toi;
31 set<TOI> t;
32 if (toi.name == filt2) {
33 toi2.name = "boloRawMuV";
34 t.insert(toi2);
35 } else {
36 throw ArchExc("Cannot produce "+toi.name);
37 }
38 return t;
39}
40
41
42void TOIBoloProducer::propagateLowBound(TOI const& toi, long sampleNum) {
43 CHKPROD
[555]44 map<TOI, TOIProducer*> & need = neededTOIs[toi];
[534]45 int hlen = 1;
46 for (map<TOI, TOIProducer*>::iterator i = need.begin(); i != need.end(); i++) {
47 (*i).second->wontNeedEarlier((*i).first, this, sampleNum-hlen);
48 }
49}
50
51
52
Note: See TracBrowser for help on using the repository browser.