]>
Commit | Line | Data |
---|---|---|
bf16d633 | 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 | ClassImp(AliHLTQADataMakerBase) | |
31 | ||
32 | AliHLTQADataMakerBase::AliHLTQADataMakerBase() | |
33 | { | |
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 | } | |
40 | ||
41 | AliHLTQADataMakerBase::~AliHLTQADataMakerBase() | |
42 | { | |
43 | // see header file for class documentation | |
44 | } | |
45 | ||
46 | void AliHLTQADataMakerBase::Exec(AliQAv1::TASKINDEX_t task, TObject * data) | |
47 | { | |
48 | // special handling for esds | |
49 | if ( task == AliQAv1::kESDS ) { | |
50 | AliESDEvent * esd = NULL; | |
51 | AliESDEvent * hltesd = NULL; | |
52 | 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 | return; | |
56 | } | |
57 | if (data->InheritsFrom("TObjArray")) { | |
58 | TObjArray* array=dynamic_cast<TObjArray*>(data); | |
59 | if (array && array->GetEntriesFast()>0) { | |
60 | esd = dynamic_cast<AliESDEvent *>(array->At(0)) ; | |
61 | } | |
62 | if (array && array->GetEntriesFast()>1) { | |
63 | hltesd = dynamic_cast<AliESDEvent *>(array->At(1)) ; | |
64 | } | |
65 | } else { | |
66 | esd = static_cast<AliESDEvent *>(data) ; | |
67 | } | |
68 | ||
69 | if (esd && strcmp(esd->ClassName(), "AliESDEvent") == 0) { | |
70 | if (hltesd) { | |
71 | MakeESDs(esd, hltesd); | |
72 | } else { | |
73 | AliError(Form("HLT ESD missing or wrong class type (%p), skipping HLT QA task kESDs", hltesd)); | |
74 | } | |
75 | } else { | |
76 | AliError(Form("ESD missing or wrong class type (%p), skipping HLT QA task kESDSs", esd)); | |
77 | } | |
78 | } else { | |
79 | // forward for all other types | |
80 | AliQADataMakerRec::Exec(task, data); | |
81 | } | |
82 | } | |
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 | } | |
95 | ||
96 | void AliHLTQADataMakerBase::MakeESDs(AliESDEvent * esd, AliESDEvent* hltesd) | |
97 | { | |
98 | // HLT QA on ESDs | |
99 | if (!esd || !hltesd) { | |
100 | AliError("invalid parameter: missing ESDs"); | |
101 | return; | |
102 | } | |
103 | ||
104 | // nothing to do in the base class, QA implemented in the overloaded | |
105 | // child function | |
106 | } |