GeoValidate Class Reference

#include <GeoValidate.h>

List of all members.

Public Member Functions

 GeoValidate (float fracdiff, int detmask, int simmask)
virtual ~GeoValidate ()
bool RunAllTests (void)

Private Member Functions

bool TestLoanPool ()
bool TestGeom (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestSteelPln (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestScintPln (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestScintMdl (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestStrip (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetNearestSteelPlnHandle (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetScintPlnHandleVector (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetSteelPlnHandleVector (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetPlnHandleVector (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetScintPlnHandle (UgliGeomHandle geo)
bool TestGeom_GetSteelPlnHandle (UgliGeomHandle geo)
bool TestGeom_GetStripHandle (UgliGeomHandle geo)
bool TestGeom_GetPlaneIdFromZ (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetHallExtentMin (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetHallExtentMax (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetZExtent (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestGeom_GetTransverseExtent (UgliGeomHandle geo, UgliGeomHandle ugli)
bool TestSteelPln_GetHalfThickness (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_GetCenter (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_GetX0 (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_GetY0 (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_GetZ0 (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_GlobalToLocal (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestSteelPln_LocalToGlobal (UgliSteelPlnHandle geo, UgliSteelPlnHandle ugli)
bool TestScintPln_NumberOfStrips (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetStripHandle (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetStripHandleVector (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetScintMdlHandleVector (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetClosestStrip (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetX0RelSteel (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetY0RelSteel (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GlobalToLocal (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_LocalToGlobal (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintPln_GetZRotRelSteelRad (UgliScintPlnHandle geo, UgliScintPlnHandle ugli)
bool TestScintMdl_GetModuleNum (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_NumberOfStrips (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetClearFiber (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetExtraWlsFiber (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GlobalToLocal (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_LocalToGlobal (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetZRotRelPlnRad (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetLPosRelPln (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetTPosRelPln (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetScintPlnHandle (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetPlexScintMdlId (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestScintMdl_GetPlexPlaneId (UgliScintMdlHandle geo, UgliScintMdlHandle ugli)
bool TestStrip_GetSEId (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetHalfLength (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetHalfThickness (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetHalfWidth (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetTPos (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_PartialLength (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_IsMirrored (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_WlsPigtail (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_WlsBypass (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_ClearFiber (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GlobalPos (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GlobalToLocal (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_LocalToGlobal (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_DistanceAlong (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_Intersection (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetScintMdlHandle (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetScintPlnHandle (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetZRotRelMdlRad (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetLPosRelMdl (UgliStripHandle geo, UgliStripHandle ugli)
bool TestStrip_GetTPosRelMdl (UgliStripHandle geo, UgliStripHandle ugli)

Private Attributes

VldContextfVldContext
float fFracDiff
int fDetMask
int fSimMask

Detailed Description

Definition at line 22 of file GeoValidate.h.


Constructor & Destructor Documentation

GeoValidate::GeoValidate ( float  fracdiff,
int  detmask,
int  simmask 
)

Definition at line 35 of file GeoValidate.cc.

00035                                                                  : 
00036                           fVldContext(0), fFracDiff(fracdiff),
00037                           fDetMask(detmask), fSimMask(simmask) {
00038   // Default constructor
00039 
00040 }

GeoValidate::~GeoValidate (  )  [virtual]

Definition at line 43 of file GeoValidate.cc.

00043                           {
00044   // Destructor
00045 
00046 }


Member Function Documentation

bool GeoValidate::RunAllTests ( void   ) 

Definition at line 2827 of file GeoValidate.cc.

References fDetMask, fFracDiff, fSimMask, fVldContext, UgliLoanPool::Instance(), Detector::kCalDet, SimFlag::kData, Detector::kFar, SimFlag::kMC, Detector::kNear, Detector::MaskToString(), UgliLoanPool::SetUseGeo(), TestGeom(), TestLoanPool(), TestScintMdl(), TestScintPln(), TestSteelPln(), and TestStrip().

Referenced by main().

02827                               {
02828   //
02829   //  Purpose:  Run sequence of GeoGeometry package validity tests.
02830   //
02831   //  Arguments: none.
02832   //
02833   //  Return:    pass (if all tests successful) or fail
02834   //
02835   //  Contact:   S. Kasahara
02836   // 
02837 
02838   // Test 3 detector types in sequence, with kData DB values
02839   const int ndet = 3;
02840   Detector::Detector_t dettype[ndet] = {Detector::kFar,
02841                                         Detector::kNear,
02842                                         Detector::kCalDet};
02843 
02844   const int nsim = 2;
02845   SimFlag::SimFlag_t simflag[nsim] = { SimFlag::kMC, SimFlag::kData };
02846       
02847   VldTimeStamp currentTime;
02848   
02849   cout << "*** GeoValidate::RunAllTests ***" << endl;
02850   cout << "*** Fractional precision used in comparison of floats  = "
02851        << fFracDiff << ", Detector: " 
02852        << Detector::MaskToString(fDetMask)
02853        << ", SimFlag: " << SimFlag::MaskToString(fSimMask)
02854        << " ***" << endl;
02855   
02856   Bool_t passed[ndet][nsim];
02857   VldContext vldc[ndet][nsim];
02858   
02859   for ( int isim = 0; isim < nsim; isim++ ) {
02860     if ( !(simflag[isim] & fSimMask ) ) continue;
02861     for ( int idet = 0; idet < ndet; idet++ ) {
02862       if (!(dettype[idet] & fDetMask ) ) continue;
02863     
02864       passed[idet][isim] = true;
02865       
02866       if (dettype[idet] != Detector::kCalDet) {
02867         // Build vldc using current time
02868         fVldContext = new VldContext(dettype[idet],simflag[isim],currentTime);
02869       }
02870       else {
02871         // Current time isn't valid for caldet
02872         fVldContext = new VldContext(dettype[idet],simflag[isim],
02873                                      VldTimeStamp(2003,9,15,0,0,0));
02874       }
02875       vldc[idet][isim] = *fVldContext;
02876     
02877       cout << "\n*** Testing geometry with vld " 
02878            << *fVldContext << " ***" << endl;
02879     
02880       UgliLoanPool::Instance()->SetUseGeo(true);
02881       UgliGeomHandle geo(*fVldContext);
02882     
02883       UgliLoanPool::Instance()->SetUseGeo(false);
02884       UgliGeomHandle ugli(*fVldContext);
02885     
02886       // Run test methods
02887       cout << "*** TestLoanPool ***" << endl;
02888       if ( TestLoanPool() ) {
02889         cout << "*** All LoanPool tests Passed ***" << endl;
02890       }
02891       else {
02892         cout << "*** At least one LoanPool test FAILED ***" << endl;
02893         passed[idet][isim] = false;
02894       }
02895       cout << "\n*** TestGeom ***" << endl;
02896       if ( TestGeom(geo,ugli) ) {
02897         cout << "*** All Geom tests Passed ***" << endl;
02898       }
02899       else {
02900         cout << "*** At least one Geom test FAILED ***" << endl;
02901         passed[idet][isim] = false;
02902       }
02903     
02904       cout << "\n*** TestSteelPln ***" << endl;
02905       if ( TestSteelPln(geo,ugli) ) {
02906         cout << "*** All SteelPln tests Passed ***" << endl;
02907       }
02908       else {
02909         cout << "*** At least one SteelPln test FAILED ***" << endl;
02910         passed[idet][isim] = false;
02911       }
02912 
02913       cout << "\n*** TestScintPln ***" << endl;
02914       if ( TestScintPln(geo,ugli) ) {
02915         cout << "*** All ScintPln tests Passed ***" << endl;
02916       }
02917       else {
02918         cout << "*** At least one ScintPln test FAILED ***" << endl;
02919         passed[idet][isim] = false;
02920       }
02921 
02922       cout << "\n*** TestScintMdl ***" << endl;
02923       if ( TestScintMdl(geo,ugli) ) {
02924         cout << "*** All ScintMdl tests Passed ***" << endl;
02925       }
02926       else {
02927         cout << "\n*** At least one ScintMdl test FAILED ***" << endl;
02928         passed[idet][isim] = false;
02929       }
02930 
02931       cout << "\n*** TestStrip ***" << endl;
02932       if ( TestStrip(geo,ugli) ) {
02933         cout << "*** All Strip tests Passed ***" << endl;
02934       }
02935       else {
02936         cout << "*** At least one Strip test FAILED ***" << endl;
02937         passed[idet][isim] = false;
02938       }
02939     
02940       std::string detstatus = " Passed all Tests ***";
02941       if ( !passed[idet][isim] ) detstatus = " FAILED at least one Test ***";
02942     
02943       cout << "\n*** Detector w/vld " << *fVldContext << detstatus.c_str() 
02944            << endl;
02945 
02946       delete fVldContext; fVldContext = 0;
02947     }    
02948   }
02949 
02950   cout << "\n*** Finished all tests:" << endl;
02951   Bool_t allPassed = kTRUE;
02952   for ( int isim = 0; isim < nsim; isim++ ) {
02953     if ( !(simflag[isim] & fSimMask ) ) continue;
02954     for ( int idet = 0; idet < ndet; idet++ ) {
02955       if ( !(dettype[idet] & fDetMask) ) continue;
02956 
02957       std::string detstatus = " Passed all Tests ***";
02958       if ( !passed[idet][isim] ) {
02959         detstatus = " FAILED at least one Test ***";
02960         allPassed = kFALSE;
02961       }
02962       cout << "*** Detector w/vld " << vldc[idet][isim]
02963            << detstatus.c_str() << endl;
02964     }
02965   }
02966 
02967   return allPassed;
02968 
02969 }

bool GeoValidate::TestGeom ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 73 of file GeoValidate.cc.

References TestGeom_GetHallExtentMax(), TestGeom_GetHallExtentMin(), TestGeom_GetNearestSteelPlnHandle(), TestGeom_GetPlaneIdFromZ(), TestGeom_GetPlnHandleVector(), TestGeom_GetScintPlnHandle(), TestGeom_GetScintPlnHandleVector(), TestGeom_GetSteelPlnHandle(), TestGeom_GetSteelPlnHandleVector(), TestGeom_GetStripHandle(), TestGeom_GetTransverseExtent(), and TestGeom_GetZExtent().

Referenced by RunAllTests().

00073                                                                   {
00074   //  Test UgliGeomHandle methods
00075 
00076   bool pass = true;
00077 
00078   pass &= TestGeom_GetNearestSteelPlnHandle(geo,ugli);
00079   pass &= TestGeom_GetScintPlnHandleVector(geo,ugli);
00080   pass &= TestGeom_GetSteelPlnHandleVector(geo,ugli);
00081   pass &= TestGeom_GetPlnHandleVector(geo,ugli);
00082   pass &= TestGeom_GetScintPlnHandle(geo);
00083   pass &= TestGeom_GetSteelPlnHandle(geo);
00084   pass &= TestGeom_GetStripHandle(geo);
00085   pass &= TestGeom_GetPlaneIdFromZ(geo,ugli);
00086   pass &= TestGeom_GetHallExtentMin(geo,ugli);
00087   pass &= TestGeom_GetHallExtentMax(geo,ugli);
00088   pass &= TestGeom_GetTransverseExtent(geo,ugli);
00089   pass &= TestGeom_GetZExtent(geo,ugli);
00090 
00091   return pass;
00092 
00093 }

bool GeoValidate::TestGeom_GetHallExtentMax ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 764 of file GeoValidate.cc.

References fFracDiff, and UgliGeomHandle::GetHallExtentMax().

Referenced by TestGeom().

00765                                                                  {
00766   // Test UgliGeomHandle::GetHallExtentMax()
00767 
00768   bool pass = true;
00769 
00770   TVector3 geoxyz = geo.GetHallExtentMax();
00771   TVector3 uglixyz = ugli.GetHallExtentMax();
00772   
00773   if ( TMath::Abs((geoxyz.X() - uglixyz.X())/uglixyz.X()) > fFracDiff ) {
00774     cout << " Geo HallExtentMax X "
00775          << geoxyz.X() << " differs from Ugli " << uglixyz.X()
00776          << " by more than " << fFracDiff*100. << "%." << endl;
00777     pass = false;
00778   }
00779 
00780   if ( TMath::Abs((geoxyz.Y() - uglixyz.Y())/uglixyz.Y()) > fFracDiff ) {
00781     cout << " Geo HallExtentMax Y "
00782          << geoxyz.Y() << " differs from Ugli " << uglixyz.Y()
00783          << " by more than " << fFracDiff*100. << "%." << endl;
00784     pass = false;
00785   }
00786 
00787   if ( TMath::Abs((geoxyz.Z() - uglixyz.Z())/uglixyz.Z()) > fFracDiff ) {
00788     cout << " Geo HallExtentMax Z "
00789          << geoxyz.Z() << " differs from Ugli " << uglixyz.Z()
00790          << " by more than " << fFracDiff*100. << "%." << endl;
00791     pass = false;
00792   }
00793 
00794   if ( pass ) cout<< "*** TestGeom_GetHallExtentMax Passed ***"<< endl;
00795   else cout << "*** TestGeom_GetHallExtentMax FAILED ***" << endl;
00796 
00797   return pass;
00798 
00799 }

bool GeoValidate::TestGeom_GetHallExtentMin ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 726 of file GeoValidate.cc.

References fFracDiff, and UgliGeomHandle::GetHallExtentMin().

Referenced by TestGeom().

00727                                                                  {
00728   // Test UgliGeomHandle::GetHallExtentMin()
00729 
00730   bool pass = true;
00731 
00732   TVector3 geoxyz = geo.GetHallExtentMin();
00733   TVector3 uglixyz = ugli.GetHallExtentMin();
00734   
00735   if ( TMath::Abs((geoxyz.X() - uglixyz.X())/uglixyz.X()) > fFracDiff ) {
00736     cout << " Geo HallExtentMin X "
00737          << geoxyz.X() << " differs from Ugli " << uglixyz.X()
00738          << " by more than " << fFracDiff*100. << "%." << endl;
00739     pass = false;
00740   }
00741 
00742   if ( TMath::Abs((geoxyz.Y() - uglixyz.Y())/uglixyz.Y()) > fFracDiff ) {
00743     cout << " Geo HallExtentMin Y "
00744          << geoxyz.Y() << " differs from Ugli " << uglixyz.Y()
00745          << " by more than " << fFracDiff*100. << "%." << endl;
00746     pass = false;
00747   }
00748 
00749   if ( TMath::Abs((geoxyz.Z() - uglixyz.Z())/uglixyz.Z()) > fFracDiff ) {
00750     cout << " Geo HallExtentMin Z "
00751          << geoxyz.Z() << " differs from Ugli " << uglixyz.Z()
00752          << " by more than " << fFracDiff*100. << "%." << endl;
00753     pass = false;
00754   }
00755 
00756   if ( pass ) cout<< "*** TestGeom_GetHallExtentMin Passed ***"<< endl;
00757   else cout << "*** TestGeom_GetHallExtentMin FAILED ***" << endl;
00758 
00759   return pass;
00760 
00761 }

bool GeoValidate::TestGeom_GetNearestSteelPlnHandle ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 418 of file GeoValidate.cc.

References UgliGeomHandle::GetNearestSteelPlnHandle(), UgliPlnHandle::GetPlexPlaneId(), and UgliGeomHandle::GetZExtent().

Referenced by TestGeom().

00419                                                                          {
00420   //  Test UgliGeomHandle::GetNearestSteelPlnHandle(Double_t z)
00421 
00422   bool pass = true;
00423 
00424   // Test by z from -1+zmindet to +1+zmaxdet
00425   int nz = 11;
00426   Double_t zmin;
00427   Double_t zmax;
00428   geo.GetZExtent(zmin,zmax);
00429   zmin += -1.;
00430   zmax += +1.;
00431   
00432   Double_t dz = (zmax - zmin)/(nz-1);
00433   
00434   for ( int iz = 0; iz < nz; iz++ ) {
00435     Double_t z = iz*dz + zmin;
00436 
00437     UgliSteelPlnHandle geosteelpln = geo.GetNearestSteelPlnHandle(z);
00438     UgliSteelPlnHandle uglisteelpln = ugli.GetNearestSteelPlnHandle(z);
00439 
00440     if ( geosteelpln.GetPlexPlaneId() != uglisteelpln.GetPlexPlaneId() ) {
00441       cout << "SteelPln Geo GetNearestSteelPlnHandle "
00442            << geosteelpln.GetPlexPlaneId() << " differs from Ugli " 
00443            << uglisteelpln.GetPlexPlaneId()
00444            << " for z " << z << "." << endl;
00445       pass = false;
00446     }
00447   }
00448 
00449   if ( pass ) cout<< "*** TestGeom_GetNearestSteelPlnHandle Passed ***"<< endl;
00450   else cout << "*** TestGeom_GetNearestSteelPlnHandle FAILED ***" << endl;
00451   
00452   return pass;
00453 
00454 }

bool GeoValidate::TestGeom_GetPlaneIdFromZ ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 689 of file GeoValidate.cc.

References UgliGeomHandle::GetPlaneIdFromZ(), and UgliGeomHandle::GetZExtent().

Referenced by TestGeom().

00690                                                                 {
00691   //  Test UgliGeomHandle::GetPlaneIdFromZ(Double_t z)
00692 
00693   bool pass = true;
00694 
00695   // Test by z from -1+zmindet to +1+zmaxdet
00696   int nz = 11;
00697   Double_t zmin;
00698   Double_t zmax;
00699   geo.GetZExtent(zmin,zmax);
00700   zmin += -1.;
00701   zmax += +1.;
00702   
00703   Double_t dz = (zmax - zmin)/(nz-1);
00704   
00705   for ( int iz = 0; iz < nz; iz++ ) {
00706     Double_t z = iz*dz + zmin;
00707   
00708     PlexPlaneId geoplnid = geo.GetPlaneIdFromZ(z);
00709     PlexPlaneId ugliplnid = ugli.GetPlaneIdFromZ(z);
00710 
00711     if ( geoplnid != ugliplnid ) {
00712       cout << "Pln Geo GetPlaneIdFromZ " << geoplnid << " differs from Ugli " 
00713            << ugliplnid << " for z " << z << "." << endl;
00714       pass = false;
00715     }
00716   }
00717 
00718   if ( pass ) cout << "*** TestGeom_GetPlaneIdFromZ Passed ***" << endl;
00719   else cout << "*** TestGeom_GetPlaneIdFromZ FAILED ***" << endl;
00720 
00721   return pass;
00722 
00723 }

bool GeoValidate::TestGeom_GetPlnHandleVector ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 544 of file GeoValidate.cc.

References PlexPlaneId::AsString(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetPlnHandleVector(), PlexPlaneId::IsSteel(), and PlexPlaneId::IsVetoShield().

Referenced by TestGeom().

00545                                                                    {
00546   // Test UgliGeomHandle::GetPlnHandleVector()
00547 
00548   bool pass = true;
00549   
00550   std::vector<UgliPlnHandle> geo_vec = geo.GetPlnHandleVector();
00551   std::vector<UgliPlnHandle> ugli_vec = ugli.GetPlnHandleVector();
00552   
00553   // Because Ugli stores steel planes with epsilon thickness for 
00554   // shield planes, and Geo does not store steel planes for shield planes,
00555   // there will be a differing number of planes in the two lists.  Must 
00556   // test to see that every geo plane appears in ugli list, and that every 
00557   // ugli plane this is not in the geo plane list is a steel vetoshield
00558   // placeholder.
00559   std::vector<UgliPlnHandle>::iterator geo_iter;
00560   std::vector<UgliPlnHandle>::iterator ugli_iter = ugli_vec.begin();
00561 
00562   unsigned int ngeomatch = 0;
00563   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00564     UgliPlnHandle geoplnhandle = *geo_iter;
00565     PlexPlaneId geoplexplaneid = geoplnhandle.GetPlexPlaneId();
00566     PlexPlaneId ugliplexplaneid;
00567     while ( ugli_iter != ugli_vec.end() && geoplexplaneid != ugliplexplaneid ){
00568       UgliPlnHandle ugliplnhandle = *ugli_iter;
00569       ugliplexplaneid = ugliplnhandle.GetPlexPlaneId();
00570       if ( geoplexplaneid != ugliplexplaneid ) {
00571         if (!(ugliplexplaneid.IsSteel() && ugliplexplaneid.IsVetoShield())) {
00572           cout << "Geom Geo GetPlnHandleVector " << geoplexplaneid.AsString()
00573                << " differs from Ugli " << ugliplexplaneid.AsString() << endl;
00574           pass = false;
00575         }
00576       }
00577       else ngeomatch++;
00578       if ( ugli_iter != ugli_vec.end() ) ugli_iter++;
00579     }
00580   }
00581 
00582   if ( ngeomatch != geo_vec.size() ) {
00583     cout << "Geom Geo GetPlnHandleVector number of planes " << geo_vec.size() 
00584          << " differs from Ugli " << ngeomatch << "." << endl;
00585     pass = false;
00586   }
00587   
00588   if ( pass ) cout << "*** TestGeom_GetPlnHandleVector Passed ***" << endl;
00589   else cout << "*** TestGeom_GetPlnHandleVector FAILED ***" << endl;
00590  
00591   return pass;
00592 
00593 }

bool GeoValidate::TestGeom_GetScintPlnHandle ( UgliGeomHandle  geo  )  [private]

Definition at line 596 of file GeoValidate.cc.

References PlexPlaneId::AsString(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetScintPlnHandle(), and UgliGeomHandle::GetScintPlnHandleVector().

Referenced by TestGeom().

00596                                                                {
00597   // Test UgliGeomHandle::GetScintPlnHandle(PlexPlaneId planeid)
00598 
00599   bool pass = true;
00600   
00601   std::vector<UgliScintPlnHandle> geo_vec = geo.GetScintPlnHandleVector();
00602   
00603   std::vector<UgliScintPlnHandle>::iterator geo_iter;
00604   
00605   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00606     UgliScintPlnHandle geoplnhandle = *geo_iter;
00607     PlexPlaneId geoplexplaneid = geoplnhandle.GetPlexPlaneId();
00608     // Now ask UgliGeomHandle for this scint plane by plane id
00609     UgliScintPlnHandle geoplnbyidhandle= geo.GetScintPlnHandle(geoplexplaneid);
00610     if ( geoplnhandle.GetPlexPlaneId() != geoplnbyidhandle.GetPlexPlaneId() ) {
00611       cout << "Geom GetScintPlnHandle retrieved wrong scintpln for planeid " 
00612            << geoplexplaneid.AsString() << "." << endl;
00613       pass = false;
00614     }
00615   }
00616   
00617   if ( pass ) cout << "*** TestGeom_GetScintPlnHandle Passed ***" << endl;
00618   else cout << "*** TestGeom_GetScintPlnHandle FAILED ***" << endl;
00619 
00620   return pass;
00621 
00622 }

bool GeoValidate::TestGeom_GetScintPlnHandleVector ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 457 of file GeoValidate.cc.

References PlexPlaneId::AsString(), UgliPlnHandle::GetPlexPlaneId(), and UgliGeomHandle::GetScintPlnHandleVector().

Referenced by TestGeom().

00458                                                                         {
00459   // Test UgliGeomHandle::GetScintPlnHandleVector()
00460 
00461   bool pass = true;
00462   
00463   std::vector<UgliScintPlnHandle> geo_vec = geo.GetScintPlnHandleVector();
00464   std::vector<UgliScintPlnHandle> ugli_vec = ugli.GetScintPlnHandleVector();
00465   
00466   if ( geo_vec.size() != ugli_vec.size() ) {
00467     cout << "Geom Geo GetScintPlnHandleVector size " << geo_vec.size() 
00468          << " differs from Ugli " << ugli_vec.size() << endl;
00469     pass = false;
00470   }
00471   
00472   std::vector<UgliScintPlnHandle>::iterator geo_iter;
00473   std::vector<UgliScintPlnHandle>::iterator ugli_iter = ugli_vec.begin();
00474   
00475   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00476     UgliScintPlnHandle geoplnhandle = *geo_iter;
00477     PlexPlaneId geoplexplaneid = geoplnhandle.GetPlexPlaneId();
00478     PlexPlaneId ugliplexplaneid;
00479     UgliScintPlnHandle ugliplnhandle;
00480     if ( ugli_iter != ugli_vec.end() ) {
00481       ugliplnhandle = *ugli_iter;
00482       ugliplexplaneid = ugliplnhandle.GetPlexPlaneId();
00483     }
00484     if ( geoplexplaneid != ugliplexplaneid ) {
00485       cout << "Geom Geo GetScintPlnHandleVector " << geoplexplaneid.AsString()
00486            << " differs from Ugli " << ugliplexplaneid.AsString() << endl;
00487       pass = false;
00488     }
00489     if ( ugli_iter != ugli_vec.end() ) ugli_iter++;
00490   }
00491  
00492   if (pass) cout << "*** TestGeom_GetScintPlnHandleVector Passed ***" << endl;
00493   else cout << "*** TestGeom_GetScintPlnHandleVector FAILED ***" << endl;
00494  
00495   return pass;
00496 
00497 }

bool GeoValidate::TestGeom_GetSteelPlnHandle ( UgliGeomHandle  geo  )  [private]

Definition at line 625 of file GeoValidate.cc.

References PlexPlaneId::AsString(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetSteelPlnHandle(), and UgliGeomHandle::GetSteelPlnHandleVector().

Referenced by TestGeom().

00625                                                                {
00626   // Test UgliGeomHandle::GetSteelPlnHandle(PlexPlaneId planeid)
00627 
00628   bool pass = true;
00629   
00630   std::vector<UgliSteelPlnHandle> geo_vec = geo.GetSteelPlnHandleVector();
00631   
00632   std::vector<UgliSteelPlnHandle>::iterator geo_iter;
00633   
00634   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00635     UgliSteelPlnHandle geoplnhandle = *geo_iter;
00636     PlexPlaneId geoplexplaneid = geoplnhandle.GetPlexPlaneId();
00637     // Now ask UgliGeomHandle for this steel plane by plane id
00638     UgliSteelPlnHandle geoplnbyidhandle= geo.GetSteelPlnHandle(geoplexplaneid);
00639     if ( geoplnhandle.GetPlexPlaneId() != geoplnbyidhandle.GetPlexPlaneId() ) {
00640       cout << "Geom GetSteelPlnHandle retrieved wrong steelpln for planeid " 
00641            << geoplexplaneid.AsString() << endl;
00642       pass = false;
00643     }
00644   }
00645   
00646   if ( pass ) cout << "*** TestGeom_GetSteelPlnHandle Passed ***" << endl;
00647   else cout << "*** TestGeom_GetSteelPlnHandle FAILED ***" << endl;
00648 
00649   return pass;
00650 
00651 }

bool GeoValidate::TestGeom_GetSteelPlnHandleVector ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 500 of file GeoValidate.cc.

References PlexPlaneId::AsString(), UgliPlnHandle::GetPlexPlaneId(), and UgliGeomHandle::GetSteelPlnHandleVector().

Referenced by TestGeom().

00501                                                                         {
00502   // Test UgliGeomHandle::GetSteelPlnHandleVector()
00503 
00504   bool pass = true;
00505   
00506   std::vector<UgliSteelPlnHandle> geo_vec = geo.GetSteelPlnHandleVector();
00507   std::vector<UgliSteelPlnHandle> ugli_vec = ugli.GetSteelPlnHandleVector();
00508   
00509   if ( geo_vec.size() != ugli_vec.size() ) {
00510     cout << "Geom Geo GetSteelPlnHandleVector size " << geo_vec.size() 
00511          << " differs from Ugli " << ugli_vec.size() << "." << endl;
00512     pass = false;
00513   }
00514   
00515   std::vector<UgliSteelPlnHandle>::iterator geo_iter;
00516   std::vector<UgliSteelPlnHandle>::iterator ugli_iter = ugli_vec.begin();
00517   
00518   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00519     UgliSteelPlnHandle geoplnhandle = *geo_iter;
00520     PlexPlaneId geoplexplaneid = geoplnhandle.GetPlexPlaneId();
00521     PlexPlaneId ugliplexplaneid;
00522     UgliSteelPlnHandle ugliplnhandle;
00523     if ( ugli_iter != ugli_vec.end() ) {
00524       ugliplnhandle = *ugli_iter;
00525       ugliplexplaneid = ugliplnhandle.GetPlexPlaneId();
00526     }
00527     if ( geoplexplaneid != ugliplexplaneid ) {
00528       cout << "Geom Geo GetSteelPlnHandleVector " << geoplexplaneid.AsString()
00529            << " differs from Ugli " << ugliplexplaneid.AsString() << endl;
00530       pass = false;
00531     }
00532     if ( ugli_iter != ugli_vec.end() ) ugli_iter++;
00533   }
00534   
00535   if (pass) cout << "*** TestGeom_GetScintPlnHandleVector Passed ***" << endl;
00536   else cout << "*** TestGeom_GetScintPlnHandleVector FAILED ***" << endl;
00537 
00538   return pass;
00539 
00540 }

bool GeoValidate::TestGeom_GetStripHandle ( UgliGeomHandle  geo  )  [private]

Definition at line 654 of file GeoValidate.cc.

References PlexStripEndId::AsString(), UgliGeomHandle::GetScintPlnHandleVector(), UgliStripHandle::GetSEId(), UgliGeomHandle::GetStripHandle(), and UgliScintPlnHandle::GetStripHandleVector().

Referenced by TestGeom().

00654                                                             {
00655   // Test UgliGeomHandle::GetStripHandle(PlexStripEndId seid)
00656 
00657   bool pass = true;
00658   
00659   std::vector<UgliScintPlnHandle> geo_vec = geo.GetScintPlnHandleVector();
00660   std::vector<UgliScintPlnHandle>::iterator geo_iter;
00661   
00662   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00663     // Probably don't need to test this method for every strip in every
00664     // plane...
00665     UgliScintPlnHandle geoplnhandle = *geo_iter;
00666     std::vector<UgliStripHandle> stp_vec=geoplnhandle.GetStripHandleVector();
00667     std::vector<UgliStripHandle>::iterator stp_iter;
00668     for ( stp_iter = stp_vec.begin(); stp_iter != stp_vec.end(); stp_iter++ ) {
00669       UgliStripHandle geostphandle = *stp_iter;
00670       PlexStripEndId geoseid = geostphandle.GetSEId();
00671       // Now ask UgliGeomHandle for this strip by seid
00672       UgliStripHandle geostpbyidhandle = geo.GetStripHandle(geoseid);
00673       if (geostphandle.GetSEId() != geostpbyidhandle.GetSEId()) {
00674         cout << "Geom Geo GetStripHandle retrieved wrong striphandle for stripendid " 
00675              << geoseid.AsString() << endl;
00676         pass = false;
00677       }
00678     }
00679   }
00680   
00681   if ( pass ) cout << "*** TestGeom_GetStripHandle Passed ***" << endl;
00682   else cout << "*** TestGeom_GetStripHandle FAILED ***" << endl;
00683 
00684   return pass;
00685 
00686 }

bool GeoValidate::TestGeom_GetTransverseExtent ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 837 of file GeoValidate.cc.

References bfld::AsString(), fFracDiff, fVldContext, DataUtil::GetDetector(), UgliGeomHandle::GetTransverseExtent(), Detector::kCalDet, PlaneView::kU, PlaneView::kV, PlaneView::kX, and PlaneView::kY.

Referenced by TestGeom().

00838                                                                     {
00839   // Test UgliGeomHandle::GetTransverseExtent()
00840 
00841   bool pass = true;
00842 
00843   int npv = 2; // 2 planeviews
00844   PlaneView::PlaneView_t pv[2] = { PlaneView::kU, PlaneView::kV };
00845   if ( fVldContext -> GetDetector() == Detector::kCalDet ) {
00846       pv[0] = PlaneView::kX;
00847       pv[1] = PlaneView::kY;
00848   }
00849       
00850   for ( int ipv = 0; ipv < npv; ipv++ ) {
00851     Float_t geotmin, geotmax;
00852     geo.GetTransverseExtent(pv[ipv],geotmin,geotmax);
00853     Float_t uglitmin, uglitmax;
00854     ugli.GetTransverseExtent(pv[ipv],uglitmin,uglitmax);
00855     if ( TMath::Abs((uglitmax - geotmax)/uglitmax) > fFracDiff ) {
00856       cout << " Geo TransverseExtent tmax " << geotmax << " for pv "
00857            << PlaneView::AsString(pv[ipv]) << " differs from Ugli " << uglitmax
00858            << " by more than " << fFracDiff*100. << "%." << endl;
00859       pass = false;
00860     }
00861     if ( TMath::Abs((uglitmin - geotmin)/uglitmin) > fFracDiff ) {
00862       cout << " Geo TransverseExtent tmin " << geotmin << " for pv "
00863            << PlaneView::AsString(pv[ipv]) << " differs from Ugli " << uglitmin
00864            << " by more than " << fFracDiff*100. << "%." << endl;
00865       pass = false;
00866     }
00867   }
00868 
00869   if ( pass ) cout<< "*** TestGeom_GetTransverseExtent Passed ***"<< endl;
00870   else cout << "*** TestGeom_GetTransverseExtent FAILED ***" << endl;
00871 
00872   return pass;
00873 
00874 }

bool GeoValidate::TestGeom_GetZExtent ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 802 of file GeoValidate.cc.

References fFracDiff, fVldContext, DataUtil::GetDetector(), UgliGeomHandle::GetZExtent(), and Detector::kFar.

Referenced by TestGeom().

00802                                                                             {
00803   // Test UgliGeomHandle::GetZExtent()
00804 
00805   bool pass = true;
00806 
00807   int nsm = 0; // Ugli doesn't like testing of sm 0 for non-fardet
00808   if ( fVldContext -> GetDetector() == Detector::kFar ) nsm = 2;
00809  
00810   for ( int ism = -1; ism < nsm; ism++ ) {
00811     Float_t geozmin, geozmax;
00812     geo.GetZExtent(geozmin,geozmax,ism);
00813     Float_t uglizmin, uglizmax;
00814     ugli.GetZExtent(uglizmin,uglizmax,ism);
00815     if ( TMath::Abs((uglizmax - geozmax)/uglizmax) > fFracDiff ) {
00816       cout << " Geo ZExtent zmax " << geozmax << " for ism "
00817            << ism << " differs from Ugli " << uglizmax
00818            << " by more than " << fFracDiff*100. << "%." << endl;
00819       pass = false;
00820     }
00821     if ( TMath::Abs((uglizmin - geozmin)/uglizmin) > fFracDiff ) {
00822       cout << " Geo ZExtent zmin " << geozmin << " for ism "
00823            << ism << " differs from Ugli " << uglizmin
00824            << " by more than " << fFracDiff*100. << "%." << endl;
00825       pass = false;
00826     }
00827   }
00828 
00829   if ( pass ) cout<< "*** TestGeom_GetZExtent Passed ***"<< endl;
00830   else cout << "*** TestGeom_GetZExtent FAILED ***" << endl;
00831 
00832   return pass;
00833 
00834 }

bool GeoValidate::TestLoanPool (  )  [private]

Definition at line 49 of file GeoValidate.cc.

References fVldContext, UgliLoanPool::Instance(), UgliGeomHandle::IsValid(), and UgliLoanPool::SetUseGeo().

Referenced by RunAllTests().

00049                                {
00050   //  Test UgliLoanPool
00051 
00052   //  A test of the UgliLoanPool is that it should not rebuild geometries
00053   bool pass = true;
00054   UgliLoanPool::Instance()->SetUseGeo(true);
00055   UgliGeomHandle geo(*fVldContext);
00056   if ( !geo.IsValid() ) {
00057     cout << "Invalid GeoGeometry " << endl;
00058     pass = false;
00059   }
00060   
00061   UgliLoanPool::Instance()->SetUseGeo(false);
00062   UgliGeomHandle ugli(*fVldContext);
00063   if ( !ugli.IsValid() ) {
00064     cout << "Invalid UgliGeometry " << endl;
00065     pass = false;
00066   }
00067   
00068   return pass;
00069 
00070 }

bool GeoValidate::TestScintMdl ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 221 of file GeoValidate.cc.

References PlexPlaneId::AsString(), PlexScintMdlId::AsString(), PlexPlaneId::GetPlane(), UgliPlnHandle::GetPlexPlaneId(), UgliScintMdlHandle::GetPlexScintMdlId(), UgliScintPlnHandle::GetScintMdlHandleVector(), UgliGeomHandle::GetScintPlnHandle(), UgliGeomHandle::GetScintPlnHandleVector(), TestScintMdl_GetClearFiber(), TestScintMdl_GetExtraWlsFiber(), TestScintMdl_GetLPosRelPln(), TestScintMdl_GetModuleNum(), TestScintMdl_GetPlexPlaneId(), TestScintMdl_GetPlexScintMdlId(), TestScintMdl_GetScintPlnHandle(), TestScintMdl_GetTPosRelPln(), TestScintMdl_GetZRotRelPlnRad(), TestScintMdl_GlobalToLocal(), TestScintMdl_LocalToGlobal(), and TestScintMdl_NumberOfStrips().

Referenced by RunAllTests().

00221                                                                      {
00222   // Test UgliScintMdlHandle methods
00223 
00224   bool pass = true;
00225   
00226   std::vector<UgliScintPlnHandle> pln_vec = geo.GetScintPlnHandleVector();
00227   std::vector<UgliScintPlnHandle>::iterator pln_iter;
00228   
00229   cout << "*** Running ScintMdl Tests: ***" << endl;
00230   cout << "    TestScintMdl_GetModuleNum" << endl;
00231   cout << "    TestScintMdl_NumberOfStrips" << endl;
00232   cout << "    TestScintMdl_GetClearFiber" << endl;
00233   cout << "    TestScintMdl_GetExtraWlsFiber" << endl;
00234   cout << "    TestScintMdl_GlobalToLocal" << endl;
00235   cout << "    TestScintMdl_LocalToGlobal" << endl;
00236   cout << "    TestScintMdl_GetZRotRelPlnRad" << endl;
00237   cout << "    TestScintMdl_GetLPosRelPln" << endl;
00238   cout << "    TestScintMdl_GetTPosRelPln" << endl;
00239   cout << "    TestScintMdl_GetScintPlnHandle" << endl;
00240   cout << "    TestScintMdl_GetPlexScintMdlId" << endl;
00241   cout << "    TestScintMdl_GetPlexPlaneId" << endl;
00242   
00243   UgliScintPlnHandle geoplnbeg = *(pln_vec.begin());
00244   PlexPlaneId begplnid = geoplnbeg.GetPlexPlaneId();
00245   pln_iter = pln_vec.end(); pln_iter--;
00246   UgliScintPlnHandle geoplnend = *(pln_iter);
00247   PlexPlaneId endplnid = geoplnend.GetPlexPlaneId();
00248   Int_t nprintgap = ((endplnid.GetPlane() - begplnid.GetPlane())+1)/5;
00249 
00250   Int_t nplane = 0;
00251   for ( pln_iter = pln_vec.begin(); pln_iter != pln_vec.end(); pln_iter++ ) {
00252     nplane++;
00253     bool plnpass = true;
00254     UgliScintPlnHandle geopln = *pln_iter;
00255     PlexPlaneId plexplaneid = geopln.GetPlexPlaneId();
00256     UgliScintPlnHandle uglipln = ugli.GetScintPlnHandle(plexplaneid);
00257     
00258     std::vector<UgliScintMdlHandle> geovec = geopln.GetScintMdlHandleVector();
00259     std::vector<UgliScintMdlHandle>::iterator geo_iter;
00260     
00261     std::vector<UgliScintMdlHandle> uglivec
00262                                      = uglipln.GetScintMdlHandleVector();
00263     std::vector<UgliScintMdlHandle>::iterator ugli_iter = uglivec.begin();
00264     
00265     for ( geo_iter = geovec.begin(); geo_iter != geovec.end(); geo_iter++ ) {
00266       bool mdlpass = true;
00267       UgliScintMdlHandle geomdl = *geo_iter;
00268       PlexScintMdlId plexmdlid = geomdl.GetPlexScintMdlId();
00269       UgliScintMdlHandle uglimdl = *ugli_iter;
00270 
00271       mdlpass &= TestScintMdl_GetModuleNum(geomdl,uglimdl);
00272       mdlpass &= TestScintMdl_NumberOfStrips(geomdl,uglimdl);
00273       mdlpass &= TestScintMdl_GetClearFiber(geomdl,uglimdl);
00274       mdlpass &= TestScintMdl_GetExtraWlsFiber(geomdl,uglimdl);
00275       mdlpass &= TestScintMdl_GlobalToLocal(geomdl,uglimdl);
00276       mdlpass &= TestScintMdl_LocalToGlobal(geomdl,uglimdl);
00277       mdlpass &= TestScintMdl_GetZRotRelPlnRad(geomdl,uglimdl);
00278       mdlpass &= TestScintMdl_GetLPosRelPln(geomdl,uglimdl);
00279       mdlpass &= TestScintMdl_GetTPosRelPln(geomdl,uglimdl);
00280       mdlpass &= TestScintMdl_GetScintPlnHandle(geomdl,uglimdl);
00281       mdlpass &= TestScintMdl_GetPlexScintMdlId(geomdl,uglimdl);
00282       mdlpass &= TestScintMdl_GetPlexPlaneId(geomdl,uglimdl);
00283 
00284       if ( !mdlpass )
00285         cout << " ScintMdl " << plexmdlid.AsString() << " FAILED." << endl;
00286     
00287       plnpass &= mdlpass;
00288       ugli_iter++;
00289  
00290     }
00291 
00292     if ( plnpass ) {
00293       if ( nplane % nprintgap == 0 ) {
00294         cout << plexplaneid.AsString() << " Passed... " << endl;
00295       }
00296     }
00297     
00298     pass &= plnpass;
00299   }
00300   
00301   cout << "*** Finished All ScintMdl Tests for " << begplnid.AsString()
00302        << " to " << endplnid.AsString() << "***" << endl;
00303 
00304   return pass;
00305 
00306 }

bool GeoValidate::TestScintMdl_GetClearFiber ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1896 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetClearFiber(), UgliScintMdlHandle::GetPlexScintMdlId(), StripEnd::kEast, and StripEnd::kWest.

Referenced by TestScintMdl().

01897                                                                          {
01898   // Test UgliScintMdlHandle::GetClearFiber()
01899 
01900   bool pass = true;
01901 
01902   // Test by strip end 
01903   StripEnd::StripEnd_t stripend[2] = {StripEnd::kEast,
01904                                       StripEnd::kWest};
01905 
01906   for ( int iend = 0; iend < 2; iend++ ) {
01907     Float_t geoclearfiber = geomdl.GetClearFiber(stripend[iend]);
01908     Float_t ugliclearfiber = uglimdl.GetClearFiber(stripend[iend]);
01909   
01910     if ( TMath::Abs(ugliclearfiber) > fFracDiff ) {
01911       if (TMath::Abs((geoclearfiber-ugliclearfiber)/ugliclearfiber)> fFracDiff){
01912         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01913              << " Geo GetClearFiber " << geoclearfiber<< " differs from Ugli " 
01914              << ugliclearfiber << " by more than " << fFracDiff*100. << "%." 
01915              << endl;
01916         pass = false;
01917       }
01918     }
01919     else {
01920       if ( TMath::Abs(geoclearfiber-ugliclearfiber) > fFracDiff ) {
01921         cout << "ScintMdl " << geomdl.GetPlexScintMdlId()
01922              << " Geo GetClearFiber "
01923              << geoclearfiber << " differs from Ugli " << ugliclearfiber
01924              << " by more than " << fFracDiff << "." << endl;
01925         pass = false;
01926       }
01927     }
01928   }
01929 
01930   return pass;
01931 
01932 }

bool GeoValidate::TestScintMdl_GetExtraWlsFiber ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1935 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetExtraWlsFiber(), UgliScintMdlHandle::GetPlexScintMdlId(), StripEnd::kEast, and StripEnd::kWest.

Referenced by TestScintMdl().

01936                                                                             {
01937   // Test UgliScintMdlHandle::GetExtraWlsFiber()
01938 
01939   bool pass = true;
01940 
01941   // Test by strip end 
01942   StripEnd::StripEnd_t stripend[2] = {StripEnd::kEast,
01943                                       StripEnd::kWest};
01944 
01945   for ( int iend = 0; iend < 2; iend++ ) {
01946     Float_t geoextrawlsfiber = geomdl.GetExtraWlsFiber(stripend[iend]);
01947     Float_t ugliextrawlsfiber = uglimdl.GetExtraWlsFiber(stripend[iend]);
01948   
01949     if ( TMath::Abs(ugliextrawlsfiber) > fFracDiff ) {
01950       if (TMath::Abs((geoextrawlsfiber
01951                      -ugliextrawlsfiber)/ugliextrawlsfiber)> fFracDiff){
01952         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01953              << " Geo GetExtraWlsFiber " << geoextrawlsfiber
01954              << " differs from Ugli " 
01955              << ugliextrawlsfiber << " by more than " << fFracDiff*100. << "%." 
01956              << endl;
01957         pass = false;
01958       }
01959     }
01960     else {
01961       if ( TMath::Abs(geoextrawlsfiber-ugliextrawlsfiber) > fFracDiff ) {
01962         cout << "ScintMdl " << geomdl.GetPlexScintMdlId()
01963              << " Geo GetExtraWlsFiber "
01964              << geoextrawlsfiber << " differs from Ugli " << ugliextrawlsfiber
01965              << " by more than " << fFracDiff << "." << endl;
01966         pass = false;
01967       }
01968     }
01969   }
01970 
01971   return pass;
01972 
01973 }

bool GeoValidate::TestScintMdl_GetLPosRelPln ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1836 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetLPosRelPln(), and UgliScintMdlHandle::GetPlexScintMdlId().

Referenced by TestScintMdl().

01837                                                                          {
01838   // Test UgliScintMdlHandle::GetLPosRelPln()
01839 
01840   bool pass = true;
01841 
01842   Float_t geolposrelpln = geomdl.GetLPosRelPln();
01843   Float_t uglilposrelpln = uglimdl.GetLPosRelPln();
01844   
01845   if ( TMath::Abs(uglilposrelpln) > fFracDiff ) {
01846     if ( TMath::Abs((geolposrelpln-uglilposrelpln)/uglilposrelpln) > fFracDiff){
01847       cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01848            << " Geo GetLPosRelPln " << geolposrelpln << " differs from Ugli " 
01849            << uglilposrelpln << " by more than " << fFracDiff*100. << "%." 
01850            << endl;
01851       pass = false;
01852     }
01853   }
01854   if ( TMath::Abs(geolposrelpln - uglilposrelpln) > fFracDiff ) {
01855     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() << " Geo LPosRelPln "
01856          << geolposrelpln << " differs from Ugli " << uglilposrelpln
01857          << " by more than " << fFracDiff << "." << endl;
01858     pass = false;
01859   }
01860 
01861   return pass;
01862 
01863 }

bool GeoValidate::TestScintMdl_GetModuleNum ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1976 of file GeoValidate.cc.

References UgliScintMdlHandle::GetModuleNum(), and UgliScintMdlHandle::GetPlexScintMdlId().

Referenced by TestScintMdl().

01977                                                                         {
01978   // Test UgliScintMdlHandle::GetModuleNum()
01979 
01980   bool pass = true;
01981 
01982   Int_t geomodulenum = geomdl.GetModuleNum();
01983   Int_t uglimodulenum = uglimdl.GetModuleNum();
01984   
01985   if ( geomodulenum != uglimodulenum ) {
01986     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() << " Geo GetModuleNum "
01987          << geomodulenum << " differs from Ugli " << uglimodulenum
01988          << "." << endl;
01989     pass = false;
01990   }
01991     
01992   return pass;
01993 
01994 }

bool GeoValidate::TestScintMdl_GetPlexPlaneId ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1791 of file GeoValidate.cc.

References UgliScintMdlHandle::GetPlexPlaneId(), and UgliScintMdlHandle::GetPlexScintMdlId().

Referenced by TestScintMdl().

01792                                                                           {
01793   // Test UgliScintMdlHandle::GetPlexPlaneId()
01794 
01795   bool pass = true;
01796 
01797   PlexPlaneId geoplexplnid = geomdl.GetPlexPlaneId();
01798   PlexPlaneId ugliplexplnid = uglimdl.GetPlexPlaneId();
01799   
01800   if ( geoplexplnid != ugliplexplnid ) {
01801     cout << "ScintMdl " << geomdl.GetPlexScintMdlId()
01802          << "Geo GetPlexPlaneId " << geoplexplnid
01803          << " differs from Ugli " << ugliplexplnid << "."
01804          << endl;
01805     pass = false;
01806   }
01807 
01808   return pass;
01809 
01810 }

bool GeoValidate::TestScintMdl_GetPlexScintMdlId ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1769 of file GeoValidate.cc.

References UgliScintMdlHandle::GetPlexScintMdlId().

Referenced by TestScintMdl().

01770                                                                              {
01771   // Test UgliScintMdlHandle::GetPlexScintMdlId()
01772 
01773   bool pass = true;
01774 
01775   PlexScintMdlId geoplexmdlid = geomdl.GetPlexScintMdlId();
01776   PlexScintMdlId ugliplexmdlid = uglimdl.GetPlexScintMdlId();
01777   
01778   if ( geoplexmdlid != ugliplexmdlid ) {
01779     cout << "ScintMdl " << geomdl.GetPlexScintMdlId()
01780          << "Geo GetPlexScintMdlId " << geoplexmdlid
01781          << " differs from Ugli " << ugliplexmdlid << "."
01782          << endl;
01783     pass = false;
01784   }
01785 
01786   return pass;
01787 
01788 }

bool GeoValidate::TestScintMdl_GetScintPlnHandle ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1747 of file GeoValidate.cc.

References UgliPlnHandle::GetPlexPlaneId(), UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintMdlHandle::GetScintPlnHandle().

Referenced by TestScintMdl().

01748                                                                              {
01749   // Test UgliScintMdlHandle::GetScintPlnHandle()
01750 
01751   bool pass = true;
01752 
01753   UgliScintPlnHandle geoscintpln = geomdl.GetScintPlnHandle();
01754   UgliScintPlnHandle ugliscintpln = uglimdl.GetScintPlnHandle();
01755   
01756   if ( geoscintpln.GetPlexPlaneId() != ugliscintpln.GetPlexPlaneId() ) {
01757     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01758          << "Geo GetScintPlnHandle " << geoscintpln.GetPlexPlaneId()
01759          << " differs from Ugli " << ugliscintpln.GetPlexPlaneId() << "."
01760          << endl;
01761     pass = false;
01762   }
01763 
01764   return pass;
01765 
01766 }

bool GeoValidate::TestScintMdl_GetTPosRelPln ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1866 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintMdlHandle::GetTPosRelPln().

Referenced by TestScintMdl().

01867                                                                          {
01868   // Test UgliScintMdlHandle::GetTPosRelPln()
01869 
01870   bool pass = true;
01871 
01872   Float_t geotposrelpln = geomdl.GetTPosRelPln();
01873   Float_t uglitposrelpln = uglimdl.GetTPosRelPln();
01874   
01875   if ( TMath::Abs(uglitposrelpln) > fFracDiff ) {
01876     if ( TMath::Abs((geotposrelpln-uglitposrelpln)/uglitposrelpln) > fFracDiff){
01877       cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01878            << " Geo GetTPosRelPln " << geotposrelpln << " differs from Ugli " 
01879            << uglitposrelpln << " by more than " << fFracDiff*100. << "%." 
01880            << endl;
01881       pass = false;
01882     }
01883   }
01884   else if ( TMath::Abs(geotposrelpln - uglitposrelpln) > fFracDiff ) {
01885     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() << " Geo TPosRelPln "
01886          << geotposrelpln << " differs from Ugli " << uglitposrelpln
01887          << " by more than " << fFracDiff << "." << endl;
01888     pass = false;
01889   }
01890 
01891   return pass;
01892 
01893 }

bool GeoValidate::TestScintMdl_GetZRotRelPlnRad ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1813 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintMdlHandle::GetZRotRelPlnRad().

Referenced by TestScintMdl().

01814                                                                          {
01815   // Test UgliScintMdlHandle::GetZRotRelPlnRad()
01816 
01817   bool pass = true;
01818 
01819   Float_t geozrotrelplnrad = geomdl.GetZRotRelPlnRad();
01820   if ( geozrotrelplnrad < 0. ) geozrotrelplnrad += 2.*TMath::Pi();
01821   Float_t uglizrotrelplnrad = uglimdl.GetZRotRelPlnRad();
01822   if ( uglizrotrelplnrad < 0. ) uglizrotrelplnrad += 2.*TMath::Pi();
01823   
01824   if ( TMath::Abs(geozrotrelplnrad - uglizrotrelplnrad) > fFracDiff ) {
01825     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() << " Geo ZRotRelPlnRad "
01826          << geozrotrelplnrad << " differs from Ugli " << uglizrotrelplnrad
01827          << " by more than " << fFracDiff << "(rad)." << endl;
01828     pass = false;
01829   }
01830 
01831   return pass;
01832 
01833 }

bool GeoValidate::TestScintMdl_GlobalToLocal ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1664 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetPlexScintMdlId(), UgliScintMdlHandle::GlobalToLocal(), and UgliScintMdlHandle::LocalToGlobal().

Referenced by TestScintMdl().

01665                                                                          {
01666   // Test UgliScintMdlHandle::GlobalToLocal()
01667 
01668   bool pass = true;
01669 
01670   const int ntestpt = 3;
01671   TVector3 lxyz[ntestpt];
01672   lxyz[0] = TVector3(0.,0.,0.);
01673   lxyz[1] = TVector3(1.,1.,1.);
01674   lxyz[2] = TVector3(-1.,-1.,-1.);
01675 
01676   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01677     TVector3 geogxyz  = geomdl.LocalToGlobal(lxyz[ipt]);
01678 
01679     TVector3 geolxyz = geomdl.GlobalToLocal(geogxyz);
01680     TVector3 uglilxyz = uglimdl.GlobalToLocal(geogxyz);
01681   
01682     Float_t fFracDiff = 1.E-2;
01683   
01684     if ( TMath::Abs(uglilxyz.X()) > fFracDiff ) {
01685       if ( TMath::Abs((geolxyz.X() - uglilxyz.X())/uglilxyz.X()) > fFracDiff ) {
01686         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01687              << " Geo GlobalToLocal X "
01688              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01689              << " by more than " << fFracDiff*100. << "%." << endl;
01690         pass = false;
01691       }
01692     }
01693     else {
01694       if ( TMath::Abs(geolxyz.X() - uglilxyz.X()) > fFracDiff ) {
01695         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01696              << " Geo GlobalToLocal X "
01697              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01698              << " by more than " << fFracDiff << "." << endl;
01699         pass = false;
01700       }
01701     }
01702 
01703     if ( TMath::Abs(uglilxyz.Y()) > fFracDiff ) {
01704       if ( TMath::Abs((geolxyz.Y() - uglilxyz.Y())/uglilxyz.Y()) > fFracDiff ) {
01705         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01706              << " Geo GlobalToLocal Y "
01707              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01708              << " by more than " << fFracDiff*100. << "%." << endl;
01709         pass = false;
01710       }
01711     }
01712     else {
01713       if ( TMath::Abs(geolxyz.Y() - uglilxyz.Y()) > fFracDiff ) {
01714         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01715              << " Geo GlobalToLocal Y "
01716              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01717              << " by more than " << fFracDiff << "." << endl;
01718         pass = false;
01719       }
01720     }
01721 
01722     if ( TMath::Abs(uglilxyz.Z()) > fFracDiff ) {
01723       if ( TMath::Abs((geolxyz.Z() - uglilxyz.Z())/uglilxyz.Z()) > fFracDiff ) {
01724         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01725              << " Geo GlobalToLocal Z "
01726              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01727              << " by more than " << fFracDiff*100. << "%." << endl;
01728         pass = false;
01729       }
01730     }
01731     else {
01732       if ( TMath::Abs(geolxyz.Z() - uglilxyz.Z()) > fFracDiff ) {
01733         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01734              << " Geo GlobalToLocal Z "
01735              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01736              << " by more than " << fFracDiff << "." << endl;
01737         pass = false;
01738       }
01739     }
01740   }
01741   
01742   return pass;
01743 
01744 }

bool GeoValidate::TestScintMdl_LocalToGlobal ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1583 of file GeoValidate.cc.

References fFracDiff, UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintMdlHandle::LocalToGlobal().

Referenced by TestScintMdl().

01584                                                                          {
01585   // Test UgliScintMdlHandle::LocalToGlobal()
01586 
01587   bool pass = true;
01588 
01589   const int ntestpt = 3;
01590   TVector3 lxyz[ntestpt];
01591   lxyz[0] = TVector3(0.,0.,0.);
01592   lxyz[1] = TVector3(1.,1.,1.);
01593   lxyz[2] = TVector3(-1.,-1.,-1.);
01594 
01595   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01596     TVector3 geogxyz  = geomdl.LocalToGlobal(lxyz[ipt]);
01597     TVector3 ugligxyz = uglimdl.LocalToGlobal(lxyz[ipt]);
01598   
01599     Float_t fFracDiff = 1.E-2;
01600   
01601     if ( TMath::Abs(ugligxyz.X()) > fFracDiff ) {
01602       if ( TMath::Abs((geogxyz.X() - ugligxyz.X())/ugligxyz.X()) > fFracDiff ) {
01603         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01604              << " Geo LocalToGlobal X "
01605              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01606              << " by more than " << fFracDiff*100. << "%." << endl;
01607         pass = false;
01608       }
01609     }
01610     else {
01611       if ( TMath::Abs(geogxyz.X() - ugligxyz.X()) > fFracDiff ) {
01612         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01613              << " Geo LocalToGlobal X "
01614              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01615              << " by more than " << fFracDiff << "." << endl;
01616         pass = false;
01617       }
01618     }
01619 
01620     if ( TMath::Abs(ugligxyz.Y()) > fFracDiff ) {
01621       if ( TMath::Abs((geogxyz.Y() - ugligxyz.Y())/ugligxyz.Y()) > fFracDiff ) {
01622         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01623              << " Geo LocalToGlobal Y "
01624              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01625              << " by more than " << fFracDiff*100. << "%." << endl;
01626         pass = false;
01627       }
01628     }
01629     else {
01630       if ( TMath::Abs(geogxyz.Y() - ugligxyz.Y()) > fFracDiff ) {
01631         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01632              << " Geo LocalToGlobal Y "
01633              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01634              << " by more than " << fFracDiff << "." << endl;
01635         pass = false;
01636       }
01637     }
01638 
01639     if ( TMath::Abs(ugligxyz.Z()) > fFracDiff ) {
01640       if ( TMath::Abs((geogxyz.Z() - ugligxyz.Z())/ugligxyz.Z()) > fFracDiff ) {
01641         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01642              << " Geo LocalToGlobal Z "
01643              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01644              << " by more than " << fFracDiff*100. << "%." << endl;
01645         pass = false;
01646       }
01647     }
01648     else {
01649       if ( TMath::Abs(geogxyz.Z() - ugligxyz.Z()) > fFracDiff ) {
01650         cout << "ScintMdl " << geomdl.GetPlexScintMdlId() 
01651              << " Geo LocalToGlobal Z "
01652              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01653              << " by more than " << fFracDiff << "." << endl;
01654         pass = false;
01655       }
01656     }
01657   }
01658   
01659   return pass;
01660 
01661 }

bool GeoValidate::TestScintMdl_NumberOfStrips ( UgliScintMdlHandle  geo,
UgliScintMdlHandle  ugli 
) [private]

Definition at line 1997 of file GeoValidate.cc.

References UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintMdlHandle::NumberOfStrips().

Referenced by TestScintMdl().

01998                                                                           {
01999   // Test UgliScintMdlHandle::NumberOfStrips()
02000 
02001   bool pass = true;
02002 
02003   Int_t geonumberofstrips = geomdl.NumberOfStrips();
02004   Int_t uglinumberofstrips = uglimdl.NumberOfStrips();
02005   
02006   if ( geonumberofstrips != uglinumberofstrips ) {
02007     cout << "ScintMdl " << geomdl.GetPlexScintMdlId() << " Geo NumberOfStrips "
02008          << geonumberofstrips << " differs from Ugli " << uglinumberofstrips
02009          << "." << endl;
02010     pass = false;
02011   }
02012     
02013   return pass;
02014 
02015 }

bool GeoValidate::TestScintPln ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 156 of file GeoValidate.cc.

References PlexPlaneId::AsString(), PlexPlaneId::GetPlane(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetScintPlnHandle(), UgliGeomHandle::GetScintPlnHandleVector(), TestScintPln_GetClosestStrip(), TestScintPln_GetScintMdlHandleVector(), TestScintPln_GetStripHandle(), TestScintPln_GetStripHandleVector(), TestScintPln_GetX0RelSteel(), TestScintPln_GetY0RelSteel(), TestScintPln_GetZRotRelSteelRad(), TestScintPln_GlobalToLocal(), TestScintPln_LocalToGlobal(), and TestScintPln_NumberOfStrips().

Referenced by RunAllTests().

00156                                                                      {
00157   // Test UgliScintPlnHandle methods
00158 
00159   bool pass = true;
00160   
00161   std::vector<UgliScintPlnHandle> geo_vec = geo.GetScintPlnHandleVector();
00162   std::vector<UgliScintPlnHandle>::iterator geo_iter;
00163   
00164   cout << "*** Running ScintPln Tests: ***" << endl;
00165   cout << "    TestScintPln_NumberOfStrips" << endl;
00166   cout << "    TestScintPln_GetStripHandle" << endl;
00167   cout << "    TestScintPln_GetStripHandleVector" << endl;
00168   cout << "    TestScintPln_GetScintMdlHandleVector" << endl;
00169   cout << "    TestScintPln_GetClosestStrip" << endl;
00170   cout << "    TestScintPln_GetX0RelSteel" << endl;
00171   cout << "    TestScintPln_GetY0RelSteel" << endl;
00172   cout << "    TestScintPln_GlobalToLocal" << endl;
00173   cout << "    TestScintPln_LocalToGlobal" << endl;
00174   cout << "    TestScintPln_GetZRotRelSteelRad" << endl;
00175   
00176   UgliScintPlnHandle geoplnbeg = *(geo_vec.begin());
00177   PlexPlaneId begplnid = geoplnbeg.GetPlexPlaneId();
00178   geo_iter = geo_vec.end(); geo_iter--;
00179   UgliScintPlnHandle geoplnend = *(geo_iter);
00180   PlexPlaneId endplnid = geoplnend.GetPlexPlaneId();
00181   Int_t nprintgap = ((endplnid.GetPlane() - begplnid.GetPlane())+1)/5;
00182 
00183   Int_t nplane = 0;
00184   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00185     nplane++;
00186     bool plnpass = true;
00187     UgliScintPlnHandle geopln = *geo_iter;
00188     PlexPlaneId plexplaneid = geopln.GetPlexPlaneId();
00189     UgliScintPlnHandle uglipln = ugli.GetScintPlnHandle(plexplaneid);
00190     
00191     plnpass &= TestScintPln_NumberOfStrips(geopln,uglipln);
00192     plnpass &= TestScintPln_GetStripHandle(geopln,uglipln);
00193     plnpass &= TestScintPln_GetStripHandleVector(geopln,uglipln);
00194     plnpass &= TestScintPln_GetScintMdlHandleVector(geopln,uglipln);
00195     plnpass &= TestScintPln_GetClosestStrip(geopln,uglipln);
00196     plnpass &= TestScintPln_GetX0RelSteel(geopln,uglipln);
00197     plnpass &= TestScintPln_GetY0RelSteel(geopln,uglipln);
00198     plnpass &= TestScintPln_GlobalToLocal(geopln,uglipln);
00199     plnpass &= TestScintPln_LocalToGlobal(geopln,uglipln);
00200     plnpass &= TestScintPln_GetZRotRelSteelRad(geopln,uglipln);
00201 
00202     if ( plnpass ) {
00203       if ( nplane % nprintgap == 0 ) {
00204         cout << plexplaneid.AsString() << " Passed... " << endl;
00205       }
00206     }
00207     else 
00208       cout << " ScintPln " << plexplaneid.AsString() << " FAILED." << endl;
00209     
00210     pass &= plnpass;
00211   }
00212 
00213   cout << "*** Finished All ScintPln Tests for " << begplnid.AsString()
00214        << " to " << endplnid.AsString() << "***" << endl;
00215   
00216   return pass;
00217 
00218 }

bool GeoValidate::TestScintPln_GetClosestStrip ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1400 of file GeoValidate.cc.

References UgliScintPlnHandle::GetClosestStrip(), UgliPlnHandle::GetPlexPlaneId(), UgliStripHandle::GetSEId(), and PlexPlaneId::IsVetoShield().

Referenced by TestScintPln().

01401                                                                            {
01402   // Test UgliScintPlnHandle::GetClosestStrip(Float_t tpos,
01403   //                                          Float_t orthCoord)
01404 
01405   bool pass = true;
01406 
01407   // veto shield planes not tested because method relies on StripNode::GetTPos
01408   // and Ugli version of this fails for shield planes
01409   if ( geopln.GetPlexPlaneId().IsVetoShield() ) return pass; // but not really
01410 
01411   // Test by tpos from -4 to 4 m regardless of detector type
01412   int ntpos = 11;
01413   Double_t mintpos = -4.;
01414   Double_t maxtpos = +4.;
01415   Double_t dtpos = (maxtpos - mintpos)/(ntpos-1);
01416   
01417   for ( int itpos = 0; itpos < ntpos; itpos++ ) {
01418     Double_t tpos = itpos*dtpos + mintpos;
01419     UgliStripHandle geostp  = geopln.GetClosestStrip(tpos);
01420     UgliStripHandle uglistp = uglipln.GetClosestStrip(tpos);
01421   
01422     if ( geostp.GetSEId() != uglistp.GetSEId() ) {
01423       cout << "ScintPln " << geopln.GetPlexPlaneId() << " Geo GetClosestStrip "
01424            << geostp.GetSEId() << " differs from Ugli " << uglistp.GetSEId()
01425            << " for tpos " << tpos << "." << endl;
01426       pass = false;
01427     }
01428   }
01429   
01430   return pass;
01431 
01432 }

bool GeoValidate::TestScintPln_GetScintMdlHandleVector ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1218 of file GeoValidate.cc.

References PlexScintMdlId::AsString(), UgliScintMdlHandle::GetPlexScintMdlId(), and UgliScintPlnHandle::GetScintMdlHandleVector().

Referenced by TestScintPln().

01219                                                                             {
01220   // Test UgliScintPlnHandle::GetScintMdlHandleVector()
01221 
01222   bool pass = true;
01223 
01224   std::vector<UgliScintMdlHandle> geo_vec = geopln.GetScintMdlHandleVector();
01225   std::vector<UgliScintMdlHandle> ugli_vec = uglipln.GetScintMdlHandleVector();
01226   
01227   if ( geo_vec.size() != ugli_vec.size() ) {
01228     cout << "ScintPln Geo GetScintMdlHandleVector size " 
01229          << geo_vec.size() << "differs from Ugli" << ugli_vec.size() << endl;
01230     pass = false;
01231   }
01232   
01233   
01234   std::vector<UgliScintMdlHandle>::iterator geo_iter;
01235   std::vector<UgliScintMdlHandle>::iterator ugli_iter = ugli_vec.begin();
01236 
01237   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
01238     UgliScintMdlHandle geomdlhandle = *geo_iter;
01239     PlexScintMdlId geoplexmdlid = geomdlhandle.GetPlexScintMdlId();
01240     PlexScintMdlId ugliplexmdlid;
01241     if ( ugli_iter != ugli_vec.end() ) {
01242       UgliScintMdlHandle uglimdlhandle = *ugli_iter;
01243       ugliplexmdlid = uglimdlhandle.GetPlexScintMdlId();
01244     }
01245     if ( geoplexmdlid != ugliplexmdlid ) {
01246       cout << "ScintPln Geo GetScintMdlHandleVector " 
01247            << geoplexmdlid.AsString() << " differs from Ugli " 
01248            << ugliplexmdlid.AsString() << endl;
01249       pass = false;
01250     }
01251     
01252     if ( ugli_iter != ugli_vec.end() ) ugli_iter++;
01253   }
01254   
01255   return pass;
01256 
01257 }

bool GeoValidate::TestScintPln_GetStripHandle ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1192 of file GeoValidate.cc.

References PlexStripEndId::AsString(), UgliStripHandle::GetSEId(), UgliScintPlnHandle::GetStripHandle(), and UgliScintPlnHandle::GetStripHandleVector().

Referenced by TestScintPln().

01193                                                                           {
01194   // Test UgliScintPlnHandle::GetStripHandle(PlexStripEndId seid)
01195 
01196   bool pass = true;
01197 
01198   std::vector<UgliStripHandle> ugli_vec = uglipln.GetStripHandleVector();
01199   std::vector<UgliStripHandle>::iterator ugli_iter = ugli_vec.begin();
01200 
01201   for ( ugli_iter=ugli_vec.begin();ugli_iter != ugli_vec.end();ugli_iter++ ) {
01202     UgliStripHandle uglistp = *ugli_iter;
01203     PlexStripEndId ugliplexseid = uglistp.GetSEId();
01204     PlexStripEndId geoplexseid 
01205                         = (geopln.GetStripHandle(ugliplexseid)).GetSEId();
01206     if ( geoplexseid != ugliplexseid ) {
01207       cout << "ScintPln Geo GetStripHandle " << geoplexseid.AsString()
01208            << " differs from Ugli " << ugliplexseid.AsString() << endl;
01209       pass = false;
01210     }
01211   }
01212   
01213   return pass;
01214 
01215 }

bool GeoValidate::TestScintPln_GetStripHandleVector ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1260 of file GeoValidate.cc.

References PlexStripEndId::AsString(), UgliStripHandle::GetSEId(), and UgliScintPlnHandle::GetStripHandleVector().

Referenced by TestScintPln().

01261                                                                             {
01262   // Test UgliScintPlnHandle::GetStripHandleVector()
01263 
01264   bool pass = true;
01265 
01266   std::vector<UgliStripHandle> geo_vec = geopln.GetStripHandleVector();
01267   std::vector<UgliStripHandle> ugli_vec = uglipln.GetStripHandleVector();
01268   
01269   if ( geo_vec.size() != ugli_vec.size() ) {
01270     cout << "ScintPln Geo GetStripHandleVector size " 
01271          << geo_vec.size() << "differs from Ugli" << ugli_vec.size() << endl;
01272     pass = false;
01273   }
01274   
01275   std::vector<UgliStripHandle>::iterator geo_iter;
01276   std::vector<UgliStripHandle>::iterator ugli_iter = ugli_vec.begin();
01277 
01278   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
01279     UgliStripHandle geostphandle = *geo_iter;
01280     PlexStripEndId geoseid = geostphandle.GetSEId();
01281     PlexStripEndId ugliseid;
01282     if ( ugli_iter != ugli_vec.end() ) {
01283       UgliStripHandle uglistphandle = *ugli_iter;
01284       ugliseid = uglistphandle.GetSEId();
01285     }
01286     if ( geoseid != ugliseid ) {
01287       cout << "ScintPln Geo GetStripHandleVector " << geoseid.AsString()
01288            << " differs from Ugli " << ugliseid.AsString() << endl;
01289       pass = false;
01290     }
01291     
01292     if ( ugli_iter != ugli_vec.end() ) ugli_iter++;
01293   }
01294   
01295   return pass;
01296 
01297 }

bool GeoValidate::TestScintPln_GetX0RelSteel ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1539 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliScintPlnHandle::GetX0RelSteel().

Referenced by TestScintPln().

01540                                                                          {
01541   // Test UgliScintPlnHandle::GetX0RelSteel()
01542 
01543   bool pass = true;
01544 
01545   Float_t geox0relsteel = geopln.GetX0RelSteel();
01546   Float_t uglix0relsteel = uglipln.GetX0RelSteel();
01547   
01548   if ( TMath::Abs(geox0relsteel - uglix0relsteel) > fFracDiff ) {
01549     cout << "ScintPln " << geopln.GetPlexPlaneId() << " Geo X0RelSteel "
01550          << geox0relsteel << " differs from Ugli " << uglix0relsteel
01551          << " by more than " << fFracDiff << "." << endl;
01552     pass = false;
01553   }
01554 
01555   return pass;
01556 
01557 }

bool GeoValidate::TestScintPln_GetY0RelSteel ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1560 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliScintPlnHandle::GetY0RelSteel().

Referenced by TestScintPln().

01561                                                                          {
01562   // Test UgliScintPlnHandle::GetY0RelSteel()
01563 
01564   bool pass = true;
01565 
01566   Float_t geoy0relsteel = geopln.GetY0RelSteel();
01567   Float_t ugliy0relsteel = uglipln.GetY0RelSteel();
01568   
01569   if ( TMath::Abs(geoy0relsteel - ugliy0relsteel) > fFracDiff ) {
01570     cout << "ScintPln " << geopln.GetPlexPlaneId() << " Geo Y0RelSteel "
01571          << geoy0relsteel << " differs from Ugli " << ugliy0relsteel
01572          << " by more than " << fFracDiff << "(rad)." << endl;
01573     pass = false;
01574   }
01575 
01576   return pass;
01577 
01578 }

bool GeoValidate::TestScintPln_GetZRotRelSteelRad ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1516 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliScintPlnHandle::GetZRotRelSteelRad().

Referenced by TestScintPln().

01517                                                                               {
01518   // Test UgliScintPlnHandle::GetZRotRelSteelRad()
01519 
01520   bool pass = true;
01521 
01522   Float_t geozrotrelsteelrad = geopln.GetZRotRelSteelRad();
01523   if ( geozrotrelsteelrad < 0. ) geozrotrelsteelrad += 2.*TMath::Pi();
01524   Float_t uglizrotrelsteelrad = uglipln.GetZRotRelSteelRad();
01525   if ( uglizrotrelsteelrad < 0. ) uglizrotrelsteelrad += 2.*TMath::Pi();
01526   
01527   if ( TMath::Abs(geozrotrelsteelrad - uglizrotrelsteelrad) > fFracDiff ) {
01528     cout << "ScintPln " << geopln.GetPlexPlaneId() << " Geo ZRotRelSteelRad "
01529          << geozrotrelsteelrad << " differs from Ugli " << uglizrotrelsteelrad
01530          << " by more than " << fFracDiff << "(rad)." << endl;
01531     pass = false;
01532   }
01533 
01534   return pass;
01535 
01536 }

bool GeoValidate::TestScintPln_GlobalToLocal ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1435 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), UgliScintPlnHandle::GlobalToLocal(), and UgliScintPlnHandle::LocalToGlobal().

Referenced by TestScintPln().

01436                                                                          {
01437   // Test UgliScintPlnHandle::GlobalToLocal()
01438 
01439   bool pass = true;
01440 
01441   const int ntestpt = 3;
01442   TVector3 lxyz[ntestpt];
01443   lxyz[0] = TVector3(0.,0.,0.);
01444   lxyz[1] = TVector3(1.,1.,1.);
01445   lxyz[2] = TVector3(-1.,-1.,-1.);
01446 
01447   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01448     TVector3 geogxyz  = geopln.LocalToGlobal(lxyz[ipt]);
01449 
01450     TVector3 geolxyz = geopln.GlobalToLocal(geogxyz);
01451     TVector3 uglilxyz = uglipln.GlobalToLocal(geogxyz);
01452   
01453     if ( TMath::Abs(uglilxyz.X()) > fFracDiff ) {
01454       if ( TMath::Abs((geolxyz.X() - uglilxyz.X())/uglilxyz.X()) > fFracDiff ) {
01455         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01456              << " Geo GlobalToLocal X "
01457              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01458              << " by more than " << fFracDiff*100. << "%." << endl;
01459         pass = false;
01460       }
01461     }
01462     else {
01463       if ( TMath::Abs(geolxyz.X() - uglilxyz.X()) > fFracDiff ) {
01464         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01465              << " Geo GlobalToLocal X "
01466              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01467              << " by more than " << fFracDiff << "." << endl;
01468         pass = false;
01469       }
01470     }
01471 
01472     if ( TMath::Abs(uglilxyz.Y()) > fFracDiff ) {
01473       if ( TMath::Abs((geolxyz.Y() - uglilxyz.Y())/uglilxyz.Y()) > fFracDiff ) {
01474         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01475              << " Geo GlobalToLocal Y "
01476              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01477              << " by more than " << fFracDiff*100. << "%." << endl;
01478         pass = false;
01479       }
01480     }
01481     else {
01482       if ( TMath::Abs(geolxyz.Y() - uglilxyz.Y()) > fFracDiff ) {
01483         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01484              << " Geo GlobalToLocal Y "
01485              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01486              << " by more than " << fFracDiff << "." << endl;
01487         pass = false;
01488       }
01489     }
01490 
01491     if ( TMath::Abs(uglilxyz.Z()) > fFracDiff ) {
01492       if ( TMath::Abs((geolxyz.Z() - uglilxyz.Z())/uglilxyz.Z()) > fFracDiff ) {
01493         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01494              << " Geo GlobalToLocal Z "
01495              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01496              << " by more than " << fFracDiff*100. << "%." << endl;
01497         pass = false;
01498       }
01499     }
01500     else {
01501       if ( TMath::Abs(geolxyz.Z() - uglilxyz.Z()) > fFracDiff ) {
01502         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01503              << " Geo GlobalToLocal Z "
01504              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01505              << " by more than " << fFracDiff << "." << endl;
01506         pass = false;
01507       }
01508     }
01509   }
01510   
01511   return pass;
01512 
01513 }

bool GeoValidate::TestScintPln_LocalToGlobal ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1321 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliScintPlnHandle::LocalToGlobal().

Referenced by TestScintPln().

01322                                                                          {
01323   // Test UgliScintPlnHandle::LocalToGlobal()
01324 
01325   bool pass = true;
01326 
01327   const int ntestpt = 3;
01328   TVector3 lxyz[ntestpt];
01329   lxyz[0] = TVector3(0.,0.,0.);
01330   lxyz[1] = TVector3(1.,1.,1.);
01331   lxyz[2] = TVector3(-1.,-1.,-1.);
01332 
01333   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01334     TVector3 geogxyz  = geopln.LocalToGlobal(lxyz[ipt]);
01335     TVector3 ugligxyz = uglipln.LocalToGlobal(lxyz[ipt]);
01336   
01337     if ( TMath::Abs(ugligxyz.X()) > fFracDiff ) {
01338       if ( TMath::Abs((geogxyz.X() - ugligxyz.X())/ugligxyz.X()) > fFracDiff ) {
01339         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01340              << " Geo LocalToGlobal X "
01341              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01342              << " by more than " << fFracDiff*100. << "%." << endl;
01343         pass = false;
01344       }
01345     }
01346     else {
01347       if ( TMath::Abs(geogxyz.X() - ugligxyz.X()) > fFracDiff ) {
01348         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01349              << " Geo LocalToGlobal X "
01350              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01351              << " by more than " << fFracDiff << "." << endl;
01352         pass = false;
01353       }
01354     }
01355 
01356     if ( TMath::Abs(ugligxyz.Y()) > fFracDiff ) {
01357       if ( TMath::Abs((geogxyz.Y() - ugligxyz.Y())/ugligxyz.Y()) > fFracDiff ) {
01358         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01359              << " Geo LocalToGlobal Y "
01360              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01361              << " by more than " << fFracDiff*100. << "%." << endl;
01362         pass = false;
01363       }
01364     }
01365     else {
01366       if ( TMath::Abs(geogxyz.Y() - ugligxyz.Y()) > fFracDiff ) {
01367         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01368              << " Geo LocalToGlobal Y "
01369              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01370              << " by more than " << fFracDiff << "." << endl;
01371         pass = false;
01372       }
01373     }
01374 
01375     if ( TMath::Abs(ugligxyz.Z()) > fFracDiff ) {
01376       if ( TMath::Abs((geogxyz.Z() - ugligxyz.Z())/ugligxyz.Z()) > fFracDiff ) {
01377         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01378              << " Geo LocalToGlobal Z "
01379              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01380              << " by more than " << fFracDiff*100. << "%." << endl;
01381         pass = false;
01382       }
01383     }
01384     else {
01385       if ( TMath::Abs(geogxyz.Z() - ugligxyz.Z()) > fFracDiff ) {
01386         cout << "ScintPln " << geopln.GetPlexPlaneId() 
01387              << " Geo LocalToGlobal Z "
01388              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01389              << " by more than " << fFracDiff << "." << endl;
01390         pass = false;
01391       }
01392     }
01393   }
01394   
01395   return pass;
01396 
01397 }

bool GeoValidate::TestScintPln_NumberOfStrips ( UgliScintPlnHandle  geo,
UgliScintPlnHandle  ugli 
) [private]

Definition at line 1300 of file GeoValidate.cc.

References UgliScintPlnHandle::NumberOfStrips().

Referenced by TestScintPln().

01301                                                                           {
01302   // Test UgliScintPlnHandle::NumberOfStrips()
01303 
01304   bool pass = true;
01305 
01306   Int_t geonumberofstrips = geopln.NumberOfStrips();
01307   Int_t uglinumberofstrips = uglipln.NumberOfStrips();
01308   
01309   if ( geonumberofstrips != uglinumberofstrips ) {
01310     cout << "ScintPln " << geopln.NumberOfStrips() << " Geo NumberOfStrips "
01311          << geonumberofstrips << " differs from Ugli " << uglinumberofstrips
01312          << "." << endl;
01313     pass = false;
01314   }
01315 
01316   return pass;
01317 
01318 }

bool GeoValidate::TestSteelPln ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 96 of file GeoValidate.cc.

References PlexPlaneId::AsString(), PlexPlaneId::GetPlane(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetSteelPlnHandle(), UgliGeomHandle::GetSteelPlnHandleVector(), TestSteelPln_GetCenter(), TestSteelPln_GetHalfThickness(), TestSteelPln_GetX0(), TestSteelPln_GetY0(), TestSteelPln_GetZ0(), TestSteelPln_GlobalToLocal(), and TestSteelPln_LocalToGlobal().

Referenced by RunAllTests().

00096                                                                      {
00097   // Test UgliSteelPlnHandle methods
00098 
00099   bool pass = true;
00100   
00101   std::vector<UgliSteelPlnHandle> geo_vec = geo.GetSteelPlnHandleVector();
00102   std::vector<UgliSteelPlnHandle>::iterator geo_iter;
00103   
00104   cout << "*** Running SteelPln Tests: ***" << endl;
00105   cout << "    TestSteelPln_GetHalfThickness" << endl;
00106   cout << "    TestSteelPln_GetCenter" << endl;
00107   cout << "    TestSteelPln_GetX0" << endl;
00108   cout << "    TestSteelPln_GetY0" << endl;
00109   cout << "    TestSteelPln_GetZ0" << endl;
00110   cout << "    TestSteelPln_LocalToGlobal" << endl;
00111   cout << "    TestSteelPln_GlobalToLocal" << endl;
00112   
00113   UgliSteelPlnHandle geoplnbeg = *(geo_vec.begin());
00114   PlexPlaneId begplnid = geoplnbeg.GetPlexPlaneId();
00115   geo_iter = geo_vec.end(); geo_iter--;
00116   UgliSteelPlnHandle geoplnend = *(geo_iter);
00117   PlexPlaneId endplnid = geoplnend.GetPlexPlaneId();
00118   Int_t nprintgap = ((endplnid.GetPlane() - begplnid.GetPlane())+1)/5;
00119   
00120   Int_t nplane = 0;
00121   for ( geo_iter = geo_vec.begin(); geo_iter != geo_vec.end(); geo_iter++ ) {
00122     nplane++;
00123     bool plnpass = true;
00124      UgliSteelPlnHandle geoplnhandle = *geo_iter;
00125     PlexPlaneId plexplaneid = geoplnhandle.GetPlexPlaneId();
00126     UgliSteelPlnHandle ugliplnhandle = ugli.GetSteelPlnHandle(plexplaneid);
00127     
00128     plnpass &= TestSteelPln_GetHalfThickness(geoplnhandle,ugliplnhandle);
00129     plnpass &= TestSteelPln_GetCenter(geoplnhandle,ugliplnhandle);
00130     plnpass &= TestSteelPln_GetX0(geoplnhandle,ugliplnhandle);
00131     plnpass &= TestSteelPln_GetY0(geoplnhandle,ugliplnhandle);
00132     plnpass &= TestSteelPln_GetZ0(geoplnhandle,ugliplnhandle);
00133     plnpass &= TestSteelPln_LocalToGlobal(geoplnhandle,ugliplnhandle);
00134     plnpass &= TestSteelPln_GlobalToLocal(geoplnhandle,ugliplnhandle);
00135 
00136 
00137     if ( plnpass ) {
00138       if ( nplane % nprintgap == 0 ) {
00139         cout << plexplaneid.AsString() << " Passed... " << endl;
00140       }
00141     }
00142     else 
00143       cout << " SteelPln " << plexplaneid.AsString() << " FAILED." << endl;
00144     
00145     pass &= plnpass;
00146   }
00147   
00148   cout << "*** Finished All SteelPln Tests for " << begplnid.AsString()
00149        << " to " << endplnid.AsString() << "***" << endl;
00150   
00151   return pass;
00152 
00153 }

bool GeoValidate::TestSteelPln_GetCenter ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 995 of file GeoValidate.cc.

References fFracDiff, UgliSteelPlnHandle::GetCenter(), and UgliPlnHandle::GetPlexPlaneId().

Referenced by TestSteelPln().

00996                                                                      {
00997   // Test UgliSteelPlnHandle::GetCenter()
00998 
00999   bool pass = true;
01000 
01001   TVector3 geoxyz0 = geopln.GetCenter();
01002   TVector3 uglixyz0 = uglipln.GetCenter();
01003   
01004   for ( int ic = 0; ic < 3; ic++ ) {
01005     if ( TMath::Abs(uglixyz0[ic]) > fFracDiff ) {
01006       if ( TMath::Abs((geoxyz0[ic] - uglixyz0[ic])/uglixyz0[ic]) > fFracDiff ) {
01007         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01008              << " Geo GetCenter for ic " << ic << " is " 
01009              << geoxyz0[ic] << " differs from Ugli " << uglixyz0[ic]
01010              << " by more than " << fFracDiff*100. << "%." << endl;
01011         pass = false;
01012       }
01013     }
01014     else {
01015       if ( TMath::Abs(geoxyz0[ic]-uglixyz0[ic]) > fFracDiff ) {
01016         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01017              << " Geo GetCenter for ic " << ic << " is "
01018              << geoxyz0[ic] << " differs from Ugli " << uglixyz0[ic]
01019              << " by more than " << fFracDiff << "." << endl;
01020         pass = false;
01021       }
01022     }
01023   }
01024 
01025   return pass;
01026 
01027 }

bool GeoValidate::TestSteelPln_GetHalfThickness ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 878 of file GeoValidate.cc.

References fFracDiff, UgliSteelPlnHandle::GetHalfThickness(), and UgliPlnHandle::GetPlexPlaneId().

Referenced by TestSteelPln().

00879                                                                             {
00880   // Test UgliSteelPlnHandle::GetHalfThickness()
00881 
00882   bool pass = true;
00883 
00884   Float_t geohalfthick = geopln.GetHalfThickness();
00885   Float_t uglihalfthick = uglipln.GetHalfThickness();
00886   
00887   if ( TMath::Abs((geohalfthick - uglihalfthick)/uglihalfthick) > fFracDiff ) {
00888     cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo HalfThickness "
00889          << geohalfthick << " differs from Ugli " << uglihalfthick
00890          << " by more than " << fFracDiff*100. << "%." << endl;
00891     pass = false;
00892   }
00893 
00894   return pass;
00895 
00896 }

bool GeoValidate::TestSteelPln_GetX0 ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 899 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliSteelPlnHandle::GetX0().

Referenced by TestSteelPln().

00900                                                                  {
00901   // Test UgliSteelPlnHandle::GetX0()
00902 
00903   bool pass = true;
00904 
00905   Float_t geox0 = geopln.GetX0();
00906   Float_t uglix0 = uglipln.GetX0();
00907   
00908   if ( TMath::Abs(uglix0) > fFracDiff ) {
00909     if ( TMath::Abs((geox0 - uglix0)/uglix0) > fFracDiff ) {
00910       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetX0 "
00911            << geox0 << " differs from Ugli " << uglix0
00912            << " by more than " << fFracDiff*100. << "%." << endl;
00913       pass = false;
00914     }
00915   }
00916   else {
00917     if ( TMath::Abs(geox0-uglix0) > fFracDiff ) {
00918       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetX0 "
00919            << geox0 << " differs from Ugli " << uglix0
00920            << " by more than " << fFracDiff << "." << endl;
00921       pass = false;
00922     }
00923   }
00924   
00925 
00926   return pass;
00927 
00928 }

bool GeoValidate::TestSteelPln_GetY0 ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 931 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliSteelPlnHandle::GetY0().

Referenced by TestSteelPln().

00932                                                                  {
00933   // Test UgliSteelPlnHandle::GetY0()
00934 
00935   bool pass = true;
00936 
00937   Float_t geoy0 = geopln.GetY0();
00938   Float_t ugliy0 = uglipln.GetY0();
00939   
00940   if ( TMath::Abs(ugliy0) > fFracDiff ) {
00941     if ( TMath::Abs((geoy0 - ugliy0)/ugliy0) > fFracDiff ) {
00942       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetY0 "
00943            << geoy0 << " differs from Ugli " << ugliy0
00944            << " by more than " << fFracDiff*100. << "%." << endl;
00945       pass = false;
00946     }
00947   }
00948   else {
00949     if ( TMath::Abs(geoy0-ugliy0) > fFracDiff ) {
00950       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetY0 "
00951            << geoy0 << " differs from Ugli " << ugliy0
00952            << " by more than " << fFracDiff << "." << endl;
00953       pass = false;
00954     }
00955   }
00956   
00957 
00958   return pass;
00959 
00960 }

bool GeoValidate::TestSteelPln_GetZ0 ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 963 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliSteelPlnHandle::GetZ0().

Referenced by TestSteelPln().

00964                                                                  {
00965   // Test UgliSteelPlnHandle::GetZ0()
00966 
00967   bool pass = true;
00968 
00969   Float_t geoz0 = geopln.GetZ0();
00970   Float_t ugliz0 = uglipln.GetZ0();
00971   
00972   if ( TMath::Abs(ugliz0) > fFracDiff ) {
00973     if ( TMath::Abs((geoz0 - ugliz0)/ugliz0) > fFracDiff ) {
00974       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetZ0 "
00975            << geoz0 << " differs from Ugli " << ugliz0
00976            << " by more than " << fFracDiff*100. << "%." << endl;
00977       pass = false;
00978     }
00979   }
00980   else {
00981     if ( TMath::Abs(geoz0-ugliz0) > fFracDiff ) {
00982       cout << "SteelPln " << geopln.GetPlexPlaneId() << " Geo GetZ0 "
00983            << geoz0 << " differs from Ugli " << ugliz0
00984            << " by more than " << fFracDiff << "." << endl;
00985       pass = false;
00986     }
00987   }
00988   
00989 
00990   return pass;
00991 
00992 }

bool GeoValidate::TestSteelPln_GlobalToLocal ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 1109 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), UgliSteelPlnHandle::GlobalToLocal(), and UgliSteelPlnHandle::LocalToGlobal().

Referenced by TestSteelPln().

01110                                                                          {
01111   // Test UgliSteelPlnHandle::GlobalToLocal()
01112 
01113   bool pass = true;
01114 
01115   const int ntestpt = 3;
01116   TVector3 lxyz[ntestpt];
01117   lxyz[0] = TVector3(0.,0.,0.);
01118   lxyz[1] = TVector3(1.,1.,1.);
01119   lxyz[2] = TVector3(-1.,-1.,-1.);
01120 
01121   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01122     TVector3 geogxyz  = geopln.LocalToGlobal(lxyz[ipt]);
01123 
01124     TVector3 geolxyz = geopln.GlobalToLocal(geogxyz);
01125     TVector3 uglilxyz = uglipln.GlobalToLocal(geogxyz);
01126   
01127     if ( TMath::Abs(uglilxyz.X()) > fFracDiff ) {
01128       if ( TMath::Abs((geolxyz.X() - uglilxyz.X())/uglilxyz.X()) > fFracDiff ) {
01129         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01130              << " Geo GlobalToLocal X "
01131              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01132              << " by more than " << fFracDiff*100. << "%." << endl;
01133         pass = false;
01134       }
01135     }
01136     else {
01137       if ( TMath::Abs(geolxyz.X() - uglilxyz.X()) > fFracDiff ) {
01138         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01139              << " Geo GlobalToLocal X "
01140              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
01141              << " by more than " << fFracDiff << "." << endl;
01142         pass = false;
01143       }
01144     }
01145 
01146     if ( TMath::Abs(uglilxyz.Y()) > fFracDiff ) {
01147       if ( TMath::Abs((geolxyz.Y() - uglilxyz.Y())/uglilxyz.Y()) > fFracDiff ) {
01148         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01149              << " Geo GlobalToLocal Y "
01150              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01151              << " by more than " << fFracDiff*100. << "%." << endl;
01152         pass = false;
01153       }
01154     }
01155     else {
01156       if ( TMath::Abs(geolxyz.Y() - uglilxyz.Y()) > fFracDiff ) {
01157         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01158              << " Geo GlobalToLocal Y "
01159              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
01160              << " by more than " << fFracDiff << "." << endl;
01161         pass = false;
01162       }
01163     }
01164 
01165     if ( TMath::Abs(uglilxyz.Z()) > fFracDiff ) {
01166       if ( TMath::Abs((geolxyz.Z() - uglilxyz.Z())/uglilxyz.Z()) > fFracDiff ) {
01167         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01168              << " Geo GlobalToLocal Z "
01169              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01170              << " by more than " << fFracDiff*100. << "%." << endl;
01171         pass = false;
01172       }
01173     }
01174     else {
01175       if ( TMath::Abs(geolxyz.Z() - uglilxyz.Z()) > fFracDiff ) {
01176         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01177              << " Geo GlobalToLocal Z "
01178              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
01179              << " by more than " << fFracDiff << "." << endl;
01180         pass = false;
01181       }
01182     }
01183   }
01184   
01185   return pass;
01186 
01187 }

bool GeoValidate::TestSteelPln_LocalToGlobal ( UgliSteelPlnHandle  geo,
UgliSteelPlnHandle  ugli 
) [private]

Definition at line 1030 of file GeoValidate.cc.

References fFracDiff, UgliPlnHandle::GetPlexPlaneId(), and UgliSteelPlnHandle::LocalToGlobal().

Referenced by TestSteelPln().

01031                                                                          {
01032   // Test UgliSteelPlnHandle::LocalToGlobal()
01033 
01034   bool pass = true;
01035 
01036   const int ntestpt = 3;
01037   TVector3 lxyz[ntestpt];
01038   lxyz[0] = TVector3(0.,0.,0.);
01039   lxyz[1] = TVector3(1.,1.,1.);
01040   lxyz[2] = TVector3(-1.,-1.,-1.);
01041 
01042   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
01043     TVector3 geogxyz  = geopln.LocalToGlobal(lxyz[ipt]);
01044     TVector3 ugligxyz = uglipln.LocalToGlobal(lxyz[ipt]);
01045   
01046     if ( TMath::Abs(ugligxyz.X()) > fFracDiff ) {
01047       if ( TMath::Abs((geogxyz.X() - ugligxyz.X())/ugligxyz.X()) > fFracDiff ) {
01048         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01049              << " Geo LocalToGlobal X "
01050              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01051              << " by more than " << fFracDiff*100. << "%." << endl;
01052         pass = false;
01053       }
01054     }
01055     else {
01056       if ( TMath::Abs(geogxyz.X() - ugligxyz.X()) > fFracDiff ) {
01057         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01058              << " Geo LocalToGlobal X "
01059              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
01060              << " by more than " << fFracDiff << "." << endl;
01061         pass = false;
01062       }
01063     }
01064 
01065     if ( TMath::Abs(ugligxyz.Y()) > fFracDiff ) {
01066       if ( TMath::Abs((geogxyz.Y() - ugligxyz.Y())/ugligxyz.Y()) > fFracDiff ) {
01067         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01068              << " Geo LocalToGlobal Y "
01069              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01070              << " by more than " << fFracDiff*100. << "%." << endl;
01071         pass = false;
01072       }
01073     }
01074     else {
01075       if ( TMath::Abs(geogxyz.Y() - ugligxyz.Y()) > fFracDiff ) {
01076         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01077              << " Geo LocalToGlobal Y "
01078              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
01079              << " by more than " << fFracDiff << "." << endl;
01080         pass = false;
01081       }
01082     }
01083 
01084     if ( TMath::Abs(ugligxyz.Z()) > fFracDiff ) {
01085       if ( TMath::Abs((geogxyz.Z() - ugligxyz.Z())/ugligxyz.Z()) > fFracDiff ) {
01086         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01087              << " Geo LocalToGlobal Z "
01088              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01089              << " by more than " << fFracDiff*100. << "%." << endl;
01090         pass = false;
01091       }
01092     }
01093     else {
01094       if ( TMath::Abs(geogxyz.Z() - ugligxyz.Z()) > fFracDiff ) {
01095         cout << "SteelPln " << geopln.GetPlexPlaneId() 
01096              << " Geo LocalToGlobal Z "
01097              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
01098              << " by more than " << fFracDiff << "." << endl;
01099         pass = false;
01100       }
01101     }
01102   }
01103   
01104   return pass;
01105 
01106 }

bool GeoValidate::TestStrip ( UgliGeomHandle  geo,
UgliGeomHandle  ugli 
) [private]

Definition at line 309 of file GeoValidate.cc.

References bfld::AsString(), PlexPlaneId::AsString(), PlexStripEndId::AsString(), fVldContext, PlexPlaneId::GetPlane(), UgliPlnHandle::GetPlexPlaneId(), UgliGeomHandle::GetScintPlnHandle(), UgliGeomHandle::GetScintPlnHandleVector(), UgliStripHandle::GetSEId(), UgliScintPlnHandle::GetStripHandle(), UgliScintPlnHandle::GetStripHandleVector(), TestStrip_ClearFiber(), TestStrip_DistanceAlong(), TestStrip_GetHalfLength(), TestStrip_GetHalfThickness(), TestStrip_GetHalfWidth(), TestStrip_GetLPosRelMdl(), TestStrip_GetScintMdlHandle(), TestStrip_GetScintPlnHandle(), TestStrip_GetSEId(), TestStrip_GetTPos(), TestStrip_GetTPosRelMdl(), TestStrip_GetZRotRelMdlRad(), TestStrip_GlobalPos(), TestStrip_GlobalToLocal(), TestStrip_Intersection(), TestStrip_IsMirrored(), TestStrip_LocalToGlobal(), TestStrip_PartialLength(), TestStrip_WlsBypass(), and TestStrip_WlsPigtail().

Referenced by RunAllTests().

00309                                                                   {
00310   // Test UgliStripHandle methods
00311 
00312   bool pass = true;
00313   
00314   std::vector<UgliScintPlnHandle> pln_vec = geo.GetScintPlnHandleVector();
00315   std::vector<UgliScintPlnHandle>::iterator pln_iter;
00316   
00317   cout << "*** Running Strip Tests: ***" << endl;
00318   cout << "    TestStrip_GetSEId" << endl;
00319   cout << "    TestStrip_GetHalfLength" << endl;
00320   cout << "    TestStrip_GetHalfThickness" << endl;
00321   cout << "    TestStrip_GetHalfWidth" << endl;
00322   cout << "    TestStrip_GetTPos" << endl;
00323   cout << "    TestStrip_PartialLength" << endl;
00324   cout << "    TestStrip_IsMirrored" << endl;
00325   cout << "    TestStrip_WlsPigtail" << endl;
00326   cout << "    TestStrip_WlsBypass" << endl;
00327   cout << "    TestStrip_ClearFiber" << endl;
00328   cout << "    TestStrip_GlobalPos" << endl;
00329   cout << "    TestStrip_GlobalToLocal" << endl;
00330   cout << "    TestStrip_LocalToGlobal" << endl;
00331   cout << "    TestStrip_DistanceAlong" << endl;
00332   cout << "    TestStrip_Intersection" << endl;
00333   cout << "    TestStrip_GetScintMdlHandle" << endl;
00334   cout << "    TestStrip_GetScintPlnHandle" << endl;
00335   cout << "    TestStrip_GetZRotRelMdlRad" << endl;
00336   cout << "    TestStrip_GetLPosRelMdl" << endl;
00337   cout << "    TestStrip_GetTPosRelMdl" << endl;
00338   
00339   UgliScintPlnHandle geoplnbeg = *(pln_vec.begin());
00340   PlexPlaneId begplnid = geoplnbeg.GetPlexPlaneId();
00341   pln_iter = pln_vec.end(); pln_iter--;
00342   UgliScintPlnHandle geoplnend = *(pln_iter);
00343   PlexPlaneId endplnid = geoplnend.GetPlexPlaneId();
00344   Int_t nprintgap = ((endplnid.GetPlane()-begplnid.GetPlane())+1)/5;
00345 
00346   Int_t nplane = -1;
00347   Int_t nfailPartialLength = 0;
00348   for ( pln_iter = pln_vec.begin(); pln_iter != pln_vec.end(); pln_iter++ ) {
00349     nplane++;
00350     bool plnpass = true;
00351     UgliScintPlnHandle geopln = *pln_iter;
00352     PlexPlaneId plexplaneid = geopln.GetPlexPlaneId();
00353     UgliScintPlnHandle uglipln = ugli.GetScintPlnHandle(plexplaneid);
00354     
00355     std::vector<UgliStripHandle> stp_vec = geopln.GetStripHandleVector();
00356     std::vector<UgliStripHandle>::iterator stp_iter;
00357     
00358     for ( stp_iter = stp_vec.begin(); stp_iter != stp_vec.end(); stp_iter++ ) {
00359       bool stppass = true;
00360       UgliStripHandle geostp = *stp_iter;
00361       PlexStripEndId plexseid = geostp.GetSEId();
00362       UgliStripHandle uglistp = uglipln.GetStripHandle(plexseid);
00363 
00364       stppass &= TestStrip_GetSEId(geostp,uglistp);
00365       stppass &= TestStrip_GetHalfLength(geostp,uglistp);
00366       stppass &= TestStrip_GetHalfThickness(geostp,uglistp);
00367       stppass &= TestStrip_GetHalfWidth(geostp,uglistp);
00368       stppass &= TestStrip_GetTPos(geostp,uglistp);
00369       if (nfailPartialLength < 10 && !TestStrip_PartialLength(geostp,uglistp)){
00370         stppass = false;
00371         nfailPartialLength++;
00372         if ( nfailPartialLength == 10 ) {
00373           cout << "*** TestStrip_PartialLength had 10 failures for Vld "
00374                << fVldContext -> AsString() 
00375                << ". No further strips will be tested. ***" << endl;
00376         }
00377       }
00378       stppass &= TestStrip_IsMirrored(geostp,uglistp);
00379       stppass &= TestStrip_WlsPigtail(geostp,uglistp);
00380       stppass &= TestStrip_WlsBypass(geostp,uglistp);
00381       stppass &= TestStrip_ClearFiber(geostp,uglistp);
00382       stppass &= TestStrip_GlobalPos(geostp,uglistp);
00383       stppass &= TestStrip_GlobalToLocal(geostp,uglistp);
00384       stppass &= TestStrip_LocalToGlobal(geostp,uglistp);
00385       stppass &= TestStrip_DistanceAlong(geostp,uglistp);
00386       stppass &= TestStrip_Intersection(geostp,uglistp);
00387       stppass &= TestStrip_GetScintMdlHandle(geostp,uglistp);
00388       stppass &= TestStrip_GetScintPlnHandle(geostp,uglistp);
00389       stppass &= TestStrip_GetZRotRelMdlRad(geostp,uglistp);
00390       stppass &= TestStrip_GetLPosRelMdl(geostp,uglistp);
00391       stppass &= TestStrip_GetTPosRelMdl(geostp,uglistp);
00392 
00393       if ( !stppass )
00394         cout << "*** Strip " << plexseid.AsString() << " FAILED. ***" << endl;
00395     
00396       plnpass &= stppass;
00397  
00398     }
00399     
00400     if ( plnpass ) {
00401       if ( nplane % nprintgap == 0 ) {
00402         cout << plexplaneid.AsString() << " Passed... " << endl;
00403       }
00404     }
00405 
00406     pass &= plnpass;
00407   }
00408   
00409   cout << "*** Finished All Strip Tests for " << begplnid.AsString()
00410        << " to " << endplnid.AsString() << "***" << endl;
00411 
00412   return pass;
00413 
00414 }

bool GeoValidate::TestStrip_ClearFiber ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2798 of file GeoValidate.cc.

References bfld::AsString(), UgliStripHandle::ClearFiber(), fFracDiff, UgliStripHandle::GetSEId(), StripEnd::kEast, and StripEnd::kWest.

Referenced by TestStrip().

02799                                                                 {
02800   // Test UgliStripHandle::ClearFiber(const StripEnd::StripEnd_t end)
02801 
02802   bool pass = true;
02803 
02804   // Test by strip end 
02805   StripEnd::StripEnd_t stripend[3] = {StripEnd::kEast,
02806                                       StripEnd::kWest};
02807   
02808   for ( int iend = 0; iend < 2; iend++ ) {
02809     Float_t geoclearfiber  = geostp.ClearFiber(stripend[iend]);
02810     Float_t ugliclearfiber = uglistp.ClearFiber(stripend[iend]);
02811   
02812     if ( TMath::Abs((geoclearfiber - ugliclearfiber)/ugliclearfiber) 
02813                                                                 > fFracDiff ) {
02814       cout << "Strip " << geostp.GetSEId() << " Geo ClearFiber "
02815            << geoclearfiber << " differs from Ugli " << ugliclearfiber
02816            << " by more than " << fFracDiff*100. << "% for strip end " 
02817            << StripEnd::AsString(stripend[iend]) << endl;
02818       pass = false;
02819     }
02820   }
02821     
02822   return pass;
02823 
02824 }

bool GeoValidate::TestStrip_DistanceAlong ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2548 of file GeoValidate.cc.

References UgliStripHandle::DistanceAlong(), fFracDiff, fVldContext, PlexPlaneId::GetDetector(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneView(), UgliStripHandle::GetSEId(), UgliGeomHandle::GetStripHandle(), UgliLoanPool::Instance(), UgliStripHandle::IsValid(), PlexPlaneId::IsVetoShield(), Detector::kCalDet, Detector::kFar, Detector::kNear, PlaneView::kU, StripEnd::kUnknown, PlaneView::kV, StripEnd::kWhole, and UgliLoanPool::SetUseGeo().

Referenced by TestStrip().

02549                                                                    {
02550   // Test UgliStripHandle::DistanceAlong(const PlexStripEndId& orthogonalStrip)
02551 
02552   bool pass = true;
02553 
02554   if ( geostp.GetSEId().IsVetoShield() ) return pass; // no orthogonal strip
02555   
02556   // Pick 3 orthogonal strips
02557   Detector::Detector_t dettype = geostp.GetSEId().GetDetector();
02558   UInt_t plane = geostp.GetSEId().GetPlane();
02559   StripEnd::StripEnd_t end = StripEnd::kUnknown;
02560   StripEnd::StripEnd_t subpart = StripEnd::kWhole;
02561   PlaneView::PlaneView_t view = geostp.GetSEId().GetPlaneView();
02562   
02563   UgliLoanPool::Instance()->SetUseGeo(true);
02564   UgliGeomHandle geo(*fVldContext);
02565 
02566   if ( view == PlaneView::kU ) view = PlaneView::kV;
02567   else view = PlaneView::kU;
02568 
02569   UInt_t strip0 = 0;
02570   if ( dettype == Detector::kFar ) {
02571     if ( plane < 248 || (plane > 248 && plane < 300) ) plane += 1;
02572     else plane -= 1; // switched in latter part of detector
02573     strip0 = 95;
02574   }
02575   else if ( dettype == Detector::kNear ) {
02576     if ( plane < 140 ) plane += 1;
02577     else plane -= 1;
02578     strip0 = 45;
02579   }
02580   else if ( dettype == Detector::kCalDet ) {
02581     if ( plane < 60 ) plane += 1;
02582     else plane -= 1;
02583     strip0 = 12;
02584   }
02585   
02586   PlexStripEndId seid[3] 
02587              = {PlexStripEndId(dettype,plane,strip0-10,end,subpart,view),
02588                 PlexStripEndId(dettype,plane,strip0,end,subpart,view),
02589                 PlexStripEndId(dettype,plane,strip0+10,end,subpart,view)};
02590   
02591   for ( int istp = 0; istp < 3; istp++ ) {
02592 
02593     UgliStripHandle orthstp = geo.GetStripHandle(seid[istp]);
02594     if ( !orthstp.IsValid() ) continue;
02595     
02596     Float_t geodist  = geostp.DistanceAlong(seid[istp]);
02597     Float_t uglidist = uglistp.DistanceAlong(seid[istp]);
02598   
02599     if ( TMath::Abs(uglidist) > 1.E-2 ) {
02600       if ( TMath::Abs((geodist - uglidist)/uglidist) > fFracDiff ) {
02601         cout << "Strip " << geostp.GetSEId() << " Geo DistanceAlong "
02602              << geodist << " differs from Ugli " << uglidist
02603              << " by more than " << fFracDiff*100. << "% for orth seid " 
02604              << seid[istp] << "." << endl;
02605         pass = false;
02606       }
02607     }
02608     else {
02609       if ( TMath::Abs(geodist-uglidist) > fFracDiff ) {
02610         cout << "Strip " << geostp.GetSEId() << " Geo DistanceAlong "
02611              << geodist << " differs from Ugli " << uglidist
02612              << " by " << fFracDiff << "(m)" << " for orth seid " 
02613              << seid[istp] << endl;
02614         pass = false;
02615       }
02616     }
02617   }
02618     
02619   return pass;
02620 
02621 }

bool GeoValidate::TestStrip_GetHalfLength ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2244 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetHalfLength(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02245                                                                    {
02246   // Test UgliStripHandle::GetHalfLength()
02247 
02248   bool pass = true;
02249 
02250   Float_t geohalflength = geostp.GetHalfLength();
02251   Float_t uglihalflength = uglistp.GetHalfLength();
02252   
02253   if ( TMath::Abs((geohalflength-uglihalflength)/uglihalflength) > fFracDiff ) {
02254     cout << "Strip " << geostp.GetSEId() << " Geo HalfLength "
02255          << geohalflength << " differs from Ugli " << uglihalflength
02256          << " by more than " << fFracDiff*100. << "%" << endl;
02257     pass = false;
02258   }
02259     
02260   return pass;
02261 
02262 }

bool GeoValidate::TestStrip_GetHalfThickness ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2265 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetHalfThickness(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02266                                                                       {
02267   // Test UgliStripHandle::GetThickness()
02268 
02269   bool pass = true;
02270 
02271   Float_t geohalfthick = geostp.GetHalfThickness();
02272   Float_t uglihalfthick = uglistp.GetHalfThickness();
02273   
02274   if ( TMath::Abs((geohalfthick-uglihalfthick)/uglihalfthick) > fFracDiff ) {
02275     cout << "Strip " << geostp.GetSEId() << " Geo HalfThickness "
02276          << geohalfthick << " differs from Ugli " << uglihalfthick
02277          << " by more than " << fFracDiff*100. << "%" << endl;
02278     pass = false;
02279   }
02280 
02281   return pass;
02282 
02283 }

bool GeoValidate::TestStrip_GetHalfWidth ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2286 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetHalfWidth(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02287                                                                   {
02288   // Test UgliStripHandle::GetWidth()
02289 
02290   bool pass = true;
02291 
02292   Float_t geohalfwidth = geostp.GetHalfWidth();
02293   Float_t uglihalfwidth = uglistp.GetHalfWidth();
02294   
02295   if ( TMath::Abs((geohalfwidth - uglihalfwidth)/uglihalfwidth) > fFracDiff ) {
02296     cout << "Strip " << geostp.GetSEId() << " Geo HalfWidth "
02297          << geohalfwidth << " differs from Ugli " << uglihalfwidth
02298          << " by more than " << fFracDiff*100. << "%" << endl;
02299     pass = false;
02300   }
02301 
02302   return pass;
02303 
02304 }

bool GeoValidate::TestStrip_GetLPosRelMdl ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2350 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetLPosRelMdl(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02351                                                                    {
02352   // Test UgliStripHandle::GetLPosRelMdl()
02353 
02354   bool pass = true;
02355 
02356   Float_t geolposrelmdl    = geostp.GetLPosRelMdl();
02357   Float_t uglilposrelmdl    = uglistp.GetLPosRelMdl();
02358   
02359   if ( TMath::Abs(geolposrelmdl - uglilposrelmdl) > fFracDiff ) {
02360     cout << "Strip " << geostp.GetSEId() << " Geo LPosRelMdl "
02361          << geolposrelmdl << " differs from Ugli " << uglilposrelmdl
02362          << " by more than " << fFracDiff << "(m)." << endl;
02363     pass = false;
02364   }
02365 
02366   return pass;
02367 
02368 }

bool GeoValidate::TestStrip_GetScintMdlHandle ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2201 of file GeoValidate.cc.

References UgliScintMdlHandle::GetPlexScintMdlId(), UgliStripHandle::GetScintMdlHandle(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02202                                                                        {
02203   // Test UgliStripHandle::GetScintMdlHandle()
02204 
02205   bool pass = true;
02206 
02207   UgliScintMdlHandle geomdl = geostp.GetScintMdlHandle();
02208   UgliScintMdlHandle uglimdl = uglistp.GetScintMdlHandle();
02209   
02210   if ( geomdl.GetPlexScintMdlId() != uglimdl.GetPlexScintMdlId() ) {
02211     cout << "Strip " << geostp.GetSEId() << " Geo GetScintMdlHandle "
02212          << geomdl.GetPlexScintMdlId() << " differs from Ugli " 
02213          << uglimdl.GetPlexScintMdlId() << "." << endl;
02214     pass = false;
02215   }
02216     
02217   return pass;
02218 
02219 }

bool GeoValidate::TestStrip_GetScintPlnHandle ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2222 of file GeoValidate.cc.

References UgliPlnHandle::GetPlexPlaneId(), UgliStripHandle::GetScintPlnHandle(), and UgliStripHandle::GetSEId().

Referenced by TestStrip().

02223                                                                        {
02224   // Test UgliStripHandle::GetScintPlnHandle()
02225 
02226   bool pass = true;
02227 
02228   UgliScintPlnHandle geopln = geostp.GetScintPlnHandle();
02229   UgliScintPlnHandle uglipln = uglistp.GetScintPlnHandle();
02230   
02231   if ( geopln.GetPlexPlaneId() != uglipln.GetPlexPlaneId() ) {
02232     cout << "Strip " << geostp.GetSEId() << " Geo GetScintPlnHandle "
02233          << geopln.GetPlexPlaneId() << " differs from Ugli " 
02234          << uglipln.GetPlexPlaneId() << "." << endl;
02235     pass = false;
02236   }
02237     
02238   return pass;
02239 
02240 }

bool GeoValidate::TestStrip_GetSEId ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2180 of file GeoValidate.cc.

References UgliStripHandle::GetSEId().

Referenced by TestStrip().

02181                                                              {
02182   // Test UgliStripHandle::GetSEId()
02183 
02184   bool pass = true;
02185 
02186   PlexStripEndId geoseid = geostp.GetSEId();
02187   PlexStripEndId ugliseid = uglistp.GetSEId();
02188   
02189   if ( geoseid != ugliseid ) {
02190     cout << "Strip " << geostp.GetSEId() << " Geo GetSEId "
02191          << geoseid << " differs from Ugli " << ugliseid
02192          << "." << endl;
02193     pass = false;
02194   }
02195     
02196   return pass;
02197 
02198 }

bool GeoValidate::TestStrip_GetTPos ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2502 of file GeoValidate.cc.

References doc, fFracDiff, UgliStripHandle::GetSEId(), UgliStripHandle::GetTPos(), and PlexPlaneId::IsVetoShield().

Referenced by TestStrip().

02503                                                              {
02504   // Test UgliStripHandle::GetTPos(Float_t orthCoord)
02505 
02506   bool pass = true;
02507 
02508   // Veto shield strips are skipped because Ugli considers them invalid
02509   // for this calculation
02510   if ( geostp.GetSEId().IsVetoShield() ) return pass; // but not really
02511   
02512   // Test by orthCoord from -4 to 4 m regardless of detector type
02513   int noc = 11;
02514   Float_t minoc = -4.;
02515   Float_t maxoc = +4.;
02516   Float_t doc = (maxoc - minoc)/(noc-1);
02517   
02518   for ( int ioc = 0; ioc < noc; ioc++ ) {
02519     Float_t oc = ioc*doc + minoc;
02520 
02521     Float_t geotpos  = geostp.GetTPos(oc);
02522     Float_t uglitpos = uglistp.GetTPos(oc);
02523   
02524     if ( TMath::Abs(uglitpos) > 1.E-2 ) {
02525       if ( TMath::Abs((geotpos - uglitpos)/uglitpos) > fFracDiff ) {
02526         cout << "Strip " << geostp.GetSEId() << " Geo TPos "
02527              << geotpos << " differs from Ugli " << uglitpos
02528              << " by more than " << fFracDiff*100. << "% for orth coord " 
02529              << oc << "(m)" << endl;
02530         pass = false;
02531       }
02532     }
02533     else {
02534       if ( TMath::Abs(geotpos-uglitpos) > fFracDiff ) {
02535         cout << "Strip " << geostp.GetSEId() << " Geo TPos "
02536              << geotpos << " differse from Ugli " << uglitpos
02537              << " by " << fFracDiff << "(m)" << endl;
02538         pass = false;
02539       }
02540     }
02541   }
02542     
02543   return pass;
02544 
02545 }

bool GeoValidate::TestStrip_GetTPosRelMdl ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2371 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), and UgliStripHandle::GetTPosRelMdl().

Referenced by TestStrip().

02372                                                                    {
02373   // Test UgliStripHandle::GetTPosRelMdl()
02374 
02375   bool pass = true;
02376 
02377   Float_t geotposrelmdl    = geostp.GetTPosRelMdl();
02378   Float_t uglitposrelmdl   = uglistp.GetTPosRelMdl();
02379   
02380   if ( TMath::Abs(geotposrelmdl - uglitposrelmdl) > fFracDiff ) {
02381     cout << "Strip " << geostp.GetSEId() << " Geo TPosRelMdl "
02382          << geotposrelmdl << " differs from Ugli " << uglitposrelmdl
02383          << " by more than " << fFracDiff << "(m)." << endl;
02384     pass = false;
02385   }
02386     
02387   return pass;
02388 
02389 }

bool GeoValidate::TestStrip_GetZRotRelMdlRad ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2328 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), and UgliStripHandle::GetZRotRelMdlRad().

Referenced by TestStrip().

02329                                                                       {
02330   // Test UgliStripHandle::GetZRotRelMdlRad()
02331 
02332   bool pass = true;
02333 
02334   Float_t geozrotrelmdlrad = geostp.GetZRotRelMdlRad();
02335   Float_t uglizrotrelmdlrad = uglistp.GetZRotRelMdlRad();
02336   
02337   if ( TMath::Abs(geozrotrelmdlrad - uglizrotrelmdlrad) > fFracDiff ) {
02338     cout << "Strip " << geostp.GetSEId() << " Geo ZRotRelMdlRad "
02339          << geozrotrelmdlrad << " differs from Ugli " << uglizrotrelmdlrad
02340          << " by more than " << fFracDiff << "(rad)." << endl;
02341     pass = false;
02342   }
02343 
02344   return pass;
02345 
02346 }

bool GeoValidate::TestStrip_GlobalPos ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2424 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), and UgliStripHandle::GlobalPos().

Referenced by TestStrip().

02425                                                                {
02426   // Test UgliStripHandle::GlobalPos(const Float_t alongLength,
02427   //                                 const Bool_t onWLS = kFALSE) const;
02428   
02429   bool pass = true;
02430 
02431   // Test by strip end and by whole
02432   Double_t alongLength[3] = {-1.,0.,1.};
02433 
02434   for ( int ipt = 0; ipt < 3; ipt++ ) {
02435     TVector3 geogxyz  = geostp.GlobalPos(alongLength[ipt]);
02436     TVector3 ugligxyz = uglistp.GlobalPos(alongLength[ipt]);
02437   
02438     if ( TMath::Abs(ugligxyz.X()) > fFracDiff ) {
02439       if ( TMath::Abs((geogxyz.X() - ugligxyz.X())/ugligxyz.X()) > fFracDiff ) {
02440         cout << "Strip " << geostp.GetSEId() 
02441              << " Geo GlobalPos X " << geogxyz.X() << " differs from Ugli " 
02442              << ugligxyz.X() << " by more than " << fFracDiff*100. 
02443              << "% for alongLength " << alongLength[ipt] << "(m)." << endl;
02444         pass = false;
02445       }
02446     }
02447     else {
02448       if ( TMath::Abs(geogxyz.X() - ugligxyz.X()) > fFracDiff ) {
02449         cout << "Strip " << geostp.GetSEId() << " Geo GlobalPos X "
02450              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
02451              << " by more than " << fFracDiff << " for alongLength " 
02452              << alongLength[ipt] << "(m)." << endl;
02453         pass = false;
02454       }
02455     }
02456 
02457     if ( TMath::Abs(ugligxyz.Y()) > fFracDiff ) {
02458       if ( TMath::Abs((geogxyz.Y() - ugligxyz.Y())/ugligxyz.Y()) > fFracDiff ) {
02459         cout << "Strip " << geostp.GetSEId() 
02460              << " Geo GlobalPos Y " << geogxyz.Y() << " differs from Ugli " 
02461              << ugligxyz.Y() << " by more than " << fFracDiff*100. 
02462              << "% for alongLength " << alongLength[ipt] << "(m)." << endl;
02463         pass = false;
02464       }
02465     }
02466     else {
02467       if ( TMath::Abs(geogxyz.Y() - ugligxyz.Y()) > fFracDiff ) {
02468         cout << "Strip " << geostp.GetSEId() << " Geo GlobalPos Y "
02469              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
02470              << " by more than " << fFracDiff << " for alongLength " 
02471              << alongLength[ipt] << "(m)." << endl;
02472         pass = false;
02473       }
02474     }
02475 
02476     if ( TMath::Abs(ugligxyz.Z()) > fFracDiff ) {
02477       if ( TMath::Abs((geogxyz.Z() - ugligxyz.Z())/ugligxyz.Z()) > fFracDiff ) {
02478         cout << "Strip " << geostp.GetSEId() 
02479              << " Geo GlobalPos Z " << geogxyz.Z() << " differs from Ugli " 
02480              << ugligxyz.Z() << " by more than " << fFracDiff*100. 
02481              << "% for alongLength " << alongLength[ipt] << "(m)." << endl;
02482         pass = false;
02483       }
02484     }
02485     else {
02486       if ( TMath::Abs(geogxyz.Z() - ugligxyz.Z()) > fFracDiff ) {
02487         cout << "Strip " << geostp.GetSEId() << " Geo GlobalPos Z "
02488              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
02489              << " by more than " << fFracDiff << " for alongLength " 
02490              << alongLength[ipt] << "(m)." << endl;
02491         pass = false;
02492       }
02493     }
02494 
02495   }
02496     
02497   return pass;
02498 
02499 }

bool GeoValidate::TestStrip_GlobalToLocal ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2099 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), UgliStripHandle::GlobalToLocal(), and UgliStripHandle::LocalToGlobal().

Referenced by TestStrip().

02100                                                                    {
02101   // Test UgliStripHandle::GlobalToLocal()
02102 
02103   bool pass = true;
02104 
02105   const int ntestpt = 3;
02106   TVector3 lxyz[ntestpt];
02107   lxyz[0] = TVector3(0.,0.,0.);
02108   lxyz[1] = TVector3(1.,1.,1.);
02109   lxyz[2] = TVector3(-1.,-1.,-1.);
02110 
02111   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
02112     TVector3 geogxyz  = geostp.LocalToGlobal(lxyz[ipt]);
02113 
02114     TVector3 geolxyz = geostp.GlobalToLocal(geogxyz);
02115     TVector3 uglilxyz = uglistp.GlobalToLocal(geogxyz);
02116   
02117     if ( TMath::Abs(uglilxyz.X()) > fFracDiff ) {
02118       if ( TMath::Abs((geolxyz.X() - uglilxyz.X())/uglilxyz.X()) > fFracDiff ) {
02119         cout << "Strip " << geostp.GetSEId() 
02120              << " Geo GlobalToLocal X "
02121              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
02122              << " by more than " << fFracDiff*100. << "%." << endl;
02123         pass = false;
02124       }
02125     }
02126     else {
02127       if ( TMath::Abs(geolxyz.X() - uglilxyz.X()) > fFracDiff ) {
02128         cout << "Strip " << geostp.GetSEId() 
02129              << " Geo GlobalToLocal X "
02130              << geolxyz.X() << " differs from Ugli " << uglilxyz.X()
02131              << " by more than " << fFracDiff << "." << endl;
02132         pass = false;
02133       }
02134     }
02135 
02136     if ( TMath::Abs(uglilxyz.Y()) > fFracDiff ) {
02137       if ( TMath::Abs((geolxyz.Y() - uglilxyz.Y())/uglilxyz.Y()) > fFracDiff ) {
02138         cout << "Strip " << geostp.GetSEId() 
02139              << " Geo GlobalToLocal Y "
02140              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
02141              << " by more than " << fFracDiff*100. << "%." << endl;
02142         pass = false;
02143       }
02144     }
02145     else {
02146       if ( TMath::Abs(geolxyz.Y() - uglilxyz.Y()) > fFracDiff ) {
02147         cout << "Strip " << geostp.GetSEId() 
02148              << " Geo GlobalToLocal Y "
02149              << geolxyz.Y() << " differs from Ugli " << uglilxyz.Y()
02150              << " by more than " << fFracDiff << "." << endl;
02151         pass = false;
02152       }
02153     }
02154 
02155     if ( TMath::Abs(uglilxyz.Z()) > fFracDiff ) {
02156       if ( TMath::Abs((geolxyz.Z() - uglilxyz.Z())/uglilxyz.Z()) > fFracDiff ) {
02157         cout << "Strip " << geostp.GetSEId() 
02158              << " Geo GlobalToLocal Z "
02159              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
02160              << " by more than " << fFracDiff*100. << "%." << endl;
02161         pass = false;
02162       }
02163     }
02164     else {
02165       if ( TMath::Abs(geolxyz.Z() - uglilxyz.Z()) > fFracDiff ) {
02166         cout << "Strip " << geostp.GetSEId() 
02167              << " Geo GlobalToLocal Z "
02168              << geolxyz.Z() << " differs from Ugli " << uglilxyz.Z()
02169              << " by more than " << fFracDiff << "." << endl;
02170         pass = false;
02171       }
02172     }
02173   }
02174   
02175   return pass;
02176 
02177 }

bool GeoValidate::TestStrip_Intersection ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2624 of file GeoValidate.cc.

References fFracDiff, fVldContext, PlexPlaneId::GetDetector(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneView(), UgliStripHandle::GetSEId(), UgliGeomHandle::GetStripHandle(), UgliLoanPool::Instance(), UgliStripHandle::Intersection(), UgliStripHandle::IsValid(), PlexPlaneId::IsVetoShield(), Detector::kCalDet, Detector::kFar, Detector::kNear, PlaneView::kU, StripEnd::kUnknown, PlaneView::kV, StripEnd::kWhole, and UgliLoanPool::SetUseGeo().

Referenced by TestStrip().

02625                                                                   {
02626   // Test UgliStripHandle::Intersection(const PlexStripEndId& orthogonalStrip)
02627 
02628   bool pass = true;
02629 
02630   if ( geostp.GetSEId().IsVetoShield() ) return pass; // no orthogonal strip
02631   
02632   // Pick 3 orthogonal strips
02633   Detector::Detector_t dettype = geostp.GetSEId().GetDetector();
02634   UInt_t plane = geostp.GetSEId().GetPlane();
02635   StripEnd::StripEnd_t end = StripEnd::kUnknown;
02636   StripEnd::StripEnd_t subpart = StripEnd::kWhole;
02637   PlaneView::PlaneView_t view = geostp.GetSEId().GetPlaneView();
02638   
02639   UgliLoanPool::Instance()->SetUseGeo(true);
02640   UgliGeomHandle geo(*fVldContext);
02641 
02642   if ( view == PlaneView::kU ) view = PlaneView::kV;
02643   else view = PlaneView::kU;
02644 
02645   UInt_t strip0 = 0;
02646   if ( dettype == Detector::kFar ) {
02647     if ( plane < 248 || (plane > 248 && plane < 300) ) plane += 1;
02648     else plane -= 1; // switched in latter part of detector
02649     strip0 = 95;
02650   }
02651   else if ( dettype == Detector::kNear ) {
02652     if ( plane < 140 ) plane += 1;
02653     else plane -= 1;
02654     strip0 = 45;
02655   }
02656   else if ( dettype == Detector::kCalDet ) {
02657     if ( plane < 60 ) plane += 1;
02658     else plane -= 1;
02659     strip0 = 12;
02660   }
02661   
02662   PlexStripEndId seid[3] 
02663              = {PlexStripEndId(dettype,plane,strip0-10,end,subpart,view),
02664                 PlexStripEndId(dettype,plane,strip0,end,subpart,view),
02665                 PlexStripEndId(dettype,plane,strip0+10,end,subpart,view)};
02666   
02667   for ( int istp = 0; istp < 3; istp++ ) {
02668 
02669     UgliStripHandle orthstp = geo.GetStripHandle(seid[istp]);
02670     if ( !orthstp.IsValid() ) continue;
02671     
02672     TVector3 geoint  = geostp.Intersection(seid[istp]);
02673     TVector3 ugliint = uglistp.Intersection(seid[istp]);
02674   
02675     if ( TMath::Abs(ugliint.X()) > fFracDiff ) {
02676       if ( TMath::Abs((geoint.X() - ugliint.X())/ugliint.X()) > fFracDiff ) {
02677         cout << "Strip " << geostp.GetSEId() << " Geo Intersection X "
02678              << geoint.X() << " differs from Ugli " << ugliint.X()
02679              << " by more than " << fFracDiff*100. << "% for orth seid " 
02680              << seid[istp] << "." << endl;
02681         pass = false;
02682       }
02683     }
02684     else {
02685       if ( TMath::Abs(geoint.X() - ugliint.X()) > fFracDiff ) {
02686         cout << "Strip " << geostp.GetSEId() << " Geo Intersection X "
02687              << geoint.X() << " differs from Ugli " << ugliint.X()
02688              << " by more than " << fFracDiff << "(m) for orth seid " 
02689              << seid[istp] << "." << endl;
02690         pass = false;
02691       }
02692     }
02693 
02694     if ( TMath::Abs(ugliint.Y()) > fFracDiff ) {
02695       if ( TMath::Abs((geoint.Y() - ugliint.Y())/ugliint.Y()) > fFracDiff ) {
02696         cout << "Strip " << geostp.GetSEId() << " Geo Intersection Y "
02697              << geoint.Y() << " differs from Ugli " << ugliint.Y()
02698              << " by more than " << fFracDiff*100. << "% for orth seid " 
02699              << seid[istp] << "." << endl;
02700         pass = false;
02701       }
02702     }
02703     else {
02704       if ( TMath::Abs(geoint.Y() - ugliint.Y()) > fFracDiff ) {
02705         cout << "Strip " << geostp.GetSEId() << " Geo Intersection Y "
02706              << geoint.Y() << " differs from Ugli " << ugliint.Y()
02707              << " by more than " << fFracDiff << "(m) for orth seid " 
02708              << seid[istp] << "." << endl;
02709         pass = false;
02710       }
02711     }
02712 
02713     if ( TMath::Abs(ugliint.Z()) > fFracDiff ) {
02714       if ( TMath::Abs((geoint.Z() - ugliint.Z())/ugliint.Z()) > fFracDiff ) {
02715         cout << "Strip " << geostp.GetSEId() << " Geo Intersection Z "
02716              << geoint.Z() << " differs from Ugli " << ugliint.Z()
02717              << " by more than " << fFracDiff*100. << "% for orth seid " 
02718              << seid[istp] << "." << endl;
02719         pass = false;
02720       }
02721     }
02722     else {
02723       if ( TMath::Abs(geoint.Z() - ugliint.Z()) > fFracDiff ) {
02724         cout << "Strip " << geostp.GetSEId() << " Geo Intersection Z "
02725              << geoint.Z() << " differs from Ugli " << ugliint.Z()
02726              << " by more than " << fFracDiff << "(m) for orth seid " 
02727              << seid[istp] << "." << endl;
02728         pass = false;
02729       }
02730     }
02731 
02732   }
02733     
02734   return pass;
02735 
02736 }

bool GeoValidate::TestStrip_IsMirrored ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2740 of file GeoValidate.cc.

References UgliStripHandle::GetSEId(), UgliStripHandle::IsMirrored(), StripEnd::kEast, and StripEnd::kWest.

Referenced by TestStrip().

02741                                                                 {
02742   // Test UgliStripHandle::IsMirrored(const StripEnd::StripEnd_t end)
02743 
02744   bool pass = true;
02745 
02746   // Test by strip end 
02747   StripEnd::StripEnd_t stripend[2] = {StripEnd::kEast,
02748                                       StripEnd::kWest};
02749   
02750   for ( int iend = 0; iend < 2; iend++ ) {
02751     Bool_t geoismirrored  = geostp.IsMirrored(stripend[iend]);
02752     Bool_t ugliismirrored = uglistp.IsMirrored(stripend[iend]);
02753   
02754     if ( geoismirrored != ugliismirrored ) {
02755        std::string geoismirroredstr = (geoismirrored) ? "true" : "false";
02756        std::string ugliismirroredstr = (ugliismirrored) ? "true" : "false";
02757        cout << "Strip " << geostp.GetSEId() << " Geo IsMirrored "
02758             << geoismirroredstr.c_str() << " differs from Ugli " 
02759             << ugliismirroredstr.c_str() << "." << endl;
02760        pass = false;
02761     }
02762   }
02763     
02764   return pass;
02765 
02766 }

bool GeoValidate::TestStrip_LocalToGlobal ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2020 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), and UgliStripHandle::LocalToGlobal().

Referenced by TestStrip().

02021                                                                    {
02022   // Test UgliStripHandle::LocalToGlobal()
02023 
02024   bool pass = true;
02025 
02026   const int ntestpt = 3;
02027   TVector3 lxyz[ntestpt];
02028   lxyz[0] = TVector3(0.,0.,0.);
02029   lxyz[1] = TVector3(1.,1.,1.);
02030   lxyz[2] = TVector3(-1.,-1.,-1.);
02031 
02032   for ( int ipt = 0; ipt < ntestpt; ipt++ ) {
02033     TVector3 geogxyz  = geostp.LocalToGlobal(lxyz[ipt]);
02034     TVector3 ugligxyz = uglistp.LocalToGlobal(lxyz[ipt]);
02035   
02036     if ( TMath::Abs(ugligxyz.X()) > fFracDiff ) {
02037       if ( TMath::Abs((geogxyz.X() - ugligxyz.X())/ugligxyz.X()) > fFracDiff ) {
02038         cout << "Strip " << geostp.GetSEId() 
02039              << " Geo LocalToGlobal X "
02040              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
02041              << " by more than " << fFracDiff*100. << "%." << endl;
02042         pass = false;
02043       }
02044     }
02045     else {
02046       if ( TMath::Abs(geogxyz.X() - ugligxyz.X()) > fFracDiff ) {
02047         cout << "Strip " << geostp.GetSEId() 
02048              << " Geo LocalToGlobal X "
02049              << geogxyz.X() << " differs from Ugli " << ugligxyz.X()
02050              << " by more than " << fFracDiff << "." << endl;
02051         pass = false;
02052       }
02053     }
02054 
02055     if ( TMath::Abs(ugligxyz.Y()) > fFracDiff ) {
02056       if ( TMath::Abs((geogxyz.Y() - ugligxyz.Y())/ugligxyz.Y()) > fFracDiff ) {
02057         cout << "Strip " << geostp.GetSEId() 
02058              << " Geo LocalToGlobal Y "
02059              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
02060              << " by more than " << fFracDiff*100. << "%." << endl;
02061         pass = false;
02062       }
02063     }
02064     else {
02065       if ( TMath::Abs(geogxyz.Y() - ugligxyz.Y()) > fFracDiff ) {
02066         cout << "Strip " << geostp.GetSEId() 
02067              << " Geo LocalToGlobal Y "
02068              << geogxyz.Y() << " differs from Ugli " << ugligxyz.Y()
02069              << " by more than " << fFracDiff << "." << endl;
02070         pass = false;
02071       }
02072     }
02073 
02074     if ( TMath::Abs(ugligxyz.Z()) > fFracDiff ) {
02075       if ( TMath::Abs((geogxyz.Z() - ugligxyz.Z())/ugligxyz.Z()) > fFracDiff ) {
02076         cout << "Strip " << geostp.GetSEId() 
02077              << " Geo LocalToGlobal Z "
02078              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
02079              << " by more than " << fFracDiff*100. << "%." << endl;
02080         pass = false;
02081       }
02082     }
02083     else {
02084       if ( TMath::Abs(geogxyz.Z() - ugligxyz.Z()) > fFracDiff ) {
02085         cout << "Strip " << geostp.GetSEId() 
02086              << " Geo LocalToGlobal Z "
02087              << geogxyz.Z() << " differs from Ugli " << ugligxyz.Z()
02088              << " by more than " << fFracDiff << "." << endl;
02089         pass = false;
02090       }
02091     }
02092   }
02093   
02094   return pass;
02095 
02096 }

bool GeoValidate::TestStrip_PartialLength ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2392 of file GeoValidate.cc.

References bfld::AsString(), fFracDiff, UgliStripHandle::GetSEId(), StripEnd::kEast, StripEnd::kWest, StripEnd::kWhole, and UgliStripHandle::PartialLength().

Referenced by TestStrip().

02393                                                                    {
02394   // Test UgliStripHandle::PartialLength(const StripEnd::StripEnd_t end)
02395 
02396   bool pass = true;
02397 
02398   // Test by strip end and by whole
02399   StripEnd::StripEnd_t stripend[3] = {StripEnd::kEast,
02400                                       StripEnd::kWest,
02401                                       StripEnd::kWhole};
02402   
02403   // Only test east & west because whole is known to differ
02404   // (Geo returns total length of strip, while Ugli returns a huge number)
02405   for ( int iend = 0; iend < 2; iend++ ) {
02406     Float_t geopartiallength  = geostp.PartialLength(stripend[iend]);
02407     Float_t uglipartiallength = uglistp.PartialLength(stripend[iend]);
02408   
02409     if ( TMath::Abs((geopartiallength - uglipartiallength)/uglipartiallength) 
02410                                                                 > fFracDiff ) {
02411       cout << "Strip " << geostp.GetSEId() << " Geo PartialLength "
02412            << geopartiallength << " differs from Ugli " << uglipartiallength
02413            << " by more than " << fFracDiff*100. << "% for strip end " 
02414            << StripEnd::AsString(stripend[iend]) << endl;
02415       pass = false;
02416     }
02417   }
02418     
02419   return pass;
02420 
02421 }

bool GeoValidate::TestStrip_WlsBypass ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2307 of file GeoValidate.cc.

References fFracDiff, UgliStripHandle::GetSEId(), and UgliStripHandle::WlsBypass().

Referenced by TestStrip().

02308                                                                {
02309   // Test UgliStripHandle::WlsBypass()
02310 
02311   bool pass = true;
02312 
02313   Float_t geowlsbypass = geostp.WlsBypass();
02314   Float_t ugliwlsbypass = uglistp.WlsBypass();
02315   
02316   if ( TMath::Abs((geowlsbypass - ugliwlsbypass)/ugliwlsbypass) > fFracDiff ) {
02317     cout << "Strip " << geostp.GetSEId() << " Geo WlsBypass "
02318          << geowlsbypass << " differs from Ugli " << ugliwlsbypass
02319          << " by more than " << fFracDiff*100. << "%" << endl;
02320     pass = false;
02321   }
02322     
02323   return pass;
02324 
02325 }

bool GeoValidate::TestStrip_WlsPigtail ( UgliStripHandle  geo,
UgliStripHandle  ugli 
) [private]

Definition at line 2769 of file GeoValidate.cc.

References bfld::AsString(), fFracDiff, UgliStripHandle::GetSEId(), StripEnd::kEast, StripEnd::kWest, and UgliStripHandle::WlsPigtail().

Referenced by TestStrip().

02770                                                                 {
02771   // Test UgliStripHandle::WlsPigtail(const StripEnd::StripEnd_t end)
02772 
02773   bool pass = true;
02774 
02775   // Test by strip end 
02776   StripEnd::StripEnd_t stripend[3] = {StripEnd::kEast,
02777                                       StripEnd::kWest};
02778   
02779   for ( int iend = 0; iend < 2; iend++ ) {
02780     Float_t geowlspigtail  = geostp.WlsPigtail(stripend[iend]);
02781     Float_t ugliwlspigtail = uglistp.WlsPigtail(stripend[iend]);
02782   
02783     if ( TMath::Abs((geowlspigtail - ugliwlspigtail)/ugliwlspigtail) 
02784                                                                 > fFracDiff ) {
02785       cout << "Strip " << geostp.GetSEId() << " Geo WlsPigtail "
02786            << geowlspigtail << " differs from Ugli " << ugliwlspigtail
02787            << " by more than " << fFracDiff*100. << "% for strip end " 
02788            << StripEnd::AsString(stripend[iend]) << endl;
02789       pass = false;
02790     }
02791   }
02792     
02793   return pass;
02794 
02795 }


Member Data Documentation

int GeoValidate::fDetMask [private]

Definition at line 145 of file GeoValidate.h.

Referenced by RunAllTests().

float GeoValidate::fFracDiff [private]
int GeoValidate::fSimMask [private]

Definition at line 146 of file GeoValidate.h.

Referenced by RunAllTests().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1