CMS 3D CMS Logo

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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef TrajectoryStateOnSurface TSOS
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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< TransientTrackingRecHitBuildertheBuilder
 
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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 18 of file CtfSpecialSeedGenerator.cc.

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

18  :
19  conf_(conf),
20  requireBOFF(conf.getParameter<bool>("requireBOFF")),
21  theMaxSeeds(conf.getParameter<int32_t>("maxSeeds")),
22  check(conf,consumesCollector())
23 
24 {
25  useScintillatorsConstraint = conf_.getParameter<bool>("UseScintillatorsConstraint");
26  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Constructing CtfSpecialSeedGenerator";
27  produces<TrajectorySeedCollection>();
28  theSeedBuilder =0;
30 
31  edm::ParameterSet regfactoryPSet = conf_.getParameter<edm::ParameterSet>("RegionFactoryPSet");
32  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
33  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector());
34 
35  std::vector<edm::ParameterSet> pSets = conf_.getParameter<std::vector<edm::ParameterSet> >("OrderedHitsFactoryPSets");
36  std::vector<edm::ParameterSet>::const_iterator iPSet;
38  for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
39  std::string hitsfactoryName = iPSet->getParameter<std::string>("ComponentName");
40  theGenerators.emplace_back(OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, *iPSet, iC));
41  }
42 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
SeedFromGenericPairOrTriplet * theSeedBuilder
TrackingRegionProducer * theRegionProducer
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
T get(const Candidate &c)
Definition: component.h:55
CtfSpecialSeedGenerator::~CtfSpecialSeedGenerator ( )
virtual

Definition at line 44 of file CtfSpecialSeedGenerator.cc.

References theRegionProducer.

44  {
46 }
TrackingRegionProducer * theRegionProducer

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 52 of file CtfSpecialSeedGenerator.cc.

References alongMomentum, conf_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), insideOut, lowerScintillator, oppositeToMomentum, outsideIn, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), makeMuonMisalignmentScenario::rot, 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().

