larutil::Geometry Class Reference

#include <Geometry.hh>

Inheritance diagram for larutil::Geometry:
larutil::LArUtilBase larlight::larlight_base

List of all members.

Public Member Functions

UInt_t Nchannels () const
 Number of readout channels in the detector.
UInt_t NOpChannels () const
 Number of OpChannels in the detector.
UInt_t Nviews () const
 Number of views (different wire orientations) in the detector.
UInt_t Nplanes () const
 Number of wire planes in TPC "tpc" of cryostat "cstat".
UInt_t Nwires (UInt_t p) const
 Number of wires in plane "p" of TPC "tpc" of cryostat "cstat".
larlight::GEO::SigType_t SignalType (const UInt_t channel) const
 convert channel number to list of possible WireIDs
larlight::GEO::SigType_t PlaneToSignalType (const UChar_t plane) const
 return the signal type for a given plane
larlight::GEO::View_t View (const UInt_t channel) const
 return the view type for a given channel
larlight::GEO::View_t PlaneToView (const UChar_t plane) const
 return the view type for a given plane
std::set
< larlight::GEO::View_t >
const 
Views () const
 return vector of possible views in the detector
UInt_t PlaneWireToChannel (const UInt_t plane, const UInt_t wire) const
 convert plane, wire to channel
UChar_t ChannelToPlane (const UInt_t ch) const
 convert channel to plane
UInt_t ChannelToWire (const UInt_t ch) const
 Convert channel to wire.
UInt_t NearestChannel (const Double_t worldLoc[3], const UInt_t PlaneNo) const
 find the nearest channel to input world coordinates
UInt_t NearestChannel (const std::vector< Double_t > &worldLoc, const UInt_t PlaneNo) const
 find the nearest channel to input world coordinates
UInt_t NearestChannel (const TVector3 &worldLoc, const UInt_t PlaneNo) const
 find the nearest channel to input world coordinates
UInt_t NearestWire (const Double_t worldLoc[3], const UInt_t PlaneNo) const
 nearest wire to input world coordinates
UInt_t NearestWire (const std::vector< Double_t > &worldLoc, const UInt_t PlaneNo) const
 nearest wire to input world coordinate
UInt_t NearestWire (const TVector3 &worldLoc, const UInt_t PlaneNo) const
 nearest wire to input world coordinates
Double_t DetHalfWidth () const
 half width of the TPC
Double_t DetHalfHeight () const
 half height of the TPC
Double_t DetLength () const
 length of the TPC
Double_t CryostatHalfWidth () const
 half width of the cryostat
Double_t CryostatHalfHeight () const
 half height of the cryostat
Double_t CryostatLength () const
 length of the cryostat
Double_t PlanePitch (const UChar_t p1=0, const UChar_t p2=1) const
 distance between planes p1 < p2
Double_t WirePitch (const UInt_t w1=0, const UInt_t w2=1, const UChar_t plane=0) const
 distance between wires on the same plane w1 < w2
Double_t WirePitch (const larlight::GEO::View_t view) const
 assumes all planes in a view have the same pitch
Double_t WireAngleToVertical (larlight::GEO::View_t view) const
 assumes all wires in the view have the same angle
bool ValueInRange (const Double_t value, Double_t min, Double_t max) const
 volume box
void WireEndPoints (const UChar_t plane, const UInt_t wire, Double_t *xyzStart, Double_t *xyzEnd) const
bool ChannelsIntersect (const UInt_t c1, const UInt_t c2, Double_t &y, Double_t &z) const
void IntersectionPoint (const UInt_t wire1, const UInt_t wire2, const UChar_t plane1, const UChar_t plane2, Double_t start_w1[3], Double_t end_w1[3], Double_t start_w2[3], Double_t end_w2[3], Double_t &y, Double_t &z) const
void IntersectionPoint (const UInt_t wire1, const UInt_t wire2, const UChar_t plane1, const UChar_t plane2, Double_t &y, Double_t &z) const
UInt_t GetClosestOpChannel (const Double_t *xyz) const
 Return gdml string which gives sensitive opdet name.
UInt_t GetClosestOpChannel (const Double_t *xyz, Double_t &dist) const
 Find the nearest OpChannel to some point, in the appropriate cryostat.
void GetOpChannelPosition (const UInt_t i, Double_t *xyz) const
 Return optical channel vertex.
const std::vector< Double_t > & PlaneOriginVtx (UChar_t plane)
void PlaneOriginVtx (UChar_t plane, Double_t *vtx) const
virtual bool LoadData (bool force_reload=false)
 Method to load data TTree.
void SetFileName (const std::string filename)
 Method to set data file name.
void SetTreeName (const std::string treename)
 Method to set data TTree name.
virtual void set_verbosity (MSG::Level level)
 Setter for the verbosity level.
MSG::Level get_verbosity () const
 Getter for the verbosity level.
const std::string class_name () const
 Getter for the class name.
void print (MSG::Level level, std::string where, std::string msg) const
 message print out method
void print (MSG::Level level, std::string msg) const
 message print out method

Static Public Member Functions

static const GeometryGetME (bool default_load=true)
 Singleton getter.

Protected Member Functions

virtual bool ReadTree ()
virtual void ClearData ()

Protected Attributes

std::string _file_name
std::string _tree_name
bool _loaded
char _buf [200]
 char buffer for message manipulation
std::vector< bool > _verbosity
 holder for enabled message levels
MSG::Level _verbosity_level
 holder for specified verbosity level
std::string _name
 class name holder

Private Member Functions

 Geometry (bool default_load=true)
 Singleton constructor.
virtual ~Geometry ()
 Default destructor.

Private Attributes

Double_t fDetLength
 boundaries of cryostat, 3 pairs of +/- coord
Double_t fDetHalfWidth
Double_t fDetHalfHeight
Double_t fCryoLength
Double_t fCryoHalfWidth
Double_t fCryoHalfHeight
std::vector< UChar_t > fChannelToPlaneMap
std::vector< UShort_t > fChannelToWireMap
std::vector< std::vector
< UShort_t > > 
fPlaneWireToChannelMap
std::vector
< larlight::GEO::SigType_t
fSignalType
std::vector
< larlight::GEO::View_t
fViewType
std::vector< Double_t > fPlanePitch
std::vector< std::vector
< std::vector< Double_t > > > 
fWireStartVtx
std::vector< std::vector
< std::vector< Double_t > > > 
fWireEndVtx
std::vector< std::vector
< Double_t > > 
fPlaneOriginVtx
std::vector< Double_t > fWirePitch
std::vector< Double_t > fWireAngle
std::vector< std::vector
< Float_t > > 
fOpChannelVtx
std::vector< Double_t > fOrthVectorsY
std::vector< Double_t > fOrthVectorsZ
std::vector< Double_t > fFirstWireProj

Static Private Attributes

static Geometry_me = 0

Detailed Description

Definition at line 26 of file Geometry.hh.


Constructor & Destructor Documentation

larutil::Geometry::Geometry ( bool  default_load = true  )  [private]

Singleton constructor.

Definition at line 10 of file Geometry.cc.

References larutil::LArUtilBase::_file_name, larlight::larlight_base::_name, larutil::LArUtilBase::_tree_name, larutil::LArUtilConfig::Detector(), larutil::kTREENAME_GEOMETRY, larutil::kUTIL_DATA_FILENAME, and LoadData().

