40 #include <Math/VectorUtil.h>
153 : isMC_(iConfig.getParameter<
bool>(
"isMC")),
154 deltaR_(iConfig.getParameter<double>(
"deltaR")),
155 ptThreshold_(iConfig.getParameter<double>(
"ptThreshold")),
158 nEleMaps_(eleMapBranchNames_.
size()),
160 valMapBranchNames_(iConfig.getParameter<
std::
vector<
std::
string>>(
"eleMVAValMapLabels")),
161 nValMaps_(valMapBranchNames_.
size()),
163 mvaCatBranchNames_(iConfig.getParameter<
std::
vector<
std::
string>>(
"eleMVACatLabels")),
164 nCats_(mvaCatBranchNames_.
size()),
172 mvaPasses_(nEleMaps_),
173 mvaValues_(nValMaps_),
175 variableHelper_(consumesCollector()),
177 nVars_(mvaVarMngr_.getNVars()),
179 doEnergyMatrix_(iConfig.getParameter<
bool>(
"doEnergyMatrix")),
180 energyMatrixSize_(iConfig.getParameter<
int>(
"energyMatrixSize")) {
182 for (
auto const&
tag : eleMapTags_) {
186 for (
auto const&
tag : valMapTags_) {
190 for (
auto const&
tag : mvaCatTags_) {
197 tree_ = fs->
make<TTree>(
"tree",
"tree");
199 tree_->Branch(
"nEvent", &nEvent_);
200 tree_->Branch(
"nRun", &nRun_);
201 tree_->Branch(
"nLumi", &nLumi_);
203 tree_->Branch(
"genNpu", &genNpu_);
204 tree_->Branch(
"vtxN", &vtxN_);
206 tree_->Branch(
"ele_q", &eleQ_);
207 tree_->Branch(
"ele_3q", &ele3Q_);
210 tree_->Branch(
"energyMatrix", &energyMatrix_);
213 tree_->Branch(
"matchedToGenEle", &matchedToGenEle_);
216 tree_->Branch(mvaVarMngr_.getName(
i).c_str(), &vars_[
i]);
218 tree_->Branch(
"ele_isEB", &eleIsEB_);
219 tree_->Branch(
"ele_isEE", &eleIsEE_);
220 tree_->Branch(
"ele_isEBEtaGap", &eleIsEBEtaGap_);
221 tree_->Branch(
"ele_isEBPhiGap", &eleIsEBPhiGap_);
222 tree_->Branch(
"ele_isEBEEGap", &eleIsEBEEGap_);
223 tree_->Branch(
"ele_isEEDeeGap", &eleIsEEDeeGap_);
224 tree_->Branch(
"ele_isEERingGap", &eleIsEERingGap_);
227 for (
size_t k = 0;
k < nValMaps_; ++
k) {
228 tree_->Branch(valMapBranchNames_[
k].c_str(), &mvaValues_[
k]);
231 for (
size_t k = 0;
k < nEleMaps_; ++
k) {
232 tree_->Branch(eleMapBranchNames_[
k].c_str(), &mvaPasses_[
k]);
235 for (
size_t k = 0;
k < nCats_; ++
k) {
236 tree_->Branch(mvaCatBranchNames_[
k].c_str(), &mvaCats_[
k]);
252 std::unique_ptr<noZS::EcalClusterLazyTools> lazyTools;
255 lazyTools = std::make_unique<noZS::EcalClusterLazyTools>(
268 int bx =
pu.getBunchCrossing();
296 for (
auto const& ele :
src->ptrs()) {
302 const auto&
seed = *(ele->superCluster()->seed());
307 eleQ_ = ele->charge();
308 ele3Q_ = ele->chargeInfo().isGsfCtfScPixConsistent;
310 for (
int iVar = 0; iVar <
nVars_; ++iVar) {
352 if (
std::abs(particle.pdgId()) != 11 || particle.status() != 1)
358 closestElectron = &particle;
362 if (closestElectron ==
nullptr ||
dR >=
deltaR_)
385 desc.add<
bool>(
"doEnergyMatrix",
false);
386 desc.add<
int>(
"energyMatrixSize", 2)->setComment(
"extension of crystals in each direction away from the seed");
387 desc.add<
bool>(
"isMC",
true);
388 desc.add<
double>(
"deltaR", 0.1);
389 desc.add<
double>(
"ptThreshold", 5.0);
390 desc.add<std::vector<std::string>>(
"eleMVAs", {});
391 desc.add<std::vector<std::string>>(
"eleMVALabels", {});
392 desc.add<std::vector<std::string>>(
"eleMVAValMaps", {});
393 desc.add<std::vector<std::string>>(
"eleMVAValMapLabels", {});
394 desc.add<std::vector<std::string>>(
"eleMVACats", {});
395 desc.add<std::vector<std::string>>(
"eleMVACatLabels", {});