Transition to NewIO
[u/mrichter/AliRoot.git] / ZDC / AliZDCMerger.h
CommitLineData
359cdddc 1#ifndef ALIZDCMERGER_H
2#define ALIZDCMERGER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6////////////////////////////////////////////////
7// Merger class for ZDC //
8////////////////////////////////////////////////
9
10class AliZDC;
11class AliZDCHit;
1acbaaa8 12class AliZDCMergedHit;
359cdddc 13class AliZDCDigit;
14
15typedef enum {kDigitize=0, kMerge=1} MergeMode_t;
16
17class AliZDCMerger{
18
19public:
20 AliZDCMerger();
21 virtual ~AliZDCMerger();
22
23 void InitMerging();
24 void Background(Float_t &b, Int_t &nspecn, Int_t &nspecp);
25 void Fragmentation(Float_t b, Int_t nspecn, Int_t nspecp,
26 Int_t &nfreespn, Int_t &nfreespp);
1acbaaa8 27 void Mixing();
28 void ExtractSignal(Int_t SpecType);
29 void Digitize(Int_t NMhits, TClonesArray *MHits);
359cdddc 30 Int_t Phe2ADCch(Int_t Detector, Int_t Quadrant, Int_t Light);
31 Int_t AddPedestal();
32
1acbaaa8 33 // Inline functions to return TCA of MergerHits to Hits2SDigits()
34 TClonesArray *MergedHits() const {return fMHits;}
35 int GetNMhits() const {return fNMhits;}
36
37 // Inline function to return background file Hits2SDigits()
38 TFile *BgrFile() const {return fBgrFile;}
39
40 // Inline function to return event number
41 Int_t EvNum() const {return fNEvBgr;}
42
359cdddc 43 // Setters
359cdddc 44 void SetMode(MergeMode_t mode) {fMerge = mode;}
1acbaaa8 45 void SetBackgroundFileName(char* file) {fFnBgr = file;}
46 void SetBackgroundEventNum(Int_t nev) {fNEvBgr = nev;}
47
359cdddc 48 //Open the background file
49 TFile *OpenBgrFile();
50
51protected:
52 MergeMode_t fMerge; // Merging type kDigitize, kMerge
53
54 // Background event
359cdddc 55 char *fFnBgr; // Background file name
56 TFile *fBgrFile; // Pointer to background file
1acbaaa8 57 Int_t fNEvBgr; // Number of events in background file
359cdddc 58 TTree *fTrHBgr; // Hits tree for background event
1acbaaa8 59 TClonesArray *fHitsBgr; // TClonesArray of background hits
359cdddc 60 Float_t fImpPar; // Impact Parameter of the collision
61 Int_t fSpecn; // Number of spectator n
62 Int_t fSpecp; // Number of spectator p
359cdddc 63
64 // Signal events
65 Int_t fFreeSpn; // Signal event number x spectator n
66 Int_t fFreeSpp; // Signal event number x spectator p
1acbaaa8 67
88cb7938 68 char *fFnSpecn; // Spectator n file name
359cdddc 69 TFile *fSpecnFile; // Pointer to signal file -> spectator n
70 char *fFnSpecp; // Spectator p file name
71 TFile *fSpecpFile; // Pointer to signal file -> spectator p
359cdddc 72
1acbaaa8 73 Int_t fNMhits; // Number of Merged hits for background
74 TClonesArray *fMHits; // TCA for "merged" hits
1450a7cd 75
76public:
77 // *** Digits
78 // --- Parameters for conversion of light yield in ADC channels
79 Float_t fPMGain[3][5]; // PM gain
80 Float_t fADCRes; // ADC conversion factor
81 // --- Digitization parameters setters and getters
82 // PM gain
83 void SetPMGain(Int_t Det, Int_t PMDet, Int_t PMGain)
84 {fPMGain[Det][PMDet] = PMGain;}
85 Float_t GetPMGain(Int_t Det, Int_t PMDet)
86 {return fPMGain[Det][PMDet];}
87 // Conversion factor from charge to ADC channels
88 // F = 1.6E-19 / Resolution [Coulomb/ch]
89 void SetADCRes(Int_t ADCRes) {fADCRes = ADCRes;}
90 Float_t GetADCRes() {return fADCRes;}
91
359cdddc 92
93
1450a7cd 94 ClassDef(AliZDCMerger,1)
359cdddc 95};
96#endif