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

Comparing UserCode/MitHzz4l/LeptonSelection/src/IsolationSelection.cc (file contents):
Revision 1.21 by khahn, Sun May 20 19:08:58 2012 UTC vs.
Revision 1.22 by anlevin, Tue May 22 22:31:17 2012 UTC

# Line 25 | Line 25 | extern vector<bool> PFnoPUflag;
25  
26   //--------------------------------------------------------------------------------------------------
27   Float_t computePFMuonIso(const mithep::Muon *muon,
28 <                         const mithep::Vertex & vtx,
28 >                         const mithep::Vertex * vtx,
29                           const mithep::Array<mithep::PFCandidate> * fPFCandidates,
30                           const Double_t dRMax)
31   //--------------------------------------------------------------------------------------------------
# Line 34 | Line 34 | Float_t computePFMuonIso(const mithep::M
34    const Double_t neuPtMin = 1.0;
35    const Double_t dzMax    = 0.1;
36      
37 <  Double_t zLepton = (muon->BestTrk()) ? muon->BestTrk()->DzCorrected(vtx) : 0.0;
37 >  Double_t zLepton = (muon->BestTrk()) ? muon->BestTrk()->DzCorrected(*vtx) : 0.0;
38    
39    Float_t iso=0;
40    for(UInt_t ipf=0; ipf<fPFCandidates->GetEntries(); ipf++) {
# Line 46 | Line 46 | Float_t computePFMuonIso(const mithep::M
46      if(pfcand->TrackerTrk() && muon->TrackerTrk() && (pfcand->TrackerTrk()==muon->TrackerTrk())) continue;
47      
48      // dz cut
49 <    Double_t dz = (pfcand->BestTrk()) ? fabs(pfcand->BestTrk()->DzCorrected(vtx) - zLepton) : 0;
49 >    Double_t dz = (pfcand->BestTrk()) ? fabs(pfcand->BestTrk()->DzCorrected(*vtx) - zLepton) : 0;
50      if(dz >= dzMax) continue;
51      
52      // check iso cone
# Line 60 | Line 60 | Float_t computePFMuonIso(const mithep::M
60  
61   //--------------------------------------------------------------------------------------------------
62   Float_t computePFEleIso(const mithep::Electron *electron,
63 <                        const mithep::Vertex & fVertex,
63 >                        const mithep::Vertex * fVertex,
64                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
65                          const Double_t dRMax)
66   //--------------------------------------------------------------------------------------------------
# Line 69 | Line 69 | Float_t computePFEleIso(const mithep::El
69    const Double_t neuPtMin = 1.0;
70    const Double_t dzMax    = 0.1;
71      
72 <  Double_t zLepton = (electron->BestTrk()) ? electron->BestTrk()->DzCorrected(fVertex) : 0.0;
72 >  Double_t zLepton = (electron->BestTrk()) ? electron->BestTrk()->DzCorrected(*fVertex) : 0.0;
73    
74    Float_t iso=0;
75    for(UInt_t ipf=0; ipf<fPFCandidates->GetEntries(); ipf++) {
# Line 78 | Line 78 | Float_t computePFEleIso(const mithep::El
78      if(!pfcand->HasTrk() && (pfcand->Pt()<=neuPtMin)) continue;  // pT cut on neutral particles
79      
80      // dz cut
81 <    Double_t dz = (pfcand->BestTrk()) ? fabs(pfcand->BestTrk()->DzCorrected(fVertex) - zLepton) : 0;
81 >    Double_t dz = (pfcand->BestTrk()) ? fabs(pfcand->BestTrk()->DzCorrected(*fVertex) - zLepton) : 0;
82      if(dz >= dzMax) continue;
83      
84      // remove THE electron
# Line 182 | Line 182 | bool pairwiseIsoSelection( ControlFlags
182   //--------------------------------------------------------------------------------------------------
183   SelectionStatus muonIsoSelection(ControlFlags &ctrl,
184                                   const mithep::Muon * mu,
185 <                                 const mithep::Vertex & vtx,
185 >                                 const mithep::Vertex * vtx,
186                                   const mithep::Array<mithep::PFCandidate> * fPFCandidateCol   )
187   //--------------------------------------------------------------------------------------------------
188   {
# Line 212 | Line 212 | SelectionStatus muonIsoSelection(Control
212   //--------------------------------------------------------------------------------------------------
213   SelectionStatus electronIsoSelection(ControlFlags &ctrl,
214                                       const mithep::Electron * ele,
215 <                                     const mithep::Vertex &fVertex,
215 >                                     const mithep::Vertex *fVertex,
216                                       const mithep::Array<mithep::PFCandidate> * fPFCandidates)
217   //--------------------------------------------------------------------------------------------------
218   {
# Line 254 | Line 254 | bool noIso(ControlFlags &, vector<Simple
254   //--------------------------------------------------------------------------------------------------
255   SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
256                                      const mithep::Muon * mu,
257 <                                    const mithep::Vertex & vtx,
257 >                                    const mithep::Vertex * vtx,
258                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
259                                      const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
260                                      mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 595 | Line 595 | SelectionStatus muonIsoMVASelection(Cont
595   //--------------------------------------------------------------------------------------------------
596   SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
597                                      const mithep::Muon * mu,
598 <                                    const mithep::Vertex & vtx,
598 >                                    const mithep::Vertex * vtx,
599                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
600                                      float rho,
601                                      //const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
# Line 957 | Line 957 | void initMuonIsoMVA() {
957   //--------------------------------------------------------------------------------------------------
958   double  muonPFIso04(ControlFlags &ctrl,
959                      const mithep::Muon * mu,
960 <                    const mithep::Vertex & vtx,
960 >                    const mithep::Vertex * vtx,
961                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
962                      const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
963                      mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 1137 | Line 1137 | double  muonPFIso04(ControlFlags &ctrl,
1137   // hacked version
1138   double  muonPFIso04(ControlFlags &ctrl,
1139                      const mithep::Muon * mu,
1140 <                    const mithep::Vertex & vtx,
1140 >                    const mithep::Vertex * vtx,
1141                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1142                      float rho,
1143                      mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 1313 | Line 1313 | double  muonPFIso04(ControlFlags &ctrl,
1313   //--------------------------------------------------------------------------------------------------
1314   SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
1315                                            const mithep::Muon * mu,
1316 <                                          const mithep::Vertex & vtx,
1316 >                                          const mithep::Vertex * vtx,
1317                                            const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1318                                            const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
1319                                            mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 1349 | Line 1349 | SelectionStatus muonReferenceIsoSelectio
1349   // hacked version
1350   SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
1351                                            const mithep::Muon * mu,
1352 <                                          const mithep::Vertex & vtx,
1352 >                                          const mithep::Vertex * vtx,
1353                                            const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1354                                            float rho,
1355                                            mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 1386 | Line 1386 | SelectionStatus muonReferenceIsoSelectio
1386   //--------------------------------------------------------------------------------------------------
1387   SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
1388                                          const mithep::Electron * ele,
1389 <                                        const mithep::Vertex & vtx,
1389 >                                        const mithep::Vertex * vtx,
1390                                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1391                                          const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
1392                                          mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 1478 | Line 1478 | SelectionStatus electronIsoMVASelection(
1478  
1479      if(ctrl.debug) {
1480        cout << "pf :: type: " << pf->PFType() << "\tpt: " << pf->Pt();
1481 <      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(vtx);
1481 >      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(*vtx);
1482        cout << endl;
1483      }
1484  
# Line 1805 | Line 1805 | SelectionStatus electronIsoMVASelection(
1805   //--------------------------------------------------------------------------------------------------
1806   SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
1807                                          const mithep::Electron * ele,
1808 <                                        const mithep::Vertex & vtx,
1808 >                                        const mithep::Vertex * vtx,
1809                                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1810                                          float rho,
1811                                          //const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
# Line 1902 | Line 1902 | SelectionStatus electronIsoMVASelection(
1902  
1903      if(ctrl.debug) {
1904        cout << "pf :: type: " << pf->PFType() << "\tpt: " << pf->Pt();
1905 <      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(vtx);
1905 >      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(*vtx);
1906        cout << endl;
1907      }
1908  
# Line 2247 | Line 2247 | void initElectronIsoMVA() {
2247   // hacked version
2248   float electronPFIso04(ControlFlags &ctrl,
2249                        const mithep::Electron * ele,
2250 <                      const mithep::Vertex & vtx,
2250 >                      const mithep::Vertex * vtx,
2251                        const mithep::Array<mithep::PFCandidate> * fPFCandidates,
2252                        const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
2253                        mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 2301 | Line 2301 | float electronPFIso04(ControlFlags &ctrl
2301  
2302      if(ctrl.debug) {
2303        cout << "pf :: type: " << pf->PFType() << "\tpt: " << pf->Pt() << "\tdR: " << dr;
2304 <      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(vtx)
2304 >      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(*vtx)
2305                                       << "\ttrk: " << pf->HasTrackerTrk()
2306                                       << "\tgsf: " << pf->HasGsfTrk();
2307        
# Line 2467 | Line 2467 | float electronPFIso04(ControlFlags &ctrl
2467   // hacked version
2468   float electronPFIso04(ControlFlags &ctrl,
2469                        const mithep::Electron * ele,
2470 <                      const mithep::Vertex & vtx,
2470 >                      const mithep::Vertex * vtx,
2471                        const mithep::Array<mithep::PFCandidate> * fPFCandidates,
2472                        float rho,
2473                        mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 2521 | Line 2521 | float electronPFIso04(ControlFlags &ctrl
2521  
2522      if(ctrl.debug) {
2523        cout << "pf :: type: " << pf->PFType() << "\tpt: " << pf->Pt() << "\tdR: " << dr;
2524 <      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(vtx)
2524 >      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(*vtx)
2525                                       << "\ttrk: " << pf->HasTrackerTrk()
2526                                       << "\tgsf: " << pf->HasGsfTrk();
2527        
# Line 2684 | Line 2684 | float electronPFIso04(ControlFlags &ctrl
2684   //--------------------------------------------------------------------------------------------------
2685   SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
2686                                                const mithep::Electron * ele,
2687 <                                              const mithep::Vertex & vtx,
2687 >                                              const mithep::Vertex * vtx,
2688                                                const mithep::Array<mithep::PFCandidate> * fPFCandidates,
2689                                                const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
2690                                                mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 2720 | Line 2720 | SelectionStatus electronReferenceIsoSele
2720   // hacked version
2721   SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
2722                                                const mithep::Electron * ele,
2723 <                                              const mithep::Vertex & vtx,
2723 >                                              const mithep::Vertex * vtx,
2724                                                const mithep::Array<mithep::PFCandidate> * fPFCandidates,
2725                                                float rho,
2726                                                mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines