ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/treeWriter.cc
(Generate patch)

Comparing UserCode/kiesel/TreeWriter/treeWriter.cc (file contents):
Revision 1.9 by kiesel, Sat Apr 13 09:53:02 2013 UTC vs.
Revision 1.11 by kiesel, Mon Apr 15 16:01:40 2013 UTC

# Line 14 | Line 14 | TreeWriter::TreeWriter( TString inputNam
14          if (loggingVerbosity_ > 0)
15                  std::cout << "Add files to chain" << std::endl;
16          inputTree->Add( inputName );
17 +        Init( outputName, loggingVerbosity_ );
18 + }
19 +
20 + TreeWriter::TreeWriter( TChain* inputTree_, TString outputName, int loggingVerbosity_ ) {
21 +        inputTree = inputTree_;
22 +        Init( outputName, loggingVerbosity_ );
23 + }
24 +
25 +
26 + void TreeWriter::Init( TString outputName, int loggingVerbosity_ ) {
27  
28          if (loggingVerbosity_ > 0)
29                  std::cout << "Set Branch Address of susy::Event" << std::endl;
# Line 39 | Line 49 | void TreeWriter::PileUpWeightFile( strin
49          pileupHisto = (TH1F*) puFile->Get("pileup");
50   }
51  
42
43
52   TreeWriter::~TreeWriter() {
53          if (pileupHisto != 0 )
54                  delete pileupHisto;
# Line 183 | Line 191 | void TreeWriter::Loop() {
191  
192          tree->Branch("photon", &photon);
193          tree->Branch("jet", &jet);
194 <        tree->Branch("electron", &electron);
194 >        //tree->Branch("electron", &electron);
195          tree->Branch("muon", &muon);
196          tree->Branch("met", &met, "met/F");
197 +        tree->Branch("metPhi", &met_phi, "metPhi/F");
198 +        tree->Branch("type1met", &type1met, "type1met/F");
199 +        tree->Branch("type1metPhi", &type1met_phi, "type1metPhi/F");
200          tree->Branch("ht", &ht, "ht/F");
201          tree->Branch("nVertex", &nVertex, "nVertex/I");
202          tree->Branch("pu_weight", &pu_weight, "pu_weight/F");
# Line 232 | Line 243 | void TreeWriter::Loop() {
243                          thisphoton->chargedIso = chargedHadronIso_corrected(*it, event->rho25);
244                          thisphoton->neutralIso = neutralHadronIso_corrected(*it, event->rho25);
245                          thisphoton->photonIso = photonIso_corrected(*it, event->rho25);
235                        if ( it->r9 >= 1 && skim )
236                                continue;
246                          thisphoton->r9 = it->r9;
247                          thisphoton->sigmaIetaIeta = it->sigmaIetaIeta;
248                          thisphoton->hadTowOverEm = it->hadTowOverEm;
249                          thisphoton->pixelseed = it->nPixelSeeds;
250 +                        thisphoton->conversionSafeVeto = it->passelectronveto;
251                          photon.push_back( *thisphoton );
252                          if( loggingVerbosity > 2 )
253                                  std::cout << " p_T, gamma = " << thisphoton->pt << std::endl;
# Line 303 | Line 313 | void TreeWriter::Loop() {
313                          std::cout << " type1met = " << type1met << std::endl;
314  
315                  // electrons
316 +                /*
317                  tree::Particle* thiselectron = new tree::Particle();
307
318                  map<TString, vector<susy::Electron> >::iterator eleMap = event->electrons.find("gsfElectrons");
319                  if(eleMap == event->electrons.end() && loggingVerbosity > 0) {
320                          cout << "gsfElectrons not found!" << endl;
# Line 322 | Line 332 | void TreeWriter::Loop() {
332                  }
333                  if( loggingVerbosity > 1 )
334                          std::cout << "Found " << electron.size() << " electrons" << std::endl;
335 +                */
336  
337                  // this seems not to work yet, where is the bug?
338                  /*
# Line 342 | Line 353 | void TreeWriter::Loop() {
353                  std::vector<susy::Muon> mVector = event->muons["muons"];
354                  tree::Particle* thismuon = new tree::Particle();
355                  for( std::vector<susy::Muon>::iterator it = mVector.begin(); it != mVector.end(); ++it) {
356 +                        if( !( it->isPFMuon() && ( it->isGlobalMuon() || it->isTrackerMuon() ) ) )
357 +                                continue; // see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideMuonId#Loose_Muon
358                          thismuon->pt = it->momentum.Et();
359                          if( thismuon->pt < 20 )
360                                  continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines