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;
65 (*ss) <<
"In " << innerLayerObj.
name() <<
" Out " << outerLayerObj.
name() << std::endl;
73 if (innerHitsMap.
empty())
return;
76 if (outerHitsMap.
empty())
return;
84 vector<RecHitsSortedInPhi::Hit> innerHits, outerHits;
85 float outerPhimin, outerPhimax;
86 float innerPhimin, innerPhimax;
90 outerHitsMap.
hits( outerPhimin, outerPhimax, outerHits);
93 (*ss) <<
"\tophimin, ophimax " << outerPhimin <<
" " << outerPhimax << std::endl;
97 for (vector<RecHitsSortedInPhi::Hit>::const_iterator oh = outerHits.begin(); oh!= outerHits.end(); ++oh) {
102 (*ss) <<
"\toPos " << oPos <<
" r " << oPos.
perp() <<
" phi " << oPos.
phi() <<
" cotTheta " << oPos.
z()/oPos.
perp() << std::endl;
119 (*ss) <<
"*******\nNo valid checkRZ\n*******" << std::endl;
126 if(!
getPhiRange(innerPhimin,innerPhimax,*innerLayerObj.
detLayer(),convRegion,es))
continue;
127 innerHitsMap.
hits(innerPhimin, innerPhimax, innerHits);
130 (*ss) <<
"\tiphimin, iphimax " << innerPhimin <<
" " << innerPhimax << std::endl;
134 for ( vector<RecHitsSortedInPhi::Hit>::const_iterator ih=innerHits.begin(), ieh = innerHits.end(); ih < ieh; ++ih) {
139 (*ss) <<
"\tinnPos " << innPos <<
" r " << innPos.
perp() <<
" phi " << innPos.
phi() <<
" cotTheta " << innPos.
z()/innPos.
perp() << std::endl;
149 allowed = checkRZ->
range(r_reduced);
150 float zErr = nSigmaRZ * (*ih)->errorGlobalZ();
151 hitRZ =
Range(innPos.
z()-zErr, innPos.
z()+zErr);
153 allowed = checkRZ->
range(innPos.
z());
154 float rErr = nSigmaRZ * (*ih)->errorGlobalR();
155 hitRZ =
Range(r_reduced-rErr, r_reduced+rErr);
161 <<
"\n\t\t allowed Range " << allowed.
min() <<
" \t, " << allowed.max()
162 <<
"\n\t\t hitRz Range " << hitRZ.min() <<
" \t, " << hitRZ.max()
163 <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, " << crossRange.max()
164 <<
"\n\t\t the seed track has origin " << convRegion.
convPoint() <<
" \t cotTheta " << convRegion.
cotTheta()
168 if (! crossRange.empty() ) {
171 <<
"\n\t\t !!!!ACCEPTED!!! \n\n";
176 edm::LogError(
"TooManySeeds")<<
"number of pairs exceed maximum, no pairs produced";
204 return rLayer + 0.5f*theThickness;
215 float layerZmax = layerZ > 0 ? layerZ+0.5f*theThickness: layerZ-0.5f*theThickness;
226 float minZEndCap=130;
227 if(fabs(convRegion.
convPoint().
z()) > minZEndCap){
229 (*ss) <<
"\tthe conversion seems to be in the endcap. Zconv " << convRegion.
convPoint().
z() << std::endl;
239 (*ss) <<
"\tthis layer is before the conversion : R layer " << R <<
" [ Rconv " << convRegion.
convPoint().
perp() <<
" Zconv " << convRegion.
convPoint().
z()<< std::endl;
247 (*ss) <<
"\tthis layer is far from the conversion more than cut " << maxSearchR <<
" cm. R layer " << R <<
" [ Rconv " << convRegion.
convPoint().
perp() <<
" Zconv " << convRegion.
convPoint().
z()<< std::endl;
262 (*ss) <<
"\tthis layer is before the conversion : Z layer " << Z <<
" [ Rconv " << convRegion.
convPoint().
perp()<<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
269 if(fabs(Z - convRegion.
convPoint().
z()) > maxSearchZ ){
271 (*ss) <<
"\tthis layer is far from the conversion more than cut " << maxSearchZ <<
" cm. Z layer " << Z <<
" [ Rconv " << convRegion.
convPoint().
perp()<<
" Zconv " << convRegion.
convPoint().
z() << std::endl;
307 if(theRCurvatureMin<DeltaL)
308 dphi = atan(DeltaL/layerR);
310 dphi = atan(theRCurvatureMin/layerR * ( 1 -
sqrt(1-
sqr(DeltaL/theRCurvatureMin)) ) );
312 if(convRegion.
charge()>0){
329 Range allowedCotTheta(convRegion.
cotTheta()-nSigmaRZ*sigmaCotTheta,convRegion.
cotTheta()+nSigmaRZ*sigmaCotTheta);
331 double dz = hit->globalPosition().z()-convRegion.
pvtxPoint().
z();
335 float zErr = nSigmaRZ * hit->errorGlobalZ();
338 float rErr = nSigmaRZ * hit->errorGlobalR();
349 <<
"\n\t\t cotTheta allowed Range " << allowedCotTheta.
min() <<
" \t, " << allowedCotTheta.max()
350 <<
"\n\t\t hitCotTheta Range " << hitCotTheta.min() <<
" \t, " << hitCotTheta.max()
351 <<
"\n\t\t Cross Range " << crossRange.min() <<
" \t, " << crossRange.max()
352 <<
"\n\t\t the seed track has origin " << convRegion.
convPoint() <<
" \t cotTheta " << convRegion.
cotTheta()
356 return crossRange.empty();
364 if(dz>0)
return 99999.f;
365 else return -99999.f;
const double Z[kNumberCalorimeter]
std::vector< Hit > hits(float phiMin, float phiMax) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
bool checkRZCompatibilityWithSeedTrack(const RecHitsSortedInPhi::Hit &hit, const DetLayer &layer, const ConversionRegion &convRegion)
double getCot(double dz, double dr)
GlobalPoint const & origin() const
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion ®, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es)
virtual Location location() const =0
Which part of the detector (barrel, endcap)
virtual Range range(const float &rORz) const =0
float getLayerRadius(const DetLayer &layer)
GlobalPoint pvtxPoint() const
Geom::Phi< T > phi() const
SeedingHitSet::ConstRecHitPointer InnerRecHit
GlobalPoint convPoint() const
const Bounds & bounds() const
virtual unsigned int size() const
virtual float thickness() const =0
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)
constexpr double nSigmaRZ
bool getPhiRange(float &Phimin, float &Phimax, const DetLayer &layer, const ConversionRegion &convRegion, const edm::EventSetup &es)
Abs< T >::type abs(const T &t)
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
SeedingHitSet::ConstRecHitPointer Hit
LayerCacheType & theLayerCache
BaseTrackerRecHit const * Hit
float getLayerZ(const DetLayer &layer)
double deltaPhi(double phi1, double phi2)
PixelRecoRange< float > Range
bool checkBoundaries(const DetLayer &layer, const ConversionRegion &convRegion, float maxSearchR, float maxSearchZ)
virtual const Surface::PositionType & position() const
Returns position of the surface.
const DetLayer * detLayer() const
T bendingRadius(T pt, const edm::EventSetup &iSetup)
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
HitPairGeneratorFromLayerPairForPhotonConversion(unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
SeedingHitSet::ConstRecHitPointer OuterRecHit