]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/QA/AliHLTQADataMakerRec.cxx
Implementing the skeleton for HLT QA for type kESDs (reconstruction)
[u/mrichter/AliRoot.git] / HLT / QA / AliHLTQADataMakerRec.cxx
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   AliHLTQADataMakerRec.cxx
20     @author Matthias Richter
21     @date   2009-05-14
22     @brief  Container for the HLT offline QA
23 */
24 #include "AliHLTQADataMakerRec.h"
25 #include "AliESDEvent.h"
26 #include <iostream>
27
28 using namespace std;
29
30 /** ROOT macro for the implementation of ROOT specific class methods */
31 ClassImp(AliHLTQADataMakerRec)
32
33 AliHLTQADataMakerRec::AliHLTQADataMakerRec()
34 {
35   // see header file for class documentation
36   // or
37   // refer to README to build package
38   // or
39   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40 }
41
42 AliHLTQADataMakerRec::~AliHLTQADataMakerRec()
43 {
44   // see header file for class documentation
45 }
46
47 void AliHLTQADataMakerRec::Exec(AliQAv1::TASKINDEX_t task, TObject * data) 
48
49   // special handling for esds
50   if ( task == AliQAv1::kESDS ) {
51     AliESDEvent * esd = NULL;
52     AliESDEvent * hltesd = NULL;
53     if (data->IsA() == AliESDEvent::Class()) {
54       // silently skip this. Currently HLT QA is still called as
55       // part of AliQAManager::RunOneEvent with the esd
56       return;
57     }
58     if (data->InheritsFrom("TObjArray")) {
59       TObjArray* array=dynamic_cast<TObjArray*>(data);
60       if (array && array->GetEntriesFast()>0) {
61         esd = dynamic_cast<AliESDEvent *>(array->At(0)) ;
62       }
63       if (array && array->GetEntriesFast()>1) {
64         hltesd = dynamic_cast<AliESDEvent *>(array->At(1)) ;
65       }
66     } else {
67       esd = static_cast<AliESDEvent *>(data) ; 
68     }
69
70     if (esd && strcmp(esd->ClassName(), "AliESDEvent") == 0) {
71       if (hltesd) {
72         MakeESDs(esd, hltesd);
73       } else {
74         AliError(Form("HLT ESD missing or wrong class type (%p), skipping HLT QA task kESDs", hltesd));
75       }
76     } else {
77       AliError(Form("ESD missing or wrong class type (%p), skipping HLT QA task kESDSs", esd));
78     }
79   } else {
80     // forward for all other types
81     AliQADataMakerRec::Exec(task, data);
82   }
83 }
84
85 void AliHLTQADataMakerRec::StartOfDetectorCycle()
86 {
87   // see header file for class documentation
88 }
89
90 void AliHLTQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray** /*list*/)
91 {
92   // see header file for class documentation
93 }
94
95 void AliHLTQADataMakerRec::MakeRaws(AliRawReader * rawReader)
96 {
97   // see header file for class documentation
98   if (!rawReader) return;
99 }
100
101 void AliHLTQADataMakerRec::MakeESDs(AliESDEvent * esd)
102 {
103   // see header file for class documentation
104   
105   // as an extension in the QA interface also the hlt esd can be sent
106   // in order to preserve backward compatibility, a new function has been
107   // introduced.
108   //
109   // NOTE: This function is not the place for HLT QA
110   if (!esd) return;
111 }
112
113 void AliHLTQADataMakerRec::MakeESDs(AliESDEvent * esd, AliESDEvent* hltesd)
114 {
115   // HLT QA on ESDs
116   if (!esd || !hltesd) {
117     AliError("invalid parameter: missing ESDs");
118     return;
119   }
120 }