69 typedef vector<T> TCollection;
79 std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
82 std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
89 std::vector<TVector3> ElePs;
91 if(!clusCands.empty()){
92 for(
auto & clusCand : clusCands){
93 TVector3 positionVector(
94 clusCand->superCluster()->position().x(),
95 clusCand->superCluster()->position().y(),
96 clusCand->superCluster()->position().z());
97 ElePs.push_back(positionVector);
99 }
else if(!eleCands.empty()){
100 for(
auto & eleCand : eleCands){
101 TVector3 positionVector(
102 eleCand->superCluster()->position().x(),
103 eleCand->superCluster()->position().y(),
104 eleCand->superCluster()->position().z());
105 ElePs.push_back(positionVector);
108 else if(!photonCands.empty()){
109 for(
auto & photonCand : photonCands){
110 TVector3 positionVector(
111 photonCand->superCluster()->position().x(),
112 photonCand->superCluster()->position().y(),
113 photonCand->superCluster()->position().z());
114 ElePs.push_back(positionVector);
121 const TCollection & theJetCollection = *theJetCollectionHandle;
123 std::unique_ptr< TCollection > theFilteredJetCollection(
new TCollection);
125 std::unique_ptr < TCollectionVector > allSelections(
new TCollectionVector());
127 bool foundSolution(
false);
129 for (
auto & EleP : ElePs) {
131 bool VBFJetPair =
false;
132 std::vector<int> store_jet;
133 TRefVector refVector;
135 for (
unsigned int j = 0; j < theJetCollection.size(); j++) {
136 TVector3 JetP(theJetCollection[j].px(), theJetCollection[j].py(),
137 theJetCollection[j].pz());
138 double DR = EleP.DeltaR(JetP);
141 store_jet.push_back(j);
144 for (
unsigned int k = j+1;
k < theJetCollection.size();
k++ ) {
145 TVector3 SoftJetP(theJetCollection[
k].px(), theJetCollection[
k].py(),
146 theJetCollection[
k].pz());
147 double softDR = EleP.DeltaR(SoftJetP);
151 store_jet.push_back(
k);
161 std::sort( store_jet.begin(), store_jet.end() );
162 store_jet.erase(
unique( store_jet.begin(), store_jet.end() ), store_jet.end() );
165 for (
int & ijet : store_jet)
168 refVector.push_back(TRef(theJetCollectionHandle, ijet));
171 theFilteredJetCollection->push_back(theJetCollection[ijet]);
174 allSelections->push_back(refVector);
177 foundSolution =
true;
179 foundSolution =
true;
180 else if (!foundSolution)
181 theFilteredJetCollection->clear();
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< T > > m_theJetToken
def unique(seq, keepstr=True)
Abs< T >::type abs(const T &t)
std::vector< reco::RecoEcalCandidateRef > VRphoton