#include "AliAltroBuffer.h"
#include "AliRawReader.h"
#include "AliEMCALRawStream.h"
+#include "AliDAQ.h"
ClassImp(AliEMCAL)
Double_t AliEMCAL::fgCapa = 1.; // 1pF
Double_t AliEMCAL::fgTimePeak = 4.1E-6 ; // 4 micro seconds
Double_t AliEMCAL::fgTimeTrigger = 100E-9 ; // 100ns, just for a reference
// some digitization constants
-Int_t AliEMCAL::fgDDLOffset = 0x800;
Int_t AliEMCAL::fgThreshold = 1;
// 24*48=1152 towers per SM; divided up on 3 DDLs,
// each DDL with 12FEC *32towers or 12*32*2 channels (high&low gain)
{
// Default ctor
fName = "EMCAL" ;
+ Init();
+
}
//____________________________________________________________________________
AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
{
// ctor : title is used to identify the layout
+ Init();
+
+}
+
+//____________________________________________________________________________
+AliEMCAL::AliEMCAL(const AliEMCAL& emcal) : AliDetector(emcal)
+{
+ //copy ctor
+ Init();
- 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 = 1 ; // offset added to the module id to distinguish high and low gain data
}
//____________________________________________________________________________
AliEMCAL::~AliEMCAL()
{
+ //dtor
+}
+//____________________________________________________________________________
+void AliEMCAL::Init(void)
+{
+ //initialize EMCAL values
+ fBirkC0 = 1;
+ fBirkC1 = 0.013/1.032;
+ fBirkC2 = 9.6e-6/(1.032 * 1.032);
+
+ 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 = 1 ; // offset added to the module id to distinguish high and low gain data
}
//____________________________________________________________________________
void AliEMCAL::Copy(AliEMCAL & emcal) const
{
+ //copy
+
TObject::Copy(emcal) ;
emcal.fHighCharge = fHighCharge ;
emcal.fHighGain = fHighGain ;
//____________________________________________________________________________
AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
{
+ //create and return the digitizer
return new AliEMCALDigitizer(manager);
}
// get the digits
loader->LoadDigits("EMCAL");
+ loader->GetEvent();
TClonesArray* digits = loader->Digits() ;
if (!digits) {
AliAltroBuffer* buffer = NULL;
Int_t prevDDL = -1;
- Int_t adcValuesLow[fkTimeBins];
- Int_t adcValuesHigh[fkTimeBins];
+ Int_t adcValuesLow[fgkTimeBins];
+ Int_t adcValuesHigh[fgkTimeBins];
// loop over digits (assume ordered digits)
for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
}
// open new file and write dummy header
- TString fileName("EMCAL_") ;
- fileName += (iDDL + fgDDLOffset) ;
- fileName += ".ddl" ;
- buffer = new AliAltroBuffer(fileName.Data(), 1);
+ TString fileName(AliDAQ::DdlFileName("EMCAL",iDDL));
+ buffer = new AliAltroBuffer(fileName.Data());
buffer->WriteDataHeader(kTRUE, kFALSE); //Dummy;
prevDDL = iDDL;
// Use AliAltroRawStream to read the ALTRO format. No need to
// reinvent the wheel :-)
AliEMCALRawStream in(reader);
- // Select EMCAL DDL's; lowest 8 bits of DDL offser is used for something else..
- reader->Select(fgDDLOffset >> 8);
+ // Select EMCAL DDL's;
+ reader->Select("EMCAL");
// reading is from previously existing AliEMCALGetter.cxx
// ReadRaw method
//__________________________________________________________________
Double_t AliEMCAL::RawResponseFunctionMax(Double_t charge, Double_t gain)
{
+ //compute the maximum of the raw response function and return
return ( charge * TMath::Power(fgOrder, fgOrder) * TMath::Power(gain, fgOrder)
/ ( fgCapa * TMath::Exp(fgOrder) ) );