17 : hltElectronTag(iConfig.getParameter<
edm::
InputTag>(
"HltElectronTag")),
18 sourceJetTag(iConfig.getParameter<
edm::
InputTag>(
"SourceJetTag")),
22 minDeltaR_(iConfig.getParameter<double>(
"minDeltaR"))
31 produces<TCollectionVector>();
48 desc.add<
double>(
"minDeltaR", 0.5);
65 typedef vector<T> TCollection;
74 iEvent.getByToken(m_theElectronToken, PrevFilterOutput);
78 std::vector<edm::Ref<reco::RecoEcalCandidateCollection>> clusCands;
81 std::vector<edm::Ref<reco::ElectronCollection>> eleCands;
88 std::vector<TVector3> ElePs;
90 if (!clusCands.empty()) {
91 for (
auto& clusCand : clusCands) {
92 TVector3 positionVector(clusCand->superCluster()->position().x(),
93 clusCand->superCluster()->position().y(),
94 clusCand->superCluster()->position().z());
95 ElePs.push_back(positionVector);
97 }
else if (!eleCands.empty()) {
98 for (
auto& eleCand : eleCands) {
99 TVector3 positionVector(eleCand->superCluster()->position().x(),
100 eleCand->superCluster()->position().y(),
101 eleCand->superCluster()->position().z());
102 ElePs.push_back(positionVector);
104 }
else if (!photonCands.empty()) {
105 for (
auto& photonCand : photonCands) {
106 TVector3 positionVector(photonCand->superCluster()->position().x(),
107 photonCand->superCluster()->position().y(),
108 photonCand->superCluster()->position().z());
109 ElePs.push_back(positionVector);
114 iEvent.getByToken(m_theJetToken, theJetCollectionHandle);
116 const TCollection& theJetCollection = *theJetCollectionHandle;
120 std::unique_ptr<TCollectionVector> allSelections(
new TCollectionVector());
124 for (
auto& EleP : ElePs) {
127 TRefVector refVector;
129 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
130 TVector3 JetP(theJetCollection[
j].
px(), theJetCollection[
j].
py(), theJetCollection[
j].pz());
131 double DR = EleP.DeltaR(JetP);
134 refVector.push_back(TRef(theJetCollectionHandle,
j));
136 allSelections->push_back(refVector);