X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONDigitizerV3.h;h=ee1fafed5d547ed53182020971ab63c4443b8816;hb=6b548b9e581d9a6c99fcc7d27dd2bd8aef22b22b;hp=9fea4b72f846c0e4e448dbba90c4a55fd43a7cdd;hpb=829425a512355433c2b59d05ddb13e541094c2ea;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONDigitizerV3.h b/MUON/AliMUONDigitizerV3.h index 9fea4b72f84..ee1fafed5d5 100644 --- a/MUON/AliMUONDigitizerV3.h +++ b/MUON/AliMUONDigitizerV3.h @@ -7,7 +7,7 @@ /// \class AliMUONDigitizerV3 /// \brief Digitizer (from SDigit to Digit), performing digit de-calibration. /// -/// \author Laurent Aphecetche +// Author Laurent Aphecetche #ifndef ALIMUONDIGITIZERV3_H #define ALIMUONDIGITIZERV3_H @@ -16,82 +16,99 @@ #include "AliDigitizer.h" #endif -#ifndef ROOT_TStopwatch -# include "TStopwatch.h" -#endif +#include "TArrayI.h" class AliMUONCalibrationData; -class AliMUONData; -class AliMUONDigit; -class AliMUONTriggerEfficiencyCells; +class AliMUONVDigit; +class AliMUONLogger; class TClonesArray; class TF1; class TString; +class AliMUONVDigitStore; +class AliLoader; +class AliMUONVTriggerStore; +class AliMUONTriggerElectronics; +class AliMUONVCalibParam; +class AliMUONRecoParam; +class AliMUONTriggerChamberEfficiency; +class AliMUONTriggerUtilities; class AliMUONDigitizerV3 : public AliDigitizer { public: - enum ETriggerCodeVersion - { - kTriggerDecision=-1, - kTriggerElectronics - }; + AliMUONDigitizerV3(AliDigitizationInput* digInput=0, + Int_t generateNoisyDigits=1); - AliMUONDigitizerV3(AliRunDigitizer* manager=0, - ETriggerCodeVersion=kTriggerDecision, - Bool_t useTriggerEfficiency=kFALSE, - Bool_t generateNoisyDigits=kTRUE); virtual ~AliMUONDigitizerV3(); - virtual void Exec(Option_t* opt=""); + virtual void Digitize(Option_t* opt=""); virtual Bool_t Init(); + static Int_t DecalibrateTrackerDigit(const AliMUONVCalibParam& pedestals, + const AliMUONVCalibParam* gains, + Int_t channel, + Float_t charge, + Bool_t addNoise=kFALSE, + Bool_t noiseOnly=kFALSE, + const TString& calibrationMode="NOGAIN"); + + /// Set calibration (and recoparam) data + void SetCalibrationData(AliMUONCalibrationData* calibrationData, AliMUONRecoParam* recoParam); + + /// Set the number of sigmas for pedestal cut + static void SetNSigmas(Double_t nsigmas=4.0) { fgNSigmas = nsigmas; } + private: - + /// Not implemented AliMUONDigitizerV3(const AliMUONDigitizerV3& other); + /// Not implemented AliMUONDigitizerV3& operator=(const AliMUONDigitizerV3& other); - - void AddOrUpdateDigit(TClonesArray& array, - const AliMUONDigit& digit); - void ApplyResponse(); + void ApplyResponse(const AliMUONVDigitStore& store, AliMUONVDigitStore& filteredStore); - void ApplyResponseToTrackerDigit(AliMUONDigit& digit, Bool_t addNoise); - void ApplyResponseToTriggerDigit(AliMUONDigit& digit, AliMUONData* data); + void ApplyResponseToTrackerDigit(AliMUONVDigit& digit, Bool_t addNoise); + void ApplyResponseToTriggerDigit(AliMUONVDigit& digit); -private: - AliMUONDigit* FindCorrespondingDigit(AliMUONDigit& digit,AliMUONData* data) const; + AliLoader* GetLoader(const TString& foldername); - Int_t FindDigitIndex(TClonesArray& array, const AliMUONDigit& digit) const; - - void GenerateNoisyDigits(); - void GenerateNoisyDigitsForOneCathode(Int_t detElemId, Int_t cathode); - - AliMUONData* GetDataAccess(const TString& folderName); +private: - Bool_t MergeDigits(const AliMUONDigit& src, AliMUONDigit& srcAndDest); + void GenerateNoisyDigits(AliMUONVDigitStore& digitStore); + void GenerateNoisyDigitsForOneCathode(AliMUONVDigitStore& digitStore, + Int_t detElemId, Int_t cathode); + void GenerateNoisyDigitsForTrigger(AliMUONVDigitStore& digitStore); - void MergeWithSDigits(AliMUONData& outputData, const AliMUONData& inputData, + void MergeWithSDigits(AliMUONVDigitStore*& digitStore, + const AliMUONVDigitStore& input, Int_t mask); + static TF1* NoiseFunction(); + + void CreateInputDigitStores(); + + void BuildTriggerStatusMap(); + Int_t GetArrayIndex(Int_t cathode, Int_t trigCh, Int_t localCircuit); + private: Bool_t fIsInitialized; ///< are we initialized ? - AliMUONData* fOutputData; //!< pointer to access digits AliMUONCalibrationData* fCalibrationData; //!< pointer to access calib parameters - TTask* fTriggerProcessor; ///< pointer to the trigger part of the job - ETriggerCodeVersion fTriggerCodeVersion; ///< which version of trigger job - Bool_t fUseTriggerEfficiency; ///< whether or not we should apply trigger efficiency - AliMUONTriggerEfficiencyCells* fTriggerEfficiency; ///< trigger efficiency map - mutable TStopwatch fFindDigitIndexTimer; //!< counting time spent in FindDigitIndex - TStopwatch fGenerateNoisyDigitsTimer; //!< counting time spent in GenerateNoisyDigits() - TStopwatch fExecTimer; //!< couting time spent in Exec() - TF1* fNoiseFunction; //!< function to randomly get signal above n*sigma_ped - Bool_t fGenerateNoisyDigits; //!< whether or not we should generate noise-only digits for tracker - static const Double_t fgkNSigmas; ///< \brief number of sigmas above ped to use + AliMUONTriggerElectronics* fTriggerProcessor; ///< pointer to the trigger part of the job + TF1* fNoiseFunctionTrig; //!< function to get noise disribution on trig. chambers + Int_t fGenerateNoisyDigits; //!< whether or not we should generate noise-only digits for tracker (1) and trigger (2) + static Double_t fgNSigmas; ///< \brief number of sigmas above ped to use /// for noise-only digit generation and zero-suppression - - ClassDef(AliMUONDigitizerV3,3) // MUON Digitizer V3-3 + AliMUONLogger* fLogger; //!< to keep track of messages + AliMUONVTriggerStore* fTriggerStore; //!< trigger objects + AliMUONVDigitStore* fDigitStore; //!< temporary digits + AliMUONVDigitStore* fOutputDigitStore; //!< digits we'll output to disk + TObjArray* fInputDigitStores; //!< input digit stores (one per input file + AliMUONRecoParam* fRecoParam; //!< reco params (to know how to decalibrate) (not owner) + AliMUONTriggerChamberEfficiency* fTriggerEfficiency; //!< trigger efficiency map + AliMUONTriggerUtilities* fTriggerUtilities; //!< Trigger utilities for masks + TArrayI fEfficiencyResponse; //!< Local board efficiency response + + ClassDef(AliMUONDigitizerV3,11) // MUON Digitizer V3-11 }; #endif