11 edm::LogInfo(
"SUSY_HLT_Razor") <<
"Constructor SUSY_HLT_Razor::SUSY_HLT_Razor " << std::endl;
27 edm::LogInfo(
"SUSY_HLT_Razor") <<
"Destructor SUSY_HLT_Razor::~SUSY_HLT_Razor " << std::endl;
32 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::beginRun" << std::endl;
37 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::bookHistograms" << std::endl;
45 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::beginLuminosityBlock" << std::endl;
51 desc.
add<
edm::InputTag>(
"CaloFilter",
edm::InputTag(
"hltRsqMR200Rsq0p01MR100Calo",
"",
"HLT"))->setComment(
"Calo HLT filter module used to save razor variable objects");
54 desc.
add<
std::string>(
"TriggerPath",
"HLT_RsqMR300_Rsq0p09_MR200_v")->setComment(
"trigger path name");
55 desc.
add<
std::string>(
"DenomPath",
"HLT_Ele40_eta2p1_WP85_Gsf_v")->setComment(
"tight denominator trigger path name (for 1.4e34 lumi)");
56 desc.
add<
std::string>(
"DenomPathLoose",
"HLT_Ele35_eta2p1_WP85_Gsf_v")->setComment(
"loose denominator trigger path name (for 7e33 lumi)");
57 desc.
add<
edm::InputTag>(
"TriggerFilter",
edm::InputTag(
"hltRsqMR300Rsq0p09MR200",
"",
"HLT"))->setComment(
"PF HLT filter module used to save razor variable objects");
60 descriptions.
add(
"SUSY_HLT_Razor_Main",desc);
65 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::analyze" << std::endl;
77 if ( !inputMet.isValid() ){
78 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: MET" <<
"\n";
84 if ( !jetCollection.isValid() ){
85 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: jets" <<
"\n";
92 if(!hltresults.isValid()){
93 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: TriggerResults" <<
"\n";
102 if(!triggerSummary.isValid()) {
103 edm::LogError (
"SUSY_HLT_Razor") <<
"invalid collection: TriggerSummary" <<
"\n";
108 double onlineMR = 0, onlineRsq = 0;
109 double caloMR = 0, caloRsq = 0;
110 size_t filterIndex = triggerSummary->filterIndex(
triggerFilter_ );
111 size_t caloFilterIndex = triggerSummary->filterIndex(
caloFilter_ );
114 if( !(filterIndex >= triggerSummary->sizeFilters()) ){
116 for(
size_t j = 0;
j < keys.size(); ++
j ){
118 if(foundObject.
id() == 0){
119 onlineMR = foundObject.
px();
120 onlineRsq = foundObject.
py();
126 if( !(caloFilterIndex >= triggerSummary->sizeFilters()) ){
128 for(
size_t j = 0;
j < keys.size(); ++
j ){
130 if(foundObject.
id() == 0){
131 caloMR = foundObject.
px();
132 caloRsq = foundObject.
py();
137 bool hasFired =
false;
138 bool denomFired =
false;
140 unsigned int numTriggers =
trigNames.size();
141 for(
unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
142 if (
trigNames.triggerName(hltIndex).find(
triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
146 if (
trigNames.triggerName(hltIndex).find(
denomPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) {
149 if (
trigNames.triggerName(hltIndex).find(
denomPathLoose_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
157 for (
unsigned int i=0;
i<jetCollection->size();
i++) {
158 if(
std::abs(jetCollection->at(
i).eta()) < 3.0 && jetCollection->at(
i).pt() >= 40.0){
159 HT += jetCollection->at(
i).pt();
167 float MET = (inputMet->front()).
pt();
178 if(hasFired && denomFired){
181 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;
189 edm::LogError(
"SUSY_HLT_Razor") <<
"Invalid hemisphere collection! hemispheres->size() = " <<
hemispheres->size() << endl;
197 std::vector<math::XYZTLorentzVector> muonVec;
199 double MR =
CalcMR(ja,jb);
200 double R =
CalcR(MR,ja,jb,inputMet,muonVec);
254 std::vector<math::XYZTLorentzVector> muonVec;
256 double MR =
CalcMR(ja,jb);
257 double R =
CalcR(MR,ja,jb,inputMet,muonVec);
283 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::endLuminosityBlock" << std::endl;
289 edm::LogInfo(
"SUSY_HLT_Razor") <<
"SUSY_HLT_Razor::endRun" << std::endl;
297 h_mr = ibooker_.
book1D(
"mr",
"M_{R} (R^{2} > 0.15) ; GeV", 100, 0.0, 4000);
298 h_rsq = ibooker_.
book1D(
"rsq",
"R^{2} (M_{R} > 300)", 100, 0.0, 1.5);
299 h_mrRsq = ibooker_.
book2D(
"mrRsq",
"R^{2} vs M_{R}; GeV; ", 100, 0.0, 4000.0, 100, 0.0, 1.5);
300 h_mr_denom = ibooker_.
book1D(
"mr_denom",
"M_{R} (R^{2} > 0.15); GeV", 100, 0.0, 4000);
302 h_mrRsq_denom = ibooker_.
book2D(
"mrRsq_denom",
"R^{2} vs M_{R}; GeV; ", 100, 0.0, 4000.0, 100, 0.0, 1.5);
304 h_mr_tight = ibooker_.
book1D(
"mr_tight",
"M_{R} (R^{2} > 0.25) ; GeV", 100, 0.0, 4000);
305 h_rsq_tight = ibooker_.
book1D(
"rsq_tight",
"R^{2} (M_{R} > 400) ; ", 100, 0.0, 1.5);
309 h_rsq_loose = ibooker_.
book1D(
"rsq_loose",
"R^{2} (M_{R} > 0) ; ", 100, 0.0, 1.5);
312 h_ht = ibooker_.
book1D(
"ht",
"HT; GeV; ", 100, 0.0, 4000.0);
313 h_met = ibooker_.
book1D(
"met",
"MET; GeV; ", 100, 0.0, 1000);
314 h_htMet = ibooker_.
book2D(
"htMet",
"MET vs HT; GeV; ", 100, 0.0, 4000.0, 100, 0.0, 1000);
317 h_htMet_denom = ibooker_.
book2D(
"htMet_denom",
"MET vs HT; GeV; ", 100, 0.0, 4000.0, 100, 0.0, 1000);
319 h_online_mr_vs_mr = ibooker_.
book2D(
"online_mr_vs_mr",
"Online M_{R} vs Offline M_{R} (events passing trigger); Offline M_{R} (GeV); Online M_{R} (GeV); ", 100, 0.0, 4000.0, 100, 0.0, 4000.0);
320 h_calo_mr_vs_mr = ibooker_.
book2D(
"calo_mr_vs_mr",
"Calo M_{R} vs Offline M_{R} (events passing trigger); Offline M_{R} (GeV); Calo M_{R} (GeV); ", 100, 0.0, 4000.0, 100, 0.0, 4000.0);
321 h_online_rsq_vs_rsq = ibooker_.
book2D(
"online_rsq_vs_rsq",
"Online R^{2} vs Offline R^{2} (events passing trigger); Offline R^{2}; Online R^{2}; ", 100, 0.0, 1.5, 100, 0.0, 1.5);
322 h_calo_rsq_vs_rsq = ibooker_.
book2D(
"calo_rsq_vs_rsq",
"Calo R^{2} vs Offline R^{2} (events passing trigger); Offline R^{2}; Calo R^{2}; ", 100, 0.0, 1.5, 100, 0.0, 1.5);
324 h_online_mr_vs_mr_all = ibooker_.
book2D(
"online_mr_vs_mr_all",
"Online M_{R} vs Offline M_{R} (events passing reference trigger); Offline M_{R} (GeV); Online M_{R} (GeV); ", 100, 0.0, 4000.0, 100, 0.0, 4000.0);
325 h_calo_mr_vs_mr_all = ibooker_.
book2D(
"calo_mr_vs_mr_all",
"Calo M_{R} vs Offline M_{R} (events passing reference trigger); Offline M_{R} (GeV); Calo M_{R} (GeV); ", 100, 0.0, 4000.0, 100, 0.0, 4000.0);
326 h_online_rsq_vs_rsq_all = ibooker_.
book2D(
"online_rsq_vs_rsq_all",
"Online R^{2} vs Offline R^{2} (events passing reference trigger); Offline R^{2}; Online R^{2}; ", 100, 0.0, 1.5, 100, 0.0, 1.5);
327 h_calo_rsq_vs_rsq_all = ibooker_.
book2D(
"calo_rsq_vs_rsq_all",
"Calo R^{2} vs Offline R^{2} (events passing reference trigger); Offline R^{2}; Calo R^{2}; ", 100, 0.0, 1.5, 100, 0.0, 1.5);
335 if(ja.Pt()<=0.1)
return -1;
337 ja.SetPtEtaPhiM(ja.Pt(),ja.Eta(),ja.Phi(),0.0);
338 jb.SetPtEtaPhiM(jb.Pt(),jb.Eta(),jb.Phi(),0.0);
340 if(ja.Pt() > jb.Pt()){
341 TLorentzVector
temp = ja;
351 jaT.SetXYZ(ja.Px(),ja.Py(),0.0);
352 jbT.SetXYZ(jb.Px(),jb.Py(),0.0);
353 double ATBT = (jaT+jbT).Mag2();
355 double MR =
sqrt((A+B)*(A+B)-(az+bz)*(az+bz)-
356 (jbT.Dot(jbT)-jaT.Dot(jaT))*(jbT.Dot(jbT)-jaT.Dot(jaT))/(jaT+jbT).Mag2());
358 double mybeta = (jbT.Dot(jbT)-jaT.Dot(jaT))/
359 sqrt(ATBT*((A+B)*(A+B)-(az+bz)*(az+bz)));
361 double mygamma = 1./
sqrt(1.-mybeta*mybeta);
371 met.SetPtEtaPhi((inputMet->front()).
pt(),0.0,(inputMet->front()).
phi());
373 std::vector<math::XYZTLorentzVector>::const_iterator muonIt;
374 for(muonIt = muons.begin(); muonIt!=muons.end(); muonIt++){
376 tmp.SetPtEtaPhi(muonIt->pt(),0,muonIt->phi());
380 double MTR =
sqrt(0.5*(met.Mag()*(ja.Pt()+jb.Pt()) - met.Dot(ja.Vect()+jb.Vect())));
383 return float(MTR)/float(MR);
void bookHistos(DQMStore::IBooker &)
T getParameter(std::string const &) const
std::string denomPathLoose_
MonitorElement * h_calo_rsq_vs_rsq
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * h_htMet_denom
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
MonitorElement * h_rsq_tight
#define DEFINE_FWK_MODULE(type)
SUSY_HLT_Razor(const edm::ParameterSet &ps)
MonitorElement * h_ht_denom
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)
MonitorElement * h_online_rsq_vs_rsq_all
edm::EDGetTokenT< edm::View< reco::MET > > theMETCollection_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
void endLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::InputTag caloFilter_
MonitorElement * h_online_mr_vs_mr_all
MonitorElement * h_mr_tight_denom
MonitorElement * h_calo_mr_vs_mr
virtual ~SUSY_HLT_Razor()
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< size_type > Keys
MonitorElement * h_rsq_denom
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
std::vector< std::vector< double > > tmp
MonitorElement * h_online_rsq_vs_rsq
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::View< reco::Jet > > theJetCollection_
MonitorElement * h_calo_rsq_vs_rsq_all
MonitorElement * h_met_denom
edm::InputTag triggerFilter_
MonitorElement * h_rsq_tight_denom
MonitorElement * h_mrRsq_denom
MonitorElement * h_mr_tight
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
MonitorElement * h_calo_mr_vs_mr_all
MonitorElement * h_mr_denom
static double CalcMR(TLorentzVector ja, TLorentzVector jb)
MonitorElement * h_rsq_loose_denom
MonitorElement * h_rsq_loose
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)