CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
CombinedSVComputer Class Reference

#include <CombinedSVComputer.h>

Inheritance diagram for CombinedSVComputer:
CombinedSVSoftLeptonComputer

Classes

struct  IterationRange
 

Public Member Functions

 CombinedSVComputer (const edm::ParameterSet &params)
 
edm::ParameterSet dropDeltaR (const edm::ParameterSet &pset) const
 
template<class SVTI , class IPTI >
void fillCommonVariables (reco::TaggingVariableList &vars, reco::TrackKinematics &vertexKinematics, const IPTI &ipInfo, const SVTI &svInfo, double &vtx_track_ptSum, double &vtx_track_ESum) const
 
IterationRange flipIterate (int size, bool vertex) const
 
double flipValue (double value, bool vertex) const
 
virtual reco::TaggingVariableList operator() (const reco::TrackIPTagInfo &ipInfo, const reco::SecondaryVertexTagInfo &svInfo) const
 
virtual reco::TaggingVariableList operator() (const reco::CandIPTagInfo &ipInfo, const reco::CandSecondaryVertexTagInfo &svInfo) const
 
const reco::btag::TrackIPDatathreshTrack (const reco::CandIPTagInfo &trackIPTagInfo, const reco::btag::SortCriteria sort, const reco::Jet &jet, const GlobalPoint &pv) const
 
const reco::btag::TrackIPDatathreshTrack (const reco::TrackIPTagInfo &trackIPTagInfo, const reco::btag::SortCriteria sort, const reco::Jet &jet, const GlobalPoint &pv) const
 

Private Attributes

double charmCut
 
double minTrackWeight
 
unsigned int pseudoMultiplicityMin
 
reco::V0Filter pseudoVertexV0Filter
 
reco::btag::SortCriteria sortCriterium
 
std::vector
< reco::btau::TaggingVariableName
taggingVariables
 
bool trackFlip
 
unsigned int trackMultiplicityMin
 
reco::TrackSelector trackNoDeltaRSelector
 
reco::V0Filter trackPairV0Filter
 
reco::TrackSelector trackPseudoSelector
 
reco::TrackSelector trackSelector
 
bool useTrackWeights
 
bool vertexFlip
 
bool vertexMassCorrection
 

Detailed Description

Definition at line 42 of file CombinedSVComputer.h.

Constructor & Destructor Documentation

CombinedSVComputer::CombinedSVComputer ( const edm::ParameterSet params)
explicit

Definition at line 13 of file CombinedSVComputer.cc.

13  :
14  trackFlip(params.getParameter<bool>("trackFlip")),
15  vertexFlip(params.getParameter<bool>("vertexFlip")),
16  charmCut(params.getParameter<double>("charmCut")),
18  trackSelector(params.getParameter<edm::ParameterSet>("trackSelection")),
20  trackPseudoSelector(params.getParameter<edm::ParameterSet>("trackPseudoSelection")),
21  pseudoMultiplicityMin(params.getParameter<unsigned int>("pseudoMultiplicityMin")),
22  trackMultiplicityMin(params.getParameter<unsigned int>("trackMultiplicityMin")),
23  minTrackWeight(params.getParameter<double>("minimumTrackWeight")),
24  useTrackWeights(params.getParameter<bool>("useTrackWeights")),
25  vertexMassCorrection(params.getParameter<bool>("correctVertexMass")),
26  pseudoVertexV0Filter(params.getParameter<edm::ParameterSet>("pseudoVertexV0Filter")),
27  trackPairV0Filter(params.getParameter<edm::ParameterSet>("trackPairV0Filter"))
28 {
29 
30 }
reco::TrackSelector trackSelector
T getParameter(std::string const &) const
reco::btag::SortCriteria getCriterium(const std::string &name)
Definition: TrackSorting.cc:11
unsigned int pseudoMultiplicityMin
reco::TrackSelector trackNoDeltaRSelector
reco::V0Filter pseudoVertexV0Filter
reco::btag::SortCriteria sortCriterium
reco::TrackSelector trackPseudoSelector
reco::V0Filter trackPairV0Filter
edm::ParameterSet dropDeltaR(const edm::ParameterSet &pset) const
unsigned int trackMultiplicityMin

Member Function Documentation