52  {
53  std::string builderName = conf_.getParameter<std::string>("TTRHBuilder");
54  iSetup.get<TransientRecHitRecord>().get(builderName,theBuilder);
55 
56  iSetup.get<IdealMagneticFieldRecord>().get(theMagfield);
57  iSetup.get<TrackerDigiGeometryRecord>().get(theTracker);
58 
59  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Initializing...";
61  edm::ParameterSet upperScintPar = conf_.getParameter<edm::ParameterSet>("UpperScintillatorParameters");
62  edm::ParameterSet lowerScintPar = conf_.getParameter<edm::ParameterSet>("LowerScintillatorParameters");
63  RectangularPlaneBounds upperBounds(upperScintPar.getParameter<double>("WidthInX"),
64  upperScintPar.getParameter<double>("LenghtInZ"),
65  1);
66  GlobalPoint upperPosition(upperScintPar.getParameter<double>("GlobalX"),
67  upperScintPar.getParameter<double>("GlobalY"),
68  upperScintPar.getParameter<double>("GlobalZ"));
69  edm::LogVerbatim("CtfSpecialSeedGenerator")
70  << "Upper Scintillator position x, y, z " << upperPosition.x()
71  << ", " << upperPosition.y() << ", " << upperPosition.z();
72  RectangularPlaneBounds lowerBounds(lowerScintPar.getParameter<double>("WidthInX"),
73  lowerScintPar.getParameter<double>("LenghtInZ"),
74  1);
75  GlobalPoint lowerPosition(lowerScintPar.getParameter<double>("GlobalX"),
76  lowerScintPar.getParameter<double>("GlobalY"),
77  lowerScintPar.getParameter<double>("GlobalZ"));
78  edm::LogVerbatim("CtfSpecialSeedGenerator")
79  << "Lower Scintillator position x, y, z " << lowerPosition.x()
80  << ", " << lowerPosition.y() << ", " << lowerPosition.z() ;
81  TkRotation<float> rot(1,0,0,0,0,1,0,1,0);
82  upperScintillator = BoundPlane::build(upperPosition, rot, &upperBounds);
83  lowerScintillator = BoundPlane::build(lowerPosition, rot, &lowerBounds);
84  }
85 
86  edm::ESHandle<Propagator> propagatorAlongHandle;
87  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",propagatorAlongHandle);
88  edm::ESHandle<Propagator> propagatorOppositeHandle;
89  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterialOpposite",propagatorOppositeHandle);
90 
91 
92  std::vector<edm::ParameterSet> pSets = conf_.getParameter<std::vector<edm::ParameterSet> >("OrderedHitsFactoryPSets");
93  std::vector<edm::ParameterSet>::const_iterator iPSet;
94  for (iPSet = pSets.begin(); iPSet != pSets.end(); iPSet++){
95  std::string propagationDirection = iPSet->getParameter<std::string>("PropagationDirection");
96  if (propagationDirection == "alongMomentum") thePropDirs.push_back(alongMomentum);
97  else thePropDirs.push_back(oppositeToMomentum);
98  std::string navigationDirection = iPSet->getParameter<std::string>("NavigationDirection");
99  if (navigationDirection == "insideOut") theNavDirs.push_back(insideOut);
100  else theNavDirs.push_back(outsideIn);
101  edm::LogVerbatim("CtfSpecialSeedGenerator") << "hitsGenerator done";
102  }
103  bool setMomentum = conf_.getParameter<bool>("SetMomentum");
104  std::vector<int> charges;
105  if (setMomentum){
106  charges = conf_.getParameter<std::vector<int> >("Charges");
107  }
109  theTracker.product(),
111  propagatorAlongHandle.product(),
112  propagatorOppositeHandle.product(),
113  charges,
114  setMomentum,
115  conf_.getParameter<double>("ErrorRescaling"));
116  double p = 1;
117  if (setMomentum) {
118  p = conf_.getParameter<double>("SeedMomentum");
119  theSeedBuilder->setMomentumTo(p);
120  }
121 
122 }
T getParameter(std::string const &) const
SeedFromGenericPairOrTriplet * theSeedBuilder
BoundPlane::BoundPlanePointer lowerScintillator
BoundPlane::BoundPlanePointer upperScintillator
edm::ESHandle< MagneticField > theMagfield
edm::ESHandle< TrackerGeometry > theTracker
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
std::vector< NavigationDirection > theNavDirs
T const * product() const
Definition: ESHandle.h:86
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 166 of file CtfSpecialSeedGenerator.cc.

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

Referenced by run().

171  {
172  //SeedFromGenericPairOrTriplet seedBuilder(conf_, magfield.product(), tracker.product(), theBuilder.product());
173  edm::LogInfo("CtfSpecialSeedGenerator")<<"osh.size() " << osh.size();
174  for (unsigned int i = 0; i < osh.size(); i++){
175  SeedingHitSet shs = osh[i];
176  if (preliminaryCheck(shs,iSetup)){
177  std::vector<TrajectorySeed*> seeds = theSeedBuilder->seed(shs,
178  dir,
179  navdir,
180  iSetup);
181  for (std::vector<TrajectorySeed*>::const_iterator iSeed = seeds.begin(); iSeed != seeds.end(); iSeed++){
182  if (!*iSeed) {edm::LogError("CtfSpecialSeedGenerator")<<"a seed pointer is null. skipping.";continue;}
183  if (postCheck(**iSeed)){
184  output.push_back(**iSeed);
185  }
186  delete *iSeed;
187  edm::LogVerbatim("CtfSpecialSeedGenerator") << "Seed built";
188  }
189  }
190  }
191  if ((theMaxSeeds > 0) && (output.size() > size_t(theMaxSeeds))) {
192  edm::LogWarning("TooManySeeds") << "Too many seeds ("<< output.size() <<"), bailing out.\n";
193  output.clear();
194  return false;
195  }
196  return true;
197 }
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::stream::EDProducerBase.

