tree is written
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Sep 2007 07:41:40 +0000 (07:41 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Sep 2007 07:41:40 +0000 (07:41 +0000)
PMD/AliPMDCalibPedestal.cxx
PMD/AliPMDCalibPedestal.h

index 70aa79910c9d924b685e24319e2567411c27a57a..a51f691f00a2bd5fa6b02b427b8edb7b6f045f4d 100644 (file)
@@ -26,6 +26,8 @@
 #include "TTreeStream.h"
 
 //AliRoot includes
 #include "TTreeStream.h"
 
 //AliRoot includes
+#include "AliDAQ.h"
+#include "AliLog.h"
 #include "AliRawReader.h"
 #include "AliPMDRawStream.h"
 #include "AliPMDddldata.h"
 #include "AliRawReader.h"
 #include "AliPMDRawStream.h"
 #include "AliPMDddldata.h"
@@ -72,7 +74,7 @@ AliPMDCalibPedestal::AliPMDCalibPedestal(const AliPMDCalibPedestal &ped) :
     {
        for (int j = 0; j < 24; j++)
        {
     {
        for (int j = 0; j < 24; j++)
        {
-           for (int k = 0; k < 96; k++)
+           for (int k = 0; k < 48; k++)
            {
                for (int l = 0; l < 96; l++)
                {
            {
                for (int l = 0; l < 96; l++)
                {
@@ -109,12 +111,15 @@ Bool_t AliPMDCalibPedestal::ProcessEvent(AliRawReader *rawReader)
   //
   //  Event processing loop - AliRawReader
   //
   //
   //  Event processing loop - AliRawReader
   //
+
+    const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
+
     AliPMDRawStream rawStream(rawReader);
 
     TObjArray pmdddlcont;
     Bool_t streamout = kTRUE;
 
     AliPMDRawStream rawStream(rawReader);
 
     TObjArray pmdddlcont;
     Bool_t streamout = kTRUE;
 
-    for (Int_t iddl = 0; iddl < 6; iddl++)
+    for (Int_t iddl = 0; iddl < kDDL; iddl++)
     {
        
        rawReader->Select("PMD", iddl, iddl);
     {
        
        rawReader->Select("PMD", iddl, iddl);
@@ -142,22 +147,35 @@ Bool_t AliPMDCalibPedestal::ProcessEvent(AliRawReader *rawReader)
 }
 //_____________________________________________________________________
 
 }
 //_____________________________________________________________________
 
-void AliPMDCalibPedestal::Analyse()
+void AliPMDCalibPedestal::Analyse(TTree *pedtree)
 {
     //
     //  Calculate pedestal Mean and RMS
     //
 {
     //
     //  Calculate pedestal Mean and RMS
     //
-    for (int i = 0; i < 2; i++)
+    Int_t   DET, SM, ROW, COL;
+    Float_t MEAN, RMS;
+    pedtree->Branch("DET",&DET,"DET/I");
+    pedtree->Branch("SM",&SM,"SM/I");
+    pedtree->Branch("ROW",&ROW,"ROW/I");
+    pedtree->Branch("COL",&COL,"COL/I");
+    pedtree->Branch("MEAN",&MEAN,"MEAN/F");
+    pedtree->Branch("RMS",&RMS,"RMS/F");
+
+    for (int idet = 0; idet < 2; idet++)
     {
     {
-       for (int j = 0; j < 24; j++)
+       for (int ism = 0; ism < 24; ism++)
        {
        {
-           for (int k = 0; k < 96; k++)
+           for (int irow = 0; irow < 48; irow++)
            {
            {
-               for (int l = 0; l < 96; l++)
+               for (int icol = 0; icol < 96; icol++)
                {
                {
-
-                   Float_t mean = fPedHisto[i][j][k][l]->GetMean();
-                   Float_t rms  = fPedHisto[i][j][k][l]->GetRMS();
+                   DET  = idet;
+                   SM   = ism;
+                   ROW  = irow;
+                   COL  = icol;
+                   MEAN = fPedHisto[idet][ism][irow][icol]->GetMean();
+                   RMS  = fPedHisto[idet][ism][irow][icol]->GetRMS();
+                   pedtree->Fill();
                }
            }
        }
                }
            }
        }
index 7234657d29dba88a53a1b81ea7a374443a849414..2fc5cd6006152b131f096df77e76c9963b486755 100644 (file)
@@ -17,14 +17,14 @@ public:
   virtual ~AliPMDCalibPedestal();
 
   Bool_t ProcessEvent(AliRawReader  *rawReader);
   virtual ~AliPMDCalibPedestal();
 
   Bool_t ProcessEvent(AliRawReader  *rawReader);
-  void   Analyse();
+  void   Analyse(TTree *pedtree);
 
 private:
 
 
 private:
 
-  TH1F *fPedHisto[2][24][96][96];
+  TH1F *fPedHisto[2][24][48][96];
 
 
 
 
-  ClassDef(AliPMDCalibPedestal,1)
+  ClassDef(AliPMDCalibPedestal,2)
 };
 
 
 };