CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ConversionSeedFinder Class Referenceabstract

#include <ConversionSeedFinder.h>

Inheritance diagram for ConversionSeedFinder:
InOutConversionSeedFinder OutInConversionSeedFinder

Public Member Functions

void clear ()
 
 ConversionSeedFinder ()
 
 ConversionSeedFinder (const edm::ParameterSet &config)
 
const MeasurementTrackergetMeasurementTracker () const
 
std::vector< const DetLayer * >
const & 
layerList () const
 
virtual void makeSeeds (const edm::Handle< edm::View< reco::CaloCluster > > &allBc) const =0
 
TrajectorySeedCollectionseeds ()
 
virtual void setCandidate (float e, GlobalPoint pos) const
 
void setEvent (const edm::Event &e)
 
void setEventSetup (const edm::EventSetup &es)
 Initialize EventSetup objects at each event. More...
 
void setMeasurementTracker (const MeasurementTracker *tracker) const
 
virtual ~ConversionSeedFinder ()
 

Protected Member Functions

void findLayers () const
 
void findLayers (const FreeTrajectoryState &fts) const
 
void printLayer (int i) const
 
FreeTrajectoryState trackStateFromClusters (int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
 

Protected Attributes

edm::ParameterSet conf_
 
PropagationDirection dir_
 
float theBCEnergy_
 
GlobalPoint theBCPosition_
 
reco::BeamSpot theBeamSpot_
 
edm::ESHandle
< GeometricSearchTracker
theGeomSearchTracker_
 
std::vector< const DetLayer * > theLayerList_
 
const MeasurementTrackertheMeasurementTracker_
 
std::string theMeasurementTrackerName_
 
edm::ESHandle< MagneticFieldtheMF_
 
const PropagatorthePropagatorAlongMomentum_
 
const PropagatorthePropagatorOppositeToMomentum_
 
reco::CaloClustertheSC_
 
float theSCenergy_
 
GlobalPoint theSCPosition_
 
TrajectorySeedCollection theSeeds_
 
const TrackingGeometrytheTrackerGeom_
 
KFUpdator theUpdator_
 

Detailed Description

Id:
ConversionSeedFinder.h,v 1.13 2011/07/28 19:37:35 vlimant Exp
Date:
2011/07/28 19:37:35
Revision:
1.13
Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 50 of file ConversionSeedFinder.h.

Constructor & Destructor Documentation

ConversionSeedFinder::ConversionSeedFinder ( )
ConversionSeedFinder::ConversionSeedFinder ( const edm::ParameterSet config)

Definition at line 15 of file ConversionSeedFinder.cc.

References edm::ParameterSet::getParameter(), LogDebug, AlCaHLTBitMon_QueryRunRegistry::string, and theMeasurementTrackerName_.

15  :
16  conf_(config),
17  theUpdator_()
18 {
19 
20  LogDebug("ConversionSeedFinder") << " CTOR " << "\n";
21 
22  theMeasurementTrackerName_=config.getParameter<std::string>("MeasurementTrackerName");
23 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::ParameterSet conf_
std::string theMeasurementTrackerName_
virtual ConversionSeedFinder::~ConversionSeedFinder ( )
inlinevirtual

Definition at line 58 of file ConversionSeedFinder.h.

58 {}

Member Function Documentation

void ConversionSeedFinder::clear ( void  )
inline

Definition at line 77 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::produce().

77  {
78  theSeeds_.clear();
79  }
TrajectorySeedCollection theSeeds_
void ConversionSeedFinder::findLayers ( ) const
protected

Definition at line 65 of file ConversionSeedFinder.cc.

References alongMomentum, DeDxDiscriminatorTools::charge(), reco::BeamSpot::position(), theBeamSpot_, and trackStateFromClusters().

Referenced by OutInConversionSeedFinder::makeSeeds(), and InOutConversionSeedFinder::makeSeeds().

65  {
66 
67 
68  int charge;
69  //List the DetLayers crossed by a straight line from the centre of the
70  //detector to the supercluster position
71  // GlobalPoint vertex(0.,0.,0.);
73  charge=-1;
74  FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
75 
76  findLayers( theStraightLineFTS );
77 
78 
79 }
double charge(const std::vector< uint8_t > &Ampls)
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
const Point & position() const
position
Definition: BeamSpot.h:63
void ConversionSeedFinder::findLayers ( const FreeTrajectoryState fts) const
protected

Definition at line 124 of file ConversionSeedFinder.cc.

References LayerCollector::allLayers(), alongMomentum, getMeasurementTracker(), i, printLayer(), StraightLinePropagator_cfi::StraightLinePropagator, theLayerList_, and theMF_.

124  {
125 
126 
127 
128  theLayerList_.clear();
129 
130 
132 
133  StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
134 
135  LayerCollector collector(&prop, &starter, 5., 5.);
136 
137  theLayerList_ = collector.allLayers(traj);
138 
139 
140  for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
141  printLayer(i);
142  }
143 
144 
145 }
int i
Definition: DBlmapReader.cc:9
const MeasurementTracker * getMeasurementTracker() const
void printLayer(int i) const
std::vector< const DetLayer * > theLayerList_
edm::ESHandle< MagneticField > theMF_
const MeasurementTracker* ConversionSeedFinder::getMeasurementTracker ( ) const
inline
std::vector<const DetLayer*> const& ConversionSeedFinder::layerList ( ) const
inline
virtual void ConversionSeedFinder::makeSeeds ( const edm::Handle< edm::View< reco::CaloCluster > > &  allBc) const
pure virtual
void ConversionSeedFinder::printLayer ( int  i) const
protected

Definition at line 148 of file ConversionSeedFinder.cc.

References GeomDetEnumerators::barrel, i, DetLayer::location(), and theLayerList_.

Referenced by InOutConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::fillClusterSeeds(), and findLayers().

148  {
149  const DetLayer * layer = theLayerList_[i];
150  if (layer->location() == GeomDetEnumerators::barrel ) {
151  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
152  //float r = barrelLayer->specificSurface().radius();
153  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
154 
155  } else {
156  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
157  // float z = fabs(forwardLayer->surface().position().z());
158  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
159  }
160 }
int i
Definition: DBlmapReader.cc:9
virtual Location location() const =0
Which part of the detector (barrel, endcap)
std::vector< const DetLayer * > theLayerList_
TrajectorySeedCollection& ConversionSeedFinder::seeds ( )
inline

Definition at line 65 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::buildCollections().

65 { return theSeeds_;}
TrajectorySeedCollection theSeeds_
virtual void ConversionSeedFinder::setCandidate ( float  e,
GlobalPoint  pos 
) const
inlinevirtual
void ConversionSeedFinder::setEvent ( const edm::Event e)

Definition at line 27 of file ConversionSeedFinder.cc.

References MeasurementTracker::geomTracker(), edm::Event::getByLabel(), getMeasurementTracker(), theBeamSpot_, theMeasurementTracker_, theTrackerGeom_, and MeasurementTracker::update().

Referenced by ConversionTrackCandidateProducer::produce().

27  {
28 
31 
32  //get the BeamSpot
33  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
34  evt.getByLabel("offlineBeamSpot",recoBeamSpotHandle);
35  theBeamSpot_ = *recoBeamSpotHandle;
36 
37 
38 
39 }
const MeasurementTracker * getMeasurementTracker() const
const MeasurementTracker * theMeasurementTracker_
virtual void update(const edm::Event &) const =0
const TrackingGeometry * geomTracker() const
const TrackingGeometry * theTrackerGeom_
void ConversionSeedFinder::setEventSetup ( const edm::EventSetup es)

Initialize EventSetup objects at each event.

Definition at line 41 of file ConversionSeedFinder.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), theGeomSearchTracker_, theMeasurementTracker_, theMeasurementTrackerName_, theMF_, thePropagatorAlongMomentum_, and thePropagatorOppositeToMomentum_.

