17 using namespace ctfseeding;
21 requireBOFF(conf.getParameter<bool>(
"requireBOFF")),
22 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds")),
23 check(conf,consumesCollector())
27 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
28 produces<TrajectorySeedCollection>();
36 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
37 std::vector<edm::ParameterSet>::const_iterator iPSet;
39 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
71 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
72 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
74 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
76 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
77 lowerScintPar.getParameter<
double>(
"GlobalY"),
78 lowerScintPar.getParameter<
double>(
"GlobalZ"));
80 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
81 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
113 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
114 std::vector<edm::ParameterSet>::const_iterator iPSet;
115 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
125 std::vector<int> charges;
132 propagatorAlongHandle.
product(),
133 propagatorOppositeHandle.
product(),
154 bool ok =
run(iSetup, e, *output);
156 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
160 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
" number of seeds = "<< output->size();
168 std::vector<TrackingRegion*>::const_iterator iReg;
170 for (iReg = regions.begin(); iReg != regions.end(); iReg++){
176 (*iGen)->
run(**iReg, e, iSetup),
186 for (std::vector<TrackingRegion*>::iterator iReg = regions.begin(); iReg != regions.end(); iReg++){
200 for (
unsigned int i = 0;
i < osh.
size();
i++){
207 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
208 if (!*iSeed) {
edm::LogError(
"CtfSpecialSeedGenerator")<<
"a seed pointer is null. skipping.";
continue;}
210 output.push_back(**iSeed);
218 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds ("<< output.size() <<
"), bailing out.\n";
230 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
236 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
237 unsigned int nHits = shs.
size();
238 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
245 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
247 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
251 unsigned int subid=(*trh).geographicalId().subdetId();
252 unsigned int layer = tTopo->layer( (*trh).geographicalId());
253 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
255 if (checkHitsOnDifferentLayers){
257 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
258 if (iter->first == subid && iter->second == layer)
return false;
267 vSubdetLayer.push_back(std::make_pair(subid, layer));
287 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
289 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
291 if (!(positionUpper.first && positionLower.first)) {
293 <<
"Scintillator plane not crossed";
301 <<
"position on Upper scintillator "
302 << positionUpper.second;
304 <<
"position on Lower scintillator "
305 << positionLower.second;
310 <<
"scintillator not crossed in bounds: position on Upper scintillator "
311 << 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
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< std::unique_ptr< OrderedHitsGenerator > > theGenerators
std::vector< PropagationDirection > thePropDirs
T get(const Candidate &c)
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0