11 : moduleLabel_(cfg.getParameter<
std::
string>(
"@module_label"))
24 produces<JetCollection>();
47 std::vector<bool>
match(shiftedObjects->
size(),
false);
52 unshiftedObject != unshiftedObjects->
end(); ++unshiftedObject ) {
53 bool isMatched_Object =
false;
60 shiftedObject != shiftedObjects->
end(); ++shiftedObject ) {
61 if(
match[ cnt ] )
continue;
63 double dR2 =
deltaR2(unshiftedObject->p4(), shiftedObject->p4());
65 shiftedObjectP4_matched = shiftedObject->p4();
66 isMatched_Object =
true;
67 dR2bestMatch_Object = dR2;
73 if ( isMatched_Object ) {
75 match[ prevMatch ] =
true;
83 auto shiftedJets = std::make_unique<JetCollection>();
85 for (
typename JetCollection::const_iterator originalJet = originalJets->begin();
86 originalJet != originalJets->end(); ++originalJet ) {
89 bool applyShift =
false;
94 for (
typename std::vector<objectEntryType>::const_iterator
object =
objects_.begin();
96 if ( !
object->isValidMatch_ )
continue;
97 if(
match[ cnt ] )
continue;
99 double dR2 =
deltaR2(originalJet->p4(),
object->unshiftedObjectP4_);
101 shift =
object->shift_;
103 dR2bestMatch_Jet = dR2;
113 match[ prevMatch ] =
true;
115 shiftedJetP4 *= (1. +
shift);
118 T shiftedJet(*originalJet);
119 shiftedJet.setP4(shiftedJetP4);
121 shiftedJets->push_back(shiftedJet);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ShiftedJetProducerByMatchedObjectT< reco::CaloJet > ShiftedCaloJetProducerByMatchedObject
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const_iterator begin() const
std::vector< objectEntryType > objects_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcShiftedObjects_
ShiftedJetProducerByMatchedObjectT< reco::PFJet > ShiftedPFJetProducerByMatchedObject
edm::EDGetTokenT< edm::View< reco::Candidate > > srcUnshiftedObjects_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
math::XYZTLorentzVector LorentzVector
Lorentz vector.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~ShiftedJetProducerByMatchedObjectT() override
static unsigned int const shift
const_iterator end() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::EDGetTokenT< JetCollection > srcJets_
ShiftedJetProducerByMatchedObjectT(const edm::ParameterSet &)