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");
//____________________________________________________________________
void
-AliFMDReconstructor::Reconstruct(AliRawReader* reader, TTree*) const
+AliFMDReconstructor::Reconstruct(AliFMDRawReader& rawReader) const
{
- // Reconstruct directly from raw data (no intermediate output on
- // digit tree or rec point tree).
- //
- // Parameters:
- // reader Raw event reader
- // ctree Not used - 'cluster tree' to store rec-points in.
- AliFMDDebug(1, ("Reconstructing from raw reader"));
- AliFMDRawReader rawReader(reader, 0);
+ 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;
ProcessSignal(det, rng, sec, str, adc);
}
UseRecoParam(kFALSE);
-
+
+}
+
+//____________________________________________________________________
+void
+AliFMDReconstructor::Reconstruct(AliRawReader* reader, TTree*) const
+{
+ // Reconstruct directly from raw data (no intermediate output on
+ // digit tree or rec point tree).
+ //
+ // Parameters:
+ // 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"));
}
+//____________________________________________________________________
+void
+AliFMDReconstructor::ProcessDigits(TClonesArray* digits,
+ const AliFMDRawReader& rawRead) const
+{
+ // For each digit, find the pseudo rapdity, azimuthal angle, and
+ // number of corrected ADC counts, and pass it on to the algorithms
+ // used.
+ //
+ // 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));
+ fZSFactor[i-1] = rawRead.NoiseFactor(map->Detector2DDL(i));
+ }
+ UseRecoParam(kTRUE);
+ ProcessDigits(digits);
+ UseRecoParam(kFALSE);
+}
+
//____________________________________________________________________
void
AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
// 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);
}