22 distJetAxis_ ( pSet.getParameter<double>(
"distJetAxisCut") ),
23 decayLength_ ( pSet.getParameter<double>(
"decayLengthCut") ),
24 minJetPt_ ( pSet.getParameter<double>(
"minJetPt") ),
25 maxJetEta_ ( pSet.getParameter<double>(
"maxJetEta") ),
26 ipTagInfos_ ( pSet.getParameter<
std::
string>(
"ipTagInfos") ),
27 PatJetSrc_ ( pSet.getParameter<
InputTag>(
"PatJetSource") ),
28 TrackSrc_ ( pSet.getParameter<
InputTag>(
"TrackSource") ),
29 PVSrc_ ( pSet.getParameter<
InputTag>(
"PrimaryVertexSource") ),
30 ClusterTPMapSrc_ ( pSet.getParameter<
InputTag>(
"clusterTPMap") ),
31 classifier_(pSet, consumesCollector())
55 nTrkAll_bjet = ibook.
book1D(
"nTrkAll_bjet",
"Number of selected tracks in b jets;number of selected tracks;jets",16,-0.5,15.5);
57 nTrkAll_cjet = ibook.
book1D(
"nTrkAll_cjet",
"Number of selected tracks in c jets;number of selected tracks;jets",16,-0.5,15.5);
59 nTrkAll_dusgjet = ibook.
book1D(
"nTrkAll_dusgjet",
"Number of selected tracks in dusg jets;number of selected tracks;jets",16,-0.5,15.5);
108 using P = std::pair<OmniClusterRef, TrackingParticleRef>;
110 return i.second.index() > j.second.index();
137 bool pvFound = (!primaryVertex->empty());
139 pv = &(*primaryVertex->begin());
143 e(0,0)=0.0015*0.0015;
144 e(1,1)=0.0015*0.0015;
152 for ( pat::JetCollection::const_iterator
jet = patJetsColl->begin();
jet != patJetsColl->end(); ++
jet ) {
155 unsigned int flav =
abs(
jet->hadronFlavour());
159 const std::vector<edm::Ptr<reco::Candidate> > &
selectedTracks( trackIpTagInfo->selectedTracks() );
162 unsigned int nseltracks = 0;
163 std::vector<int> nseltracksCat(
TrkHistCat.size(),0);
167 for (
unsigned int itt=0; itt < nTrackSize; ++itt)
194 double TrkPt = ptrack.
pt();
195 double TrkEta = ptrack.
eta();
196 double TrkPhi = ptrack.
phi();
204 double TrkTruthPt=-99;
205 double TrkTruthEta=-99;
206 double TrkTruthPhi=-99;
207 double TrkTruthDxy=-1;
208 double TrkTruthDz=-1;
209 int TrkTruthnHitAll=-1;
210 int TrkTruthnHitPixel=-1;
211 int TrkTruthnHitStrip=-1;
216 double quality_tpr = res.second;
219 auto clusterTPmap = clusterToTPMap.
map();
220 std::sort(clusterTPmap.begin(), clusterTPmap.end(),
compare);
221 auto clusterRange = std::equal_range(clusterTPmap.begin(), clusterTPmap.end(),std::make_pair(
OmniClusterRef(), tpr),
compare);
222 if (quality_tpr != 0) {
224 TrkTruthPt = tpr->pt();
225 TrkTruthEta = tpr->eta();
226 TrkTruthPhi = tpr->phi();
231 TrkTruthDxy = (-(vertex_tpr.x()-vertex_pv.x())*momentum_tpr.y()+(vertex_tpr.y()-vertex_pv.y())*momentum_tpr.x())/tpr->pt();
232 TrkTruthDz = (vertex_tpr.z()-vertex_pv.z()) - ((vertex_tpr.x()-vertex_pv.x())*momentum_tpr.x()+(vertex_tpr.y()-vertex_pv.y())*momentum_tpr.y())/
sqrt(momentum_tpr.perp2()) * momentum_tpr.z()/
sqrt(momentum_tpr.perp2());
235 TrkTruthnHitPixel = 0;
236 TrkTruthnHitStrip = 0;
237 if( clusterRange.first != clusterRange.second ) {
238 for(
auto ip=clusterRange.first; ip != clusterRange.second; ++ip ) {
240 if (cluster.
isPixel() && cluster.
isValid()){ TrkTruthnHitPixel+=1;}
241 if (cluster.
isStrip() && cluster.
isValid()){ TrkTruthnHitStrip+=1;}
244 TrkTruthnHitAll = TrkTruthnHitPixel + TrkTruthnHitStrip;
263 if (quality_tpr != 0) {
285 if (quality_tpr != 0) {
307 if (quality_tpr != 0) {
329 if (quality_tpr != 0) {
351 if (quality_tpr != 0) {
403 if (!pvFound){
delete pv;}
reco::Vertex::Point convertPos(const GlobalPoint &p)
MonitorElement * nTrk_dusgjet[6]
int pdgId() const final
PDG identifier.
bool compare(const P &i, const P &j)
bool isNonnull() const
Checks for non-null.
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
MonitorElement * TrkHitAll_alljets[6]
MonitorElement * TrkDxy_alljets[6]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * TrkTruthHitPixel_alljets[5]
#define DEFINE_FWK_MODULE(type)
T const * get() const
Returns C++ pointer to the item.
MonitorElement * TrkDz_alljets[6]
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
reco::TransientTrack build(const reco::Track *p) const
TrackClassifier classifier_
MonitorElement * TrkHitStrip_alljets[6]
int numberOfValidStripHits() const
math::Error< dimension >::type Error
covariance error matrix (3x3)
GlobalPoint globalPosition() const
double phi() const
azimuthal angle of momentum vector
const MagneticField * field() const
MonitorElement * TrkEta_alljets[6]
TrackHistory const & history() const
Returns a reference to the track history used in the classification.
BDHadronTrackMonitoringAnalyzer(const edm::ParameterSet &pSet)
const reco::Track * toTrack(const reco::TrackBaseRef &t)
const Point & position() const
position
MonitorElement * TrkPhi_alljets[6]
MonitorElement * TrkHitPixel_alljets[6]
edm::InputTag ClusterTPMapSrc_
reco::TrackRef trackRef() const
edm::EDGetTokenT< pat::JetCollection > PatJetCollectionTag_
math::XYZPointD Point
point in the space
MonitorElement * nTrkAll_dusgjet
MonitorElement * TrkTruthPhi_alljets[5]
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
MonitorElement * TrkTruthEta_alljets[5]
double eta() const
pseudorapidity of momentum vector
MonitorElement * nTrkAll_bjet
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double pt() const
track transverse momentum
~BDHadronTrackMonitoringAnalyzer() override
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
unsigned short numberOfValidHits() const
number of valid hits found
static const std::vector< std::string > TrkHistCat
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
MonitorElement * TrkTruthPt_alljets[5]
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...
void setCurrentFolder(const std::string &fullpath)
const Flags & flags() const
Returns flags with the category descriptions.
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
MonitorElement * nTrkAll_cjet
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]
reco::GsfTrackRef gsfTrackRef() const
const map_type & map() const
int numberOfValidPixelHits() const
std::vector< bool > Flags
Main types associated to the class.
TrajectoryStateOnSurface impactPointState() const
MonitorElement * TrkTruthDz_alljets[5]
const std::pair< TrackingParticleRef, double > getMatchedTrackingParticle() const
MonitorElement * nTrk_bjet[6]
math::XYZVectorD Vector
point in the space
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
MonitorElement * TrkTruthHitStrip_alljets[5]
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override