From bf16d633e00a244ec3664a2c96b29c9ca740938c Mon Sep 17 00:00:00 2001 From: richterm Date: Sun, 14 Mar 2010 13:02:38 +0000 Subject: [PATCH] adding base class for HLT detector QA plugins --- HLT/QA/AliHLTQADataMakerBase.cxx | 106 +++++++++++++++++++++++++++++++ HLT/QA/AliHLTQADataMakerBase.h | 53 ++++++++++++++++ HLT/libHLTqadm.pkg | 1 + 3 files changed, 160 insertions(+) create mode 100644 HLT/QA/AliHLTQADataMakerBase.cxx create mode 100644 HLT/QA/AliHLTQADataMakerBase.h diff --git a/HLT/QA/AliHLTQADataMakerBase.cxx b/HLT/QA/AliHLTQADataMakerBase.cxx new file mode 100644 index 00000000000..e90afb05cf8 --- /dev/null +++ b/HLT/QA/AliHLTQADataMakerBase.cxx @@ -0,0 +1,106 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTQADataMakerBase.cxx + @author Matthias Richter + @date 2010-03-10 + @brief +*/ +#include "AliHLTQADataMakerBase.h" +#include "AliESDEvent.h" + +using namespace std; + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTQADataMakerBase) + +AliHLTQADataMakerBase::AliHLTQADataMakerBase() +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTQADataMakerBase::~AliHLTQADataMakerBase() +{ + // see header file for class documentation +} + +void AliHLTQADataMakerBase::Exec(AliQAv1::TASKINDEX_t task, TObject * data) +{ + // special handling for esds + if ( task == AliQAv1::kESDS ) { + AliESDEvent * esd = NULL; + AliESDEvent * hltesd = NULL; + if (data->IsA() == AliESDEvent::Class()) { + // silently skip this. Currently HLT QA is still called as + // part of AliQAManager::RunOneEvent with the esd + return; + } + if (data->InheritsFrom("TObjArray")) { + TObjArray* array=dynamic_cast(data); + if (array && array->GetEntriesFast()>0) { + esd = dynamic_cast(array->At(0)) ; + } + if (array && array->GetEntriesFast()>1) { + hltesd = dynamic_cast(array->At(1)) ; + } + } else { + esd = static_cast(data) ; + } + + if (esd && strcmp(esd->ClassName(), "AliESDEvent") == 0) { + if (hltesd) { + MakeESDs(esd, hltesd); + } else { + AliError(Form("HLT ESD missing or wrong class type (%p), skipping HLT QA task kESDs", hltesd)); + } + } else { + AliError(Form("ESD missing or wrong class type (%p), skipping HLT QA task kESDSs", esd)); + } + } else { + // forward for all other types + AliQADataMakerRec::Exec(task, data); + } +} + +void AliHLTQADataMakerBase::MakeESDs(AliESDEvent * esd) +{ + // see header file for class documentation + + // as an extension in the QA interface also the hlt esd can be sent + // in order to preserve backward compatibility, a new function has been + // introduced. + // + // NOTE: This function is not the place for HLT QA + if (!esd) return; +} + +void AliHLTQADataMakerBase::MakeESDs(AliESDEvent * esd, AliESDEvent* hltesd) +{ + // HLT QA on ESDs + if (!esd || !hltesd) { + AliError("invalid parameter: missing ESDs"); + return; + } + + // nothing to do in the base class, QA implemented in the overloaded + // child function +} diff --git a/HLT/QA/AliHLTQADataMakerBase.h b/HLT/QA/AliHLTQADataMakerBase.h new file mode 100644 index 00000000000..e95fcef8ddb --- /dev/null +++ b/HLT/QA/AliHLTQADataMakerBase.h @@ -0,0 +1,53 @@ +//-*- Mode: C++ -*- +// $Id$ + +#ifndef ALIHLTQADATAMAKERBASE_H +#define ALIHLTQADATAMAKERBASE_H +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTQADataMakerBase.h + @author Matthias Richter + @date 2010-03-10 + @brief Base class for HLT detector QA data makers +*/ + +#include "AliQADataMakerRec.h" + +class AliHLTQADataMakerBase: public AliQADataMakerRec { + public: + AliHLTQADataMakerBase(); + virtual ~AliHLTQADataMakerBase(); + + protected: + TObjArray** GetESDsQAList() {return fESDsQAList;} + TObjArray** GetRawsQAList() {return fRawsQAList;} + TObjArray** GetRecPointsQAList() {return fRecPointsQAList;} + TObjArray** GetDigitsQAList() {return fDigitsQAList;} + + /** specific Exec handler which which can handle both the Esd and + * HLTEsd in order to call MakeESDs with two parameters + */ + virtual void Exec(AliQAv1::TASKINDEX_t task, TObject * data); + + /** dummy function, required by the QA framework, however + * HLT QA is done in the other MakeESDs function + */ + virtual void MakeESDs(AliESDEvent * esd); + + /** specific function with the two ESDs as argument + */ + virtual void MakeESDs(AliESDEvent * esd, AliESDEvent* hltesd); + + friend class AliHLTQADataMakerRec; + private: + /** copy constructor prohibited */ + AliHLTQADataMakerBase(const AliHLTQADataMakerBase&); + /** assignment operator prohibited */ + AliHLTQADataMakerBase& operator = (const AliHLTQADataMakerBase&); + + ClassDef(AliHLTQADataMakerBase,0) // Base class for HLT QA Data Makers +}; + +#endif // ALIHLTQADATAMAKERBASE_H diff --git a/HLT/libHLTqadm.pkg b/HLT/libHLTqadm.pkg index 97caa8dc718..cb8d7378c8a 100644 --- a/HLT/libHLTqadm.pkg +++ b/HLT/libHLTqadm.pkg @@ -2,6 +2,7 @@ # $Id$ CLASS_HDRS:= AliHLTQADataMakerSim.h \ + AliHLTQADataMakerBase.h \ AliHLTQADataMakerRec.h \ AliHLTQAChecker.h -- 2.43.0