CandDigit Class Reference

#include <CandDigit.h>

Inheritance diagram for CandDigit:
CandBase CandRefCounted CandDeMuxDigit

List of all members.

Public Member Functions

 CandDigit ()
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Static Public Member Functions

static CandDigitHandle MakeCandidate (AlgHandle &ah, CandContext &cx)

Protected Member Functions

 CandDigit (AlgHandle &ah)
 CandDigit (AlgHandle &ah, CandHandle &ch, CandContext &cx)
 CandDigit (const CandDigit &rhs)
virtual ~CandDigit ()
virtual void CreateLocalHandle ()
virtual CandDigitDup () const
virtual Bool_t IsEquivalent (const TObject *rhs) const

Protected Attributes

RawChannelId fChannelId
Float_t fCharge
PlexSEIdAltL fPlexSEIdAltL
Int_t fRawDigitIndex
Double_t fTime
Char_t fVaErrorBits
Char_t fQieErrorBits

Friends

class CandDigitHandle

Detailed Description

Definition at line 26 of file CandDigit.h.


Constructor & Destructor Documentation

CandDigit::CandDigit (  ) 

Definition at line 45 of file CandDigit.cxx.

References CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, and MSG.

Referenced by Dup(), and MakeCandidate().

00045                      :
00046   fRawDigitIndex(-1)
00047 , fVaErrorBits(0)
00048 , fQieErrorBits(0)
00049 {
00050 //CreateLocalHandle();       // LocalHandle is now furnished by Streamer
00051   MSG("Cand", Msg::kDebug)
00052                         << "Begin CandDigit::CandDigit() ctor: " << endl
00053                                            << "UidInt = " << GetUidInt()
00054                            << ", ArchUidInt " << GetArchUidInt() << endl
00055                              << "No. of links = " << GetNLinks() << endl
00056                           << "End CandDigit::CandDigit() ctor." << endl;
00057 }

CandDigit::CandDigit ( AlgHandle ah  )  [protected]

Definition at line 60 of file CandDigit.cxx.

00060                                   :
00061   CandBase(ah)       // Should be the next class up on inheritance chain
00062 , fRawDigitIndex(-1)
00063 , fVaErrorBits(0)
00064 , fQieErrorBits(0)
00065 {
00066 
00067 // The sole purpose of this constructor is to transmit the AlgHandle
00068 // up the inheritance chain to CandBase without having to invoke the
00069 // full constructor of an intermediate Candidate type which the highest
00070 // level Candidate might inherit from.  One only wants to create the
00071 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00072 
00073 }

CandDigit::CandDigit ( AlgHandle ah,
CandHandle ch,
CandContext cx 
) [protected]

Definition at line 76 of file CandDigit.cxx.

References CreateLocalHandle(), CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, MSG, and AlgHandle::RunAlg().

00076                                                                    :
00077   CandBase(ah)       // Should be the next class up on inheritance chain
00078 , fRawDigitIndex(-1)
00079 , fVaErrorBits(0)
00080 , fQieErrorBits(0)
00081 {
00082   CreateLocalHandle();
00083 
00084 #ifdef ENABLE_DEBUG_MSG
00085   MSG("Cand", Msg::kDebug)
00086              << "Begin CandDigit::CandDigit(AlgHandle &, CandHandle &, "
00087                                       << "CandContext &) ctor: " << endl
00088                                            << "UidInt = " << GetUidInt()
00089                            << ", ArchUidInt " << GetArchUidInt() << endl
00090                              << "No. of links = " << GetNLinks() << endl
00091                << "End CandDigit::CandDigit(AlgHandle &, CandHandle &, "
00092                                       << "CandContext &) ctor." << endl;
00093 #endif
00094 
00095 // Run Algorithm to construct Candidate
00096    {                                         // Start of scope.
00097      CandDigitHandle cdh(this);              // cdh will go out of scope
00098      ch = cdh;                               // after setting ch.
00099    }                                         // End of scope.
00100    ah.RunAlg(ch, cx);
00101 }

CandDigit::CandDigit ( const CandDigit rhs  )  [protected]

Definition at line 104 of file CandDigit.cxx.

References CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, and MSG.

