30 , NumberOfRecHitsPerSeed(
NULL)
31 , NumberOfRecHitsPerSeedVsPhiProfile(
NULL)
32 , NumberOfRecHitsPerSeedVsEtaProfile(
NULL)
33 , stoppingSource(
NULL)
34 , stoppingSourceVSeta(
NULL)
35 , stoppingSourceVSphi(
NULL)
56 int TrackPtBin = iConfig.
getParameter<
int>(
"TrackPtBin");
57 double TrackPtMin = iConfig.
getParameter<
double>(
"TrackPtMin");
58 double TrackPtMax = iConfig.
getParameter<
double>(
"TrackPtMax");
69 double ThetaMin = iConfig.
getParameter<
double>(
"ThetaMin");
70 double ThetaMax = iConfig.
getParameter<
double>(
"ThetaMax");
73 double TrackQMin = iConfig.
getParameter<
double>(
"TrackQMin");
74 double TrackQMax = iConfig.
getParameter<
double>(
"TrackQMax");
76 int SeedDxyBin = iConfig.
getParameter<
int>(
"SeedDxyBin");
77 double SeedDxyMin = iConfig.
getParameter<
double>(
"SeedDxyMin");
78 double SeedDxyMax = iConfig.
getParameter<
double>(
"SeedDxyMax");
81 double SeedDzMin = iConfig.
getParameter<
double>(
"SeedDzMin");
82 double SeedDzMax = iConfig.
getParameter<
double>(
"SeedDzMax");
84 int SeedHitBin = iConfig.
getParameter<
int>(
"SeedHitBin");
85 double SeedHitMin = iConfig.
getParameter<
double>(
"SeedHitMin");
86 double SeedHitMax = iConfig.
getParameter<
double>(
"SeedHitMax");
89 double TCDxyMin = iConfig.
getParameter<
double>(
"TCDxyMin");
90 double TCDxyMax = iConfig.
getParameter<
double>(
"TCDxyMax");
93 double TCDzMin = iConfig.
getParameter<
double>(
"TCDzMin");
94 double TCDzMax = iConfig.
getParameter<
double>(
"TCDzMax");
97 double TCHitMin = iConfig.
getParameter<
double>(
"TCHitMin");
98 double TCHitMax = iConfig.
getParameter<
double>(
"TCHitMax");
107 std::vector<std::string> mvaProducers = iConfig.
getParameter<std::vector<std::string> >(
"MVAProducers");
136 if (doAllSeedPlots || doPT) {
137 histname =
"SeedPt_"+seedProducer.label() +
"_";
143 if (doAllSeedPlots || doETA) {
144 histname =
"SeedEta_"+seedProducer.label() +
"_";
150 if (doAllSeedPlots || doPHI) {
151 histname =
"SeedPhi_"+seedProducer.label() +
"_";
157 if (doAllSeedPlots || doPHIVsETA) {
158 histname =
"SeedPhiVsEta_"+seedProducer.label() +
"_";
164 if (doAllSeedPlots || doTheta){
165 histname =
"SeedTheta_"+seedProducer.label() +
"_";
171 if (doAllSeedPlots || doQ){
172 histname =
"SeedQ_"+seedProducer.label() +
"_";
178 if (doAllSeedPlots || doDxy){
179 histname =
"SeedDxy_"+seedProducer.label() +
"_";
185 if (doAllSeedPlots || doDz){
186 histname =
"SeedDz_"+seedProducer.label() +
"_";
192 if (doAllSeedPlots || doNRecHits){
193 histname =
"NumberOfRecHitsPerSeed_"+seedProducer.label() +
"_";
199 if (doAllSeedPlots || doProfPHI){
200 histname =
"NumberOfRecHitsPerSeedVsPhiProfile_"+seedProducer.label() +
"_";
206 if (doAllSeedPlots || doProfETA){
207 histname =
"NumberOfRecHitsPerSeedVsEtaProfile_"+seedProducer.label() +
"_";
213 if (doAllTCPlots || doStopSource) {
218 <<
" but StopReasonName's only for " 219 << StopReasonNameSize
220 <<
". Please update DataFormats/TrackReco/interface/TrajectoryStopReasons.h.";
224 histname =
"StoppingSource_"+seedProducer.label() +
"_";
228 0.,
double(StopReasonNameSize));
232 histname =
"StoppingSourceVSeta_"+seedProducer.label() +
"_";
239 0.,
double(StopReasonNameSize));
243 histname =
"StoppingSourceVSphi_"+seedProducer.label() +
"_";
250 0.,
double(StopReasonNameSize));
254 for (
size_t ibin=0; ibin<StopReasonNameSize; ibin++) {
270 histname =
"TrackCandPt_"+tcProducer.label() +
"_";
275 histname =
"TrackCandEta_"+tcProducer.label() +
"_";
280 histname =
"TrackCandPhi_"+tcProducer.label() +
"_";
286 histname =
"TrackCandTheta_"+tcProducer.label() +
"_";
293 histname =
"TrackCandQ_"+tcProducer.label() +
"_";
298 histname =
"TrackCandDxy_"+tcProducer.label() +
"_";
303 histname =
"TrackCandDz_"+tcProducer.label() +
"_";
308 histname =
"NumberOfRecHitsPerTrackCand_"+tcProducer.label() +
"_";
313 histname =
"NumberOfRecHitsPerTrackCandVsPhiProfile_"+tcProducer.label() +
"_";
318 histname =
"NumberOfRecHitsPerTrackCandVsEtaProfile_"+tcProducer.label() +
"_";
324 histname =
"TrackCandPhiVsEta_"+tcProducer.label() +
"_";
329 if(doAllTCPlots || doMVAPlots) {
330 for(
size_t i=1,
end=mvaProducers.size();
i<=
end; ++
i) {
331 auto num = std::to_string(
i);
340 pfix =
" (not loose-selected)";
342 histname =
"TrackMVA"+
num+
"HP_"+tcProducer.label() +
"_";
345 trackMVAsHP.back()->setAxisTitle(
"Number of tracks", 2);
347 histname =
"TrackMVA"+
num+
"HPVsPtProfile_"+tcProducer.label() +
"_";
352 histname =
"TrackMVA"+
num+
"HPVsEtaProfile_"+tcProducer.label() +
"_";
358 histname =
"TrackMVA"+
num+
"_"+tcProducer.label() +
"_";
360 trackMVAs.back()->setAxisTitle(
"Track selection MVA"+
num, 1);
361 trackMVAs.back()->setAxisTitle(
"Number of tracks", 2);
363 histname =
"TrackMVA"+
num+
"VsPtProfile_"+tcProducer.label() +
"_";
368 histname =
"TrackMVA"+
num+
"VsEtaProfile_"+tcProducer.label() +
"_";
397 if(!(tsAtClosestApproachSeed.isValid())) {
398 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
401 GlobalPoint v0 = tsAtClosestApproachSeed.trackStateAtPCA().position();
402 GlobalVector p = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
414 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
452 if(!(tsAtClosestApproachTrackCand.isValid())) {
453 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
456 GlobalPoint v0 = tsAtClosestApproachTrackCand.trackStateAtPCA().position();
457 GlobalVector p = tsAtClosestApproachTrackCand.trackStateAtPCA().momentum();
469 double numberOfHits = candidate.
recHits().second-candidate.
recHits().first;
477 double stop = candidate.
stopReason() > max ? double(max-1) :
static_cast<double>(candidate.
stopReason());
500 bool trackSelected(
unsigned char mask,
unsigned char qual) {
501 return mask & 1<<qual;
505 const std::vector<const MVACollection *>& mvaCollections,
506 const std::vector<const QualityMaskCollection *>& qualityMaskCollections) {
509 if(trackCollection.
empty())
512 const auto ntracks = trackCollection.
size();
513 const auto nmva = mvaCollections.size();
514 for(
const auto mva: mvaCollections) {
515 if(mva->size() != ntracks) {
516 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of MVACollection, " << mva->size() <<
" differs from the size of the track collection " << ntracks;
520 for(
const auto qual: qualityMaskCollections) {
521 if(qual->size() != ntracks) {
522 edm::LogError(
"LogicError") <<
"TrackBuildingAnalyzer: Incompatible size of QualityMaskCollection, " << qual->size() <<
" differs from the size of the track collection " << ntracks;
528 for(
size_t iTrack=0; iTrack<ntracks; ++iTrack) {
531 bool selectedLoose =
false;
532 bool selectedHP =
false;
534 const auto pt = trackCollection[iTrack].pt();
535 const auto eta = trackCollection[iTrack].eta();
537 for(
size_t iMVA=0; iMVA<nmva; ++iMVA) {
538 const auto mva = (*(mvaCollections[iMVA]))[iTrack];
544 if(iMVA >= 1 && !selectedHP) {
550 const auto qual = (*(qualityMaskCollections)[iMVA])[iTrack];
554 if(selectedLoose && selectedHP)
MonitorElement * NumberOfRecHitsPerTrackCandVsPhiProfile
MonitorElement * TrackCandPt
T getParameter(std::string const &) const
double z0() const
z coordinate
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 * 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
GlobalVector globalMomentum() const
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