CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BeamHaloPairGenerator.cc
Go to the documentation of this file.
3 
5 using namespace ctfseeding;
6 
7 
9  theLayerBuilder(conf.getParameter<edm::ParameterSet>("LayerPSet"), iC)
10 {
11  edm::LogInfo("CtfSpecialSeedGenerator|BeamHaloPairGenerator") << "Constructing BeamHaloPairGenerator";
12  theMaxTheta=conf.getParameter<double>("maxTheta");
13  theMaxTheta=fabs(sin(theMaxTheta));
14 }
15 
16 
18  const edm::Event& e,
19  const edm::EventSetup& es){
20  hitPairs.clear();
21  if(theLayerBuilder.check(es)) {
23  }
24  SeedingLayerSets::const_iterator iLss;
25  for (iLss = theLss.begin(); iLss != theLss.end(); iLss++){
26  SeedingLayers ls = *iLss;
27  if (ls.size() != 2){
28  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << ls.size() <<" layers in set instead of 2 ";
29  }
30  std::vector<SeedingHit> innerHits = region.hits(e, es, &ls[0]);
31  std::vector<SeedingHit> outerHits = region.hits(e, es, &ls[1]);
32  std::vector<SeedingHit>::const_iterator iOuterHit;
33  for (iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
34  std::vector<SeedingHit>::const_iterator iInnerHit;
35  for (iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
36  //do something in there... if necessary
37  const TransientTrackingRecHit::ConstRecHitPointer & crhpi = *iInnerHit;
38  const TransientTrackingRecHit::ConstRecHitPointer & crhpo = *iOuterHit;
39  GlobalVector d=crhpo->globalPosition() - crhpi->globalPosition();
40  double ABSsinDtheta = fabs(sin(d.theta()));
41  LogDebug("BeamHaloPairGenerator")<<"position1: "<<crhpo->globalPosition()
42  <<" position2: "<<crhpi->globalPosition()
43  <<" |sin(Dtheta)|: "<< ABSsinDtheta <<((ABSsinDtheta>theMaxTheta)?" skip":" keep");
44 
45  if (ABSsinDtheta>theMaxTheta) {;continue;}
46 
47  hitPairs.push_back(OrderedHitPair(*iInnerHit,
48  *iOuterHit));
49  }
50  }
51  }
52  return hitPairs;
53 }
#define LogDebug(id)
T getParameter(std::string const &) const
ctfseeding::SeedingLayerSets layers(const edm::EventSetup &es)
SeedingLayerSetsBuilder theLayerBuilder
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const ctfseeding::SeedingLayer *layer) const =0
get hits from layer compatible with region constraints
virtual const OrderedSeedingHits & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool check(const edm::EventSetup &es)
BeamHaloPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
tuple conf
Definition: dbtoconf.py:185
TransientTrackingRecHit::ConstRecHitPointer SeedingHit
ctfseeding::SeedingLayerSets theLss
std::vector< SeedingLayer > SeedingLayers