CMS 3D CMS Logo

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

#include <PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h>

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
IdealHelixParametersgetIdealHelixParameters ()
 
TrajectorySeedCollectiongetTrajectorySeedCollection ()
 
TrajectorySeedCollectiongetTrajectorySeedCollectionOfSourceTracks ()
 
 PhotonConversionTrajectorySeedProducerFromSingleLegAlgo (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
 ~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo ()
 

Private Types

typedef Regions::const_iterator IR
 
typedef std::vector
< TrackingRegion * > 
Regions
 

Private Member Functions

bool inspectTrack (const reco::Track *track, const TrackingRegion &region, math::XYZPoint &primaryVertexPoint)
 
void loopOnPriVtx (const reco::Track &tk, const std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
 
void loopOnTracks ()
 
bool rejectTrack (const reco::Track &track)
 
bool selectPriVtxCompatibleWithTrack (const reco::Track &tk, std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
 

Private Attributes

bool _applyTkVtxConstraint
 
edm::InputTag _beamSpotInputTag
 
const edm::ParameterSet _conf
 
size_t _countSeedTracks
 
IdealHelixParameters _IdealHelixParameters
 
double _maxDZSigmas
 
size_t _maxNumSelVtx
 
edm::InputTag _primaryVtxInputTag
 
double _vtxMinDoF
 
const MagneticFieldmagField
 
const edm::EventSetupmyEsetup
 
const edm::EventmyEvent
 
PrintRecoObjects po
 
reco::Vertex primaryVertex
 
edm::Handle< reco::BeamSpotrecoBeamSpotHandle
 
Regions regions
 
TrajectorySeedCollectionseedCollection
 
TrajectorySeedCollectionseedCollectionOfSourceTracks
 
std::stringstream ss
 
const reco::BeamSpottheBeamSpot
 
ClusterChecker theClusterCheck
 
std::unique_ptr
< CombinedHitPairGeneratorForPhotonConversion
theHitsGenerator
 
std::unique_ptr
< GlobalTrackingRegionProducerFromBeamSpot
theRegionProducer
 
std::unique_ptr
< SeedForPhotonConversion1Leg
theSeedCreator
 
bool theSilentOnClusterCheck
 
edm::EDGetTokenT< reco::BeamSpottoken_bs
 
edm::EDGetTokenT
< reco::TrackCollection
token_refitter
 
edm::EDGetTokenT
< reco::VertexCollection
token_vertex
 
edm::Handle
< reco::TrackCollection
trackCollectionH
 
edm::Handle
< TrajTrackAssociationCollection
trajTrackAssociations
 
reco::VertexCollection vertexCollection
 
edm::Handle
< reco::VertexCollection
vertexHandle
 

Detailed Description

Definition at line 33 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Member Typedef Documentation

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::IR
private

Constructor & Destructor Documentation

PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::PhotonConversionTrajectorySeedProducerFromSingleLegAlgo ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 16 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _beamSpotInputTag, _conf, _primaryVtxInputTag, edm::ParameterSet::getParameter(), token_bs, token_refitter, and token_vertex.

22  theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet"), iC),
23  theSilentOnClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false)),
24  _vtxMinDoF(conf.getParameter<double>("vtxMinDoF")),
25  _maxDZSigmas(conf.getParameter<double>("maxDZSigmas")),
26  _maxNumSelVtx(conf.getParameter<uint32_t>("maxNumSelVtx")),
27  _applyTkVtxConstraint(conf.getParameter<bool>("applyTkVtxConstraint")),
29  _primaryVtxInputTag(conf.getParameter<edm::InputTag>("primaryVerticesTag")),
30  _beamSpotInputTag(conf.getParameter<edm::InputTag>("beamSpotInputTag"))
31 {
35 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo ( )

Definition at line 37 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

37  {
38 }

Member Function Documentation

void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::analyze ( const edm::Event event,
const edm::EventSetup setup 
)

Definition at line 41 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _IdealHelixParameters, _primaryVtxInputTag, event(), edm::EventSetup::get(), MagneticField::inTesla(), edm::HandleBase::isValid(), loopOnTracks(), magField, myEsetup, myEvent, po, PrintRecoObjects::print(), edm::ESHandle< class >::product(), recoBeamSpotHandle, regions, mathSSE::return(), seedCollection, seedCollectionOfSourceTracks, IdealHelixParameters::setMagnField(), HcalObjRepresent::setup(), ss, theClusterCheck, theHitsGenerator, theRegionProducer, theSilentOnClusterCheck, token_bs, token_vertex, ClusterChecker::tooManyClusters(), unlikely, vertexHandle, and PV3DBase< T, PVType, FrameType >::z().

Referenced by PhotonConversionTrajectorySeedProducerFromSingleLeg::produce().

41  {
42 
43  myEsetup = &setup;
44  myEvent = &event;
45 
46  if(seedCollection!=0)
47  delete seedCollection;
48 
51 
54 
55  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
56  if (clustsOrZero){
58  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
59  return ;
60  }
61 
62 
63  edm::ESHandle<MagneticField> handleMagField;
64  setup.get<IdealMagneticFieldRecord>().get(handleMagField);
65  magField = handleMagField.product();
66  if (unlikely(magField->inTesla(GlobalPoint(0.,0.,0.)).z()<0.01)) return;
67 
69 
70 
71  event.getByToken(token_vertex, vertexHandle);
72  if (!vertexHandle.isValid() || vertexHandle->empty()){
73  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _primaryVtxInputTag << "\n";
74  return;
75  }
76 
77  event.getByToken(token_bs,recoBeamSpotHandle);
78 
79 
80  regions = theRegionProducer->regions(event,setup);
81 
82  //Do the analysis
83  loopOnTracks();
84 
85 
86 #ifdef debugTSPFSLA
87  std::stringstream ss;
88  ss.str("");
89  ss << "\n++++++++++++++++++\n";
90  ss << "seed collection size " << seedCollection->size();
91  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
92  po.print(ss, tjS);
93  }
94  edm::LogInfo("debugTrajSeedFromSingleLeg") << ss.str();
95  //-------------------------------------------------
96 #endif
97 
98  // clear memory
99  theHitsGenerator->clearLayerCache();
100  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
101 
102 }
void setMagnField(const MagneticField *magnField)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
return((rh^lh)&mask)
#define unlikely(x)
std::vector< TrajectorySeed > TrajectorySeedCollection
T z() const
Definition: PV3DBase.h:64
size_t tooManyClusters(const edm::Event &e) const
void print(std::stringstream &ss, const SiStripCluster &clus)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:76
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
IdealHelixParameters* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getIdealHelixParameters ( )
inline
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getTrajectorySeedCollection ( )
inline
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getTrajectorySeedCollectionOfSourceTracks ( )
inline
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::inspectTrack ( const reco::Track track,
const TrackingRegion region,
math::XYZPoint primaryVertexPoint 
)
private

Definition at line 295 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _IdealHelixParameters, funct::abs(), reco::TrackBase::charge(), alignCSCRings::e, f, IdealHelixParameters::GetMomentumAtTangentPoint(), IdealHelixParameters::GetTangentPoint(), edm::isNotFinite(), myEsetup, myEvent, PV3DBase< T, PVType, FrameType >::perp(), ptmin, seedCollection, IdealHelixParameters::setData(), OrderedSeedingHits::size(), ss, theHitsGenerator, theSeedCreator, and reco::TrackBase::thetaError().

Referenced by loopOnPriVtx().

295  {
296 
297  _IdealHelixParameters.setData(track,primaryVertexPoint);
298 
301  //this case means a null results on the _IdealHelixParameters side
302  return false;
303  }
304 
305  float rMin=3.; //cm
306  if(_IdealHelixParameters.GetTangentPoint().rho()<rMin){
307  //this case means a track that has the tangent point nearby the primary vertex
308  // if the track is primary, this number tends to be the primary vertex itself
309  //Rejecting all the potential photon conversions having a "vertex" inside the beampipe
310  //We should not miss too much, seen that the conversions at the beam pipe are the better reconstructed
311  return false;
312  }
313 
314  float ptmin = 0.5;
315  float originRBound = 3;
316  float originZBound = 3.;
317 
318  GlobalPoint originPos;
322  );
323  float cotTheta;
326  }else{
328  cotTheta=99999.f;
329  else
330  cotTheta=-99999.f;
331  }
332  GlobalVector originBounds(originRBound,originRBound,originZBound);
333 
334  GlobalPoint pvtxPoint(primaryVertexPoint.x(),
335  primaryVertexPoint.y(),
336  primaryVertexPoint.z()
337  );
338  ConversionRegion convRegion(originPos, pvtxPoint, cotTheta, track->thetaError(), -1*track->charge());
339 
340 #ifdef debugTSPFSLA
341  ss << "\nConversion Point " << originPos << " " << originPos.perp() << "\n";
342 #endif
343 
344  const OrderedSeedingHits & hitss = theHitsGenerator->run(convRegion, region, *myEvent, *myEsetup);
345 
346  unsigned int nHitss = hitss.size();
347 
348  if(nHitss==0)
349  return false;
350 
351 #ifdef debugTSPFSLA
352  ss << "\n nHitss " << nHitss << "\n";
353 #endif
354 
355  if (seedCollection->empty()) seedCollection->reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
356  // as it will cause N re-allocations instead of the normal log(N)/log(2)
357  for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
358 
359 #ifdef debugTSPFSLA
360  ss << "\n iHits " << iHits << "\n";
361 #endif
362  const SeedingHitSet & hits = hitss[iHits];
363  //if (!theComparitor || theComparitor->compatible( hits, es) ) {
364  //try{
365  theSeedCreator->trajectorySeed(*seedCollection,hits, originPos, originBounds, ptmin, *myEsetup,convRegion.cotTheta(),ss);
366  //}catch(cms::Exception& er){
367  // edm::LogError("SeedingConversion") << " Problem in the Single Leg Seed creator " <<er.what()<<std::endl;
368  //}catch(std::exception& er){
369  // edm::LogError("SeedingConversion") << " Problem in the Single Leg Seed creator " << er.what()<<std::endl;
370  //}
371  }
372  return true;
373 }
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
T perp() const
Definition: PV3DBase.h:72
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual unsigned int size() const =0
math::XYZVector GetMomentumAtTangentPoint() const
bool isNotFinite(T x)
Definition: isFinite.h:10
math::XYZVector GetTangentPoint() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
double ptmin
Definition: HydjetWrapper.h:85
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
int charge() const
track electric charge
Definition: TrackBase.h:111
double thetaError() const
error on theta
Definition: TrackBase.h:199
void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::loopOnPriVtx ( const reco::Track tk,
const std::vector< reco::Vertex > &  selectedPriVtxCompatibleWithTrack 
)
private

