27 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
28 check(conf, consumesCollector())
32 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
33 produces<TrajectorySeedCollection>();
40 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet>>(
"OrderedHitsFactoryPSets");
41 std::vector<edm::ParameterSet>::const_iterator iPSet;
43 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++) {
65 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Upper Scintillator position x, y, z " << upperPosition.
x() <<
", " 66 << upperPosition.
y() <<
", " << upperPosition.
z();
68 lowerScintPar.getParameter<
double>(
"WidthInX"), lowerScintPar.getParameter<
double>(
"LenghtInZ"), 1);
69 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
70 lowerScintPar.getParameter<
double>(
"GlobalY"),
71 lowerScintPar.getParameter<
double>(
"GlobalZ"));
72 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Lower Scintillator position x, y, z " << lowerPosition.
x() <<
", " 73 << 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(),
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++) {
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);
193 std::vector<std::pair<unsigned int, unsigned int>> vSubdetLayer;
199 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
201 for (
unsigned int iHit = 0; iHit <
nHits; ++iHit) {
203 auto trh = shs[iHit];
208 if (checkHitsAtPositiveY) {
213 if (checkHitsAtNegativeY) {
220 unsigned int subid = (*trh).geographicalId().subdetId();
221 unsigned int layer = tTopo->
layer((*trh).geographicalId());
222 std::vector<std::pair<unsigned int, unsigned int>>::const_iterator iter;
224 if (checkHitsOnDifferentLayers) {
225 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++) {
226 if (iter->first == subid && iter->second ==
layer)
236 vSubdetLayer.push_back(std::make_pair(subid,
layer));
253 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionUpper =
255 std::pair<bool, StraightLinePlaneCrossing::PositionType> positionLower =
257 if (!(positionUpper.first && positionLower.first)) {
258 edm::LogVerbatim(
"CtfSpecialSeedGenerator::checkDirection") <<
"Scintillator plane not crossed";
266 <<
"position on Upper scintillator " << positionUpper.second;
268 <<
"position on Lower scintillator " << positionLower.second;
273 <<
"scintillator not crossed in bounds: position on Upper scintillator " << positionUpper.second
274 <<
" position on Lower scintillator " << positionLower.second;
282 desc.add<
double>(
"SeedMomentum", 5.0);
283 desc.add<
double>(
"ErrorRescaling", 50.0);
284 desc.add<
bool>(
"UseScintillatorsConstraint",
true);
286 desc.add<
bool>(
"SeedsFromPositiveY",
true);
287 desc.add<
bool>(
"SeedsFromNegativeY",
false);
288 desc.add<
bool>(
"CheckHitsAreOnDifferentLayers",
false);
289 desc.add<
bool>(
"SetMomentum",
true);
290 desc.add<
bool>(
"requireBOFF",
false);
291 desc.add<int32_t>(
"maxSeeds", 10000);
297 desc.add<std::vector<int>>(
"Charges", {-1});
302 ps_RegionFactoryPSet.
add<
std::string>(
"ComponentName",
"GlobalRegionProducer");
306 ps_RegionFactoryPSet.
add(
"RegionPSet", ps_RegionPSet)->
setComment(
"");
313 ps_UpperScintillatorParameters.
add<
double>(
"LenghtInZ", 100.0);
314 ps_UpperScintillatorParameters.
add<
double>(
"GlobalX", 0.0);
315 ps_UpperScintillatorParameters.
add<
double>(
"GlobalY", 300.0);
316 ps_UpperScintillatorParameters.
add<
double>(
"GlobalZ", 50.0);
317 ps_UpperScintillatorParameters.
add<
double>(
"WidthInX", 100.0);
324 ps_LowerScintillatorParameters.
add<
double>(
"LenghtInZ", 100.0);
325 ps_LowerScintillatorParameters.
add<
double>(
"GlobalX", 0.0);
326 ps_LowerScintillatorParameters.
add<
double>(
"GlobalY", -100.0);
327 ps_LowerScintillatorParameters.
add<
double>(
"GlobalZ", 50.0);
328 ps_LowerScintillatorParameters.
add<
double>(
"WidthInX", 100.0);
336 std::vector<edm::ParameterSet> default_OrderedHitsFactoryPSet(1);
339 desc.addVPSet(
"OrderedHitsFactoryPSets", ps_OrderedHitsFactoryPSet, default_OrderedHitsFactoryPSet);
Log< level::Info, true > LogVerbatim
void setComment(std::string const &value)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
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)
void setAllowAnything()
allow any parameter label/value pairs
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)
static void fillDescriptions(edm::ParameterSetDescription &description)
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
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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)
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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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