AliFMDMerger.h
[u/mrichter/AliRoot.git] / FMD / AliFMDMerger.h
CommitLineData
dc8af42e 1#ifndef ALIFMDMERGER_H
2#define ALIFMDMERGER_H
3/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6// #include "AliMerger.h"
7// #include "AliMergable.h"
8#include "TRandom.h"
88cb7938 9
10
11
12class AliRunLoader;
13class TClonesArray;
14class TFile;
dc8af42e 15
16typedef enum {kDigitize=0, kMerge = 1} MergeMode_t;
17
18class AliFMDMerger {
19 public:
20
21 AliFMDMerger();
22 virtual ~AliFMDMerger();
23
24
25 // Initialize merging and digitisation
26 virtual void Init();
27
28 // Do the main work
29 void Digitise() ;
30 Int_t PutNoise(Int_t charge){return (Int_t)(gRandom->Gaus(charge,500));}
31 TClonesArray *SDigits() const {return fSDigits;}
dc8af42e 32
37c55dc0 33 void ReadDigit(Int_t a[][30][150], Int_t);
dc8af42e 34
35 // Setters -> Later Communication with gAlice
36 void SetSignalEventNumber(Int_t i) {fEvNrSig = i;}
37 void SetBackgroundEventNumber(Int_t i) {fEvNrBgr = i;}
88cb7938 38 void SetBackgroundFileName(char* file) {fFnBgr = file;}
39 void SetSignalFileName(char* file) {fFnSig = file;}
dc8af42e 40 void SetMode(MergeMode_t mode) {fMerge = mode;}
37c55dc0 41
42 // Granularity
43 virtual void SetRingsSi1(Int_t ringsSi1);
44 virtual void SetSectorsSi1(Int_t sectorsSi1);
45 virtual void SetRingsSi2(Int_t ringsSi2);
46 virtual void SetSectorsSi2(Int_t sectorsSi2);
dc8af42e 47
48 enum {kBgTag = -1};
49
50 private:
51 // Open the bgr file
88cb7938 52 TFile *InitBgr();
37c55dc0 53 //Granularity
54 Int_t fRingsSi1; // Number of rings
55 Int_t fSectorsSi1; // Number of sectors
56 Int_t fRingsSi2; // Number of rings
57 Int_t fSectorsSi2; // Number of sectors
58
dc8af42e 59 private:
37c55dc0 60 TClonesArray *fDigits; // ! array with digits
dc8af42e 61 TClonesArray *fSDigits ; // List of summable digits
62 Int_t fEvNrSig; // signal event number
63 Int_t fEvNrBgr; // background event number
64 MergeMode_t fMerge; // merging type kDigitize, kMerge
65 char *fFnBgr; // background file name
66 char *fFnSig; // signal file name
67 TFile *fBgrFile; // Pointer to background file
68
88cb7938 69 AliRunLoader* fBgrLoader; //! Background event run loader
70 AliRunLoader* fSigLoader; //! Signal event run loader
71
dc8af42e 72 ClassDef(AliFMDMerger,0)
73};
74#endif
75