00104                                          :
00105   CandBase(rhs)      // Should be the next class up on inheritance chain
00106 , fChannelId(rhs.fChannelId)
00107 , fCharge(rhs.fCharge)
00108 , fPlexSEIdAltL(rhs.fPlexSEIdAltL)
00109 , fRawDigitIndex(rhs.fRawDigitIndex)
00110 , fTime(rhs.fTime)
00111 , fVaErrorBits(rhs.fVaErrorBits)
00112 , fQieErrorBits(rhs.fQieErrorBits) 
00113 {
00114 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00115 
00116 #ifdef ENABLE_DEBUG_MSG
00117   MSG("Cand", Msg::kDebug)
00118     << "Begin CandDigit::CandDigit(const CandDigit &rhs) ctor: " << endl
00119                                            << "UidInt = " << GetUidInt()
00120                            << ", ArchUidInt " << GetArchUidInt() << endl
00121                              << "No. of links = " << GetNLinks() << endl
00122       << "End CandDigit::CandDigit(const CandDigit &rhs) ctor." << endl;
00123 #endif
00124 }

CandDigit::~CandDigit (  )  [protected, virtual]

Definition at line 127 of file CandDigit.cxx.

References CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, and MSG.

00128 {
00129 #ifdef ENABLE_DEBUG_MSG
00130   MSG("Cand", Msg::kDebug)
00131                        << "Begin CandDigit::~CandDigit() dtor: " << endl
00132                                            << "UidInt = " << GetUidInt()
00133                            << ", ArchUidInt " << GetArchUidInt() << endl
00134                              << "No. of links = " << GetNLinks() << endl
00135                          << "End CandDigit::~CandDigit() dtor." << endl;
00136 #endif
00137 }


Member Function Documentation

void CandDigit::CreateLocalHandle (  )  [protected, virtual]

Implements CandBase.

Reimplemented in CandDeMuxDigit.

Definition at line 140 of file CandDigit.cxx.

References CandDigitHandle, and CandBase::SetLocalHandle().

Referenced by CandDigit(), and Dup().

00141 {
00142   SetLocalHandle(new CandDigitHandle(this));
00143 }

CandDigit * CandDigit::Dup (  )  const [protected, virtual]

Implements CandBase.

Reimplemented in CandDeMuxDigit.

Definition at line 146 of file CandDigit.cxx.

References CandBase::AddDaughterLink(), CandDigit(), CreateLocalHandle(), and CandBase::GetDaughterIterator().

00147 {
00148 
00149 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00150 // Daughter List copy is made in the derived class Dup() function.
00151 // This is because base class copy constructor hasn't yet created
00152 // fLocalHandle with a CandHandle* of the full derived type.
00153   CandDigit *cb = new CandDigit(*this);           // Copy-ctor dups ptrs
00154   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00155   TIter iterdau = GetDaughterIterator();
00156   CandHandle *dau;
00157   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00158   return cb;
00159 }

std::ostream & CandDigit::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Reimplemented from CandBase.

Reimplemented in CandDeMuxDigit.

Definition at line 215 of file CandDigit.cxx.

References fChannelId, fCharge, fQieErrorBits, fRawDigitIndex, fTime, fVaErrorBits, CandBase::GetDataIndent(), and CandBase::GetIndentString().

00217 {
00218   CandBase::FormatToOStream(os,option);
00219 
00220   TString opt(option);
00221   if (!opt.Contains("v0")) { // v0 means suppress the data values
00222     const TString& indent = GetIndentString();
00223 
00224     static MsgFormat qfmt("f7.1");
00225     static MsgFormat indxfmt("i6");
00226     static MsgFormat timefmt("f10.9");
00227     os << indent << GetDataIndent()
00228        << "[" << indxfmt(fRawDigitIndex) << "] "
00229        << fChannelId
00230        << " Q=" << qfmt(fCharge)
00231        << " Time " << timefmt(fTime);
00232     if ( fVaErrorBits || fQieErrorBits ) {
00233       os << hex << setfill('0'); // prepare for hex words
00234       // the error bits are of type Char_t, but we want them interpreted 
00235       // as int-like values (rather than as ASCII chars) so we cast them 
00236       // to something larger
00237       if ( fVaErrorBits )  os << " VaErr  0x" << setw(2) << (short)fVaErrorBits;
00238       if ( fQieErrorBits ) os << " QieErr 0x" << setw(2) << (short)fQieErrorBits;
00239       os << dec << setfill(' '); // done with hex words
00240     }
00241     os << endl;
00242     //fPlexSEIdAltL.Print("C");
00243   }
00244   return os;
00245   
00246 }

