#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 | getName () |
| Getters. | |
| bool | getNearFollowBeam () |
| double | getNearR () |
| double | getNearZData (int indx) |
| double | getNearZMC (int indx) |
| double | getBeamAngleRad () |
| double | getNearDyDz () |
| double | getNearX0Beam () |
| double | getNearY0Beam () |
| double | getNearX0Z () |
| double | getNearY0Z () |
| bool | getFarOctagon () |
| bool | getFarCoilCut () |
| double | getFarRinner () |
| double | getFarRouter () |
| double | getFarZData (int indx) |
| double | getFarZMC (int indx) |
| double | getEvtVtxZOffset () |
| double | getTrkVtxZOffset () |
| double | getShwVtxZOffset () |
| void | setName (std::string name) |
| Setters. | |
| void | setNearFollowBeam (bool follow) |
| void | setNearR (double r) |
| void | setNearZData (int indx, double z) |
| void | setNearZMC (int indx, double z) |
| void | setBeamAngleRad (double angle) |
| void | setNearDyDz (double dydz) |
| void | setNearX0Beam (double x0) |
| void | setNearY0Beam (double y0) |
| void | setNearX0Z (double x0) |
| void | setNearY0Z (double y0) |
| void | setFarOctagon (bool octagon) |
| void | setFarCoilCut (bool coilcut) |
| void | setFarRinner (double r) |
| void | setFarRouter (double r) |
| void | setFarZData (int indx, double z) |
| void | setFarZMC (int indx, double z) |
| void | setEvtVtxZOffset (double zoff) |
| void | setTrkVtxZOffset (double zoff) |
| void | setShwVtxZOffset (double zoff) |
| double | infid_near_radius (double x, double y, double z) |
| public utility functions | |
|
||||||||||||
|
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 }
|
|
|
Definition at line 352 of file infid.cxx. 00352 { return gBeamAngleRad; }
|
|
|
Definition at line 385 of file infid.cxx. Referenced by NuReco::GetRegion(), and infid(). 00385 { return gEvtVtxZOffset; }
|
|
|
Definition at line 369 of file infid.cxx. 00369 { return gFarCoilCut; }
|
|
|
Definition at line 367 of file infid.cxx. 00367 { return gFarOctagon; }
|
|
|
Definition at line 371 of file infid.cxx. Referenced by NuReco::GetRegion(), and NuCutImps::ChairSound::GetRegion(). 00371 { return gFarRinner; }
|
|
|
Definition at line 373 of file infid.cxx. Referenced by NuReco::GetRegion(), and NuCutImps::ChairSound::GetRegion(). 00373 { return gFarRouter; }
|
|
|
Definition at line 375 of file infid.cxx. References FidVol::gFarZData, and FidVol::legal_indx(). Referenced by NuReco::GetRegion(). 00376 { if (!legal_indx(indx,4)) assert(0); return gFarZData[indx]; }
|
|
|
Definition at line 379 of file infid.cxx. References FidVol::gFarZMC, and FidVol::legal_indx(). Referenced by NuReco::GetRegion(), and NuCutImps::ChairSound::GetRegion(). 00380 { if (!legal_indx(indx,4)) assert(0); return gFarZMC[indx]; }
|
|
|
Getters.
Definition at line 337 of file infid.cxx. Referenced by NuCut::InFidVol(), NuCut::InFidVolEvt(), NuCut::InFidVolTrueEvt(), and NuCut::SetFidVol(). 00337 { return gName; }
|
|
|
Definition at line 355 of file infid.cxx. 00355 { return gNearDyDz; }
|
|
|
Definition at line 340 of file infid.cxx. 00340 { return gNearFollowBeam; }
|
|
|
Definition at line 342 of file infid.cxx. 00342 { return gNearR; }
|
|
|
Definition at line 358 of file infid.cxx. 00358 { return gNearX0Beam; }
|
|
|
Definition at line 362 of file infid.cxx. 00362 { return gNearX0Z; }
|
|
|
Definition at line 360 of file infid.cxx. 00360 { return gNearY0Beam; }
|
|
|
Definition at line 364 of file infid.cxx. 00364 { return gNearY0Z; }
|
|
|
Definition at line 344 of file infid.cxx. References FidVol::gNearZData, and FidVol::legal_indx(). 00345 { if (!legal_indx(indx,2)) assert(0); return gNearZData[indx]; }
|
|
|
Definition at line 348 of file infid.cxx. References FidVol::gNearZMC, and FidVol::legal_indx(). 00349 { if (!legal_indx(indx,2)) assert(0); return gNearZMC[indx]; }
|
|
|
Definition at line 389 of file infid.cxx. Referenced by infid(). 00389 { return gShwVtxZOffset; }
|
|
|
Definition at line 387 of file infid.cxx. Referenced by NuReco::GetRegion(), NuCutImps::ChairSound::GetRegion(), and infid(). 00387 { return gTrkVtxZOffset; }
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||
|
public utility functions
Definition at line 275 of file infid.cxx. References FidVol::gNearY0Beam. 00276 {
00277 double xx = x, yy = y;
00278 if ( gNearFollowBeam ) {
00279 xx = xx - gNearX0Beam;
00280 yy = yy - gNearY0Beam - z*gNearDyDz;
00281 } else {
00282 xx = xx - gNearX0Z;
00283 yy = yy - gNearY0Z;
00284 }
00285 double r2 = xx*xx + yy*yy;
00286 return TMath::Sqrt(r2);
00287 }
|
|
|
Definition at line 109 of file infid.cxx. References Form(). 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 }
|
|
|
Definition at line 353 of file infid.cxx. References FidVol::gBeamAngleRad, and FidVol::gNearDyDz. 00354 { gBeamAngleRad = angle; gNearDyDz = TMath::Tan(-angle); }
|
|
|
Definition at line 386 of file infid.cxx. References FidVol::gEvtVtxZOffset. 00386 { gEvtVtxZOffset = zoff; }
|
|
|
Definition at line 370 of file infid.cxx. References FidVol::gFarCoilCut. 00370 { gFarCoilCut = coilcut; }
|
|
|
Definition at line 368 of file infid.cxx. References FidVol::gFarOctagon. 00368 { gFarOctagon = octagon; }
|
|
|
Definition at line 372 of file infid.cxx. References FidVol::gFarRinner. 00372 { gFarRinner = r; }
|
|
|
Definition at line 374 of file infid.cxx. References FidVol::gFarRouter. 00374 { gFarRouter = r; }
|
|
||||||||||||
|
Definition at line 377 of file infid.cxx. References FidVol::gFarZData, and FidVol::legal_indx(). 00378 { if (!legal_indx(indx,4)) assert(0); gFarZData[indx] = z; }
|
|
||||||||||||
|
Definition at line 381 of file infid.cxx. References FidVol::gFarZMC, and FidVol::legal_indx(). 00382 { if (!legal_indx(indx,4)) assert(0); gFarZMC[indx] = z; }
|
|
|
Setters.
Definition at line 338 of file infid.cxx. References FidVol::gName. 00338 { gName = name; }
|
|
|
Definition at line 356 of file infid.cxx. References FidVol::gBeamAngleRad, and FidVol::gNearDyDz. 00357 { gNearDyDz = dydz; gBeamAngleRad = -TMath::ATan(dydz); }
|
|
|
Definition at line 341 of file infid.cxx. References FidVol::gNearFollowBeam. 00341 { gNearFollowBeam = follow; }
|
|
|
Definition at line 343 of file infid.cxx. References FidVol::gNearR. 00343 { gNearR = r; }
|
|
|
Definition at line 359 of file infid.cxx. References FidVol::gNearX0Beam. 00359 { gNearX0Beam = x0; }
|
|
|
Definition at line 363 of file infid.cxx. References FidVol::gNearX0Z. 00363 { gNearX0Z = x0; }
|
|
|
Definition at line 361 of file infid.cxx. References FidVol::gNearY0Beam. 00361 { gNearY0Beam = y0; }
|
|
|
Definition at line 365 of file infid.cxx. References FidVol::gNearY0Z. 00365 { gNearY0Z = y0; }
|
|
||||||||||||
|
Definition at line 346 of file infid.cxx. References FidVol::gNearZData, and FidVol::legal_indx(). 00347 { if (!legal_indx(indx,2)) assert(0); gNearZData[indx] = z; }
|
|
||||||||||||
|
Definition at line 350 of file infid.cxx. References FidVol::gNearZMC, and FidVol::legal_indx(). 00351 { if (!legal_indx(indx,2)) assert(0); gNearZMC[indx] = z; }
|
|
|
Definition at line 390 of file infid.cxx. References FidVol::gShwVtxZOffset. 00390 { gShwVtxZOffset = zoff; }
|
|
|
Definition at line 388 of file infid.cxx. References FidVol::gTrkVtxZOffset. 00388 { gTrkVtxZOffset = zoff; }
|
1.3.9.1