]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrapConfigHandler.h
Fix for true centrality estimator with hijing npart (Alberica)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrapConfigHandler.h
index 77ebf4eaa693d12ce3ed2cd9130a42dd4015fcaf..0e485e3fcf9f7c29fbd8aefd5611c182639e31c3 100644 (file)
 
 
 #include <TObject.h>
-
-class AliTRDgeometry;
-class AliTRDtrapConfig;
-class AliTRDpadPlane;
-
+#include "AliTRDltuParam.h"
+#include "AliTRDCalOnlineGainTable.h"
+#include "AliTRDtrapConfig.h"
 
 class AliTRDtrapConfigHandler : public TObject {
  public:
-                    AliTRDtrapConfigHandler();
+                    AliTRDtrapConfigHandler(AliTRDtrapConfig *cfg);
   virtual          ~AliTRDtrapConfigHandler();
 
+  void Init();                                                // Set DMEM allocation modes
   void ResetMCMs();                                           // Reset all trap registers and DMEM of the MCMs
-  Int_t LoadConfig(TString filename, Int_t det);              // load a TRAP configuration from a file
+  Int_t LoadConfig();                                         // load a default configuration suitable for simulation
+  Int_t LoadConfig(TString filename);                         // load a TRAP configuration from a file
+  Int_t SetGaintable(AliTRDCalOnlineGainTable const &gtbl);   // Set a gain table to correct Q0 and Q1 for PID
 
   void ProcessLTUparam(Int_t dest, Int_t addr, UInt_t data);  // Process the LTU parameters
   void PrintGeoTest();                                        // Prints some information about the geometry. Only for debugging
@@ -32,49 +33,50 @@ class AliTRDtrapConfigHandler : public TObject {
   // Int_t poke(Int_t rob, Int_t mcm, Int_t addr, UInt_t value);   // not implemented yet
 
  private:
-  void  ConfigureDyCorr();                                    // deflection length correction due to Lorentz angle and tilted pad correction
-  void  ConfigureDRange();                                    // deflection range LUT,  range calculated according to B-field (in T) and pt_min (in GeV/c)
-  void  ConfigureNTimebins();                                 // timebins in the drift region
-  void  ConfigurePIDcorr();                                   // Calculate the mcm individual correction factors for the PID
+  Bool_t AddValues(UInt_t det, UInt_t cmd, UInt_t extali, Int_t addr, UInt_t data);
 
-  Int_t GetPadPosNonRot(Int_t rob, Int_t mcm, Int_t channel, Double_t trackCoor[3]);    // calcutate the gobal coordinates for an mcm channel in the supermodule at position -0.5
-  void GetLocalPadPos(AliTRDpadPlane *plane, Int_t rob, Int_t mcm, Int_t channel, Double_t result[2]); // calculate the local coordinates for an mcm channel
+  void  ConfigureDyCorr(Int_t det);                             // deflection length correction due to Lorentz angle and tilted pad correction
+  void  ConfigureDRange(Int_t det);                             // deflection range LUT,  range calculated according to B-field (in T) and pt_min (in GeV/c)
+  void  ConfigureNTimebins(Int_t det);                          // timebins in the drift region
+  void  ConfigurePIDcorr(Int_t det);                            // Calculate the mcm individual correction factors for the PID
 
-  Double_t Square(Double_t val);  // returns the square of a given number
+  Double_t Square(Double_t val) const { return val*val; };          // returns the square of a given number
 
   AliTRDtrapConfigHandler(const AliTRDtrapConfigHandler &h);             // not implemented
   AliTRDtrapConfigHandler &operator=(const AliTRDtrapConfigHandler &h);  // not implemented
 
-
-
-  static const UInt_t fgkScsnCmdWrite=10;  // SCSN command for the write command
-  static const UInt_t fgkScsnLTUparam=27;  // extended SCSN command for the LTU configuration
-
-  static const Int_t fgkDyMaxCut = 63;     // Maximum value of the deflection cut
-  static const Int_t fgkDyMinCut = -64;    // Minimum value of the deflection cut
+  static const UInt_t fgkScsnCmdReset=6;     // SCSN command for reset
+  static const UInt_t fgkScsnCmdPause=8;     // SCSN command to pause
+  static const UInt_t fgkScsnCmdRead=9;      // SCSN command to read
+  static const UInt_t fgkScsnCmdWrite=10;    // SCSN command to write
+  static const UInt_t fgkScsnCmdPtrg=12;     // SCSN command for pretrigger
+  static const UInt_t fgkScsnCmdRobPower=16; // SCSN command to switch ROB power
+  static const UInt_t fgkScsnCmdRobReset=17; // SCSN command for ROB reset
+
+  static const UInt_t fgkScsnCmdRestr=18;    // SCSN command to restrict commands to specified chambers
+  static const UInt_t fgkScsnCmdTtcRx=19;    // SCSN command to configure TTCrx
+  static const UInt_t fgkScsnCmdHwPtrg=20;   // SCSN command to issue pretrigger pulse
+  static const UInt_t fgkScsnCmdSetHC=22;    // SCSN command to set HC ID
+  static const UInt_t fgkScsnCmdMcmTemp=24;  // SCSN command for MCM temperature sensors
+  static const UInt_t fgkScsnCmdPM=25;       // SCSN command for patchmaker
+  static const UInt_t fgkScsnCmdOri=26;      // SCSN command for ORI configuration
+  static const UInt_t fgkScsnLTUparam=27;    // extended SCSN command for the LTU configuration
 
   static const Int_t fgkMCMperROBCol = 4;  // MCMs per ROB column
   static const Int_t fgkPadsPerMCM = 18;   // readout pads per MCM
   static const Int_t fgkMCMperROBRow = 4;  // MCMs per ROB row
 
+  static const Int_t fgkMaxLinkPairs=4;    // number of linkpairs used during configuration
+  static const Int_t fgkMcmlistSize=256;     // list of MCMs to which a value has to be written
 
-  AliTRDgeometry *fGeo;                    // Pointer to the AliTRDgeometry class
-
-  Int_t fDet;   // detector number (0 - 539)
+  AliTRDltuParam     ltuParam;             // ltuParam class for the actual calculation of the parameters
 
-  Double_t fBField;                        // value of the L3 magnet field
-  Double_t fOmegaTau;                      // ometa tau
-  Double_t fPtMin;                         // lower p_t threshold for the tracks which should pass the deflection cut
-  Int_t fNTimebins;                        // Number of time bins in the drift region (only relevant for GTU)
-  UInt_t fScaleQ0;                         // scale parameter to map the accumulated charge in the first time window to a memory address
-  UInt_t fScaleQ1;                         // scale parameter to map the accumulated charge in the second time window to a memory address
-  Bool_t fPidTracklengthCorr;              // Factor to correct the accumulated charge for track length effects
-  Bool_t fTiltCorr;                        // tilting correction
+  UInt_t fRestrictiveMask;                 // mask to restrict subsequent commands to specified chambers
 
+  AliTRDtrapConfig *fTrapConfig;           // pointer to TRAP config in use
+  AliTRDCalOnlineGainTable fGtbl;          // gain table
 
   ClassDef(AliTRDtrapConfigHandler,0)
 };
 
-
 #endif
-