22 folderName_ ( iConfig.getParameter<
std::
string>(
"FolderName") )
25 , rsq_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> > (
"rsqBins") )
26 , mr_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> > (
"mrBins") )
27 , dphiR_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> > (
"dphiRBins") )
30 , metSelection_ ( iConfig.getParameter<
std::
string>(
"metSelection") )
31 , jetSelection_ ( iConfig.getParameter<
std::
string>(
"jetSelection") )
32 , njets_ ( iConfig.getParameter<unsigned
int>(
"njets" ) )
33 , rsqCut_ ( iConfig.getParameter<double>(
"rsqCut" ) )
34 , mrCut_ ( iConfig.getParameter<double>(
"mrCut" ) )
64 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, min, max);
65 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, min, max);
69 int nbins = binning.size()-1;
70 std::vector<float> fbinning(binning.begin(),binning.end());
71 float* arr = &fbinning[0];
72 me.
numerator = ibooker.
book1D(histname+
"_numerator", histtitle+
" (numerator)", nbins, arr);
73 me.
denominator = ibooker.
book1D(histname+
"_denominator", histtitle+
" (denominator)", nbins, arr);
77 me.
numerator = ibooker.
bookProfile(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
78 me.
denominator = ibooker.
bookProfile(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
82 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
83 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
87 int nbinsX = binningX.size()-1;
88 std::vector<float> fbinningX(binningX.begin(),binningX.end());
89 float* arrX = &fbinningX[0];
90 int nbinsY = binningY.size()-1;
91 std::vector<float> fbinningY(binningY.begin(),binningY.end());
92 float* arrY = &fbinningY[0];
94 me.
numerator = ibooker.
book2D(histname+
"_numerator", histtitle+
" (numerator)", nbinsX, arrX, nbinsY, arrY);
95 me.
denominator = ibooker.
book2D(histname+
"_denominator", histtitle+
" (denominator)", nbinsX, arrX, nbinsY, arrY);
109 histname =
"MR"; histtitle =
"PF MR";
114 histname =
"Rsq"; histtitle =
"PF Rsq";
119 histname =
"dPhiR"; histtitle =
"dPhiR";
124 histname =
"MRVsRsq"; histtitle =
"PF MR vs PF Rsq";
150 std::vector<reco::PFJet>
jets;
151 if ( jetHandle->size() <
njets_ )
return;
152 for (
auto const & j : *jetHandle ) {
155 if ( jets.size() <
njets_ )
return;
161 if (not hemispheres.
isValid()){
165 if(hemispheres->empty()){
166 edm::LogError(
"DQM_HLT_Razor") <<
"Cannot calculate M_R and R^2 because there are too many jets! (trigger passed automatically without forming the hemispheres)" << endl;
172 if(!hemispheres->empty() && hemispheres->size() != 2 && hemispheres->size() != 5 && hemispheres->size() != 10){
173 edm::LogError(
"DQM_HLT_Razor") <<
"Invalid hemisphere collection! hemispheres->size() = " << hemispheres->size() << endl;
178 double MR = 0,
R = 0;
179 if (hemispheres->at(1).Pt() > hemispheres->at(0).Pt()) {
180 MR =
CalcMR(hemispheres->at(1),hemispheres->at(0));
181 R =
CalcR(MR,hemispheres->at(1),hemispheres->at(0),metHandle);
184 MR =
CalcMR(hemispheres->at(0),hemispheres->at(1));
185 R =
CalcR(MR,hemispheres->at(0),hemispheres->at(1),metHandle);
189 double dPhiR =
abs(
deltaPhi(hemispheres->at(0).Phi(), hemispheres->at(1).Phi()));
240 desc.
add<
unsigned int>(
"njets", 2);
241 desc.
add<
double>(
"mrCut", 300);
242 desc.
add<
double>(
"rsqCut", 0.15);
245 genericTriggerEventPSet.
add<
bool>(
"andOr");
247 genericTriggerEventPSet.
add<std::vector<int> >(
"dcsPartitions",{});
248 genericTriggerEventPSet.
add<
bool>(
"andOrDcs",
false);
249 genericTriggerEventPSet.
add<
bool>(
"errorReplyDcs",
true);
251 genericTriggerEventPSet.
add<
bool>(
"andOrHlt",
true);
253 genericTriggerEventPSet.
add<std::vector<std::string> >(
"hltPaths",{});
255 genericTriggerEventPSet.
add<
bool>(
"errorReplyHlt",
false);
256 genericTriggerEventPSet.
add<
unsigned int>(
"verbosityLevel",1);
263 std::vector<double> mrbins = {0., 100., 200., 300., 400., 500., 575., 650., 750., 900., 1200., 1600., 2500., 4000.};
264 histoPSet.
add<std::vector<double> >(
"mrBins", mrbins);
266 std::vector<double> rsqbins = {0., 0.05, 0.1, 0.15, 0.2, 0.25, 0.30, 0.41, 0.52, 0.64, 0.8, 1.5};
267 histoPSet.add<std::vector<double> >(
"rsqBins", rsqbins);
269 std::vector<double> dphirbins = {0., 0.5, 1.0, 1.5, 2.0, 2.5, 2.8, 3.0, 3.2};
270 histoPSet.add<std::vector<double> >(
"dphiRBins", dphirbins);
274 descriptions.
add(
"razorMonitoring", desc);
279 if(ja.Pt()<=0.1)
return -1;
286 jaT.SetXYZ(ja.Px(),ja.Py(),0.0);
287 jbT.SetXYZ(jb.Px(),jb.Py(),0.0);
288 double ATBT = (jaT+jbT).Mag2();
290 double MR =
sqrt((A+B)*(A+B)-(az+bz)*(az+bz)-
291 (jbT.Dot(jbT)-jaT.Dot(jaT))*(jbT.Dot(jbT)-jaT.Dot(jaT))/(jaT+jbT).Mag2());
292 double mybeta = (jbT.Dot(jbT)-jaT.Dot(jaT))/
293 sqrt(ATBT*((A+B)*(A+B)-(az+bz)*(az+bz)));
295 double mygamma = 1./
sqrt(1.-mybeta*mybeta);
306 double MTR =
sqrt(0.5*(met.R()*(ja.Pt()+jb.Pt()) - met.Dot(ja.Vect()+jb.Vect())));
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
edm::EDGetTokenT< reco::PFMETCollection > metToken_
void bookME(DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
void setMETitle(RazorME &me, const std::string &titleX, const std::string &titleY)
static double CalcMR(const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb)
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
MonitorElement * numerator
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
#define DEFINE_FWK_MODULE(type)
std::vector< double > mr_binning_
void setCurrentFolder(std::string const &fullpath)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
static const std::string B
std::vector< double > dphiR_binning_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * book2D(Args &&...args)
std::vector< double > rsq_binning_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
StringCutObjectSelector< reco::MET, true > metSelection_
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * denominator
RazorMonitor(const edm::ParameterSet &)
static double CalcR(double MR, const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb, const edm::Handle< std::vector< reco::PFMET > > &met)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
StringCutObjectSelector< reco::PFJet, true > jetSelection_