Definition at line 202 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _countSeedTracks, inspectTrack(), reco::Vertex::position(), TrackingRegion::print(), regions, and ss.

Referenced by loopOnTracks().

202  {
203 
204  bool foundAtLeastASeedCand=false;
205  BOOST_FOREACH(const reco::Vertex vtx, selectedPriVtxCompatibleWithTrack){
206 
207  math::XYZPoint primaryVertexPoint=math::XYZPoint(vtx.position());
208 
209  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
210  const TrackingRegion & region = **ir;
211 
212 #ifdef debugTSPFSLA
213  ss << "[PrintRegion] " << region.print() << std::endl;
214 #endif
215 
216  //This if is just for the _countSeedTracks. otherwise
217  //inspectTrack(&tk,region, primaryVertexPoint);
218  //would be enough
219 
220  if(
221  inspectTrack(&tk,region, primaryVertexPoint)
222  and
223  !foundAtLeastASeedCand
224  ){
225  foundAtLeastASeedCand=true;
226  _countSeedTracks++;
227  }
228 
229  }
230  }
231 }
const Point & position() const
position
Definition: Vertex.h:106
bool inspectTrack(const reco::Track *track, const TrackingRegion &region, math::XYZPoint &primaryVertexPoint)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
virtual std::string print() const
void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::loopOnTracks ( )
private

