ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.cc
(Generate patch)

Comparing UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.cc (file contents):
Revision 1.119 by wulsin, Tue Aug 6 13:24:39 2013 UTC vs.
Revision 1.122 by jbrinson, Fri Aug 9 11:12:33 2013 UTC

# Line 174 | Line 174 | OSUAnalysis::OSUAnalysis (const edm::Par
174        tempHistogram.variableBinsY = histogramList_.at(currentHistogram).getUntrackedParameter<vector<double> >("variableBinsY", defaultValue);
175        tempHistogram.inputVariables = histogramList_.at(currentHistogram).getParameter<vector<string> >("inputVariables");
176  
177 <      histograms.push_back(tempHistogram);
177 >      bool histExists = false;
178 >      for (uint i=0; i<histograms.size(); i++) {
179 >        if (histograms.at(i).name == tempHistogram.name) { histExists = true; break; }
180 >      }  
181 >      if (histExists) {
182 >        clog << "Warning:  histogram " << tempHistogram.name << " already exists; will not book an additional instance." << endl;  
183 >      } else {
184 >        histograms.push_back(tempHistogram);
185 >      }
186  
187      }
188    } //   for(uint currentHistogramSet = 0; currentHistogramSet != histogramSets_.size(); currentHistogramSet++)
# Line 1865 | Line 1873 | OSUAnalysis::valueLookup (const BNmuon*
1873  
1874    //user-defined variables
1875    else if(variable == "looseID") {
1876 <    value = object->pt > 10 &&
1876 >    value = object->pt > 10 &&
1877        (object->isGlobalMuon  > 0 ||
1878         object->isTrackerMuon > 0);
1879    }
1880 +
1881    else if(variable == "looseIDGlobalMuon") {
1882      value = object->pt > 10 &&
1883        object->isGlobalMuon  > 0;
# Line 2706 | Line 2715 | OSUAnalysis::valueLookup (const BNtau* o
2715    else if(variable == "leadingTrackValid") value = object->leadingTrackValid;
2716  
2717    else if (variable == "looseHadronicID") {
2718 <    value = object->pt > 10
2719 <      && object->eta < 2.3
2718 >    //criteria taken from http://cms.cern.ch/iCMS/jsp/db_notes/showNoteDetails.jsp?noteID=CMS%20AN-2011/019
2719 >    value = object->pt > 30
2720 >      && fabs(object->eta) < 2.3
2721        && object->HPSbyLooseCombinedIsolationDeltaBetaCorr > 0
2722        && object->HPSdecayModeFinding > 0
2723        && object->HPSagainstElectronLoose > 0
# Line 3012 | Line 3022 | OSUAnalysis::valueLookup (const BNtrack*
3022      }
3023      value = trkMuonDeltaRMin;  
3024    }  
3025 +
3026 +  else if(variable == "isPassMuonLooseIDVeto") {
3027 +
3028 +    // calculate minimum deltaR between track and any other loose-Id
3029 +    double trkMuonDeltaRMin = 99.;
3030 +    //    if (!muons) cout << "ERROR:  could not find muon collection for calculation of deltaRMinMuonLooseId" <<                                                                          
3031 +    for (uint imuon = 0; imuon<muons->size(); imuon++) {
3032 +      string empty = "";
3033 +      double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty);
3034 +      if (!isLooseIdMuon) continue;  // only consider muons that pass the looseID                                
3035 +        double muonEta = valueLookup(&muons->at(imuon), "eta", "", empty);
3036 +        double muonPhi = valueLookup(&muons->at(imuon), "phi", "", empty);
3037 +        double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi);
3038 +        if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR;
3039 +    }
3040 +    if (trkMuonDeltaRMin  < 0.15) value = 1;
3041 +    if (trkMuonDeltaRMin  > 0.15) value = 0;
3042 +  }
3043 +
3044 +
3045    
3046    else if(variable == "deltaRMinSecMuonLooseIdGlobal") {
3047      // calculate minimum deltaR between track and any other loose-Id muon

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines