Updates in classes for encoding and decoding compressed(HLT) SDD raw format (F. Prino)
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQADataMakerRec.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// Produces the data needed to calculate the quality assurance.
17// All data must be mergeable objects.
18
19
20// Authors:
21//
22// Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
23// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
24// Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
25//
26// Created: June 13th 2008
27//---
28
29
30
31// --- ROOT system ---
32#include <TClonesArray.h>
33#include <TFile.h>
34#include <TH1F.h>
35#include <TDirectory.h>
36// --- Standard library ---
37
38// --- AliRoot header files ---
39#include "AliESDEvent.h"
40#include "AliLog.h"
41#include "AliACORDEdigit.h"
42#include "AliACORDEhit.h"
43#include "AliACORDEQADataMakerRec.h"
44#include "AliQAChecker.h"
45#include "AliACORDERawReader.h"
46#include "AliACORDERawStream.h"
47ClassImp(AliACORDEQADataMakerRec)
48
49//____________________________________________________________________________
50AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
51{
52
53}
54//____________________________________________________________________________
55AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):AliQADataMakerRec()
56{
57 SetName((const char*)qadm.GetName()) ;
58 SetTitle((const char*)qadm.GetTitle());
59}
60//__________________________________________________________________
61AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )
62{
63 // Equal operator.
64 this->~AliACORDEQADataMakerRec();
65 new(this) AliACORDEQADataMakerRec(qadm);
66 return *this;
67}
68//____________________________________________________________________________
69void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
70{
71 //Detector specific actions at end of cycle
72 // do the QA checking
73 AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
74}
75
76//____________________________________________________________________________
77void AliACORDEQADataMakerRec::StartOfDetectorCycle()
78{
79 //Detector specific actions at start of cycle
80
81}
82
83//____________________________________________________________________________
84void AliACORDEQADataMakerRec::InitRaws()
85{
86 // create Raw histograms in Raw subdir
87
88TH1D *fhACORDEBitPattern[4];
89fhACORDEBitPattern[0] = new TH1D("ACORDERawDataSM","ACORDE-SingleMuon",60,1,60);//AcordeSingleMuon BitPattern
90fhACORDEBitPattern[1] = new TH1D("ACORDERawDataMM","ACORDE-MultiMuon",60,1,60);//AcordeMultiMuon BitPattern
91fhACORDEBitPattern[2] = new TH1D("ACORDERawDataSMM","ACORDE-SingleMuonMultiplicity",60,1,60);//AcordeSingleMuon Multiplicity
92fhACORDEBitPattern[3] = new TH1D("ACORDERawDataMMM","ACORDE-MultiMuonMultiplicity",60,1,60);//AcordeMultiMuon Multiplicity
93for(Int_t i=0;i<4;i++)
94{
95 Add2RawsList(fhACORDEBitPattern[i],i);
96}
97}
98//____________________________________________________________________________
99
100void AliACORDEQADataMakerRec::InitRecPoints()
101{
102 // create cluster histograms in RecPoint subdir
103 // Not needed for ACORDE by now !!!
104}
105//____________________________________________________________________________
106void AliACORDEQADataMakerRec::InitESDs()
107{
108 //create ESDs histograms in ESDs subdir
109
110 TH1F * fhESDsSingle;
111 TH1F * fhESDsMulti;
112
113 TString name;
114
115 name = "hESDsSingle";
116 fhESDsSingle = new TH1F(name.Data(),"hESDsSingle",60,0,60);
117 Add2ESDsList( fhESDsSingle,0);
118
119 name = "hESDsMulti";
120 fhESDsMulti = new TH1F(name.Data(),"hESDsMulti",60,0,60);
121 Add2ESDsList( fhESDsMulti,1);
122}
123//____________________________________________________________________________
124void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)
125{
126 //fills QA histos for RAW
127 rawReader->Reset();
128 AliACORDERawStream rawStream(rawReader);
129 size_t contSingle=0;
130 size_t contMulti=0;
131 UInt_t dy[4];
132
133 bool kroSingle[60],kroMulti[60];
134 UInt_t tmpDy;
135
136 for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
137
138if(rawStream.Next())
139{
140 rawReader->NextEvent();
141 rawStream.Reset();
142 dy[0]=rawStream.GetWord(0);
143 dy[1]=rawStream.GetWord(1);
144 dy[2]=rawStream.GetWord(2);
145 dy[3]=rawStream.GetWord(3);
146 tmpDy=dy[0];
147 for(Int_t r=0;r<30;++r)
148 {
149 kroSingle[r] = tmpDy & 1;
150 tmpDy>>=1;
151 }
152 tmpDy=dy[1];
153 for(Int_t r=30;r<60;++r)
154 {
155 kroSingle[r] = tmpDy & 1;
156 tmpDy>>=1;
157 }
158 tmpDy=dy[2];
159 for(Int_t r=0;r<30;++r)
160 {
161 kroMulti[r] = tmpDy & 1;
162 tmpDy>>=1;
163 }
164 tmpDy=dy[3];
165 for(Int_t r=30;r<60;++r)
166 {
167 kroMulti[r] = tmpDy & 1;
168 tmpDy>>=1;
169 }
170 contSingle=0;
171 contMulti=0;
172 for(Int_t r=0;r<60;++r)
173 {
174 if(kroSingle[r]==1)
175 {
176 GetRawsData(0)->Fill(r+1);
177 contSingle=contSingle+1;
178 }
179 if(kroMulti[r]==1)
180 {
181 GetRawsData(1)->Fill(r+1);
182 contMulti++;
183 }
184
185 }GetRawsData(2)->Fill(contSingle);GetRawsData(3)->Fill(contMulti);
186}
187}
188//____________________________________________________________________________
189void AliACORDEQADataMakerRec::MakeRecPoints(TTree * clustersTree)
190{
191 //fills QA histos for clusters
192 // Not needed for ACORDE by now !!!
193}
194//____________________________________________________________________________
195void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)
196{
197 //fills QA histos for ESD
198
199 AliESDACORDE * fESDACORDE= esd->GetACORDEData();
200 Int_t *fACORDEMultiMuon =fESDACORDE->GetACORDEMultiMuon();
201 Int_t *fACORDESingleMuon=fESDACORDE->GetACORDESingleMuon();
202
203 for(int i=0;i<60;i++){
204 if(fACORDESingleMuon[i]==1)
205 GetESDsData(0) -> Fill(i);
206 if(fACORDEMultiMuon[i]==1)
207 GetESDsData(1) -> Fill(i);
208 }
209
210
211
212
213}
214