Get the analysis.
444 if(&triggerResults) {
451 int ntrigs = triggerResults.
size();
461 const unsigned int nTrig(triggerNames.
size());
462 for (
unsigned int i=0;
i<nTrig;++
i)
483 if (triggerIndex<triggerResults.
size()) {
484 if (triggerResults.
accept(triggerIndex)) {
518 edm::LogInfo(
"MetAnalyzer") <<
"TriggerResults::HLT not found, "
519 "automatically select events";
539 met = &(metcol->front());
568 if (!HRBXCollection.
isValid()) {
569 LogDebug(
"") <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
570 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
576 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
577 if (!HBHENoiseFilterResultHandle.
isValid()) {
578 LogDebug(
"") <<
"METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
579 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
586 LogDebug(
"") <<
"METAnalyzer: Could not find jet product" << std::endl;
587 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find jet 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 if (!TheBeamHaloSummary.
isValid()) {
702 std::cout <<
"BeamHaloSummary doesn't exist" << std::endl;
705 bool bBeamHaloIDTightPass =
true;
706 bool bBeamHaloIDLoosePass =
true;
708 if(!TheBeamHaloSummary.
isValid()) {
714 bBeamHaloIDLoosePass =
false;
718 bBeamHaloIDTightPass =
false;
725 bool bPrimaryVertex =
true;
727 bPrimaryVertex =
false;
733 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
734 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
739 int vertex_number = vertexCollection.size();
740 VertexCollection::const_iterator
v = vertexCollection.begin();
741 for ( ; v != vertexCollection.end(); ++
v) {
742 double vertex_chi2 = v->normalizedChi2();
743 double vertex_ndof = v->ndof();
744 bool fakeVtx = v->isFake();
745 double vertex_Z = v->z();
752 bPrimaryVertex =
true;
761 if (!gtReadoutRecord.
isValid()) {
762 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
763 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
766 bool bTechTriggers =
true;
767 bool bTechTriggersAND =
true;
768 bool bTechTriggersOR =
false;
769 bool bTechTriggersNOT =
false;
771 if (gtReadoutRecord.
isValid()) {
772 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
775 bTechTriggersAND =
true;
778 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(
_techTrigsAND.at(ttr));
782 bTechTriggersOR =
true;
784 for (
unsigned ttr = 0; ttr !=
_techTrigsOR.size(); ttr++) {
785 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(
_techTrigsOR.at(ttr));
788 bTechTriggersNOT =
false;
791 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(
_techTrigsNOT.at(ttr));
796 bTechTriggersAND =
true;
797 bTechTriggersOR =
true;
798 bTechTriggersNOT =
false;
802 bTechTriggersAND =
true;
804 bTechTriggersOR =
true;
806 bTechTriggersNOT =
false;
808 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
813 bool bHcalNoise = bHcalNoiseFilter;
814 bool bBeamHaloID = bBeamHaloIDLoosePass;
817 bool bPhysicsDeclared =
true;
828 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
829 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
833 for (std::vector<std::string>::const_iterator ic =
_FolderNames.begin();
835 if (*ic==
"All")
fillMESet(iEvent, DirName+
"/"+*ic, *met);
838 if (*ic==
"BasicCleanup" && bBasicCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
839 if (*ic==
"ExtraCleanup" && bExtraCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
842 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter )
fillMESet(iEvent, DirName+
"/"+*ic, *met);
843 if (*ic==
"JetIDMinimal" && bJetIDMinimal)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
844 if (*ic==
"JetIDLoose" && bJetIDLoose)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
845 if (*ic==
"JetIDTight" && bJetIDTight)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
846 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
847 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
848 if (*ic==
"Triggers" && bTechTriggers)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
849 if (*ic==
"PV" && bPrimaryVertex)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
const bool EcalTightHaloId() const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
tuple met
____________________________________________________________________________||
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
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
XYZPointD XYZPoint
point in space with cartesian internal representation
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)