Line data Source code
1 : // $Id$
2 :
3 : //**************************************************************************
4 : //* This file is property of and copyright by the ALICE HLT Project *
5 : //* ALICE Experiment at CERN, All rights reserved. *
6 : //* *
7 : //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 : //* for The ALICE HLT Project. *
9 : //* *
10 : //* Permission to use, copy, modify and distribute this software and its *
11 : //* documentation strictly for non-commercial purposes is hereby granted *
12 : //* without fee, provided that the above copyright notice appears in all *
13 : //* copies and that both the copyright notice and this permission notice *
14 : //* appear in the supporting documentation. The authors make no claims *
15 : //* about the suitability of this software for any purpose. It is *
16 : //* provided "as is" without express or implied warranty. *
17 : //**************************************************************************
18 :
19 : /** @file AliHLTQADataMakerBase.cxx
20 : @author Matthias Richter
21 : @date 2010-03-10
22 : @brief
23 : */
24 : #include "AliHLTQADataMakerBase.h"
25 : #include "AliESDEvent.h"
26 :
27 : using namespace std;
28 :
29 : /** ROOT macro for the implementation of ROOT specific class methods */
30 6 : ClassImp(AliHLTQADataMakerBase)
31 :
32 4 : AliHLTQADataMakerBase::AliHLTQADataMakerBase()
33 12 : {
34 : // see header file for class documentation
35 : // or
36 : // refer to README to build package
37 : // or
38 : // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
39 4 : }
40 :
41 : AliHLTQADataMakerBase::~AliHLTQADataMakerBase()
42 0 : {
43 : // see header file for class documentation
44 0 : }
45 :
46 : void AliHLTQADataMakerBase::Exec(AliQAv1::TASKINDEX_t task, TObject * data)
47 : {
48 : // special handling for esds
49 0 : if ( task == AliQAv1::kESDS ) {
50 : AliESDEvent * esd = NULL;
51 : AliESDEvent * hltesd = NULL;
52 0 : if (data->IsA() == AliESDEvent::Class()) {
53 : // silently skip this. Currently HLT QA is still called as
54 : // part of AliQAManager::RunOneEvent with the esd
55 0 : return;
56 : }
57 0 : if (data->InheritsFrom("TObjArray")) {
58 0 : TObjArray* array=dynamic_cast<TObjArray*>(data);
59 0 : if (array && array->GetEntriesFast()>0) {
60 0 : esd = dynamic_cast<AliESDEvent *>(array->At(0)) ;
61 0 : }
62 0 : if (array && array->GetEntriesFast()>1) {
63 0 : hltesd = dynamic_cast<AliESDEvent *>(array->At(1)) ;
64 0 : }
65 0 : } else {
66 0 : esd = static_cast<AliESDEvent *>(data) ;
67 : }
68 :
69 0 : if (esd && strcmp(esd->ClassName(), "AliESDEvent") == 0) {
70 0 : if (hltesd) {
71 0 : MakeESDs(esd, hltesd);
72 0 : } else {
73 0 : AliError(Form("HLT ESD missing or wrong class type (%p), skipping HLT QA task kESDs", hltesd));
74 : }
75 : } else {
76 0 : AliError(Form("ESD missing or wrong class type (%p), skipping HLT QA task kESDSs", esd));
77 : }
78 0 : } else {
79 : // forward for all other types
80 0 : AliQADataMakerRec::Exec(task, data);
81 : }
82 0 : }
83 :
84 : void AliHLTQADataMakerBase::MakeESDs(AliESDEvent * esd)
85 : {
86 : // see header file for class documentation
87 :
88 : // as an extension in the QA interface also the hlt esd can be sent
89 : // in order to preserve backward compatibility, a new function has been
90 : // introduced.
91 : //
92 : // NOTE: This function is not the place for HLT QA
93 : if (!esd) return;
94 0 : }
95 :
96 : void AliHLTQADataMakerBase::MakeESDs(AliESDEvent * esd, AliESDEvent* hltesd)
97 : {
98 : // HLT QA on ESDs
99 0 : if (!esd || !hltesd) {
100 0 : AliError("invalid parameter: missing ESDs");
101 0 : return;
102 : }
103 :
104 : // nothing to do in the base class, QA implemented in the overloaded
105 : // child function
106 0 : }
|