21 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
22 check(conf, consumesCollector())
26 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
27 produces<TrajectorySeedCollection>();
34 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet>>(
"OrderedHitsFactoryPSets");
35 std::vector<edm::ParameterSet>::const_iterator iPSet;
37 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++) {
63 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Upper Scintillator position x, y, z " << upperPosition.
x() <<
", " 64 << upperPosition.
y() <<
", " << upperPosition.
z();
66 lowerScintPar.getParameter<
double>(
"WidthInX"), lowerScintPar.getParameter<
double>(
"LenghtInZ"), 1);
67 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
68 lowerScintPar.getParameter<
double>(
"GlobalY"),
69 lowerScintPar.getParameter<
double>(
"GlobalZ"));
70 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Lower Scintillator position x, y, z " << lowerPosition.
x() <<
", " 71 << lowerPosition.
y() <<
", " << lowerPosition.
z();
82 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet>>(
"OrderedHitsFactoryPSets");
83 std::vector<edm::ParameterSet>::const_iterator iPSet;
84 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++) {
86 if (propagationDirection ==
"alongMomentum")
91 if (navigationDirection ==
"insideOut")
105 propagatorAlongHandle.
product(),
106 propagatorOppositeHandle.
product(),
113 theSeedBuilder->setMomentumTo(p);
119 auto output = std::make_unique<TrajectorySeedCollection>();
129 edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
141 for (
auto iReg = regions.begin(); iReg != regions.end(); iReg++) {
165 for (
unsigned int i = 0;
i < osh.
size();
i++) {
168 std::vector<TrajectorySeed*> seeds =
theSeedBuilder->seed(shs, dir, navdir, iSetup);
169 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++) {
171 edm::LogError(
"CtfSpecialSeedGenerator") <<
"a seed pointer is null. skipping.";
175 output.push_back(**iSeed);
183 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds (" << output.size() <<
"), bailing out.\n";
194 std::vector<std::pair<unsigned int, unsigned int>> vSubdetLayer;
200 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
201 unsigned int nHits = shs.
size();
202 for (
unsigned int iHit = 0; iHit < nHits; ++iHit) {
204 auto trh = shs[iHit];
209 if (checkHitsAtPositiveY) {
214 if (checkHitsAtNegativeY) {
221 unsigned int subid = (*trh).geographicalId().subdetId();
222 unsigned int layer = tTopo->
layer((*trh).geographicalId());
223 std::vector<std::pair<unsigned int, unsigned int>>::const_iterator iter;
225 if (checkHitsOnDifferentLayers) {
226 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++) {
227 if (iter->first == subid && iter->second == layer)
237 vSubdetLayer.push_back(std::make_pair(subid, layer));
254 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionUpper =
256 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionLower =
258 if (!(positionUpper.first && positionLower.first)) {
259 edm::LogVerbatim(
"CtfSpecialSeedGenerator::checkDirection") <<
"Scintillator plane not crossed";
267 <<
"position on Upper scintillator " << positionUpper.second;
269 <<
"position on Lower scintillator " << positionLower.second;
274 <<
"scintillator not crossed in bounds: position on Upper scintillator " << positionUpper.second
275 <<
" position on Lower scintillator " << positionLower.second;
T getParameter(std::string const &) const
std::unique_ptr< SeedFromGenericPairOrTriplet > theSeedBuilder
std::unique_ptr< TrackingRegionProducer > theRegionProducer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
def create(alignables, pedeDump, additionalData, outputFile, config)
bool useScintillatorsConstraint
BoundPlane::BoundPlanePointer lowerScintillator
bool run(const edm::EventSetup &c, const edm::Event &e, TrajectorySeedCollection &output)
bool buildSeeds(const edm::EventSetup &iSetup, const edm::Event &e, const OrderedSeedingHits &osh, const NavigationDirection &navdir, const PropagationDirection &dir, TrajectorySeedCollection &output)
const Plane & surface() const
The nominal surface of the GeomDet.
CtfSpecialSeedGenerator(const edm::ParameterSet &conf)
BoundPlane::BoundPlanePointer upperScintillator
std::vector< TrajectorySeed > TrajectorySeedCollection
FreeTrajectoryState const * freeState(bool withErrors=true) const
size_t tooManyClusters(const edm::Event &e) const
PositionType position(float s) const
unsigned int detId() const
virtual unsigned int size() const =0
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool preliminaryCheck(const SeedingHitSet &shs, const edm::EventSetup &es)
~CtfSpecialSeedGenerator() override
PTrajectoryStateOnDet const & startingState() const
bool postCheck(const TrajectorySeed &seed)
unsigned int layer(const DetId &id) const
void produce(edm::Event &e, const edm::EventSetup &c) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::ESHandle< MagneticField > theMagfield
unsigned int size() const
edm::ESHandle< TrackerGeometry > theTracker
const TrackerGeomDet * idToDet(DetId) const override
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
charges
only generated particles of these IDs are considered
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< NavigationDirection > theNavDirs
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
T const * product() const
std::vector< PropagationDirection > thePropDirs