Definition at line 48 of file CtfSpecialSeedGenerator.cc.

References theSeedBuilder.

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

Definition at line 247 of file CtfSpecialSeedGenerator.cc.

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

Referenced by buildSeeds().

247  {
248  if (!useScintillatorsConstraint) return true;
249 
250  PTrajectoryStateOnDet pstate = seed.startingState();
252  &(theTracker->idToDet(DetId(pstate.detId()))->surface()),
253  &(*theMagfield));
254  const FreeTrajectoryState* state = theTSOS.freeState();
255  StraightLinePlaneCrossing planeCrossingLower( Basic3DVector<float>(state->position()),
256  Basic3DVector<float>(state->momentum()),
257  alongMomentum);
258  StraightLinePlaneCrossing planeCrossingUpper( Basic3DVector<float>(state->position()),
259  Basic3DVector<float>(state->momentum()),
261  std::pair<bool,StraightLinePlaneCrossing::PositionType> positionUpper =
262  planeCrossingUpper.position(*upperScintillator);
263  std::pair<bool,StraightLinePlaneCrossing::PositionType> positionLower =
264  planeCrossingLower.position(*lowerScintillator);
265  if (!(positionUpper.first && positionLower.first)) {
266  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
267  << "Scintillator plane not crossed";
268  return false;
269  }
270  LocalPoint positionUpperLocal = upperScintillator->toLocal((GlobalPoint)(positionUpper.second));
271  LocalPoint positionLowerLocal = lowerScintillator->toLocal((GlobalPoint)(positionLower.second));
272  if (upperScintillator->bounds().inside(positionUpperLocal) &&
273  lowerScintillator->bounds().inside(positionLowerLocal)) {
274  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
275  << "position on Upper scintillator "
276  << positionUpper.second;
277  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
278  << "position on Lower scintillator "
279  << positionLower.second;
280 
281  return true;
282  }
283  edm::LogVerbatim("CtfSpecialSeedGenerator::checkDirection")
284  << "scintillator not crossed in bounds: position on Upper scintillator "
285  << positionUpper.second << " position on Lower scintillator " << positionLower.second;
286  return false;
287 }
BoundPlane::BoundPlanePointer lowerScintillator
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
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
const TrackerGeomDet * idToDet(DetId) const
bool CtfSpecialSeedGenerator::preliminaryCheck ( const SeedingHitSet shs,
const edm::EventSetup es 
)
private

Definition at line 199 of file CtfSpecialSeedGenerator.cc.

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

Referenced by buildSeeds().

