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

Comparing UserCode/MitHzz4l/Selection/src/applySelection.cc (file contents):
Revision 1.70 by anlevin, Sun Jan 20 06:55:17 2013 UTC vs.
Revision 1.75 by anlevin, Thu Feb 14 14:04:19 2013 UTC

# Line 81 | Line 81 | using namespace std;
81  
82   #include "SimpleLepton.h"
83  
84 + #include "Cintex/Cintex.h"
85 +
86   #ifndef CMSSW_BASE
87   #define CMSSW_BASE "../"
88   #endif
# Line 132 | Line 134 | void initRunLumiRangeMap(ControlFlags &c
134   int main(int argc, char** argv)
135   //----------------------------------------------------------------------------
136   {
137 +
138    vector<TString> cuts;
139    cuts.push_back("start"); // NOTE: is incremented in ReferenceSelection, so if you turn on JSONS be careful
140    cuts.push_back("trigger");
# Line 187 | Line 190 | int main(int argc, char** argv)
190      ifstream f(ctrl.inputfiles.c_str());
191      while (f >> fname) {
192        if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines
193 <      if(fname.find("/store/") != string::npos) fname = "root://eoscms//"+fname;
193 >      //if(fname.find("/store/") != string::npos) fname = "root://eoscms//"+fname;
194        cout << "adding inputfile : " << fname.c_str() << endl;
195        entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str());
196        cerr << "unskimmed entries: " << entrymap[string(fname.c_str())] << endl;
# Line 197 | Line 200 | int main(int argc, char** argv)
200        runchain->AddFile(fname.c_str());
201      }
202    } else {
203 <    if(ctrl.inputfile.find("/store/") != string::npos) ctrl.inputfile = "root://eoscms//"+ctrl.inputfile;
203 >    //if(ctrl.inputfile.find("/store/") != string::npos) ctrl.inputfile = "root://eoscms//"+ctrl.inputfile;
204      cout << "adding inputfile : " << ctrl.inputfile.c_str() << endl;
205      unsigned unsk_ents = unskimmedEntries(ctrl.inputfile.c_str());
206      entrymap[string(ctrl.inputfile.c_str())] = unsk_ents;
# Line 225 | Line 228 | int main(int argc, char** argv)
228      if(ctrl.use_xs_weights) getWeight(xstab,entrymap,chain); // test *now* whether we've got the xs in here, so it fails before it creates the output
229    }
230  
231 +  //root will write to this temporary file instead of to memory and the selection will run faster
232 +
233    //
234    // Setup
235    //--------------------------------------------------------------------------------------------------------------
# Line 275 | Line 280 | int main(int argc, char** argv)
280    initMassErrors();
281    ti.dump();
282  
283 <  if(ctrl.do_escale) {
283 >  {
284 >    TFile tmp_file("tmp_file.root","RECREATE");
285 >  }
286 >
287 >  if(ctrl.do_eregression) {
288      string regPath("EGamma/EGammaAnalysisTools/data/eleEnergyRegWeights_V1.root");
289      // if(TString(getenv("HOSTNAME")).Contains(TRegexp("t3[bd][te][cs][hk]")))
290 <      regPath = cmsswpath + "/" + regPath;
290 >    regPath = cmsswpath + "/" + regPath;
291      electron_momentum_correction.initialize_regression(regPath);
283    if(ctrl.mc) {
284      if(ctrl.era == 2011) ctrl.smearing_scaling_dataset = "Fall11";
285      else                 ctrl.smearing_scaling_dataset = "Summer12_DR53X_HCP2012";
286    } else {
287      if(ctrl.era == 2011) ctrl.smearing_scaling_dataset = "Jan16ReReco";
288      else                 ctrl.smearing_scaling_dataset = "2012Jul13ReReco";
289    }
292    }
293 +
294    if(ctrl.correct_muon_momentum) {
295      muCorr = new MuCorr;
296      muCorr->corr2011 = new rochcor;
# Line 366 | Line 369 | int main(int argc, char** argv)
369      chain->GetEntry(ientry);
370      if(!(ientry%1000)) cerr << "entry: " << ientry << " ( / " << imax << " )" << endl;
371  
372 +    //if(info->EvtNum() != 217502611) continue;
373 +
374      increment(counts,"start");
375      if( ctrl.debug ) {
376        cout << "-----------------------------------------------------------------" << endl;
# Line 494 | Line 499 | int main(int argc, char** argv)
499          if(ctrl.debug) cout << "failing PASS_GOODZ1" << endl;
500        }
501      }
502 +
503 +    hltTable->Delete();
504 +
505    }
506  
507    if(ctrl.fakeScheme != "none") {
# Line 507 | Line 515 | int main(int argc, char** argv)
515      cerr << setw(25) << cuts[icut] << "\t" << setw(9) << thisCount["all"] << "  ("
516           << setw(9) << thisCount["4e"] << setw(9) << thisCount["4m"] << setw(9) << thisCount["2e2m"] << ")" << endl;
517    }
518 +
519   }
520   //----------------------------------------------------------------------------------------
521   void addDummyZ2Lepotons(EventData &ret4l)
# Line 530 | Line 539 | void setNtupleVals(ControlFlags &ctrl, E
539    //the last two arguments are usePt and useY respectively
540    fillMela(kine,0,0);
541  
542 <  fillMassErrors(ctrl,ret4l,muonArr,electronArr,kine,false);
542 >  fillMassErrors(ctrl,ret4l,muonArr,electronArr,kine);
543  
544    TLorentzVector pfmet; pfmet.SetPxPyPzE(metArr->At(0)->Mex(),metArr->At(0)->Mey(),0,0);
545    fillEventInfo( info, pfmet, evtinfo, ctrl.mc ? getNPU(puArr) : 0, vtxArr->GetEntries());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines