-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventProcessor.h
55 lines (48 loc) · 1.47 KB
/
EventProcessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// $Id: EventProcessor.h,v 1.10 2012/01/24 16:25:33 kirschen Exp $
//
#ifndef EVENTPROCESSOR_H
#define EVENTPROCESSOR_H
#include <vector>
#include <string>
#include "ConfigFile.h"
class Event;
class Parameters;
// -----------------------------------------------------------------
class EventProcessor
{
public:
EventProcessor(const std::string& name, const std::string& configfile,
Parameters* param);
virtual ~EventProcessor();
int process(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) {
if(active_) return preprocess(data,control1,control2);
return data.size();
}
int revert(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) {
if(active_) return postprocess(data,control1,control2);
return data.size();
}
const std::string& name() const { return name_;}
const std::string& configName() const { return configName_;}
const bool isActive() const { return active_;}
void produceControlPlots(const std::vector<std::vector<Event*>* >& samples);
protected:
virtual int preprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) = 0;
virtual int postprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) = 0;
private:
Parameters* par_;
const std::string name_;
const std::string configName_;
bool active_;
ConfigFile config_;
};
#endif