edm::ParameterSet CombinedSVComputer::dropDeltaR ( const edm::ParameterSet pset) const
inline

Definition at line 6 of file CombinedSVComputer.cc.

References edm::ParameterSet::addParameter().

7 {
8  edm::ParameterSet psetCopy(pset);
9  psetCopy.addParameter<double>("jetDeltaRMax", 99999.0);
10  return psetCopy;
11 }
template<class SVTI , class IPTI >
void CombinedSVComputer::fillCommonVariables ( reco::TaggingVariableList vars,
reco::TrackKinematics vertexKinematics,
const IPTI &  ipInfo,
const SVTI &  svInfo,
double &  vtx_track_ptSum,
double &  vtx_track_ESum 
) const

Definition at line 95 of file CombinedSVComputer.h.

References reco::TrackKinematics::add(), reco::btau::chargedHadronEnergyFraction, reco::btau::chargedHadronMultiplicity, reco::btag::TrackIPData::closestToJetAxis, data, deltaR(), HLT_25ns14e33_v1_cff::DeltaR, dir, reco::btag::TrackIPData::distanceToJetAxis, reco::btau::electronEnergyFraction, reco::btau::electronMultiplicity, reco::btau::etaRel(), reco::btau::flightDistance2dSig, reco::btau::flightDistance2dVal, reco::btau::flightDistance3dSig, reco::btau::flightDistance3dVal, flipIterate(), flipValue(), reco::btau::hadronMultiplicity, reco::btau::hadronPhotonMultiplicity, i, customizeTrackingMonitorSeedNumber::idx, reco::TaggingVariableList::insert(), reco::btag::TrackIPData::ip2d, reco::btag::IP2DSig, reco::btag::TrackIPData::ip3d, reco::btag::IP3DSig, j, metsig::jet, reco::btau::jetEta, reco::btau::jetNSecondaryVertices, reco::btau::jetNTracks, reco::btau::jetPt, PV3DBase< T, PVType, FrameType >::mag2(), reco::btau::massVertexEnergyFraction, reco::TrackBase::momentum(), reco::btau::muonEnergyFraction, reco::btau::muonMultiplicity, reco::btau::neutralHadronEnergyFraction, reco::btau::neutralHadronMultiplicity, reco::btag::Vertices::NoVertex, reco::TrackKinematics::numberOfTracks(), convertSQLiteXML::ok, reco::btau::photonEnergyFraction, reco::btau::photonMultiplicity, reco::ParticleMasses::piPlus, pseudoMultiplicityMin, reco::btag::Vertices::PseudoVertex, pseudoVertexV0Filter, MetAnalyzer::pv(), range_for, dt_dqm_sourceclient_common_cff::reco, reco::btag::Vertices::RecoVertex, Measurement1D::significance(), sortCriterium, mathSSE::sqrt(), threshTrack(), reco::btau::totalMultiplicity, reco::btag::toTrack(), reco::btau::trackDecayLenVal, reco::btau::trackDeltaR, reco::btau::trackEta, reco::btau::trackEtaRel, reco::btau::trackJetDistVal, reco::btau::trackJetPt, reco::btau::trackMomentum, trackMultiplicityMin, trackPairV0Filter, reco::btau::trackPPar, reco::btau::trackPParRatio, trackPseudoSelector, reco::btau::trackPtRatio, reco::btau::trackPtRel, testEve_cfg::tracks, trackSelector, reco::btau::trackSip2dSig, reco::btau::trackSip2dSigAboveCharm, reco::btau::trackSip2dVal, reco::btau::trackSip2dValAboveCharm, reco::btau::trackSip3dSig, reco::btau::trackSip3dSigAboveCharm, reco::btau::trackSip3dVal, reco::btau::trackSip3dValAboveCharm, reco::btau::trackSumJetDeltaR, reco::btau::trackSumJetEtRatio, useTrackWeights, Measurement1D::value(), reco::TrackKinematics::vectorSum(), reco::btau::vertexBoostOverSqrtJetPt, reco::btau::vertexCategory, reco::btau::vertexEnergyRatio, reco::btau::vertexJetDeltaR, reco::btau::vertexMass, vertexMassCorrection, reco::btau::vertexNTracks, reco::TrackKinematics::weightedVectorSum(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by operator()().

98 {
99  using namespace ROOT::Math;
100  using namespace reco;
101 
102  edm::RefToBase<Jet> jet = ipInfo.jet();
103  math::XYZVector jetDir = jet->momentum().Unit();
104  bool havePv = ipInfo.primaryVertex().isNonnull();
105  GlobalPoint pv;
106  if (havePv)
107  pv = GlobalPoint(ipInfo.primaryVertex()->x(),
108  ipInfo.primaryVertex()->y(),
109  ipInfo.primaryVertex()->z());
110 
112 
113 
114  vars.insert(btau::jetPt, jet->pt(), true);
115  vars.insert(btau::jetEta, jet->eta(), true);
116 
117  if (ipInfo.selectedTracks().size() < trackMultiplicityMin)
118  return;
119 
120  vars.insert(btau::jetNTracks, ipInfo.selectedTracks().size(), true);
121 
122  TrackKinematics allKinematics;
123  TrackKinematics trackJetKinematics;
124 
125  double jet_track_ESum= 0.;
126 
127  int vtx = -1;
128 
129  IterationRange range = flipIterate(svInfo.nVertices(), true);
130  range_for(i , range) {
131  if (vtx < 0) vtx = i;
132  }
133 
134  if (vtx >= 0) {
135  vtxType = btag::Vertices::RecoVertex;
136 
137  vars.insert(btau::flightDistance2dVal,flipValue(svInfo.flightDistance(vtx, true).value(),true),true);
138  vars.insert(btau::flightDistance2dSig,flipValue(svInfo.flightDistance(vtx, true).significance(),true),true);
139  vars.insert(btau::flightDistance3dVal,flipValue(svInfo.flightDistance(vtx, false).value(),true),true);
140  vars.insert(btau::flightDistance3dSig,flipValue(svInfo.flightDistance(vtx, false).significance(),true),true);
141  vars.insert(btau::vertexJetDeltaR,Geom::deltaR(svInfo.flightDirection(vtx), jetDir),true);
142  vars.insert(btau::jetNSecondaryVertices, svInfo.nVertices(), true);
143  }
144 
145  std::vector<std::size_t> indices = ipInfo.sortedIndexes(sortCriterium);
146  const std::vector<reco::btag::TrackIPData> &ipData = ipInfo.impactParameterData();
147 
148  const typename IPTI::input_container &tracks = ipInfo.selectedTracks();
149  std::vector<const Track *> pseudoVertexTracks;
150 
151  const Track * trackPairV0Test[2];
152  range = flipIterate(indices.size(), false);
153  range_for(i, range) {
154  std::size_t idx = indices[i];
155  const reco::btag::TrackIPData &data = ipData[idx];
156  const Track * trackPtr = reco::btag::toTrack(tracks[idx]);
157  const Track &track = *trackPtr;
158 
159  jet_track_ESum += std::sqrt(track.momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
160 
161  // add track to kinematics for all tracks in jet
162  //allKinematics.add(track); // would make more sense for some variables, e.g. vertexEnergyRatio nicely between 0 and 1, but not necessarily the best option for the discriminating power...
163 
164  // filter track -> this track selection can be tighter than the vertex track selection (used to fill the track related variables...)
165  if (!trackSelector(track, data, *jet, pv))
166  continue;
167 
168  // add track to kinematics for all tracks in jet
169  allKinematics.add(track);
170 
171  // if no vertex was reconstructed, attempt pseudo vertex
172  if (vtxType == btag::Vertices::NoVertex && trackPseudoSelector(track, data, *jet, pv)) {
173  pseudoVertexTracks.push_back(trackPtr);
174  vertexKinematics.add(track);
175  }
176 
177  // check against all other tracks for V0 track pairs
178  trackPairV0Test[0] = reco::btag::toTrack(tracks[idx]);
179  bool ok = true;
180  range_for(j, range) {
181  if (i == j)
182  continue;
183 
184  std::size_t pairIdx = indices[j];
185  const reco::btag::TrackIPData &pairTrackData = ipData[pairIdx];
186  const Track * pairTrackPtr = reco::btag::toTrack(tracks[pairIdx]);
187  const Track &pairTrack = *pairTrackPtr;
188 
189  if (!trackSelector(pairTrack, pairTrackData, *jet, pv))
190  continue;
191 
192  trackPairV0Test[1] = pairTrackPtr;
193  if (!trackPairV0Filter(trackPairV0Test, 2)) {
194  ok = false;
195  break;
196  }
197  }
198  if (!ok)
199  continue;
200 
201  trackJetKinematics.add(track);
202 
203  // add track variables
204  math::XYZVector trackMom = track.momentum();
205  double trackMag = std::sqrt(trackMom.Mag2());
206 
207  vars.insert(btau::trackSip3dVal, flipValue(data.ip3d.value(), false), true);
208  vars.insert(btau::trackSip3dSig, flipValue(data.ip3d.significance(), false), true);
209  vars.insert(btau::trackSip2dVal, flipValue(data.ip2d.value(), false), true);
210  vars.insert(btau::trackSip2dSig, flipValue(data.ip2d.significance(), false), true);
212 // vars.insert(btau::trackJetDistSig, data.distanceToJetAxis.significance(), true);
213 // vars.insert(btau::trackFirstTrackDist, data.distanceToFirstTrack, true);
214 // vars.insert(btau::trackGhostTrackVal, data.distanceToGhostTrack.value(), true);
215 // vars.insert(btau::trackGhostTrackSig, data.distanceToGhostTrack.significance(), true);
216  vars.insert(btau::trackDecayLenVal, havePv ? (data.closestToJetAxis - pv).mag() : -1.0, true);
217 
218  vars.insert(btau::trackMomentum, trackMag, true);
219  vars.insert(btau::trackEta, trackMom.Eta(), true);
220 
221  vars.insert(btau::trackPtRel, VectorUtil::Perp(trackMom, jetDir), true);
222  vars.insert(btau::trackPPar, jetDir.Dot(trackMom), true);
223  vars.insert(btau::trackDeltaR, VectorUtil::DeltaR(trackMom, jetDir), true);
224  vars.insert(btau::trackPtRatio, VectorUtil::Perp(trackMom, jetDir) / trackMag, true);
225  vars.insert(btau::trackPParRatio, jetDir.Dot(trackMom) / trackMag, true);
226  }
227 
228  if (vtxType == btag::Vertices::NoVertex && vertexKinematics.numberOfTracks() >= pseudoMultiplicityMin && pseudoVertexV0Filter(pseudoVertexTracks))
229  {
231  for(std::vector<const Track *>::const_iterator track = pseudoVertexTracks.begin(); track != pseudoVertexTracks.end(); ++track)
232  {
233  vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
234  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
235  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
236  }
237  }
238 
239  vars.insert(btau::vertexCategory, vtxType, true);
240 
241  vars.insert(btau::trackJetPt, trackJetKinematics.vectorSum().Pt(), true);
242  vars.insert(btau::trackSumJetDeltaR,VectorUtil::DeltaR(allKinematics.vectorSum(), jetDir), true);
243  vars.insert(btau::trackSumJetEtRatio,allKinematics.vectorSum().Et() / ipInfo.jet()->et(), true);
244 
245  vars.insert(btau::trackSip3dSigAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP3DSig, *jet, pv).ip3d.significance(),false),true);
246  vars.insert(btau::trackSip3dValAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP3DSig, *jet, pv).ip3d.value(),false),true);
247  vars.insert(btau::trackSip2dSigAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP2DSig, *jet, pv).ip2d.significance(),false),true);
248  vars.insert(btau::trackSip2dValAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP2DSig, *jet, pv).ip2d.value(),false),true);
249 
250  if (vtxType != btag::Vertices::NoVertex) {
252  ? allKinematics.weightedVectorSum()
253  : allKinematics.vectorSum();
255  ? vertexKinematics.weightedVectorSum()
256  : vertexKinematics.vectorSum();
257 
258  if (vtxType != btag::Vertices::RecoVertex) {
259  vars.insert(btau::vertexNTracks,vertexKinematics.numberOfTracks(), true);
260  vars.insert(btau::vertexJetDeltaR,VectorUtil::DeltaR(vertexSum, jetDir), true);
261  }
262 
263  double vertexMass = vertexSum.M();
264  if (vtxType == btag::Vertices::RecoVertex &&
266  GlobalVector dir = svInfo.flightDirection(vtx);
267  double vertexPt2 = math::XYZVector(dir.x(), dir.y(), dir.z()).Cross(vertexSum).Mag2() / dir.mag2();
268  vertexMass = std::sqrt(vertexMass * vertexMass + vertexPt2) + std::sqrt(vertexPt2);
269  }
270  vars.insert(btau::vertexMass, vertexMass, true);
271 
272  double varPi = (vertexMass/5.2794) * (vtx_track_ESum /jet_track_ESum); // 5.2794 should be the average B meson mass of PDG! CHECK!!!
273  vars.insert(btau::massVertexEnergyFraction, varPi, true);
274  double varB = (std::sqrt(5.2794) * vtx_track_ptSum) / ( vertexMass * std::sqrt(jet->pt()));
275  vars.insert(btau::vertexBoostOverSqrtJetPt,varB*varB/(varB*varB + 10.), true);
276 
277  if (allKinematics.numberOfTracks()) {
278  vars.insert(btau::vertexEnergyRatio, vertexSum.E() / allSum.E(), true);
279  }
280  else {
281  vars.insert(btau::vertexEnergyRatio, 1, true);
282  }
283  }
284 
285  reco::PFJet const * pfJet = dynamic_cast<reco::PFJet const *>( &* jet ) ;
286  pat::Jet const * patJet = dynamic_cast<pat::Jet const *>( &* jet ) ;
287  if ( pfJet != 0 )
288  {
289  vars.insert(btau::chargedHadronEnergyFraction,pfJet->chargedHadronEnergyFraction(), true);
290  vars.insert(btau::neutralHadronEnergyFraction,pfJet->neutralHadronEnergyFraction(), true);
291  vars.insert(btau::photonEnergyFraction,pfJet->photonEnergyFraction(), true);
292  vars.insert(btau::electronEnergyFraction,pfJet->electronEnergyFraction(), true);
293  vars.insert(btau::muonEnergyFraction,pfJet->muonEnergyFraction(), true);
294  vars.insert(btau::chargedHadronMultiplicity,pfJet->chargedHadronMultiplicity(), true);
295  vars.insert(btau::neutralHadronMultiplicity,pfJet->neutralHadronMultiplicity(), true);
296  vars.insert(btau::photonMultiplicity,pfJet->photonMultiplicity(), true);
297  vars.insert(btau::electronMultiplicity,pfJet->electronMultiplicity(), true);
298  vars.insert(btau::muonMultiplicity,pfJet->muonMultiplicity(), true);
299  vars.insert(btau::hadronMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity(), true);
300  vars.insert(btau::hadronPhotonMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity(), true);
301  vars.insert(btau::totalMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity()+pfJet->electronMultiplicity()+pfJet->muonMultiplicity(), true);
302 
303  }
304  else if( patJet != 0 && patJet->isPFJet() )
305  {
306  vars.insert(btau::chargedHadronEnergyFraction,patJet->chargedHadronEnergyFraction(), true);
307  vars.insert(btau::neutralHadronEnergyFraction,patJet->neutralHadronEnergyFraction(), true);
308  vars.insert(btau::photonEnergyFraction,patJet->photonEnergyFraction(), true);
309  vars.insert(btau::electronEnergyFraction,patJet->electronEnergyFraction(), true);
310  vars.insert(btau::muonEnergyFraction,patJet->muonEnergyFraction(), true);
311  vars.insert(btau::chargedHadronMultiplicity,patJet->chargedHadronMultiplicity(), true);
312  vars.insert(btau::neutralHadronMultiplicity,patJet->neutralHadronMultiplicity(), true);
313  vars.insert(btau::photonMultiplicity,patJet->photonMultiplicity(), true);
314  vars.insert(btau::electronMultiplicity,patJet->electronMultiplicity(), true);
315  vars.insert(btau::muonMultiplicity,patJet->muonMultiplicity(), true);
316  vars.insert(btau::hadronMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity(), true);
317  vars.insert(btau::hadronPhotonMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity(), true);
318  vars.insert(btau::totalMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity()+patJet->electronMultiplicity()+patJet->muonMultiplicity(), true);
319 
320  }
321  else
322  {
325  vars.insert(btau::photonEnergyFraction,0., true);
326  vars.insert(btau::electronEnergyFraction,0., true);
327  vars.insert(btau::muonEnergyFraction,0., true);
330  vars.insert(btau::photonMultiplicity,0, true);
331  vars.insert(btau::electronMultiplicity,0, true);
332  vars.insert(btau::muonMultiplicity,0, true);
333  vars.insert(btau::hadronMultiplicity,0, true);
335  vars.insert(btau::totalMultiplicity,0, true);
336  }
337 }
reco::TrackSelector trackSelector
const double piPlus
Definition: ParticleMasses.h:9
int i
Definition: DBlmapReader.cc:9
T mag2() const
Definition: PV3DBase.h:66
const math::XYZTLorentzVector & weightedVectorSum() const
unsigned int pseudoMultiplicityMin
void add(const reco::Track &track, double weight=1.0)
double etaRel(const math::XYZVector &dir, const math::XYZVector &track)
Measurement1D ip2d
Definition: IPTagInfo.h:31
reco::V0Filter pseudoVertexV0Filter
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:638
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
Jets made from PFObjects.
Definition: PFJet.h:21
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::btag::SortCriteria sortCriterium
reco::TrackSelector trackPseudoSelector
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
int j
Definition: DBlmapReader.cc:9
Measurement1D ip3d
Definition: IPTagInfo.h:32
IterationRange flipIterate(int size, bool vertex) const
reco::V0Filter trackPairV0Filter
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double significance() const
Definition: Measurement1D.h:32
unsigned int numberOfTracks() const
#define range_for(i, x)
GlobalPoint closestToJetAxis
Definition: IPTagInfo.h:29
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
double flipValue(double value, bool vertex) const
Analysis-level calorimeter jet class.
Definition: Jet.h:77
double value() const
Definition: Measurement1D.h:28
const reco::btag::TrackIPData & threshTrack(const reco::CandIPTagInfo &trackIPTagInfo, const reco::btag::SortCriteria sort, const reco::Jet &jet, const GlobalPoint &pv) const
Measurement1D distanceToJetAxis
Definition: IPTagInfo.h:33
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const math::XYZTLorentzVector & vectorSum() const
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
void insert(const TaggingVariable &variable, bool delayed=false)
unsigned int trackMultiplicityMin
CombinedSVComputer::IterationRange CombinedSVComputer::flipIterate ( int  size,
bool  vertex 
) const
inline

