#include "AliLog.h"
#include "AliRun.h"
#include "AliRunDigitizer.h"
+#include "AliLoader.h"
#include "AliRunLoader.h"
#include <Riostream.h>
#include <TRandom.h>
#include <TString.h>
#include <TSystem.h>
+#include <TTree.h>
//-----------------------------------------------------------------------------
/// \class AliMUONDigitizerV3
/// - add some electronics noise (thus leading to a realistic adc), if requested to do so
/// - sets the signal to zero if below 3*sigma of the noise
- Float_t charge = digit.Charge();
+ Float_t charge = digit.IsChargeInFC() ? digit.Charge()*AliMUONConstants::FC2ADC() : digit.Charge();
// We set the charge to 0, as the only relevant piece of information
// after Digitization is the ADC value.
if ( stationType != AliMp::kStationTrigger )
{
- ApplyResponseToTrackerDigit(*digit,kAddNoise);
+ Bool_t addNoise = kAddNoise;
+ if (digit->IsConverted()) addNoise = kFALSE; // No need to add extra noise to a converted real digit
+ ApplyResponseToTrackerDigit(*digit,addNoise);
}
if ( digit->ADC() > 0 || digit->Charge() > 0 )
Float_t pedestalSigma = pedestals.ValueAsFloat(channel,1);
AliDebugClass(1,Form("DE %04d MANU %04d CH %02d PEDMEAN %7.2f PEDSIGMA %7.2f",
- pedestals.ID0(),pedestals.ID1(),channel,pedestalMean,pedestalSigma));
+ pedestals.ID0(),pedestals.ID1(),channel,pedestalMean,pedestalSigma));
Float_t a0 = gains.ValueAsFloat(channel,0);
Float_t a1 = gains.ValueAsFloat(channel,1);
Int_t thres = gains.ValueAsInt(channel,2);
Int_t qual = gains.ValueAsInt(channel,3);
+
if ( qual <= 0 ) return 0;
Float_t chargeThres = a0*thres;
if ( adc < TMath::Nint(pedestalMean + fgNSigmas*pedestalSigma + 0.5) )
{
+ // this is an error only in specific cases
+ if ( !addNoise || (addNoise && noiseOnly) )
+ {
+ AliErrorClass(Form(" DE %04d Manu %04d Channel %02d "
+ " a0 %7.2f a1 %7.2f thres %04d ped %7.2f pedsig %7.2f adcNoise %7.2f "
+ " charge=%7.2f padc=%7.2f adc=%04d ZS=%04d fgNSigmas=%e addNoise %d noiseOnly %d ",
+ pedestals.ID0(),pedestals.ID1(),channel,
+ a0, a1, thres, pedestalMean, pedestalSigma, adcNoise,
+ charge, padc, adc,
+ TMath::Nint(pedestalMean + fgNSigmas*pedestalSigma + 0.5),
+ fgNSigmas,addNoise,noiseOnly));
+ }
+
adc = 0;
}
// files.
for ( Int_t iFile = 0; iFile < nInputFiles; ++iFile )
- {
+ {
AliLoader* inputLoader = GetLoader(fManager->GetInputFolderName(iFile));
inputLoader->LoadSDigits("READ");
dstore->Clear();
}
+
// At this point, we do have digit arrays (one per chamber) which contains
// the merging of all the sdigits of the input file(s).
// Generate noise-only digits for trigger.
GenerateNoisyDigitsForTrigger(*fDigitStore);
}
-
ApplyResponse(*fDigitStore,*fOutputDigitStore);
-
+
if ( fGenerateNoisyDigits )
{
// Generate noise-only digits for tracker.