source: Sophya/trunk/ArchTOIPipe/Processors/toisqfilter.cc

Last change on this file was 1738, checked in by aubourg, 24 years ago

copyright

File size: 884 bytes
Line 
1// ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
2// Eric Aubourg
3// Christophe Magneville
4// Reza Ansari
5// $Id: toisqfilter.cc,v 1.2 2001-11-08 15:47:46 aubourg Exp $
6
7
8#include "toisqfilter.h"
9#include "toimanager.h"
10
11void TOISqFilter::init() {
12 cout << "TOISqFilter::init" << endl;
13 declareInput("signal");
14 declareOutput("out");
15 name = "sqfilt";
16 upExtra = 1;
17}
18
19void TOISqFilter::run() {
20 TOIManager* mgr = TOIManager::getManager();
21 int snb = getMinOut();
22 int sne = getMaxOut();
23
24 for (int sn = snb; sn <= sne; sn++) {
25 try {
26 double x1 = getData(0, sn);
27 double x2 = getData(0, sn+1);
28 double y = (x1+x2)/2;
29 putData(0, sn, y);
30 } catch (PException e) {
31 cout << "TOISqFilter exception " << e.Msg() << endl;
32 continue;
33 }
34 }
35}
Note: See TracBrowser for help on using the repository browser.