CbmRoot
Loading...
Searching...
No Matches
CbmEvBuildSource.h
Go to the documentation of this file.
1/* Copyright (C) 2016 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer], Florian Uhlig */
4
5// FairSource which reads a time slice and creates events using a simple approach
6// Use the same approach as CbmBuildEventSimple
7// //Dr.Sys : mikhail.prokudin@cern.ch
8
9#ifndef CBMEVBUILDSOURCE_H
10#define CBMEVBUILDSOURCE_H
11
12#include "FairSource.h"
13
14#include <iostream>
15
16class TChain;
17class TClonesArray;
18class CbmTimeSlice;
19class FairEventHeader;
20
21class CbmEvBuildSource : public FairSource {
22 public:
24 CbmEvBuildSource(const char* fname);
25 virtual ~CbmEvBuildSource();
26 void AddFile(const char* fname);
27
28 virtual Bool_t Init();
29 virtual Int_t ReadEvent(UInt_t par = 0);
30 virtual void Close();
31
32 virtual void Reset();
33
34 //virtual Source_Type GetSourceType() {return kFILE;}
35
36 virtual Bool_t ActivateObject(TObject**, const char*) { return kFALSE; }
37
39 virtual Int_t CheckMaxEventNo(Int_t = 0) { return 1000000000; }
41 virtual void ReadBranchEvent(const char*) { return; }
42 virtual void ReadBranchEvent(const char*, Int_t) { return; }
43 virtual void FillEventHeader(FairEventHeader* feh);
44
45 // Setters. Time in [ns], events in counts :) Only STS information is used.
46 void SetWindDur(Double_t winddur = 2) { fWindDur = winddur; }
47 void SetMinusDeltaT(Double_t minusdeltat = 2) { fMinusDeltaT = minusdeltat; }
48 void SetPlusDeltaT(Double_t plusdeltat = 5) { fPlusDeltaT = plusdeltat; }
49 void SetMinHitStations(Int_t minhitstations = 8) { fMinHitStations = minhitstations; }
50 void SetMinDigis(Int_t mindigis = 2000) { fMinDigis = mindigis; }
51 void SetDeadT(Double_t deadt = 10) { fDeadT = deadt; }
52
53 public:
55 void FillEvent(Int_t st, Int_t end); //Fill output TClonesArray
56 Int_t GetNextTimeSlice(); //Load next time slice from disk
57
58 private:
59 TChain* fCh;
60 Int_t fN; //Number of entries in input tree
61 Int_t fI; //Current entry in tree
62 TClonesArray* fSTSDigi;
63 Int_t fNSTSDigis; //Number of STS digis in current event
65 Int_t fISts; //Number of STS digi under consideration
66
67 UInt_t fEv; // Number of current event **/
68 Int_t fNDigis; // Number of digis in current time window
69 Int_t fSN; // N of start of time window
70 Double_t fST; // Time of start of time window
71 Int_t fNStsDigis[16]; // Number of STS digis per station
72 Double_t fWindDur; // Duration of time window [ns]
73 Double_t fMinusDeltaT; // [ns] before start of time window for event construction
74 Double_t fPlusDeltaT; // [ns] after end of time window for event construction
75 Double_t fDeadT; // [ns] after last accepted digi of blindless
76 Int_t fMinHitStations; // Minimum number of hit STS stations for event formation
77 Int_t fMinDigis; // Minimum number of digis in time window for event formation
78 FairEventHeader* fEvHeader;
79
81
82 ClassDef(CbmEvBuildSource, 1)
83};
84
85
86#endif
void SetMinDigis(Int_t mindigis=2000)
virtual void ReadBranchEvent(const char *, Int_t)
void SetMinHitStations(Int_t minhitstations=8)
CbmTimeSlice * fSlice
virtual Bool_t ActivateObject(TObject **, const char *)
virtual void ReadBranchEvent(const char *)
FairEventHeader * fEvHeader
void SetDeadT(Double_t deadt=10)
TClonesArray * fSTSDigi
virtual Bool_t Init()
void SetWindDur(Double_t winddur=2)
void SetPlusDeltaT(Double_t plusdeltat=5)
CbmEvBuildSource & operator=(const CbmEvBuildSource &)
Event header.
Int_t fN
Chain of input files.
void SetMinusDeltaT(Double_t minusdeltat=2)
void AddFile(const char *fname)
Int_t fISts
Current time slice.
virtual Int_t CheckMaxEventNo(Int_t=0)
virtual Int_t ReadEvent(UInt_t par=0)
Int_t fNSTSDigis
Array of output STS digis for each built event.
virtual void FillEventHeader(FairEventHeader *feh)
void FillEvent(Int_t st, Int_t end)
Bookkeeping of time-slice content.