fPulseGain(0),
fDeadMap(0),
fAltroMap(0),
- fStripRange(0)
+ fStripRange(0),
+ fRunNo(-1)
{
//
// Default constructor
}
//__________________________________________________________________
-void
+Bool_t
+AliFMDParameters::CheckForNewRun()
+{
+ Int_t run = AliCDBManager::Instance()->GetRun();
+ if (run != fRunNo) {
+ fIsInit = false;
+ fRunNo = run;
+ }
+ return run != fRunNo;
+}
+
+//__________________________________________________________________
+UShort_t
AliFMDParameters::Init(Bool_t forceReInit, UInt_t what)
{
//
// what What to initialize
//
if (forceReInit) fIsInit = kFALSE;
- if (fIsInit) return;
- if (what & kPulseGain) InitPulseGain();
- if (what & kPedestal) InitPedestal();
- if (what & kDeadMap) InitDeadMap();
- if (what & kSampleRate) InitSampleRate();
- if (what & kZeroSuppression) InitZeroSuppression();
- if (what & kAltroMap) InitAltroMap();
- if (what & kStripRange) InitStripRange();
+ CheckForNewRun();
+
+ if (fIsInit) return 0;
+
+ UShort_t errMask = 0;
+ if (what & kPulseGain) errMask |= InitPulseGain();
+ if (what & kPedestal) errMask |= InitPedestal();
+ if (what & kDeadMap) errMask |= InitDeadMap();
+ if (what & kSampleRate) errMask |= InitSampleRate();
+ if (what & kZeroSuppression) errMask |= InitZeroSuppression();
+ if (what & kAltroMap) errMask |= InitAltroMap();
+ if (what & kStripRange) errMask |= InitStripRange();
fIsInit = kTRUE;
+
+ return errMask;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::Init(AliFMDPreprocessor* pp, Bool_t forceReInit, UInt_t what)
{
//
// what What to initialize
//
if (forceReInit) fIsInit = kFALSE;
- if (fIsInit) return;
- if (what & kPulseGain) InitPulseGain(pp);
- if (what & kPedestal) InitPedestal(pp);
- if (what & kDeadMap) InitDeadMap(pp);
- if (what & kSampleRate) InitSampleRate(pp);
- if (what & kZeroSuppression) InitZeroSuppression(pp);
- if (what & kAltroMap) InitAltroMap(pp);
- if (what & kStripRange) InitStripRange(pp);
+ CheckForNewRun();
+
+ if (fIsInit) return 0;
+
+ UShort_t errMask = 0;
+ if (what & kPulseGain) errMask |= InitPulseGain(pp);
+ if (what & kPedestal) errMask |= InitPedestal(pp);
+ if (what & kDeadMap) errMask |= InitDeadMap(pp);
+ if (what & kSampleRate) errMask |= InitSampleRate(pp);
+ if (what & kZeroSuppression) errMask |= InitZeroSuppression(pp);
+ if (what & kAltroMap) errMask |= InitAltroMap(pp);
+ if (what & kStripRange) errMask |= InitStripRange(pp);
fIsInit = kTRUE;
+
+ return errMask;
}
//__________________________________________________________________
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::Init(const char* path, Bool_t forceReInit, UInt_t what)
{
//
// what What calibrations to load.
//
if (forceReInit) fIsInit = kFALSE;
- if (fIsInit) return;
+ CheckForNewRun();
+
+ if (fIsInit) return 0;
AliFMDCalibStripRange* range = 0;
AliFMDCalibSampleRate* rate = 0;
if (peds) what &= ~kPedestal;
if (gains) what &= ~kPulseGain;
- Init(kFALSE, what);
+ UShort_t ret = Init(kFALSE, what);
if (range) SetStripRange(range);
if (rate) SetSampleRate(rate);
if (gains) SetGain(gains);
fIsInit = kTRUE;
+
+ return ret;
}
//__________________________________________________________________
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitPulseGain(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* gain = GetEntry(fgkPulseGain, pp);
- if (!gain) return;
+ if (!gain) return kPulseGain;
AliFMDDebug(5, ("Got gain from CDB"));
fPulseGain = dynamic_cast<AliFMDCalibGain*>(gain->GetObject());
- if (!fPulseGain) AliFatal("Invalid pulser gain object from CDB");
- if (!fPulseGain->Values().Ptr())
- AliFatal("Empty pulser gain object from CDB");
+ if (!fPulseGain) {
+ AliError("Invalid pulser gain object from CDB");
+ return kPulseGain;
+ }
+ if (!fPulseGain->Values().Ptr()) {
+ AliError("Empty pulser gain object from CDB");
+ return kPulseGain;
+ }
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitPedestal(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* pedestal = GetEntry(fgkPedestal, pp);
- if (!pedestal) return;
+ if (!pedestal) return kPedestal;
AliFMDDebug(5, ("Got pedestal from CDB"));
fPedestal = dynamic_cast<AliFMDCalibPedestal*>(pedestal->GetObject());
- if (!fPedestal) AliFatal("Invalid pedestal object from CDB");
- if (!fPedestal->Values().Ptr()) AliFatal("Empty pedestal object from CDB");
+ if (!fPedestal) {
+ AliError("Invalid pedestal object from CDB");
+ return kPedestal;
+ }
+ if (!fPedestal->Values().Ptr()) {
+ AliError("Empty pedestal object from CDB");
+ return kPedestal;
+ }
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitDeadMap(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* deadMap = GetEntry(fgkDead, pp);
- if (!deadMap) return;
+ if (!deadMap) return kDeadMap;
AliFMDDebug(5, ("Got dead map from CDB"));
fDeadMap = dynamic_cast<AliFMDCalibDeadMap*>(deadMap->GetObject());
- if (!fDeadMap) AliFatal("Invalid dead map object from CDB");
- if (!fDeadMap->Ptr()) AliFatal("Empty dead map object from CDB");
+ if (!fDeadMap) {
+ AliError("Invalid dead map object from CDB");
+ return kDeadMap;
+ }
+ if (!fDeadMap->Ptr()) {
+ AliError("Empty dead map object from CDB");
+ return kDeadMap;
+ }
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitZeroSuppression(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* zeroSup = GetEntry(fgkZeroSuppression, pp);
- if (!zeroSup) return;
+ if (!zeroSup) return kZeroSuppression;
+
AliFMDDebug(5, ("Got zero suppression from CDB"));
fZeroSuppression =
dynamic_cast<AliFMDCalibZeroSuppression*>(zeroSup->GetObject());
- if (!fZeroSuppression)AliFatal("Invalid zero suppression object from CDB");
+ if (!fZeroSuppression) {
+ AliError("Invalid zero suppression object from CDB");
+ return kZeroSuppression;
+ }
if (!fZeroSuppression->Ptr()) {
AliWarningF("Empty zero suppression object from CDB, assuming %d",
fFixedZeroSuppression);
delete fZeroSuppression;
fZeroSuppression = 0;
}
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitSampleRate(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* sampRat = GetEntry(fgkSampleRate, pp);
- if (!sampRat) return;
+ if (!sampRat) return kSampleRate;
+
AliFMDDebug(5, ("Got zero suppression from CDB"));
fSampleRate = dynamic_cast<AliFMDCalibSampleRate*>(sampRat->GetObject());
- if (!fSampleRate) AliFatal("Invalid sample rate object from CDB");
- if (!fSampleRate->Rates().Ptr())
- AliFatal("empty sample rate object from CDB");
+ if (!fSampleRate) {
+ AliError("Invalid sample rate object from CDB");
+ return kSampleRate;
+ }
+ if (!fSampleRate->Rates().Ptr()) {
+ AliError("empty sample rate object from CDB");
+ return kSampleRate;
+ }
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitAltroMap(AliFMDPreprocessor* pp)
{
//
fAltroMap = 0;
}
AliCDBEntry* hwMap = GetEntry(fgkAltroMap, pp, kFALSE);
- if (!hwMap) return;
-
- AliFMDDebug(5, ("Got ALTRO map from CDB"));
- fAltroMap = dynamic_cast<AliFMDAltroMapping*>(hwMap->GetObject());
+ if (hwMap) {
+ AliFMDDebug(5, ("Got ALTRO map from CDB"));
+ fAltroMap = dynamic_cast<AliFMDAltroMapping*>(hwMap->GetObject());
+ }
if (!fAltroMap) {
- AliFatal("Invalid ALTRO map object from CDB");
+ AliError("Invalid ALTRO map object from CDB");
fAltroMap = new AliFMDAltroMapping;
+ // return kAltroMap;
}
+ return 0;
}
//__________________________________________________________________
-void
+UShort_t
AliFMDParameters::InitStripRange(AliFMDPreprocessor* pp)
{
//
// pp Pre-processor if called from shuttle
//
AliCDBEntry* range = GetEntry(fgkStripRange, pp);
- if (!range) return;
+ if (!range) return kStripRange;
+
AliFMDDebug(5, ("Got strip range from CDB"));
fStripRange = dynamic_cast<AliFMDCalibStripRange*>(range->GetObject());
- if (!fStripRange) AliFatal("Invalid strip range object from CDB");
- if (!fStripRange->Ranges().Ptr())
- AliFatal("Empty strip range object from CDB");
+
+ if (!fStripRange) {
+ AliError("Invalid strip range object from CDB");
+ return kStripRange;
+ }
+ if (!fStripRange->Ranges().Ptr()) {
+ AliError("Empty strip range object from CDB");
+ return kStripRange;
+ }
+ return 0;
}
*
* @param forceReInit Force (re-)initalize flag
* @param what What to initialize
+ *
+ * @return 0 on success, bit mask of failed elements otherwise
*/
- void Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll );
+ UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll );
/**
* Initialize the manager. This tries to read the parameters from
* CDB. If that fails, the class uses the hard-coded parameters.
* @param pp Preprocessor
* @param forceReInit Force (re-)initalize flag
* @param what What to initialize
+ *
+ * @return 0 on success, bit mask of failed elements otherwise
*/
- void Init(AliFMDPreprocessor* pp,
+ UShort_t Init(AliFMDPreprocessor* pp,
Bool_t forceReInit=kFALSE,
UInt_t what=kAll);
/**
* @param path Where to look for the CSV files
* @param forceReInit Always reinitialise
* @param what What calibrations to load.
+ *
+ * @return 0 on success, bit mask of failed elements otherwise
*/
- void Init(const char* path,
- Bool_t forceReInit=kFALSE,
- UInt_t what=kAll);
+ UShort_t Init(const char* path,
+ Bool_t forceReInit=kFALSE,
+ UInt_t what=kAll);
/**
* Automatically generate a dead map from the pedestals and gains.
fPulseGain(o.fPulseGain),
fDeadMap(o.fDeadMap),
fAltroMap(o.fAltroMap),
- fStripRange(o.fStripRange)
+ fStripRange(o.fStripRange),
+ fRunNo(o.fRunNo)
{}
/**
* Assignement operator
* Initialize gains. Try to get them from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitPulseGain(AliFMDPreprocessor* pp=0);
+ UShort_t InitPulseGain(AliFMDPreprocessor* pp=0);
/**
* Initialize pedestals. Try to get them from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitPedestal(AliFMDPreprocessor* pp=0);
+ UShort_t InitPedestal(AliFMDPreprocessor* pp=0);
/**
* Initialize dead map. Try to get it from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitDeadMap(AliFMDPreprocessor* pp=0);
+ UShort_t InitDeadMap(AliFMDPreprocessor* pp=0);
/**
* Initialize sample rates. Try to get them from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitSampleRate(AliFMDPreprocessor* pp=0);
+ UShort_t InitSampleRate(AliFMDPreprocessor* pp=0);
/**
* Initialize zero suppression thresholds. Try to get them from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitZeroSuppression(AliFMDPreprocessor* pp=0);
+ UShort_t InitZeroSuppression(AliFMDPreprocessor* pp=0);
/**
* Initialize hardware map. Try to get it from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitAltroMap(AliFMDPreprocessor* pp=0);
+ UShort_t InitAltroMap(AliFMDPreprocessor* pp=0);
/**
* Initialize strip range. Try to get it from CDB
*
* @param pp Pre-processor if called from shuttle
+ *
+ * @return 0 on success, error mask otherwise
*/
- void InitStripRange(AliFMDPreprocessor* pp=0);
+ UShort_t InitStripRange(AliFMDPreprocessor* pp=0);
+ Bool_t CheckForNewRun();
Bool_t fIsInit; // Whether we've been initialised
AliFMDCalibDeadMap* fDeadMap; // Pulser gain
AliFMDAltroMapping* fAltroMap; // Map of hardware
AliFMDCalibStripRange* fStripRange; // Strip range
+ Int_t fRunNo; // Initialized for this run
- ClassDef(AliFMDParameters,6) // Manager of parameters
+ ClassDef(AliFMDParameters,7) // Manager of parameters
};
//__________________________________________________________________
//_____________________________________________________________________
void AliFMDQADataMakerRec::StartOfDetectorCycle()
{
- // What
- // to
- // do?
-
+ // Do an init on the reconstructor. If we have the
+ // same run nothing happens, but if we have a new run, we update our
+ // parameters.
+ if (fUseReconstructor && fReconstructor) fReconstructor->Init();
if (fRawsQAList) {
for (Int_t index = 0 ; index < AliRecoParam::kNSpecies ; index++) {
if (!fRawsQAList[index]) continue;
fDiagStep3(0),
fDiagStep4(0),
fDiagAll(0),
- fBad(0)
+ fBad(0),
+ fZombie(false)
{
// Make a new FMD reconstructor object - default CTOR.
SetNoiseFactor();
// Initialize the parameters
AliFMDParameters* param = AliFMDParameters::Instance();
- param->Init();
+ if (param->Init() != 0) {
+ AliError("Failed to initialize parameters, making zombie");
+ fZombie = true;
+ }
+ else
+ fZombie = false;
// Current vertex position
fCurrentVertex = 0;
// Check if we need diagnostics histograms
if (!fDiagnostics) return;
AliInfo("Making diagnostics histograms");
- fDiagStep1 = new TH2I("diagStep1", "Read ADC vs. Noise surpressed ADC",
- 1024, -.5, 1023.5, 1024, -.5, 1023.5);
- fDiagStep1->SetDirectory(0);
- fDiagStep1->GetXaxis()->SetTitle("ADC (read)");
- fDiagStep1->GetYaxis()->SetTitle(Form("ADC (noise surpressed %4.f)",
- fNoiseFactor));
- fDiagStep2 = new TH2F("diagStep2", "ADC vs Edep deduced",
- 1024, -.5, 1023.5, 100, 0, 2);
- fDiagStep2->SetDirectory(0);
- fDiagStep2->GetXaxis()->SetTitle("ADC (noise surpressed)");
- fDiagStep2->GetYaxis()->SetTitle("#Delta E [GeV]");
- fDiagStep3 = new TH2F("diagStep3", "Edep vs Edep path corrected",
- 100, 0., 2., 100, 0., 2.);
- fDiagStep3->SetDirectory(0);
- fDiagStep3->GetXaxis()->SetTitle("#Delta E [GeV]");
- fDiagStep3->GetYaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
- fDiagStep4 = new TH2F("diagStep4", "Edep vs Multiplicity deduced",
- 100, 0., 2., 100, -.1, 19.9);
- fDiagStep4->SetDirectory(0);
- fDiagStep4->GetXaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
- fDiagStep4->GetYaxis()->SetTitle("Multiplicity");
- fDiagAll = new TH2F("diagAll", "Read ADC vs Multiplicity deduced",
- 1024, -.5, 1023.5, 100, -.1, 19.9);
- fDiagAll->SetDirectory(0);
- fDiagAll->GetXaxis()->SetTitle("ADC (read)");
- fDiagAll->GetYaxis()->SetTitle("Multiplicity");
+ if (!fDiagStep1) {
+ fDiagStep1 = new TH2I("diagStep1", "Read ADC vs. Noise surpressed ADC",
+ 1024, -.5, 1023.5, 1024, -.5, 1023.5);
+ fDiagStep1->SetDirectory(0);
+ fDiagStep1->GetXaxis()->SetTitle("ADC (read)");
+ fDiagStep1->GetYaxis()->SetTitle(Form("ADC (noise surpressed %4.f)",
+ fNoiseFactor));
+ }
+ if (!fDiagStep2) {
+ fDiagStep2 = new TH2F("diagStep2", "ADC vs Edep deduced",
+ 1024, -.5, 1023.5, 100, 0, 2);
+ fDiagStep2->SetDirectory(0);
+ fDiagStep2->GetXaxis()->SetTitle("ADC (noise surpressed)");
+ fDiagStep2->GetYaxis()->SetTitle("#Delta E [GeV]");
+ }
+ if (!fDiagStep3) {
+ fDiagStep3 = new TH2F("diagStep3", "Edep vs Edep path corrected",
+ 100, 0., 2., 100, 0., 2.);
+ fDiagStep3->SetDirectory(0);
+ fDiagStep3->GetXaxis()->SetTitle("#Delta E [GeV]");
+ fDiagStep3->GetYaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ }
+ if (!fDiagStep4) {
+ fDiagStep4 = new TH2F("diagStep4", "Edep vs Multiplicity deduced",
+ 100, 0., 2., 100, -.1, 19.9);
+ fDiagStep4->SetDirectory(0);
+ fDiagStep4->GetXaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ fDiagStep4->GetYaxis()->SetTitle("Multiplicity");
+ fDiagAll = new TH2F("diagAll", "Read ADC vs Multiplicity deduced",
+ 1024, -.5, 1023.5, 100, -.1, 19.9);
+ }
+ if (!fDiagAll) {
+ fDiagAll->SetDirectory(0);
+ fDiagAll->GetXaxis()->SetTitle("ADC (read)");
+ fDiagAll->GetYaxis()->SetTitle("Multiplicity");
+ }
}
//____________________________________________________________________
TTree* digitsTree) const
{
// Convert Raw digits to AliFMDDigit's in a tree
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
AliFMDDebug(1, ("Reading raw data into digits tree"));
if (!digitsTree) {
AliError("No digits tree passed");
AliFMDReconstructor::Reconstruct(AliFMDRawReader& rawReader) const
{
AliFMDDebug(1, ("Reconstructing from FMD raw reader"));
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
fBad.Reset(false);
UShort_t det, sec, str, fac;
Short_t adc, oldDet = -1;
// reader Raw event reader
// ctree Not used - 'cluster tree' to store rec-points in.
AliFMDDebug(1, ("Reconstructing from raw reader"));
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
AliFMDRawReader rawReader(reader, 0);
Reconstruct(rawReader);
}
// Parameters:
// reader Raw event reader
// ctree Not used.
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
AliFMDRawReader rawReader(reader, 0);
UShort_t det, sec, str, sam, rat, fac;
// digitsTree Pointer to a tree containing digits
// clusterTree Pointer to output tree
//
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
if (!fMult) fMult = new TClonesArray("AliFMDRecPoint");
AliFMDDebug(1, ("Reconstructing from digits in a tree"));
// Parameters:
// digits Array of digits
//
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
AliFMDAltroMapping* map = AliFMDParameters::Instance()->GetAltroMap();
for (size_t i = 1; i <= 3; i++) {
fZS[i-1] = rawRead.IsZeroSuppressed(map->Detector2DDL(i));
// FIXME: The vertex may not be known when Reconstruct is executed,
// so we may have to move some of that member function here.
AliFMDDebug(2, ("Calling FillESD with two trees and one ESD"));
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
// fESDObj->Print();
// Fix up ESD so that only truely dead channels get the kInvalidMult flag.
//
// Forwards to above member function
//
+ if (fZombie {
+ AliWarning("I'm a zombie - cannot do anything");
+ return;
+ }
TTree* dummy = 0;
FillESD(dummy, clusterTree, esd);
}