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

Comparing UserCode/MitPhysics/Mods/src/MuonIDMod.cc (file contents):
Revision 1.9 by ceballos, Fri Nov 28 10:31:38 2008 UTC vs.
Revision 1.16 by ceballos, Thu Apr 30 06:34:09 2009 UTC

# Line 13 | Line 13 | ClassImp(mithep::MuonIDMod)
13    BaseMod(name,title),
14    fMuonBranchName(Names::gkMuonBrn),
15    fCleanMuonsName(ModNames::gkCleanMuonsName),  
16 +  fVertexName("PrimaryVertexesBeamSpot"),
17    fMuonIDType("Loose"),
18    fMuonIsoType("TrackCaloSliding"),  
19    fMuonClassType("Global"),  
# Line 20 | Line 21 | ClassImp(mithep::MuonIDMod)
21    fCaloIsolationCut(3.0),
22    fCombIsolationCut(5.0),
23    fMuonPtMin(10),
24 <  fMuons(0)
24 >  fD0Cut(0.025),
25 >  fMuIDType(kIdUndef),
26 >  fMuIsoType(kIsoUndef),
27 >  fMuClassType(kClassUndef),
28 >  fMuons(0),
29 >  fVertices(0),
30 >  fMuonTools(0),
31 >  fReverseIsoCut(kTRUE)
32   {
33    // Constructor.
34   }
35  
28
36   //--------------------------------------------------------------------------------------------------
37   void MuonIDMod::Process()
38   {
39    // Process entries of the tree.
40  
41    LoadBranch(fMuonBranchName);
42 +  LoadBranch(fVertexName);
43  
44    MuonOArr *CleanMuons = new MuonOArr;
45    CleanMuons->SetName(fCleanMuonsName);
# Line 109 | Line 117 | void MuonIDMod::Process()
117              isopass = kTRUE;
118          }
119          break;
120 <        case kNoIso:
121 <          isopass = kTRUE;
122 <          break;
120 >      case kNoIso:
121 >        isopass = kTRUE;
122 >        break;
123        case kCustomIso:
124        default:
125          break;
126      }
127  
128 <    if (!isopass)
128 >    if ((isopass == kFALSE && fReverseIsoCut == kFALSE) ||
129 >        (isopass == kTRUE  && fReverseIsoCut == kTRUE))
130        continue;
131  
132 +    // d0 cut
133 +    double d0_real = 99999;
134 +    for(uint i0 = 0; i0 < fVertices->GetEntries(); i0++) {
135 +      double pD0 = mu->GlobalTrk()->D0Corrected(*fVertices->At(i0));
136 +      if(TMath::Abs(pD0) < TMath::Abs(d0_real)) d0_real = TMath::Abs(pD0);
137 +    }
138 +    if(d0_real >= fD0Cut) continue;
139 +
140      // add good muon
141      CleanMuons->Add(mu);
142    }
143  
144 +  // sort according to pt
145 +  CleanMuons->Sort();
146 +
147    // add objects for other modules to use
148    AddObjThisEvt(CleanMuons);  
149   }
150  
131
151   //--------------------------------------------------------------------------------------------------
152   void MuonIDMod::SlaveBegin()
153   {
# Line 136 | Line 155 | void MuonIDMod::SlaveBegin()
155    // we just request the muon collection branch.
156  
157    ReqBranch(fMuonBranchName, fMuons);
158 +  ReqBranch(fVertexName, fVertices);
159  
160    fMuonTools = new MuonTools;
161  
# Line 143 | Line 163 | void MuonIDMod::SlaveBegin()
163      fMuIDType = kTight;
164    else if (fMuonIDType.CompareTo("Loose") == 0)
165      fMuIDType = kLoose;
166 +  else if (fMuonIDType.CompareTo("NoId") == 0)
167 +    fMuIDType = kNoId;
168    else if (fMuonIDType.CompareTo("Custom") == 0) {
169      fMuIDType = kCustomId;
170      SendError(kWarning, "SlaveBegin",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines