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, edm::ConsumesCollector &iC)
 
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
 
void setNavigationSchool (const NavigationSchool *navigation)
 
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::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
PropagationDirection dir_
 
edm::EDGetTokenT
< MeasurementTrackerEvent
measurementTrkToken_
 
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 NavigationSchooltheNavigationSchool_ = 0
 
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 52 of file ConversionSeedFinder.h.

Constructor & Destructor Documentation

ConversionSeedFinder::ConversionSeedFinder ( )
ConversionSeedFinder::ConversionSeedFinder ( const edm::ParameterSet config,
edm::ConsumesCollector iC 
)

Definition at line 16 of file ConversionSeedFinder.cc.

References beamSpotToken_, edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), HLT_25ns14e33_v1_cff::InputTag, LogDebug, measurementTrkToken_, AlCaHLTBitMon_QueryRunRegistry::string, and theMeasurementTrackerName_.

16  :
17  // conf_(config),
18  theUpdator_()
19 {
20 
21  measurementTrkToken_=iC.consumes<MeasurementTrackerEvent>(edm::InputTag("MeasurementTrackerEvent")); //hardcoded because the original was and no time to fix (sigh)
22  beamSpotToken_=iC.consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot")); //hardcoded because the original was and no time to fix (sigh)
23 
24  LogDebug("ConversionSeedFinder") << " CTOR " << "\n";
25 
26  theMeasurementTrackerName_=config.getParameter<std::string>("MeasurementTrackerName");
27 }
#define LogDebug(id)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::string theMeasurementTrackerName_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
virtual ConversionSeedFinder::~ConversionSeedFinder ( )
inlinevirtual

Definition at line 60 of file ConversionSeedFinder.h.

60 {}

Member Function Documentation

void ConversionSeedFinder::clear ( void  )
inline

Definition at line 80 of file ConversionSeedFinder.h.

References theSeeds_.

80  {
81  theSeeds_.clear();
82  }
TrajectorySeedCollection theSeeds_
void ConversionSeedFinder::findLayers ( ) const
protected

Definition at line 68 of file ConversionSeedFinder.cc.

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

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

68  {
69 
70 
71  int charge;
72  //List the DetLayers crossed by a straight line from the centre of the
73  //detector to the supercluster position
74  // GlobalPoint vertex(0.,0.,0.);
76  charge=-1;
77  FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
78 
79  findLayers( theStraightLineFTS );
80 
81 
82 }
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 127 of file ConversionSeedFinder.cc.

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

127  {
128 
129 
130 
131  theLayerList_.clear();
132 
133 
135 
136  StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
137 
138  LayerCollector collector(theNavigationSchool_, &prop, &starter, 5., 5.);
139 
140  theLayerList_ = collector.allLayers(traj);
141 
142 
143  for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
144  printLayer(i);
145  }
146 
147 
148 }
int i
Definition: DBlmapReader.cc:9
const MeasurementTracker * getMeasurementTracker() const
const NavigationSchool * theNavigationSchool_
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 151 of file ConversionSeedFinder.cc.

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

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

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

References theSeeds_.

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

Definition at line 31 of file ConversionSeedFinder.cc.

References beamSpotToken_, MeasurementTracker::geomTracker(), edm::Event::getByToken(), getMeasurementTracker(), measurementTrkToken_, theBeamSpot_, theTrackerData_, and theTrackerGeom_.

31  {
32 
34 
35  //get the BeamSpot
36  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
37  evt.getByToken(beamSpotToken_,recoBeamSpotHandle);
38  theBeamSpot_ = *recoBeamSpotHandle;
39 
40  evt.getByToken(measurementTrkToken_, theTrackerData_);
41 
42 }
const MeasurementTracker * getMeasurementTracker() const
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const TrackingGeometry * geomTracker() const
const TrackingGeometry * theTrackerGeom_
edm::Handle< MeasurementTrackerEvent > theTrackerData_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
void ConversionSeedFinder::setEventSetup ( const edm::EventSetup es)

Initialize EventSetup objects at each event.

Definition at line 44 of file ConversionSeedFinder.cc.

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

44  {
46  es.get<IdealMagneticFieldRecord>().get( theMF_ );
47 
48 
49  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
50  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_,measurementTrackerHandle);
51  theMeasurementTracker_ = measurementTrackerHandle.product();
52 
53  edm::ESHandle<Propagator> propagatorAlongMomHandle;
54  es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
55  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
56 
57 
58  edm::ESHandle<Propagator> propagatorOppoToMomHandle;
59  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
60  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);
61 
62 
63 
64 
65 }
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:56
T const * product() const
Definition: ESHandle.h:86
void ConversionSeedFinder::setMeasurementTracker ( const MeasurementTracker tracker) const
inline

Definition at line 72 of file ConversionSeedFinder.h.

72 { ; }
void ConversionSeedFinder::setNavigationSchool ( const NavigationSchool navigation)
inline

Definition at line 77 of file ConversionSeedFinder.h.

References theNavigationSchool_.

77 { theNavigationSchool_ = navigation; }
const NavigationSchool * theNavigationSchool_
FreeTrajectoryState ConversionSeedFinder::trackStateFromClusters ( int  aCharge,
const GlobalPoint gpOrigine,
PropagationDirection  dir,
float  scaleFactor 
) const
protected

Definition at line 84 of file ConversionSeedFinder.cc.

References alongMomentum, visualization-live-secondInstance_cfg::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().

85  {
86 
87 
88 
89  double caloEnergy = theSCenergy_ * scaleFactor ;
90 
91  GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
92 
93  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
94 
95 
97  if(dir == alongMomentum) {
98  gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
99  } else {
100  gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
101  }
102 
103 
104 
105 
106  // now create error matrix
107  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
108  float dpos = 0.4/sqrt(theSCenergy_);
109  dpos *= 2.;
110  float dphi = dpos/theSCPosition_.perp();
111  // float dp = 0.03 * sqrt(theCaloEnergy);
112  // float dp = theCaloEnergy / sqrt(12.); // for fun
113  float theta1 = theSCPosition_.theta();
114  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
115  float dtheta = theta1 - theta2;
117  m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
118  m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;
119 
121 
122  return fts ;
123 
124 
125 }
T perp() const
Definition: PV3DBase.h:72
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
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::EDGetTokenT<reco::BeamSpot> ConversionSeedFinder::beamSpotToken_
protected

Definition at line 113 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

PropagationDirection ConversionSeedFinder::dir_
protected

Definition at line 118 of file ConversionSeedFinder.h.

edm::EDGetTokenT<MeasurementTrackerEvent> ConversionSeedFinder::measurementTrkToken_
protected

Definition at line 114 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEvent().

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

Definition at line 111 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

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

Definition at line 105 of file ConversionSeedFinder.h.

Referenced by getMeasurementTracker(), and setEventSetup().

std::string ConversionSeedFinder::theMeasurementTrackerName_
protected

Definition at line 104 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

edm::ESHandle<MagneticField> ConversionSeedFinder::theMF_
protected
const NavigationSchool* ConversionSeedFinder::theNavigationSchool_ = 0
protected

Definition at line 107 of file ConversionSeedFinder.h.

Referenced by findLayers(), and setNavigationSchool().

const Propagator* ConversionSeedFinder::thePropagatorAlongMomentum_
protected
const Propagator* ConversionSeedFinder::thePropagatorOppositeToMomentum_
protected
reco::CaloCluster* ConversionSeedFinder::theSC_
mutableprotected

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