-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Tau Embedding update and integration #43871
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
df878d9
MCEmbeddingTools: update BuildFile
ff041ba
MCEmbeddingTools: update CollectionMerger
a2a267f
MCEmbeddingTools: introducing other GenFilters
bad12dd
MCEmbeddingTools: introducing EmbeddingBeamSpotOnlineProducer
5257e12
MCEmbeddingTools: introducing DoubleCollectionMerger
f15f9ac
MCEmbeddingTools: introducing EmbeddingHltPixelVerticesProducer
1756c37
MCEmbeddingTools: updating EmbeddingLHEProducer
948f821
MCEmbeddingTools: updating MuMuForEmbeddingSelector
cfca6a7
MCEmbeddingTools: updating TrackMergeremb
4731fe5
MCEmbeddingTools: adding configuration for all filters
384bccf
MCEmbeddingTools: adding configuration for additional producers
10eaeb2
MCEmbeddingTools: updating configuration for EmbeddingLHEProducer & M…
674e409
MCEmbeddingTools: update customisers
c1b408f
customisers.py: remove cleanUnscheduled since deprecated
2cba985
customisers.py: fix remaining code bugs
89846af
customisers.py: remove crashing modules for the time-being
2c5adca
DataFormats/EgammaCandidates/src/classes_def.xml: define maps require…
8d42003
MCEmbeddingTools: fixing customise_Merging to avoid schdule deadlocks
2a4cd33
TauAnalysis/MCEmbeddingTools: create skeleton for hcalDigis merger
3fb467b
TauAnalysis/MCEmbeddingTools: merging electron seeds also for low Pt …
a4bd3f2
customisers.py: merge lowPtGsfEleGsfTracks
5385960
merge also displaced Muons 1st Step collections
78bfe77
adapt displacedMuons configuration as for usual Muons
25e798e
Remove Low Pt Electron Seed Merger, since the producer creates not on…
ecb50b6
keeping all trajectory seeds now, since needed by lowPt electrons
e7b1817
Fix Geometry records for Tracking Rec. Hits
756aae2
Adding recoElectronSeeds to the collections to be kept for merging
0390729
Fix Ctf track reference for lowPtGsfElectrons
4069ab0
re-enable Filling of muons as done usually; merge track collection fo…
af160eb
Fixing production sequence for isolation deposits
26754e1
Fixing production sequence for id selection types
cb48e66
Removing MC info not required for muons in embedded samples
f73346c
adding merging and production sequences for displaced muons
cccdc99
Hotfix to cover displacedMuons after merging displacedTracks
41b8fb7
This doc not needed anymore, since derived from name, it seems
fea22b8
Fix rec. hits geometry records also for gsf tracks
13c344b
adapt nanoAOD config to create correct TriggerResults and gen particles
4b2dc52
Override MC matching removal for embedded samples
8ee77ad
fix trigger result creation
1eebd03
Improve calculation for generator particles
7351d14
Add 3rd HLT path to fix behaviour for 2016 samples
f059c81
add L1 results & bits for full nanoAOD content
311a3fc
add SIMembeddingpreHLT to be able to include L1simulation in nanoAOD
685d2a7
fix the case where a ctf track could be shared by several seeds or sa…
fc0d112
roll back the change, introduce explanationns into the cff file
5ddebdd
fix the ct pps sequences to use _LHC raw data
68428e4
add sequence to create L1 objects
286e560
add improved muon cleaning
9226bc1
make the changes compatible with cmssw changes
01c9307
format code with clang-format
e9283b6
rewrite header files to only contain declaration
efe13d9
load EventSetup information for each run separatly
c79fde4
debug correct handling of input comming from RESELECT collection
49d02ef
add a running test for embedding.
41944c0
add workflow unittests for each UL year
12e24e3
apply patches for code-checks and code-format as CI suggests
ffeab60
change root file dir in embedding tests
a8eae9f
PR to adress review comments (#3)
harrypuuter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="DataFormats/PatCandidates"/> | ||
<use name="pythia8"/> | ||
<use name="DataFormats/RPCRecHit"/> | ||
<use name="DataFormats/EcalRecHit"/> | ||
<use name="DataFormats/HcalRecHit"/> | ||
<use name="TrackingTools/TrackAssociator"/> | ||
<use name="DataFormats/TrackReco"/> | ||
<use name="CondFormats/BeamSpotObjects"/> | ||
<use name="SimDataFormats/GeneratorProducts"/> | ||
<use name="CommonTools/UtilAlgos"/> | ||
<use name="PhysicsTools/UtilAlgos"/> | ||
<use name="CondFormats/JetMETObjects"/> | ||
<use name="JetMETCorrections/Objects"/> | ||
<use name="JetMETCorrections/JetCorrector"/> | ||
<use name="RecoMET/METAlgorithms"/> | ||
<flags EDM_PLUGIN="1"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,55 @@ | ||
/** \class CaloCleaner | ||
* | ||
* Clean collections of calorimeter recHits | ||
* (detectors supported at the moment: EB/EE, HB/HE and HO) | ||
* | ||
* (detectors supported: EB/EE, HB/HE and HO) | ||
* | ||
* \author Tomasz Maciej Frueboes; | ||
* Christian Veelken, LLR | ||
* | ||
* | ||
* | ||
* Clean Up from STefan Wayand, KIT | ||
* Clean Up from Christian Winter & Sebastian Brommer, KIT | ||
*/ | ||
#ifndef TauAnalysis_MCEmbeddingTools_CaloCleaner_H | ||
#define TauAnalysis_MCEmbeddingTools_CaloCleaner_H | ||
|
||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DataFormats/Common/interface/Handle.h" | ||
#include "DataFormats/PatCandidates/interface/Muon.h" | ||
#include "DataFormats/MuonReco/interface/MuonEnergy.h" | ||
#include "DataFormats/PatCandidates/interface/Muon.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h" | ||
#include "TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h" | ||
#include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h" | ||
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h" | ||
|
||
#include "DataFormats/Common/interface/SortedCollection.h" | ||
#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" | ||
|
||
#include <string> | ||
#include <iostream> | ||
#include <map> | ||
#include <string> | ||
|
||
template <typename T> | ||
class CaloCleaner : public edm::stream::EDProducer<> { | ||
public: | ||
explicit CaloCleaner(const edm::ParameterSet&); | ||
explicit CaloCleaner(const edm::ParameterSet &); | ||
~CaloCleaner() override; | ||
|
||
private: | ||
void produce(edm::Event&, const edm::EventSetup&) override; | ||
void produce(edm::Event &, const edm::EventSetup &) override; | ||
|
||
typedef edm::SortedCollection<T> RecHitCollection; | ||
|
||
const edm::EDGetTokenT<edm::View<pat::Muon> > mu_input_; | ||
const edm::EDGetTokenT<edm::View<pat::Muon>> mu_input_; | ||
|
||
std::map<std::string, edm::EDGetTokenT<RecHitCollection> > inputs_; | ||
std::map<std::string, edm::EDGetTokenT<RecHitCollection>> inputs_; | ||
edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; | ||
|
||
TrackDetectorAssociator trackAssociator_; | ||
TrackAssociatorParameters parameters_; | ||
|
||
bool is_preshower_; | ||
void fill_correction_map(TrackDetMatchInfo*, std::map<uint32_t, float>*); | ||
void fill_correction_map(TrackDetMatchInfo *, std::map<uint32_t, float> *); | ||
}; | ||
|
||
template <typename T> | ||
CaloCleaner<T>::CaloCleaner(const edm::ParameterSet& iConfig) | ||
: mu_input_(consumes<edm::View<pat::Muon> >(iConfig.getParameter<edm::InputTag>("MuonCollection"))), | ||
propagatorToken_(esConsumes(edm::ESInputTag("", "SteppingHelixPropagatorAny"))) { | ||
std::vector<edm::InputTag> inCollections = iConfig.getParameter<std::vector<edm::InputTag> >("oldCollection"); | ||
for (const auto& inCollection : inCollections) { | ||
inputs_[inCollection.instance()] = consumes<RecHitCollection>(inCollection); | ||
produces<RecHitCollection>(inCollection.instance()); | ||
} | ||
|
||
is_preshower_ = iConfig.getUntrackedParameter<bool>("is_preshower", false); | ||
edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters"); | ||
edm::ConsumesCollector iC = consumesCollector(); | ||
parameters_.loadParameters(parameters, iC); | ||
//trackAssociator_.useDefaultPropagator(); | ||
} | ||
|
||
template <typename T> | ||
CaloCleaner<T>::~CaloCleaner() { | ||
// nothing to be done yet... | ||
} | ||
|
||
template <typename T> | ||
void CaloCleaner<T>::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
auto const& propagator = iSetup.getData(propagatorToken_); | ||
trackAssociator_.setPropagator(&propagator); | ||
|
||
edm::Handle<edm::View<pat::Muon> > muonHandle; | ||
iEvent.getByToken(mu_input_, muonHandle); | ||
edm::View<pat::Muon> muons = *muonHandle; | ||
|
||
std::map<uint32_t, float> correction_map; | ||
|
||
// Fill the correction map | ||
for (edm::View<pat::Muon>::const_iterator iMuon = muons.begin(); iMuon != muons.end(); ++iMuon) { | ||
// get the basic informaiton like fill reco mouon does | ||
// RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc | ||
const reco::Track* track = nullptr; | ||
if (iMuon->track().isNonnull()) | ||
track = iMuon->track().get(); | ||
else if (iMuon->standAloneMuon().isNonnull()) | ||
track = iMuon->standAloneMuon().get(); | ||
else | ||
throw cms::Exception("FatalError") | ||
<< "Failed to fill muon id information for a muon with undefined references to tracks"; | ||
TrackDetMatchInfo info = | ||
trackAssociator_.associate(iEvent, iSetup, *track, parameters_, TrackDetectorAssociator::Any); | ||
fill_correction_map(&info, &correction_map); | ||
} | ||
|
||
// Copy the old collection and correct if necessary | ||
for (auto input_ : inputs_) { | ||
std::unique_ptr<RecHitCollection> recHitCollection_output(new RecHitCollection()); | ||
edm::Handle<RecHitCollection> recHitCollection; | ||
// iEvent.getByToken(input_.second[0], recHitCollection); | ||
iEvent.getByToken(input_.second, recHitCollection); | ||
for (typename RecHitCollection::const_iterator recHit = recHitCollection->begin(); | ||
recHit != recHitCollection->end(); | ||
++recHit) { | ||
if (correction_map[recHit->detid().rawId()] > 0) { | ||
float new_energy = recHit->energy() - correction_map[recHit->detid().rawId()]; | ||
if (new_energy <= 0) | ||
continue; // Do not save empty Hits | ||
T newRecHit(*recHit); | ||
newRecHit.setEnergy(new_energy); | ||
recHitCollection_output->push_back(newRecHit); | ||
} else { | ||
recHitCollection_output->push_back(*recHit); | ||
} | ||
/* For the inveted collection | ||
if (correction_map[recHit->detid().rawId()] > 0){ | ||
float new_energy = correction_map[recHit->detid().rawId()]; | ||
if (new_energy < 0) new_energy =0; | ||
T newRecHit(*recHit); | ||
newRecHit.setEnergy(new_energy); | ||
recHitCollection_output->push_back(newRecHit); | ||
}*/ | ||
} | ||
// Save the new collection | ||
recHitCollection_output->sort(); | ||
iEvent.put(std::move(recHitCollection_output), input_.first); | ||
} | ||
} | ||
#endif | ||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@winterchristian , normally
GsfTrackReco
type dictionaries should go in toDataFormats/GsfTrackReco
. Any specific reason to add these dict inDataFormats/EgammaCandidates
package?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cms-sw/reconstruction-l2 any objections on moving these to
DataFormats/GsfTrackReco
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection. Sorry we missed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same from us (answering for @winterchristian since he is on holiday)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #44884