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 &)
 
 ~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
 
edm::ParameterSet hitsfactoryPSet
 
const MagneticFieldmagField
 
const edm::EventSetupmyEsetup
 
const edm::EventmyEvent
 
PrintRecoObjects po
 
reco::Vertex primaryVertex
 
edm::Handle< reco::BeamSpotrecoBeamSpotHandle
 
edm::ParameterSet regfactoryPSet
 
Regions regions
 
TrajectorySeedCollectionseedCollection
 
TrajectorySeedCollectionseedCollectionOfSourceTracks
 
std::stringstream ss
 
const reco::BeamSpottheBeamSpot
 
ClusterChecker theClusterCheck
 
CombinedHitPairGeneratorForPhotonConversiontheHitsGenerator
 
GlobalTrackingRegionProducerFromBeamSpottheRegionProducer
 
SeedForPhotonConversion1LegtheSeedCreator
 
bool theSilentOnClusterCheck
 
edm::Handle
< reco::TrackCollection
trackCollectionH
 
edm::Handle
< TrajTrackAssociationCollection
trajTrackAssociations
 
reco::VertexCollection vertexCollection
 
edm::Handle
< reco::VertexCollection
vertexHandle
 

Detailed Description

Definition at line 32 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Member Typedef Documentation

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::IR
private

Constructor & Destructor Documentation

PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::PhotonConversionTrajectorySeedProducerFromSingleLegAlgo ( const edm::ParameterSet conf)

Definition at line 16 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References init().

18  hitsfactoryPSet(conf.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet")),
19  creatorPSet(conf.getParameter<edm::ParameterSet>("SeedCreatorPSet")),
20  regfactoryPSet(conf.getParameter<edm::ParameterSet>("RegionFactoryPSet")),
21  theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet")),
22  theSilentOnClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false)),
23  _vtxMinDoF(conf.getParameter<double>("vtxMinDoF")),
24  _maxDZSigmas(conf.getParameter<double>("maxDZSigmas")),
25  _maxNumSelVtx(conf.getParameter<uint32_t>("maxNumSelVtx")),
26  _applyTkVtxConstraint(conf.getParameter<bool>("applyTkVtxConstraint")),
28  _primaryVtxInputTag(conf.getParameter<edm::InputTag>("primaryVerticesTag")),
29  _beamSpotInputTag(conf.getParameter<edm::InputTag>("beamSpotInputTag"))
30 {
31  init();
32 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo ( )
inline

Member Function Documentation

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

Definition at line 52 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by PhotonConversionTrajectorySeedProducerFromSingleLeg::produce().

52  {
53 
54  myEsetup = &setup;
55  myEvent = &event;
56 
57  if(seedCollection!=0)
58  delete seedCollection;
59 
62 
65 
66  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
67  if (clustsOrZero){
69  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
70  return ;
71  }
72 
73 
74  edm::ESHandle<MagneticField> handleMagField;
75  setup.get<IdealMagneticFieldRecord>().get(handleMagField);
76  magField = handleMagField.product();
77  if (unlikely(magField->inTesla(GlobalPoint(0.,0.,0.)).z()<0.01)) return;
78 
80 
81 
82  event.getByLabel(_primaryVtxInputTag, vertexHandle);
83  if (!vertexHandle.isValid() || vertexHandle->empty()){
84  edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _primaryVtxInputTag << "\n";
85  return;
86  }
87 
88  event.getByLabel(_beamSpotInputTag,recoBeamSpotHandle);
89 
90 
91  regions = theRegionProducer->regions(event,setup);
92 
93  //Do the analysis
94  loopOnTracks();
95 
96 
97 #ifdef debugTSPFSLA
98  std::stringstream ss;
99  ss.str("");
100  ss << "\n++++++++++++++++++\n";
101  ss << "seed collection size " << seedCollection->size();
102  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
103  po.print(ss, tjS);
104  }
105  edm::LogInfo("debugTrajSeedFromSingleLeg") << ss.str();
106  //-------------------------------------------------
107 #endif
108 
109  // clear memory
111  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
112 
113 }
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
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &) const
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  )

Definition at line 45 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

References creatorPSet, hitsfactoryPSet, regfactoryPSet, theHitsGenerator, theRegionProducer, and theSeedCreator.

Referenced by PhotonConversionTrajectorySeedProducerFromSingleLeg::beginRun(), and PhotonConversionTrajectorySeedProducerFromSingleLegAlgo().

45  {
49 }
bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::inspectTrack ( const reco::Track track,
const TrackingRegion region,
math::XYZPoint primaryVertexPoint 
)
private

Definition at line 306 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by loopOnPriVtx().

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

Definition at line 213 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by loopOnTracks().

213  {
214 
215  bool foundAtLeastASeedCand=false;
216  BOOST_FOREACH(const reco::Vertex vtx, selectedPriVtxCompatibleWithTrack){
217 
218  math::XYZPoint primaryVertexPoint=math::XYZPoint(vtx.position());
219 
220  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
221  const TrackingRegion & region = **ir;
222 
223 #ifdef debugTSPFSLA
224  ss << "[PrintRegion] " << region.print() << std::endl;
225 #endif
226 
227  //This if is just for the _countSeedTracks. otherwise
228  //inspectTrack(&tk,region, primaryVertexPoint);
229  //would be enough
230 
231  if(
232  inspectTrack(&tk,region, primaryVertexPoint)
233  and
234  !foundAtLeastASeedCand
235  ){
236  foundAtLeastASeedCand=true;
237  _countSeedTracks++;
238  }
239 
240  }
241  }
242 }
const Point & position() const
position
Definition: Vertex.h:93
bool inspectTrack(const reco::Track *track, const TrackingRegion &region, math::XYZPoint &primaryVertexPoint)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
virtual std::string print() const
void PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::loopOnTracks ( )
private

Definition at line 117 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.cc.

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

Referenced by analyze().

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

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

Referenced by loopOnTracks().

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

Definition at line 156 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().

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

Member Data Documentation

bool PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_applyTkVtxConstraint
private
edm::InputTag PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_beamSpotInputTag
private

Definition at line 77 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

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

Definition at line 77 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

double PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::_vtxMinDoF
private
edm::ParameterSet PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::creatorPSet
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by init().

edm::ParameterSet PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::hitsfactoryPSet
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by init().

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
edm::ParameterSet PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::regfactoryPSet
private

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by init().

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 70 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

CombinedHitPairGeneratorForPhotonConversion* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theHitsGenerator
private
GlobalTrackingRegionProducerFromBeamSpot* PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::theRegionProducer
private

Definition at line 65 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze(), clear(), and init().

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

Definition at line 71 of file PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.h.

Referenced by analyze().

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