Definition at line 106 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _applyTkVtxConstraint, _conf, _countSeedTracks, edm::Event::getByToken(), edm::ParameterSet::getParameter(), customizeTrackingMonitorSeedNumber::idx, edm::HandleBase::isValid(), loopOnPriVtx(), myEvent, rejectTrack(), EgammaValidation_Wenu_cff::sel, selectPriVtxCompatibleWithTrack(), ss, token_refitter, trackCollectionH, and vertexHandle.

Referenced by analyze().

106  {
107 
108  //--- Get Tracks
110 
111  if(trackCollectionH.isValid()==0){
112  edm::LogError("MissingInput")<<" could not find track collecion:"<<_conf.getParameter<edm::InputTag>("TrackRefitter");
113  return;
114  }
115  size_t idx=0, sel=0;
117 
118  ss.str("");
119 
120  for( reco::TrackCollection::const_iterator tr = trackCollectionH->begin();
121  tr != trackCollectionH->end(); tr++, idx++) {
122 
123  // #ifdef debugTSPFSLA
124  // ss << "\nStuding track Nb " << idx;
125  // #endif
126 
127  if(rejectTrack(*tr)) continue;
128  std::vector<reco::Vertex> selectedPriVtxCompatibleWithTrack;
130  selectedPriVtxCompatibleWithTrack.push_back(*(vertexHandle->begin())); //Same approach as before
131  }else{
132  if(!selectPriVtxCompatibleWithTrack(*tr,selectedPriVtxCompatibleWithTrack)) continue;
133  }
134 
135  sel++;
136  loopOnPriVtx(*tr,selectedPriVtxCompatibleWithTrack);
137  }
138 #ifdef debugTSPFSLA
139  edm::LogInfo("debugTrajSeedFromSingleLeg") << ss.str();
140  edm::LogInfo("debugTrajSeedFromSingleLeg") << "Inspected " << sel << " tracks over " << idx << " tracks. \t # tracks providing at least one seed " << _countSeedTracks ;
141 #endif
142 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
bool isValid() const
Definition: HandleBase.h:76
void loopOnPriVtx(const reco::Track &tk, const std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
bool selectPriVtxCompatibleWithTrack(const reco::Track &tk, std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::rejectTrack ( const reco::Track track)
private

Definition at line 234 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _IdealHelixParameters, SiPixelRawToDigiRegional_cfi::beamSpot, IdealHelixParameters::GetTangentPoint(), edm::HandleBase::isValid(), recoBeamSpotHandle, and IdealHelixParameters::setData().

Referenced by loopOnTracks().

234  {
235 
238  beamSpot = math::XYZVector(recoBeamSpotHandle->position());
239 
240  _IdealHelixParameters.setData(&track,beamSpot);
242  //this case means a null results on the _IdealHelixParameters side
243  return true;
244  }
245 
246  float rMin=2.; //cm
247  if(_IdealHelixParameters.GetTangentPoint().rho()<rMin){
248  //this case means a track that has the tangent point nearby the primary vertex
249  // if the track is primary, this number tends to be the primary vertex itself
250  //Rejecting all the potential photon conversions having a "vertex" inside the beampipe
251  //We should not miss too much, seen that the conversions at the beam pipe are the better reconstructed
252  return true;
253  }
254  }
255 
256  //-------------------------------------------------------
257  /*
258  float maxPt2=64.; //Cut on pt^2 Indeed doesn't do almost nothing
259  if(track.momentum().Perp2() > maxPt2)
260  return true;
261  */
262  //-------------------------------------------------------
263  //Cut in the barrel eta region FIXME: to be extended to endcaps
264  /*
265  float maxEta=1.3;
266  if(fabs(track.eta()) > maxEta)
267  return true;
268  */
269  //-------------------------------------------------------
270  //Reject tracks that have a first valid hit in the pixel barrel/endcap layer/disk 1
271  //assume that the hits are aligned along momentum
272  /*
273  const reco::HitPattern& p=track.hitPattern();
274  for (int i=0; i<p.numberOfHits(); i++) {
275  uint32_t hit = p.getHitPattern(i);
276  // if the hit is valid and in pixel barrel, print out the layer
277  if (! p.validHitFilter(hit) ) continue;
278  if( (p.pixelBarrelHitFilter(hit) || p.pixelEndcapHitFilter(hit))
279  &&
280  p.getLayer(hit) == 1
281  )
282  return true;
283  else
284  break; //because the first valid hit is in a different layer
285  }
286  */
287  //-------------------------------------------------------
288 
289 
290  return false;
291 }
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
math::XYZVector GetTangentPoint() const
bool isValid() const
Definition: HandleBase.h:76
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::selectPriVtxCompatibleWithTrack ( const reco::Track tk,
std::vector< reco::Vertex > &  selectedPriVtxCompatibleWithTrack 
)
private

