Line | |
---|
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 |
|
---|
11 | TOIBoloProducer::TOIBoloProducer() {
|
---|
12 | possibleTOIs.insert(TOI(filt2, TOI::all, "", "microVolts"));
|
---|
13 | }
|
---|
14 |
|
---|
15 | string TOIBoloProducer::getName() {
|
---|
16 | return("TOIBoloProducer 1.0");
|
---|
17 | }
|
---|
18 |
|
---|
19 |
|
---|
20 | void 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 |
|
---|
29 | set<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 |
|
---|
42 | void TOIBoloProducer::propagateLowBound(TOI const& toi, long sampleNum) {
|
---|
43 | CHKPROD
|
---|
44 | map<TOI, TOIProducer*> & need = neededTOIs[toi];
|
---|
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.