243 tnp_(iConfig.getParameter<
bool>("
tnp")),
244 L3_(iConfig.getParameter<
int>("
L3")),
248 Jpsi_(iConfig.getParameter<
int>("
Jpsi")),
251 enum_(iConfig.getParameter<
int>("
enum")),
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);
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);
1023 std::vector<reco::TransientTrack> t_tks;
1024 t_tks.push_back(mu2TT);
1025 t_tks.push_back(trTT);
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);
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);
1138 m.px() + m1.px() + itrk1.
px() + itrk2.
px(),
m.py() + m1.py() + itrk1.
py() + itrk2.
py(), 0.);
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.);
1283 histoPSet.add<std::vector<double>>(
"ptBinning", {-0.5, 0, 2, 4, 8, 10, 12, 16, 20, 25, 30, 35, 40, 50});
1284 histoPSet.add<std::vector<double>>(
"dMuPtBinning", {6, 8, 12, 16, 20, 25, 30, 35, 40, 50, 70});
1285 histoPSet.add<std::vector<double>>(
"probBinning",
1286 {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});
1299 descriptions.
add(
"bphMonitoring",
desc);
1303 const std::string trigger_name_tmp = partialName.substr(0, partialName.find(
"v*"));
1306 for (
unsigned int i = 0;
i < Ntriggers;
i++) {
1308 if (trigger_name.find(trigger_name_tmp) != std::string::npos)
1312 return trigger_name;
1315 template <
typename T>
1330 unsigned int fIdx = 0;
1331 for (
unsigned int i = 0;
i < Nmodules;
i++) {
1332 const unsigned int tmp_fIdx =
1334 if (tmp_fIdx < handleTriggerEvent->sizeFilters())
1360 double Prescale_num = 1;
1361 double L1P = 1, HLTP = 1;
1363 std::vector<bool> theSame_den;
1364 std::vector<bool> theSame_num;
1369 auto PrescaleHLT_den = prescales_den.second;
1370 auto PrescaleHLT_num = prescales_num.second;
1371 if (PrescaleHLT_den > 0 && PrescaleHLT_num > 0)
1372 HLTP = PrescaleHLT_num /
std::min(PrescaleHLT_num, PrescaleHLT_den);
1380 if (not prescales_den.first.empty()) {
1381 for (
size_t iSeed = 0; iSeed < prescales_den.first.size(); ++iSeed) {
1382 auto l1_den = prescales_den.first.at(iSeed).first;
1383 auto l1_denp = prescales_den.first.at(iSeed).second;
1387 for (
size_t iSeed1 = 0; iSeed1 < prescales_num.first.size(); ++iSeed1) {
1388 auto l1_num = prescales_num.first.at(iSeed1).first;
1389 auto l1_nump = prescales_num.first.at(iSeed1).second;
1390 if (l1_num == l1_den && l1_nump >= 1)
1396 theSame_den.push_back(
flag);
1400 if (not prescales_num.first.empty()) {
1401 for (
size_t iSeed = 0; iSeed < prescales_num.first.size(); ++iSeed) {
1402 auto l1_num = prescales_num.first.at(iSeed).first;
1403 auto l1_nump = prescales_num.first.at(iSeed).second;
1407 for (
size_t iSeed1 = 0; iSeed1 < prescales_den.first.size(); ++iSeed1) {
1408 auto l1_den = prescales_den.first.at(iSeed1).first;
1409 auto l1_denp = prescales_den.first.at(iSeed1).second;
1410 if (l1_den == l1_num && l1_denp >= 1)
1416 theSame_num.push_back(
flag);
1421 if (theSame_num.size() == theSame_den.size()) {
1422 for (
size_t i = 0;
i < theSame_num.size(); ++
i) {
1423 if ((!theSame_num.at(
i)) || (!theSame_den.at(
i))) {
1430 if (
flag && (theSame_num.size() == theSame_den.size())) {
1433 if (not prescales_num.first.empty()) {
1435 for (
size_t iSeed = 0; iSeed < prescales_num.first.size(); ++iSeed) {
1436 auto l1 = prescales_num.first.at(iSeed).second;
1443 Prescale_num *= 1 - (1.0 / (l1));
1445 if (Prescale_num != 1)
1446 Prescale_num = 1.0 / (1 - Prescale_num);
bool quality(const TrackQuality) const
Track quality.
const bool requireValidHLTPaths_
const std::string & triggerName(unsigned int triggerIndex) const
static void fillPSetDescription(edm::ParameterSetDescription &desc, unsigned int stageL1Trigger, edm::InputTag const &l1tAlgBlkInputTag, edm::InputTag const &l1tExtBlkInputTag, bool readPrescalesFromFile)
const Keys & filterKeys(trigger::size_type index) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
GlobalPoint position() const
float distance() const override
HLTPrescaleProvider * hltPrescale_
virtual void setCurrentFolder(std::string const &fullpath)
StringCutObjectSelector< reco::Track, true > trSelection_
GlobalError positionError() const
StringCutObjectSelector< reco::Candidate::LorentzVector, true > DMSelection_ref
edm::EDGetTokenT< reco::MuonCollection > muoToken_
double px() const
x coordinate of momentum vector
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
edm::InputTag bsInputTag_
trigger::size_type sizeFilters() const
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)
double py() const
y coordinate of momentum vector
StringCutObjectSelector< reco::Muon, true > muoSelection_ref
HLTConfigProvider const & hltConfigProvider() const
double dydz() const
dydz slope
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
edm::EDGetTokenT< trigger::TriggerEvent > hltInputTag_
denGenericTriggerEventPSet
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
std::vector< Vertex > VertexCollection
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
edm::EDGetTokenT< reco::TrackCollection > trToken_
bool inited() const
Accessors (const methods)
std::vector< Muon > MuonCollection
collection of Muon objects
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
Single trigger physics object (e.g., an isolated muon)
double x0() const
x coordinate
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
const std::string folderName_
unsigned int size() const
number of trigger paths in trigger table
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
edm::InputTag muoInputTag_
edm::InputTag vtxInputTag_
edm::Handle< edm::TriggerResults > HLTR
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
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
const TriggerObjectCollection & getObjects() const
math::XYZTLorentzVector LorentzVector
math::XYZPoint Point
point in the space
def template(fileName, svg, replaceme="REPLACEME")
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
dqm::reco::MonitorElement MonitorElement
double y0() const
y coordinate
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
edm::EDGetTokenT< edm::TriggerResults > hltTrigResTag_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
std::vector< std::string > hltpaths_den
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
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)
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< size_type > Keys
std::vector< Photon > PhotonCollection
collectin of Photon objects
double pz() const
z coordinate of momentum vector
double dxdz() const
dxdz slope
StringCutObjectSelector< reco::Muon, true > muoSelection_probe
std::string getTriggerName(std::string partialName)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent
const FreeTrajectoryState & theState() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StringCutObjectSelector< reco::Muon, true > muoSelection_
edm::InputTag hltInputTag_1
const Vector & momentum() const
track momentum vector
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)
double chi2() const
chi-squares
double z0() const
z coordinate
bool matchToTrigger(const std::string &theTriggerName, T t)
edm::InputTag trInputTag_
StringCutObjectSelector< reco::Muon, true > muoSelection_tag
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
T rerr(const GlobalPoint &aPoint) const
std::vector< std::string > hltpaths_num
edm::InputTag phInputTag_
std::vector< double > prob_variable_binning_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static void fillPSetDescription(edm::ParameterSetDescription &desc)
numGenericTriggerEventPSet
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)