if (!fSDigits) fSDigits = new TClonesArray("AliPMDsdigit", 1000);
treeS->Branch("PMDSDigit", &fSDigits, bufsize);
- const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
+// const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
const Int_t kRow = 48;
const Int_t kCol = 96;
const Int_t kSMN = 48;
}
}
- for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++)
- {
-
- rawReader->Reset();
- AliPMDRawStream pmdinput(rawReader);
- rawReader->Select("PMD", indexDDL, indexDDL);
-
- pmdinput.DdlData(indexDDL,&pmdddlcont);
-
+ AliPMDRawStream pmdinput(rawReader);
+ Int_t indexDDL = -1;
+ while ((indexDDL = pmdinput.DdlData(&pmdddlcont)) >=0)
+ {
Int_t ientries = pmdddlcont.GetEntries();
for (Int_t ient = 0; ient < ientries; ient++)
{
for (Int_t icol = 0; icol < kCol; icol++)
{
- Int_t trno = -99999;
- Int_t sig1 = precpvADC[indexsmn][irow][icol];
+ Int_t trno = -99999; // when extracted from raw data
+ Int_t trpid = -99999; // when extracted from raw data
+ Int_t sig1 = precpvADC[indexsmn][irow][icol];
// plug in a function to convert to adc to MeV
Float_t edep = 0.;
if (sig1 > 0)
{
AdcToMeV(sig1,edep);
- AddSDigit(trno,idet,ismn,irow,icol,edep);
+ AddSDigit(trno,trpid,idet,ismn,irow,icol,edep);
}
} // row
} // col
if (!fDigits) fDigits = new TClonesArray("AliPMDdigit", 1000);
treeD->Branch("PMDDigit", &fDigits, bufsize);
- const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
+// const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
const Int_t kRow = 48;
const Int_t kCol = 96;
const Int_t kSMN = 48;
}
}
}
- for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++)
- {
- rawReader->Reset();
- AliPMDRawStream pmdinput(rawReader);
- rawReader->Select("PMD", indexDDL, indexDDL);
-
- //pmdinput.DdlData(&pmdddlcont);
- pmdinput.DdlData(indexDDL,&pmdddlcont);
-
-
+
+ AliPMDRawStream pmdinput(rawReader);
+ Int_t indexDDL = -1;
+ while ((indexDDL = pmdinput.DdlData(&pmdddlcont)) >=0)
+ {
Int_t ientries = pmdddlcont.GetEntries();
for (Int_t ient = 0; ient < ientries; ient++)
{
{
for (Int_t icol = 0; icol < kCol; icol++)
{
- Int_t trno = -99999;
- Int_t sig1 = precpvADC[indexsmn][irow][icol];
+ Int_t trno = -99999; // when extracted from raw
+ Int_t trpid = -99999; // when extracted from raw
+ Int_t sig1 = precpvADC[indexsmn][irow][icol];
// plug in a function to convert to adc to MeV
if (sig1 > 0)
{
- AddDigit(trno,idet,ismn,irow,icol,sig1);
+ AddDigit(trno,trpid,idet,ismn,irow,icol,sig1);
}
} // row
} // col
void AliPMDRawToSDigits::AdcToMeV(Int_t adc, Float_t &edep)
{
- // To be implemented, this is just for the test
-
- const Float_t kConstant = 7.181;
- // const Float_t kErConstant = 0.6899;
- const Float_t kSlope = 35.93;
- // const Float_t kErSlope = 0.306;
-
+ // These constants are from Test Beam 2010
+ const Float_t kConstant = 0.612796;
+ const Float_t kSlope = 130.158;
- Float_t adc10bit = (Float_t) adc/4;
- edep = (1000.0/kSlope)*(adc10bit - kConstant);
+ edep = (1000.0/kSlope)*(adc - kConstant);
}
// ------------------------------------------------------------------------- //
-void AliPMDRawToSDigits::AddSDigit(Int_t trnumber, Int_t det, Int_t smnumber,
+void AliPMDRawToSDigits::AddSDigit(Int_t trnumber, Int_t trpid, Int_t det,
+ Int_t smnumber,
Int_t irow, Int_t icol, Float_t adc)
{
// Add SDigit
//
if (!fSDigits) fSDigits = new TClonesArray("AliPMDsdigit", 1000);
TClonesArray &lsdigits = *fSDigits;
- new(lsdigits[fNsdigit++]) AliPMDsdigit(trnumber,det,smnumber,irow,icol,adc);
+ new(lsdigits[fNsdigit++]) AliPMDsdigit(trnumber,trpid,det,smnumber,irow,icol,adc);
}
// ------------------------------------------------------------------------- //
-void AliPMDRawToSDigits::AddDigit(Int_t trnumber, Int_t det, Int_t smnumber,
+void AliPMDRawToSDigits::AddDigit(Int_t trnumber, Int_t trpid, Int_t det,
+ Int_t smnumber,
Int_t irow, Int_t icol, Float_t adc)
{
// Add Digit
//
if (!fDigits) fDigits = new TClonesArray("AliPMDdigit", 1000);
TClonesArray &ldigits = *fDigits;
- new(ldigits[fNdigit++]) AliPMDdigit(trnumber,det,smnumber,irow,icol,adc);
+ new(ldigits[fNdigit++]) AliPMDdigit(trnumber,trpid,det,smnumber,irow,icol,adc);
}
// ------------------------------------------------------------------------- //