]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ACORDE/AliACORDEQADataMakerSim.cxx
Adding default HLT trigger menu object to AliRoot CDB and macro for generating it.
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQADataMakerSim.cxx
CommitLineData
51504028 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16
17
18//---
19// Produces the data needed to calculate the quality assurance.
20// All data must be mergeable objects.
21
22// Authors:
23//
24// Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
25// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
26// Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
27//
28// Created: June 13th 2008
29//---
491ceb3e 30// Last Update: Aug. 27th 2008 ---> Implementation to declare QA expert histogram
31
51504028 32
33// --- ROOT system ---
34#include <TClonesArray.h>
35#include <TFile.h>
36#include <TH1F.h>
37#include <TH2F.h>
38#include <TDirectory.h>
39// --- Standard library ---
40
41// --- AliRoot header files ---
42#include "AliESDEvent.h"
43#include "AliLog.h"
44#include "AliACORDEdigit.h"
45#include "AliACORDEhit.h"
46#include "AliACORDEQADataMakerSim.h"
47#include "AliQAChecker.h"
48#include "AliACORDERawReader.h"
49ClassImp(AliACORDEQADataMakerSim)
50
51//____________________________________________________________________________
4e25ac79 52AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
51504028 53{
54}
55//____________________________________________________________________________
56AliACORDEQADataMakerSim::AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) :
57 AliQADataMakerSim()
58{
59 SetName((const char*)qadm.GetName()) ;
60 SetTitle((const char*)qadm.GetTitle());
61}
62//__________________________________________________________________
63AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQADataMakerSim& qadm )
64{
65 // Equal operator.
66 this->~AliACORDEQADataMakerSim();
67 new(this) AliACORDEQADataMakerSim(qadm);
68 return *this;
69}
70//____________________________________________________________________________
4e25ac79 71void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
51504028 72{
73 //Detector specific actions at end of cycle
74 // do the QA checking
5379c4a3 75 AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at END of cycle\n................\n");
51504028 76
4e25ac79 77 AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
51504028 78}
79//____________________________________________________________________________
80void AliACORDEQADataMakerSim::StartOfDetectorCycle()
81{
82 //Detector specific actions at start of cycle
5379c4a3 83 AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at START of cycle\n................\n");
51504028 84}
85//____________________________________________________________________________
86void AliACORDEQADataMakerSim::InitHits()
87{
88 // create Hits histograms in Hits subdir
d461c877 89
7d297381 90 const Bool_t expert = kTRUE ;
91 const Bool_t image = kTRUE ;
92
93 TH1F * fHitsACORDE;
db72ff3b 94 fHitsACORDE = new TH1F("hACORDEBitPattern","Distribution of fired modules;# of modules;Counts",60,0,60);
7d297381 95 Add2HitsList(fHitsACORDE,0,!expert,image);
51504028 96}
97//____________________________________________________________________________
98void AliACORDEQADataMakerSim::InitDigits()
99{
100 // create Digits histograms in Digits subdir
101
7d297381 102 const Bool_t expert = kTRUE ;
103 const Bool_t image = kTRUE ;
104
105 TH1F * fhDigitsModule;
106 TString modulename;
107 modulename = "hDigitsModule";
db72ff3b 108 fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle;# of modules;Counts",60,0,60);
7d297381 109 Add2DigitsList(fhDigitsModule,0,!expert,image);
51504028 110
111}
112//____________________________________________________________________________
113
114void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
115{
116 // Here we fill the QA histos for Hits declared above
117
6252ceeb 118 if (fHitsArray)
119 fHitsArray->Clear() ;
120 else
121 fHitsArray = new TClonesArray("AliACORDEhit",1000);
d461c877 122 TBranch * branch = hitTree->GetBranch("ACORDE");
fcdfb1ff 123 if (!branch) {
d461c877 124 AliWarning("ACORDE branch in Hit Tree not found");
fcdfb1ff 125 } else {
6252ceeb 126 branch->SetAddress(&fHitsArray);
fcdfb1ff 127 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
d461c877 128 branch->GetEntry(track);
6252ceeb 129 for(Int_t ihit=0 ; ihit < fHitsArray->GetEntriesFast() ; ihit++) {
130 AliACORDEhit *AcoHit = (AliACORDEhit*) fHitsArray->UncheckedAt(ihit);
fcdfb1ff 131 if(!AcoHit) {
d461c877 132 AliError("The unchecked hit doesn't exist");
fcdfb1ff 133 continue ;
d461c877 134 }
135 GetHitsData(0)->Fill(AcoHit->GetModule()-1);
fcdfb1ff 136 }
137 }
138 }
51504028 139}
140//____________________________________________________________________________
141void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
142{
143 //fills QA histos for Digits
6252ceeb 144 if (fDigitsArray)
145 fDigitsArray->Clear() ;
146 else
147 fDigitsArray = new TClonesArray("AliACORDEdigit",1000);
148
fcdfb1ff 149 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
150 if (!branch) {
151 AliWarning("ACORDE branch in Digits Tree not found");
152 } else {
6252ceeb 153 branch->SetAddress(&fDigitsArray);
fcdfb1ff 154 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
155 branch->GetEntry(track);
6252ceeb 156 for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {
157 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);
fcdfb1ff 158 if (!AcoDigit) {
159 AliError("The unchecked digit doesn't exist");
160 continue ;
51504028 161 }
fcdfb1ff 162 GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
163 }
164 }
165 }
51504028 166}