11 pfcand->gsfTrackRef().isAvailable())
13 else if (
pfcand->trackRef().isNonnull() &&
pfcand->trackRef().isAvailable())
21 "BCWeakDecay",
"BWeakDecay",
"CWeakDecay",
"PU",
"Other",
"Fake"};
25 : distJetAxis_(pSet.getParameter<double>(
"distJetAxisCut")),
26 decayLength_(pSet.getParameter<double>(
"decayLengthCut")),
27 minJetPt_(pSet.getParameter<double>(
"minJetPt")),
28 maxJetEta_(pSet.getParameter<double>(
"maxJetEta")),
29 ipTagInfos_(pSet.getParameter<
std::
string>(
"ipTagInfos")),
30 PatJetSrc_(pSet.getParameter<
InputTag>(
"PatJetSource")),
31 TrackSrc_(pSet.getParameter<
InputTag>(
"TrackSource")),
32 PVSrc_(pSet.getParameter<
InputTag>(
"PrimaryVertexSource")),
33 ClusterTPMapSrc_(pSet.getParameter<
InputTag>(
"clusterTPMap")),
34 classifier_(pSet, consumesCollector())
58 "nTrkAll_bjet",
"Number of selected tracks in b jets;number of selected tracks;jets", 16, -0.5, 15.5);
61 "nTrkAll_cjet",
"Number of selected tracks in c jets;number of selected tracks;jets", 16, -0.5, 15.5);
64 "nTrkAll_dusgjet",
"Number of selected tracks in dusg jets;number of selected tracks;jets", 16, -0.5, 15.5);
71 "Number of selected tracks in b jets (" +
TrkHistCat[
i] +
72 ");number of selected tracks (" +
TrkHistCat[
i] +
");jets",
79 "Number of selected tracks in c jets (" +
TrkHistCat[
i] +
80 ");number of selected tracks (" +
TrkHistCat[
i] +
");jets",
87 "Number of selected tracks in dusg jets (" +
TrkHistCat[
i] +
88 ");number of selected tracks (" +
TrkHistCat[
i] +
");jets",
173 "Number of tracker hits (" +
TrkHistCat[
i] +
" Truth);track number of all hits (" +
180 "Number of strip hits (" +
TrkHistCat[
i] +
" Truth);track number of strip hits (" +
187 "Number of pixel hits (" +
TrkHistCat[
i] +
" Truth);track number of pixel hits (" +
203 using P = std::pair<OmniClusterRef, TrackingParticleRef>;
204 bool compare(
const P &
i,
const P &
j) {
return i.second.index() >
j.second.index(); }
233 e(0, 0) = 0.0015 * 0.0015;
234 e(1, 1) = 0.0015 * 0.0015;
242 for (pat::JetCollection::const_iterator
jet = patJetsColl->begin();
jet != patJetsColl->end(); ++
jet) {
246 unsigned int flav =
abs(
jet->hadronFlavour());
251 const std::vector<edm::Ptr<reco::Candidate>> &
selectedTracks(trackIpTagInfo->selectedTracks());
253 unsigned int nseltracks = 0;
254 std::vector<int> nseltracksCat(
TrkHistCat.size(),
259 for (
unsigned int itt = 0; itt < nTrackSize; ++itt) {
285 double TrkPt = ptrack.
pt();
286 double TrkEta = ptrack.
eta();
287 double TrkPhi = ptrack.
phi();
288 double TrkDxy = ptrack.
dxy(
pv->position());
289 double TrkDz = ptrack.
dz(
pv->position());
294 double TrkTruthPt = -99;
295 double TrkTruthEta = -99;
296 double TrkTruthPhi = -99;
297 double TrkTruthDxy = -1;
298 double TrkTruthDz = -1;
299 int TrkTruthnHitAll = -1;
300 int TrkTruthnHitPixel = -1;
301 int TrkTruthnHitStrip = -1;
306 double quality_tpr =
res.second;
310 auto clusterTPmap = clusterToTPMap.
map();
313 std::equal_range(clusterTPmap.begin(), clusterTPmap.end(), std::make_pair(
OmniClusterRef(), tpr),
compare);
314 if (quality_tpr != 0) {
315 TrkTruthPt = tpr->pt();
316 TrkTruthEta = tpr->eta();
317 TrkTruthPhi = tpr->phi();
322 TrkTruthDxy = (-(vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.y() +
323 (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.x()) /
325 TrkTruthDz = (vertex_tpr.z() - vertex_pv.z()) - ((vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.x() +
326 (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.y()) /
327 sqrt(momentum_tpr.perp2()) * momentum_tpr.z() /
328 sqrt(momentum_tpr.perp2());
331 TrkTruthnHitPixel = 0;
332 TrkTruthnHitStrip = 0;
333 if (clusterRange.first != clusterRange.second) {
334 for (
auto ip = clusterRange.first; ip != clusterRange.second; ++ip) {
337 TrkTruthnHitPixel += 1;
340 TrkTruthnHitStrip += 1;
344 TrkTruthnHitAll = TrkTruthnHitPixel + TrkTruthnHitStrip;
362 if (quality_tpr != 0) {
385 if (quality_tpr != 0) {
408 if (quality_tpr != 0) {
430 if (quality_tpr != 0) {
453 if (quality_tpr != 0) {
485 }
else if (flav == 4) {
int numberOfValidPixelHits() const
reco::Vertex::Point convertPos(const GlobalPoint &p)
MonitorElement * nTrk_dusgjet[6]
bool compare(const P &i, const P &j)
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
unsigned short numberOfValidHits() const
number of valid hits found
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * TrkHitAll_alljets[6]
MonitorElement * TrkDxy_alljets[6]
MonitorElement * TrkTruthHitPixel_alljets[5]
#define DEFINE_FWK_MODULE(type)
MonitorElement * TrkDz_alljets[6]
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttrackToken_
TrackClassifier classifier_
MonitorElement * TrkHitStrip_alljets[6]
math::Error< dimension >::type Error
covariance error matrix (3x3)
MonitorElement * TrkEta_alljets[6]
BDHadronTrackMonitoringAnalyzer(const edm::ParameterSet &pSet)
const reco::Track * toTrack(const reco::TrackBaseRef &t)
MonitorElement * TrkPhi_alljets[6]
MonitorElement * TrkHitPixel_alljets[6]
edm::InputTag ClusterTPMapSrc_
int numberOfValidStripHits() const
edm::EDGetTokenT< pat::JetCollection > PatJetCollectionTag_
math::XYZPointD Point
point in the space
MonitorElement * nTrkAll_dusgjet
double pt() const
track transverse momentum
TrackHistory const & history() const
Returns a reference to the track history used in the classification.
MonitorElement * TrkTruthPhi_alljets[5]
const Flags & flags() const
Returns flags with the category descriptions.
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
MonitorElement * TrkTruthEta_alljets[5]
GlobalPoint globalPosition() const
MonitorElement * nTrkAll_bjet
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
const MagneticField * field() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
~BDHadronTrackMonitoringAnalyzer() override
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
double phi() const
azimuthal angle of momentum vector
static const std::vector< std::string > TrkHistCat
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * TrkTruthPt_alljets[5]
T const * get() const
Returns C++ pointer to the item.
const std::pair< TrackingParticleRef, double > getMatchedTrackingParticle() const
double eta() const
pseudorapidity of momentum vector
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
MonitorElement * nTrkAll_cjet
const map_type & map() const
MonitorElement * TrkTruthHitAll_alljets[5]
std::pair< OmniClusterRef, TrackingParticleRef > P
const reco::TrackBaseRef toTrackRef(const edm::Ptr< reco::Candidate > &cnd)
MonitorElement * TrkTruthDxy_alljets[5]
MonitorElement * TrkPt_alljets[6]
Particle reconstructed by the particle flow algorithm.
MonitorElement * nTrk_cjet[6]
std::vector< bool > Flags
Main types associated to the class.
MonitorElement * TrkTruthDz_alljets[5]
MonitorElement * nTrk_bjet[6]
math::XYZVectorD Vector
point in the space
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
primaryVertex
hltOfflineBeamSpot for HLTMON
MonitorElement * TrkTruthHitStrip_alljets[5]
TrajectoryStateOnSurface impactPointState() const
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override