-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiJetEventCuts.cc
68 lines (51 loc) · 1.93 KB
/
DiJetEventCuts.cc
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
56
57
58
59
60
61
62
63
64
65
66
67
//
// Event processor to perform additional (harder) cuts
// on the preselected dijet events
//
// first version: Hartmut Stadie 2008/12/14
//
#include "DiJetEventCuts.h"
#include "CalibData.h"
#include "ConfigFile.h"
#include "Parameters.h"
#include "TwoJetsPtBalanceEvent.h"
#include "CutFlow.h"
#include "progressbar.h"
#include <algorithm>
#include <iostream>
DiJetEventCuts::DiJetEventCuts(const std::string& configfile, Parameters* param)
: EventProcessor("DiJetEventCuts",configfile,param)
{
// configfile_=configfile;
}
DiJetEventCuts::~DiJetEventCuts()
{
}
typedef bool (CutFlow::*CutFlowMemFn)(Event* event);
int DiJetEventCuts::preprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2)
{
std::cout << "processing data: " <<std::endl;
CutFlow CutFlow_DATA(this->configName());
CutFlow_DATA.setAllSuppDiJetCuts();
CutFlow_DATA.setNExpectedEvents(data.size());
// int l = data.size()/100;
std::cout << "start with " << data.size() << " events... check with cutflow:"<< std::endl;
CheckDiJetCuts passCutsPredicate_DATA(&CutFlow_DATA);
std::vector<Event*>::iterator bound;
bound= partition(data.begin(),data.end(),passCutsPredicate_DATA);
data.erase(bound,data.end());
std::cout << "kept " << data.size() << " events... check with cutflow:"<< std::endl;
CutFlow_DATA.printCutFlow();
std::cout << "processing control1: " <<std::endl;
CutFlow CutFlow_CONTROL1(this->configName());
CutFlow_CONTROL1.setAllSuppDiJetCuts();
CutFlow_CONTROL1.setNExpectedEvents(control1.size());
CheckDiJetCuts passCutsPredicate_CONTROL1(&CutFlow_CONTROL1);
bound= partition(control1.begin(),control1.end(),passCutsPredicate_CONTROL1);
control1.erase(bound,control1.end());
CutFlow_CONTROL1.printCutFlow();
std::cout << "kept " << control1.size() << " events... check with cutflow:"<< std::endl;
return (data.size()+control1.size());
}