ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Go to the documentation of this file.
4 #include <FairRootManager.h>
6 #include <FairRunAna.h>
7 #include <FairRunOnline.h>
8 #include <FairRuntimeDb.h>
10 constexpr
auto cRED =
"\033[1;31m";
13 constexpr
auto cGREEN =
"\033[1;32m";
24 fExternalNumTbs = kFALSE;
33 fIsPersistence = kFALSE;
37 fRawEventArray =
new TClonesArray(
"AtRawEvent");
40 fIsSeparatedData = kFALSE;
41 fIsPseudoTopology = kFALSE;
55 fIsPersistence = value;
60 fExternalNumTbs = kTRUE;
64 fDataList[coboIdx].push_back(filename);
72 fFPNPedestalRMS = pedestalRMS;
84 fIsSeparatedData = value;
92 fIsPseudoTopology = value;
112 std::cout <<
" ==== AtDecoder2Task::Init() "
114 std::cout <<
" Number of Cobo/Asad : " << fNumCobo <<
"\n";
116 FairRootManager *ioMan = FairRootManager::Instance();
118 LOG(error) <<
"Cannot find RootManager!";
123 ioMan->Register(
"AtRawEvent",
"AtTPC", fRawEventArray, fIsPersistence);
125 fDecoder =
new AtCore2(fMap, fNumCobo);
129 for (Int_t iFile = 0; iFile < fDataList[0].size(); iFile++)
130 fDecoder->
AddData(fDataList[0].at(iFile));
132 if (fIsSeparatedData)
133 for (Int_t iCobo = 1; iCobo < fNumCobo; iCobo++)
134 for (Int_t iFile = 0; iFile < fDataList[iCobo].size(); iFile++)
135 fDecoder->
AddData(fDataList[iCobo].at(iFile), iCobo);
137 if (fIsPseudoTopology)
147 if (fFPNPedestalRMS == -1)
158 FairRun *run = FairRun::Instance();
160 LOG(fatal) <<
"No analysis run!";
162 FairRuntimeDb *db = run->GetRuntimeDb();
164 LOG(fatal) <<
"No runtime database!";
166 fPar = (
AtDigiPar *)db->getContainer(
"AtDigiPar");
168 LOG(fatal) <<
"Cannot find AtDigiPar!";
176 fRawEventArray->Delete();
178 if (fRawEvent ==
nullptr)
181 if (fInternalID % 1 == 0)
182 std::cout <<
" Event Number " << fEventID <<
" Internal ID : " << fInternalID
183 <<
" Number of Pads : " << fRawEvent->
GetNumPads() << std::endl;
185 new ((*fRawEventArray)[0])
AtRawEvent(*fRawEvent);
195 fRawEventArray->Delete();
200 if (fRawEvent ==
nullptr)
203 new ((*fRawEventArray)[0])
AtRawEvent(*fRawEvent);
212 if (fRawEvent ==
nullptr) {
213 LOG(info) <<
"End of file. Terminating FairRun.";
214 FairRootManager::Instance()->SetFinishRun();
Int_t ReadEvent(Int_t eventID)
Read event for AtSource.
void SetFPNPedestal(Double_t rms)
Setting the FPN RMS value cut for pedestal region taking.
void AddData(TString filename, Int_t coboIdx=0)
Adding raw data file to the list.
Int_t GetEventID()
Returns the current event ID.
virtual void SetParContainers()
Setting parameter containers. This will be called inbetween Init() and Run().
void SetPseudoTopologyFrame(Bool_t value)
void SetNumCobo(Int_t numCobo)
Bool_t SetData(Int_t value)
void SetFPNPedestal(Double_t sigmaThreshold=5)
virtual void Exec(Option_t *opt)
Running the task. This will be called when Run() method invoked from FairRun.
Bool_t AddData(TString filename, Int_t coboIdx=0)
void SetPseudoTopologyFrame(Int_t asadMask, Bool_t check=kFALSE)
void SetNumTbs(Int_t value)
void SetUseSeparatedData(Bool_t value=kTRUE)
Setting to use not merged data files.
AtRawEvent * GetRawEvent(Long64_t eventID=-1)
Returns STRawEvent object filled with the data.
void SetUseSeparatedData(Bool_t value=kTRUE)
void SetPTFMask(Int_t mask)
void SetNumCobo(Int_t numCobo)
void SetEventID(Long64_t eventid=-1)
Setting event id for STSource.
void SetPositivePolarity(Bool_t value=kFALSE)
void SetPersistence(Bool_t value=kTRUE)
If set, decoded raw data is written in ROOT file with AtRawEvent class.
void SetData(Int_t value)
Setting which data to be decoded.
virtual InitStatus Init()
Initializing the task. This will be called when Init() method invoked from FairRun.
~AtDecoder2Task()
Destructor.
void SetNumTbs(Int_t numTbs)
Setting the number of time buckets used when taking data.
AtDecoder2Task()
Constructor.
virtual void FinishEvent()
Finishing the event.