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)
 
void clear ()
 
IdealHelixParametersgetIdealHelixParameters ()
 
TrajectorySeedCollectiongetTrajectorySeedCollection ()
 
TrajectorySeedCollectiongetTrajectorySeedCollectionOfSourceTracks ()
 
void init ()
 
 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
 
edm::ParameterSet creatorPSet
 
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
 
SeedForPhotonConversion1LegtheSeedCreator
 
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(), init(), token_bs, token_refitter, and token_vertex.

21  creatorPSet(conf.getParameter<edm::ParameterSet>("SeedCreatorPSet")),
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  init();
36 }
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 38 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

38  {
39 }

Member Function Documentation

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

Definition at line 53 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, reco::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().

53  {
54 
55  myEsetup = &setup;
56  myEvent = &event;
57 
58  if(seedCollection!=0)
59  delete seedCollection;
60 
63 
66 
67  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
68  if (clustsOrZero){
70  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
71  return ;
72  }
73 
74 
75  edm::ESHandle<MagneticField> handleMagField;
76  setup.get<IdealMagneticFieldRecord>().get(handleMagField);
77  magField = handleMagField.product();
78  if (unlikely(magField->inTesla(GlobalPoint(0.,0.,0.)).z()<0.01)) return;
79 
81 
82 
83  event.getByToken(token_vertex, vertexHandle);
84  if (!vertexHandle.isValid() || vertexHandle->empty()){
85  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _primaryVtxInputTag << "\n";
86  return;
87  }
88 
89  event.getByToken(token_bs,recoBeamSpotHandle);
90 
91 
92  regions = theRegionProducer->regions(event,setup);
93 
94  //Do the analysis
95  loopOnTracks();
96 
97 
98 #ifdef debugTSPFSLA
99  std::stringstream ss;
100  ss.str("");
101  ss << "\n++++++++++++++++++\n";
102  ss << "seed collection size " << seedCollection->size();
103  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
104  po.print(ss, tjS);
105  }
106  edm::LogInfo("debugTrajSeedFromSingleLeg") << ss.str();
107  //-------------------------------------------------
108 #endif
109 
110  // clear memory
111  theHitsGenerator->clearLayerCache();
112  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
113 
114 }
void setMagnField(const MagneticField *magnField)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define unlikely(x)
Definition: Likely.h:21
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
return(e1-e2)*(e1-e2)+dp *dp
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::clear ( void  )
IdealHelixParameters* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getIdealHelixParameters ( )
inline
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getTrajectorySeedCollection ( )
inline
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::getTrajectorySeedCollectionOfSourceTracks ( )
inline
void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::init ( void  )
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::inspectTrack ( const reco::Track track,
const TrackingRegion region,
math::XYZPoint primaryVertexPoint 
)
private

Definition at line 307 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, reco::TrackBase::thetaError(), and SeedForPhotonConversion1Leg::trajectorySeed().

Referenced by loopOnPriVtx().

