24 :
doAllPlots(iConfig.getParameter<bool>(
"doAllPlots")),
25 doAllSeedPlots(iConfig.getParameter<bool>(
"doSeedParameterHistos")),
26 doTCPlots(iConfig.getParameter<bool>(
"doTrackCandHistos")),
27 doAllTCPlots(iConfig.getParameter<bool>(
"doAllTrackCandHistos")),
28 doPT(iConfig.getParameter<bool>(
"doSeedPTHisto")),
29 doETA(iConfig.getParameter<bool>(
"doSeedETAHisto")),
30 doPHI(iConfig.getParameter<bool>(
"doSeedPHIHisto")),
31 doPHIVsETA(iConfig.getParameter<bool>(
"doSeedPHIVsETAHisto")),
32 doTheta(iConfig.getParameter<bool>(
"doSeedThetaHisto")),
33 doQ(iConfig.getParameter<bool>(
"doSeedQHisto")),
34 doDxy(iConfig.getParameter<bool>(
"doSeedDxyHisto")),
35 doDz(iConfig.getParameter<bool>(
"doSeedDzHisto")),
36 doNRecHits(iConfig.getParameter<bool>(
"doSeedNRecHitsHisto")),
37 doProfPHI(iConfig.getParameter<bool>(
"doSeedNVsPhiProf")),
38 doProfETA(iConfig.getParameter<bool>(
"doSeedNVsEtaProf")),
39 doStopSource(iConfig.getParameter<bool>(
"doStopSource")),
40 doMVAPlots(iConfig.getParameter<bool>(
"doMVAPlots")),
41 doRegionPlots(iConfig.getParameter<bool>(
"doRegionPlots")),
42 doRegionCandidatePlots(iConfig.getParameter<bool>(
"doRegionCandidatePlots")) {}
62 phiBinWidth = PhiBin > 0 ? (PhiMax - PhiMin) / PhiBin : 0.;
70 double ThetaMin = iConfig.
getParameter<
double>(
"ThetaMin");
71 double ThetaMax = iConfig.
getParameter<
double>(
"ThetaMax");
74 double TrackQMin = iConfig.
getParameter<
double>(
"TrackQMin");
75 double TrackQMax = iConfig.
getParameter<
double>(
"TrackQMax");
77 int SeedDxyBin = iConfig.
getParameter<
int>(
"SeedDxyBin");
78 double SeedDxyMin = iConfig.
getParameter<
double>(
"SeedDxyMin");
79 double SeedDxyMax = iConfig.
getParameter<
double>(
"SeedDxyMax");
82 double SeedDzMin = iConfig.
getParameter<
double>(
"SeedDzMin");
83 double SeedDzMax = iConfig.
getParameter<
double>(
"SeedDzMax");
85 int SeedHitBin = iConfig.
getParameter<
int>(
"SeedHitBin");
86 double SeedHitMin = iConfig.
getParameter<
double>(
"SeedHitMin");
87 double SeedHitMax = iConfig.
getParameter<
double>(
"SeedHitMax");
90 double TCDxyMin = iConfig.
getParameter<
double>(
"TCDxyMin");
91 double TCDxyMax = iConfig.
getParameter<
double>(
"TCDxyMax");
94 double TCDzMin = iConfig.
getParameter<
double>(
"TCDzMin");
95 double TCDzMax = iConfig.
getParameter<
double>(
"TCDzMax");
98 double TCHitMin = iConfig.
getParameter<
double>(
"TCHitMin");
99 double TCHitMax = iConfig.
getParameter<
double>(
"TCHitMax");
107 std::vector<std::string> mvaProducers = iConfig.
getParameter<std::vector<std::string> >(
"MVAProducers");
120 histname =
"SeedPt_" + seedProducer.label() +
"_";
127 histname =
"SeedEta_" + seedProducer.label() +
"_";
134 histname =
"SeedPhi_" + seedProducer.label() +
"_";
141 histname =
"SeedPhiVsEta_" + seedProducer.label() +
"_";
143 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
149 histname =
"SeedTheta_" + seedProducer.label() +
"_";
156 histname =
"SeedQ_" + seedProducer.label() +
"_";
163 histname =
"SeedDxy_" + seedProducer.label() +
"_";
170 histname =
"SeedDz_" + seedProducer.label() +
"_";
177 histname =
"NumberOfRecHitsPerSeed_" + seedProducer.label() +
"_";
185 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_" + seedProducer.label() +
"_";
200 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_" + seedProducer.label() +
"_";
216 histname =
"TrackingRegionEta_" + seedProducer.label() +
"_";
223 histname =
"TrackingRegionPhi_" + seedProducer.label() +
"_";
230 histname =
"TrackingRegionPhiVsEta_" + seedProducer.label() +
"_";
232 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
239 auto ptBin = iConfig.
getParameter<
int>(
"RegionCandidatePtBin");
243 histname =
"TrackingRegionCandidatePt_" + seedProducer.label() +
"_";
245 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName, ptBin, ptMin, ptMax);
251 histname =
"TrackingRegionCandidateEta_" + seedProducer.label() +
"_";
259 histname =
"TrackingRegionCandidatePhi_" + seedProducer.label() +
"_";
267 histname =
"TrackingRegionCandidatePhiVsEta_" + seedProducer.label() +
"_";
269 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
279 const auto candsBin = iConfig.
getParameter<
int>(
"SeedCandBin");
280 const auto candsMin = iConfig.
getParameter<
double>(
"SeedCandMin");
281 const auto candsMax = iConfig.
getParameter<
double>(
"SeedCandMax");
283 histname =
"SeedStoppingSource_" + seedProducer.label() +
"_";
285 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName, stopReasonSize, 0., stopReasonSize);
289 histname =
"SeedStoppingSourceVsPhi_" + seedProducer.label() +
"_";
291 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, PhiBin, PhiMin, PhiMax, 2, 0., 2.);
295 histname =
"SeedStoppingSourceVsEta_" + seedProducer.label() +
"_";
297 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, EtaBin, EtaMin, EtaMax, 2, 0., 2.);
301 histname =
"NumberOfTrajCandsPerSeed_" + seedProducer.label() +
"_";
303 ibooker.
book1D(histname + CatagoryName, histname + CatagoryName, candsBin, candsMin, candsMax);
307 histname =
"NumberOfTrajCandsPerSeedVsPhi_" + seedProducer.label() +
"_";
309 histname + CatagoryName, histname + CatagoryName, PhiBin, PhiMin, PhiMax, candsBin, candsMin, candsMax);
313 histname =
"NumberOfTrajCandsPerSeedVsEta_" + seedProducer.label() +
"_";
315 histname + CatagoryName, histname + CatagoryName, EtaBin, EtaMin, EtaMax, candsBin, candsMin, candsMax);
319 histname =
"SeedStoppingSourceVsNumberOfTrajCandsPerSeed_" + seedProducer.label() +
"_";
321 ibooker.
bookProfile(histname + CatagoryName, histname + CatagoryName, candsBin, candsMin, candsMax, 2, 0., 2.);
325 for (
unsigned int i = 0;
i < stopReasonSize; ++
i) {
334 histname =
"StoppingSource_" + seedProducer.label() +
"_";
336 histname + CatagoryName,
histname + CatagoryName, StopReasonNameSize, 0.,
double(StopReasonNameSize));
340 histname =
"StoppingSourceVSeta_" + seedProducer.label() +
"_";
346 histname =
"StoppingSourceVSphi_" + seedProducer.label() +
"_";
352 for (
size_t ibin = 0; ibin < StopReasonNameSize; ibin++) {
363 histname =
"TrackCandPt_" + tcProducer.label() +
"_";
368 histname =
"TrackCandEta_" + tcProducer.label() +
"_";
373 histname =
"TrackCandPhi_" + tcProducer.label() +
"_";
379 histname =
"TrackCandTheta_" + tcProducer.label() +
"_";
386 histname =
"TrackCandQ_" + tcProducer.label() +
"_";
391 histname =
"TrackCandDxy_" + tcProducer.label() +
"_";
396 histname =
"TrackCandDz_" + tcProducer.label() +
"_";
401 histname =
"NumberOfRecHitsPerTrackCand_" + tcProducer.label() +
"_";
407 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_" + tcProducer.label() +
"_";
409 histname + CatagoryName,
histname + CatagoryName, PhiBin, PhiMin, PhiMax, TCHitBin, TCHitMin, TCHitMax,
"s");
413 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_" + tcProducer.label() +
"_";
415 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, TCHitBin, TCHitMin, TCHitMax,
"s");
420 histname =
"TrackCandPhiVsEta_" + tcProducer.label() +
"_";
422 histname + CatagoryName,
histname + CatagoryName, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
427 for (
size_t i = 1,
end = mvaProducers.size();
i <=
end; ++
i) {
436 pfix =
" (not loose-selected)";
438 histname =
"TrackMVA" +
num +
"HP_" + tcProducer.label() +
"_";
442 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
444 histname =
"TrackMVA" +
num +
"HPVsPtProfile_" + tcProducer.label() +
"_";
456 histname =
"TrackMVA" +
num +
"HPVsEtaProfile_" + tcProducer.label() +
"_";
458 histname + CatagoryName,
histname + CatagoryName + pfix2, EtaBin, EtaMin, EtaMax, MVABin, MVAMin, MVAMax));
463 histname =
"TrackMVA" +
num +
"_" + tcProducer.label() +
"_";
466 trackMVAs.back()->setAxisTitle(
"Track selection MVA" +
num, 1);
467 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
469 histname =
"TrackMVA" +
num +
"VsPtProfile_" + tcProducer.label() +
"_";
481 histname =
"TrackMVA" +
num +
"VsEtaProfile_" + tcProducer.label() +
"_";
483 histname + CatagoryName,
histname + CatagoryName + pfix, EtaBin, EtaMin, EtaMax, MVABin, MVAMin, MVAMax));
509 if (!(tsAtClosestApproachSeed.
isValid())) {
510 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
526 double numberOfHits = candidate.
nHits();
528 double dz =
v.z() - (
v.x() * p.
x() +
v.y() * p.
y()) / p.
perp() * p.
z() / p.
perp();
585 if (!(tsAtClosestApproachTrackCand.
isValid())) {
586 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
602 double numberOfHits = candidate.
nRecHits();
605 double dz =
v.z() - (
v.x() * p.
x() +
v.y() * p.
y()) / p.
perp() * p.
z() / p.
perp();
610 double stop = candidate.
stopReason() > max ? double(max - 1) :
static_cast<double>(candidate.
stopReason());
641 bool trackSelected(
unsigned char mask,
unsigned char qual) {
return mask & 1 << qual; }
644 const std::vector<const MVACollection*>& mvaCollections,
645 const std::vector<const QualityMaskCollection*>& qualityMaskCollections) {
648 if (trackCollection.
empty())
652 const auto nmva = mvaCollections.size();
653 for (
const auto mva : mvaCollections) {
655 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " <<
mva->size()
656 <<
" differs from the size of the track collection " <<
ntracks;
660 for (
const auto qual : qualityMaskCollections) {
662 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, "
663 << qual->size() <<
" differs from the size of the track collection " <<
ntracks;
668 for (
size_t iTrack = 0; iTrack <
ntracks; ++iTrack) {
671 bool selectedLoose =
false;
672 bool selectedHP =
false;
674 const auto pt = trackCollection[iTrack].pt();
675 const auto eta = trackCollection[iTrack].eta();
677 for (
size_t iMVA = 0; iMVA < nmva; ++iMVA) {
678 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
679 if (!selectedLoose) {
684 if (iMVA >= 1 && !selectedHP) {
690 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
694 if (selectedLoose && selectedHP)
704 for (
const auto& candidate : regionCandidates) {
705 const auto eta = candidate.eta();
706 const auto phi = candidate.phi();
724 return &(regionLayers.
region());
728 template <
typename T>
733 for (
const auto&
tmp : regions) {
734 if (
const auto* etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion*>(regionPtr(
tmp))) {
735 const auto&
etaRange = etaPhiRegion->etaRange();
736 const auto& phiMargin = etaPhiRegion->phiMargin();
741 const auto phiMin = etaPhiRegion->phiDirection() - phiMargin.left();
742 const auto phiMax = etaPhiRegion->phiDirection() + phiMargin.right();
MonitorElement * NumberOfRecHitsPerTrackCandVsPhiProfile
MonitorElement * TrackCandPt
Log< level::Info, true > LogVerbatim
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 MagneticField &theMF, const TransientTrackingRecHitBuilder &theTTRHBuilder)
TrackCharge charge() const
std::vector< MonitorElement * > trackMVAsVsPtProfile
SeedStopReason stopReason() const
constexpr T reduceRange(T x)
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * TrackCandDz
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Geom::Theta< T > theta() const
MonitorElement * stoppingSourceVSphi
GlobalPoint globalPosition() const
std::string to_string(const V &value)
MonitorElement * TrackCandPhi
static const std::string StopReasonName[]
void initHisto(DQMStore::IBooker &ibooker, const edm::ParameterSet &)
Log< level::Error, false > LogError
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 * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * TrackCandDxy
const bool doAllSeedPlots
FreeTrajectoryState const * freeState(bool withErrors=true) const
Cos< T >::type cos(const T &t)
MonitorElement * TrackCandEta
const double EtaMin[kNumberCalorimeter]
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)
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
std::vector< MonitorElement * > trackMVAsHPVsEtaProfile
MonitorElement * TrackingRegionPhiVsEta
GlobalPoint position() const
const bool doRegionCandidatePlots
PTrajectoryStateOnDet const & startingState() const
MonitorElement * stoppingSourceVSeta
MonitorElement * TrackingRegionEta
std::vector< MonitorElement * > trackMVAsHPVsPtProfile
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
MonitorElement * TrackCandTheta
MonitorElement * TrackCandQ
MonitorElement * SeedPhiVsEta
unsigned int nHits() const
MonitorElement * TrackingRegionCandidateEta
GlobalVector globalMomentum() const
MonitorElement * seedStoppingSourceVsEta
const TrackingRegion & region() const
MonitorElement * TrackingRegionCandidatePhi
double y0() const
y coordinate
MonitorElement * seedStoppingSourceVsNumberOfTrajCandsPerSeed
MonitorElement * NumberOfRecHitsPerSeedVsEtaProfile
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
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)