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.4 by lethuill, Wed Dec 17 16:23:49 2008 UTC vs.
Revision 1.8 by lethuill, Tue Apr 7 17:09:06 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 >                        // Jet energy correction changed in 22x
161 >                        // see DataFormats/PatCandidates/interface/JetCorrFactors.h
162 >                        // j'ai pas tout compris, mais je choisis le niveau L7 pour tout le monde
163 >                        // A verifier. S.P.
164 >                        localJet.setBCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7b));
165 >                        localJet.setCCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7c));
166 >                        localJet.setUDSCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7uds));
167 >                        localJet.setGCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7g));
168  
169                          // Use  associated tracks to calculate charged broadness of the jet
170                          // FIXME - Check generalTracks collection is present
# Line 241 | Line 246 | void JetAnalyzer::Process(const edm::Eve
246                                          localJet.setGenParticleIndex(-1);
247                                  }
248  
249 <                                // Matched generated parton
250 <                                if ( patJet->genParton() != NULL )
249 >                                // check if jet comes from a top
250 >                                bool IsTopJet =  false;
251 >                                if(patJet->genParton())
252                                  {
253 <                                        localJet.setMomentumMCParton(TLorentzVector(patJet->genParton()->px(),patJet->genParton()->py(),patJet->genParton()->pz(),patJet->genParton()->energy()));
254 <                                        localJet.setVertexMCParton(TVector3(patJet->genParton()->vx(),patJet->genParton()->vy(),patJet->genParton()->vz() ) );
255 <                                        localJet.setPdgIdMCParton(patJet->genParton()->pdgId());
253 >                                        const reco::Candidate* gen = patJet->genParton();
254 >                                        while(gen->mother())
255 >                                        {
256 >                                                if(abs((gen->mother())->pdgId()) == 6)
257 >                                                {
258 >                                                        IsTopJet =  true;
259 >                                                        break;
260 >                                                }
261 >                                                else
262 >                                                {
263 >                                                        gen = (gen->mother() );
264 >                                                }
265 >                                        }
266                                  }
267 +                                localJet.setIsTopJet(IsTopJet);
268  
269                                  // Matched generated jet
270                                  if ( patJet->genJet() != NULL )
271                                  {
272 <                                        localJet.setMomentumMCJet(TLorentzVector(patJet->genJet()->px(),patJet->genJet()->py(),patJet->genJet()->pz(),patJet->genJet()->energy()));
256 <                                        localJet.setVertexMCJet(TVector3(patJet->genJet()->vx(),patJet->genJet()->vy(),patJet->genJet()->vz() ));
257 <                                        localJet.setPdgIdMCJet(patJet->genJet()->pdgId());
272 >                                        localJet.setGenJetEnergy( patJet->genJet()->energy() );
273                                  }
274 +
275                          }
276                  }
277  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines