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:
CombinedSVComputerV2 CombinedSVSoftLeptonComputer

Classes

struct  IterationRange
 

Public Member Functions

void clearTaggingVariables ()
 
 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
 
bool isUsed (reco::btau::TaggingVariableName var) 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
 
void sortTaggingVariables ()
 
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
 
void useTaggingVariable (reco::btau::TaggingVariableName var)
 

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.

References clearTaggingVariables(), reco::btau::flightDistance2dSig, reco::btau::flightDistance2dVal, reco::btau::flightDistance3dSig, reco::btau::flightDistance3dVal, reco::btau::jetEta, reco::btau::jetNSecondaryVertices, reco::btau::jetPt, sortTaggingVariables(), reco::btau::trackDecayLenVal, reco::btau::trackDeltaR, reco::btau::trackEta, reco::btau::trackEtaRel, reco::btau::trackJetDistVal, reco::btau::trackMomentum, reco::btau::trackPPar, reco::btau::trackPParRatio, reco::btau::trackPtRatio, reco::btau::trackPtRel, reco::btau::trackSip2dSig, reco::btau::trackSip2dSigAboveCharm, reco::btau::trackSip2dVal, reco::btau::trackSip3dSig, reco::btau::trackSip3dSigAboveCharm, reco::btau::trackSip3dVal, reco::btau::trackSumJetDeltaR, reco::btau::trackSumJetEtRatio, useTaggingVariable(), reco::btau::vertexCategory, reco::btau::vertexEnergyRatio, reco::btau::vertexJetDeltaR, reco::btau::vertexMass, and reco::btau::vertexNTracks.

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 {
30 
31  // define used TaggingVariables
34 
52 
64 
65  // sort TaggingVariables for faster lookup later
67 }
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
void useTaggingVariable(reco::btau::TaggingVariableName var)
unsigned int trackMultiplicityMin

Member Function Documentation

void CombinedSVComputer::clearTaggingVariables ( )
inline

Definition at line 53 of file CombinedSVComputer.h.

References taggingVariables.

Referenced by CombinedSVComputer(), and CombinedSVComputerV2::CombinedSVComputerV2().

53 { taggingVariables.clear(); }
std::vector< reco::btau::TaggingVariableName > taggingVariables
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 100 of file CombinedSVComputer.h.

References reco::TrackKinematics::add(), reco::btau::chargedHadronEnergyFraction, reco::btau::chargedHadronMultiplicity, reco::btag::TrackIPData::closestToJetAxis, data, 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, isUsed(), 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, pfJet, reco::btau::photonEnergyFraction, reco::btau::photonMultiplicity, reco::ParticleMasses::piPlus, pseudoMultiplicityMin, reco::btag::Vertices::PseudoVertex, pseudoVertexV0Filter, 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()().

