CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SeedGeneratorForCRack Class Reference

#include <SeedGeneratorForCRack.h>

Public Types

typedef TrajectoryStateOnSurface TSOS
 

Public Member Functions

void init (const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)
 
void run (TrajectorySeedCollection &, const edm::EventSetup &c)
 
 SeedGeneratorForCRack (const edm::ParameterSet &conf)
 
void seeds (TrajectorySeedCollection &output, const edm::EventSetup &c, const TrackingRegion &region)
 
virtual ~SeedGeneratorForCRack ()
 

Private Attributes

std::string builderName
 
edm::ParameterSet conf_
 
std::string geometry
 
OrderedHitPairs HitPairs
 
edm::ESHandle< MagneticFieldmagfield
 
float multipleScatteringFactor
 
GlobalTrackingRegion region
 
double seedMomentum
 
float seedpt
 
CosmicHitPairGeneratorthePairGenerator
 
PropagatorWithMaterialthePropagatorAl
 
PropagatorWithMaterialthePropagatorOp
 
KFUpdatortheUpdator
 
edm::ESHandle< TrackerGeometrytracker
 
const
TransientTrackingRecHitBuilder
TTTRHBuilder
 

Detailed Description

Definition at line 21 of file SeedGeneratorForCRack.h.

Member Typedef Documentation

Definition at line 23 of file SeedGeneratorForCRack.h.

Constructor & Destructor Documentation

SeedGeneratorForCRack::SeedGeneratorForCRack ( const edm::ParameterSet conf)

Definition at line 31 of file SeedGeneratorForCRack.cc.

References builderName, conf_, geometry, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), multipleScatteringFactor, seedMomentum, seedpt, and AlCaHLTBitMon_QueryRunRegistry::string.

