#include <RawDeadChipBlock.h>
Inheritance diagram for RawDeadChipBlock:

Public Types | |
| typedef std::set< RawChannelId > | RawChannelIdSet |
| typedef RawChannelIdSet::const_iterator | RawChannelIdSetConstIter |
Public Member Functions | |
| RawDeadChipBlock () | |
| RawDeadChipBlock (const Int_t *block) | |
| RawDeadChipBlock (const VldContext &vldc, const RawChannelIdSet &inset) | |
| virtual | ~RawDeadChipBlock () |
| UInt_t | GetNumberOfEntries () const |
| RawChannelId | GetDeadEntry (UInt_t indx) const |
| Bool_t | ChipWasDead (const RawChannelId &rcid) const |
| const RawChannelIdSet & | GetDeadChannels () const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| RawDeadChipBlock (const RawDeadChipBlock &rhs) | |
| RawDeadChipBlock & | operator= (const RawDeadChipBlock &rhs) |
Static Public Member Functions | |
| void | SetDebugFlags (const UInt_t dbgflgs) |
| UInt_t | GetDebugFlags () |
Protected Member Functions | |
| virtual void | FillDeadChannels () const |
Protected Attributes | |
| Bool_t | fUnpacked |
| RawChannelIdSet | fDeadChannels |
| not written out | |
Static Private Attributes | |
| UInt_t | fgDebugFlags = 0 |
| not written out | |
| UInt_t | fgStdVaChannel = 0 |
|
|
Definition at line 26 of file RawDeadChipBlock.h. |
|
|
Definition at line 27 of file RawDeadChipBlock.h. Referenced by FormatToOStream(), GetDeadEntry(), and RawDeadChipBlock(). |
|
|
Definition at line 33 of file RawDeadChipBlock.cxx. 00033 : RawDataBlock(), fUnpacked(false) 00034 { 00035 // Default constructor 00036 }
|
|
|
Definition at line 39 of file RawDeadChipBlock.cxx. 00040 : RawDataBlock(block), fUnpacked(false) 00041 { 00042 // stored block format is: 00043 //--------------------- 00044 // 0 # words in block 00045 // 1 checksum 00046 // 2 Block Id 00047 //----- 00048 // 3 # dead chips in crate 0 00049 // 4 chad for 0th dead chip (chan=0) 00050 // 5 chad ... 00051 // 3+N0 # dead chips in crate 1 00052 // 3+N0+1 chad for 0th dead chip (chan=0) 00053 // ... 00054 }
|
|
||||||||||||
|
Definition at line 57 of file RawDeadChipBlock.cxx. References RawChannelId::GetChAdd(), RawChannelId::GetCrate(), VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldContext::GetSimFlag(), RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), RawChannelIdSetConstIter, and rdxsum_fill(). 00059 : RawDataBlock(), fUnpacked(false) 00060 { 00061 // create a RawDeadChipBlock from a list of RawChannelId's 00062 00063 // find crate # of last element (assume sorted by set) 00064 Int_t ncrates = 0; 00065 Int_t *crate_count = 0; 00066 if (inset.size()>0) { 00067 RawChannelId rcid_last = *inset.rbegin(); 00068 ncrates = rcid_last.GetCrate() + 1; // crate numbering starts at 0 00069 // build list of how many entries for each crate 00070 crate_count = new Int_t [ncrates]; 00071 for (int i=0; i<ncrates; i++) crate_count[i] = 0; 00072 RawChannelIdSetConstIter iter = inset.begin(); 00073 while (iter != inset.end()) { 00074 RawChannelId rcid = *iter; 00075 crate_count[rcid.GetCrate()] += 1; 00076 iter++; 00077 } 00078 } 00079 // 3 words of header + count for each crate (no skips) + # of chips 00080 fSize = 3 + ncrates + inset.size(); 00081 if (fRawBlock) delete [] fRawBlock; 00082 fRawBlock = new Int_t [fSize]; 00083 00084 fRawBlock[0] = fSize; 00085 // fRawBlock[1] = checksum... see below 00086 00087 RawBlockRegistry& rbr = RawBlockRegistry::Instance(); 00088 RawBlockProxy* rbp = rbr.LookUp("RawDeadChipBlock"); 00089 00090 Bool_t isDCS = rbp->IsDCS(); 00091 Int_t majorId = rbp->GetMajorId(); 00092 Int_t minorId = 0; 00093 RawBlockId rbid(majorId,minorId,isDCS, 00094 vldc.GetDetector(),vldc.GetSimFlag()); 00095 fRawBlock[2] = rbid.GetEncoded(); 00096 00097 Int_t *p = fRawBlock + 3; 00098 Int_t this_crate = -1; 00099 RawChannelIdSetConstIter iter = inset.begin(); 00100 while (iter != inset.end()) { 00101 RawChannelId rcid = *iter; 00102 while (this_crate != rcid.GetCrate()) { 00103 this_crate++; 00104 *p = crate_count[this_crate]; 00105 p++; 00106 } 00107 *p = rcid.GetChAdd(); 00108 p++; 00109 iter++; 00110 } 00111 00112 00113 // fill checksum 00114 rdxsum_fill((long*)fRawBlock,0); 00115 00116 // delete temporary 00117 delete crate_count; 00118 }
|
|
|
Definition at line 121 of file RawDeadChipBlock.cxx. 00122 {
00123 // dtor
00124 }
|
|
|
Definition at line 47 of file RawDeadChipBlock.h. References fDeadChannels, and fUnpacked. 00048 : RawDataBlock(rhs), fUnpacked(false) { fDeadChannels.clear(); }
|
|
|
Definition at line 188 of file RawDeadChipBlock.cxx. References RawChannelId::ClearModeBits(), fDeadChannels, fgStdVaChannel, FillDeadChannels(), and RawChannelId::SetVaChannel(). 00189 {
00190 // look up whether chip was registered as dead
00191 FillDeadChannels();
00192
00193 // table was built with {pedestal,spars,common} mode bits off
00194 RawChannelId rcid0 = rcid;
00195 rcid0.ClearModeBits(); // standardize mode bits
00196 // only one entry for every va *chip* so vachannel is irrelevant
00197 // but standardize it so that lookup can proceed
00198 rcid0.SetVaChannel(fgStdVaChannel);
00199
00200 return fDeadChannels.end() != fDeadChannels.find(rcid0);
00201 }
|
|
|
Definition at line 159 of file RawDeadChipBlock.cxx. References RawChannelId::ClearModeBits(), det, fDeadChannels, fgStdVaChannel, RawDataBlock::GetBlockId(), RawBlockId::GetDetector(), and RawChannelId::SetVaChannel(). Referenced by ChipWasDead(), FormatToOStream(), GetDeadChannels(), and GetNumberOfEntries(). 00160 {
00161 // unpack the data into a STL set of RawChannelId's
00162
00163 if (fUnpacked) return;
00164
00165 Detector::Detector_t det = GetBlockId().GetDetector();
00166 // assume this block is only sensible for VA electronics
00167 ElecType::Elec_t elec = ElecType::kVA;
00168
00169 Int_t crate = -1;
00170 Int_t* ptr = fRawBlock+zzzz_last;
00171 while (ptr < fRawBlock+fSize) {
00172 // start of new crate
00173 crate++;
00174 int ndead = *ptr; ptr++;
00175 for (int i=0; i<ndead; i++) {
00176 Int_t chad = *ptr; ptr++;
00177 RawChannelId rcid0(det,elec,crate,chad);
00178 rcid0.ClearModeBits(); // standardize mode bits
00179 // only one entry for every va *chip* so vachannel is irrelevant
00180 // but standardize it so that lookup can proceed
00181 rcid0.SetVaChannel(fgStdVaChannel);
00182 fDeadChannels.insert(rcid0);
00183 }
00184 }
00185 }
|
|
||||||||||||
|
Reimplemented from RawDataBlock. Definition at line 140 of file RawDeadChipBlock.cxx. References RawChannelId::AsString(), fDeadChannels, FillDeadChannels(), RawDataBlock::FormatToOStream(), option, and RawChannelIdSetConstIter. 00142 {
00143 RawDataBlock::FormatToOStream(os,option);
00144 if (option[0] == 'X') return os;
00145
00146 // additional block specific formatted output is done here
00147
00148 FillDeadChannels();
00149 RawChannelIdSetConstIter iter = fDeadChannels.begin();
00150 while (iter != fDeadChannels.end()) {
00151 RawChannelId rcid = *iter;
00152 os << " " << rcid.AsString("e") << " was dead " << endl;
00153 iter++;
00154 }
00155 return os;
00156 }
|
|
|
Definition at line 76 of file RawDeadChipBlock.h. References FillDeadChannels(). Referenced by GetDeadEntry(). 00077 { FillDeadChannels(); return fDeadChannels; }
|
|
|
Definition at line 79 of file RawDeadChipBlock.h. References GetDeadChannels(), GetNumberOfEntries(), and RawChannelIdSetConstIter. 00080 {
00081 if ( indx > GetNumberOfEntries() ) return RawChannelId();
00082 RawChannelIdSetConstIter iter = GetDeadChannels().begin();
00083 for (UInt_t i=0; i<indx; i++) iter++;
00084 return *iter;
00085 }
|
|
|
Definition at line 44 of file RawDeadChipBlock.h. 00044 { return fgDebugFlags; }
|
|
|
Definition at line 73 of file RawDeadChipBlock.h. References fDeadChannels, and FillDeadChannels(). Referenced by CDTrackerModule::Ana(), CDPreFilterModule::Ana(), CDAnaModule::Ana(), GetDeadEntry(), and OltTimeScan::Reco(). 00074 { FillDeadChannels(); return fDeadChannels.size(); }
|
|
|
Definition at line 127 of file RawDeadChipBlock.cxx. References fDeadChannels, fUnpacked, and RawDataBlock::operator=(). 00128 {
00129 // deep copy assignment
00130 if (this != &rhs) {
00131 RawDataBlock::operator=(rhs);
00132 // clear the unpacked info to allow it to be re-filled
00133 fUnpacked = false;
00134 fDeadChannels.clear();
00135 }
00136 return *this;
00137 }
|
|
|
Definition at line 43 of file RawDeadChipBlock.h. References fgDebugFlags. 00043 {fgDebugFlags=dbgflgs;}
|
|
|
not written out
Definition at line 59 of file RawDeadChipBlock.h. Referenced by ChipWasDead(), FillDeadChannels(), FormatToOStream(), GetNumberOfEntries(), operator=(), and RawDeadChipBlock(). |
|
|
not written out
Definition at line 14 of file RawDeadChipBlock.cxx. Referenced by SetDebugFlags(). |
|
|
Definition at line 15 of file RawDeadChipBlock.cxx. Referenced by ChipWasDead(), and FillDeadChannels(). |
|
|
Definition at line 58 of file RawDeadChipBlock.h. Referenced by operator=(), and RawDeadChipBlock(). |
1.3.9.1