103 {
104  using namespace ROOT::Math;
105  using namespace reco;
106 
107  edm::RefToBase<Jet> jet = ipInfo.jet();
108  math::XYZVector jetDir = jet->momentum().Unit();
109  bool havePv = ipInfo.primaryVertex().isNonnull();
110  GlobalPoint pv;
111  if (havePv)
112  pv = GlobalPoint(ipInfo.primaryVertex()->x(),
113  ipInfo.primaryVertex()->y(),
114  ipInfo.primaryVertex()->z());
115 
117 
118 
119  if( isUsed(btau::jetPt) ) vars.insert(btau::jetPt, jet->pt(), true);
120  if( isUsed(btau::jetEta) ) vars.insert(btau::jetEta, jet->eta(), true);
121 
122  if (ipInfo.selectedTracks().size() < trackMultiplicityMin)
123  return;
124 
125  if( isUsed(btau::jetNTracks) ) vars.insert(btau::jetNTracks, ipInfo.selectedTracks().size(), true);
126 
127  TrackKinematics allKinematics;
128  TrackKinematics trackJetKinematics;
129 
130  double jet_track_ESum= 0.;
131 
132  int vtx = -1;
133 
134  IterationRange range = flipIterate(svInfo.nVertices(), true);
135  range_for(i , range) {
136  if (vtx < 0) vtx = i;
137  }
138 
139  if (vtx >= 0) {
140  vtxType = btag::Vertices::RecoVertex;
141 
142  if( isUsed(btau::flightDistance2dVal) ) vars.insert(btau::flightDistance2dVal,flipValue(svInfo.flightDistance(vtx, true).value(),true),true);
143  if( isUsed(btau::flightDistance2dSig) ) vars.insert(btau::flightDistance2dSig,flipValue(svInfo.flightDistance(vtx, true).significance(),true),true);
144  if( isUsed(btau::flightDistance3dVal) ) vars.insert(btau::flightDistance3dVal,flipValue(svInfo.flightDistance(vtx, false).value(),true),true);
145  if( isUsed(btau::flightDistance3dSig) ) vars.insert(btau::flightDistance3dSig,flipValue(svInfo.flightDistance(vtx, false).significance(),true),true);
146  if( isUsed(btau::vertexJetDeltaR) ) vars.insert(btau::vertexJetDeltaR,Geom::deltaR(svInfo.flightDirection(vtx), jetDir),true);
147  if( isUsed(btau::jetNSecondaryVertices) ) vars.insert(btau::jetNSecondaryVertices, svInfo.nVertices(), true);
148  }
149 
150  std::vector<std::size_t> indices = ipInfo.sortedIndexes(sortCriterium);
151  const std::vector<reco::btag::TrackIPData> &ipData = ipInfo.impactParameterData();
152 
153  const typename IPTI::input_container &tracks = ipInfo.selectedTracks();
154  std::vector<const Track *> pseudoVertexTracks;
155 
156  const Track * trackPairV0Test[2];
157  range = flipIterate(indices.size(), false);
158  range_for(i, range) {
159  std::size_t idx = indices[i];
160  const reco::btag::TrackIPData &data = ipData[idx];
161  const Track * trackPtr = reco::btag::toTrack(tracks[idx]);
162  const Track &track = *trackPtr;
163 
164  jet_track_ESum += std::sqrt(track.momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
165 
166  // add track to kinematics for all tracks in jet
167  //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...
168 
169  // filter track -> this track selection can be tighter than the vertex track selection (used to fill the track related variables...)
170  if (!trackSelector(track, data, *jet, pv))
171  continue;
172 
173  // add track to kinematics for all tracks in jet
174  allKinematics.add(track);
175 
176  // if no vertex was reconstructed, attempt pseudo vertex
177  if (vtxType == btag::Vertices::NoVertex && trackPseudoSelector(track, data, *jet, pv)) {
178  pseudoVertexTracks.push_back(trackPtr);
179  vertexKinematics.add(track);
180  }
181 
182  // check against all other tracks for V0 track pairs
183  trackPairV0Test[0] = reco::btag::toTrack(tracks[idx]);
184  bool ok = true;
185  range_for(j, range) {
186  if (i == j)
187  continue;
188 
189  std::size_t pairIdx = indices[j];
190  const reco::btag::TrackIPData &pairTrackData = ipData[pairIdx];
191  const Track * pairTrackPtr = reco::btag::toTrack(tracks[pairIdx]);
192  const Track &pairTrack = *pairTrackPtr;
193 
194  if (!trackSelector(pairTrack, pairTrackData, *jet, pv))
195  continue;
196 
197  trackPairV0Test[1] = pairTrackPtr;
198  if (!trackPairV0Filter(trackPairV0Test, 2)) {
199  ok = false;
200  break;
201  }
202  }
203  if (!ok)
204  continue;
205 
206  trackJetKinematics.add(track);
207 
208  // add track variables
209  math::XYZVector trackMom = track.momentum();
210  double trackMag = std::sqrt(trackMom.Mag2());
211 
212  if( isUsed(btau::trackSip3dVal) ) vars.insert(btau::trackSip3dVal, flipValue(data.ip3d.value(), false), true);
214  if( isUsed(btau::trackSip2dVal) ) vars.insert(btau::trackSip2dVal, flipValue(data.ip2d.value(), false), true);
217 // if( isUsed(btau::trackJetDistSig) ) vars.insert(btau::trackJetDistSig, data.distanceToJetAxis.significance(), true);
218 // if( isUsed(btau::trackFirstTrackDist) ) vars.insert(btau::trackFirstTrackDist, data.distanceToFirstTrack, true);
219 // if( isUsed(btau::trackGhostTrackVal) ) vars.insert(btau::trackGhostTrackVal, data.distanceToGhostTrack.value(), true);
220 // if( isUsed(btau::trackGhostTrackSig) ) vars.insert(btau::trackGhostTrackSig, data.distanceToGhostTrack.significance(), true);
221  if( isUsed(btau::trackDecayLenVal) ) vars.insert(btau::trackDecayLenVal, havePv ? (data.closestToJetAxis - pv).mag() : -1.0, true);
222 
223  if( isUsed(btau::trackMomentum) ) vars.insert(btau::trackMomentum, trackMag, true);
224  if( isUsed(btau::trackEta) ) vars.insert(btau::trackEta, trackMom.Eta(), true);
225 
226  if( isUsed(btau::trackPtRel) ) vars.insert(btau::trackPtRel, VectorUtil::Perp(trackMom, jetDir), true);
227  if( isUsed(btau::trackPPar) ) vars.insert(btau::trackPPar, jetDir.Dot(trackMom), true);
228  if( isUsed(btau::trackDeltaR) ) vars.insert(btau::trackDeltaR, VectorUtil::DeltaR(trackMom, jetDir), true);
229  if( isUsed(btau::trackPtRatio) ) vars.insert(btau::trackPtRatio, VectorUtil::Perp(trackMom, jetDir) / trackMag, true);
230  if( isUsed(btau::trackPParRatio) ) vars.insert(btau::trackPParRatio, jetDir.Dot(trackMom) / trackMag, true);
231  }
232 
233  if (vtxType == btag::Vertices::NoVertex && vertexKinematics.numberOfTracks() >= pseudoMultiplicityMin && pseudoVertexV0Filter(pseudoVertexTracks))
234  {
236  for(std::vector<const Track *>::const_iterator track = pseudoVertexTracks.begin(); track != pseudoVertexTracks.end(); ++track)
237  {
238  if( isUsed(btau::trackEtaRel) ) vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
239  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
240  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
241  }
242  }
243 
244  if( isUsed(btau::vertexCategory) ) vars.insert(btau::vertexCategory, vtxType, true);
245 
246  if( isUsed(btau::trackJetPt) ) vars.insert(btau::trackJetPt, trackJetKinematics.vectorSum().Pt(), true);
247  if( isUsed(btau::trackSumJetDeltaR) ) vars.insert(btau::trackSumJetDeltaR,VectorUtil::DeltaR(allKinematics.vectorSum(), jetDir), true);
248  if( isUsed(btau::trackSumJetEtRatio) ) vars.insert(btau::trackSumJetEtRatio,allKinematics.vectorSum().Et() / ipInfo.jet()->et(), true);
249 
250  if( isUsed(btau::trackSip3dSigAboveCharm) ) vars.insert(btau::trackSip3dSigAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP3DSig, *jet, pv).ip3d.significance(),false),true);
252  if( isUsed(btau::trackSip2dSigAboveCharm) ) vars.insert(btau::trackSip2dSigAboveCharm, flipValue(threshTrack(ipInfo, reco::btag::IP2DSig, *jet, pv).ip2d.significance(),false),true);
254 
255  if (vtxType != btag::Vertices::NoVertex) {
257  ? allKinematics.weightedVectorSum()
258  : allKinematics.vectorSum();
260  ? vertexKinematics.weightedVectorSum()
261  : vertexKinematics.vectorSum();
262 
263  if (vtxType != btag::Vertices::RecoVertex) {
264  if( isUsed(btau::vertexNTracks) ) vars.insert(btau::vertexNTracks,vertexKinematics.numberOfTracks(), true);
265  if( isUsed(btau::vertexJetDeltaR) ) vars.insert(btau::vertexJetDeltaR,VectorUtil::DeltaR(vertexSum, jetDir), true);
266  }
267 
268  double vertexMass = vertexSum.M();
269  if (vtxType == btag::Vertices::RecoVertex &&
271  GlobalVector dir = svInfo.flightDirection(vtx);
272  double vertexPt2 = math::XYZVector(dir.x(), dir.y(), dir.z()).Cross(vertexSum).Mag2() / dir.mag2();
273  vertexMass = std::sqrt(vertexMass * vertexMass + vertexPt2) + std::sqrt(vertexPt2);
274  }
275  if( isUsed(btau::vertexMass) ) vars.insert(btau::vertexMass, vertexMass, true);
276 
277  double varPi = (vertexMass/5.2794) * (vtx_track_ESum /jet_track_ESum); // 5.2794 should be the average B meson mass of PDG! CHECK!!!
279  double varB = (std::sqrt(5.2794) * vtx_track_ptSum) / ( vertexMass * std::sqrt(jet->pt()));
280  if( isUsed(btau::vertexBoostOverSqrtJetPt) ) vars.insert(btau::vertexBoostOverSqrtJetPt,varB*varB/(varB*varB + 10.), true);
281 
282  if (allKinematics.numberOfTracks()) {
283  if( isUsed(btau::vertexEnergyRatio) ) vars.insert(btau::vertexEnergyRatio, vertexSum.E() / allSum.E(), true);
284  }
285  else {
287  }
288  }
289 
290  reco::PFJet const * pfJet = dynamic_cast<reco::PFJet const *>( &* jet ) ;
291  pat::Jet const * patJet = dynamic_cast<pat::Jet const *>( &* jet ) ;
292  if ( pfJet != 0 )
293  {
294  if( isUsed(btau::chargedHadronEnergyFraction) ) vars.insert(btau::chargedHadronEnergyFraction,pfJet->chargedHadronEnergyFraction(), true);
295  if( isUsed(btau::neutralHadronEnergyFraction) ) vars.insert(btau::neutralHadronEnergyFraction,pfJet->neutralHadronEnergyFraction(), true);
296  if( isUsed(btau::photonEnergyFraction) ) vars.insert(btau::photonEnergyFraction,pfJet->photonEnergyFraction(), true);
297  if( isUsed(btau::electronEnergyFraction) ) vars.insert(btau::electronEnergyFraction,pfJet->electronEnergyFraction(), true);
298  if( isUsed(btau::muonEnergyFraction) ) vars.insert(btau::muonEnergyFraction,pfJet->muonEnergyFraction(), true);
299  if( isUsed(btau::chargedHadronMultiplicity) ) vars.insert(btau::chargedHadronMultiplicity,pfJet->chargedHadronMultiplicity(), true);
300  if( isUsed(btau::neutralHadronMultiplicity) ) vars.insert(btau::neutralHadronMultiplicity,pfJet->neutralHadronMultiplicity(), true);
301  if( isUsed(btau::photonMultiplicity) ) vars.insert(btau::photonMultiplicity,pfJet->photonMultiplicity(), true);
302  if( isUsed(btau::electronMultiplicity) ) vars.insert(btau::electronMultiplicity,pfJet->electronMultiplicity(), true);
303  if( isUsed(btau::muonMultiplicity) ) vars.insert(btau::muonMultiplicity,pfJet->muonMultiplicity(), true);
304  if( isUsed(btau::hadronMultiplicity) ) vars.insert(btau::hadronMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity(), true);
305  if( isUsed(btau::hadronPhotonMultiplicity) ) vars.insert(btau::hadronPhotonMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity(), true);
306  if( isUsed(btau::totalMultiplicity) ) vars.insert(btau::totalMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity()+pfJet->electronMultiplicity()+pfJet->muonMultiplicity(), true);
307 
308  }
309  else if( patJet != 0 && patJet->isPFJet() )
310  {
311  if( isUsed(btau::chargedHadronEnergyFraction) ) vars.insert(btau::chargedHadronEnergyFraction,patJet->chargedHadronEnergyFraction(), true);
312  if( isUsed(btau::neutralHadronEnergyFraction) ) vars.insert(btau::neutralHadronEnergyFraction,patJet->neutralHadronEnergyFraction(), true);
313  if( isUsed(btau::photonEnergyFraction) ) vars.insert(btau::photonEnergyFraction,patJet->photonEnergyFraction(), true);
314  if( isUsed(btau::electronEnergyFraction) ) vars.insert(btau::electronEnergyFraction,patJet->electronEnergyFraction(), true);
315  if( isUsed(btau::muonEnergyFraction) ) vars.insert(btau::muonEnergyFraction,patJet->muonEnergyFraction(), true);
316  if( isUsed(btau::chargedHadronMultiplicity) ) vars.insert(btau::chargedHadronMultiplicity,patJet->chargedHadronMultiplicity(), true);
317  if( isUsed(btau::neutralHadronMultiplicity) ) vars.insert(btau::neutralHadronMultiplicity,patJet->neutralHadronMultiplicity(), true);
318  if( isUsed(btau::photonMultiplicity) ) vars.insert(btau::photonMultiplicity,patJet->photonMultiplicity(), true);
319  if( isUsed(btau::electronMultiplicity) ) vars.insert(btau::electronMultiplicity,patJet->electronMultiplicity(), true);
320  if( isUsed(btau::muonMultiplicity) ) vars.insert(btau::muonMultiplicity,patJet->muonMultiplicity(), true);
321  if( isUsed(btau::hadronMultiplicity) ) vars.insert(btau::hadronMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity(), true);
322  if( isUsed(btau::hadronPhotonMultiplicity) ) vars.insert(btau::hadronPhotonMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity(), true);
323  if( isUsed(btau::totalMultiplicity) ) vars.insert(btau::totalMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity()+patJet->electronMultiplicity()+patJet->muonMultiplicity(), true);
324 
325  }
326  else
327  {
341  }
342 }
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
const reco::Track * toTrack(const reco::TrackRef &t)
Definition: IPTagInfo.h:24
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:30
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:651
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:31
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:28
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:73
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:32
bool isUsed(reco::btau::TaggingVariableName var) const
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 74 of file CombinedSVComputer.cc.

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

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