Definition at line 37 of file CombinedSVComputer.cc.

References CombinedSVComputer::IterationRange::begin, CombinedSVComputer::IterationRange::end, CombinedSVComputer::IterationRange::increment, findQualityFiles::size, trackFlip, and vertexFlip.

Referenced by fillCommonVariables(), and operator()().

39 {
40  IterationRange range;
41  if (vertex ? vertexFlip : trackFlip) {
42  range.begin = size - 1;
43  range.end = -1;
44  range.increment = -1;
45  } else {
46  range.begin = 0;
47  range.end = size;
48  range.increment = +1;
49  }
50 
51  return range;
52 }
tuple size
Write out results.
double CombinedSVComputer::flipValue ( double  value,
bool  vertex 
) const
inline

Definition at line 32 of file CombinedSVComputer.cc.

References trackFlip, relativeConstraints::value, and vertexFlip.

Referenced by fillCommonVariables().

33 {
34  return (vertex ? vertexFlip : trackFlip) ? -value : value;
35 }
TaggingVariableList CombinedSVComputer::operator() ( const reco::TrackIPTagInfo ipInfo,
const reco::SecondaryVertexTagInfo svInfo 
) const
virtual

Definition at line 134 of file CombinedSVComputer.cc.

References reco::btau::etaRel(), fillCommonVariables(), flipIterate(), reco::Vertex::hasRefittedTracks(), i, minTrackWeight, reco::LeafCandidate::momentum(), reco::TrackBase::momentum(), reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::nVertices(), reco::ParticleMasses::piPlus, range_for, reco::Vertex::refittedTrack(), reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::secondaryVertex(), mathSSE::sqrt(), reco::btau::trackEtaRel, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::trackWeight(), reco::btau::vertexFitProb, reco::btau::vertexNTracks, and w.

