]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding base class for HLT detector QA plugins
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Mar 2010 13:02:38 +0000 (13:02 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Mar 2010 13:02:38 +0000 (13:02 +0000)
HLT/QA/AliHLTQADataMakerBase.cxx [new file with mode: 0644]
HLT/QA/AliHLTQADataMakerBase.h [new file with mode: 0644]
HLT/libHLTqadm.pkg

diff --git a/HLT/QA/AliHLTQADataMakerBase.cxx b/HLT/QA/AliHLTQADataMakerBase.cxx
new file mode 100644 (file)
index 0000000..e90afb0
--- /dev/null
@@ -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 <Matthias.Richter@ift.uib.no>        *
+//*                  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<TObjArray*>(data);
+      if (array && array->GetEntriesFast()>0) {
+       esd = dynamic_cast<AliESDEvent *>(array->At(0)) ;
+      }
+      if (array && array->GetEntriesFast()>1) {
+       hltesd = dynamic_cast<AliESDEvent *>(array->At(1)) ;
+      }
+    } else {
+      esd = static_cast<AliESDEvent *>(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 (file)
index 0000000..e95fcef
--- /dev/null
@@ -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
index 97caa8dc718e9789f415574d075965e1676f3c2e..cb8d7378c8a10444dab97aa37dc0e6e1207ceb9b 100644 (file)
@@ -2,6 +2,7 @@
 # $Id$
 
 CLASS_HDRS:=   AliHLTQADataMakerSim.h \
+               AliHLTQADataMakerBase.h \
                AliHLTQADataMakerRec.h \
                AliHLTQAChecker.h