#include "AliPHOSPulseGenerator.h"
#include "AliDAQ.h"
#include "AliPHOSRawDecoder.h"
+#include "AliPHOSCalibData.h"
#include "AliPHOSRawDigiProducer.h"
#include "AliPHOSQAChecker.h"
-#include "AliPHOSRecoParamEmc.h"
+#include "AliPHOSRecoParam.h"
#include "AliPHOSSimParam.h"
ClassImp(AliPHOS)
//____________________________________________________________________________
- AliPHOS:: AliPHOS() : AliDetector()
+ AliPHOS:: AliPHOS() : AliDetector(),fgCalibData(0)
{
// Default ctor
fName = "PHOS" ;
}
//____________________________________________________________________________
-AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title)
+AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title),
+fgCalibData(0)
{
// ctor : title is used to identify the layout
}
//____________________________________________________________________________
AliPHOS::~AliPHOS()
{
+ if(fgCalibData) delete fgCalibData ;
}
//____________________________________________________________________________
}
// get mapping from OCDB
- const TObjArray* maps = AliPHOSRecoParamEmc::GetMappings();
+ const TObjArray* maps = AliPHOSRecoParam::GetMappings();
if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
// some digitization constants
- const Float_t kThreshold = 0.001; // skip digits below 1 MeV
+ const Float_t kThreshold = 1.; // skip digits below 1 ADC channel
const Int_t kAdcThreshold = 1; // Lower ADC threshold to write to raw data
Int_t prevDDL = -1;
+ if(fgCalibData==0)
+ fgCalibData= new AliPHOSCalibData(-1) ;
+
// Create a shaper pulse object
AliPHOSPulseGenerator *pulse = new AliPHOSPulseGenerator();
// loop over digits (assume ordered digits)
for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
AliPHOSDigit* digit = dynamic_cast<AliPHOSDigit *>(digits->At(iDigit)) ;
+
+ // Skip small energy below treshold
if (digit->GetEnergy() < kThreshold)
continue;
+
Int_t relId[4];
geom->AbsToRelNumbering(digit->GetId(), relId);
Int_t module = relId[0];
relId[0]-1,relId[3]-1,relId[2]-1));
// if a signal is out of time range, write only trailer
if (digit->GetTimeR() > pulse->GetRawFormatTimeMax()*0.5 ) {
- AliInfo("Signal is out of time range.\n");
+ AliDebug(2,"Signal is out of time range.\n");
buffer[iDDL]->FillBuffer(0);
buffer[iDDL]->FillBuffer(pulse->GetRawFormatTimeBins() ); // time bin
buffer[iDDL]->FillBuffer(3); // bunch length
}
pulse->SetAmplitude(energy);
pulse->SetTZero(digit->GetTimeR());
+ Double_t r =fgCalibData->GetHighLowRatioEmc(relId[0],relId[3],relId[2]) ;
+ pulse->SetHG2LGRatio(r) ;
pulse->MakeSamples();
pulse->GetSamples(adcValuesHigh, adcValuesLow) ;
buffer[iDDL]->WriteChannel(relId[3]-1, relId[2]-1, 0,
char branchname[20];
sprintf(branchname,"%s",GetName());
// Branch address for hit tree
- TTree *treeH = TreeH();
+ TTree *treeH = fLoader->TreeH();
if (treeH) {
branch = treeH->GetBranch(branchname);
if (branch)