]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDigitizerV3.h
- Fix problem with EventSpecie when running online in DQM. The problem prevented...
[u/mrichter/AliRoot.git] / MUON / AliMUONDigitizerV3.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice                               */
3
4 // $Id$
5
6 /// \ingroup sim
7 /// \class AliMUONDigitizerV3
8 /// \brief Digitizer (from SDigit to Digit), performing digit de-calibration.
9 ///
10 //  Author Laurent Aphecetche
11
12 #ifndef ALIMUONDIGITIZERV3_H
13 #define ALIMUONDIGITIZERV3_H
14
15 #ifndef ALIDIGITIZER_H
16 #include "AliDigitizer.h"
17 #endif
18
19 #include "TArrayI.h"
20
21 class AliMUONCalibrationData;
22 class AliMUONVDigit;
23 class AliMUONLogger;
24 class TClonesArray;
25 class TF1;
26 class TString;
27 class AliMUONVDigitStore;
28 class AliLoader;
29 class AliMUONVTriggerStore;
30 class AliMUONTriggerElectronics;
31 class AliMUONVCalibParam;
32 class AliMUONRecoParam;
33 class AliMUONTriggerChamberEfficiency;
34 class AliMUONTriggerUtilities;
35
36 class AliMUONDigitizerV3 : public AliDigitizer
37 {
38 public:
39   AliMUONDigitizerV3(AliDigitizationInput* digInput=0, 
40                      Int_t generateNoisyDigits=1);
41   
42   virtual ~AliMUONDigitizerV3();
43
44   virtual void Digitize(Option_t* opt="");
45   
46   virtual Bool_t Init();
47
48   static Int_t DecalibrateTrackerDigit(const AliMUONVCalibParam& pedestals,
49                                        const AliMUONVCalibParam* gains,
50                                        Int_t channel,
51                                        Float_t charge,
52                                        Bool_t addNoise=kFALSE,
53                                        Bool_t noiseOnly=kFALSE,
54                                        const TString& calibrationMode="NOGAIN");
55   
56   /// Set calibration (and recoparam) data
57   void SetCalibrationData(AliMUONCalibrationData* calibrationData, AliMUONRecoParam* recoParam);
58
59   /// Set the number of sigmas for pedestal cut
60   static void SetNSigmas(Double_t nsigmas=4.0) { fgNSigmas = nsigmas; }
61
62 private:
63   /// Not implemented
64   AliMUONDigitizerV3(const AliMUONDigitizerV3& other);
65   /// Not implemented
66   AliMUONDigitizerV3& operator=(const AliMUONDigitizerV3& other);
67     
68   void ApplyResponse(const AliMUONVDigitStore& store, AliMUONVDigitStore& filteredStore);
69
70   void ApplyResponseToTrackerDigit(AliMUONVDigit& digit, Bool_t addNoise);
71   void ApplyResponseToTriggerDigit(AliMUONVDigit& digit);
72
73   AliLoader* GetLoader(const TString& foldername);
74   
75 private:  
76
77   void GenerateNoisyDigits(AliMUONVDigitStore& digitStore);
78   void GenerateNoisyDigitsForOneCathode(AliMUONVDigitStore& digitStore, 
79                                         Int_t detElemId, Int_t cathode);
80   void GenerateNoisyDigitsForTrigger(AliMUONVDigitStore& digitStore);
81
82   void MergeWithSDigits(AliMUONVDigitStore*& digitStore,
83                         const AliMUONVDigitStore& input,
84                         Int_t mask);
85   
86   static TF1* NoiseFunction();
87   
88   void CreateInputDigitStores();
89   
90   void BuildTriggerStatusMap();
91   Int_t GetArrayIndex(Int_t cathode, Int_t trigCh, Int_t localCircuit);
92
93 private:
94   Bool_t fIsInitialized; ///< are we initialized ?
95   AliMUONCalibrationData* fCalibrationData; //!< pointer to access calib parameters
96   AliMUONTriggerElectronics* fTriggerProcessor; ///< pointer to the trigger part of the job
97   TF1* fNoiseFunctionTrig; //!< function to get noise disribution on trig. chambers
98   Int_t fGenerateNoisyDigits; //!< whether or not we should generate noise-only digits for tracker (1) and trigger (2)
99   static Double_t fgNSigmas; ///< \brief number of sigmas above ped to use 
100   /// for noise-only digit generation and zero-suppression
101   AliMUONLogger* fLogger; //!< to keep track of messages
102   AliMUONVTriggerStore* fTriggerStore; //!< trigger objects
103   AliMUONVDigitStore* fDigitStore; //!< temporary digits
104   AliMUONVDigitStore* fOutputDigitStore; //!< digits we'll output to disk
105   TObjArray* fInputDigitStores; //!< input digit stores (one per input file
106   AliMUONRecoParam* fRecoParam; //!< reco params (to know how to decalibrate) (not owner)
107   AliMUONTriggerChamberEfficiency* fTriggerEfficiency; //!< trigger efficiency map
108   AliMUONTriggerUtilities* fTriggerUtilities; //!< Trigger utilities for masks
109   TArrayI fEfficiencyResponse; //!< Local board efficiency response
110   
111   ClassDef(AliMUONDigitizerV3,11) // MUON Digitizer V3-11
112 };
113
114 #endif