52 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::analyze" << std::endl;
82 edm::LogError(
"SUSY_HLT_Razor") <<
"invalid collection: TriggerResults" 92 if (!triggerSummary.
isValid()) {
93 edm::LogError(
"SUSY_HLT_Razor") <<
"invalid collection: TriggerSummary" 100 double onlineMR = 0, onlineRsq = 0;
107 if (!(filterIndex >= triggerSummary->
sizeFilters())) {
109 for (
size_t j = 0; j < keys.size(); ++j) {
111 if (foundObject.
id() == 0) {
112 onlineMR = foundObject.
px();
113 onlineRsq = foundObject.
py();
119 if (!(caloFilterIndex >= triggerSummary->
sizeFilters())) {
121 for (
size_t j = 0; j < keys.size(); ++j) {
123 if (foundObject.
id() == 0) {
124 caloMR = foundObject.
px();
125 caloRsq = foundObject.
py();
130 bool hasFired =
false;
132 unsigned int numTriggers = trigNames.
size();
133 for (
unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
135 hltresults->
accept(hltIndex)) {
142 for (
unsigned int i = 0;
i < jetCollection->size();
i++) {
143 if (
std::abs(jetCollection->at(
i).eta()) < 3.0 && jetCollection->at(
i).pt() >= 40.0) {
144 HT += jetCollection->at(
i).pt();
153 float MET = (inputMet->front()).
pt();
158 if (not hemispheres.
isValid()) {
166 if (hemispheres->empty()) {
169 edm::LogError(
"SUSY_HLT_Razor") <<
"Cannot calculate M_R and R^2 because there are too many jets! " 170 "(trigger passed automatically without forming the hemispheres)" 178 if (!hemispheres->empty() && hemispheres->size() != 2 && hemispheres->size() != 5 && hemispheres->size() != 10) {
179 edm::LogError(
"SUSY_HLT_Razor") <<
"Invalid hemisphere collection! hemispheres->size() = " << hemispheres->size()
184 TLorentzVector ja(hemispheres->at(0).x(), hemispheres->at(0).y(), hemispheres->at(0).z(), hemispheres->at(0).t());
185 TLorentzVector jb(hemispheres->at(1).x(), hemispheres->at(1).y(), hemispheres->at(1).z(), hemispheres->at(1).t());
188 std::vector<math::XYZTLorentzVector> muonVec;
190 double MR =
CalcMR(ja, jb);
191 double R =
CalcR(MR, ja, jb, inputMet, muonVec);
bool wasrun() const
Was at least one path run?
MonitorElement * h_calo_rsq_vs_rsq
static double CalcR(double MR, TLorentzVector ja, TLorentzVector jb, edm::Handle< edm::View< reco::MET >> met, const std::vector< math::XYZTLorentzVector > &muons)
trigger::size_type sizeFilters() const
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
MonitorElement * h_rsq_tight
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Strings::size_type size() const
MonitorElement * h_online_mr_vs_mr
Single trigger physics object (e.g., an isolated muon)
edm::EDGetTokenT< edm::View< reco::MET > > theMETCollection_
const TriggerObjectCollection & getObjects() const
Abs< T >::type abs(const T &t)
edm::InputTag caloFilter_
MonitorElement * h_calo_mr_vs_mr
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
MonitorElement * h_online_rsq_vs_rsq
edm::EDGetTokenT< edm::View< reco::Jet > > theJetCollection_
edm::InputTag triggerFilter_
MonitorElement * h_mr_tight
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
static double CalcMR(TLorentzVector ja, TLorentzVector jb)
MonitorElement * h_rsq_loose