Referenced by CombinedSVSoftLeptonComputer::operator()().

136 {
137  using namespace ROOT::Math;
138 
139  edm::RefToBase<Jet> jet = ipInfo.jet();
140  math::XYZVector jetDir = jet->momentum().Unit();
141  TaggingVariableList vars;
142 
143  TrackKinematics vertexKinematics;
144 
145  double vtx_track_ptSum = 0.;
146  double vtx_track_ESum = 0.;
147 
148  // the following is specific depending on the type of vertex
149  int vtx = -1;
150  unsigned int numberofvertextracks = 0;
151 
152  IterationRange range = flipIterate(svInfo.nVertices(), true);
153  range_for(i, range) {
154 
155  numberofvertextracks = numberofvertextracks + (svInfo.secondaryVertex(i)).nTracks();
156 
157  const Vertex &vertex = svInfo.secondaryVertex(i);
158  bool hasRefittedTracks = vertex.hasRefittedTracks();
159  for(reco::Vertex::trackRef_iterator track = vertex.tracks_begin(); track != vertex.tracks_end(); track++) {
160  double w = vertex.trackWeight(*track);
161  if (w < minTrackWeight)
162  continue;
163  if (hasRefittedTracks) {
164  const Track actualTrack = vertex.refittedTrack(*track);
165  vertexKinematics.add(actualTrack, w);
166  vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,actualTrack.momentum()), true);
167  if(vtx < 0) // calculate this only for the first vertex
168  {
169  vtx_track_ptSum += std::sqrt(actualTrack.momentum().Perp2());
170  vtx_track_ESum += std::sqrt(actualTrack.momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
171  }
172  } else {
173  vertexKinematics.add(**track, w);
174  vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
175  if(vtx < 0) // calculate this only for the first vertex
176  {
177  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
178  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
179  }
180  }
181  }
182 
183  if (vtx < 0) vtx = i;
184  }
185  if(vtx>=0){
186  vars.insert(btau::vertexNTracks, numberofvertextracks, true);
187  vars.insert(btau::vertexFitProb,(svInfo.secondaryVertex(vtx)).normalizedChi2(), true);
188  }
189 
190  // after we collected vertex information we let the common code complete the job
191  fillCommonVariables(vars,vertexKinematics,ipInfo,svInfo,vtx_track_ptSum,vtx_track_ESum);
192 
193  vars.finalize();
194  return vars;
195 }
const double piPlus
Definition: ParticleMasses.h:9
int i
Definition: DBlmapReader.cc:9
const double w
Definition: UKUtility.cc:23
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
const VTX & secondaryVertex(unsigned int index) const
Track refittedTrack(const TrackBaseRef &track) const
double etaRel(const math::XYZVector &dir, const math::XYZVector &track)
bool hasRefittedTracks() const
Checks whether refitted tracks are stored.
Definition: Vertex.h:134
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:638
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
T sqrt(T t)
Definition: SSEVec.h:48
IterationRange flipIterate(int size, bool vertex) const
#define range_for(i, x)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void fillCommonVariables(reco::TaggingVariableList &vars, reco::TrackKinematics &vertexKinematics, const IPTI &ipInfo, const SVTI &svInfo, double &vtx_track_ptSum, double &vtx_track_ESum) const
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
TaggingVariableList CombinedSVComputer::operator() ( const reco::CandIPTagInfo ipInfo,
const reco::CandSecondaryVertexTagInfo svInfo 
) const
virtual

