19 using namespace ctfseeding;
23 requireBOFF(conf.getParameter<bool>(
"requireBOFF")),
24 theMaxSeeds(conf.getParameter<int32_t>(
"maxSeeds"))
27 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
"Constructing CtfSpecialSeedGenerator";
28 produces<TrajectorySeedCollection>();
39 std::vector<OrderedHitsGenerator*>::iterator iGen;
64 <<
"Upper Scintillator position x, y, z " << upperPosition.
x()
65 <<
", " << upperPosition.
y() <<
", " << upperPosition.
z();
67 lowerScintPar.getParameter<
double>(
"LenghtInZ"),
69 GlobalPoint lowerPosition(lowerScintPar.getParameter<
double>(
"GlobalX"),
70 lowerScintPar.getParameter<
double>(
"GlobalY"),
71 lowerScintPar.getParameter<
double>(
"GlobalZ"));
73 <<
"Lower Scintillator position x, y, z " << lowerPosition.
x()
74 <<
", " << lowerPosition.
y() <<
", " << lowerPosition.
z() ;
80 std::string regfactoryName = regfactoryPSet.
getParameter<std::string>(
"ComponentName");
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++){
112 std::string hitsfactoryName = iPSet->getParameter<std::string>(
"ComponentName");
114 std::string propagationDirection = iPSet->getParameter<std::string>(
"PropagationDirection");
117 std::string navigationDirection = iPSet->getParameter<std::string>(
"NavigationDirection");
123 std::vector<int> charges;
130 propagatorAlongHandle.
product(),
131 propagatorOppositeHandle.
product(),
153 bool ok =
run(iSetup, e, *output);
155 }
else edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
159 edm::LogVerbatim(
"CtfSpecialSeedGenerator") <<
" number of seeds = "<< output->size();
167 std::vector<TrackingRegion*>::const_iterator iReg;
169 for (iReg = regions.begin(); iReg != regions.end(); iReg++){
171 std::vector<OrderedHitsGenerator*>::const_iterator iGen;
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";
226 std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
232 bool checkHitsOnDifferentLayers =
conf_.
getParameter<
bool>(
"CheckHitsAreOnDifferentLayers");
233 unsigned int nHits = shs.
size();
234 for (
unsigned int iHit=0; iHit < nHits; ++iHit) {
241 if (checkHitsAtPositiveY){
if (hitPos.
y() < 0)
return false;}
243 if (checkHitsAtNegativeY){
if (hitPos.
y() > 0)
return false;}
247 unsigned int subid=(*trh).geographicalId().subdetId();
248 unsigned int layer = 0;
250 TIBDetId tibId((*trh).geographicalId());
251 layer = tibId.
layer();
253 TIDDetId tidId((*trh).geographicalId());
254 layer = tidId.
wheel();
256 TOBDetId tobId((*trh).geographicalId());
257 layer = tobId.
layer();
259 TECDetId tecId((*trh).geographicalId());
260 layer = tecId.
wheel();
262 std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
264 if (checkHitsOnDifferentLayers){
266 for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
267 if (iter->first == subid && iter->second == layer)
return false;
276 vSubdetLayer.push_back(std::make_pair(subid, layer));
296 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
298 std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
300 if (!(positionUpper.first && positionLower.first)) {
302 <<
"Scintillator plane not crossed";
310 <<
"position on Upper scintillator "
311 << positionUpper.second;
313 <<
"position on Lower scintillator "
314 << positionLower.second;
319 <<
"scintillator not crossed in bounds: position on Upper scintillator "
320 << positionUpper.second <<
" position on Lower scintillator " << positionLower.second;
T getParameter(std::string const &) const
unsigned int layer() const
layer id
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)
virtual void produce(edm::Event &e, const edm::EventSetup &c)
static BoundPlanePointer build(const PositionType &pos, const RotationType &rot, const Bounds *bounds, MediumProperties *mp=0)
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)
virtual void beginRun(edm::Run &, edm::EventSetup const &)
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)
std::vector< OrderedHitsGenerator * > theGenerators
void setMomentumTo(double mom)
virtual ~CtfSpecialSeedGenerator()
GlobalVector momentum() const
PositionType position(double s) const
size_t tooManyClusters(const edm::Event &e)
GlobalPoint position() const
std::vector< TrajectorySeed * > seed(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, const edm::EventSetup &iSetup)
PTrajectoryStateOnDet const & startingState() const
virtual void endRun(edm::Run &, edm::EventSetup const &)
bool postCheck(const TrajectorySeed &seed)
const unsigned int detId() const
T const * product() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
edm::ESHandle< MagneticField > theMagfield
unsigned int size() const
edm::ESHandle< TrackerGeometry > theTracker
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
bool preliminaryCheck(const SeedingHitSet &shs)
std::vector< NavigationDirection > theNavDirs
std::vector< PropagationDirection > thePropDirs
T get(const Candidate &c)
unsigned int wheel() const
wheel id
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0