#include <MomNavigator.h>
Public Member Functions | |
| MomNavigator () | |
| virtual | ~MomNavigator () |
| void | AdoptFragment (TObject *block) |
| TObject * | GetFragment (const char *classname=0, const char *username=0, const char *streamname=0) const |
| std::vector< TObject * > | GetFragmentList (const char *classname=0, const char *username=0, const char *streamname=0) const |
| TObject * | GetFragmentByInputTag (const char *streamname, const char *treename, int treeindex, const char *filename) const |
| const TObjArray * | GetFragmentArray () const |
| TObject * | At (Int_t idx) const |
| TIter | FragmentIter (void) const |
| Int_t | IndexOf (TObject *Fragment) |
| void | Clear (Option_t *option="") |
| virtual std::ostream & | Print (std::ostream &os) const |
| virtual void | Print (Option_t *option="") const |
Private Attributes | |
| TObjArray * | fFragmentArray |
|
|
Definition at line 37 of file MomNavigator.cxx. References MSG. 00038 : fFragmentArray(0) 00039 { 00040 // Default constructor 00041 MSG("Mom",Msg::kDebug) << "MomNavigator ctor " << this << endl; 00042 00043 fFragmentArray = new TObjArray; 00044 }
|
|
|
Definition at line 47 of file MomNavigator.cxx. References fFragmentArray, and MSG. 00048 {
00049 // delete all the owned sub-objects
00050 MSG("Mom",Msg::kDebug) << "MomNavigator dtor " << this << "\n"
00051 << *this << endl;
00052 if (fFragmentArray) fFragmentArray->Delete();//delete owned Fragments
00053 delete fFragmentArray;
00054 }
|
|
|
Definition at line 57 of file MomNavigator.cxx. References fFragmentArray. Referenced by RotoObjectifier::BuildRecord(), PulserSummaryModule::FinishList(), PulserFromRawModule::FinishList(), RerootToTruthModule::Get(), RerootToRawDataModule::Get(), RecordSetupModule::Get(), MCMerge::Get(), DigitListModule::Get(), DetSim::Get(), DDSChildServer::Get(), main(), VtxModule::Reco(), UberModuleLite::Reco(), UberModule::Reco(), RecordSetupModule::Reco(), NueModule::Reco(), NtpBDLiteModule::Reco(), NtpBDFullModule::Reco(), FilterPID::Reco(), FillPIDFromText::Reco(), FarDetDataQualityModule::Reco(), DemoRecordModule::Reco(), DataQualityReader::Reco(), CalDetSIModule::Reco(), SpillTimeCreateKeyFile(), MomValidate::TestMomNavigatorClear(), and OltNewModule::WriteConfig(). 00058 {
00059 // adopt (to own) a Fragment
00060
00061 fFragmentArray->Add(Fragment);
00062 }
|
|
|
Definition at line 65 of file MomNavigator.cxx. References fFragmentArray. Referenced by DemoSnarlList::Ana(), AltDeMuxDisplay::Ana(), DemoEventDump::DumpFragments(), DemoEventDump::DumpRawData(), DemoEventDump::DumpRawHeader(), RerootToTruthModule::Get(), main(), IoInputModule::ReadHeader(), and DemuxFast::Reco(). 00066 {
00067 // return pointer to the i-th Fragment
00068
00069 return fFragmentArray->At(idx);
00070 }
|
|
|
Definition at line 254 of file MomNavigator.cxx. References fFragmentArray, RecRecord::IsPerOwned(), RecRecord::IsTransient(), RecMinos::IsTransient(), and MSG. Referenced by ReadDispatcherModule::Get(), MCMerge::GrabStreamEvents(), DDSChildServer::Next(), JobCRecord::Reset(), SpillTimeCreateKeyFile(), MomValidate::TestMomNavigatorClear(), and JobC::~JobC(). 00255 {
00256 // Clear out all transient records
00257 //
00258 // Since, *currently*, MomNavigator _owns_ the things in it's list
00259 // then it should be responsible for deleting the heap based objects
00260 // eventually when it is just a means of associating the objects
00261 // then that responsibility might change
00262
00263 if ( !fFragmentArray ) return;
00264 MSG("Mom",Msg::kVerbose) << "MomNavigator::Clear. Mom contents at entry:\n"
00265 << *this << endl;
00266
00267
00268 for ( int idx = fFragmentArray->GetEntriesFast()-1; idx >= 0; idx-- ) {
00269 TObject* fragment = fFragmentArray->At(idx);
00270 if ( !fragment ) continue;
00271 bool isTransient = true;
00272 bool isPerOwned = false;
00273 if ( RecMinos* recminos = dynamic_cast<RecMinos*>(fragment) ) {
00274 isTransient = recminos->IsTransient();
00275 }
00276 else if ( RecRecord* recrecord = dynamic_cast<RecRecord*>(fragment) ) {
00277 isTransient = recrecord->IsTransient();
00278 isPerOwned = recrecord->IsPerOwned();
00279 }
00280 if ( isTransient ) {
00281 fFragmentArray->RemoveAt(idx); // remove does not delete object
00282 // If fragment is owned by persistency, only remove it from list
00283 if ( fragment && !isPerOwned ) delete fragment;
00284 fragment = 0;
00285 }
00286 }
00287 fFragmentArray->Compress();
00288
00289 MSG("Mom",Msg::kVerbose) << "MomNavigator::Clear. Mom contents at exit:\n"
00290 << *this << endl;
00291
00292 }
|
|
|
||||||||||||||||
|
|
Definition at line 44 of file MomNavigator.h. Referenced by CountPot::Ana(), DemoEventDump::DumpFragments(), DemoEventDump::DumpRawHeader(), DataUtil::GetVldContext(), ReadDispatcherModule::IsNewEventReady(), IoInputModule::ReadHeader(), PerInputStreamManager::RemoveAllFragments(), PerInputStreamManager::RemoveFragmentsNotInWindow(), and MomValidate::TestMomNavigatorClear(). 00044 {return fFragmentArray;}
|
|
||||||||||||||||||||
|
Definition at line 217 of file MomNavigator.cxx. References fFragmentArray, Registry::Get(), RecRecord::GetTempTags(), and RecMinos::GetTempTags(). 00218 {
00219 // Returns the selected fragment matching the specified input tags. Null
00220 // is returned if none found.
00221
00222 TIter fiter(fFragmentArray);
00223 TObject* fragment;
00224 while ((fragment = fiter())) {
00225 Registry* iotags = 0;
00226 if ( RecMinos* record = dynamic_cast<RecMinos*>(fragment) ) {
00227 iotags = &(record->GetTempTags());
00228 }
00229 else if ( RecRecord* record = dynamic_cast<RecRecord*>(fragment) ) {
00230 iotags = &(record->GetTempTags());
00231 }
00232 if ( iotags ) {
00233 const char* tagstream = 0;
00234 if(iotags->Get("stream",tagstream) && strcmp(streamname,tagstream)==0) {
00235 const char* tagtree = 0;
00236 if (iotags -> Get("tree",tagtree) && strcmp(treename,tagtree)==0 ) {
00237 int tagindex = -1;
00238 if (iotags -> Get("index",tagindex) && tagindex == treeindex ) {
00239 const char* tagfile = 0;
00240 if (iotags -> Get("file",tagfile) && strcmp(filename,tagfile)==0){
00241 return fragment;
00242 }
00243 }
00244 }
00245 }
00246 }
00247 } // loop over fragments
00248
00249 return 0; // no matching fragment found
00250 }
|
|
||||||||||||||||
|
Definition at line 149 of file MomNavigator.cxx. References fFragmentArray, RecRecord::GetTempTags(), and RecMinos::GetTempTags(). Referenced by MCMerge::GrabStreamEvents(). 00151 {
00152 // Returns the list of selected fragments satisfying the argument list.
00153 // If classname is a null ptr or
00154 // blank string, no class selection is done. Any classname selection
00155 // is done by testing on the InheritsFrom() boolean, rather than
00156 // requiring agreement with the final derived class name. The username
00157 // is optional, but, if filled, will further qualify the selection by
00158 // requiring agreement with the GetName() method of the fragment. Note
00159 // that TNamed and TCollection objects both have SetName() methods to
00160 // allow the user to set a customized name. General TObjects do not
00161 // have the SetName() method and default to the GetName() name returned
00162 // by the associated TClass object, i.e., the final derived class name.
00163 // If the fragment is a Record then the name of the input stream it
00164 // came from is tested and compared to the specified streamname (optional).
00165 //
00166
00167 std::vector<TObject*> fragmentList;
00168
00169 TString classtr("");
00170 if (classname)
00171 classtr.Append(TString(classname).Strip(TString::kBoth));
00172 TString userstr("");
00173 if (username)
00174 userstr.Append(TString(username).Strip(TString::kBoth));
00175 TString streamstr("");
00176 if (streamname)
00177 streamstr.Append(TString(streamname).Strip(TString::kBoth));
00178
00179 TIter fiter(fFragmentArray);
00180 TObject* fragment = 0;
00181 while ((fragment = fiter())) {
00182
00183 // First check whether Fragment InheritsFrom "classname"
00184 if (classtr.IsNull() || fragment->IsA()->InheritsFrom(classtr)) {
00185 // meets classname criteria
00186 if (userstr.IsNull() || (userstr == fragment->GetName())) {
00187 // meets username criteria
00188 if ( streamstr.IsNull() ) {
00189 // No request of stream name match
00190 fragmentList.push_back(fragment);
00191 }
00192 else {
00193 // Test the stream name (if it exists, and can be determined)
00194 Registry* iotags = 0;
00195 if ( RecMinos* record = dynamic_cast<RecMinos*>(fragment) ) {
00196 iotags = &(record->GetTempTags());
00197 }
00198 else if ( RecRecord* record = dynamic_cast<RecRecord*>(fragment) ) {
00199 iotags = &(record->GetTempTags());
00200 }
00201 if ( iotags ) {
00202 const char* tagstream = 0;
00203 if (iotags -> Get("stream",tagstream)
00204 && strcmp(streamname,tagstream) == 0 ) {
00205 fragmentList.push_back(fragment);
00206 }
00207 }
00208 }
00209 } // match username
00210 } // match classname
00211 } // loop over fragments
00212 return fragmentList;
00213 }
|
|
|
Definition at line 81 of file MomNavigator.cxx. References fFragmentArray. 00082 {
00083 // return the index of this object (if contained in the list)
00084
00085 return fFragmentArray->IndexOf(Fragment);
00086 }
|
|
|
Definition at line 357 of file MomNavigator.cxx. References Print(). 00357 {
00358 //
00359 // Purpose: Print header in form supported by TObject::Print.
00360 //
00361 // Arguments: option (not used)
00362 //
00363 // Return: none.
00364 //
00365 // Contact: S. Kasahara
00366 //
00367
00368 Print(std::cout);
00369 return;
00370
00371 }
|
|
|
Definition at line 294 of file MomNavigator.cxx. References fFragmentArray, Registry::Get(), RecRecord::GetTempTags(), RecMinos::GetTempTags(), and DataUtil::GetVldContext(). Referenced by operator<<(), Print(), and MomValidate::TestMomNavigatorClear(). 00294 {
00295 //
00296 // Purpose: Print brief listing of mom contents on ostream.
00297 //
00298 // Arguments: os ostream to display on.
00299 //
00300 // Return: ostream reference.
00301 //
00302 // Contact: S. Kasahara
00303 //
00304
00305 assert(fFragmentArray);
00306
00307 Int_t nent = fFragmentArray->GetEntriesFast();
00308 if ( nent <= 0 ) {
00309 os << "Mom has no entries." << endl;
00310 return os;
00311 }
00312
00313 os << "Mom contents listed by array index:" << endl;
00314 for (int idx = 0; idx < nent; idx++) {
00315 TObject* fragment = fFragmentArray->At(idx);
00316 if ( !fragment ) {
00317 os << idx << ")No object.";
00318 }
00319 else {
00320 os << idx << ")" << fragment->ClassName();
00321 Registry* iotags = 0;
00322 bool isTransient = true;
00323 bool isPerOwned = false;
00324 if ( RecMinos* record = dynamic_cast<RecMinos*>(fragment) ) {
00325 iotags = &(record->GetTempTags());
00326 isTransient = record -> IsTransient();
00327 const VldContext& vldc = record -> GetHeader() -> GetVldContext();
00328 os << " " << vldc;
00329 }
00330 else if ( RecRecord* record = dynamic_cast<RecRecord*>(fragment) ) {
00331 iotags = &(record->GetTempTags());
00332 isTransient = record -> IsTransient();
00333 isPerOwned = record -> IsPerOwned();
00334 const VldContext& vldc = (record -> GetHeader()).GetVldContext();
00335 os << " " << vldc;
00336 }
00337
00338 if ( strcmp(fragment->GetName(),"") ) {
00339 os << ", TNamed " << fragment->GetName();
00340 }
00341 if ( iotags ) {
00342 const char* tagstream = 0;
00343 if(iotags->Get("stream",tagstream)) {
00344 os << ", InputStream " << tagstream;
00345 }
00346 }
00347 os << (( isTransient ) ? ", isTransient " : ", isNotTransient ");
00348 os << (( isPerOwned ) ? ", isPerOwned " : ", isNotPerOwned ");
00349 }
00350 os << endl;
00351 }
00352
00353 return os;
00354
00355 }
|
|
|
Definition at line 58 of file MomNavigator.h. Referenced by AdoptFragment(), At(), Clear(), FragmentIter(), GetFragment(), GetFragmentByInputTag(), GetFragmentList(), IndexOf(), Print(), and ~MomNavigator(). |
1.3.9.1