307  {
308 
309  _IdealHelixParameters.setData(track,primaryVertexPoint);
310 
313  //this case means a null results on the _IdealHelixParameters side
314  return false;
315  }
316 
317  float rMin=3.; //cm
318  if(_IdealHelixParameters.GetTangentPoint().rho()<rMin){
319  //this case means a track that has the tangent point nearby the primary vertex
320  // if the track is primary, this number tends to be the primary vertex itself
321  //Rejecting all the potential photon conversions having a "vertex" inside the beampipe
322  //We should not miss too much, seen that the conversions at the beam pipe are the better reconstructed
323  return false;
324  }
325 
326  float ptmin = 0.5;
327  float originRBound = 3;
328  float originZBound = 3.;
329 
330  GlobalPoint originPos;
334  );
335  float cotTheta;
338  }else{
340  cotTheta=99999.f;
341  else
342  cotTheta=-99999.f;
343  }
344  GlobalVector originBounds(originRBound,originRBound,originZBound);
345 
346  GlobalPoint pvtxPoint(primaryVertexPoint.x(),
347  primaryVertexPoint.y(),
348  primaryVertexPoint.z()
349  );
350  ConversionRegion convRegion(originPos, pvtxPoint, cotTheta, track->thetaError(), -1*track->charge());
351 
352 #ifdef debugTSPFSLA
353  ss << "\nConversion Point " << originPos << " " << originPos.perp() << "\n";
354 #endif
355 
356  const OrderedSeedingHits & hitss = theHitsGenerator->run(convRegion, region, *myEvent, *myEsetup);
357 
358  unsigned int nHitss = hitss.size();
359 
360  if(nHitss==0)
361  return false;
362 
363 #ifdef debugTSPFSLA
364  ss << "\n nHitss " << nHitss << "\n";
365 #endif
366 
367  if (seedCollection->empty()) seedCollection->reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
368  // as it will cause N re-allocations instead of the normal log(N)/log(2)
369  for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
370 
371 #ifdef debugTSPFSLA
372  ss << "\n iHits " << iHits << "\n";
373 #endif
374  const SeedingHitSet & hits = hitss[iHits];
375  //if (!theComparitor || theComparitor->compatible( hits, es) ) {
376  //try{
377  theSeedCreator->trajectorySeed(*seedCollection,hits, originPos, originBounds, ptmin, *myEsetup,convRegion.cotTheta(),ss);
378  //}catch(cms::Exception& er){
379  // edm::LogError("SeedingConversion") << " Problem in the Single Leg Seed creator " <<er.what()<<std::endl;
380  //}catch(std::exception& er){
381  // edm::LogError("SeedingConversion") << " Problem in the Single Leg Seed creator " << er.what()<<std::endl;
382  //}
383  }
384  return true;
385 }
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
const TrajectorySeed * trajectorySeed(TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const GlobalPoint &vertex, const GlobalVector &vertexBounds, float ptmin, const edm::EventSetup &es, float cotTheta, std::stringstream &ss)
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 214 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by loopOnTracks().

214  {
215 
216  bool foundAtLeastASeedCand=false;
217  BOOST_FOREACH(const reco::Vertex vtx, selectedPriVtxCompatibleWithTrack){
218 
219  math::XYZPoint primaryVertexPoint=math::XYZPoint(vtx.position());
220 
221  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
222  const TrackingRegion & region = **ir;
223 
224 #ifdef debugTSPFSLA
225  ss << "[PrintRegion] " << region.print() << std::endl;
226 #endif
227 
228  //This if is just for the _countSeedTracks. otherwise
229  //inspectTrack(&tk,region, primaryVertexPoint);
230  //would be enough
231 
232  if(
233  inspectTrack(&tk,region, primaryVertexPoint)
234  and
235  !foundAtLeastASeedCand
236  ){
237  foundAtLeastASeedCand=true;
238  _countSeedTracks++;
239  }
240 
241  }
242  }
243 }
const Point & position() const
position
Definition: Vertex.h:92
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 118 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().

118  {
119 
120  //--- Get Tracks
122 
123  if(trackCollectionH.isValid()==0){
124  edm::LogError("MissingInput")<<" could not find track collecion:"<<_conf.getParameter<edm::InputTag>("TrackRefitter");
125  return;
126  }
127  size_t idx=0, sel=0;
129 
130  ss.str("");
131 
132  for( reco::TrackCollection::const_iterator tr = trackCollectionH->begin();
133  tr != trackCollectionH->end(); tr++, idx++) {
134 
135  // #ifdef debugTSPFSLA
136  // ss << "\nStuding track Nb " << idx;
137  // #endif
138 
139  if(rejectTrack(*tr)) continue;
140  std::vector<reco::Vertex> selectedPriVtxCompatibleWithTrack;
142  selectedPriVtxCompatibleWithTrack.push_back(*(vertexHandle->begin())); //Same approach as before
143  }else{
144  if(!selectPriVtxCompatibleWithTrack(*tr,selectedPriVtxCompatibleWithTrack)) continue;
145  }
146 
147  sel++;
148  loopOnPriVtx(*tr,selectedPriVtxCompatibleWithTrack);
149  }
150 #ifdef debugTSPFSLA
151  edm::LogInfo("debugTrajSeedFromSingleLeg") << ss.str();
152  edm::LogInfo("debugTrajSeedFromSingleLeg") << "Inspected " << sel << " tracks over " << idx << " tracks. \t # tracks providing at least one seed " << _countSeedTracks ;
153 #endif
154 }
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 246 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by loopOnTracks().

