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_
 
edm::Handle
< MeasurementTrackerEvent
theTrackerData_
 
const TrackingGeometrytheTrackerGeom_
 
KFUpdator theUpdator_
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 49 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 57 of file ConversionSeedFinder.h.

57 {}

Member Function Documentation

void ConversionSeedFinder::clear ( void  )
inline

Definition at line 76 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::produce().

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

Definition at line 64 of file ConversionSeedFinder.cc.

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

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

64  {
65 
66 
67  int charge;
68  //List the DetLayers crossed by a straight line from the centre of the
69  //detector to the supercluster position
70  // GlobalPoint vertex(0.,0.,0.);
72  charge=-1;
73  FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
74 
75  findLayers( theStraightLineFTS );
76 
77 
78 }
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:62
void ConversionSeedFinder::findLayers ( const FreeTrajectoryState fts) const
protected

Definition at line 123 of file ConversionSeedFinder.cc.

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

123  {
124 
125 
126 
127  theLayerList_.clear();
128 
129 
131 
132  StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
133 
134  LayerCollector collector(&prop, &starter, 5., 5.);
135 
136  theLayerList_ = collector.allLayers(traj);
137 
138 
139  for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
140  printLayer(i);
141  }
142 
143 
144 }
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 147 of file ConversionSeedFinder.cc.

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

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

147  {
148  const DetLayer * layer = theLayerList_[i];
149  if (layer->location() == GeomDetEnumerators::barrel ) {
150  // const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
151  //float r = barrelLayer->specificSurface().radius();
152  // std::cout << " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";
153 
154  } else {
155  // const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
156  // float z = fabs(forwardLayer->surface().position().z());
157  // std::cout << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
158  }
159 }
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 64 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::buildCollections().

64 { 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_, theTrackerData_, and theTrackerGeom_.

Referenced by ConversionTrackCandidateProducer::produce().

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

Initialize EventSetup objects at each event.

Definition at line 40 of file ConversionSeedFinder.cc.

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

Referenced by ConversionTrackCandidateProducer::setEventSetup().

40  {
42  es.get<IdealMagneticFieldRecord>().get( theMF_ );
43 
44 
45  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
46  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_,measurementTrackerHandle);
47  theMeasurementTracker_ = measurementTrackerHandle.product();
48 
49  edm::ESHandle<Propagator> propagatorAlongMomHandle;
50  es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
51  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
52 
53 
54  edm::ESHandle<Propagator> propagatorOppoToMomHandle;
55  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
56  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
57 
58 
59 
60 
61 }
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 69 of file ConversionSeedFinder.h.

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

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

81  {
82 
83 
84 
85  double caloEnergy = theSCenergy_ * scaleFactor ;
86 
87  GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
88 
89  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
90 
91 
93  if(dir == alongMomentum) {
94  gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
95  } else {
96  gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
97  }
98 
99 
100 
101 
102  // now create error matrix
103  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
104  float dpos = 0.4/sqrt(theSCenergy_);
105  dpos *= 2.;
106  float dphi = dpos/theSCPosition_.perp();
107  // float dp = 0.03 * sqrt(theCaloEnergy);
108  // float dp = theCaloEnergy / sqrt(12.); // for fun
109  float theta1 = theSCPosition_.theta();
110  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
111  float dtheta = theta1 - theta2;
113  m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
114  m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;
115 
117 
118  return fts ;
119 
120 
121 }
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 83 of file ConversionSeedFinder.h.

PropagationDirection ConversionSeedFinder::dir_
protected

Definition at line 110 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 106 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

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

Definition at line 101 of file ConversionSeedFinder.h.

Referenced by getMeasurementTracker(), and setEventSetup().

std::string ConversionSeedFinder::theMeasurementTrackerName_
protected

Definition at line 100 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 111 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theSCenergy_
mutableprotected
GlobalPoint ConversionSeedFinder::theSCPosition_
mutableprotected
TrajectorySeedCollection ConversionSeedFinder::theSeeds_
mutableprotected
edm::Handle<MeasurementTrackerEvent> ConversionSeedFinder::theTrackerData_
protected
const TrackingGeometry* ConversionSeedFinder::theTrackerGeom_
protected
KFUpdator ConversionSeedFinder::theUpdator_
protected