17 using namespace ctfseeding;
21 requireBOFF(conf.getParameter<bool>(
"requireBOFF")),
22 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds"))
25 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
26 produces<TrajectorySeedCollection>();
37 std::vector<OrderedHitsGenerator*>::iterator iGen;
62 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
63 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
65 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
67 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
68 lowerScintPar.getParameter<
double>(
"GlobalY"),
69 lowerScintPar.getParameter<
double>(
"GlobalZ"));
71 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
72 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
107 std::vector<edm::ParameterSet> pSets =
conf_.
getParameter<std::vector<edm::ParameterSet> >(
"OrderedHitsFactoryPSets");
108 std::vector<edm::ParameterSet>::const_iterator iPSet;
109 for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
121 std::vector<int> charges;
128 propagatorAlongHandle.
product(),
129 propagatorOppositeHandle.
product(),
151 bool ok =
run(iSetup, e, *output);
153 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
157 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
" number of seeds = "<< output->size();
165 std::vector<TrackingRegion*>::const_iterator iReg;
167 for (iReg = regions.begin(); iReg != regions.end(); iReg++){
169 std::vector<OrderedHitsGenerator*>::const_iterator iGen;
174 (*iGen)->
run(**iReg, e, iSetup),
184 for (std::vector<TrackingRegion*>::iterator iReg = regions.begin(); iReg != regions.end(); iReg++){
198 for (
unsigned int i = 0;
i < osh.
size();
i++){
205 for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
206 if (!*iSeed) {
edm::LogError(
"CtfSpecialSeedGenerator")<<
"a seed pointer is null. skipping.";
continue;}
208 output.push_back(**iSeed);
216 edm::LogWarning(
"TooManySeeds") <<
"Too many seeds ("<< output.size() <<
"), bailing out.\n";
228 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
234 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
235 unsigned int nHits = shs.
size();
236 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
243 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
245 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
249 unsigned int subid=(*trh).geographicalId().subdetId();
250 unsigned int layer = tTopo->layer( (*trh).geographicalId());
251 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
253 if (checkHitsOnDifferentLayers){
255 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
256 if (iter->first == subid && iter->second == layer)
return false;
265 vSubdetLayer.push_back(std::make_pair(subid, layer));
285 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
287 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
289 if (!(positionUpper.first && positionLower.first)) {
291 <<
"Scintillator plane not crossed";
299 <<
"position on Upper scintillator "
300 << positionUpper.second;
302 <<
"position on Lower scintillator "
303 << positionLower.second;
308 <<
"scintillator not crossed in bounds: position on Upper scintillator "
309 << 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
FreeTrajectoryState * freeState(bool withErrors=true) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
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