26 doAllPlots( iConfig.getParameter<
bool>(
"doAllPlots")),
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")),
41 doStopSource( iConfig.getParameter<
bool>(
"doStopSource")),
43 doRegionPlots( iConfig.getParameter<
bool>(
"doRegionPlots")),
44 doRegionCandidatePlots( iConfig.getParameter<
bool>(
"doRegionCandidatePlots"))
61 int TrackPtBin = iConfig.
getParameter<
int>(
"TrackPtBin");
62 double TrackPtMin = iConfig.
getParameter<
double>(
"TrackPtMin");
63 double TrackPtMax = iConfig.
getParameter<
double>(
"TrackPtMax");
68 phiBinWidth = PhiBin > 0 ? (PhiMax-PhiMin)/PhiBin : 0.;
76 double ThetaMin = iConfig.
getParameter<
double>(
"ThetaMin");
77 double ThetaMax = iConfig.
getParameter<
double>(
"ThetaMax");
80 double TrackQMin = iConfig.
getParameter<
double>(
"TrackQMin");
81 double TrackQMax = iConfig.
getParameter<
double>(
"TrackQMax");
83 int SeedDxyBin = iConfig.
getParameter<
int>(
"SeedDxyBin");
84 double SeedDxyMin = iConfig.
getParameter<
double>(
"SeedDxyMin");
85 double SeedDxyMax = iConfig.
getParameter<
double>(
"SeedDxyMax");
88 double SeedDzMin = iConfig.
getParameter<
double>(
"SeedDzMin");
89 double SeedDzMax = iConfig.
getParameter<
double>(
"SeedDzMax");
91 int SeedHitBin = iConfig.
getParameter<
int>(
"SeedHitBin");
92 double SeedHitMin = iConfig.
getParameter<
double>(
"SeedHitMin");
93 double SeedHitMax = iConfig.
getParameter<
double>(
"SeedHitMax");
96 double TCDxyMin = iConfig.
getParameter<
double>(
"TCDxyMin");
97 double TCDxyMax = iConfig.
getParameter<
double>(
"TCDxyMax");
100 double TCDzMin = iConfig.
getParameter<
double>(
"TCDzMin");
101 double TCDzMax = iConfig.
getParameter<
double>(
"TCDzMax");
104 double TCHitMin = iConfig.
getParameter<
double>(
"TCHitMin");
105 double TCHitMax = iConfig.
getParameter<
double>(
"TCHitMax");
114 std::vector<std::string> mvaProducers = iConfig.
getParameter<std::vector<std::string> >(
"MVAProducers");
127 histname =
"SeedPt_"+seedProducer.label() +
"_";
134 histname =
"SeedEta_"+seedProducer.label() +
"_";
141 histname =
"SeedPhi_"+seedProducer.label() +
"_";
148 histname =
"SeedPhiVsEta_"+seedProducer.label() +
"_";
155 histname =
"SeedTheta_"+seedProducer.label() +
"_";
162 histname =
"SeedQ_"+seedProducer.label() +
"_";
169 histname =
"SeedDxy_"+seedProducer.label() +
"_";
176 histname =
"SeedDz_"+seedProducer.label() +
"_";
183 histname =
"NumberOfRecHitsPerSeed_"+seedProducer.label() +
"_";
190 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_"+seedProducer.label() +
"_";
197 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_"+seedProducer.label() +
"_";
205 histname =
"TrackingRegionEta_"+seedProducer.label() +
"_";
212 histname =
"TrackingRegionPhi_"+seedProducer.label() +
"_";
219 histname =
"TrackingRegionPhiVsEta_"+seedProducer.label() +
"_";
231 histname =
"TrackingRegionCandidatePt_"+seedProducer.label() +
"_";
238 histname =
"TrackingRegionCandidateEta_"+seedProducer.label() +
"_";
245 histname =
"TrackingRegionCandidatePhi_"+seedProducer.label() +
"_";
252 histname =
"TrackingRegionCandidatePhiVsEta_"+seedProducer.label() +
"_";
263 const auto candsBin = iConfig.
getParameter<
int>(
"SeedCandBin");
264 const auto candsMin = iConfig.
getParameter<
double>(
"SeedCandMin");
265 const auto candsMax = iConfig.
getParameter<
double>(
"SeedCandMax");
267 histname =
"SeedStoppingSource_"+seedProducer.label() +
"_";
268 seedStoppingSource = ibooker.
book1D(histname+CatagoryName, histname+CatagoryName, stopReasonSize, 0., stopReasonSize);
272 histname =
"SeedStoppingSourceVsPhi_"+seedProducer.label() +
"_";
277 histname =
"SeedStoppingSourceVsEta_"+seedProducer.label() +
"_";
282 histname =
"NumberOfTrajCandsPerSeed_"+seedProducer.label() +
"_";
287 histname =
"NumberOfTrajCandsPerSeedVsPhi_"+seedProducer.label() +
"_";
292 histname =
"NumberOfTrajCandsPerSeedVsEta_"+seedProducer.label() +
"_";
297 histname =
"SeedStoppingSourceVsNumberOfTrajCandsPerSeed_"+seedProducer.label() +
"_";
302 for(
unsigned int i=0;
i<stopReasonSize; ++
i) {
311 histname =
"StoppingSource_"+seedProducer.label() +
"_";
315 0.,
double(StopReasonNameSize));
319 histname =
"StoppingSourceVSeta_"+seedProducer.label() +
"_";
330 histname =
"StoppingSourceVSphi_"+seedProducer.label() +
"_";
341 for (
size_t ibin=0; ibin<StopReasonNameSize; ibin++) {
355 histname =
"TrackCandPt_"+tcProducer.label() +
"_";
360 histname =
"TrackCandEta_"+tcProducer.label() +
"_";
365 histname =
"TrackCandPhi_"+tcProducer.label() +
"_";
371 histname =
"TrackCandTheta_"+tcProducer.label() +
"_";
378 histname =
"TrackCandQ_"+tcProducer.label() +
"_";
383 histname =
"TrackCandDxy_"+tcProducer.label() +
"_";
388 histname =
"TrackCandDz_"+tcProducer.label() +
"_";
393 histname =
"NumberOfRecHitsPerTrackCand_"+tcProducer.label() +
"_";
398 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_"+tcProducer.label() +
"_";
403 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_"+tcProducer.label() +
"_";
409 histname =
"TrackCandPhiVsEta_"+tcProducer.label() +
"_";
415 for(
size_t i=1,
end=mvaProducers.size();
i<=
end; ++
i) {
416 auto num = std::to_string(
i);
425 pfix =
" (not loose-selected)";
427 histname =
"TrackMVA"+
num+
"HP_"+tcProducer.label() +
"_";
430 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
432 histname =
"TrackMVA"+
num+
"HPVsPtProfile_"+tcProducer.label() +
"_";
437 histname =
"TrackMVA"+
num+
"HPVsEtaProfile_"+tcProducer.label() +
"_";
443 histname =
"TrackMVA"+
num+
"_"+tcProducer.label() +
"_";
445 trackMVAs.back()->setAxisTitle(
"Track selection MVA"+
num, 1);
446 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
448 histname =
"TrackMVA"+
num+
"VsPtProfile_"+tcProducer.label() +
"_";
453 histname =
"TrackMVA"+
num+
"VsEtaProfile_"+tcProducer.label() +
"_";
483 if(!(tsAtClosestApproachSeed.isValid())) {
484 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
487 GlobalPoint v0 = tsAtClosestApproachSeed.trackStateAtPCA().position();
488 GlobalVector p = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
500 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
550 if(!(tsAtClosestApproachTrackCand.isValid())) {
551 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
554 GlobalPoint v0 = tsAtClosestApproachTrackCand.trackStateAtPCA().position();
555 GlobalVector p = tsAtClosestApproachTrackCand.trackStateAtPCA().momentum();
567 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
575 double stop = candidate.
stopReason() > max ? double(max-1) :
static_cast<double>(candidate.
stopReason());
599 bool trackSelected(
unsigned char mask,
unsigned char qual) {
600 return mask & 1<<qual;
604 const std::vector<const MVACollection *>& mvaCollections,
605 const std::vector<const QualityMaskCollection *>& qualityMaskCollections) {
608 if(trackCollection.
empty())
611 const auto ntracks = trackCollection.
size();
612 const auto nmva = mvaCollections.size();
613 for(
const auto mva: mvaCollections) {
614 if(
mva->size() != ntracks) {
615 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " <<
mva->size() <<
" differs from the size of the track collection " << ntracks;
619 for(
const auto qual: qualityMaskCollections) {
620 if(qual->size() != ntracks) {
621 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, " << qual->size() <<
" differs from the size of the track collection " << ntracks;
627 for(
size_t iTrack=0; iTrack<ntracks; ++iTrack) {
630 bool selectedLoose =
false;
631 bool selectedHP =
false;
633 const auto pt = trackCollection[iTrack].pt();
634 const auto eta = trackCollection[iTrack].eta();
636 for(
size_t iMVA=0; iMVA<nmva; ++iMVA) {
637 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
643 if(iMVA >= 1 && !selectedHP) {
649 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
653 if(selectedLoose && selectedHP)
663 for(
const auto& candidate: regionCandidates) {
664 const auto eta = candidate.eta();
665 const auto phi = candidate.phi();
685 return &(regionLayers.
region());
689 template <
typename T>
694 for(
const auto&
tmp: regions) {
695 if(
const auto *etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion *>(regionPtr(
tmp))) {
696 const auto&
etaRange = etaPhiRegion->etaRange();
697 const auto& phiMargin = etaPhiRegion->phiMargin();
702 const auto phiMin = etaPhiRegion->phiDirection() - phiMargin.left();
703 const auto phiMax = etaPhiRegion->phiDirection() + phiMargin.right();
MonitorElement * NumberOfRecHitsPerTrackCandVsPhiProfile
MonitorElement * TrackCandPt
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
SeedStopReason stopReason() const
constexpr T reduceRange(T x)
MonitorElement * bookProfile(Args &&...args)
std::vector< MonitorElement * > trackMVAsHPVsEtaProfile
MonitorElement * TrackCandDz
std::vector< MonitorElement * > trackMVAsVsPtProfile
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Geom::Theta< T > theta() const
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)
MonitorElement * stoppingSourceVSphi
GlobalPoint globalPosition() const
std::vector< MonitorElement * > trackMVAsVsEtaProfile
const double EtaMax[kNumberCalorimeter]
MonitorElement * TrackCandPhi
static const std::string StopReasonName[]
void initHisto(DQMStore::IBooker &ibooker, const edm::ParameterSet &)
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 setCurrentFolder(std::string const &fullpath)
void analyzeRegions(const T ®ions)
MonitorElement * TrackCandDxy
const bool doAllSeedPlots
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< MonitorElement * > trackMVAsHP
Cos< T >::type cos(const T &t)
MonitorElement * TrackCandEta
MonitorElement * book1D(Args &&...args)
const double EtaMin[kNumberCalorimeter]
MonitorElement * numberOfTrajCandsPerSeedVsPhi
MonitorElement * TrackingRegionPhi
unsigned char stopReasonUC() const
TrackBuildingAnalyzer(const edm::ParameterSet &)
MonitorElement * numberOfTrajCandsPerSeedVsEta
std::vector< MonitorElement * > trackMVAs
MonitorElement * TrackingRegionPhiVsEta
const bool doRegionCandidatePlots
PTrajectoryStateOnDet const & startingState() const
MonitorElement * stoppingSourceVSeta
MonitorElement * book2D(Args &&...args)
MonitorElement * TrackingRegionEta
MonitorElement * TrackCandTheta
MonitorElement * TrackCandQ
MonitorElement * SeedPhiVsEta
std::vector< std::vector< double > > tmp
std::vector< MonitorElement * > trackMVAsHPVsPtProfile
MonitorElement * TrackingRegionCandidateEta
GlobalVector globalMomentum() const
MonitorElement * seedStoppingSourceVsEta
const TrackingRegion & region() const
MonitorElement * TrackingRegionCandidatePhi
double y0() const
y coordinate
MonitorElement * seedStoppingSourceVsNumberOfTrajCandsPerSeed
MonitorElement * NumberOfRecHitsPerSeedVsEtaProfile
int getNbinsX() const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
MonitorElement * NumberOfRecHitsPerTrackCand
uint8_t stopReason() const
MonitorElement * seedStoppingSource
double x0() const
x coordinate