Bool_t CandDigit::IsEquivalent ( const TObject *  rhs  )  const [protected, virtual]

Reimplemented from CandBase.

Reimplemented in CandDeMuxDigit.

Definition at line 162 of file CandDigit.cxx.

References CandDigitPlexListInEquivTestState, fChannelId, fCharge, fPlexSEIdAltL, fQieErrorBits, fRawDigitIndex, fTime, fVaErrorBits, PlexSEIdAltL::GetBestItem(), CandBase::IsEquivalent(), CandBase::TestDisplayCandBanner(), and CandBase::TestEquality().

Referenced by CandDeMuxDigit::IsEquivalent().

00163 {
00164   Bool_t result = true;
00165   if (!CandBase::IsEquivalent(rhs)) result = false;   // superclass test
00166   TestDisplayCandBanner("CandDigit");
00167   const CandDigit* rCnd = dynamic_cast<const CandDigit*>(rhs);
00168   if (rCnd == NULL) return false;
00169 
00170   result = TestEquality("fChannelId",   this->fChannelId,
00171                                         rCnd->fChannelId)     && result;
00172   result = TestEquality("fCharge",      this->fCharge,
00173                                         rCnd->fCharge)        && result;
00174 
00175   if(CandDigitPlexListInEquivTestState == 1){
00176   result = TestEquality("fPlexSEIdAltL",
00177                                         this->fPlexSEIdAltL,
00178                                         rCnd->fPlexSEIdAltL)  && result;
00179   }
00180   if(CandDigitPlexListInEquivTestState == 2){
00181     //Highly specific to a Nue search matching a demux digit against
00182     // an original digit
00183     bool match = false;
00184     if(rCnd->fPlexSEIdAltL.size() == 1){
00185       PlexSEIdAltLItem best    = rCnd->fPlexSEIdAltL.GetBestItem();
00186       for(unsigned int i = 0; i < this->fPlexSEIdAltL.size(); i++){
00187         const PlexSEIdAltLItem& item = this->fPlexSEIdAltL[i];
00188         if(item == best) match = true;
00189       }
00190     }
00191     result = match && result;
00192   }
00193 
00194   result = TestEquality("fRawDigitIndex",
00195                                         this->fRawDigitIndex,
00196                                         rCnd->fRawDigitIndex) && result;
00197   result = TestEquality("fTime",        this->fTime,
00198                                         rCnd->fTime)          && result;
00199   result = TestEquality("fVaErrorBits", this->fVaErrorBits,
00200                                         rCnd->fVaErrorBits)   && result;
00201   result = TestEquality("fQieErrorBits",this->fQieErrorBits,
00202                                         rCnd->fQieErrorBits)  && result;
00203   return result;
00204 }

CandDigitHandle CandDigit::MakeCandidate ( AlgHandle ah,
CandContext cx 
) [static]

Reimplemented in CandDeMuxDigit.

Definition at line 207 of file CandDigit.cxx.

References CandDigit().

Referenced by AlgMuonRemoval::RunAlg(), AlgCaldetDigitList::RunAlg(), AlgCosmicMuonRemoval::RunAlg(), AlgMergeEvent::RunAlg(), AlgDigitList::RunAlg(), and AlgMCDigitList::RunAlg().

00208 {
00209   CandDigitHandle cdh;
00210   new CandDigit(ah, cdh, cx);              // cdh owns the new CandDigit
00211   return cdh;
00212 }


Friends And Related Function Documentation

friend class CandDigitHandle [friend]

Definition at line 29 of file CandDigit.h.

Referenced by CreateLocalHandle().


Member Data Documentation

Definition at line 39 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().

Float_t CandDigit::fCharge [protected]

Definition at line 40 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().

Definition at line 41 of file CandDigit.h.

Referenced by IsEquivalent().

Char_t CandDigit::fQieErrorBits [protected]

Definition at line 45 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().

Int_t CandDigit::fRawDigitIndex [protected]

Definition at line 42 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().

Double_t CandDigit::fTime [protected]

Definition at line 43 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().

Char_t CandDigit::fVaErrorBits [protected]

Definition at line 44 of file CandDigit.h.

Referenced by FormatToOStream(), and IsEquivalent().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1