17 using namespace GeomDetEnumerators;
24 template<
class T>
inline T sqr(
T t) {
return t*
t;}
42 theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner)
45 ss =
new std::stringstream;
61 size_t totCountP2=0, totCountP1=0, totCountM2=0, totCountM1=0, selCount=0;
63 (*ss) <<
"In " << innerLayerObj.
name() <<
" Out " <<
theOuterLayer.name() << std::endl;
68 if (innerHitsMap.
empty())
return;
71 if (outerHitsMap.
empty())
return;
77 vector<RecHitsSortedInPhi::Hit> innerHits;
79 float innerPhimin, innerPhimax;
92 for(nextoh=oh+1;nextoh!=outerHits.second; ++nextoh){
99 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
100 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
121 innerPhimin=ohit->globalPosition().phi();
122 innerPhimax=nohit->globalPosition().phi();
126 innerHitsMap.
hits(innerPhimin, innerPhimax, innerHits);
129 (*ss) <<
"\tiphimin, iphimax " << innerPhimin <<
" " << innerPhimax << std::endl;
136 vector<RecHitsSortedInPhi::Hit>::const_iterator ieh = innerHits.end();
137 for ( vector<RecHitsSortedInPhi::Hit>::const_iterator ih=innerHits.begin(); ih < ieh; ++ih) {
142 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
143 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
144 (*ss) <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " << innPos.
z()/innPos.
perp() << std::endl;
155 for ( vector<RecHitsSortedInPhi::Hit>::const_iterator nextih=ih+1; nextih != ieh; ++nextih) {
161 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
162 (*ss) <<
"\tnoPos " << noPos <<
" r " << noPos.
perp() <<
" phi " << noPos.
phi() <<
" cotTheta " << noPos.
z()/noPos.
perp() << std::endl;
163 (*ss) <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " << innPos.
z()/innPos.
perp() << std::endl;
164 (*ss) <<
"\tninnPos " << ninnPos <<
" r " << ninnPos.
perp() <<
" phi " << ninnPos.
phi() <<
" cotTheta " << ninnPos.
z()/ninnPos.
perp() << std::endl;
179 edm::LogError(
"TooManyQuads")<<
"number of Quad combinations exceed maximum, no quads produced";
184 (*ss) <<
"In " << innerLayerObj.
name() <<
" Out " << outerLayerObj.
name()
185 <<
"\tP2 " << totCountP2
186 <<
"\tM2 " << totCountM2
187 <<
"\tP1 " << totCountP1
188 <<
"\tM1 " << totCountM1
189 <<
"\tsel " << selCount
209 (*ss) <<
"In " << innerLayerObj.
name() <<
" Out " << outerLayerObj.
name()
210 <<
"\tP2 " << totCountP2
211 <<
"\tM2 " << totCountM2
212 <<
"\tP1 " << totCountP1
213 <<
"\tM1 " << totCountM1
214 <<
"\tsel " << selCount
228 (*ss) <<
"*******\nNo valid checkRZ\n*******" << std::endl;
238 allowed = checkRZ->
range(r_reduced);
239 float zErr = nSigmaRZ * hit->errorGlobalZ();
240 hitRZ =
Range(hit->globalPosition().z()-zErr, hit->globalPosition().z()+zErr);
242 allowed = checkRZ->
range(hit->globalPosition().z());
243 float rErr = nSigmaRZ * hit->errorGlobalR();
244 hitRZ =
Range(r_reduced-rErr, r_reduced+rErr);
250 <<
"\n\t\t allowed Range " << allowed.
min() <<
" \t, " << allowed.max()
251 <<
"\n\t\t hitRz Range " << hitRZ.min() <<
" \t, " << hitRZ.max()
252 <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, " << crossRange.max()
254 if( !crossRange.empty())
255 (*
ss) <<
"\n\t\t !!!!ACCEPTED!!! \n\n";
258 return crossRange.empty();
265 double r[5],
z[5], ez[5];
270 r[0] = ohit->globalPosition().perp();
271 z[0] = ohit->globalPosition().z();
274 r[1] = nohit->globalPosition().perp();
275 z[1] = nohit->globalPosition().z();
278 r[2] = nihit->globalPosition().perp();
279 z[2] = nihit->globalPosition().z();
282 r[3] = ihit->globalPosition().perp();
283 z[3] = ihit->globalPosition().z();
293 if ( vError > 15. ) vError = 1.;
301 double zInnMin = z[4]-ez[4];
302 double zInnMax = z[4]+ez[4];
306 double zOutMin = z[3]-ez[3];
307 double zOutMax = z[3]+ez[3];
309 double zIntMin = z[2]-ez[2];
310 double zIntMax = z[2]+ez[2];
312 rInt, zIntMin, zIntMax,
313 rOut, zOutMin, zOutMax) )
return true;
320 zIntMin = z[1]-ez[1];
321 zIntMax = z[1]+ez[1];
323 rInt, zIntMin, zIntMax,
324 rOut, zOutMin, zOutMax) )
return true;
331 zIntMin = z[0]-ez[0];
332 zIntMax = z[0]+ez[0];
334 rInt, zIntMin, zIntMax,
335 rOut, zOutMin, zOutMax) )
return true;
357 double sqrProjFactor =
sqr((hit->globalPosition().z()-region.
origin().
z())/(hit->globalPosition().perp()-region.
origin().
perp()));
358 return (hit->globalPositionError().czz()+sqrProjFactor*hit->globalPositionError().rerr(hit->globalPosition()));
367 double sqrProjFactor =
sqr((hit->globalPosition().z()-region.
origin().
z())/(hit->globalPosition().perp()-region.
origin().
perp()));
368 double effErr =
sqrt(hit->globalPositionError().czz()+sqrProjFactor*hit->globalPositionError().rerr(hit->globalPosition()));
385 double tmpr, tmpz, tmpez;
389 for (
int i = 0;
i < n -
j;
i++) {
390 if ( ar[
i] > ar[
i+1] ) {
408 double &rInt,
double &zIntMin,
double &zIntMax,
409 double &rOut,
double &zOutMin,
double &zOutMax){
415 double zLeft =
getZAtR(rInn, zInnMin, rInt, rOut, zOutMin);
416 if ( zIntMax < zLeft )
return true;
418 double zRight =
getZAtR(rInn, zInnMax, rInt, rOut, zOutMax);
419 if ( zIntMin > zRight )
return true;
420 if ( zIntMin < zLeft && zIntMax < zRight ) {
424 if ( zIntMin > zLeft && zIntMax > zRight ) {
437 double &rOut,
double &zOut){
444 return zInn + (zOut - zInn)*(r - rInn)/(rOut - rInn);
std::vector< Hit > hits(float phiMin, float phiMax) const
GlobalPoint const & origin() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
virtual Range range(const float &rORz) const =0
HitQuadrupletGeneratorFromLayerPairForPhotonConversion(unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
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
const unsigned int theOuterLayer
std::pair< HitIter, HitIter > Range
virtual HitRZCompatibility * checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=0, float lr=0, float gz=0, float dr=0, float dz=0) const =0
const T & max(const T &a, const T &b)
std::vector< HitWithPhi >::const_iterator HitIter
constexpr double nSigmaRZ
bool failCheckSegmentZCompatibility(double &rInn, double &zInnMin, double &zInnMax, double &rInt, double &zIntMin, double &zIntMax, double &rOut, double &zOutMin, double &zOutMax)
unsigned int theMaxElement
const std::string & name() const
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)
float originZBound() const
bounds the particle vertex in the longitudinal plane
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)
const DetLayer * detLayer() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
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)
tuple size
Write out results.
void bubbleSortVsR(int n, double *ax, double *ay, double *aey)
double getSqrEffectiveErrorOnZ(const RecHitsSortedInPhi::Hit &hit, const TrackingRegion ®ion)