-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve FairRunOnline. Cleanup of run managers.
1. Allow to use parameters in FairUnpackers. Added SetParContainers() method to FairUnpack. Separated method FairMbsSource::InitUnpackers(). Added source identification method. Generate RunID if it was not set. 2. Unify data members of different run classes. Use only one data member of FairEventHeader in the base class FairRun with needed getters and setters. All derrived classes use this data member. 3. Create new class for online sources. The last implementation assumed that all sources which need parameter containers in the unpackers are derrived from FairMbsSource. This is not the case for many of the Sources used by CBM. Therefore an new class for online sources was created which contain all the needed functionality. FairMbsSource is derrived from FairOnlineSource, as well as the CBM specific source classes. 4. Avoid reading the first event in case of online source. In case of online sources like lmd files or other raw data files the input file or input stream doesn't contain an event header, so it doesn't make any sense to read the first event and try to extract one. The event header is needed in case of ROOT files to extract the runID. The RunId for online files should be defined from the macro or generated on the fly.
- Loading branch information
Showing
20 changed files
with
168 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * | ||
* * | ||
* This software is distributed under the terms of the * | ||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, * | ||
* copied verbatim in the file "LICENSE" * | ||
********************************************************************************/ | ||
// ----------------------------------------------------------------------------- | ||
// ----- ----- | ||
// ----- FairOnlineSource ----- | ||
// ----- Created 12.04.2013 by D.Kresan ----- | ||
// ----- Copied from FairSource 01.11.2013 by F.Uhlig ----- | ||
// ----- ----- | ||
// ----------------------------------------------------------------------------- | ||
|
||
#include <iostream> | ||
|
||
#include "FairOnlineSource.h" | ||
#include "FairLogger.h" | ||
|
||
FairOnlineSource::FairOnlineSource() : FairSource(), fUnpackers(new TObjArray()) {} | ||
|
||
FairOnlineSource::FairOnlineSource(const FairOnlineSource &source) | ||
: FairSource(source), fUnpackers(new TObjArray(*(source.GetUnpackers()))) {} | ||
|
||
FairOnlineSource::~FairOnlineSource() { | ||
fUnpackers->Delete(); | ||
delete fUnpackers; | ||
} | ||
|
||
Bool_t FairOnlineSource::InitUnpackers() { | ||
for (Int_t i = 0; i < fUnpackers->GetEntriesFast(); i++) { | ||
if (!((FairUnpack *)fUnpackers->At(i))->Init()) { | ||
return kFALSE; | ||
} | ||
} | ||
return kTRUE; | ||
} | ||
|
||
void FairOnlineSource::SetParUnpackers() { | ||
for (Int_t i = 0; i < fUnpackers->GetEntriesFast(); i++) { | ||
((FairUnpack *)fUnpackers->At(i))->SetParContainers(); | ||
} | ||
} | ||
|
||
void FairOnlineSource::Reset() { | ||
for (Int_t i = 0; i < fUnpackers->GetEntriesFast(); i++) { | ||
((FairUnpack *)fUnpackers->At(i))->Reset(); | ||
} | ||
} | ||
|
||
ClassImp(FairOnlineSource) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * | ||
* * | ||
* This software is distributed under the terms of the * | ||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, * | ||
* copied verbatim in the file "LICENSE" * | ||
********************************************************************************/ | ||
// ----------------------------------------------------------------------------- | ||
// ----- ----- | ||
// ----- FairMbsSource ----- | ||
// ----- Created 12.04.2013 by D.Kresan ----- | ||
// ----- Copied from FairSource 01.11.2013 by F.Uhlig ----- | ||
// ----- ----- | ||
// ----------------------------------------------------------------------------- | ||
|
||
#ifndef FAIRONLINESOURCE_H | ||
#define FAIRONLINESOURCE_H | ||
|
||
#include "FairSource.h" | ||
#include "TObjArray.h" | ||
|
||
#include "FairUnpack.h" | ||
|
||
|
||
class FairOnlineSource : public FairSource | ||
{ | ||
public: | ||
FairOnlineSource(); | ||
FairOnlineSource(const FairOnlineSource& source); | ||
virtual ~FairOnlineSource(); | ||
|
||
inline void AddUnpacker(FairUnpack* unpacker) { fUnpackers->Add(unpacker); } | ||
inline const TObjArray* GetUnpackers() const { return fUnpackers; } | ||
|
||
virtual Bool_t Init() = 0; | ||
virtual Int_t ReadEvent(UInt_t=0) = 0; | ||
virtual void Close() = 0; | ||
|
||
void SetParUnpackers(); | ||
|
||
Bool_t InitUnpackers(); | ||
|
||
void Reset(); | ||
|
||
virtual Source_Type GetSourceType() { return kONLINE; } | ||
|
||
protected: | ||
TObjArray* fUnpackers; | ||
|
||
private: | ||
ClassDef(FairOnlineSource, 0) | ||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.