Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AlignmentStrip.cxx

Go to the documentation of this file.
00001 /***************************************************************************
00002         
00003  Simple strip object for internal alignment use
00004 
00005  ***************************************************************************/
00006 
00007 #include <cmath>
00008 
00009 #include "AlignmentStrip.h"
00010 #include "RecoBase/CandStripHandle.h"
00011 #include "NtpAlignCandStrip.h"
00012 #include "NtpAlignTrackStrip.h"
00013 
00014 AlignmentStrip::AlignmentStrip()
00015    :plexseid(0),
00016     plane(0),
00017     strip(0),
00018     ndigit(0),
00019     charge(0.0),
00020     charge_pc(0.0),
00021     tpos(0.0),
00022     tposrelmdl(0.0),
00023     lposrelmdl(0.0),
00024     zpos(0.0),
00025     pigtail(0.0),
00026     wlsbypass(0.0),
00027     begtime(0.0),
00028     endtime(0.0),
00029     residual(100.0),
00030     ghitpos(0.0),
00031     lhitpos(0.0),
00032     length(0.0),
00033     goodhit(true)
00034 {
00035 }
00036 
00037 AlignmentStrip::AlignmentStrip(const CandStripHandle* csh)
00038    :plexseid(0),
00039     plane(0),
00040     strip(0),
00041     ndigit(0),
00042     charge(0.0),
00043     charge_pc(0.0),
00044     tpos(0.0),
00045     tposrelmdl(0.0),
00046     lposrelmdl(0.0),
00047     zpos(0.0),
00048     pigtail(0.0),
00049     wlsbypass(0.0),
00050     begtime(0.0),
00051     endtime(0.0),
00052     residual(100.0),
00053     ghitpos(0.0),
00054     lhitpos(0.0),
00055     length(0.0),
00056     goodhit(true)
00057 {
00058    if(csh){
00059       plexseid = csh->GetStripEndId().GetEncoded();
00060       ndigit   = csh->GetNDigit();
00061       charge   = csh->GetCharge(CalDigitType::kNone);
00062       tpos     = csh->GetTPos();
00063       zpos     = csh->GetZPos();
00064       begtime  = csh->GetBegTime();
00065       endtime  = csh->GetEndTime();
00066      
00067    }
00068 }
00069 
00070 AlignmentStrip::AlignmentStrip(const NtpAlignTrackStrip* strip)
00071    :plexseid(0),
00072     plane(0),
00073     strip(0),
00074     ndigit(0),
00075     charge(0.0),
00076     charge_pc(0.0),
00077     tpos(0.0),
00078     tposrelmdl(0.0),
00079     lposrelmdl(0.0),
00080     zpos(0.0),
00081     pigtail(0.0),
00082     wlsbypass(0.0),
00083     begtime(0.0),
00084     endtime(0.0),
00085     residual(100.0),
00086     ghitpos(0.0),
00087     lhitpos(0.0),
00088     length(0.0),
00089     goodhit(true)
00090 {
00091    plexseid = strip->plexseid;
00092    ndigit   = strip->ndigit;
00093    charge   = strip->charge;
00094    residual = strip->residual;
00095    begtime  = strip->begtime;
00096 }
00097 
00098 AlignmentStrip::AlignmentStrip(const NtpAlignCandStrip* strip)
00099    :plexseid(0),
00100     plane(0),
00101     strip(0),
00102     ndigit(0),
00103     charge(0.0),
00104     charge_pc(0.0),
00105     tpos(0.0),
00106     tposrelmdl(0.0),
00107     lposrelmdl(0.0),
00108     zpos(0.0),
00109     pigtail(0.0),
00110     wlsbypass(0.0),
00111     begtime(0.0),
00112     endtime(0.0),
00113     residual(100.0),
00114     ghitpos(0.0),
00115     lhitpos(0.0),
00116     length(0.0),
00117     goodhit(true)
00118 {
00119    plexseid = strip->plexseid;
00120    ndigit   = strip->ndigit;
00121    charge   = strip->charge;
00122    begtime  = strip->begtime;
00123    
00124 }
00125 
00126 
00127 bool AlignmentStrip::operator<(const AlignmentStrip &right ) const
00128 { 
00129    if(plexseid < right.plexseid)
00130       return true; 
00131    if(plexseid > right.plexseid)
00132       return false;
00133    if(begtime < right.begtime)
00134       return true;
00135    return false;
00136 }
00137 
00138 bool AlignmentStrip::operator<=(const AlignmentStrip &right ) const
00139 { 
00140    if(plexseid <= right.plexseid)
00141       return true;
00142    return false;
00143 }
00144 
00145 bool AlignmentStrip::operator>(const AlignmentStrip &right ) const
00146 { 
00147    if(plexseid > right.plexseid)
00148       return true; 
00149    if(plexseid < right.plexseid)
00150       return false;
00151    if(begtime <= right.begtime)
00152       return true;
00153    return false;
00154 }
00155 
00156 bool AlignmentStrip::operator>=(const AlignmentStrip &right ) const
00157 { 
00158    if(plexseid >= right.plexseid)
00159       return true; 
00160    return false;
00161 }
00162 
00163 bool AlignmentStrip::operator==(const AlignmentStrip &right ) const
00164 {
00165    // if the same PlexStripEndId and begtime are within 1 ns - return true
00166    if(plexseid == right.plexseid && fabs(begtime-right.begtime) < 0.000000002)
00167          return true; 
00168    return false;
00169 }
00170 
00171 bool AlignmentStrip::operator!=(const AlignmentStrip &right ) const
00172 { 
00173    if(plexseid != right.plexseid)
00174       return true; 
00175    return false;
00176 }

Generated on Mon Feb 15 11:06:21 2010 for loon by  doxygen 1.3.9.1