CMS 3D CMS Logo

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, edm::ConsumesCollector)
 
void seeds (TrajectorySeedCollection &output, const edm::EventSetup &c, const TrackingRegion &region)
 
virtual ~SeedGeneratorForCRack ()
 

Private Attributes

std::string geometry
 
OrderedHitPairs HitPairs
 
edm::ESHandle< MagneticFieldmagfield
 
float multipleScatteringFactor
 
GlobalTrackingRegion region
 
double seedMomentum
 
float seedpt
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheMagfieldToken
 
CosmicHitPairGeneratorthePairGenerator
 
PropagatorWithMaterialthePropagatorAl
 
PropagatorWithMaterialthePropagatorOp
 
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecordtheSearchTrackerToken
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtheTrackerToken
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTTopoToken
 
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordtheTTRHToken
 
KFUpdatortheUpdator
 
edm::ESHandle< TrackerGeometrytracker
 
const TransientTrackingRecHitBuilderTTTRHBuilder
 

Detailed Description

Definition at line 25 of file SeedGeneratorForCRack.h.

Member Typedef Documentation

◆ TSOS

Definition at line 27 of file SeedGeneratorForCRack.h.

Constructor & Destructor Documentation

◆ SeedGeneratorForCRack()

SeedGeneratorForCRack::SeedGeneratorForCRack ( const edm::ParameterSet conf,
edm::ConsumesCollector  iCC 
)

Definition at line 29 of file SeedGeneratorForCRack.cc.

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

34  theTTRHToken(iCC.esConsumes(edm::ESInputTag("", conf.getParameter<std::string>("TTRHBuilder")))),
35  region(conf.getParameter<double>("ptMin"),
36  conf.getParameter<double>("originRadius"),
37  conf.getParameter<double>("originHalfLength"),
38  conf.getParameter<double>("originZPosition")) {
39  seedpt = conf.getParameter<double>("SeedPt");
40  geometry = conf.getUntrackedParameter<std::string>("GeometricStructure", "STANDARD");
41  multipleScatteringFactor = conf.getUntrackedParameter<double>("multipleScatteringFactor", 1.0);
42  seedMomentum = conf.getUntrackedParameter<double>("SeedMomentum", 1);
43 }
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTTRHToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTTopoToken
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMagfieldToken
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > theTrackerToken
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theSearchTrackerToken
GlobalTrackingRegion region

◆ ~SeedGeneratorForCRack()

virtual SeedGeneratorForCRack::~SeedGeneratorForCRack ( )
inlinevirtual

Definition at line 29 of file SeedGeneratorForCRack.h.

29 {};

Member Function Documentation

◆ init()

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, edm::EventSetup::getData(), edm::EventSetup::getHandle(), CosmicHitPairGenerator::hitPairs(), HitPairs, LogDebug, magfield, oppositeToMomentum, region, OrderedHitPairs::size(), theMagfieldToken, thePairGenerator, thePropagatorAl, thePropagatorOp, theSearchTrackerToken, theTrackerToken, theTTopoToken, theTTRHToken, theUpdator, HLT_2022v12_cff::track, tracker, and TTTRHBuilder.

Referenced by CRackSeedGenerator::produce().

9  {
10  magfield = iSetup.getHandle(theMagfieldToken);
11  tracker = iSetup.getHandle(theTrackerToken);
14  theUpdator = new KFUpdator();
15 
16  // get the transient builder
17  TTTRHBuilder = &iSetup.getData(theTTRHToken);
18 
19  GeometricSearchTracker const& track = iSetup.getData(theSearchTrackerToken);
20  TrackerTopology const& ttopo = iSetup.getData(theTTopoToken);
21 
22  CosmicLayerPairs cosmiclayers(geometry, collrphi, collmatched, track, ttopo);
23  thePairGenerator = new CosmicHitPairGenerator(cosmiclayers, *tracker);
24  HitPairs.clear();
26  LogDebug("CosmicSeedFinder") << "Initialized with " << HitPairs.size() << " hit pairs" << std::endl;
27 }
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTTRHToken
const TransientTrackingRecHitBuilder * TTTRHBuilder
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTTopoToken
PropagatorWithMaterial * thePropagatorAl
edm::ESHandle< MagneticField > magfield
unsigned int size() const override
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMagfieldToken
PropagatorWithMaterial * thePropagatorOp
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > theTrackerToken
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theSearchTrackerToken
GlobalTrackingRegion region
void hitPairs(const TrackingRegion &reg, OrderedHitPairs &pr)
form base class
CosmicHitPairGenerator * thePairGenerator
#define LogDebug(id)
edm::ESHandle< TrackerGeometry > tracker

