CMS 3D CMS Logo

Functions

reco::MustacheKernel Namespace Reference

Functions

bool inDynamicDPhiWindow (const bool isEE, const float seedPhi, const float ClustE, const float ClusEta, const float clusPhi)
bool inMustache (const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)

Function Documentation

bool reco::MustacheKernel::inDynamicDPhiWindow ( const bool  isEE,
const float  seedPhi,
const float  ClustE,
const float  ClusEta,
const float  clusPhi 
)

Definition at line 74 of file Mustache.cc.

References abs, constexpr, create_public_lumi_plots::exp, create_public_lumi_plots::log, and Phi_mpi_pi().

Referenced by PFSuperClusterTreeMaker::processSuperClusterFillTree().

                                                  {
      // from Rishi's fit 21 May 2013
      constexpr double yoffsetEB = 0.04635;
      constexpr double scaleEB   = 0.6514;
      constexpr double xoffsetEB = 0.5709;
      constexpr double widthEB   = 0.7814;

      constexpr double yoffsetEE = 0.0453;
      constexpr double scaleEE   = 0.7416;
      constexpr double xoffsetEE = 0.09217;
      constexpr double widthEE   = 1.059;
      
      double maxdphi;
      
      const double logClustEt = std::log(ClustE/std::cosh(ClusEta));
      const double clusDphi = std::abs(TVector2::Phi_mpi_pi(seedPhi - 
                                                            ClusPhi));
      if( isEB ) {      
        maxdphi = (yoffsetEB + scaleEB/(1+std::exp((logClustEt - 
                                                    xoffsetEB)/widthEB)));
      } else {
        maxdphi = (yoffsetEE + scaleEE/(1+std::exp((logClustEt - 
                                                    xoffsetEE)/widthEE)));
      } 
      maxdphi = ( logClustEt >  2.0 ) ? 0.15 : maxdphi;
      maxdphi = ( logClustEt < -1.0 ) ? 0.6  : maxdphi;
      
      return clusDphi < maxdphi;
    }
bool reco::MustacheKernel::inMustache ( const float  maxEta,
const float  maxPhi,
const float  ClustE,
const float  ClusEta,
const float  ClusPhi 
)

Definition at line 9 of file Mustache.cc.

References constexpr, f, max(), maxEta, min, Phi_mpi_pi(), funct::sin(), mathSSE::sqrt(), w10, and w11.

Referenced by reco::Mustache::MustacheClust(), reco::Mustache::MustacheID(), and PFSuperClusterTreeMaker::processSuperClusterFillTree().

                                        {
      //bool inMust=false;
      //float eta0 = maxEta;
      //float phi0 = maxPhi;      
      
      constexpr float p00 = -0.107537;
      constexpr float p01 = 0.590969;
      constexpr float p02 = -0.076494;
      constexpr float p10 = -0.0268843;
      constexpr float p11 = 0.147742;
      constexpr float p12 = -0.0191235;
      
      constexpr float w00 = -0.00571429;
      constexpr float w01 = -0.002;
      constexpr float w10 = 0.0135714;
      constexpr float w11 = 0.001;
      
      const float sineta0 = std::sin(maxEta);
      const float eta0xsineta0 = maxEta*sineta0;
      
      
      //2 parabolas (upper and lower) 
      //of the form: y = a*x*x + b
      
      //b comes from a fit to the width
      //and has a slight dependence on E on the upper edge    
      // this only works because of fine tuning :-D
      const float sqrt_log10_clustE = std::sqrt(std::log10(ClustE)+1.1);
      // we need to have this in two steps, so that we don't improperly shift
      // the lower bound!
      float b_upper = w10*eta0xsineta0 + w11 / sqrt_log10_clustE;      
      float b_lower = w00*eta0xsineta0 + w01 / sqrt_log10_clustE; 
      const float midpoint =  0.5*( b_upper + b_lower );
      b_upper -= midpoint;
      b_lower -= midpoint;

      //the curvature comes from a parabolic 
      //fit for many slices in eta given a 
      //slice -0.1 < log10(Et) < 0.1
      const float curv_up=std::max(eta0xsineta0*(p00*eta0xsineta0+p01)+p02,
                                   0.0f);
      const float curv_low=std::max(eta0xsineta0*(p10*eta0xsineta0+p11)+p12,
                                    0.0f);
      
      //solving for the curviness given the width of this particular point
      const float a_upper=(1/(4*curv_up))-fabs(b_upper);
      const float a_lower = (1/(4*curv_low))-fabs(b_lower);
      
      const double dphi=TVector2::Phi_mpi_pi(ClusPhi-maxPhi);
      const double dphi2 = dphi*dphi;
      // minimum offset is half a crystal width in either direction
      // because science.
      const float upper_cut=( std::max((1./(4.*a_upper)),0.0)*dphi2 +
                              std::max(b_upper,0.0087f) );
      const float lower_cut=( std::max((1./(4.*a_lower)),0.0)*dphi2 + 
                              std::min(b_lower,-0.0087f) );
      
      //if(deta < upper_cut && deta > lower_cut) inMust=true;
      
      const float deta=(1-2*(maxEta<0))*(ClusEta-maxEta); // sign flip deta
      return (deta < upper_cut && deta > lower_cut);
    }