AliRoot Core  3dc7879 (3dc7879)
AliFMDParameters.h
Go to the documentation of this file.
1 #ifndef ALIFMDPARAMETERS_H
2 #define ALIFMDPARAMETERS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved.
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice
9  */
10 //____________________________________________________________________
11 //
12 // Singleton class to handle various parameters (not geometry) of the
13 // FMD
14 // Should get ata fromm Conditions DB.
15 //
21 #ifndef ROOT_TNamed
22 # include <TNamed.h>
23 #endif
24 #ifndef ROOT_TArrayI
25 # include <TArrayI.h>
26 #endif
27 #include "AliFMDCalibFwd.h"
28 class AliCDBEntry;
29 class AliFMDPreprocessor;
30 
31 //____________________________________________________________________
32 //
33 // Singleton class to handle various parameters (not geometry) of the
34 // FMD
35 // Should get ata fromm Conditions DB.
36 //
37 
66 class AliFMDParameters : public TNamed
67 {
68 public:
70  enum What {
72  kPulseGain = 0x1, // Pulser gain
74  kPedestal = 0x2, // Pedestal and noise
76  kDeadMap = 0x4, // Dead channel map
78  kSampleRate = 0x8, // Over sampling rate
80  kZeroSuppression = 0x10, // Zero suppression parameters
82  kAltroMap = 0x20, // Altro channel map
84  kStripRange = 0x40 //Strip range,
85  };
86  enum {
89  };
90 
97  static AliFMDParameters* Instance();
98 
108  UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll );
119  UShort_t Init(AliFMDPreprocessor* pp,
120  Bool_t forceReInit=kFALSE,
121  UInt_t what=kAll);
145  UShort_t Init(const char* path,
146  Bool_t forceReInit=kFALSE,
147  UInt_t what=kAll);
148 
167  void MakeDeadMap(Float_t maxNoise=10, Float_t minGain=.1, Float_t maxGain=10);
186  void Print(Option_t* option="A") const;
202  void Draw(Option_t* option="pedestal");
203 
210  void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
215  void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
221  void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
225  void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
230  void SetZSPreSamples(UShort_t n=1) { fZSPre = (n & 0x3); }
235  void SetZSPostSamples(UShort_t n=1) { fZSPost = (n & 0x3); }
240  void SetZSPedSubtract(Bool_t use=kTRUE) { fZSPedSubtract = use; }
248  void SetZeroSuppression(UShort_t s=1) { fFixedZeroSuppression = s; }
252  void SetSampleRate(UShort_t r=2) { fFixedSampleRate = r ;}//(r>2?2:r);}
260  void SetPedestal(Float_t p=100) { fFixedPedestal = p; }
268  void SetPedestalWidth(Float_t w=2) { fFixedPedestalWidth = w; }
272  void SetThreshold(Float_t t=0) { fFixedThreshold = t; }
279  void SetStripRange(UShort_t min=0, UShort_t max=127);
292  void UseCompleteHeader(Bool_t yes=kTRUE) { fHasCompleteHeader = yes; }
300  void SetGain(Float_t g=2) { fFixedPulseGain = g; }
308  UShort_t GetVA1MipRange() const { return fVA1MipRange; }
312  UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
316  UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
320  Float_t GetEdepMip() const;
328  Float_t GetDACPerMIP() const;
332  Float_t GetPedestalFactor() const { return fPedestalFactor; }
337  UShort_t GetZSPreSamples() const { return fZSPre; }
342  UShort_t GetZSPostSamples() const { return fZSPost; }
347  Bool_t IsZSPedSubtract() const { return fZSPedSubtract; }
363  Bool_t IsDead(UShort_t detector,
364  Char_t ring,
365  UShort_t sector,
366  UShort_t strip) const;
373  Float_t GetThreshold() const;
391  Float_t GetPulseGain(UShort_t detector,
392  Char_t ring,
393  UShort_t sector,
394  UShort_t strip) const;
405  Float_t GetPedestal(UShort_t detector,
406  Char_t ring,
407  UShort_t sector,
408  UShort_t strip) const;
419  Float_t GetPedestalWidth(UShort_t detector,
420  Char_t ring,
421  UShort_t sector,
422  UShort_t strip) const;
433  UShort_t GetZeroSuppression(UShort_t detector,
434  Char_t ring,
435  UShort_t sector,
436  UShort_t strip) const;
447  UShort_t GetSampleRate(UShort_t detector,
448  Char_t ring,
449  UShort_t sector,
450  UShort_t strip) const;
461  UShort_t GetMinStrip(UShort_t detector,
462  Char_t ring,
463  UShort_t sector,
464  UShort_t strip) const;
475  UShort_t GetMaxStrip(UShort_t detector,
476  Char_t ring,
477  UShort_t sector,
478  UShort_t strip) const;
489  UShort_t GetPreSamples(UShort_t,
490  Char_t,
491  UShort_t,
492  UShort_t) const { return 14+5; }
493  /* @}*/
494 
515  Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
516  UShort_t altro, UShort_t chan,
517  UShort_t timebin,
518  UShort_t& det, Char_t& ring,
519  UShort_t& sec, Short_t& str,
520  UShort_t& sam) const;
535  Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr,
536  UShort_t timebin,
537  UShort_t& det, Char_t& ring,
538  UShort_t& sec, Short_t& str,
539  UShort_t& sam) const;
540 
557  Bool_t Detector2Hardware(UShort_t det, Char_t ring,
558  UShort_t sec, UShort_t str,
559  UShort_t sam,
560  UShort_t& ddl, UShort_t& board,
561  UShort_t& altro, UShort_t& channel,
562  UShort_t& timebin) const;
577  Bool_t Detector2Hardware(UShort_t det, Char_t ring,
578  UShort_t sec, UShort_t str,
579  UShort_t sam,
580  UShort_t& ddl, UShort_t& hwaddr,
581  UShort_t& timebin) const;
595  Bool_t HasCompleteHeader() const { return fHasCompleteHeader; }
596 
599  static const char* PulseGainPath() { return fgkPulseGain; }
600  static const char* PedestalPath() { return fgkPedestal; }
601  static const char* DeadPath() { return fgkDead; }
602  static const char* SampleRatePath() { return fgkSampleRate; }
603  static const char* AltroMapPath() { return fgkAltroMap; }
604  static const char* ZeroSuppressionPath() { return fgkZeroSuppression; }
605  static const char* StripRangePath() { return fgkStripRange; }
606  static const char* GetPedestalShuttleID() {return fkPedestalShuttleID;}
607  static const char* GetGainShuttleID() {return fkGainShuttleID;}
608  static const char* GetConditionsShuttleID() {return fkConditionsShuttleID;}
609 
610 protected:
619  : TNamed(o),
620  fIsInit(o.fIsInit),
626  fZSPre(o.fZSPre),
627  fZSPost(o.fZSPost),
637  fEdepMip(o.fEdepMip),
641  fPedestal(o.fPedestal),
643  fDeadMap(o.fDeadMap),
644  fAltroMap(o.fAltroMap),
646  fRunNo(o.fRunNo)
647  {}
653  AliFMDParameters& operator=(const AliFMDParameters&) { return *this; }
657  virtual ~AliFMDParameters() {}
661  static AliFMDParameters* fgInstance; // Static singleton instance
673  Bool_t CheckFile(const char* prefix, const char* path,
674  int number, TString& f) const;
684  AliCDBEntry* GetEntry(const char* path, AliFMDPreprocessor* pp,
685  Bool_t fatal=kTRUE) const;
693  UShort_t InitPulseGain(AliFMDPreprocessor* pp=0);
701  UShort_t InitPedestal(AliFMDPreprocessor* pp=0);
709  UShort_t InitDeadMap(AliFMDPreprocessor* pp=0);
717  UShort_t InitSampleRate(AliFMDPreprocessor* pp=0);
725  UShort_t InitZeroSuppression(AliFMDPreprocessor* pp=0);
733  UShort_t InitAltroMap(AliFMDPreprocessor* pp=0);
741  UShort_t InitStripRange(AliFMDPreprocessor* pp=0);
742  Bool_t CheckForNewRun();
743 
744  Bool_t fIsInit; // Whether we've been initialised
745 
746  static const char* fgkPulseGain; // Path to PulseGain calib object
747  static const char* fgkPedestal; // Path to Pedestal calib object
748  static const char* fgkDead; // Path to Dead calib object
749  static const char* fgkSampleRate; // Path to SampleRate calib object
750  static const char* fgkAltroMap; // Path to AltroMap calib object
751  static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
752  static const char* fgkStripRange; // Path to strip range cal object
753  const Float_t fkSiDeDxMip; // MIP dE/dx in Silicon
754  UShort_t fVA1MipRange; // # MIPs the pre-amp can do
755  UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
756  UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
757  Float_t fPedestalFactor; // Number of pedestal widths
758  UShort_t fZSPre; // Number of pre-samples in ZS
759  UShort_t fZSPost; // Number of post-samples in ZS
760  Bool_t fZSPedSubtract; // Pedestal subtraction before ZS
761 
762  Float_t fFixedPedestal; // Pedestal to subtract
763  Float_t fFixedPedestalWidth; // Width of pedestal
764  UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
765  UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
766  Float_t fFixedThreshold; // Threshold in ADC counts
767  UShort_t fFixedMinStrip; // Minimum strip read-out
768  UShort_t fFixedMaxStrip; // Maximum strip read-out
769  mutable Float_t fFixedPulseGain;
770  mutable Float_t fEdepMip;
771  Bool_t fHasCompleteHeader; // raw data has incomplete data header
772 
773  static const char* fkPedestalShuttleID; // Shuttle/preprocessor ID for pedestals
774  static const char* fkGainShuttleID; // Shuttle/preprocessor ID for gains
775  static const char* fkConditionsShuttleID; // Shuttle/preprocessor ID for conditions
776 
777  AliFMDCalibZeroSuppression* fZeroSuppression; // Zero suppression from CDB
778  AliFMDCalibSampleRate* fSampleRate; // Sample rate from CDB
780  AliFMDCalibGain* fPulseGain; // Pulser gain
781  AliFMDCalibDeadMap* fDeadMap; // Pulser gain
782  AliFMDAltroMapping* fAltroMap; // Map of hardware
784  Int_t fRunNo; // Initialized for this run
785 
786  ClassDef(AliFMDParameters,7) // Manager of parameters
787 };
788 
789 //__________________________________________________________________
790 inline void
791 AliFMDParameters::SetStripRange(UShort_t min, UShort_t max)
792 {
793  // Set fixed strip range
794  fFixedMinStrip = min;
795  fFixedMaxStrip = max;
796 }
797 
798 #endif
799 //____________________________________________________________________
800 //
801 // Local Variables:
802 // mode: C++
803 // End:
804 //
805 // EOF
806 //
807 
Float_t GetDACPerMIP() const
AliFMDCalibZeroSuppression * fZeroSuppression
static const char * fkConditionsShuttleID
UShort_t GetZeroSuppression(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
void SetThreshold(Float_t t=0)
void SetStripRange(AliFMDCalibStripRange *r)
UShort_t GetMaxStrip(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Bool_t IsDead(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Map of an integer per strip.
AliFMDParameters & operator=(const AliFMDParameters &)
UShort_t fAltroChannelSize
Bool_t Hardware2Detector(UShort_t ddl, UShort_t board, UShort_t altro, UShort_t chan, UShort_t timebin, UShort_t &det, Char_t &ring, UShort_t &sec, Short_t &str, UShort_t &sam) const
static const char * DeadPath()
static const char * fgkZeroSuppression
static const char * fgkDead
static const char * AltroMapPath()
UShort_t InitSampleRate(AliFMDPreprocessor *pp=0)
void SetZeroSuppression(UShort_t s=1)
const char * path
UShort_t InitDeadMap(AliFMDPreprocessor *pp=0)
This class is a singleton that handles various parameters of the FMD detectors. This class reads from...
Float_t GetPulseGain(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
AliFMDAltroMapping * GetAltroMap() const
void SetZSPreSamples(UShort_t n=1)
AliFMDAltroMapping * fAltroMap
static const char * PedestalPath()
Float_t p[]
Definition: kNNTest.C:133
void SetSampleRate(UShort_t r=2)
static const char * fgkPedestal
AliCDBEntry * GetEntry(const char *path, AliFMDPreprocessor *pp, Bool_t fatal=kTRUE) const
void Print(Option_t *option="A") const
void SetPedestalFactor(Float_t f=3)
void SetVA1MipRange(UShort_t r=20)
Float_t GetEdepMip() const
UShort_t GetZSPostSamples() const
UShort_t InitPedestal(AliFMDPreprocessor *pp=0)
UShort_t InitPulseGain(AliFMDPreprocessor *pp=0)
void SetPedestal(AliFMDCalibPedestal *p)
Gain value and width for each strip in the FMD.
Per digitizer card pulser calibration.
UShort_t InitZeroSuppression(AliFMDPreprocessor *pp=0)
void UseCompleteHeader(Bool_t yes=kTRUE)
void SetZSPedSubtract(Bool_t use=kTRUE)
static const char * fgkSampleRate
MAp of per strip boolean values.
Definition: AliFMDBoolMap.h:29
Bool_t fHasCompleteHeader
Cache of energy loss for a MIP.
static AliFMDParameters * fgInstance
AliFMDParameters(const AliFMDParameters &o)
AliFMDCalibStripRange * fStripRange
static const char * GetGainShuttleID()
void SetChannelsPerAltro(UShort_t size=128)
void SetStripRange(UShort_t min=0, UShort_t max=127)
UShort_t fFixedZeroSuppression
AliFMDCalibDeadMap * fDeadMap
Macros to do fast simulation of processes important for tuning of reconstruction Currently fast simulation of ionization digitization and cluster finder AliTPCclusterFast How to use it a which macro to use(I know it was somewhere in AliRoot but with the GIT page I dont find it anymore)
AliFMDCalibSampleRate * fSampleRate
char * prefix
UShort_t fChannelsPerAltro
Bool_t HasCompleteHeader() const
static const char * GetConditionsShuttleID()
static const char * SampleRatePath()
Class that encodes a map to/from ALTRO hardware address to FMD detector coordinates.
static AliFMDParameters * Instance()
UShort_t InitAltroMap(AliFMDPreprocessor *pp=0)
virtual ~AliFMDParameters()
const Float_t fkSiDeDxMip
Definition: AliCDBEntry.h:18
static const char * StripRangePath()
void SetPedestalWidth(Float_t w=2)
UShort_t InitStripRange(AliFMDPreprocessor *pp=0)
TF1 * f
Definition: interpolTest.C:21
Float_t GetThreshold() const
void SetSampleRate(AliFMDCalibSampleRate *r)
static const char * fkGainShuttleID
void MakeDeadMap(Float_t maxNoise=10, Float_t minGain=.1, Float_t maxGain=10)
static const char * fgkStripRange
void SetGain(AliFMDCalibGain *g)
void Draw(Option_t *option="pedestal")
static const char * ZeroSuppressionPath()
static const char * PulseGainPath()
Per digitizer card pulser calibration.
UShort_t GetPreSamples(UShort_t, Char_t, UShort_t, UShort_t) const
void SetPedestal(Float_t p=100)
static const char * fgkAltroMap
Bool_t CheckFile(const char *prefix, const char *path, int number, TString &f) const
Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, UShort_t sam, UShort_t &ddl, UShort_t &board, UShort_t &altro, UShort_t &channel, UShort_t &timebin) const
Float_t GetPedestalFactor() const
static const char * GetPedestalShuttleID()
void SetAltroChannelSize(UShort_t s=1024)
UShort_t GetZSPreSamples() const
AliFMDCalibPedestal * fPedestal
Float_t GetPedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
UShort_t GetAltroChannelSize() const
Float_t GetPedestalWidth(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
UShort_t GetChannelsPerAltro() const
static const char * fkPedestalShuttleID
UShort_t GetSampleRate(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
void SetZSPostSamples(UShort_t n=1)
Pedestal value and width for each strip in the FMD.
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)
void SetGain(Float_t g=2)
Bool_t IsZSPedSubtract() const
Float_t fEdepMip
Gain (cached)
AliFMDCalibGain * fPulseGain
UShort_t GetVA1MipRange() const
UShort_t GetMinStrip(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
static const char * fgkPulseGain