29 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
30 check(conf, consumesCollector())
34 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
35 produces<TrajectorySeedCollection>();
42 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet>>(
"OrderedHitsFactoryPSets");
43 std::vector<edm::ParameterSet>::const_iterator iPSet;
45 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++) {
69 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Upper Scintillator position x, y, z " << upperPosition.
x() <<
", " 70 << upperPosition.
y() <<
", " << upperPosition.
z();
72 lowerScintPar.getParameter<
double>(
"WidthInX"), lowerScintPar.getParameter<
double>(
"LenghtInZ"), 1);
73 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
74 lowerScintPar.getParameter<
double>(
"GlobalY"),
75 lowerScintPar.getParameter<
double>(
"GlobalZ"));
76 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Lower Scintillator position x, y, z " << lowerPosition.
x() <<
", " 77 << lowerPosition.
y() <<
", " << lowerPosition.
z();
86 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet>>(
"OrderedHitsFactoryPSets");
87 std::vector<edm::ParameterSet>::const_iterator iPSet;
88 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++) {
90 if (propagationDirection ==
"alongMomentum")
95 if (navigationDirection ==
"insideOut")
109 propagatorAlongHandle.
product(),
110 propagatorOppositeHandle.
product(),
123 auto output = std::make_unique<TrajectorySeedCollection>();
133 edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
145 for (
auto iReg =
regions.begin(); iReg !=
regions.end(); iReg++) {
169 for (
unsigned int i = 0;
i < osh.
size();
i++) {
173 for (std::vector<TrajectorySeed*>::const_iterator iSeed =
seeds.begin(); iSeed !=
seeds.end(); iSeed++) {
175 edm::LogError(
"CtfSpecialSeedGenerator") <<
"a seed pointer is null. skipping.";
179 output.push_back(**iSeed);
197 std::vector<std::pair<unsigned int, unsigned int>> vSubdetLayer;
203 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
205 for (
unsigned int iHit = 0; iHit <
nHits; ++iHit) {
207 auto trh = shs[iHit];
212 if (checkHitsAtPositiveY) {
217 if (checkHitsAtNegativeY) {
224 unsigned int subid = (*trh).geographicalId().subdetId();
225 unsigned int layer = tTopo->
layer((*trh).geographicalId());
226 std::vector<std::pair<unsigned int, unsigned int>>::const_iterator iter;
228 if (checkHitsOnDifferentLayers) {
229 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++) {
230 if (iter->first == subid && iter->second ==
layer)
240 vSubdetLayer.push_back(std::make_pair(subid,
layer));
257 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionUpper =
259 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionLower =
261 if (!(positionUpper.first && positionLower.first)) {
262 edm::LogVerbatim(
"CtfSpecialSeedGenerator::checkDirection") <<
"Scintillator plane not crossed";
270 <<
"position on Upper scintillator " << positionUpper.second;
272 <<
"position on Lower scintillator " << positionLower.second;
277 <<
"scintillator not crossed in bounds: position on Upper scintillator " << positionUpper.second
278 <<
" position on Lower scintillator " << positionLower.second;
Log< level::Info, true > LogVerbatim
std::unique_ptr< SeedFromGenericPairOrTriplet > theSeedBuilder
std::unique_ptr< TrackingRegionProducer > theRegionProducer
T getParameter(std::string const &) const
size_t tooManyClusters(const edm::Event &e) const
def create(alignables, pedeDump, additionalData, outputFile, config)
bool useScintillatorsConstraint
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
BoundPlane::BoundPlanePointer lowerScintillator
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theBuilderToken
virtual unsigned int size() const =0
bool run(const edm::EventSetup &c, const edm::Event &e, TrajectorySeedCollection &output)
Log< level::Error, false > LogError
bool buildSeeds(const edm::EventSetup &iSetup, const edm::Event &e, const OrderedSeedingHits &osh, const NavigationDirection &navdir, const PropagationDirection &dir, TrajectorySeedCollection &output)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropOppositeToken
CtfSpecialSeedGenerator(const edm::ParameterSet &conf)
unsigned int detId() const
unsigned int layer(const DetId &id) const
BoundPlane::BoundPlanePointer upperScintillator
T const * product() const
std::vector< TrajectorySeed > TrajectorySeedCollection
unsigned int size() const
PositionType position(float s) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const TrackerGeomDet * idToDet(DetId) const override
Log< level::Info, false > LogInfo
bool preliminaryCheck(const SeedingHitSet &shs, const edm::EventSetup &es)
~CtfSpecialSeedGenerator() override
const Plane & surface() const
The nominal surface of the GeomDet.
bool postCheck(const TrajectorySeed &seed)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > thePropAlongToken
void produce(edm::Event &e, const edm::EventSetup &c) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::ESHandle< MagneticField > theMagfield
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > theTrackerToken
edm::ESHandle< TrackerGeometry > theTracker
FreeTrajectoryState const * freeState(bool withErrors=true) const
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
charges
only generated particles of these IDs are considered
Log< level::Warning, false > LogWarning
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< NavigationDirection > theNavDirs
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopoToken
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken
std::vector< PropagationDirection > thePropDirs