Anp::Strip Class Reference

#include <Strip.h>

List of all members.

Classes

struct  TrackInfo

Public Types

typedef std::map< Short_t,
TrackInfo
TrackInfoMap
typedef std::map< Short_t,
TrackInfo >::const_iterator 
TrackInfoIter

Public Member Functions

 Strip ()
 ~Strip ()
bool Add (int key, float data)
void Clear ()
short Index () const
const std::vector< Short_t > & EvtIndex () const
const std::vector< Short_t > & TrkIndex () const
const std::vector< Short_t > & ShwIndex () const
const std::vector< Short_t > & SlcIndex () const
bool MatchEvt (short key) const
bool MatchShw (short key) const
bool MatchSlc (short key) const
bool MatchTrk (short key) const
unsigned short GetStrip () const
unsigned short GetPlane () const
unsigned short GetDigit () const
char GetPlaneView () const
unsigned int GetEncoded () const
float TPos () const
float ZPos () const
float ADC () const
float PE () const
float SigLin () const
float SigCor () const
float SigCorEast () const
float SigCorWest () const
double Time () const
double EastTime () const
double WestTime () const
bool IsUview () const
bool IsVview () const
TrackInfoIter GetInfo (short track_index) const
TrackInfoIter InfoBegIter () const
TrackInfoIter InfoEndIter () const
bool KeyExists (short key) const
float operator[] (short key) const
float DataAt (short key) const
DataIter DataBeg () const
DataIter DataEnd () const
void Print (std::ostream &os=std::cout) const

Private Attributes

Short_t index
UShort_t strip
UShort_t plane
UShort_t ndigit
Char_t planeview
Float_t tpos
Float_t zpos
Float_t adc
Float_t pe
Float_t siglin
Float_t sigcor0
Float_t sigcor1
Double_t time0
Double_t time1
Int_t pmtindex0
Int_t pmtindex1
UInt_t seid
std::vector< Short_t > evt
std::vector< Short_t > trk
std::vector< Short_t > shw
std::vector< Short_t > slc
TrackInfoMap trk_info
DataVec fData

Friends

class FillStrip

Detailed Description

Definition at line 23 of file PhysicsNtuple/HEAD/Strip.h.


Member Typedef Documentation

typedef std::map<Short_t, TrackInfo>::const_iterator Anp::Strip::TrackInfoIter

Definition at line 40 of file PhysicsNtuple/HEAD/Strip.h.

typedef std::map<Short_t, TrackInfo> Anp::Strip::TrackInfoMap

Definition at line 39 of file PhysicsNtuple/HEAD/Strip.h.


Constructor & Destructor Documentation

Anp::Strip::Strip (  ) 

Definition at line 27 of file PhysicsNtuple/HEAD/Strip.cxx.

00028    :index    (-1),
00029     strip    (0),
00030     plane    (0),
00031     ndigit   (0),
00032     planeview('0'),
00033     tpos     (-1.0e6),
00034     zpos     (-1.0e6),
00035     adc      (-1.0e6),
00036     pe       (-1.0e6),
00037     siglin   (-1.0e6),
00038     sigcor0  (-1.0e6),
00039     sigcor1  (-1.0e6),
00040     time0    (-1.0e6),
00041     time1    (-1.0e6),
00042     pmtindex0(-1),
00043     pmtindex1(-1),
00044     seid     (0)
00045 {
00046 }

Anp::Strip::~Strip (  ) 

Definition at line 49 of file PhysicsNtuple/HEAD/Strip.cxx.

00050 {
00051 }


Member Function Documentation

float Anp::Strip::ADC (  )  const [inline]

Definition at line 180 of file PhysicsNtuple/HEAD/Strip.h.

References adc.

00180 { return adc; }

bool Anp::Strip::Add ( int  key,
float  data 
)

Definition at line 83 of file PhysicsNtuple/HEAD/Strip.cxx.

References fData, and KeyExists().

00084 { 
00085    //
00086    // Add data at key, if key does not already exits 
00087    //
00088 
00089    assert(std::abs(key) < SHRT_MAX && "key is out of range");
00090    
00091    if(KeyExists(key))
00092    {
00093       cerr << "Strip::Add(" << key << ") - key already exists" << endl;
00094       return false;
00095    }
00096    
00097    fData.push_back(Anp::Data(short(key), data));
00098    return true;
00099 }

void Anp::Strip::Clear ( void   ) 

Definition at line 54 of file PhysicsNtuple/HEAD/Strip.cxx.

References adc, evt, fData, index, ndigit, pe, plane, planeview, pmtindex0, pmtindex1, seid, shw, sigcor0, sigcor1, siglin, slc, strip, time0, time1, tpos, trk, trk_info, and zpos.

