CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

ConversionSeedFinder Class Reference

#include <ConversionSeedFinder.h>

Inheritance diagram for ConversionSeedFinder:
InOutConversionSeedFinder OutInConversionSeedFinder

List of all members.

Public Member Functions

void clear ()
 ConversionSeedFinder (const edm::ParameterSet &config)
 ConversionSeedFinder ()
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.
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_.

                                                                        : 
  conf_(config),
  theUpdator_()
{

  LogDebug("ConversionSeedFinder")  << " CTOR " << "\n";

  theMeasurementTrackerName_=config.getParameter<std::string>("MeasurementTrackerName");
}
virtual ConversionSeedFinder::~ConversionSeedFinder ( ) [inline, virtual]

Definition at line 58 of file ConversionSeedFinder.h.

{}

Member Function Documentation

void ConversionSeedFinder::clear ( void  ) [inline]

Definition at line 77 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::produce().

               {
    theSeeds_.clear();
  }
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 InOutConversionSeedFinder::makeSeeds(), and OutInConversionSeedFinder::makeSeeds().

                                            {
  

  int charge;
  //List the DetLayers crossed by a straight line from the centre of the 
  //detector to the supercluster position
  //  GlobalPoint  vertex(0.,0.,0.);
  GlobalPoint  vertex(theBeamSpot_.position().x(),theBeamSpot_.position().y(),theBeamSpot_.position().z()); 
  charge=-1;  
  FreeTrajectoryState theStraightLineFTS = trackStateFromClusters(charge, vertex, alongMomentum, 1.);
  
  findLayers( theStraightLineFTS  );
  
  
}
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_.

                                                                            {



  theLayerList_.clear();


  StraightLinePropagator prop( &(*theMF_), alongMomentum);

  StartingLayerFinder starter(&prop, this->getMeasurementTracker() );
 
  LayerCollector collector(&prop, &starter, 5., 5.);

  theLayerList_ = collector.allLayers(traj);

  
  for(unsigned int i = 0; i < theLayerList_.size(); ++i) {
    printLayer(i);
  }
  

}
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 Reference_intrackfit_cff::barrel, i, DetLayer::location(), and theLayerList_.

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

                                                 {
  const DetLayer * layer = theLayerList_[i];
  if (layer->location() == GeomDetEnumerators::barrel ) {
    //    const BarrelDetLayer * barrelLayer = dynamic_cast<const BarrelDetLayer*>(layer);
    //float r = barrelLayer->specificSurface().radius();
    //    std::cout   <<  " barrel layer radius " << r << " " << barrelLayer->specificSurface().bounds().length()/2. << "\n";

  } else {
    //    const ForwardDetLayer * forwardLayer = dynamic_cast<const ForwardDetLayer*>(layer);
    // float z =  fabs(forwardLayer->surface().position().z());
    //    std::cout   << " forward layer position " << z << " " << forwardLayer->specificSurface().innerRadius() << " " << forwardLayer->specificSurface().outerRadius() << "\n";
  }
}
TrajectorySeedCollection& ConversionSeedFinder::seeds ( ) [inline]

Definition at line 65 of file ConversionSeedFinder.h.

References theSeeds_.

Referenced by ConversionTrackCandidateProducer::buildCollections().

{  return theSeeds_;}
virtual void ConversionSeedFinder::setCandidate ( float  e,
GlobalPoint  pos 
) const [inline, virtual]
void ConversionSeedFinder::setEvent ( const edm::Event e)
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< T >::product(), theGeomSearchTracker_, theMeasurementTracker_, theMeasurementTrackerName_, theMF_, thePropagatorAlongMomentum_, and thePropagatorOppositeToMomentum_.

Referenced by ConversionTrackCandidateProducer::setEventSetup().

                                                                   {
  es.get<TrackerRecoGeometryRecord>().get( theGeomSearchTracker_);
  es.get<IdealMagneticFieldRecord>().get( theMF_ );


  edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
  es.get<CkfComponentsRecord>().get(theMeasurementTrackerName_,measurementTrackerHandle);
  theMeasurementTracker_ = measurementTrackerHandle.product();
  
  edm::ESHandle<Propagator>  propagatorAlongMomHandle;
  es.get<TrackingComponentsRecord>().get("alongMomElePropagator",propagatorAlongMomHandle);
  thePropagatorAlongMomentum_ = &(*propagatorAlongMomHandle);
 

  edm::ESHandle<Propagator>  propagatorOppoToMomHandle;
  es.get<TrackingComponentsRecord>().get("oppositeToMomElePropagator",propagatorOppoToMomHandle);
  thePropagatorOppositeToMomentum_ = &(*propagatorOppoToMomHandle);




}
void ConversionSeedFinder::setMeasurementTracker ( const MeasurementTracker tracker) const [inline]

Definition at line 70 of file ConversionSeedFinder.h.

{ ; }
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().

                                                                                                                     {
  
  

  double caloEnergy = theSCenergy_ * scaleFactor ;
  
  GlobalVector radiusCalo = theSCPosition_ - theOrigin ;
  
  GlobalVector momentumWithoutCurvature = radiusCalo.unit() * caloEnergy;
  
  
  GlobalTrajectoryParameters gtp;
  if(dir == alongMomentum) {
    gtp = GlobalTrajectoryParameters(theOrigin, momentumWithoutCurvature, charge, &(*theMF_) ) ;
  } else {
    gtp = GlobalTrajectoryParameters(theSCPosition_, momentumWithoutCurvature, charge, &(*theMF_) ) ;
  }



  
  // now create error matrix
  // dpos = 4mm/sqrt(E), dtheta = move vertex by 1sigma
  float dpos = 0.4/sqrt(theSCenergy_);
  dpos *= 2.;
  float dphi = dpos/theSCPosition_.perp();
  //  float dp = 0.03 * sqrt(theCaloEnergy);
  //  float dp = theCaloEnergy / sqrt(12.); // for fun
  float theta1 = theSCPosition_.theta();
  float theta2 = atan2(double(theSCPosition_.perp()), theSCPosition_.z()-5.5);
  float dtheta = theta1 - theta2;
  AlgebraicSymMatrix55  m;
  m[0][0] = 1.; m[1][1] = dpos*dpos ; m[2][2] = dpos*dpos ;
  m[3][3] = dphi*dphi ; m[4][4] = dtheta * dtheta ;

  FreeTrajectoryState fts(gtp, CurvilinearTrajectoryError(m)) ;

  return fts ;


}

Member Data Documentation

Reimplemented in InOutConversionSeedFinder, and OutInConversionSeedFinder.

Definition at line 84 of file ConversionSeedFinder.h.

Definition at line 111 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theBCEnergy_ [mutable, protected]

Definition at line 107 of file ConversionSeedFinder.h.

Referenced by setEventSetup().

std::vector<const DetLayer *> ConversionSeedFinder::theLayerList_ [mutable, protected]

Definition at line 102 of file ConversionSeedFinder.h.

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

Definition at line 101 of file ConversionSeedFinder.h.

Referenced by ConversionSeedFinder(), and setEventSetup().

Definition at line 112 of file ConversionSeedFinder.h.

float ConversionSeedFinder::theSCenergy_ [mutable, protected]