Exemplo n.º 1
0
//method two for reconstructing the pseudotop
void MyTopEvent::Recon_Mass_Method_2(const particlevector & mu, const particlevector & els, fastjet::PseudoJet * sendback )
{
  //why is this called!!!!
  if(m_bjets.size() < 2 || m_lightjets.size() < 2 ){ cout<< "something went terriblly wrong"; abort(); }  
  
  fastjet::PseudoJet lightop;

  //make the hadronic pseudow from talk prescriptio
  m_hadronicw = operator+(m_lightjets[0], m_lightjets[1]);
  
  LeptonicW(mu, els);

  vector<fastjet::PseudoJet> leptons;
  fastjet::PseudoJet one, two, three, final;
  fastjet::PseudoJet lepton;

  
  if( mu.size() != 0 ) 
    { leptons.push_back(Summation(mu)); }
  else 
    {  leptons.push_back(Summation(els)); }
  

  double dif(999), tempdif(0), tempeta(9), tempet(0);
  double truetopmass = m_lepton_top.m();

  int position_b(0), position_nu(0), position_lep(0);

  for( size_t i(0); i < m_neutrinosolutions.size(); ++i)
    {
      for(size_t m(0) ; m < m_bjets.size(); ++m)
	{

	  one = operator+(m_neutrinosolutions[i], m_bjets[m]);
	  for(size_t n(0); n < leptons.size(); ++n )
	    {
	      two = operator+(one, leptons[n]);
      
	      tempdif = fabs(two.m() - truetopmass ) ;
	      // tempet = fabs( two.eta() - m_lepton_top.eta() );
	      if( tempdif < dif ) 
		{
		  
		   dif = tempdif; final = two; position_lep = n; position_nu = i; position_b = m; 
		}
	      /*      if(tempdif <= dif )
		{
		  if(tempdif ==dif) 
		    {
		      if( tempet  > tempeta ) continue;  
		    }
		  dif = tempdif; tempeta = tempet; final = two; position_lep = n; position_nu = i; position_b = m; 
		  }*/
	    } 
	}
Exemplo n.º 2
0
    int WorldMagModel::Geomag(WMMtype_CoordSpherical *CoordSpherical, WMMtype_CoordGeodetic *CoordGeodetic, WMMtype_GeoMagneticElements *GeoMagneticElements)
    /*
      The main subroutine that calls a sequence of WMM sub-functions to calculate the magnetic field elements for a single point.
      The function expects the model coefficients and point coordinates as input and returns the magnetic field elements and
      their rate of change. Though, this subroutine can be called successively to calculate a time series, profile or grid
      of magnetic field, these are better achieved by the subroutine WMM_Grid.

      INPUT: Ellip
      CoordSpherical
      CoordGeodetic
      TimedMagneticModel

      OUTPUT : GeoMagneticElements
    */
    {
        WMMtype_MagneticResults             MagneticResultsSph;
        WMMtype_MagneticResults             MagneticResultsGeo;
        WMMtype_MagneticResults             MagneticResultsSphVar;
        WMMtype_MagneticResults             MagneticResultsGeoVar;
        WMMtype_LegendreFunction            LegendreFunction;
        WMMtype_SphericalHarmonicVariables  SphVariables;

        // Compute Spherical Harmonic variables
        ComputeSphericalHarmonicVariables(CoordSpherical, MagneticModel.nMax, &SphVariables);

        // Compute ALF
        if (AssociatedLegendreFunction(CoordSpherical, MagneticModel.nMax, &LegendreFunction) < 0)
            return -1; // error

        // Accumulate the spherical harmonic coefficients
        Summation(&LegendreFunction, &SphVariables, CoordSpherical, &MagneticResultsSph);

        // Sum the Secular Variation Coefficients
        SecVarSummation(&LegendreFunction, &SphVariables, CoordSpherical, &MagneticResultsSphVar);

        // Map the computed Magnetic fields to Geodeitic coordinates
        RotateMagneticVector(CoordSpherical, CoordGeodetic, &MagneticResultsSph, &MagneticResultsGeo);

        // Map the secular variation field components to Geodetic coordinates
        RotateMagneticVector(CoordSpherical, CoordGeodetic, &MagneticResultsSphVar, &MagneticResultsGeoVar);

        // Calculate the Geomagnetic elements, Equation 18 , WMM Technical report
        CalculateGeoMagneticElements(&MagneticResultsGeo, GeoMagneticElements);

        // Calculate the secular variation of each of the Geomagnetic elements
        CalculateSecularVariation(&MagneticResultsGeoVar, GeoMagneticElements);

        return 0;   // OK
    }