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>();
42 std::vector<OrderedHitsGenerator*>::iterator iGen;
67 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
68 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
70 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
72 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
73 lowerScintPar.getParameter<
double>(
"GlobalY"),
74 lowerScintPar.getParameter<
double>(
"GlobalZ"));
76 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
77 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
109 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
110 std::vector<edm::ParameterSet>::const_iterator iPSet;
111 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
123 std::vector<int> charges;
130 propagatorAlongHandle.
product(),
131 propagatorOppositeHandle.
product(),
152 bool ok =
run(iSetup, e, *output);
154 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
158 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
" number of seeds = "<< output->size();
166 std::vector<TrackingRegion*>::const_iterator iReg;
168 for (iReg = regions.begin(); iReg != regions.end(); iReg++){
170 std::vector<OrderedHitsGenerator*>::const_iterator iGen;
175 (*iGen)->
run(**iReg, e, iSetup),
185 for (std::vector<TrackingRegion*>::iterator iReg = regions.begin(); iReg != regions.end(); iReg++){
199 for (
unsigned int i = 0;
i < osh.
size();
i++){
206 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
207 if (!*iSeed) {
edm::LogError(
"CtfSpecialSeedGenerator")<<
"a seed pointer is null. skipping.";
continue;}
209 output.push_back(**iSeed);
217 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds ("<< output.size() <<
"), bailing out.\n";
229 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
235 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
236 unsigned int nHits = shs.
size();
237 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
244 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
246 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
250 unsigned int subid=(*trh).geographicalId().subdetId();
251 unsigned int layer = tTopo->layer( (*trh).geographicalId());
252 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
254 if (checkHitsOnDifferentLayers){
256 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
257 if (iter->first == subid && iter->second == layer)
return false;
266 vSubdetLayer.push_back(std::make_pair(subid, layer));
286 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
288 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
290 if (!(positionUpper.first && positionLower.first)) {
292 <<
"Scintillator plane not crossed";
300 <<
"position on Upper scintillator "
301 << positionUpper.second;
303 <<
"position on Lower scintillator "
304 << positionLower.second;
309 <<
"scintillator not crossed in bounds: position on Upper scintillator "
310 << 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.
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
FreeTrajectoryState const * freeState(bool withErrors=true) const
size_t tooManyClusters(const edm::Event &e) const
std::vector< OrderedHitsGenerator * > theGenerators
void setMomentumTo(double mom)
unsigned int detId() const
virtual ~CtfSpecialSeedGenerator()
PositionType position(double s) const
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 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< PropagationDirection > thePropDirs
T get(const Candidate &c)
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0