Definition at line 145 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References _maxDZSigmas, _maxNumSelVtx, _vtxMinDoF, prof2calltree::count, reco::Vertex::covariance(), reco::TrackBase::covariance(), reco::TrackBase::dz(), reco::TrackBase::dzError(), i, customizeTrackingMonitorSeedNumber::idx, lt_(), reco::Vertex::ndof(), reco::Vertex::position(), reco::TrackBase::pt(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), edm::second(), funct::sqr(), mathSSE::sqrt(), ss, vertexHandle, reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by loopOnTracks().

145  {
146 
147  std::vector< std::pair< double, short> > idx;
148  short count=-1;
149 
150  double cosPhi=tk.px()/tk.pt();
151  double sinPhi=tk.py()/tk.pt();
152  double sphi2=tk.covariance(2,2);
153  double stheta2=tk.covariance(1,1);
154 
155  BOOST_FOREACH(const reco::Vertex& vtx, *vertexHandle){
156  count++;
157  if(vtx.ndof()<= _vtxMinDoF) continue;
158 
159  double _dz= tk.dz(vtx.position());
160  double _dzError=tk.dzError();
161 
162  double cotTheta=tk.pz()/tk.pt();
163  double dx = vtx.position().x();
164  double dy = vtx.position().y();
165  double sx2=vtx.covariance(0,0);
166  double sy2=vtx.covariance(1,1);
167 
168  double sxy2= sqr(cosPhi*cotTheta)*sx2+
169  sqr(sinPhi*cotTheta)*sy2+
170  sqr(cotTheta*(-dx*sinPhi+dy*cosPhi))*sphi2+
171  sqr((1+cotTheta*cotTheta)*(dx*cosPhi+dy*sinPhi))*stheta2;
172 
173  _dzError=sqrt(_dzError*_dzError+vtx.covariance(2,2)+sxy2); //there is a missing component, related to the element (vtx.x*px+vtx.y*py)/pt * pz/pt. since the tk ref point is at the point of closest approach, this scalar product should be almost zero.
174 
175 #ifdef debugTSPFSLA
176  ss << " primary vtx " << vtx.position() << " \tk vz " << tk.vz() << " vx " << tk.vx() << " vy " << tk.vy() << " pz/pt " << tk.pz()/tk.pt() << " \t dz " << _dz << " \t " << _dzError << " sxy2 "<< sxy2<< " \t dz/dzErr " << _dz/_dzError<< std::endl;
177 #endif
178 
179  if(fabs(_dz)/_dzError > _maxDZSigmas) continue;
180 
181  idx.push_back(std::pair<double,short>(fabs(_dz),count));
182  }
183  if(idx.size()==0) {
184 #ifdef debugTSPFSLA
185  ss << "no vertex selected " << std::endl;
186 #endif
187  return false;
188 }
189 
190  std::stable_sort(idx.begin(),idx.end(),lt_);
191  for(size_t i=0;i<_maxNumSelVtx && i<idx.size();++i){
192  selectedPriVtxCompatibleWithTrack.push_back((*vertexHandle)[idx[i].second]);
193 #ifdef debugTSPFSLA
194  ss << "selected vtx dz " << idx[0].first << " position" << idx[0].second << std::endl;
195 #endif
196  }
197 
198  return true;
199 }
int i
Definition: DBlmapReader.cc:9
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:123
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:131
const Point & position() const
position
Definition: Vertex.h:106
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:180
U second(std::pair< T, U > const &p)
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:129
double ndof() const
Definition: Vertex.h:102
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:135
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...
Definition: TrackBase.h:125
double dzError() const
error on dz
Definition: TrackBase.h:213
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:145
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:143
Square< F >::type sqr(const F &f)
Definition: Square.h:13
bool lt_(std::pair< double, short > a, std::pair< double, short > b)
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:133
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:141

