64 const std::
string den,
65 edm::
Event const& iEvent,
195 requireValidHLTPaths_(
iConfig.getParameter<
bool>("requireValidHLTPaths")),
196 hltPathsAreValid_(
false),
207 pt_variable_binning_(
209 dMu_pt_variable_binning_(
211 prob_variable_binning_(
234 iConfig.getParameter<edm::
ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
236 iConfig.getParameter<edm::
ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
238 muoSelection_(iConfig.getParameter<std::
string>("muoSelection")),
239 muoSelection_ref(iConfig.getParameter<std::
string>("muoSelection_ref")),
240 muoSelection_tag(iConfig.getParameter<std::
string>("muoSelection_tag")),
241 muoSelection_probe(iConfig.getParameter<std::
string>("muoSelection_probe")),
242 nmuons_(iConfig.getParameter<
int>("nmuons")),
243 tnp_(iConfig.getParameter<
bool>("tnp")),
244 L3_(iConfig.getParameter<
int>("
L3")),
245 ptCut_(iConfig.getParameter<
int>("ptCut")),
246 displaced_(iConfig.getParameter<
int>("displaced")),
247 trOrMu_(iConfig.getParameter<
int>("trOrMu")),
248 Jpsi_(iConfig.getParameter<
int>("Jpsi")),
249 Upsilon_(iConfig.getParameter<
int>("Upsilon"))
251 enum_(iConfig.getParameter<
int>("enum")),
252 seagull_(iConfig.getParameter<
int>("seagull")),
253 maxmass_(iConfig.getParameter<
double>("maxmass")),
254 minmass_(iConfig.getParameter<
double>("minmass")),
255 maxmassJpsi(iConfig.getParameter<
double>("maxmassJpsi")),
256 minmassJpsi(iConfig.getParameter<
double>("minmassJpsi")),
257 maxmassUpsilon(iConfig.getParameter<
double>("maxmassUpsilon")),
258 minmassUpsilon(iConfig.getParameter<
double>("minmassUpsilon")),
259 maxmassTkTk(iConfig.getParameter<
double>("maxmassTkTk")),
260 minmassTkTk(iConfig.getParameter<
double>("minmassTkTk")),
261 maxmassJpsiTk(iConfig.getParameter<
double>("maxmassJpsiTk")),
262 minmassJpsiTk(iConfig.getParameter<
double>("minmassJpsiTk")),
263 kaon_mass(iConfig.getParameter<
double>("kaon_mass")),
264 mu_mass(iConfig.getParameter<
double>("mu_mass")),
265 min_dR(iConfig.getParameter<
double>("min_dR")),
266 max_dR(iConfig.getParameter<
double>("max_dR")),
267 minprob(iConfig.getParameter<
double>("minprob")),
268 mincos(iConfig.getParameter<
double>("mincos")),
269 minDS(iConfig.getParameter<
double>("minDS")),
270 hltInputTag_1(iConfig.getParameter<edm::
InputTag>("hltTriggerSummaryAOD")),
271 hltInputTag_(mayConsume<trigger::TriggerEvent>(iConfig.getParameter<edm::
InputTag>("hltTriggerSummaryAOD"))),
272 hltpaths_num(iConfig.getParameter<edm::
ParameterSet>("numGenericTriggerEventPSet")
274 hltpaths_den(iConfig.getParameter<edm::
ParameterSet>("denGenericTriggerEventPSet")
275 .getParameter<std::
vector<std::
string>>("hltPaths")),
276 trSelection_(iConfig.getParameter<std::
string>("muoSelection")),
277 trSelection_ref(iConfig.getParameter<std::
string>("trSelection_ref")),
278 DMSelection_ref(iConfig.getParameter<std::
string>("DMSelection_ref")) {
280 magneticFieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
321 istnp =
"Tag_and_Probe/";
336 histname = trMuPh +
"Pt";
337 histtitle = trMuPh +
"_P_{t}";
341 histname = trMuPh +
"Phi";
342 histtitle = trMuPh +
"Phi";
346 histname = trMuPh +
"Eta";
347 histtitle = trMuPh +
"_Eta";
359 histname = trMuPh +
"1Pt";
360 histtitle = trMuPh +
"1_P_{t}";
364 histname = trMuPh +
"1Phi";
365 histtitle = trMuPh +
"1Phi";
369 histname = trMuPh +
"1Eta";
370 histtitle = trMuPh +
"1_Eta";
374 histname = trMuPh +
"2Pt";
375 histtitle = trMuPh +
"2_P_{t}";
379 histname = trMuPh +
"2Phi";
380 histtitle = trMuPh +
"2Phi";
384 histname = trMuPh +
"2Eta";
385 histtitle = trMuPh +
"2_Eta";
396 histname = trMuPh +
"3Eta";
397 histtitle = trMuPh +
"3Eta";
401 histname = trMuPh +
"3Pt";
402 histtitle = trMuPh +
"3_P_{t}";
406 histname = trMuPh +
"3Phi";
407 histtitle = trMuPh +
"3Phi";
412 histname =
"DiMuEta";
413 histtitle =
"DiMuEta";
418 histtitle =
"DiMu_P_{t}";
422 histname =
"DiMuPhi";
423 histtitle =
"DiMuPhi";
429 histtitle =
"DiMudR";
434 histname =
"DiMuMass";
435 histtitle =
"DiMuMass";
439 }
else if (
enum_ == 8) {
440 histname =
"DiMuProb";
441 histtitle =
"DiMuProb";
445 histname =
"DiMuPVcos";
446 histtitle =
"DiMuPVcos";
451 histtitle =
"DiMuDS";
455 histname =
"DiMuDCA";
456 histtitle =
"DiMuDCA";
502 double PrescaleWeight = 1.0;
515 std::vector<reco::Muon> tagMuons;
516 for (
auto const&
m : *muoHandle) {
520 tagMuons.push_back(
m);
523 for (
int i = 0;
i < int(tagMuons.size());
i++) {
524 for (
auto const&
m : *muoHandle) {
527 if ((tagMuons[
i].
pt() ==
m.pt()))
529 if ((tagMuons[
i].p4() +
m.p4()).M() >
minmass_ &&
552 for (
auto const&
m : *muoHandle) {
558 for (
auto const& m1 : *muoHandle) {
559 if (!(m1.pt() >
m.pt()))
572 if (
m.charge() * m1.charge() > 0)
579 std::vector<reco::TransientTrack> j_tks;
582 j_tks.push_back(mu1TT);
583 j_tks.push_back(mu2TT);
590 if ((jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0))
591 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof());
596 -1 * ((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
597 -1 * ((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
600 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R() * jpperp.R());
609 double DiMuMass = (m1.p4() +
m.p4()).M();
795 for (
auto const&
m2 : *muoHandle) {
796 if (
m2.pt() ==
m.pt())
798 if (
m2.pt() == m1.pt())
837 if (!phHandle->empty())
838 for (
auto const&
p : *phHandle) {
869 if ((displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
888 sqrt(jerr.
rerr(displacementFromBeamspotJpsi)));
901 displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)), PrescaleWeight);
915 if (fabs(jpsi_cos) <
mincos)
917 if ((displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
921 for (
auto const&
t : *trHandle) {
936 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2);
937 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
946 std::vector<reco::TransientTrack> t_tks;
947 t_tks.push_back(mu1TT);
948 t_tks.push_back(mu2TT);
949 t_tks.push_back(trTT);
956 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0))
957 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof());
962 -1 * ((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
963 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
964 -1 * ((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
965 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
968 float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
971 if (fabs(jpsiKcos) <
mincos)
973 if ((displacementFromBeamspot.
perp() /
sqrt(err.
rerr(displacementFromBeamspot))) <
minDS)
999 if (trHandle.isValid())
1000 for (
auto const&
t : *trHandle) {
1015 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
1016 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2);
1023 std::vector<reco::TransientTrack> t_tks;
1024 t_tks.push_back(mu2TT);
1025 t_tks.push_back(trTT);
1032 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0))
1033 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof());
1038 -1 * ((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
1039 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
1040 -1 * ((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
1041 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
1070 if (fabs(jpsi_cos) <
mincos)
1072 if (displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)) <
minDS)
1075 if (trHandle.isValid())
1076 for (
auto const&
t : *trHandle) {
1084 for (
auto const& t1 : *trHandle) {
1085 if (&
t - &(*trHandle)[0] >= &t1 - &(*trHandle)[0])
1106 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2);
1107 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
1108 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2);
1109 double e4 =
sqrt(itrk2.
momentum().Mag2() + trackMass2);
1117 pB = p1 + p2 + p3 + p4;
1124 std::vector<reco::TransientTrack> t_tks;
1125 t_tks.push_back(mu1TT);
1126 t_tks.push_back(mu2TT);
1127 t_tks.push_back(trTT);
1128 t_tks.push_back(tr1TT);
1135 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0))
1136 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof());
1138 m.px() + m1.px() + itrk1.
px() + itrk2.
px(),
m.py() + m1.py() + itrk1.
py() + itrk2.
py(), 0.);
1142 -1 * ((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
1143 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
1144 -1 * ((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
1145 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
1148 float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
1151 if (fabs(jpsiKcos) <
mincos)
1153 if ((displacementFromBeamspot.
perp() /
sqrt(err.
rerr(displacementFromBeamspot))) <
minDS)
1195 desc.
add<
bool>(
"requireValidHLTPaths",
true);
1205 "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1206 "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1209 "isGlobalMuon && isPFMuon && isTrackerMuon && abs(eta) < 2.4 && innerTrack.hitPattern.numberOfValidPixelHits > 0 "
1210 "&& innerTrack.hitPattern.trackerLayersWithMeasurement > 5 && globalTrack.hitPattern.numberOfValidMuonHits > 0 "
1211 "&& globalTrack.normalizedChi2 < 10");
1213 "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1214 "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1218 desc.
add<
int>(
"nmuons", 1);
1219 desc.
add<
bool>(
"tnp",
false);
1220 desc.
add<
int>(
"L3", 0);
1221 desc.
add<
int>(
"ptCut", 0);
1222 desc.
add<
int>(
"displaced", 0);
1223 desc.
add<
int>(
"trOrMu", 0);
1224 desc.
add<
int>(
"Jpsi", 0);
1225 desc.
add<
int>(
"Upsilon", 0);
1226 desc.
add<
int>(
"enum", 1);
1227 desc.
add<
int>(
"seagull", 1);
1228 desc.
add<
double>(
"maxmass", 3.596);
1229 desc.
add<
double>(
"minmass", 2.596);
1230 desc.
add<
double>(
"maxmassJpsi", 3.2);
1231 desc.
add<
double>(
"minmassJpsi", 3.);
1232 desc.
add<
double>(
"maxmassUpsilon", 10.0);
1233 desc.
add<
double>(
"minmassUpsilon", 8.8);
1234 desc.
add<
double>(
"maxmassTkTk", 10);
1235 desc.
add<
double>(
"minmassTkTk", 0);
1236 desc.
add<
double>(
"maxmassJpsiTk", 5.46);
1237 desc.
add<
double>(
"minmassJpsiTk", 5.1);
1238 desc.
add<
double>(
"kaon_mass", 0.493677);
1239 desc.
add<
double>(
"mu_mass", 0.1056583745);
1240 desc.
add<
double>(
"min_dR", 0.001);
1241 desc.
add<
double>(
"max_dR", 1.4);
1242 desc.
add<
double>(
"minprob", 0.005);
1243 desc.
add<
double>(
"mincos", 0.95);
1244 desc.
add<
double>(
"minDS", 3.);
1245 desc.
add<
unsigned int>(
"stageL1Trigger", 1);
1248 genericTriggerEventPSet.
add<
bool>(
"andOr");
1251 genericTriggerEventPSet.add<std::vector<int>>(
"dcsPartitions", {});
1252 genericTriggerEventPSet.add<
bool>(
"andOrDcs",
false);
1253 genericTriggerEventPSet.add<
bool>(
"errorReplyDcs",
true);
1254 genericTriggerEventPSet.add<
std::string>(
"dbLabel",
"");
1255 genericTriggerEventPSet.add<
bool>(
"andOrHlt",
true);
1256 genericTriggerEventPSet.add<
bool>(
"andOrL1",
true);
1257 genericTriggerEventPSet.add<std::vector<std::string>>(
"hltPaths", {});
1258 genericTriggerEventPSet.add<std::vector<std::string>>(
"l1Algorithms", {});
1259 genericTriggerEventPSet.add<
std::string>(
"hltDBKey",
"");
1260 genericTriggerEventPSet.add<
bool>(
"errorReplyHlt",
false);
1261 genericTriggerEventPSet.add<
bool>(
"errorReplyL1",
true);
1262 genericTriggerEventPSet.add<
bool>(
"l1BeforeMask",
true);
1263 genericTriggerEventPSet.add<
unsigned int>(
"verbosityLevel", 0);
1296 histoPSet.add<std::vector<double>>(
"ptBinning", {-0.5, 0, 2, 4, 8, 10, 12, 16, 20, 25, 30, 35, 40, 50});
1297 histoPSet.add<std::vector<double>>(
"dMuPtBinning", {6, 8, 12, 16, 20, 25, 30, 35, 40, 50, 70});
1298 histoPSet.add<std::vector<double>>(
"probBinning",
1299 {0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0});
1312 descriptions.
add(
"bphMonitoring", desc);
1316 const std::string trigger_name_tmp = partialName.substr(0, partialName.find(
"v*"));
1319 for (
unsigned int i = 0;
i < Ntriggers;
i++) {
1321 if (trigger_name.find(trigger_name_tmp) != std::string::npos)
1325 return trigger_name;
1328 template <
typename T>
1330 bool matched =
false;
1343 unsigned int fIdx = 0;
1344 for (
unsigned int i = 0;
i < Nmodules;
i++) {
1345 const unsigned int tmp_fIdx =
1347 if (tmp_fIdx < handleTriggerEvent->sizeFilters())
1373 int PrescaleHLT_num = 1;
1374 int PrescaleHLT_den = 1;
1375 double Prescale_num = 1;
1376 double L1P = 1, HLTP = 1;
1378 std::vector<bool> theSame_den;
1379 std::vector<bool> theSame_num;
1383 if (PrescaleHLT_den > 0 && PrescaleHLT_num > 0)
1384 HLTP = PrescaleHLT_num / std::__gcd(PrescaleHLT_num, PrescaleHLT_den);
1404 if (l1_num == l1_den && l1_nump >= 1)
1410 theSame_den.push_back(flag);
1426 if (l1_den == l1_num && l1_denp >= 1)
1432 theSame_num.push_back(flag);
1437 if (theSame_num.size() == theSame_den.size()) {
1438 for (
size_t i = 0;
i < theSame_num.size(); ++
i) {
1439 if ((!theSame_num.at(
i)) || (!theSame_den.at(
i))) {
1446 if (flag && (theSame_num.size() == theSame_den.size())) {
1460 Prescale_num *= 1 - (1.0 / (l1));
1462 if (Prescale_num != 1)
1463 Prescale_num = 1.0 / (1 - Prescale_num);
unsigned int size() const
number of trigger paths in trigger table
const bool requireValidHLTPaths_
GlobalError positionError() const
double z0() const
z coordinate
const std::string & triggerName(unsigned int triggerIndex) const
float distance() const override
HLTPrescaleProvider * hltPrescale_
virtual void setCurrentFolder(std::string const &fullpath)
StringCutObjectSelector< reco::Track, true > trSelection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const FreeTrajectoryState & theState() const
#define DEFINE_FWK_MODULE(type)
StringCutObjectSelector< reco::Candidate::LorentzVector, true > DMSelection_ref
edm::EDGetTokenT< reco::MuonCollection > muoToken_
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
edm::InputTag bsInputTag_
std::vector< Track > TrackCollection
collection of Tracks
double Prescale(const std::string num, const std::string den, edm::Event const &iEvent, edm::EventSetup const &iSetup, HLTPrescaleProvider *hltPrescale_)
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
StringCutObjectSelector< reco::Muon, true > muoSelection_ref
auto const & tracks
cannot be loose
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
double px() const
x coordinate of momentum vector
const Vector & momentum() const
track momentum vector
edm::EDGetTokenT< trigger::TriggerEvent > hltInputTag_
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
std::vector< Vertex > VertexCollection
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
edm::EDGetTokenT< reco::TrackCollection > trToken_
std::vector< Muon > MuonCollection
collection of Muon objects
bool inited() const
Accessors (const methods)
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
double dydz() const
dydz slope
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
const std::string folderName_
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
edm::InputTag muoInputTag_
edm::InputTag vtxInputTag_
edm::Handle< edm::TriggerResults > HLTR
GlobalPoint position() const
StringCutObjectSelector< reco::Track, true > trSelection_ref
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
MonitorElement * denominator
MonitorElement * numerator
HLTConfigProvider hltConfig_
BPHMonitor(const edm::ParameterSet &)
dqm::reco::DQMStore DQMStore
double chi2() const
chi-squares
math::XYZTLorentzVector LorentzVector
math::XYZPoint Point
point in the space
dqm::reco::MonitorElement MonitorElement
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
edm::EDGetTokenT< edm::TriggerResults > hltTrigResTag_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
double dxdz() const
dxdz slope
std::vector< std::string > hltpaths_den
double pz() const
z coordinate of momentum vector
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< double > pt_variable_binning_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< double > dMu_pt_variable_binning_
edm::EDGetTokenT< reco::PhotonCollection > phToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< size_type > Keys
T rerr(const GlobalPoint &aPoint) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
StringCutObjectSelector< reco::Muon, true > muoSelection_probe
std::string getTriggerName(std::string partialName)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StringCutObjectSelector< reco::Muon, true > muoSelection_
edm::InputTag hltInputTag_1
bool quality(const TrackQuality) const
Track quality.
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
HLTConfigProvider const & hltConfigProvider() const
bool matchToTrigger(const std::string &theTriggerName, T t)
edm::InputTag trInputTag_
StringCutObjectSelector< reco::Muon, true > muoSelection_tag
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
double y0() const
y coordinate
std::vector< std::string > hltpaths_num
edm::InputTag phInputTag_
std::vector< double > prob_variable_binning_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
double py() const
y coordinate of momentum vector
double x0() const
x coordinate