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

Comparing UserCode/MitHzz4l/NonMCBackground/src/SelectionEMU.cc (file contents):
Revision 1.8 by dkralph, Thu Jun 21 21:25:38 2012 UTC vs.
Revision 1.9 by dkralph, Mon Jun 25 18:08:04 2012 UTC

# Line 30 | Line 30
30  
31   extern vector<SimpleLepton> failingLeptons;
32   extern vector<SimpleLepton> passingLeptons;
33 + extern vector<int> muTrigObjs,eleTrigObjs,muTriggers,eleTriggers;
34 + extern bitset<TRIGGER_BIG_NUMBER> triggerBits;
35  
36   //--------------------------------------------------------------------------------------------------
37   EventData apply_HZZ4L_EMU_selection(ControlFlags &ctrl,           // input control
38 <                                        const mithep::EventHeader *info,     // input event info
39 <                                        const mithep::Array<mithep::Vertex>       * vtxArr ,
40 <                                        const mithep::Array<mithep::PFCandidate>  *pfCandidates,
41 <                                        const mithep::Array<mithep::PileupEnergyDensity>  *puEnergyDensity,
42 <                                        const mithep::Array<mithep::Electron> *electronArr,    // input electrons
43 <                                        SelectionStatus (*ElectronPreSelector)( ControlFlags &,
44 <                                                                                const mithep::Electron*,
45 <                                                                                const mithep::Vertex *),
46 <                                        SelectionStatus (*ElectronIDSelector)( ControlFlags &,
47 <                                                                               const mithep::Electron*,
48 <                                                                               const mithep::Vertex *),
49 <                                        SelectionStatus (*ElectronIsoSelector)( ControlFlags &,
50 <                                                                                const mithep::Electron*,
51 <                                                                                const mithep::Vertex *,
52 <                                                                                const mithep::Array<mithep::PFCandidate> *,
53 <                                                                                const mithep::Array<mithep::PileupEnergyDensity> *,
52 <                                                                                mithep::ElectronTools::EElectronEffectiveAreaTarget,
53 <                                                                                vector<const mithep::PFCandidate*>),
54 <                                        const mithep::Array<mithep::Muon> *muonArr,    // input muons
55 <                                        SelectionStatus (*MuonPreSelector)( ControlFlags &,
56 <                                                                            const mithep::Muon*,
57 <                                                                            const mithep::Vertex *,
58 <                                                                            const mithep::Array<mithep::PFCandidate> *),
59 <                                        SelectionStatus (*MuonIDSelector)( ControlFlags &,
60 <                                                                           const mithep::Muon*,
61 <                                                                           // const mithep::Vertex &),
62 <                                                                           const mithep::Vertex *,
63 <                                                                           const mithep::Array<mithep::PFCandidate> *),
64 <                                        SelectionStatus (*MuonIsoSelector)( ControlFlags &,
65 <                                                                            const mithep::Muon*,
38 >                                    const mithep::EventHeader *info,     // input event info
39 >                                    mithep::TriggerTable *hltTable,
40 >                                    mithep::Array<mithep::TriggerObject> *hltObjArr,
41 >                                    mithep::TriggerObjectsTable *fTrigObjs,
42 >                                    const mithep::Array<mithep::Vertex>       * vtxArr ,
43 >                                    const mithep::Array<mithep::PFCandidate>  *pfCandidates,
44 >                                    const mithep::Array<mithep::PileupEnergyDensity>  *puEnergyDensity,
45 >                                    const mithep::Array<mithep::Electron> *electronArr,    // input electrons
46 >                                    SelectionStatus (*ElectronPreSelector)( ControlFlags &,
47 >                                                                            const mithep::Electron*,
48 >                                                                            const mithep::Vertex *),
49 >                                    SelectionStatus (*ElectronIDSelector)( ControlFlags &,
50 >                                                                           const mithep::Electron*,
51 >                                                                           const mithep::Vertex *),
52 >                                    SelectionStatus (*ElectronIsoSelector)( ControlFlags &,
53 >                                                                            const mithep::Electron*,
54                                                                              const mithep::Vertex *,
55 <                                                                            const mithep::Array<mithep::PFCandidate> *,
55 >                                                                            const mithep::Array<mithep::PFCandidate> *,
56                                                                              const mithep::Array<mithep::PileupEnergyDensity> *,
57 <                                                                            mithep::MuonTools::EMuonEffectiveAreaTarget,
58 <                                                                            vector<const mithep::PFCandidate*>)
59 <                                        )
57 >                                                                            mithep::ElectronTools::EElectronEffectiveAreaTarget,
58 >                                                                            vector<const mithep::PFCandidate*>),
59 >                                    const mithep::Array<mithep::Muon> *muonArr,    // input muons
60 >                                    SelectionStatus (*MuonPreSelector)( ControlFlags &,
61 >                                                                        const mithep::Muon*,
62 >                                                                        const mithep::Vertex *,
63 >                                                                        const mithep::Array<mithep::PFCandidate> *),
64 >                                    SelectionStatus (*MuonIDSelector)( ControlFlags &,
65 >                                                                       const mithep::Muon*,
66 >                                                                       // const mithep::Vertex &),
67 >                                                                       const mithep::Vertex *,
68 >                                                                       const mithep::Array<mithep::PFCandidate> *),
69 >                                    SelectionStatus (*MuonIsoSelector)( ControlFlags &,
70 >                                                                        const mithep::Muon*,
71 >                                                                        const mithep::Vertex *,
72 >                                                                        const mithep::Array<mithep::PFCandidate> *,
73 >                                                                        const mithep::Array<mithep::PileupEnergyDensity> *,
74 >                                                                        mithep::MuonTools::EMuonEffectiveAreaTarget,
75 >                                                                        vector<const mithep::PFCandidate*>)
76 >                                    )
77   //--------------------------------------------------------------------------------------------------
78   {      
79  
# Line 108 | Line 113 | EventData apply_HZZ4L_EMU_selection(Cont
113        
114  
115        SelectionStatus denomSel;
116 <      denomSel |= muonDenominatorSelection(ctrl,mu,vtx,pfCandidates);
117 <      if( !(denomSel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
116 >      denomSel |= muonPreSelectionNoD0DzIP(ctrl,mu,vtx,pfCandidates);
117 >      if( !denomSel.passPre() ) continue;
118  
119        SelectionStatus musel;
120        musel |= (*MuonPreSelector)(ctrl,mu,vtx,pfCandidates);
# Line 139 | Line 144 | EventData apply_HZZ4L_EMU_selection(Cont
144        tmplep.is4l    = false;
145        tmplep.isEB    = (fabs(mu->Eta()) < 1.479 ? 1 : 0 );
146        tmplep.isoMVA  = musel.isoMVA;
142      tmplep.isTight = musel.tight();
147        tmplep.isLoose = musel.loose();
148 +
149 +      bitset<TRIGGER_BIG_NUMBER> hltMatchBits = fillHLTMatchBits( mu->Eta(), mu->Phi(), hltTable, hltObjArr, fTrigObjs);
150 +      tmplep.isTight = testBits(ctrl,triggerBits,muTriggers,hltMatchBits,muTrigObjs);
151 +
152 +      tmplep.bdtfail = 0;
153 +      if(triggerBits.test(kHLT_IsoMu24_eta2p1))        tmplep.bdtfail |= 1;
154 +      if(hltMatchBits.test(kHLT_IsoMu24_eta2p1_MuObj)) tmplep.bdtfail |= 2;
155 +      if(triggerBits.test(kHLT_IsoMu24))               tmplep.bdtfail |= 4;
156 +      if(hltMatchBits.test(kHLT_IsoMu24_MuObj))        tmplep.bdtfail |= 8;
157 +
158        tmplep.status  = musel;    
159        tmplep.fsrRecoveryAttempted = false;
160        SelectionStatus tmpstat = PassWwMuonSel(mu,vtx,pfCandidates);
# Line 156 | Line 170 | EventData apply_HZZ4L_EMU_selection(Cont
170          const mithep::Electron *ele = (mithep::Electron*)((*electronArr)[i]);
171  
172          SelectionStatus denomSel;
173 <        denomSel |= electronDenominatorSelection(ctrl,ele,vtx);
173 >        denomSel |= electronPreSelectionNoD0DzIP(ctrl,ele,vtx);
174          if( !(denomSel.getStatus() & SelectionStatus::PRESELECTION) ) continue;
175          
176          SelectionStatus elesel;
# Line 187 | Line 201 | EventData apply_HZZ4L_EMU_selection(Cont
201          tmplep.is4l    = false;
202          tmplep.isEB    = ele->IsEB();
203          tmplep.scID    = ele->SCluster()->GetUniqueID();
204 +
205 +        bitset<TRIGGER_BIG_NUMBER> hltMatchBits = fillHLTMatchBits( ele->Eta(), ele->Phi(), hltTable, hltObjArr, fTrigObjs);
206 +        tmplep.isTight = testBits(ctrl,triggerBits,eleTriggers,hltMatchBits,eleTrigObjs);
207 +
208          tmplep.isTight = elesel.tight();
209          tmplep.isLoose = elesel.loose();
210          tmplep.status  = elesel;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines