16 |
|
Init( outputName, loggingVerbosity_ ); |
17 |
|
} |
18 |
|
|
19 |
– |
|
19 |
|
void TreeWriter::Init( std::string outputName, int loggingVerbosity_ ) { |
20 |
|
|
21 |
|
if (loggingVerbosity_ > 0) |
208 |
|
// get number of events to be proceeded |
209 |
|
Long64_t nentries = inputTree->GetEntries(); |
210 |
|
// store them in histo |
211 |
< |
eventNumbers->Fill( "Number of generated Events", nentries ); |
211 |
> |
eventNumbers->Fill( "Number of generated events", nentries ); |
212 |
|
if(processNEvents <= 0 || processNEvents > nentries) processNEvents = nentries; |
213 |
|
|
214 |
|
if( loggingVerbosity > 0 ) |
231 |
|
for (long jentry=0; jentry < processNEvents; ++jentry) { |
232 |
|
if ( loggingVerbosity>2 || jentry%reportEvery==0 ) |
233 |
|
std::cout << jentry << " / " << processNEvents << std :: endl; |
234 |
+ |
inputTree->LoadTree( jentry ); |
235 |
+ |
inputTree->GetEntry( jentry ); |
236 |
|
|
237 |
|
photon.clear(); |
238 |
|
jet.clear(); |
406 |
|
float iso = ( it->chargedHadronIso + max(it->neutralHadronIso+it->photonIso |
407 |
|
- effectiveAreaElectron(it->momentum.Eta())*event->rho25, (Float_t)0. ) |
408 |
|
) / it->momentum.Pt(); |
408 |
– |
cout << iso << endl; |
409 |
|
float d0 = d0correction( *it, *event ); |
410 |
– |
cout << d0 << endl; |
410 |
|
float dZ = std::abs( dZcorrection( *it, *event ) ); |
412 |
– |
cout << dZ << endl; |
411 |
|
if ( it->isEB() ){ |
414 |
– |
cout << "electron in barrel" << endl; |
412 |
|
if ( fabs(it->deltaEtaSuperClusterTrackAtVtx) > 0.007 |
413 |
|
|| fabs(it->deltaPhiSuperClusterTrackAtVtx) > 0.8 |
414 |
|
|| it->sigmaIetaIeta > 0.01 |
415 |
|
|| it->hcalOverEcalBc > 0.15 |
416 |
|
|| d0 > 0.04 |
417 |
|
|| dZ > 0.2 |
418 |
< |
|| iso > 0.15 ){ |
422 |
< |
cout << " no real electron" << endl; |
418 |
> |
|| iso > 0.15 ) |
419 |
|
continue; |
420 |
|
} |
425 |
– |
} |
421 |
|
else if( it->isEE() ) { |
427 |
– |
cout << "electron in endcap" << endl; |
422 |
|
if ( fabs(it->deltaEtaSuperClusterTrackAtVtx) > 0.01 |
423 |
|
|| fabs(it->deltaPhiSuperClusterTrackAtVtx) > 0.7 |
424 |
|
|| it->sigmaIetaIeta > 0.03 |
425 |
|
|| d0 > 0.04 |
426 |
|
|| dZ > 0.2 |
427 |
< |
|| iso > 0.15 ){ |
434 |
< |
cout << "no real electron" << endl; |
427 |
> |
|| iso > 0.15 ) |
428 |
|
continue; |
429 |
|
} |
430 |
< |
} |
438 |
< |
else{ // not in barrel nor in endcap |
439 |
< |
cout << " electron in gap" << endl; |
430 |
> |
else // not in barrel nor in endcap |
431 |
|
continue; |
432 |
< |
// TODO: conversion rejection information not implemented yet, see twiki for more details |
442 |
< |
} |
432 |
> |
|
433 |
|
thiselectron.pt = it->momentum.Pt(); |
434 |
|
if( loggingVerbosity > 2 ) |
435 |
|
std::cout << " p_T, electron = " << it->momentum.Et() << std::endl; |
436 |
|
thiselectron.eta = it->momentum.Eta(); |
437 |
|
thiselectron.phi = it->momentum.Phi(); |
448 |
– |
cout << " adde electron" << endl; |
438 |
|
electron.push_back( thiselectron ); |
439 |
|
} |
440 |
|
if( loggingVerbosity > 1 ) |