62 typedef vector<T> TCollection;
73 std::vector<edm::Ref<reco::RecoEcalCandidateCollection>> clusCands;
76 std::vector<edm::Ref<reco::ElectronCollection>> eleCands;
83 std::vector<TVector3> ElePs;
85 if (!clusCands.empty()) {
86 for (
auto& clusCand : clusCands) {
87 TVector3 positionVector(clusCand->superCluster()->position().x(),
88 clusCand->superCluster()->position().y(),
89 clusCand->superCluster()->position().z());
90 ElePs.push_back(positionVector);
92 }
else if (!eleCands.empty()) {
93 for (
auto& eleCand : eleCands) {
94 TVector3 positionVector(eleCand->superCluster()->position().x(),
95 eleCand->superCluster()->position().y(),
96 eleCand->superCluster()->position().z());
97 ElePs.push_back(positionVector);
99 }
else if (!photonCands.empty()) {
100 for (
auto& photonCand : photonCands) {
101 TVector3 positionVector(photonCand->superCluster()->position().x(),
102 photonCand->superCluster()->position().y(),
103 photonCand->superCluster()->position().z());
104 ElePs.push_back(positionVector);
111 const TCollection& theJetCollection = *theJetCollectionHandle;
113 std::unique_ptr<TCollection> theFilteredJetCollection(
new TCollection);
115 std::unique_ptr<TCollectionVector> allSelections(
new TCollectionVector());
117 bool foundSolution(
false);
119 for (
auto& EleP : ElePs) {
120 bool VBFJetPair =
false;
121 std::vector<int> store_jet;
122 TRefVector refVector;
124 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
125 TVector3 JetP(theJetCollection[
j].
px(), theJetCollection[
j].
py(), theJetCollection[
j].pz());
126 double DR = EleP.DeltaR(JetP);
129 store_jet.push_back(
j);
132 for (
unsigned int k =
j + 1;
k < theJetCollection.size();
k++) {
133 TVector3 SoftJetP(theJetCollection[
k].
px(), theJetCollection[
k].
py(), theJetCollection[
k].pz());
134 double softDR = EleP.DeltaR(SoftJetP);
138 store_jet.push_back(
k);
147 std::sort(store_jet.begin(), store_jet.end());
148 store_jet.erase(
unique(store_jet.begin(), store_jet.end()), store_jet.end());
151 for (
int& ijet : store_jet) {
153 refVector.push_back(TRef(theJetCollectionHandle, ijet));
156 theFilteredJetCollection->push_back(theJetCollection[ijet]);
159 allSelections->push_back(refVector);
162 foundSolution =
true;
164 foundSolution =
true;
165 else if (!foundSolution)
166 theFilteredJetCollection->clear();