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

Comparing UserCode/Morgan/src/JetAnalyzer.cc (file contents):
Revision 1.3 by lethuill, Mon Dec 15 19:08:52 2008 UTC vs.
Revision 1.9 by lethuill, Fri Apr 10 08:27:40 2009 UTC

# Line 96 | Line 96 | void JetAnalyzer::Process(const edm::Eve
96                          ,jet->vx()
97                          ,jet->vy()
98                          ,jet->vz()
99 <                        ,abs(jet->pdgId())
99 >                        ,jet->pdgId()
100                          ,jet->charge()
101                  );
102  
# Line 156 | Line 156 | void JetAnalyzer::Process(const edm::Eve
156                          localJet.setBtag_trackCountingHighEff(patJet->bDiscriminator("trackCountingHighEffBJetTags"));
157                          localJet.setBtag_trackCountingHighPur(patJet->bDiscriminator("trackCountingHighPurBJetTags"));
158                          localJet.setBtag_jetProbability(patJet->bDiscriminator("jetProbabilityBJetTags"));
159 <                        localJet.setBCorrection(patJet->correctionFactor(pat::Jet::bCorrection));
160 <                        localJet.setCCorrection(patJet->correctionFactor(pat::Jet::cCorrection));
161 <                        localJet.setUDSCorrection(patJet->correctionFactor(pat::Jet::udsCorrection));
162 <                        localJet.setGCorrection(patJet->correctionFactor(pat::Jet::gCorrection));
159 >
160 >                        // see DataFormats/PatCandidates/interface/JetCorrFactors.h
161 >                        localJet.setBCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7b,patJet->jetCorrStep() ));
162 >                        localJet.setCCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7c,patJet->jetCorrStep() ));
163 >                        localJet.setUDSCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7uds,patJet->jetCorrStep() ));
164 >                        localJet.setGCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7g,patJet->jetCorrStep() ));
165  
166                          // Use  associated tracks to calculate charged broadness of the jet
167                          // FIXME - Check generalTracks collection is present
# Line 234 | Line 236 | void JetAnalyzer::Process(const edm::Eve
236                          // Matched genParticle
237                          if (useMC_)
238                          {
239 <                                if ( patJet->genParton() != NULL )
239 >                                // MC truth associator index
240 >                                if ((patJet->genParticleRef()).isNonnull()) {
241 >                                        localJet.setGenParticleIndex((patJet->genParticleRef()).index());
242 >                                } else {
243 >                                        localJet.setGenParticleIndex(-1);
244 >                                }
245 >
246 >                                // check if jet comes from a top
247 >                                bool IsTopJet =  false;
248 >                                if(patJet->genParton())
249                                  {
250 <                                        localJet.setMomentumMCParton(TLorentzVector(patJet->genParton()->px(),patJet->genParton()->py(),patJet->genParton()->pz(),patJet->genParton()->energy()));
251 <                                        localJet.setVertexMCParton(TVector3(patJet->genParton()->vx(),patJet->genParton()->vy(),patJet->genParton()->vz() ) );
252 <                                        localJet.setPdgIdMCParton(patJet->genParton()->pdgId());
250 >                                        const reco::Candidate* gen = patJet->genParton();
251 >                                        while(gen->mother())
252 >                                        {
253 >                                                if(abs((gen->mother())->pdgId()) == 6)
254 >                                                {
255 >                                                        IsTopJet =  true;
256 >                                                        break;
257 >                                                }
258 >                                                else
259 >                                                {
260 >                                                        gen = (gen->mother() );
261 >                                                }
262 >                                        }
263                                  }
264 +                                localJet.setIsTopJet(IsTopJet);
265  
266 +                                // Matched generated jet
267                                  if ( patJet->genJet() != NULL )
268                                  {
269 <                                        localJet.setMomentumMCJet(TLorentzVector(patJet->genJet()->px(),patJet->genJet()->py(),patJet->genJet()->pz(),patJet->genJet()->energy()));
247 <                                        localJet.setVertexMCJet(TVector3(patJet->genJet()->vx(),patJet->genJet()->vy(),patJet->genJet()->vz() ));
248 <                                        localJet.setPdgIdMCJet(patJet->genJet()->pdgId());
269 >                                        localJet.setGenJetEnergy( patJet->genJet()->energy() );
270                                  }
271 +
272                          }
273                  }
274  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines