/* History of cvs commits:
*
* $Log$
+ * Revision 1.97 2006/04/22 10:30:17 hristov
+ * Add fEnergy to AliPHOSDigit and operate with EMC amplitude in energy units (Yu.Kharlov)
+ *
+ * Revision 1.96 2006/04/07 08:41:59 hristov
+ * Follow AliAlignObj framework and remove AliPHOSAlignData (Yu.Kharlov)
+ *
+ * Revision 1.95 2006/03/14 19:40:41 kharlov
+ * Remove De-digitizing of raw data and digitizing the raw data fit
+ *
* Revision 1.94 2006/03/07 18:56:25 kharlov
* CDB is passed via environment variable
*
{
// ctor : title is used to identify the layout
- // Check if CDB_PATH is defined and take alignment data from CDB
- AliPHOSAlignData* alignda = 0;
- if (gSystem->Getenv("CDB_PATH")) {
- TString cdbPath = gSystem->Getenv("CDB_PATH");
- AliCDBStorage *cdbStorage = AliCDBManager::Instance()->GetStorage(cdbPath);
- if (cdbStorage != NULL) {
- alignda =
- (AliPHOSAlignData*)(cdbStorage->Get("PHOS/Alignment/Geometry",0)->GetObject());
- if(AliLog::GetGlobalDebugLevel()>0) alignda->Print();
- }
- else {
- Fatal("AliPHOS", "No CDB storage at the path %s", cdbPath.Data()) ;
- }
- }
-
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(alignda)->GetNModules() + 1 ;
+ fLowGainOffset = GetGeometry()->GetNModules() + 1 ;
// offset added to the module id to distinguish high and low gain data
}
return;
}
- // get the digitizer
- loader->LoadDigitizer();
-// AliPHOSDigitizer * digitizer = dynamic_cast<AliPHOSDigitizer *>(loader->Digitizer()) ;
-
// get the geometry
AliPHOSGeometry* geom = GetGeometry();
if (!geom) {
// some digitization constants
const Int_t kDDLOffset = 0x600; // assigned to PHOS
- const Int_t kThreshold = 1; // skip digits below this threshold
+// 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
AliAltroBuffer* buffer = NULL;
Int_t prevDDL = -1;
Int_t adcValuesLow[fkTimeBins];
Int_t adcValuesHigh[fkTimeBins];
-// AliPHOSCalibData* calib=0;
-
-// //retrieve calibration database
-// if(AliCDBManager::Instance()->IsDefaultStorageSet()){
-// AliCDBEntry *entry = (AliCDBEntry*) AliCDBManager::Instance()->GetDefaultStorage()
-// ->Get("PHOS/GainFactors_and_Pedestals/Calibration",gAlice->GetRunNumber());
-// calib = (AliPHOSCalibData*) entry->GetObject();
-// }
-
// loop over digits (assume ordered digits)
for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
AliPHOSDigit* digit = dynamic_cast<AliPHOSDigit *>(digits->At(iDigit)) ;
- if (digit->GetAmp() < kThreshold)
+ if (digit->GetEnergy() < kThreshold)
continue;
Int_t relId[4];
geom->AbsToRelNumbering(digit->GetId(), relId);
TString fileName("PHOS_") ;
fileName += (iDDL + kDDLOffset) ;
fileName += ".ddl" ;
- buffer = new AliAltroBuffer(fileName.Data(), 1);
+ buffer = new AliAltroBuffer(fileName.Data());
buffer->WriteDataHeader(kTRUE, kFALSE); //Dummy;
prevDDL = iDDL;
// out of time range signal (?)
if (digit->GetTimeR() > GetRawFormatTimeMax() ) {
- buffer->FillBuffer(digit->GetAmp());
+ buffer->FillBuffer((Int_t)digit->GetEnergy());
buffer->FillBuffer(GetRawFormatTimeBins() ); // time bin
buffer->FillBuffer(3); // bunch length
buffer->WriteTrailer(3, relId[3], relId[2], module); // trailer
} else {
Double_t energy = 0 ;
Int_t module = relId[0];
-// Int_t column = relId[3];
-// Int_t row = relId[2];
if ( digit->GetId() <= geom->GetNModules() * geom->GetNCristalsInModule()) {
-// if(calib)
-// energy = digit->GetAmp()*calib->GetADCchannelEmc(module,column,row) +
-// calib->GetADCpedestalEmc(module,column,row);
-// else
-// energy=digit->GetAmp()*digitizer->GetEMCchannel()+digitizer->GetEMCpedestal();
-// }
- energy=digit->GetAmp();
+ energy=digit->GetEnergy();
}
else {
// energy = digit->GetAmp()*digitizer->GetCPVchannel()+digitizer->GetCPVpedestal();
}
Bool_t lowgain = RawSampledResponse(digit->GetTimeR(), energy, adcValuesHigh, adcValuesLow) ;
- if (lowgain)
+ if (lowgain)
buffer->WriteChannel(relId[3], relId[2], module + fLowGainOffset,
- GetRawFormatTimeBins(), adcValuesLow, kThreshold);
+ GetRawFormatTimeBins(), adcValuesLow , kAdcThreshold);
else
buffer->WriteChannel(relId[3], relId[2], module,
- GetRawFormatTimeBins(), adcValuesHigh, kThreshold);
+ GetRawFormatTimeBins(), adcValuesHigh, kAdcThreshold);
}
}
{
// for a start time dtime and an amplitude damp given by digit,
// calculates the raw sampled response AliPHOS::RawResponseFunction
+ // Input: dtime - signal start time
+ // damp - signal amplitude (energy)
+ // Output: adcH - array[fkTimeBins] of 10-bit samples for high-gain channel
+ // adcL - array[fkTimeBins] of 10-bit samples for low-gain channel
const Int_t kRawSignalOverflow = 0x3FF ;
Bool_t lowGain = kFALSE ;