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")),
41 doRegionPlots( iConfig.getParameter<
bool>(
"doRegionPlots"))
58 int TrackPtBin = iConfig.
getParameter<
int>(
"TrackPtBin");
59 double TrackPtMin = iConfig.
getParameter<
double>(
"TrackPtMin");
60 double TrackPtMax = iConfig.
getParameter<
double>(
"TrackPtMax");
71 double ThetaMin = iConfig.
getParameter<
double>(
"ThetaMin");
72 double ThetaMax = iConfig.
getParameter<
double>(
"ThetaMax");
75 double TrackQMin = iConfig.
getParameter<
double>(
"TrackQMin");
76 double TrackQMax = iConfig.
getParameter<
double>(
"TrackQMax");
78 int SeedDxyBin = iConfig.
getParameter<
int>(
"SeedDxyBin");
79 double SeedDxyMin = iConfig.
getParameter<
double>(
"SeedDxyMin");
80 double SeedDxyMax = iConfig.
getParameter<
double>(
"SeedDxyMax");
83 double SeedDzMin = iConfig.
getParameter<
double>(
"SeedDzMin");
84 double SeedDzMax = iConfig.
getParameter<
double>(
"SeedDzMax");
86 int SeedHitBin = iConfig.
getParameter<
int>(
"SeedHitBin");
87 double SeedHitMin = iConfig.
getParameter<
double>(
"SeedHitMin");
88 double SeedHitMax = iConfig.
getParameter<
double>(
"SeedHitMax");
91 double TCDxyMin = iConfig.
getParameter<
double>(
"TCDxyMin");
92 double TCDxyMax = iConfig.
getParameter<
double>(
"TCDxyMax");
95 double TCDzMin = iConfig.
getParameter<
double>(
"TCDzMin");
96 double TCDzMax = iConfig.
getParameter<
double>(
"TCDzMax");
99 double TCHitMin = iConfig.
getParameter<
double>(
"TCHitMin");
100 double TCHitMax = iConfig.
getParameter<
double>(
"TCHitMax");
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() +
"_";
150 histname =
"SeedTheta_"+seedProducer.label() +
"_";
157 histname =
"SeedQ_"+seedProducer.label() +
"_";
164 histname =
"SeedDxy_"+seedProducer.label() +
"_";
171 histname =
"SeedDz_"+seedProducer.label() +
"_";
178 histname =
"NumberOfRecHitsPerSeed_"+seedProducer.label() +
"_";
185 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_"+seedProducer.label() +
"_";
192 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_"+seedProducer.label() +
"_";
204 histname =
"TrackingRegionCandidatePt_"+seedProducer.label() +
"_";
211 histname =
"TrackingRegionCandidateEta_"+seedProducer.label() +
"_";
218 histname =
"TrackingRegionCandidatePhi_"+seedProducer.label() +
"_";
225 histname =
"TrackingRegionCandidatePhiVsEta_"+seedProducer.label() +
"_";
235 const auto candsBin = iConfig.
getParameter<
int>(
"SeedCandBin");
236 const auto candsMin = iConfig.
getParameter<
double>(
"SeedCandMin");
237 const auto candsMax = iConfig.
getParameter<
double>(
"SeedCandMax");
239 histname =
"SeedStoppingSource_"+seedProducer.label() +
"_";
240 seedStoppingSource = ibooker.
book1D(histname+CatagoryName, histname+CatagoryName, stopReasonSize, 0., stopReasonSize);
244 histname =
"StoppingSourceVsPhi_"+seedProducer.label() +
"_";
249 histname =
"StoppingSourceVsEta_"+seedProducer.label() +
"_";
254 histname =
"NumberOfTrajCandsPerSeed_"+seedProducer.label() +
"_";
259 histname =
"NumberOfTrajCandsPerSeedVsPhi_"+seedProducer.label() +
"_";
264 histname =
"NumberOfTrajCandsPerSeedVsEta_"+seedProducer.label() +
"_";
269 histname =
"SeedStoppingSourceVsNumberOfTrajCandsPerSeed_"+seedProducer.label() +
"_";
273 for(
unsigned int i=0;
i<stopReasonSize; ++
i) {
283 histname =
"StoppingSource_"+seedProducer.label() +
"_";
287 0.,
double(StopReasonNameSize));
291 histname =
"StoppingSourceVSeta_"+seedProducer.label() +
"_";
302 histname =
"StoppingSourceVSphi_"+seedProducer.label() +
"_";
313 for (
size_t ibin=0; ibin<StopReasonNameSize; ibin++) {
327 histname =
"TrackCandPt_"+tcProducer.label() +
"_";
332 histname =
"TrackCandEta_"+tcProducer.label() +
"_";
337 histname =
"TrackCandPhi_"+tcProducer.label() +
"_";
343 histname =
"TrackCandTheta_"+tcProducer.label() +
"_";
350 histname =
"TrackCandQ_"+tcProducer.label() +
"_";
355 histname =
"TrackCandDxy_"+tcProducer.label() +
"_";
360 histname =
"TrackCandDz_"+tcProducer.label() +
"_";
365 histname =
"NumberOfRecHitsPerTrackCand_"+tcProducer.label() +
"_";
370 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_"+tcProducer.label() +
"_";
375 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_"+tcProducer.label() +
"_";
381 histname =
"TrackCandPhiVsEta_"+tcProducer.label() +
"_";
387 for(
size_t i=1,
end=mvaProducers.size();
i<=
end; ++
i) {
388 auto num = std::to_string(
i);
397 pfix =
" (not loose-selected)";
399 histname =
"TrackMVA"+
num+
"HP_"+tcProducer.label() +
"_";
402 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
404 histname =
"TrackMVA"+
num+
"HPVsPtProfile_"+tcProducer.label() +
"_";
409 histname =
"TrackMVA"+
num+
"HPVsEtaProfile_"+tcProducer.label() +
"_";
415 histname =
"TrackMVA"+
num+
"_"+tcProducer.label() +
"_";
417 trackMVAs.back()->setAxisTitle(
"Track selection MVA"+
num, 1);
418 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
420 histname =
"TrackMVA"+
num+
"VsPtProfile_"+tcProducer.label() +
"_";
425 histname =
"TrackMVA"+
num+
"VsEtaProfile_"+tcProducer.label() +
"_";
455 if(!(tsAtClosestApproachSeed.isValid())) {
456 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
459 GlobalPoint v0 = tsAtClosestApproachSeed.trackStateAtPCA().position();
460 GlobalVector p = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
472 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
522 if(!(tsAtClosestApproachTrackCand.isValid())) {
523 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
526 GlobalPoint v0 = tsAtClosestApproachTrackCand.trackStateAtPCA().position();
527 GlobalVector p = tsAtClosestApproachTrackCand.trackStateAtPCA().momentum();
539 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
547 double stop = candidate.
stopReason() > max ? double(max-1) :
static_cast<double>(candidate.
stopReason());
571 bool trackSelected(
unsigned char mask,
unsigned char qual) {
572 return mask & 1<<qual;
576 const std::vector<const MVACollection *>& mvaCollections,
577 const std::vector<const QualityMaskCollection *>& qualityMaskCollections) {
580 if(trackCollection.
empty())
583 const auto ntracks = trackCollection.
size();
584 const auto nmva = mvaCollections.size();
585 for(
const auto mva: mvaCollections) {
586 if(
mva->size() != ntracks) {
587 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " <<
mva->size() <<
" differs from the size of the track collection " << ntracks;
591 for(
const auto qual: qualityMaskCollections) {
592 if(qual->size() != ntracks) {
593 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, " << qual->size() <<
" differs from the size of the track collection " << ntracks;
599 for(
size_t iTrack=0; iTrack<ntracks; ++iTrack) {
602 bool selectedLoose =
false;
603 bool selectedHP =
false;
605 const auto pt = trackCollection[iTrack].pt();
606 const auto eta = trackCollection[iTrack].eta();
608 for(
size_t iMVA=0; iMVA<nmva; ++iMVA) {
609 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
615 if(iMVA >= 1 && !selectedHP) {
621 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
625 if(selectedLoose && selectedHP)
635 for(
const auto& candidate: regionCandidates) {
636 const auto eta = candidate.eta();
637 const auto phi = candidate.phi();
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
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
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
unsigned char stopReasonUC() const
TrackBuildingAnalyzer(const edm::ParameterSet &)
MonitorElement * numberOfTrajCandsPerSeedVsEta
std::vector< MonitorElement * > trackMVAs
PTrajectoryStateOnDet const & startingState() const
MonitorElement * stoppingSourceVSeta
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * TrackCandTheta
MonitorElement * TrackCandQ
MonitorElement * SeedPhiVsEta
std::vector< MonitorElement * > trackMVAsHPVsPtProfile
MonitorElement * TrackingRegionCandidateEta
GlobalVector globalMomentum() const
MonitorElement * seedStoppingSourceVsEta
MonitorElement * TrackingRegionCandidatePhi
int getNbinsX(void) const
get # of bins in X-axis
double y0() const
y coordinate
MonitorElement * seedStoppingSourceVsNumberOfTrajCandsPerSeed
MonitorElement * NumberOfRecHitsPerSeedVsEtaProfile
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