Get the analysis.
476 if(&triggerResults) {
483 int ntrigs = triggerResults.
size();
493 const unsigned int nTrig(triggerNames.
size());
494 for (
unsigned int i=0;
i<nTrig;++
i)
515 if (triggerIndex<triggerResults.
size()) {
516 if (triggerResults.
accept(triggerIndex)) {
529 edm::LogInfo(
"PFMetAnalyzer") <<
"TriggerResults::HLT not found, "
530 "automatically select events";
543 if(!pfmetcoll.
isValid())
return;
547 pfmet = &(pfmetcol->front());
555 if (!HRBXCollection.
isValid()) {
556 LogDebug(
"") <<
"PfMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
557 if (
_verbose)
std::cout <<
"PfMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
563 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
564 if (!HBHENoiseFilterResultHandle.
isValid()) {
565 LogDebug(
"") <<
"PFMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
566 if (
_verbose)
std::cout <<
"PFMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
573 LogDebug(
"") <<
"PFMETAnalyzer: Could not find jet product" << std::endl;
574 if (
_verbose)
std::cout <<
"PFMETAnalyzer: Could not find jet product" << std::endl;
580 LogDebug(
"") <<
"PfMETAnalyzer: Could not find pfcandidates product" << std::endl;
581 if (
_verbose)
std::cout <<
"PfMETAnalyzer: Could not find pfcandidates product" << std::endl;
587 LogDebug(
"") <<
"PFMETAnalyzer: Could not find pfjet product" << std::endl;
588 if (
_verbose)
std::cout <<
"PFMETAnalyzer: Could not find pfjet product" << std::endl;
603 bool bJetIDMinimal=
true;
604 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
605 cal!=caloJets->end(); ++cal){
608 if (fabs(cal->eta())<=2.6 &&
609 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
616 bool bJetIDLoose=
true;
617 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
618 cal!=caloJets->end(); ++cal){
622 << cal->pt() << std::endl;
627 if (
jetID->
fHPD()>=0.98) bJetIDLoose=
false;
631 if (fabs(cal->eta())<2.55){
632 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
636 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
638 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
647 bool bJetIDTight=
true;
648 bJetIDTight=bJetIDLoose;
649 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
650 cal!=caloJets->end(); ++cal){
655 if (
jetID->
fHPD()>=0.95) bJetIDTight=
false;
658 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
659 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
663 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
664 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
668 else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
669 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=
false;
670 if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=
false;
671 if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=
false;
672 if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
673 && cal->emEnergyFraction()>=0.95) bJetIDTight=
false;
677 else if (fabs(cal->eta())>=3.25){
678 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
679 && cal->emEnergyFraction()>=0.90) bJetIDTight=
false;
680 if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
681 && cal->emEnergyFraction()>=0.80) bJetIDTight=
false;
682 if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
683 && cal->emEnergyFraction()>=0.70) bJetIDTight=
false;
694 bool bHcalNoiseFilter = HBHENoiseFilterResult;
701 bool bBeamHaloIDTightPass =
true;
702 bool bBeamHaloIDLoosePass =
true;
704 if(!TheBeamHaloSummary.
isValid()) {
710 bBeamHaloIDLoosePass =
false;
714 bBeamHaloIDTightPass =
false;
722 bool bPrimaryVertex =
true;
724 bPrimaryVertex =
false;
730 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
731 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
736 int vertex_number = vertexCollection.size();
737 VertexCollection::const_iterator
v = vertexCollection.begin();
738 for ( ; v != vertexCollection.end(); ++
v) {
739 double vertex_chi2 = v->normalizedChi2();
740 double vertex_ndof = v->ndof();
741 bool fakeVtx = v->isFake();
742 double vertex_Z = v->z();
749 bPrimaryVertex =
true;
760 if (!gtReadoutRecord.
isValid()) {
761 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
762 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
765 bool bTechTriggers =
true;
766 bool bTechTriggersAND =
true;
767 bool bTechTriggersOR =
false;
768 bool bTechTriggersNOT =
false;
770 if (gtReadoutRecord.
isValid()) {
771 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
774 bTechTriggersAND =
true;
777 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(
_techTrigsAND.at(ttr));
781 bTechTriggersOR =
true;
783 for (
unsigned ttr = 0; ttr !=
_techTrigsOR.size(); ttr++) {
784 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(
_techTrigsOR.at(ttr));
787 bTechTriggersNOT =
false;
790 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(
_techTrigsNOT.at(ttr));
795 bTechTriggersAND =
true;
796 bTechTriggersOR =
true;
797 bTechTriggersNOT =
false;
801 bTechTriggersAND =
true;
803 bTechTriggersOR =
true;
805 bTechTriggersNOT =
false;
807 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
812 bool bHcalNoise = bHcalNoiseFilter;
813 bool bBeamHaloID = bBeamHaloIDLoosePass;
814 bool bJetID = bJetIDMinimal;
816 bool bPhysicsDeclared =
true;
826 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
827 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
831 for (std::vector<std::string>::const_iterator ic =
_FolderNames.begin();
833 if (*ic==
"All")
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
836 if (*ic==
"BasicCleanup" && bBasicCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
837 if (*ic==
"ExtraCleanup" && bExtraCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
840 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter )
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
841 if (*ic==
"JetIDMinimal" && bJetIDMinimal)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
842 if (*ic==
"JetIDLoose" && bJetIDLoose)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
843 if (*ic==
"JetIDTight" && bJetIDTight)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
844 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
845 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
846 if (*ic==
"Triggers" && bTechTriggers)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
847 if (*ic==
"PV" && bPrimaryVertex)
fillMESet(iEvent, DirName+
"/"+*ic, *pfmet);
const bool EcalTightHaloId() const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
const bool HcalTightHaloId() const
const bool GlobalLooseHaloId() const
bool accept() const
Has at least one path accepted the event?
std::vector< Vertex > VertexCollection
collection of Vertex objects
Strings::size_type size() const
const bool GlobalTightHaloId() const
double restrictedEMF() const
const bool HcalLooseHaloId() const
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
const bool CSCTightHaloId() const
unsigned int triggerIndex(std::string const &name) const
unsigned int size() const
Get number of paths stored.
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool filter(const edm::Event &evt, const edm::EventSetup &es)
std::string const & triggerName(unsigned int index) const
T const * product() const
const bool CSCLooseHaloId() const
const bool EcalLooseHaloId() const
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)