31  :
32  conf_(conf), region(conf.getParameter<double>("ptMin")
33  ,conf.getParameter<double>("originRadius")
34  ,conf.getParameter<double>("originHalfLength")
35  ,conf.getParameter<double>("originZPosition")
36  )
37 {
38  seedpt = conf_.getParameter<double>("SeedPt");
39  builderName = conf_.getParameter<std::string>("TTRHBuilder");
40  geometry=conf_.getUntrackedParameter<std::string>("GeometricStructure","STANDARD");
41  multipleScatteringFactor=conf_.getUntrackedParameter<double>("multipleScatteringFactor", 1.0);
42  seedMomentum =conf_.getUntrackedParameter<double>("SeedMomentum",1);
43 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
GlobalTrackingRegion region
virtual SeedGeneratorForCRack::~SeedGeneratorForCRack ( )
inlinevirtual

Definition at line 25 of file SeedGeneratorForCRack.h.

25 {};

Member Function Documentation

void SeedGeneratorForCRack::init ( const SiStripRecHit2DCollection collstereo,
const SiStripRecHit2DCollection collrphi,
const SiStripMatchedRecHit2DCollection collmatched,
const edm::EventSetup c 
)

Definition at line 6 of file SeedGeneratorForCRack.cc.

References alongMomentum, builderName, geometry, edm::EventSetup::get(), CosmicHitPairGenerator::hitPairs(), HitPairs, CosmicLayerPairs::init(), LogDebug, magfield, oppositeToMomentum, edm::ESHandle< class >::product(), region, OrderedHitPairs::size(), thePairGenerator, thePropagatorAl, thePropagatorOp, theUpdator, tracker, and TTTRHBuilder.

Referenced by CRackSeedGenerator::produce().

10 {
11  iSetup.get<IdealMagneticFieldRecord>().get(magfield);
12  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
15  theUpdator= new KFUpdator();
16 
17  // get the transient builder
18 
20 
21  iSetup.get<TransientRecHitRecord>().get(builderName,theBuilder);
22  TTTRHBuilder = theBuilder.product();
23  CosmicLayerPairs cosmiclayers(geometry);
24  cosmiclayers.init(collstereo,collrphi,collmatched,iSetup);
25  thePairGenerator=new CosmicHitPairGenerator(cosmiclayers,iSetup);
26  HitPairs.clear();
28  LogDebug("CosmicSeedFinder") <<"Initialized with " << HitPairs.size() << " hit pairs" << std::endl;
29 }
#define LogDebug(id)
const TransientTrackingRecHitBuilder * TTTRHBuilder
virtual unsigned int size() const
virtual void hitPairs(const TrackingRegion &reg, OrderedHitPairs &prs, const edm::EventSetup &iSetup)
form base class
PropagatorWithMaterial * thePropagatorAl
edm::ESHandle< MagneticField > magfield
PropagatorWithMaterial * thePropagatorOp
T const * product() const
Definition: ESHandle.h:62
GlobalTrackingRegion region
CosmicHitPairGenerator * thePairGenerator
edm::ESHandle< TrackerGeometry > tracker
void SeedGeneratorForCRack::run ( TrajectorySeedCollection output,
const edm::EventSetup c 
)

Definition at line 45 of file SeedGeneratorForCRack.cc.

References region, seeds(), thePairGenerator, thePropagatorAl, thePropagatorOp, and theUpdator.

Referenced by CRackSeedGenerator::produce().

45  {
46  seeds(output,iSetup,region);
47  delete thePairGenerator;
48  delete thePropagatorAl;
49  delete thePropagatorOp;
50  delete theUpdator;
51 }
void seeds(TrajectorySeedCollection &output, const edm::EventSetup &c, const TrackingRegion &region)
PropagatorWithMaterial * thePropagatorAl
PropagatorWithMaterial * thePropagatorOp
GlobalTrackingRegion region
CosmicHitPairGenerator * thePairGenerator
void SeedGeneratorForCRack::seeds ( TrajectorySeedCollection output,
const edm::EventSetup c,
const TrackingRegion region 
)

Definition at line 53 of file SeedGeneratorForCRack.cc.

References alongMomentum, clone(), HitPairs, i, SurfaceOrientation::inner, TrajectoryStateOnSurface::isValid(), LogDebug, magfield, multipleScatteringFactor, oppositeToMomentum, SurfaceOrientation::outer, trajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), TrajectoryStateOnSurface::rescaleError(), seedMomentum, OrderedHitPairs::size(), thePropagatorOp, theUpdator, tracker, Vector3DBase< T, FrameTag >::unit(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by run().

55  {
56  for(unsigned int is=0;is<HitPairs.size();is++){
57 
58  GlobalPoint inner = tracker->idToDet((*(HitPairs[is].inner())).geographicalId())->surface().toGlobal((*(HitPairs[is].inner())).localPosition());
59  GlobalPoint outer = tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface().toGlobal((*(HitPairs[is].outer())).localPosition());
60 
61  LogDebug("CosmicSeedFinder") <<"inner point of the seed "<<inner <<" outer point of the seed "<<outer;
62  SeedingHitSet::ConstRecHitPointer inrhit= HitPairs[is].inner();
63  SeedingHitSet::ConstRecHitPointer outrhit = HitPairs[is].outer();
64 
66  hits.push_back(HitPairs[is].outer()->hit()->clone());
67 
68  for (int i=0;i<2;i++){
69  //FIRST STATE IS CALCULATED CONSIDERING THAT THE CHARGE CAN BE POSITIVE OR NEGATIVE
70  int predsign=(2*i)-1;
71  if((outer.y()-inner.y())>0){
72  GlobalVector momentum = GlobalVector(inner-outer);
73  momentum = momentum.unit()*seedMomentum;
75  momentum,
76  predsign,
77  &(*magfield));
78  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
79  TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
80  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
81  //Cosmic Seed update inner...
82  LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerUpdated;
83 
84  //First propagation
85  const TSOS outerState =
86  thePropagatorOp->propagate(innerUpdated,
87  tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
88  if ( outerState.isValid()) {
89  LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
90  TSOS outerUpdated= theUpdator->update( outerState,*outrhit);
91  //fudge factor for multiple scattering
93  if ( outerUpdated.isValid()) {
94  LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
95 
96  PTrajectoryStateOnDet PTraj=
97  trajectoryStateTransform::persistentState(outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
98  output.push_back(TrajectorySeed(PTraj,hits,alongMomentum));
99 
100  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
101  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
102 
103 
104  }
105  else{
106  GlobalVector momentum= GlobalVector(outer-inner);
107  momentum=momentum.unit()*seedMomentum;
108  GlobalTrajectoryParameters Gtp(inner,
109  momentum,
110  predsign,
111  &(*magfield));
112  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
113  TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
114  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
115  LogDebug("CosmicSeedFinder") << " FirstTSOS "<< innerState;
116 
117  //First propagation
118  const TSOS outerState =
119  thePropagatorOp->propagate(innerUpdated,
120  tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
121  if ( outerState.isValid()) {
122 
123  LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
124  TSOS outerUpdated = theUpdator->update( outerState,*outrhit);
125  //fudge factor for multiple scattering
126  outerUpdated.rescaleError( multipleScatteringFactor);
127  if ( outerUpdated.isValid()) {
128  LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
129  PTrajectoryStateOnDet PTraj=
130  trajectoryStateTransform::persistentState(outerUpdated,(*(HitPairs[is].outer())).geographicalId().rawId());
131  output.push_back(TrajectorySeed(PTraj,hits,oppositeToMomentum));
132 
133  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
134  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
135  }
136  }
137  }
138 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
T y() const
Definition: PV3DBase.h:63
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
virtual unsigned int size() const
TrajectoryStateOnSurface TSOS
void push_back(D *&d)
Definition: OwnVector.h:274
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11
edm::ESHandle< MagneticField > magfield
Vector3DBase unit() const
Definition: Vector3DBase.h:57
PropagatorWithMaterial * thePropagatorOp
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::ESHandle< TrackerGeometry > tracker

Member Data Documentation

std::string SeedGeneratorForCRack::builderName
private

Definition at line 49 of file SeedGeneratorForCRack.h.

Referenced by init(), and SeedGeneratorForCRack().

edm::ParameterSet SeedGeneratorForCRack::conf_
private

Definition at line 39 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack().

std::string SeedGeneratorForCRack::geometry
private
OrderedHitPairs SeedGeneratorForCRack::HitPairs
private

Definition at line 52 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

edm::ESHandle<MagneticField> SeedGeneratorForCRack::magfield
private

Definition at line 42 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

float SeedGeneratorForCRack::multipleScatteringFactor
private

Definition at line 53 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

GlobalTrackingRegion SeedGeneratorForCRack::region
private

Definition at line 40 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

double SeedGeneratorForCRack::seedMomentum
private

Definition at line 54 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

float SeedGeneratorForCRack::seedpt
private

Definition at line 51 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack().

CosmicHitPairGenerator* SeedGeneratorForCRack::thePairGenerator
private

Definition at line 41 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

PropagatorWithMaterial* SeedGeneratorForCRack::thePropagatorAl
private

Definition at line 46 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

PropagatorWithMaterial* SeedGeneratorForCRack::thePropagatorOp
private

Definition at line 47 of file SeedGeneratorForCRack.h.

Referenced by init(), run(), and seeds().

KFUpdator* SeedGeneratorForCRack::theUpdator
private

Definition at line 45 of file SeedGeneratorForCRack.h.

Referenced by init(), run(), and seeds().

edm::ESHandle<TrackerGeometry> SeedGeneratorForCRack::tracker
private

Definition at line 43 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

const TransientTrackingRecHitBuilder* SeedGeneratorForCRack::TTTRHBuilder
private

Definition at line 48 of file SeedGeneratorForCRack.h.

Referenced by init().