Project

General

Profile

Detector

The Detector class stores information about a particular detector. It includes a name, typical nuclear target, size (cm), location (cm in detector coordinates), and a number identifying how many times to smear a neutrino ray through the detector volume. The Parameters class stores a vector of these objects.

Predefined Detectors

The file Detectors.h defines some default detectors. For most studies at particular detectors, these objects should suffice. The predefined list includes the NOvA Near Detector, NOvA Far Detector, NOvA Prototype (IPND or NDOS), MINOS Near Detector, and MINOS Far Detector. All immovable detectors should eventually populate this file.

Construction

If the user should need to create a Detector object, then every piece of information the class stores must be provided to the constructor. The detector name as a std::string is first, followed by the typical nuclear target, also as a std::string. The detector position follows as three doubles. These values should be provided in cm, and in detector coordinates. The detector size follows the position, also as three doubles. These values, too, should be provided in cm. Finally, the number of times to smear a neutrino ray throughout the detector volume should be provided as an integer. This last value is the only value that can be changed later on, so the constructor input can be any positive integer, typically 1 to start. The example below shows a NOvA Near Detector shifted by +100 cm.

   Detector knova_nd_shift("nova_nd_shift", "CH2",
                           1141.4, -345.6, 99566.5,     // the third value, 99566.5, is shifted from the nominal 99466.5
                           262.14, 393.27, 1424.52698,  // size
                           1);

General Use

Functions exist that allow the user to get any of the values stored in a Detector, though not necessarily change them. Every function that begins with "Get" takes no arguments. All of the functions will be demonstrated using the object defined above, knova_nd_shift.

To access the detector name, use the GetDetName function.

  std::string detname = knova_nd_shift.GetDetName(); // returns "nova_nd_shift" 

To access the nuclear target, use the GetTarget function.

  std::string target = knova_nd_shift.GetTarget(); // returns "CH2" 

The detector coordinates can be accessed in three ways. Each coordinate can be returned separately using the GetCoordX, GetCoordY, and GetCoordZ functions; all three coordinates can be returned as a std::vector<double> using the GetCoords() function; and all three coordinates can be returned as a TVector3 using the GetTCoords function.

  std::vector<double> option1;
  option1.push_back(knova_nd_shift.GetCoordX());
  option1.push_back(knova_nd_shift.GetCoordY());
  option1.push_back(knova_nd_shift.GetCoordZ());
  std::vector<double> option2 = knova_nd_shift.GetCoords();
  TVector3 option3 = knova_nd_shift.GetTCoords();

The detector size can also be accessed in three ways. Each dimension can be returned separately using the GetSizeX, GetSizeY, and GetSizeZ functions; all three dimensions can be returned as a std::vector<double> using the GetSizes function, and half of each dimension can returned separately using the GetHalfSizeX, GetHalfSizeY, and GetHalfSizeZ functions.

  std::vector<double> fullsize1;
  fullsize1.push_back(knova_nd_shift.GetSizeX());
  fullsize1.push_back(knova_nd_shift.GetSizeY());
  fullsize1.push_back(knova_nd_shift.GetSizeZ());
  std::vector<double> fullsize2 = knova_nd_shift.GetSizes();
  std::vector<double> halfsize;
  halfsize.push_back(knova_nd_shift.GetHalfSizeX());
  halfsize.push_back(knova_nd_shift.GetHalfSizeY());
  halfsize.push_back(knova_nd_shift.GetHalfSizeZ());

The user can check the number of times a neutrino ray will be smeared through a detector using the GetUses function.

  std::cout << knova_nd_shift.GetUses() << std::endl;

Finally, if the user wants to change the number of times a neutrino ray will be smeared through a detector, the SetUses function can be used. This function takes an integer as the new number of times to smear a neutrino ray through the detector volume. The example below sets this value to 3. However, it should be noted that this value can, and should, be changed within the Parameters object, and that functionality is demonstrated on the Parameters page.

  knova_nd_shift.SetUses(3);