Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hcal strip 76 x #13119

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions DataFormats/METReco/interface/HcalHaloData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@
[date]: October 15, 2009
*/
#include <vector>
#include <map>
#include "DataFormats/METReco/interface/PhiWedge.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"

struct HaloTowerStrip {
std::vector<std::pair<uint8_t, CaloTowerDetId> > cellTowerIds;
float hadEt;
float energyRatio;
float emEt;
HaloTowerStrip() {
hadEt = 0.0;
energyRatio = -1.0;
emEt = 0.0;
cellTowerIds.clear();
}
HaloTowerStrip(const HaloTowerStrip& strip) {
cellTowerIds = strip.cellTowerIds;
hadEt = strip.hadEt;
energyRatio = strip.energyRatio;
emEt = strip.emEt;
}
};

Expand Down
3 changes: 2 additions & 1 deletion DataFormats/METReco/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
</class>
<class name="edm::Wrapper<reco::HcalHaloData>"/>

<class name="HaloTowerStrip" ClassVersion="2">
<class name="HaloTowerStrip" ClassVersion="3">
<version ClassVersion="3" checksum="3149281836"/>
<version ClassVersion="2" checksum="665188928"/>
</class>
<class name="std::vector<HaloTowerStrip>"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,25 @@ void CandidateBoostedDoubleSecondaryVertexComputer::calcNsubjettiness(const reco
for(const reco::CandidatePtr & daughter : jet->daughterPtrVector())
{
if ( daughter.isNonnull() && daughter.isAvailable() )
fjParticles.push_back( fastjet::PseudoJet( daughter->px(), daughter->py(), daughter->pz(), daughter->energy() ) );
{
const reco::Jet * subjet = dynamic_cast<const reco::Jet *>(daughter.get());
// if the daughter is actually a subjet
if( subjet && daughter->numberOfDaughters() > 1 )
{
// loop over subjet constituents and push them in the vector of FastJet constituents
for(size_t i=0; i<daughter->numberOfDaughters(); ++i)
{
const reco::Candidate * constit = daughter->daughter(i);

if ( constit )
fjParticles.push_back( fastjet::PseudoJet( constit->px(), constit->py(), constit->pz(), constit->energy() ) );
else
edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-subjettiness computation is missing!";
}
}
else
fjParticles.push_back( fastjet::PseudoJet( daughter->px(), daughter->py(), daughter->pz(), daughter->energy() ) );
}
else
edm::LogWarning("MissingJetConstituent") << "Jet constituent required for N-subjettiness computation is missing!";
}
Expand Down
1 change: 1 addition & 0 deletions RecoBTag/SoftLepton/src/MuonTagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ float MuonTagger::discriminator(const TagInfoHelper& tagInfo) const {
// If there are multiple leptons, look for the highest tag result
for (unsigned int i=0; i<info.leptons(); i++) {
const reco::SoftLeptonProperties& properties = info.properties(i);
if(!m_selector(properties)) continue;
bool flip(false);
if(m_selector.isNegative()) {
int seed=1+round(10000.*properties.deltaR);
Expand Down
38 changes: 35 additions & 3 deletions RecoMET/METAlgorithms/src/HcalHaloAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,38 @@ HcalHaloData HcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, edm::H
}
}


// Don't use HF.
int maxAbsIEta = 29;


std::map<int, float> iPhiHadEtMap;
std::vector<const CaloTower*> sortedCaloTowers;
for(CaloTowerCollection::const_iterator tower = TheCaloTowers->begin(); tower != TheCaloTowers->end(); tower++) {
if(abs(tower->ieta()) <= maxAbsIEta && tower->numProblematicHcalCells() > 0)
sortedCaloTowers.push_back(&(*tower));
if(abs(tower->ieta()) > maxAbsIEta) continue;

int iPhi = tower->iphi();
if(!iPhiHadEtMap.count(iPhi)) iPhiHadEtMap[iPhi] = 0.0;
iPhiHadEtMap[iPhi] += tower->hadEt();

if(tower->numProblematicHcalCells() > 0) sortedCaloTowers.push_back(&(*tower));

}


// Sort towers such that lowest iphi and ieta are first, highest last, and towers
// with same iphi value are consecutive. Then we can do everything else in one loop.
std::sort(sortedCaloTowers.begin(), sortedCaloTowers.end(), CompareTowers);

HaloTowerStrip strip;


int prevIEta = -99, prevIPhi = -99;
float prevHadEt = 0.;
float prevEmEt = 0.;
std::pair<uint8_t, CaloTowerDetId> prevPair, towerPair;
bool wasContiguous = true;

// Loop through and store a vector of pairs (problematicCells, DetId) for each contiguous strip we find
for(unsigned int i = 0; i < sortedCaloTowers.size(); i++) {
const CaloTower* tower = sortedCaloTowers[i];
Expand All @@ -162,22 +176,40 @@ HcalHaloData HcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, edm::H
strip.cellTowerIds.push_back(prevPair);
strip.cellTowerIds.push_back(towerPair);
strip.hadEt += prevHadEt + tower->hadEt();
strip.emEt += prevEmEt + tower->emEt();
}

if(wasContiguous && isContiguous) {
strip.cellTowerIds.push_back(towerPair);
strip.hadEt += tower->hadEt();
strip.emEt += tower->emEt();
}

if((wasContiguous && !isContiguous) || i == sortedCaloTowers.size()-1) { //ended the strip, so flush it
if(strip.cellTowerIds.size() > 2) {

if(strip.cellTowerIds.size() > 3) {

int iPhi = strip.cellTowerIds.at(0).second.iphi();
int iPhiLower = (iPhi == 1) ? 72 : iPhi - 1;
int iPhiUpper = (iPhi == 72) ? 1 : iPhi + 1;

float energyRatio = 0.0;
if(iPhiHadEtMap.count(iPhiLower)) energyRatio += iPhiHadEtMap[iPhiLower];
if(iPhiHadEtMap.count(iPhiUpper)) energyRatio += iPhiHadEtMap[iPhiUpper];
iPhiHadEtMap[iPhi] = max(iPhiHadEtMap[iPhi], 0.001F);

energyRatio /= iPhiHadEtMap[iPhi];
strip.energyRatio = energyRatio;

TheHcalHaloData.getProblematicStrips().push_back( strip );

}
strip = HaloTowerStrip();
}

wasContiguous = isContiguous;
prevPair = towerPair;
prevEmEt = tower->emEt();
prevIPhi = tower->iphi();
prevIEta = tower->ieta();
prevHadEt = tower->hadEt();
Expand Down
8 changes: 7 additions & 1 deletion RecoMET/METFilters/plugins/HcalStripHaloFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ class HcalStripHaloFilter : public edm::global::EDFilter<> {

const bool taggingMode_;
const int maxWeightedStripLength_;
const double maxEnergyRatio_;
const double minHadEt_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
};

HcalStripHaloFilter::HcalStripHaloFilter(const edm::ParameterSet & iConfig)
: taggingMode_ (iConfig.getParameter<bool> ("taggingMode"))
, maxWeightedStripLength_ (iConfig.getParameter<int>("maxWeightedStripLength"))
, maxEnergyRatio_ (iConfig.getParameter<double>("maxEnergyRatio"))
, minHadEt_ (iConfig.getParameter<double>("minHadEt"))
, beamHaloSummaryToken_(consumes<reco::BeamHaloSummary>(edm::InputTag("BeamHaloSummary")))
{
produces<bool>();
Expand All @@ -42,7 +46,9 @@ bool HcalStripHaloFilter::filter(edm::StreamID iID, edm::Event & iEvent, const e
for (unsigned int iTower = 0; iTower < problematicStrip.cellTowerIds.size(); iTower++) {
numContiguousCells += (int)problematicStrip.cellTowerIds[iTower].first;
}
if(numContiguousCells > maxWeightedStripLength_) {
if( numContiguousCells > maxWeightedStripLength_
&& problematicStrip.energyRatio < maxEnergyRatio_
&& problematicStrip.hadEt > minHadEt_ ) {
pass = false;
break;
}
Expand Down
4 changes: 3 additions & 1 deletion RecoMET/METFilters/python/HcalStripHaloFilter_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
HcalStripHaloFilter = cms.EDFilter(
"HcalStripHaloFilter",
taggingMode = cms.bool(False),
maxWeightedStripLength = cms.int32(9) # values higher than this are rejected
maxWeightedStripLength = cms.int32(7),
maxEnergyRatio = cms.double(0.15),
minHadEt = cms.double(100.0)
)
4 changes: 3 additions & 1 deletion SimTracker/TrackHistory/python/TrackQuality_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
associatePixel = cms.bool(True),
associateStrip = cms.bool(True),
associateRecoTracks = cms.bool(True),
ROUList = copy.deepcopy(tabh.trackAssociatorByHits.ROUList)
ROUList = copy.deepcopy(tabh.trackAssociatorByHits.ROUList),
pixelSimLinkSrc = cms.InputTag("simSiPixelDigis"),
stripSimLinkSrc = cms.InputTag("simSiStripDigis")
)
)