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

Comparing UserCode/MitPhysics/Mods/src/JetCleaningMod.cc (file contents):
Revision 1.6 by ceballos, Mon Dec 1 08:15:53 2008 UTC vs.
Revision 1.9 by bendavid, Thu Mar 12 16:00:46 2009 UTC

# Line 27 | Line 27 | void JetCleaningMod::Process()
27    // Process entries of the tree.
28  
29    // get input collections
30 <  ElectronOArr *CleanElectrons = GetObjThisEvt<ElectronOArr>(fCleanElectronsName);
31 <  PhotonOArr *CleanPhotons = GetObjThisEvt<PhotonOArr>(fCleanPhotonsName);
32 <  JetOArr *GoodJets = GetObjThisEvt<JetOArr>(fGoodJetsName);
30 >  const JetCol  *GoodJets       = GetObjThisEvt<JetCol>(fGoodJetsName);
31 >  const ElectronCol *CleanElectrons = 0;
32 >  if (!fCleanElectronsName.IsNull())
33 >    CleanElectrons = GetObjThisEvt<ElectronCol>(fCleanElectronsName);
34 >  const PhotonCol   *CleanPhotons   = 0;
35 >  if (!fCleanPhotonsName.IsNull())
36 >  CleanPhotons    = GetObjThisEvt<PhotonCol>(fCleanPhotonsName);
37  
38    // create output collection
39    JetOArr *CleanJets = new JetOArr;
40    CleanJets->SetName(fCleanJetsName);
41  
42 <  // Remove any jet that overlaps in eta, phi with an isolated electron.    
42 >  // remove any jet that overlaps in eta, phi with an isolated electron.    
43    for (UInt_t i=0; i<GoodJets->GetEntries(); ++i) {
44      const Jet *jet = GoodJets->At(i);        
45  
46 +    // check for overlap with an electron
47      Bool_t isElectronOverlap = kFALSE;
43    Bool_t isPhotonOverlap = kFALSE;
44
45    //Check for overlap with an electron
48      if (CleanElectrons) {
49 <      for (UInt_t j=0; j<CleanElectrons->Entries(); j++) {
49 >      UInt_t n = CleanElectrons->GetEntries();
50 >      for (UInt_t j=0; j<n; ++j) {
51          Double_t deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->Mom(),jet->Mom());  
52          if (deltaR < fMinDeltaRToElectron) {
53            isElectronOverlap = kTRUE;
# Line 55 | Line 58 | void JetCleaningMod::Process()
58  
59      if (isElectronOverlap) continue;
60  
61 <    //Check for overlap with a photon
61 >    // check for overlap with a photon
62 >    Bool_t isPhotonOverlap = kFALSE;
63      if (CleanPhotons) {
64 <      for (UInt_t j=0; j<CleanPhotons->Entries(); j++) {
64 >      UInt_t n = CleanPhotons->GetEntries();
65 >      for (UInt_t j=0; j<n; ++j) {
66          Double_t deltaR = MathUtils::DeltaR(CleanPhotons->At(j)->Mom(),jet->Mom());  
67          if (deltaR < fMinDeltaRToPhoton) {
68            isPhotonOverlap = kTRUE;
# Line 71 | Line 76 | void JetCleaningMod::Process()
76      CleanJets->Add(jet);    
77    }
78  
79 +  // sort according to pt
80 +  CleanJets->Sort();
81 +
82    // add to event for other modules to use
83    AddObjThisEvt(CleanJets);
84   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines