76 const std::string& featName,
78 const std::map<std::string, double>& denominatorMap) {
79 std::map<std::string, double>::const_iterator it = denominatorMap.begin();
80 for(; it!=denominatorMap.end(); ++it) {
81 std::string FullName = featName + it->first;
82 float value =
static_cast<float>(it->second);
83 if(value <= 0. || std::isnan(value) || std::isinf(value) )
continue;
84 targetMap->
addFeature(FullName, numerator / it->second);
175 int tauConstituentType,
176 const std::map<std::string, double>& variants_SeedEt)
const {
185 bool foundIt =
false;
186 std::vector<PanTau::TauConstituent*> list_TypeConstituents;
189 if (!foundIt)
return StatusCode::SUCCESS;
191 unsigned int n_Constituents_Type = list_TypeConstituents.size();
198 std::vector<PanTau::TauConstituent*> list_TypeConstituents_SortBDT = list_TypeConstituents;
201 TLorentzVector tlv_1st_BDT;
203 if(!list_TypeConstituents_SortBDT.empty()) tlv_1st_BDT = list_TypeConstituents_SortBDT[0]->p4();
213 double sum_EtxDR = 0;
215 unsigned int num_EFOs = 0;
220 for(
unsigned int iTypeConst=0; iTypeConst<list_TypeConstituents.size(); iTypeConst++) {
223 TLorentzVector tlv_curConst = list_TypeConstituents.at(iTypeConst)->p4();
226 if (std::isnan(tlv_curConst.Pt()) || std::isinf(tlv_curConst.Pt()))
continue;
233 double hlp_Et = tlv_curConst.Et();
234 double hlp_Et2 = hlp_Et * hlp_Et;
235 double hlp_DeltaR = tlv_Reference.DeltaR(tlv_curConst);
241 sum_EtxDR += hlp_Et * hlp_DeltaR;
253 std::string prefixVARType =
"";
257 if( num_EFOs == 0 ) {
258 return StatusCode::SUCCESS;
265 for(
unsigned int iTypeConst=0; iTypeConst<n_Constituents_Type; iTypeConst++) {
267 double value_BDT = list_TypeConstituents_SortBDT[iTypeConst]->getBDTValue();
268 if( std::isnan(value_BDT) || std::isinf(value_BDT) )
continue;
272 double mvaCorrection = 0.0;
273 double etaCurConst = list_TypeConstituents_SortBDT[iTypeConst]->p4().Eta();
279 value_BDT = value_BDT - mvaCorrection;
282 std::string iConst =
m_HelperFunctions.convertNumberToString(
static_cast<double>(iTypeConst+1));
283 tauFeatureMap->
addFeature(
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_BDTValues_BDTSort_" + iConst, value_BDT);
292 unsigned int totalPhotonsInSeed = 0;
294 for(
unsigned int iConst=0; iConst<list_TypeConstituents_SortBDT.size(); iConst++) {
297 std::vector<PanTau::TauConstituent*> shotConstituents = curConst->
getShots();
298 unsigned int nShots = shotConstituents.size();
300 unsigned int totalPhotonsInNeutral = 0;
302 for(
unsigned int iShot=0; iShot<nShots; iShot++) {
306 totalPhotonsInSeed += totalPhotonsInNeutral;
311 tauFeatureMap->
addFeature(
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_NPhotonsInSeed", totalPhotonsInSeed);
319 if(curTypeName != curTypeName_All)
addFeatureWrtSeedEnergy(tauFeatureMap,
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_EtOver", sum_Et, variants_SeedEt);
321 if(tlv_1st_BDT.Pt() != 0)
addFeatureWrtSeedEnergy(tauFeatureMap,
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_1stBDTEtOver", tlv_1st_BDT.Et(), variants_SeedEt);
328 if(stddev_Et > 0.)
addFeatureWrtSeedEnergy(tauFeatureMap,
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_Et_Wrt", stddev_Et, variants_SeedEt);
338 tauFeatureMap->
addFeature(
"CellBased_" + curTypeName +
"_" + prefixVARType +
"_EtDRxTotalEt", (sum_EtxDR / sum_Et) * variants_SeedEt.at(
"EtAllConsts"));
341 return StatusCode::SUCCESS;
362 tlv_System[iType] = TLorentzVector();
363 tlv_1stEFO[iType] = TLorentzVector();
364 tlv_Sys_OK[iType] =
false;
365 tlv_1st_OK[iType] =
false;
371 if (!tlv_Sys_OK[iType])
continue;
373 std::vector<TauConstituent*> typeConstituents = inSeed->
getConstituentsOfType(iType, tlv_Sys_OK[iType]);
374 if (typeConstituents.empty()) tlv_Sys_OK[iType] =
false;
375 if (!tlv_Sys_OK[iType])
continue;
377 if (!typeConstituents.empty()) {
378 tlv_1stEFO[iType] = typeConstituents.at(0)->p4();
379 tlv_1st_OK[iType] =
true;
381 tlv_1st_OK[iType] =
false;
396 int type_Denom = iType;
401 int type_Nom = jType;
403 if(jType == iType)
continue;
408 double sum_Et_Nom = 0.0;
409 double sum_Et_Denom = 0.0;
410 if(tlv_Sys_OK[type_Nom] && tlv_Sys_OK[type_Denom]) {
411 sum_Et_Nom = tlv_System[type_Nom].Et();
412 sum_Et_Denom = tlv_System[type_Denom].Et();
416 if(jType <= iType)
continue;
419 if(sum_Et_Denom > 0. && sum_Et_Nom > 0.) {
420 tauFeatures->
addFeature(
"CellBased_" + prefixVARType +
"_Log" + typeName_Nom +
"EtOver" + typeName_Denom +
"Et", std::log10(sum_Et_Nom / sum_Et_Denom) );
423 if(tlv_1st_OK[type_Nom] && tlv_1st_OK[type_Denom]) {
425 tauFeatures->
addFeature(
"CellBased_" + prefixVARType +
"_DeltaR1st" + typeName_Nom +
"To1st" + typeName_Denom, tlv_1stEFO[type_Nom].DeltaR( tlv_1stEFO[type_Denom] ) );
432 return StatusCode::SUCCESS;