CMS 3D CMS Logo

SeedGeneratorForCRack.cc
Go to the documentation of this file.
6  const SiStripRecHit2DCollection& collrphi,
7  const SiStripMatchedRecHit2DCollection& collmatched,
8  const edm::EventSetup& iSetup) {
13  theUpdator = new KFUpdator();
14 
15  // get the transient builder
16 
18 
19  iSetup.get<TransientRecHitRecord>().get(builderName, theBuilder);
20  TTTRHBuilder = theBuilder.product();
21  CosmicLayerPairs cosmiclayers(geometry);
22  cosmiclayers.init(collstereo, collrphi, collmatched, iSetup);
23  thePairGenerator = new CosmicHitPairGenerator(cosmiclayers, iSetup);
24  HitPairs.clear();
26  LogDebug("CosmicSeedFinder") << "Initialized with " << HitPairs.size() << " hit pairs" << std::endl;
27 }
28 
30  : conf_(conf),
31  region(conf.getParameter<double>("ptMin"),
32  conf.getParameter<double>("originRadius"),
33  conf.getParameter<double>("originHalfLength"),
34  conf.getParameter<double>("originZPosition")) {
35  seedpt = conf_.getParameter<double>("SeedPt");
36  builderName = conf_.getParameter<std::string>("TTRHBuilder");
37  geometry = conf_.getUntrackedParameter<std::string>("GeometricStructure", "STANDARD");
38  multipleScatteringFactor = conf_.getUntrackedParameter<double>("multipleScatteringFactor", 1.0);
39  seedMomentum = conf_.getUntrackedParameter<double>("SeedMomentum", 1);
40 }
41 
43  seeds(output, iSetup, region);
44  delete thePairGenerator;
45  delete thePropagatorAl;
46  delete thePropagatorOp;
47  delete theUpdator;
48 }
49 
51  const edm::EventSetup& iSetup,
52  const TrackingRegion& region) {
53  for (unsigned int is = 0; is < HitPairs.size(); is++) {
54  GlobalPoint inner = tracker->idToDet((*(HitPairs[is].inner())).geographicalId())
55  ->surface()
56  .toGlobal((*(HitPairs[is].inner())).localPosition());
57  GlobalPoint outer = tracker->idToDet((*(HitPairs[is].outer())).geographicalId())
58  ->surface()
59  .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;
74  GlobalTrajectoryParameters Gtp(inner, momentum, predsign, &(*magfield));
75  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
76  TSOS innerState = TSOS(Gtp,
77  CurvilinearTrajectoryError(errMatrix),
78  tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
79  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
80  //Cosmic Seed update inner...
81  LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerUpdated;
82 
83  //First propagation
84  const TSOS outerState = thePropagatorOp->propagate(
85  innerUpdated, tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
86  if (outerState.isValid()) {
87  LogDebug("CosmicSeedFinder") << "outerState " << outerState;
88  TSOS outerUpdated = theUpdator->update(outerState, *outrhit);
89  //fudge factor for multiple scattering
91  if (outerUpdated.isValid()) {
92  LogDebug("CosmicSeedFinder") << "outerUpdated " << outerUpdated;
93 
95  outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
96  output.push_back(TrajectorySeed(PTraj, hits, alongMomentum));
97 
98  } else
99  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
100  } else
101  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
102 
103  } else {
104  GlobalVector momentum = GlobalVector(outer - inner);
105  momentum = momentum.unit() * seedMomentum;
106  GlobalTrajectoryParameters Gtp(inner, momentum, predsign, &(*magfield));
107  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
108  TSOS innerState = TSOS(Gtp,
109  CurvilinearTrajectoryError(errMatrix),
110  tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
111  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
112  LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerState;
113 
114  //First propagation
115  const TSOS outerState = thePropagatorOp->propagate(
116  innerUpdated, tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
117  if (outerState.isValid()) {
118  LogDebug("CosmicSeedFinder") << "outerState " << outerState;
119  TSOS outerUpdated = theUpdator->update(outerState, *outrhit);
120  //fudge factor for multiple scattering
122  if (outerUpdated.isValid()) {
123  LogDebug("CosmicSeedFinder") << "outerUpdated " << outerUpdated;
125  outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
126  output.push_back(TrajectorySeed(PTraj, hits, oppositeToMomentum));
127 
128  } else
129  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
130  } else
131  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
132  }
133  }
134  }
135 }
Vector3DBase
Definition: Vector3DBase.h:8
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
KFUpdator::update
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:177
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
TrajectorySeedCollection
std::vector< TrajectorySeed > TrajectorySeedCollection
Definition: TrajectorySeedCollection.h:6
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
PropagatorWithMaterial::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
SeedGeneratorForCRack.h
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
TransientRecHitRecord.h
geometry
Definition: geometry.py:1
SeedingHitSet::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
oppositeToMomentum
Definition: PropagationDirection.h:4
SeedGeneratorForCRack::thePropagatorAl
PropagatorWithMaterial * thePropagatorAl
Definition: SeedGeneratorForCRack.h:42
SeedGeneratorForCRack::seedpt
float seedpt
Definition: SeedGeneratorForCRack.h:47
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
SeedGeneratorForCRack::thePairGenerator
CosmicHitPairGenerator * thePairGenerator
Definition: SeedGeneratorForCRack.h:37
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SeedGeneratorForCRack::init
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)
Definition: SeedGeneratorForCRack.cc:5
SeedGeneratorForCRack::tracker
edm::ESHandle< TrackerGeometry > tracker
Definition: SeedGeneratorForCRack.h:39
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
SeedGeneratorForCRack::seedMomentum
double seedMomentum
Definition: SeedGeneratorForCRack.h:50
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PropagatorWithMaterial
Definition: PropagatorWithMaterial.h:25
SeedGeneratorForCRack::multipleScatteringFactor
float multipleScatteringFactor
Definition: SeedGeneratorForCRack.h:49
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
SeedGeneratorForCRack::conf_
edm::ParameterSet conf_
Definition: SeedGeneratorForCRack.h:35
SurfaceOrientation::inner
Definition: Surface.h:19
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:16
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
edm::ESHandle< TransientTrackingRecHitBuilder >
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
SeedGeneratorForCRack::SeedGeneratorForCRack
SeedGeneratorForCRack(const edm::ParameterSet &conf)
Definition: SeedGeneratorForCRack.cc:29
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
CosmicLayerPairs::init
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &iSetup)
Definition: CosmicLayerPairs.cc:239
SeedGeneratorForCRack::theUpdator
KFUpdator * theUpdator
Definition: SeedGeneratorForCRack.h:41
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
SeedGeneratorForCRack::HitPairs
OrderedHitPairs HitPairs
Definition: SeedGeneratorForCRack.h:48
SeedGeneratorForCRack::magfield
edm::ESHandle< MagneticField > magfield
Definition: SeedGeneratorForCRack.h:38
edm::EventSetup
Definition: EventSetup.h:58
CosmicLayerPairs
Definition: CosmicLayerPairs.h:19
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SeedGeneratorForCRack::run
void run(TrajectorySeedCollection &, const edm::EventSetup &c)
Definition: SeedGeneratorForCRack.cc:42
TrajectoryStateOnSurface::rescaleError
void rescaleError(double factor)
Definition: TrajectoryStateOnSurface.h:82
CosmicLayerPairs.h
edmNew::DetSetVector
Definition: DetSetNew.h:13
CosmicHitPairGenerator
Definition: CosmicHitPairGenerator.h:17
SeedGeneratorForCRack::TTTRHBuilder
const TransientTrackingRecHitBuilder * TTTRHBuilder
Definition: SeedGeneratorForCRack.h:44
TrajectorySeed
Definition: TrajectorySeed.h:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
OrderedHitPairs::size
unsigned int size() const override
Definition: OrderedHitPairs.h:12
TrackingRegion
Definition: TrackingRegion.h:41
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
SurfaceOrientation::outer
Definition: Surface.h:19
SeedGeneratorForCRack::builderName
std::string builderName
Definition: SeedGeneratorForCRack.h:45
SeedGeneratorForCRack::region
GlobalTrackingRegion region
Definition: SeedGeneratorForCRack.h:36
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
alongMomentum
Definition: PropagationDirection.h:4
CosmicHitPairGenerator::hitPairs
void hitPairs(const TrackingRegion &reg, OrderedHitPairs &prs, const edm::EventSetup &iSetup)
form base class
Definition: CosmicHitPairGenerator.cc:25
KFUpdator
Definition: KFUpdator.h:32
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
SeedGeneratorForCRack::thePropagatorOp
PropagatorWithMaterial * thePropagatorOp
Definition: SeedGeneratorForCRack.h:43
edm::OwnVector< TrackingRecHit >
SeedGeneratorForCRack::TSOS
TrajectoryStateOnSurface TSOS
Definition: SeedGeneratorForCRack.h:23
SeedGeneratorForCRack::seeds
void seeds(TrajectorySeedCollection &output, const edm::EventSetup &c, const TrackingRegion &region)
Definition: SeedGeneratorForCRack.cc:50