00055 {   
00056    index     = -1;
00057    strip     = 0;
00058    plane     = 0;
00059    ndigit    = 0;
00060    planeview = '0';
00061    tpos      = -1.0e6;
00062    zpos      = -1.0e6;
00063    adc       = -1.0e6;
00064    pe        = -1.0e6;
00065    siglin    = -1.0e6;
00066    sigcor0   = -1.0e6;
00067    sigcor1   = -1.0e6;
00068    time0     = -1.0e6;
00069    time1     = -1.0e6;
00070    pmtindex0 = -1;
00071    pmtindex1 = -1;
00072    seid      = 0;
00073 
00074    evt.clear();
00075    shw.clear();
00076    slc.clear();
00077    trk.clear();
00078    trk_info.clear();
00079    fData.clear();
00080 }

float Anp::Strip::DataAt ( short  key  )  const

Definition at line 188 of file PhysicsNtuple/HEAD/Strip.cxx.

References fData, find(), and it.

Referenced by operator[]().

00189 {
00190    DataIter it = std::find(fData.begin(), fData.end(), key);
00191    if(it == fData.end())
00192    {
00193       std::cerr << "Strip::DataAt(" << key << ") - key does not exist" << std::endl;
00194       return -1.0e6;
00195    }
00196    
00197    return it -> Data();
00198 }

DataIter Anp::Strip::DataBeg (  )  const [inline]

Definition at line 214 of file PhysicsNtuple/HEAD/Strip.h.

References fData.

00214 { return fData.begin(); }

DataIter Anp::Strip::DataEnd (  )  const [inline]

Definition at line 215 of file PhysicsNtuple/HEAD/Strip.h.

References fData.

00215 { return fData.end(); }

double Anp::Strip::EastTime (  )  const [inline]

Definition at line 191 of file PhysicsNtuple/HEAD/Strip.h.

References time0.

00191 { return time0; }

const std::vector< Short_t > & Anp::Strip::EvtIndex (  )  const [inline]

Definition at line 160 of file PhysicsNtuple/HEAD/Strip.h.

References evt.

00160 { return evt; }

unsigned short Anp::Strip::GetDigit (  )  const [inline]

Definition at line 167 of file PhysicsNtuple/HEAD/Strip.h.

References ndigit.

00167 { return ndigit; }

unsigned int Anp::Strip::GetEncoded (  )  const [inline]

Definition at line 173 of file PhysicsNtuple/HEAD/Strip.h.

References seid.

Referenced by Anp::FillMuonId::Get(), Anp::Pmt::IsSamePmt(), Anp::FillShortVar::OtherStripEnergy(), and Anp::PmtHit::Plot().

00174    {
00175       return seid;
00176    }

Anp::Strip::TrackInfoIter Anp::Strip::GetInfo ( short  track_index  )  const

Definition at line 102 of file PhysicsNtuple/HEAD/Strip.cxx.

References trk_info.

00103 {
00104    TrackInfoIter fit = trk_info.find(track_index);
00105    if(fit != trk_info.end())
00106    {
00107       return fit;
00108    }
00109    
00110    std::cerr << "Failed to find info for track with index " << track_index << std::endl;
00111    return trk_info.end();
00112 }

unsigned short Anp::Strip::GetPlane (  )  const [inline]
char Anp::Strip::GetPlaneView ( void   )  const [inline]

Definition at line 169 of file PhysicsNtuple/HEAD/Strip.h.

References planeview.

00170    {
00171       return planeview;
00172    }

unsigned short Anp::Strip::GetStrip (  )  const [inline]
short Anp::Strip::Index (  )  const [inline]

Definition at line 156 of file PhysicsNtuple/HEAD/Strip.h.

References index.

Referenced by Anp::operator==().

00157    {
00158       return index;
00159    }

Strip::TrackInfoIter Anp::Strip::InfoBegIter (  )  const [inline]

Definition at line 211 of file PhysicsNtuple/HEAD/Strip.h.

References trk_info.

00211 { return trk_info.begin(); }

Strip::TrackInfoIter Anp::Strip::InfoEndIter (  )  const [inline]

Definition at line 212 of file PhysicsNtuple/HEAD/Strip.h.

References trk_info.

00212 { return trk_info.end(); }

bool Anp::Strip::IsUview (  )  const

Definition at line 142 of file PhysicsNtuple/HEAD/Strip.cxx.

References planeview.

Referenced by Anp::FillMuonId::Get(), and Anp::FillShortVar::OtherStripEnergy().

00143 {
00144    if(int(planeview) == 2)
00145    {
00146       return true;
00147    }
00148    else if(int(planeview) == 3)
00149    {
00150       return false;
00151    }
00152 
00153    std::cerr << "Strip::IsUview - this strip is not initialized" << std::endl;
00154 
00155    return false;
00156 }

