18 template <
class Object>
20 template <
class Object>
22 template <
class Object>
46 std::vector<Candidate> candidates;
47 for (
int i = 0 ; i <
n_ ; ++i )
50 candidates.push_back(cand);
53 return CandidateCollection;
63 hasPuppiInfo_ =
false;
64 hasQGLikelihood_ =
false;
73 std::size_t found = branch.find(
"btag_");
74 if (found!=std::string::npos)
76 mbtag_[branch] = btags_[algos];
78 tree_ -> SetBranchAddress( branch.c_str(), mbtag_[branch]);
86 if ( mbtag_.size() > 0 )
88 tree_ -> SetBranchAddress(
"flavour" , flavour_ );
89 tree_ -> SetBranchAddress(
"hadronFlavour" , hadrflavour_ );
90 tree_ -> SetBranchAddress(
"partonFlavour" , partflavour_ );
91 tree_ -> SetBranchAddress(
"physicsFlavour" , physflavour_ );
92 tree_ -> SetBranchAddress(
"id_nHadFrac", nHadFrac_);
93 tree_ -> SetBranchAddress(
"id_nEmFrac" , nEmFrac_ );
94 tree_ -> SetBranchAddress(
"id_nMult" , nMult_ );
95 tree_ -> SetBranchAddress(
"id_cHadFrac", cHadFrac_);
96 tree_ -> SetBranchAddress(
"id_cEmFrac" , cEmFrac_ );
97 tree_ -> SetBranchAddress(
"id_cMult" , cMult_ );
98 tree_ -> SetBranchAddress(
"id_muonFrac", muFrac_ );
99 tree_ -> SetBranchAddress(
"jecUncert" , jecUnc_);
100 tree_ -> SetBranchAddress(
"jerSF", jerSF_);
101 tree_ -> SetBranchAddress(
"jerSFDown", jerSFDown_);
102 tree_ -> SetBranchAddress(
"jerSFUp", jerSFUp_);
103 tree_ -> SetBranchAddress(
"jerResolution", jerResolution_);
104 std::vector<std::string>::iterator it;
105 it = std::find(branches_.begin(),branches_.end(),
"qgLikelihood") ;
if ( it != branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , qgLikelihood_ ); hasQGLikelihood_ =
true; }
106 it = std::find(branches_.begin(),branches_.end(),
"puJetIdFullDiscriminant") ;
if ( it != branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , puJetIdFullDisc_ );
107 it = std::find(branches_.begin(),branches_.end(),
"puJetIdFullId") ;
if ( it != branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , puJetIdFullId_ );
108 it = std::find(branches_.begin(),branches_.end(),
"id_puppi") ;
if ( it != branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , puppi_ ) ; hasPuppiInfo_ =
true; }
109 it = std::find(branches_.begin(),branches_.end(),
"bjetRegCorr") ;
if ( it != branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , bRegCorr_ ) ; hasBRegCorr_ =
true; }
110 it = std::find(branches_.begin(),branches_.end(),
"bjetRegRes") ;
if ( it != branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , bRegRes_ ) ; hasBRegRes_ =
true; }
111 it = std::find(branches_.begin(),branches_.end(),
"Rho") ;
if ( it != branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , &rho_ ) ; hasRho_ =
true; }
131 std::vector<Jet> jets;
132 for (
int i = 0 ; i <
n_ ; ++i )
136 for (
auto & b : mbtag_ )
137 jet.
btag(b.first,b.second[i]);
139 jet.
flavour(
"Hadron",hadrflavour_[i]);
140 jet.
flavour(
"Parton",partflavour_[i]);
141 jet.
flavour(
"Physics",physflavour_[i]);
167 jet.
jerSF(jerSF_[i]);
170 if ( hasQGLikelihood_ ) jet.
qgLikelihood(qgLikelihood_[i]);
174 if ( hasBRegCorr_ ) jet.
bRegCorr(bRegCorr_[i]);
176 if ( hasBRegRes_ ) jet.
bRegRes (bRegRes_[i]);
178 if ( hasRho_ ) jet.
rho(rho_);
184 return jetCollection;
192 gp_has_indx_ =
false;
194 tree_ -> SetBranchAddress(
"pdg" , pdgid_ );
195 tree_ -> SetBranchAddress(
"status", status_ );
196 tree_ -> SetBranchAddress(
"higgs_dau", higgs_dau_ );
198 std::vector<std::string>::iterator it;
199 it = std::find(
branches_.begin(),
branches_.end(),
"index") ;
if ( it !=
branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , indx_ ); gp_has_indx_ =
true; }
214 std::vector<GenParticle> particles;
215 for (
int i = 0 ; i <
n_ ; ++i )
229 particles.push_back(p);
232 return genPartCollection;
240 tree_ -> SetBranchAddress(
"sigxx" , sigxx_ );
241 tree_ -> SetBranchAddress(
"sigxy" , sigxy_ );
242 tree_ -> SetBranchAddress(
"sigyx" , sigyx_ );
243 tree_ -> SetBranchAddress(
"sigyy" , sigyy_ );
246 std::vector<std::string>::iterator it;
256 std::vector<MET> mets;
257 for (
int i = 0 ; i <
n_ ; ++i )
261 met.
genP(gen_px_[i],gen_py_[i],gen_pz_[i]);
265 return metCollection;
276 hasTightMuon_ =
false;
277 tree_ -> SetBranchAddress (
"isPFMuon" , isPFMuon_ ) ;
278 tree_ -> SetBranchAddress (
"isGlobalMuon" , isGlobalMuon_ ) ;
279 tree_ -> SetBranchAddress (
"isTrackerMuon" , isTrackerMuon_) ;
280 tree_ -> SetBranchAddress (
"isLooseMuon" , isLooseMuon_ ) ;
281 tree_ -> SetBranchAddress (
"isMediumMuon" , isMediumMuon_ ) ;
284 tree_ -> SetBranchAddress (
"validFraction" ,validFraction_ ) ;
285 tree_ -> SetBranchAddress (
"segmentCompatibility" , segmentCompatibility_) ;
286 tree_ -> SetBranchAddress (
"trkKink" , trkKink_) ;
287 tree_ -> SetBranchAddress (
"chi2LocalPos" ,chi2LocalPos_) ;
289 tree_ -> SetBranchAddress (
"normChi2" , normChi2_) ;
292 std::vector<std::string>::iterator it;
293 it = std::find(
branches_.begin(),
branches_.end(),
"isTightMuon") ;
if ( it !=
branches_.end() ) {
tree_ -> SetBranchAddress( (*it).c_str() , isTightMuon_ ); hasTightMuon_ =
true; }
295 if ( ! hasTightMuon_ ) std::cout <<
"*** warning *** PhysicsObjectTree<Muon> constructor: muon id tight is not available in this ntuple production, isIdTight -> false" << std::endl;
304 std::vector<Muon> muons;
305 for (
int i = 0 ; i <
n_ ; ++i )
313 if ( hasTightMuon_ ) muon.
isTightMuon(isTightMuon_[i]) ;
322 muons.push_back(muon);
325 return muonCollection;
335 tree_ -> SetBranchAddress(
"btag", btag_ );
343 std::vector<JetTag> jetstags;
344 for (
int i = 0 ; i <
n_ ; ++i )
347 jettag.
btag(btag_[i]);
348 jetstags.push_back(jettag);
351 return jettagCollection;
369 std::vector<GenJet> genjets;
370 for (
int i = 0 ; i <
n_ ; ++i )
373 genjets.push_back(genjet);
376 return genjetCollection;
390 std::vector<Vertex> vertices;
391 for (
int i = 0 ; i <
n_ ; ++i )
393 Vertex vertex(x_[i], y_[i], z_[i]);
394 vertex.
chi2(chi2_[i]);
395 vertex.
ndof(ndof_[i]);
397 vertex.
fake(fake_[i]);
399 vertices.push_back(vertex);
402 return vertexCollection;
412 tree_ -> SetBranchAddress (
"type" , type_ ) ;
419 std::vector<TriggerObject> triggers;
420 for (
int i = 0 ; i <
n_ ; ++i )
424 triggers.push_back(trig);
427 return TriggerObjectCollection;
438 tree_ -> SetBranchAddress (
"hwQual" , hwQual_ ) ;
439 tree_ -> SetBranchAddress (
"etaAtVtx" , etaAtVtx_ ) ;
440 tree_ -> SetBranchAddress (
"phiAtVtx" , phiAtVtx_ ) ;
448 std::vector<L1TMuon> muons;
449 for (
int i = 0 ; i <
n_ ; ++i )
452 muon.
hwQual (hwQual_ [i]) ;
455 muons.push_back(muon);
458 return muonCollection;
475 std::vector<L1TJet> jets;
476 for (
int i = 0 ; i <
n_ ; ++i )
482 return jetCollection;
498 std::vector<RecoMuon> candidates;
499 for (
int i = 0 ; i <
n_ ; ++i )
502 candidates.push_back(cand);
505 return RecoMuonCollection;
516 std::vector<std::string>::iterator it;
521 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfLostMuonHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nLostMuHits_ );
522 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfBadMuonHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nBadMuHits_ );
523 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidMuonHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValMuHits_ );
524 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidTrackerHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValTrackerHits_ );
525 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidStripTECHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValStripTECHits_ );
526 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidStripTIBHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValStripTIBHits_ );
527 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidStripTIDHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValStripTIDHits_ );
528 it = std::find(
branches_.begin(),
branches_.end(),
"numberOfValidStripTOBHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , nValStripTOBHits_ );
529 it = std::find(
branches_.begin(),
branches_.end(),
"muonStationsWithValidHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , muStationsWithValHits_ );
530 it = std::find(
branches_.begin(),
branches_.end(),
"muonStationsWithBadHits" ) ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , muStationsWithBadHits_ );
531 it = std::find(
branches_.begin(),
branches_.end(),
"innermostMuonStationWithValidHits") ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , inMuStationWithValHits_ );
532 it = std::find(
branches_.begin(),
branches_.end(),
"outermostMuonStationWithValidHits") ;
if ( it !=
branches_.end() )
tree_ -> SetBranchAddress( (*it).c_str() , outMuStationWithValHits_ );
535 mqual_[
loose ] = qual_[1];
536 mqual_[
tight ] = qual_[2];
566 std::vector<RecoTrack> trks;
567 for (
int i = 0 ; i <
n_ ; ++i )
600 return RecoTrackCollection;
void status(const int &status)
void daughter(const int &, const int &)
void mother(const int &, const int &)
void higgsDaughter(const bool &higgs_dau)
void pdgId(const int &pdgId)