8#ifndef FAIR_ROOT_MANAGER_H
9#define FAIR_ROOT_MANAGER_H
125 TClonesArray*
GetData(TString branchName,
127 Double_t startParameter,
129 Double_t stopParameter);
132 fTSBufferMap[branchName] = functionalBuffer;
160 void Register(
const char*
name,
const char* Foldername, TNamed* obj, Bool_t toFile);
166 void Register(
const char*
name,
const char* Foldername, TCollection* obj, Bool_t toFile);
178 TClonesArray*
Register(TString branchName, TString
className, TString folderName, Bool_t toFile);
204 Int_t
Write(
const char*
name = 0, Int_t
option = 0, Int_t bufsize = 0);
248 return fSourceChain->GetTree();
254 return fSourceChain->GetFile();
260 return fSourceChain->GetFile();
263 void SetInChain(TChain* tempChain, Int_t ident = -1);
269 static void SetTreeName(
const std::string& tname) { fTreeName = tname; }
270 static void SetFolderName(
const std::string& tname) { fFolderName = tname; }
291 struct TypeAddressPair
293 TypeAddressPair(
const std::type_info& oi,
const std::type_info& pi,
void*
a)
295 , persistenttypeinfo(pi)
298 const std::type_info& origtypeinfo;
299 const std::type_info& persistenttypeinfo;
310 TObject* ActivateBranch(
const char* BrName);
313 void AddMemoryBranch(
const char*,
TObject*);
316 void AddMemoryBranchAny(
const char*
name, T** obj);
318 T GetMemoryBranchAny(
const char*
name)
const;
321 void RegisterImpl(
const char*
name,
const char* Foldername, T* obj, Bool_t toFile);
329 Int_t CheckBranchSt(
const char* BrName);
332 TObject* GetMemoryBranch(
const char*);
338 void EmitMemoryBranchWrongTypeWarning(
const char* brname,
const char* typen1,
const char* typen2)
const;
345 TFolder* fRootFolder;
347 Double_t fCurrentTime;
355 std::map<TString, TObject*> fMap;
358 static std::string fFolderName;
360 static std::string fTreeName;
361 static std::string GetNameFromFile(
const char* namekind);
366 std::map<std::string, std::unique_ptr<TypeAddressPair const>> fAnyBranchMap;
368 std::vector<std::string> fPersistentBranchesAny;
373 TList* fBranchNameList;
375 std::vector<std::string> fReqBrNames;
378 Int_t fMCTrackBranchId;
381 TList* fTimeBasedBranchNameList;
383 std::map<TString, TClonesArray*> fActiveContainer;
385 std::map<TString, FairTSBufferFunctional*> fTSBufferMap;
386 std::map<TString, FairWriteoutBuffer*> fWriteoutBufferMap;
387 std::map<Int_t, TBranch*> fInputBranchMap;
391 Bool_t fBranchPerMap;
393 std::map<TString, Int_t> fBrPerMap;
395 std::map<TString, Int_t>::iterator fBrPerMapIter;
398 UInt_t fCurrentEntryNo;
400 UInt_t fTimeforEntryNo;
401 Bool_t fFillLastData;
404 TObjArray* fListFolder;
408 TChain* fSourceChain =
nullptr;
409 std::map<UInt_t, TChain*> fSignalChainList;
415 Bool_t fUseFairLinks;
418 TObjArray* fListOfBranchesFromInput;
420 TIterator* fListOfBranchesFromInputIter;
422 TRefArray* fListOfNonTimebasedBranches;
424 TIterator* fListOfNonTimebasedBranchesIter;
428 static Int_t fgCounter;
437void FairRootManager::AddMemoryBranchAny(
const char* brname, T** obj)
439 if (fAnyBranchMap.find(brname) == fAnyBranchMap.end()) {
440 auto& ot =
typeid(
T*);
441 auto& pt =
typeid(
T);
442 fAnyBranchMap[brname] = std::unique_ptr<TypeAddressPair const>(
new TypeAddressPair(ot, pt, (
void*)obj));
448T FairRootManager::GetMemoryBranchAny(
const char* brname)
const
450 static_assert(std::is_pointer<T>::value,
"Return type of GetMemoryBranchAny has to be a pointer");
451 using P =
typename std::remove_pointer<T>::type;
452 auto iter = fAnyBranchMap.find(brname);
453 if (iter != fAnyBranchMap.end()) {
455 if (
typeid(
P).hash_code() != iter->second->origtypeinfo.hash_code()) {
456 EmitMemoryBranchWrongTypeWarning(brname,
typeid(
P).
name(), iter->second->origtypeinfo.name());
459 return static_cast<T>(iter->second->ptraddr);
469 AddMemoryBranchAny<T>(brname, &obj);
471 auto& ot =
typeid(T*);
472 auto& pt =
typeid(T);
476 LOG(fatal) <<
"The sink does not exist to store persistent branches.";
483template<
typename TPtr>
486 static_assert(std::is_pointer<TPtr>::value,
"Return type of GetObjectAs has to be a pointer");
487 using X =
typename std::remove_pointer<TPtr>::type;
488 static_assert(std::is_const<X>::value,
"Return type of GetObjectAs has to be pointer to const class");
489 using T =
typename std::remove_const<X>::type;
493 T** obj = GetMemoryBranchAny<T**>(brname);
516 AddMemoryBranchAny<T>(brname, addr);
519 fReqBrNames.emplace_back(brname);
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder Print launch bounds used for RTC code as debugging option
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this parameter(fixed during CTF decoding)") AddOptionRTC(defaultZOffsetOverR
Base class for all functors which are used in the FairTSBufferFunctional.
TClonesArray * GetTClonesArray(TString branchName)
const std::vector< std::string > & GetReqBranchNames() const
static const char * GetFolderName()
void SetSource(FairSource *tempSource)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
FairWriteoutBuffer * RegisterWriteoutBuffer(TString branchName, FairWriteoutBuffer *buffer)
bool CreatePersistentBranchesAny()
void SetListOfFolders(TObjArray *ta)
void SetFinishRun(Bool_t val=kTRUE)
void UpdateListOfTimebasedBranches()
virtual ~FairRootManager()
void SetLastFill(Bool_t val=kTRUE)
void SetEntryNr(Int_t val)
void UpdateFileName(TString &fileName)
static void SetTreeName(const std::string &tname)
Int_t ReadEvent(Int_t i=0)
void SetUseFairLinks(Bool_t val)
TChain * GetSignalChainNo(UInt_t i)
void CreateGeometryFile(const char *geofile)
TString GetBranchName(Int_t id)
void RegisterInputObject(const char *name, TObject *obj)
T InitObjectAs(const char *BrName)
Int_t CheckMaxEventNo(Int_t EvtEnd=0)
void WriteFileHeader(FairFileHeader *f)
TObject * GetCloneOfLinkData(const FairLink link)
void TerminateTSBuffer(TString branchName)
void ReadBranchEvent(const char *BrName)
void RegisterTSBuffer(TString branchName, FairTSBufferFunctional *functionalBuffer)
static const char * GetTreeName()
void RegisterAny(const char *name, T *&obj, Bool_t toFile)
Bool_t GetUseFairLinks() const
TList * GetBranchNameList()
Int_t CheckBranch(const char *BrName)
FairTSBufferFunctional * GetTSBuffer(TString branchName)
static void SetFolderName(const std::string &tname)
void StoreWriteoutBufferData(Double_t eventTime)
static FairRootManager * Instance()
TClonesArray * GetData(TString branchName, BinaryFunctor *function, Double_t parameter)
Int_t AddBranchToList(const char *name)
void FillEventHeader(FairEventHeader *feh)
Int_t ReadNonTimeBasedEventFromBranches(Int_t i=0)
const TFile * GetRootFile()
Int_t GetMCTrackBranchId() const
void TerminateAllTSBuffer()
TClonesArray * GetCloneOfTClonesArray(const FairLink link)
TObject * GetObject(const char *BrName)
void InitTSBuffer(TString branchName, BinaryFunctor *function)
void SetBranchNameList(TList *list)
void SetTimeBasedBranchNameList(TList *list)
Int_t GetInstanceId() const
Bool_t AllDataProcessed()
Int_t GetBranchId(TString const &BrName)
Bool_t ReadNextEvent(Double_t dt)
void SetSink(FairSink *tempSink)
TClonesArray * GetEmptyTClonesArray(TString branchName)
void StoreAllWriteoutBufferData()
void DeleteOldWriteoutBufferData()
void SetInChain(TChain *tempChain, Int_t ident=-1)
virtual void RegisterAny(const char *brname, const std::type_info &oi, const std::type_info &pi, void *obj)=0
virtual Bool_t ActivateObjectAny(void **, const std::type_info &, const char *)
virtual void FillEventHeader(FairEventHeader *feh)
A class to access time ordered data in a root branch.
A container class to store digi data during events.
GLuint const GLchar * name
GLboolean GLboolean GLboolean GLboolean a
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"