24 using namespace ctfseeding;
27 : thePairGenerator(0),
29 useFixedPreFiltering(cfg.getParameter<bool>(
"useFixedPreFiltering")),
30 extraHitRZtolerance(cfg.getParameter<double>(
"extraHitRZtolerance")),
31 extraHitRPhitolerance(cfg.getParameter<double>(
"extraHitRPhitolerance")),
32 useMScat(cfg.getParameter<bool>(
"useMultScattering")),
33 useBend(cfg.getParameter<bool>(
"useBending"))
40 std::string comparitorName = comparitorPSet.
getParameter<std::string>(
"ComponentName");
53 const std::vector<SeedingLayer> & layers,
69 OrderedHitPairs::const_iterator ip;
73 if (pairs.empty())
return;
77 typedef std::vector<ThirdHitRZPrediction<PixelRecoLineRZ> > Preds;
80 std::vector<const RecHitsSortedInPhi *> thirdHitMap(size);
82 vector<Hit> thirdHits;
85 for (
int il=0; il!=
size; ++il) {
86 thirdHitMap[il] = &(*theLayerCache)(&
theLayers[il], region, ev, es);
96 for (ip = pairs.begin(); ip != pairs.end(); ip++) {
98 GlobalPoint gp1tmp = (*ip).inner()->globalPosition();
99 GlobalPoint gp2tmp = (*ip).outer()->globalPosition();
110 for (
int il=0; il!=
size; ++il) {
121 Range rzRange = predictionRZ();
123 correction.correctRZRange(rzRange);
126 float phi0 = (*ip).outer()->globalPosition().phi();
132 radius = predictionRZ.detRange();
135 max(rzRange.min(), predictionRZ.detSize().min()),
136 min(rzRange.max(), predictionRZ.detSize().max()) );
138 if (radius.empty())
continue;
139 Range rPhi1m = predictionRPhitmp(radius.max(), -1);
140 Range rPhi1p = predictionRPhitmp(radius.max(), 1);
141 Range rPhi2m = predictionRPhitmp(radius.min(), -1);
142 Range rPhi2p = predictionRPhitmp(radius.min(), 1);
145 correction.correctRPhiRange(rPhi1);
146 correction.correctRPhiRange(rPhi2);
147 rPhi1.first /= radius.
max();
148 rPhi1.second /= radius.max();
149 rPhi2.first /= radius.min();
150 rPhi2.second /= radius.min();
159 thirdHitMap[il]->hits(phiRange.min(),phiRange.max(), thirdHits);
164 typedef vector<Hit>::const_iterator IH;
165 for (IH th=thirdHits.begin(), eh=thirdHits.end(); th !=eh; ++th) {
169 edm::LogError(
"TooManyTriplets")<<
" number of triples exceed maximum. no triplets produced.";
172 const Hit&
hit = (*th);
174 hit->globalPosition().
y()-region.
origin().
y(),
175 hit->globalPosition().z() );
176 float p3_r =
point.perp();
177 float p3_z =
point.z();
178 float p3_phi =
point.phi();
181 Range allowedZ = predictionRZ(p3_r);
182 correction.correctRZRange(allowedZ);
184 float zErr = nSigmaRZ * hit->errorGlobalZ();
185 Range hitRange(p3_z-zErr, p3_z+zErr);
187 if (crossingRange.empty())
continue;
189 Range allowedR = predictionRZ(p3_z);
190 correction.correctRZRange(allowedR);
191 float rErr = nSigmaRZ * hit->errorGlobalR();
192 Range hitRange(p3_r-rErr, p3_r+rErr);
194 if (crossingRange.empty())
continue;
197 float phiErr = nSigmaPhi*hit->errorGlobalRPhi()/p3_r;
198 for (
int icharge=-1; icharge <=1; icharge+=2) {
199 Range rangeRPhi = predictionRPhi(p3_r, icharge);
200 correction.correctRPhiRange(rangeRPhi);
201 if (
checkPhiInRange(p3_phi, rangeRPhi.first/p3_r-phiErr, rangeRPhi.second/p3_r+phiErr)) {
205 result.push_back( hittriplet );
207 LogDebug(
"RejectedTriplet") <<
"rejected triplet from comparitor "
208 << hittriplet.outer()->globalPosition().x() <<
" "
209 << hittriplet.outer()->globalPosition().y() <<
" "
210 << hittriplet.outer()->globalPosition().z();
225 return ( (phi1 <= phi) && (phi <= phi2) );
229 const std::pair<float,float>&
r1,
const std::pair<float,float>&
r2)
const
231 float r2_min=r2.first;
232 float r2_max=r2.second;
236 return std::make_pair(
min(r1.first,r2_min),
max(r1.second,r2_max));
T getParameter(std::string const &) const
std::vector< ctfseeding::SeedingLayer > theLayers
virtual HitPairGenerator * clone() const =0
void initPropagator(const Propagator *propagator)
virtual float ptMin() const =0
minimal pt of interest
virtual GlobalPoint origin() const =0
void initLayer(const DetLayer *layer)
virtual Location location() const =0
Which part of the detector (barrel, endcap)
float extraHitRPhitolerance
static const double nSigmaPhi
PixelRecoRange< T > sum(const PixelRecoRange< T > &r) const
virtual bool compatible(const SeedingHitSet &hits, const TrackingRegion ®ion) const =0
virtual void init(const edm::EventSetup &es)=0
virtual void init(const HitPairGenerator &pairs, const std::vector< ctfseeding::SeedingLayer > &layers, LayerCacheType *layerCache)
std::pair< float, float > mergePhiRanges(const std::pair< float, float > &r1, const std::pair< float, float > &r2) const
bool useFixedPreFiltering
T curvature(T InversePt, const edm::EventSetup &iSetup)
const T & max(const T &a, const T &b)
SeedComparitor * theComparitor
virtual void hitPairs(const TrackingRegion ®, OrderedHitPairs &prs, const edm::EventSetup &es)
HitPairGenerator * thePairGenerator
unsigned int theMaxElement
static const double nSigmaRZ
PixelRecoRange< float > Range
PixelTripletHLTGenerator(const edm::ParameterSet &cfg)
virtual float originRBound() const =0
bounds the particle vertex in the transverse plane
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
bool checkPhiInRange(float phi, float phi1, float phi2) const
TransientTrackingRecHit::ConstRecHitPointer Hit
LayerCacheType * theLayerCache
virtual unsigned int size() const
virtual void hitTriplets(const TrackingRegion ®ion, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es)
float extraHitRZtolerance
tuple size
Write out results.
virtual ~PixelTripletHLTGenerator()
T get(const Candidate &c)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point