4 throw cms::Exception(
"Configuration") <<
"Requested plots for from the collection " << requested
5 <<
" also requires a collection in " <<
missing << std::endl;
10 if (
cand.hasUserFloat(
"fitMass")) {
118 std::vector<bool> displacedJPsiToMuMu;
122 displacedJPsiToMuMu.resize(lOniaToMuMu.size(),
false);
127 for (
auto&&
cand : lBuToJPsiK) {
130 if (jpsiMass < 2.9 or jpsiMass > 3.3)
138 displacedJPsiToMuMu[jpsi.index()] =
true;
142 std::vector<bool> displacedPsi2SToJPsiPiPi;
146 displacedPsi2SToJPsiPiPi.resize(lPsi2SToJPsiPiPi.size(),
false);
151 for (
auto&&
cand : lBuToPsi2SK) {
153 auto psi2SMass =
getMass(*psi2S);
154 if (psi2SMass < 3.65 or psi2SMass > 3.72)
159 if (jpsiMass < 2.9 or jpsiMass > 3.3)
167 displacedPsi2SToJPsiPiPi[psi2S.index()] =
true;
168 displacedJPsiToMuMu[jpsi.index()] =
true;
172 for (
size_t i = 0;
i < lPsi2SToJPsiPiPi.size();
i++) {
173 auto&&
cand = lPsi2SToJPsiPiPi[
i];
177 if (jpsiMass < 2.9 or jpsiMass > 3.3)
185 auto decayHistos = &
histos.psi2SToJPsiPiPiPrompt;
186 if (displacedPsi2SToJPsiPiPi[
i]) {
187 decayHistos = &
histos.psi2SToJPsiPiPiDispl;
193 lPsi2SToJPsiPiPi.clear();
194 displacedPsi2SToJPsiPiPi.clear();
196 std::vector<bool> displacedKx0ToKPi;
200 displacedKx0ToKPi.resize(lKx0ToKPi.size(),
false);
205 for (
auto&&
cand : lBdToJPsiKx0) {
208 if (jpsiMass < 2.9 or jpsiMass > 3.3)
213 if (kx0Mass < 0.77 or kx0Mass > 1.02)
221 displacedKx0ToKPi[kx0.index()] =
true;
225 for (
size_t i = 0;
i < lKx0ToKPi.size();
i++) {
226 auto&&
cand = lKx0ToKPi[
i];
233 auto decayHistos = &
histos.kx0ToKPiPrompt;
234 if (displacedKx0ToKPi[
i]) {
235 decayHistos = &
histos.kx0ToKPiDispl;
242 displacedKx0ToKPi.clear();
244 std::vector<bool> displacedPhiToKK;
248 displacedPhiToKK.resize(lPhiToKK.size(),
false);
253 for (
auto&&
cand : lBsToJPsiPhi) {
256 if (jpsiMass < 2.9 or jpsiMass > 3.3)
261 if (phiMass < 1.005 or phiMass > 1.035)
269 displacedJPsiToMuMu[jpsi.index()] =
true;
270 displacedPhiToKK[
phi.index()] =
true;
274 for (
size_t i = 0;
i < lPhiToKK.size();
i++) {
275 auto&&
cand = lPhiToKK[
i];
282 auto decayHistos = &
histos.phiToKKPrompt;
283 if (displacedPhiToKK[
i]) {
284 decayHistos = &
histos.phiToKKDispl;
291 displacedPhiToKK.clear();
295 for (
auto&&
cand : lBdToJPsiK0s) {
298 if (jpsiMass < 2.9 or jpsiMass > 3.3)
306 displacedJPsiToMuMu[jpsi.index()] =
true;
312 for (
auto&&
cand : lBcToJPsiPi) {
315 if (jpsiMass < 2.9 or jpsiMass > 3.3)
323 displacedJPsiToMuMu[jpsi.index()] =
true;
329 for (
auto&&
cand : lLambdaBToJPsiLambda0) {
332 if (jpsiMass < 2.9 or jpsiMass > 3.3)
340 displacedJPsiToMuMu[jpsi.index()] =
true;
344 for (
size_t i = 0;
i < lOniaToMuMu.size();
i++) {
345 auto&&
cand = lOniaToMuMu[
i];
352 auto decayHistos = &
histos.oniaToMuMuPrompt;
353 if (displacedJPsiToMuMu[
i]) {
354 decayHistos = &
histos.oniaToMuMuDispl;
361 displacedJPsiToMuMu.clear();
365 for (
auto&&
cand : lK0sToPiPi) {
375 for (
auto&&
cand : lLambda0ToPPi) {
398 decayHists.
h_pt = ibook.
book1D(
"h_pt",
histTitle +
"fitted p_{T} [GeV]", 100, 0.00, 200.0);
488 ibook,
run, iSetup,
histos.psi2SToJPsiPiPiPrompt,
"#Psi(2S)",
"J/#psi #pi^{+} #pi^{-}", 100, 3.65, 3.72);
496 ibook,
run, iSetup,
histos.psi2SToJPsiPiPiDispl,
"#Psi(2S)",
"J/#psi #pi^{+} #pi^{-}", 100, 3.65, 3.72);
504 ibook,
run, iSetup,
histos.psi2SToJPsiPiPi,
"#Psi(2S)/X(3872)",
"J/#psi #pi^{+} #pi^{-}", 200, 3.60, 3.80);
586 ibook,
run, iSetup,
histos.lambdaBToJPsiLambda0,
"#Lambda^{0}_{b}",
"J/#psi #Lambda^{0}", 100, 5.00, 6.00);
597 TString
const& componentName)
const {
600 comp.h_pt = ibook.
book1D(componentName +
"_pt",
";p_{T} [GeV]", 200, 0, 20);
601 comp.h_eta = ibook.
book1D(componentName +
"_eta",
";#eta", 200, -3, 3);
603 comp.h_dxy = ibook.
book1D(componentName +
"_dxyBS",
";d_{xy}(BS) [cm]", 200, -3, 3);
604 comp.h_exy = ibook.
book1D(componentName +
"_exy",
";#sigma(d_{xy}(BS)) [cm]", 200, 0, 0.2);
605 comp.h_dz = ibook.
book1D(componentName +
"_dzPV",
";d_{z}(PV) [cm]", 200, -20, 20);
606 comp.h_ez = ibook.
book1D(componentName +
"_ez",
";#sigma(d_{z}(PV)) [cm]", 200, 0, 2);
607 comp.h_chi2 = ibook.
book1D(componentName +
"_chi2",
";#chi^{2}", 200, 0, 20);
730 if (not svtx->isValid()) {
736 if (
cand.hasUserData(
"fitMomentum")) {
742 return abs(pv1.
z() - svtx->z()) <
abs(pv2.z() - svtx->z());
744 if (pvtx ==
pvs.end()) {
751 auto pvtPos = pvtx->position();
752 auto svtPos = svtx->position();
754 math::XYZVector displVect2D(svtPos.x() - pvtPos.x(), svtPos.y() - pvtPos.y(), 0);
755 auto cosAlpha = displVect2D.Dot(momentum) / (displVect2D.Rho() * momentum.rho());
757 auto ct = distXY.
value() * cosAlpha *
mass / momentum.rho();
759 histos.h_pointing->Fill(cosAlpha);
763 histos.h_pt->Fill(momentum.rho());
764 histos.h_eta->Fill(momentum.eta());
765 histos.h_phi->Fill(momentum.phi());
773 if (svtx->chi2() >= 0) {
774 histos.h_vertNormChi2->Fill(svtx->chi2() / svtx->ndof());
785 int startPosition)
const {
788 return startPosition;
795 int startPosition)
const {
799 return startPosition;
806 int startPosition)
const {
809 return startPosition;
816 int startPosition)
const {
819 return startPosition;
826 int startPosition)
const {
830 return startPosition;
837 int startPosition)
const {
842 return startPosition;
849 int startPosition)
const {
854 return startPosition;
861 int startPosition)
const {
867 return startPosition;
874 int startPosition)
const {
880 return startPosition;
887 int startPosition)
const {
893 return startPosition;
900 int startPosition)
const {
905 return startPosition;
912 int startPosition)
const {
918 return startPosition;
925 int startPosition)
const {
929 return startPosition;
950 histos.h_dz->Fill(component.
dz(
pv->position()));
971 bool throwOnMissing)
const {
973 auto trackModeLabel =
"trackMode_" +
name;
975 if (!trackMode
or trackMode->empty()) {
976 if (throwOnMissing) {
977 throw cms::Exception(
"TrackNotFound") <<
"Could not determine track mode from candidate with name " <<
name 978 <<
" with label " << trackModeLabel << std::endl;
985 if (throwOnMissing and not
track) {
986 throw cms::Exception(
"TrackNotFound") <<
"BPHTrackReference could not extract a track as type " << trackMode
987 <<
" from candidate with name " <<
name << std::endl;
998 int startPosition)
const {
1001 return startPosition + 1;
1010 int startPosition)
const {
1014 if (daughLead->pt() < daughSoft->pt()) {
1021 return startPosition + 2;
1047 descriptions.
add(
"HeavyFlavorDQMAnalyzer",
desc);
int fillKx0ToKPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
Analysis-level particle class.
T getParameter(std::string const &) const
int fillLambdaBToJPsiLambda0Components(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
dqm::reco::MonitorElement * h_displ2D
HeavyFlavorDQMAnalyzer(const edm::ParameterSet &)
const reco::Track * getDaughterTrack(pat::CompositeCandidate const &cand, std::string const &name, bool throwOnMissing=true) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > bdToJPsiKx0CandsToken
void initPsi2SToJPsiPiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > lambdaBToJPsiLambda0CandsToken
math::XYZVector Vector
point in the space
double z() const
z coordinate
void initOniaToMuMuComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
dqm::reco::MonitorElement * h_phi
virtual void setCurrentFolder(std::string const &fullpath)
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
int fillComponentHistogramsSinglePart(DecayHists const &, pat::CompositeCandidate const &cand, std::string const &name, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
void fillComponentHistograms(ComponentHists const &histos, reco::Track const &component, reco::BeamSpot const *bs, reco::Vertex const *pv) const
dqm::reco::MonitorElement * h_vertNormChi2
bool allTracksAvailable(pat::CompositeCandidate const &cand) const
constexpr bool isUninitialized() const noexcept
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< pat::CompositeCandidateCollection > lambda0ToPPiCandsToken
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
dqm::reco::MonitorElement * h_vertProb
std::vector< Vertex > VertexCollection
edm::EDGetTokenT< pat::CompositeCandidateCollection > phiToKKCandsToken
reco::Vertex const * fillDecayHistograms(DecayHists const &, pat::CompositeCandidate const &cand, reco::VertexCollection const &pvs) const
void swap(Association< C > &lhs, Association< C > &rhs)
edm::EDGetTokenT< pat::CompositeCandidateCollection > oniaToMuMuCandsToken
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, Histograms const &) const override
void initK0sToPiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
double pt() const
track transverse momentum
void initBcToJPsiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
double ndof() const
number of degrees of freedom of the fit
void initBuToJPsiKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int fillOniaToMuMuComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
void initLambdaBToJPsiLambda0ComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int fillPhiToKKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > buToJPsiKCandsToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dqm::reco::MonitorElement * h_pointing
int fillPsi2SToJPsiPiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< reco::VertexCollection > pvCollectionToken
void initComponentHists(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &, TString const &) const
double dxyError() const
error on dxy
double dzError() const
error on dz
int fillBsToJPsiPhiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
dqm::reco::MonitorElement * h_ct
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
int fillBdToJPsiKx0Components(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > bdToJPsiK0sCandsToken
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
edm::EDGetTokenT< pat::CompositeCandidateCollection > bcToJPsiPiCandsToken
void initBsToJPsiPhiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigset", char *modeFlag=nullptr)
Abs< T >::type abs(const T &t)
float getMass(pat::CompositeCandidate const &cand)
edm::EDGetTokenT< pat::CompositeCandidateCollection > buToPsi2SKCandsToken
double phi() const
azimuthal angle of momentum vector
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
dqm::reco::MonitorElement * h_mass
int fillBcToJPsiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
int fillBuToJPsiKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > kx0ToKPiCandsToken
void initPhiToKKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int fillComponentHistogramsLeadSoft(DecayHists const &, pat::CompositeCandidate const &cand, std::string const &name1, std::string const &name2, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double eta() const
pseudorapidity of momentum vector
~HeavyFlavorDQMAnalyzer() override
int fillBuToPsi2SKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
std::vector< CompositeCandidate > CompositeCandidateCollection
void initLambda0ToPPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
void bookDecayHists(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &, std::string const &, std::string const &, int, float, float, float distanceScaleFactor=1.) const
double chi2() const
chi-squared of the fit
void initKx0ToKPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int fillLambda0ToPPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
int fillBdToJPsiK0sComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double significance() const
void initBdToJPsiKx0ComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
void initBuToPsi2SKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > psi2SToJPsiPiPiCandsToken
int fillK0sToPiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
void throwMissingCollection(const char *requested, const char *missing)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
dqm::reco::MonitorElement * h_eta
dqm::reco::MonitorElement * h_sign2D
void initBdToJPsiK0sComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
dqm::reco::MonitorElement * h_pt
edm::EDGetTokenT< pat::CompositeCandidateCollection > k0sToPiPiCandsToken
edm::EDGetTokenT< pat::CompositeCandidateCollection > bsToJPsiPhiCandsToken
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override