Commit 1a538e70 authored by John Kenneth Anders's avatar John Kenneth Anders
Browse files

Merge branch 'pufittrack' into '21.0'

merging a new met algorithm pufittrack to 21.0 (already merged into 21.1)

See merge request atlas/athena!15117

Former-commit-id: d76ede915eb244aae97291f2ccf0b7f4f77f6530
parents ff3db389 81b1e0ca
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGEFMISSINGET_EFMissingETFromClustersTracksPUC_H
#define TRIGEFMISSINGET_EFMissingETFromClustersTracksPUC_H
/********************************************************************
This code should be edited as necessary and then placed in the TrigEFMissingET/TrigEFMissingET directory
********************************************************************/
#include "TrigEFMissingET/EFMissingETBaseTool.h"
#include "TrigMissingEtEvent/TrigMissingET.h"
#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h"
#include "GaudiKernel/ToolHandle.h"
class EFMissingETFromClustersTracksPUC : public EFMissingETBaseTool
{
public:
EFMissingETFromClustersTracksPUC(const std::string& type,
const std::string& name,
const IInterface* parent);
~EFMissingETFromClustersTracksPUC();
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode execute();
virtual StatusCode execute(xAOD::TrigMissingET *met,
TrigEFMissingEtHelper *metHelper,
const xAOD::CaloClusterContainer *caloCluster,
const xAOD::JetContainer *jets,
const xAOD::TrackParticleContainer *track,
const xAOD::VertexContainer *vertex,
const xAOD::MuonContainer *muon);
private:
//internal
unsigned int m_nPhiBins;
unsigned int m_nEtaBins;
unsigned int m_nTowers;
double m_towerEtaWidth;
double m_towerPhiWidth;
bool m_saveuncalibrated;
xAOD::CaloCluster::State m_clusterstate;
int m_methelperposition;
// Tower
double m_targetTowerWidth;
double m_maxEta;
// For jet selection
double m_forward_ptcut;
double m_track_ptcut;
double m_dRCut;
double m_minJetPtJvt;
double m_maxJetPtJvt;
double m_jetRpTCut;
ToolHandle<InDet::IInDetTrackSelectionTool> m_trackselTool;
//Covariance variables
double m_caloResSqrtTerm;
double m_caloResFloor;
// Pufit variables
double m_constraintWeight;
};
#endif // TRIGEFMISSINGET_EFMissingETFromClustersTracksPUC_H
......@@ -7,6 +7,7 @@ from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromCells
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromClusters
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromClustersPS
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromClustersPUC
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromClustersTracksPUC
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromJets
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromTrackAndJets
from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFlags
......@@ -1172,6 +1173,194 @@ class EFMissingET_Fex_topoClustersPS (EFMissingETBase):
self.ComponentCalib1 += [ 1.00 ] # Muons
from TrigEFMissingET.TrigEFMissingETMonitoring import TrigEFMissingETValidationMonitoring_other, TrigEFMissingETOnlineMonitoring_other, TrigEFMissingETCosmicMonitoring_other
validation = TrigEFMissingETValidationMonitoring_other()
online = TrigEFMissingETOnlineMonitoring_other()
cosmic = TrigEFMissingETCosmicMonitoring_other()
self.AthenaMonTools = [ validation, online, cosmic]
#### Use topo. clusters for noise suppression #####
class EFMissingET_Fex_topoClustersTracksPUC (EFMissingETBase):
__slots__ = []
def __init__ (self, name="EFMissingET_Fex_topoClustersTracksPUC", extraCalib = ""):
super(EFMissingET_Fex_topoClustersTracksPUC, self).__init__(name)
# name of TrigMissingET object
self.MissingETOutputKey = "TrigEFMissingET_topocltrk_PUC{0}".format(extraCalib)
self.doTopoClusters = True
self.doPUC = True
self.doJets = True
self.doTracks = True
# tools
clusterTool = EFMissingETFromClustersTracksPUC("TheClusterToolTracksPUC")
flagTool = EFMissingETFlags("TheFlagsTool")
helperTool = EFMissingETFromHelper("TheHelperTool")
clusterTool.ParentFexName = name
flagTool.ParentFexName = name
helperTool.ParentFexName = name
#clusterTool.SubtractPileup = True
is2016 = (TriggerFlags.run2Config() == '2016')
clusterTool.SaveUncalibrated = True if "_em" in extraCalib else False
'''
clusterTool.use2016Algo = is2016
# N.B. - defaults for 2016 running: nSigma = 3.2 and varRhoScale = 4.0
# N.B. - defaults for 2017 running: nSigma = 5.0 and varRhoScale = 1.0
clusterTool.nSigma = 3.2 if is2016 else 5.0
clusterTool.varRhoScale = 4.0 if is2016 else 1.0
clusterTool.aveEclusPU = 10000.0
clusterTool.towerWidthInput = 0.7
clusterTool.EtaRange = 5.0
clusterTool.resE = 15.81
clusterTool.resEfloor = 50.0
clusterTool.trimFactor = 0.90
'''
# fraction of energy deposited in EM samplings
flagTool.MaxEMfraction = 1.0
flagTool.MinEMfraction = 0.0
flagTool.MaxTileGapEratio = 1.0
# max/min energy ratios from each subdet.
flagTool.MaxSumEratioInEMB = 1.0
flagTool.MaxSumEratioInEME = 1.0
flagTool.MaxSumEratioInHEC = 1.0
flagTool.MaxSumEratioInTileBar = 1.0
flagTool.MaxSumEratioInTileGap = 1.0
flagTool.MaxSumEratioInTileExt = 1.0
flagTool.MaxSumEratioInFCal = 1.0
flagTool.MinSumEratioInEMB = 0.0
flagTool.MinSumEratioInEME = 0.0
flagTool.MinSumEratioInHEC = 0.0
flagTool.MinSumEratioInTileBar = 0.0
flagTool.MinSumEratioInTileGap = 0.0
flagTool.MinSumEratioInTileExt = 0.0
flagTool.MinSumEratioInTileExt = 0.0
# max/min comp energies
flagTool.MaxCompE = []
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV,1e4*GeV ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV,1e4*GeV ] # PreSamplE, EME1, EME2, EME3
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV,1e4*GeV ] # HEC0, HEC1, HEC2, HEC3
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # TileBar0, TileBar1, TileBar2
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # TileGap0, TileGap1, TileGap2
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # TileExt0, TileExt1, TileExt2
flagTool.MaxCompE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # FCalEM, FCalHad1, FCalHad2
flagTool.MinCompE = []
flagTool.MinCompE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.MinCompE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # PreSamplE, EME1, EME2, EME3
flagTool.MinCompE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # HEC0, HEC1, HEC2, HEC3
flagTool.MinCompE += [ 0.0*GeV,0.0*GeV,0.0*GeV ] # TileBar0, TileBar1, TileBar2
flagTool.MaxCellE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # TileGap0, TileGap1, TileGap2
flagTool.MaxCellE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # TileExt0, TileExt1, TileExt2
flagTool.MaxCellE += [ 1e4*GeV,1e4*GeV,1e4*GeV ] # FCalEM, FCalHad1, FCalHad2
flagTool.MinCellE = []
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # PreSamplE, EME1, EME2, EME3
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV,0.0*GeV ] # HEC0, HEC1, HEC2, HEC3
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV ] # TileBar0, TileBar1, TileBar2
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV ] # TileGap0, TileGap1, TileGap2
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV ] # TileExt0, TileExt1, TileExt2
flagTool.MinCellE += [ 0.0*GeV,0.0*GeV,0.0*GeV ] # FCalEM, FCalHad1, FCalHad2
# max/min cell times
flagTool.MaxCellTime = []
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond,+10*nanosecond ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond,+10*nanosecond ] # PreSamplE, EME1, EME2, EME3
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond,+10*nanosecond ] # HEC0, HEC1, HEC2, HEC3
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond ] # TileBar0, TileBar1, TileBar2
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond ] # TileGap0, TileGap1, TileGap2
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond ] # TileExt0, TileExt1, TileExt2
flagTool.MaxCellTime += [ +10*nanosecond,+10*nanosecond,+10*nanosecond ] # FCalEM, FCalHad1, FCalHad2
flagTool.MinCellTime = []
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond,-10*nanosecond ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond,-10*nanosecond ] # PreSamplE, EME1, EME2, EME3
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond,-10*nanosecond ] # HEC0, HEC1, HEC2, HEC3
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond ] # TileBar0, TileBar1, TileBar2
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond ] # TileGap0, TileGap1, TileGap2
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond ] # TileExt0, TileExt1, TileExt2
flagTool.MinCellTime += [ -10*nanosecond,-10*nanosecond,-10*nanosecond ] # FCalEM, FCalHad1, FCalHad2
# max cell chi-square
flagTool.WorstCellQuality = []
flagTool.WorstCellQuality += [ 4e3,4e3,4e3,4e3 ] # PreSamplB, EMB1, EMB2, EMB3
flagTool.WorstCellQuality += [ 4e3,4e3,4e3,4e3 ] # PreSamplE, EME1, EME2, EME3
flagTool.WorstCellQuality += [ 4e3,4e3,4e3,4e3 ] # HEC0, HEC1, HEC2, HEC3
flagTool.WorstCellQuality += [ 4e3,4e3,4e3 ] # TileBar0, TileBar1, TileBar2
flagTool.WorstCellQuality += [ 4e3,4e3,4e3 ] # TileGap0, TileGap1, TileGap2
flagTool.WorstCellQuality += [ 4e3,4e3,4e3 ] # TileExt0, TileExt1, TileExt2
flagTool.WorstCellQuality += [ 4e3,4e3,4e3 ] # FCalEM, FCalHad1, FCalHad2
## chain of tools
self.Tools = []
self.Tools += [ clusterTool ]
self.Tools += [ flagTool ]
self.Tools += [ helperTool ]
# component flags (-1 means skip)
self.ComponentFlags = []
self.ComponentFlags += [ 0,0,0,0 ] # PreSamplB, EMB1, EMB2, EMB3
self.ComponentFlags += [ 0,0,0,0 ] # PreSamplE, EME1, EME2, EME3
self.ComponentFlags += [ 0,0,0,0 ] # HEC0, HEC1, HEC2, HEC3
self.ComponentFlags += [ 0,0,0 ] # TileBar0, TileBar1, TileBar2
self.ComponentFlags += [ 0,0,0 ] # TileGap0, TileGap1, TileGap2
self.ComponentFlags += [ 0,0,0 ] # TileExt0, TileExt1, TileExt2
self.ComponentFlags += [ 0,0,0 ] # FCalEM, FCalHad1, FCalHad2
self.ComponentFlags += [ 0 ] # EM Topo
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0 ] # Had Topo
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0 ] # Jet
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0,0 ]
self.ComponentFlags += [ 0 ] # PUC
self.ComponentFlags += [ 0 ] # PUC prior correction
self.ComponentFlags += [ 0 ] # Muons
# calibration: constant term (MeV)
self.ComponentCalib0 = []
self.ComponentCalib0 += [ 0,0,0,0 ] # PreSamplB, EMB1, EMB2, EMB3
self.ComponentCalib0 += [ 0,0,0,0 ] # PreSamplE, EME1, EME2, EME3
self.ComponentCalib0 += [ 0,0,0,0 ] # HEC0, HEC1, HEC2, HEC3
self.ComponentCalib0 += [ 0,0,0 ] # TileBar0, TileBar1, TileBar2
self.ComponentCalib0 += [ 0,0,0 ] # TileGap0, TileGap1, TileGap2
self.ComponentCalib0 += [ 0,0,0 ] # TileExt0, TileExt1, TileExt2
self.ComponentCalib0 += [ 0,0,0 ] # FCalEM, FCalHad1, FCalHad2
self.ComponentCalib0 += [ 0 ] # EM Topo
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0 ] # Had Topo
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0 ] # Jet
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0, 0 ]
self.ComponentCalib0 += [ 0 ] # PUC
self.ComponentCalib0 += [ 0 ] # PUC prior correction
self.ComponentCalib0 += [ 0 ] # Muons
# calibration: multiplicative constant
self.ComponentCalib1 = []
self.ComponentCalib1 += [ 1.00,1.00,1.00,1.00 ] # PreSamplB, EMB1, EMB2, EMB3
self.ComponentCalib1 += [ 1.00,1.00,1.00,1.00 ] # PreSamplE, EME1, EME2, EME3
self.ComponentCalib1 += [ 1.00,1.00,1.00,1.00 ] # HEC0, HEC1, HEC2, HEC3
self.ComponentCalib1 += [ 1.00,1.00,1.00 ] # TileBar0, TileBar1, TileBar2
self.ComponentCalib1 += [ 1.00,1.00,1.00 ] # TileGap0, TileGap1, TileGap2
self.ComponentCalib1 += [ 1.00,1.00,1.00 ] # TileExt0, TileExt1, TileExt2
self.ComponentCalib1 += [ 1.00,1.00,1.00 ] # FCalEM, FCalHad1, FCalHad2
self.ComponentCalib1 += [ 1.00 ] # EM Topo
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00 ] # Had Topo
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00 ] # Jet
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00,1.00 ]
self.ComponentCalib1 += [ 1.00 ] # PUC
self.ComponentCalib1 += [ 1.00 ] # PUC prior correction
self.ComponentCalib1 += [ 1.00 ] # Muons
from TrigEFMissingET.TrigEFMissingETMonitoring import TrigEFMissingETValidationMonitoring_other, TrigEFMissingETOnlineMonitoring_other, TrigEFMissingETCosmicMonitoring_other
validation = TrigEFMissingETValidationMonitoring_other()
online = TrigEFMissingETOnlineMonitoring_other()
......
......@@ -27,6 +27,8 @@
#include "CaloEvent/CaloCellContainer.h"
#include "xAODTrigMissingET/TrigMissingET.h"
#include "xAODTrigMissingET/TrigMissingETContainer.h"
#include "AthContainers/DataVector.h"
#include "AthContainers/ConstDataVector.h"
//#include "TrigNavigation/Navigation.h" // Added for "Hack"
//#include "TrigNavigation/NavigationCore.icc" // Added for "Hack"
......@@ -313,8 +315,10 @@ HLT::ErrorCode EFMissingET::hltBeginRun() {
}
if(m_doJets && !foundJets) {
ATH_MSG_ERROR( "found jet config but no JetTool .. aborting " );
return HLT::ERROR;
if (!m_doTopoClusters){
ATH_MSG_ERROR( "found jet config but no JetTool .. aborting " );
return HLT::ERROR;
}
}
......@@ -524,6 +528,8 @@ HLT::ErrorCode EFMissingET::makeMissingET(std::vector<std::vector<HLT::TriggerEl
if(m_doTopoClusters == false && m_doJets == false && m_doJets == false)
m_n_sizePers = 25;
else if(m_doTopoClusters == true && m_doJets == true && m_doTracks==true)
m_n_sizePers = 3;
else if(m_doJets == true)
m_n_sizePers = 6;
else if(m_doPUC == true)
......@@ -542,7 +548,7 @@ HLT::ErrorCode EFMissingET::makeMissingET(std::vector<std::vector<HLT::TriggerEl
m_met->defineComponents(vs_aux);
ATH_MSG_DEBUG (" Created pers. object of size " << m_n_sizePers);
ConstDataVector<xAOD::TrackParticleContainer> m_ttracks (SG::VIEW_ELEMENTS);//Define a track container for Pufit track
// fetch topo. clusters for later use
if (m_doTopoClusters && tes_in.size() > 0) { // safe-guard
for (const auto& te_in : tes_in.at(0) ) {
......@@ -558,7 +564,92 @@ HLT::ErrorCode EFMissingET::makeMissingET(std::vector<std::vector<HLT::TriggerEl
}
} // end loop over topoclusters
} // fetched all topo. clusters
if (m_doJets && m_doTracks && tes_in.size() > 0) {
for (const auto& te_in : tes_in.at(1) ) {
HLT::ErrorCode status = getFeature( te_in , m_jets );
if(status!=HLT::OK || !m_jets) {
ATH_MSG_ERROR( "Failed to get Jets" ); return HLT::NAV_ERROR;
} else {
if (msgLvl(MSG::DEBUG) ) {
ATH_MSG_DEBUG( "size of jet container " << m_jets->size() );
for (const auto& ijet : *m_jets)
ATH_MSG_DEBUG( " Jet E, eta, phi: " << ijet->e()<<", "<< ijet->eta()<<", "<< ijet->phi() );
}
}
}
if(tes_in.size()>3){
//This section is for 4 tes, like in the case of pufit track
const xAOD::TrackParticleContainer* tempTracks;
for (const auto& te_in : tes_in.at(2) ) {
HLT::ErrorCode status_trk = getFeature( te_in , tempTracks);
if(status_trk!=HLT::OK || !tempTracks) {
ATH_MSG_ERROR( "Failed to get tracks" ); return HLT::NAV_ERROR;
} else {
// m_ttracks.push_back(tempTracks);
ATH_MSG_DEBUG( "size of track container " << tempTracks->size() );
for (const auto& itrack : *tempTracks){
m_ttracks.push_back(itrack);
ATH_MSG_DEBUG( " Track pt, eta, phi, vertex, z0, vz: " << itrack->pt()<<", "<< itrack->eta()<<", "<< itrack->phi() << ", "
<< itrack->vertex() << ", " << fabs(itrack->z0()) << ", " << itrack->vz() );
}
}//correctly retrived the tracks
}//retrieve te2
m_tracks = m_ttracks.asDataVector();
std::vector<const xAOD::TrackParticle*> TracksVec(m_tracks->begin(), m_tracks->end());
ATH_MSG_DEBUG( "num of tracks in datavector: " << TracksVec.size() );
for (const xAOD::TrackParticle* trk : TracksVec){
ATH_MSG_DEBUG("tracks " << trk->pt() << "," << trk->eta() << ","<<trk->phi() );
}
ATH_MSG_DEBUG( "size of track container" << m_tracks->size());
for (const auto& te_in : tes_in.at(3) ) {
HLT::ErrorCode status_vtx = getFeature( te_in , m_vertices );
if(status_vtx!=HLT::OK || !m_vertices) {
ATH_MSG_ERROR( "Failed to get vertices" ); return HLT::NAV_ERROR;
} else {
if (true){//msgLvl(MSG::DEBUG) ) {
ATH_MSG_DEBUG( "size of vertex container " << m_vertices->size() );
for (auto& ivtx : *m_vertices)
ATH_MSG_DEBUG( " Vertex x, y, z, ntracks: " << ivtx->x()<<", "<< ivtx->y()<<", "<< ivtx->z() << ", "
<< ivtx->nTrackParticles() );
}
}//retrieve vertex container
}//retrieve te3
}//more than 3 tes (0-3)
else{
//this section is for track mht
for (const auto& te_in : tes_in.at(2) ) {
HLT::ErrorCode status_trk = getFeature( te_in , m_tracks );
if(status_trk!=HLT::OK || !m_tracks) {
ATH_MSG_ERROR( "Failed to get tracks" ); return HLT::NAV_ERROR;
} else {
if (msgLvl(MSG::DEBUG) ) {
ATH_MSG_DEBUG( "size of track container " << m_tracks->size() );
for (const auto& itrack : *m_tracks)
ATH_MSG_DEBUG( " Track pt, eta, phi, vertex, z0, vz: " << itrack->pt()<<", "<< itrack->eta()<<", "<< itrack->phi() << ", "
<< itrack->vertex() << ", " << fabs(itrack->z0()) << ", " << itrack->vz() );
}
}
//The vertex container is part of the same TE as the tracks
HLT::ErrorCode status_vtx = getFeature( te_in , m_vertices );
if(status_vtx!=HLT::OK || !m_vertices) {
ATH_MSG_ERROR( "Failed to get vertices" ); return HLT::NAV_ERROR;
} else {
if (msgLvl(MSG::DEBUG) ) {
ATH_MSG_DEBUG( "size of vertex container " << m_vertices->size() );
for (auto& ivtx : *m_vertices)
ATH_MSG_DEBUG( " Vertex x, y, z, ntracks: " << ivtx->x()<<", "<< ivtx->y()<<", "<< ivtx->z() << ", "
<< ivtx->nTrackParticles() );
}
}
}//retrieve te2, this gets tracks and vertex container for track mht
}//only 3 tes, for track mht
}//do jets and tracks
} else { // fetched all topo. clusters
// fetch jets for later use
if (m_doJets && tes_in.size() > 0) { // safe-guard
......@@ -636,7 +727,7 @@ HLT::ErrorCode EFMissingET::makeMissingET(std::vector<std::vector<HLT::TriggerEl
} // end loop over topoclusters
} // fetched all topo. clusters
}
if(m_doTopoClusters && !m_caloCluster) { // check if one should process topo. clusters and if pointer is present
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
/********************************************************************
NAME: EFMissingETFromClustersTracksPUC.cxx
PACKAGE: Trigger/TrigAlgorithms/TrigEFMissingET
AUTHORS: Rui Zou, Ben Carlson, Jonathan Burr
CREATED: Feb 01, 2018
PURPOSE: Pile-up fit + tracks
********************************************************************/
#include "TrigEFMissingET/EFMissingETFromClustersTracksPUC.h"
#include "TrigTimeAlgs/TrigTimerSvc.h"
#include <TMatrixD.h>
#include <string>
using namespace std;
namespace {
// Helper class
struct Tower{
xAOD::CaloCluster::State m_clusterstate;
float sumEt{0.};
float px{0.};
float py{0.};
float pt() { return sqrt(px*px+py*py); }
float cosPhi() { return pt() > 0 ? px/pt() : 1.; }
float sinPhi() { return pt() > 0 ? py/pt() : 0.; }
Tower& operator=(bool m_saveuncalibrated) {
if(m_saveuncalibrated) m_clusterstate = xAOD::CaloCluster::UNCALIBRATED;
else m_clusterstate = xAOD::CaloCluster::CALIBRATED;
return *this;
}
Tower& operator+=(const xAOD::CaloCluster& clus) {
float sinPhi;
float cosPhi;
sincosf(clus.phi(m_clusterstate), &sinPhi, &cosPhi);
float Et = clus.pt(m_clusterstate);
sumEt += Et;
px += Et * cosPhi;
py += Et * sinPhi;
return *this;
}
};
}
EFMissingETFromClustersTracksPUC::EFMissingETFromClustersTracksPUC(const std::string& type,
const std::string& name,
const IInterface* parent) :
EFMissingETBaseTool(type, name, parent),
m_trackselTool("InDet::InDetTrackSelectionTool/TrackSelectionTool", this )
{
// declare the algorithm configurables here
// declareProperty("PropertyName", m_property=default_value, "Property Description");
// (*Do* add a property description...)
declareProperty("SaveUncalibrated", m_saveuncalibrated = false ,"save uncalibrated topo. clusters");
declareProperty("TargetTowerWidth", m_targetTowerWidth = 0.7, "The target width of the towers");
declareProperty("MaxEta", m_maxEta = 5., "The maximum eta");
declareProperty("ForwardpTCut", m_forward_ptcut = 50.0e3 ,"pT Cut for forward jets");
declareProperty("TrackpTCut", m_track_ptcut = 0.0 ,"pT Cut for online tracks");
declareProperty("dRCut", m_dRCut = 0.4, "dR Cut for track - jet association");
declareProperty("MinJetPtJvt", m_minJetPtJvt = 20.e3, "The minimum pT (in MeV) for jets to consider for JVT");
declareProperty("MaxJetPtJvt", m_maxJetPtJvt = 60.e3, "The maximum pT (in MeV) for jets to consider for JVT (above this jets automatically pass");
declareProperty("JetRpTCut", m_jetRpTCut = 0.1, "The JVT RpT cut to apply to jets");//0.1, "The JVT RpT cut to apply to jets");
declareProperty("CaloResSqrtTerm", m_caloResSqrtTerm = 15.81, "The coefficient of the sqrt term in the calorimeter resolution (in MeV)");
declareProperty("CaloResFloor", m_caloResFloor = 50, "Floor for calorimeter resolution (in MeV)");
declareProperty("ConstraintWeight", m_constraintWeight = 1., "The relative weighting applied to the constraints");
// declare configurables
m_fextype = FexType::TOPO;
m_methelperposition = 3;
// Determine number of phi & eta bins, and number of towers
m_nPhiBins = TMath::TwoPi() / m_targetTowerWidth;
m_nEtaBins = 2 * m_maxEta / m_targetTowerWidth;
m_nTowers = m_nPhiBins * m_nEtaBins;
m_towerEtaWidth = 2 * m_maxEta / m_nEtaBins;
m_towerPhiWidth = TMath::TwoPi() / m_nPhiBins;
m_clusterstate = xAOD::CaloCluster::UNCALIBRATED;
}
EFMissingETFromClustersTracksPUC::~EFMissingETFromClustersTracksPUC()
{
}
StatusCode EFMissingETFromClustersTracksPUC::initialize()
{
ATH_MSG_DEBUG( "called EFMissingETFromClustersTracksPUC::initialize()" );
// Standard initialize step
// Set up the timer service.
if( service( "TrigTimerSvc", m_timersvc).isFailure() )
ATH_MSG_WARNING( name() << ": Unable to locate TrigTimer Service" );
if (m_timersvc) {
// global time
std::string basename=name()+".TotalTime";
m_glob_timer = m_timersvc->addItem(basename);
} // if timing service
if(m_saveuncalibrated) m_clusterstate = xAOD::CaloCluster::UNCALIBRATED;
else m_clusterstate = xAOD::CaloCluster::CALIBRATED;
return StatusCode::SUCCESS;
}
StatusCode EFMissingETFromClustersTracksPUC::execute()
{
return StatusCode::SUCCESS;
}
StatusCode EFMissingETFromClustersTracksPUC::finalize()
{
ATH_MSG_DEBUG( "called EFMissingETFromClustersTracksPUC::finalize()" );
return StatusCode::SUCCESS;
}
StatusCode EFMissingETFromClustersTracksPUC::execute(xAOD::TrigMissingET * /* met */ ,
TrigEFMissingEtHelper *metHelper ,
const xAOD::CaloClusterContainer *caloCluster, const xAOD::JetContainer * jetContainer,
const xAOD::TrackParticleContainer * trackContainer, const xAOD::VertexContainer * vertexContainer,
const xAOD::MuonContainer * /*muonContainer*/ )