Get the analysis.
438 if(&triggerResults) {
445 int ntrigs = triggerResults.
size();
458 if (triggerIndex<triggerResults.
size()) {
459 if (triggerResults.
accept(triggerIndex)) {
504 edm::LogInfo(
"MetAnalyzer") <<
"TriggerResults::HLT not found, "
505 "automatically select events";
525 met = &(metcol->front());
555 if (!HRBXCollection.
isValid()) {
556 LogDebug(
"") <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
557 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
562 if (!HNoiseSummary.
isValid()) {
563 LogDebug(
"") <<
"METAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
564 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
570 LogDebug(
"") <<
"METAnalyzer: Could not find jet product" << std::endl;
571 if (
_verbose)
std::cout <<
"METAnalyzer: Could not find jet product" << std::endl;
587 bool bJetIDMinimal=
true;
588 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
589 cal!=caloJets->end(); ++cal){
592 if (fabs(cal->eta())<=2.6 &&
593 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
600 bool bJetIDLoose=
true;
601 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
602 cal!=caloJets->end(); ++cal){
606 << cal->pt() << std::endl;
611 if (
jetID->
fHPD()>=0.98) bJetIDLoose=
false;
615 if (fabs(cal->eta())<2.55){
616 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
620 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
622 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
631 bool bJetIDTight=
true;
632 bJetIDTight=bJetIDLoose;
633 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
634 cal!=caloJets->end(); ++cal){
639 if (
jetID->
fHPD()>=0.95) bJetIDTight=
false;
642 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
643 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
647 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
648 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
652 else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
653 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=
false;
654 if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=
false;
655 if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=
false;
656 if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
657 && cal->emEnergyFraction()>=0.95) bJetIDTight=
false;
661 else if (fabs(cal->eta())>=3.25){
662 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
663 && cal->emEnergyFraction()>=0.90) bJetIDTight=
false;
664 if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
665 && cal->emEnergyFraction()>=0.80) bJetIDTight=
false;
666 if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
667 && cal->emEnergyFraction()>=0.70) bJetIDTight=
false;
678 bool bHcalNoiseFilter = HNoiseSummary->passLooseNoiseFilter();
679 bool bHcalNoiseFilterTight = HNoiseSummary->passTightNoiseFilter();
686 if (!TheBeamHaloSummary.
isValid()) {
687 std::cout <<
"BeamHaloSummary doesn't exist" << std::endl;
690 bool bBeamHaloIDTightPass =
true;
691 bool bBeamHaloIDLoosePass =
true;
693 if(!TheBeamHaloSummary.
isValid()) {
699 bBeamHaloIDLoosePass =
false;
703 bBeamHaloIDTightPass =
false;
710 bool bPrimaryVertex =
true;
712 bPrimaryVertex =
false;
718 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
719 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
724 int vertex_number = vertexCollection.size();
725 VertexCollection::const_iterator
v = vertexCollection.begin();
726 double vertex_chi2 = v->normalizedChi2();
727 double vertex_ndof = v->ndof();
728 bool fakeVtx = v->isFake();
729 double vertex_Z = v->z();
735 && fabs(vertex_Z)<
_vtxz_max ) bPrimaryVertex =
true;
743 if (!gtReadoutRecord.
isValid()) {
744 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
745 if (
_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
748 bool bTechTriggers =
true;
749 bool bTechTriggersAND =
true;
750 bool bTechTriggersOR =
false;
751 bool bTechTriggersNOT =
false;
753 if (gtReadoutRecord.
isValid()) {
754 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
757 bTechTriggersAND =
true;
760 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(
_techTrigsAND.at(ttr));
764 bTechTriggersOR =
true;
766 for (
unsigned ttr = 0; ttr !=
_techTrigsOR.size(); ttr++) {
767 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(
_techTrigsOR.at(ttr));
770 bTechTriggersNOT =
false;
773 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(
_techTrigsNOT.at(ttr));
778 bTechTriggersAND =
true;
779 bTechTriggersOR =
true;
780 bTechTriggersNOT =
false;
784 bTechTriggersAND =
true;
786 bTechTriggersOR =
true;
788 bTechTriggersNOT =
false;
790 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
795 bool bHcalNoise = bHcalNoiseFilter;
796 bool bBeamHaloID = bBeamHaloIDLoosePass;
799 bool bPhysicsDeclared =
true;
811 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
812 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
816 for (std::vector<std::string>::const_iterator ic =
_FolderNames.begin();
818 if (*ic==
"All")
fillMESet(iEvent, DirName+
"/"+*ic, *met);
821 if (*ic==
"BasicCleanup" && bBasicCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
822 if (*ic==
"ExtraCleanup" && bExtraCleanup)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
825 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter )
fillMESet(iEvent, DirName+
"/"+*ic, *met);
826 if (*ic==
"HcalNoiseFilterTight" && bHcalNoiseFilterTight )
fillMESet(iEvent, DirName+
"/"+*ic, *met);
827 if (*ic==
"JetIDMinimal" && bJetIDMinimal)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
828 if (*ic==
"JetIDLoose" && bJetIDLoose)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
829 if (*ic==
"JetIDTight" && bJetIDTight)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
830 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
831 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
832 if (*ic==
"Triggers" && bTechTriggers)
fillMESet(iEvent, DirName+
"/"+*ic, *met);
833 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.
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
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)
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)