#include "AliFMDRawReader.h"
#include "AliRawReader.h"
#include "AliFMDAltroMapping.h"
+#include "AliFMDDebug.h"
//_____________________________________________________________________
// This is the class that collects the QA data for the FMD during
AliFMDQADataMakerRec::AliFMDQADataMakerRec() :
AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kFMD),
"FMD Quality Assurance Data Maker"),
- fDigitsArray("AliFMDDigit", 0),
fRecPointsArray("AliFMDRecPoint", 1000)
{
// ctor
AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm)
: AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kFMD),
"FMD Quality Assurance Data Maker"),
- fDigitsArray(qadm.fDigitsArray),
fRecPointsArray(qadm.fRecPointsArray)
{
// copy ctor
}
//_____________________________________________________________________
-AliFMDQADataMakerRec& AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm )
+AliFMDQADataMakerRec&
+AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm )
{
- fDigitsArray = qadm.fDigitsArray;
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // qadm What to assign from
+ //
+ // Return:
+ // Reference to this
+ //
fRecPointsArray = qadm.fRecPointsArray;
return *this;
//_____________________________________________________________________
AliFMDQADataMakerRec::~AliFMDQADataMakerRec()
{
-
+ //
+ // Destrcutor
+ //
}
void AliFMDQADataMakerRec::InitESDs()
{
// create Digits histograms in Digits subdir
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3);
hEnergyOfESD->SetXTitle("Edep/Emip");
hEnergyOfESD->SetYTitle("Counts");
- Add2ESDsList(hEnergyOfESD, 0);
+ Add2ESDsList(hEnergyOfESD, 0, !expert, image);
}
-//_____________________________________________________________________
-/*void AliFMDQADataMakerRec::InitDigits()
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::InitDigits()
{
// create Digits histograms in Digits subdir
- TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",
- 1024,0,1024);
- hADCCounts->SetXTitle("ADC counts");
- hADCCounts->SetYTitle("");
- Add2DigitsList(hADCCounts, 0);
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+ TH1I* hADCCounts = new TH1I("hADCCounts",
+ "Dist of ADC counts;ADC counts;Counts",
+ 1024,0,1024);
+ Add2DigitsList(hADCCounts, 0, !expert, image);
}
-*/
+
+
//_____________________________________________________________________
void AliFMDQADataMakerRec::InitRecPoints()
{
+ // create Reconstructed Points histograms in RecPoints subdir
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints",
"Energy Distribution",100,0,3);
hEnergyOfRecpoints->SetXTitle("Edep/Emip");
- hEnergyOfRecpoints->SetYTitle("");
- Add2RecPointsList(hEnergyOfRecpoints,0);
+ hEnergyOfRecpoints->SetYTitle("Counts");
+ Add2RecPointsList(hEnergyOfRecpoints,0, !expert, image);
}
//_____________________________________________________________________
void AliFMDQADataMakerRec::InitRaws()
{
-
+ // create Raws histograms in Raws subdir
+ const Bool_t expert = kTRUE ;
+ const Bool_t saveCorr = kTRUE ;
+ const Bool_t image = kTRUE ;
+ Int_t colors[3] = {kRed,kGreen,kBlue};
TH1I* hADCCounts;
for(Int_t det = 1; det<=3; det++) {
Int_t firstring = (det==1 ? 1 : 0);
for(Int_t iring = firstring;iring<=1;iring++) {
Char_t ring = (iring == 1 ? 'I' : 'O');
- hADCCounts = new TH1I(Form("hADCCounts_FMD%d%c",
- det, ring), "ADC counts",
- 1024,0,1023);
-
+ hADCCounts =
+ new TH1I(Form("hADCCounts_FMD%d%c", det, ring),
+ Form("FMD%d%c ADC counts;Amplitude [ADC counts];Counts",
+ det,ring),1024,0,1023);
+ hADCCounts->SetFillStyle(3001);
+ hADCCounts->SetFillColor(colors[det-1]+2+iring);
+ hADCCounts->SetDrawOption("LOGY");
+
Int_t index1 = GetHalfringIndex(det, ring, 0,1);
- Add2RawsList(hADCCounts, index1,kTRUE);
+ Add2RawsList(hADCCounts, index1, !expert, image, !saveCorr);
for(Int_t b = 0; b<=1;b++) {
board = board + b*16;
- hADCCounts = new TH1I(Form("hADCCounts_FMD%d%c_board%d",
- det, ring, board), "ADC counts",
- 1024,0,1023);
+ hADCCounts =
+ new TH1I(Form("hADCCounts_FMD%d%c_0x%02x", det, ring, board),
+ Form("FMD%d%c_0x%x ADC counts;Amplitude [ADC counts];Counts",
+ det,ring, board),1024,0,1023);
hADCCounts->SetXTitle("ADC counts");
hADCCounts->SetYTitle("");
+ hADCCounts->SetFillStyle(3001);
+ hADCCounts->SetFillColor(colors[det-1]+2+iring);
+ hADCCounts->SetDrawOption("LOGY");
Int_t index2 = GetHalfringIndex(det, ring, board/16,0);
- Add2RawsList(hADCCounts, index2);
+ Add2RawsList(hADCCounts, index2, expert, !image, !saveCorr);
}
}
}
}
+#if 0
+struct FillESDHist : public AliESDFMD::ForOne
+{
+ FillESDHist(AliFMDQADataMakerRec* m) : fM(m) {}
+ FillESDHist(const FillESDHist& o) : fM(o.fM) {}
+ FillESDHist& operator=(const FillESDHist& o) { fM = o.fM; return *this; }
+ Bool_t operator()(UShort_t, Char_t, UShort_t, UShort_t, Float_t m, Float_t)
+ {
+ // Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+ if(m == AliESDFMD::kInvalidMult) return true;
+
+ fM->GetESDsData(0)->Fill(m);
+ return true;
+ }
+ AliFMDQADataMakerRec* fM;
+};
+#endif
+
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
{
+ //
+ // Analyse ESD event
+ //
+ // Parameters:
+ // esd ESD event
+ //
if(!esd) {
AliError("FMD ESD object not found!!") ;
return;
}
+ AliFMDDebug(2, ("Will loop over ESD data and fill histogram"));
+
AliESDFMD* fmd = esd->GetFMDData();
if (!fmd) return;
-
+
+#if 0
+ FillESDHist f(this);
+ fmd->ForEach(f);
+#else
+
+
+
+ // FIXME - we should use AliESDFMD::ForOne subclass to do this!
for(UShort_t det=1;det<=3;det++) {
- for (UShort_t ir = 0; ir < 2; ir++) {
+ UShort_t nrng = (det == 1 ? 1 : 2);
+ for (UShort_t ir = 0; ir < nrng; ir++) {
Char_t ring = (ir == 0 ? 'I' : 'O');
UShort_t nsec = (ir == 0 ? 20 : 40);
UShort_t nstr = (ir == 0 ? 512 : 256);
}
}
}
+#endif
}
-/*
+
//_____________________________________________________________________
-void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
+void AliFMDQADataMakerRec::MakeDigits()
{
// makes data from Digits
- if(!digits) {
+ if(!fDigitsArray) {
AliError("FMD Digit object not found!!") ;
return;
}
- for(Int_t i=0;i<digits->GetEntriesFast();i++) {
+
+ for(Int_t i=0;i<fDigitsArray->GetEntriesFast();i++) {
//Raw ADC counts
- AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
+ AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
GetDigitsData(0)->Fill(digit->Counts());
}
}
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
{
+ //
+ // Analyse digits
+ //
+ // Parameters:
+ // digitTree Tree of digits
+ //
- fDigitsArray.Clear();
+ if (fDigitsArray)
+ fDigitsArray->Clear();
+ else
+ fDigitsArray = new TClonesArray("AliFMDDigit", 1000);
+
TBranch* branch = digitTree->GetBranch("FMD");
if (!branch) {
AliWarning("FMD branch in Digit Tree not found") ;
return;
}
- TClonesArray* digitsAddress = &fDigitsArray;
- branch->SetAddress(&digitsAddress);
+ branch->SetAddress(&fDigitsArray);
branch->GetEntry(0);
- MakeDigits(digitsAddress);
+ MakeDigits();
}
-*/
+
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
{
+ //
+ // Analyse raw
+ //
+ // Parameters:
+ // rawReader Raw reader
+ //
AliFMDRawReader fmdReader(rawReader,0);
- TClonesArray* digitsAddress = &fDigitsArray;
+
+ if (fDigitsArray)
+ fDigitsArray->Clear();
+ else
+ fDigitsArray = new TClonesArray("AliFMDDigit", 1000);
+
+ TClonesArray* digitsAddress = fDigitsArray;
rawReader->Reset();
void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
{
// makes data from RecPoints
- AliFMDParameters* pars = AliFMDParameters::Instance();
+
+ AliFMDParameters* pars = AliFMDParameters::Instance();
fRecPointsArray.Clear();
TBranch *fmdbranch = clustersTree->GetBranch("FMD");
if (!fmdbranch) {
Int_t AliFMDQADataMakerRec::GetHalfringIndex(UShort_t det,
Char_t ring,
UShort_t board,
- UShort_t monitor) {
-
+ UShort_t monitor) const
+{
+ //
+ // Get the half-ring index
+ //
+ // Parameters:
+ // det Detector
+ // ring Ring
+ // board Board number
+ // monitor Monitor
+ //
+ // Return:
+ // Half ring index
+ //
UShort_t iring = (ring == 'I' ? 1 : 0);
-
- Int_t index = ( ((det-1) << 3) | (iring << 2) | (board << 1) | (monitor << 0));
+ Int_t index = ( ((det-1) << 3) | (iring << 2) | (board << 1) |
+ (monitor << 0));
return index-2;
-
}
//_____________________________________________________________________