Commit 83e58c59 authored by Michel Janus's avatar Michel Janus Committed by Graeme Stewart
Browse files

adapt to PFO link naming change in TauJet_v2 (PanTauAlgs-00-06-00)

	* adapt to PFO link naming change in TauJet_v2

2014 November 25 Peter Wagner <wagner -at- physik.uni-bonn.de>
    * reverted some of the changes when tagging 00-05-25 below:
	- in Tool_InputConverter.cxx:
	  added the original pi0-tagging code as comments to insert it again for more flexibility;
	  also, energy calculation had been done correctly -> reverted back
     	- in Tool_TauConstituentSelector.cxx:
	  speed-up of ET-cut function was unnecessary
    * tag PanTauAlgs-00-05-28

2014 November 24 Peter Wagner <wagner -at- physik.uni-bonn.de>
    * updated arrangePFOLinks in Tool_DetailsArranger.cxx to use tau constituents instead of the cell-based PFOs directly
    * tag PanTauAlgs-00-05-27

2014 November 20 Peter Wagner <wagner -at- physik.uni-bonn.de>
    * re-wrote arrangePFOLinks in Tool_DetailsArranger.cxx
    * tag PanTauAlgs-00-05-26

2014 November 20 Peter Wagner <wagner -at- physik.uni-bonn.de>
...
(Long ChangeLog diff - truncated)
parent 405c28d6
......@@ -30,6 +30,7 @@
#include "PanTauInterfaces/ITool_DetailsArranger.h"
#include "PanTauInterfaces/ITool_InformationStore.h"
#include "PanTauEvent/TauConstituent.h"
namespace PanTau {
class PanTauSeed;
......@@ -82,11 +83,32 @@ namespace PanTau {
void arrangeScalarDetail(PanTau::PanTauDetails* targetDetails, std::string featName, int featEnumFromPanTauDetails) const;
void arrangeVectorDetail(PanTau::PanTauDetails* targetDetails, std::string featName, int featEnumFromPanTauDetails) const;
void arrangePFOLinks(PanTau::PanTauSeed* inSeed, xAOD::TauJet* tauJet);
std::vector<unsigned int> helper_IndicesOfNeutralsToBePi0( std::vector< ElementLink<xAOD::PFOContainer> > neutralPFOLinks, int nMaxPi0s);
int helper_CopyNeutralsAndSetPi0(xAOD::TauJet* tauJet, int nMaxPi0s, bool isSpecialCase_1pXnTo1p1n);
std::vector< ElementLink< xAOD::PFOContainer > > PreselectNeutralLinks(std::vector< ElementLink<xAOD::PFOContainer> > neutralPFOLinks, xAOD::TauJet* tauJet);
void StripPi0ConstsFromNeutralConsts(std::vector< ElementLink< xAOD::PFOContainer > > &neutralPFOLinks, std::vector< ElementLink< xAOD::PFOContainer > > pi0PFOLinks);
bool HasMultPi0sInOneCluster(const xAOD::PFO* pfo, int decayModeProto, TString inputAlg);
void SetNeutralConstituentMass(xAOD::PFO* neutral_pfo, double mass);
void SetNeutralConstituentVectorMasses(std::vector< ElementLink<xAOD::PFOContainer> > neutralPFOLinks, double mass);
std::vector< ElementLink< xAOD::PFOContainer > > CollectConstituentsAsPFOLinks( PanTau::PanTauSeed* inSeed, std::vector< ElementLink< xAOD::PFOContainer > > cellbased_neutralPFOLinks, PanTau::TauConstituent::Type type );
/* std::vector<unsigned int> helper_IndicesOfNeutralsToBePi0(xAOD::TauJet* tauJet, */
/* std::vector< ElementLink<xAOD::PFOContainer> > neutralPFOLinks, */
/* int nMaxPi0s); */
/* int helper_CopyNeutralsAndSetPi0(xAOD::TauJet* tauJet, int nMaxPi0s, bool isSpecialCase_1pXnTo1p1n); */
bool m_expectInvalidFeatures;
const float MASS_PI0 = 134.98; // in MeV
double m_CoreCone;
std::vector<double> m_EtaBinEdges;
std::vector<double> m_EtaBinnedEtCuts;
std::string m_varTypeName_Sum;
std::string m_varTypeName_Ratio;
std::string m_varTypeName_EtInRing;
......
......@@ -42,6 +42,8 @@ use GeoPrimitives GeoPrimitives-* DetectorDescript
public
# Specify required ROOT components to cmake (transparent to CMT)
apply_pattern cmake_add_command command="find_package(ROOT COMPONENTS MathCore MathMore Matrix TMVA)"
apply_pattern declare_runtime files="../data/*.root ../data/weights/*.txt ../data/weights/*.xml"
......@@ -52,5 +54,4 @@ library PanTauAlgs *.cxx components/*.cxx
private
apply_tag ROOTBasicLibs
apply_tag ROOTMathLibs
macro_append ROOT_linkopts " -lTMVA"
apply_tag ROOTTMVALibs
......@@ -251,7 +251,7 @@ StatusCode PanTau::Alg_SeedBuilder::execute() {
l_List_SelectedTauConstituents,
l_List_TauConstituents, pantauSeed_TechnicalQuality);
unsigned int nPi0LinksCellBased = curTauJet->cellBased_Pi0_PFOLinks().size();
unsigned int nPi0LinksCellBased = curTauJet->protoPi0PFOLinks().size();
ATH_MSG_DEBUG("Created new PanTauSeed at " << curPanTauSeed << " with proto mode " << curPanTauSeed->getDecayModeBySubAlg() << " and nPi0 CellBased = " << nPi0LinksCellBased);
// Get the features for this PanTauSeed
......@@ -300,6 +300,8 @@ StatusCode PanTau::Alg_SeedBuilder::execute() {
ATH_MSG_DEBUG("===> PanTauSeed " << iPanTau+1 << " / " << l_Number_InputSeeds << " will be finalized now...");
PanTau::PanTauSeed* curPanTauSeed = l_Container_PanTauSeeds->at(iPanTau);
// 1. call decay mode determinator for this seed
ATH_MSG_DEBUG("calling decay mode determinator for valid seed ");
CHECK( m_Tool_DecayModeDeterminator->determineDecayMode(curPanTauSeed) );
......@@ -345,26 +347,24 @@ void PanTau::Alg_SeedBuilder::fillDefaultValuesToTau(xAOD::TauJet* tauJet) {
if(m_Name_InputAlg == "CellBased") {
tauJet->setP4(xAOD::TauJetParameters::PanTauCellBasedProto, -1111., -1111., -1111., -1111.);
tauJet->setP4(xAOD::TauJetParameters::PanTauCellBased, -1111., -1111., -1111., -1111.);
//
//charged
std::vector< ElementLink< xAOD::PFOContainer > > chrgPFOLinks = tauJet->cellBased_Charged_PFOLinks();
tauJet->setCharged_PFOLinks(chrgPFOLinks);
std::vector< ElementLink< xAOD::PFOContainer > > chrgPFOLinks = tauJet->protoChargedPFOLinks();
tauJet->setChargedPFOLinks(chrgPFOLinks);
//pi0
std::vector< ElementLink< xAOD::PFOContainer > > pi0PFOLinks = tauJet->cellBased_Pi0_PFOLinks();
tauJet->setPi0_PFOLinks(pi0PFOLinks);
std::vector< ElementLink< xAOD::PFOContainer > > pi0PFOLinks = tauJet->protoPi0PFOLinks();
tauJet->setPi0PFOLinks(pi0PFOLinks);
//neutrals
std::vector< ElementLink< xAOD::PFOContainer > > neutralPFOLinks = tauJet->cellBased_Neutral_PFOLinks();
tauJet->setNeutral_PFOLinks(neutralPFOLinks);
std::vector< ElementLink< xAOD::PFOContainer > > neutralPFOLinks = tauJet->protoNeutralPFOLinks();
tauJet->setNeutralPFOLinks(neutralPFOLinks);
}
if(m_Name_InputAlg == "eflowRec") {
tauJet->setP4(xAOD::TauJetParameters::PanTauEFlowRecProto, -1111., -1111., -1111., -1111.);
tauJet->setP4(xAOD::TauJetParameters::PanTauEFlowRec, -1111., -1111., -1111., -1111.);
}
......
......@@ -99,15 +99,15 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
bool noSelConstituents = inSeed->isOfTechnicalQuality(PanTau::PanTauSeed::t_NoSelectedConstituents);
bool invalidForDecayMode = (noValidInput || noAnyConstituents || noSelConstituents);
if(invalidForDecayMode) {
ATH_MSG_DEBUG("Seed has no constituents assigned and/or input seed has no substructure info - use default mode for this");
features->addFeature(inAlgName + "_" + m_varTypeName_Prefix_Basic + "_RecoMode", PanTau::TauClassificationTypes::Reco_InvalidInSeed);
ATH_MSG_DEBUG("Seed has no constituents assigned and/or input seed has no substructure info - use NotSet mode for this");
features->addFeature(inAlgName + "_" + m_varTypeName_Prefix_Basic + "_RecoMode_PanTau", PanTau::PanTauSeed::Mode_NotSet);
return StatusCode::SUCCESS;
}
//get the mode as it was determined by the subalgorithm
int decayMode_SubAlg = inSeed->getDecayModeBySubAlg();
int decayMode_PanTau = PanTau::PanTauSeed::t_Mode_NotSet;
int decayMode_PanTau = PanTau::PanTauSeed::Mode_NotSet;
//and calc the number of additional neutrals, not tagged as pi0
int nCharged_SubAlg = inSeed->getNumberOfConstituentsOfType(PanTau::TauConstituent::t_Charged);
......@@ -146,14 +146,14 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
double bdtResponse = -5;
DecayModeTest bdtTest = t_UnknownTest;
// 1p0n mode
if(decayMode_SubAlg == PanTauSeed::t_Mode_1p0n) {
if(decayMode_SubAlg == PanTau::PanTauSeed::Mode_1p0n) {
//1 prong, and no other objects at all -> use 1p0n
if(AdditionalNeutrals == 0) {
ATH_MSG_DEBUG("Set 1p0n because there is only one object");
decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p0n;
decayMode_PanTau = PanTau::PanTauSeed::Mode_1p0n;
bdtResponse = -3.;
//if there are neutrals which are not pi0-tagged, check BDT to maybe set 1p1n
} else {
......@@ -164,8 +164,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING: problems getting bdt response for 1p0n + X-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse > BDTCutValue_R10X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p0n;
if(bdtResponse <= BDTCutValue_R10X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p1n;
if(bdtResponse > BDTCutValue_R10X) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p0n;
if(bdtResponse <= BDTCutValue_R10X) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p1n;
ATH_MSG_DEBUG("R10X: Response is: " << bdtResponse << " Use 1p0n if > " << BDTCutValue_R10X << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
}
......@@ -177,7 +177,7 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
//1p1n mode
else if (decayMode_SubAlg == PanTau::PanTauSeed::t_Mode_1p1n) {
else if (decayMode_SubAlg == PanTau::PanTauSeed::Mode_1p1n) {
//1prong, 1pi0 and no other neutrals. check 1p0n-vs-1p1n
......@@ -189,8 +189,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING problems getting bdt response for 1p1n + 0-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse <= BDTCutValue_R110) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p1n;
if(bdtResponse > BDTCutValue_R110) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p0n;
if(bdtResponse <= BDTCutValue_R110) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p1n;
if(bdtResponse > BDTCutValue_R110) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p0n;
ATH_MSG_DEBUG("R110: Response is: " << bdtResponse << " Use 1p0n if > " << BDTCutValue_R110 << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
......@@ -205,8 +205,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING problems getting bdt response for 1p1n + X-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse > BDTCutValue_R11X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p1n;
if(bdtResponse <= BDTCutValue_R11X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1pXn;
if(bdtResponse > BDTCutValue_R11X) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p1n;
if(bdtResponse <= BDTCutValue_R11X) decayMode_PanTau = PanTau::PanTauSeed::Mode_1pXn;
ATH_MSG_DEBUG("R11X: Response is: " << bdtResponse << " Use 1p1n if > " << BDTCutValue_R11X << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
}
......@@ -217,7 +217,7 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
//1pXn mode
else if (decayMode_SubAlg == PanTau::PanTauSeed::t_Mode_1pXn) {
else if (decayMode_SubAlg == PanTau::PanTauSeed::Mode_1pXn) {
//1prong, Xpi0. check 1p1n-vs-1pXn
bool isOK = false;
......@@ -227,8 +227,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING problems getting bdt response for 1p1n + X-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse > BDTCutValue_R1XX) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1p1n;
if(bdtResponse <= BDTCutValue_R1XX) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1pXn;
if(bdtResponse > BDTCutValue_R1XX) decayMode_PanTau = PanTau::PanTauSeed::Mode_1p1n;
if(bdtResponse <= BDTCutValue_R1XX) decayMode_PanTau = PanTau::PanTauSeed::Mode_1pXn;
ATH_MSG_DEBUG("R1XX: Response is: " << bdtResponse << " Use 1p1n if > " << BDTCutValue_R1XX << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
......@@ -238,13 +238,13 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
//3p0n mode
else if (decayMode_SubAlg == PanTau::PanTauSeed::t_Mode_3p0n) {
else if (decayMode_SubAlg == PanTau::PanTauSeed::Mode_3p0n) {
//no additional neutrals.
if(AdditionalNeutrals == 0) {
ATH_MSG_DEBUG("Set 3p0n because there are only charged objects");
decayMode_PanTau = PanTau::PanTauSeed::t_Mode_3p0n;
decayMode_PanTau = PanTau::PanTauSeed::Mode_3p0n;
bdtResponse = -2.5;
//additional neutrals
} else {
......@@ -256,8 +256,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING problems getting bdt response for 3p0n + X-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse > BDTCutValue_R30X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_3p0n;
if(bdtResponse <= BDTCutValue_R30X) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_3pXn;
if(bdtResponse > BDTCutValue_R30X) decayMode_PanTau = PanTau::PanTauSeed::Mode_3p0n;
if(bdtResponse <= BDTCutValue_R30X) decayMode_PanTau = PanTau::PanTauSeed::Mode_3pXn;
ATH_MSG_DEBUG("R30X: Response is: " << bdtResponse << " Use 3p0n if > " << BDTCutValue_R30X << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
......@@ -269,7 +269,7 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
//3pXn mode
else if (decayMode_SubAlg == PanTau::PanTauSeed::t_Mode_3pXn) {
else if (decayMode_SubAlg == PanTau::PanTauSeed::Mode_3pXn) {
//3prong, Xpi0. check 3p0n-vs-3pXn
bool isOK = false;
......@@ -279,8 +279,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
ATH_MSG_DEBUG("WARNING problems getting bdt response for 3p0n + X-neutrals. use subAlg mode");
decayMode_PanTau = decayMode_SubAlg;
} else {
if(bdtResponse > BDTCutValue_R3XX) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_3p0n;
if(bdtResponse <= BDTCutValue_R3XX) decayMode_PanTau = PanTau::PanTauSeed::t_Mode_3pXn;
if(bdtResponse > BDTCutValue_R3XX) decayMode_PanTau = PanTau::PanTauSeed::Mode_3p0n;
if(bdtResponse <= BDTCutValue_R3XX) decayMode_PanTau = PanTau::PanTauSeed::Mode_3pXn;
ATH_MSG_DEBUG("R3XX: Response is: " << bdtResponse << " Use 3p0n if > " << BDTCutValue_R3XX << " -- decision: " << PanTau::PanTauSeed::getDecayModeName(decayMode_PanTau) );
}
......@@ -292,8 +292,8 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
//it's none of 1p0n, 1p1n, 1pXn, 3p0n, 3pXn -> set other mode
else {
ATH_MSG_DEBUG("WARNING SubAlg mode of tau is not known. set the 'other' mode");
decayMode_PanTau = PanTau::PanTauSeed::t_Mode_Other;
bdtResponse = -5;
decayMode_PanTau = PanTau::PanTauSeed::Mode_Other;
bdtResponse = -4;
bdtTest = t_UnknownTest;
}
......@@ -321,9 +321,10 @@ StatusCode PanTau::Tool_DecayModeDeterminator::determineDecayMode(PanTau::PanTau
}
ATH_MSG_DEBUG("Counted " << nPhotons << " photons in the pi0 neutral");
if(nPhotons > 2) {
decayMode_SubAlg = PanTau::PanTauSeed::t_Mode_1pXn;
decayMode_PanTau = PanTau::PanTauSeed::t_Mode_1pXn;
decayMode_SubAlg = PanTau::PanTauSeed::Mode_1pXn;
decayMode_PanTau = PanTau::PanTauSeed::Mode_1pXn;
inSeed->setModeHackedByCellBased(true);
bdtResponse = -2.;
}
//end check for pi0 neutrals were found
......
......@@ -166,7 +166,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
consts_Pi0NeutralUpdate.push_back(hlv_SumPi0);
// nPi0AfterPanTau = 1;
} else if(mode_PanTau != PanTau::PanTauSeed::t_Mode_3pXn) {
} else if(mode_PanTau != PanTau::PanTauSeed::Mode_3pXn) {
ATH_MSG_DEBUG("Non 3pXn mode");
//Just use the same objects as CellBased if the mode was not altered (and is not 3pXn)
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
......@@ -196,7 +196,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
bool updatedMomentum = false;
// 1p0n -> 1p1n
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_1p0n && mode_PanTau == PanTau::PanTauSeed::t_Mode_1p1n) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_1p0n && mode_PanTau == PanTau::PanTauSeed::Mode_1p1n) {
ATH_MSG_DEBUG("\t1p0n -> 1p1n: Use tracks & highest pi0 score neutral");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
if(consts_Neutral.size() > 0) {
......@@ -209,7 +209,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
}
// 1p1n -> 1p0n
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_1p1n && mode_PanTau == PanTau::PanTauSeed::t_Mode_1p0n) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_1p1n && mode_PanTau == PanTau::PanTauSeed::Mode_1p0n) {
ATH_MSG_DEBUG("\t1p1n -> 1p0n: Use tracks only");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
// nPi0AfterPanTau = 0;
......@@ -217,7 +217,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
}
// 1p1n -> 1pXn
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_1p1n && mode_PanTau == PanTau::PanTauSeed::t_Mode_1pXn) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_1p1n && mode_PanTau == PanTau::PanTauSeed::Mode_1pXn) {
ATH_MSG_DEBUG("\t1p1n -> 1pXn: Use tracks, the pi0 from sub alg and highest pi0 score neutral");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
......@@ -236,7 +236,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
}
// 1pXn -> 1p1n
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_1pXn && mode_PanTau == PanTau::PanTauSeed::t_Mode_1p1n) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_1pXn && mode_PanTau == PanTau::PanTauSeed::Mode_1p1n) {
ATH_MSG_DEBUG("\t1pXn -> 1p1n: Use tracks & both pi0 from sub alg with mass 0");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
......@@ -263,7 +263,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
}
// 3p0n -> 3pXn
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_3p0n && mode_PanTau == PanTau::PanTauSeed::t_Mode_3pXn) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_3p0n && mode_PanTau == PanTau::PanTauSeed::Mode_3pXn) {
ATH_MSG_DEBUG("\t3p0n -> 3pXn: Use tracks & best pi0 score neutral");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
......@@ -277,7 +277,7 @@ StatusCode PanTau::Tool_FourMomentumCalculator::calculateFourMomentum(PanTau::Pa
}
// 3pXn -> 3p0n
if(mode_SubAlg == PanTau::PanTauSeed::t_Mode_3pXn && mode_PanTau == PanTau::PanTauSeed::t_Mode_3p0n) {
if(mode_SubAlg == PanTau::PanTauSeed::Mode_3pXn && mode_PanTau == PanTau::PanTauSeed::Mode_3p0n) {
ATH_MSG_DEBUG("\t3pXn -> 3p0n: Use tracks only");
for(unsigned int iChrg=0; iChrg<subAlg_NCharged; iChrg++) hlv_PanTau_Final += consts_Charged.at(iChrg)->hlv();
// nPi0AfterPanTau = 0;
......
......@@ -19,6 +19,9 @@
//! PanTau includes
#include "PanTauAlgs/Tool_InformationStore.h"
// ROOT includes
#include "TVector2.h"
// #include "tauEvent/TauJetContainer.h"
#include "xAODTau/TauJetContainer.h"
......@@ -73,7 +76,7 @@ StatusCode PanTau::Tool_InformationStore::initialize() {
// }
StatusCode PanTau::Tool_InformationStore::updateInformation(std::string inputAlg) {
StatusCode PanTau::Tool_InformationStore::updateInformation(std::string /*inputAlg*/) {
//get the tauRec container
StatusCode sc = m_sgSvc->retrieve(m_Container_TauRec, m_Name_Container_TauRec);
......@@ -231,7 +234,8 @@ void PanTau::Tool_InformationStore::checkEFOContainer(const eflowObjectContainer
const eflowObject* goodEFO = outputContainer->at(jEFO);
double diff_Et = fabs(goodEFO->et() - cur_Et);
double diff_Eta = fabs(goodEFO->eta() - cur_Eta);
double diff_Phi = fabs(goodEFO->phi() - cur_Phi);
//double diff_Phi = fabs(goodEFO->phi() - cur_Phi); // bug! shouldn't matter much but nevertheless...
double diff_Phi = fabs( TVector2::Phi_mpi_pi( goodEFO->phi() - cur_Phi ) );
double diff_m = fabs(goodEFO->m() - cur_M);
if(diff_Et < 0.000001 && diff_Eta < 0.000001 && diff_Phi < 0.000001 && diff_m < 0.000001 ) {
......
......@@ -162,9 +162,9 @@ StatusCode PanTau::Tool_InputConverter::ConvertToTauConstituent(xAOD::PFO* pfo,
itsTypeFlags[(int)PanTau::TauConstituent::t_NoType] = 1;
double mvaValue = PanTau::TauConstituent::DefaultBDTValue();
double dEta = tauJet->etaIntermediateAxis() - pfo->eta();
double dPhi = tauJet->phiIntermediateAxis() - pfo->phi();
double deltaR_toTauJet = sqrt( dEta*dEta + dPhi*dPhi );
TLorentzVector hlv_intAxis = tauJet->p4(xAOD::TauJetParameters::IntermediateAxis);
double deltaR_toTauJet = hlv_intAxis.DeltaR( pfo->p4() );
if(deltaR_toTauJet > m_Config_TauConstituents_Types_DeltaRCore) {
if(pfoCharge != 0) {
......@@ -192,24 +192,62 @@ StatusCode PanTau::Tool_InputConverter::ConvertToTauConstituent(xAOD::PFO* pfo,
bool isThreeProng = false;
if(tauJet->nTracks() == 3) isThreeProng = true;
// ATH_MSG_DEBUG("numTrack = " << tauJet->nTracks() << ", is Threeprong = " << isThreeProng);
/*
// original code by Christian; allows to configure the BDT cuts in a
// config file - might give more flexibility than the cell-based code
// below!
int etaBinIndex = -1;
if(algName == "CellBased") etaBinIndex = m_Tool_HelperFunctions->getBinIndex(m_Config_CellBased_BinEdges_Eta, fabs(pfo->eta()) );
if(algName == "eflowRec") etaBinIndex = m_Tool_HelperFunctions->getBinIndex(m_Config_eflowRec_BinEdges_Eta, fabs(pfo->eta()) );
if(isThreeProng == false) {
double minMVAValue = -5;
if(algName == "CellBased") minMVAValue = m_Config_CellBased_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex);
if(algName == "eflowRec") minMVAValue = m_Config_eflowRec_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex);
if(mvaValue > minMVAValue) itsTypeFlags[(int)PanTau::TauConstituent::t_Pi0Neut] = 1;
}
if(isThreeProng == true) {
double minMVAValue = -5;
if(algName == "CellBased") minMVAValue = m_Config_CellBased_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex);
if(algName == "eflowRec") minMVAValue = m_Config_eflowRec_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex);
if(mvaValue > minMVAValue) itsTypeFlags[(int)PanTau::TauConstituent::t_Pi0Neut] = 1;
}
// end: original code
*/
if(algName == "CellBased"){
int nPi0sPerCluster = 0;
if( !pfo->attribute(xAOD::PFODetails::nPi0Proto, nPi0sPerCluster) ) {
ATH_MSG_WARNING("WARNING: Could not retrieve nPi0Proto. Will set it to 1.");
nPi0sPerCluster = 1;
}
if(nPi0sPerCluster > 0) itsTypeFlags[(int)PanTau::TauConstituent::t_Pi0Neut] = 1;
}
if(algName == "eflowRec"){
int etaBinIndex = -1;
etaBinIndex = m_Tool_HelperFunctions->getBinIndex(m_Config_eflowRec_BinEdges_Eta, fabs(pfo->eta()) );
int etaBinIndex = -1;
if(algName == "CellBased") etaBinIndex = m_Tool_HelperFunctions->getBinIndex(m_Config_CellBased_BinEdges_Eta, fabs(pfo->eta()) );
if(algName == "eflowRec") etaBinIndex = m_Tool_HelperFunctions->getBinIndex(m_Config_eflowRec_BinEdges_Eta, fabs(pfo->eta()) );
if(isThreeProng == false) {
if(isThreeProng == false) {
double minMVAValue = -5;
if(algName == "CellBased") minMVAValue = m_Config_CellBased_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex);
if(algName == "eflowRec") minMVAValue = m_Config_eflowRec_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex);
minMVAValue = m_Config_eflowRec_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex);
if(mvaValue > minMVAValue) itsTypeFlags[(int)PanTau::TauConstituent::t_Pi0Neut] = 1;
}
}
if(isThreeProng == true) {
if(isThreeProng == true) {
double minMVAValue = -5;
if(algName == "CellBased") minMVAValue = m_Config_CellBased_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex);
if(algName == "eflowRec") minMVAValue = m_Config_eflowRec_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex);
if(mvaValue > minMVAValue) itsTypeFlags[(int)PanTau::TauConstituent::t_Pi0Neut] = 1;
}
}
}
}
}//end if pfo is in core
......
......@@ -110,14 +110,14 @@ StatusCode PanTau::Tool_TauConstituentGetter::GetTauConstituents(//const Analysi
//loop over chared PFOs
ATH_MSG_DEBUG("Get charged ones...");
unsigned int nChargedPFO = 0;
if(algName == "eflowRec") nChargedPFO = tauJet->nEflowRec_Charged_PFOs();
if(algName == "CellBased") nChargedPFO = tauJet->nCellBased_Charged_PFOs();
if(algName == "eflowRec") nChargedPFO = tauJet->nProtoChargedPFOs();
if(algName == "CellBased") nChargedPFO = tauJet->nProtoChargedPFOs();
ATH_MSG_DEBUG("Charged PFOs: " << nChargedPFO);
for(unsigned int iChrgPFO=0; iChrgPFO<nChargedPFO; iChrgPFO++) {
xAOD::PFO* curChrgPFO = 0;
if(algName == "eflowRec") curChrgPFO = const_cast<xAOD::PFO*>(tauJet->eflowRec_Charged_PFO( iChrgPFO ));
if(algName == "CellBased") curChrgPFO = const_cast<xAOD::PFO*>(tauJet->cellBased_Charged_PFO( iChrgPFO ));
if(algName == "eflowRec") curChrgPFO = const_cast<xAOD::PFO*>(tauJet->protoChargedPFO( iChrgPFO ));
if(algName == "CellBased") curChrgPFO = const_cast<xAOD::PFO*>(tauJet->protoChargedPFO( iChrgPFO ));
if(enableXAODHacks == 1) {
ATH_MSG_DEBUG("EnableXAODMigrationHacks is true -> call vertex correctio for charged PFOs to check whether it runs & does something");
......@@ -149,14 +149,14 @@ StatusCode PanTau::Tool_TauConstituentGetter::GetTauConstituents(//const Analysi
// ATH_MSG_DEBUG("Get pi0 ones...");
unsigned int nPi0PFO = 0;
if(algName == "eflowRec") nPi0PFO = tauJet->nEflowRec_Pi0_PFOs();
if(algName == "CellBased") nPi0PFO = tauJet->nCellBased_Pi0_PFOs();
if(algName == "eflowRec") nPi0PFO = tauJet->nProtoPi0PFOs();
if(algName == "CellBased") nPi0PFO = tauJet->nProtoPi0PFOs();
ATH_MSG_DEBUG("Pi0 tagged PFOs in neutral PFOs: " << nPi0PFO);
//
// for(unsigned int iPi0PFO=0; iPi0PFO<nPi0PFO; iPi0PFO++) {
// xAOD::PFO* curPi0PFO = 0;
// if(algName == "eflowRec") curPi0PFO = const_cast<xAOD::PFO*>(tauJet->eflowRec_pi0_PFO( iPi0PFO ));
// if(algName == "CellBased") curPi0PFO = const_cast<xAOD::PFO*>(tauJet->cellbased_pi0_PFO( iPi0PFO ));
// if(algName == "eflowRec") curPi0PFO = const_cast<xAOD::PFO*>(tauJet->protopi0PFO( iPi0PFO ));
// if(algName == "CellBased") curPi0PFO = const_cast<xAOD::PFO*>(tauJet->protopi0PFO( iPi0PFO ));
//
// // Call vertex correction here
// m_Tool_HelperFunctions->vertexCorrection_PFOs(tauJet, curPi0PFO);
......@@ -180,14 +180,14 @@ StatusCode PanTau::Tool_TauConstituentGetter::GetTauConstituents(//const Analysi
//loop over neutral PFOs
ATH_MSG_DEBUG("Get neutral ones...");
unsigned int nNeutPFO = 0;
if(algName == "eflowRec") nNeutPFO = tauJet->nEflowRec_Neutral_PFOs();
if(algName == "CellBased") nNeutPFO = tauJet->nCellBased_Neutral_PFOs();
if(algName == "eflowRec") nNeutPFO = tauJet->nProtoNeutralPFOs();
if(algName == "CellBased") nNeutPFO = tauJet->nProtoNeutralPFOs();
ATH_MSG_DEBUG("Neutral PFOs: " << nNeutPFO);
for(unsigned int iNeutPFO=0; iNeutPFO<nNeutPFO; iNeutPFO++) {
xAOD::PFO* curNeutPFO = 0;
if(algName == "eflowRec") curNeutPFO = const_cast<xAOD::PFO*>(tauJet->eflowRec_Neutral_PFO( iNeutPFO ));
if(algName == "CellBased") curNeutPFO = const_cast<xAOD::PFO*>(tauJet->cellBased_Neutral_PFO( iNeutPFO ));
if(algName == "eflowRec") curNeutPFO = const_cast<xAOD::PFO*>(tauJet->protoNeutralPFO( iNeutPFO ));
if(algName == "CellBased") curNeutPFO = const_cast<xAOD::PFO*>(tauJet->protoNeutralPFO( iNeutPFO ));
// Call vertex correction here
m_Tool_HelperFunctions->vertexCorrection_PFOs(tauJet, curNeutPFO);
......
......@@ -74,7 +74,6 @@ double PanTau::Tool_TauConstituentSelector::getEtCut(double eta, PanTau::TauCons
default:
return 9999999.;
}
}
}
......@@ -155,10 +154,13 @@ bool PanTau::Tool_TauConstituentSelector::passesSelection_NeutralConstituent(
double curEta = hlv_Constituent.eta();
double cut_MinEt = getEtCut(fabs(curEta), PanTau::TauConstituent::t_Neutral);
double curEt = hlv_Constituent.et();
ATH_MSG_DEBUG("curEt (" << curEt << ") < cut_MinEt (" << cut_MinEt << ") ?");
if(curEt < cut_MinEt) {
ATH_MSG_DEBUG("\tNot using constituent at eta " << curEta << " with et of " << curEt);
return false;
}
ATH_MSG_DEBUG("Passed!");
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment