ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/src/JetFlavour.cc
(Generate patch)

Comparing UserCode/HbbAnalysis/src/JetFlavour.cc (file contents):
Revision 1.1 by amagnan, Thu May 28 15:12:45 2009 UTC vs.
Revision 1.2 by amagnan, Tue Jun 2 13:24:26 2009 UTC

# Line 49 | Line 49 | namespace HbbAnalysis {
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;
# Line 158 | Line 158 | namespace HbbAnalysis {
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;
# Line 169 | Line 170 | namespace HbbAnalysis {
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;
# Line 187 | Line 189 | namespace HbbAnalysis {
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]++;
# Line 227 | Line 229 | namespace HbbAnalysis {
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
# Line 303 | Line 305 | namespace HbbAnalysis {
305  
306      }//for light jets
307  
308 +
309      delete[] nDaugh;
310      delete[] parents;
311      delete[] daughters;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines