16 using namespace ctfseeding;
20 requireBOFF(conf.getParameter<bool>(
"requireBOFF")),
21 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
22 check(conf,consumesCollector())
26 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
27 produces<TrajectorySeedCollection>();
35 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
36 std::vector<edm::ParameterSet>::const_iterator iPSet;
38 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
70 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
71 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
73 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
75 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
76 lowerScintPar.getParameter<
double>(
"GlobalY"),
77 lowerScintPar.getParameter<
double>(
"GlobalZ"));
79 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
80 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
92 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
93 std::vector<edm::ParameterSet>::const_iterator iPSet;
94 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
104 std::vector<int> charges;
111 propagatorAlongHandle.
product(),
112 propagatorOppositeHandle.
product(),
133 bool ok =
run(iSetup, e, *output);
135 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
139 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
" number of seeds = "<< output->size();
148 for (
auto iReg = regions.begin(); iReg != regions.end(); iReg++){
154 (*iGen)->
run(**iReg, e, iSetup),
174 for (
unsigned int i = 0;
i < osh.
size();
i++){
181 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
182 if (!*iSeed) {
edm::LogError(
"CtfSpecialSeedGenerator")<<
"a seed pointer is null. skipping.";
continue;}
184 output.push_back(**iSeed);
192 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds ("<< output.size() <<
"), bailing out.\n";
204 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
210 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
211 unsigned int nHits = shs.
size();
212 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
214 auto trh = shs[iHit];
219 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
221 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
225 unsigned int subid=(*trh).geographicalId().subdetId();
226 unsigned int layer = tTopo->layer( (*trh).geographicalId());
227 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
229 if (checkHitsOnDifferentLayers){
231 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
232 if (iter->first == subid && iter->second == layer)
return false;
241 vSubdetLayer.push_back(std::make_pair(subid, layer));
261 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
263 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
265 if (!(positionUpper.first && positionLower.first)) {
267 <<
"Scintillator plane not crossed";
275 <<
"position on Upper scintillator "
276 << positionUpper.second;
278 <<
"position on Lower scintillator "
279 << positionLower.second;
284 <<
"scintillator not crossed in bounds: position on Upper scintillator "
285 << positionUpper.second <<
" position on Lower scintillator " << positionLower.second;
T getParameter(std::string const &) const
bool useScintillatorsConstraint
SeedFromGenericPairOrTriplet * theSeedBuilder
BoundPlane::BoundPlanePointer lowerScintillator
TrackingRegionProducer * theRegionProducer
virtual unsigned int size() const =0
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)
CtfSpecialSeedGenerator(const edm::ParameterSet &conf)
BoundPlane::BoundPlanePointer upperScintillator
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
FreeTrajectoryState const * freeState(bool withErrors=true) const
size_t tooManyClusters(const edm::Event &e) const
PositionType position(float s) const
void setMomentumTo(double mom)
unsigned int detId() const
virtual ~CtfSpecialSeedGenerator()
bool preliminaryCheck(const SeedingHitSet &shs, const edm::EventSetup &es)
std::vector< TrajectorySeed * > seed(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, const edm::EventSetup &iSetup)
PTrajectoryStateOnDet const & startingState() const
bool postCheck(const TrajectorySeed &seed)
T const * product() const
virtual std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &es) const =0
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::ESHandle< MagneticField > theMagfield
unsigned int size() const
edm::ESHandle< TrackerGeometry > theTracker
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< NavigationDirection > theNavDirs
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
std::vector< PropagationDirection > thePropDirs
T get(const Candidate &c)