199  {
200 
202  es.get<TrackerTopologyRcd>().get(tTopo);
203 
204  std::vector<std::pair<unsigned int, unsigned int> > vSubdetLayer;
205  //std::vector<std::string> vSeedLayerNames;
206  bool checkHitsAtPositiveY = conf_.getParameter<bool>("SeedsFromPositiveY");
207  //***top-bottom
208  bool checkHitsAtNegativeY = conf_.getParameter<bool>("SeedsFromNegativeY");
209  //***
210  bool checkHitsOnDifferentLayers = conf_.getParameter<bool>("CheckHitsAreOnDifferentLayers");
211  unsigned int nHits = shs.size();
212  for (unsigned int iHit=0; iHit < nHits; ++iHit) {
213  //hits for the seeds must be at positive y
214  auto trh = shs[iHit];
215  auto recHit = trh;
216  GlobalPoint hitPos = recHit->globalPosition();
217  //GlobalPoint point =
218  // theTracker->idToDet(iHits->geographicalId() )->surface().toGlobal(iHits->localPosition());
219  if (checkHitsAtPositiveY){ if (hitPos.y() < 0) return false;}
220  //***top-bottom
221  if (checkHitsAtNegativeY){ if (hitPos.y() > 0) return false;}
222  //***
223  //std::string name = iHits->seedinglayer().name();
224  //hits for the seeds must be in different layers
225  unsigned int subid=(*trh).geographicalId().subdetId();
226  unsigned int layer = tTopo->layer( (*trh).geographicalId());
227  std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter;
228  //std::vector<std::string>::const_iterator iNames;
229  if (checkHitsOnDifferentLayers){
230 
231  for (iter = vSubdetLayer.begin(); iter != vSubdetLayer.end(); iter++){
232  if (iter->first == subid && iter->second == layer) return false;
233  }
234  /*
235  for (iNames = vSeedLayerNames.begin(); iNames != vSeedLayerNames.end(); iNames++){
236  if (*iNames == name) return false;
237  }
238  */
239  }
240  //vSeedLayerNames.push_back(iHits->seedinglayer().name());
241  vSubdetLayer.push_back(std::make_pair(subid, layer));
242  }
243  return true;
244 }
T getParameter(std::string const &) const
T y() const
Definition: PV3DBase.h:63
const T & get() const
Definition: EventSetup.h:56
unsigned int layer(const DetId &id) const
unsigned int size() const
Definition: SeedingHitSet.h:46
void CtfSpecialSeedGenerator::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Definition at line 124 of file CtfSpecialSeedGenerator.cc.

References check, MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::mag(), eostools::move(), convertSQLiteXML::ok, convertSQLitetoXML_cfg::output, edm::Event::put(), requireBOFF, run(), theMagfield, and ClusterChecker::tooManyClusters().

125 {
126  // get Inputs
127  auto output = std::make_unique<TrajectorySeedCollection>();
128 
129  //check on the number of clusters
130  if ( !requireBOFF || (theMagfield->inTesla(GlobalPoint(0,0,0)).mag() == 0.00) ) {
131  size_t clustsOrZero = check.tooManyClusters(e);
132  if (!clustsOrZero){
133  bool ok = run(iSetup, e, *output);
134  if (!ok) { ; } // nothing to do
135  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
136  }
137 
138 
139  edm::LogVerbatim("CtfSpecialSeedGenerator") << " number of seeds = "<< output->size();
140  e.put(std::move(output));
141 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool run(const edm::EventSetup &c, const edm::Event &e, TrajectorySeedCollection &output)
T mag() const
Definition: PV3DBase.h:67
size_t tooManyClusters(const edm::Event &e) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
edm::ESHandle< MagneticField > theMagfield
def move(src, dest)
Definition: eostools.py:510
bool CtfSpecialSeedGenerator::run ( const edm::EventSetup c,
const edm::Event e,
TrajectorySeedCollection output 
)
private

Definition at line 143 of file CtfSpecialSeedGenerator.cc.

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

Referenced by produce().

145  {
146  std::vector<std::unique_ptr<TrackingRegion>> regions = theRegionProducer->regions(e, iSetup);
147  bool ok = true;
148  for (auto iReg = regions.begin(); iReg != regions.end(); iReg++){
149  if(!theSeedBuilder->momentumFromPSet()) theSeedBuilder->setMomentumTo((*iReg)->ptMin());
150  int i = 0;
151  for (auto iGen = theGenerators.begin(); iGen != theGenerators.end(); iGen++){
152  ok = buildSeeds(iSetup,
153  e,
154  (*iGen)->run(**iReg, e, iSetup),
155  theNavDirs[i],
156  thePropDirs[i],
157  output);
158  i++;
159  if (!ok) break;
160  }
161  if (!ok) break;
162  }
163  return ok;
164 }
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:94
virtual std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &es) const =0
std::vector< NavigationDirection > theNavDirs
std::vector< std::unique_ptr< OrderedHitsGenerator > > theGenerators
std::vector< PropagationDirection > thePropDirs

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().

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
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().