New version of FMD code (A.Maevskaia)
[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"
9#include "AliDetector.h"
10
11typedef enum {kDigitize=0, kMerge = 1} MergeMode_t;
12
13class AliFMDMerger {
14 public:
15
16 AliFMDMerger();
17 virtual ~AliFMDMerger();
18
19
20 // Initialize merging and digitisation
21 virtual void Init();
22
23 // Do the main work
24 void Digitise() ;
25 Int_t PutNoise(Int_t charge){return (Int_t)(gRandom->Gaus(charge,500));}
26 TClonesArray *SDigits() const {return fSDigits;}
dc8af42e 27
37c55dc0 28 void ReadDigit(Int_t a[][30][150], Int_t);
dc8af42e 29
30 // Setters -> Later Communication with gAlice
31 void SetSignalEventNumber(Int_t i) {fEvNrSig = i;}
32 void SetBackgroundEventNumber(Int_t i) {fEvNrBgr = i;}
33 void SetBackgroundFileName(char* file) {fFnBgr = file;}
34 void SetSignalFileName(char* file) {fFnSig = file;}
35 void SetMode(MergeMode_t mode) {fMerge = mode;}
37c55dc0 36
37 // Granularity
38 virtual void SetRingsSi1(Int_t ringsSi1);
39 virtual void SetSectorsSi1(Int_t sectorsSi1);
40 virtual void SetRingsSi2(Int_t ringsSi2);
41 virtual void SetSectorsSi2(Int_t sectorsSi2);
dc8af42e 42
43 enum {kBgTag = -1};
44
45 private:
46 // Open the bgr file
47 TFile *InitBgr();
37c55dc0 48 //Granularity
49 Int_t fRingsSi1; // Number of rings
50 Int_t fSectorsSi1; // Number of sectors
51 Int_t fRingsSi2; // Number of rings
52 Int_t fSectorsSi2; // Number of sectors
53
dc8af42e 54 private:
37c55dc0 55 TClonesArray *fDigits; // ! array with digits
dc8af42e 56 TClonesArray *fSDigits ; // List of summable digits
57 Int_t fEvNrSig; // signal event number
58 Int_t fEvNrBgr; // background event number
59 MergeMode_t fMerge; // merging type kDigitize, kMerge
60 char *fFnBgr; // background file name
61 char *fFnSig; // signal file name
62 TFile *fBgrFile; // Pointer to background file
63
64 ClassDef(AliFMDMerger,0)
65};
66#endif
67