Referenced by ConversionTrackCandidateProducer::setEventSetup().

41  {
43  es.get<IdealMagneticFieldRecord>().get( theMF_ );
44 
45 
46  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
47  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_,measurementTrackerHandle);
48  theMeasurementTracker_ = measurementTrackerHandle.product();
49 
50  edm::ESHandle<Propagator> propagatorAlongMomHandle;
51  es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
52  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
53 
54 
55  edm::ESHandle<Propagator> propagatorOppoToMomHandle;
56  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
57  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
58 
59 
60 
61 
62 }
const Propagator * thePropagatorAlongMomentum_
const MeasurementTracker * theMeasurementTracker_
const Propagator * thePropagatorOppositeToMomentum_
std::string theMeasurementTrackerName_
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker_
edm::ESHandle< MagneticField > theMF_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void ConversionSeedFinder::setMeasurementTracker ( const MeasurementTracker tracker) const
inline

Definition at line 70 of file ConversionSeedFinder.h.

70 { ; }
FreeTrajectoryState ConversionSeedFinder::trackStateFromClusters ( int  aCharge,
const GlobalPoint gpOrigine,
PropagationDirection  dir,
float  scaleFactor 
) const
protected

Definition at line 81 of file ConversionSeedFinder.cc.

References alongMomentum, m, PV3DBase< T, PVType, FrameType >::perp(), mathSSE::sqrt(), theMF_, theSCenergy_, theSCPosition_, PV3DBase< T, PVType, FrameType >::theta(), Vector3DBase< T, FrameTag >::unit(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by findLayers(), and OutInConversionSeedFinder::startSeed().

82  {
83 
84 
85 
86  double caloEnergy = theSCenergy_ * scaleFactor ;
87 
88  GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
89 
90  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
91 
92 
94  if(dir == alongMomentum) {
95  gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
96  } else {
97  gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
98  }
99 
100 
101 
102 
103  // now create error matrix
104  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
105  float dpos = 0.4/sqrt(theSCenergy_);
106  dpos *= 2.;
107  float dphi = dpos/theSCPosition_.perp();
108  // float dp = 0.03 * sqrt(theCaloEnergy);
109  // float dp = theCaloEnergy / sqrt(12.); // for fun
110  float theta1 = theSCPosition_.theta();
111  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
112  float dtheta = theta1 - theta2;
114  m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
115  m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;
116 
118 
119  return fts ;
120 
121 
122 }
T perp() const
Definition: PV3DBase.h:72
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
double charge(const std::vector< uint8_t > &Ampls)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Vector3DBase unit() const
Definition: Vector3DBase.h:57
edm::ESHandle< MagneticField > theMF_
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

edm::ParameterSet ConversionSeedFinder::conf_
protected

Definition at line 84 of file ConversionSeedFinder.h.

PropagationDirection ConversionSeedFinder::dir_
protected

Definition at line 111 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theBCEnergy_
mutableprotected
GlobalPoint ConversionSeedFinder::theBCPosition_
mutableprotected
reco::BeamSpot ConversionSeedFinder::theBeamSpot_
protected
edm::ESHandle<GeometricSearchTracker> ConversionSeedFinder::theGeomSearchTracker_
protected

Definition at line 107 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

std::vector<const DetLayer *> ConversionSeedFinder::theLayerList_
mutableprotected
const MeasurementTracker* ConversionSeedFinder::theMeasurementTracker_
protected

Definition at line 102 of file ConversionSeedFinder.h.

Referenced by getMeasurementTracker(), setEvent(), and setEventSetup().

std::string ConversionSeedFinder::theMeasurementTrackerName_
protected

Definition at line 101 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

edm::ESHandle<MagneticField> ConversionSeedFinder::theMF_
protected
const Propagator* ConversionSeedFinder::thePropagatorAlongMomentum_
protected
const Propagator* ConversionSeedFinder::thePropagatorOppositeToMomentum_
protected
reco::CaloCluster* ConversionSeedFinder::theSC_
mutableprotected

Definition at line 112 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theSCenergy_
mutableprotected
GlobalPoint ConversionSeedFinder::theSCPosition_
mutableprotected
TrajectorySeedCollection ConversionSeedFinder::theSeeds_
mutableprotected
const TrackingGeometry* ConversionSeedFinder::theTrackerGeom_
protected
KFUpdator ConversionSeedFinder::theUpdator_
protected