39 #include <Math/VectorUtil.h>
136 if (
abs(particle.pdgId()) != 22 || particle.status() != 1)
142 closestPhoton = &particle;
162 nPhoMaps_(phoMapBranchNames_.
size()),
164 valMapBranchNames_(iConfig.getParameter<
std::
vector<
std::
string>>(
"phoMVAValMapLabels")),
165 nValMaps_(valMapBranchNames_.
size()),
167 mvaCatBranchNames_(iConfig.getParameter<
std::
vector<
std::
string>>(
"phoMVACatLabels")),
168 nCats_(mvaCatBranchNames_.
size()),
169 isMC_(iConfig.getParameter<
bool>(
"isMC")),
170 ptThreshold_(iConfig.getParameter<double>(
"ptThreshold")),
171 deltaR_(iConfig.getParameter<double>(
"deltaR")),
179 mvaPasses_(nPhoMaps_),
180 mvaValues_(nValMaps_),
182 variableHelper_(consumesCollector()),
184 nVars_(mvaVarMngr_.getNVars()),
186 doEnergyMatrix_(iConfig.getParameter<
bool>(
"doEnergyMatrix")),
187 energyMatrixSize_(iConfig.getParameter<
int>(
"energyMatrixSize")) {
189 for (
auto const&
tag : phoMapTags_) {
193 for (
auto const&
tag : valMapTags_) {
197 for (
auto const&
tag : mvaCatTags_) {
204 tree_ = fs->
make<TTree>(
"tree",
"tree");
206 tree_->Branch(
"nEvent", &nEvent_);
207 tree_->Branch(
"nRun", &nRun_);
208 tree_->Branch(
"nLumi", &nLumi_);
210 tree_->Branch(
"genNpu", &genNpu_);
211 tree_->Branch(
"matchedToGenPh", &matchedToGenPh_);
213 tree_->Branch(
"vtxN", &vtxN_);
214 tree_->Branch(
"pT", &pT_);
215 tree_->Branch(
"eta", &eta_);
218 tree_->Branch(
"energyMatrix", &energyMatrix_);
221 tree_->Branch(mvaVarMngr_.getName(
i).c_str(), &vars_[
i]);
225 for (
size_t k = 0;
k < nValMaps_; ++
k) {
226 tree_->Branch(valMapBranchNames_[
k].c_str(), &mvaValues_[
k]);
229 for (
size_t k = 0;
k < nPhoMaps_; ++
k) {
230 tree_->Branch(phoMapBranchNames_[
k].c_str(), &mvaPasses_[
k]);
233 for (
size_t k = 0;
k < nCats_; ++
k) {
234 tree_->Branch(mvaCatBranchNames_[
k].c_str(), &mvaCats_[
k]);
254 std::unique_ptr<noZS::EcalClusterLazyTools> lazyTools;
257 lazyTools = std::make_unique<noZS::EcalClusterLazyTools>(
264 int bx =
pu.getBunchCrossing();
292 for (
auto const& pho :
src->ptrs()) {
301 const auto&
seed = *(pho->superCluster()->seed());
306 for (
int iVar = 0; iVar <
nVars_; ++iVar) {
336 desc.add<std::vector<std::string>>(
"phoMVAs", {});
337 desc.add<std::vector<std::string>>(
"phoMVALabels", {});
338 desc.add<std::vector<std::string>>(
"phoMVAValMaps", {});
339 desc.add<std::vector<std::string>>(
"phoMVAValMapLabels", {});
340 desc.add<std::vector<std::string>>(
"phoMVACats", {});
341 desc.add<std::vector<std::string>>(
"phoMVACatLabels", {});
342 desc.add<
bool>(
"doEnergyMatrix",
false);
343 desc.add<
int>(
"energyMatrixSize", 2)->setComment(
"extension of crystals in each direction away from the seed");
344 desc.add<
bool>(
"isMC",
true);
345 desc.add<
double>(
"ptThreshold", 15.0);
346 desc.add<
double>(
"deltaR", 0.1);