#include "AliRunLoader.h"
#include "AliLoader.h"
#include "AliGRPObject.h"
-#include "AliRunDigitizer.h"
+#include "AliDigitizationInput.h"
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
#include "AliCDBEntry.h"
}
//____________________________________________________________________________
- AliVZERODigitizer::AliVZERODigitizer(AliRunDigitizer* manager)
- :AliDigitizer(manager),
+ AliVZERODigitizer::AliVZERODigitizer(AliDigitizationInput* digInput)
+ :AliDigitizer(digInput),
fCalibData(GetCalibData()),
fPhotoCathodeEfficiency(0.18),
fNdigits(0),
fNBinsLT[i] = TMath::Nint(((Float_t)(fCalibData->GetMatchWindow(board)+1)*25.0)/
fCalibData->GetTimeResolution(board));
fBinSize[i] = fCalibData->GetTimeResolution(board);
- fHptdcOffset[i] = (((Float_t)fCalibData->GetTriggerCountOffset(board)-
- (Float_t)fCalibData->GetRollOver(board))*25.0+
+ fHptdcOffset[i] = (((Float_t)fCalibData->GetRollOver(board)-
+ (Float_t)fCalibData->GetTriggerCountOffset(board))*25.0+
fCalibData->GetTimeOffset(i)-
l1Delay-
phase->GetMeanPhase()+
delays->GetBinContent(i+1)+
kV0Offset);
+ fClockOffset[i] = (((Float_t)fCalibData->GetRollOver(board)-
+ (Float_t)fCalibData->GetTriggerCountOffset(board))*25.0+
+ fCalibData->GetTimeOffset(i)-
+ l1Delay+
+ kV0Offset);
fTime[i] = new Float_t[fNBins[i]];
memset(fTime[i],0,fNBins[i]*sizeof(Float_t));
}
//____________________________________________________________________________
-void AliVZERODigitizer::Exec(Option_t* /*option*/)
+void AliVZERODigitizer::Digitize(Option_t* /*option*/)
{
// Creates digits from hits
fNdigits = 0;
- if (fVZERO && !fManager) {
+ if (fVZERO && !fDigInput) {
AliLoader *loader = fVZERO->GetLoader();
if (!loader) {
AliError("Can not get VZERO Loader via AliVZERO object!");
}
}
}
- else if (fManager) {
+ else if (fDigInput) {
ReadSDigits();
DigitizeSDigits();
- AliRunLoader *currentLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
+ AliRunLoader *currentLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName());
AliLoader *loader = currentLoader->GetLoader("VZEROLoader");
if (!loader) {
AliError("Cannot get VZERO Loader via RunDigitizer!");
}
TClonesArray* hits = fVZERO->Hits();
- Float_t lightYieldCorr[64] = {0.01051, 0.00955, 0.00861, 0.00948, 0.01082, 0.00870, 0.01023, 0.01012, 0.01270, 0.01184, 0.01110, 0.01266, 0.00956, 0.00826, 0.00966, 0.00891, 0.01358, 0.01543, 0.01516, 0.01337, 0.01908, 0.01641, 0.01767, 0.01512, 0.01664, 0.01326, 0.01536, 0.00586, 0.01439, 0.01445, 0.01504, 0.01079, 0.00105, 0.00110, 0.00143, 0.00093, 0.00072, 0.01919, 0.00073, 0.02580, 0.02911, 0.00148, 0.03176, 0.00126, 0.00158, 0.00111, 0.02804, 0.00109, 0.00157, 0.00158, 0.00104, 0.00120, 0.00123, 0.00188, 0.00193, 0.03442, 0.00200, 0.00185, 0.00143, 0.00257, 0.00201, 0.00151, 0.00197, 0.00282};
-
// Now makes Digits from hits
Int_t nTracks = (Int_t) treeH->GetEntries();
for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
Int_t nPhot = hit->Nphot();
Int_t cell = hit->Cell();
Int_t pmt = Cell2Pmt(cell);
+ if (pmt < 0) continue;
Int_t trackLabel = hit->GetTrack();
for(Int_t l = 0; l < 3; ++l) {
if (fLabels[pmt][l] < 0) {
if (pmt < 32) t += kV0CDelayCables;
t += fHptdcOffset[pmt];
Int_t nPhE;
- Float_t prob = lightYieldCorr[pmt]*fPhotoCathodeEfficiency; // Optical losses included!
+ Float_t prob = fCalibData->GetLightYields(pmt)*fPhotoCathodeEfficiency; // Optical losses included!
if (nPhot > 100)
nPhE = (Int_t)gRandom->Gaus(prob*Float_t(nPhot)+0.5,
sqrt(Float_t(nPhot)*prob*(1.-prob)));
Float_t maximum = 0.9*fSignalShape->GetMaximum(0,200); // Not exact, one needs to do this on the convoluted
Float_t integral2 = fSignalShape->Integral(0,200); // function. Anyway the effect is small <10% on the 2.5 ADC thr
for (Int_t ipmt = 0; ipmt < 64; ++ipmt) {
- Float_t thr = fCalibData->GetDiscriThr(ipmt)*kChargePerADC*maximum*fBinSize[ipmt]/integral2;
+ Float_t thr = fCalibData->GetCalibDiscriThr(ipmt,kFALSE)*kChargePerADC*maximum*fBinSize[ipmt]/integral2;
Bool_t ltFound = kFALSE, ttFound = kFALSE;
for (Int_t iBin = 0; iBin < fNBins[ipmt]; ++iBin) {
Float_t t = fBinSize[ipmt]*Float_t(iBin);
}
}
}
- Float_t tadc = t - kClockOffset - fCalibData->GetTimeOffset(ipmt);
+ Float_t tadc = t - fClockOffset[ipmt];
Int_t clock = kNClocks/2 - Int_t(tadc/25.0);
if (clock >= 0 && clock < kNClocks)
fAdc[ipmt][clock] += fTime[ipmt][iBin]/kChargePerADC;
}
+ AliDebug(1,Form("Channel %d Offset %f Time %f",ipmt,fClockOffset[ipmt],fLeadingTime[ipmt]));
Int_t board = AliVZEROCalibData::GetBoardNumber(ipmt);
if (ltFound && ttFound) {
fTimeWidth[ipmt] = fCalibData->GetWidthResolution(board)*
for (Int_t j=0; j<64; ++j){
for (Int_t iClock = 0; iClock < kNClocks; ++iClock) {
Int_t integrator = (iClock + fEvenOrOdd) % 2;
+ AliDebug(1,Form("ADC %d %d %f",j,iClock,fAdc[j][iClock]));
fAdc[j][iClock] += gRandom->Gaus(fAdcPedestal[j][integrator], fAdcSigma[j][integrator]);
}
}
}
// Loop over input files
- Int_t nFiles= fManager->GetNinputs();
+ Int_t nFiles= fDigInput->GetNinputs();
for (Int_t inputFile = 0; inputFile < nFiles; inputFile++) {
// Get the current loader
AliRunLoader* currentLoader =
- AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
+ AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inputFile));
AliLoader *loader = currentLoader->GetLoader("VZEROLoader");
loader->LoadSDigits("READ");
// Get the tree of summable digits
TTree* sdigitsTree = loader->TreeS();
if (!sdigitsTree) {
- AliError("No sdigit tree from manager");
+ AliError("No sdigit tree from digInput");
continue;
}