/* History of cvs commits:
*
* $Log$
+ * Revision 1.100 2007/10/10 09:05:10 schutz
+ * Changing name QualAss to QA
+ *
+ * Revision 1.99 2007/09/30 17:08:20 schutz
+ * Introducing the notion of QA data acquisition cycle (needed by online)
+ *
+ * Revision 1.98 2007/09/26 14:22:17 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
+ * Revision 1.97 2007/08/07 14:12:03 kharlov
+ * Quality assurance added (Yves Schutz)
+ *
+ * Revision 1.96 2007/04/28 10:43:36 policheh
+ * Dead channels simulation: digit energy sets to 0.
+ *
+ * Revision 1.95 2007/04/10 07:20:52 kharlov
+ * Decalibration should use the same CDB as calibration in AliPHOSClusterizerv1
+ *
+ * Revision 1.94 2007/02/01 10:34:47 hristov
+ * Removing warnings on Solaris x86
+ *
+ * Revision 1.93 2006/10/17 13:17:01 kharlov
+ * Replace AliInfo by AliDebug
+ *
+ * Revision 1.92 2006/08/28 10:01:56 kharlov
+ * Effective C++ warnings fixed (Timur Pocheptsov)
+ *
+ * Revision 1.91 2006/04/29 20:25:30 hristov
+ * Decalibration is implemented (Yu.Kharlov)
+ *
* Revision 1.90 2006/04/22 10:30:17 hristov
* Add fEnergy to AliPHOSDigit and operate with EMC amplitude in energy units (Yu.Kharlov)
*
#include "AliPHOSSDigitizer.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSTick.h"
+#include "AliPHOSQADataMaker.h"
ClassImp(AliPHOSDigitizer)
//____________________________________________________________________________
- AliPHOSDigitizer::AliPHOSDigitizer():AliDigitizer("",""),
- fInput(0),
- fInputFileNames(0x0),
- fEventNames(0x0)
+AliPHOSDigitizer::AliPHOSDigitizer() :
+ AliDigitizer("",""),
+ fDefaultInit(kTRUE),
+ fDigitsInRun(0),
+ fInit(kFALSE),
+ fInput(0),
+ fInputFileNames(0x0),
+ fEventNames(0x0),
+ fEmcCrystals(0),
+ fPinNoise(0.f),
+ fEMCDigitThreshold(0.f),
+ fCPVNoise(0.f),
+ fCPVDigitThreshold(0.f),
+ fTimeResolution(0.f),
+ fTimeThreshold(0.f),
+ fTimeSignalLength(0.f),
+ fADCchanelEmc(0.f),
+ fADCpedestalEmc(0.f),
+ fNADCemc(0),
+ fADCchanelCpv(0.f),
+ fADCpedestalCpv(0.f),
+ fNADCcpv(0),
+ fEventFolderName(""),
+ fFirstEvent(0),
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
{
// ctor
InitParameters() ;
- fDefaultInit = kTRUE ;
fManager = 0 ; // We work in the standalong mode
- fEventFolderName = "" ;
}
//____________________________________________________________________________
AliPHOSDigitizer::AliPHOSDigitizer(TString alirunFileName,
TString eventFolderName):
- AliDigitizer("PHOS"+AliConfig::Instance()->GetDigitizerTaskName(),
- alirunFileName),
- fInputFileNames(0), fEventNames(0), fEventFolderName(eventFolderName)
+ AliDigitizer("PHOS"+AliConfig::Instance()->GetDigitizerTaskName(), alirunFileName),
+ fDefaultInit(kFALSE),
+ fDigitsInRun(0),
+ fInit(kFALSE),
+ fInput(0),
+ fInputFileNames(0x0),
+ fEventNames(0x0),
+ fEmcCrystals(0),
+ fPinNoise(0.f),
+ fEMCDigitThreshold(0.f),
+ fCPVNoise(0.f),
+ fCPVDigitThreshold(0.f),
+ fTimeResolution(0.f),
+ fTimeThreshold(0.f),
+ fTimeSignalLength(0.f),
+ fADCchanelEmc(0.f),
+ fADCpedestalEmc(0.f),
+ fNADCemc(0),
+ fADCchanelCpv(0.f),
+ fADCpedestalCpv(0.f),
+ fNADCcpv(0),
+ fEventFolderName(eventFolderName),
+ fFirstEvent(0),
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
{
// ctor
InitParameters() ;
Init() ;
fDefaultInit = kFALSE ;
fManager = 0 ; // We work in the standalong mode
+ //Initialize the quality assurance data maker only once
+ fQADM = new AliPHOSQADataMaker() ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ;
+ GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ;
}
//____________________________________________________________________________
-AliPHOSDigitizer::AliPHOSDigitizer(const AliPHOSDigitizer & d)
- : AliDigitizer(d)
+AliPHOSDigitizer::AliPHOSDigitizer(const AliPHOSDigitizer & d) :
+ AliDigitizer(d),
+ fDefaultInit(d.fDefaultInit),
+ fDigitsInRun(d.fDigitsInRun),
+ fInit(d.fInit),
+ fInput(d.fInput),
+ fInputFileNames(0x0),//?
+ fEventNames(0x0),//?
+ fEmcCrystals(d.fEmcCrystals),
+ fPinNoise(d.fPinNoise),
+ fEMCDigitThreshold(d.fEMCDigitThreshold),
+ fCPVNoise(d.fCPVNoise),
+ fCPVDigitThreshold(d.fCPVDigitThreshold),
+ fTimeResolution(d.fTimeResolution),
+ fTimeThreshold(d.fTimeThreshold),
+ fTimeSignalLength(d.fTimeSignalLength),
+ fADCchanelEmc(d.fADCchanelEmc),
+ fADCpedestalEmc(d.fADCpedestalEmc),
+ fNADCemc(d.fNADCemc),
+ fADCchanelCpv(d.fADCchanelCpv),
+ fADCpedestalCpv(d.fADCpedestalCpv),
+ fNADCcpv(d.fNADCcpv),
+ fEventFolderName(d.fEventFolderName),
+ fFirstEvent(d.fFirstEvent),
+ fLastEvent(d.fLastEvent),
+ fQADM (d.fQADM),
+ fEventCounter(0)
+
{
// copyy ctor
-
SetName(d.GetName()) ;
SetTitle(d.GetTitle()) ;
- fPinNoise = d.fPinNoise ;
- fEMCDigitThreshold = d.fEMCDigitThreshold ;
- fCPVNoise = d.fCPVNoise ;
- fCPVDigitThreshold = d.fCPVDigitThreshold ;
- fTimeResolution = d.fTimeResolution ;
- fTimeThreshold = d.fTimeThreshold ;
- fTimeSignalLength = d.fTimeSignalLength ;
- fADCchanelEmc = d.fADCchanelEmc ;
- fADCpedestalEmc = d.fADCpedestalEmc ;
- fNADCemc = d.fNADCemc ;
- fADCchanelCpv = d.fADCchanelCpv ;
- fADCpedestalCpv = d.fADCpedestalCpv ;
- fNADCcpv = d.fNADCcpv ;
- fEventFolderName = d.fEventFolderName;
+//Initialize the quality assurance data maker only once
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQADataMaker()->Init(AliQA::kDIGITS, run, fgkCycles) ;
+ GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ;
}
//____________________________________________________________________________
-AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd):
- AliDigitizer(rd,"PHOS"+AliConfig::Instance()->GetDigitizerTaskName()),
- fEventFolderName(0)
+AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) :
+ AliDigitizer(rd,"PHOS"+AliConfig::Instance()->GetDigitizerTaskName()),
+ fDefaultInit(kFALSE),
+ fDigitsInRun(0),
+ fInit(kFALSE),
+ fInput(0),
+ fInputFileNames(0x0),
+ fEventNames(0x0),
+ fEmcCrystals(0),
+ fPinNoise(0.f),
+ fEMCDigitThreshold(0.f),
+ fCPVNoise(0.f),
+ fCPVDigitThreshold(0.f),
+ fTimeResolution(0.f),
+ fTimeThreshold(0.f),
+ fTimeSignalLength(0.f),
+ fADCchanelEmc(0.f),
+ fADCpedestalEmc(0.f),
+ fNADCemc(0),
+ fADCchanelCpv(0.f),
+ fADCpedestalCpv(0.f),
+ fNADCcpv(0),
+ fEventFolderName(fManager->GetInputFolderName(0)),
+ fFirstEvent(0),
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
+
{
// ctor Init() is called by RunDigitizer
fManager = rd ;
- fEventFolderName = fManager->GetInputFolderName(0) ;
SetTitle(dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetFileName(0));
InitParameters() ;
fDefaultInit = kFALSE ;
+//Initialize the quality assurance data maker only once
+ fQADM = new AliPHOSQADataMaker() ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQADataMaker()->Init(AliQA::kDIGITS, run) ;
+ GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ;
}
//____________________________________________________________________________
// dtor
delete [] fInputFileNames ;
delete [] fEventNames ;
-
+
+ delete fQADM ;
+
}
//____________________________________________________________________________
Int_t ReadEvent = event ;
if (fManager)
ReadEvent = dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetCurrentEventNumber() ;
- AliInfo(Form("Adding event %d from input stream 0 %s %s",
- ReadEvent, GetTitle(), fEventFolderName.Data())) ;
+ AliDebug(1,Form("Adding event %d from input stream 0 %s %s",
+ ReadEvent, GetTitle(), fEventFolderName.Data())) ;
gime->Event(ReadEvent, "S") ;
TClonesArray * digits = gime->Digits() ;
digits->Clear() ;
for(i = 1 ; i < fInput ; i++){
TString tempo(fEventNames[i]) ;
tempo += i ;
- AliPHOSGetter * gime = AliPHOSGetter::Instance(fInputFileNames[i], tempo) ;
+ AliPHOSGetter * gime1 = AliPHOSGetter::Instance(fInputFileNames[i], tempo) ;
if (fManager)
ReadEvent = dynamic_cast<AliStream*>(fManager->GetInputStream(i))->GetCurrentEventNumber() ;
AliInfo(Form("Adding event %d from input stream %d %s %s",
ReadEvent, i, fInputFileNames[i].Data(), tempo.Data())) ;
- gime->Event(ReadEvent,"S");
- sdigArray->AddAt(gime->SDigits(), i) ;
+ gime1->Event(ReadEvent,"S");
+ sdigArray->AddAt(gime1->SDigits(), i) ;
}
//Find the first crystal with signal
new((*ticks)[contrib++]) AliPHOSTick(curSDigit->GetTime(),0, b);
new((*ticks)[contrib++]) AliPHOSTick(curSDigit->GetTime()+fTimeSignalLength, -a, -b);
- *digit = *digit + *curSDigit ; //add energies
+ *digit += *curSDigit ; //add energies
index[i]++ ;
if( dynamic_cast<TClonesArray *>(sdigArray->At(i))->GetEntriesFast() > index[i] )
curSDigit->ShiftPrimary(primaryoffset) ;
//add energies
- *digit = *digit + *curSDigit ;
+ *digit += *curSDigit ;
index[i]++ ;
if( dynamic_cast<TClonesArray *>(sdigArray->At(i))->GetEntriesFast() > index[i] )
curSDigit = dynamic_cast<AliPHOSDigit*>( dynamic_cast<TClonesArray *>(sdigArray->At(i))->At(index[i]) ) ;
digit->SetAmp(DigitizeCPV(digit->GetEnergy(),digit->GetId()) ) ;
}
}
+
+ Int_t relId[4];
+
+ //set amplitudes in bad channels to zero
+ for(i = 0 ; i <digits->GetEntries(); i++){
+ digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
+ gime->PHOSGeometry()->AbsToRelNumbering(digit->GetId(),relId);
+ if(relId[1] == 0) // Emc
+ if(gime->CalibData()->IsBadChannelEmc(relId[0],relId[3],relId[2])) digit->SetEnergy(0.);
+ }
+
}
//____________________________________________________________________________
Int_t row =relId[2];
Int_t column=relId[3];
Float_t decalibration = gime->CalibData()->GetADCchannelEmc(module,column,row);
- Float_t energy = digit->GetEnergy() * decalibration;
+ Float_t energy = digit->GetEnergy() / decalibration;
digit->SetEnergy(energy);
}
//____________________________________________________________________________
return ;
}
- if(strstr(option,"tim"))
- gBenchmark->Start("PHOSDigitizer");
+ // check the QA result for Hits and SDigits
+ AliQA * qa = AliQA::Instance(AliQA::kPHOS) ;
+ if ( qa->IsSet(AliQA::kPHOS, AliQA::kSIM, AliQA::kFATAL)) {
+ AliFatal("QA status in Hits and/or SDIGITS was Fatal") ;
+ } else if ( qa->IsSet(AliQA::kPHOS, AliQA::kSIM, AliQA::kERROR)) {
+ AliError("QA status in Hits and/or SDIGITS was Error") ;
+ } else if ( qa->IsSet(AliQA::kPHOS, AliQA::kSIM, AliQA::kWARNING) ) {
+ AliWarning("QA status in Hits and/or SDIGITS was Warning") ;
+ } else if ( qa->IsSet(AliQA::kPHOS, AliQA::kSIM, AliQA::kINFO) ) {
+ AliInfo("QA status in Hits and/or SDIGITS was Info") ;
+ }
+
+ if(strstr(option,"tim"))
+ gBenchmark->Start("PHOSDigitizer");
AliPHOSGetter * gime = AliPHOSGetter::Instance(GetTitle()) ;
Int_t ievent ;
for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-
+ fEventCounter++ ;
gime->Event(ievent,"S") ;
Digitize(ievent) ; //Add prepared SDigits to digits and add the noise
+ //makes the quality assurance data
+ if (GetQADataMaker()->IsCycleDone() ) {
+ GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ;
+ GetQADataMaker()->StartOfCycle(AliQA::kDIGITS) ;
+ }
+ GetQADataMaker()->Exec(AliQA::kDIGITS, gime->Digits()) ;
+ GetQADataMaker()->Increment() ;
+
WriteDigits() ;
if(strstr(option,"deb"))
//increment the total number of Digits per run
fDigitsInRun += gime->Digits()->GetEntriesFast() ;
}
+
+ //Write the quality assurance data only after the last event
+ if ( fEventCounter == gime->MaxEvent() ) {
+ GetQADataMaker()->EndOfCycle(AliQA::kDIGITS) ;
+ GetQADataMaker()->Finish(AliQA::kDIGITS) ;
+ }
gime->PhosLoader()->CleanDigitizer();