Definition at line 198 of file CombinedSVComputer.cc.

References reco::CompositePtrCandidate::daughterPtrVector(), reco::btau::etaRel(), fillCommonVariables(), flipIterate(), i, reco::LeafCandidate::momentum(), reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::nVertices(), reco::ParticleMasses::piPlus, range_for, reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::secondaryVertex(), mathSSE::sqrt(), reco::btau::trackEtaRel, reco::btau::vertexFitProb, and reco::btau::vertexNTracks.

200 {
201  using namespace ROOT::Math;
202 
203  edm::RefToBase<Jet> jet = ipInfo.jet();
204  math::XYZVector jetDir = jet->momentum().Unit();
205  TaggingVariableList vars;
206 
207  TrackKinematics vertexKinematics;
208 
209  double vtx_track_ptSum = 0.;
210  double vtx_track_ESum = 0.;
211 
212  // the following is specific depending on the type of vertex
213  int vtx = -1;
214  unsigned int numberofvertextracks = 0;
215 
216  IterationRange range = flipIterate(svInfo.nVertices(), true);
217  range_for(i, range) {
218 
219  numberofvertextracks = numberofvertextracks + (svInfo.secondaryVertex(i)).numberOfSourceCandidatePtrs();
220 
221  const reco::VertexCompositePtrCandidate &vertex = svInfo.secondaryVertex(i);
222  const std::vector<CandidatePtr> & tracks = vertex.daughterPtrVector();
223  for(std::vector<CandidatePtr>::const_iterator track = tracks.begin(); track != tracks.end(); ++track) {
224  vertexKinematics.add(*(*track)->bestTrack(), 1.0);
225  vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
226  if(vtx < 0) // calculate this only for the first vertex
227  {
228  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
229  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
230  }
231  }
232 
233  if (vtx < 0) vtx = i;
234  }
235  if(vtx>=0){
236  vars.insert(btau::vertexNTracks, numberofvertextracks, true);
237  vars.insert(btau::vertexFitProb,(svInfo.secondaryVertex(vtx)).vertexNormalizedChi2(), true);
238  }
239 
240  // after we collected vertex information we let the common code complete the job
241  fillCommonVariables(vars,vertexKinematics,ipInfo,svInfo,vtx_track_ptSum,vtx_track_ESum);
242 
243  vars.finalize();
244  return vars;
245 }
const double piPlus
Definition: ParticleMasses.h:9
int i
Definition: DBlmapReader.cc:9
const VTX & secondaryVertex(unsigned int index) const
double etaRel(const math::XYZVector &dir, const math::XYZVector &track)
T sqrt(T t)
Definition: SSEVec.h:48
IterationRange flipIterate(int size, bool vertex) const
#define range_for(i, x)
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void fillCommonVariables(reco::TaggingVariableList &vars, reco::TrackKinematics &vertexKinematics, const IPTI &ipInfo, const SVTI &svInfo, double &vtx_track_ptSum, double &vtx_track_ESum) const
const daughters & daughterPtrVector() const
references to daughtes
const reco::btag::TrackIPData& CombinedSVComputer::threshTrack ( const reco::CandIPTagInfo trackIPTagInfo,
const reco::btag::SortCriteria  sort,
const reco::Jet jet,
const GlobalPoint pv 
) const

