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.7 by lethuill, Wed Mar 11 12:44:56 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  
244                                // Matched generated parton
245                                if ( patJet->genParton() != NULL )
246                                {
247                                        localJet.setMomentumMCParton(TLorentzVector(patJet->genParton()->px(),patJet->genParton()->py(),patJet->genParton()->pz(),patJet->genParton()->energy()));
248                                        localJet.setVertexMCParton(TVector3(patJet->genParton()->vx(),patJet->genParton()->vy(),patJet->genParton()->vz() ) );
249                                        localJet.setPdgIdMCParton(patJet->genParton()->pdgId());
250                                }
251
249                                  // Matched generated jet
250 +                                // FIXME - Keep genJet index or UID instead
251 +                                // genJet stocked in MCParticles branch
252 +                                /*
253                                  if ( patJet->genJet() != NULL )
254                                  {
255                                          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());
258                                  }
259 +                                */
260 +
261 +                                // check if jet comes from a top
262 +                                bool IsTopJet =  false;
263 +                                if(patJet->genParton())
264 +                                {
265 +                                        const reco::Candidate* gen = patJet->genParton();
266 +                                        while(gen->mother())
267 +                                        {
268 +                                                if(abs((gen->mother())->pdgId()) == 6)
269 +                                                {
270 +                                                        IsTopJet =  true;
271 +                                                        break;
272 +                                                }
273 +                                                else
274 +                                                {
275 +                                                        gen = (gen->mother() );
276 +                                                }
277 +                                        }
278 +                                }
279 +                                localJet.setIsTopJet(IsTopJet);
280                          }
281                  }
282  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines