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

Public Member Functions | |
| RawTOFBlock () | |
| RawTOFBlock (const Int_t *block) | |
| virtual | ~RawTOFBlock () |
| Int_t | GetNumberOfDigits () const |
| const RawTOFDigit * | At (Int_t idx) const |
| virtual TIter | GetDatumIter (Bool_t dir=kIterForward) const |
| Int_t | IndexOf (RawTOFDigit *rawdigit) const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| RawTOFBlock (const RawTOFBlock &rhs) | |
| RawTOFBlock & | operator= (const RawTOFBlock &rhs) |
Static Public Member Functions | |
| void | SetDebugFlags (const UInt_t dbgflgs) |
| UInt_t | GetDebugFlags () |
Protected Member Functions | |
| virtual void | FillRawTOFDigits () const |
Protected Attributes | |
| TObjArray * | fRawCrateStatuses |
| TObjArray * | fRawTOFDigits |
| not written out | |
Static Private Attributes | |
| UInt_t | fgDebugFlags = 0 |
| not written out | |
|
|
Definition at line 36 of file RawTOFBlock.cxx. 00036 : 00037 fRawCrateStatuses(0), fRawTOFDigits(0) 00038 { 00039 // Default constructor 00040 }
|
|
|
Definition at line 43 of file RawTOFBlock.cxx. 00044 : RawDataBlock(block), 00045 fRawCrateStatuses(0), fRawTOFDigits(0) 00046 { 00047 // stored block format is: 00048 //--------------------- 00049 // 0 # words in block 00050 // 1 checksum 00051 // 2 Block Id 00052 //----- 00053 // 3 Crate # i (+extra) 00054 // 4 # of crate entries (N_i) 00055 // 5 Crate T0_i sec 00056 // 6 Crate T0_i nsec 00057 //----- 00058 // 7 readout 1_i word 1 00059 // 8 readout 1_i word 2 00060 // < truth PlexStripEndId if Reroot data> 00061 // tdc header (inc count) 00062 // tdc data word 0 00063 // ... 00064 // tdc trailer 00065 // readout 2_i word 1 00066 // readout 2_i word 2 00067 // ... 00068 00069 }
|
|
|
Definition at line 72 of file RawTOFBlock.cxx. References fRawCrateStatuses, and fRawTOFDigits. 00073 {
00074 if (fRawTOFDigits) {
00075 fRawTOFDigits->Delete();
00076 delete fRawTOFDigits;
00077 fRawTOFDigits = 0;
00078 }
00079 if (fRawCrateStatuses) {
00080 fRawCrateStatuses->Delete();
00081 delete fRawCrateStatuses;
00082 fRawCrateStatuses = 0;
00083 }
00084 return;
00085 }
|
|
|
Definition at line 43 of file RawTOFBlock.h. References fRawCrateStatuses, and fRawTOFDigits. 00044 : RawDataBlock(rhs), fRawCrateStatuses(0), fRawTOFDigits(0) { ; }
|
|
|
Definition at line 118 of file RawTOFBlock.cxx. References FillRawTOFDigits(), and fRawTOFDigits. Referenced by AlgCalDetSI::RunAlg(). 00119 {
00120 // create/fill the TObjArray of RawTOFDigit (if it doesn't exist)
00121 // return pointer to the i-th element
00122
00123 if ( ! fRawTOFDigits ) FillRawTOFDigits();
00124 return (RawTOFDigit*) fRawTOFDigits->At(idx);
00125 }
|
|
|
Definition at line 148 of file RawTOFBlock.cxx. References ElecType::AsString(), SimFlag::AsString(), RawBlockId::AsString(), fgDebugFlags, fRawCrateStatuses, fRawTOFDigits, RawDataBlock::GetBlockId(), RawCrateStatus::GetElecType(), RawCrateStatus::GetEntries(), RawBlockId::GetSimFlag(), MSG, RawTOFDigit::Print(), and RawCrateStatus::Print(). Referenced by At(), GetDatumIter(), GetNumberOfDigits(), and IndexOf(). 00149 {
00150 // create the TObjArray of RawTOFDigit (if it doesn't exist)
00151
00152 if ( fRawTOFDigits ) return; // already filled
00153 if ( fSize <= 0 || fRawBlock == 0) {
00154 MSG("RawData",Msg::kWarning)
00155 << "RawTOFBlock::FillRawTOFDigits empty block? "
00156 << fSize << " " << fRawBlock << endl;
00157 return;
00158 }
00159
00160 fRawCrateStatuses = new TObjArray();
00161 fRawTOFDigits = new TObjArray();
00162 RawDigitCrateStatus *cratestatus = 0;
00163 RawTOFDigit *rawdigit = 0;
00164 const Int_t *p = fRawBlock;
00165 const Int_t *end = fRawBlock + fSize; // 1 beyond end
00166
00167 RawBlockId rbid = GetBlockId();
00168 p += 3; // skip #words, blockid and checksum
00169
00170 if (fgDebugFlags&dbg_DumpHeaderOnUnpack) {
00171 MSG("RawData",Msg::kInfo)
00172 << "RawTOFBlock::FillRawTOFDigits "
00173 << " fSize " << fSize
00174 << " id " << rbid.AsString()
00175 << endl;
00176 }
00177
00178 while (p<end) {
00179 // start a new crate (pointer advanced by RawCrateStatus ctor
00180 cratestatus = new RawDigitCrateStatus(rbid,p);
00181 fRawCrateStatuses->Add(cratestatus);
00182 Int_t npairs = cratestatus->GetEntries();
00183
00184 if (fgDebugFlags&dbg_DumpCrateOnUnpack) cratestatus->Print();
00185
00186 for (Int_t ipair = 0; ipair < npairs; ipair++) {
00187 // assume that the readout type is consistent for whole crate
00188 // and that the status block knows what it is
00189 ElecType::Elec_t etype = cratestatus->GetElecType();
00190
00191 // pointer is advanced by RawTOFDigit ctor
00192 // knowing how many words it needed to eat
00193 switch (rbid.GetSimFlag()) {
00194 case SimFlag::kData:
00195 case SimFlag::kDaqFakeData:
00196 rawdigit = new RawTOFDigit(p,cratestatus);
00197 break;
00198 case SimFlag::kMC:
00199 case SimFlag::kReroot:
00200 rawdigit = new RawTOFDigit(p,cratestatus);
00201 break;
00202 default:
00203 MSG("RawData",Msg::kWarning)
00204 << "RawTOFBlock::FillRawTOFDigits simflag was: \""
00205 << SimFlag::AsString(rbid.GetSimFlag()) << "\" ("
00206 << (int)rbid.GetSimFlag() << ")" << endl;
00207 break;
00208 }
00209
00210 fRawTOFDigits->Add(rawdigit);
00211
00212 if (fgDebugFlags&dbg_DumpDigitOnUnpack) rawdigit->Print();
00213 if (p>end) {
00214 MSG("RawData",Msg::kWarning)
00215 << "RawTOFBlock::FillRawTOFDigits crate info seems trashed"
00216 << endl << " SimFlag " << SimFlag::AsString(rbid.GetSimFlag())
00217 << " ElecType " << ElecType::AsString(etype)
00218 << endl;
00219 break;
00220 }
00221 }
00222 }
00223
00224 }
|
|
||||||||||||
|
Reimplemented from RawDataBlock. Definition at line 227 of file RawTOFBlock.cxx. References RawDataBlock::FormatToOStream(), RawDigit::GetCrateStatus(), GetDatumIter(), and option. Referenced by RawTofConverter::Dump(). 00229 {
00230 RawDataBlock::FormatToOStream(os,option);
00231 if (option[0] == 'X') return os;
00232
00233 // additional block specific formatted output is done here
00234
00235 const RawDigitCrateStatus *lastcrate = 0;
00236
00237 TIter iter = GetDatumIter();
00238 TObject *tobj;
00239 RawTOFDigit *udigit;
00240 while ( ( tobj = iter.Next() ) ) {
00241 udigit = dynamic_cast<RawTOFDigit *>(tobj);
00242 if (udigit->GetCrateStatus() != lastcrate) {
00243 lastcrate = udigit->GetCrateStatus();
00244 os << " " << *lastcrate << endl;
00245 }
00246 if (udigit) os << (*udigit);
00247 }
00248 os << endl;
00249 return os;
00250 }
|
|
|
Definition at line 128 of file RawTOFBlock.cxx. References FillRawTOFDigits(), and fRawTOFDigits. Referenced by FormatToOStream(). 00129 {
00130 // create/fill the TObjArray of RawTOFDigit (if it doesn't exist)
00131 // return an iterator to look over them
00132
00133 if ( ! fRawTOFDigits ) FillRawTOFDigits();
00134 return TIter(fRawTOFDigits,dir);
00135 }
|
|
|
Definition at line 40 of file RawTOFBlock.h. 00040 { return fgDebugFlags; }
|
|
|
Definition at line 108 of file RawTOFBlock.cxx. References FillRawTOFDigits(), and fRawTOFDigits. Referenced by CDPreFilterModule::Ana(). 00109 {
00110 // create/fill the TObjArray of RawTOFDigit (if it doesn't exist)
00111 // return number of entries
00112
00113 if ( ! fRawTOFDigits ) FillRawTOFDigits();
00114 return fRawTOFDigits->GetEntriesFast(); // known not to have gaps
00115 }
|
|
|
Definition at line 138 of file RawTOFBlock.cxx. References FillRawTOFDigits(), and fRawTOFDigits. 00139 {
00140 // create/fill the TObjArray of RawTOFDigit (if it doesn't exist)
00141 // return the index for this object (if contained in the list)
00142
00143 if ( ! fRawTOFDigits ) FillRawTOFDigits();
00144 return fRawTOFDigits->IndexOf(rawdigit);
00145 }
|
|
|
Definition at line 88 of file RawTOFBlock.cxx. References fRawCrateStatuses, fRawTOFDigits, and RawDataBlock::operator=(). 00089 {
00090 // deep copy assignment
00091 if (this != &rhs) {
00092 RawDataBlock::operator=(rhs);
00093 if (fRawTOFDigits) {
00094 fRawTOFDigits->Delete();
00095 delete fRawTOFDigits;
00096 fRawTOFDigits = 0;
00097 }
00098 if (fRawCrateStatuses) {
00099 fRawCrateStatuses->Delete();
00100 delete fRawCrateStatuses;
00101 fRawCrateStatuses = 0;
00102 }
00103 }
00104 return *this;
00105 }
|
|
|
Definition at line 39 of file RawTOFBlock.h. References fgDebugFlags. 00039 {fgDebugFlags=dbgflgs;}
|
|
|
not written out
Definition at line 21 of file RawTOFBlock.cxx. Referenced by FillRawTOFDigits(), and SetDebugFlags(). |
|
|
Definition at line 54 of file RawTOFBlock.h. Referenced by FillRawTOFDigits(), operator=(), RawTOFBlock(), and ~RawTOFBlock(). |
|
|
not written out
Definition at line 55 of file RawTOFBlock.h. Referenced by At(), FillRawTOFDigits(), GetDatumIter(), GetNumberOfDigits(), IndexOf(), operator=(), RawTOFBlock(), and ~RawTOFBlock(). |
1.3.9.1