◆ run()

void SeedGeneratorForCRack::run ( TrajectorySeedCollection output,
const edm::EventSetup c 
)

Definition at line 45 of file SeedGeneratorForCRack.cc.

References convertSQLitetoXML_cfg::output, 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

◆ seeds()

void SeedGeneratorForCRack::seeds ( TrajectorySeedCollection output,
const edm::EventSetup c,
const TrackingRegion region 
)

Definition at line 53 of file SeedGeneratorForCRack.cc.

References alongMomentum, clone(), HitPairs, hfClusterShapes_cfi::hits, mps_fire::i, TrackerGeometry::idToDet(), SurfaceOrientation::inner, TrajectoryStateOnSurface::isValid(), LogDebug, magfield, multipleScatteringFactor, oppositeToMomentum, SurfaceOrientation::outer, convertSQLitetoXML_cfg::output, trajectoryStateTransform::persistentState(), PropagatorWithMaterial::propagate(), TrajectoryStateOnSurface::rescaleError(), seedMomentum, OrderedHitPairs::size(), GeomDet::surface(), thePropagatorOp, theUpdator, Surface::toGlobal(), tracker, Vector3DBase< T, FrameTag >::unit(), and KFUpdator::update().

Referenced by run().

55  {
56  for (unsigned int is = 0; is < HitPairs.size(); is++) {
57  GlobalPoint inner = tracker->idToDet((*(HitPairs[is].inner())).geographicalId())
58  ->surface()
59  .toGlobal((*(HitPairs[is].inner())).localPosition());
60  GlobalPoint outer = tracker->idToDet((*(HitPairs[is].outer())).geographicalId())
61  ->surface()
62  .toGlobal((*(HitPairs[is].outer())).localPosition());
63 
64  LogDebug("CosmicSeedFinder") << "inner point of the seed " << inner << " outer point of the seed " << outer;
65  SeedingHitSet::ConstRecHitPointer inrhit = HitPairs[is].inner();
66  SeedingHitSet::ConstRecHitPointer outrhit = HitPairs[is].outer();
67 
69  hits.push_back(HitPairs[is].outer()->hit()->clone());
70 
71  for (int i = 0; i < 2; i++) {
72  //FIRST STATE IS CALCULATED CONSIDERING THAT THE CHARGE CAN BE POSITIVE OR NEGATIVE
73  int predsign = (2 * i) - 1;
74  if ((outer.y() - inner.y()) > 0) {
75  GlobalVector momentum = GlobalVector(inner - outer);
76  momentum = momentum.unit() * seedMomentum;
77  GlobalTrajectoryParameters Gtp(inner, momentum, predsign, &(*magfield));
78  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
79  TSOS innerState = TSOS(Gtp,
80  CurvilinearTrajectoryError(errMatrix),
81  tracker->idToDet((HitPairs[is].inner()->hit())->geographicalId())->surface());
82  const TSOS innerUpdated = theUpdator->update(innerState, *inrhit);
83  //Cosmic Seed update inner...
84  LogDebug("CosmicSeedFinder") << " FirstTSOS " << innerUpdated;
85 
86  //First propagation
87  const TSOS outerState = thePropagatorOp->propagate(
88  innerUpdated, tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
89  if (outerState.isValid()) {
90  LogDebug("CosmicSeedFinder") << "outerState " << outerState;
91  TSOS outerUpdated = theUpdator->update(outerState, *outrhit);
92  //fudge factor for multiple scattering
94  if (outerUpdated.isValid()) {
95  LogDebug("CosmicSeedFinder") << "outerUpdated " << outerUpdated;
96 
98  outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
99  output.push_back(TrajectorySeed(PTraj, hits, alongMomentum));
100 
101  } else
102  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
103  } else
104  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
105 
106  } else {
107  GlobalVector momentum = GlobalVector(outer - inner);
108  momentum = momentum.unit() * seedMomentum;
109  GlobalTrajectoryParameters Gtp(inner, momentum, predsign, &(*magfield));
110  AlgebraicSymMatrix55 errMatrix = ROOT::Math::SMatrixIdentity();
111  TSOS innerState = TSOS(Gtp,
112  CurvilinearTrajectoryError(errMatrix),
113  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 = thePropagatorOp->propagate(
119  innerUpdated, tracker->idToDet((*(HitPairs[is].outer())).geographicalId())->surface());
120  if (outerState.isValid()) {
121  LogDebug("CosmicSeedFinder") << "outerState " << outerState;
122  TSOS outerUpdated = theUpdator->update(outerState, *outrhit);
123  //fudge factor for multiple scattering
125  if (outerUpdated.isValid()) {
126  LogDebug("CosmicSeedFinder") << "outerUpdated " << outerUpdated;
128  outerUpdated, (*(HitPairs[is].outer())).geographicalId().rawId());
129  output.push_back(TrajectorySeed(PTraj, hits, oppositeToMomentum));
130 
131  } else
132  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first update failed ";
133  } else
134  edm::LogWarning("CosmicSeedFinder") << " SeedForCosmics first propagation failed ";
135  }
136  }
137  }
138 }
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
TrajectoryStateOnSurface TSOS
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:14
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:177
edm::ESHandle< MagneticField > magfield
const TrackerGeomDet * idToDet(DetId) const override
unsigned int size() const override
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
PropagatorWithMaterial * thePropagatorOp
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Log< level::Warning, false > LogWarning
Global3DVector GlobalVector
Definition: GlobalVector.h:10
#define LogDebug(id)
edm::ESHandle< TrackerGeometry > tracker

Member Data Documentation

◆ geometry

std::string SeedGeneratorForCRack::geometry
private

Definition at line 55 of file SeedGeneratorForCRack.h.

◆ HitPairs

OrderedHitPairs SeedGeneratorForCRack::HitPairs
private

Definition at line 57 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

◆ magfield

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

Definition at line 48 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

◆ multipleScatteringFactor

float SeedGeneratorForCRack::multipleScatteringFactor
private

Definition at line 58 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

◆ region

GlobalTrackingRegion SeedGeneratorForCRack::region
private

Definition at line 46 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

◆ seedMomentum

double SeedGeneratorForCRack::seedMomentum
private

Definition at line 59 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack(), and seeds().

◆ seedpt

float SeedGeneratorForCRack::seedpt
private

Definition at line 56 of file SeedGeneratorForCRack.h.

Referenced by SeedGeneratorForCRack().

◆ theMagfieldToken

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedGeneratorForCRack::theMagfieldToken
private

Definition at line 40 of file SeedGeneratorForCRack.h.

Referenced by init().

◆ thePairGenerator

CosmicHitPairGenerator* SeedGeneratorForCRack::thePairGenerator
private

Definition at line 47 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

◆ thePropagatorAl

PropagatorWithMaterial* SeedGeneratorForCRack::thePropagatorAl
private

Definition at line 52 of file SeedGeneratorForCRack.h.

Referenced by init(), and run().

◆ thePropagatorOp

PropagatorWithMaterial* SeedGeneratorForCRack::thePropagatorOp
private

Definition at line 53 of file SeedGeneratorForCRack.h.

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

◆ theSearchTrackerToken

const edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> SeedGeneratorForCRack::theSearchTrackerToken
private

Definition at line 42 of file SeedGeneratorForCRack.h.

Referenced by init().

◆ theTrackerToken

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SeedGeneratorForCRack::theTrackerToken
private

Definition at line 41 of file SeedGeneratorForCRack.h.

Referenced by init().

◆ theTTopoToken

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SeedGeneratorForCRack::theTTopoToken
private

Definition at line 43 of file SeedGeneratorForCRack.h.

Referenced by init().

◆ theTTRHToken

const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> SeedGeneratorForCRack::theTTRHToken
private

Definition at line 44 of file SeedGeneratorForCRack.h.

Referenced by init().

◆ theUpdator

KFUpdator* SeedGeneratorForCRack::theUpdator
private

Definition at line 51 of file SeedGeneratorForCRack.h.

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

◆ tracker

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

Definition at line 49 of file SeedGeneratorForCRack.h.

Referenced by init(), and seeds().

◆ TTTRHBuilder

const TransientTrackingRecHitBuilder* SeedGeneratorForCRack::TTTRHBuilder
private

Definition at line 54 of file SeedGeneratorForCRack.h.

Referenced by init().