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