Referenced by fillCommonVariables().

const reco::btag::TrackIPData& CombinedSVComputer::threshTrack ( const reco::TrackIPTagInfo trackIPTagInfo,
const reco::btag::SortCriteria  sort,
const reco::Jet jet,
const GlobalPoint pv 
) const

Member Data Documentation

double CombinedSVComputer::charmCut
private

Definition at line 79 of file CombinedSVComputer.h.

double CombinedSVComputer::minTrackWeight
private

Definition at line 86 of file CombinedSVComputer.h.

Referenced by operator()().

unsigned int CombinedSVComputer::pseudoMultiplicityMin
private

Definition at line 84 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::V0Filter CombinedSVComputer::pseudoVertexV0Filter
private

Definition at line 89 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::btag::SortCriteria CombinedSVComputer::sortCriterium
private

Definition at line 80 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

std::vector<reco::btau::TaggingVariableName> CombinedSVComputer::taggingVariables
private

Definition at line 91 of file CombinedSVComputer.h.

bool CombinedSVComputer::trackFlip
private

Definition at line 77 of file CombinedSVComputer.h.

Referenced by flipIterate(), and flipValue().

unsigned int CombinedSVComputer::trackMultiplicityMin
private

Definition at line 85 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackNoDeltaRSelector
private

Definition at line 82 of file CombinedSVComputer.h.

reco::V0Filter CombinedSVComputer::trackPairV0Filter
private

Definition at line 90 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackPseudoSelector
private

Definition at line 83 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackSelector
private

Definition at line 81 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

bool CombinedSVComputer::useTrackWeights
private

Definition at line 87 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

bool CombinedSVComputer::vertexFlip
private

Definition at line 78 of file CombinedSVComputer.h.

Referenced by flipIterate(), and flipValue().

bool CombinedSVComputer::vertexMassCorrection
private

Definition at line 88 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().