Referenced by GetME().

00010                                       : LArUtilBase()
00011   {
00012     _name = "Geometry";
00013     if(default_load) {
00014       _file_name = Form("%s/LArUtil/dat/%s",
00015             getenv("LARLIGHT_CORE_DIR"),
00016             kUTIL_DATA_FILENAME[LArUtilConfig::Detector()].c_str());
00017       _tree_name = kTREENAME_GEOMETRY;
00018       LoadData();
00019     }
00020   }

virtual larutil::Geometry::~Geometry (  )  [inline, private, virtual]

Default destructor.

Definition at line 34 of file Geometry.hh.

00034 {};


Member Function Documentation

bool larutil::Geometry::ChannelsIntersect ( const UInt_t  c1,
const UInt_t  c2,
Double_t &  y,
Double_t &  z 
) const

Definition at line 465 of file Geometry.cc.

References fChannelToPlaneMap, fChannelToWireMap, fViewType, fWireAngle, IntersectionPoint(), ValueInRange(), and WireEndPoints().

Referenced by larutil::GeometryUtilities::GetProjectedPoint(), and larutil::GeometryUtilities::GetYZ().

00468   {
00469     if(c1==c2){
00470       throw LArUtilException("Same channel does not intersect!");
00471       return false;
00472     }
00473 
00474     if( c1 >= fChannelToPlaneMap.size() || c2>= fChannelToPlaneMap.size() ) {
00475       throw LArUtilException(Form("Invalid channels : %d and %d",c1,c2));
00476       return false;
00477     }
00478     if( fViewType.at(fChannelToPlaneMap.at(c1)) == fViewType.at(fChannelToPlaneMap.at(c2)) ) {
00479       return false;
00480     }
00481 
00482     UInt_t w1 = fChannelToWireMap.at(c1);
00483     UInt_t w2 = fChannelToWireMap.at(c2);
00484     
00485     UChar_t p1 = fChannelToPlaneMap.at(c1);
00486     UChar_t p2 = fChannelToPlaneMap.at(c2);
00487 
00488     larlight::GEO::View_t v1 = fViewType.at(p1);
00489     larlight::GEO::View_t v2 = fViewType.at(p2);
00490 
00491     Double_t start1[3]={0.};
00492     Double_t start2[3]={0.};
00493     Double_t end1[3]={0.};
00494     Double_t end2[3]={0.};
00495 
00496     WireEndPoints(p1, w1, start1, end1);
00497     WireEndPoints(p2, w2, start2, end2);
00498 
00499     // if endpoint of one input wire is within range of other input wire in
00500     // BOTH y AND z, wires overlap
00501     bool overlapY = (ValueInRange(start1[1], start2[1], end2[1]) || ValueInRange(end1[1], start2[1], end2[1]));
00502     bool overlapZ = (ValueInRange(start1[2], start2[2], end2[2]) || ValueInRange(end1[2], start2[2], end2[2]));
00503 
00504     bool overlapY_rev = (ValueInRange(start2[1], start1[1], end1[1]) || ValueInRange(end2[1], start1[1], end1[1]));
00505     bool overlapZ_rev = (ValueInRange(start2[2], start1[2], end1[2]) || ValueInRange(end2[2], start1[2], end1[2]));
00506                        
00507     // override y overlap checks if a vertical plane exists:
00508       if( fWireAngle.at(v1) == TMath::Pi()/2 || fWireAngle.at(v2) == TMath::Pi()/2 ) {
00509       overlapY     = true;
00510       overlapY_rev = true;
00511     }
00512     
00513     //catch to get vertical wires, where the standard overlap might not work, Andrzej
00514     if(std::abs(start2[2] - end2[2]) < 0.01) overlapZ = overlapZ_rev;
00515 
00516 
00517     if(overlapY && overlapZ){
00518       IntersectionPoint(w1,w2, p1, p2,
00519             start1, end1,
00520             start2, end2,
00521             y, z);
00522       return true;
00523     }
00524 
00525     else if(overlapY_rev && overlapZ_rev){
00526       this->IntersectionPoint(w2, w1, p2, p1,
00527                               start2, end2,
00528                               start1, end1,
00529                               y, z);
00530       return true;
00531     }
00532     
00533     return false;
00534 
00535   }

UChar_t larutil::Geometry::ChannelToPlane ( const UInt_t  ch  )  const

convert channel to plane

Definition at line 251 of file Geometry.cc.

References fChannelToPlaneMap, and larlight::DATA::INVALID_CHAR.

Referenced by larutil::GeometryUtilities::GetPlaneAndTPC().

00252   {
00253     if(ch >= fChannelToPlaneMap.size()) {
00254       throw LArUtilException(Form("Invalid channel number: %d",ch));
00255       return larlight::DATA::INVALID_CHAR;
00256     }
00257     return fChannelToPlaneMap.at(ch);
00258   }

UInt_t larutil::Geometry::ChannelToWire ( const UInt_t  ch  )  const

Convert channel to wire.

Definition at line 260 of file Geometry.cc.

References fChannelToWireMap, and larlight::DATA::INVALID_CHAR.

Referenced by larutil::GeometryUtilities::GetPlaneAndTPC().

00261   {
00262     if(ch >= fChannelToWireMap.size()) {
00263       throw LArUtilException(Form("Invalid channel number: %d",ch));
00264       return larlight::DATA::INVALID_CHAR;
00265     }
00266     return fChannelToWireMap.at(ch);
00267   }

const std::string larlight::larlight_base::class_name (  )  const [inline, inherited]

Getter for the class name.

Definition at line 49 of file larlight_base.hh.

References larlight::larlight_base::_name.

00049 {return _name;};

void larutil::Geometry::ClearData (  )  [protected, virtual]
Double_t larutil::Geometry::CryostatHalfHeight (  )  const [inline]

half height of the cryostat

Definition at line 137 of file Geometry.hh.

References fCryoHalfHeight.

00138     { return fCryoHalfHeight; }

Double_t larutil::Geometry::CryostatHalfWidth (  )  const [inline]

half width of the cryostat

Definition at line 133 of file Geometry.hh.

References fCryoHalfWidth.

00134     { return fCryoHalfWidth; }

Double_t larutil::Geometry::CryostatLength (  )  const [inline]

length of the cryostat

Definition at line 141 of file Geometry.hh.

References fCryoLength.

00142     { return fCryoLength; }

Double_t larutil::Geometry::DetHalfHeight (  )  const [inline]

half height of the TPC

Definition at line 125 of file Geometry.hh.

References fDetHalfHeight.

Referenced by larutil::GeometryUtilities::Get2DangleFrom3D().

00126     { return fDetHalfHeight; }

Double_t larutil::Geometry::DetHalfWidth (  )  const [inline]

half width of the TPC

Definition at line 121 of file Geometry.hh.

References fDetHalfWidth.

Referenced by larutil::GeometryUtilities::Get2DangleFrom3D().

00122     { return fDetHalfWidth; }

Double_t larutil::Geometry::DetLength (  )  const [inline]

length of the TPC

Definition at line 129 of file Geometry.hh.

References fDetLength.

Referenced by larutil::GeometryUtilities::Get2DangleFrom3D().

00130     { return fDetLength; }

MSG::Level larlight::larlight_base::get_verbosity (  )  const [inline, inherited]

Getter for the verbosity level.

