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

Comparing UserCode/MitHzz4l/Selection/src/SelectionFuncs.cc (file contents):
Revision 1.7 by khahn, Fri Jun 22 03:10:32 2012 UTC vs.
Revision 1.8 by khahn, Thu Jul 12 15:50:27 2012 UTC

# Line 178 | Line 178 | unsigned makePFnoPUArray(mithep::Array<P
178  
179    return pfNoPileUpflag.size();
180   }
181
181   //--------------------------------------------------------------------------------
182 < void setEffiencyWeights(unsigned era, EventData & evtdat, WeightStruct & weights )
182 > void setEffiencyWeights(unsigned era,
183 >                        EventData & evtdat,
184 >                        std::bitset<1024> triggerBits,
185 >                        mithep::TriggerTable *hltTable,
186 >                        mithep::Array<mithep::TriggerObject> *hltObjArr,
187 >                        mithep::TriggerObjectsTable *fTrigObjs,
188 >                        WeightStruct & weights )
189   //--------------------------------------------------------------------------------
190   {
191    vector<SimpleLepton> lepvec = evtdat.Z1leptons;
192    lepvec.insert(lepvec.end(), evtdat.Z2leptons.begin(), evtdat.Z2leptons.end());
193    double w_offline=-1, werr_offline=0;
194    double w_online=-1, werr_online=0;
195 <  
195 >
196 >  vector<SimpleLepton> muvec, elvec;
197 >  if(abs(evtdat.Z1leptons[0].type) == 11 ) {
198 >    //    lepvec.insert(elvec.end(), evtdat.Z1leptons.begin(), evtdat.Z1leptons.end());
199 >    elvec.push_back(evtdat.Z1leptons[0]);
200 >    elvec.push_back(evtdat.Z1leptons[1]);
201 >  }  else {
202 >    // lepvec.insert(muvec.end(), evtdat.Z1leptons.begin(), evtdat.Z1leptons.end());
203 >    muvec.push_back(evtdat.Z1leptons[0]);
204 >    muvec.push_back(evtdat.Z1leptons[1]);
205 >  }
206 >  if(abs(evtdat.Z2leptons[0].type) == 11 ) {
207 >    //lepvec.insert(elvec.end(), evtdat.Z2leptons.begin(), evtdat.Z2leptons.end());
208 >    elvec.push_back(evtdat.Z2leptons[0]);
209 >    elvec.push_back(evtdat.Z2leptons[1]);
210 >  } else {
211 >    // lepvec.insert(muvec.end(), evtdat.Z2leptons.begin(), evtdat.Z2leptons.end());
212 >    muvec.push_back(evtdat.Z2leptons[0]);
213 >    muvec.push_back(evtdat.Z2leptons[1]);
214 >  }
215 >
216    vector< pair <double,double> > wlegs; // pair here is eff & err
217    vector< pair <float,float> > mvec;  // pair here is eta & pt
218  
219    //      vector< pair <float,float> > evec;  // pair here is eta & pt
220    // now deal with medium vs loose
221 <  vector< pair< bool, pair <float,float> > > evec;  // pair here is eta & pt
222 <  
221 >  //  vector< pair< bool, pair <float,float> > > evec;  // pair here is eta & pt
222 >    vector< pair <float,float>  > evec;  // pair here is eta & pt
223 >
224    for( int k=0; k<lepvec.size(); k++ ) {
225      if( abs(lepvec[k].type) == 13 ) {
226        mvec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
# Line 206 | Line 232 | void setEffiencyWeights(unsigned era, Ev
232        //              evec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
233        
234        std::pair<float,float> tmppair(fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt());
235 <      evec.push_back( std::pair<bool, std::pair<float,float> > (lepvec[k].isTight, tmppair) );
235 >      evec.push_back( tmppair );
236        
237        //              wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
238        //                                                                 lepvec[k].vec.Pt() ) );
# Line 223 | Line 249 | void setEffiencyWeights(unsigned era, Ev
249    weights.woff    = offpair.first;
250    weights.werroff = offpair.second;
251    
252 <  pair<double,double> onpair  = getOnlineEfficiencyWeight( mvec, evec );
252 >  pair<double,double> onpair  = getOnlineEfficiencyWeight( triggerBits, hltTable, hltObjArr, fTrigObjs,  muvec, elvec );
253    weights.won    = onpair.first;
254    weights.werron = onpair.second;
255   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines