CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
CtfSpecialSeedGenerator Class Reference

#include <CtfSpecialSeedGenerator.h>

Inheritance diagram for CtfSpecialSeedGenerator:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef TrajectoryStateOnSurface TSOS
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 CtfSpecialSeedGenerator (const edm::ParameterSet &conf)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~CtfSpecialSeedGenerator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

bool buildSeeds (const edm::EventSetup &iSetup, const edm::Event &e, const OrderedSeedingHits &osh, const NavigationDirection &navdir, const PropagationDirection &dir, TrajectorySeedCollection &output)
 
bool postCheck (const TrajectorySeed &seed)
 
bool preliminaryCheck (const SeedingHitSet &shs, const edm::EventSetup &es)
 
bool run (const edm::EventSetup &c, const edm::Event &e, TrajectorySeedCollection &output)
 

Private Attributes

ClusterChecker check
 
edm::ParameterSet conf_
 
BoundPlane::BoundPlanePointer lowerScintillator
 
bool requireBOFF
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theBuilder
 
std::vector< std::unique_ptr
< OrderedHitsGenerator > > 
theGenerators
 
edm::ESHandle< MagneticFieldtheMagfield
 
int32_t theMaxSeeds
 
std::vector< NavigationDirectiontheNavDirs
 
std::vector< PropagationDirectionthePropDirs
 
TrackingRegionProducertheRegionProducer
 
SeedFromGenericPairOrTriplettheSeedBuilder
 
edm::ESHandle< TrackerGeometrytheTracker
 
BoundPlane::BoundPlanePointer upperScintillator
 
bool useScintillatorsConstraint
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 40 of file CtfSpecialSeedGenerator.h.

Member Typedef Documentation

Definition at line 43 of file CtfSpecialSeedGenerator.h.

Constructor & Destructor Documentation

CtfSpecialSeedGenerator::CtfSpecialSeedGenerator ( const edm::ParameterSet conf)

Definition at line 19 of file CtfSpecialSeedGenerator.cc.

References conf_, edm::EDConsumerBase::consumesCollector(), SurfaceDeformationFactory::create(), reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theGenerators, theRegionProducer, theSeedBuilder, and useScintillatorsConstraint.

19  :
20  conf_(conf),
21  requireBOFF(conf.getParameter<bool>("requireBOFF")),
22  theMaxSeeds(conf.getParameter<int32_t>("maxSeeds")),
23  check(conf,consumesCollector())
24 
25 {
26  useScintillatorsConstraint = conf_.getParameter<bool>("UseScintillatorsConstraint");
27  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Constructing CtfSpecialSeedGenerator";
28  produces<TrajectorySeedCollection>();
29  theSeedBuilder =0;
31 
32  edm::ParameterSet regfactoryPSet = conf_.getParameter<edm::ParameterSet>("RegionFactoryPSet");
33  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
34  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector());
35 
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++){
40  std::string hitsfactoryName = iPSet->getParameter<std::string>("ComponentName");
41  theGenerators.emplace_back(OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, *iPSet, iC));
42  }
43 }
T getParameter(std::string const &) const
SeedFromGenericPairOrTriplet * theSeedBuilder
TrackingRegionProducer * theRegionProducer
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
CtfSpecialSeedGenerator::~CtfSpecialSeedGenerator ( )
virtual

Definition at line 45 of file CtfSpecialSeedGenerator.cc.

45  {
46 }

Member Function Documentation

void CtfSpecialSeedGenerator::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 53 of file CtfSpecialSeedGenerator.cc.

References alongMomentum, newFWLiteAna::build, conf_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), insideOut, lowerScintillator, oppositeToMomentum, outsideIn, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< class >::product(), makeMuonMisalignmentScenario::rot, SeedFromGenericPairOrTriplet::setMomentumTo(), AlCaHLTBitMon_QueryRunRegistry::string, theBuilder, theMagfield, theNavDirs, thePropDirs, theSeedBuilder, theTracker, upperScintillator, useScintillatorsConstraint, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

53  {
54  std::string builderName = conf_.getParameter<std::string>("TTRHBuilder");
55  iSetup.get<TransientRecHitRecord>().get(builderName,theBuilder);
56 
57  iSetup.get<IdealMagneticFieldRecord>().get(theMagfield);
58  iSetup.get<TrackerDigiGeometryRecord>().get(theTracker);
59 
60  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Initializing...";
62  edm::ParameterSet upperScintPar = conf_.getParameter<edm::ParameterSet>("UpperScintillatorParameters");
63  edm::ParameterSet lowerScintPar = conf_.getParameter<edm::ParameterSet>("LowerScintillatorParameters");
64  RectangularPlaneBounds upperBounds(upperScintPar.getParameter<double>("WidthInX"),
65  upperScintPar.getParameter<double>("LenghtInZ"),
66  1);
67  GlobalPoint upperPosition(upperScintPar.getParameter<double>("GlobalX"),
68  upperScintPar.getParameter<double>("GlobalY"),
69  upperScintPar.getParameter<double>("GlobalZ"));
70  edm::LogVerbatim("CtfSpecialSeedGenerator")
71  << "Upper Scintillator position x, y, z " << upperPosition.x()
72  << ", " << upperPosition.y() << ", " << upperPosition.z();
73  RectangularPlaneBounds lowerBounds(lowerScintPar.getParameter<double>("WidthInX"),
74  lowerScintPar.getParameter<double>("LenghtInZ"),
75  1);
76  GlobalPoint lowerPosition(lowerScintPar.getParameter<double>("GlobalX"),
77  lowerScintPar.getParameter<double>("GlobalY"),
78  lowerScintPar.getParameter<double>("GlobalZ"));
79  edm::LogVerbatim("CtfSpecialSeedGenerator")
80  << "Lower Scintillator position x, y, z " << lowerPosition.x()
81  << ", " << lowerPosition.y() << ", " << lowerPosition.z() ;
82  TkRotation<float> rot(1,0,0,0,0,1,0,1,0);
83  upperScintillator = BoundPlane::build(upperPosition, rot, &upperBounds);
84  lowerScintillator = BoundPlane::build(lowerPosition, rot, &lowerBounds);
85  }
86 
87  edm::ESHandle<Propagator> propagatorAlongHandle;
88  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",propagatorAlongHandle);
89  edm::ESHandle<Propagator> propagatorOppositeHandle;
90  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterialOpposite",propagatorOppositeHandle);
91 
92 /* edm::ParameterSet hitsfactoryOutInPSet = conf_.getParameter<edm::ParameterSet>("OrderedHitsFactoryOutInPSet");
93  std::string hitsfactoryOutInName = hitsfactoryOutInPSet.getParameter<std::string>("ComponentName");
94  hitsGeneratorOutIn = OrderedHitsGeneratorFactory::get()->create( hitsfactoryOutInName, hitsfactoryOutInPSet);
95  std::string propagationDirection = hitsfactoryOutInPSet.getUntrackedParameter<std::string>("PropagationDirection",
96  "alongMomentum");
97  if (propagationDirection == "alongMomentum") outInPropagationDirection = alongMomentum;
98  else outInPropagationDirection = oppositeToMomentum;
99  edm::LogVerbatim("CtfSpecialSeedGenerator") << "hitsGeneratorOutIn done";
100 
101  edm::ParameterSet hitsfactoryInOutPSet = conf_.getParameter<edm::ParameterSet>("OrderedHitsFactoryInOutPSet");
102  std::string hitsfactoryInOutName = hitsfactoryInOutPSet.getParameter<std::string>("ComponentName");
103  hitsGeneratorInOut = OrderedHitsGeneratorFactory::get()->create( hitsfactoryInOutName, hitsfactoryInOutPSet);
104 
105  propagationDirection = hitsfactoryInOutPSet.getUntrackedParameter<std::string>("PropagationDirection",
106  "alongMomentum");
107  if (propagationDirection == "alongMomentum") inOutPropagationDirection = alongMomentum;
108  else inOutPropagationDirection = oppositeToMomentum;
109  edm::LogVerbatim("CtfSpecialSeedGenerator") << "hitsGeneratorInOut done";
110  if (!hitsGeneratorOutIn || !hitsGeneratorInOut)
111  throw cms::Exception("CtfSpecialSeedGenerator") << "Only corcrete implementation GenericPairOrTripletGenerator of OrderedHitsGenerator is allowed ";
112 */
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++){
116  std::string propagationDirection = iPSet->getParameter<std::string>("PropagationDirection");
117  if (propagationDirection == "alongMomentum") thePropDirs.push_back(alongMomentum);
118  else thePropDirs.push_back(oppositeToMomentum);
119  std::string navigationDirection = iPSet->getParameter<std::string>("NavigationDirection");
120  if (navigationDirection == "insideOut") theNavDirs.push_back(insideOut);
121  else theNavDirs.push_back(outsideIn);
122  edm::LogVerbatim("CtfSpecialSeedGenerator") << "hitsGenerator done";
123  }
124  bool setMomentum = conf_.getParameter<bool>("SetMomentum");
125  std::vector<int> charges;
126  if (setMomentum){
127  charges = conf_.getParameter<std::vector<int> >("Charges");
128  }
130  theTracker.product(),
132  propagatorAlongHandle.product(),
133  propagatorOppositeHandle.product(),
134  charges,
135  setMomentum,
136  conf_.getParameter<double>("ErrorRescaling"));
137  double p = 1;
138  if (setMomentum) {
139  p = conf_.getParameter<double>("SeedMomentum");
141  }
142 
143 }
T getParameter(std::string const &) const
SeedFromGenericPairOrTriplet * theSeedBuilder
BoundPlane::BoundPlanePointer lowerScintillator
BoundPlane::BoundPlanePointer upperScintillator
T const * product() const
Definition: ESHandle.h:62
edm::ESHandle< MagneticField > theMagfield
edm::ESHandle< TrackerGeometry > theTracker
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
std::vector< NavigationDirection > theNavDirs
std::vector< PropagationDirection > thePropDirs
bool CtfSpecialSeedGenerator::buildSeeds ( const edm::EventSetup iSetup,
const edm::Event e,
const OrderedSeedingHits osh,
const NavigationDirection navdir,
const PropagationDirection dir,
TrajectorySeedCollection output 
)
private

Definition at line 192 of file CtfSpecialSeedGenerator.cc.

References i, postCheck(), preliminaryCheck(), SeedFromGenericPairOrTriplet::seed(), OrderedSeedingHits::size(), theMaxSeeds, and theSeedBuilder.

Referenced by run().

197  {
198  //SeedFromGenericPairOrTriplet seedBuilder(conf_, magfield.product(), tracker.product(), theBuilder.product());
199  edm::LogInfo("CtfSpecialSeedGenerator")<<"osh.size() " << osh.size();
200  for (unsigned int i = 0; i < osh.size(); i++){
201  SeedingHitSet shs = osh[i];
202  if (preliminaryCheck(shs,iSetup)){
203  std::vector<TrajectorySeed*> seeds = theSeedBuilder->seed(shs,
204  dir,
205  navdir,
206  iSetup);
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;}
209  if (postCheck(**iSeed)){
210  output.push_back(**iSeed);
211  }
212  delete *iSeed;
213  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Seed built";
214  }
215  }
216  }
217  if ((theMaxSeeds > 0) && (output.size() > size_t(theMaxSeeds))) {
218  edm::LogWarning("TooManySeeds") << "Too many seeds ("<< output.size() <<"), bailing out.\n";
219  output.clear();
220  return false;
221  }
222  return true;
223 }
int i
Definition: DBlmapReader.cc:9
SeedFromGenericPairOrTriplet * theSeedBuilder
virtual unsigned int size() const =0
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)
bool postCheck(const TrajectorySeed &seed)
dbl *** dir
Definition: mlp_gen.cc:35
void CtfSpecialSeedGenerator::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 48 of file CtfSpecialSeedGenerator.cc.

References theRegionProducer, and theSeedBuilder.

48  {
49  if (theSeedBuilder) { delete theSeedBuilder; theSeedBuilder = 0; }
51 }
SeedFromGenericPairOrTriplet * theSeedBuilder
TrackingRegionProducer * theRegionProducer
bool CtfSpecialSeedGenerator::postCheck ( const TrajectorySeed seed)
private

Definition at line 273 of file CtfSpecialSeedGenerator.cc.

References alongMomentum, PTrajectoryStateOnDet::detId(), TrajectoryStateOnSurface::freeState(), lowerScintillator, oppositeToMomentum, StraightLinePlaneCrossing::position(), TrajectorySeed::startingState(), theMagfield, theTracker, trajectoryStateTransform::transientState(), upperScintillator, and useScintillatorsConstraint.

Referenced by buildSeeds().

273  {
274  if (!useScintillatorsConstraint) return true;
275 
276  PTrajectoryStateOnDet pstate = seed.startingState();
278  &(theTracker->idToDet(DetId(pstate.detId()))->surface()),
279  &(*theMagfield));
280  const FreeTrajectoryState* state = theTSOS.freeState();
281  StraightLinePlaneCrossing planeCrossingLower( Basic3DVector<float>(state->position()),
282  Basic3DVector<float>(state->momentum()),
283  alongMomentum);
284  StraightLinePlaneCrossing planeCrossingUpper( Basic3DVector<float>(state->position()),
285  Basic3DVector<float>(state->momentum()),
287  std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
288  planeCrossingUpper.position(*upperScintillator);
289  std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
290  planeCrossingLower.position(*lowerScintillator);
291  if (!(positionUpper.first && positionLower.first)) {
292  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
293  << "Scintillator plane not crossed";
294  return false;
295  }
296  LocalPoint positionUpperLocal = upperScintillator->toLocal((GlobalPoint)(positionUpper.second));
297  LocalPoint positionLowerLocal = lowerScintillator->toLocal((GlobalPoint)(positionLower.second));
298  if (upperScintillator->bounds().inside(positionUpperLocal) &&
299  lowerScintillator->bounds().inside(positionLowerLocal)) {
300  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
301  << "position on Upper scintillator "
302  << positionUpper.second;
303  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
304  << "position on Lower scintillator "
305  << positionLower.second;
306 
307  return true;
308  }
309  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
310  << "scintillator not crossed in bounds: position on Upper scintillator "
311  << positionUpper.second << " position on Lower scintillator " << positionLower.second;
312  return false;
313 }
BoundPlane::BoundPlanePointer lowerScintillator
BoundPlane::BoundPlanePointer upperScintillator
FreeTrajectoryState const * freeState(bool withErrors=true) const
unsigned int detId() const
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
edm::ESHandle< MagneticField > theMagfield
edm::ESHandle< TrackerGeometry > theTracker
bool CtfSpecialSeedGenerator::preliminaryCheck ( const SeedingHitSet shs,
const edm::EventSetup es 
)
private

Definition at line 225 of file CtfSpecialSeedGenerator.cc.

References conf_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), SeedingHitSet::size(), theBuilder, and PV3DBase< T, PVType, FrameType >::y().

Referenced by buildSeeds().

225  {
226 
228  es.get<IdealGeometryRecord>().get(tTopo);
229 
230  std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
231  //std::vector<std::string> vSeedLayerNames;
232  bool checkHitsAtPositiveY = conf_.getParameter<bool>("SeedsFromPositiveY");
233  //***top-bottom
234  bool checkHitsAtNegativeY = conf_.getParameter<bool>("SeedsFromNegativeY");
235  //***
236  bool checkHitsOnDifferentLayers = conf_.getParameter<bool>("CheckHitsAreOnDifferentLayers");
237  unsigned int nHits = shs.size();
238  for (unsigned int iHit=0; iHit < nHits; ++iHit) {
239  //hits for the seeds must be at positive y
240  const TrackingRecHit * trh = shs[iHit]->hit();
242  GlobalPoint hitPos = recHit->globalPosition();
243  //GlobalPoint point =
244  // theTracker->idToDet(iHits->geographicalId() )->surface().toGlobal(iHits->localPosition());
245  if (checkHitsAtPositiveY){ if (hitPos.y() < 0) return false;}
246  //***top-bottom
247  if (checkHitsAtNegativeY){ if (hitPos.y() > 0) return false;}
248  //***
249  //std::string name = iHits->seedinglayer().name();
250  //hits for the seeds must be in different layers
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;
254  //std::vector<std::string>::const_iterator iNames;
255  if (checkHitsOnDifferentLayers){
256 
257  for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
258  if (iter->first == subid && iter->second == layer) return false;
259  }
260  /*
261  for (iNames = vSeedLayerNames.begin(); iNames != vSeedLayerNames.end(); iNames++){
262  if (*iNames == name) return false;
263  }
264  */
265  }
266  //vSeedLayerNames.push_back(iHits->seedinglayer().name());
267  vSubdetLayer.push_back(std::make_pair(subid, layer));
268  }
269  return true;
270 }
T getParameter(std::string const &) const
T y() const
Definition: PV3DBase.h:63
const T & get() const
Definition: EventSetup.h:55
unsigned int size() const
Definition: SeedingHitSet.h:41
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
void CtfSpecialSeedGenerator::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 145 of file CtfSpecialSeedGenerator.cc.

References check, convertSQLiteXML::ok, convertSQLitetoXML_cfg::output, edm::Event::put(), requireBOFF, run(), theMagfield, and ClusterChecker::tooManyClusters().

146 {
147  // get Inputs
148  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
149 
150  //check on the number of clusters
151  if ( !requireBOFF || (theMagfield->inTesla(GlobalPoint(0,0,0)).mag() == 0.00) ) {
152  size_t clustsOrZero = check.tooManyClusters(e);
153  if (!clustsOrZero){
154  bool ok = run(iSetup, e, *output);
155  if (!ok) { ; } // nothing to do
156  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
157  }
158 
159 
160  edm::LogVerbatim("CtfSpecialSeedGenerator") << " number of seeds = "<< output->size();
161  e.put(output);
162 }
bool run(const edm::EventSetup &c, const edm::Event &e, TrajectorySeedCollection &output)
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
size_t tooManyClusters(const edm::Event &e) const
edm::ESHandle< MagneticField > theMagfield
bool CtfSpecialSeedGenerator::run ( const edm::EventSetup c,
const edm::Event e,
TrajectorySeedCollection output 
)
private

Definition at line 164 of file CtfSpecialSeedGenerator.cc.

References buildSeeds(), i, SeedFromGenericPairOrTriplet::momentumFromPSet(), convertSQLiteXML::ok, convertSQLitetoXML_cfg::output, TrackingRegionProducer::regions(), edm::Event::run(), SeedFromGenericPairOrTriplet::setMomentumTo(), theGenerators, theNavDirs, thePropDirs, theRegionProducer, and theSeedBuilder.

Referenced by produce().

166  {
167  std::vector<TrackingRegion*> regions = theRegionProducer->regions(e, iSetup);
168  std::vector<TrackingRegion*>::const_iterator iReg;
169  bool ok = true;
170  for (iReg = regions.begin(); iReg != regions.end(); iReg++){
171  if(!theSeedBuilder->momentumFromPSet()) theSeedBuilder->setMomentumTo((*iReg)->ptMin());
172  int i = 0;
173  for (auto iGen = theGenerators.begin(); iGen != theGenerators.end(); iGen++){
174  ok = buildSeeds(iSetup,
175  e,
176  (*iGen)->run(**iReg, e, iSetup),
177  theNavDirs[i],
178  thePropDirs[i],
179  output);
180  i++;
181  if (!ok) break;
182  }
183  if (!ok) break;
184  }
185  //clear memory
186  for (std::vector<TrackingRegion*>::iterator iReg = regions.begin(); iReg != regions.end(); iReg++){
187  delete *iReg;
188  }
189  return ok;
190 }
int i
Definition: DBlmapReader.cc:9
SeedFromGenericPairOrTriplet * theSeedBuilder
TrackingRegionProducer * theRegionProducer
bool buildSeeds(const edm::EventSetup &iSetup, const edm::Event &e, const OrderedSeedingHits &osh, const NavigationDirection &navdir, const PropagationDirection &dir, TrajectorySeedCollection &output)
RunNumber_t run() const
Definition: Event.h:88
std::vector< NavigationDirection > theNavDirs
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
std::vector< PropagationDirection > thePropDirs
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0

Member Data Documentation

ClusterChecker CtfSpecialSeedGenerator::check
private

Definition at line 96 of file CtfSpecialSeedGenerator.h.

Referenced by produce().

edm::ParameterSet CtfSpecialSeedGenerator::conf_
private

Definition at line 74 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), CtfSpecialSeedGenerator(), and preliminaryCheck().

BoundPlane::BoundPlanePointer CtfSpecialSeedGenerator::lowerScintillator
private

Definition at line 93 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and postCheck().

bool CtfSpecialSeedGenerator::requireBOFF
private

Definition at line 94 of file CtfSpecialSeedGenerator.h.

Referenced by produce().

edm::ESHandle<TransientTrackingRecHitBuilder> CtfSpecialSeedGenerator::theBuilder
private

Definition at line 77 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and preliminaryCheck().

std::vector<std::unique_ptr<OrderedHitsGenerator> > CtfSpecialSeedGenerator::theGenerators
private

Definition at line 85 of file CtfSpecialSeedGenerator.h.

Referenced by CtfSpecialSeedGenerator(), and run().

edm::ESHandle<MagneticField> CtfSpecialSeedGenerator::theMagfield
private

Definition at line 75 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), postCheck(), and produce().

int32_t CtfSpecialSeedGenerator::theMaxSeeds
private

Definition at line 95 of file CtfSpecialSeedGenerator.h.

Referenced by buildSeeds().

std::vector<NavigationDirection> CtfSpecialSeedGenerator::theNavDirs
private

Definition at line 87 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and run().

std::vector<PropagationDirection> CtfSpecialSeedGenerator::thePropDirs
private

Definition at line 86 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and run().

TrackingRegionProducer* CtfSpecialSeedGenerator::theRegionProducer
private

Definition at line 88 of file CtfSpecialSeedGenerator.h.

Referenced by CtfSpecialSeedGenerator(), endRun(), and run().

SeedFromGenericPairOrTriplet* CtfSpecialSeedGenerator::theSeedBuilder
private

Definition at line 90 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), buildSeeds(), CtfSpecialSeedGenerator(), endRun(), and run().

edm::ESHandle<TrackerGeometry> CtfSpecialSeedGenerator::theTracker
private

Definition at line 76 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and postCheck().

BoundPlane::BoundPlanePointer CtfSpecialSeedGenerator::upperScintillator
private

Definition at line 92 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), and postCheck().

bool CtfSpecialSeedGenerator::useScintillatorsConstraint
private

Definition at line 91 of file CtfSpecialSeedGenerator.h.

Referenced by beginRun(), CtfSpecialSeedGenerator(), and postCheck().