X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliCorrQADataMakerRec.cxx;h=0e92ad680949b8961ddb5adf8d98fb397c66b270;hb=e24560480642b94aa84892fc6594b8019bdf5b76;hp=776b2eeab8e360e113be5ca21e6b2ad8fa2dcd9c;hpb=930e6e3e58413751257c49069d5828fffb6fbf86;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliCorrQADataMakerRec.cxx b/STEER/AliCorrQADataMakerRec.cxx index 776b2eeab8e..0e92ad68094 100644 --- a/STEER/AliCorrQADataMakerRec.cxx +++ b/STEER/AliCorrQADataMakerRec.cxx @@ -30,6 +30,7 @@ #include #include #include +#include // --- Standard library --- @@ -42,41 +43,68 @@ ClassImp(AliCorrQADataMakerRec) //____________________________________________________________________________ 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) + fqadm(qadm), + fVarvalue(NULL) { // ctor - + fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fCorrNt[specie] = NULL ; } //____________________________________________________________________________ AliCorrQADataMakerRec::AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) : AliQADataMakerRec(), fMaxRawVar(qadm.fMaxRawVar), - fqadm(qadm.fqadm) + fqadm(qadm.fqadm), + fVarvalue(NULL) { //copy ctor SetName((const char*)qadm.GetName()) ; SetTitle((const char*)qadm.GetTitle()); + if ( fMaxRawVar > 0 ) + fVarvalue = new Double_t[fMaxRawVar] ; + + fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fCorrNt[specie] = qadm.fCorrNt[specie] ; + } //__________________________________________________________________ AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm ) { - // Equal operator. + // assign operator. this->~AliCorrQADataMakerRec(); new(this) AliCorrQADataMakerRec(qadm); return *this; } - + //____________________________________________________________________________ -void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * /*list*/) +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 ; + fCorrNt = 0x0; + } + if ( fMaxRawVar > 0 ) + delete [] fVarvalue ; +} + +//____________________________________________________________________________ +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) ; } } @@ -88,24 +116,27 @@ void AliCorrQADataMakerRec::InitESDs() AliInfo("TO BE IMPLEMENTED") ; } -//____________________________________________________________________________ -void AliCorrQADataMakerRec::InitRecPoints() -{ - // create Reconstructed Points histograms in RecPoints subdir - - AliInfo("TO BE IMPLEMENTED") ; -} //____________________________________________________________________________ void AliCorrQADataMakerRec::InitRaws() { // createa ntuple taking all the parameters declared by detectors - if (fObject) + if (fCorrNt && fCorrNt[AliRecoParam::AConvert(fEventSpecie)]) return ; - delete fRawsQAList ; // not needed for the time being - fRawsQAList = NULL ; + + if (!fCorrNt) { + fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; ; + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) + fCorrNt[specie] = NULL ; + } + + if ( fRawsQAList ) + { + 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 ; @@ -113,7 +144,7 @@ void AliCorrQADataMakerRec::InitRaws() if (list) { TIter next(list) ; TParameter * p ; - while ( (p = dynamic_cast*>(next()) ) ) { + while ( (p = static_cast*>(next()) ) ) { varlist.Append(p->GetName()) ; varlist.Append(":") ; fMaxRawVar++ ; @@ -124,10 +155,28 @@ void AliCorrQADataMakerRec::InitRaws() if (fMaxRawVar == 0) { AliWarning("NTUPLE not created") ; } else { - fObject = new TNtupleD(AliQA::GetQACorrName(), "Raws data correlation among detectors", varlist.Data()) ; + char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ; + fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ; + fVarvalue = new Double_t[fMaxRawVar] ; } } +//____________________________________________________________________________ +void AliCorrQADataMakerRec::InitRecPoints() +{ + // create Reconstructed Points histograms in RecPoints subdir + + AliInfo("TO BE IMPLEMENTED") ; +} + +//____________________________________________________________________________ +void AliCorrQADataMakerRec::InitRecoParams() +{ + // Get the recoparam form the OCDB for every detector involved in CORR + + AliInfo("TO BE IMPLEMENTED") ; +} + //____________________________________________________________________________ void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/) { @@ -141,23 +190,31 @@ void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/) void AliCorrQADataMakerRec::MakeRaws(AliRawReader *) { //Fill prepared histograms with Raw digit properties + + if ( !fCorrNt || ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)]) + InitRaws() ; + if ( fMaxRawVar > 0 ) { - 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 * p ; - while ( (p = dynamic_cast*>(next()) ) ) { - varvalue[index++] = p->GetVal() ; + if (list) { + TIter next(list) ; + TParameter * p ; + while ( (p = static_cast*>(next()) ) ) { + if (index >= fMaxRawVar) { + AliError(Form("Variables list size exceeded (%d) !",index)); + break; + } + fVarvalue[index] = p->GetVal() ; + index++ ; + } } } - (dynamic_cast(fObject))->Fill(varvalue); - delete [] varvalue; + static_cast(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue); } }