#include <TH2F.h>
#include <TNtupleD.h>
#include <TParameter.h>
+#include <TMath.h>
// --- Standard library ---
//____________________________________________________________________________
AliCorrQADataMakerRec::AliCorrQADataMakerRec(AliQADataMaker ** qadm ) :
- AliQADataMakerRec("Corr", "Corr Quality Assurance Data Maker"),
+AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kCORR), "Corr Quality Assurance Data Maker"),
fMaxRawVar(0),
fqadm(qadm)
{
// ctor
-
+ fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
+ fCorrNt[specie] = NULL ;
}
//____________________________________________________________________________
//__________________________________________________________________
AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
{
- // Equal operator.
+ // assign operator.
this->~AliCorrQADataMakerRec();
new(this) AliCorrQADataMakerRec(qadm);
return *this;
}
-
+
+//____________________________________________________________________________
+AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
+{
+ // dtor only destroy the ntuple
+ if ( fCorrNt ) {
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+ if ( fCorrNt[specie] != NULL )
+ delete fCorrNt[specie] ;
+ }
+ delete[] fCorrNt ;
+ }
+}
+
//____________________________________________________________________________
-void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * /*list*/)
+void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
{
//Detector specific actions at end of cycle
// do the QA checking
- if (task == AliQA::kRAWS) {
- AliQAChecker::Instance()->Run(AliQA::kCORR, task, fObject) ;
+ if (task == AliQAv1::kRAWS) {
+ AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
}
}
void AliCorrQADataMakerRec::InitRaws()
{
// createa ntuple taking all the parameters declared by detectors
- if (fObject)
+ if (fCorrNt)
return ;
delete fRawsQAList ; // not needed for the time being
fRawsQAList = NULL ;
TString varlist("") ;
- for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++ ) {
+ for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
AliQADataMaker * qadm = fqadm[detIndex] ;
if ( ! qadm )
continue ;
if (list) {
TIter next(list) ;
TParameter<double> * p ;
- while ( (p = dynamic_cast<TParameter<double>*>(next()) ) ) {
+ while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
varlist.Append(p->GetName()) ;
varlist.Append(":") ;
fMaxRawVar++ ;
if (fMaxRawVar == 0) {
AliWarning("NTUPLE not created") ;
} else {
- fObject = new TNtupleD(AliQA::GetQACorrName(), "Raws data correlation among detectors", varlist.Data()) ;
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+ char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(specie)) ;
+ fCorrNt[specie] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ;
+ }
}
}
const Int_t kSize = fMaxRawVar ;
Double_t *varvalue = new Double_t[kSize] ;
Int_t index = 0 ;
- for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++ ) {
+ for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
AliQADataMaker * qadm = fqadm[detIndex] ;
if ( ! qadm )
continue ;
TList * list = qadm->GetParameterList() ;
TIter next(list) ;
TParameter<double> * p ;
- while ( (p = dynamic_cast<TParameter<double>*>(next()) ) ) {
+ while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
varvalue[index++] = p->GetVal() ;
}
}
- (dynamic_cast<TNtupleD*>(fObject))->Fill(varvalue);
+ (static_cast<TNtupleD*>(fCorrNt[(Int_t)TMath::Log2(fEventSpecie)]))->Fill(varvalue);
delete [] varvalue;
}
}