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, ptmin, region, seedMomentum, and seedpt.

31  :
32  conf_(conf)
33 {
34  float ptmin=conf_.getParameter<double>("ptMin");
35  float originradius=conf_.getParameter<double>("originRadius");
36  float halflength=conf_.getParameter<double>("originHalfLength");
37  float originz=conf_.getParameter<double>("originZPosition");
38  seedpt = conf_.getParameter<double>("SeedPt");
39 
40  builderName = conf_.getParameter<std::string>("TTRHBuilder");
41  geometry=conf_.getUntrackedParameter<std::string>("GeometricStructure","STANDARD");
42  region=GlobalTrackingRegion(ptmin,originradius,
43  halflength,originz);
44  multipleScatteringFactor=conf_.getUntrackedParameter<double>("multipleScatteringFactor", 1.0);
45  seedMomentum =conf_.getUntrackedParameter<double>("SeedMomentum",1);
46  edm::LogInfo("SeedGeneratorForCRack")<<" PtMin of track is "<<ptmin<<
47  " The Radius of the cylinder for seeds is "<<originradius <<"cm" << " The set Seed Momentum" << seedpt;
48 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double ptmin
Definition: HydjetWrapper.h:86
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 50 of file SeedGeneratorForCRack.cc.

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

Referenced by CRackSeedGenerator::produce().

50  {
51  seeds(output,iSetup,region);
52  delete thePairGenerator;
53  delete thePropagatorAl;
54  delete thePropagatorOp;
55  delete theUpdator;
56 }
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 58 of file SeedGeneratorForCRack.cc.

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

Referenced by run().

60  {
61  for(unsigned int is=0;is<HitPairs.size();is++){
62 
63  GlobalPoint inner = tracker->idToDet((*(HitPairs[is].inner())).geographicalId())->surface().toGlobal((*(HitPairs[is].inner())).localPosition());
64  GlobalPoint outer = tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface().toGlobal((*(HitPairs[is].outer())).localPosition());
65 
66  LogDebug("CosmicSeedFinder") <<"inner point of the seed "<<inner <<" outer point of the seed "<<outer;
69 
71  hits.push_back(HitPairs[is].outer()->hit()->clone());
72 
73  for (int i=0;i<2;i++){
74  //FIRST STATE IS CALCULATED CONSIDERING THAT THE CHARGE CAN BE POSITIVE OR NEGATIVE
75  int predsign=(2*i)-1;
76  if((outer.y()-inner.y())>0){
77  GlobalVector momentum = GlobalVector(inner-outer);
78  momentum = momentum.unit()*seedMomentum;
80  momentum,
81  predsign,
82  &(*magfield));
83  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
84  TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
85  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
86  //Cosmic Seed update inner...
87  LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerUpdated;
88 
89  //First propagation
90  const TSOS outerState =
91  thePropagatorOp->propagate(innerUpdated,
92  tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
93  if ( outerState.isValid()) {
94  LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
95  TSOS outerUpdated= theUpdator->update( outerState,*outrhit);
96  //fudge factor for multiple scattering
98  if ( outerUpdated.isValid()) {
99  LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
100 
101  PTrajectoryStateOnDet PTraj=
102  trajectoryStateTransform::persistentState(outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
103  output.push_back(TrajectorySeed(PTraj,hits,alongMomentum));
104 
105  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
106  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
107 
108 
109  }
110  else{
111  GlobalVector momentum= GlobalVector(outer-inner);
112  momentum=momentum.unit()*seedMomentum;
113  GlobalTrajectoryParameters Gtp(inner,
114  momentum,
115  predsign,
116  &(*magfield));
117  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
118  TSOS innerState = TSOS(Gtp, CurvilinearTrajectoryError(errMatrix), tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
119  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
120  LogDebug("CosmicSeedFinder") << " FirstTSOS "<< innerState;
121 
122  //First propagation
123  const TSOS outerState =
124  thePropagatorOp->propagate(innerUpdated,
125  tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
126  if ( outerState.isValid()) {
127 
128  LogDebug("CosmicSeedFinder") <<"outerState "<<outerState;
129  TSOS outerUpdated = theUpdator->update( outerState,*outrhit);
130  //fudge factor for multiple scattering
131  outerUpdated.rescaleError( multipleScatteringFactor);
132  if ( outerUpdated.isValid()) {
133  LogDebug("CosmicSeedFinder") <<"outerUpdated "<<outerUpdated;
134  PTrajectoryStateOnDet PTraj=
135  trajectoryStateTransform::persistentState(outerUpdated,(*(HitPairs[is].outer())).geographicalId().rawId());
136  output.push_back(TrajectorySeed(PTraj,hits,oppositeToMomentum));
137 
138  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
139  }else edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
140  }
141  }
142  }
143 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
const TransientTrackingRecHitBuilder * TTTRHBuilder
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
T y() const
Definition: PV3DBase.h:62
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:273
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
edm::ESHandle< MagneticField > magfield
virtual TrajectoryStateOnSurface propagate(const TrajectoryStateOnSurface &tsos, const Plane &plane) const
Vector3DBase unit() const
Definition: Vector3DBase.h:57
PropagatorWithMaterial * thePropagatorOp
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
Definition: KFUpdator.cc:10
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(), run(), and SeedGeneratorForCRack().

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(), and seeds().