18 template <
typename jetType>
20 : hltLeptonTag(iConfig.getParameter<
edm::
InputTag>(
"HltLeptonTag")),
21 sourceJetTag(iConfig.getParameter<
edm::
InputTag>(
"SourceJetTag")),
22 minDeltaR_(iConfig.getParameter<double>(
"minDeltaR")) {
29 produces<JetCollectionVector>();
32 template <
typename jetType>
38 template <
typename jetType>
43 desc.
add<
double>(
"minDeltaR", 0.5);
53 template <
typename jetType>
69 vector<Ref<reco::RecoEcalCandidateCollection>> clusCands;
72 vector<Ref<reco::ElectronCollection>> eleCands;
78 vector<reco::RecoChargedCandidateRef> muonCands;
84 const JetCollection& theJetCollection = *theJetCollectionHandle;
86 unique_ptr<JetCollectionVector> allSelections(
new JetCollectionVector());
88 if (!clusCands.empty()) {
89 for (
auto& clusCand : clusCands) {
91 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
92 if (
deltaR(clusCand->superCluster()->position(), theJetCollection[
j]) >
minDeltaR_)
93 refVector.push_back(
JetRef(theJetCollectionHandle,
j));
95 allSelections->push_back(refVector);
99 if (!eleCands.empty()) {
100 for (
auto& eleCand : eleCands) {
102 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
103 if (
deltaR(eleCand->superCluster()->position(), theJetCollection[
j]) >
minDeltaR_)
104 refVector.push_back(
JetRef(theJetCollectionHandle,
j));
106 allSelections->push_back(refVector);
110 if (!photonCands.empty()) {
111 for (
auto& photonCand : photonCands) {
113 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
114 if (
deltaR(photonCand->superCluster()->position(), theJetCollection[
j]) >
minDeltaR_)
115 refVector.push_back(
JetRef(theJetCollectionHandle,
j));
117 allSelections->push_back(refVector);
121 if (!muonCands.empty()) {
122 for (
auto& muonCand : muonCands) {
124 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
126 refVector.push_back(
JetRef(theJetCollectionHandle,
j));
128 allSelections->push_back(refVector);