76 {
77  IterationRange range;
78  if (vertex ? vertexFlip : trackFlip) {
79  range.begin = size - 1;
80  range.end = -1;
81  range.increment = -1;
82  } else {
83  range.begin = 0;
84  range.end = size;
85  range.increment = +1;
86  }
87 
88  return range;
89 }
tuple size
Write out results.
double CombinedSVComputer::flipValue ( double  value,
bool  vertex 
) const
inline

Definition at line 69 of file CombinedSVComputer.cc.

References trackFlip, relativeConstraints::value, and vertexFlip.

Referenced by fillCommonVariables().

70 {
71  return (vertex ? vertexFlip : trackFlip) ? -value : value;
72 }
bool CombinedSVComputer::isUsed ( reco::btau::TaggingVariableName  var) const
inline

Definition at line 56 of file CombinedSVComputer.h.

References taggingVariables.

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

56 { return std::binary_search(taggingVariables.begin(), taggingVariables.end(), var); }
std::vector< reco::btau::TaggingVariableName > taggingVariables
TaggingVariableList CombinedSVComputer::operator() ( const reco::TrackIPTagInfo ipInfo,
const reco::SecondaryVertexTagInfo svInfo 
) const
virtual

Definition at line 171 of file CombinedSVComputer.cc.

References reco::btau::etaRel(), fillCommonVariables(), flipIterate(), reco::Vertex::hasRefittedTracks(), i, isUsed(), 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()().