Member Data Documentation

bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_applyTkVtxConstraint
private
edm::InputTag PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_beamSpotInputTag
private
const edm::ParameterSet PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_conf
private
size_t PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_countSeedTracks
private
IdealHelixParameters PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_IdealHelixParameters
private
double PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_maxDZSigmas
private
size_t PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_maxNumSelVtx
private
edm::InputTag PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_primaryVtxInputTag
private
double PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_vtxMinDoF
private
const MagneticField* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::magField
private

Definition at line 89 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

const edm::EventSetup* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::myEsetup
private
const edm::Event* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::myEvent
private
PrintRecoObjects PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::po
private

Definition at line 99 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

reco::Vertex PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::primaryVertex
private
edm::Handle<reco::BeamSpot> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::recoBeamSpotHandle
private
Regions PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::regions
private
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::seedCollection
private
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::seedCollectionOfSourceTracks
private
std::stringstream PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::ss
private
const reco::BeamSpot* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theBeamSpot
private
ClusterChecker PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theClusterCheck
private

Definition at line 67 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

std::unique_ptr<CombinedHitPairGeneratorForPhotonConversion> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theHitsGenerator
private
std::unique_ptr<GlobalTrackingRegionProducerFromBeamSpot> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theRegionProducer
private

Definition at line 64 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

std::unique_ptr<SeedForPhotonConversion1Leg> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theSeedCreator
private
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theSilentOnClusterCheck
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

edm::EDGetTokenT<reco::BeamSpot> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::token_bs
private
edm::EDGetTokenT<reco::TrackCollection> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::token_refitter
private
edm::EDGetTokenT<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::token_vertex
private
edm::Handle<reco::TrackCollection> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::trackCollectionH
private
edm::Handle<TrajTrackAssociationCollection> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::trajTrackAssociations
private
reco::VertexCollection PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::vertexCollection
private
edm::Handle<reco::VertexCollection> PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::vertexHandle
private