246  {
247 
250  beamSpot = math::XYZVector(recoBeamSpotHandle->position());
251 
252  _IdealHelixParameters.setData(&track,beamSpot);
254  //this case means a null results on the _IdealHelixParameters side
255  return true;
256  }
257 
258  float rMin=2.; //cm
259  if(_IdealHelixParameters.GetTangentPoint().rho()<rMin){
260  //this case means a track that has the tangent point nearby the primary vertex
261  // if the track is primary, this number tends to be the primary vertex itself
262  //Rejecting all the potential photon conversions having a "vertex" inside the beampipe
263  //We should not miss too much, seen that the conversions at the beam pipe are the better reconstructed
264  return true;
265  }
266  }
267 
268  //-------------------------------------------------------
269  /*
270  float maxPt2=64.; //Cut on pt^2 Indeed doesn't do almost nothing
271  if(track.momentum().Perp2() > maxPt2)
272  return true;
273  */
274  //-------------------------------------------------------
275  //Cut in the barrel eta region FIXME: to be extended to endcaps
276  /*
277  float maxEta=1.3;
278  if(fabs(track.eta()) > maxEta)
279  return true;
280  */
281  //-------------------------------------------------------
282  //Reject tracks that have a first valid hit in the pixel barrel/endcap layer/disk 1
283  //assume that the hits are aligned along momentum
284  /*
285  const reco::HitPattern& p=track.hitPattern();
286  for (int i=0; i<p.numberOfHits(); i++) {
287  uint32_t hit = p.getHitPattern(i);
288  // if the hit is valid and in pixel barrel, print out the layer
289  if (! p.validHitFilter(hit) ) continue;
290  if( (p.pixelBarrelHitFilter(hit) || p.pixelEndcapHitFilter(hit))
291  &&
292  p.getLayer(hit) == 1
293  )
294  return true;
295  else
296  break; //because the first valid hit is in a different layer
297  }
298  */
299  //-------------------------------------------------------
300 
301 
302  return false;
303 }
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 157 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().

157  {
158 
159  std::vector< std::pair< double, short> > idx;
160  short count=-1;
161 
162  double cosPhi=tk.px()/tk.pt();
163  double sinPhi=tk.py()/tk.pt();
164  double sphi2=tk.covariance(2,2);
165  double stheta2=tk.covariance(1,1);
166 
167  BOOST_FOREACH(const reco::Vertex& vtx, *vertexHandle){
168  count++;
169  if(vtx.ndof()<= _vtxMinDoF) continue;
170 
171  double _dz= tk.dz(vtx.position());
172  double _dzError=tk.dzError();
173 
174  double cotTheta=tk.pz()/tk.pt();
175  double dx = vtx.position().x();
176  double dy = vtx.position().y();
177  double sx2=vtx.covariance(0,0);
178  double sy2=vtx.covariance(1,1);
179 
180  double sxy2= sqr(cosPhi*cotTheta)*sx2+
181  sqr(sinPhi*cotTheta)*sy2+
182  sqr(cotTheta*(-dx*sinPhi+dy*cosPhi))*sphi2+
183  sqr((1+cotTheta*cotTheta)*(dx*cosPhi+dy*sinPhi))*stheta2;
184 
185  _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.
186 
187 #ifdef debugTSPFSLA
188  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;
189 #endif
190 
191  if(fabs(_dz)/_dzError > _maxDZSigmas) continue;
192 
193  idx.push_back(std::pair<double,short>(fabs(_dz),count));
194  }
195  if(idx.size()==0) {
196 #ifdef debugTSPFSLA
197  ss << "no vertex selected " << std::endl;
198 #endif
199  return false;
200 }
201 
202  std::stable_sort(idx.begin(),idx.end(),lt_);
203  for(size_t i=0;i<_maxNumSelVtx && i<idx.size();++i){
204  selectedPriVtxCompatibleWithTrack.push_back((*vertexHandle)[idx[i].second]);
205 #ifdef debugTSPFSLA
206  ss << "selected vtx dz " << idx[0].first << " position" << idx[0].second << std::endl;
207 #endif
208  }
209 
210  return true;
211 }
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:109
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:131
const Point & position() const
position
Definition: Vertex.h:92
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:88
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
edm::ParameterSet PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::creatorPSet
private

Definition at line 70 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by init().

const MagneticField* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::magField
private

Definition at line 94 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 104 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 72 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

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

Definition at line 67 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

SeedForPhotonConversion1Leg* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theSeedCreator
private
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theSilentOnClusterCheck
private

Definition at line 73 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