-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathProtonsFiller.cc
More file actions
42 lines (31 loc) · 1.03 KB
/
ProtonsFiller.cc
File metadata and controls
42 lines (31 loc) · 1.03 KB
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
#include "../interface/ProtonsFiller.h"
#include "DataFormats/Common/interface/RefToPtr.h"
ProtonsFiller::ProtonsFiller(std::string const& _name, edm::ParameterSet const& _cfg, edm::ConsumesCollector& _coll) :
FillerBase(_name, _cfg)
{
//if (isRealData_)
getToken_(protonsToken_, _cfg, _coll, "protons");
}
void
ProtonsFiller::branchNames(panda::utils::BranchList& _eventBranches, panda::utils::BranchList&) const
{
//if (isRealData_)
_eventBranches.emplace_back("protons");
}
void
ProtonsFiller::fill(panda::Event& _outEvent, edm::Event const& _inEvent, edm::EventSetup const& _setup)
{
//if (!isRealData_)
//return;
auto& inProtons(getProduct_(_inEvent, protonsToken_));
auto& outProtons(_outEvent.protons);
for (auto& inProton : inProtons) {
auto& outProton(outProtons.create_back());
outProton.x = inProton.getX();
outProton.xUnc = inProton.getXUnc();
outProton.y = inProton.getY();
outProton.yUnc = inProton.getYUnc();
outProton.rpId = inProton.getRPId();
}
}
DEFINE_TREEFILLER(ProtonsFiller);