49 |
|
flav_.clear(); |
50 |
|
eid_.clear(); |
51 |
|
muid_.clear(); |
52 |
< |
partons_.reserve(10); |
53 |
< |
eid_.reserve(10); |
54 |
< |
muid_.reserve(10); |
55 |
< |
flav_.reserve(10); |
52 |
> |
partons_.reserve(2); |
53 |
> |
eid_.reserve(2); |
54 |
> |
muid_.reserve(2); |
55 |
> |
flav_.reserve(2); |
56 |
|
|
57 |
|
unsigned int n_quarks = 0; |
58 |
|
unsigned int n_antiquarks = 0; |
158 |
|
unsigned int *eid = new unsigned int[nPartons]; |
159 |
|
unsigned int *muid = new unsigned int[nPartons]; |
160 |
|
|
161 |
+ |
assert (nPartons <= 2); |
162 |
|
|
163 |
|
for (unsigned int ip(0); ip<nPartons; ip++){//loop on partons |
164 |
|
nDaugh[ip] = 0; |
170 |
|
eid[ip] = 0; |
171 |
|
muid[ip] = 0; |
172 |
|
daughters[ip].clear(); |
173 |
< |
daughters[ip].reserve(250); |
173 |
> |
daughters[ip].reserve(500); |
174 |
|
parents[ip].clear(); |
175 |
< |
parents[ip].reserve(250); |
175 |
> |
parents[ip].reserve(500); |
176 |
|
parents[ip].push_back(partons_.at(ip)); |
177 |
|
|
178 |
|
for (unsigned int pmc = 0; pmc < parents[ip].size(); pmc++){//loop "interactively" on parents |
179 |
|
unsigned int lParIndex = parents[ip].at(pmc); |
180 |
< |
if (debug_ > 2) std::cout << "** Looking for parent : #" << lParIndex << " (id " << (*aGenParticles).at(lParIndex).pdgId() << "), vector size = " << parents[ip].size() << std::endl; |
180 |
> |
const reco::GenParticle & ppar = (*aGenParticles).at(lParIndex); |
181 |
> |
if (debug_ > 2) std::cout << "** Looking for parent : #" << lParIndex << " (id " << ppar.pdgId() << "), vector size = " << parents[ip].size() << std::endl; |
182 |
|
|
183 |
|
//counter to check a match is found |
184 |
|
unsigned int lNNotFound = 0; |
189 |
|
|
190 |
|
for (unsigned int im(0); im<pgen.numberOfMothers(); im++){//loop on parents |
191 |
|
//recursive loop to find all parents |
192 |
< |
if ( compareParticles(pgen.mother(im),(*aGenParticles).at(lParIndex)) ){//if par=parton |
192 |
> |
if ( compareParticles(pgen.mother(im),ppar)){//if par=parton |
193 |
|
lNTot++; |
194 |
|
if (pgen.status() != 1) { |
195 |
|
nDaugh[ip]++; |
229 |
|
}//loop on parts |
230 |
|
if (lNNotFound == lNTot ) { |
231 |
|
std::cout << " --- WARNING: no particle found for parton #" << lParIndex ; |
232 |
< |
printParticle((*aGenParticles).at(lParIndex)); |
232 |
> |
printParticle(ppar); |
233 |
|
} |
234 |
|
|
235 |
|
}//loop on parents |
305 |
|
|
306 |
|
}//for light jets |
307 |
|
|
308 |
+ |
|
309 |
|
delete[] nDaugh; |
310 |
|
delete[] parents; |
311 |
|
delete[] daughters; |