Update for ACORDE-QA (Mario & Luciano)
authormrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Jun 2008 23:37:52 +0000 (23:37 +0000)
committermrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 29 Jun 2008 23:37:52 +0000 (23:37 +0000)
16 files changed:
ACORDE/ACORDEbaseLinkDef.h
ACORDE/ACORDErecLinkDef.h
ACORDE/ACORDEsimLinkDef.h
ACORDE/AliACORDEQAChecker.cxx [new file with mode: 0755]
ACORDE/AliACORDEQAChecker.h [new file with mode: 0755]
ACORDE/AliACORDEQADataMaker.cxx [new file with mode: 0755]
ACORDE/AliACORDEQADataMaker.h [new file with mode: 0755]
ACORDE/AliACORDEQADataMakerRec.cxx [new file with mode: 0755]
ACORDE/AliACORDEQADataMakerRec.h [new file with mode: 0755]
ACORDE/AliACORDEQADataMakerSim.cxx [new file with mode: 0755]
ACORDE/AliACORDEQADataMakerSim.h [new file with mode: 0755]
ACORDE/AliACORDERawReader.cxx [new file with mode: 0755]
ACORDE/AliACORDERawReader.h [new file with mode: 0755]
ACORDE/libACORDEbase.pkg
ACORDE/libACORDErec.pkg
ACORDE/libACORDEsim.pkg

index 28f0268..7d249f2 100644 (file)
@@ -16,5 +16,6 @@
 #pragma link C++ class  AliACORDEDataDCS+;
 #pragma link C++ class  AliACORDEdigit+;
 #pragma link C++ class  AliACORDERawStream+;
-
+#pragma link C++ class  AliACORDERawReader+;
+#pragma link C++ class  AliACORDEQAChecker+;
 #endif
index 7e5131f..1dbc121 100644 (file)
@@ -9,7 +9,7 @@
 #pragma link off all functions;
  
 #pragma link C++ class  AliACORDEReconstructor+;
-
+#pragma link C++ class  AliACORDEQADataMakerRec+;
  
 #endif
 
index 7fa0efe..031f0d1 100644 (file)
@@ -14,6 +14,6 @@
 #pragma link C++ class AliACORDEDigitizer+;
 #pragma link C++ class AliACORDETrigger+;
 #pragma link C++ class AliACORDERawData+;
-
+#pragma link C++ class AliACORDEQADataMakerSim+;
 
 #endif
