21 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
22 check(conf,consumesCollector())
26 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
27 produces<TrajectorySeedCollection>();
33 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
34 std::vector<edm::ParameterSet>::const_iterator iPSet;
36 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
66 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
67 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
69 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
71 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
72 lowerScintPar.getParameter<
double>(
"GlobalY"),
73 lowerScintPar.getParameter<
double>(
"GlobalZ"));
75 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
76 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
88 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
89 std::vector<edm::ParameterSet>::const_iterator iPSet;
90 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
100 std::vector<int> charges;
107 propagatorAlongHandle.
product(),
108 propagatorOppositeHandle.
product(),
115 theSeedBuilder->setMomentumTo(p);
123 auto output = std::make_unique<TrajectorySeedCollection>();
131 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
144 for (
auto iReg = regions.begin(); iReg != regions.end(); iReg++){
150 (*iGen)->
run(**iReg, e, iSetup),
170 for (
unsigned int i = 0;
i < osh.
size();
i++){
177 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
178 if (!*iSeed) {
edm::LogError(
"CtfSpecialSeedGenerator")<<
"a seed pointer is null. skipping.";
continue;}
180 output.push_back(**iSeed);
188 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds ("<< output.size() <<
"), bailing out.\n";
200 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
206 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
207 unsigned int nHits = shs.
size();
208 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
210 auto trh = shs[iHit];
215 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
217 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
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){
227 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
228 if (iter->first == subid && iter->second == layer)
return false;
237 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)) {
263 <<
"Scintillator plane not crossed";
271 <<
"position on Upper scintillator " 272 << positionUpper.second;
274 <<
"position on Lower scintillator " 275 << positionLower.second;
280 <<
"scintillator not crossed in bounds: position on Upper scintillator " 281 << positionUpper.second <<
" 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
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
T get(const Candidate &c)