27 doAllSeedPlots(iConfig.getParameter<
bool>(
"doSeedParameterHistos")),
28 doTCPlots(iConfig.getParameter<
bool>(
"doTrackCandHistos")),
29 doAllTCPlots(iConfig.getParameter<
bool>(
"doAllTrackCandHistos")),
30 doPT(iConfig.getParameter<
bool>(
"doSeedPTHisto")),
31 doETA(iConfig.getParameter<
bool>(
"doSeedETAHisto")),
32 doPHI(iConfig.getParameter<
bool>(
"doSeedPHIHisto")),
33 doPHIVsETA(iConfig.getParameter<
bool>(
"doSeedPHIVsETAHisto")),
34 doTheta(iConfig.getParameter<
bool>(
"doSeedThetaHisto")),
35 doQ(iConfig.getParameter<
bool>(
"doSeedQHisto")),
36 doDxy(iConfig.getParameter<
bool>(
"doSeedDxyHisto")),
37 doDz(iConfig.getParameter<
bool>(
"doSeedDzHisto")),
38 doNRecHits(iConfig.getParameter<
bool>(
"doSeedNRecHitsHisto")),
39 doProfPHI(iConfig.getParameter<
bool>(
"doSeedNVsPhiProf")),
40 doProfETA(iConfig.getParameter<
bool>(
"doSeedNVsEtaProf")),
109 std::vector<std::string> mvaProducers = iConfig.
getParameter<std::vector<std::string> >(
"MVAProducers");
122 histname =
"SeedPt_" + seedProducer.label() +
"_";
129 histname =
"SeedEta_" + seedProducer.label() +
"_";
136 histname =
"SeedPhi_" + seedProducer.label() +
"_";
143 histname =
"SeedPhiVsEta_" + seedProducer.label() +
"_";
145 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
151 histname =
"SeedTheta_" + seedProducer.label() +
"_";
158 histname =
"SeedQ_" + seedProducer.label() +
"_";
165 histname =
"SeedDxy_" + seedProducer.label() +
"_";
172 histname =
"SeedDz_" + seedProducer.label() +
"_";
179 histname =
"NumberOfRecHitsPerSeed_" + seedProducer.label() +
"_";
187 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_" + seedProducer.label() +
"_";
202 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_" + seedProducer.label() +
"_";
218 histname =
"TrackingRegionEta_" + seedProducer.label() +
"_";
225 histname =
"TrackingRegionPhi_" + seedProducer.label() +
"_";
232 histname =
"TrackingRegionPhiVsEta_" + seedProducer.label() +
"_";
234 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
245 histname =
"TrackingRegionCandidatePt_" + seedProducer.label() +
"_";
247 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName,
ptBin, ptMin, ptMax);
253 histname =
"TrackingRegionCandidateEta_" + seedProducer.label() +
"_";
261 histname =
"TrackingRegionCandidatePhi_" + seedProducer.label() +
"_";
269 histname =
"TrackingRegionCandidatePhiVsEta_" + seedProducer.label() +
"_";
271 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
281 const auto candsBin = iConfig.
getParameter<
int>(
"SeedCandBin");
282 const auto candsMin = iConfig.
getParameter<
double>(
"SeedCandMin");
283 const auto candsMax = iConfig.
getParameter<
double>(
"SeedCandMax");
285 histname =
"SeedStoppingSource_" + seedProducer.label() +
"_";
287 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName, stopReasonSize, 0., stopReasonSize);
291 histname =
"SeedStoppingSourceVsPhi_" + seedProducer.label() +
"_";
293 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, PhiBin, PhiMin, PhiMax, 2, 0., 2.);
297 histname =
"SeedStoppingSourceVsEta_" + seedProducer.label() +
"_";
299 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, EtaBin, EtaMin, EtaMax, 2, 0., 2.);
303 histname =
"NumberOfTrajCandsPerSeed_" + seedProducer.label() +
"_";
305 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName, candsBin, candsMin, candsMax);
309 histname =
"NumberOfTrajCandsPerSeedVsPhi_" + seedProducer.label() +
"_";
311 histname + CatagoryName, histname + CatagoryName, PhiBin, PhiMin, PhiMax, candsBin, candsMin, candsMax);
315 histname =
"NumberOfTrajCandsPerSeedVsEta_" + seedProducer.label() +
"_";
317 histname + CatagoryName, histname + CatagoryName, EtaBin, EtaMin, EtaMax, candsBin, candsMin, candsMax);
321 histname =
"SeedStoppingSourceVsNumberOfTrajCandsPerSeed_" + seedProducer.label() +
"_";
323 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, candsBin, candsMin, candsMax, 2, 0., 2.);
327 for (
unsigned int i = 0;
i < stopReasonSize; ++
i) {
336 histname =
"StoppingSource_" + seedProducer.label() +
"_";
338 histname + CatagoryName,
histname + CatagoryName, StopReasonNameSize, 0.,
double(StopReasonNameSize));
342 histname =
"StoppingSourceVSeta_" + seedProducer.label() +
"_";
348 histname =
"StoppingSourceVSphi_" + seedProducer.label() +
"_";
354 for (
size_t ibin = 0; ibin < StopReasonNameSize; ibin++) {
365 histname =
"TrackCandPt_" + tcProducer.label() +
"_";
370 histname =
"TrackCandEta_" + tcProducer.label() +
"_";
375 histname =
"TrackCandPhi_" + tcProducer.label() +
"_";
381 histname =
"TrackCandTheta_" + tcProducer.label() +
"_";
388 histname =
"TrackCandQ_" + tcProducer.label() +
"_";
393 histname =
"TrackCandDxy_" + tcProducer.label() +
"_";
398 histname =
"TrackCandDz_" + tcProducer.label() +
"_";
403 histname =
"NumberOfRecHitsPerTrackCand_" + tcProducer.label() +
"_";
409 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_" + tcProducer.label() +
"_";
411 histname + CatagoryName,
histname + CatagoryName, PhiBin, PhiMin, PhiMax, TCHitBin, TCHitMin, TCHitMax,
"s");
415 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_" + tcProducer.label() +
"_";
417 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, TCHitBin, TCHitMin, TCHitMax,
"s");
422 histname =
"TrackCandPhiVsEta_" + tcProducer.label() +
"_";
424 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
429 for (
size_t i = 1,
end = mvaProducers.size();
i <=
end; ++
i) {
430 auto num = std::to_string(
i);
438 pfix =
" (not loose-selected)";
440 histname =
"TrackMVA" +
num +
"HP_" + tcProducer.label() +
"_";
444 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
446 histname =
"TrackMVA" +
num +
"HPVsPtProfile_" + tcProducer.label() +
"_";
458 histname =
"TrackMVA" +
num +
"HPVsEtaProfile_" + tcProducer.label() +
"_";
460 histname + CatagoryName,
histname + CatagoryName + pfix2, EtaBin, EtaMin, EtaMax, MVABin, MVAMin, MVAMax));
465 histname =
"TrackMVA" +
num +
"_" + tcProducer.label() +
"_";
468 trackMVAs.back()->setAxisTitle(
"Track selection MVA" +
num, 1);
469 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
471 histname =
"TrackMVA" +
num +
"VsPtProfile_" + tcProducer.label() +
"_";
483 histname =
"TrackMVA" +
num +
"VsEtaProfile_" + tcProducer.label() +
"_";
485 histname + CatagoryName,
histname + CatagoryName + pfix, EtaBin, EtaMin, EtaMax, MVABin, MVAMin, MVAMax));
511 if (!(tsAtClosestApproachSeed.isValid())) {
512 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
515 GlobalPoint v0 = tsAtClosestApproachSeed.trackStateAtPCA().position();
516 GlobalVector p = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
528 double numberOfHits = candidate.
recHits().second - candidate.
recHits().first;
530 double dz =
v.z() - (
v.x() * p.
x() +
v.y() * p.
y()) / p.
perp() * p.
z() / p.
perp();
587 if (!(tsAtClosestApproachTrackCand.isValid())) {
588 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
591 GlobalPoint v0 = tsAtClosestApproachTrackCand.trackStateAtPCA().position();
592 GlobalVector p = tsAtClosestApproachTrackCand.trackStateAtPCA().momentum();
604 double numberOfHits = candidate.
recHits().second - candidate.
recHits().first;
607 double dz =
v.z() - (
v.x() * p.
x() +
v.y() * p.
y()) / p.
perp() * p.
z() / p.
perp();
612 double stop = candidate.
stopReason() > max ? double(max - 1) :
static_cast<double>(candidate.
stopReason());
643 bool trackSelected(
unsigned char mask,
unsigned char qual) {
return mask & 1 << qual; }
646 const std::vector<const MVACollection*>& mvaCollections,
647 const std::vector<const QualityMaskCollection*>& qualityMaskCollections) {
650 if (trackCollection.
empty())
653 const auto ntracks = trackCollection.
size();
654 const auto nmva = mvaCollections.size();
655 for (
const auto mva : mvaCollections) {
656 if (
mva->size() != ntracks) {
657 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " <<
mva->size()
658 <<
" differs from the size of the track collection " << ntracks;
662 for (
const auto qual : qualityMaskCollections) {
663 if (qual->size() != ntracks) {
664 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, " 665 << qual->size() <<
" differs from the size of the track collection " << ntracks;
670 for (
size_t iTrack = 0; iTrack < ntracks; ++iTrack) {
673 bool selectedLoose =
false;
674 bool selectedHP =
false;
676 const auto pt = trackCollection[iTrack].pt();
677 const auto eta = trackCollection[iTrack].eta();
679 for (
size_t iMVA = 0; iMVA < nmva; ++iMVA) {
680 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
681 if (!selectedLoose) {
686 if (iMVA >= 1 && !selectedHP) {
692 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
696 if (selectedLoose && selectedHP)
706 for (
const auto& candidate : regionCandidates) {
707 const auto eta = candidate.eta();
708 const auto phi = candidate.phi();
726 return &(regionLayers.
region());
730 template <
typename T>
735 for (
const auto&
tmp : regions) {
736 if (
const auto* etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion*>(regionPtr(
tmp))) {
737 const auto&
etaRange = etaPhiRegion->etaRange();
738 const auto& phiMargin = etaPhiRegion->phiMargin();
743 const auto phiMin = etaPhiRegion->phiDirection() - phiMargin.left();
744 const auto phiMax = etaPhiRegion->phiDirection() + phiMargin.right();
MonitorElement * NumberOfRecHitsPerTrackCandVsPhiProfile
MonitorElement * TrackCandPt
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
MonitorElement * seedStoppingSourceVsPhi
double z0() const
z coordinate
MonitorElement * numberOfTrajCandsPerSeed
MonitorElement * TrackingRegionCandidatePhiVsEta
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrajectorySeed &seed, const SeedStopInfo &stopInfo, const reco::BeamSpot &bs, const edm::ESHandle< MagneticField > &theMF, const edm::ESHandle< TransientTrackingRecHitBuilder > &theTTRHBuilder)
TrackCharge charge() const
std::vector< MonitorElement * > trackMVAsVsPtProfile
SeedStopReason stopReason() const
constexpr T reduceRange(T x)
MonitorElement * TrackCandDz
void setCurrentFolder(std::string const &fullpath)
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Geom::Theta< T > theta() const
MonitorElement * stoppingSourceVSphi
GlobalPoint globalPosition() const
MonitorElement * TrackCandPhi
static const std::string StopReasonName[]
void initHisto(DQMStore::IBooker &ibooker, const edm::ParameterSet &)
std::vector< MonitorElement * > trackMVAs
MonitorElement * TrackCandPhiVsEta
MonitorElement * TrackingRegionCandidatePt
unsigned short candidatesPerSeed() const
MonitorElement * SeedTheta
static const std::string SeedStopReasonName[]
Geom::Theta< T > theta() const
MonitorElement * NumberOfRecHitsPerTrackCandVsEtaProfile
MonitorElement * stoppingSource
PTrajectoryStateOnDet const & trajectoryStateOnDet() const
MonitorElement * NumberOfRecHitsPerSeed
MonitorElement * NumberOfRecHitsPerSeedVsPhiProfile
void analyzeRegions(const T ®ions)
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * TrackCandDxy
const bool doAllSeedPlots
FreeTrajectoryState const * freeState(bool withErrors=true) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Cos< T >::type cos(const T &t)
MonitorElement * TrackCandEta
std::vector< MonitorElement * > trackMVAsHP
MonitorElement * numberOfTrajCandsPerSeedVsPhi
MonitorElement * TrackingRegionPhi
unsigned char stopReasonUC() const
TrackBuildingAnalyzer(const edm::ParameterSet &)
std::vector< MonitorElement * > trackMVAsVsEtaProfile
MonitorElement * numberOfTrajCandsPerSeedVsEta
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::vector< MonitorElement * > trackMVAsHPVsEtaProfile
MonitorElement * TrackingRegionPhiVsEta
const bool doRegionCandidatePlots
PTrajectoryStateOnDet const & startingState() const
MonitorElement * stoppingSourceVSeta
MonitorElement * TrackingRegionEta
std::vector< MonitorElement * > trackMVAsHPVsPtProfile
MonitorElement * TrackCandTheta
MonitorElement * TrackCandQ
MonitorElement * SeedPhiVsEta
MonitorElement * TrackingRegionCandidateEta
GlobalVector globalMomentum() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
MonitorElement * seedStoppingSourceVsEta
const TrackingRegion & region() const
MonitorElement * TrackingRegionCandidatePhi
double y0() const
y coordinate
MonitorElement * seedStoppingSourceVsNumberOfTrajCandsPerSeed
MonitorElement * NumberOfRecHitsPerSeedVsEtaProfile
T const * product() const
MonitorElement * NumberOfRecHitsPerTrackCand
uint8_t stopReason() const
MonitorElement * seedStoppingSource
double x0() const
x coordinate
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)