FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PixelDigiBinSource.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 //
9 // PixelDigiBinSource.h
10 //
11 //
12 // Created by Radoslaw Karabowicz on 19.02.2016.
13 //
14 //
15 
16 #ifndef PIXELDIGIBINSOURCE_H_
17 #define PIXELDIGIBINSOURCE_H_
18 
19 #include "FairSource.h"
20 
21 #include <Rtypes.h>
22 #include <TString.h>
23 #include <fstream>
24 
25 class TClonesArray;
26 class TObject;
27 class PixelEventHeader;
28 class FairEventHeader;
29 
31 {
32  public:
33  PixelDigiBinSource(TString inputFileName = "test.dat");
34  virtual ~PixelDigiBinSource();
35 
36  Bool_t Init();
37 
38  Int_t ReadEvent(UInt_t i = 0);
39  void Close();
40  void Reset();
41  Bool_t SpecifyRunId()
42  {
43  ReadEvent(0);
44  return true;
45  };
46 
47  virtual Source_Type GetSourceType() { return kFILE; }
48 
49  virtual void SetParUnpackers() {}
50 
51  virtual Bool_t InitUnpackers() { return kTRUE; }
52 
53  virtual Bool_t ReInitUnpackers() { return kTRUE; }
54 
56  virtual Int_t CheckMaxEventNo(Int_t EvtEnd = 0);
57 
58  virtual void FillEventHeader(FairEventHeader* feh);
59 
60  void SetInputFileName(const TString& tstr) { fInputFileName = tstr; };
61 
62  virtual Bool_t ActivateObject(TObject** obj, const char* BrName);
63 
64  private:
65  PixelEventHeader* fEventHeader;
66  TClonesArray* fDigis;
67  Int_t fNDigis;
68 
69  Int_t fTNofEvents;
70  Int_t fTNofDigis;
71 
72  TString fInputFileName;
73  std::ifstream fInputFile;
74 
75  Int_t fCurrentEntryNo;
76 
77  Int_t fRunId;
78  Int_t fMCEntryNo;
79  Int_t fPartNo;
80 
82  PixelDigiBinSource& operator=(const PixelDigiBinSource&);
83 
84  ClassDef(PixelDigiBinSource, 1);
85 };
86 
87 #endif /* defined(PIXELDIGISOURCE_H_) */
void SetInputFileName(const TString &tstr)
virtual Source_Type GetSourceType()
virtual Int_t CheckMaxEventNo(Int_t EvtEnd=0)
Source_Type
Definition: FairSource.h:26
virtual Bool_t InitUnpackers()
Int_t ReadEvent(UInt_t i=0)
virtual Bool_t ReInitUnpackers()
PixelDigiBinSource(TString inputFileName="test.dat")
virtual Bool_t ActivateObject(TObject **obj, const char *BrName)
virtual void FillEventHeader(FairEventHeader *feh)
virtual void SetParUnpackers()