diff --git a/ACORDE/AliACORDEQAChecker.cxx b/ACORDE/AliACORDEQAChecker.cxx
new file mode 100755 (executable)
index 0000000..ccdcfdf
--- /dev/null
@@ -0,0 +1,49 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//...
+//  Checks the quality assurance for ACORDE. 
+//  Default implementation
+//  Authors:
+//     Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP) 
+//     Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//     Arturo Fernandez <afernan@mail.cern.ch> (FCFM-BUAP)
+//...
+
+// --- ROOT system ---
+#include <TClass.h>
+#include <TH1F.h> 
+#include <TH1I.h> 
+#include <TIterator.h> 
+#include <TKey.h> 
+#include <TFile.h> 
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQA.h"
+#include "AliQAChecker.h"
+#include "AliACORDEQAChecker.h"
+
+ClassImp(AliACORDEQAChecker)
+
+//__________________________________________________________________
+AliACORDEQAChecker& AliACORDEQAChecker::operator = (const AliACORDEQAChecker& qac )
+{
+  // Equal operator.
+  this->~AliACORDEQAChecker();
+  new(this) AliACORDEQAChecker(qac);
+  return *this;
+}
diff --git a/ACORDE/AliACORDEQAChecker.h b/ACORDE/AliACORDEQAChecker.h
new file mode 100755 (executable)
index 0000000..bdc7fdc
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIACORDEQACHECKER_H
+#define ALIACORDEQACHECKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//
+//  Checks the quality assurance for ACORDE. 
+//  Default implementation
+//
+//  Authors:
+//      Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//      Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//      Arturo Fernandez <afernan@mail.cern.ch> (FCFM-BUAP)
+
+
+// --- ROOT system ---
+class TFile ; 
+class TH1F ; 
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQACheckerBase.h"
+
+class AliACORDEQAChecker: public AliQACheckerBase {
+
+public:
+  AliACORDEQAChecker() : AliQACheckerBase("ACORDE","ACORDE Quality Assurance Data Checker") {;}          // constructor
+  AliACORDEQAChecker(const AliACORDEQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // constructor   
+  AliACORDEQAChecker& operator = (const AliACORDEQAChecker& qac) ;
+  virtual ~AliACORDEQAChecker() {;} // destructor
+/*
+private:
+  virtual const Double_t Check(TObjArray * list) ;
+  virtual const Double_t Check() {return 0.;} ;
+  */
+
+  ClassDef(AliACORDEQAChecker,1)  // description 
+
+};
+
+#endif // AliACORDEQAChecker_H
diff --git a/ACORDE/AliACORDEQADataMaker.cxx b/ACORDE/AliACORDEQADataMaker.cxx
new file mode 100755 (executable)
index 0000000..db8308f
--- /dev/null
@@ -0,0 +1,368 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+
+//---
+//  Produces the data needed to calculate the quality assurance. 
+//  ACORDE QA for Hits, Digits, RAW and ESD's
+//
+//  Authors:
+//  
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h>
+#include <TH2F.h> 
+#include <TDirectory.h>
+#include <TObject.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliACORDEdigit.h" 
+#include "AliACORDEhit.h"
+#include "AliACORDERecPoint.h"
+#include "AliACORDEQADataMaker.h"
+#include "AliQAChecker.h"
+#include "AliACORDERawReader.h"
+#include "AliACORDERawStream.h"
+
+ClassImp(AliACORDEQADataMaker)
+           
+//____________________________________________________________________________ 
+AliACORDEQADataMaker::AliACORDEQADataMaker():AliQADataMaker(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
+{
+       // Acorde QA Data Maker
+}
+
+//____________________________________________________________________________ 
+AliACORDEQADataMaker::AliACORDEQADataMaker(const AliACORDEQADataMaker& qadm):AliQADataMaker() 
+{
+  SetName((const char*)qadm.GetName()) ; 
+  SetTitle((const char*)qadm.GetTitle()); 
+}
+//__________________________________________________________________
+AliACORDEQADataMaker& AliACORDEQADataMaker::operator = (const AliACORDEQADataMaker& qadm )
+{
+  // Equal operator.
+  this->~AliACORDEQADataMaker();
+  new(this) AliACORDEQADataMaker(qadm);
+  return *this;
+}
+//____________________________________________________________________________
+void AliACORDEQADataMaker::StartOfDetectorCycle()
+{
+  //Detector specific actions at start of cycle
+
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMaker::InitHits()
+{
+
+// create Hits histograms in Hits subdir
+        TH1F *fAHitsACORDE[8];
+
+        fAHitsACORDE[0] = new TH1F("hACORDEloss" ,"Energy Loss ",1000,0.,1500.);
+        fAHitsACORDE[1] = new TH1F("hACORDEPolar" ," Polar Angle ",90,0.,90.);
+        fAHitsACORDE[2] = new TH1F("hACORDEAzimuth" ,"Azimuth Angle  ",360,-180.,180.);
+        fAHitsACORDE[3] = new TH1F("hACORDEPx" ,"Px Distribution ",60,-30.,30.);
+        fAHitsACORDE[4] = new TH1F("hACORDEPy" ,"Py Distribution ",60,-30.,30.);
+        fAHitsACORDE[5] = new TH1F("hACORDEPz" ,"Pz Distribution ",60,-30.,30.);
+        fAHitsACORDE[6] = new TH1F("hACORDEPt" ,"Pt Distribution ",60,0.,50.);
+        fAHitsACORDE[7] = new TH1F("hACORDEpxpz" ,"Pt Distribution ",100,-50.,50.);
+
+        TH2F *hACORDExy = new TH2F("hACORDExy" ,"Dist. xy",2800,-2400.,1400.,200,-4805.,4825.);
+        TH2F *hACORDExz = new TH2F("hACORDExz" ,"Dist.xz ",900,-1500.,2850.,1200,-1000.,4000.);
+        TH2F *hACORDEyz = new TH2F("hACORDEyz" ,"Dist.yz ",5,817.,819.,1200,-600.,600.);
+        TH2F *hACORDEAzimPol =  new TH2F("hACORDEAzimPol" ,"Azimuth vs Polar ",360,-180.,180.,180,0.,180.);
+
+        for(Int_t i=0; i<8; i++)
+           Add2HitsList(fAHitsACORDE[i],i);
+
+         Add2HitsList(hACORDExy,8);
+         Add2HitsList(hACORDExz,9);
+         Add2HitsList(hACORDEyz,10);
+         Add2HitsList(hACORDEAzimPol,11);
+
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMaker::InitDigits()
+{
+// create Digits histograms in Digits subdir
+
+   TH1F *    fhDigitsModule;
+   TString   modulename;
+   modulename = "hDigitsModule";
+   fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
+   Add2DigitsList( fhDigitsModule,0);
+
+
+}
+
+//____________________________________________________________________________ 
+void AliACORDEQADataMaker::InitRaws()
+{
+  // create Raw histograms in Raw subdir
+TH1D *fhACORDEBitPattern[4];
+fhACORDEBitPattern[0] = new TH1D("ACORDERawDataSM","ACORDE-SingleMuon",60,1,60);//AcordeSingleMuon BitPattern
+fhACORDEBitPattern[1] = new TH1D("ACORDERawDataMM","ACORDE-MultiMuon",60,1,60);//AcordeMultiMuon BitPattern
+fhACORDEBitPattern[2] = new TH1D("ACORDERawDataSMM","ACORDE-SingleMuonMultiplicity",60,1,60);//AcordeSingleMuon Multiplicity
+fhACORDEBitPattern[3] = new TH1D("ACORDERawDataMMM","ACORDE-MultiMuonMultiplicity",60,1,60);//AcordeMultiMuon Multiplicity
+for(Int_t i=0;i<4;i++)
+{
+        Add2RawsList(fhACORDEBitPattern[i],i);
+}
+}
+
+//____________________________________________________________________________ 
+
+void AliACORDEQADataMaker::InitRecPoints()
+{
+  // create cluster histograms in RecPoint subdir
+  // Not needed for ACORDE by now !!!
+}
+//____________________________________________________________________________
+void AliACORDEQADataMaker::InitESDs()
+{
+  //create ESDs histograms in ESDs subdir
+
+   TH1F *    fhESDsSingle;
+   TH1F *    fhESDsMulti;
+
+   TString   name;
+
+   name = "hESDsSingle";
+   fhESDsSingle = new TH1F(name.Data(),"hESDsSingle",60,0,60);
+   Add2ESDsList( fhESDsSingle,0);
+
+   name = "hESDsMulti";
+   fhESDsMulti = new TH1F(name.Data(),"hESDsMulti",60,0,60);
+   Add2ESDsList( fhESDsMulti,1);
+
+
+
+}
+//____________________________________________________________________________
+
+void AliACORDEQADataMaker::MakeHits(TTree *hitTree)
+{
+
+ // Here we fill the QA histos for Hits declared above
+
+        printf("Estamos en make Hits");
+        TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
+        TBranch * branch = hitTree->GetBranch("ACORDE");
+        if (!branch)
+        {
+                AliWarning("ACORDE branch in Hit Tree not found");
+        }else
+        {
+                if (branch)
+                {
+                        branch->SetAddress(&hits);
+                }else
+                {
+                        AliError("Branch ACORDE hit not found");
+                        exit(111);
+                }
+                Int_t ntracks = (Int_t)hitTree->GetEntries();
+                if (ntracks<=0) return;
+                for(Int_t track=0;track<ntracks;track++)
+                {
+                        branch->GetEntry(track);
+                        Int_t nhits = hits->GetEntriesFast();
+                        for(Int_t ihit=0;ihit<nhits;ihit++)
+                        {
+                                AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
+                                if (!AcoHit)
+                                {
+                                        AliError("The unchecked hit doesn't exist");
+                                        break;
+                                }
+                                GetHitsData(0)->Fill(AcoHit->Eloss());
+                                GetHitsData(1)->Fill(AcoHit->PolarAngle());
+                                GetHitsData(2)->Fill(AcoHit->AzimuthAngle());
+                                GetHitsData(3)->Fill(AcoHit->Px());
+                                GetHitsData(4)->Fill(AcoHit->Py());
+                                GetHitsData(5)->Fill(AcoHit->Pz());
+                                GetHitsData(6)->Fill(TMath::Sqrt( (AcoHit->Px())*(AcoHit->Px())+
+                                             (AcoHit->Py())*(AcoHit->Py())));
+                                if((AcoHit->Py()) != 0.0 ) GetHitsData(7)->Fill(TMath::ATan(AcoHit->Px()/AcoHit->Py()));
+                                GetHitsData(8)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Y()) );
+                                GetHitsData(9)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Z()) );
+                                GetHitsData(10)->Fill( (Float_t)(AcoHit->Y()),(Float_t)(AcoHit->Z()) );
+                                GetHitsData(11)->Fill( (Float_t)(AcoHit->AzimuthAngle()),
+                                (Float_t)(AcoHit->PolarAngle()));
+                        }
+                }
+        }
+
+
+
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMaker::MakeDigits( TTree *digitsTree)
+{
+  //fills QA histos for Digits
+
+
+        TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
+        TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
+        if (!branch)
+        {
+                AliWarning("ACORDE branch in Digits Tree not found");
+        }else
+        {
+                if (branch)
+                {
+                        branch->SetAddress(&digits);
+                }else
+                {
+                        AliError("Branch ACORDE digit not found");
+                        exit(111);
+                }
+                Int_t ntracks = (Int_t)digitsTree->GetEntries();
+                if (ntracks<=0) return;
+                printf("Entries in DigitsTree:%d\n",ntracks);
+                for(Int_t track=0;track<ntracks;track++)
+                {
+                        branch->GetEntry(track);
+                        Int_t ndigits = digits->GetEntriesFast();
+                        for(Int_t idigit=0;idigit<ndigits;idigit++)
+                        {
+                                AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
+                                if (!AcoDigit)
+                                {
+                                        AliError("The unchecked digit doesn't exist");
+                                        break;
+                                }
+                                GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
+                        }
+                }
+
+
+        }
+
+
+}
+
+
+//____________________________________________________________________________
+void AliACORDEQADataMaker::MakeRaws( AliRawReader* rawReader)
+{
+
+ //fills QA histos for RAW
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  size_t contSingle=0;
+  size_t contMulti=0;
+  UInt_t dy[4];
+
+  bool kroSingle[60],kroMulti[60];
+  UInt_t tmpDy;
+
+  for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
+
+if(rawStream.Next())
+{
+        rawReader->NextEvent();
+        rawStream.Reset();
+        dy[0]=rawStream.GetWord(0);
+        dy[1]=rawStream.GetWord(1);
+        dy[2]=rawStream.GetWord(2);
+        dy[3]=rawStream.GetWord(3);
+        tmpDy=dy[0];
+        for(Int_t r=0;r<30;++r)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[1];
+        for(Int_t r=30;r<60;++r)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[2];
+        for(Int_t r=0;r<30;++r)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[3];
+        for(Int_t r=30;r<60;++r)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        contSingle=0;
+        contMulti=0;
+        for(Int_t r=0;r<60;++r)
+        {
+                if(kroSingle[r]==1)
+                {
+                        GetRawsData(0)->Fill(r+1);
+                        contSingle=contSingle+1;
+                }
+                if(kroMulti[r]==1)
+                {
+                        GetRawsData(1)->Fill(r+1);
+                        contMulti++;
+                }
+
+        }GetRawsData(2)->Fill(contSingle);GetRawsData(3)->Fill(contMulti);
+}
+
+
+
+}
+//____________________________________________________________________________
+void AliACORDEQADataMaker::MakeRecPoints(TTree * clustersTree)
+{
+  //fills QA histos for clusters
+  // Not needed for ACORDE by now!!!
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMaker::MakeESDs(AliESDEvent * esd)
+{
+  //fills QA histos for ESD
+
+        AliESDACORDE * fESDACORDE= esd->GetACORDEData();
+        Int_t *fACORDEMultiMuon =fESDACORDE->GetACORDEMultiMuon();
+        Int_t *fACORDESingleMuon=fESDACORDE->GetACORDESingleMuon();
+
+       for(int i=0;i<60;i++){
+            if(fACORDESingleMuon[i]==1)
+               GetESDsData(0) -> Fill(i);
+            if(fACORDEMultiMuon[i]==1)
+               GetESDsData(1) -> Fill(i);
+        }
+
+
+
+}
+
diff --git a/ACORDE/AliACORDEQADataMaker.h b/ACORDE/AliACORDEQADataMaker.h
new file mode 100755 (executable)
index 0000000..98e19e7
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef ALIACORDEQADATAMAKER_H
+#define ALIACORDEQADATAMAKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliACORDEQADataMaker.h 25659 2008-05-030 15:13:46Z ldg $ */
+
+
+//  Produces the data needed to calculate the quality assurance. 
+//  ACORDE QA for Hits, Digits, RAW and ESD's
+
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+
+
+
+#include "AliQADataMaker.h"
+
+class AliACORDEQADataMaker: public AliQADataMaker {
+
+public:
+  AliACORDEQADataMaker() ;          // constructor
+  AliACORDEQADataMaker(const AliACORDEQADataMaker& qadm) ;   
+  AliACORDEQADataMaker& operator = (const AliACORDEQADataMaker& qadm) ;
+  virtual ~AliACORDEQADataMaker() {;} // destructor
+
+private:
+  virtual void   InitHits() ;      //book hit QA histo 
+  virtual void   InitDigits() ;    //book Digit QA histo
+  virtual void   InitRaws() ;    //book Digit QA histo
+  virtual void   InitRecPoints();  //book cluster QA histo
+  virtual void   InitESDs() ;      //book ESD QA histo 
+  virtual void   MakeHits(TTree * hits) ;       //Fill hit QA histo
+  virtual void   MakeRaws(AliRawReader* rawReader) ;
+  virtual void   MakeDigits(TTree* digitsTree) ;   //Fill Digit QA histo
+  virtual void   MakeRecPoints(TTree * clusters)    ;  //Fill cluster QA histo
+  virtual void   MakeESDs(AliESDEvent * esd) ;         //Fill hit QA histo
+
+/*******/
+
+  virtual Int_t  Add2DigitsList(TH1*, Int_t){return 0;};
+  virtual Int_t  Add2HitsList(TH1*, Int_t){return 0;};
+  virtual Int_t  Add2RecPointsList(TH1*, Int_t){return 0;};
+  virtual Int_t  Add2RawsList(TH1*, Int_t){return 0;};
+  virtual Int_t  Add2SDigitsList(TH1*, Int_t){return 0;};
+  virtual void   Exec(AliQA::TASKINDEX_t, TObject*){};
+  virtual void   EndOfCycle(AliQA::TASKINDEX_t){};
+  virtual Int_t  Add2ESDsList(TH1*, Int_t){return 0;};
+  virtual TH1*   GetDigitsData(Int_t){return 0;};
+  virtual TH1*   GetESDsData(Int_t){return 0;};
+  virtual TH1*   GetHitsData(Int_t){return 0;};
+  virtual TH1*   GetRecPointsData(Int_t){return 0;};
+  virtual TH1*   GetRawsData(Int_t){return 0;};
+  virtual TH1*   GetSDigitsData(Int_t){return 0;};
+  virtual TObjArray* Init(AliQA::TASKINDEX_t, Int_t, Int_t){return 0;};
+  virtual void   Init(AliQA::TASKINDEX_t, TObjArray*, Int_t, Int_t){};
+  virtual void   StartOfCycle(AliQA::TASKINDEX_t, Bool_t){};
+  virtual void   EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray*){};
+  virtual void   InitSDigits(){};
+  virtual void   MakeHits(TClonesArray*){};
+  virtual void   MakeDigits(TClonesArray*){};
+  virtual void   MakeSDigits(TClonesArray*){};
+  virtual void   MakeSDigits(TTree*){};
+  virtual void   StartOfDetectorCycle() ;
+/******/
+  ClassDef(AliACORDEQADataMaker,1)  // description 
+
+};
+
+#endif // AliACORDEQADataMaker_H
diff --git a/ACORDE/AliACORDEQADataMakerRec.cxx b/ACORDE/AliACORDEQADataMakerRec.cxx
new file mode 100755 (executable)
index 0000000..55b499a
--- /dev/null
@@ -0,0 +1,214 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//---
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TDirectory.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliACORDEdigit.h" 
+#include "AliACORDEhit.h"
+#include "AliACORDEQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliACORDERawReader.h"
+#include "AliACORDERawStream.h"
+ClassImp(AliACORDEQADataMakerRec)
+           
+//____________________________________________________________________________ 
+AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
+{
+
+}
+//____________________________________________________________________________ 
+AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):AliQADataMakerRec() 
+{
+  SetName((const char*)qadm.GetName()) ; 
+  SetTitle((const char*)qadm.GetTitle()); 
+}
+//__________________________________________________________________
+AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )
+{
+  // Equal operator.
+  this->~AliACORDEQADataMakerRec();
+  new(this) AliACORDEQADataMakerRec(qadm);
+  return *this;
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
+{
+  //Detector specific actions at end of cycle
+  // do the QA checking
+  AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::StartOfDetectorCycle()
+{
+  //Detector specific actions at start of cycle
+
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMakerRec::InitRaws()
+{
+  // create Raw histograms in Raw subdir
+
+TH1D *fhACORDEBitPattern[4];
+fhACORDEBitPattern[0] = new TH1D("ACORDERawDataSM","ACORDE-SingleMuon",60,1,60);//AcordeSingleMuon BitPattern
+fhACORDEBitPattern[1] = new TH1D("ACORDERawDataMM","ACORDE-MultiMuon",60,1,60);//AcordeMultiMuon BitPattern
+fhACORDEBitPattern[2] = new TH1D("ACORDERawDataSMM","ACORDE-SingleMuonMultiplicity",60,1,60);//AcordeSingleMuon Multiplicity
+fhACORDEBitPattern[3] = new TH1D("ACORDERawDataMMM","ACORDE-MultiMuonMultiplicity",60,1,60);//AcordeMultiMuon Multiplicity
+for(Int_t i=0;i<4;i++)
+{
+       Add2RawsList(fhACORDEBitPattern[i],i);
+}
+}
+//____________________________________________________________________________ 
+
+void AliACORDEQADataMakerRec::InitRecPoints()
+{
+  // create cluster histograms in RecPoint subdir
+  // Not needed for ACORDE by now !!!
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::InitESDs()
+{
+  //create ESDs histograms in ESDs subdir
+
+   TH1F *    fhESDsSingle;
+   TH1F *    fhESDsMulti;
+
+   TString   name;
+
+   name = "hESDsSingle";
+   fhESDsSingle = new TH1F(name.Data(),"hESDsSingle",60,0,60);
+   Add2ESDsList( fhESDsSingle,0);
+
+   name = "hESDsMulti";
+   fhESDsMulti = new TH1F(name.Data(),"hESDsMulti",60,0,60);
+   Add2ESDsList( fhESDsMulti,1);
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+  //fills QA histos for RAW
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  size_t contSingle=0;
+  size_t contMulti=0;
+  UInt_t dy[4];
+
+  bool kroSingle[60],kroMulti[60];
+  UInt_t tmpDy;
+
+  for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
+
+if(rawStream.Next())
+{
+       rawReader->NextEvent();
+        rawStream.Reset();
+        dy[0]=rawStream.GetWord(0);
+        dy[1]=rawStream.GetWord(1);
+        dy[2]=rawStream.GetWord(2);
+        dy[3]=rawStream.GetWord(3);
+        tmpDy=dy[0];
+        for(Int_t r=0;r<30;++r)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[1];
+        for(Int_t r=30;r<60;++r)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[2];
+        for(Int_t r=0;r<30;++r)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[3];
+        for(Int_t r=30;r<60;++r)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        contSingle=0;
+       contMulti=0;
+        for(Int_t r=0;r<60;++r)
+        {
+                if(kroSingle[r]==1)
+                {
+                        GetRawsData(0)->Fill(r+1);
+                        contSingle=contSingle+1;
+                }
+               if(kroMulti[r]==1)
+               {
+                       GetRawsData(1)->Fill(r+1);
+                       contMulti++;
+               }
+
+        }GetRawsData(2)->Fill(contSingle);GetRawsData(3)->Fill(contMulti);
+}
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+  //fills QA histos for clusters
+  // Not needed for ACORDE by now !!!
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+  //fills QA histos for ESD
+
+        AliESDACORDE * fESDACORDE= esd->GetACORDEData();
+        Int_t *fACORDEMultiMuon =fESDACORDE->GetACORDEMultiMuon();
+        Int_t *fACORDESingleMuon=fESDACORDE->GetACORDESingleMuon();
+
+       for(int i=0;i<60;i++){
+            if(fACORDESingleMuon[i]==1)
+               GetESDsData(0) -> Fill(i);
+            if(fACORDEMultiMuon[i]==1)
+               GetESDsData(1) -> Fill(i);
+        }
+
+
+
+
+}
+
diff --git a/ACORDE/AliACORDEQADataMakerRec.h b/ACORDE/AliACORDEQADataMakerRec.h
new file mode 100755 (executable)
index 0000000..03a4f0a
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef AliACORDEQADataMakerRec_H
+#define AliACORDEQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+
+//
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+
+// --- ROOT system ---
+
+
+
+// --- Standard library ---
+// --- AliRoot header files ---
+
+#include "AliQADataMakerRec.h"
+
+class AliACORDEQADataMakerRec: public AliQADataMakerRec {
+
+public:
+  AliACORDEQADataMakerRec() ;          // constructor
+  AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm) ;   
+  AliACORDEQADataMakerRec& operator = (const AliACORDEQADataMakerRec& qadm) ;
+  virtual ~AliACORDEQADataMakerRec() {;} // destructor
+
+private:
+  virtual void   InitRaws() ;    //book Digit QA histo
+  virtual void   InitRecPoints();  //book cluster QA histo
+  virtual void   InitESDs() ;      //book ESD QA histo 
+  virtual void   MakeRaws(AliRawReader* rawReader) ;
+  virtual void   MakeRecPoints(TTree * clusters)    ;  //Fill cluster QA histo
+  virtual void   MakeESDs(AliESDEvent * esd) ;         //Fill hit QA histo
+  virtual void   EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ;
+  virtual void   StartOfDetectorCycle() ;
+  ClassDef(AliACORDEQADataMakerRec,1)  // description 
+
+};
+
+#endif // AliACORDEQADataMakerRec_H
diff --git a/ACORDE/AliACORDEQADataMakerSim.cxx b/ACORDE/AliACORDEQADataMakerSim.cxx
new file mode 100755 (executable)
index 0000000..38776b3
--- /dev/null
@@ -0,0 +1,224 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+
+//---
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TH2F.h>
+#include <TDirectory.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliACORDEdigit.h" 
+#include "AliACORDEhit.h"
+#include "AliACORDEQADataMakerSim.h"
+#include "AliQAChecker.h"
+#include "AliACORDERawReader.h"
+ClassImp(AliACORDEQADataMakerSim)
+           
+//____________________________________________________________________________ 
+AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
+{
+}
+//____________________________________________________________________________ 
+AliACORDEQADataMakerSim::AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) :
+  AliQADataMakerSim() 
+{
+  SetName((const char*)qadm.GetName()) ; 
+  SetTitle((const char*)qadm.GetTitle()); 
+}
+//__________________________________________________________________
+AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQADataMakerSim& qadm )
+{
+  // Equal operator.
+  this->~AliACORDEQADataMakerSim();
+  new(this) AliACORDEQADataMakerSim(qadm);
+  return *this;
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
+{
+  //Detector specific actions at end of cycle
+  // do the QA checking
+   printf("ACORDE---->Detector specific actions at END of cycle\n................\n");
+
+  AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerSim::StartOfDetectorCycle()
+{
+  //Detector specific actions at start of cycle
+  printf("ACORDE---->Detector specific actions at START of cycle\n................\n");
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMakerSim::InitHits()
+{
+  // create Hits histograms in Hits subdir
+        TH1F *fAHitsACORDE[8];
+
+        fAHitsACORDE[0] = new TH1F("hACORDEloss" ,"Energy Loss ",1000,0.,1500.);
+        fAHitsACORDE[1] = new TH1F("hACORDEPolar" ," Polar Angle ",90,0.,90.);
+        fAHitsACORDE[2] = new TH1F("hACORDEAzimuth" ,"Azimuth Angle  ",360,-180.,180.);
+        fAHitsACORDE[3] = new TH1F("hACORDEPx" ,"Px Distribution ",60,-30.,30.);
+        fAHitsACORDE[4] = new TH1F("hACORDEPy" ,"Py Distribution ",60,-30.,30.);
+        fAHitsACORDE[5] = new TH1F("hACORDEPz" ,"Pz Distribution ",60,-30.,30.);
+        fAHitsACORDE[6] = new TH1F("hACORDEPt" ,"Pt Distribution ",60,0.,50.);
+        fAHitsACORDE[7] = new TH1F("hACORDEpxpz" ,"Pt Distribution ",100,-50.,50.);
+
+        TH2F *hACORDExy = new TH2F("hACORDExy" ,"Dist. xy",2800,-2400.,1400.,200,-4805.,4825.);
+        TH2F *hACORDExz = new TH2F("hACORDExz" ,"Dist.xz ",900,-1500.,2850.,1200,-1000.,4000.);
+        TH2F *hACORDEyz = new TH2F("hACORDEyz" ,"Dist.yz ",5,817.,819.,1200,-600.,600.);
+        TH2F *hACORDEAzimPol =  new TH2F("hACORDEAzimPol" ,"Azimuth vs Polar ",360,-180.,180.,180,0.,180.);
+
+        for(Int_t i=0; i<8; i++)
+          Add2HitsList(fAHitsACORDE[i],i);
+         Add2HitsList(hACORDExy,8);
+        Add2HitsList(hACORDExz,9);
+        Add2HitsList(hACORDEyz,10);
+        Add2HitsList(hACORDEAzimPol,11);
+
+
+
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMakerSim::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+
+   TH1F *    fhDigitsModule;
+   TString   modulename;
+   modulename = "hDigitsModule";
+   fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
+   Add2DigitsList( fhDigitsModule,0);
+
+}
+//____________________________________________________________________________
+
+void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
+{
+  // Here we fill the QA histos for Hits declared above
+
+        printf("Estamos en make Hits");
+        TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
+        TBranch * branch = hitTree->GetBranch("ACORDE");
+        if (!branch)
+        {
+                AliWarning("ACORDE branch in Hit Tree not found");
+        }else
+        {
+                if (branch)
+                {
+                        branch->SetAddress(&hits);
+                }else
+                {
+                        AliError("Branch ACORDE hit not found");
+                        exit(111);
+                }
+                Int_t ntracks = (Int_t)hitTree->GetEntries();
+                if (ntracks<=0) return;
+                for(Int_t track=0;track<ntracks;track++)
+                {
+                        branch->GetEntry(track);
+                        Int_t nhits = hits->GetEntriesFast();
+                        for(Int_t ihit=0;ihit<nhits;ihit++)
+                        {
+                                AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
+                                if (!AcoHit)
+                                {
+                                        AliError("The unchecked hit doesn't exist");
+                                        break;
+                                }
+                                GetHitsData(0)->Fill(AcoHit->Eloss());
+                                GetHitsData(1)->Fill(AcoHit->PolarAngle());
+                                GetHitsData(2)->Fill(AcoHit->AzimuthAngle());
+                                GetHitsData(3)->Fill(AcoHit->Px());
+                                GetHitsData(4)->Fill(AcoHit->Py());
+                                GetHitsData(5)->Fill(AcoHit->Pz());
+                                GetHitsData(6)->Fill(TMath::Sqrt( (AcoHit->Px())*(AcoHit->Px())+
+                                             (AcoHit->Py())*(AcoHit->Py())));
+                               if((AcoHit->Py()) != 0.0 ) GetHitsData(7)->Fill(TMath::ATan(AcoHit->Px()/AcoHit->Py()));
+                               GetHitsData(8)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Y()) );
+                               GetHitsData(9)->Fill( (Float_t)(AcoHit->X()),(Float_t)(AcoHit->Z()) );
+                               GetHitsData(10)->Fill( (Float_t)(AcoHit->Y()),(Float_t)(AcoHit->Z()) );
+                               GetHitsData(11)->Fill( (Float_t)(AcoHit->AzimuthAngle()),
+                                (Float_t)(AcoHit->PolarAngle()));
+                        }
+                }
+        }
+
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
+{
+  //fills QA histos for Digits
+
+
+        TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
+        TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
+        if (!branch)
+        {
+                AliWarning("ACORDE branch in Digits Tree not found");
+        }else
+        {
+                if (branch)
+                {
+                        branch->SetAddress(&digits);
+                }else
+                {
+                        AliError("Branch ACORDE digit not found");
+                        exit(111);
+                }
+                Int_t ntracks = (Int_t)digitsTree->GetEntries();
+                if (ntracks<=0) return;
+                printf("Entries in DigitsTree:%d\n",ntracks);
+                for(Int_t track=0;track<ntracks;track++)
+                {
+                        branch->GetEntry(track);
+                        Int_t ndigits = digits->GetEntriesFast();
+                        for(Int_t idigit=0;idigit<ndigits;idigit++)
+                        {
+                                AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
+                                if (!AcoDigit)
+                                {
+                                        AliError("The unchecked digit doesn't exist");
+                                        break;
+                                }
+                                GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
+                        }
+                }
+
+
+        }
+
+}
diff --git a/ACORDE/AliACORDEQADataMakerSim.h b/ACORDE/AliACORDEQADataMakerSim.h
new file mode 100755 (executable)
index 0000000..a043fad
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef AliACORDEQADataMakerSim_H
+#define AliACORDEQADataMakerSim_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+
+//
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+
+
+// --- ROOT system ---
+
+
+
+// --- Standard library ---
+// --- AliRoot header files ---
+
+#include "AliQADataMakerSim.h"
+
+class AliACORDEQADataMakerSim: public AliQADataMakerSim {
+
+public:
+  AliACORDEQADataMakerSim() ;          // constructor
+  AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) ;   
+  AliACORDEQADataMakerSim& operator = (const AliACORDEQADataMakerSim& qadm) ;
+  virtual ~AliACORDEQADataMakerSim() {;} // detector
+
+private:
+  virtual void   InitHits() ;      //book hit QA histo 
+  virtual void   InitDigits() ;    //book Digit QA histo
+  virtual void   MakeHits(TTree * hits) ;       //Fill hit QA histo
+  virtual void   MakeHits(TClonesArray *) {}       //Dummy for the moment
+  virtual void   MakeDigits(TTree* digitsTree) ;   //Fill Digit QA histo
+  virtual void   MakeDigits(TClonesArray *) {}       //Dummy for the moment
+  virtual void   EndOfDetectorCycle(AliQA::TASKINDEX_t, TObjArray * list) ;
+  virtual void   StartOfDetectorCycle() ;
+  ClassDef(AliACORDEQADataMakerSim,1)  // description 
+
+};
+
+#endif // AliACORDEQADataMakerSim_H
diff --git a/ACORDE/AliACORDERawReader.cxx b/ACORDE/AliACORDERawReader.cxx
new file mode 100755 (executable)
index 0000000..98cebbd
--- /dev/null
@@ -0,0 +1,110 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+// Authors:
+//      Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>
+//      Arturo Fernandez Tellez <afernan@mail.cern.ch>
+//____________________________________________________________________
+//                                                                          
+// ACORDE 
+// Class for reading ACORDE RAW data in TOF data format
+//
+#include "AliACORDERawReader.h"
+#include "AliBitPacking.h"
+#include "TBits.h"
+
+#include <Riostream.h>
+#include "TMath.h"
+#include "TH1F.h"
+#include "TArrayI.h"
+#include "AliLog.h"
+ClassImp(AliACORDERawReader)
+  
+AliACORDERawReader::AliACORDERawReader (AliRawReader *rawReader, Bool_t isOnline):
+       TTask("ACORDERawReader","read raw ACORDE data"),
+       fRawReader(rawReader),
+       fData(NULL),
+       fPosition(0),
+       fIsOnline(isOnline)
+{
+
+       fWord[0] = fWord[1] = fWord[2] = fWord[3] = 0;
+
+
+}
+//_____________________________________________________________________________
+ AliACORDERawReader::~AliACORDERawReader ()
+{
+}
+//_____________________________________________________________________________
+Bool_t  AliACORDERawReader::Next()
+{
+
+// Read next digit from the ACORDE raw data stream;\r
+// return kFALSE in case of error or no digits left
+
+  if (fPosition >= 0) return kFALSE;
+
+  if (!fRawReader->ReadNextData(fData)) return kFALSE;
+  if (fRawReader->GetDataSize() == 0) return kFALSE;
+
+  fDataSize = fRawReader->GetDataSize();
+  if (fDataSize != 16) {
+    fRawReader->AddFatalErrorLog(kRawDataSizeErr,Form("size %d != 16",fDataSize));
+    AliWarning(Form("Wrong ACORDE raw data size: %d, expected 16 bytes!",fDataSize));
+    return kFALSE;
+  }
+
+  fPosition = 0;
+
+  for (Int_t i=0; i<4; i++)
+    fWord[i] = GetNextWord();
+
+  return kTRUE;
+
+
+}
+//_____________________________________________________________________________
+Int_t AliACORDERawReader::GetPosition()
+{
+  // Sets the position in the
+  // input stream
+  if (((fRawReader->GetDataSize() * 8) % 32) != 0)
+    AliFatal(Form("Incorrect raw data size ! %d words are found !",fRawReader->GetDataSize()));
+  return (fRawReader->GetDataSize() * 8) / 32;
+}
+//_____________________________________________________________________________
+UInt_t AliACORDERawReader::GetNextWord()
+{
+
+  // Returns the next 32 bit word inside the raw data payload.\r
+  // The method is supposed to be endian (platform) independent.
+
+
+ if (!fData || fPosition < 0)
+    AliFatal("Raw data payload buffer is not yet initialized !");
+
+  UInt_t word = 0;
+  word |= fData[fPosition++];
+  word |= fData[fPosition++] << 8;
+  word |= fData[fPosition++] << 16;
+  word |= fData[fPosition++] << 24;
+
+  return word;
+
+}
+
diff --git a/ACORDE/AliACORDERawReader.h b/ACORDE/AliACORDERawReader.h
new file mode 100755 (executable)
index 0000000..607d893
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef ALIACORDERAWREADER_H
+#define ALIACORDERAWREADER_H
+/***************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ ***************************************************************************/
+// Authors:
+//     Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>
+//     Arturo Fernandez Tellez   <afernan@mail.cern.ch>
+#include <TTask.h>
+#include "AliRawReader.h"
+
+  
+class AliACORDERawReader : public TTask {
+  public :
+
+  AliACORDERawReader(AliRawReader *rawReader,Bool_t isOnline = kFALSE) ;
+//AliACORDERawReader(AliRawReader *rawReader,Bool_t isOnline = kTRUE) ;
+
+  virtual  ~AliACORDERawReader();
+  AliACORDERawReader(const AliACORDERawReader& o): TTask(o),fRawReader(0),fData(NULL),fPosition(0),fIsOnline(kFALSE) {}
+  
+  AliACORDERawReader& operator=(const AliACORDERawReader&) { return *this; }
+
+
+  Bool_t  Next(); //read next raw digit
+  Int_t            GetPosition();
+  UInt_t         GetNextWord();
+  Int_t GetData( Int_t channel, Int_t hit) {return fAllData[channel][hit];}
+
+
+  enum EACORDERawReaderError {
+    kIncorrectDataSize = 1,
+    kWrongDRMHeader = 2,
+    kWrongDRMTrailer = 3,
+    kWrongTRMHeader = 4,
+    kWrongTRMTrailer = 5,
+    kWrongChain0Header = 6,
+    kWrongChain0Trailer = 7,
+    kWrongChain1Header = 8,
+    kWrongChain1Trailer = 9,
+    kIncorrectLUT = 10
+  };
+
+  Bool_t IsOnlineMode () {return fIsOnline;}
+     
+  protected :
+
+  AliRawReader*    fRawReader;    // object for reading the raw data
+  UChar_t*         fData;         // raw data
+  Int_t            fPosition;     // current (32 bit) position in fData
+  Bool_t           fIsOnline;     // for case online DA usage
+  UInt_t          fWord[4];      // data vector
+  Int_t           fDataSize;     // data size
+  Int_t            fAllData[110][50]; // container for raw data
+
+enum EACORDERawStreamError {
+      kRawDataSizeErr = 1
+  };
+  
+ ClassDef(AliACORDERawReader,2) //class for reading ACORDE Raw data
+};
+
+typedef AliACORDERawReader AliSTARTRawReader; // for backward compatibility
+#endif
index 4ab5df5..16b4214 100644 (file)
@@ -1,7 +1,7 @@
 #-*-Mode: Makefile-*-
 
-SRCS = AliACORDEConstants.cxx AliACORDECalibData.cxx \
-       AliGenACORDE.cxx  AliACORDELoader.cxx AliACORDEPreprocessor.cxx AliACORDEdigit.cxx AliACORDEDataDCS.cxx AliACORDERawStream.cxx 
+SRCS = AliACORDEConstants.cxx AliACORDECalibData.cxx AliACORDERawReader.cxx \
+       AliGenACORDE.cxx AliACORDEQAChecker.cxx  AliACORDELoader.cxx AliACORDEPreprocessor.cxx AliACORDEdigit.cxx AliACORDEDataDCS.cxx AliACORDERawStream.cxx 
 
 HDRS:= $(SRCS:.cxx=.h)
 
@@ -11,6 +11,6 @@ EINCLUDE := RAW
 
 ifeq (win32gcc,$(ALICE_TARGET))
 PACKSOFLAGS:= $(SOFLAGS) -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) \
-                         -lSTEER -lCDB -lSTEERBase  -lRAWDatarec -lRAWDatabase \
-#                         -L$(shell root-config --libdir) -lGeom
+                         -lSTEER -lCDB -lSTEERBase  -lRAWDatarec  -lRAWDatabase \
+#                         -L$(shell root-config --libdir) -lGeom 
 endif
index 579859d..3ee2a26 100644 (file)
@@ -1,7 +1,7 @@
 #-*-Mode: Makefile-*-
 
-SRCS = \
-       AliACORDEReconstructor.cxx
+SRCS = AliACORDEReconstructor.cxx \
+       AliACORDEQADataMakerRec.cxx
 HDRS:= $(SRCS:.cxx=.h)
 
 DHDR:=ACORDErecLinkDef.h
index 8f33d11..e37c989 100644 (file)
@@ -2,7 +2,7 @@
 
 SRCS = AliACORDE.cxx AliACORDEv1.cxx AliACORDEhit.cxx \
        AliACORDEDigitizer.cxx AliACORDETrigger.cxx \
-       AliACORDERawData.cxx 
+       AliACORDERawData.cxx AliACORDEQADataMakerSim.cxx 
 
 
 HDRS:= $(SRCS:.cxx=.h)