Definition at line 46 of file larlight_base.hh.

References larlight::larlight_base::_verbosity_level.

00046 {return _verbosity_level;};

UInt_t larutil::Geometry::GetClosestOpChannel ( const Double_t *  xyz,
Double_t &  dist 
) const

Find the nearest OpChannel to some point, in the appropriate cryostat.

Definition at line 666 of file Geometry.cc.

References fOpChannelVtx, larlight::DATA::INVALID_DOUBLE, and larlight::DATA::INVALID_UINT.

00667   {
00668     Double_t min_dist2  = larlight::DATA::INVALID_DOUBLE;
00669     UInt_t   closest_ch = larlight::DATA::INVALID_UINT;
00670     for(size_t ch=0; ch<fOpChannelVtx.size(); ++ch) {
00671 
00672       dist = 
00673     pow(xyz[0] - fOpChannelVtx.at(ch).at(0),2) + 
00674     pow(xyz[1] - fOpChannelVtx.at(ch).at(1),2) +
00675     pow(xyz[2] - fOpChannelVtx.at(ch).at(2),2); 
00676     
00677       if( dist < min_dist2 ) {
00678     
00679     min_dist2 = dist;
00680     closest_ch = ch;
00681 
00682       }
00683     }
00684     dist = sqrt(dist);
00685     return closest_ch;
00686   }

UInt_t larutil::Geometry::GetClosestOpChannel ( const Double_t *  xyz  )  const

Return gdml string which gives sensitive opdet name.

Find the nearest OpChannel to some point, in the appropriate cryostat

Definition at line 643 of file Geometry.cc.

References fOpChannelVtx, larlight::DATA::INVALID_DOUBLE, and larlight::DATA::INVALID_UINT.

00644   {
00645     Double_t dist2      = 0;
00646     Double_t min_dist2  = larlight::DATA::INVALID_DOUBLE;
00647     UInt_t   closest_ch = larlight::DATA::INVALID_UINT;
00648     for(size_t ch=0; ch<fOpChannelVtx.size(); ++ch) {
00649 
00650       dist2 = 
00651     pow(xyz[0] - fOpChannelVtx.at(ch).at(0),2) + 
00652     pow(xyz[1] - fOpChannelVtx.at(ch).at(1),2) +
00653     pow(xyz[2] - fOpChannelVtx.at(ch).at(2),2); 
00654     
00655       if( dist2 < min_dist2 ) {
00656     
00657     min_dist2 = dist2;
00658     closest_ch = ch;
00659 
00660       }
00661     }
00662 
00663     return closest_ch;
00664   }

static const Geometry* larutil::Geometry::GetME ( bool  default_load = true  )  [inline, static]

Singleton getter.

Definition at line 41 of file Geometry.hh.

References _me, and Geometry().

Referenced by main(), larutil::GeometryUtilities::Reconfigure(), and larutil::LArUtilManager::ReconfigureUtilities().

00042     {
00043       if(!_me) _me = new Geometry(default_load);
00044       return _me;
00045     }

void larutil::Geometry::GetOpChannelPosition ( const UInt_t  i,
Double_t *  xyz 
) const

Return optical channel vertex.

Definition at line 688 of file Geometry.cc.

References fOpChannelVtx, and larlight::DATA::INVALID_DOUBLE.

00689   {
00690     if( i >= fOpChannelVtx.size() ) {
00691       throw LArUtilException(Form("Invalid PMT channel number: %d",i));
00692       xyz[0] = larlight::DATA::INVALID_DOUBLE;
00693       xyz[0] = larlight::DATA::INVALID_DOUBLE;
00694       xyz[0] = larlight::DATA::INVALID_DOUBLE;
00695       return;
00696     }
00697 
00698     xyz[0] = fOpChannelVtx.at(i).at(0);
00699     xyz[1] = fOpChannelVtx.at(i).at(1);
00700     xyz[2] = fOpChannelVtx.at(i).at(2);
00701     return;
00702   }

void larutil::Geometry::IntersectionPoint ( const UInt_t  wire1,
const UInt_t  wire2,
const UChar_t  plane1,
const UChar_t  plane2,
Double_t &  y,
Double_t &  z 
) const

Definition at line 626 of file Geometry.cc.

References IntersectionPoint(), and WireEndPoints().

00630   {
00631     double WireStart1[3] = {0.};
00632     double WireStart2[3] = {0.};
00633     double WireEnd1[3]   = {0.};
00634     double WireEnd2[3]   = {0.};
00635 
00636     this->WireEndPoints(plane1, wire1, WireStart1, WireEnd1);
00637     this->WireEndPoints(plane2, wire2, WireStart2, WireEnd2);
00638     this->IntersectionPoint(wire1, wire2, plane1, plane2,
00639                             WireStart1, WireEnd1, 
00640                 WireStart2, WireEnd2, y, z);
00641   }

void larutil::Geometry::IntersectionPoint ( const UInt_t  wire1,
const UInt_t  wire2,
const UChar_t  plane1,
const UChar_t  plane2,
Double_t  start_w1[3],
Double_t  end_w1[3],
Double_t  start_w2[3],
Double_t  end_w2[3],
Double_t &  y,
Double_t &  z 
) const

Definition at line 537 of file Geometry.cc.

References fViewType, and fWireAngle.

Referenced by ChannelsIntersect(), and IntersectionPoint().

00542   {
00543 
00544     larlight::GEO::View_t v1 = fViewType.at(plane1);
00545     larlight::GEO::View_t v2 = fViewType.at(plane2);
00546     //angle of wire1 wrt z-axis in Y-Z plane...in radians
00547     Double_t angle1 = fWireAngle.at(v1);
00548     //angle of wire2 wrt z-axis in Y-Z plane...in radians
00549     Double_t angle2 = fWireAngle.at(v2);
00550 
00551     if(angle1 == angle2) return; //comparing two wires in the same plane...pointless.
00552 
00553      //coordinates of "upper" endpoints...(z1,y1) = (a,b) and (z2,y2) = (c,d)
00554     double a = 0.;
00555     double b = 0.;
00556     double c = 0.;
00557     double d = 0.;
00558     double angle = 0.;
00559     double anglex = 0.;
00560 
00561     // below is a special case of calculation when one of the planes is vertical.
00562     angle1 < angle2 ? angle = angle1 : angle = angle2;//get angle closest to the z-axis
00563     
00564     // special case, one plane is vertical 
00565     if(angle1 == TMath::Pi()/2 || angle2 == TMath::Pi()/2){
00566       if(angle1 == TMath::Pi()/2){
00567     
00568     anglex = (angle2-TMath::Pi()/2);
00569         a = end_w1[2];
00570         b = end_w1[1];
00571         c = end_w2[2];
00572         d = end_w2[1];
00573         // the if below can in principle be replaced by the sign of anglex (inverted)
00574         // in the formula for y below. But until the geometry is fully symmetric in y I'm
00575         // leaving it like this. Andrzej 
00576         if((anglex) > 0 ) b = start_w1[1];
00577 
00578       } 
00579       else if(angle2 == TMath::Pi()/2){
00580         anglex = (angle1-TMath::Pi()/2);
00581         a = end_w2[2];
00582         b = end_w2[1];
00583         c = end_w1[2];
00584         d = end_w1[1];
00585         // the if below can in principle be replaced by the sign of anglex (inverted)
00586         // in the formula for y below. But until the geometry is fully symmetric in y I'm
00587         // leaving it like this. Andrzej
00588         if((anglex) > 0 ) b = start_w2[1];
00589       }
00590 
00591       y = b + ((c-a) - (b-d)*tan(anglex))/tan(anglex);
00592       z = a;   // z is defined by the wire in the vertical plane
00593       
00594       return;
00595     }
00596 
00597     // end of vertical case 
00598     z = 0;y = 0;
00599 
00600     if(angle1 < (TMath::Pi()/2.0)){
00601       c = end_w1[2];
00602       d = end_w1[1];
00603       a = start_w2[2];
00604       b = start_w2[1];
00605     }
00606     else{
00607       c = end_w2[2];
00608       d = end_w2[1];
00609       a = start_w1[2];
00610       b = start_w1[1];
00611     }
00612 
00613     //Intersection point of two wires in the yz plane is completely
00614     //determined by wire endpoints and angle of inclination.
00615     z = 0.5 * ( c + a + (b-d)/TMath::Tan(angle) );
00616     y = 0.5 * ( b + d + (a-c)*TMath::Tan(angle) );
00617 
00618     return;
00619 
00620   }

bool larutil::Geometry::LoadData ( bool  force_reload = false  )  [virtual]

Method to load data TTree.

Reimplemented from larutil::LArUtilBase.

Definition at line 22 of file Geometry.cc.

References fFirstWireProj, fOrthVectorsY, fOrthVectorsZ, fWireEndVtx, fWireStartVtx, Nplanes(), PlaneToView(), WireAngleToVertical(), and WirePitch().

Referenced by Geometry(), and larutil::LArUtilManager::ReconfigureUtilities().

00023   {
00024     bool status = LArUtilBase::LoadData(force_reload);
00025 
00026     if(!status) return status;
00027 
00028     fOrthVectorsY.resize(this->Nplanes());
00029     fOrthVectorsZ.resize(this->Nplanes());
00030     fFirstWireProj.resize(this->Nplanes());
00031     for(size_t plane=0; plane<this->Nplanes(); ++plane) {
00032       
00033       larlight::GEO::View_t view = this->PlaneToView(plane);
00034 
00035       Double_t ThisWirePitch = this->WirePitch(view);
00036 
00037       Double_t WireCentre1[3] = {0.};
00038       Double_t WireCentre2[3] = {0.};
00039 
00040       Double_t  th = this->WireAngleToVertical(view);
00041       Double_t sth = TMath::Sin(th);
00042       Double_t cth = TMath::Cos(th);
00043       
00044       for(size_t coord=0; coord<3; ++coord) {
00045     WireCentre1[coord] = (fWireEndVtx.at(plane).at(0).at(coord) + fWireStartVtx.at(plane).at(0).at(coord)) / 2.;
00046     WireCentre2[coord] = (fWireEndVtx.at(plane).at(1).at(coord) + fWireStartVtx.at(plane).at(1).at(coord)) / 2.;
00047       }
00048 
00049       Double_t OrthY =  cth;
00050       Double_t OrthZ = -sth;
00051       if(((WireCentre2[1] - WireCentre1[1])*OrthY 
00052       + (WireCentre2[2] - WireCentre1[2])*OrthZ) < 0){
00053     OrthZ *= -1;
00054     OrthY *= -1;
00055       }
00056 
00057       fOrthVectorsY[plane] = OrthY / ThisWirePitch;
00058       fOrthVectorsZ[plane] = OrthZ / ThisWirePitch;
00059 
00060       fFirstWireProj[plane]  = WireCentre1[1]*OrthY + WireCentre1[2]*OrthZ;
00061       fFirstWireProj[plane] /= ThisWirePitch;
00062       fFirstWireProj[plane] -= 0.5;
00063 
00064     }
00065     return status;
00066   }

UInt_t larutil::Geometry::Nchannels (  )  const [inline]

Number of readout channels in the detector.

Definition at line 50 of file Geometry.hh.

References fChannelToWireMap.

00051     { return fChannelToWireMap.size(); }

UInt_t larutil::Geometry::NearestChannel ( const TVector3 &  worldLoc,
const UInt_t  PlaneNo 
) const

find the nearest channel to input world coordinates

Definition at line 338 of file Geometry.cc.

References NearestWire(), and PlaneWireToChannel().

00340   {
00341     return PlaneWireToChannel(PlaneNo,NearestWire(worldLoc,PlaneNo));
00342   }

UInt_t larutil::Geometry::NearestChannel ( const std::vector< Double_t > &  worldLoc,
const UInt_t  PlaneNo 
) const

find the nearest channel to input world coordinates

Definition at line 332 of file Geometry.cc.

References NearestWire(), and PlaneWireToChannel().

00334   {
00335     return PlaneWireToChannel(PlaneNo,NearestWire(worldLoc,PlaneNo));
00336   }

UInt_t larutil::Geometry::NearestChannel ( const Double_t  worldLoc[3],
const UInt_t  PlaneNo 
) const

find the nearest channel to input world coordinates

Definition at line 326 of file Geometry.cc.

References NearestWire(), and PlaneWireToChannel().

00328   {
00329     return PlaneWireToChannel(PlaneNo,NearestWire(worldLoc,PlaneNo));
00330   }

UInt_t larutil::Geometry::NearestWire ( const TVector3 &  worldLoc,
const UInt_t  PlaneNo 
) const

nearest wire to input world coordinates

Definition at line 358 of file Geometry.cc.

References fFirstWireProj, fOrthVectorsY, fOrthVectorsZ, and Nwires().

00360   {
00361 
00362     int NearestWireNumber = int(nearbyint(worldLoc[1]*fOrthVectorsY.at(PlaneNo)
00363                       + worldLoc[2]*fOrthVectorsZ.at(PlaneNo)
00364                       - fFirstWireProj.at(PlaneNo)));
00365 
00366     unsigned int wireNumber = (unsigned int) NearestWireNumber;
00367 
00368     if(NearestWireNumber < 0 ||
00369        NearestWireNumber >= (int)(this->Nwires(PlaneNo)) ){
00370 
00371       if(NearestWireNumber < 0) wireNumber = 0;
00372       else wireNumber = this->Nwires(PlaneNo) - 1;
00373 
00374       throw larutil::LArUtilException(Form("Can't find nearest wire for (%g,%g,%g)",
00375                        worldLoc[0],worldLoc[1], worldLoc[2]));
00376 
00377     }
00378     /*
00379     std::cout<<"NearestWireID"<<std::endl;
00380     std::cout<<Form("(%g,%g,%g) position ... using (%g,%g,%g) ... Wire %d Plane %d",
00381                     worldLoc[0],worldLoc[1],worldLoc[2],
00382                     fOrthVectorsY[PlaneNo],
00383                     fOrthVectorsZ[PlaneNo],
00384                     fFirstWireProj[PlaneNo],
00385             wireNumber,PlaneNo)
00386              << std::endl;
00387     */
00388     return wireNumber;
00389   }

UInt_t larutil::Geometry::NearestWire ( const std::vector< Double_t > &  worldLoc,
const UInt_t  PlaneNo 
) const

nearest wire to input world coordinate

Definition at line 351 of file Geometry.cc.

References NearestWire().

00353   {
00354     TVector3 loc(&worldLoc[0]);
00355     return NearestWire(loc,PlaneNo);
00356   }

UInt_t larutil::Geometry::NearestWire ( const Double_t  worldLoc[3],
const UInt_t  PlaneNo 
) const

nearest wire to input world coordinates

Definition at line 344 of file Geometry.cc.

Referenced by larutil::GeometryUtilities::Get2DPointProjection(), larutil::GeometryUtilities::Get2DPointProjectionCM(), NearestChannel(), and NearestWire().

00346   {
00347     TVector3 loc(worldLoc);
00348     return NearestWire(loc,PlaneNo);
00349   }

UInt_t larutil::Geometry::NOpChannels (  )  const [inline]

Number of OpChannels in the detector.

Definition at line 54 of file Geometry.hh.

References fOpChannelVtx.

00055     { return fOpChannelVtx.size(); }

UInt_t larutil::Geometry::Nplanes (  )  const [inline]

Number of wire planes in TPC "tpc" of cryostat "cstat".

Definition at line 62 of file Geometry.hh.

References fPlanePitch.

Referenced by larutil::GeometryUtilities::CalculatePitch(), larutil::GeometryUtilities::CalculatePitchPolar(), LoadData(), Nwires(), PlaneOriginVtx(), PlaneWireToChannel(), and larutil::GeometryUtilities::Reconfigure().

00063     { return fPlanePitch.size(); }

UInt_t larutil::Geometry::Nviews (  )  const [inline]

Number of views (different wire orientations) in the detector.

Definition at line 58 of file Geometry.hh.

References fWirePitch.

Referenced by WireAngleToVertical(), and WirePitch().

00059     { return fWirePitch.size(); }

UInt_t larutil::Geometry::Nwires ( UInt_t  p  )  const

Number of wires in plane "p" of TPC "tpc" of cryostat "cstat".

Definition at line 241 of file Geometry.cc.

References fPlaneWireToChannelMap, larlight::DATA::INVALID_UINT, and Nplanes().

Referenced by NearestWire(), and larutil::GeometryUtilities::SelectPolygonHitList().

00242   {
00243     if(Nplanes() <= p) {
00244       throw LArUtilException(Form("Invalid plane ID :%d",p));
00245       return larlight::DATA::INVALID_UINT;
00246     }
00247 
00248     return fPlaneWireToChannelMap.at(p).size();
00249   }

void larutil::Geometry::PlaneOriginVtx ( UChar_t  plane,
Double_t *  vtx 
) const

Definition at line 715 of file Geometry.cc.

References fPlaneOriginVtx.

00716   {
00717     vtx[0] = fPlaneOriginVtx.at(plane)[0];
00718     vtx[1] = fPlaneOriginVtx.at(plane)[1];
00719     vtx[2] = fPlaneOriginVtx.at(plane)[2];
00720   }  

const std::vector< Double_t > & larutil::Geometry::PlaneOriginVtx ( UChar_t  plane  ) 

Definition at line 704 of file Geometry.cc.

References fPlaneOriginVtx, larlight::DATA::INVALID_DOUBLE, and Nplanes().

Referenced by larutil::GeometryUtilities::Get2DPointProjection(), larutil::GeometryUtilities::GetProjectedPoint(), and larutil::GeometryUtilities::GetTimeTicks().

00705   {
00706     if(plane >= fPlaneOriginVtx.size()) {
00707       throw LArUtilException(Form("Invalid plane number: %d",plane));
00708       fPlaneOriginVtx.push_back(std::vector<Double_t>(3,larlight::DATA::INVALID_DOUBLE));
00709       return fPlaneOriginVtx.at(this->Nplanes());
00710     }
00711 
00712     return fPlaneOriginVtx.at(plane);
00713   }

Double_t larutil::Geometry::PlanePitch ( const UChar_t  p1 = 0,
const UChar_t  p2 = 1 
) const

distance between planes p1 < p2

Definition at line 392 of file Geometry.cc.

References fPlanePitch, and larlight::DATA::INVALID_DOUBLE.

00393   {
00394     if( p1==p2 ) return 0;
00395     else if( (p1==0 && p2==1) || (p1==1 && p2==0) ) return fPlanePitch.at(0);
00396     else if( (p1==1 && p2==2) || (p1==2 && p2==1) ) return fPlanePitch.at(1);
00397     else if( (p1==0 && p2==2) || (p1==2 && p2==0) ) return fPlanePitch.at(2);
00398     else {
00399       throw LArUtilException("Plane number > 2 not supported!");
00400       return larlight::DATA::INVALID_DOUBLE;
00401     }
00402   }

larlight::GEO::SigType_t larutil::Geometry::PlaneToSignalType ( const UChar_t  plane  )  const

return the signal type for a given plane

Definition at line 279 of file Geometry.cc.

References fSignalType, and larlight::GEO::kMysteryType.

00280   {
00281     if(plane >= fSignalType.size()) {
00282       throw LArUtilException(Form("Invalid Plane number: %d",plane));
00283       return larlight::GEO::kMysteryType;
00284     }
00285 
00286     return fSignalType.at(plane);
00287   }

larlight::GEO::View_t larutil::Geometry::PlaneToView ( const UChar_t  plane  )  const

return the view type for a given plane

Definition at line 299 of file Geometry.cc.

References fViewType, and larlight::GEO::kUnknown.

Referenced by larutil::GeometryUtilities::CalculatePitch(), larutil::GeometryUtilities::CalculatePitchPolar(), larutil::GeometryUtilities::Get2DangleFrom3D(), LoadData(), larutil::GeometryUtilities::PitchInView(), and larutil::GeometryUtilities::Reconfigure().

00300   {
00301     if(plane >= fViewType.size()) {
00302       throw LArUtilException(Form("Invalid Plane number: %d",plane));
00303       return larlight::GEO::kUnknown;
00304     }
00305 
00306     return fViewType.at(plane);
00307   }

UInt_t larutil::Geometry::PlaneWireToChannel ( const UInt_t  plane,
const UInt_t  wire 
) const

convert plane, wire to channel

Definition at line 316 of file Geometry.cc.

References fPlaneWireToChannelMap, larlight::DATA::INVALID_UINT, and Nplanes().

Referenced by larutil::GeometryUtilities::GetProjectedPoint(), larutil::GeometryUtilities::GetYZ(), and NearestChannel().

00318   {
00319     if(plane >= Nplanes() || fPlaneWireToChannelMap.at(plane).size() >= wire) {
00320       throw LArUtilException(Form("Invalid (plane, wire) = (%d, %d)",plane,wire));
00321       return larlight::DATA::INVALID_UINT;
00322     }
00323     return fPlaneWireToChannelMap.at(plane).at(wire);
00324   }

void larlight::larlight_base::print ( MSG::Level  level,
std::string  msg 
) const [inline, inherited]

message print out method

Definition at line 56 of file larlight_base.hh.

00057     {if(_verbosity.at(level)) Message::send(level,msg);};

void larlight::larlight_base::print ( MSG::Level  level,
std::string  where,
std::string  msg 
) const [inline, inherited]
bool larutil::Geometry::ReadTree (  )  [protected, virtual]

Implements larutil::LArUtilBase.

Definition at line 94 of file Geometry.cc.

References larutil::LArUtilBase::_file_name, larutil::LArUtilBase::_tree_name, ClearData(), fChannelToPlaneMap, fChannelToWireMap, fCryoHalfHeight, fCryoHalfWidth, fCryoLength, fDetHalfHeight, fDetHalfWidth, fDetLength, fOpChannelVtx, fPlaneOriginVtx, fPlanePitch, fPlaneWireToChannelMap, fSignalType, fViewType, fWireAngle, fWireEndVtx, fWirePitch, and fWireStartVtx.

00095   {
00096     ClearData();
00097     
00098     TChain *ch = new TChain(_tree_name.c_str());
00099     ch->AddFile(_file_name.c_str());
00100     
00101     std::string error_msg("");
00102     if(!(ch->GetBranch("fDetLength")))      error_msg += "      fDetLength\n";
00103     if(!(ch->GetBranch("fDetHalfWidth")))   error_msg += "      fDetHalfWidth\n";
00104     if(!(ch->GetBranch("fDetHalfHeight")))  error_msg += "      fDetHalfHeight\n";
00105 
00106     if(!(ch->GetBranch("fCryoLength")))     error_msg += "      fCryoLength\n";
00107     if(!(ch->GetBranch("fCryoHalfWidth")))  error_msg += "      fCryoHalfWidth\n";
00108     if(!(ch->GetBranch("fCryoHalfHeight"))) error_msg += "      fCryoHalfHeight\n";
00109 
00110     if(!(ch->GetBranch("fChannelToPlaneMap")))     error_msg += "      fChannelToPlaneMap\n";
00111     if(!(ch->GetBranch("fChannelToWireMap")))      error_msg += "      fChannelToWireMap\n";
00112     if(!(ch->GetBranch("fPlaneWireToChannelMap"))) error_msg += "      fPlaneWireToChannelMap\n";
00113 
00114     if(!(ch->GetBranch("fSignalType"))) error_msg += "      fSignalType\n";
00115     if(!(ch->GetBranch("fViewType")))   error_msg += "      fViewType\n";
00116     if(!(ch->GetBranch("fPlanePitch"))) error_msg += "      fPlanePitch\n";
00117 
00118     //if(!(ch->GetBranch("fFirstWireStartVtx"))) error_msg += "      fFirstWireStartVtx\n";
00119     //if(!(ch->GetBranch("fFirstWireEndVtx")))   error_msg += "      fFirstWireEndVtx\n";
00120 
00121     if(!(ch->GetBranch("fWireStartVtx"))) error_msg += "      fWireStartVtx\n";
00122     if(!(ch->GetBranch("fWireEndVtx")))   error_msg += "      fWireEndVtx\n";
00123 
00124     if(!(ch->GetBranch("fWirePitch")))    error_msg += "      fWirePitch\n";
00125     if(!(ch->GetBranch("fWireAngle")))    error_msg += "      fWireAngle\n";
00126     if(!(ch->GetBranch("fOpChannelVtx"))) error_msg += "      fOpChannelVtx\n";
00127     
00128     if(!(ch->GetBranch("fPlaneOriginVtx"))) error_msg += "      fPlaneOriginVtx\n";
00129 
00130     if(!error_msg.empty()) {
00131 
00132       throw LArUtilException(Form("Missing following TBranches...\n%s",error_msg.c_str()));
00133 
00134       return false;
00135     }
00136 
00137     // Vectors with length = # channels
00138     std::vector<UChar_t>                *pChannelToPlaneMap = nullptr;
00139     std::vector<UShort_t>               *pChannelToWireMap = nullptr;
00140 
00141     // Vectors with length = # planes
00142     std::vector<std::vector<UShort_t> >   *pPlaneWireToChannelMap = nullptr;
00143     std::vector<larlight::GEO::SigType_t> *pSignalType = nullptr;
00144     std::vector<larlight::GEO::View_t>    *pViewType = nullptr;
00145     std::vector<Double_t>                 *pPlanePitch = nullptr;
00146     //std::vector<std::vector<Double_t> >   *pFirstWireStartVtx = nullptr;
00147     //std::vector<std::vector<Double_t> >   *pFirstWireEndVtx = nullptr;
00148     std::vector<std::vector<std::vector<Double_t> > >  *pWireStartVtx = nullptr;
00149     std::vector<std::vector<std::vector<Double_t> > >  *pWireEndVtx = nullptr;
00150     std::vector<std::vector<Double_t> >  *pPlaneOriginVtx = nullptr;
00151 
00152     // Vectors with length = view
00153     std::vector<Double_t> *pWirePitch = nullptr;
00154     std::vector<Double_t> *pWireAngle = nullptr;
00155 
00156     std::vector<std::vector<Float_t> > *pOpChannelVtx = nullptr;
00157 
00158     ch->SetBranchAddress("fDetLength",&fDetLength);
00159     ch->SetBranchAddress("fDetHalfWidth",&fDetHalfWidth);
00160     ch->SetBranchAddress("fDetHalfHeight",&fDetHalfHeight);
00161 
00162     ch->SetBranchAddress("fCryoLength",&fCryoLength);
00163     ch->SetBranchAddress("fCryoHalfWidth",&fCryoHalfWidth);
00164     ch->SetBranchAddress("fCryoHalfHeight",&fCryoHalfHeight);
00165 
00166     ch->SetBranchAddress("fChannelToWireMap",  &pChannelToWireMap);
00167     ch->SetBranchAddress("fChannelToPlaneMap", &pChannelToPlaneMap);
00168     ch->SetBranchAddress("fPlaneWireToChannelMap",&pPlaneWireToChannelMap);
00169 
00170     ch->SetBranchAddress("fSignalType",&pSignalType);
00171     ch->SetBranchAddress("fViewType",&pViewType);
00172     ch->SetBranchAddress("fPlanePitch",&pPlanePitch);
00173 
00174     //ch->SetBranchAddress("fFirstWireStartVtx",&pFirstWireStartVtx);
00175     //ch->SetBranchAddress("fFirstWireEndVtx",&pFirstWireEndVtx);
00176     ch->SetBranchAddress("fWireStartVtx",&pWireStartVtx);
00177     ch->SetBranchAddress("fWireEndVtx",&pWireEndVtx);
00178     ch->SetBranchAddress("fPlaneOriginVtx",&pPlaneOriginVtx);
00179 
00180     ch->SetBranchAddress("fWirePitch",&pWirePitch);
00181     ch->SetBranchAddress("fWireAngle",&pWireAngle);
00182 
00183     ch->SetBranchAddress("fOpChannelVtx",&pOpChannelVtx);
00184 
00185     ch->GetEntry(0);
00186 
00187     // Copy channelw-sie variables
00188     size_t n_channels = pChannelToPlaneMap->size();
00189     fChannelToPlaneMap.reserve(n_channels);
00190     fChannelToWireMap.reserve(n_channels);
00191     for(size_t i=0; i<n_channels; ++i) {
00192       fChannelToPlaneMap.push_back(pChannelToPlaneMap->at(i));
00193       fChannelToWireMap.push_back(pChannelToWireMap->at(i));
00194     }
00195 
00196     // Copy plane-wise variables
00197     size_t n_planes = pPlaneWireToChannelMap->size();
00198     fPlaneWireToChannelMap.reserve(n_planes);
00199     fSignalType.reserve(n_planes);
00200     fViewType.reserve(n_planes);
00201     fPlanePitch.reserve(n_planes);
00202     //fFirstWireStartVtx.reserve(n_planes);
00203     //fFirstWireEndVtx.reserve(n_planes);
00204     fWireStartVtx.reserve(n_planes);
00205     fWireEndVtx.reserve(n_planes);
00206     fPlaneOriginVtx.reserve(n_planes);
00207     for(size_t i=0; i<n_planes; ++i) {
00208       fPlaneWireToChannelMap.push_back(pPlaneWireToChannelMap->at(i));
00209       fSignalType.push_back(pSignalType->at(i));
00210       fViewType.push_back(pViewType->at(i));
00211       fPlanePitch.push_back(pPlanePitch->at(i));
00212       //fFirstWireStartVtx.push_back(pFirstWireStartVtx->at(i));
00213       //fFirstWireEndVtx.push_back(pFirstWireEndVtx->at(i));
00214       fWireStartVtx.push_back(pWireStartVtx->at(i));
00215       fWireEndVtx.push_back(pWireEndVtx->at(i));
00216 
00217       fPlaneOriginVtx.push_back(pPlaneOriginVtx->at(i));
00218     }
00219 
00220 
00221     // Copy view-wise variables
00222     size_t n_views = pWirePitch->size();
00223     fWirePitch.reserve(n_views);
00224     fWireAngle.reserve(n_views);
00225     for(size_t i=0; i<n_views; ++i) {
00226       fWirePitch.push_back(pWirePitch->at(i));
00227       fWireAngle.push_back(pWireAngle->at(i));
00228     }
00229 
00230     // Copy op-channel-wise variables
00231     size_t n_opchannel = pOpChannelVtx->size();
00232     fOpChannelVtx.reserve(n_opchannel);
00233     for(size_t i=0; i<n_opchannel; ++i)
00234       fOpChannelVtx.push_back(pOpChannelVtx->at(i));
00235 
00236     delete ch;
00237     return true;
00238   }

void larlight::larlight_base::set_verbosity ( MSG::Level  level  )  [virtual, inherited]

Setter for the verbosity level.

Reimplemented in larlight::ana_processor.

Definition at line 8 of file larlight_base.cc.

References larlight::larlight_base::_verbosity, larlight::larlight_base::_verbosity_level, larlight::MSG::DEBUG, larlight::MSG::ERROR, larlight::MSG::INFO, larlight::MSG::MSG_TYPE_MAX, larlight::MSG::NORMAL, and larlight::MSG::WARNING.

Referenced by larlight::larlight_base::larlight_base(), main(), and larlight::ana_processor::set_verbosity().

00010   {
00011     
00012     _verbosity_level=level;
00013     
00014     for(size_t i=(size_t)(MSG::DEBUG); i<(size_t)(MSG::MSG_TYPE_MAX); ++i)
00015       _verbosity[i]=false;
00016     
00017     switch(level){
00018     case MSG::DEBUG:
00019       _verbosity[MSG::DEBUG]=true;
00020     case MSG::INFO:
00021       _verbosity[MSG::INFO]=true;
00022     case MSG::NORMAL:
00023       _verbosity[MSG::NORMAL]=true;
00024     case MSG::WARNING:
00025       _verbosity[MSG::WARNING]=true;
00026     case MSG::ERROR:
00027       _verbosity[MSG::ERROR]=true;
00028     case MSG::MSG_TYPE_MAX:
00029       break;
00030     }
00031     
00032   }

void larutil::LArUtilBase::SetFileName ( const std::string  filename  )  [inline, inherited]

Method to set data file name.

Definition at line 44 of file LArUtilBase.hh.

References larutil::LArUtilBase::_file_name.

Referenced by larutil::LArUtilManager::ReconfigureUtilities().

00045     { _file_name = filename; }

void larutil::LArUtilBase::SetTreeName ( const std::string  treename  )  [inline, inherited]

Method to set data TTree name.

Definition at line 48 of file LArUtilBase.hh.

References larutil::LArUtilBase::_tree_name.

Referenced by larutil::LArUtilManager::ReconfigureUtilities().

00049     { _tree_name = treename; }

larlight::GEO::SigType_t larutil::Geometry::SignalType ( const UInt_t  channel  )  const

convert channel number to list of possible WireIDs

return the signal type for a given channel

Definition at line 269 of file Geometry.cc.

References fChannelToPlaneMap, fSignalType, and larlight::GEO::kMysteryType.

00270   {
00271     if(ch >= fChannelToPlaneMap.size()) {
00272       throw LArUtilException(Form("Invalid Channel number :%d",ch));
00273       return larlight::GEO::kMysteryType;
00274     }
00275     
00276     return fSignalType.at(fChannelToPlaneMap.at(ch));
00277   }

bool larutil::Geometry::ValueInRange ( const Double_t  value,
Double_t  min,
Double_t  max 
) const [inline]

volume box

The following functions are utilized to determine if two wires in the TPC intersect or not, and if they do then determine the coordinates of the intersection. Starting point of wire is end with lower z-coordinate.

Definition at line 189 of file Geometry.hh.

Referenced by ChannelsIntersect().

00190     {  if(min>max) std::swap(min,max); return ( (min <= value) && (value <= max) ); }

larlight::GEO::View_t larutil::Geometry::View ( const UInt_t  channel  )  const

return the view type for a given channel

Definition at line 289 of file Geometry.cc.

References fChannelToPlaneMap, fViewType, and larlight::GEO::kUnknown.

00290   {
00291     if(ch >= fChannelToPlaneMap.size()) {
00292       throw LArUtilException(Form("Invalid Channel number :%d",ch));
00293       return larlight::GEO::kUnknown;
00294     }
00295     
00296     return fViewType.at(fChannelToPlaneMap.at(ch));
00297   }

std::set< larlight::GEO::View_t > const larutil::Geometry::Views (  )  const

return vector of possible views in the detector

Definition at line 309 of file Geometry.cc.

References fViewType.

00310   {
00311     std::set<larlight::GEO::View_t> views;
00312     for(auto const v : fViewType) views.insert(v);
00313     return views;
00314   }

Double_t larutil::Geometry::WireAngleToVertical ( larlight::GEO::View_t  view  )  const

assumes all wires in the view have the same angle

Definition at line 431 of file Geometry.cc.

References fWireAngle, larlight::DATA::INVALID_DOUBLE, and Nviews().

Referenced by larutil::GeometryUtilities::CalculatePitch(), larutil::GeometryUtilities::CalculatePitchPolar(), larutil::GeometryUtilities::Get2DangleFrom3D(), LoadData(), larutil::GeometryUtilities::PitchInView(), and larutil::GeometryUtilities::Reconfigure().

00432   { 
00433     if((size_t)view > Nviews()) {
00434       throw LArUtilException(Form("Invalid view: %d",view));
00435       return larlight::DATA::INVALID_DOUBLE;
00436     }
00437 
00438     return fWireAngle.at((size_t)view);
00439   }

void larutil::Geometry::WireEndPoints ( const UChar_t  plane,
const UInt_t  wire,
Double_t *  xyzStart,
Double_t *  xyzEnd 
) const

Definition at line 442 of file Geometry.cc.

References fWireEndVtx, and fWireStartVtx.

Referenced by ChannelsIntersect(), and IntersectionPoint().

