/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/CommonAlignmentProducer/plugins/AlignmentCSCTrackSelectorModule.cc
48 строк
2 KB
mmusich
Add fillDescriptions to several plugins used at HLT
03 фев 2025, 13:35
03 фев 2025, 13:35
083eb7b
Код
Авторство
О чём код?
#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "CommonTools/UtilAlgos/interface/ObjectSelector.h" //the selectores used to select the tracks #include "Alignment/CommonAlignmentProducer/interface/AlignmentCSCTrackSelector.h" #include "Alignment/CommonAlignmentProducer/interface/AlignmentGlobalTrackSelector.h" #include "Alignment/CommonAlignmentProducer/interface/AlignmentTwoBodyDecayTrackSelector.h" // the following include is necessary to clone all track branches // including recoTrackExtras and TrackingRecHitsOwned. // if you remove it the code will compile, but the cloned // tracks have only the recoTracks branch! #include "CommonTools/RecoAlgos/interface/TrackSelector.h" struct CSCTrackConfigSelector { typedef std::vector<const reco::Track *> container; typedef container::const_iterator const_iterator; typedef reco::TrackCollection collection; CSCTrackConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC) : theBaseSelector(cfg) {} const_iterator begin() const { return theSelectedTracks.begin(); } const_iterator end() const { return theSelectedTracks.end(); } size_t size() const { return theSelectedTracks.size(); } void select(const edm::Handle<reco::TrackCollection> &c, const edm::Event &evt, const edm::EventSetup & /*dummy*/) { container all; for (reco::TrackCollection::const_iterator i = c.product()->begin(); i != c.product()->end(); ++i) { all.push_back(&*i); } theSelectedTracks = theBaseSelector.select(all, evt); // might add dummy } static void fillPSetDescription(edm::ParameterSetDescription &desc) { AlignmentCSCTrackSelector::fillPSetDescription(desc); } private: container theSelectedTracks; AlignmentCSCTrackSelector theBaseSelector; }; typedef ObjectSelector<CSCTrackConfigSelector> AlignmentCSCTrackSelectorModule; DEFINE_FWK_MODULE(AlignmentCSCTrackSelectorModule);