infid.h File Reference

#include <string>
#include "Conventions/Detector.h"
#include "Conventions/SimFlag.h"

Go to the source code of this file.

Namespaces

namespace  FidVol

Functions

bool infid (Detector::Detector_t det, SimFlag::SimFlag_t simflg, Double_t x, Double_t y, Double_t z)
void print_infid ()
void choose_infid_set (std::string name, bool doassert=true)
std::string FidVol::getName ()
 Getters.
bool FidVol::getNearFollowBeam ()
double FidVol::getNearR ()
double FidVol::getNearZData (int indx)
double FidVol::getNearZMC (int indx)
double FidVol::getBeamAngleRad ()
double FidVol::getNearDyDz ()
double FidVol::getNearX0Beam ()
double FidVol::getNearY0Beam ()
double FidVol::getNearX0Z ()
double FidVol::getNearY0Z ()
bool FidVol::getFarOctagon ()
bool FidVol::getFarCoilCut ()
double FidVol::getFarRinner ()
double FidVol::getFarRouter ()
double FidVol::getFarZData (int indx)
double FidVol::getFarZMC (int indx)
double FidVol::getEvtVtxZOffset ()
double FidVol::getTrkVtxZOffset ()
double FidVol::getShwVtxZOffset ()
void FidVol::setName (std::string name)
 Setters.
void FidVol::setNearFollowBeam (bool follow)
void FidVol::setNearR (double r)
void FidVol::setNearZData (int indx, double z)
void FidVol::setNearZMC (int indx, double z)
void FidVol::setBeamAngleRad (double angle)
void FidVol::setNearDyDz (double dydz)
void FidVol::setNearX0Beam (double x0)
void FidVol::setNearY0Beam (double y0)
void FidVol::setNearX0Z (double x0)
void FidVol::setNearY0Z (double y0)
void FidVol::setFarOctagon (bool octagon)
void FidVol::setFarCoilCut (bool coilcut)
void FidVol::setFarRinner (double r)
void FidVol::setFarRouter (double r)
void FidVol::setFarZData (int indx, double z)
void FidVol::setFarZMC (int indx, double z)
void FidVol::setEvtVtxZOffset (double zoff)
void FidVol::setTrkVtxZOffset (double zoff)
void FidVol::setShwVtxZOffset (double zoff)
double FidVol::infid_near_radius (double x, double y, double z)
 public utility functions

Function Documentation

void choose_infid_set ( std::string  name,
bool  doassert = true 
)

Definition at line 192 of file infid.cxx.

References done(), Form(), FidVol::know_setter(), FidVol::load_setter_script(), and print_infid().

Referenced by NuAnalysis::DemoInfidSRInterface(), MadScanDisplay::DrawTextBox(), MadScanDisplay::InFidNoTrk(), MadScanDisplay::InFidTrk(), NuCut::InFidVol(), NuCut::InFidVolEvt(), NuCut::InFidVolTrueEvt(), MadQuantities::IsFid_2008(), NuCuts::IsInFidVol(), MadAbID::MakeRecoVariables(), and NuCut::SetFidVol().

00193 {
00194   //
00195   // Call function that will configure "infid" parameters
00196   // Function name could be any of:
00197   //    infid_set_<setname>()
00198   //    <setname>()
00199   // And can be defined in any of:
00200   //    infid_sets.C
00201   //    infid_set_<setname>.C
00202   //    <setname>.C
00203   // Found in any of the directories (searched in this order):
00204   //     . ~ $SRT_PRIVATE_CONTEXT/DataUtil $SRT_PUBLIC_CONTEXT/DataUtil
00205   // If doassert is true and function can't be found, then assert()
00206   //
00207   // std::cout << "choose_infid_set(\"" << setname << "\")" << std::endl;
00208   // one-time load of generic macro that that has infid setter functions
00209   static bool loadGeneric = FidVol::load_setter_script("infid_sets.C");
00210   if ( ! loadGeneric ) {
00211     std::cout << "failed to find \"infid_sets.C\"" << std::endl;
00212   }
00213 
00214   const char* patterns[] = { "infid_set_%s", "%s" };
00215   int npatterns = sizeof(patterns)/sizeof(const char*);
00216   bool done = false;
00217 
00218   for (int i = 0; i < npatterns; ++i) {
00219     std::string funcname = Form(patterns[i],setname.c_str());
00220     if ( ! FidVol::know_setter(funcname) ) {
00221       // not known, try loading script if one can be found
00222       FidVol::load_setter_script(funcname);
00223     }
00224     if ( FidVol::know_setter(funcname) ) {
00225       funcname += "();";
00226       int psuccess = 0;
00227       gROOT->ProcessLine(funcname.c_str(),&psuccess);
00228       if ( psuccess == 0 ) {
00229         std::cout << "Successfully ran function \"" << funcname 
00230                   << "\" for set \"" << setname << "\"" << std::endl;
00231         done = true;
00232         break; // exit loop
00233       } else {
00234         std::cout << "Failed running macro \"" << funcname << "\" for set \"" 
00235                   << setname << "\"" << std::endl;
00236         if (doassert) assert(0);
00237       }
00238     } else {
00239       std::cout << "Found no setter function " << funcname 
00240                 << "() for \"" << setname << "\"" << std::endl;
00241     }
00242   } // end loop over patterns
00243   if ( ! done ) {
00244     if ( doassert ) assert(0);
00245     else {
00246       std::cout << "choose_infid_set(\"" << setname << "\") FAILED" 
00247                 << ", but user chose not to assert()" << std::endl;
00248     }
00249   }
00250   print_infid();
00251 }