bool Anp::Strip::IsVview (  )  const

Definition at line 159 of file PhysicsNtuple/HEAD/Strip.cxx.

References planeview.

00160 {
00161    if(int(planeview) == 3)
00162    {
00163       return true;
00164    }
00165    else if(int(planeview) == 2)
00166    {
00167       return false;
00168    }
00169    
00170    std::cerr << "Strip::IsUview - this strip is not initialized" << std::endl;
00171 
00172    return false;
00173 }

bool Anp::Strip::KeyExists ( short  key  )  const

Definition at line 176 of file PhysicsNtuple/HEAD/Strip.cxx.

References fData, and find().

Referenced by Add().

00177 {
00178    return std::find(fData.begin(), fData.end(), key) != fData.end();
00179 }

bool Anp::Strip::MatchEvt ( short  key  )  const [inline]

Definition at line 194 of file PhysicsNtuple/HEAD/Strip.h.

References evt, and find().

00195    {
00196       return std::find(evt.begin(), evt.end(), key) != evt.end();
00197    }

bool Anp::Strip::MatchShw ( short  key  )  const [inline]

Definition at line 198 of file PhysicsNtuple/HEAD/Strip.h.

References find(), and shw.

00199    {
00200       return std::find(shw.begin(), shw.end(), key) != shw.end();
00201    }

bool Anp::Strip::MatchSlc ( short  key  )  const [inline]

Definition at line 202 of file PhysicsNtuple/HEAD/Strip.h.

References find(), and slc.

00203    {
00204       return std::find(slc.begin(), slc.end(), key) != slc.end();
00205    }

bool Anp::Strip::MatchTrk ( short  key  )  const [inline]

Definition at line 206 of file PhysicsNtuple/HEAD/Strip.h.

References find(), and trk.

00207    {
00208       return std::find(trk.begin(), trk.end(), key) != trk.end();
00209    }

float Anp::Strip::operator[] ( short  key  )  const

Definition at line 182 of file PhysicsNtuple/HEAD/Strip.cxx.

References DataAt().

00183 {
00184    return DataAt(key);
00185 }

float Anp::Strip::PE (  )  const [inline]

Definition at line 181 of file PhysicsNtuple/HEAD/Strip.h.

References pe.

Referenced by Anp::PmtHit::Plot().

00181 { return pe; }

void Anp::Strip::Print ( std::ostream &  os = std::cout  )  const

Definition at line 201 of file PhysicsNtuple/HEAD/Strip.cxx.

References adc, index, plane, planeview, strip, Time(), tpos, and zpos.

00202 {   
00203    os << "Strip::Print" << endl
00204       << "   index=" << index << endl
00205       << "   strip=" << strip << endl
00206       << "   plane=" << plane << endl
00207       << "   planeview=" << short(planeview) << endl
00208       << "   tpos=" << tpos << endl
00209       << "   zpos=" << zpos << endl
00210       << "   adc=" << adc << endl
00211       << "   time=" << Time() << endl;
00212 }

const std::vector< Short_t > & Anp::Strip::ShwIndex (  )  const [inline]

Definition at line 162 of file PhysicsNtuple/HEAD/Strip.h.

References shw.

00162 { return shw; }

float Anp::Strip::SigCor (  )  const [inline]
float Anp::Strip::SigCorEast (  )  const [inline]

Definition at line 188 of file PhysicsNtuple/HEAD/Strip.h.

References sigcor0.

Referenced by Anp::FillMuonId::Get(), and Anp::FillShortVar::OtherStripEnergy().

00188 { return sigcor0; }

float Anp::Strip::SigCorWest (  )  const [inline]

Definition at line 189 of file PhysicsNtuple/HEAD/Strip.h.

References sigcor1.

Referenced by Anp::FillMuonId::Get(), and Anp::FillShortVar::OtherStripEnergy().

00189 { return sigcor1; }

float Anp::Strip::SigLin (  )  const [inline]

Definition at line 182 of file PhysicsNtuple/HEAD/Strip.h.

References siglin.

00182 { return siglin; }

const std::vector< Short_t > & Anp::Strip::SlcIndex (  )  const [inline]

Definition at line 163 of file PhysicsNtuple/HEAD/Strip.h.

References slc.

00163 { return slc; }

double Anp::Strip::Time (  )  const

Definition at line 115 of file PhysicsNtuple/HEAD/Strip.cxx.

References pmtindex0, pmtindex1, sigcor0, sigcor1, time0, and time1.

Referenced by Anp::DrawSpan::FindSpan(), Anp::SnarlTimeTab::GetTime(), Anp::PmtHit::Plot(), and Print().

