1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include <TObjArray.h>
24 #include <TDirectory.h>
26 #include "TTreeStream.h"
29 #include "AliRawReader.h"
30 #include "AliPMDRawStream.h"
31 #include "AliPMDddldata.h"
34 #include "AliPMDCalibPedestal.h"
37 ClassImp(AliPMDCalibPedestal)
40 AliPMDCalibPedestal::AliPMDCalibPedestal() :
44 // default constructor
47 for (int i = 0; i < 2; i++)
49 for (int j = 0; j < 24; j++)
51 for (int k = 0; k < 96; k++)
53 for (int l = 0; l < 96; l++)
56 fPedHisto[i][j][k][l] = new TH1F("","",300,0.,300.);
64 //_____________________________________________________________________
65 AliPMDCalibPedestal::AliPMDCalibPedestal(const AliPMDCalibPedestal &ped) :
71 for (int i = 0; i < 2; i++)
73 for (int j = 0; j < 24; j++)
75 for (int k = 0; k < 96; k++)
77 for (int l = 0; l < 96; l++)
80 fPedHisto[i][j][k][l] = ped.fPedHisto[i][j][k][l];
87 //_____________________________________________________________________
88 AliPMDCalibPedestal& AliPMDCalibPedestal::operator = (const AliPMDCalibPedestal &source)
91 // assignment operator
93 if (&source == this) return *this;
94 new (this) AliPMDCalibPedestal(source);
98 //_____________________________________________________________________
99 AliPMDCalibPedestal::~AliPMDCalibPedestal()
106 //_____________________________________________________________________
107 Bool_t AliPMDCalibPedestal::ProcessEvent(AliRawReader *rawReader)
110 // Event processing loop - AliRawReader
112 AliPMDRawStream rawStream(rawReader);
114 TObjArray pmdddlcont;
115 Bool_t streamout = kTRUE;
117 for (Int_t iddl = 0; iddl < 6; iddl++)
120 rawReader->Select("PMD", iddl, iddl);
121 //cout << reader.GetDataSize() << endl;
122 streamout = rawStream.DdlData(iddl, &pmdddlcont);
123 Int_t ientries = pmdddlcont.GetEntries();
124 for (Int_t ient = 0; ient < ientries; ient++)
126 AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
128 Int_t det = pmdddl->GetDetector();
129 Int_t smn = pmdddl->GetSMN();
130 //Int_t mcm = pmdddl->GetMCM();
131 //Int_t chno = pmdddl->GetChannel();
132 Int_t row = pmdddl->GetRow();
133 Int_t col = pmdddl->GetColumn();
134 Int_t sig = pmdddl->GetSignal();
136 fPedHisto[det][smn][row][col]->Fill((Float_t) sig);
143 //_____________________________________________________________________
145 void AliPMDCalibPedestal::Analyse()
148 // Calculate pedestal Mean and RMS
150 for (int i = 0; i < 2; i++)
152 for (int j = 0; j < 24; j++)
154 for (int k = 0; k < 96; k++)
156 for (int l = 0; l < 96; l++)
159 Float_t mean = fPedHisto[i][j][k][l]->GetMean();
160 Float_t rms = fPedHisto[i][j][k][l]->GetRMS();
166 //_____________________________________________________________________