Added QA code from Hans Hjersing Dalsgaard <canute@nbi.dk>
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Feb 2008 16:38:35 +0000 (16:38 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Feb 2008 16:38:35 +0000 (16:38 +0000)
Please bug him (Cc'ed to me) in case of problems :-)

FMD/AliFMDQAChecker.cxx [new file with mode: 0644]
FMD/AliFMDQAChecker.h [new file with mode: 0644]
FMD/AliFMDQADataMakerRec.cxx [new file with mode: 0644]
FMD/AliFMDQADataMakerRec.h [new file with mode: 0644]
FMD/AliFMDQADataMakerSim.cxx [new file with mode: 0644]
FMD/AliFMDQADataMakerSim.h [new file with mode: 0644]
FMD/libFMDbase.pkg
FMD/libFMDrec.pkg
FMD/libFMDsim.pkg

diff --git a/FMD/AliFMDQAChecker.cxx b/FMD/AliFMDQAChecker.cxx
new file mode 100644 (file)
index 0000000..ad49e67
--- /dev/null
@@ -0,0 +1,51 @@
+/**************************************************************************
+ * Copyright(c) 2004, 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.                  *
+ **************************************************************************/
+//__________________________________________________________________
+//
+// Yves?
+// What 
+// is 
+// this 
+// class 
+// supposed 
+// to
+// do?
+//__________________________________________________________________
+//
+// --- ROOT system ---
+#include <TClass.h>
+#include <TH1F.h> 
+#include <TH1I.h> 
+#include <TIterator.h> 
+#include <TKey.h> 
+#include <TFile.h> 
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQA.h"
+#include "AliQAChecker.h"
+#include "AliFMDQAChecker.h"
+
+ClassImp(AliFMDQAChecker)
+#if 0
+; // This is for Emacs! - do not delete
+#endif
+
+//__________________________________________________________________
+
+//__________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/AliFMDQAChecker.h b/FMD/AliFMDQAChecker.h
new file mode 100644 (file)
index 0000000..68786ce
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef ALIFMDQACHECKER_H
+#define ALIFMDQACHECKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+
+class TFile; 
+class TH1F; 
+class TH1I; 
+
+#include "AliQACheckerBase.h"
+
+class AliFMDQAChecker : public AliQACheckerBase 
+{
+public:
+  AliFMDQAChecker() 
+    : AliQACheckerBase("FMD","FMD Quality Assurance Checker") 
+  {}          
+  virtual ~AliFMDQAChecker() {}
+
+private:
+  ClassDef(AliFMDQAChecker,0)  // Yves? what to do? 
+};
+
+#endif // AliFMDQAChecker_H
+// Local Variables:
+//  mode: c++
+// End:
diff --git a/FMD/AliFMDQADataMakerRec.cxx b/FMD/AliFMDQADataMakerRec.cxx
new file mode 100644 (file)
index 0000000..a01a29e
--- /dev/null
@@ -0,0 +1,223 @@
+/**************************************************************************
+ * Copyright(c) 2004, 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.                  *
+ **************************************************************************/
+// --- ROOT system ---
+#include <iostream>
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TH1I.h> 
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliFMDQADataMakerRec.h"
+#include "AliFMDDigit.h"
+#include "AliFMDRecPoint.h"
+#include "AliQAChecker.h"
+#include "AliESDFMD.h"
+#include "AliFMDParameters.h"
+
+//_____________________________________________________________________
+// This is the class that collects the QA data for the FMD during
+// reconstruction.  
+//
+// The following data types are picked up:
+// - digits
+// - rec points
+// - esd data
+// The following data types are not supported (yet):
+// - raws
+// Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
+//_____________________________________________________________________
+
+ClassImp(AliFMDQADataMakerRec)
+#if 0
+; // For Emacs - do not delete!
+#endif
+           
+//_____________________________________________________________________
+AliFMDQADataMakerRec::AliFMDQADataMakerRec() : 
+  AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD), 
+                   "FMD Quality Assurance Data Maker")
+{
+  // ctor
+}
+
+//_____________________________________________________________________
+AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) :
+  AliQADataMakerRec()
+{
+  //copy ctor 
+  // Parameters: 
+  //    qadm    Object to copy from
+  
+}
+
+
+//_____________________________________________________________________ 
+
+void 
+AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, 
+                                        TObjArray * list)
+{
+  // Detector specific actions at end of cycle
+  // do the QA checking
+  AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerRec","AliFMDQADataMakerRec","AliFMDQADataMakerRec::EndOfDetectorCycle","AliFMDQADataMakerRec.cxx",95);
+  AliQAChecker::Instance()->Run(AliQA::kFMD, task, list);
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerRec::InitESDs()
+{
+  // create Digits histograms in Digits subdir
+  TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3);
+  hEnergyOfESD->SetXTitle("Edep/Emip");
+  hEnergyOfESD->SetYTitle("Counts");
+  Add2ESDsList(hEnergyOfESD, 0);
+    
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerRec::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+  TH1I* hADCCounts      = new TH1I("hADCCounts","Dist of ADC counts",
+                                  1024,0,1024);
+  // TH1F* hEnergyOfDigits = new TH1F("hEnergyOfDigits", "Energy distribution",
+  // 100,0,3);
+  hADCCounts->SetXTitle("ADC counts");
+  hADCCounts->SetYTitle("");
+  // hEnergyOfDigits->SetXTitle("Edep/Emip");
+  // hEnergyOfDigits->SetYTitle("Counts");
+  Add2DigitsList(hADCCounts, 0);
+  // Add2DigitsList(hEnergyOfDigits, 1);
+  
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerRec::InitRecPoints()
+{
+  TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints",
+                                     "Energy Distribution",100,0,3);
+  hEnergyOfRecpoints->SetXTitle("Edep/Emip");
+  hEnergyOfRecpoints->SetYTitle("");
+  Add2RecPointsList(hEnergyOfRecpoints,0);
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerRec::InitRaws()
+{
+  
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+  if(!esd) {
+    AliError("FMD ESD object not found!!") ; 
+    return;
+  }
+  AliESDFMD* fmd = esd->GetFMDData();
+  if (!fmd) return;
+  
+  for(UShort_t det=1;det<=3;det++) {
+    for (UShort_t ir = 0; ir < 2; ir++) {
+      Char_t   ring = (ir == 0 ? 'I' : 'O');
+      UShort_t nsec = (ir == 0 ? 20  : 40);
+      UShort_t nstr = (ir == 0 ? 512 : 256);
+      for(UShort_t sec =0; sec < nsec;  sec++)  {
+       for(UShort_t strip = 0; strip < nstr; strip++) {
+         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+         if(mult == AliESDFMD::kInvalidMult) continue;
+         
+         GetESDsData(0)->Fill(mult);
+       }
+      }
+    }
+  }
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
+{
+  // makes data from Digits  
+  if(!digits)  {
+      AliError("FMD Digit object not found!!") ;
+      return;
+  }
+  for(Int_t i=0;i<digits->GetEntries();i++) {
+    //Raw ADC counts
+    AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
+    GetDigitsData(0)->Fill(digit->Counts());
+  }
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
+{
+  
+  TClonesArray* digits = new TClonesArray("AliFMDDigit", 1000) ; 
+  TBranch*      branch = digitTree->GetBranch("FMD") ;
+  if (!branch ) {
+    AliWarning("FMD branch in Digit Tree not found") ; 
+    return;
+  } 
+  
+  branch->SetAddress(&digits) ;
+  branch->GetEntry(0) ; 
+  MakeDigits(digits) ; 
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+  
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
+{
+  // makes data from RecPoints
+  TBranch *fmdbranch = clustersTree->GetBranch("FMD");
+  if (!fmdbranch) { 
+    AliError("can't get the branch with the FMD recpoints !");
+    return;
+  }
+  
+  TClonesArray * fmdrecpoints = new TClonesArray("AliFMDRecPoint", 1000) ;
+  fmdbranch->SetAddress(&fmdrecpoints);
+  fmdbranch->GetEntry(0);
+    
+  TIter next(fmdrecpoints) ; 
+  AliFMDRecPoint * rp ; 
+  while ((rp = static_cast<AliFMDRecPoint*>(next()))) {
+    GetRecPointsData(0)->Fill(rp->Particles()) ;
+  }
+  fmdrecpoints->Delete();
+  delete fmdrecpoints;
+
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerRec::StartOfDetectorCycle()
+{
+  // What 
+  // to 
+  // do?
+}
+//_____________________________________________________________________ 
+//
+// EOF
+//
diff --git a/FMD/AliFMDQADataMakerRec.h b/FMD/AliFMDQADataMakerRec.h
new file mode 100644 (file)
index 0000000..d1f7160
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIFMDQADATAMAKERREC_H
+#define ALIFMDQADATAMAKERREC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+#include "AliQADataMakerRec.h"
+
+class TH1F; 
+class TH1I; 
+class TList; 
+
+
+//_____________________________________________________________________
+// This class implements the AliQADataMakerRec for the FMD. Some
+// functions are not implemented yet. 
+// Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
+//_____________________________________________________________________
+
+class AliFMDQADataMakerRec: public AliQADataMakerRec {
+
+ public:
+  AliFMDQADataMakerRec();
+  AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) ;   
+  virtual ~AliFMDQADataMakerRec() {}
+  
+ private:
+  virtual void   EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list);
+  virtual void   InitESDs(); 
+  virtual void   InitDigits(); 
+  virtual void   InitRecPoints(); 
+  virtual void   InitRaws(); 
+  virtual void   MakeESDs(AliESDEvent * esd);
+  virtual void   MakeDigits(TClonesArray * digits); 
+  virtual void   MakeDigits(TTree * digitTree); 
+  virtual void   MakeRecPoints(TTree * recpoTree); 
+  virtual void   MakeRaws(AliRawReader* rawReader); 
+  virtual void   StartOfDetectorCycle(); 
+
+  ClassDef(AliFMDQADataMakerRec,0)  // description 
+
+    };
+
+#endif // AliFMDQADataMakerRec_H
+//____________________________________________________________________
+//
+// Local Variables: 
+//  mode: c++
+// End:
+//
+
diff --git a/FMD/AliFMDQADataMakerSim.cxx b/FMD/AliFMDQADataMakerSim.cxx
new file mode 100644 (file)
index 0000000..d34156a
--- /dev/null
@@ -0,0 +1,166 @@
+/**************************************************************************
+ * Copyright(c) 2004, 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.                  *
+ **************************************************************************/
+// --- ROOT system ---
+#include <iostream>
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TH1I.h> 
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliFMDQADataMakerSim.h"
+#include "AliFMDDigit.h"
+#include "AliFMDHit.h"
+#include "AliQAChecker.h"
+#include "AliFMDParameters.h"
+
+//_____________________________________________________________________
+// This is the class that collects the QA data for the FMD during simulation.
+// The following data types are picked up:
+// - hits
+// - digits
+// The following data types are not supported (yet):
+// - raws
+// - sdigits
+// Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch
+//_____________________________________________________________________
+
+ClassImp(AliFMDQADataMakerSim)
+           
+//_____________________________________________________________________
+AliFMDQADataMakerSim::AliFMDQADataMakerSim() : 
+AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD),
+                 "FMD Quality Assurance Data Maker")
+{
+  // ctor
+  
+}
+
+//_____________________________________________________________________
+AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) :
+  AliQADataMakerSim()
+{
+  //copy ctor 
+  // Parameters: 
+  //    qadm    Object to copy from
+  
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+  //Detector specific actions at end of cycle
+  // do the QA checking
+  AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerSim","AliFMDQADataMakerSim","AliFMDQADataMakerSim::EndOfDetectorCycle","AliFMDQADataMakerSim.cxx",83);
+  AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ;  
+  
+}
+
+//____________________________________________________________________ 
+void AliFMDQADataMakerSim::InitHits()
+{
+  // create Digits histograms in Digits subdir
+  TH1F* hEnergyOfHits    = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
+  hEnergyOfHits->SetXTitle("Edep");
+  hEnergyOfHits->SetYTitle("Counts");
+  Add2HitsList(hEnergyOfHits, 0);
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+  TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024);
+  //TH1F* hEnergyOfDigits    = new TH1F("hEnergyOfDigits","Energy distribution",100,0,3);
+  hADCCounts->SetXTitle("ADC counts");
+  //hADCCounts->SetYTitle("Counts");
+  //hEnergyOfDigits->SetXTitle("Edep/Emip");
+  //hEnergyOfDigits->SetYTitle("Counts");
+  Add2DigitsList(hADCCounts, 0);
+  //Add2DigitsList(hEnergyOfDigits, 1);
+  
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits)
+{
+  TIter next(hits);
+  AliFMDHit * hit;
+  while ((hit = static_cast<AliFMDHit *>(next()))) 
+    GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
+{
+  // make QA data from Hit Tree
+  
+  TBranch * branch = hitTree->GetBranch("FMD") ;
+  if (!branch) {
+    AliWarning("FMD branch in Hit Tree not found") ; 
+    return;
+  }
+
+  TClonesArray * tmp =  new TClonesArray("AliFMDHit", 10) ;
+  branch->SetAddress(&tmp) ;
+  
+  for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+    branch->GetEntry(ientry);
+    MakeHits(tmp); 
+  }    
+  tmp->Delete() ; 
+  delete tmp ; 
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits)
+{
+  // makes data from Digits
+  if(!digits) return;
+
+  for(Int_t i = 0 ; i < digits->GetEntries() ; i++) {
+    //Raw ADC counts
+    AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
+    GetDigitsData(0)->Fill(digit->Counts());
+  }
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
+{
+  
+  TClonesArray * digits = new TClonesArray("AliFMDDigit", 1000) ; 
+  
+  TBranch * branch = digitTree->GetBranch("FMD") ;
+  if (!branch)    {
+      AliWarning("FMD branch in Digit Tree not found") ; 
+      return;
+  } 
+  branch->SetAddress(&digits) ;
+  branch->GetEntry(0) ; 
+  MakeDigits(digits) ; 
+}
+
+//_____________________________________________________________________ 
+void AliFMDQADataMakerSim::StartOfDetectorCycle()
+{
+   
+}
+//_____________________________________________________________________ 
+//
+// EOF
+//
diff --git a/FMD/AliFMDQADataMakerSim.h b/FMD/AliFMDQADataMakerSim.h
new file mode 100644 (file)
index 0000000..a003f8c
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIFMDQADATAMAKERSIM_H
+#define ALIFMDQADATAMAKERSIM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+
+#include "AliQADataMakerSim.h"
+
+class TH1F ; 
+class TH1I ; 
+class TList ; 
+
+//_____________________________________________________________________
+// This class implements the AliQADataMakerSim for the FMD. Some
+// functions are not implemented yet.
+// Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
+//_____________________________________________________________________
+
+
+
+class AliFMDQADataMakerSim: public AliQADataMakerSim {
+
+ public:
+  AliFMDQADataMakerSim() ;          // ctor
+  AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) ;   
+  virtual ~AliFMDQADataMakerSim() {} // dtor
+  
+ private:
+  virtual void   EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list);
+  virtual void   InitHits(); 
+  virtual void   InitDigits(); 
+  // virtual void   InitRaws() ; 
+  // virtual void   InitSDigits() ; 
+  virtual void   MakeHits(TClonesArray* hits) ;
+  virtual void   MakeHits(TTree* hitTree) ;
+  virtual void   MakeDigits(TClonesArray* digits) ; 
+  virtual void   MakeDigits(TTree* digitTree) ; 
+  // virtual void   MakeRaws(AliRawReader* rawReader) ; 
+  // virtual void   MakeSDigits(TClonesArray * sigits) ; 
+  // virtual void   MakeSDigits(TTree * sigitTree) ; 
+  virtual void   StartOfDetectorCycle() ; 
+  
+  ClassDef(AliFMDQADataMakerSim,0)  // description 
+    };
+
+#endif // AliFMDQADataMakerSim_H
+//____________________________________________________________________
+//
+// Local Variables: 
+//  mode: c++
+// End:
+//
index 08dce15..1ac7cc2 100644 (file)
@@ -20,7 +20,8 @@ SRCS          =  AliFMDIndex.cxx              \
                   AliFMD1.cxx                  \
                   AliFMD2.cxx                  \
                   AliFMD3.cxx                  \
-                  AliFMDPreprocessor.cxx       
+                  AliFMDPreprocessor.cxx       \
+                  AliFMDQAChecker.cxx
 
 #                 AliFMDAltroIO.cxx            
 
index 9a70159..e67b1f5 100644 (file)
@@ -5,7 +5,9 @@
 SRCS           =  AliFMDReconstructor.cxx      \
                   AliFMDRawStream.cxx          \
                   AliFMDRawReader.cxx          \
-                  AliFMDRecPoint.cxx           
+                  AliFMDRecPoint.cxx           \
+                  AliFMDQADataMakerRec.cxx             
+
 HDRS           =  $(SRCS:.cxx=.h)
 DHDR           := FMDrecLinkDef.h
 EINCLUDE       := RAW
index 8b62d8c..3bf8fb7 100644 (file)
@@ -13,6 +13,7 @@ SRCS          =  AliFMD.cxx                           \
                   AliFMDSDigitizer.cxx                 \
                   AliFMDEdepMap.cxx                    \
                   AliFMDRawWriter.cxx                  \
+                  AliFMDQADataMakerSim.cxx             
 
 HDRS           =  $(SRCS:.cxx=.h) AliFMDEdepHitPair.h
 DHDR           := FMDsimLinkDef.h