Commit 5d41979e authored by Daniele Zanzi's avatar Daniele Zanzi Committed by Graeme Stewart
Browse files

bug fix for singlepion chains (ATR-13841) (TrigTauHypo-00-06-84)

	* bug fix for singlepion chains
	* TrigTauHypo-00-06-84

2016-05-07 Daniele Zanzi
	* move to r21 tau EDM
	* TrigTauHypo-00-06-83

2016-05-06 Daniele Zanzi
	* kaon-kaon, kaon-pion and pion-pion inv mass calculations (ATR-13841)
	* TrigTauHypo-00-06-82
parent 018086a1
......@@ -48,6 +48,9 @@ class EFTauDiKaonHypo : public HLT::HypoAlgo {
float m_massTrkSysMax;
float m_massTrkSysKaonMin;
float m_massTrkSysKaonMax;
float m_massTrkSysKaonPiMin;
float m_massTrkSysKaonPiMax;
float m_targetMassTrkSysKaonPi;
float m_EtCalibMin;
float m_leadTrkPtMin;
int m_nTrackMax;
......@@ -61,6 +64,7 @@ class EFTauDiKaonHypo : public HLT::HypoAlgo {
/** variables used for cuts in hypo algorithm */
float m_massTrkSys;
float m_massTrkSysKaon;
float m_massTrkSysKaonPi;
float m_leadTrkPt;
float m_EtCalib;
int m_nTrack;
......@@ -73,6 +77,7 @@ class EFTauDiKaonHypo : public HLT::HypoAlgo {
int m_cutCounter;
float m_massTrkSysAccepted;
float m_massTrkSysKaonAccepted;
float m_massTrkSysKaonPiAccepted;
float m_leadTrkPtAccepted;
float m_ptAccepted;
float m_nTrackAccepted;
......
......@@ -44,8 +44,8 @@ class TrigTauHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
elif (myName.find("tracktwo") > -1 or myName.find("loose1") > -1 or myName.find("medium1") > -1 or myName.find("tight1") > -1 or myName.find("FTK") > -1):
cuts=['Input','has tau details','E_{T} calib','tk. number','score cut', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
elif (myName.find("dikaon") > -1 or myName.find("singlepion") > -1):
cuts=['Input','E_{T} calib','tk. number','lead tr pt','massTrkSys','massTrkSysKaon','EMPOverTrkSysP', 'etOverPtLeadTrk', 'dRmax', ' ', ' ', ' ', ' ']
elif (myName.find("kaon") > -1 or myName.find("pion") > -1):
cuts=['Input', 'tau cand' ,'E_{T} calib','tk. number','lead tr pt','massTrkSys','massTrkSysKaon','massTrkSysKaonPi','EMPOverTrkSysP', 'etOverPtLeadTrk', 'dRmax', ' ', ' ', ' ', ' ']
elif myName.find("ditau") > -1:
cuts=['Input','good vtx/trk', 'match', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
......@@ -327,6 +327,7 @@ class EFTauDiKaonHypoOnlineMonitoring(TrigTauHypoOnlineMonitoring):
self.Histograms += [defineHistogram('NWideTrack',type='TH1F',title='Tau nWideTrack Passed', xbins=10, xmin=-0.5,xmax=9.5)]
self.Histograms += [defineHistogram('MassTrkSys',type='TH1F',title='Tau massTrkSys Passed', xbins=50, xmin=0.,xmax=2000.)]
self.Histograms += [defineHistogram('MassTrkSysKaon',type='TH1F',title='Tau massTrkSysKaon Passed', xbins=50, xmin=0.,xmax=2000.)]
self.Histograms += [defineHistogram('MassTrkSysKaonPi',type='TH1F',title='Tau massTrkSysKaonPi Passed', xbins=50, xmin=0.,xmax=2000.)]
self.Histograms += [defineHistogram('LeadTrkPt',type='TH1F',title='Tau leadTrkPt Passed', xbins=50, xmin=0.,xmax=50000.)]
self.Histograms += [defineHistogram('DR',type='TH1F',title='Tau dRmax Passed', xbins=40, xmin=0.,xmax=0.4)]
self.Histograms += [defineHistogram('EtOverPtLeadTrk',type='TH1F',title='Tau etOverPtLeadTrk Passed', xbins=50, xmin=0.,xmax=5.)]
......
......@@ -44,11 +44,14 @@ EFTauDiKaonHypo::EFTauDiKaonHypo(const std::string& name,
declareProperty("massTrkSysMax", m_massTrkSysMax = 1000000000.);
declareProperty("massTrkSysKaonMin", m_massTrkSysKaonMin = 0.);
declareProperty("massTrkSysKaonMax", m_massTrkSysKaonMax = 1000000000.);
declareProperty("massTrkSysKaonPiMin", m_massTrkSysKaonPiMin = 0.);
declareProperty("massTrkSysKaonPiMax", m_massTrkSysKaonPiMax = 1000000000.);
declareProperty("targetMassTrkSysKaonPi", m_targetMassTrkSysKaonPi = 0.);
declareProperty("leadTrkPtMin", m_leadTrkPtMin = 0.);
declareProperty("EtCalibMin", m_EtCalibMin = 0.);
declareProperty("nTrackMin", m_nTrackMin = 1);
declareProperty("nTrackMax", m_nTrackMax = 2);
declareProperty("nWideTrackMax", m_nWideTrackMax = 10);
declareProperty("nWideTrackMax", m_nWideTrackMax = 1);
declareProperty("dRmaxMax", m_dRmaxMax = 10.);
declareProperty("etOverPtLeadTrkMin", m_etOverPtLeadTrkMin = 0.);
declareProperty("etOverPtLeadTrkMax", m_etOverPtLeadTrkMax = 10.);
......@@ -57,6 +60,7 @@ EFTauDiKaonHypo::EFTauDiKaonHypo(const std::string& name,
declareMonitoredVariable("CutCounter", m_cutCounter=0);
declareMonitoredVariable("MassTrkSys", m_massTrkSysAccepted =-10.);
declareMonitoredVariable("MassTrkSysKaon", m_massTrkSysKaonAccepted =-10.);
declareMonitoredVariable("MassTrkSysKaonPi", m_massTrkSysKaonPiAccepted =-10.);
declareMonitoredVariable("LeadTrkPt", m_leadTrkPtAccepted =-10.);
declareMonitoredVariable("EtCalib", m_ptAccepted =-10.);
declareMonitoredVariable("NTrack", m_nTrackAccepted =-1);
......@@ -67,6 +71,7 @@ EFTauDiKaonHypo::EFTauDiKaonHypo(const std::string& name,
m_massTrkSys = 0.;
m_massTrkSysKaon = 0.;
m_massTrkSysKaonPi = 0.;
m_leadTrkPt = 0.;
m_nTrack = 0;
m_nWideTrack = 0;
......@@ -102,6 +107,9 @@ HLT::ErrorCode EFTauDiKaonHypo::hltInitialize()
msg() << MSG::INFO << " REGTEST: param massTrkSysMax " << m_massTrkSysMax <<endreq;
msg() << MSG::INFO << " REGTEST: param massTrkSysKaonMin " << m_massTrkSysKaonMin <<endreq;
msg() << MSG::INFO << " REGTEST: param massTrkSysKaonMax " << m_massTrkSysKaonMax <<endreq;
msg() << MSG::INFO << " REGTEST: param massTrkSysKaonPiMin " << m_massTrkSysKaonPiMin <<endreq;
msg() << MSG::INFO << " REGTEST: param massTrkSysKaonPiMax " << m_massTrkSysKaonPiMax <<endreq;
msg() << MSG::INFO << " REGTEST: param targetMassTrkSysKaonPi " << m_targetMassTrkSysKaonPi <<endreq;
msg() << MSG::INFO << " REGTEST: param leadTrkPtMin " << m_leadTrkPtMin <<endreq;
msg() << MSG::INFO << " REGTEST: param EtCalibMin " << m_EtCalibMin <<endreq;
msg() << MSG::INFO << " REGTEST: param nTrackMin (included) " << m_nTrackMin <<endreq;
......@@ -114,7 +122,7 @@ HLT::ErrorCode EFTauDiKaonHypo::hltInitialize()
msg() << MSG::INFO << " REGTEST: ------ "<<endreq;
if( ( m_massTrkSysKaonMin > m_massTrkSysKaonMax ) || ( m_massTrkSysMin > m_massTrkSysMax ) || ( m_nTrackMin > m_nTrackMax ) || (m_etOverPtLeadTrkMin > m_etOverPtLeadTrkMax) )
if( ( m_massTrkSysKaonPiMin > m_massTrkSysKaonPiMax ) || ( m_massTrkSysKaonMin > m_massTrkSysKaonMax ) || ( m_massTrkSysMin > m_massTrkSysMax ) || ( m_nTrackMin > m_nTrackMax ) || (m_etOverPtLeadTrkMin > m_etOverPtLeadTrkMax) )
{
msg() << MSG::ERROR << "EFTauDiKaonHypo is uninitialized! " << endreq;
return HLT::BAD_JOB_SETUP;
......@@ -150,6 +158,7 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
m_cutCounter = 0;
m_massTrkSysAccepted = -10.;
m_massTrkSysKaonAccepted = -10.;
m_massTrkSysKaonPiAccepted = -10.;
m_leadTrkPtAccepted = -10.;
m_ptAccepted = -10.;
m_nTrackAccepted = -1;
......@@ -160,6 +169,7 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
m_massTrkSys = 0.;
m_massTrkSysKaon = 0.;
m_massTrkSysKaonPi = 0.;
m_leadTrkPt = 0.;
m_nTrack = 0;
m_nWideTrack = 0;
......@@ -238,7 +248,7 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
// cut on core and wide tracks:
m_nTrack = (*tauIt)->nTracks();
m_nWideTrack = (*tauIt)->nWideTracks();
m_nWideTrack = (*tauIt)->nTracksIsolation();
if( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << " REGTEST: Track size "<< m_nTrack <<endreq;
if( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << " REGTEST: Wide Track size "<< m_nWideTrack <<endreq;
......@@ -262,6 +272,7 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
// for dikaon mass hypothesis, compute invariant mass with kaon mass
TLorentzVector my_kaons(0.,0.,0.,0.);
std::vector<TLorentzVector> my_trks;
// need to add checks for valid link
for (unsigned int i=0;i<(*tauIt)->nTracks();++i) {
const xAOD::TrackParticle* trk = 0;
......@@ -269,19 +280,47 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
try
{
trk = (*tauIt)->track(i);
trk = (*tauIt)->track(i)->track();
}
catch(std::exception e)
{
msg() << MSG::WARNING << " REGTEST: EFTauDiKaonHypo, failed to get tau track link! " <<endreq;
}
if(trk) tmpKaon.SetPtEtaPhiM(trk->pt(), trk->eta(), trk->phi(), 493.677);
if(trk) {
tmpKaon.SetPtEtaPhiM(trk->pt(), trk->eta(), trk->phi(), 493.677);
my_trks.push_back(trk->p4());
}
my_kaons = my_kaons + tmpKaon;
}
m_massTrkSysKaon = my_kaons.M();
if( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << " REGTEST: massTrkSys with kaon mass hypo "<< m_massTrkSysKaon <<endreq;
// kaon+pi mass hypo
double finalKPiMass = 0;
if(my_trks.size()==2){
TLorentzVector tmpKaon;
tmpKaon.SetPtEtaPhiM(my_trks.at(0).Pt(), my_trks.at(0).Eta(), my_trks.at(0).Phi(), 493.677);
TLorentzVector tmpPion = my_trks.at(1);
double kPiMass1 = (tmpKaon+tmpPion).M();
tmpKaon.SetPtEtaPhiM(my_trks.at(1).Pt(), my_trks.at(1).Eta(), my_trks.at(1).Phi(), 493.677);
tmpPion = my_trks.at(0);
double kPiMass2 = (tmpKaon+tmpPion).M();
if(fabs(kPiMass1 - m_targetMassTrkSysKaonPi) < fabs(kPiMass2 - m_targetMassTrkSysKaonPi))
{
finalKPiMass = kPiMass1;
}else{
finalKPiMass = kPiMass2;
}
}
m_massTrkSysKaonPi = finalKPiMass;
if( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << " REGTEST: massTrkSys with kaon+pi mass hypo "<< m_massTrkSysKaonPi <<endreq;
if (!( (m_massTrkSys > m_massTrkSysMin) && (m_massTrkSys < m_massTrkSysMax) ) ) continue;
m_cutCounter++;
m_massTrkSysAccepted = m_massTrkSys;
......@@ -290,6 +329,10 @@ HLT::ErrorCode EFTauDiKaonHypo::hltExecute(const HLT::TriggerElement* outputTE,
m_cutCounter++;
m_massTrkSysKaonAccepted = m_massTrkSysKaon;
if (!( (m_massTrkSysKaonPi >= m_massTrkSysKaonPiMin) && (m_massTrkSysKaonPi < m_massTrkSysKaonPiMax) ) ) continue; //use >= otherwise singlepion chain would fail here!
m_cutCounter++;
m_massTrkSysKaonPiAccepted = m_massTrkSysKaonPi;
// cut on EMPOverTrkSysP:
(*tauIt)->detail(xAOD::TauJetParameters::EMPOverTrkSysP, m_EMPOverTrkSysP);
if( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << " REGTEST: EMPOverTrkSysP "<< m_EMPOverTrkSysP <<endreq;
......
......@@ -252,7 +252,7 @@ HLT::ErrorCode EFTauMVHypo::hltExecute(const HLT::TriggerElement* outputTE, bool
m_mon_ptAccepted = EFet;
m_numTrack = (*tauIt)->nTracks();
m_numWideTrack = (*tauIt)->nWideTracks();
m_numWideTrack = (*tauIt)->nTracksIsolation();
if( msgLvl() <= MSG::DEBUG ){
msg() << MSG::DEBUG << " REGTEST: Track size "<<m_numTrack <<endreq;
......
......@@ -206,7 +206,7 @@ float HLTVertexPreSelHypo::findLeadingTrackZ0(size_t numberOfTracks, const xAOD:
const xAOD::TrackParticle* leadingTrack(NULL);
for(size_t i = 0; i < numberOfTracks; i++)
{
const xAOD::TrackParticle* currentTrack = tauJet->track(i);
const xAOD::TrackParticle* currentTrack = tauJet->track(i)->track();
ATH_MSG_DEBUG("Track " << (i + 1) << " | pT: " << currentTrack->pt());
if(fabs(currentTrack->pt()) > highestpT)
{
......
Supports Markdown
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