18 using namespace GeomDetEnumerators;
19 using namespace ctfseeding;
26 template<
class T>
inline T sqr(
T t) {
return t*
t;}
44 theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner)
47 ss =
new std::stringstream;
60 size_t totCountP2=0, totCountP1=0, totCountM2=0, totCountM1=0, selCount=0;
67 if (innerHitsMap.
empty())
return;
70 if (outerHitsMap.
empty())
return;
76 vector<RecHitsSortedInPhi::Hit> innerHits;
78 float innerPhimin, innerPhimax;
91 for(nextoh=oh+1;nextoh!=outerHits.second; ++nextoh){
98 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
99 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
120 innerPhimin=ohit->globalPosition().phi();
121 innerPhimax=nohit->globalPosition().phi();
125 innerHitsMap.
hits(innerPhimin, innerPhimax, innerHits);
128 (*ss) <<
"\tiphimin, iphimax " << innerPhimin <<
" " << innerPhimax << std::endl;
135 vector<RecHitsSortedInPhi::Hit>::const_iterator ieh = innerHits.end();
136 for ( vector<RecHitsSortedInPhi::Hit>::const_iterator ih=innerHits.begin(); ih < ieh; ++ih) {
141 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
142 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
143 (*ss) <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " << innPos.
z()/innPos.
perp() << std::endl;
154 for ( vector<RecHitsSortedInPhi::Hit>::const_iterator nextih=ih+1; nextih != ieh; ++nextih) {
160 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
161 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
162 (*ss) <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " << innPos.
z()/innPos.
perp() << std::endl;
163 (*ss) <<
"\tninnPos " << ninnPos <<
" r " << ninnPos.
perp() <<
" phi " << ninnPos.
phi() <<
" cotTheta " << ninnPos.
z()/ninnPos.
perp() << std::endl;
178 edm::LogError(
"TooManySeeds")<<
"number of pairs exceed maximum, no pairs produced";
184 <<
"\tP2 " << totCountP2
185 <<
"\tM2 " << totCountM2
186 <<
"\tP1 " << totCountP1
187 <<
"\tM1 " << totCountM1
188 <<
"\tsel " << selCount
209 <<
"\tP2 " << totCountP2
210 <<
"\tM2 " << totCountM2
211 <<
"\tP1 " << totCountP1
212 <<
"\tM1 " << totCountM1
213 <<
"\tsel " << selCount
227 (*ss) <<
"*******\nNo valid checkRZ\n*******" << std::endl;
237 allowed = checkRZ->
range(r_reduced);
238 float zErr = nSigmaRZ * hit->errorGlobalZ();
239 hitRZ =
Range(hit->globalPosition().z()-zErr, hit->globalPosition().z()+zErr);
241 allowed = checkRZ->
range(hit->globalPosition().z());
242 float rErr = nSigmaRZ * hit->errorGlobalR();
243 hitRZ =
Range(r_reduced-rErr, r_reduced+rErr);
249 <<
"\n\t\t allowed Range " << allowed.
min() <<
" \t, " << allowed.max()
250 <<
"\n\t\t hitRz Range " << hitRZ.min() <<
" \t, " << hitRZ.max()
251 <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, " << crossRange.max()
253 if( !crossRange.empty())
254 (*
ss) <<
"\n\t\t !!!!ACCEPTED!!! \n\n";
257 return crossRange.empty();
264 double r[5],
z[5], ez[5];
269 r[0] = ohit->globalPosition().perp();
270 z[0] = ohit->globalPosition().z();
273 r[1] = nohit->globalPosition().perp();
274 z[1] = nohit->globalPosition().z();
277 r[2] = nihit->globalPosition().perp();
278 z[2] = nihit->globalPosition().z();
281 r[3] = ihit->globalPosition().perp();
282 z[3] = ihit->globalPosition().z();
292 if ( vError > 15. ) vError = 1.;
300 double zInnMin = z[4]-ez[4];
301 double zInnMax = z[4]+ez[4];
305 double zOutMin = z[3]-ez[3];
306 double zOutMax = z[3]+ez[3];
308 double zIntMin = z[2]-ez[2];
309 double zIntMax = z[2]+ez[2];
311 rInt, zIntMin, zIntMax,
312 rOut, zOutMin, zOutMax) )
return true;
319 zIntMin = z[1]-ez[1];
320 zIntMax = z[1]+ez[1];
322 rInt, zIntMin, zIntMax,
323 rOut, zOutMin, zOutMax) )
return true;
330 zIntMin = z[0]-ez[0];
331 zIntMax = z[0]+ez[0];
333 rInt, zIntMin, zIntMax,
334 rOut, zOutMin, zOutMax) )
return true;
356 double sqrProjFactor =
sqr((hit->globalPosition().z()-region.
origin().
z())/(hit->globalPosition().perp()-region.
origin().
perp()));
357 return (hit->globalPositionError().czz()+sqrProjFactor*hit->globalPositionError().rerr(hit->globalPosition()));
366 double sqrProjFactor =
sqr((hit->globalPosition().z()-region.
origin().
z())/(hit->globalPosition().perp()-region.
origin().
perp()));
367 double effErr =
sqrt(hit->globalPositionError().czz()+sqrProjFactor*hit->globalPositionError().rerr(hit->globalPosition()));
384 double tmpr, tmpz, tmpez;
388 for (
int i = 0;
i < n -
j;
i++) {
389 if ( ar[
i] > ar[
i+1] ) {
407 double &rInt,
double &zIntMin,
double &zIntMax,
408 double &rOut,
double &zOutMin,
double &zOutMax){
414 double zLeft =
getZAtR(rInn, zInnMin, rInt, rOut, zOutMin);
415 if ( zIntMax < zLeft )
return true;
417 double zRight =
getZAtR(rInn, zInnMax, rInt, rOut, zOutMax);
418 if ( zIntMin > zRight )
return true;
419 if ( zIntMin < zLeft && zIntMax < zRight ) {
423 if ( zIntMin > zLeft && zIntMax > zRight ) {
436 double &rOut,
double &zOut){
443 return zInn + (zOut - zInn)*(r - rInn)/(rOut - rInn);
virtual GlobalPoint origin() const =0
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const DetLayer * detLayer() const
virtual Range range(const float &rORz) const =0
std::vector< Hit > hits(float phiMin, float phiMax) const
LayerCacheType & theLayerCache
Geom::Phi< T > phi() const
virtual void hitPairs(const TrackingRegion ®, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es)
virtual unsigned int size() const
std::pair< HitIter, HitIter > Range
const T & max(const T &a, const T &b)
std::vector< HitWithPhi >::const_iterator HitIter
bool failCheckSegmentZCompatibility(double &rInn, double &zInnMin, double &zInnMax, double &rInt, double &zIntMin, double &zIntMax, double &rOut, double &zOutMin, double &zOutMax)
unsigned int theMaxElement
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool failCheckSlopeTest(const RecHitsSortedInPhi::Hit &ohit, const RecHitsSortedInPhi::Hit &nohit, const RecHitsSortedInPhi::Hit &ihit, const RecHitsSortedInPhi::Hit &nihit, const TrackingRegion ®ion)
*virtual HitRZCompatibility * checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup) const =0
static const double nSigmaRZ
double deltaPhi(double phi1, double phi2)
PixelRecoRange< float > Range
double getEffectiveErrorOnZ(const RecHitsSortedInPhi::Hit &hit, const TrackingRegion ®ion)
double verySimpleFit(int size, double *ax, double *ay, double *e2y, double &p0, double &e2p0, double &p1)
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
virtual float originZBound() const =0
bounds the particle vertex in the longitudinal plane
Square< F >::type sqr(const F &f)
TransientTrackingRecHit::ConstRecHitPointer Hit
double getZAtR(double &rInn, double &zInn, double &r, double &rOut, double &zOut)
bool failCheckRZCompatibility(const RecHitsSortedInPhi::Hit &hit, const DetLayer &layer, const HitRZCompatibility *checkRZ, const TrackingRegion ®ion)
HitQuadrupletGeneratorFromLayerPairForPhotonConversion(const Layer &inner, const Layer &outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
tuple size
Write out results.
void bubbleSortVsR(int n, double *ax, double *ay, double *aey)
double getSqrEffectiveErrorOnZ(const RecHitsSortedInPhi::Hit &hit, const TrackingRegion ®ion)