56 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::analyze" << std::endl;
69 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: MET" <<
"\n";
75 if ( !jetCollection.
isValid() ){
76 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: jets" <<
"\n";
84 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: TriggerResults" <<
"\n";
94 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: TriggerSummary" <<
"\n";
99 double onlineMR = 0, onlineRsq = 0;
100 double caloMR = 0, caloRsq = 0;
105 if( !(filterIndex >= triggerSummary->
sizeFilters()) ){
107 for(
size_t j = 0; j < keys.size(); ++j ){
109 if(foundObject.
id() == 0){
110 onlineMR = foundObject.
px();
111 onlineRsq = foundObject.
py();
117 if( !(caloFilterIndex >= triggerSummary->
sizeFilters()) ){
119 for(
size_t j = 0; j < keys.size(); ++j ){
121 if(foundObject.
id() == 0){
122 caloMR = foundObject.
px();
123 caloRsq = foundObject.
py();
128 bool hasFired =
false;
130 unsigned int numTriggers = trigNames.
size();
131 for(
unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
140 for (
unsigned int i=0;
i<jetCollection->size();
i++) {
141 if(
std::abs(jetCollection->at(
i).eta()) < 3.0 && jetCollection->at(
i).pt() >= 40.0){
142 HT += jetCollection->at(
i).pt();
150 float MET = (inputMet->front()).
pt();
155 if (not hemispheres.
isValid()){
163 if(hemispheres->empty()){
164 edm::LogError(
"SUSY_HLT_Razor") <<
"Cannot calculate M_R and R^2 because there are too many jets! (trigger passed automatically without forming the hemispheres)" << endl;
171 if(!hemispheres->empty() && hemispheres->size() != 2 && hemispheres->size() != 5 && hemispheres->size() != 10){
172 edm::LogError(
"SUSY_HLT_Razor") <<
"Invalid hemisphere collection! hemispheres->size() = " << hemispheres->size() << endl;
176 TLorentzVector ja(hemispheres->at(0).x(),hemispheres->at(0).y(),hemispheres->at(0).z(),hemispheres->at(0).t());
177 TLorentzVector jb(hemispheres->at(1).x(),hemispheres->at(1).y(),hemispheres->at(1).z(),hemispheres->at(1).t());
180 std::vector<math::XYZTLorentzVector> muonVec;
182 double MR =
CalcMR(ja,jb);
183 double R =
CalcR(MR,ja,jb,inputMet,muonVec);
bool wasrun() const
Was at least one path run?
MonitorElement * h_calo_rsq_vs_rsq
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
static double CalcR(double MR, TLorentzVector ja, TLorentzVector jb, edm::Handle< edm::View< reco::MET > > met, const std::vector< math::XYZTLorentzVector > &muons)
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