00116 {
00117    //
00118    // In MINOS reconstruction before 07/14/2007 pmtindex0 and pmtindex1 are
00119    // set by default to 0. After this date, default value is -1. FillStrip
00120    // algorithm sets pmtindex0 and pmtindex1 to non negative value
00121    // for channels with non zero pmtindex or non zero adc.
00122    //
00123 
00124    if((pmtindex0 >= 0 && sigcor0 > 0.0) && (pmtindex1 >= 0 && sigcor1 > 0.0))
00125    {
00126       return 0.5*(time0 + time1);
00127    }
00128    else if(pmtindex0 >= 0 && sigcor0 > 0.0)
00129    {
00130       return time0;
00131    }
00132    else if(pmtindex1 >= 0 && sigcor1 > 0.0)
00133    {
00134       return time1;
00135    }
00136 
00137    // std::cerr << "Strip::Time - failed to find valid strip end" << std::endl;
00138    return -1.0e6;
00139 }

float Anp::Strip::TPos (  )  const [inline]

Definition at line 178 of file PhysicsNtuple/HEAD/Strip.h.

References tpos.

Referenced by Anp::DrawSpan::FindSpan(), Anp::FillMuonId::Get(), and Anp::FillShortVar::OtherStripEnergy().

00178 { return tpos; }

const std::vector< Short_t > & Anp::Strip::TrkIndex (  )  const [inline]

Definition at line 161 of file PhysicsNtuple/HEAD/Strip.h.

References trk.

00161 { return trk; }

double Anp::Strip::WestTime (  )  const [inline]

Definition at line 192 of file PhysicsNtuple/HEAD/Strip.h.

References time1.

00192 { return time1; }

float Anp::Strip::ZPos (  )  const [inline]

Definition at line 179 of file PhysicsNtuple/HEAD/Strip.h.

References zpos.

Referenced by Anp::DrawSpan::FindSpan(), Anp::FillMuonId::Get(), and Anp::FillShortVar::OtherStripEnergy().

00179 { return zpos; }


Friends And Related Function Documentation

friend class FillStrip [friend]

Definition at line 104 of file PhysicsNtuple/HEAD/Strip.h.


Member Data Documentation

Float_t Anp::Strip::adc [private]

Definition at line 113 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by ADC(), Clear(), Print(), and Anp::FillStrip::Run().

std::vector<Short_t> Anp::Strip::evt [private]

Definition at line 124 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), EvtIndex(), Anp::FillStrip::GetEvtStrip(), and MatchEvt().

Definition at line 131 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Add(), Clear(), DataAt(), DataBeg(), DataEnd(), and KeyExists().

Short_t Anp::Strip::index [private]
UShort_t Anp::Strip::ndigit [private]

Definition at line 109 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), GetDigit(), and Anp::FillStrip::Run().

Float_t Anp::Strip::pe [private]

Definition at line 114 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), PE(), and Anp::FillStrip::Run().

UShort_t Anp::Strip::plane [private]
Char_t Anp::Strip::planeview [private]
Int_t Anp::Strip::pmtindex0 [private]
Int_t Anp::Strip::pmtindex1 [private]
UInt_t Anp::Strip::seid [private]

Definition at line 122 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), GetEncoded(), and Anp::FillStrip::Run().

std::vector<Short_t> Anp::Strip::shw [private]

Definition at line 126 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Anp::FillStrip::GetShwStrip(), MatchShw(), and ShwIndex().

Float_t Anp::Strip::sigcor0 [private]
Float_t Anp::Strip::sigcor1 [private]
Float_t Anp::Strip::siglin [private]

Definition at line 115 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Anp::FillStrip::Run(), and SigLin().

std::vector<Short_t> Anp::Strip::slc [private]

Definition at line 127 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Anp::FillStrip::GetSlcStrip(), MatchSlc(), and SlcIndex().

UShort_t Anp::Strip::strip [private]
Double_t Anp::Strip::time0 [private]

Definition at line 118 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), EastTime(), Anp::FillStrip::Run(), and Time().

Double_t Anp::Strip::time1 [private]

Definition at line 119 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Anp::FillStrip::Run(), Time(), and WestTime().

Float_t Anp::Strip::tpos [private]

Definition at line 111 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Print(), Anp::FillStrip::Run(), and TPos().

std::vector<Short_t> Anp::Strip::trk [private]

Definition at line 125 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Anp::FillStrip::GetTrkStrip(), MatchTrk(), and TrkIndex().

Float_t Anp::Strip::zpos [private]

Definition at line 112 of file PhysicsNtuple/HEAD/Strip.h.

Referenced by Clear(), Print(), Anp::FillStrip::Run(), and ZPos().


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

Generated on 17 Jun 2018 for loon by  doxygen 1.6.1