49 #include "TLorentzVector.h" 71 template <
typename T,
typename... Args>
173 iConfig.getParameter<
edm::
InputTag>(
"vertexCompositeCandidates"))),
178 forceSCAL_(iConfig.getParameter<
bool>(
"forceSCAL")),
179 pvNDOF_(iConfig.getParameter<
int>(
"pvNDOF")) {
233 template <
typename T,
typename... Args>
240 mebinning.
nbins =
pset.getParameter<int32_t>(
"nbins");
241 mebinning.
xmin =
pset.getParameter<
double>(
"xmin");
242 mebinning.
xmax =
pset.getParameter<
double>(
"xmax");
254 return book<TH2F>(
name.c_str(),
255 title_w_axes.c_str(),
267 return book<TProfile>(
278 std::vector<const reco::Track*> myTracks;
283 if (vccHandle->empty())
289 myTracks.emplace_back(&
track);
293 if (myTracks.size() != 2)
296 for (
const auto&
v0 : v0s) {
300 for (
size_t i = 0;
i <
v0.numberOfDaughters(); ++
i) {
304 if (chargedDaughter) {
315 const auto& tplus = myTracks[0]->charge() > 0 ? myTracks[0] : myTracks[1];
316 const auto& tminus = myTracks[0]->charge() < 0 ? myTracks[0] : myTracks[1];
318 TLorentzVector p4_tplus(tplus->px(), tplus->py(), tplus->pz(),
sqrt((tplus->p() * tplus->p()) +
piMass2));
319 TLorentzVector p4_tminus(tminus->px(), tminus->py(), tminus->pz(),
sqrt((tminus->p() * tminus->p()) +
piMass2));
321 const auto& V0p4 = p4_tplus + p4_tminus;
322 float track_invMass = V0p4.M();
336 LumiScalersCollection::const_iterator scalit =
lumiScalers->begin();
337 lumi = scalit->instantLumi();
350 bs = &(*beamspotHandle);
356 pv = &pvHandle->front();
359 pv->tracksSize() == 0
364 for (
const auto&
v : *pvHandle) {
376 float nLS =
static_cast<float>(
iEvent.id().luminosityBlock());
380 int n = (v0Handle.
isValid() ? v0Handle->size() : -1);
391 for (
const auto&
v0 : v0s) {
395 float eta =
v0.eta();
396 float phi =
v0.phi();
397 int pdgID =
v0.pdgId();
398 float chi2oNDF =
v0.vertexNormalizedChi2();
405 -1 * ((
bs->position().y() -
v0.vy()) + (
v0.vz() -
bs->position().z()) *
bs->dydz()),
407 float lxy = (
pv ==
nullptr ? -9. : displacementFromPV.
perp());
408 float lxyWRTbs = (
bs ==
nullptr ? -9. : displacementFromBS.
perp());
429 float PDGmass = -9999.;
446 float delta = (PDGmass > 0. ? (
mass - PDGmass) / PDGmass : -9.);
467 N_binning.
nbins = 15;
468 N_binning.xmin = -0.5;
469 N_binning.xmax = 14.5;
475 phi_binning.
nbins = 34;
476 phi_binning.
xmin = -3.2;
477 phi_binning.
xmax = 3.2;
488 delta_binning.
nbins = 150;
489 delta_binning.
xmin = -0.15;
490 delta_binning.
xmax = 0.15;
493 "v0_deltaMass_vs_pt",
"deltaMass vs pt",
"p_{T} [GeV]",
"m-m_{PDG}/m_{DPG}",
pt_binning_, delta_binning);
495 bookProfile(
"v0_deltaMass_vs_eta",
"deltaMass vs eta",
"#eta",
"m-m_{PDG}/m_{DPG}",
eta_binning_, delta_binning);
498 "v0_Lxy_vs_deltaMass",
"L_{xy} vs deltaMass",
"m-m_{PDG}/m_{DPG}",
"L_{xy} [cm]", delta_binning,
Lxy_binning_);
504 bx_binning.
nbins = 3564;
505 bx_binning.
xmin = 0.5;
506 bx_binning.
xmax = 3564.5;
512 bookProfile(
"v0_deltaMass_vs_BX",
"deltaMass vs BX",
"BX",
"m-m_{PDG}/m_{DPG}", bx_binning, delta_binning);
525 "inst. lumi x10^{30} [Hz cm^{-2}]",
532 "inst. lumi x10^{30} [Hz cm^{-2}]",
542 "v0_deltaMass_vs_PU",
"deltaMass vs PU",
"# good PV",
"m-m_{PDG}/m_{DPG}",
pu_binning_, delta_binning);
557 desc.add<
bool>(
"forceSCAL",
false);
558 desc.add<
int>(
"pvNDOF", 4);
564 psd1.
add<
int>(
"nbins", 3700);
565 psd1.
add<
double>(
"xmin", 0.);
566 psd1.
add<
double>(
"xmax", 14000.);
571 psd2.
add<
int>(
"nbins", 100);
572 psd2.
add<
double>(
"xmin", 0.400);
573 psd2.
add<
double>(
"xmax", 0.600);
578 psd3.
add<
int>(
"nbins", 100);
579 psd3.
add<
double>(
"xmin", 0.);
580 psd3.
add<
double>(
"xmax", 50.);
585 psd4.
add<
int>(
"nbins", 60);
586 psd4.
add<
double>(
"xmin", -3.);
587 psd4.
add<
double>(
"xmax", 3.);
592 psd5.
add<
int>(
"nbins", 350);
593 psd5.
add<
double>(
"xmin", 0.);
594 psd5.
add<
double>(
"xmax", 70.);
599 psd6.
add<
int>(
"nbins", 100);
600 psd6.
add<
double>(
"xmin", 0.);
601 psd6.
add<
double>(
"xmax", 30.);
606 psd7.
add<
int>(
"nbins", 100);
607 psd7.
add<
double>(
"xmin", -0.5);
608 psd7.
add<
double>(
"xmax", 99.5);
613 psd8.
add<
int>(
"nbins", 2000);
614 psd8.
add<
double>(
"xmin", 0.);
615 psd8.
add<
double>(
"xmax", 2000.);
void getHistoPSet(edm::ParameterSet pset, MEbinning &mebinning)
static const std::string kSharedResource
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
TProfile * v0_mass_vs_lumi_
T getParameter(std::string const &) const
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
T const * product() const
Class to contain the online luminosity from soft FED 1022.
Global3DPoint GlobalPoint
TProfile * v0_Lxy_vs_eta_
std::vector< Track > TrackCollection
collection of Tracks
TProfile * v0_deltaMass_vs_pt_
bool isNonnull() const
Checks for non-null.
TProfile * v0_deltaMass_vs_eta_
TProfile * v0_mass_vs_BX_
const edm::EDGetTokenT< reco::VertexCollection > pvToken_
float instLumi() const
Return the luminosity for the current nibble.
std::vector< Vertex > VertexCollection
const edm::EDGetTokenT< TrackCollection > tracksToken_
TProfile * bookProfile(std::string name, std::string title, std::string xaxis, std::string yaxis, MEbinning xbinning, MEbinning ybinning)
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
TProfile * v0_Lxy_vs_lumi_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::Service< TFileService > fs_
const edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > vccToken_
T * book(const Args &... args) const
MEbinning chi2oNDF_binning_
TProfile * v0_mass_vs_eta_
reco::TrackRef track() const override
reference to a track
TH1F * bookHisto1D(std::string name, std::string title, std::string xaxis, std::string yaxis, MEbinning binning)
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
TProfile * v0_mass_vs_pt_
#define DEFINE_FWK_MODULE(type)
~TkAlV0sAnalyzer() override=default
ParameterDescriptionBase * add(U const &iLabel, T const &value)
TH2F * bookHisto2D(std::string name, std::string title, std::string xaxis, std::string yaxis, MEbinning xbinning, MEbinning ybinning)
TProfile * v0_deltaMass_vs_lumi_
TProfile * v0_mass_vs_PU_
static constexpr double piMass2
TProfile * v0_deltaMass_vs_BX_
const edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
TProfile * v0_Lxy_vs_deltaMass_
TkAlV0sAnalyzer(const edm::ParameterSet &)
T * make(const Args &...args) const
make new ROOT object
std::vector< LumiScalers > LumiScalersCollection
void fillMonitoringHistos(const edm::Event &iEvent)
TProfile * v0_deltaMass_vs_PU_
const edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)