173 {
174  using namespace ROOT::Math;
175 
176  edm::RefToBase<Jet> jet = ipInfo.jet();
177  math::XYZVector jetDir = jet->momentum().Unit();
178  TaggingVariableList vars;
179 
180  TrackKinematics vertexKinematics;
181 
182  double vtx_track_ptSum = 0.;
183  double vtx_track_ESum = 0.;
184 
185  // the following is specific depending on the type of vertex
186  int vtx = -1;
187  unsigned int numberofvertextracks = 0;
188 
189  IterationRange range = flipIterate(svInfo.nVertices(), true);
190  range_for(i, range) {
191 
192  numberofvertextracks = numberofvertextracks + (svInfo.secondaryVertex(i)).nTracks();
193 
194  const Vertex &vertex = svInfo.secondaryVertex(i);
195  bool hasRefittedTracks = vertex.hasRefittedTracks();
196  for(reco::Vertex::trackRef_iterator track = vertex.tracks_begin(); track != vertex.tracks_end(); track++) {
197  double w = vertex.trackWeight(*track);
198  if (w < minTrackWeight)
199  continue;
200  if (hasRefittedTracks) {
201  const Track actualTrack = vertex.refittedTrack(*track);
202  vertexKinematics.add(actualTrack, w);
203  if( isUsed(btau::trackEtaRel) ) vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,actualTrack.momentum()), true);
204  if(vtx < 0) // calculate this only for the first vertex
205  {
206  vtx_track_ptSum += std::sqrt(actualTrack.momentum().Perp2());
207  vtx_track_ESum += std::sqrt(actualTrack.momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
208  }
209  } else {
210  vertexKinematics.add(**track, w);
211  if( isUsed(btau::trackEtaRel) ) vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
212  if(vtx < 0) // calculate this only for the first vertex
213  {
214  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
215  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
216  }
217  }
218  }
219 
220  if (vtx < 0) vtx = i;
221  }
222  if(vtx>=0){
223  if( isUsed(btau::vertexNTracks) ) vars.insert(btau::vertexNTracks, numberofvertextracks, true);
224  if( isUsed(btau::vertexFitProb) ) vars.insert(btau::vertexFitProb,(svInfo.secondaryVertex(vtx)).normalizedChi2(), true);
225  }
226 
227  // after we collected vertex information we let the common code complete the job
228  fillCommonVariables(vars,vertexKinematics,ipInfo,svInfo,vtx_track_ptSum,vtx_track_ESum);
229 
230  vars.finalize();
231  return vars;
232 }
const double piPlus
Definition: ParticleMasses.h:9
int i
Definition: DBlmapReader.cc:9
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:651
T sqrt(T t)
Definition: SSEVec.h:48
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:74
IterationRange flipIterate(int size, bool vertex) const
#define range_for(i, x)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
bool isUsed(reco::btau::TaggingVariableName var) const
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
T w() const
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 235 of file CombinedSVComputer.cc.

