]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOS.cxx
fixing wrong define
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.cxx
index c73bf3d6e357cd744654b225a9e7514b5938b7fb..8aecbb2211ce001cd7e2982a2a8ae63935ff03ac 100644 (file)
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.99  2006/06/28 11:36:09  cvetan
+ * New detector numbering scheme (common for DAQ/HLT/Offline). All the subdetectors shall use the AliDAQ class for the sim and rec of the raw data. The AliDAQ and raw reader classes now provide all the necessary interfaces to write and select the detector specific raw-data payload. Look into the AliDAQ.h and AliRawReader.h for more details.
+ *
+ * Revision 1.98  2006/05/11 11:30:48  cvetan
+ * Major changes in AliAltroBuffer. Now it can be used only for writing of raw data. All the corresponding read method are removed. It is based now on AliFstream in order to avoid endianess problems. The altro raw data is written always with little endian
+ *
  * Revision 1.97  2006/04/22 10:30:17  hristov
  * Add fEnergy to AliPHOSDigit and operate with EMC amplitude in energy units (Yu.Kharlov)
  *
@@ -81,6 +87,7 @@ class TFile;
 #include "AliCDBEntry.h"
 #include "AliCDBStorage.h"
 #include "AliPHOSCalibData.h"
+#include "AliDAQ.h"
 
 ClassImp(AliPHOS)
 
@@ -90,6 +97,10 @@ Double_t AliPHOS::fgTimeMax     = 2.56E-5 ;  // each sample is over 100 ns fTime
 Double_t AliPHOS::fgTimePeak    = 4.1E-6 ;   // 4 micro seconds
 Double_t AliPHOS::fgTimeTrigger = 100E-9 ;      // 100ns, just for a reference
 
+Double_t AliPHOS::fgHighCharge  = 8.2;       // adjusted for a high gain range of 5.12 GeV (10 bits)
+Double_t AliPHOS::fgHighGain    = 6.64;
+Double_t AliPHOS::fgHighLowGainFactor = 16.; // adjusted for a low gain range of 82 GeV (10 bits) 
+
 //____________________________________________________________________________
   AliPHOS:: AliPHOS() : AliDetector()
 {
@@ -102,12 +113,6 @@ Double_t AliPHOS::fgTimeTrigger = 100E-9 ;      // 100ns, just for a reference
 AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title)
 {
   //   ctor : title is used to identify the layout
-
-  fHighCharge        = 8.2 ;          // adjusted for a high gain range of 5.12 GeV (10 bits)
-  fHighGain          = 6.64 ; 
-  fHighLowGainFactor = 16. ;          // adjusted for a low gain range of 82 GeV (10 bits) 
-  fLowGainOffset     = GetGeometry()->GetNModules() + 1 ;   
-    // offset added to the module id to distinguish high and low gain data
 }
 
 //____________________________________________________________________________
@@ -120,13 +125,6 @@ void AliPHOS::Copy(TObject &obj)const
 {
   // copy method to be used by the cpy ctor
   TObject::Copy(obj);
-  
-  AliPHOS &phos = static_cast<AliPHOS &>(obj); 
-  
-  phos.fHighCharge        = fHighCharge ;
-  phos.fHighGain          = fHighGain ; 
-  phos.fHighLowGainFactor = fHighLowGainFactor ;  
-  phos.fLowGainOffset     = fLowGainOffset;   
 }
 
 //____________________________________________________________________________
@@ -438,7 +436,6 @@ void AliPHOS::Digits2Raw()
   }
 
   // some digitization constants
-  const Int_t    kDDLOffset = 0x600; // assigned to PHOS
 //   const Int_t    kThreshold = 1; // skip digits below this threshold // YVK
   const Float_t    kThreshold = 0.001; // skip digits below 1 MeV
   const Int_t      kAdcThreshold = 1;  // Lower ADC threshold to write to raw data
@@ -475,9 +472,7 @@ void AliPHOS::Digits2Raw()
       }
 
       // open new file and write dummy header
-      TString fileName("PHOS_") ;
-      fileName += (iDDL + kDDLOffset) ; 
-      fileName += ".ddl" ; 
+      TString fileName = AliDAQ::DdlFileName("PHOS",iDDL);
       buffer = new AliAltroBuffer(fileName.Data());
       buffer->WriteDataHeader(kTRUE, kFALSE);  //Dummy;
 
@@ -505,7 +500,7 @@ void AliPHOS::Digits2Raw()
       Bool_t lowgain = RawSampledResponse(digit->GetTimeR(), energy, adcValuesHigh, adcValuesLow) ; 
       
       if (lowgain) 
-       buffer->WriteChannel(relId[3], relId[2], module + fLowGainOffset
+       buffer->WriteChannel(relId[3], relId[2], module + GetGeometry()->GetNModules() + 1
                             GetRawFormatTimeBins(), adcValuesLow , kAdcThreshold);
       else 
        buffer->WriteChannel(relId[3], relId[2], module,