24 : TrackingRegionCandidatePt(
nullptr)
25 , TrackingRegionCandidateEta(
nullptr)
26 , TrackingRegionCandidatePhi(
nullptr)
27 , TrackingRegionCandidatePhiVsEta(
nullptr)
36 , NumberOfRecHitsPerSeed(
nullptr)
37 , NumberOfRecHitsPerSeedVsPhiProfile(
nullptr)
38 , NumberOfRecHitsPerSeedVsEtaProfile(
nullptr)
62 int TrackPtBin = iConfig.
getParameter<
int>(
"TrackPtBin");
63 double TrackPtMin = iConfig.
getParameter<
double>(
"TrackPtMin");
64 double TrackPtMax = iConfig.
getParameter<
double>(
"TrackPtMax");
75 double ThetaMin = iConfig.
getParameter<
double>(
"ThetaMin");
76 double ThetaMax = iConfig.
getParameter<
double>(
"ThetaMax");
79 double TrackQMin = iConfig.
getParameter<
double>(
"TrackQMin");
80 double TrackQMax = iConfig.
getParameter<
double>(
"TrackQMax");
82 int SeedDxyBin = iConfig.
getParameter<
int>(
"SeedDxyBin");
83 double SeedDxyMin = iConfig.
getParameter<
double>(
"SeedDxyMin");
84 double SeedDxyMax = iConfig.
getParameter<
double>(
"SeedDxyMax");
87 double SeedDzMin = iConfig.
getParameter<
double>(
"SeedDzMin");
88 double SeedDzMax = iConfig.
getParameter<
double>(
"SeedDzMax");
90 int SeedHitBin = iConfig.
getParameter<
int>(
"SeedHitBin");
91 double SeedHitMin = iConfig.
getParameter<
double>(
"SeedHitMin");
92 double SeedHitMax = iConfig.
getParameter<
double>(
"SeedHitMax");
95 double TCDxyMin = iConfig.
getParameter<
double>(
"TCDxyMin");
96 double TCDxyMax = iConfig.
getParameter<
double>(
"TCDxyMax");
99 double TCDzMin = iConfig.
getParameter<
double>(
"TCDzMin");
100 double TCDzMax = iConfig.
getParameter<
double>(
"TCDzMax");
103 double TCHitMin = iConfig.
getParameter<
double>(
"TCHitMin");
104 double TCHitMax = iConfig.
getParameter<
double>(
"TCHitMax");
113 std::vector<std::string> mvaProducers = iConfig.
getParameter<std::vector<std::string> >(
"MVAProducers");
144 if (doAllSeedPlots || doPT) {
145 histname =
"SeedPt_"+seedProducer.label() +
"_";
151 if (doAllSeedPlots || doETA) {
152 histname =
"SeedEta_"+seedProducer.label() +
"_";
158 if (doAllSeedPlots || doPHI) {
159 histname =
"SeedPhi_"+seedProducer.label() +
"_";
165 if (doAllSeedPlots || doPHIVsETA) {
166 histname =
"SeedPhiVsEta_"+seedProducer.label() +
"_";
172 if (doAllSeedPlots || doTheta){
173 histname =
"SeedTheta_"+seedProducer.label() +
"_";
179 if (doAllSeedPlots || doQ){
180 histname =
"SeedQ_"+seedProducer.label() +
"_";
186 if (doAllSeedPlots || doDxy){
187 histname =
"SeedDxy_"+seedProducer.label() +
"_";
193 if (doAllSeedPlots || doDz){
194 histname =
"SeedDz_"+seedProducer.label() +
"_";
200 if (doAllSeedPlots || doNRecHits){
201 histname =
"NumberOfRecHitsPerSeed_"+seedProducer.label() +
"_";
207 if (doAllSeedPlots || doProfPHI){
208 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_"+seedProducer.label() +
"_";
214 if (doAllSeedPlots || doProfETA){
215 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_"+seedProducer.label() +
"_";
222 if (doAllSeedPlots || doPT) {
227 histname =
"TrackingRegionCandidatePt_"+seedProducer.label() +
"_";
233 if (doAllSeedPlots || doETA) {
234 histname =
"TrackingRegionCandidateEta_"+seedProducer.label() +
"_";
240 if (doAllSeedPlots || doPHI) {
241 histname =
"TrackingRegionCandidatePhi_"+seedProducer.label() +
"_";
247 if (doAllSeedPlots || doPHIVsETA) {
248 histname =
"TrackingRegionCandidatePhiVsEta_"+seedProducer.label() +
"_";
255 if (doAllTCPlots || doStopSource) {
260 <<
" but StopReasonName's only for " 261 << StopReasonNameSize
262 <<
". Please update DataFormats/TrackReco/interface/TrajectoryStopReasons.h.";
266 histname =
"StoppingSource_"+seedProducer.label() +
"_";
270 0.,
double(StopReasonNameSize));
274 histname =
"StoppingSourceVSeta_"+seedProducer.label() +
"_";
285 histname =
"StoppingSourceVSphi_"+seedProducer.label() +
"_";
296 for (
size_t ibin=0; ibin<StopReasonNameSize; ibin++) {
310 histname =
"TrackCandPt_"+tcProducer.label() +
"_";
315 histname =
"TrackCandEta_"+tcProducer.label() +
"_";
320 histname =
"TrackCandPhi_"+tcProducer.label() +
"_";
326 histname =
"TrackCandTheta_"+tcProducer.label() +
"_";
333 histname =
"TrackCandQ_"+tcProducer.label() +
"_";
338 histname =
"TrackCandDxy_"+tcProducer.label() +
"_";
343 histname =
"TrackCandDz_"+tcProducer.label() +
"_";
348 histname =
"NumberOfRecHitsPerTrackCand_"+tcProducer.label() +
"_";
353 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_"+tcProducer.label() +
"_";
358 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_"+tcProducer.label() +
"_";
364 histname =
"TrackCandPhiVsEta_"+tcProducer.label() +
"_";
369 if(doAllTCPlots || doMVAPlots) {
370 for(
size_t i=1,
end=mvaProducers.size();
i<=
end; ++
i) {
371 auto num = std::to_string(
i);
380 pfix =
" (not loose-selected)";
382 histname =
"TrackMVA"+
num+
"HP_"+tcProducer.label() +
"_";
385 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
387 histname =
"TrackMVA"+
num+
"HPVsPtProfile_"+tcProducer.label() +
"_";
392 histname =
"TrackMVA"+
num+
"HPVsEtaProfile_"+tcProducer.label() +
"_";
398 histname =
"TrackMVA"+
num+
"_"+tcProducer.label() +
"_";
400 trackMVAs.back()->setAxisTitle(
"Track selection MVA"+
num, 1);
401 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
403 histname =
"TrackMVA"+
num+
"VsPtProfile_"+tcProducer.label() +
"_";
408 histname =
"TrackMVA"+
num+
"VsEtaProfile_"+tcProducer.label() +
"_";
437 if(!(tsAtClosestApproachSeed.isValid())) {
438 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
441 GlobalPoint v0 = tsAtClosestApproachSeed.trackStateAtPCA().position();
442 GlobalVector p = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
454 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
492 if(!(tsAtClosestApproachTrackCand.isValid())) {
493 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
496 GlobalPoint v0 = tsAtClosestApproachTrackCand.trackStateAtPCA().position();
497 GlobalVector p = tsAtClosestApproachTrackCand.trackStateAtPCA().momentum();
509 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
517 double stop = candidate.
stopReason() > max ? double(max-1) :
static_cast<double>(candidate.
stopReason());
541 bool trackSelected(
unsigned char mask,
unsigned char qual) {
542 return mask & 1<<qual;
546 const std::vector<const MVACollection *>& mvaCollections,
547 const std::vector<const QualityMaskCollection *>& qualityMaskCollections) {
550 if(trackCollection.
empty())
553 const auto ntracks = trackCollection.
size();
554 const auto nmva = mvaCollections.size();
555 for(
const auto mva: mvaCollections) {
556 if(mva->size() != ntracks) {
557 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " << mva->size() <<
" differs from the size of the track collection " << ntracks;
561 for(
const auto qual: qualityMaskCollections) {
562 if(qual->size() != ntracks) {
563 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, " << qual->size() <<
" differs from the size of the track collection " << ntracks;
569 for(
size_t iTrack=0; iTrack<ntracks; ++iTrack) {
572 bool selectedLoose =
false;
573 bool selectedHP =
false;
575 const auto pt = trackCollection[iTrack].pt();
576 const auto eta = trackCollection[iTrack].eta();
578 for(
size_t iMVA=0; iMVA<nmva; ++iMVA) {
579 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
585 if(iMVA >= 1 && !selectedHP) {
591 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
595 if(selectedLoose && selectedHP)
605 for(
const auto& candidate: regionCandidates) {
606 const auto eta = candidate.eta();
607 const auto phi = candidate.phi();
MonitorElement * NumberOfRecHitsPerTrackCandVsPhiProfile
MonitorElement * TrackCandPt
T getParameter(std::string const &) const
double z0() const
z coordinate
MonitorElement * TrackingRegionCandidatePhiVsEta
TrackCharge charge() 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
MonitorElement * SeedTheta
Geom::Theta< T > theta() const
MonitorElement * NumberOfRecHitsPerTrackCandVsEtaProfile
MonitorElement * stoppingSource
PTrajectoryStateOnDet const & trajectoryStateOnDet() const
MonitorElement * NumberOfRecHitsPerSeed
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrajectorySeed &seed, const reco::BeamSpot &bs, const edm::ESHandle< MagneticField > &theMF, const edm::ESHandle< TransientTrackingRecHitBuilder > &theTTRHBuilder)
MonitorElement * NumberOfRecHitsPerSeedVsPhiProfile
MonitorElement * TrackCandDxy
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]
TrackBuildingAnalyzer(const edm::ParameterSet &)
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 * TrackingRegionCandidatePhi
int getNbinsX(void) const
get # of bins in X-axis
double y0() const
y coordinate
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
double x0() const
x coordinate