References reco::CompositePtrCandidate::daughterPtrVector(), reco::btau::etaRel(), fillCommonVariables(), flipIterate(), i, isUsed(), 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.

237 {
238  using namespace ROOT::Math;
239 
240  edm::RefToBase<Jet> jet = ipInfo.jet();
241  math::XYZVector jetDir = jet->momentum().Unit();
242  TaggingVariableList vars;
243 
244  TrackKinematics vertexKinematics;
245 
246  double vtx_track_ptSum = 0.;
247  double vtx_track_ESum = 0.;
248 
249  // the following is specific depending on the type of vertex
250  int vtx = -1;
251  unsigned int numberofvertextracks = 0;
252 
253  IterationRange range = flipIterate(svInfo.nVertices(), true);
254  range_for(i, range) {
255 
256  numberofvertextracks = numberofvertextracks + (svInfo.secondaryVertex(i)).numberOfSourceCandidatePtrs();
257 
258  const reco::VertexCompositePtrCandidate &vertex = svInfo.secondaryVertex(i);
259  const std::vector<CandidatePtr> tracks = vertex.daughterPtrVector();
260  for(std::vector<CandidatePtr>::const_iterator track = tracks.begin(); track != tracks.end(); ++track) {
261  vertexKinematics.add(*(*track)->bestTrack(), 1.0);
262  if( isUsed(btau::trackEtaRel) ) vars.insert(btau::trackEtaRel, reco::btau::etaRel(jetDir,(*track)->momentum()), true);
263  if(vtx < 0) // calculate this only for the first vertex
264  {
265  vtx_track_ptSum += std::sqrt((*track)->momentum().Perp2());
266  vtx_track_ESum += std::sqrt((*track)->momentum().Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
267  }
268  }
269 
270  if (vtx < 0) vtx = i;
271  }
272  if(vtx>=0){
273  if( isUsed(btau::vertexNTracks) ) vars.insert(btau::vertexNTracks, numberofvertextracks, true);
274  if( isUsed(btau::vertexFitProb) ) vars.insert(btau::vertexFitProb,(svInfo.secondaryVertex(vtx)).vertexNormalizedChi2(), true);
275  }
276 
277  // after we collected vertex information we let the common code complete the job
278  fillCommonVariables(vars,vertexKinematics,ipInfo,svInfo,vtx_track_ptSum,vtx_track_ESum);
279 
280  vars.finalize();
281  return vars;
282 }
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
bool isUsed(reco::btau::TaggingVariableName var) const
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
void CombinedSVComputer::sortTaggingVariables ( )
inline

Definition at line 54 of file CombinedSVComputer.h.

References python.multivaluedict::sort(), and taggingVariables.

Referenced by CombinedSVComputer(), and CombinedSVComputerV2::CombinedSVComputerV2().

54 { std::sort(taggingVariables.begin(), taggingVariables.end()); }
std::vector< reco::btau::TaggingVariableName > taggingVariables
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
void CombinedSVComputer::useTaggingVariable ( reco::btau::TaggingVariableName  var)
inline

Definition at line 55 of file CombinedSVComputer.h.

References taggingVariables.

Referenced by CombinedSVComputer(), and CombinedSVComputerV2::CombinedSVComputerV2().

55 { taggingVariables.push_back(var); }
std::vector< reco::btau::TaggingVariableName > taggingVariables

Member Data Documentation

double CombinedSVComputer::charmCut
private

Definition at line 84 of file CombinedSVComputer.h.

double CombinedSVComputer::minTrackWeight
private

Definition at line 91 of file CombinedSVComputer.h.

Referenced by operator()().

unsigned int CombinedSVComputer::pseudoMultiplicityMin
private

Definition at line 89 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::V0Filter CombinedSVComputer::pseudoVertexV0Filter
private

Definition at line 94 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

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

Definition at line 85 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

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

Definition at line 82 of file CombinedSVComputer.h.

Referenced by flipIterate(), and flipValue().

unsigned int CombinedSVComputer::trackMultiplicityMin
private

Definition at line 90 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackNoDeltaRSelector
private

Definition at line 87 of file CombinedSVComputer.h.

reco::V0Filter CombinedSVComputer::trackPairV0Filter
private

Definition at line 95 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackPseudoSelector
private

Definition at line 88 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

reco::TrackSelector CombinedSVComputer::trackSelector
private

Definition at line 86 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

bool CombinedSVComputer::useTrackWeights
private

Definition at line 92 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().

bool CombinedSVComputer::vertexFlip
private

Definition at line 83 of file CombinedSVComputer.h.

Referenced by flipIterate(), and flipValue().

bool CombinedSVComputer::vertexMassCorrection
private

Definition at line 93 of file CombinedSVComputer.h.

Referenced by fillCommonVariables().