PMNS_Base.cxx
//......................................................................
///
/// Set all values of a path attribute.
///
/// An auxiliary function to set individual attributes in a path sequence.
///
/// If the path sequence is of a different size, a new path sequence will
/// be created and the previous sequence will be lost. Use with care.
///
/// @param att - The values of the attribute
/// @param idx - The index of the attribute (0,1,2,3) = (L, Rho, Z/A, Layer)
///
Set all values of a path attribute.

An auxiliary function to set individual attributes in a path sequence.

If the path sequence is of a different size, a new path sequence will
be created and the previous sequence will be lost. Use with care.
Set all values of a path attribute . An auxiliary function to set individual attributes in a path sequence . If the path sequence is of a different size a new path sequence will be created and the previous sequence will be lost . Use with care .
void PMNS_Base::SetAtt(std::vector<double> att, int idx){
  int nA = att.size();
  int nP = fNuPaths.size();
  if(nA == nP){
    for(int i=0; i<nP; i++){
      switch(idx){
        case 0: fNuPaths[i].length  = att[i]; break;
        case 1: fNuPaths[i].density = att[i]; break;
        case 2: fNuPaths[i].zoa     = att[i]; break;
        case 3: fNuPaths[i].layer   = att[i]; break;
      }
    }
  }
  else{
    cout << "Warning: New vector size. Starting new path vector." << endl;
    cout << "To avoid possible issues, use the SetPath function." << endl;
    SetStdPath();
    NuPath p = fNuPaths[0];
    ClearPath();
    for(int i=0; i<nA; i++){
      switch(idx){
        case 0: p.length  = att[i]; break;
        case 1: p.density = att[i]; break;
        case 2: p.zoa     = att[i]; break;
        case 3: p.layer   = att[i]; break;
      }
      AddPath(p);
    }
  }
}
void PMNS_Base :: SetAtt ( std :: vector < double > att , int idx ) { int nA = att . size ( ) ; int nP = fNuPaths . size ( ) ; if ( nA == nP ) { for ( int i = 0 ; i < nP ; i ++ ) { switch ( idx ) { case 0 : fNuPaths [ i ] . length = att [ i ] ; break ; case 1 : fNuPaths [ i ] . density = att [ i ] ; break ; case 2 : fNuPaths [ i ] . zoa = att [ i ] ; break ; case 3 : fNuPaths [ i ] . layer = att [ i ] ; break ; } } } else { cout << " " << endl ; cout << " " << endl ; SetStdPath ( ) ; NuPath p = fNuPaths [ 0 ] ; ClearPath ( ) ; for ( int i = 0 ; i < nA ; i ++ ) { switch ( idx ) { case 0 : p . length = att [ i ] ; break ; case 1 : p . density = att [ i ] ; break ; case 2 : p . zoa = att [ i ] ; break ; case 3 : p . layer = att [ i ] ; break ; } AddPath ( p ) ; } } }
......................................................................
Set all values of a path attribute.
...................................................................... Set all values of a path attribute .
// Get the sizes of the attribute and // path sequence vectors // If the vector sizes are equal, update this attribute // If the vector sizes differ, create a new path sequence // and set value for this attribute. Other attributes will // be taken from default single path. // Start a new standard path just // to set default values // Create a path segment with default values // Clear the path sequence // Set this particular attribute's value // and add the path segment to the sequence