313 using namespace l1extra;
319 for( L1JetParticleCollection::const_iterator itr = l1TauHandle->begin() ;
320 itr != l1TauHandle->end() ; ++itr ) {
321 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
329 for( L1JetParticleCollection::const_iterator itr = l1CenJetHandle->begin() ;
330 itr != l1CenJetHandle->end() ; ++itr ) {
331 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
339 for( L1JetParticleCollection::const_iterator itr = l1ForJetHandle->begin() ;
340 itr != l1ForJetHandle->end() ; ++itr ) {
341 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
349 for( L1EmParticleCollection::const_iterator itr = l1IsoEgammaHandle->begin() ;
350 itr != l1IsoEgammaHandle->end() ; ++itr ) {
351 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
359 for( L1EmParticleCollection::const_iterator itr = l1NonIsoEgammaHandle->begin() ;
360 itr != l1NonIsoEgammaHandle->end() ; ++itr ) {
361 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
370 for( L1MuonParticleCollection::const_iterator itr = l1MuonHandle->begin() ;
371 itr != l1MuonHandle->end() ; ++itr ) {
372 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
382 for( L1EtMissParticleCollection::const_iterator itr = l1MetHandle->begin() ;
383 itr != l1MetHandle->end() ; ++itr ) {
384 TLorentzVector
p(itr->px(),itr->py(),itr->pz(),itr->energy());
393 using namespace reco;
401 PFTauRef thePFTau(thePFTauHandle,iPFTau);
402 if ((*thePFTauDiscriminatorByIsolation)[thePFTau] == 1) {
403 TLorentzVector pftau((*thePFTau).px(),(*thePFTau).py(),(*thePFTau).pz(),(*thePFTau).energy());
412 using namespace HepMC;
418 GenEvent * generated_event =
new GenEvent(*(evt->GetEvent()));
425 unsigned int nTauHads = 0;
int nTauMuons = 0;
int nTauElecs = 0;
426 unsigned int nfidTauHads = 0;
int nfidTauMuons = 0;
int nfidTauElecs = 0;
427 TLorentzVector taunu,tauelec,taumuon;
428 GenEvent::particle_iterator
p;
430 for (
p = generated_event->particles_begin();
p != generated_event->particles_end(); ++
p) {
431 if(
abs((*p)->pdg_id()) ==
_BosonPID && (*p)->end_vertex()) {
432 HepMC::GenVertex::particle_iterator
z = (*p)->end_vertex()->particles_begin(HepMC::descendants);
433 for(; z != (*p)->end_vertex()->particles_end(HepMC::descendants); z++) {
434 if(
abs((*z)->pdg_id()) == 15 && (*z)->status()==2) {
435 bool lept_decay =
false;
436 TLorentzVector
tau((*z)->momentum().px(),(*z)->momentum().py(),(*z)->momentum().pz(),(*z)->momentum().e());
437 HepMC::GenVertex::particle_iterator
t = (*z)->end_vertex()->particles_begin(HepMC::descendants);
438 for(; t != (*z)->end_vertex()->particles_end(HepMC::descendants); t++) {
439 if(
abs((*t)->pdg_id()) == 11 ||
abs((*t)->pdg_id()) == 13) lept_decay=
true;
440 if(
abs((*t)->pdg_id()) == 11) {
441 tauelec.SetPxPyPzE((*t)->momentum().px(),(*t)->momentum().py(),(*t)->momentum().pz(),(*t)->momentum().e());
447 if(
abs((*t)->pdg_id()) == 13) {
448 taumuon.SetPxPyPzE((*t)->momentum().px(),(*t)->momentum().py(),(*t)->momentum().pz(),(*t)->momentum().e());
454 if(
abs((*t)->pdg_id()) == 16)
455 taunu.SetPxPyPzE((*t)->momentum().px(),(*t)->momentum().py(),(*t)->momentum().pz(),(*t)->momentum().e());
457 if(lept_decay==
false) {
458 TLorentzVector jetMom=
tau-taunu;
468 delete generated_event;
551 const vector<L1GlobalTriggerObjectMap>& objMapVec = L1GTOMRec.
gtObjectMap();
552 for (vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
553 itMap != objMapVec.end(); ++itMap) {
554 int iBit = (*itMap).algoBitNumber();
555 l1BitName =
string( (*itMap).algoName() );
556 l1Accept = gtDecisionWord[iBit];
579 bool singleTauPassed =
false;
580 bool doubleTauPassed =
false;
581 bool muTauPassed =
false;
582 bool isoEgTauPassed =
false;
583 bool singleTauMETPassed =
false;
593 singleTauPassed =
true;
598 doubleTauPassed =
true;
603 singleTauMETPassed =
true;
614 for (
int i=0;
i<nL1Taus;
i++) {
615 for (
int j=0;
j<nL1IsoEgammas;
j++) {
622 if (deltaPhi>0.348 && deltaEta>0.348) {
623 isoEgTauPassed =
true;
640 bool singleTauPassed =
false;
641 bool doubleTauPassed =
false;
642 bool muTauPassed =
false;
643 bool isoEgTauPassed =
false;
644 bool singleTauMETPassed =
false;
646 bool singleMatch =
false;
647 bool doubleMatch =
false;
651 for (
unsigned int i = 0;
i<
_L1Taus.size();
i++) {
666 if (singleMatch && !doubleMatch)
686 if (singleMatch && iSingle>=0) {
689 singleTauPassed =
true;
702 singleTauMETPassed =
true;
727 if (deltaPhi>0.348 && deltaEta>0.348) {
731 isoEgTauPassed =
true;
740 if (doubleMatch && iDouble>=0) {
743 doubleTauPassed =
true;
750 if (deltaPhi>0.348 && deltaEta>0.348) {
754 isoEgTauPassed =
true;
773 bool singleTauPassed =
false;
774 bool doubleTauPassed =
false;
775 bool muTauPassed =
false;
776 bool isoEgTauPassed =
false;
777 bool singleTauMETPassed =
false;
779 bool singleMatch =
false;
780 bool doubleMatch =
false;
784 unsigned int nPFMatchGenTauHad = 0;
786 std::vector<TLorentzVector> PFMatchedGenTauHads;
787 PFMatchedGenTauHads.clear();
789 for (
unsigned int k = 0;
k<
_PFTaus.size();
k++) {
811 for (
unsigned int i = 0;
i<
_L1Taus.size();
i++) {
812 for (
unsigned int j = 0;
j<PFMatchedGenTauHads.size();
j++) {
813 double deltaR = ROOT::Math::VectorUtil::DeltaR(
_L1Taus[
i],PFMatchedGenTauHads[
j]);
821 if (singleMatch && !doubleMatch)
836 if (singleMatch && iSingle>=0) {
839 singleTauPassed =
true;
852 singleTauMETPassed =
true;
876 if (deltaPhi>0.348 && deltaEta>0.348) {
880 isoEgTauPassed =
true;
888 if (doubleMatch && iDouble>=0) {
891 doubleTauPassed =
true;
899 if (deltaPhi>0.348 && deltaEta>0.348) {
903 isoEgTauPassed =
true;
912 unsigned int nfidMCGenTauMuon = 0;
913 unsigned int nfidMCGenTauElec = 0;
946 int nbins = histo->GetNbinsX();
947 double integral = histo->GetBinContent(nbins+1);
949 std::cerr <<
"***** L1TauAnalyzer::convertToIntegratedEff() Error: nGenerated = " << nGenerated << std::endl;
952 for(
int i = nbins;
i >= 1;
i--)
954 double thisBin = histo->GetBinContent(
i);
957 double integralError;
958 integralEff = (integral / nGenerated);
959 histo->SetBinContent(
i, integralEff);
961 integralError = (
sqrt(integral) / nGenerated);
962 histo->SetBinError(
i, integralError);
970 cout<<
"****************************************"<<endl;
971 cout<<
"* L1extra Efficiency Report"<<endl;
972 cout<<
"****************************************"<<endl;
974 cout<<
"---------------------------------------------------------------------------------------------"<<endl;
975 cout<<
" #PassL1 GlobEff GlEff/BR(fid.) MCMatchEff PFMCMatchEff BR(fid.) BR"<<endl;
976 cout<<
"---------------------------------------------------------------------------------------------"<<endl;
1025 cout<<
"****************************************"<<endl;
1026 cout<<
"* L1 GT Efficiency Report"<<endl;
1027 cout<<
"****************************************"<<endl;
1029 cout<<
"---------------------------------------------------------------------------------------"<<endl;
1030 cout<<
" #PassL1 GlobEff GlobEff/BR(fid.) BR(fid.) BR"<<endl;
1031 cout<<
"---------------------------------------------------------------------------------------"<<endl;
TH1 * h_L1MCMatchedTauEta
TH1 * h_L1DoubleTauEffPFMCMatchEt
T getParameter(std::string const &) const
void evalL1Decisions(const edm::Event &iEvent)
int _nfidEventsDoubleGenTauHads
int _nEventsL1GTIsoEgTauPassed
int _nEventsPFMatchGenTauElecTauHad
int _nEventsL1IsoEgTauPassedMCMatched
double _SingleTauThreshold
std::vector< double > _MuTauThresholds
TH1 * h_L1MCPFMatchedTauEt
int _nEventsL1GTDoubleTauPassed
std::vector< TLorentzVector > _GenTauElecs
edm::InputTag _L1extraIsoEgammaSource
void calcL1MCPFTauMatching()
TH1 * h_L1DoubleTauEffMCMatchEt
edm::InputTag _PFTauSource
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TLorentzVector > _L1ForJets
void getL1extraObjects(const edm::Event &, const edm::EventSetup &)
edm::InputTag _PFTauDiscriminatorSource
std::string _L1SingleTauName
TH1 * h_L1MCPFMatchedTauPhi
edm::InputTag _GenParticleSource
int _nEventsL1SingleTauPassedPFMCMatched
std::vector< TLorentzVector > _GenTauMuons
int _nEventsPFMatchGenTauHad
edm::InputTag _L1extraCenJetSource
std::vector< TLorentzVector > _PFTaus
TH1 * h_L1MCPFMatchedTauEta
edm::InputTag _L1extraTauJetSource
int _nEventsGenTauMuonTauHad
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
TH1 * h_L1MCMatchedTauPhi
int _nEventsL1SingleTauPassed
edm::InputTag _L1GtReadoutRecord
std::vector< TLorentzVector > _L1IsoEgammas
int _nEventsL1GTSingleTauPassed
std::vector< TLorentzVector > _GenTauHads
std::vector< TLorentzVector > _L1CenJets
int _nEventsL1GTSingleTauMETPassed
edm::InputTag _L1extraMuonSource
std::vector< bool > DecisionWord
typedefs
TH1 * h_L1minusMCoverMCTauEt
void convertToIntegratedEff(TH1 *, double)
std::vector< int > _L1MuQuals
int _nEventsL1IsoEgTauPassedPFMCMatched
void fillPFTauHistograms()
double _MCTauHadMaxAbsEta
int _nEventsL1SingleTauMETPassedPFMCMatched
std::vector< TLorentzVector > _L1METs
int _nEventsL1IsoEgTauPassed
int _nEventsGenTauElecTauHad
TH1 * h_L1SingleTauEffPFMCMatchEt
std::vector< TLorentzVector > _L1Muons
int _nfidEventsGenTauElecTauHad
int _nEventsL1DoubleTauPassedMCMatched
int _nEventsL1DoubleTauPassed
int _nEventsL1MuonTauPassedPFMCMatched
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Integral< F, X >::type integral(const F &f)
void getPFTauObjects(const edm::Event &, const edm::EventSetup &)
std::vector< double > _IsoEgTauThresholds
int _nEventsL1SingleTauMETPassed
double deltaR(double eta1, double eta2, double phi1, double phi2)
void getGenObjects(const edm::Event &, const edm::EventSetup &)
std::vector< TLorentzVector > _L1NonIsoEgammas
int _nEventsPFMatchGenTauMuonTauHad
unsigned int quality() const
get quality
std::vector< TLorentzVector > _L1Taus
std::string _L1TauMETName
int _nEventsL1SingleTauMETPassedMCMatched
int _nEventsL1DoubleTauPassedPFMCMatched
std::string _L1MuonTauName
std::string _L1IsoEgTauName
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
edm::InputTag _L1extraForJetSource
int _nEventsL1MuonTauPassedMCMatched
int _nfidEventsGenTauMuonTauHad
edm::InputTag _L1extraNonIsoEgammaSource
int _nEventsDoubleGenTauHads
T * make() const
make new ROOT object
double _DoubleTauThreshold
int _nEventsL1MuonTauPassed
L1TauAnalyzer(const edm::ParameterSet &)
int _nEventsPFMatchDoubleGenTauHads
int _nEventsL1SingleTauPassedMCMatched
std::string _L1DoubleTauName
std::vector< double > _SingleTauMETThresholds
void calcL1MCTauMatching()
edm::InputTag _L1extraMETSource
void evalL1extraDecisions()
edm::InputTag _L1GtObjectMap
TH1 * h_L1SingleTauEffMCMatchEt
int _nEventsL1GTMuonTauPassed