Get the analysis.
446 if(&triggerResults) {
453 int ntrigs = triggerResults.
size();
463 const unsigned int nTrig(triggerNames.
size());
464 for (
unsigned int i=0;
i<nTrig;++
i)
485 if (triggerIndex<triggerResults.
size()) {
486 if (triggerResults.
accept(triggerIndex)) {
520 edm::LogInfo(
"MetAnalyzer") <<
"TriggerResults::HLT not found, "
521 "automatically select events";
541 met = &(metcol->front());
570 if (!HRBXCollection.
isValid()) {
571 LogDebug(
"") <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
572 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
578 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
579 if (!HBHENoiseFilterResultHandle.
isValid()) {
580 LogDebug(
"") <<
"METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
581 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
588 LogDebug(
"") <<
"METAnalyzer: Could not find jet product" << std::endl;
589 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find jet product" << std::endl;
605 bool bJetIDMinimal=
true;
606 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
607 cal!=caloJets->end(); ++cal){
610 if (fabs(cal->eta())<=2.6 &&
611 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
618 bool bJetIDLoose=
true;
619 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
620 cal!=caloJets->end(); ++cal){
624 << cal->pt() << std::endl;
629 if (
jetID->
fHPD()>=0.98) bJetIDLoose=
false;
633 if (fabs(cal->eta())<2.55){
634 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
638 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
640 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
649 bool bJetIDTight=
true;
650 bJetIDTight=bJetIDLoose;
651 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
652 cal!=caloJets->end(); ++cal){
657 if (
jetID->
fHPD()>=0.95) bJetIDTight=
false;
660 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
661 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
665 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
666 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
670 else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
671 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=
false;
672 if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=
false;
673 if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=
false;
674 if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
675 && cal->emEnergyFraction()>=0.95) bJetIDTight=
false;
679 else if (fabs(cal->eta())>=3.25){
680 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
681 && cal->emEnergyFraction()>=0.90) bJetIDTight=
false;
682 if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
683 && cal->emEnergyFraction()>=0.80) bJetIDTight=
false;
684 if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
685 && cal->emEnergyFraction()>=0.70) bJetIDTight=
false;
696 bool bHcalNoiseFilter = HBHENoiseFilterResult;
703 if (!TheBeamHaloSummary.
isValid()) {
704 std::cout <<
"BeamHaloSummary doesn't exist" << std::endl;
707 bool bBeamHaloIDTightPass =
true;
708 bool bBeamHaloIDLoosePass =
true;
710 if(!TheBeamHaloSummary.
isValid()) {
716 bBeamHaloIDLoosePass =
false;
720 bBeamHaloIDTightPass =
false;
727 bool bPrimaryVertex =
true;
729 bPrimaryVertex =
false;
735 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
736 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
741 int vertex_number = vertexCollection.size();
742 VertexCollection::const_iterator
v = vertexCollection.begin();
743 for ( ; v != vertexCollection.end(); ++
v) {
744 double vertex_chi2 = v->normalizedChi2();
745 double vertex_ndof = v->ndof();
746 bool fakeVtx = v->isFake();
747 double vertex_Z = v->z();
754 bPrimaryVertex =
true;
763 if (!gtReadoutRecord.
isValid()) {
764 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
765 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
768 bool bTechTriggers =
true;
769 bool bTechTriggersAND =
true;
770 bool bTechTriggersOR =
false;
771 bool bTechTriggersNOT =
false;
773 if (gtReadoutRecord.
isValid()) {
774 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
777 bTechTriggersAND =
true;
780 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(
_techTrigsAND.at(ttr));
784 bTechTriggersOR =
true;
786 for (
unsigned ttr = 0; ttr !=
_techTrigsOR.size(); ttr++) {
787 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(
_techTrigsOR.at(ttr));
790 bTechTriggersNOT =
false;
793 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(
_techTrigsNOT.at(ttr));
798 bTechTriggersAND =
true;
799 bTechTriggersOR =
true;
800 bTechTriggersNOT =
false;
804 bTechTriggersAND =
true;
806 bTechTriggersOR =
true;
808 bTechTriggersNOT =
false;
810 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
815 bool bHcalNoise = bHcalNoiseFilter;
816 bool bBeamHaloID = bBeamHaloIDLoosePass;
819 bool bPhysicsDeclared =
true;
830 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
831 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
835 for (std::vector<std::string>::const_iterator ic =
_FolderNames.begin();
837 if (*ic==
"All")
fillMESet(iEvent, DirName+
"/"+*ic, *met);
840 if (*ic==
"BasicCleanup" && bBasicCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
841 if (*ic==
"ExtraCleanup" && bExtraCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
844 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter )
fillMESet(iEvent, DirName+
"/"+*ic, *met);
845 if (*ic==
"JetIDMinimal" && bJetIDMinimal)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
846 if (*ic==
"JetIDLoose" && bJetIDLoose)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
847 if (*ic==
"JetIDTight" && bJetIDTight)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
848 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
849 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
850 if (*ic==
"Triggers" && bTechTriggers)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
851 if (*ic==
"PV" && bPrimaryVertex)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
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
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)