00445   {
00446 
00447     if(plane >= fWireStartVtx.size())  {
00448       throw LArUtilException(Form("Plane %d invalid!",plane));
00449       return;
00450     }
00451     if(wire >= fWireStartVtx.at(plane).size()) {
00452       throw LArUtilException(Form("Wire %d invalid!",wire));
00453       return;
00454     }
00455 
00456     xyzStart[0] = fWireStartVtx.at(plane).at(wire).at(0);
00457     xyzStart[1] = fWireStartVtx.at(plane).at(wire).at(1);
00458     xyzStart[2] = fWireStartVtx.at(plane).at(wire).at(2);
00459     xyzEnd[0]   = fWireEndVtx.at(plane).at(wire).at(0);
00460     xyzEnd[1]   = fWireEndVtx.at(plane).at(wire).at(1);
00461     xyzEnd[2]   = fWireEndVtx.at(plane).at(wire).at(2);
00462 
00463   }

Double_t larutil::Geometry::WirePitch ( const larlight::GEO::View_t  view  )  const

assumes all planes in a view have the same pitch

Definition at line 421 of file Geometry.cc.

References fWirePitch, larlight::DATA::INVALID_DOUBLE, and Nviews().

00422   {
00423     if((size_t)view > Nviews()) {
00424       throw LArUtilException(Form("Invalid view: %d",view));
00425       return larlight::DATA::INVALID_DOUBLE;
00426     }
00427 
00428     return fWirePitch.at((size_t)view);
00429   }

Double_t larutil::Geometry::WirePitch ( const UInt_t  w1 = 0,
const UInt_t  w2 = 1,
const UChar_t  plane = 0 
) const

distance between wires on the same plane w1 < w2

Definition at line 404 of file Geometry.cc.

References fPlaneWireToChannelMap, fViewType, fWirePitch, and larlight::DATA::INVALID_DOUBLE.

Referenced by larutil::GeometryUtilities::CalculatePitch(), larutil::GeometryUtilities::CalculatePitchPolar(), LoadData(), larutil::GeometryUtilities::PitchInView(), and larutil::GeometryUtilities::Reconfigure().

00407   {
00408     if( w1 > w2 && w1 >= fPlaneWireToChannelMap.at(plane).size() ) {
00409       throw LArUtilException(Form("Invalid wire number: %d",w1));
00410       return larlight::DATA::INVALID_DOUBLE;
00411     }
00412     if( w2 > w1 && w2 >= fPlaneWireToChannelMap.at(plane).size() ) {
00413       throw LArUtilException(Form("Invalid wire number: %d",w2));
00414       return larlight::DATA::INVALID_DOUBLE;
00415     }
00416 
00417     return ( w1 < w2 ? (w2-w1)*(fWirePitch.at(fViewType.at(plane))) : (w1-w2)*(fWirePitch.at(fViewType.at(plane))));
00418   }


Member Data Documentation

char larlight::larlight_base::_buf[200] [protected, inherited]

char buffer for message manipulation

Definition at line 57 of file larlight_base.hh.

Referenced by larlight::storage_manager::open(), larlight::storage_manager::prepare_tree(), and larlight::ana_processor::run().

std::string larutil::LArUtilBase::_file_name [protected, inherited]
bool larutil::LArUtilBase::_loaded [protected, inherited]
Geometry * larutil::Geometry::_me = 0 [static, private]

Definition at line 34 of file Geometry.hh.

Referenced by GetME().

std::string larlight::larlight_base::_name [protected, inherited]
std::string larutil::LArUtilBase::_tree_name [protected, inherited]
std::vector<bool> larlight::larlight_base::_verbosity [protected, inherited]
MSG::Level larlight::larlight_base::_verbosity_level [protected, inherited]

holder for specified verbosity level

Definition at line 63 of file larlight_base.hh.

Referenced by larlight::larlight_base::get_verbosity(), larlight::ana_processor::initialize(), and larlight::larlight_base::set_verbosity().

std::vector<UChar_t> larutil::Geometry::fChannelToPlaneMap [private]

Definition at line 237 of file Geometry.hh.

Referenced by ChannelsIntersect(), ChannelToPlane(), ClearData(), ReadTree(), SignalType(), and View().

std::vector<UShort_t> larutil::Geometry::fChannelToWireMap [private]

Definition at line 238 of file Geometry.hh.

Referenced by ChannelsIntersect(), ChannelToWire(), ClearData(), Nchannels(), and ReadTree().

Definition at line 155 of file Geometry.hh.

Referenced by ClearData(), CryostatHalfHeight(), and ReadTree().

Definition at line 154 of file Geometry.hh.

Referenced by ClearData(), CryostatHalfWidth(), and ReadTree().

Double_t larutil::Geometry::fCryoLength [private]

Definition at line 153 of file Geometry.hh.

Referenced by ClearData(), CryostatLength(), and ReadTree().

Definition at line 151 of file Geometry.hh.

Referenced by ClearData(), DetHalfHeight(), and ReadTree().

Definition at line 150 of file Geometry.hh.

Referenced by ClearData(), DetHalfWidth(), and ReadTree().

Double_t larutil::Geometry::fDetLength [private]

boundaries of cryostat, 3 pairs of +/- coord

Definition at line 149 of file Geometry.hh.

Referenced by ClearData(), DetLength(), and ReadTree().

std::vector<Double_t> larutil::Geometry::fFirstWireProj [private]

Definition at line 262 of file Geometry.hh.

Referenced by LoadData(), and NearestWire().

std::vector<std::vector<Float_t> > larutil::Geometry::fOpChannelVtx [private]
std::vector<Double_t> larutil::Geometry::fOrthVectorsY [private]

Definition at line 260 of file Geometry.hh.

Referenced by LoadData(), and NearestWire().

std::vector<Double_t> larutil::Geometry::fOrthVectorsZ [private]

Definition at line 261 of file Geometry.hh.

Referenced by LoadData(), and NearestWire().

std::vector<std::vector<Double_t> > larutil::Geometry::fPlaneOriginVtx [private]

Definition at line 251 of file Geometry.hh.

Referenced by ClearData(), PlaneOriginVtx(), and ReadTree().

std::vector<Double_t> larutil::Geometry::fPlanePitch [private]

Definition at line 244 of file Geometry.hh.

Referenced by ClearData(), Nplanes(), PlanePitch(), and ReadTree().

std::vector<std::vector<UShort_t> > larutil::Geometry::fPlaneWireToChannelMap [private]

Definition at line 239 of file Geometry.hh.

Referenced by ClearData(), Nwires(), PlaneWireToChannel(), ReadTree(), and WirePitch().

Definition at line 242 of file Geometry.hh.

Referenced by ClearData(), PlaneToSignalType(), ReadTree(), and SignalType().

std::vector<Double_t> larutil::Geometry::fWireAngle [private]
std::vector<std::vector<std::vector<Double_t > > > larutil::Geometry::fWireEndVtx [private]

Definition at line 249 of file Geometry.hh.

Referenced by ClearData(), LoadData(), ReadTree(), and WireEndPoints().

std::vector<Double_t> larutil::Geometry::fWirePitch [private]

Definition at line 254 of file Geometry.hh.

Referenced by ClearData(), Nviews(), ReadTree(), and WirePitch().

std::vector<std::vector<std::vector<Double_t > > > larutil::Geometry::fWireStartVtx [private]

Definition at line 248 of file Geometry.hh.

Referenced by ClearData(), LoadData(), ReadTree(), and WireEndPoints().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator

Generated on 3 Jun 2014 for MyProject by  doxygen 1.6.1