bool infid ( Detector::Detector_t  det,
SimFlag::SimFlag_t  simflg,
Double_t  x,
Double_t  y,
Double_t  z 
)
void print_infid (  ) 

Definition at line 109 of file infid.cxx.

References Form(), FidVol::gBeamAngleRad, FidVol::gEvtVtxZOffset, FidVol::gFarCoilCut, FidVol::gFarOctagon, FidVol::gFarRinner, FidVol::gFarRouter, FidVol::gFarZData, FidVol::gFarZMC, FidVol::gName, FidVol::gNearDyDz, FidVol::gNearFollowBeam, FidVol::gNearR, FidVol::gNearX0Beam, FidVol::gNearX0Z, FidVol::gNearY0Beam, FidVol::gNearY0Z, FidVol::gNearZData, FidVol::gNearZMC, FidVol::gShwVtxZOffset, and FidVol::gTrkVtxZOffset.

Referenced by choose_infid_set().

00110 {
00111   std::cout << "Current infid settings: \"" << FidVol::gName 
00112             << "\"" << std::endl;
00113   std::cout << "Near:";
00114   std::cout << " cylinder radius " << FidVol::gNearR;
00115   if ( FidVol::gNearFollowBeam ) {
00116     std::cout << ", x0=" << FidVol::gNearX0Beam 
00117               << ", y0=" << FidVol::gNearY0Beam
00118               << ", follow beam" << std::endl;
00119     std::cout << "      dy/dz " << FidVol::gNearDyDz
00120               << " (angle " << FidVol::gBeamAngleRad << " radians)" 
00121               << std::endl;
00122   } else {
00123     std::cout << ", x0=" << FidVol::gNearX0Z 
00124               << ", y0=" << FidVol::gNearY0Z 
00125               << ", along z axis" << std::endl;
00126   }
00127   std::cout << "      z limits data: " 
00128             << Form("%8.5f",FidVol::gNearZData[0]) << " " 
00129             << Form("%8.5f",FidVol::gNearZData[1]) << std::endl
00130             << "                 MC: " 
00131             << Form("%8.5f",FidVol::gNearZMC[0]) << " " 
00132             << Form("%8.5f",FidVol::gNearZMC[1]) << std::endl;
00133 
00134   std::cout << "Far:";
00135   std::cout << "  " << (FidVol::gFarOctagon?"octagon inscribed":"circle") 
00136             << " radius " << FidVol::gFarRouter << ", ";
00137   if ( FidVol::gFarCoilCut ) 
00138     std::cout << "coil cut " << FidVol::gFarRinner;
00139   else
00140     std::cout << "no coil cut";     
00141   std::cout << std::endl;
00142   std::cout << "      z limits data: " 
00143             << Form("%8.5f",FidVol::gFarZData[0]) << " " 
00144             << Form("%8.5f",FidVol::gFarZData[1]) << " "
00145             << Form("%8.5f",FidVol::gFarZData[2]) << " "
00146             << Form("%8.5f",FidVol::gFarZData[3]) << std::endl
00147             << "                 MC: " 
00148             << Form("%8.5f",FidVol::gFarZMC[0]) << " " 
00149             << Form("%8.5f",FidVol::gFarZMC[1]) << " "
00150             << Form("%8.5f",FidVol::gFarZMC[2]) << " " 
00151             << Form("%8.5f",FidVol::gFarZMC[3]) << std::endl;
00152 
00153   std::cout << "Evt/Trk/Shw vertex offsets:"
00154             << " " << Form("%8.5f",FidVol::gEvtVtxZOffset)
00155             << "/" << Form("%8.5f",FidVol::gTrkVtxZOffset)
00156             << "/" << Form("%8.5f",FidVol::gShwVtxZOffset)
00157             << std::endl;
00158 
00159 }


Generated on 2 Nov 2017 for loon by  doxygen 1.6.1