X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALDigitizer.h;h=50cc23b73764f88ffeb850edb0b89676dde4015e;hb=34729e7928922d1536e3cbc54515af448adf2fc6;hp=7c1b13d4ef96e47b7fedf969e622db1af36efb3c;hpb=9bd3cababdf7742bc43f3555ac9ed99cf4f80710;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALDigitizer.h b/EMCAL/AliEMCALDigitizer.h index 7c1b13d4ef9..50cc23b7376 100644 --- a/EMCAL/AliEMCALDigitizer.h +++ b/EMCAL/AliEMCALDigitizer.h @@ -1,119 +1,135 @@ -#ifndef ALIEMCALDigitizer_H -#define ALIEMCALDigitizer_H +#ifndef ALIEMCALDIGITIZER_H +#define ALIEMCALDIGITIZER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //_________________________________________________________________________ -// Task Class for making Digits in EMCAL -// +// Class that performs digitization of Summable digits from simulated data +// +// In addition it performs mixing of summable digits from different events. +// +// For each event two branches are created in TreeD: +// "EMCAL" - list of digits +// "EMCALTRG" - list of trigger digits +// "AliEMCALDigitizer" - AliEMCALDigitizer with all parameters used in digitization +// //*-- Author: Sahal Yacoob (LBL) // based on : AliPHOSDigit +// July 2003 Yves Schutz : NewIO +// November 2003 Aleksei Pavlinov : Shish-Kebab geometry +// +// July 2011 GCB: Digitizer modified to accomodate embedding. +// Time calibration added. Decalibration possibility of energy and time added //_________________________________________________________________________ -#include // --- ROOT system --- +class TClonesArray ; +class TBrowser; -#include "TObjString.h" -class TArrayI ; // --- Standard library --- // --- AliRoot header files --- -class AliEMCALSDigitizer ; -#include "AliRunDigitizer.h" #include "AliDigitizer.h" - +#include "AliConfig.h" +class AliEMCALCalibData ; +class AliEMCALSDigitizer ; +class AliDigitizationInput ; class AliEMCALDigitizer: public AliDigitizer { public: - AliEMCALDigitizer() ; // ctor - AliEMCALDigitizer(const char *headerFile,const char * sDigitsBranchTitle = "Default") ; - AliEMCALDigitizer(AliRunDigitizer * ard) ; - AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) - {( (AliEMCALDigitizer &)dtizer ).Copy(*this) ;} + AliEMCALDigitizer() ; // ctor + AliEMCALDigitizer(TString alirunFileNameFile, + TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; + AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ; + AliEMCALDigitizer(AliDigitizationInput * manager) ; virtual ~AliEMCALDigitizer() ; - void Digitize(const Int_t); // Make Digits from SDigits stored in fSDigits - void Exec(Option_t *option); // Supervising method - - const TString GetHitsFileName() const { return fHitsFileName ; } - const TString GetSDigitsFileName() const { return fSDigitsFileName ; } - const Float_t GetTowerThreshold() const { return fTowerDigitThreshold;} - const Float_t GetPedestal() const { return fPedestal; } - const Float_t GetPinNoise() const { return fPinNoise;} - const Float_t GetSlope() const { return fSlope; } - const Float_t GetTimeResolution() const { return fTimeResolution ; } - const Float_t GetTowerchannel() const { return fADCchannelTower ; } - const Float_t GetTowerpedestal() const { return fADCpedestalTower ; } - const Float_t GetPreShochannel() const { return fADCchannelPreSho ; } - const Float_t GetPreShopedestal() const { return fADCpedestalPreSho ; } - - void MixWith(char* HeaderFile) ; // Add another one file to mix - virtual void Print(Option_t* option)const ; - void Reset() ; //restarts starts event processing from 0 event(s) - const Int_t GetDigitsInRun() const { return fDigitsInRun; } ; - void SetTowerThreshold(Float_t EMCThreshold) {fTowerDigitThreshold = EMCThreshold;} - void SetPinNoise(Float_t PinNoise ) {fPinNoise = PinNoise;} - - void SetSDigitsBranch(const char* file) ; - void SetSplitFile(const TString splitFileName = "EMCAL.Digits.root") ; - - - AliEMCALDigitizer & operator = (const AliEMCALDigitizer & rvalue) { + void Digitize(Int_t event); // Make Digits from SDigits stored in fSDigits + void Digitize(Option_t *option); // Supervising method + + Int_t GetDigitThreshold() const { return fDigitThreshold ; } + Float_t GetPinNoise() const { return fPinNoise ; } + Float_t GetTimeNoise() const { return fTimeNoise ; } + Float_t GetTimeResolution(const Float_t energy) const; + Double_t GetTimeResolutionPar0() const { return fTimeResolutionPar0 ; } + Double_t GetTimeResolutionPar1() const { return fTimeResolutionPar1 ; } + Double_t GetTimeDelay() const { return fTimeDelay ; } + Float_t GetECAchannel() const { return fADCchannelEC ; } + Float_t GetECApedestal() const { return fADCpedestalEC ; } + + void SetEventRange(Int_t first=0, Int_t last=-1) { fFirstEvent = first ; + fLastEvent = last ; } + void SetDigitThreshold(Int_t EMCThreshold) { fDigitThreshold = EMCThreshold ; } + void SetPinNoise(Float_t pinNoise ) { fPinNoise = pinNoise ; } + void SetTimeNoise(Float_t timeNoise ) { fTimeNoise = timeNoise ; } + + //General + Int_t GetDigitsInRun() const { return fDigitsInRun; } + void Print (Option_t * option = "") const ; + void Print1(Option_t * option) ; // *MENU* + + + AliEMCALDigitizer & operator = (const AliEMCALDigitizer & /*rvalue*/) { // assignement operator requested by coding convention but not needed - abort() ; - return *this ; + Fatal("operator =", "not implemented") ; + return *this ; } - private: - Bool_t Init(); - void InitParameters() ; - Bool_t ReadSDigits() ; // Read sdigits for particular events - void WriteDigits(Int_t evt) ; // Writes Digits for particular event - void PrintDigits(Option_t * option) ; - Float_t TimeOfNoise(void) ; // Calculate time signal generated by noise - Float_t FrontEdgeTime(TClonesArray * ticks) ; - Int_t DigitizeEnergy(Float_t energy, Int_t absId) ; + Bool_t Init(); + void InitParameters() ; + void PrintDigits(Option_t * option) ; + void Unload() ; + void WriteDigits() ; // Writes Digits the current event + void WriteDigits(TClonesArray* digits, const char* branchName = "EMTRG"); // + Float_t TimeOfNoise(void) ; // Calculate time signal generated by noise + + void CalibrateADCTime (Float_t & adc , Float_t & time, const Int_t AbsId) ; + void DigitizeEnergyTime(Float_t & energy, Float_t & time, const Int_t AbsId) ; + void Digits2FastOR(TClonesArray*digitsTMP, TClonesArray* digitsTRG); + void DigitalFastOR(Double_t time, Double_t dE, Int_t timeSamples[], Int_t nSamples); + void Decalibrate(AliEMCALDigit *digit); + private: - TString fHitsFileName ; // file name that contains the original hits - TString fSDigitsFileName ; // file name that contains the original SDigits - Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) - // !!! the following is not necessary, it is in the folder !!!!!!! - AliEMCALSDigitizer * fSDigitizer ; // ! SDigitizer to extract some sdigitizing parameters - Int_t fNinputs ; // Number of input files - Bool_t fInitialized ; // - - Int_t fDigitsInRun ; //! Total number of digits in one run - Float_t fPedestal ; // Calibration parameters - Float_t fSlope ; // read from SDigitizer - - Float_t fPinNoise ; // Electronics noise in EMC - Float_t fTowerDigitThreshold ; // Threshold for storing digits in EMC - Float_t fPreShowerDigitThreshold ; // Threshold for Preshower digits - - Float_t fTimeResolution ; // Time resolution of FEE electronics - Float_t fTimeThreshold ; // Threshold to start timing for given crystall - Float_t fTimeSignalLength ; // Length of the timing signal - - Float_t fADCchannelTower ; // width of one ADC channel in Tower (GeV) - Float_t fADCpedestalTower ; // - Int_t fNADCTower ; // number of channels in Tower ADC - - Float_t fADCchannelPreSho ; // width of one ADC channel in Pre Shower (GeV) - Float_t fADCpedestalPreSho ; // - Int_t fNADCPreSho ; // number of channels in Pre Shower ADC - TFile * fSplitFile ; //! file in which Digits will eventually be stored - - ClassDef(AliEMCALDigitizer,1) // description - + Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) + Int_t fDigitsInRun ; //! Total number of digits in one run + Bool_t fInit ; //! To avoid overwriting existing files + + Int_t fInput ; // Number of files to merge + TString *fInputFileNames ; //[fInput] List of file names to merge + TString *fEventNames ; //[fInput] List of event names to merge + + Int_t fDigitThreshold ; // Threshold for storing digits in EMC, ACD units + Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy + Float_t fGainFluctuations ; // correct fMeanPhotonElectron by the gain fluctuations + Float_t fPinNoise ; // Electronics noise in EMC, APD + Double_t fTimeNoise; // Electronics noise in EMC, time + Double_t fTimeDelay; // Time delay to reproduce data delay + Double_t fTimeResolutionPar0 ; // Time resolution of FEE electronics + Double_t fTimeResolutionPar1 ; // Time resolution of FEE electronics + Float_t fADCchannelEC ; // calibration width of one ADC channel in EC section (GeV) + Float_t fADCpedestalEC ; // calibration pedestal for one ADC channel + Float_t fADCchannelECDecal ; // decalibration width of one ADC channel in EC section (GeV) + Float_t fTimeChannel ; // calibration time width for one channel + Float_t fTimeChannelDecal ; // calibration time width for one channel + Int_t fNADCEC ; // number of channels in EC section ADC + + TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode + Int_t fFirstEvent; // first event to process + Int_t fLastEvent; // last event to process + + AliEMCALCalibData * fCalibData; // Calibration data pointer + AliEMCALSDigitizer* fSDigitizer; // SDigitization object + + ClassDef(AliEMCALDigitizer,13) }; -#endif // AliEMCALDigitizer_H +#endif // AliEMCALDIGITIZER_H